vue-wiring-diagram 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/vue-wiring-diagram.es.js +6440 -6398
- package/dist/vue-wiring-diagram.umd.js +35 -35
- package/package.json +1 -1
- package/packages/components/editor/index.vue +62 -114
- package/packages/components/graph-control/index.vue +0 -1
- package/packages/components/settings.js +4 -10
- package/packages/components/tools.js +196 -0
|
@@ -3,39 +3,39 @@
|
|
|
3
3
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
4
4
|
//! license : MIT
|
|
5
5
|
//! momentjs.com
|
|
6
|
-
var dh;function G(){return dh.apply(null,arguments)}function
|
|
6
|
+
var dh;function G(){return dh.apply(null,arguments)}function Qb(n){dh=n}function Ye(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function _s(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function yt(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function bl(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var t;for(t in n)if(yt(n,t))return!1;return!0}function be(n){return n===void 0}function Tn(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function hi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function fh(n,t){var e=[],s,r=n.length;for(s=0;s<r;++s)e.push(t(n[s],s));return e}function Qn(n,t){for(var e in t)yt(t,e)&&(n[e]=t[e]);return yt(t,"toString")&&(n.toString=t.toString),yt(t,"valueOf")&&(n.valueOf=t.valueOf),n}function fn(n,t,e,s){return $h(n,t,e,s,!0).utc()}function t0(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function lt(n){return n._pf==null&&(n._pf=t0()),n._pf}var wl;Array.prototype.some?wl=Array.prototype.some:wl=function(n){var t=Object(this),e=t.length>>>0,s;for(s=0;s<e;s++)if(s in t&&n.call(this,t[s],s,t))return!0;return!1};function xl(n){var t=null,e=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(t=lt(n),e=wl.call(t.parsedDateParts,function(r){return r!=null}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&e),n._strict&&(s=s&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=s;else return s;return n._isValid}function wo(n){var t=fn(NaN);return n!=null?Qn(lt(t),n):lt(t).userInvalidated=!0,t}var gh=G.momentProperties=[],vl=!1;function Cl(n,t){var e,s,r,i=gh.length;if(be(t._isAMomentObject)||(n._isAMomentObject=t._isAMomentObject),be(t._i)||(n._i=t._i),be(t._f)||(n._f=t._f),be(t._l)||(n._l=t._l),be(t._strict)||(n._strict=t._strict),be(t._tzm)||(n._tzm=t._tzm),be(t._isUTC)||(n._isUTC=t._isUTC),be(t._offset)||(n._offset=t._offset),be(t._pf)||(n._pf=lt(t)),be(t._locale)||(n._locale=t._locale),i>0)for(e=0;e<i;e++)s=gh[e],r=t[s],be(r)||(n[s]=r);return n}function di(n){Cl(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),vl===!1&&(vl=!0,G.updateOffset(this),vl=!1)}function We(n){return n instanceof di||n!=null&&n._isAMomentObject!=null}function ph(n){G.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function _e(n,t){var e=!0;return Qn(function(){if(G.deprecationHandler!=null&&G.deprecationHandler(null,n),e){var s=[],r,i,o,a=arguments.length;for(i=0;i<a;i++){if(r="",typeof arguments[i]=="object"){r+=`
|
|
7
7
|
[`+i+"] ";for(o in arguments[0])yt(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];s.push(r)}ph(n+`
|
|
8
8
|
Arguments: `+Array.prototype.slice.call(s).join("")+`
|
|
9
|
-
`+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var mh={};function yh(n,t){G.deprecationHandler!=null&&G.deprecationHandler(n,t),mh[n]||(ph(t),mh[n]=!0)}G.suppressDeprecationWarnings=!1,G.deprecationHandler=null;function gn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function t0(n){var t,e;for(e in n)yt(n,e)&&(t=n[e],gn(t)?this[e]=t:this["_"+e]=t);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function El(n,t){var e=Qn({},n),s;for(s in t)yt(t,s)&&(_s(n[s])&&_s(t[s])?(e[s]={},Qn(e[s],n[s]),Qn(e[s],t[s])):t[s]!=null?e[s]=t[s]:delete e[s]);for(s in n)yt(n,s)&&!yt(t,s)&&_s(n[s])&&(e[s]=Qn({},e[s]));return e}function Ol(n){n!=null&&this.set(n)}var Ml;Object.keys?Ml=Object.keys:Ml=function(n){var t,e=[];for(t in n)yt(n,t)&&e.push(t);return e};var e0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function n0(n,t,e){var s=this._calendar[n]||this._calendar.sameElse;return gn(s)?s.call(t,e):s}function pn(n,t,e){var s=""+Math.abs(n),r=t-s.length,i=n>=0;return(i?e?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+s}var Pl=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,xo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Al={},nr={};function Q(n,t,e,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(nr[n]=r),t&&(nr[t[0]]=function(){return pn(r.apply(this,arguments),t[1],t[2])}),e&&(nr[e]=function(){return this.localeData().ordinal(r.apply(this,arguments),n)})}function s0(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function r0(n){var t=n.match(Pl),e,s;for(e=0,s=t.length;e<s;e++)nr[t[e]]?t[e]=nr[t[e]]:t[e]=s0(t[e]);return function(r){var i="",o;for(o=0;o<s;o++)i+=gn(t[o])?t[o].call(r,n):t[o];return i}}function vo(n,t){return n.isValid()?(t=bh(t,n.localeData()),Al[t]=Al[t]||r0(t),Al[t](n)):n.localeData().invalidDate()}function bh(n,t){var e=5;function s(r){return t.longDateFormat(r)||r}for(xo.lastIndex=0;e>=0&&xo.test(n);)n=n.replace(xo,s),xo.lastIndex=0,e-=1;return n}var i0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function o0(n){var t=this._longDateFormat[n],e=this._longDateFormat[n.toUpperCase()];return t||!e?t:(this._longDateFormat[n]=e.match(Pl).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var a0="Invalid date";function l0(){return this._invalidDate}var c0="%d",u0=/\d{1,2}/;function h0(n){return this._ordinal.replace("%d",n)}var d0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function f0(n,t,e,s){var r=this._relativeTime[e];return gn(r)?r(n,t,e,s):r.replace(/%d/i,n)}function g0(n,t){var e=this._relativeTime[n>0?"future":"past"];return gn(e)?e(t):e.replace(/%s/i,t)}var wh={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ke(n){return typeof n=="string"?wh[n]||wh[n.toLowerCase()]:void 0}function Tl(n){var t={},e,s;for(s in n)yt(n,s)&&(e=ke(s),e&&(t[e]=n[s]));return t}var p0={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function m0(n){var t=[],e;for(e in n)yt(n,e)&&t.push({unit:e,priority:p0[e]});return t.sort(function(s,r){return s.priority-r.priority}),t}var xh=/\d/,Me=/\d\d/,vh=/\d{3}/,Nl=/\d{4}/,Co=/[+-]?\d{6}/,Mt=/\d\d?/,Ch=/\d\d\d\d?/,Sh=/\d\d\d\d\d\d?/,So=/\d{1,3}/,_l=/\d{1,4}/,Eo=/[+-]?\d{1,6}/,sr=/\d+/,Oo=/[+-]?\d+/,y0=/Z|[+-]\d\d:?\d\d/gi,Mo=/Z|[+-]\d\d(?::?\d\d)?/gi,b0=/[+-]?\d+(\.\d{1,3})?/,fi=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,rr=/^[1-9]\d?/,kl=/^([1-9]\d|\d)/,Po;Po={};function q(n,t,e){Po[n]=gn(t)?t:function(s,r){return s&&e?e:t}}function w0(n,t){return yt(Po,n)?Po[n](t._strict,t._locale):new RegExp(x0(n))}function x0(n){return Nn(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,s,r,i){return e||s||r||i}))}function Nn(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function De(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function dt(n){var t=+n,e=0;return t!==0&&isFinite(t)&&(e=De(t)),e}var Dl={};function Ct(n,t){var e,s=t,r;for(typeof n=="string"&&(n=[n]),Tn(t)&&(s=function(i,o){o[t]=dt(i)}),r=n.length,e=0;e<r;e++)Dl[n[e]]=s}function gi(n,t){Ct(n,function(e,s,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function v0(n,t,e){t!=null&&yt(Dl,n)&&Dl[n](t,e._a,e,n)}function Ao(n){return n%4===0&&n%100!==0||n%400===0}var ce=0,_n=1,mn=2,Xt=3,qe=4,kn=5,ks=6,C0=7,S0=8;Q("Y",0,0,function(){var n=this.year();return n<=9999?pn(n,4):"+"+n}),Q(0,["YY",2],0,function(){return this.year()%100}),Q(0,["YYYY",4],0,"year"),Q(0,["YYYYY",5],0,"year"),Q(0,["YYYYYY",6,!0],0,"year"),q("Y",Oo),q("YY",Mt,Me),q("YYYY",_l,Nl),q("YYYYY",Eo,Co),q("YYYYYY",Eo,Co),Ct(["YYYYY","YYYYYY"],ce),Ct("YYYY",function(n,t){t[ce]=n.length===2?G.parseTwoDigitYear(n):dt(n)}),Ct("YY",function(n,t){t[ce]=G.parseTwoDigitYear(n)}),Ct("Y",function(n,t){t[ce]=parseInt(n,10)});function pi(n){return Ao(n)?366:365}G.parseTwoDigitYear=function(n){return dt(n)+(dt(n)>68?1900:2e3)};var Eh=ir("FullYear",!0);function E0(){return Ao(this.year())}function ir(n,t){return function(e){return e!=null?(Oh(this,n,e),G.updateOffset(this,t),this):mi(this,n)}}function mi(n,t){if(!n.isValid())return NaN;var e=n._d,s=n._isUTC;switch(t){case"Milliseconds":return s?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return s?e.getUTCSeconds():e.getSeconds();case"Minutes":return s?e.getUTCMinutes():e.getMinutes();case"Hours":return s?e.getUTCHours():e.getHours();case"Date":return s?e.getUTCDate():e.getDate();case"Day":return s?e.getUTCDay():e.getDay();case"Month":return s?e.getUTCMonth():e.getMonth();case"FullYear":return s?e.getUTCFullYear():e.getFullYear();default:return NaN}}function Oh(n,t,e){var s,r,i,o,a;if(!(!n.isValid()||isNaN(e))){switch(s=n._d,r=n._isUTC,t){case"Milliseconds":return void(r?s.setUTCMilliseconds(e):s.setMilliseconds(e));case"Seconds":return void(r?s.setUTCSeconds(e):s.setSeconds(e));case"Minutes":return void(r?s.setUTCMinutes(e):s.setMinutes(e));case"Hours":return void(r?s.setUTCHours(e):s.setHours(e));case"Date":return void(r?s.setUTCDate(e):s.setDate(e));case"FullYear":break;default:return}i=e,o=n.month(),a=n.date(),a=a===29&&o===1&&!Ao(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function O0(n){return n=ke(n),gn(this[n])?this[n]():this}function M0(n,t){if(typeof n=="object"){n=Tl(n);var e=m0(n),s,r=e.length;for(s=0;s<r;s++)this[e[s].unit](n[e[s].unit])}else if(n=ke(n),gn(this[n]))return this[n](t);return this}function P0(n,t){return(n%t+t)%t}var $t;Array.prototype.indexOf?$t=Array.prototype.indexOf:$t=function(n){var t;for(t=0;t<this.length;++t)if(this[t]===n)return t;return-1};function Rl(n,t){if(isNaN(n)||isNaN(t))return NaN;var e=P0(t,12);return n+=(t-e)/12,e===1?Ao(n)?29:28:31-e%7%2}Q("M",["MM",2],"Mo",function(){return this.month()+1}),Q("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),Q("MMMM",0,0,function(n){return this.localeData().months(this,n)}),q("M",Mt,rr),q("MM",Mt,Me),q("MMM",function(n,t){return t.monthsShortRegex(n)}),q("MMMM",function(n,t){return t.monthsRegex(n)}),Ct(["M","MM"],function(n,t){t[_n]=dt(n)-1}),Ct(["MMM","MMMM"],function(n,t,e,s){var r=e._locale.monthsParse(n,s,e._strict);r!=null?t[_n]=r:lt(e).invalidMonth=n});var A0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Mh="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ph=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,T0=fi,N0=fi;function _0(n,t){return n?Ye(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Ph).test(t)?"format":"standalone"][n.month()]:Ye(this._months)?this._months:this._months.standalone}function k0(n,t){return n?Ye(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Ph.test(t)?"format":"standalone"][n.month()]:Ye(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function D0(n,t,e){var s,r,i,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)i=fn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return e?t==="MMM"?(r=$t.call(this._shortMonthsParse,o),r!==-1?r:null):(r=$t.call(this._longMonthsParse,o),r!==-1?r:null):t==="MMM"?(r=$t.call(this._shortMonthsParse,o),r!==-1?r:(r=$t.call(this._longMonthsParse,o),r!==-1?r:null)):(r=$t.call(this._longMonthsParse,o),r!==-1?r:(r=$t.call(this._shortMonthsParse,o),r!==-1?r:null))}function R0(n,t,e){var s,r,i;if(this._monthsParseExact)return D0.call(this,n,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=fn([2e3,s]),e&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!e&&!this._monthsParse[s]&&(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[s].test(n))return s;if(e&&t==="MMM"&&this._shortMonthsParse[s].test(n))return s;if(!e&&this._monthsParse[s].test(n))return s}}function Ah(n,t){if(!n.isValid())return n;if(typeof t=="string"){if(/^\d+$/.test(t))t=dt(t);else if(t=n.localeData().monthsParse(t),!Tn(t))return n}var e=t,s=n.date();return s=s<29?s:Math.min(s,Rl(n.year(),e)),n._isUTC?n._d.setUTCMonth(e,s):n._d.setMonth(e,s),n}function Th(n){return n!=null?(Ah(this,n),G.updateOffset(this,!0),this):mi(this,"Month")}function I0(){return Rl(this.year(),this.month())}function L0(n){return this._monthsParseExact?(yt(this,"_monthsRegex")||Nh.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(yt(this,"_monthsShortRegex")||(this._monthsShortRegex=T0),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function B0(n){return this._monthsParseExact?(yt(this,"_monthsRegex")||Nh.call(this),n?this._monthsStrictRegex:this._monthsRegex):(yt(this,"_monthsRegex")||(this._monthsRegex=N0),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Nh(){function n(l,u){return u.length-l.length}var t=[],e=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=fn([2e3,r]),o=Nn(this.monthsShort(i,"")),a=Nn(this.months(i,"")),t.push(o),e.push(a),s.push(a),s.push(o);t.sort(n),e.sort(n),s.sort(n),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function V0(n,t,e,s,r,i,o){var a;return n<100&&n>=0?(a=new Date(n+400,t,e,s,r,i,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,t,e,s,r,i,o),a}function yi(n){var t,e;return n<100&&n>=0?(e=Array.prototype.slice.call(arguments),e[0]=n+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(n)):t=new Date(Date.UTC.apply(null,arguments)),t}function To(n,t,e){var s=7+t-e,r=(7+yi(n,0,s).getUTCDay()-t)%7;return-r+s-1}function _h(n,t,e,s,r){var i=(7+e-s)%7,o=To(n,s,r),a=1+7*(t-1)+i+o,l,u;return a<=0?(l=n-1,u=pi(l)+a):a>pi(n)?(l=n+1,u=a-pi(n)):(l=n,u=a),{year:l,dayOfYear:u}}function bi(n,t,e){var s=To(n.year(),t,e),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+Dn(o,t,e)):r>Dn(n.year(),t,e)?(i=r-Dn(n.year(),t,e),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function Dn(n,t,e){var s=To(n,t,e),r=To(n+1,t,e);return(pi(n)-s+r)/7}Q("w",["ww",2],"wo","week"),Q("W",["WW",2],"Wo","isoWeek"),q("w",Mt,rr),q("ww",Mt,Me),q("W",Mt,rr),q("WW",Mt,Me),gi(["w","ww","W","WW"],function(n,t,e,s){t[s.substr(0,1)]=dt(n)});function j0(n){return bi(n,this._week.dow,this._week.doy).week}var $0={dow:0,doy:6};function z0(){return this._week.dow}function F0(){return this._week.doy}function H0(n){var t=this.localeData().week(this);return n==null?t:this.add((n-t)*7,"d")}function U0(n){var t=bi(this,1,4).week;return n==null?t:this.add((n-t)*7,"d")}Q("d",0,"do","day"),Q("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),Q("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),Q("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),Q("e",0,0,"weekday"),Q("E",0,0,"isoWeekday"),q("d",Mt),q("e",Mt),q("E",Mt),q("dd",function(n,t){return t.weekdaysMinRegex(n)}),q("ddd",function(n,t){return t.weekdaysShortRegex(n)}),q("dddd",function(n,t){return t.weekdaysRegex(n)}),gi(["dd","ddd","dddd"],function(n,t,e,s){var r=e._locale.weekdaysParse(n,s,e._strict);r!=null?t.d=r:lt(e).invalidWeekday=n}),gi(["d","e","E"],function(n,t,e,s){t[s]=dt(n)});function G0(n,t){return typeof n!="string"?n:isNaN(n)?(n=t.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function Y0(n,t){return typeof n=="string"?t.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Il(n,t){return n.slice(t,7).concat(n.slice(0,t))}var W0="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),kh="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),q0="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),J0=fi,X0=fi,K0=fi;function Z0(n,t){var e=Ye(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return n===!0?Il(e,this._week.dow):n?e[n.day()]:e}function Q0(n){return n===!0?Il(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function tw(n){return n===!0?Il(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function ew(n,t,e){var s,r,i,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=fn([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(i,"").toLocaleLowerCase();return e?t==="dddd"?(r=$t.call(this._weekdaysParse,o),r!==-1?r:null):t==="ddd"?(r=$t.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=$t.call(this._minWeekdaysParse,o),r!==-1?r:null):t==="dddd"?(r=$t.call(this._weekdaysParse,o),r!==-1||(r=$t.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=$t.call(this._minWeekdaysParse,o),r!==-1?r:null)):t==="ddd"?(r=$t.call(this._shortWeekdaysParse,o),r!==-1||(r=$t.call(this._weekdaysParse,o),r!==-1)?r:(r=$t.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=$t.call(this._minWeekdaysParse,o),r!==-1||(r=$t.call(this._weekdaysParse,o),r!==-1)?r:(r=$t.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function nw(n,t,e){var s,r,i;if(this._weekdaysParseExact)return ew.call(this,n,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=fn([2e3,1]).day(s),e&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[s].test(n))return s;if(e&&t==="ddd"&&this._shortWeekdaysParse[s].test(n))return s;if(e&&t==="dd"&&this._minWeekdaysParse[s].test(n))return s;if(!e&&this._weekdaysParse[s].test(n))return s}}function sw(n){if(!this.isValid())return n!=null?this:NaN;var t=mi(this,"Day");return n!=null?(n=G0(n,this.localeData()),this.add(n-t,"d")):t}function rw(n){if(!this.isValid())return n!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return n==null?t:this.add(n-t,"d")}function iw(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var t=Y0(n,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ow(n){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||Ll.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(yt(this,"_weekdaysRegex")||(this._weekdaysRegex=J0),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function aw(n){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||Ll.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(yt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=X0),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function lw(n){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||Ll.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(yt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=K0),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ll(){function n(h,f){return f.length-h.length}var t=[],e=[],s=[],r=[],i,o,a,l,u;for(i=0;i<7;i++)o=fn([2e3,1]).day(i),a=Nn(this.weekdaysMin(o,"")),l=Nn(this.weekdaysShort(o,"")),u=Nn(this.weekdays(o,"")),t.push(a),e.push(l),s.push(u),r.push(a),r.push(l),r.push(u);t.sort(n),e.sort(n),s.sort(n),r.sort(n),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Bl(){return this.hours()%12||12}function cw(){return this.hours()||24}Q("H",["HH",2],0,"hour"),Q("h",["hh",2],0,Bl),Q("k",["kk",2],0,cw),Q("hmm",0,0,function(){return""+Bl.apply(this)+pn(this.minutes(),2)}),Q("hmmss",0,0,function(){return""+Bl.apply(this)+pn(this.minutes(),2)+pn(this.seconds(),2)}),Q("Hmm",0,0,function(){return""+this.hours()+pn(this.minutes(),2)}),Q("Hmmss",0,0,function(){return""+this.hours()+pn(this.minutes(),2)+pn(this.seconds(),2)});function Dh(n,t){Q(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Dh("a",!0),Dh("A",!1);function Rh(n,t){return t._meridiemParse}q("a",Rh),q("A",Rh),q("H",Mt,kl),q("h",Mt,rr),q("k",Mt,rr),q("HH",Mt,Me),q("hh",Mt,Me),q("kk",Mt,Me),q("hmm",Ch),q("hmmss",Sh),q("Hmm",Ch),q("Hmmss",Sh),Ct(["H","HH"],Xt),Ct(["k","kk"],function(n,t,e){var s=dt(n);t[Xt]=s===24?0:s}),Ct(["a","A"],function(n,t,e){e._isPm=e._locale.isPM(n),e._meridiem=n}),Ct(["h","hh"],function(n,t,e){t[Xt]=dt(n),lt(e).bigHour=!0}),Ct("hmm",function(n,t,e){var s=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s)),lt(e).bigHour=!0}),Ct("hmmss",function(n,t,e){var s=n.length-4,r=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s,2)),t[kn]=dt(n.substr(r)),lt(e).bigHour=!0}),Ct("Hmm",function(n,t,e){var s=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s))}),Ct("Hmmss",function(n,t,e){var s=n.length-4,r=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s,2)),t[kn]=dt(n.substr(r))});function uw(n){return(n+"").toLowerCase().charAt(0)==="p"}var hw=/[ap]\.?m?\.?/i,dw=ir("Hours",!0);function fw(n,t,e){return n>11?e?"pm":"PM":e?"am":"AM"}var Ih={calendar:e0,longDateFormat:i0,invalidDate:a0,ordinal:c0,dayOfMonthOrdinalParse:u0,relativeTime:d0,months:A0,monthsShort:Mh,week:$0,weekdays:W0,weekdaysMin:q0,weekdaysShort:kh,meridiemParse:hw},kt={},wi={},xi;function gw(n,t){var e,s=Math.min(n.length,t.length);for(e=0;e<s;e+=1)if(n[e]!==t[e])return e;return s}function Lh(n){return n&&n.toLowerCase().replace("_","-")}function pw(n){for(var t=0,e,s,r,i;t<n.length;){for(i=Lh(n[t]).split("-"),e=i.length,s=Lh(n[t+1]),s=s?s.split("-"):null;e>0;){if(r=No(i.slice(0,e).join("-")),r)return r;if(s&&s.length>=e&&gw(i,s)>=e-1)break;e--}t++}return xi}function mw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function No(n){var t=null,e;if(kt[n]===void 0&&typeof module<"u"&&module&&module.exports&&mw(n))try{t=xi._abbr,e=require,e("./locale/"+n),ts(t)}catch{kt[n]=null}return kt[n]}function ts(n,t){var e;return n&&(be(t)?e=Rn(n):e=Vl(n,t),e?xi=e:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),xi._abbr}function Vl(n,t){if(t!==null){var e,s=Ih;if(t.abbr=n,kt[n]!=null)yh("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=kt[n]._config;else if(t.parentLocale!=null)if(kt[t.parentLocale]!=null)s=kt[t.parentLocale]._config;else if(e=No(t.parentLocale),e!=null)s=e._config;else return wi[t.parentLocale]||(wi[t.parentLocale]=[]),wi[t.parentLocale].push({name:n,config:t}),null;return kt[n]=new Ol(El(s,t)),wi[n]&&wi[n].forEach(function(r){Vl(r.name,r.config)}),ts(n),kt[n]}else return delete kt[n],null}function yw(n,t){if(t!=null){var e,s,r=Ih;kt[n]!=null&&kt[n].parentLocale!=null?kt[n].set(El(kt[n]._config,t)):(s=No(n),s!=null&&(r=s._config),t=El(r,t),s==null&&(t.abbr=n),e=new Ol(t),e.parentLocale=kt[n],kt[n]=e),ts(n)}else kt[n]!=null&&(kt[n].parentLocale!=null?(kt[n]=kt[n].parentLocale,n===ts()&&ts(n)):kt[n]!=null&&delete kt[n]);return kt[n]}function Rn(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return xi;if(!Ye(n)){if(t=No(n),t)return t;n=[n]}return pw(n)}function bw(){return Ml(kt)}function jl(n){var t,e=n._a;return e&<(n).overflow===-2&&(t=e[_n]<0||e[_n]>11?_n:e[mn]<1||e[mn]>Rl(e[ce],e[_n])?mn:e[Xt]<0||e[Xt]>24||e[Xt]===24&&(e[qe]!==0||e[kn]!==0||e[ks]!==0)?Xt:e[qe]<0||e[qe]>59?qe:e[kn]<0||e[kn]>59?kn:e[ks]<0||e[ks]>999?ks:-1,lt(n)._overflowDayOfYear&&(t<ce||t>mn)&&(t=mn),lt(n)._overflowWeeks&&t===-1&&(t=C0),lt(n)._overflowWeekday&&t===-1&&(t=S0),lt(n).overflow=t),n}var ww=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vw=/Z|[+-]\d\d(?::?\d\d)?/,_o=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],$l=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cw=/^\/?Date\((-?\d+)/i,Sw=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ew={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Bh(n){var t,e,s=n._i,r=ww.exec(s)||xw.exec(s),i,o,a,l,u=_o.length,h=$l.length;if(r){for(lt(n).iso=!0,t=0,e=u;t<e;t++)if(_o[t][1].exec(r[1])){o=_o[t][0],i=_o[t][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(t=0,e=h;t<e;t++)if($l[t][1].exec(r[3])){a=(r[2]||" ")+$l[t][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(vw.exec(r[4]))l="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(l||""),Fl(n)}else n._isValid=!1}function Ow(n,t,e,s,r,i){var o=[Mw(n),Mh.indexOf(t),parseInt(e,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Mw(n){var t=parseInt(n,10);return t<=49?2e3+t:t<=999?1900+t:t}function Pw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Aw(n,t,e){if(n){var s=kh.indexOf(n),r=new Date(t[0],t[1],t[2]).getDay();if(s!==r)return lt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function Tw(n,t,e){if(n)return Ew[n];if(t)return 0;var s=parseInt(e,10),r=s%100,i=(s-r)/100;return i*60+r}function Vh(n){var t=Sw.exec(Pw(n._i)),e;if(t){if(e=Ow(t[4],t[3],t[2],t[5],t[6],t[7]),!Aw(t[1],e,n))return;n._a=e,n._tzm=Tw(t[8],t[9],t[10]),n._d=yi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),lt(n).rfc2822=!0}else n._isValid=!1}function Nw(n){var t=Cw.exec(n._i);if(t!==null){n._d=new Date(+t[1]);return}if(Bh(n),n._isValid===!1)delete n._isValid;else return;if(Vh(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:G.createFromInputFallback(n)}G.createFromInputFallback=_e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function or(n,t,e){return n??t??e}function _w(n){var t=new Date(G.now());return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function zl(n){var t,e,s=[],r,i,o;if(!n._d){for(r=_w(n),n._w&&n._a[mn]==null&&n._a[_n]==null&&kw(n),n._dayOfYear!=null&&(o=or(n._a[ce],r[ce]),(n._dayOfYear>pi(o)||n._dayOfYear===0)&&(lt(n)._overflowDayOfYear=!0),e=yi(o,0,n._dayOfYear),n._a[_n]=e.getUTCMonth(),n._a[mn]=e.getUTCDate()),t=0;t<3&&n._a[t]==null;++t)n._a[t]=s[t]=r[t];for(;t<7;t++)n._a[t]=s[t]=n._a[t]==null?t===2?1:0:n._a[t];n._a[Xt]===24&&n._a[qe]===0&&n._a[kn]===0&&n._a[ks]===0&&(n._nextDay=!0,n._a[Xt]=0),n._d=(n._useUTC?yi:V0).apply(null,s),i=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[Xt]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(lt(n).weekdayMismatch=!0)}}function kw(n){var t,e,s,r,i,o,a,l,u;t=n._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,o=4,e=or(t.GG,n._a[ce],bi(Pt(),1,4).year),s=or(t.W,1),r=or(t.E,1),(r<1||r>7)&&(l=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=bi(Pt(),i,o),e=or(t.gg,n._a[ce],u.year),s=or(t.w,u.week),t.d!=null?(r=t.d,(r<0||r>6)&&(l=!0)):t.e!=null?(r=t.e+i,(t.e<0||t.e>6)&&(l=!0)):r=i),s<1||s>Dn(e,i,o)?lt(n)._overflowWeeks=!0:l!=null?lt(n)._overflowWeekday=!0:(a=_h(e,s,r,i,o),n._a[ce]=a.year,n._dayOfYear=a.dayOfYear)}G.ISO_8601=function(){},G.RFC_2822=function(){};function Fl(n){if(n._f===G.ISO_8601){Bh(n);return}if(n._f===G.RFC_2822){Vh(n);return}n._a=[],lt(n).empty=!0;var t=""+n._i,e,s,r,i,o,a=t.length,l=0,u,h;for(r=bh(n._f,n._locale).match(Pl)||[],h=r.length,e=0;e<h;e++)i=r[e],s=(t.match(w0(i,n))||[])[0],s&&(o=t.substr(0,t.indexOf(s)),o.length>0&<(n).unusedInput.push(o),t=t.slice(t.indexOf(s)+s.length),l+=s.length),nr[i]?(s?lt(n).empty=!1:lt(n).unusedTokens.push(i),v0(i,s,n)):n._strict&&!s&<(n).unusedTokens.push(i);lt(n).charsLeftOver=a-l,t.length>0&<(n).unusedInput.push(t),n._a[Xt]<=12&<(n).bigHour===!0&&n._a[Xt]>0&&(lt(n).bigHour=void 0),lt(n).parsedDateParts=n._a.slice(0),lt(n).meridiem=n._meridiem,n._a[Xt]=Dw(n._locale,n._a[Xt],n._meridiem),u=lt(n).era,u!==null&&(n._a[ce]=n._locale.erasConvertYear(u,n._a[ce])),zl(n),jl(n)}function Dw(n,t,e){var s;return e==null?t:n.meridiemHour!=null?n.meridiemHour(t,e):(n.isPM!=null&&(s=n.isPM(e),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function Rw(n){var t,e,s,r,i,o,a=!1,l=n._f.length;if(l===0){lt(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<l;r++)i=0,o=!1,t=Sl({},n),n._useUTC!=null&&(t._useUTC=n._useUTC),t._f=n._f[r],Fl(t),vl(t)&&(o=!0),i+=lt(t).charsLeftOver,i+=lt(t).unusedTokens.length*10,lt(t).score=i,a?i<s&&(s=i,e=t):(s==null||i<s||o)&&(s=i,e=t,o&&(a=!0));Qn(n,e||t)}function Iw(n){if(!n._d){var t=Tl(n._i),e=t.day===void 0?t.date:t.day;n._a=fh([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),zl(n)}}function Lw(n){var t=new di(jl(jh(n)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function jh(n){var t=n._i,e=n._f;return n._locale=n._locale||Rn(n._l),t===null||e===void 0&&t===""?wo({nullInput:!0}):(typeof t=="string"&&(n._i=t=n._locale.preparse(t)),We(t)?new di(jl(t)):(hi(t)?n._d=t:Ye(e)?Rw(n):e?Fl(n):Bw(n),vl(n)||(n._d=null),n))}function Bw(n){var t=n._i;be(t)?n._d=new Date(G.now()):hi(t)?n._d=new Date(t.valueOf()):typeof t=="string"?Nw(n):Ye(t)?(n._a=fh(t.slice(0),function(e){return parseInt(e,10)}),zl(n)):_s(t)?Iw(n):Tn(t)?n._d=new Date(t):G.createFromInputFallback(n)}function $h(n,t,e,s,r){var i={};return(t===!0||t===!1)&&(s=t,t=void 0),(e===!0||e===!1)&&(s=e,e=void 0),(_s(n)&&wl(n)||Ye(n)&&n.length===0)&&(n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=e,i._i=n,i._f=t,i._strict=s,Lw(i)}function Pt(n,t,e,s){return $h(n,t,e,s,!1)}var Vw=_e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Pt.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:wo()}),jw=_e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Pt.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:wo()});function zh(n,t){var e,s;if(t.length===1&&Ye(t[0])&&(t=t[0]),!t.length)return Pt();for(e=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][n](e))&&(e=t[s]);return e}function $w(){var n=[].slice.call(arguments,0);return zh("isBefore",n)}function zw(){var n=[].slice.call(arguments,0);return zh("isAfter",n)}var Fw=function(){return Date.now?Date.now():+new Date},vi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Hw(n){var t,e=!1,s,r=vi.length;for(t in n)if(yt(n,t)&&!($t.call(vi,t)!==-1&&(n[t]==null||!isNaN(n[t]))))return!1;for(s=0;s<r;++s)if(n[vi[s]]){if(e)return!1;parseFloat(n[vi[s]])!==dt(n[vi[s]])&&(e=!0)}return!0}function Uw(){return this._isValid}function Gw(){return Je(NaN)}function ko(n){var t=Tl(n),e=t.year||0,s=t.quarter||0,r=t.month||0,i=t.week||t.isoWeek||0,o=t.day||0,a=t.hour||0,l=t.minute||0,u=t.second||0,h=t.millisecond||0;this._isValid=Hw(t),this._milliseconds=+h+u*1e3+l*6e4+a*1e3*60*60,this._days=+o+i*7,this._months=+r+s*3+e*12,this._data={},this._locale=Rn(),this._bubble()}function Do(n){return n instanceof ko}function Hl(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function Yw(n,t,e){var s=Math.min(n.length,t.length),r=Math.abs(n.length-t.length),i=0,o;for(o=0;o<s;o++)dt(n[o])!==dt(t[o])&&i++;return i+r}function Fh(n,t){Q(n,0,0,function(){var e=this.utcOffset(),s="+";return e<0&&(e=-e,s="-"),s+pn(~~(e/60),2)+t+pn(~~e%60,2)})}Fh("Z",":"),Fh("ZZ",""),q("Z",Mo),q("ZZ",Mo),Ct(["Z","ZZ"],function(n,t,e){e._useUTC=!0,e._tzm=Ul(Mo,n)});var Ww=/([\+\-]|\d\d)/gi;function Ul(n,t){var e=(t||"").match(n),s,r,i;return e===null?null:(s=e[e.length-1]||[],r=(s+"").match(Ww)||["-",0,0],i=+(r[1]*60)+dt(r[2]),i===0?0:r[0]==="+"?i:-i)}function Gl(n,t){var e,s;return t._isUTC?(e=t.clone(),s=(We(n)||hi(n)?n.valueOf():Pt(n).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+s),G.updateOffset(e,!1),e):Pt(n).local()}function Yl(n){return-Math.round(n._d.getTimezoneOffset())}G.updateOffset=function(){};function qw(n,t,e){var s=this._offset||0,r;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=Ul(Mo,n),n===null)return this}else Math.abs(n)<16&&!e&&(n=n*60);return!this._isUTC&&t&&(r=Yl(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!t||this._changeInProgress?Yh(this,Je(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,G.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Yl(this)}function Jw(n,t){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}function Xw(n){return this.utcOffset(0,n)}function Kw(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(Yl(this),"m")),this}function Zw(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=Ul(y0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Qw(n){return this.isValid()?(n=n?Pt(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function tx(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ex(){if(!be(this._isDSTShifted))return this._isDSTShifted;var n={},t;return Sl(n,this),n=jh(n),n._a?(t=n._isUTC?fn(n._a):Pt(n._a),this._isDSTShifted=this.isValid()&&Yw(n._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function nx(){return this.isValid()?!this._isUTC:!1}function sx(){return this.isValid()?this._isUTC:!1}function Hh(){return this.isValid()?this._isUTC&&this._offset===0:!1}var rx=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ix=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Je(n,t){var e=n,s=null,r,i,o;return Do(n)?e={ms:n._milliseconds,d:n._days,M:n._months}:Tn(n)||!isNaN(+n)?(e={},t?e[t]=+n:e.milliseconds=+n):(s=rx.exec(n))?(r=s[1]==="-"?-1:1,e={y:0,d:dt(s[mn])*r,h:dt(s[Xt])*r,m:dt(s[qe])*r,s:dt(s[kn])*r,ms:dt(Hl(s[ks]*1e3))*r}):(s=ix.exec(n))?(r=s[1]==="-"?-1:1,e={y:Ds(s[2],r),M:Ds(s[3],r),w:Ds(s[4],r),d:Ds(s[5],r),h:Ds(s[6],r),m:Ds(s[7],r),s:Ds(s[8],r)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(o=ox(Pt(e.from),Pt(e.to)),e={},e.ms=o.milliseconds,e.M=o.months),i=new ko(e),Do(n)&&yt(n,"_locale")&&(i._locale=n._locale),Do(n)&&yt(n,"_isValid")&&(i._isValid=n._isValid),i}Je.fn=ko.prototype,Je.invalid=Gw;function Ds(n,t){var e=n&&parseFloat(n.replace(",","."));return(isNaN(e)?0:e)*t}function Uh(n,t){var e={};return e.months=t.month()-n.month()+(t.year()-n.year())*12,n.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+n.clone().add(e.months,"M"),e}function ox(n,t){var e;return n.isValid()&&t.isValid()?(t=Gl(t,n),n.isBefore(t)?e=Uh(n,t):(e=Uh(t,n),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function Gh(n,t){return function(e,s){var r,i;return s!==null&&!isNaN(+s)&&(yh(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=e,e=s,s=i),r=Je(e,s),Yh(this,r,n),this}}function Yh(n,t,e,s){var r=t._milliseconds,i=Hl(t._days),o=Hl(t._months);n.isValid()&&(s=s??!0,o&&Ah(n,mi(n,"Month")+o*e),i&&Oh(n,"Date",mi(n,"Date")+i*e),r&&n._d.setTime(n._d.valueOf()+r*e),s&&G.updateOffset(n,i||o))}var ax=Gh(1,"add"),lx=Gh(-1,"subtract");function Wh(n){return typeof n=="string"||n instanceof String}function cx(n){return We(n)||hi(n)||Wh(n)||Tn(n)||hx(n)||ux(n)||n===null||n===void 0}function ux(n){var t=_s(n)&&!wl(n),e=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,i,o=s.length;for(r=0;r<o;r+=1)i=s[r],e=e||yt(n,i);return t&&e}function hx(n){var t=Ye(n),e=!1;return t&&(e=n.filter(function(s){return!Tn(s)&&Wh(n)}).length===0),t&&e}function dx(n){var t=_s(n)&&!wl(n),e=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,i;for(r=0;r<s.length;r+=1)i=s[r],e=e||yt(n,i);return t&&e}function fx(n,t){var e=n.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function gx(n,t){arguments.length===1&&(arguments[0]?cx(arguments[0])?(n=arguments[0],t=void 0):dx(arguments[0])&&(t=arguments[0],n=void 0):(n=void 0,t=void 0));var e=n||Pt(),s=Gl(e,this).startOf("day"),r=G.calendarFormat(this,s)||"sameElse",i=t&&(gn(t[r])?t[r].call(this,e):t[r]);return this.format(i||this.localeData().calendar(r,this,Pt(e)))}function px(){return new di(this)}function mx(n,t){var e=We(n)?n:Pt(n);return this.isValid()&&e.isValid()?(t=ke(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function yx(n,t){var e=We(n)?n:Pt(n);return this.isValid()&&e.isValid()?(t=ke(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function bx(n,t,e,s){var r=We(n)?n:Pt(n),i=We(t)?t:Pt(t);return this.isValid()&&r.isValid()&&i.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(r,e):!this.isBefore(r,e))&&(s[1]===")"?this.isBefore(i,e):!this.isAfter(i,e))):!1}function wx(n,t){var e=We(n)?n:Pt(n),s;return this.isValid()&&e.isValid()?(t=ke(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(s=e.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function xx(n,t){return this.isSame(n,t)||this.isAfter(n,t)}function vx(n,t){return this.isSame(n,t)||this.isBefore(n,t)}function Cx(n,t,e){var s,r,i;if(!this.isValid())return NaN;if(s=Gl(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,t=ke(t),t){case"year":i=Ro(this,s)/12;break;case"month":i=Ro(this,s);break;case"quarter":i=Ro(this,s)/3;break;case"second":i=(this-s)/1e3;break;case"minute":i=(this-s)/6e4;break;case"hour":i=(this-s)/36e5;break;case"day":i=(this-s-r)/864e5;break;case"week":i=(this-s-r)/6048e5;break;default:i=this-s}return e?i:De(i)}function Ro(n,t){if(n.date()<t.date())return-Ro(t,n);var e=(t.year()-n.year())*12+(t.month()-n.month()),s=n.clone().add(e,"months"),r,i;return t-s<0?(r=n.clone().add(e-1,"months"),i=(t-s)/(s-r)):(r=n.clone().add(e+1,"months"),i=(t-s)/(r-s)),-(e+i)||0}G.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",G.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Sx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ex(n){if(!this.isValid())return null;var t=n!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?vo(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):gn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",vo(e,"Z")):vo(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ox(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",t="",e,s,r,i;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+n+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(e+s+r+i)}function Mx(n){n||(n=this.isUtc()?G.defaultFormatUtc:G.defaultFormat);var t=vo(this,n);return this.localeData().postformat(t)}function Px(n,t){return this.isValid()&&(We(n)&&n.isValid()||Pt(n).isValid())?Je({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Ax(n){return this.from(Pt(),n)}function Tx(n,t){return this.isValid()&&(We(n)&&n.isValid()||Pt(n).isValid())?Je({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Nx(n){return this.to(Pt(),n)}function qh(n){var t;return n===void 0?this._locale._abbr:(t=Rn(n),t!=null&&(this._locale=t),this)}var Jh=_e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function Xh(){return this._locale}var Io=1e3,ar=60*Io,Lo=60*ar,Kh=(365*400+97)*24*Lo;function lr(n,t){return(n%t+t)%t}function Zh(n,t,e){return n<100&&n>=0?new Date(n+400,t,e)-Kh:new Date(n,t,e).valueOf()}function Qh(n,t,e){return n<100&&n>=0?Date.UTC(n+400,t,e)-Kh:Date.UTC(n,t,e)}function _x(n){var t,e;if(n=ke(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?Qh:Zh,n){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=lr(t+(this._isUTC?0:this.utcOffset()*ar),Lo);break;case"minute":t=this._d.valueOf(),t-=lr(t,ar);break;case"second":t=this._d.valueOf(),t-=lr(t,Io);break}return this._d.setTime(t),G.updateOffset(this,!0),this}function kx(n){var t,e;if(n=ke(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?Qh:Zh,n){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Lo-lr(t+(this._isUTC?0:this.utcOffset()*ar),Lo)-1;break;case"minute":t=this._d.valueOf(),t+=ar-lr(t,ar)-1;break;case"second":t=this._d.valueOf(),t+=Io-lr(t,Io)-1;break}return this._d.setTime(t),G.updateOffset(this,!0),this}function Dx(){return this._d.valueOf()-(this._offset||0)*6e4}function Rx(){return Math.floor(this.valueOf()/1e3)}function Ix(){return new Date(this.valueOf())}function Lx(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function Bx(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function Vx(){return this.isValid()?this.toISOString():null}function jx(){return vl(this)}function $x(){return Qn({},lt(this))}function zx(){return lt(this).overflow}function Fx(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Q("N",0,0,"eraAbbr"),Q("NN",0,0,"eraAbbr"),Q("NNN",0,0,"eraAbbr"),Q("NNNN",0,0,"eraName"),Q("NNNNN",0,0,"eraNarrow"),Q("y",["y",1],"yo","eraYear"),Q("y",["yy",2],0,"eraYear"),Q("y",["yyy",3],0,"eraYear"),Q("y",["yyyy",4],0,"eraYear"),q("N",Wl),q("NN",Wl),q("NNN",Wl),q("NNNN",Qx),q("NNNNN",t1),Ct(["N","NN","NNN","NNNN","NNNNN"],function(n,t,e,s){var r=e._locale.erasParse(n,s,e._strict);r?lt(e).era=r:lt(e).invalidEra=n}),q("y",sr),q("yy",sr),q("yyy",sr),q("yyyy",sr),q("yo",e1),Ct(["y","yy","yyy","yyyy"],ce),Ct(["yo"],function(n,t,e,s){var r;e._locale._eraYearOrdinalRegex&&(r=n.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[ce]=e._locale.eraYearOrdinalParse(n,r):t[ce]=parseInt(n,10)});function Hx(n,t){var e,s,r,i=this._eras||Rn("en")._eras;for(e=0,s=i.length;e<s;++e){switch(typeof i[e].since){case"string":r=G(i[e].since).startOf("day"),i[e].since=r.valueOf();break}switch(typeof i[e].until){case"undefined":i[e].until=1/0;break;case"string":r=G(i[e].until).startOf("day").valueOf(),i[e].until=r.valueOf();break}}return i}function Ux(n,t,e){var s,r,i=this.eras(),o,a,l;for(n=n.toUpperCase(),s=0,r=i.length;s<r;++s)if(o=i[s].name.toUpperCase(),a=i[s].abbr.toUpperCase(),l=i[s].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===n)return i[s];break;case"NNNN":if(o===n)return i[s];break;case"NNNNN":if(l===n)return i[s];break}else if([o,a,l].indexOf(n)>=0)return i[s]}function Gx(n,t){var e=n.since<=n.until?1:-1;return t===void 0?G(n.since).year():G(n.since).year()+(t-n.offset)*e}function Yx(){var n,t,e,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),s[n].since<=e&&e<=s[n].until||s[n].until<=e&&e<=s[n].since)return s[n].name;return""}function Wx(){var n,t,e,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),s[n].since<=e&&e<=s[n].until||s[n].until<=e&&e<=s[n].since)return s[n].narrow;return""}function qx(){var n,t,e,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),s[n].since<=e&&e<=s[n].until||s[n].until<=e&&e<=s[n].since)return s[n].abbr;return""}function Jx(){var n,t,e,s,r=this.localeData().eras();for(n=0,t=r.length;n<t;++n)if(e=r[n].since<=r[n].until?1:-1,s=this.clone().startOf("day").valueOf(),r[n].since<=s&&s<=r[n].until||r[n].until<=s&&s<=r[n].since)return(this.year()-G(r[n].since).year())*e+r[n].offset;return this.year()}function Xx(n){return yt(this,"_erasNameRegex")||ql.call(this),n?this._erasNameRegex:this._erasRegex}function Kx(n){return yt(this,"_erasAbbrRegex")||ql.call(this),n?this._erasAbbrRegex:this._erasRegex}function Zx(n){return yt(this,"_erasNarrowRegex")||ql.call(this),n?this._erasNarrowRegex:this._erasRegex}function Wl(n,t){return t.erasAbbrRegex(n)}function Qx(n,t){return t.erasNameRegex(n)}function t1(n,t){return t.erasNarrowRegex(n)}function e1(n,t){return t._eraYearOrdinalRegex||sr}function ql(){var n=[],t=[],e=[],s=[],r,i,o,a,l,u=this.eras();for(r=0,i=u.length;r<i;++r)o=Nn(u[r].name),a=Nn(u[r].abbr),l=Nn(u[r].narrow),t.push(o),n.push(a),e.push(l),s.push(o),s.push(a),s.push(l);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}Q(0,["gg",2],0,function(){return this.weekYear()%100}),Q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Bo(n,t){Q(0,[n,n.length],0,t)}Bo("gggg","weekYear"),Bo("ggggg","weekYear"),Bo("GGGG","isoWeekYear"),Bo("GGGGG","isoWeekYear"),q("G",Oo),q("g",Oo),q("GG",Mt,Me),q("gg",Mt,Me),q("GGGG",_l,Nl),q("gggg",_l,Nl),q("GGGGG",Eo,Co),q("ggggg",Eo,Co),gi(["gggg","ggggg","GGGG","GGGGG"],function(n,t,e,s){t[s.substr(0,2)]=dt(n)}),gi(["gg","GG"],function(n,t,e,s){t[s]=G.parseTwoDigitYear(n)});function n1(n){return td.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function s1(n){return td.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function r1(){return Dn(this.year(),1,4)}function i1(){return Dn(this.isoWeekYear(),1,4)}function o1(){var n=this.localeData()._week;return Dn(this.year(),n.dow,n.doy)}function a1(){var n=this.localeData()._week;return Dn(this.weekYear(),n.dow,n.doy)}function td(n,t,e,s,r){var i;return n==null?bi(this,s,r).year:(i=Dn(n,s,r),t>i&&(t=i),l1.call(this,n,t,e,s,r))}function l1(n,t,e,s,r){var i=_h(n,t,e,s,r),o=yi(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Q("Q",0,"Qo","quarter"),q("Q",xh),Ct("Q",function(n,t){t[_n]=(dt(n)-1)*3});function c1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}Q("D",["DD",2],"Do","date"),q("D",Mt,rr),q("DD",Mt,Me),q("Do",function(n,t){return n?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Ct(["D","DD"],mn),Ct("Do",function(n,t){t[mn]=dt(n.match(Mt)[0])});var ed=ir("Date",!0);Q("DDD",["DDDD",3],"DDDo","dayOfYear"),q("DDD",So),q("DDDD",vh),Ct(["DDD","DDDD"],function(n,t,e){e._dayOfYear=dt(n)});function u1(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?t:this.add(n-t,"d")}Q("m",["mm",2],0,"minute"),q("m",Mt,kl),q("mm",Mt,Me),Ct(["m","mm"],qe);var h1=ir("Minutes",!1);Q("s",["ss",2],0,"second"),q("s",Mt,kl),q("ss",Mt,Me),Ct(["s","ss"],kn);var d1=ir("Seconds",!1);Q("S",0,0,function(){return~~(this.millisecond()/100)}),Q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Q(0,["SSS",3],0,"millisecond"),Q(0,["SSSS",4],0,function(){return this.millisecond()*10}),Q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),q("S",So,xh),q("SS",So,Me),q("SSS",So,vh);var es,nd;for(es="SSSS";es.length<=9;es+="S")q(es,sr);function f1(n,t){t[ks]=dt(("0."+n)*1e3)}for(es="S";es.length<=9;es+="S")Ct(es,f1);nd=ir("Milliseconds",!1),Q("z",0,0,"zoneAbbr"),Q("zz",0,0,"zoneName");function g1(){return this._isUTC?"UTC":""}function p1(){return this._isUTC?"Coordinated Universal Time":""}var $=di.prototype;$.add=ax,$.calendar=gx,$.clone=px,$.diff=Cx,$.endOf=kx,$.format=Mx,$.from=Px,$.fromNow=Ax,$.to=Tx,$.toNow=Nx,$.get=O0,$.invalidAt=zx,$.isAfter=mx,$.isBefore=yx,$.isBetween=bx,$.isSame=wx,$.isSameOrAfter=xx,$.isSameOrBefore=vx,$.isValid=jx,$.lang=Jh,$.locale=qh,$.localeData=Xh,$.max=jw,$.min=Vw,$.parsingFlags=$x,$.set=M0,$.startOf=_x,$.subtract=lx,$.toArray=Lx,$.toObject=Bx,$.toDate=Ix,$.toISOString=Ex,$.inspect=Ox,typeof Symbol<"u"&&Symbol.for!=null&&($[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),$.toJSON=Vx,$.toString=Sx,$.unix=Rx,$.valueOf=Dx,$.creationData=Fx,$.eraName=Yx,$.eraNarrow=Wx,$.eraAbbr=qx,$.eraYear=Jx,$.year=Eh,$.isLeapYear=E0,$.weekYear=n1,$.isoWeekYear=s1,$.quarter=$.quarters=c1,$.month=Th,$.daysInMonth=I0,$.week=$.weeks=H0,$.isoWeek=$.isoWeeks=U0,$.weeksInYear=o1,$.weeksInWeekYear=a1,$.isoWeeksInYear=r1,$.isoWeeksInISOWeekYear=i1,$.date=ed,$.day=$.days=sw,$.weekday=rw,$.isoWeekday=iw,$.dayOfYear=u1,$.hour=$.hours=dw,$.minute=$.minutes=h1,$.second=$.seconds=d1,$.millisecond=$.milliseconds=nd,$.utcOffset=qw,$.utc=Xw,$.local=Kw,$.parseZone=Zw,$.hasAlignedHourOffset=Qw,$.isDST=tx,$.isLocal=nx,$.isUtcOffset=sx,$.isUtc=Hh,$.isUTC=Hh,$.zoneAbbr=g1,$.zoneName=p1,$.dates=_e("dates accessor is deprecated. Use date instead.",ed),$.months=_e("months accessor is deprecated. Use month instead",Th),$.years=_e("years accessor is deprecated. Use year instead",Eh),$.zone=_e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Jw),$.isDSTShifted=_e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ex);function m1(n){return Pt(n*1e3)}function y1(){return Pt.apply(null,arguments).parseZone()}function sd(n){return n}var bt=Ol.prototype;bt.calendar=n0,bt.longDateFormat=o0,bt.invalidDate=l0,bt.ordinal=h0,bt.preparse=sd,bt.postformat=sd,bt.relativeTime=f0,bt.pastFuture=g0,bt.set=t0,bt.eras=Hx,bt.erasParse=Ux,bt.erasConvertYear=Gx,bt.erasAbbrRegex=Kx,bt.erasNameRegex=Xx,bt.erasNarrowRegex=Zx,bt.months=_0,bt.monthsShort=k0,bt.monthsParse=R0,bt.monthsRegex=B0,bt.monthsShortRegex=L0,bt.week=j0,bt.firstDayOfYear=F0,bt.firstDayOfWeek=z0,bt.weekdays=Z0,bt.weekdaysMin=tw,bt.weekdaysShort=Q0,bt.weekdaysParse=nw,bt.weekdaysRegex=ow,bt.weekdaysShortRegex=aw,bt.weekdaysMinRegex=lw,bt.isPM=uw,bt.meridiem=fw;function Vo(n,t,e,s){var r=Rn(),i=fn().set(s,t);return r[e](i,n)}function rd(n,t,e){if(Tn(n)&&(t=n,n=void 0),n=n||"",t!=null)return Vo(n,t,e,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Vo(n,s,e,"month");return r}function Jl(n,t,e,s){typeof n=="boolean"?(Tn(t)&&(e=t,t=void 0),t=t||""):(t=n,e=t,n=!1,Tn(t)&&(e=t,t=void 0),t=t||"");var r=Rn(),i=n?r._week.dow:0,o,a=[];if(e!=null)return Vo(t,(e+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Vo(t,(o+i)%7,s,"day");return a}function b1(n,t){return rd(n,t,"months")}function w1(n,t){return rd(n,t,"monthsShort")}function x1(n,t,e){return Jl(n,t,e,"weekdays")}function v1(n,t,e){return Jl(n,t,e,"weekdaysShort")}function C1(n,t,e){return Jl(n,t,e,"weekdaysMin")}ts("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10,e=dt(n%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return n+e}}),G.lang=_e("moment.lang is deprecated. Use moment.locale instead.",ts),G.langData=_e("moment.langData is deprecated. Use moment.localeData instead.",Rn);var In=Math.abs;function S1(){var n=this._data;return this._milliseconds=In(this._milliseconds),this._days=In(this._days),this._months=In(this._months),n.milliseconds=In(n.milliseconds),n.seconds=In(n.seconds),n.minutes=In(n.minutes),n.hours=In(n.hours),n.months=In(n.months),n.years=In(n.years),this}function id(n,t,e,s){var r=Je(t,e);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function E1(n,t){return id(this,n,t,1)}function O1(n,t){return id(this,n,t,-1)}function od(n){return n<0?Math.floor(n):Math.ceil(n)}function M1(){var n=this._milliseconds,t=this._days,e=this._months,s=this._data,r,i,o,a,l;return n>=0&&t>=0&&e>=0||n<=0&&t<=0&&e<=0||(n+=od(Xl(e)+t)*864e5,t=0,e=0),s.milliseconds=n%1e3,r=De(n/1e3),s.seconds=r%60,i=De(r/60),s.minutes=i%60,o=De(i/60),s.hours=o%24,t+=De(o/24),l=De(ad(t)),e+=l,t-=od(Xl(l)),a=De(e/12),e%=12,s.days=t,s.months=e,s.years=a,this}function ad(n){return n*4800/146097}function Xl(n){return n*146097/4800}function P1(n){if(!this.isValid())return NaN;var t,e,s=this._milliseconds;if(n=ke(n),n==="month"||n==="quarter"||n==="year")switch(t=this._days+s/864e5,e=this._months+ad(t),n){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Xl(this._months)),n){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+n)}}function Ln(n){return function(){return this.as(n)}}var ld=Ln("ms"),A1=Ln("s"),T1=Ln("m"),N1=Ln("h"),_1=Ln("d"),k1=Ln("w"),D1=Ln("M"),R1=Ln("Q"),I1=Ln("y"),L1=ld;function B1(){return Je(this)}function V1(n){return n=ke(n),this.isValid()?this[n+"s"]():NaN}function Rs(n){return function(){return this.isValid()?this._data[n]:NaN}}var j1=Rs("milliseconds"),$1=Rs("seconds"),z1=Rs("minutes"),F1=Rs("hours"),H1=Rs("days"),U1=Rs("months"),G1=Rs("years");function Y1(){return De(this.days()/7)}var Bn=Math.round,cr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function W1(n,t,e,s,r){return r.relativeTime(t||1,!!e,n,s)}function q1(n,t,e,s){var r=Je(n).abs(),i=Bn(r.as("s")),o=Bn(r.as("m")),a=Bn(r.as("h")),l=Bn(r.as("d")),u=Bn(r.as("M")),h=Bn(r.as("w")),f=Bn(r.as("y")),d=i<=e.ss&&["s",i]||i<e.s&&["ss",i]||o<=1&&["m"]||o<e.m&&["mm",o]||a<=1&&["h"]||a<e.h&&["hh",a]||l<=1&&["d"]||l<e.d&&["dd",l];return e.w!=null&&(d=d||h<=1&&["w"]||h<e.w&&["ww",h]),d=d||u<=1&&["M"]||u<e.M&&["MM",u]||f<=1&&["y"]||["yy",f],d[2]=t,d[3]=+n>0,d[4]=s,W1.apply(null,d)}function J1(n){return n===void 0?Bn:typeof n=="function"?(Bn=n,!0):!1}function X1(n,t){return cr[n]===void 0?!1:t===void 0?cr[n]:(cr[n]=t,n==="s"&&(cr.ss=t-1),!0)}function K1(n,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,s=cr,r,i;return typeof n=="object"&&(t=n,n=!1),typeof n=="boolean"&&(e=n),typeof t=="object"&&(s=Object.assign({},cr,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),r=this.localeData(),i=q1(this,!e,s,r),e&&(i=r.pastFuture(+this,i)),r.postformat(i)}var Kl=Math.abs;function ur(n){return(n>0)-(n<0)||+n}function jo(){if(!this.isValid())return this.localeData().invalidDate();var n=Kl(this._milliseconds)/1e3,t=Kl(this._days),e=Kl(this._months),s,r,i,o,a=this.asSeconds(),l,u,h,f;return a?(s=De(n/60),r=De(s/60),n%=60,s%=60,i=De(e/12),e%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=ur(this._months)!==ur(a)?"-":"",h=ur(this._days)!==ur(a)?"-":"",f=ur(this._milliseconds)!==ur(a)?"-":"",l+"P"+(i?u+i+"Y":"")+(e?u+e+"M":"")+(t?h+t+"D":"")+(r||s||n?"T":"")+(r?f+r+"H":"")+(s?f+s+"M":"")+(n?f+o+"S":"")):"P0D"}var mt=ko.prototype;mt.isValid=Uw,mt.abs=S1,mt.add=E1,mt.subtract=O1,mt.as=P1,mt.asMilliseconds=ld,mt.asSeconds=A1,mt.asMinutes=T1,mt.asHours=N1,mt.asDays=_1,mt.asWeeks=k1,mt.asMonths=D1,mt.asQuarters=R1,mt.asYears=I1,mt.valueOf=L1,mt._bubble=M1,mt.clone=B1,mt.get=V1,mt.milliseconds=j1,mt.seconds=$1,mt.minutes=z1,mt.hours=F1,mt.days=H1,mt.weeks=Y1,mt.months=U1,mt.years=G1,mt.humanize=K1,mt.toISOString=jo,mt.toString=jo,mt.toJSON=jo,mt.locale=qh,mt.localeData=Xh,mt.toIsoString=_e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",jo),mt.lang=Jh,Q("X",0,0,"unix"),Q("x",0,0,"valueOf"),q("x",Oo),q("X",b0),Ct("X",function(n,t,e){e._d=new Date(parseFloat(n)*1e3)}),Ct("x",function(n,t,e){e._d=new Date(dt(n))});//! moment.js
|
|
10
|
-
G.version="2.30.1",
|
|
9
|
+
`+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var mh={};function yh(n,t){G.deprecationHandler!=null&&G.deprecationHandler(n,t),mh[n]||(ph(t),mh[n]=!0)}G.suppressDeprecationWarnings=!1,G.deprecationHandler=null;function gn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function e0(n){var t,e;for(e in n)yt(n,e)&&(t=n[e],gn(t)?this[e]=t:this["_"+e]=t);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Sl(n,t){var e=Qn({},n),s;for(s in t)yt(t,s)&&(_s(n[s])&&_s(t[s])?(e[s]={},Qn(e[s],n[s]),Qn(e[s],t[s])):t[s]!=null?e[s]=t[s]:delete e[s]);for(s in n)yt(n,s)&&!yt(t,s)&&_s(n[s])&&(e[s]=Qn({},e[s]));return e}function El(n){n!=null&&this.set(n)}var Ol;Object.keys?Ol=Object.keys:Ol=function(n){var t,e=[];for(t in n)yt(n,t)&&e.push(t);return e};var n0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function s0(n,t,e){var s=this._calendar[n]||this._calendar.sameElse;return gn(s)?s.call(t,e):s}function pn(n,t,e){var s=""+Math.abs(n),r=t-s.length,i=n>=0;return(i?e?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+s}var Ml=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,xo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pl={},nr={};function Q(n,t,e,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(nr[n]=r),t&&(nr[t[0]]=function(){return pn(r.apply(this,arguments),t[1],t[2])}),e&&(nr[e]=function(){return this.localeData().ordinal(r.apply(this,arguments),n)})}function r0(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function i0(n){var t=n.match(Ml),e,s;for(e=0,s=t.length;e<s;e++)nr[t[e]]?t[e]=nr[t[e]]:t[e]=r0(t[e]);return function(r){var i="",o;for(o=0;o<s;o++)i+=gn(t[o])?t[o].call(r,n):t[o];return i}}function vo(n,t){return n.isValid()?(t=bh(t,n.localeData()),Pl[t]=Pl[t]||i0(t),Pl[t](n)):n.localeData().invalidDate()}function bh(n,t){var e=5;function s(r){return t.longDateFormat(r)||r}for(xo.lastIndex=0;e>=0&&xo.test(n);)n=n.replace(xo,s),xo.lastIndex=0,e-=1;return n}var o0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function a0(n){var t=this._longDateFormat[n],e=this._longDateFormat[n.toUpperCase()];return t||!e?t:(this._longDateFormat[n]=e.match(Ml).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var l0="Invalid date";function c0(){return this._invalidDate}var u0="%d",h0=/\d{1,2}/;function d0(n){return this._ordinal.replace("%d",n)}var f0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function g0(n,t,e,s){var r=this._relativeTime[e];return gn(r)?r(n,t,e,s):r.replace(/%d/i,n)}function p0(n,t){var e=this._relativeTime[n>0?"future":"past"];return gn(e)?e(t):e.replace(/%s/i,t)}var wh={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ke(n){return typeof n=="string"?wh[n]||wh[n.toLowerCase()]:void 0}function Al(n){var t={},e,s;for(s in n)yt(n,s)&&(e=ke(s),e&&(t[e]=n[s]));return t}var m0={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function y0(n){var t=[],e;for(e in n)yt(n,e)&&t.push({unit:e,priority:m0[e]});return t.sort(function(s,r){return s.priority-r.priority}),t}var xh=/\d/,Me=/\d\d/,vh=/\d{3}/,Tl=/\d{4}/,Co=/[+-]?\d{6}/,Mt=/\d\d?/,Ch=/\d\d\d\d?/,Sh=/\d\d\d\d\d\d?/,So=/\d{1,3}/,Nl=/\d{1,4}/,Eo=/[+-]?\d{1,6}/,sr=/\d+/,Oo=/[+-]?\d+/,b0=/Z|[+-]\d\d:?\d\d/gi,Mo=/Z|[+-]\d\d(?::?\d\d)?/gi,w0=/[+-]?\d+(\.\d{1,3})?/,fi=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,rr=/^[1-9]\d?/,_l=/^([1-9]\d|\d)/,Po;Po={};function q(n,t,e){Po[n]=gn(t)?t:function(s,r){return s&&e?e:t}}function x0(n,t){return yt(Po,n)?Po[n](t._strict,t._locale):new RegExp(v0(n))}function v0(n){return Nn(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,s,r,i){return e||s||r||i}))}function Nn(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function De(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function dt(n){var t=+n,e=0;return t!==0&&isFinite(t)&&(e=De(t)),e}var kl={};function Ct(n,t){var e,s=t,r;for(typeof n=="string"&&(n=[n]),Tn(t)&&(s=function(i,o){o[t]=dt(i)}),r=n.length,e=0;e<r;e++)kl[n[e]]=s}function gi(n,t){Ct(n,function(e,s,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function C0(n,t,e){t!=null&&yt(kl,n)&&kl[n](t,e._a,e,n)}function Ao(n){return n%4===0&&n%100!==0||n%400===0}var ce=0,_n=1,mn=2,Xt=3,qe=4,kn=5,ks=6,S0=7,E0=8;Q("Y",0,0,function(){var n=this.year();return n<=9999?pn(n,4):"+"+n}),Q(0,["YY",2],0,function(){return this.year()%100}),Q(0,["YYYY",4],0,"year"),Q(0,["YYYYY",5],0,"year"),Q(0,["YYYYYY",6,!0],0,"year"),q("Y",Oo),q("YY",Mt,Me),q("YYYY",Nl,Tl),q("YYYYY",Eo,Co),q("YYYYYY",Eo,Co),Ct(["YYYYY","YYYYYY"],ce),Ct("YYYY",function(n,t){t[ce]=n.length===2?G.parseTwoDigitYear(n):dt(n)}),Ct("YY",function(n,t){t[ce]=G.parseTwoDigitYear(n)}),Ct("Y",function(n,t){t[ce]=parseInt(n,10)});function pi(n){return Ao(n)?366:365}G.parseTwoDigitYear=function(n){return dt(n)+(dt(n)>68?1900:2e3)};var Eh=ir("FullYear",!0);function O0(){return Ao(this.year())}function ir(n,t){return function(e){return e!=null?(Oh(this,n,e),G.updateOffset(this,t),this):mi(this,n)}}function mi(n,t){if(!n.isValid())return NaN;var e=n._d,s=n._isUTC;switch(t){case"Milliseconds":return s?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return s?e.getUTCSeconds():e.getSeconds();case"Minutes":return s?e.getUTCMinutes():e.getMinutes();case"Hours":return s?e.getUTCHours():e.getHours();case"Date":return s?e.getUTCDate():e.getDate();case"Day":return s?e.getUTCDay():e.getDay();case"Month":return s?e.getUTCMonth():e.getMonth();case"FullYear":return s?e.getUTCFullYear():e.getFullYear();default:return NaN}}function Oh(n,t,e){var s,r,i,o,a;if(!(!n.isValid()||isNaN(e))){switch(s=n._d,r=n._isUTC,t){case"Milliseconds":return void(r?s.setUTCMilliseconds(e):s.setMilliseconds(e));case"Seconds":return void(r?s.setUTCSeconds(e):s.setSeconds(e));case"Minutes":return void(r?s.setUTCMinutes(e):s.setMinutes(e));case"Hours":return void(r?s.setUTCHours(e):s.setHours(e));case"Date":return void(r?s.setUTCDate(e):s.setDate(e));case"FullYear":break;default:return}i=e,o=n.month(),a=n.date(),a=a===29&&o===1&&!Ao(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function M0(n){return n=ke(n),gn(this[n])?this[n]():this}function P0(n,t){if(typeof n=="object"){n=Al(n);var e=y0(n),s,r=e.length;for(s=0;s<r;s++)this[e[s].unit](n[e[s].unit])}else if(n=ke(n),gn(this[n]))return this[n](t);return this}function A0(n,t){return(n%t+t)%t}var jt;Array.prototype.indexOf?jt=Array.prototype.indexOf:jt=function(n){var t;for(t=0;t<this.length;++t)if(this[t]===n)return t;return-1};function Dl(n,t){if(isNaN(n)||isNaN(t))return NaN;var e=A0(t,12);return n+=(t-e)/12,e===1?Ao(n)?29:28:31-e%7%2}Q("M",["MM",2],"Mo",function(){return this.month()+1}),Q("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),Q("MMMM",0,0,function(n){return this.localeData().months(this,n)}),q("M",Mt,rr),q("MM",Mt,Me),q("MMM",function(n,t){return t.monthsShortRegex(n)}),q("MMMM",function(n,t){return t.monthsRegex(n)}),Ct(["M","MM"],function(n,t){t[_n]=dt(n)-1}),Ct(["MMM","MMMM"],function(n,t,e,s){var r=e._locale.monthsParse(n,s,e._strict);r!=null?t[_n]=r:lt(e).invalidMonth=n});var T0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Mh="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ph=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,N0=fi,_0=fi;function k0(n,t){return n?Ye(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Ph).test(t)?"format":"standalone"][n.month()]:Ye(this._months)?this._months:this._months.standalone}function D0(n,t){return n?Ye(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Ph.test(t)?"format":"standalone"][n.month()]:Ye(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function R0(n,t,e){var s,r,i,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)i=fn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return e?t==="MMM"?(r=jt.call(this._shortMonthsParse,o),r!==-1?r:null):(r=jt.call(this._longMonthsParse,o),r!==-1?r:null):t==="MMM"?(r=jt.call(this._shortMonthsParse,o),r!==-1?r:(r=jt.call(this._longMonthsParse,o),r!==-1?r:null)):(r=jt.call(this._longMonthsParse,o),r!==-1?r:(r=jt.call(this._shortMonthsParse,o),r!==-1?r:null))}function I0(n,t,e){var s,r,i;if(this._monthsParseExact)return R0.call(this,n,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=fn([2e3,s]),e&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!e&&!this._monthsParse[s]&&(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[s].test(n))return s;if(e&&t==="MMM"&&this._shortMonthsParse[s].test(n))return s;if(!e&&this._monthsParse[s].test(n))return s}}function Ah(n,t){if(!n.isValid())return n;if(typeof t=="string"){if(/^\d+$/.test(t))t=dt(t);else if(t=n.localeData().monthsParse(t),!Tn(t))return n}var e=t,s=n.date();return s=s<29?s:Math.min(s,Dl(n.year(),e)),n._isUTC?n._d.setUTCMonth(e,s):n._d.setMonth(e,s),n}function Th(n){return n!=null?(Ah(this,n),G.updateOffset(this,!0),this):mi(this,"Month")}function L0(){return Dl(this.year(),this.month())}function B0(n){return this._monthsParseExact?(yt(this,"_monthsRegex")||Nh.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(yt(this,"_monthsShortRegex")||(this._monthsShortRegex=N0),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function V0(n){return this._monthsParseExact?(yt(this,"_monthsRegex")||Nh.call(this),n?this._monthsStrictRegex:this._monthsRegex):(yt(this,"_monthsRegex")||(this._monthsRegex=_0),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Nh(){function n(l,u){return u.length-l.length}var t=[],e=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=fn([2e3,r]),o=Nn(this.monthsShort(i,"")),a=Nn(this.months(i,"")),t.push(o),e.push(a),s.push(a),s.push(o);t.sort(n),e.sort(n),s.sort(n),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function j0(n,t,e,s,r,i,o){var a;return n<100&&n>=0?(a=new Date(n+400,t,e,s,r,i,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,t,e,s,r,i,o),a}function yi(n){var t,e;return n<100&&n>=0?(e=Array.prototype.slice.call(arguments),e[0]=n+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(n)):t=new Date(Date.UTC.apply(null,arguments)),t}function To(n,t,e){var s=7+t-e,r=(7+yi(n,0,s).getUTCDay()-t)%7;return-r+s-1}function _h(n,t,e,s,r){var i=(7+e-s)%7,o=To(n,s,r),a=1+7*(t-1)+i+o,l,u;return a<=0?(l=n-1,u=pi(l)+a):a>pi(n)?(l=n+1,u=a-pi(n)):(l=n,u=a),{year:l,dayOfYear:u}}function bi(n,t,e){var s=To(n.year(),t,e),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+Dn(o,t,e)):r>Dn(n.year(),t,e)?(i=r-Dn(n.year(),t,e),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function Dn(n,t,e){var s=To(n,t,e),r=To(n+1,t,e);return(pi(n)-s+r)/7}Q("w",["ww",2],"wo","week"),Q("W",["WW",2],"Wo","isoWeek"),q("w",Mt,rr),q("ww",Mt,Me),q("W",Mt,rr),q("WW",Mt,Me),gi(["w","ww","W","WW"],function(n,t,e,s){t[s.substr(0,1)]=dt(n)});function $0(n){return bi(n,this._week.dow,this._week.doy).week}var z0={dow:0,doy:6};function F0(){return this._week.dow}function H0(){return this._week.doy}function U0(n){var t=this.localeData().week(this);return n==null?t:this.add((n-t)*7,"d")}function G0(n){var t=bi(this,1,4).week;return n==null?t:this.add((n-t)*7,"d")}Q("d",0,"do","day"),Q("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),Q("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),Q("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),Q("e",0,0,"weekday"),Q("E",0,0,"isoWeekday"),q("d",Mt),q("e",Mt),q("E",Mt),q("dd",function(n,t){return t.weekdaysMinRegex(n)}),q("ddd",function(n,t){return t.weekdaysShortRegex(n)}),q("dddd",function(n,t){return t.weekdaysRegex(n)}),gi(["dd","ddd","dddd"],function(n,t,e,s){var r=e._locale.weekdaysParse(n,s,e._strict);r!=null?t.d=r:lt(e).invalidWeekday=n}),gi(["d","e","E"],function(n,t,e,s){t[s]=dt(n)});function Y0(n,t){return typeof n!="string"?n:isNaN(n)?(n=t.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function W0(n,t){return typeof n=="string"?t.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Rl(n,t){return n.slice(t,7).concat(n.slice(0,t))}var q0="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),kh="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),J0="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),X0=fi,K0=fi,Z0=fi;function Q0(n,t){var e=Ye(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return n===!0?Rl(e,this._week.dow):n?e[n.day()]:e}function tw(n){return n===!0?Rl(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function ew(n){return n===!0?Rl(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function nw(n,t,e){var s,r,i,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=fn([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(i,"").toLocaleLowerCase();return e?t==="dddd"?(r=jt.call(this._weekdaysParse,o),r!==-1?r:null):t==="ddd"?(r=jt.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=jt.call(this._minWeekdaysParse,o),r!==-1?r:null):t==="dddd"?(r=jt.call(this._weekdaysParse,o),r!==-1||(r=jt.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=jt.call(this._minWeekdaysParse,o),r!==-1?r:null)):t==="ddd"?(r=jt.call(this._shortWeekdaysParse,o),r!==-1||(r=jt.call(this._weekdaysParse,o),r!==-1)?r:(r=jt.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=jt.call(this._minWeekdaysParse,o),r!==-1||(r=jt.call(this._weekdaysParse,o),r!==-1)?r:(r=jt.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function sw(n,t,e){var s,r,i;if(this._weekdaysParseExact)return nw.call(this,n,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=fn([2e3,1]).day(s),e&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[s].test(n))return s;if(e&&t==="ddd"&&this._shortWeekdaysParse[s].test(n))return s;if(e&&t==="dd"&&this._minWeekdaysParse[s].test(n))return s;if(!e&&this._weekdaysParse[s].test(n))return s}}function rw(n){if(!this.isValid())return n!=null?this:NaN;var t=mi(this,"Day");return n!=null?(n=Y0(n,this.localeData()),this.add(n-t,"d")):t}function iw(n){if(!this.isValid())return n!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return n==null?t:this.add(n-t,"d")}function ow(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var t=W0(n,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function aw(n){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||Il.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(yt(this,"_weekdaysRegex")||(this._weekdaysRegex=X0),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function lw(n){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||Il.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(yt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=K0),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function cw(n){return this._weekdaysParseExact?(yt(this,"_weekdaysRegex")||Il.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(yt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Z0),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Il(){function n(h,f){return f.length-h.length}var t=[],e=[],s=[],r=[],i,o,a,l,u;for(i=0;i<7;i++)o=fn([2e3,1]).day(i),a=Nn(this.weekdaysMin(o,"")),l=Nn(this.weekdaysShort(o,"")),u=Nn(this.weekdays(o,"")),t.push(a),e.push(l),s.push(u),r.push(a),r.push(l),r.push(u);t.sort(n),e.sort(n),s.sort(n),r.sort(n),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Ll(){return this.hours()%12||12}function uw(){return this.hours()||24}Q("H",["HH",2],0,"hour"),Q("h",["hh",2],0,Ll),Q("k",["kk",2],0,uw),Q("hmm",0,0,function(){return""+Ll.apply(this)+pn(this.minutes(),2)}),Q("hmmss",0,0,function(){return""+Ll.apply(this)+pn(this.minutes(),2)+pn(this.seconds(),2)}),Q("Hmm",0,0,function(){return""+this.hours()+pn(this.minutes(),2)}),Q("Hmmss",0,0,function(){return""+this.hours()+pn(this.minutes(),2)+pn(this.seconds(),2)});function Dh(n,t){Q(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Dh("a",!0),Dh("A",!1);function Rh(n,t){return t._meridiemParse}q("a",Rh),q("A",Rh),q("H",Mt,_l),q("h",Mt,rr),q("k",Mt,rr),q("HH",Mt,Me),q("hh",Mt,Me),q("kk",Mt,Me),q("hmm",Ch),q("hmmss",Sh),q("Hmm",Ch),q("Hmmss",Sh),Ct(["H","HH"],Xt),Ct(["k","kk"],function(n,t,e){var s=dt(n);t[Xt]=s===24?0:s}),Ct(["a","A"],function(n,t,e){e._isPm=e._locale.isPM(n),e._meridiem=n}),Ct(["h","hh"],function(n,t,e){t[Xt]=dt(n),lt(e).bigHour=!0}),Ct("hmm",function(n,t,e){var s=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s)),lt(e).bigHour=!0}),Ct("hmmss",function(n,t,e){var s=n.length-4,r=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s,2)),t[kn]=dt(n.substr(r)),lt(e).bigHour=!0}),Ct("Hmm",function(n,t,e){var s=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s))}),Ct("Hmmss",function(n,t,e){var s=n.length-4,r=n.length-2;t[Xt]=dt(n.substr(0,s)),t[qe]=dt(n.substr(s,2)),t[kn]=dt(n.substr(r))});function hw(n){return(n+"").toLowerCase().charAt(0)==="p"}var dw=/[ap]\.?m?\.?/i,fw=ir("Hours",!0);function gw(n,t,e){return n>11?e?"pm":"PM":e?"am":"AM"}var Ih={calendar:n0,longDateFormat:o0,invalidDate:l0,ordinal:u0,dayOfMonthOrdinalParse:h0,relativeTime:f0,months:T0,monthsShort:Mh,week:z0,weekdays:q0,weekdaysMin:J0,weekdaysShort:kh,meridiemParse:dw},kt={},wi={},xi;function pw(n,t){var e,s=Math.min(n.length,t.length);for(e=0;e<s;e+=1)if(n[e]!==t[e])return e;return s}function Lh(n){return n&&n.toLowerCase().replace("_","-")}function mw(n){for(var t=0,e,s,r,i;t<n.length;){for(i=Lh(n[t]).split("-"),e=i.length,s=Lh(n[t+1]),s=s?s.split("-"):null;e>0;){if(r=No(i.slice(0,e).join("-")),r)return r;if(s&&s.length>=e&&pw(i,s)>=e-1)break;e--}t++}return xi}function yw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function No(n){var t=null,e;if(kt[n]===void 0&&typeof module<"u"&&module&&module.exports&&yw(n))try{t=xi._abbr,e=require,e("./locale/"+n),ts(t)}catch{kt[n]=null}return kt[n]}function ts(n,t){var e;return n&&(be(t)?e=Rn(n):e=Bl(n,t),e?xi=e:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),xi._abbr}function Bl(n,t){if(t!==null){var e,s=Ih;if(t.abbr=n,kt[n]!=null)yh("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=kt[n]._config;else if(t.parentLocale!=null)if(kt[t.parentLocale]!=null)s=kt[t.parentLocale]._config;else if(e=No(t.parentLocale),e!=null)s=e._config;else return wi[t.parentLocale]||(wi[t.parentLocale]=[]),wi[t.parentLocale].push({name:n,config:t}),null;return kt[n]=new El(Sl(s,t)),wi[n]&&wi[n].forEach(function(r){Bl(r.name,r.config)}),ts(n),kt[n]}else return delete kt[n],null}function bw(n,t){if(t!=null){var e,s,r=Ih;kt[n]!=null&&kt[n].parentLocale!=null?kt[n].set(Sl(kt[n]._config,t)):(s=No(n),s!=null&&(r=s._config),t=Sl(r,t),s==null&&(t.abbr=n),e=new El(t),e.parentLocale=kt[n],kt[n]=e),ts(n)}else kt[n]!=null&&(kt[n].parentLocale!=null?(kt[n]=kt[n].parentLocale,n===ts()&&ts(n)):kt[n]!=null&&delete kt[n]);return kt[n]}function Rn(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return xi;if(!Ye(n)){if(t=No(n),t)return t;n=[n]}return mw(n)}function ww(){return Ol(kt)}function Vl(n){var t,e=n._a;return e&<(n).overflow===-2&&(t=e[_n]<0||e[_n]>11?_n:e[mn]<1||e[mn]>Dl(e[ce],e[_n])?mn:e[Xt]<0||e[Xt]>24||e[Xt]===24&&(e[qe]!==0||e[kn]!==0||e[ks]!==0)?Xt:e[qe]<0||e[qe]>59?qe:e[kn]<0||e[kn]>59?kn:e[ks]<0||e[ks]>999?ks:-1,lt(n)._overflowDayOfYear&&(t<ce||t>mn)&&(t=mn),lt(n)._overflowWeeks&&t===-1&&(t=S0),lt(n)._overflowWeekday&&t===-1&&(t=E0),lt(n).overflow=t),n}var xw=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vw=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Cw=/Z|[+-]\d\d(?::?\d\d)?/,_o=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],jl=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Sw=/^\/?Date\((-?\d+)/i,Ew=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ow={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Bh(n){var t,e,s=n._i,r=xw.exec(s)||vw.exec(s),i,o,a,l,u=_o.length,h=jl.length;if(r){for(lt(n).iso=!0,t=0,e=u;t<e;t++)if(_o[t][1].exec(r[1])){o=_o[t][0],i=_o[t][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(t=0,e=h;t<e;t++)if(jl[t][1].exec(r[3])){a=(r[2]||" ")+jl[t][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(Cw.exec(r[4]))l="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(l||""),zl(n)}else n._isValid=!1}function Mw(n,t,e,s,r,i){var o=[Pw(n),Mh.indexOf(t),parseInt(e,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Pw(n){var t=parseInt(n,10);return t<=49?2e3+t:t<=999?1900+t:t}function Aw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Tw(n,t,e){if(n){var s=kh.indexOf(n),r=new Date(t[0],t[1],t[2]).getDay();if(s!==r)return lt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function Nw(n,t,e){if(n)return Ow[n];if(t)return 0;var s=parseInt(e,10),r=s%100,i=(s-r)/100;return i*60+r}function Vh(n){var t=Ew.exec(Aw(n._i)),e;if(t){if(e=Mw(t[4],t[3],t[2],t[5],t[6],t[7]),!Tw(t[1],e,n))return;n._a=e,n._tzm=Nw(t[8],t[9],t[10]),n._d=yi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),lt(n).rfc2822=!0}else n._isValid=!1}function _w(n){var t=Sw.exec(n._i);if(t!==null){n._d=new Date(+t[1]);return}if(Bh(n),n._isValid===!1)delete n._isValid;else return;if(Vh(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:G.createFromInputFallback(n)}G.createFromInputFallback=_e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function or(n,t,e){return n??t??e}function kw(n){var t=new Date(G.now());return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function $l(n){var t,e,s=[],r,i,o;if(!n._d){for(r=kw(n),n._w&&n._a[mn]==null&&n._a[_n]==null&&Dw(n),n._dayOfYear!=null&&(o=or(n._a[ce],r[ce]),(n._dayOfYear>pi(o)||n._dayOfYear===0)&&(lt(n)._overflowDayOfYear=!0),e=yi(o,0,n._dayOfYear),n._a[_n]=e.getUTCMonth(),n._a[mn]=e.getUTCDate()),t=0;t<3&&n._a[t]==null;++t)n._a[t]=s[t]=r[t];for(;t<7;t++)n._a[t]=s[t]=n._a[t]==null?t===2?1:0:n._a[t];n._a[Xt]===24&&n._a[qe]===0&&n._a[kn]===0&&n._a[ks]===0&&(n._nextDay=!0,n._a[Xt]=0),n._d=(n._useUTC?yi:j0).apply(null,s),i=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[Xt]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(lt(n).weekdayMismatch=!0)}}function Dw(n){var t,e,s,r,i,o,a,l,u;t=n._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,o=4,e=or(t.GG,n._a[ce],bi(Pt(),1,4).year),s=or(t.W,1),r=or(t.E,1),(r<1||r>7)&&(l=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=bi(Pt(),i,o),e=or(t.gg,n._a[ce],u.year),s=or(t.w,u.week),t.d!=null?(r=t.d,(r<0||r>6)&&(l=!0)):t.e!=null?(r=t.e+i,(t.e<0||t.e>6)&&(l=!0)):r=i),s<1||s>Dn(e,i,o)?lt(n)._overflowWeeks=!0:l!=null?lt(n)._overflowWeekday=!0:(a=_h(e,s,r,i,o),n._a[ce]=a.year,n._dayOfYear=a.dayOfYear)}G.ISO_8601=function(){},G.RFC_2822=function(){};function zl(n){if(n._f===G.ISO_8601){Bh(n);return}if(n._f===G.RFC_2822){Vh(n);return}n._a=[],lt(n).empty=!0;var t=""+n._i,e,s,r,i,o,a=t.length,l=0,u,h;for(r=bh(n._f,n._locale).match(Ml)||[],h=r.length,e=0;e<h;e++)i=r[e],s=(t.match(x0(i,n))||[])[0],s&&(o=t.substr(0,t.indexOf(s)),o.length>0&<(n).unusedInput.push(o),t=t.slice(t.indexOf(s)+s.length),l+=s.length),nr[i]?(s?lt(n).empty=!1:lt(n).unusedTokens.push(i),C0(i,s,n)):n._strict&&!s&<(n).unusedTokens.push(i);lt(n).charsLeftOver=a-l,t.length>0&<(n).unusedInput.push(t),n._a[Xt]<=12&<(n).bigHour===!0&&n._a[Xt]>0&&(lt(n).bigHour=void 0),lt(n).parsedDateParts=n._a.slice(0),lt(n).meridiem=n._meridiem,n._a[Xt]=Rw(n._locale,n._a[Xt],n._meridiem),u=lt(n).era,u!==null&&(n._a[ce]=n._locale.erasConvertYear(u,n._a[ce])),$l(n),Vl(n)}function Rw(n,t,e){var s;return e==null?t:n.meridiemHour!=null?n.meridiemHour(t,e):(n.isPM!=null&&(s=n.isPM(e),s&&t<12&&(t+=12),!s&&t===12&&(t=0)),t)}function Iw(n){var t,e,s,r,i,o,a=!1,l=n._f.length;if(l===0){lt(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<l;r++)i=0,o=!1,t=Cl({},n),n._useUTC!=null&&(t._useUTC=n._useUTC),t._f=n._f[r],zl(t),xl(t)&&(o=!0),i+=lt(t).charsLeftOver,i+=lt(t).unusedTokens.length*10,lt(t).score=i,a?i<s&&(s=i,e=t):(s==null||i<s||o)&&(s=i,e=t,o&&(a=!0));Qn(n,e||t)}function Lw(n){if(!n._d){var t=Al(n._i),e=t.day===void 0?t.date:t.day;n._a=fh([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(s){return s&&parseInt(s,10)}),$l(n)}}function Bw(n){var t=new di(Vl(jh(n)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function jh(n){var t=n._i,e=n._f;return n._locale=n._locale||Rn(n._l),t===null||e===void 0&&t===""?wo({nullInput:!0}):(typeof t=="string"&&(n._i=t=n._locale.preparse(t)),We(t)?new di(Vl(t)):(hi(t)?n._d=t:Ye(e)?Iw(n):e?zl(n):Vw(n),xl(n)||(n._d=null),n))}function Vw(n){var t=n._i;be(t)?n._d=new Date(G.now()):hi(t)?n._d=new Date(t.valueOf()):typeof t=="string"?_w(n):Ye(t)?(n._a=fh(t.slice(0),function(e){return parseInt(e,10)}),$l(n)):_s(t)?Lw(n):Tn(t)?n._d=new Date(t):G.createFromInputFallback(n)}function $h(n,t,e,s,r){var i={};return(t===!0||t===!1)&&(s=t,t=void 0),(e===!0||e===!1)&&(s=e,e=void 0),(_s(n)&&bl(n)||Ye(n)&&n.length===0)&&(n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=e,i._i=n,i._f=t,i._strict=s,Bw(i)}function Pt(n,t,e,s){return $h(n,t,e,s,!1)}var jw=_e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Pt.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:wo()}),$w=_e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=Pt.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:wo()});function zh(n,t){var e,s;if(t.length===1&&Ye(t[0])&&(t=t[0]),!t.length)return Pt();for(e=t[0],s=1;s<t.length;++s)(!t[s].isValid()||t[s][n](e))&&(e=t[s]);return e}function zw(){var n=[].slice.call(arguments,0);return zh("isBefore",n)}function Fw(){var n=[].slice.call(arguments,0);return zh("isAfter",n)}var Hw=function(){return Date.now?Date.now():+new Date},vi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Uw(n){var t,e=!1,s,r=vi.length;for(t in n)if(yt(n,t)&&!(jt.call(vi,t)!==-1&&(n[t]==null||!isNaN(n[t]))))return!1;for(s=0;s<r;++s)if(n[vi[s]]){if(e)return!1;parseFloat(n[vi[s]])!==dt(n[vi[s]])&&(e=!0)}return!0}function Gw(){return this._isValid}function Yw(){return Je(NaN)}function ko(n){var t=Al(n),e=t.year||0,s=t.quarter||0,r=t.month||0,i=t.week||t.isoWeek||0,o=t.day||0,a=t.hour||0,l=t.minute||0,u=t.second||0,h=t.millisecond||0;this._isValid=Uw(t),this._milliseconds=+h+u*1e3+l*6e4+a*1e3*60*60,this._days=+o+i*7,this._months=+r+s*3+e*12,this._data={},this._locale=Rn(),this._bubble()}function Do(n){return n instanceof ko}function Fl(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function Ww(n,t,e){var s=Math.min(n.length,t.length),r=Math.abs(n.length-t.length),i=0,o;for(o=0;o<s;o++)dt(n[o])!==dt(t[o])&&i++;return i+r}function Fh(n,t){Q(n,0,0,function(){var e=this.utcOffset(),s="+";return e<0&&(e=-e,s="-"),s+pn(~~(e/60),2)+t+pn(~~e%60,2)})}Fh("Z",":"),Fh("ZZ",""),q("Z",Mo),q("ZZ",Mo),Ct(["Z","ZZ"],function(n,t,e){e._useUTC=!0,e._tzm=Hl(Mo,n)});var qw=/([\+\-]|\d\d)/gi;function Hl(n,t){var e=(t||"").match(n),s,r,i;return e===null?null:(s=e[e.length-1]||[],r=(s+"").match(qw)||["-",0,0],i=+(r[1]*60)+dt(r[2]),i===0?0:r[0]==="+"?i:-i)}function Ul(n,t){var e,s;return t._isUTC?(e=t.clone(),s=(We(n)||hi(n)?n.valueOf():Pt(n).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+s),G.updateOffset(e,!1),e):Pt(n).local()}function Gl(n){return-Math.round(n._d.getTimezoneOffset())}G.updateOffset=function(){};function Jw(n,t,e){var s=this._offset||0,r;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=Hl(Mo,n),n===null)return this}else Math.abs(n)<16&&!e&&(n=n*60);return!this._isUTC&&t&&(r=Gl(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!t||this._changeInProgress?Yh(this,Je(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,G.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Gl(this)}function Xw(n,t){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}function Kw(n){return this.utcOffset(0,n)}function Zw(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(Gl(this),"m")),this}function Qw(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=Hl(b0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function tx(n){return this.isValid()?(n=n?Pt(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function ex(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function nx(){if(!be(this._isDSTShifted))return this._isDSTShifted;var n={},t;return Cl(n,this),n=jh(n),n._a?(t=n._isUTC?fn(n._a):Pt(n._a),this._isDSTShifted=this.isValid()&&Ww(n._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function sx(){return this.isValid()?!this._isUTC:!1}function rx(){return this.isValid()?this._isUTC:!1}function Hh(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ix=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ox=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Je(n,t){var e=n,s=null,r,i,o;return Do(n)?e={ms:n._milliseconds,d:n._days,M:n._months}:Tn(n)||!isNaN(+n)?(e={},t?e[t]=+n:e.milliseconds=+n):(s=ix.exec(n))?(r=s[1]==="-"?-1:1,e={y:0,d:dt(s[mn])*r,h:dt(s[Xt])*r,m:dt(s[qe])*r,s:dt(s[kn])*r,ms:dt(Fl(s[ks]*1e3))*r}):(s=ox.exec(n))?(r=s[1]==="-"?-1:1,e={y:Ds(s[2],r),M:Ds(s[3],r),w:Ds(s[4],r),d:Ds(s[5],r),h:Ds(s[6],r),m:Ds(s[7],r),s:Ds(s[8],r)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(o=ax(Pt(e.from),Pt(e.to)),e={},e.ms=o.milliseconds,e.M=o.months),i=new ko(e),Do(n)&&yt(n,"_locale")&&(i._locale=n._locale),Do(n)&&yt(n,"_isValid")&&(i._isValid=n._isValid),i}Je.fn=ko.prototype,Je.invalid=Yw;function Ds(n,t){var e=n&&parseFloat(n.replace(",","."));return(isNaN(e)?0:e)*t}function Uh(n,t){var e={};return e.months=t.month()-n.month()+(t.year()-n.year())*12,n.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+n.clone().add(e.months,"M"),e}function ax(n,t){var e;return n.isValid()&&t.isValid()?(t=Ul(t,n),n.isBefore(t)?e=Uh(n,t):(e=Uh(t,n),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function Gh(n,t){return function(e,s){var r,i;return s!==null&&!isNaN(+s)&&(yh(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=e,e=s,s=i),r=Je(e,s),Yh(this,r,n),this}}function Yh(n,t,e,s){var r=t._milliseconds,i=Fl(t._days),o=Fl(t._months);n.isValid()&&(s=s??!0,o&&Ah(n,mi(n,"Month")+o*e),i&&Oh(n,"Date",mi(n,"Date")+i*e),r&&n._d.setTime(n._d.valueOf()+r*e),s&&G.updateOffset(n,i||o))}var lx=Gh(1,"add"),cx=Gh(-1,"subtract");function Wh(n){return typeof n=="string"||n instanceof String}function ux(n){return We(n)||hi(n)||Wh(n)||Tn(n)||dx(n)||hx(n)||n===null||n===void 0}function hx(n){var t=_s(n)&&!bl(n),e=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,i,o=s.length;for(r=0;r<o;r+=1)i=s[r],e=e||yt(n,i);return t&&e}function dx(n){var t=Ye(n),e=!1;return t&&(e=n.filter(function(s){return!Tn(s)&&Wh(n)}).length===0),t&&e}function fx(n){var t=_s(n)&&!bl(n),e=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,i;for(r=0;r<s.length;r+=1)i=s[r],e=e||yt(n,i);return t&&e}function gx(n,t){var e=n.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function px(n,t){arguments.length===1&&(arguments[0]?ux(arguments[0])?(n=arguments[0],t=void 0):fx(arguments[0])&&(t=arguments[0],n=void 0):(n=void 0,t=void 0));var e=n||Pt(),s=Ul(e,this).startOf("day"),r=G.calendarFormat(this,s)||"sameElse",i=t&&(gn(t[r])?t[r].call(this,e):t[r]);return this.format(i||this.localeData().calendar(r,this,Pt(e)))}function mx(){return new di(this)}function yx(n,t){var e=We(n)?n:Pt(n);return this.isValid()&&e.isValid()?(t=ke(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function bx(n,t){var e=We(n)?n:Pt(n);return this.isValid()&&e.isValid()?(t=ke(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function wx(n,t,e,s){var r=We(n)?n:Pt(n),i=We(t)?t:Pt(t);return this.isValid()&&r.isValid()&&i.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(r,e):!this.isBefore(r,e))&&(s[1]===")"?this.isBefore(i,e):!this.isAfter(i,e))):!1}function xx(n,t){var e=We(n)?n:Pt(n),s;return this.isValid()&&e.isValid()?(t=ke(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(s=e.valueOf(),this.clone().startOf(t).valueOf()<=s&&s<=this.clone().endOf(t).valueOf())):!1}function vx(n,t){return this.isSame(n,t)||this.isAfter(n,t)}function Cx(n,t){return this.isSame(n,t)||this.isBefore(n,t)}function Sx(n,t,e){var s,r,i;if(!this.isValid())return NaN;if(s=Ul(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,t=ke(t),t){case"year":i=Ro(this,s)/12;break;case"month":i=Ro(this,s);break;case"quarter":i=Ro(this,s)/3;break;case"second":i=(this-s)/1e3;break;case"minute":i=(this-s)/6e4;break;case"hour":i=(this-s)/36e5;break;case"day":i=(this-s-r)/864e5;break;case"week":i=(this-s-r)/6048e5;break;default:i=this-s}return e?i:De(i)}function Ro(n,t){if(n.date()<t.date())return-Ro(t,n);var e=(t.year()-n.year())*12+(t.month()-n.month()),s=n.clone().add(e,"months"),r,i;return t-s<0?(r=n.clone().add(e-1,"months"),i=(t-s)/(s-r)):(r=n.clone().add(e+1,"months"),i=(t-s)/(r-s)),-(e+i)||0}G.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",G.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ex(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ox(n){if(!this.isValid())return null;var t=n!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?vo(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):gn(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",vo(e,"Z")):vo(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Mx(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",t="",e,s,r,i;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+n+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(e+s+r+i)}function Px(n){n||(n=this.isUtc()?G.defaultFormatUtc:G.defaultFormat);var t=vo(this,n);return this.localeData().postformat(t)}function Ax(n,t){return this.isValid()&&(We(n)&&n.isValid()||Pt(n).isValid())?Je({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Tx(n){return this.from(Pt(),n)}function Nx(n,t){return this.isValid()&&(We(n)&&n.isValid()||Pt(n).isValid())?Je({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _x(n){return this.to(Pt(),n)}function qh(n){var t;return n===void 0?this._locale._abbr:(t=Rn(n),t!=null&&(this._locale=t),this)}var Jh=_e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function Xh(){return this._locale}var Io=1e3,ar=60*Io,Lo=60*ar,Kh=(365*400+97)*24*Lo;function lr(n,t){return(n%t+t)%t}function Zh(n,t,e){return n<100&&n>=0?new Date(n+400,t,e)-Kh:new Date(n,t,e).valueOf()}function Qh(n,t,e){return n<100&&n>=0?Date.UTC(n+400,t,e)-Kh:Date.UTC(n,t,e)}function kx(n){var t,e;if(n=ke(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?Qh:Zh,n){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=lr(t+(this._isUTC?0:this.utcOffset()*ar),Lo);break;case"minute":t=this._d.valueOf(),t-=lr(t,ar);break;case"second":t=this._d.valueOf(),t-=lr(t,Io);break}return this._d.setTime(t),G.updateOffset(this,!0),this}function Dx(n){var t,e;if(n=ke(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?Qh:Zh,n){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Lo-lr(t+(this._isUTC?0:this.utcOffset()*ar),Lo)-1;break;case"minute":t=this._d.valueOf(),t+=ar-lr(t,ar)-1;break;case"second":t=this._d.valueOf(),t+=Io-lr(t,Io)-1;break}return this._d.setTime(t),G.updateOffset(this,!0),this}function Rx(){return this._d.valueOf()-(this._offset||0)*6e4}function Ix(){return Math.floor(this.valueOf()/1e3)}function Lx(){return new Date(this.valueOf())}function Bx(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function Vx(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function jx(){return this.isValid()?this.toISOString():null}function $x(){return xl(this)}function zx(){return Qn({},lt(this))}function Fx(){return lt(this).overflow}function Hx(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Q("N",0,0,"eraAbbr"),Q("NN",0,0,"eraAbbr"),Q("NNN",0,0,"eraAbbr"),Q("NNNN",0,0,"eraName"),Q("NNNNN",0,0,"eraNarrow"),Q("y",["y",1],"yo","eraYear"),Q("y",["yy",2],0,"eraYear"),Q("y",["yyy",3],0,"eraYear"),Q("y",["yyyy",4],0,"eraYear"),q("N",Yl),q("NN",Yl),q("NNN",Yl),q("NNNN",t1),q("NNNNN",e1),Ct(["N","NN","NNN","NNNN","NNNNN"],function(n,t,e,s){var r=e._locale.erasParse(n,s,e._strict);r?lt(e).era=r:lt(e).invalidEra=n}),q("y",sr),q("yy",sr),q("yyy",sr),q("yyyy",sr),q("yo",n1),Ct(["y","yy","yyy","yyyy"],ce),Ct(["yo"],function(n,t,e,s){var r;e._locale._eraYearOrdinalRegex&&(r=n.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[ce]=e._locale.eraYearOrdinalParse(n,r):t[ce]=parseInt(n,10)});function Ux(n,t){var e,s,r,i=this._eras||Rn("en")._eras;for(e=0,s=i.length;e<s;++e){switch(typeof i[e].since){case"string":r=G(i[e].since).startOf("day"),i[e].since=r.valueOf();break}switch(typeof i[e].until){case"undefined":i[e].until=1/0;break;case"string":r=G(i[e].until).startOf("day").valueOf(),i[e].until=r.valueOf();break}}return i}function Gx(n,t,e){var s,r,i=this.eras(),o,a,l;for(n=n.toUpperCase(),s=0,r=i.length;s<r;++s)if(o=i[s].name.toUpperCase(),a=i[s].abbr.toUpperCase(),l=i[s].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===n)return i[s];break;case"NNNN":if(o===n)return i[s];break;case"NNNNN":if(l===n)return i[s];break}else if([o,a,l].indexOf(n)>=0)return i[s]}function Yx(n,t){var e=n.since<=n.until?1:-1;return t===void 0?G(n.since).year():G(n.since).year()+(t-n.offset)*e}function Wx(){var n,t,e,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),s[n].since<=e&&e<=s[n].until||s[n].until<=e&&e<=s[n].since)return s[n].name;return""}function qx(){var n,t,e,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),s[n].since<=e&&e<=s[n].until||s[n].until<=e&&e<=s[n].since)return s[n].narrow;return""}function Jx(){var n,t,e,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),s[n].since<=e&&e<=s[n].until||s[n].until<=e&&e<=s[n].since)return s[n].abbr;return""}function Xx(){var n,t,e,s,r=this.localeData().eras();for(n=0,t=r.length;n<t;++n)if(e=r[n].since<=r[n].until?1:-1,s=this.clone().startOf("day").valueOf(),r[n].since<=s&&s<=r[n].until||r[n].until<=s&&s<=r[n].since)return(this.year()-G(r[n].since).year())*e+r[n].offset;return this.year()}function Kx(n){return yt(this,"_erasNameRegex")||Wl.call(this),n?this._erasNameRegex:this._erasRegex}function Zx(n){return yt(this,"_erasAbbrRegex")||Wl.call(this),n?this._erasAbbrRegex:this._erasRegex}function Qx(n){return yt(this,"_erasNarrowRegex")||Wl.call(this),n?this._erasNarrowRegex:this._erasRegex}function Yl(n,t){return t.erasAbbrRegex(n)}function t1(n,t){return t.erasNameRegex(n)}function e1(n,t){return t.erasNarrowRegex(n)}function n1(n,t){return t._eraYearOrdinalRegex||sr}function Wl(){var n=[],t=[],e=[],s=[],r,i,o,a,l,u=this.eras();for(r=0,i=u.length;r<i;++r)o=Nn(u[r].name),a=Nn(u[r].abbr),l=Nn(u[r].narrow),t.push(o),n.push(a),e.push(l),s.push(o),s.push(a),s.push(l);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}Q(0,["gg",2],0,function(){return this.weekYear()%100}),Q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Bo(n,t){Q(0,[n,n.length],0,t)}Bo("gggg","weekYear"),Bo("ggggg","weekYear"),Bo("GGGG","isoWeekYear"),Bo("GGGGG","isoWeekYear"),q("G",Oo),q("g",Oo),q("GG",Mt,Me),q("gg",Mt,Me),q("GGGG",Nl,Tl),q("gggg",Nl,Tl),q("GGGGG",Eo,Co),q("ggggg",Eo,Co),gi(["gggg","ggggg","GGGG","GGGGG"],function(n,t,e,s){t[s.substr(0,2)]=dt(n)}),gi(["gg","GG"],function(n,t,e,s){t[s]=G.parseTwoDigitYear(n)});function s1(n){return td.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function r1(n){return td.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function i1(){return Dn(this.year(),1,4)}function o1(){return Dn(this.isoWeekYear(),1,4)}function a1(){var n=this.localeData()._week;return Dn(this.year(),n.dow,n.doy)}function l1(){var n=this.localeData()._week;return Dn(this.weekYear(),n.dow,n.doy)}function td(n,t,e,s,r){var i;return n==null?bi(this,s,r).year:(i=Dn(n,s,r),t>i&&(t=i),c1.call(this,n,t,e,s,r))}function c1(n,t,e,s,r){var i=_h(n,t,e,s,r),o=yi(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Q("Q",0,"Qo","quarter"),q("Q",xh),Ct("Q",function(n,t){t[_n]=(dt(n)-1)*3});function u1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}Q("D",["DD",2],"Do","date"),q("D",Mt,rr),q("DD",Mt,Me),q("Do",function(n,t){return n?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Ct(["D","DD"],mn),Ct("Do",function(n,t){t[mn]=dt(n.match(Mt)[0])});var ed=ir("Date",!0);Q("DDD",["DDDD",3],"DDDo","dayOfYear"),q("DDD",So),q("DDDD",vh),Ct(["DDD","DDDD"],function(n,t,e){e._dayOfYear=dt(n)});function h1(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?t:this.add(n-t,"d")}Q("m",["mm",2],0,"minute"),q("m",Mt,_l),q("mm",Mt,Me),Ct(["m","mm"],qe);var d1=ir("Minutes",!1);Q("s",["ss",2],0,"second"),q("s",Mt,_l),q("ss",Mt,Me),Ct(["s","ss"],kn);var f1=ir("Seconds",!1);Q("S",0,0,function(){return~~(this.millisecond()/100)}),Q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Q(0,["SSS",3],0,"millisecond"),Q(0,["SSSS",4],0,function(){return this.millisecond()*10}),Q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),q("S",So,xh),q("SS",So,Me),q("SSS",So,vh);var es,nd;for(es="SSSS";es.length<=9;es+="S")q(es,sr);function g1(n,t){t[ks]=dt(("0."+n)*1e3)}for(es="S";es.length<=9;es+="S")Ct(es,g1);nd=ir("Milliseconds",!1),Q("z",0,0,"zoneAbbr"),Q("zz",0,0,"zoneName");function p1(){return this._isUTC?"UTC":""}function m1(){return this._isUTC?"Coordinated Universal Time":""}var $=di.prototype;$.add=lx,$.calendar=px,$.clone=mx,$.diff=Sx,$.endOf=Dx,$.format=Px,$.from=Ax,$.fromNow=Tx,$.to=Nx,$.toNow=_x,$.get=M0,$.invalidAt=Fx,$.isAfter=yx,$.isBefore=bx,$.isBetween=wx,$.isSame=xx,$.isSameOrAfter=vx,$.isSameOrBefore=Cx,$.isValid=$x,$.lang=Jh,$.locale=qh,$.localeData=Xh,$.max=$w,$.min=jw,$.parsingFlags=zx,$.set=P0,$.startOf=kx,$.subtract=cx,$.toArray=Bx,$.toObject=Vx,$.toDate=Lx,$.toISOString=Ox,$.inspect=Mx,typeof Symbol<"u"&&Symbol.for!=null&&($[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),$.toJSON=jx,$.toString=Ex,$.unix=Ix,$.valueOf=Rx,$.creationData=Hx,$.eraName=Wx,$.eraNarrow=qx,$.eraAbbr=Jx,$.eraYear=Xx,$.year=Eh,$.isLeapYear=O0,$.weekYear=s1,$.isoWeekYear=r1,$.quarter=$.quarters=u1,$.month=Th,$.daysInMonth=L0,$.week=$.weeks=U0,$.isoWeek=$.isoWeeks=G0,$.weeksInYear=a1,$.weeksInWeekYear=l1,$.isoWeeksInYear=i1,$.isoWeeksInISOWeekYear=o1,$.date=ed,$.day=$.days=rw,$.weekday=iw,$.isoWeekday=ow,$.dayOfYear=h1,$.hour=$.hours=fw,$.minute=$.minutes=d1,$.second=$.seconds=f1,$.millisecond=$.milliseconds=nd,$.utcOffset=Jw,$.utc=Kw,$.local=Zw,$.parseZone=Qw,$.hasAlignedHourOffset=tx,$.isDST=ex,$.isLocal=sx,$.isUtcOffset=rx,$.isUtc=Hh,$.isUTC=Hh,$.zoneAbbr=p1,$.zoneName=m1,$.dates=_e("dates accessor is deprecated. Use date instead.",ed),$.months=_e("months accessor is deprecated. Use month instead",Th),$.years=_e("years accessor is deprecated. Use year instead",Eh),$.zone=_e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Xw),$.isDSTShifted=_e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",nx);function y1(n){return Pt(n*1e3)}function b1(){return Pt.apply(null,arguments).parseZone()}function sd(n){return n}var bt=El.prototype;bt.calendar=s0,bt.longDateFormat=a0,bt.invalidDate=c0,bt.ordinal=d0,bt.preparse=sd,bt.postformat=sd,bt.relativeTime=g0,bt.pastFuture=p0,bt.set=e0,bt.eras=Ux,bt.erasParse=Gx,bt.erasConvertYear=Yx,bt.erasAbbrRegex=Zx,bt.erasNameRegex=Kx,bt.erasNarrowRegex=Qx,bt.months=k0,bt.monthsShort=D0,bt.monthsParse=I0,bt.monthsRegex=V0,bt.monthsShortRegex=B0,bt.week=$0,bt.firstDayOfYear=H0,bt.firstDayOfWeek=F0,bt.weekdays=Q0,bt.weekdaysMin=ew,bt.weekdaysShort=tw,bt.weekdaysParse=sw,bt.weekdaysRegex=aw,bt.weekdaysShortRegex=lw,bt.weekdaysMinRegex=cw,bt.isPM=hw,bt.meridiem=gw;function Vo(n,t,e,s){var r=Rn(),i=fn().set(s,t);return r[e](i,n)}function rd(n,t,e){if(Tn(n)&&(t=n,n=void 0),n=n||"",t!=null)return Vo(n,t,e,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Vo(n,s,e,"month");return r}function ql(n,t,e,s){typeof n=="boolean"?(Tn(t)&&(e=t,t=void 0),t=t||""):(t=n,e=t,n=!1,Tn(t)&&(e=t,t=void 0),t=t||"");var r=Rn(),i=n?r._week.dow:0,o,a=[];if(e!=null)return Vo(t,(e+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Vo(t,(o+i)%7,s,"day");return a}function w1(n,t){return rd(n,t,"months")}function x1(n,t){return rd(n,t,"monthsShort")}function v1(n,t,e){return ql(n,t,e,"weekdays")}function C1(n,t,e){return ql(n,t,e,"weekdaysShort")}function S1(n,t,e){return ql(n,t,e,"weekdaysMin")}ts("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10,e=dt(n%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return n+e}}),G.lang=_e("moment.lang is deprecated. Use moment.locale instead.",ts),G.langData=_e("moment.langData is deprecated. Use moment.localeData instead.",Rn);var In=Math.abs;function E1(){var n=this._data;return this._milliseconds=In(this._milliseconds),this._days=In(this._days),this._months=In(this._months),n.milliseconds=In(n.milliseconds),n.seconds=In(n.seconds),n.minutes=In(n.minutes),n.hours=In(n.hours),n.months=In(n.months),n.years=In(n.years),this}function id(n,t,e,s){var r=Je(t,e);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function O1(n,t){return id(this,n,t,1)}function M1(n,t){return id(this,n,t,-1)}function od(n){return n<0?Math.floor(n):Math.ceil(n)}function P1(){var n=this._milliseconds,t=this._days,e=this._months,s=this._data,r,i,o,a,l;return n>=0&&t>=0&&e>=0||n<=0&&t<=0&&e<=0||(n+=od(Jl(e)+t)*864e5,t=0,e=0),s.milliseconds=n%1e3,r=De(n/1e3),s.seconds=r%60,i=De(r/60),s.minutes=i%60,o=De(i/60),s.hours=o%24,t+=De(o/24),l=De(ad(t)),e+=l,t-=od(Jl(l)),a=De(e/12),e%=12,s.days=t,s.months=e,s.years=a,this}function ad(n){return n*4800/146097}function Jl(n){return n*146097/4800}function A1(n){if(!this.isValid())return NaN;var t,e,s=this._milliseconds;if(n=ke(n),n==="month"||n==="quarter"||n==="year")switch(t=this._days+s/864e5,e=this._months+ad(t),n){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(Jl(this._months)),n){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return t*24+s/36e5;case"minute":return t*1440+s/6e4;case"second":return t*86400+s/1e3;case"millisecond":return Math.floor(t*864e5)+s;default:throw new Error("Unknown unit "+n)}}function Ln(n){return function(){return this.as(n)}}var ld=Ln("ms"),T1=Ln("s"),N1=Ln("m"),_1=Ln("h"),k1=Ln("d"),D1=Ln("w"),R1=Ln("M"),I1=Ln("Q"),L1=Ln("y"),B1=ld;function V1(){return Je(this)}function j1(n){return n=ke(n),this.isValid()?this[n+"s"]():NaN}function Rs(n){return function(){return this.isValid()?this._data[n]:NaN}}var $1=Rs("milliseconds"),z1=Rs("seconds"),F1=Rs("minutes"),H1=Rs("hours"),U1=Rs("days"),G1=Rs("months"),Y1=Rs("years");function W1(){return De(this.days()/7)}var Bn=Math.round,cr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function q1(n,t,e,s,r){return r.relativeTime(t||1,!!e,n,s)}function J1(n,t,e,s){var r=Je(n).abs(),i=Bn(r.as("s")),o=Bn(r.as("m")),a=Bn(r.as("h")),l=Bn(r.as("d")),u=Bn(r.as("M")),h=Bn(r.as("w")),f=Bn(r.as("y")),d=i<=e.ss&&["s",i]||i<e.s&&["ss",i]||o<=1&&["m"]||o<e.m&&["mm",o]||a<=1&&["h"]||a<e.h&&["hh",a]||l<=1&&["d"]||l<e.d&&["dd",l];return e.w!=null&&(d=d||h<=1&&["w"]||h<e.w&&["ww",h]),d=d||u<=1&&["M"]||u<e.M&&["MM",u]||f<=1&&["y"]||["yy",f],d[2]=t,d[3]=+n>0,d[4]=s,q1.apply(null,d)}function X1(n){return n===void 0?Bn:typeof n=="function"?(Bn=n,!0):!1}function K1(n,t){return cr[n]===void 0?!1:t===void 0?cr[n]:(cr[n]=t,n==="s"&&(cr.ss=t-1),!0)}function Z1(n,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,s=cr,r,i;return typeof n=="object"&&(t=n,n=!1),typeof n=="boolean"&&(e=n),typeof t=="object"&&(s=Object.assign({},cr,t),t.s!=null&&t.ss==null&&(s.ss=t.s-1)),r=this.localeData(),i=J1(this,!e,s,r),e&&(i=r.pastFuture(+this,i)),r.postformat(i)}var Xl=Math.abs;function ur(n){return(n>0)-(n<0)||+n}function jo(){if(!this.isValid())return this.localeData().invalidDate();var n=Xl(this._milliseconds)/1e3,t=Xl(this._days),e=Xl(this._months),s,r,i,o,a=this.asSeconds(),l,u,h,f;return a?(s=De(n/60),r=De(s/60),n%=60,s%=60,i=De(e/12),e%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=ur(this._months)!==ur(a)?"-":"",h=ur(this._days)!==ur(a)?"-":"",f=ur(this._milliseconds)!==ur(a)?"-":"",l+"P"+(i?u+i+"Y":"")+(e?u+e+"M":"")+(t?h+t+"D":"")+(r||s||n?"T":"")+(r?f+r+"H":"")+(s?f+s+"M":"")+(n?f+o+"S":"")):"P0D"}var mt=ko.prototype;mt.isValid=Gw,mt.abs=E1,mt.add=O1,mt.subtract=M1,mt.as=A1,mt.asMilliseconds=ld,mt.asSeconds=T1,mt.asMinutes=N1,mt.asHours=_1,mt.asDays=k1,mt.asWeeks=D1,mt.asMonths=R1,mt.asQuarters=I1,mt.asYears=L1,mt.valueOf=B1,mt._bubble=P1,mt.clone=V1,mt.get=j1,mt.milliseconds=$1,mt.seconds=z1,mt.minutes=F1,mt.hours=H1,mt.days=U1,mt.weeks=W1,mt.months=G1,mt.years=Y1,mt.humanize=Z1,mt.toISOString=jo,mt.toString=jo,mt.toJSON=jo,mt.locale=qh,mt.localeData=Xh,mt.toIsoString=_e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",jo),mt.lang=Jh,Q("X",0,0,"unix"),Q("x",0,0,"valueOf"),q("x",Oo),q("X",w0),Ct("X",function(n,t,e){e._d=new Date(parseFloat(n)*1e3)}),Ct("x",function(n,t,e){e._d=new Date(dt(n))});//! moment.js
|
|
10
|
+
G.version="2.30.1",Qb(Pt),G.fn=$,G.min=zw,G.max=Fw,G.now=Hw,G.utc=fn,G.unix=y1,G.months=w1,G.isDate=hi,G.locale=ts,G.invalid=wo,G.duration=Je,G.isMoment=We,G.weekdays=v1,G.parseZone=b1,G.localeData=Rn,G.isDuration=Do,G.monthsShort=x1,G.weekdaysMin=S1,G.defineLocale=Bl,G.updateLocale=bw,G.locales=ww,G.weekdaysShort=C1,G.normalizeUnits=ke,G.relativeTimeRounding=X1,G.relativeTimeThreshold=K1,G.calendarFormat=gx,G.prototype=$,G.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Q1='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',tv=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,cd=n=>Array.from(n.querySelectorAll(Q1)).filter(t=>ev(t)&&tv(t)),ev=n=>{if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.disabled)return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return!(n.type==="hidden"||n.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Vn=(n,t,{checkForDefaultPrevented:e=!0}={})=>r=>{const i=n==null?void 0:n(r);if(e===!1||!i)return t==null?void 0:t(r)};var ud;const Ut=typeof window<"u",nv=n=>typeof n=="string",hd=()=>{},sv=Ut&&((ud=window==null?void 0:window.navigator)==null?void 0:ud.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Kl(n){return typeof n=="function"?n():c.unref(n)}function rv(n){return n}function $o(n){return c.getCurrentScope()?(c.onScopeDispose(n),!0):!1}function iv(n,t=!0){c.getCurrentInstance()?c.onMounted(n):t?n():c.nextTick(n)}function ov(n,t,e={}){const{immediate:s=!0}=e,r=c.ref(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,o()}function l(...u){o(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,n(...u)},Kl(t))}return s&&(r.value=!0,Ut&&l()),$o(a),{isPending:c.readonly(r),start:l,stop:a}}function ns(n){var t;const e=Kl(n);return(t=e==null?void 0:e.$el)!=null?t:e}const Zl=Ut?window:void 0;function jn(...n){let t,e,s,r;if(nv(n[0])||Array.isArray(n[0])?([e,s,r]=n,t=Zl):[t,e,s,r]=n,!t)return hd;Array.isArray(e)||(e=[e]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(h=>h()),i.length=0},a=(h,f,d,g)=>(h.addEventListener(f,d,g),()=>h.removeEventListener(f,d,g)),l=c.watch(()=>[ns(t),Kl(r)],([h,f])=>{o(),h&&i.push(...e.flatMap(d=>s.map(g=>a(h,d,g,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),o()};return $o(u),u}let dd=!1;function av(n,t,e={}){const{window:s=Zl,ignore:r=[],capture:i=!0,detectIframe:o=!1}=e;if(!s)return;sv&&!dd&&(dd=!0,Array.from(s.document.body.children).forEach(d=>d.addEventListener("click",hd)));let a=!0;const l=d=>r.some(g=>{if(typeof g=="string")return Array.from(s.document.querySelectorAll(g)).some(p=>p===d.target||d.composedPath().includes(p));{const p=ns(g);return p&&(d.target===p||d.composedPath().includes(p))}}),h=[jn(s,"click",d=>{const g=ns(n);if(!(!g||g===d.target||d.composedPath().includes(g))){if(d.detail===0&&(a=!l(d)),!a){a=!0;return}t(d)}},{passive:!0,capture:i}),jn(s,"pointerdown",d=>{const g=ns(n);g&&(a=!d.composedPath().includes(g)&&!l(d))},{passive:!0}),o&&jn(s,"blur",d=>{var g;const p=ns(n);((g=s.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!(p!=null&&p.contains(s.document.activeElement))&&t(d)})].filter(Boolean);return()=>h.forEach(d=>d())}function lv(n,t=!1){const e=c.ref(),s=()=>e.value=!!n();return s(),iv(s,t),e}const fd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gd="__vueuse_ssr_handlers__";fd[gd]=fd[gd]||{};var pd=Object.getOwnPropertySymbols,cv=Object.prototype.hasOwnProperty,uv=Object.prototype.propertyIsEnumerable,hv=(n,t)=>{var e={};for(var s in n)cv.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&pd)for(var s of pd(n))t.indexOf(s)<0&&uv.call(n,s)&&(e[s]=n[s]);return e};function md(n,t,e={}){const s=e,{window:r=Zl}=s,i=hv(s,["window"]);let o;const a=lv(()=>r&&"ResizeObserver"in r),l=()=>{o&&(o.disconnect(),o=void 0)},u=c.watch(()=>ns(n),f=>{l(),a.value&&r&&f&&(o=new ResizeObserver(t),o.observe(f,i))},{immediate:!0,flush:"post"}),h=()=>{l(),u()};return $o(h),{isSupported:a,stop:h}}var yd;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(yd||(yd={}));var dv=Object.defineProperty,bd=Object.getOwnPropertySymbols,fv=Object.prototype.hasOwnProperty,gv=Object.prototype.propertyIsEnumerable,wd=(n,t,e)=>t in n?dv(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,pv=(n,t)=>{for(var e in t||(t={}))fv.call(t,e)&&wd(n,e,t[e]);if(bd)for(var e of bd(t))gv.call(t,e)&&wd(n,e,t[e]);return n};pv({linear:rv},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const mv=()=>Ut&&/firefox/i.test(window.navigator.userAgent);/**
|
|
11
11
|
* @vue/shared v3.5.12
|
|
12
12
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
13
|
* @license MIT
|
|
14
|
-
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ss=()=>{},mv=Object.prototype.hasOwnProperty,zo=(n,t)=>mv.call(n,t),yv=Array.isArray,Re=n=>typeof n=="function",Xe=n=>typeof n=="string",hr=n=>n!==null&&typeof n=="object",bv=n=>{const t=Object.create(null);return e=>t[e]||(t[e]=n(e))},wv=/-(\w)/g,xv=bv(n=>n.replace(wv,(t,e)=>e?e.toUpperCase():""));var xd=typeof global=="object"&&global&&global.Object===Object&&global,vv=typeof self=="object"&&self&&self.Object===Object&&self,Ke=xd||vv||Function("return this")(),Ie=Ke.Symbol,vd=Object.prototype,Cv=vd.hasOwnProperty,Sv=vd.toString,Ci=Ie?Ie.toStringTag:void 0;function Ev(n){var t=Cv.call(n,Ci),e=n[Ci];try{n[Ci]=void 0;var s=!0}catch{}var r=Sv.call(n);return s&&(t?n[Ci]=e:delete n[Ci]),r}var Ov=Object.prototype,Mv=Ov.toString;function Pv(n){return Mv.call(n)}var Av="[object Null]",Tv="[object Undefined]",Cd=Ie?Ie.toStringTag:void 0;function rs(n){return n==null?n===void 0?Tv:Av:Cd&&Cd in Object(n)?Ev(n):Pv(n)}function Ze(n){return n!=null&&typeof n=="object"}var Nv="[object Symbol]";function yn(n){return typeof n=="symbol"||Ze(n)&&rs(n)==Nv}function Fo(n,t){for(var e=-1,s=n==null?0:n.length,r=Array(s);++e<s;)r[e]=t(n[e],e,n);return r}var ue=Array.isArray,_v=1/0,Sd=Ie?Ie.prototype:void 0,Ed=Sd?Sd.toString:void 0;function Od(n){if(typeof n=="string")return n;if(ue(n))return Fo(n,Od)+"";if(yn(n))return Ed?Ed.call(n):"";var t=n+"";return t=="0"&&1/n==-_v?"-0":t}var kv=/\s/;function Dv(n){for(var t=n.length;t--&&kv.test(n.charAt(t)););return t}var Rv=/^\s+/;function Iv(n){return n&&n.slice(0,Dv(n)+1).replace(Rv,"")}function Lt(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var Md=NaN,Lv=/^[-+]0x[0-9a-f]+$/i,Bv=/^0b[01]+$/i,Vv=/^0o[0-7]+$/i,jv=parseInt;function Si(n){if(typeof n=="number")return n;if(yn(n))return Md;if(Lt(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Lt(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=Iv(n);var e=Bv.test(n);return e||Vv.test(n)?jv(n.slice(2),e?2:8):Lv.test(n)?Md:+n}function dr(n){return n}var $v="[object AsyncFunction]",zv="[object Function]",Fv="[object GeneratorFunction]",Hv="[object Proxy]";function tc(n){if(!Lt(n))return!1;var t=rs(n);return t==zv||t==Fv||t==$v||t==Hv}var ec=Ke["__core-js_shared__"],Pd=function(){var n=/[^.]+$/.exec(ec&&ec.keys&&ec.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Uv(n){return!!Pd&&Pd in n}var Gv=Function.prototype,Yv=Gv.toString;function Is(n){if(n!=null){try{return Yv.call(n)}catch{}try{return n+""}catch{}}return""}var Wv=/[\\^$.*+?()[\]{}|]/g,qv=/^\[object .+?Constructor\]$/,Jv=Function.prototype,Xv=Object.prototype,Kv=Jv.toString,Zv=Xv.hasOwnProperty,Qv=RegExp("^"+Kv.call(Zv).replace(Wv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tC(n){if(!Lt(n)||Uv(n))return!1;var t=tc(n)?Qv:qv;return t.test(Is(n))}function eC(n,t){return n==null?void 0:n[t]}function Ls(n,t){var e=eC(n,t);return tC(e)?e:void 0}var nc=Ls(Ke,"WeakMap"),Ad=Object.create,nC=function(){function n(){}return function(t){if(!Lt(t))return{};if(Ad)return Ad(t);n.prototype=t;var e=new n;return n.prototype=void 0,e}}();function Td(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function sC(){}function Nd(n,t){var e=-1,s=n.length;for(t||(t=Array(s));++e<s;)t[e]=n[e];return t}var rC=800,iC=16,oC=Date.now;function aC(n){var t=0,e=0;return function(){var s=oC(),r=iC-(s-e);if(e=s,r>0){if(++t>=rC)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function lC(n){return function(){return n}}var Ho=function(){try{var n=Ls(Object,"defineProperty");return n({},"",{}),n}catch{}}(),cC=Ho?function(n,t){return Ho(n,"toString",{configurable:!0,enumerable:!1,value:lC(t),writable:!0})}:dr,_d=aC(cC);function uC(n,t){for(var e=-1,s=n==null?0:n.length;++e<s&&t(n[e],e,n)!==!1;);return n}function hC(n,t,e,s){for(var r=n.length,i=e+-1;++i<r;)if(t(n[i],i,n))return i;return-1}function dC(n){return n!==n}function fC(n,t,e){for(var s=e-1,r=n.length;++s<r;)if(n[s]===t)return s;return-1}function gC(n,t,e){return t===t?fC(n,t,e):hC(n,dC,e)}function kd(n,t){var e=n==null?0:n.length;return!!e&&gC(n,t,0)>-1}var pC=9007199254740991,mC=/^(?:0|[1-9]\d*)$/;function Uo(n,t){var e=typeof n;return t=t??pC,!!t&&(e=="number"||e!="symbol"&&mC.test(n))&&n>-1&&n%1==0&&n<t}function Go(n,t,e){t=="__proto__"&&Ho?Ho(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function fr(n,t){return n===t||n!==n&&t!==t}var yC=Object.prototype,bC=yC.hasOwnProperty;function sc(n,t,e){var s=n[t];(!(bC.call(n,t)&&fr(s,e))||e===void 0&&!(t in n))&&Go(n,t,e)}function Ei(n,t,e,s){var r=!e;e||(e={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=n[a]),r?Go(e,a,l):sc(e,a,l)}return e}var Dd=Math.max;function Rd(n,t,e){return t=Dd(t===void 0?n.length-1:t,0),function(){for(var s=arguments,r=-1,i=Dd(s.length-t,0),o=Array(i);++r<i;)o[r]=s[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=s[r];return a[t]=e(o),Td(n,this,a)}}function gr(n,t){return _d(Rd(n,t,dr),n+"")}var wC=9007199254740991;function rc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wC}function Bs(n){return n!=null&&rc(n.length)&&!tc(n)}function Yo(n,t,e){if(!Lt(e))return!1;var s=typeof t;return(s=="number"?Bs(e)&&Uo(t,e.length):s=="string"&&t in e)?fr(e[t],n):!1}function Id(n){return gr(function(t,e){var s=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&Yo(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++s<r;){var a=e[s];a&&n(t,a,s,i)}return t})}var xC=Object.prototype;function Wo(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||xC;return n===e}function vC(n,t){for(var e=-1,s=Array(n);++e<n;)s[e]=t(e);return s}var CC="[object Arguments]";function Ld(n){return Ze(n)&&rs(n)==CC}var Bd=Object.prototype,SC=Bd.hasOwnProperty,EC=Bd.propertyIsEnumerable,pr=Ld(function(){return arguments}())?Ld:function(n){return Ze(n)&&SC.call(n,"callee")&&!EC.call(n,"callee")};function OC(){return!1}var Vd=typeof Rt=="object"&&Rt&&!Rt.nodeType&&Rt,jd=Vd&&typeof module=="object"&&module&&!module.nodeType&&module,MC=jd&&jd.exports===Vd,$d=MC?Ke.Buffer:void 0,PC=$d?$d.isBuffer:void 0,mr=PC||OC,AC="[object Arguments]",TC="[object Array]",NC="[object Boolean]",_C="[object Date]",kC="[object Error]",DC="[object Function]",RC="[object Map]",IC="[object Number]",LC="[object Object]",BC="[object RegExp]",VC="[object Set]",jC="[object String]",$C="[object WeakMap]",zC="[object ArrayBuffer]",FC="[object DataView]",HC="[object Float32Array]",UC="[object Float64Array]",GC="[object Int8Array]",YC="[object Int16Array]",WC="[object Int32Array]",qC="[object Uint8Array]",JC="[object Uint8ClampedArray]",XC="[object Uint16Array]",KC="[object Uint32Array]",At={};At[HC]=At[UC]=At[GC]=At[YC]=At[WC]=At[qC]=At[JC]=At[XC]=At[KC]=!0,At[AC]=At[TC]=At[zC]=At[NC]=At[FC]=At[_C]=At[kC]=At[DC]=At[RC]=At[IC]=At[LC]=At[BC]=At[VC]=At[jC]=At[$C]=!1;function ZC(n){return Ze(n)&&rc(n.length)&&!!At[rs(n)]}function qo(n){return function(t){return n(t)}}var zd=typeof Rt=="object"&&Rt&&!Rt.nodeType&&Rt,Oi=zd&&typeof module=="object"&&module&&!module.nodeType&&module,QC=Oi&&Oi.exports===zd,ic=QC&&xd.process,yr=function(){try{var n=Oi&&Oi.require&&Oi.require("util").types;return n||ic&&ic.binding&&ic.binding("util")}catch{}}(),Fd=yr&&yr.isTypedArray,Jo=Fd?qo(Fd):ZC,tS=Object.prototype,eS=tS.hasOwnProperty;function Hd(n,t){var e=ue(n),s=!e&&pr(n),r=!e&&!s&&mr(n),i=!e&&!s&&!r&&Jo(n),o=e||s||r||i,a=o?vC(n.length,String):[],l=a.length;for(var u in n)(t||eS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uo(u,l)))&&a.push(u);return a}function Ud(n,t){return function(e){return n(t(e))}}var nS=Ud(Object.keys,Object),sS=Object.prototype,rS=sS.hasOwnProperty;function Gd(n){if(!Wo(n))return nS(n);var t=[];for(var e in Object(n))rS.call(n,e)&&e!="constructor"&&t.push(e);return t}function Mi(n){return Bs(n)?Hd(n):Gd(n)}function iS(n){var t=[];if(n!=null)for(var e in Object(n))t.push(e);return t}var oS=Object.prototype,aS=oS.hasOwnProperty;function lS(n){if(!Lt(n))return iS(n);var t=Wo(n),e=[];for(var s in n)s=="constructor"&&(t||!aS.call(n,s))||e.push(s);return e}function br(n){return Bs(n)?Hd(n,!0):lS(n)}var cS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uS=/^\w*$/;function oc(n,t){if(ue(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||yn(n)?!0:uS.test(n)||!cS.test(n)||t!=null&&n in Object(t)}var Pi=Ls(Object,"create");function hS(){this.__data__=Pi?Pi(null):{},this.size=0}function dS(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var fS="__lodash_hash_undefined__",gS=Object.prototype,pS=gS.hasOwnProperty;function mS(n){var t=this.__data__;if(Pi){var e=t[n];return e===fS?void 0:e}return pS.call(t,n)?t[n]:void 0}var yS=Object.prototype,bS=yS.hasOwnProperty;function wS(n){var t=this.__data__;return Pi?t[n]!==void 0:bS.call(t,n)}var xS="__lodash_hash_undefined__";function vS(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=Pi&&t===void 0?xS:t,this}function Vs(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var s=n[t];this.set(s[0],s[1])}}Vs.prototype.clear=hS,Vs.prototype.delete=dS,Vs.prototype.get=mS,Vs.prototype.has=wS,Vs.prototype.set=vS;function CS(){this.__data__=[],this.size=0}function Xo(n,t){for(var e=n.length;e--;)if(fr(n[e][0],t))return e;return-1}var SS=Array.prototype,ES=SS.splice;function OS(n){var t=this.__data__,e=Xo(t,n);if(e<0)return!1;var s=t.length-1;return e==s?t.pop():ES.call(t,e,1),--this.size,!0}function MS(n){var t=this.__data__,e=Xo(t,n);return e<0?void 0:t[e][1]}function PS(n){return Xo(this.__data__,n)>-1}function AS(n,t){var e=this.__data__,s=Xo(e,n);return s<0?(++this.size,e.push([n,t])):e[s][1]=t,this}function $n(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var s=n[t];this.set(s[0],s[1])}}$n.prototype.clear=CS,$n.prototype.delete=OS,$n.prototype.get=MS,$n.prototype.has=PS,$n.prototype.set=AS;var Ai=Ls(Ke,"Map");function TS(){this.size=0,this.__data__={hash:new Vs,map:new(Ai||$n),string:new Vs}}function NS(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function Ko(n,t){var e=n.__data__;return NS(t)?e[typeof t=="string"?"string":"hash"]:e.map}function _S(n){var t=Ko(this,n).delete(n);return this.size-=t?1:0,t}function kS(n){return Ko(this,n).get(n)}function DS(n){return Ko(this,n).has(n)}function RS(n,t){var e=Ko(this,n),s=e.size;return e.set(n,t),this.size+=e.size==s?0:1,this}function zn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var s=n[t];this.set(s[0],s[1])}}zn.prototype.clear=TS,zn.prototype.delete=_S,zn.prototype.get=kS,zn.prototype.has=DS,zn.prototype.set=RS;var IS="Expected a function";function ac(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError(IS);var e=function(){var s=arguments,r=t?t.apply(this,s):s[0],i=e.cache;if(i.has(r))return i.get(r);var o=n.apply(this,s);return e.cache=i.set(r,o)||i,o};return e.cache=new(ac.Cache||zn),e}ac.Cache=zn;var LS=500;function BS(n){var t=ac(n,function(s){return e.size===LS&&e.clear(),s}),e=t.cache;return t}var VS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jS=/\\(\\)?/g,$S=BS(function(n){var t=[];return n.charCodeAt(0)===46&&t.push(""),n.replace(VS,function(e,s,r,i){t.push(r?i.replace(jS,"$1"):s||e)}),t});function Ti(n){return n==null?"":Od(n)}function Zo(n,t){return ue(n)?n:oc(n,t)?[n]:$S(Ti(n))}var zS=1/0;function Ni(n){if(typeof n=="string"||yn(n))return n;var t=n+"";return t=="0"&&1/n==-zS?"-0":t}function Qo(n,t){t=Zo(t,n);for(var e=0,s=t.length;n!=null&&e<s;)n=n[Ni(t[e++])];return e&&e==s?n:void 0}function Yd(n,t,e){var s=n==null?void 0:Qo(n,t);return s===void 0?e:s}function lc(n,t){for(var e=-1,s=t.length,r=n.length;++e<s;)n[r+e]=t[e];return n}var Wd=Ie?Ie.isConcatSpreadable:void 0;function FS(n){return ue(n)||pr(n)||!!(Wd&&n&&n[Wd])}function ta(n,t,e,s,r){var i=-1,o=n.length;for(e||(e=FS),r||(r=[]);++i<o;){var a=n[i];e(a)?lc(r,a):s||(r[r.length]=a)}return r}function HS(n){var t=n==null?0:n.length;return t?ta(n):[]}function US(n){return _d(Rd(n,void 0,HS),n+"")}var cc=Ud(Object.getPrototypeOf,Object),GS="[object Object]",YS=Function.prototype,WS=Object.prototype,qd=YS.toString,qS=WS.hasOwnProperty,JS=qd.call(Object);function bn(n){if(!Ze(n)||rs(n)!=GS)return!1;var t=cc(n);if(t===null)return!0;var e=qS.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&qd.call(e)==JS}function XS(n,t,e){var s=-1,r=n.length;t<0&&(t=-t>r?0:r+t),e=e>r?r:e,e<0&&(e+=r),r=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(r);++s<r;)i[s]=n[s+t];return i}function KS(n,t,e){var s=n.length;return e=e===void 0?s:e,!t&&e>=s?n:XS(n,t,e)}var ZS="\\ud800-\\udfff",QS="\\u0300-\\u036f",tE="\\ufe20-\\ufe2f",eE="\\u20d0-\\u20ff",nE=QS+tE+eE,sE="\\ufe0e\\ufe0f",rE="\\u200d",iE=RegExp("["+rE+ZS+nE+sE+"]");function Jd(n){return iE.test(n)}function oE(n){return n.split("")}var Xd="\\ud800-\\udfff",aE="\\u0300-\\u036f",lE="\\ufe20-\\ufe2f",cE="\\u20d0-\\u20ff",uE=aE+lE+cE,hE="\\ufe0e\\ufe0f",dE="["+Xd+"]",uc="["+uE+"]",hc="\\ud83c[\\udffb-\\udfff]",fE="(?:"+uc+"|"+hc+")",Kd="[^"+Xd+"]",Zd="(?:\\ud83c[\\udde6-\\uddff]){2}",Qd="[\\ud800-\\udbff][\\udc00-\\udfff]",gE="\\u200d",tf=fE+"?",ef="["+hE+"]?",pE="(?:"+gE+"(?:"+[Kd,Zd,Qd].join("|")+")"+ef+tf+")*",mE=ef+tf+pE,yE="(?:"+[Kd+uc+"?",uc,Zd,Qd,dE].join("|")+")",bE=RegExp(hc+"(?="+hc+")|"+yE+mE,"g");function wE(n){return n.match(bE)||[]}function xE(n){return Jd(n)?wE(n):oE(n)}function nf(n){return function(t){t=Ti(t);var e=Jd(t)?xE(t):void 0,s=e?e[0]:t.charAt(0),r=e?KS(e,1).join(""):t.slice(1);return s[n]()+r}}var ea=nf("toUpperCase");function vE(n){return ea(Ti(n).toLowerCase())}function CE(n,t,e,s){for(var r=-1,i=n==null?0:n.length;++r<i;)e=t(e,n[r],r,n);return e}function SE(n){return function(t){return n==null?void 0:n[t]}}var EE={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},OE=SE(EE),ME=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,PE="\\u0300-\\u036f",AE="\\ufe20-\\ufe2f",TE="\\u20d0-\\u20ff",NE=PE+AE+TE,_E="["+NE+"]",kE=RegExp(_E,"g");function DE(n){return n=Ti(n),n&&n.replace(ME,OE).replace(kE,"")}var RE=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function IE(n){return n.match(RE)||[]}var LE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function BE(n){return LE.test(n)}var sf="\\ud800-\\udfff",VE="\\u0300-\\u036f",jE="\\ufe20-\\ufe2f",$E="\\u20d0-\\u20ff",zE=VE+jE+$E,rf="\\u2700-\\u27bf",of="a-z\\xdf-\\xf6\\xf8-\\xff",FE="\\xac\\xb1\\xd7\\xf7",HE="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",UE="\\u2000-\\u206f",GE=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",af="A-Z\\xc0-\\xd6\\xd8-\\xde",YE="\\ufe0e\\ufe0f",lf=FE+HE+UE+GE,cf="['’]",uf="["+lf+"]",WE="["+zE+"]",hf="\\d+",qE="["+rf+"]",df="["+of+"]",ff="[^"+sf+lf+hf+rf+of+af+"]",JE="\\ud83c[\\udffb-\\udfff]",XE="(?:"+WE+"|"+JE+")",KE="[^"+sf+"]",gf="(?:\\ud83c[\\udde6-\\uddff]){2}",pf="[\\ud800-\\udbff][\\udc00-\\udfff]",wr="["+af+"]",ZE="\\u200d",mf="(?:"+df+"|"+ff+")",QE="(?:"+wr+"|"+ff+")",yf="(?:"+cf+"(?:d|ll|m|re|s|t|ve))?",bf="(?:"+cf+"(?:D|LL|M|RE|S|T|VE))?",wf=XE+"?",xf="["+YE+"]?",tO="(?:"+ZE+"(?:"+[KE,gf,pf].join("|")+")"+xf+wf+")*",eO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sO=xf+wf+tO,rO="(?:"+[qE,gf,pf].join("|")+")"+sO,iO=RegExp([wr+"?"+df+"+"+yf+"(?="+[uf,wr,"$"].join("|")+")",QE+"+"+bf+"(?="+[uf,wr+mf,"$"].join("|")+")",wr+"?"+mf+"+"+yf,wr+"+"+bf,nO,eO,hf,rO].join("|"),"g");function oO(n){return n.match(iO)||[]}function aO(n,t,e){return n=Ti(n),t=t,t===void 0?BE(n)?oO(n):IE(n):n.match(t)||[]}var lO="['’]",cO=RegExp(lO,"g");function vf(n){return function(t){return CE(aO(DE(t).replace(cO,"")),n,"")}}var na=vf(function(n,t,e){return t=t.toLowerCase(),n+(e?vE(t):t)});function uO(n,t,e){return n===n&&(e!==void 0&&(n=n<=e?n:e),t!==void 0&&(n=n>=t?n:t)),n}function we(n,t,e){return e===void 0&&(e=t,t=void 0),e!==void 0&&(e=Si(e),e=e===e?e:0),t!==void 0&&(t=Si(t),t=t===t?t:0),uO(Si(n),t,e)}function hO(){this.__data__=new $n,this.size=0}function dO(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}function fO(n){return this.__data__.get(n)}function gO(n){return this.__data__.has(n)}var pO=200;function mO(n,t){var e=this.__data__;if(e instanceof $n){var s=e.__data__;if(!Ai||s.length<pO-1)return s.push([n,t]),this.size=++e.size,this;e=this.__data__=new zn(s)}return e.set(n,t),this.size=e.size,this}function Qe(n){var t=this.__data__=new $n(n);this.size=t.size}Qe.prototype.clear=hO,Qe.prototype.delete=dO,Qe.prototype.get=fO,Qe.prototype.has=gO,Qe.prototype.set=mO;function yO(n,t){return n&&Ei(t,Mi(t),n)}function bO(n,t){return n&&Ei(t,br(t),n)}var Cf=typeof Rt=="object"&&Rt&&!Rt.nodeType&&Rt,Sf=Cf&&typeof module=="object"&&module&&!module.nodeType&&module,wO=Sf&&Sf.exports===Cf,Ef=wO?Ke.Buffer:void 0,Of=Ef?Ef.allocUnsafe:void 0;function Mf(n,t){if(t)return n.slice();var e=n.length,s=Of?Of(e):new n.constructor(e);return n.copy(s),s}function xO(n,t){for(var e=-1,s=n==null?0:n.length,r=0,i=[];++e<s;){var o=n[e];t(o,e,n)&&(i[r++]=o)}return i}function Pf(){return[]}var vO=Object.prototype,CO=vO.propertyIsEnumerable,Af=Object.getOwnPropertySymbols,dc=Af?function(n){return n==null?[]:(n=Object(n),xO(Af(n),function(t){return CO.call(n,t)}))}:Pf;function SO(n,t){return Ei(n,dc(n),t)}var EO=Object.getOwnPropertySymbols,Tf=EO?function(n){for(var t=[];n;)lc(t,dc(n)),n=cc(n);return t}:Pf;function OO(n,t){return Ei(n,Tf(n),t)}function Nf(n,t,e){var s=t(n);return ue(n)?s:lc(s,e(n))}function fc(n){return Nf(n,Mi,dc)}function MO(n){return Nf(n,br,Tf)}var gc=Ls(Ke,"DataView"),pc=Ls(Ke,"Promise"),xr=Ls(Ke,"Set"),_f="[object Map]",PO="[object Object]",kf="[object Promise]",Df="[object Set]",Rf="[object WeakMap]",If="[object DataView]",AO=Is(gc),TO=Is(Ai),NO=Is(pc),_O=Is(xr),kO=Is(nc),Le=rs;(gc&&Le(new gc(new ArrayBuffer(1)))!=If||Ai&&Le(new Ai)!=_f||pc&&Le(pc.resolve())!=kf||xr&&Le(new xr)!=Df||nc&&Le(new nc)!=Rf)&&(Le=function(n){var t=rs(n),e=t==PO?n.constructor:void 0,s=e?Is(e):"";if(s)switch(s){case AO:return If;case TO:return _f;case NO:return kf;case _O:return Df;case kO:return Rf}return t});var DO=Object.prototype,RO=DO.hasOwnProperty;function IO(n){var t=n.length,e=new n.constructor(t);return t&&typeof n[0]=="string"&&RO.call(n,"index")&&(e.index=n.index,e.input=n.input),e}var sa=Ke.Uint8Array;function mc(n){var t=new n.constructor(n.byteLength);return new sa(t).set(new sa(n)),t}function LO(n,t){var e=t?mc(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}var BO=/\w*$/;function VO(n){var t=new n.constructor(n.source,BO.exec(n));return t.lastIndex=n.lastIndex,t}var Lf=Ie?Ie.prototype:void 0,Bf=Lf?Lf.valueOf:void 0;function jO(n){return Bf?Object(Bf.call(n)):{}}function Vf(n,t){var e=t?mc(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}var $O="[object Boolean]",zO="[object Date]",FO="[object Map]",HO="[object Number]",UO="[object RegExp]",GO="[object Set]",YO="[object String]",WO="[object Symbol]",qO="[object ArrayBuffer]",JO="[object DataView]",XO="[object Float32Array]",KO="[object Float64Array]",ZO="[object Int8Array]",QO="[object Int16Array]",tM="[object Int32Array]",eM="[object Uint8Array]",nM="[object Uint8ClampedArray]",sM="[object Uint16Array]",rM="[object Uint32Array]";function iM(n,t,e){var s=n.constructor;switch(t){case qO:return mc(n);case $O:case zO:return new s(+n);case JO:return LO(n,e);case XO:case KO:case ZO:case QO:case tM:case eM:case nM:case sM:case rM:return Vf(n,e);case FO:return new s;case HO:case YO:return new s(n);case UO:return VO(n);case GO:return new s;case WO:return jO(n)}}function jf(n){return typeof n.constructor=="function"&&!Wo(n)?nC(cc(n)):{}}var oM="[object Map]";function aM(n){return Ze(n)&&Le(n)==oM}var $f=yr&&yr.isMap,lM=$f?qo($f):aM,cM="[object Set]";function uM(n){return Ze(n)&&Le(n)==cM}var zf=yr&&yr.isSet,hM=zf?qo(zf):uM,dM=1,fM=2,gM=4,Ff="[object Arguments]",pM="[object Array]",mM="[object Boolean]",yM="[object Date]",bM="[object Error]",Hf="[object Function]",wM="[object GeneratorFunction]",xM="[object Map]",vM="[object Number]",Uf="[object Object]",CM="[object RegExp]",SM="[object Set]",EM="[object String]",OM="[object Symbol]",MM="[object WeakMap]",PM="[object ArrayBuffer]",AM="[object DataView]",TM="[object Float32Array]",NM="[object Float64Array]",_M="[object Int8Array]",kM="[object Int16Array]",DM="[object Int32Array]",RM="[object Uint8Array]",IM="[object Uint8ClampedArray]",LM="[object Uint16Array]",BM="[object Uint32Array]",Ot={};Ot[Ff]=Ot[pM]=Ot[PM]=Ot[AM]=Ot[mM]=Ot[yM]=Ot[TM]=Ot[NM]=Ot[_M]=Ot[kM]=Ot[DM]=Ot[xM]=Ot[vM]=Ot[Uf]=Ot[CM]=Ot[SM]=Ot[EM]=Ot[OM]=Ot[RM]=Ot[IM]=Ot[LM]=Ot[BM]=!0,Ot[bM]=Ot[Hf]=Ot[MM]=!1;function _i(n,t,e,s,r,i){var o,a=t&dM,l=t&fM,u=t&gM;if(o!==void 0)return o;if(!Lt(n))return n;var h=ue(n);if(h){if(o=IO(n),!a)return Nd(n,o)}else{var f=Le(n),d=f==Hf||f==wM;if(mr(n))return Mf(n,a);if(f==Uf||f==Ff||d&&!r){if(o=l||d?{}:jf(n),!a)return l?OO(n,bO(o,n)):SO(n,yO(o,n))}else{if(!Ot[f])return r?n:{};o=iM(n,f,a)}}i||(i=new Qe);var g=i.get(n);if(g)return g;i.set(n,o),hM(n)?n.forEach(function(y){o.add(_i(y,t,e,y,n,i))}):lM(n)&&n.forEach(function(y,b){o.set(b,_i(y,t,e,b,n,i))});var p=u?l?MO:fc:l?br:Mi,m=h?void 0:p(n);return uC(m||n,function(y,b){m&&(b=y,y=n[b]),sc(o,b,_i(y,t,e,b,n,i))}),o}var VM=4;function yc(n){return _i(n,VM)}var jM=1,$M=4;function Tt(n){return _i(n,jM|$M)}var zM="__lodash_hash_undefined__";function FM(n){return this.__data__.set(n,zM),this}function HM(n){return this.__data__.has(n)}function vr(n){var t=-1,e=n==null?0:n.length;for(this.__data__=new zn;++t<e;)this.add(n[t])}vr.prototype.add=vr.prototype.push=FM,vr.prototype.has=HM;function UM(n,t){for(var e=-1,s=n==null?0:n.length;++e<s;)if(t(n[e],e,n))return!0;return!1}function bc(n,t){return n.has(t)}var GM=1,YM=2;function Gf(n,t,e,s,r,i){var o=e&GM,a=n.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var u=i.get(n),h=i.get(t);if(u&&h)return u==t&&h==n;var f=-1,d=!0,g=e&YM?new vr:void 0;for(i.set(n,t),i.set(t,n);++f<a;){var p=n[f],m=t[f];if(s)var y=o?s(m,p,f,t,n,i):s(p,m,f,n,t,i);if(y!==void 0){if(y)continue;d=!1;break}if(g){if(!UM(t,function(b,w){if(!bc(g,w)&&(p===b||r(p,b,e,s,i)))return g.push(w)})){d=!1;break}}else if(!(p===m||r(p,m,e,s,i))){d=!1;break}}return i.delete(n),i.delete(t),d}function WM(n){var t=-1,e=Array(n.size);return n.forEach(function(s,r){e[++t]=[r,s]}),e}function wc(n){var t=-1,e=Array(n.size);return n.forEach(function(s){e[++t]=s}),e}var qM=1,JM=2,XM="[object Boolean]",KM="[object Date]",ZM="[object Error]",QM="[object Map]",tP="[object Number]",eP="[object RegExp]",nP="[object Set]",sP="[object String]",rP="[object Symbol]",iP="[object ArrayBuffer]",oP="[object DataView]",Yf=Ie?Ie.prototype:void 0,xc=Yf?Yf.valueOf:void 0;function aP(n,t,e,s,r,i,o){switch(e){case oP:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case iP:return!(n.byteLength!=t.byteLength||!i(new sa(n),new sa(t)));case XM:case KM:case tP:return fr(+n,+t);case ZM:return n.name==t.name&&n.message==t.message;case eP:case sP:return n==t+"";case QM:var a=WM;case nP:var l=s&qM;if(a||(a=wc),n.size!=t.size&&!l)return!1;var u=o.get(n);if(u)return u==t;s|=JM,o.set(n,t);var h=Gf(a(n),a(t),s,r,i,o);return o.delete(n),h;case rP:if(xc)return xc.call(n)==xc.call(t)}return!1}var lP=1,cP=Object.prototype,uP=cP.hasOwnProperty;function hP(n,t,e,s,r,i){var o=e&lP,a=fc(n),l=a.length,u=fc(t),h=u.length;if(l!=h&&!o)return!1;for(var f=l;f--;){var d=a[f];if(!(o?d in t:uP.call(t,d)))return!1}var g=i.get(n),p=i.get(t);if(g&&p)return g==t&&p==n;var m=!0;i.set(n,t),i.set(t,n);for(var y=o;++f<l;){d=a[f];var b=n[d],w=t[d];if(s)var x=o?s(w,b,d,t,n,i):s(b,w,d,n,t,i);if(!(x===void 0?b===w||r(b,w,e,s,i):x)){m=!1;break}y||(y=d=="constructor")}if(m&&!y){var v=n.constructor,S=t.constructor;v!=S&&"constructor"in n&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(n),i.delete(t),m}var dP=1,Wf="[object Arguments]",qf="[object Array]",ra="[object Object]",fP=Object.prototype,Jf=fP.hasOwnProperty;function gP(n,t,e,s,r,i){var o=ue(n),a=ue(t),l=o?qf:Le(n),u=a?qf:Le(t);l=l==Wf?ra:l,u=u==Wf?ra:u;var h=l==ra,f=u==ra,d=l==u;if(d&&mr(n)){if(!mr(t))return!1;o=!0,h=!1}if(d&&!h)return i||(i=new Qe),o||Jo(n)?Gf(n,t,e,s,r,i):aP(n,t,l,e,s,r,i);if(!(e&dP)){var g=h&&Jf.call(n,"__wrapped__"),p=f&&Jf.call(t,"__wrapped__");if(g||p){var m=g?n.value():n,y=p?t.value():t;return i||(i=new Qe),r(m,y,e,s,i)}}return d?(i||(i=new Qe),hP(n,t,e,s,r,i)):!1}function ia(n,t,e,s,r){return n===t?!0:n==null||t==null||!Ze(n)&&!Ze(t)?n!==n&&t!==t:gP(n,t,e,s,ia,r)}var pP=1,mP=2;function yP(n,t,e,s){var r=e.length,i=r;if(n==null)return!i;for(n=Object(n);r--;){var o=e[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<i;){o=e[r];var a=o[0],l=n[a],u=o[1];if(o[2]){if(l===void 0&&!(a in n))return!1}else{var h=new Qe,f;if(!(f===void 0?ia(u,l,pP|mP,s,h):f))return!1}}return!0}function Xf(n){return n===n&&!Lt(n)}function bP(n){for(var t=Mi(n),e=t.length;e--;){var s=t[e],r=n[s];t[e]=[s,r,Xf(r)]}return t}function Kf(n,t){return function(e){return e==null?!1:e[n]===t&&(t!==void 0||n in Object(e))}}function wP(n){var t=bP(n);return t.length==1&&t[0][2]?Kf(t[0][0],t[0][1]):function(e){return e===n||yP(e,n,t)}}function xP(n,t){return n!=null&&t in Object(n)}function Zf(n,t,e){t=Zo(t,n);for(var s=-1,r=t.length,i=!1;++s<r;){var o=Ni(t[s]);if(!(i=n!=null&&e(n,o)))break;n=n[o]}return i||++s!=r?i:(r=n==null?0:n.length,!!r&&rc(r)&&Uo(o,r)&&(ue(n)||pr(n)))}function Qf(n,t){return n!=null&&Zf(n,t,xP)}var vP=1,CP=2;function SP(n,t){return oc(n)&&Xf(t)?Kf(Ni(n),t):function(e){var s=Yd(e,n);return s===void 0&&s===t?Qf(e,n):ia(t,s,vP|CP)}}function EP(n){return function(t){return t==null?void 0:t[n]}}function OP(n){return function(t){return Qo(t,n)}}function MP(n){return oc(n)?EP(Ni(n)):OP(n)}function vc(n){return typeof n=="function"?n:n==null?dr:typeof n=="object"?ue(n)?SP(n[0],n[1]):wP(n):MP(n)}function PP(n,t,e,s){for(var r=-1,i=n==null?0:n.length;++r<i;){var o=n[r];t(s,o,e(o),n)}return s}function AP(n){return function(t,e,s){for(var r=-1,i=Object(t),o=s(t),a=o.length;a--;){var l=o[++r];if(e(i[l],l,i)===!1)break}return t}}var tg=AP();function TP(n,t){return n&&tg(n,t,Mi)}function NP(n,t){return function(e,s){if(e==null)return e;if(!Bs(e))return n(e,s);for(var r=e.length,i=-1,o=Object(e);++i<r&&s(o[i],i,o)!==!1;);return e}}var eg=NP(TP);function _P(n,t,e,s){return eg(n,function(r,i,o){t(s,r,e(r),o)}),s}function kP(n,t){return function(e,s){var r=ue(e)?PP:_P,i=t?t():{};return r(e,n,vc(s),i)}}var Cc=function(){return Ke.Date.now()},DP="Expected a function",RP=Math.max,IP=Math.min;function ng(n,t,e){var s,r,i,o,a,l,u=0,h=!1,f=!1,d=!0;if(typeof n!="function")throw new TypeError(DP);t=Si(t)||0,Lt(e)&&(h=!!e.leading,f="maxWait"in e,i=f?RP(Si(e.maxWait)||0,t):i,d="trailing"in e?!!e.trailing:d);function g(E){var C=s,M=r;return s=r=void 0,u=E,o=n.apply(M,C),o}function p(E){return u=E,a=setTimeout(b,t),h?g(E):o}function m(E){var C=E-l,M=E-u,T=t-C;return f?IP(T,i-M):T}function y(E){var C=E-l,M=E-u;return l===void 0||C>=t||C<0||f&&M>=i}function b(){var E=Cc();if(y(E))return w(E);a=setTimeout(b,m(E))}function w(E){return a=void 0,d&&s?g(E):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=l=r=a=void 0}function v(){return a===void 0?o:w(Cc())}function S(){var E=Cc(),C=y(E);if(s=arguments,r=this,l=E,C){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(b,t),g(l)}return a===void 0&&(a=setTimeout(b,t)),o}return S.cancel=x,S.flush=v,S}var sg=Object.prototype,LP=sg.hasOwnProperty,BP=gr(function(n,t){n=Object(n);var e=-1,s=t.length,r=s>2?t[2]:void 0;for(r&&Yo(t[0],t[1],r)&&(s=1);++e<s;)for(var i=t[e],o=br(i),a=-1,l=o.length;++a<l;){var u=o[a],h=n[u];(h===void 0||fr(h,sg[u])&&!LP.call(n,u))&&(n[u]=i[u])}return n});function Sc(n,t,e){(e!==void 0&&!fr(n[t],e)||e===void 0&&!(t in n))&&Go(n,t,e)}function oa(n){return Ze(n)&&Bs(n)}function Ec(n,t){if(!(t==="constructor"&&typeof n[t]=="function")&&t!="__proto__")return n[t]}function VP(n){return Ei(n,br(n))}function jP(n,t,e,s,r,i,o){var a=Ec(n,e),l=Ec(t,e),u=o.get(l);if(u){Sc(n,e,u);return}var h=i?i(a,l,e+"",n,t,o):void 0,f=h===void 0;if(f){var d=ue(l),g=!d&&mr(l),p=!d&&!g&&Jo(l);h=l,d||g||p?ue(a)?h=a:oa(a)?h=Nd(a):g?(f=!1,h=Mf(l,!0)):p?(f=!1,h=Vf(l,!0)):h=[]:bn(l)||pr(l)?(h=a,pr(a)?h=VP(a):(!Lt(a)||tc(a))&&(h=jf(l))):f=!1}f&&(o.set(l,h),r(h,l,s,i,o),o.delete(l)),Sc(n,e,h)}function aa(n,t,e,s,r){n!==t&&tg(t,function(i,o){if(r||(r=new Qe),Lt(i))jP(n,t,o,e,aa,s,r);else{var a=s?s(Ec(n,o),i,o+"",n,t,r):void 0;a===void 0&&(a=i),Sc(n,o,a)}},br)}function rg(n,t,e,s,r,i){return Lt(n)&&Lt(t)&&(i.set(t,n),aa(n,t,void 0,rg,i),i.delete(t)),n}var $P=Id(function(n,t,e,s){aa(n,t,e,s)}),ig=gr(function(n){return n.push(void 0,rg),Td($P,void 0,n)}),zP=200;function FP(n,t,e,s){var r=-1,i=kd,o=!0,a=n.length,l=[],u=t.length;if(!a)return l;t.length>=zP&&(i=bc,o=!1,t=new vr(t));t:for(;++r<a;){var h=n[r],f=h;if(h=h!==0?h:0,o&&f===f){for(var d=u;d--;)if(t[d]===f)continue t;l.push(h)}else i(t,f,s)||l.push(h)}return l}var HP=gr(function(n,t){return oa(n)?FP(n,ta(t,1,oa,!0)):[]});function UP(n,t){var e=-1,s=Bs(n)?Array(n.length):[];return eg(n,function(r,i,o){s[++e]=t(r,i,o)}),s}function la(n){for(var t=-1,e=n==null?0:n.length,s={};++t<e;){var r=n[t];s[r[0]]=r[1]}return s}var GP=Object.prototype,YP=GP.hasOwnProperty,og=kP(function(n,t,e){YP.call(n,e)?n[e].push(t):Go(n,e,[t])});function WP(n,t){return n>t}var qP=Object.prototype,JP=qP.hasOwnProperty;function XP(n,t){return n!=null&&JP.call(n,t)}function ca(n,t){return n!=null&&Zf(n,t,XP)}var KP="[object Map]",ZP="[object Set]",QP=Object.prototype,t2=QP.hasOwnProperty;function ag(n){if(n==null)return!0;if(Bs(n)&&(ue(n)||typeof n=="string"||typeof n.splice=="function"||mr(n)||Jo(n)||pr(n)))return!n.length;var t=Le(n);if(t==KP||t==ZP)return!n.size;if(Wo(n))return!Gd(n).length;for(var e in n)if(t2.call(n,e))return!1;return!0}function wn(n,t){return ia(n,t)}var e2="[object Number]";function Oc(n){return typeof n=="number"||Ze(n)&&rs(n)==e2}function ua(n){return n==null}function n2(n){return n===void 0}var s2=nf("toLowerCase");function r2(n,t,e){for(var s=-1,r=n.length;++s<r;){var i=n[s],o=t(i);if(o!=null&&(a===void 0?o===o&&!yn(o):e(o,a)))var a=o,l=i}return l}function i2(n){return n&&n.length?r2(n,dr,WP):void 0}var Yt=Id(function(n,t,e){aa(n,t,e)});function o2(n,t,e,s){if(!Lt(n))return n;t=Zo(t,n);for(var r=-1,i=t.length,o=i-1,a=n;a!=null&&++r<i;){var l=Ni(t[r]),u=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return n;if(r!=o){var h=a[l];u=void 0,u===void 0&&(u=Lt(h)?h:Uo(t[r+1])?[]:{})}sc(a,l,u),a=a[l]}return n}function a2(n,t,e){for(var s=-1,r=t.length,i={};++s<r;){var o=t[s],a=Qo(n,o);e(a,o)&&o2(i,Zo(o,n),a)}return i}function l2(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}function c2(n,t){if(n!==t){var e=n!==void 0,s=n===null,r=n===n,i=yn(n),o=t!==void 0,a=t===null,l=t===t,u=yn(t);if(!a&&!u&&!i&&n>t||i&&o&&l&&!a&&!u||s&&o&&l||!e&&l||!r)return 1;if(!s&&!i&&!u&&n<t||u&&e&&r&&!s&&!i||a&&e&&r||!o&&r||!l)return-1}return 0}function u2(n,t,e){for(var s=-1,r=n.criteria,i=t.criteria,o=r.length,a=e.length;++s<o;){var l=c2(r[s],i[s]);if(l){if(s>=a)return l;var u=e[s];return l*(u=="desc"?-1:1)}}return n.index-t.index}function h2(n,t,e){t.length?t=Fo(t,function(i){return ue(i)?function(o){return Qo(o,i.length===1?i[0]:i)}:i}):t=[dr];var s=-1;t=Fo(t,qo(vc));var r=UP(n,function(i,o,a){var l=Fo(t,function(u){return u(i)});return{criteria:l,index:++s,value:i}});return l2(r,function(i,o){return u2(i,o,e)})}function d2(n,t){return a2(n,t,function(e,s){return Qf(n,s)})}var Mc=US(function(n,t){return n==null?{}:d2(n,t)}),Pc=gr(function(n,t){if(n==null)return[];var e=t.length;return e>1&&Yo(n,t[0],t[1])?t=[]:e>2&&Yo(t[0],t[1],t[2])&&(t=[t[0]]),h2(n,ta(t),[])}),f2=4294967295,g2=f2-1,p2=Math.floor,m2=Math.min;function lg(n,t,e,s){var r=0,i=n==null?0:n.length;if(i===0)return 0;t=e(t);for(var o=t!==t,a=t===null,l=yn(t),u=t===void 0;r<i;){var h=p2((r+i)/2),f=e(n[h]),d=f!==void 0,g=f===null,p=f===f,m=yn(f);if(o)var y=p;else u?y=p&&d:a?y=p&&d&&!g:l?y=p&&d&&!g&&!m:g||m?y=!1:y=f<t;y?r=h+1:i=h}return m2(i,g2)}var y2=4294967295,b2=y2>>>1;function w2(n,t,e){var s=0,r=n==null?s:n.length;if(typeof t=="number"&&t===t&&r<=b2){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!yn(o)&&o<t?s=i+1:r=i}return r}return lg(n,t,dr)}function x2(n,t){return w2(n,t)}function v2(n,t,e){return lg(n,t,vc(e))}var C2=vf(function(n,t,e){return n+(e?" ":"")+ea(t)}),S2="Expected a function";function E2(n,t,e){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(S2);return Lt(e)&&(s="leading"in e?!!e.leading:s,r="trailing"in e?!!e.trailing:r),ng(n,t,{leading:s,maxWait:t,trailing:r})}var O2=1/0,M2=xr&&1/wc(new xr([,-0]))[1]==O2?function(n){return new xr(n)}:sC,P2=200;function cg(n,t,e){var s=-1,r=kd,i=n.length,o=!0,a=[],l=a;if(i>=P2){var u=M2(n);if(u)return wc(u);o=!1,r=bc,l=new vr}else l=a;t:for(;++s<i;){var h=n[s],f=h;if(h=h!==0?h:0,o&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;a.push(h)}else r(l,f,e)||(l!==a&&l.push(f),a.push(h))}return a}var ug=gr(function(n){return cg(ta(n,1,oa,!0))});function hg(n){return n&&n.length?cg(n):[]}const dg=n=>n===void 0,ha=n=>typeof n=="boolean",Be=n=>typeof n=="number",Fn=n=>typeof Element>"u"?!1:n instanceof Element,A2=n=>Xe(n)?!Number.isNaN(Number(n)):!1,fg=n=>Object.keys(n);class gg extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function T2(n,t){throw new gg(`[${n}] ${t}`)}function Pe(n,t){if(process.env.NODE_ENV!=="production"){const e=Xe(n)?new gg(`[${n}] ${t}`):n;console.warn(e)}}const N2="utils/dom/style",pg=(n="")=>n.split(" ").filter(t=>!!t.trim()),mg=(n,t)=>{if(!n||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(t)},_2=(n,t)=>{!n||!t.trim()||n.classList.add(...pg(t))},k2=(n,t)=>{!n||!t.trim()||n.classList.remove(...pg(t))},D2=(n,t)=>{var e;if(!Gt||!n||!t)return"";let s=xv(t);s==="float"&&(s="cssFloat");try{const r=n.style[s];if(r)return r;const i=(e=document.defaultView)==null?void 0:e.getComputedStyle(n,"");return i?i[s]:""}catch{return n.style[s]}};function ki(n,t="px"){if(!n)return"";if(Be(n)||A2(n))return`${n}${t}`;if(Xe(n))return n;Pe(N2,"binding value must be a string or number")}let da;const R2=n=>{var t;if(!Gt)return 0;if(da!==void 0)return da;const e=document.createElement("div");e.className=`${n}-scrollbar__wrap`,e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);const s=e.offsetWidth;e.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",e.appendChild(r);const i=r.offsetWidth;return(t=e.parentNode)==null||t.removeChild(e),da=s-i,da};/*! Element Plus Icons Vue v2.3.1 */var I2=c.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),L2=I2,B2=c.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),c.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),V2=B2,j2=c.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),yg=j2,$2=c.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),c.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),bg=$2,z2=c.defineComponent({name:"Close",__name:"close",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),F2=z2,H2=c.defineComponent({name:"DeleteFilled",__name:"delete-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32"})]))}}),wg=H2,U2=c.defineComponent({name:"Document",__name:"document",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),G2=U2,Y2=c.defineComponent({name:"Hide",__name:"hide",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),c.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),W2=Y2,q2=c.defineComponent({name:"InfoFilled",__name:"info-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),xg=q2,J2=c.defineComponent({name:"Loading",__name:"loading",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),fa=J2,X2=c.defineComponent({name:"Plus",__name:"plus",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),K2=X2,Z2=c.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),vg=Z2,Q2=c.defineComponent({name:"View",__name:"view",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Cg=Q2,tA=c.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Sg=tA;const Eg="__epPropKey",ct=n=>n,eA=n=>hr(n)&&!!n[Eg],ga=(n,t)=>{if(!hr(n)||eA(n))return n;const{values:e,required:s,default:r,type:i,validator:o}=n,l={type:i,required:!!s,validator:e||o?u=>{let h=!1,f=[];if(e&&(f=Array.from(e),zo(n,"default")&&f.push(r),h||(h=f.includes(u))),o&&(h||(h=o(u))),!h&&f.length>0){const d=[...new Set(f)].map(g=>JSON.stringify(g)).join(", ");c.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${d}], got value ${JSON.stringify(u)}.`)}return h}:void 0,[Eg]:!0};return zo(n,"default")&&(l.default=r),l},Kt=n=>la(Object.entries(n).map(([t,e])=>[t,ga(e,t)])),Di=ct([String,Object,Function]),Og={Close:F2,SuccessFilled:vg,InfoFilled:xg,WarningFilled:Sg,CircleCloseFilled:yg},pa={success:vg,warning:Sg,error:yg,info:xg},nA={validating:fa,success:V2,error:bg},js=(n,t)=>{if(n.install=e=>{for(const s of[n,...Object.values(t??{})])e.component(s.name,s)},t)for(const[e,s]of Object.entries(t))n[e]=s;return n},sA=(n,t)=>(n.install=e=>{n._context=e._context,e.config.globalProperties[t]=n},n),rA=n=>(n.install=ss,n),Cr={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},Ac="update:modelValue",Mg=["","default","small","large"],iA=n=>["",...Mg].includes(n);var ma=(n=>(n[n.TEXT=1]="TEXT",n[n.CLASS=2]="CLASS",n[n.STYLE=4]="STYLE",n[n.PROPS=8]="PROPS",n[n.FULL_PROPS=16]="FULL_PROPS",n[n.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",n[n.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",n[n.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",n[n.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",n[n.NEED_PATCH=512]="NEED_PATCH",n[n.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",n[n.HOISTED=-1]="HOISTED",n[n.BAIL=-2]="BAIL",n))(ma||{});const oA=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),Pg=n=>n,aA=["class","style"],lA=/^on[A-Z]/,cA=(n={})=>{const{excludeListeners:t=!1,excludeKeys:e}=n,s=c.computed(()=>((e==null?void 0:e.value)||[]).concat(aA)),r=c.getCurrentInstance();return r?c.computed(()=>{var i;return la(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(t&&lA.test(o))))}):(Pe("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),c.computed(()=>({})))},uA=({from:n,replacement:t,scope:e,version:s,ref:r,type:i="API"},o)=>{c.watch(()=>c.unref(o),a=>{a&&Pe(e,`[${i}] ${n} is about to be deprecated in version ${s}, please use ${t} instead.
|
|
14
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ss=()=>{},yv=Object.prototype.hasOwnProperty,zo=(n,t)=>yv.call(n,t),bv=Array.isArray,Re=n=>typeof n=="function",Xe=n=>typeof n=="string",hr=n=>n!==null&&typeof n=="object",wv=n=>{const t=Object.create(null);return e=>t[e]||(t[e]=n(e))},xv=/-(\w)/g,vv=wv(n=>n.replace(xv,(t,e)=>e?e.toUpperCase():""));var xd=typeof global=="object"&&global&&global.Object===Object&&global,Cv=typeof self=="object"&&self&&self.Object===Object&&self,Ke=xd||Cv||Function("return this")(),Ie=Ke.Symbol,vd=Object.prototype,Sv=vd.hasOwnProperty,Ev=vd.toString,Ci=Ie?Ie.toStringTag:void 0;function Ov(n){var t=Sv.call(n,Ci),e=n[Ci];try{n[Ci]=void 0;var s=!0}catch{}var r=Ev.call(n);return s&&(t?n[Ci]=e:delete n[Ci]),r}var Mv=Object.prototype,Pv=Mv.toString;function Av(n){return Pv.call(n)}var Tv="[object Null]",Nv="[object Undefined]",Cd=Ie?Ie.toStringTag:void 0;function rs(n){return n==null?n===void 0?Nv:Tv:Cd&&Cd in Object(n)?Ov(n):Av(n)}function Ze(n){return n!=null&&typeof n=="object"}var _v="[object Symbol]";function yn(n){return typeof n=="symbol"||Ze(n)&&rs(n)==_v}function Fo(n,t){for(var e=-1,s=n==null?0:n.length,r=Array(s);++e<s;)r[e]=t(n[e],e,n);return r}var ue=Array.isArray,kv=1/0,Sd=Ie?Ie.prototype:void 0,Ed=Sd?Sd.toString:void 0;function Od(n){if(typeof n=="string")return n;if(ue(n))return Fo(n,Od)+"";if(yn(n))return Ed?Ed.call(n):"";var t=n+"";return t=="0"&&1/n==-kv?"-0":t}var Dv=/\s/;function Rv(n){for(var t=n.length;t--&&Dv.test(n.charAt(t)););return t}var Iv=/^\s+/;function Lv(n){return n&&n.slice(0,Rv(n)+1).replace(Iv,"")}function Lt(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var Md=NaN,Bv=/^[-+]0x[0-9a-f]+$/i,Vv=/^0b[01]+$/i,jv=/^0o[0-7]+$/i,$v=parseInt;function Si(n){if(typeof n=="number")return n;if(yn(n))return Md;if(Lt(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Lt(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=Lv(n);var e=Vv.test(n);return e||jv.test(n)?$v(n.slice(2),e?2:8):Bv.test(n)?Md:+n}function dr(n){return n}var zv="[object AsyncFunction]",Fv="[object Function]",Hv="[object GeneratorFunction]",Uv="[object Proxy]";function Ql(n){if(!Lt(n))return!1;var t=rs(n);return t==Fv||t==Hv||t==zv||t==Uv}var tc=Ke["__core-js_shared__"],Pd=function(){var n=/[^.]+$/.exec(tc&&tc.keys&&tc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Gv(n){return!!Pd&&Pd in n}var Yv=Function.prototype,Wv=Yv.toString;function Is(n){if(n!=null){try{return Wv.call(n)}catch{}try{return n+""}catch{}}return""}var qv=/[\\^$.*+?()[\]{}|]/g,Jv=/^\[object .+?Constructor\]$/,Xv=Function.prototype,Kv=Object.prototype,Zv=Xv.toString,Qv=Kv.hasOwnProperty,tC=RegExp("^"+Zv.call(Qv).replace(qv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function eC(n){if(!Lt(n)||Gv(n))return!1;var t=Ql(n)?tC:Jv;return t.test(Is(n))}function nC(n,t){return n==null?void 0:n[t]}function Ls(n,t){var e=nC(n,t);return eC(e)?e:void 0}var ec=Ls(Ke,"WeakMap"),Ad=Object.create,sC=function(){function n(){}return function(t){if(!Lt(t))return{};if(Ad)return Ad(t);n.prototype=t;var e=new n;return n.prototype=void 0,e}}();function Td(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function rC(){}function Nd(n,t){var e=-1,s=n.length;for(t||(t=Array(s));++e<s;)t[e]=n[e];return t}var iC=800,oC=16,aC=Date.now;function lC(n){var t=0,e=0;return function(){var s=aC(),r=oC-(s-e);if(e=s,r>0){if(++t>=iC)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function cC(n){return function(){return n}}var Ho=function(){try{var n=Ls(Object,"defineProperty");return n({},"",{}),n}catch{}}(),uC=Ho?function(n,t){return Ho(n,"toString",{configurable:!0,enumerable:!1,value:cC(t),writable:!0})}:dr,_d=lC(uC);function hC(n,t){for(var e=-1,s=n==null?0:n.length;++e<s&&t(n[e],e,n)!==!1;);return n}function dC(n,t,e,s){for(var r=n.length,i=e+-1;++i<r;)if(t(n[i],i,n))return i;return-1}function fC(n){return n!==n}function gC(n,t,e){for(var s=e-1,r=n.length;++s<r;)if(n[s]===t)return s;return-1}function pC(n,t,e){return t===t?gC(n,t,e):dC(n,fC,e)}function kd(n,t){var e=n==null?0:n.length;return!!e&&pC(n,t,0)>-1}var mC=9007199254740991,yC=/^(?:0|[1-9]\d*)$/;function Uo(n,t){var e=typeof n;return t=t??mC,!!t&&(e=="number"||e!="symbol"&&yC.test(n))&&n>-1&&n%1==0&&n<t}function Go(n,t,e){t=="__proto__"&&Ho?Ho(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function fr(n,t){return n===t||n!==n&&t!==t}var bC=Object.prototype,wC=bC.hasOwnProperty;function nc(n,t,e){var s=n[t];(!(wC.call(n,t)&&fr(s,e))||e===void 0&&!(t in n))&&Go(n,t,e)}function Ei(n,t,e,s){var r=!e;e||(e={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=n[a]),r?Go(e,a,l):nc(e,a,l)}return e}var Dd=Math.max;function Rd(n,t,e){return t=Dd(t===void 0?n.length-1:t,0),function(){for(var s=arguments,r=-1,i=Dd(s.length-t,0),o=Array(i);++r<i;)o[r]=s[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=s[r];return a[t]=e(o),Td(n,this,a)}}function gr(n,t){return _d(Rd(n,t,dr),n+"")}var xC=9007199254740991;function sc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=xC}function Bs(n){return n!=null&&sc(n.length)&&!Ql(n)}function Yo(n,t,e){if(!Lt(e))return!1;var s=typeof t;return(s=="number"?Bs(e)&&Uo(t,e.length):s=="string"&&t in e)?fr(e[t],n):!1}function Id(n){return gr(function(t,e){var s=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&Yo(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++s<r;){var a=e[s];a&&n(t,a,s,i)}return t})}var vC=Object.prototype;function Wo(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||vC;return n===e}function CC(n,t){for(var e=-1,s=Array(n);++e<n;)s[e]=t(e);return s}var SC="[object Arguments]";function Ld(n){return Ze(n)&&rs(n)==SC}var Bd=Object.prototype,EC=Bd.hasOwnProperty,OC=Bd.propertyIsEnumerable,pr=Ld(function(){return arguments}())?Ld:function(n){return Ze(n)&&EC.call(n,"callee")&&!OC.call(n,"callee")};function MC(){return!1}var Vd=typeof Rt=="object"&&Rt&&!Rt.nodeType&&Rt,jd=Vd&&typeof module=="object"&&module&&!module.nodeType&&module,PC=jd&&jd.exports===Vd,$d=PC?Ke.Buffer:void 0,AC=$d?$d.isBuffer:void 0,mr=AC||MC,TC="[object Arguments]",NC="[object Array]",_C="[object Boolean]",kC="[object Date]",DC="[object Error]",RC="[object Function]",IC="[object Map]",LC="[object Number]",BC="[object Object]",VC="[object RegExp]",jC="[object Set]",$C="[object String]",zC="[object WeakMap]",FC="[object ArrayBuffer]",HC="[object DataView]",UC="[object Float32Array]",GC="[object Float64Array]",YC="[object Int8Array]",WC="[object Int16Array]",qC="[object Int32Array]",JC="[object Uint8Array]",XC="[object Uint8ClampedArray]",KC="[object Uint16Array]",ZC="[object Uint32Array]",At={};At[UC]=At[GC]=At[YC]=At[WC]=At[qC]=At[JC]=At[XC]=At[KC]=At[ZC]=!0,At[TC]=At[NC]=At[FC]=At[_C]=At[HC]=At[kC]=At[DC]=At[RC]=At[IC]=At[LC]=At[BC]=At[VC]=At[jC]=At[$C]=At[zC]=!1;function QC(n){return Ze(n)&&sc(n.length)&&!!At[rs(n)]}function qo(n){return function(t){return n(t)}}var zd=typeof Rt=="object"&&Rt&&!Rt.nodeType&&Rt,Oi=zd&&typeof module=="object"&&module&&!module.nodeType&&module,tS=Oi&&Oi.exports===zd,rc=tS&&xd.process,yr=function(){try{var n=Oi&&Oi.require&&Oi.require("util").types;return n||rc&&rc.binding&&rc.binding("util")}catch{}}(),Fd=yr&&yr.isTypedArray,Jo=Fd?qo(Fd):QC,eS=Object.prototype,nS=eS.hasOwnProperty;function Hd(n,t){var e=ue(n),s=!e&&pr(n),r=!e&&!s&&mr(n),i=!e&&!s&&!r&&Jo(n),o=e||s||r||i,a=o?CC(n.length,String):[],l=a.length;for(var u in n)(t||nS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Uo(u,l)))&&a.push(u);return a}function Ud(n,t){return function(e){return n(t(e))}}var sS=Ud(Object.keys,Object),rS=Object.prototype,iS=rS.hasOwnProperty;function Gd(n){if(!Wo(n))return sS(n);var t=[];for(var e in Object(n))iS.call(n,e)&&e!="constructor"&&t.push(e);return t}function Mi(n){return Bs(n)?Hd(n):Gd(n)}function oS(n){var t=[];if(n!=null)for(var e in Object(n))t.push(e);return t}var aS=Object.prototype,lS=aS.hasOwnProperty;function cS(n){if(!Lt(n))return oS(n);var t=Wo(n),e=[];for(var s in n)s=="constructor"&&(t||!lS.call(n,s))||e.push(s);return e}function br(n){return Bs(n)?Hd(n,!0):cS(n)}var uS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hS=/^\w*$/;function ic(n,t){if(ue(n))return!1;var e=typeof n;return e=="number"||e=="symbol"||e=="boolean"||n==null||yn(n)?!0:hS.test(n)||!uS.test(n)||t!=null&&n in Object(t)}var Pi=Ls(Object,"create");function dS(){this.__data__=Pi?Pi(null):{},this.size=0}function fS(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var gS="__lodash_hash_undefined__",pS=Object.prototype,mS=pS.hasOwnProperty;function yS(n){var t=this.__data__;if(Pi){var e=t[n];return e===gS?void 0:e}return mS.call(t,n)?t[n]:void 0}var bS=Object.prototype,wS=bS.hasOwnProperty;function xS(n){var t=this.__data__;return Pi?t[n]!==void 0:wS.call(t,n)}var vS="__lodash_hash_undefined__";function CS(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=Pi&&t===void 0?vS:t,this}function Vs(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var s=n[t];this.set(s[0],s[1])}}Vs.prototype.clear=dS,Vs.prototype.delete=fS,Vs.prototype.get=yS,Vs.prototype.has=xS,Vs.prototype.set=CS;function SS(){this.__data__=[],this.size=0}function Xo(n,t){for(var e=n.length;e--;)if(fr(n[e][0],t))return e;return-1}var ES=Array.prototype,OS=ES.splice;function MS(n){var t=this.__data__,e=Xo(t,n);if(e<0)return!1;var s=t.length-1;return e==s?t.pop():OS.call(t,e,1),--this.size,!0}function PS(n){var t=this.__data__,e=Xo(t,n);return e<0?void 0:t[e][1]}function AS(n){return Xo(this.__data__,n)>-1}function TS(n,t){var e=this.__data__,s=Xo(e,n);return s<0?(++this.size,e.push([n,t])):e[s][1]=t,this}function $n(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var s=n[t];this.set(s[0],s[1])}}$n.prototype.clear=SS,$n.prototype.delete=MS,$n.prototype.get=PS,$n.prototype.has=AS,$n.prototype.set=TS;var Ai=Ls(Ke,"Map");function NS(){this.size=0,this.__data__={hash:new Vs,map:new(Ai||$n),string:new Vs}}function _S(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function Ko(n,t){var e=n.__data__;return _S(t)?e[typeof t=="string"?"string":"hash"]:e.map}function kS(n){var t=Ko(this,n).delete(n);return this.size-=t?1:0,t}function DS(n){return Ko(this,n).get(n)}function RS(n){return Ko(this,n).has(n)}function IS(n,t){var e=Ko(this,n),s=e.size;return e.set(n,t),this.size+=e.size==s?0:1,this}function zn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t<e;){var s=n[t];this.set(s[0],s[1])}}zn.prototype.clear=NS,zn.prototype.delete=kS,zn.prototype.get=DS,zn.prototype.has=RS,zn.prototype.set=IS;var LS="Expected a function";function oc(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError(LS);var e=function(){var s=arguments,r=t?t.apply(this,s):s[0],i=e.cache;if(i.has(r))return i.get(r);var o=n.apply(this,s);return e.cache=i.set(r,o)||i,o};return e.cache=new(oc.Cache||zn),e}oc.Cache=zn;var BS=500;function VS(n){var t=oc(n,function(s){return e.size===BS&&e.clear(),s}),e=t.cache;return t}var jS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$S=/\\(\\)?/g,zS=VS(function(n){var t=[];return n.charCodeAt(0)===46&&t.push(""),n.replace(jS,function(e,s,r,i){t.push(r?i.replace($S,"$1"):s||e)}),t});function Ti(n){return n==null?"":Od(n)}function Zo(n,t){return ue(n)?n:ic(n,t)?[n]:zS(Ti(n))}var FS=1/0;function Ni(n){if(typeof n=="string"||yn(n))return n;var t=n+"";return t=="0"&&1/n==-FS?"-0":t}function Qo(n,t){t=Zo(t,n);for(var e=0,s=t.length;n!=null&&e<s;)n=n[Ni(t[e++])];return e&&e==s?n:void 0}function Yd(n,t,e){var s=n==null?void 0:Qo(n,t);return s===void 0?e:s}function ac(n,t){for(var e=-1,s=t.length,r=n.length;++e<s;)n[r+e]=t[e];return n}var Wd=Ie?Ie.isConcatSpreadable:void 0;function HS(n){return ue(n)||pr(n)||!!(Wd&&n&&n[Wd])}function ta(n,t,e,s,r){var i=-1,o=n.length;for(e||(e=HS),r||(r=[]);++i<o;){var a=n[i];e(a)?ac(r,a):s||(r[r.length]=a)}return r}function US(n){var t=n==null?0:n.length;return t?ta(n):[]}function GS(n){return _d(Rd(n,void 0,US),n+"")}var lc=Ud(Object.getPrototypeOf,Object),YS="[object Object]",WS=Function.prototype,qS=Object.prototype,qd=WS.toString,JS=qS.hasOwnProperty,XS=qd.call(Object);function bn(n){if(!Ze(n)||rs(n)!=YS)return!1;var t=lc(n);if(t===null)return!0;var e=JS.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&qd.call(e)==XS}function KS(n,t,e){var s=-1,r=n.length;t<0&&(t=-t>r?0:r+t),e=e>r?r:e,e<0&&(e+=r),r=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(r);++s<r;)i[s]=n[s+t];return i}function ZS(n,t,e){var s=n.length;return e=e===void 0?s:e,!t&&e>=s?n:KS(n,t,e)}var QS="\\ud800-\\udfff",tE="\\u0300-\\u036f",eE="\\ufe20-\\ufe2f",nE="\\u20d0-\\u20ff",sE=tE+eE+nE,rE="\\ufe0e\\ufe0f",iE="\\u200d",oE=RegExp("["+iE+QS+sE+rE+"]");function Jd(n){return oE.test(n)}function aE(n){return n.split("")}var Xd="\\ud800-\\udfff",lE="\\u0300-\\u036f",cE="\\ufe20-\\ufe2f",uE="\\u20d0-\\u20ff",hE=lE+cE+uE,dE="\\ufe0e\\ufe0f",fE="["+Xd+"]",cc="["+hE+"]",uc="\\ud83c[\\udffb-\\udfff]",gE="(?:"+cc+"|"+uc+")",Kd="[^"+Xd+"]",Zd="(?:\\ud83c[\\udde6-\\uddff]){2}",Qd="[\\ud800-\\udbff][\\udc00-\\udfff]",pE="\\u200d",tf=gE+"?",ef="["+dE+"]?",mE="(?:"+pE+"(?:"+[Kd,Zd,Qd].join("|")+")"+ef+tf+")*",yE=ef+tf+mE,bE="(?:"+[Kd+cc+"?",cc,Zd,Qd,fE].join("|")+")",wE=RegExp(uc+"(?="+uc+")|"+bE+yE,"g");function xE(n){return n.match(wE)||[]}function vE(n){return Jd(n)?xE(n):aE(n)}function nf(n){return function(t){t=Ti(t);var e=Jd(t)?vE(t):void 0,s=e?e[0]:t.charAt(0),r=e?ZS(e,1).join(""):t.slice(1);return s[n]()+r}}var ea=nf("toUpperCase");function CE(n){return ea(Ti(n).toLowerCase())}function SE(n,t,e,s){for(var r=-1,i=n==null?0:n.length;++r<i;)e=t(e,n[r],r,n);return e}function EE(n){return function(t){return n==null?void 0:n[t]}}var OE={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ME=EE(OE),PE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,AE="\\u0300-\\u036f",TE="\\ufe20-\\ufe2f",NE="\\u20d0-\\u20ff",_E=AE+TE+NE,kE="["+_E+"]",DE=RegExp(kE,"g");function RE(n){return n=Ti(n),n&&n.replace(PE,ME).replace(DE,"")}var IE=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function LE(n){return n.match(IE)||[]}var BE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function VE(n){return BE.test(n)}var sf="\\ud800-\\udfff",jE="\\u0300-\\u036f",$E="\\ufe20-\\ufe2f",zE="\\u20d0-\\u20ff",FE=jE+$E+zE,rf="\\u2700-\\u27bf",of="a-z\\xdf-\\xf6\\xf8-\\xff",HE="\\xac\\xb1\\xd7\\xf7",UE="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",GE="\\u2000-\\u206f",YE=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",af="A-Z\\xc0-\\xd6\\xd8-\\xde",WE="\\ufe0e\\ufe0f",lf=HE+UE+GE+YE,cf="['’]",uf="["+lf+"]",qE="["+FE+"]",hf="\\d+",JE="["+rf+"]",df="["+of+"]",ff="[^"+sf+lf+hf+rf+of+af+"]",XE="\\ud83c[\\udffb-\\udfff]",KE="(?:"+qE+"|"+XE+")",ZE="[^"+sf+"]",gf="(?:\\ud83c[\\udde6-\\uddff]){2}",pf="[\\ud800-\\udbff][\\udc00-\\udfff]",wr="["+af+"]",QE="\\u200d",mf="(?:"+df+"|"+ff+")",tO="(?:"+wr+"|"+ff+")",yf="(?:"+cf+"(?:d|ll|m|re|s|t|ve))?",bf="(?:"+cf+"(?:D|LL|M|RE|S|T|VE))?",wf=KE+"?",xf="["+WE+"]?",eO="(?:"+QE+"(?:"+[ZE,gf,pf].join("|")+")"+xf+wf+")*",nO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",sO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rO=xf+wf+eO,iO="(?:"+[JE,gf,pf].join("|")+")"+rO,oO=RegExp([wr+"?"+df+"+"+yf+"(?="+[uf,wr,"$"].join("|")+")",tO+"+"+bf+"(?="+[uf,wr+mf,"$"].join("|")+")",wr+"?"+mf+"+"+yf,wr+"+"+bf,sO,nO,hf,iO].join("|"),"g");function aO(n){return n.match(oO)||[]}function lO(n,t,e){return n=Ti(n),t=t,t===void 0?VE(n)?aO(n):LE(n):n.match(t)||[]}var cO="['’]",uO=RegExp(cO,"g");function vf(n){return function(t){return SE(lO(RE(t).replace(uO,"")),n,"")}}var na=vf(function(n,t,e){return t=t.toLowerCase(),n+(e?CE(t):t)});function hO(n,t,e){return n===n&&(e!==void 0&&(n=n<=e?n:e),t!==void 0&&(n=n>=t?n:t)),n}function we(n,t,e){return e===void 0&&(e=t,t=void 0),e!==void 0&&(e=Si(e),e=e===e?e:0),t!==void 0&&(t=Si(t),t=t===t?t:0),hO(Si(n),t,e)}function dO(){this.__data__=new $n,this.size=0}function fO(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}function gO(n){return this.__data__.get(n)}function pO(n){return this.__data__.has(n)}var mO=200;function yO(n,t){var e=this.__data__;if(e instanceof $n){var s=e.__data__;if(!Ai||s.length<mO-1)return s.push([n,t]),this.size=++e.size,this;e=this.__data__=new zn(s)}return e.set(n,t),this.size=e.size,this}function Qe(n){var t=this.__data__=new $n(n);this.size=t.size}Qe.prototype.clear=dO,Qe.prototype.delete=fO,Qe.prototype.get=gO,Qe.prototype.has=pO,Qe.prototype.set=yO;function bO(n,t){return n&&Ei(t,Mi(t),n)}function wO(n,t){return n&&Ei(t,br(t),n)}var Cf=typeof Rt=="object"&&Rt&&!Rt.nodeType&&Rt,Sf=Cf&&typeof module=="object"&&module&&!module.nodeType&&module,xO=Sf&&Sf.exports===Cf,Ef=xO?Ke.Buffer:void 0,Of=Ef?Ef.allocUnsafe:void 0;function Mf(n,t){if(t)return n.slice();var e=n.length,s=Of?Of(e):new n.constructor(e);return n.copy(s),s}function vO(n,t){for(var e=-1,s=n==null?0:n.length,r=0,i=[];++e<s;){var o=n[e];t(o,e,n)&&(i[r++]=o)}return i}function Pf(){return[]}var CO=Object.prototype,SO=CO.propertyIsEnumerable,Af=Object.getOwnPropertySymbols,hc=Af?function(n){return n==null?[]:(n=Object(n),vO(Af(n),function(t){return SO.call(n,t)}))}:Pf;function EO(n,t){return Ei(n,hc(n),t)}var OO=Object.getOwnPropertySymbols,Tf=OO?function(n){for(var t=[];n;)ac(t,hc(n)),n=lc(n);return t}:Pf;function MO(n,t){return Ei(n,Tf(n),t)}function Nf(n,t,e){var s=t(n);return ue(n)?s:ac(s,e(n))}function dc(n){return Nf(n,Mi,hc)}function PO(n){return Nf(n,br,Tf)}var fc=Ls(Ke,"DataView"),gc=Ls(Ke,"Promise"),xr=Ls(Ke,"Set"),_f="[object Map]",AO="[object Object]",kf="[object Promise]",Df="[object Set]",Rf="[object WeakMap]",If="[object DataView]",TO=Is(fc),NO=Is(Ai),_O=Is(gc),kO=Is(xr),DO=Is(ec),Le=rs;(fc&&Le(new fc(new ArrayBuffer(1)))!=If||Ai&&Le(new Ai)!=_f||gc&&Le(gc.resolve())!=kf||xr&&Le(new xr)!=Df||ec&&Le(new ec)!=Rf)&&(Le=function(n){var t=rs(n),e=t==AO?n.constructor:void 0,s=e?Is(e):"";if(s)switch(s){case TO:return If;case NO:return _f;case _O:return kf;case kO:return Df;case DO:return Rf}return t});var RO=Object.prototype,IO=RO.hasOwnProperty;function LO(n){var t=n.length,e=new n.constructor(t);return t&&typeof n[0]=="string"&&IO.call(n,"index")&&(e.index=n.index,e.input=n.input),e}var sa=Ke.Uint8Array;function pc(n){var t=new n.constructor(n.byteLength);return new sa(t).set(new sa(n)),t}function BO(n,t){var e=t?pc(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}var VO=/\w*$/;function jO(n){var t=new n.constructor(n.source,VO.exec(n));return t.lastIndex=n.lastIndex,t}var Lf=Ie?Ie.prototype:void 0,Bf=Lf?Lf.valueOf:void 0;function $O(n){return Bf?Object(Bf.call(n)):{}}function Vf(n,t){var e=t?pc(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}var zO="[object Boolean]",FO="[object Date]",HO="[object Map]",UO="[object Number]",GO="[object RegExp]",YO="[object Set]",WO="[object String]",qO="[object Symbol]",JO="[object ArrayBuffer]",XO="[object DataView]",KO="[object Float32Array]",ZO="[object Float64Array]",QO="[object Int8Array]",tM="[object Int16Array]",eM="[object Int32Array]",nM="[object Uint8Array]",sM="[object Uint8ClampedArray]",rM="[object Uint16Array]",iM="[object Uint32Array]";function oM(n,t,e){var s=n.constructor;switch(t){case JO:return pc(n);case zO:case FO:return new s(+n);case XO:return BO(n,e);case KO:case ZO:case QO:case tM:case eM:case nM:case sM:case rM:case iM:return Vf(n,e);case HO:return new s;case UO:case WO:return new s(n);case GO:return jO(n);case YO:return new s;case qO:return $O(n)}}function jf(n){return typeof n.constructor=="function"&&!Wo(n)?sC(lc(n)):{}}var aM="[object Map]";function lM(n){return Ze(n)&&Le(n)==aM}var $f=yr&&yr.isMap,cM=$f?qo($f):lM,uM="[object Set]";function hM(n){return Ze(n)&&Le(n)==uM}var zf=yr&&yr.isSet,dM=zf?qo(zf):hM,fM=1,gM=2,pM=4,Ff="[object Arguments]",mM="[object Array]",yM="[object Boolean]",bM="[object Date]",wM="[object Error]",Hf="[object Function]",xM="[object GeneratorFunction]",vM="[object Map]",CM="[object Number]",Uf="[object Object]",SM="[object RegExp]",EM="[object Set]",OM="[object String]",MM="[object Symbol]",PM="[object WeakMap]",AM="[object ArrayBuffer]",TM="[object DataView]",NM="[object Float32Array]",_M="[object Float64Array]",kM="[object Int8Array]",DM="[object Int16Array]",RM="[object Int32Array]",IM="[object Uint8Array]",LM="[object Uint8ClampedArray]",BM="[object Uint16Array]",VM="[object Uint32Array]",Ot={};Ot[Ff]=Ot[mM]=Ot[AM]=Ot[TM]=Ot[yM]=Ot[bM]=Ot[NM]=Ot[_M]=Ot[kM]=Ot[DM]=Ot[RM]=Ot[vM]=Ot[CM]=Ot[Uf]=Ot[SM]=Ot[EM]=Ot[OM]=Ot[MM]=Ot[IM]=Ot[LM]=Ot[BM]=Ot[VM]=!0,Ot[wM]=Ot[Hf]=Ot[PM]=!1;function _i(n,t,e,s,r,i){var o,a=t&fM,l=t&gM,u=t&pM;if(o!==void 0)return o;if(!Lt(n))return n;var h=ue(n);if(h){if(o=LO(n),!a)return Nd(n,o)}else{var f=Le(n),d=f==Hf||f==xM;if(mr(n))return Mf(n,a);if(f==Uf||f==Ff||d&&!r){if(o=l||d?{}:jf(n),!a)return l?MO(n,wO(o,n)):EO(n,bO(o,n))}else{if(!Ot[f])return r?n:{};o=oM(n,f,a)}}i||(i=new Qe);var g=i.get(n);if(g)return g;i.set(n,o),dM(n)?n.forEach(function(y){o.add(_i(y,t,e,y,n,i))}):cM(n)&&n.forEach(function(y,b){o.set(b,_i(y,t,e,b,n,i))});var p=u?l?PO:dc:l?br:Mi,m=h?void 0:p(n);return hC(m||n,function(y,b){m&&(b=y,y=n[b]),nc(o,b,_i(y,t,e,b,n,i))}),o}var jM=4;function mc(n){return _i(n,jM)}var $M=1,zM=4;function Tt(n){return _i(n,$M|zM)}var FM="__lodash_hash_undefined__";function HM(n){return this.__data__.set(n,FM),this}function UM(n){return this.__data__.has(n)}function vr(n){var t=-1,e=n==null?0:n.length;for(this.__data__=new zn;++t<e;)this.add(n[t])}vr.prototype.add=vr.prototype.push=HM,vr.prototype.has=UM;function GM(n,t){for(var e=-1,s=n==null?0:n.length;++e<s;)if(t(n[e],e,n))return!0;return!1}function yc(n,t){return n.has(t)}var YM=1,WM=2;function Gf(n,t,e,s,r,i){var o=e&YM,a=n.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var u=i.get(n),h=i.get(t);if(u&&h)return u==t&&h==n;var f=-1,d=!0,g=e&WM?new vr:void 0;for(i.set(n,t),i.set(t,n);++f<a;){var p=n[f],m=t[f];if(s)var y=o?s(m,p,f,t,n,i):s(p,m,f,n,t,i);if(y!==void 0){if(y)continue;d=!1;break}if(g){if(!GM(t,function(b,w){if(!yc(g,w)&&(p===b||r(p,b,e,s,i)))return g.push(w)})){d=!1;break}}else if(!(p===m||r(p,m,e,s,i))){d=!1;break}}return i.delete(n),i.delete(t),d}function qM(n){var t=-1,e=Array(n.size);return n.forEach(function(s,r){e[++t]=[r,s]}),e}function bc(n){var t=-1,e=Array(n.size);return n.forEach(function(s){e[++t]=s}),e}var JM=1,XM=2,KM="[object Boolean]",ZM="[object Date]",QM="[object Error]",tP="[object Map]",eP="[object Number]",nP="[object RegExp]",sP="[object Set]",rP="[object String]",iP="[object Symbol]",oP="[object ArrayBuffer]",aP="[object DataView]",Yf=Ie?Ie.prototype:void 0,wc=Yf?Yf.valueOf:void 0;function lP(n,t,e,s,r,i,o){switch(e){case aP:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case oP:return!(n.byteLength!=t.byteLength||!i(new sa(n),new sa(t)));case KM:case ZM:case eP:return fr(+n,+t);case QM:return n.name==t.name&&n.message==t.message;case nP:case rP:return n==t+"";case tP:var a=qM;case sP:var l=s&JM;if(a||(a=bc),n.size!=t.size&&!l)return!1;var u=o.get(n);if(u)return u==t;s|=XM,o.set(n,t);var h=Gf(a(n),a(t),s,r,i,o);return o.delete(n),h;case iP:if(wc)return wc.call(n)==wc.call(t)}return!1}var cP=1,uP=Object.prototype,hP=uP.hasOwnProperty;function dP(n,t,e,s,r,i){var o=e&cP,a=dc(n),l=a.length,u=dc(t),h=u.length;if(l!=h&&!o)return!1;for(var f=l;f--;){var d=a[f];if(!(o?d in t:hP.call(t,d)))return!1}var g=i.get(n),p=i.get(t);if(g&&p)return g==t&&p==n;var m=!0;i.set(n,t),i.set(t,n);for(var y=o;++f<l;){d=a[f];var b=n[d],w=t[d];if(s)var x=o?s(w,b,d,t,n,i):s(b,w,d,n,t,i);if(!(x===void 0?b===w||r(b,w,e,s,i):x)){m=!1;break}y||(y=d=="constructor")}if(m&&!y){var v=n.constructor,S=t.constructor;v!=S&&"constructor"in n&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return i.delete(n),i.delete(t),m}var fP=1,Wf="[object Arguments]",qf="[object Array]",ra="[object Object]",gP=Object.prototype,Jf=gP.hasOwnProperty;function pP(n,t,e,s,r,i){var o=ue(n),a=ue(t),l=o?qf:Le(n),u=a?qf:Le(t);l=l==Wf?ra:l,u=u==Wf?ra:u;var h=l==ra,f=u==ra,d=l==u;if(d&&mr(n)){if(!mr(t))return!1;o=!0,h=!1}if(d&&!h)return i||(i=new Qe),o||Jo(n)?Gf(n,t,e,s,r,i):lP(n,t,l,e,s,r,i);if(!(e&fP)){var g=h&&Jf.call(n,"__wrapped__"),p=f&&Jf.call(t,"__wrapped__");if(g||p){var m=g?n.value():n,y=p?t.value():t;return i||(i=new Qe),r(m,y,e,s,i)}}return d?(i||(i=new Qe),dP(n,t,e,s,r,i)):!1}function ia(n,t,e,s,r){return n===t?!0:n==null||t==null||!Ze(n)&&!Ze(t)?n!==n&&t!==t:pP(n,t,e,s,ia,r)}var mP=1,yP=2;function bP(n,t,e,s){var r=e.length,i=r;if(n==null)return!i;for(n=Object(n);r--;){var o=e[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<i;){o=e[r];var a=o[0],l=n[a],u=o[1];if(o[2]){if(l===void 0&&!(a in n))return!1}else{var h=new Qe,f;if(!(f===void 0?ia(u,l,mP|yP,s,h):f))return!1}}return!0}function Xf(n){return n===n&&!Lt(n)}function wP(n){for(var t=Mi(n),e=t.length;e--;){var s=t[e],r=n[s];t[e]=[s,r,Xf(r)]}return t}function Kf(n,t){return function(e){return e==null?!1:e[n]===t&&(t!==void 0||n in Object(e))}}function xP(n){var t=wP(n);return t.length==1&&t[0][2]?Kf(t[0][0],t[0][1]):function(e){return e===n||bP(e,n,t)}}function vP(n,t){return n!=null&&t in Object(n)}function Zf(n,t,e){t=Zo(t,n);for(var s=-1,r=t.length,i=!1;++s<r;){var o=Ni(t[s]);if(!(i=n!=null&&e(n,o)))break;n=n[o]}return i||++s!=r?i:(r=n==null?0:n.length,!!r&&sc(r)&&Uo(o,r)&&(ue(n)||pr(n)))}function Qf(n,t){return n!=null&&Zf(n,t,vP)}var CP=1,SP=2;function EP(n,t){return ic(n)&&Xf(t)?Kf(Ni(n),t):function(e){var s=Yd(e,n);return s===void 0&&s===t?Qf(e,n):ia(t,s,CP|SP)}}function OP(n){return function(t){return t==null?void 0:t[n]}}function MP(n){return function(t){return Qo(t,n)}}function PP(n){return ic(n)?OP(Ni(n)):MP(n)}function xc(n){return typeof n=="function"?n:n==null?dr:typeof n=="object"?ue(n)?EP(n[0],n[1]):xP(n):PP(n)}function AP(n,t,e,s){for(var r=-1,i=n==null?0:n.length;++r<i;){var o=n[r];t(s,o,e(o),n)}return s}function TP(n){return function(t,e,s){for(var r=-1,i=Object(t),o=s(t),a=o.length;a--;){var l=o[++r];if(e(i[l],l,i)===!1)break}return t}}var tg=TP();function NP(n,t){return n&&tg(n,t,Mi)}function _P(n,t){return function(e,s){if(e==null)return e;if(!Bs(e))return n(e,s);for(var r=e.length,i=-1,o=Object(e);++i<r&&s(o[i],i,o)!==!1;);return e}}var eg=_P(NP);function kP(n,t,e,s){return eg(n,function(r,i,o){t(s,r,e(r),o)}),s}function DP(n,t){return function(e,s){var r=ue(e)?AP:kP,i=t?t():{};return r(e,n,xc(s),i)}}var vc=function(){return Ke.Date.now()},RP="Expected a function",IP=Math.max,LP=Math.min;function ng(n,t,e){var s,r,i,o,a,l,u=0,h=!1,f=!1,d=!0;if(typeof n!="function")throw new TypeError(RP);t=Si(t)||0,Lt(e)&&(h=!!e.leading,f="maxWait"in e,i=f?IP(Si(e.maxWait)||0,t):i,d="trailing"in e?!!e.trailing:d);function g(E){var C=s,M=r;return s=r=void 0,u=E,o=n.apply(M,C),o}function p(E){return u=E,a=setTimeout(b,t),h?g(E):o}function m(E){var C=E-l,M=E-u,T=t-C;return f?LP(T,i-M):T}function y(E){var C=E-l,M=E-u;return l===void 0||C>=t||C<0||f&&M>=i}function b(){var E=vc();if(y(E))return w(E);a=setTimeout(b,m(E))}function w(E){return a=void 0,d&&s?g(E):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=l=r=a=void 0}function v(){return a===void 0?o:w(vc())}function S(){var E=vc(),C=y(E);if(s=arguments,r=this,l=E,C){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(b,t),g(l)}return a===void 0&&(a=setTimeout(b,t)),o}return S.cancel=x,S.flush=v,S}var sg=Object.prototype,BP=sg.hasOwnProperty,VP=gr(function(n,t){n=Object(n);var e=-1,s=t.length,r=s>2?t[2]:void 0;for(r&&Yo(t[0],t[1],r)&&(s=1);++e<s;)for(var i=t[e],o=br(i),a=-1,l=o.length;++a<l;){var u=o[a],h=n[u];(h===void 0||fr(h,sg[u])&&!BP.call(n,u))&&(n[u]=i[u])}return n});function Cc(n,t,e){(e!==void 0&&!fr(n[t],e)||e===void 0&&!(t in n))&&Go(n,t,e)}function oa(n){return Ze(n)&&Bs(n)}function Sc(n,t){if(!(t==="constructor"&&typeof n[t]=="function")&&t!="__proto__")return n[t]}function jP(n){return Ei(n,br(n))}function $P(n,t,e,s,r,i,o){var a=Sc(n,e),l=Sc(t,e),u=o.get(l);if(u){Cc(n,e,u);return}var h=i?i(a,l,e+"",n,t,o):void 0,f=h===void 0;if(f){var d=ue(l),g=!d&&mr(l),p=!d&&!g&&Jo(l);h=l,d||g||p?ue(a)?h=a:oa(a)?h=Nd(a):g?(f=!1,h=Mf(l,!0)):p?(f=!1,h=Vf(l,!0)):h=[]:bn(l)||pr(l)?(h=a,pr(a)?h=jP(a):(!Lt(a)||Ql(a))&&(h=jf(l))):f=!1}f&&(o.set(l,h),r(h,l,s,i,o),o.delete(l)),Cc(n,e,h)}function aa(n,t,e,s,r){n!==t&&tg(t,function(i,o){if(r||(r=new Qe),Lt(i))$P(n,t,o,e,aa,s,r);else{var a=s?s(Sc(n,o),i,o+"",n,t,r):void 0;a===void 0&&(a=i),Cc(n,o,a)}},br)}function rg(n,t,e,s,r,i){return Lt(n)&&Lt(t)&&(i.set(t,n),aa(n,t,void 0,rg,i),i.delete(t)),n}var zP=Id(function(n,t,e,s){aa(n,t,e,s)}),ig=gr(function(n){return n.push(void 0,rg),Td(zP,void 0,n)}),FP=200;function HP(n,t,e,s){var r=-1,i=kd,o=!0,a=n.length,l=[],u=t.length;if(!a)return l;t.length>=FP&&(i=yc,o=!1,t=new vr(t));t:for(;++r<a;){var h=n[r],f=h;if(h=h!==0?h:0,o&&f===f){for(var d=u;d--;)if(t[d]===f)continue t;l.push(h)}else i(t,f,s)||l.push(h)}return l}var UP=gr(function(n,t){return oa(n)?HP(n,ta(t,1,oa,!0)):[]});function GP(n,t){var e=-1,s=Bs(n)?Array(n.length):[];return eg(n,function(r,i,o){s[++e]=t(r,i,o)}),s}function la(n){for(var t=-1,e=n==null?0:n.length,s={};++t<e;){var r=n[t];s[r[0]]=r[1]}return s}var YP=Object.prototype,WP=YP.hasOwnProperty,og=DP(function(n,t,e){WP.call(n,e)?n[e].push(t):Go(n,e,[t])});function qP(n,t){return n>t}var JP=Object.prototype,XP=JP.hasOwnProperty;function KP(n,t){return n!=null&&XP.call(n,t)}function ca(n,t){return n!=null&&Zf(n,t,KP)}var ZP="[object Map]",QP="[object Set]",t2=Object.prototype,e2=t2.hasOwnProperty;function ag(n){if(n==null)return!0;if(Bs(n)&&(ue(n)||typeof n=="string"||typeof n.splice=="function"||mr(n)||Jo(n)||pr(n)))return!n.length;var t=Le(n);if(t==ZP||t==QP)return!n.size;if(Wo(n))return!Gd(n).length;for(var e in n)if(e2.call(n,e))return!1;return!0}function wn(n,t){return ia(n,t)}var n2="[object Number]";function Ec(n){return typeof n=="number"||Ze(n)&&rs(n)==n2}function ua(n){return n==null}function s2(n){return n===void 0}var r2=nf("toLowerCase");function i2(n,t,e){for(var s=-1,r=n.length;++s<r;){var i=n[s],o=t(i);if(o!=null&&(a===void 0?o===o&&!yn(o):e(o,a)))var a=o,l=i}return l}function o2(n){return n&&n.length?i2(n,dr,qP):void 0}var Gt=Id(function(n,t,e){aa(n,t,e)});function a2(n,t,e,s){if(!Lt(n))return n;t=Zo(t,n);for(var r=-1,i=t.length,o=i-1,a=n;a!=null&&++r<i;){var l=Ni(t[r]),u=e;if(l==="__proto__"||l==="constructor"||l==="prototype")return n;if(r!=o){var h=a[l];u=void 0,u===void 0&&(u=Lt(h)?h:Uo(t[r+1])?[]:{})}nc(a,l,u),a=a[l]}return n}function l2(n,t,e){for(var s=-1,r=t.length,i={};++s<r;){var o=t[s],a=Qo(n,o);e(a,o)&&a2(i,Zo(o,n),a)}return i}function c2(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}function u2(n,t){if(n!==t){var e=n!==void 0,s=n===null,r=n===n,i=yn(n),o=t!==void 0,a=t===null,l=t===t,u=yn(t);if(!a&&!u&&!i&&n>t||i&&o&&l&&!a&&!u||s&&o&&l||!e&&l||!r)return 1;if(!s&&!i&&!u&&n<t||u&&e&&r&&!s&&!i||a&&e&&r||!o&&r||!l)return-1}return 0}function h2(n,t,e){for(var s=-1,r=n.criteria,i=t.criteria,o=r.length,a=e.length;++s<o;){var l=u2(r[s],i[s]);if(l){if(s>=a)return l;var u=e[s];return l*(u=="desc"?-1:1)}}return n.index-t.index}function d2(n,t,e){t.length?t=Fo(t,function(i){return ue(i)?function(o){return Qo(o,i.length===1?i[0]:i)}:i}):t=[dr];var s=-1;t=Fo(t,qo(xc));var r=GP(n,function(i,o,a){var l=Fo(t,function(u){return u(i)});return{criteria:l,index:++s,value:i}});return c2(r,function(i,o){return h2(i,o,e)})}function f2(n,t){return l2(n,t,function(e,s){return Qf(n,s)})}var Oc=GS(function(n,t){return n==null?{}:f2(n,t)}),Mc=gr(function(n,t){if(n==null)return[];var e=t.length;return e>1&&Yo(n,t[0],t[1])?t=[]:e>2&&Yo(t[0],t[1],t[2])&&(t=[t[0]]),d2(n,ta(t),[])}),g2=4294967295,p2=g2-1,m2=Math.floor,y2=Math.min;function lg(n,t,e,s){var r=0,i=n==null?0:n.length;if(i===0)return 0;t=e(t);for(var o=t!==t,a=t===null,l=yn(t),u=t===void 0;r<i;){var h=m2((r+i)/2),f=e(n[h]),d=f!==void 0,g=f===null,p=f===f,m=yn(f);if(o)var y=p;else u?y=p&&d:a?y=p&&d&&!g:l?y=p&&d&&!g&&!m:g||m?y=!1:y=f<t;y?r=h+1:i=h}return y2(i,p2)}var b2=4294967295,w2=b2>>>1;function x2(n,t,e){var s=0,r=n==null?s:n.length;if(typeof t=="number"&&t===t&&r<=w2){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!yn(o)&&o<t?s=i+1:r=i}return r}return lg(n,t,dr)}function v2(n,t){return x2(n,t)}function C2(n,t,e){return lg(n,t,xc(e))}var S2=vf(function(n,t,e){return n+(e?" ":"")+ea(t)}),E2="Expected a function";function O2(n,t,e){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(E2);return Lt(e)&&(s="leading"in e?!!e.leading:s,r="trailing"in e?!!e.trailing:r),ng(n,t,{leading:s,maxWait:t,trailing:r})}var M2=1/0,P2=xr&&1/bc(new xr([,-0]))[1]==M2?function(n){return new xr(n)}:rC,A2=200;function cg(n,t,e){var s=-1,r=kd,i=n.length,o=!0,a=[],l=a;if(i>=A2){var u=P2(n);if(u)return bc(u);o=!1,r=yc,l=new vr}else l=a;t:for(;++s<i;){var h=n[s],f=h;if(h=h!==0?h:0,o&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;a.push(h)}else r(l,f,e)||(l!==a&&l.push(f),a.push(h))}return a}var ug=gr(function(n){return cg(ta(n,1,oa,!0))});function hg(n){return n&&n.length?cg(n):[]}const dg=n=>n===void 0,ha=n=>typeof n=="boolean",Be=n=>typeof n=="number",Fn=n=>typeof Element>"u"?!1:n instanceof Element,T2=n=>Xe(n)?!Number.isNaN(Number(n)):!1,fg=n=>Object.keys(n);class gg extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function N2(n,t){throw new gg(`[${n}] ${t}`)}function Pe(n,t){if(process.env.NODE_ENV!=="production"){const e=Xe(n)?new gg(`[${n}] ${t}`):n;console.warn(e)}}const _2="utils/dom/style",pg=(n="")=>n.split(" ").filter(t=>!!t.trim()),mg=(n,t)=>{if(!n||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(t)},k2=(n,t)=>{!n||!t.trim()||n.classList.add(...pg(t))},D2=(n,t)=>{!n||!t.trim()||n.classList.remove(...pg(t))},R2=(n,t)=>{var e;if(!Ut||!n||!t)return"";let s=vv(t);s==="float"&&(s="cssFloat");try{const r=n.style[s];if(r)return r;const i=(e=document.defaultView)==null?void 0:e.getComputedStyle(n,"");return i?i[s]:""}catch{return n.style[s]}};function ki(n,t="px"){if(!n)return"";if(Be(n)||T2(n))return`${n}${t}`;if(Xe(n))return n;Pe(_2,"binding value must be a string or number")}let da;const I2=n=>{var t;if(!Ut)return 0;if(da!==void 0)return da;const e=document.createElement("div");e.className=`${n}-scrollbar__wrap`,e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);const s=e.offsetWidth;e.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",e.appendChild(r);const i=r.offsetWidth;return(t=e.parentNode)==null||t.removeChild(e),da=s-i,da};/*! Element Plus Icons Vue v2.3.1 */var L2=c.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),B2=L2,V2=c.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),c.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),j2=V2,$2=c.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),yg=$2,z2=c.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),c.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),bg=z2,F2=c.defineComponent({name:"Close",__name:"close",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),H2=F2,U2=c.defineComponent({name:"DeleteFilled",__name:"delete-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32"})]))}}),wg=U2,G2=c.defineComponent({name:"Document",__name:"document",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),Y2=G2,W2=c.defineComponent({name:"Hide",__name:"hide",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),c.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),q2=W2,J2=c.defineComponent({name:"InfoFilled",__name:"info-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),xg=J2,X2=c.defineComponent({name:"Loading",__name:"loading",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),fa=X2,K2=c.defineComponent({name:"Plus",__name:"plus",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),Z2=K2,Q2=c.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),vg=Q2,tA=c.defineComponent({name:"View",__name:"view",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Cg=tA,eA=c.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[c.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Sg=eA;const Eg="__epPropKey",ct=n=>n,nA=n=>hr(n)&&!!n[Eg],ga=(n,t)=>{if(!hr(n)||nA(n))return n;const{values:e,required:s,default:r,type:i,validator:o}=n,l={type:i,required:!!s,validator:e||o?u=>{let h=!1,f=[];if(e&&(f=Array.from(e),zo(n,"default")&&f.push(r),h||(h=f.includes(u))),o&&(h||(h=o(u))),!h&&f.length>0){const d=[...new Set(f)].map(g=>JSON.stringify(g)).join(", ");c.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${d}], got value ${JSON.stringify(u)}.`)}return h}:void 0,[Eg]:!0};return zo(n,"default")&&(l.default=r),l},Kt=n=>la(Object.entries(n).map(([t,e])=>[t,ga(e,t)])),Di=ct([String,Object,Function]),Og={Close:H2,SuccessFilled:vg,InfoFilled:xg,WarningFilled:Sg,CircleCloseFilled:yg},pa={success:vg,warning:Sg,error:yg,info:xg},sA={validating:fa,success:j2,error:bg},js=(n,t)=>{if(n.install=e=>{for(const s of[n,...Object.values(t??{})])e.component(s.name,s)},t)for(const[e,s]of Object.entries(t))n[e]=s;return n},rA=(n,t)=>(n.install=e=>{n._context=e._context,e.config.globalProperties[t]=n},n),iA=n=>(n.install=ss,n),Cr={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},Pc="update:modelValue",Mg=["","default","small","large"],oA=n=>["",...Mg].includes(n);var ma=(n=>(n[n.TEXT=1]="TEXT",n[n.CLASS=2]="CLASS",n[n.STYLE=4]="STYLE",n[n.PROPS=8]="PROPS",n[n.FULL_PROPS=16]="FULL_PROPS",n[n.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",n[n.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",n[n.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",n[n.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",n[n.NEED_PATCH=512]="NEED_PATCH",n[n.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",n[n.HOISTED=-1]="HOISTED",n[n.BAIL=-2]="BAIL",n))(ma||{});const aA=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),Pg=n=>n,lA=["class","style"],cA=/^on[A-Z]/,uA=(n={})=>{const{excludeListeners:t=!1,excludeKeys:e}=n,s=c.computed(()=>((e==null?void 0:e.value)||[]).concat(lA)),r=c.getCurrentInstance();return r?c.computed(()=>{var i;return la(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(t&&cA.test(o))))}):(Pe("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),c.computed(()=>({})))},hA=({from:n,replacement:t,scope:e,version:s,ref:r,type:i="API"},o)=>{c.watch(()=>c.unref(o),a=>{a&&Pe(e,`[${i}] ${n} is about to be deprecated in version ${s}, please use ${t} instead.
|
|
15
15
|
For more detail, please visit: ${r}
|
|
16
|
-
`)},{immediate:!0})},hA=(n,t,e,s)=>{let r={offsetX:0,offsetY:0};const i=u=>{const h=u.clientX,f=u.clientY,{offsetX:d,offsetY:g}=r,p=n.value.getBoundingClientRect(),m=p.left,y=p.top,b=p.width,w=p.height,x=document.documentElement.clientWidth,v=document.documentElement.clientHeight,S=-m+d,E=-y+g,C=x-m-b+d,M=v-y-w+g,T=_=>{let D=d+_.clientX-h,N=g+_.clientY-f;s!=null&&s.value||(D=Math.min(Math.max(D,S),C),N=Math.min(Math.max(N,E),M)),r={offsetX:D,offsetY:N},n.value&&(n.value.style.transform=`translate(${ki(D)}, ${ki(N)})`)},k=()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",T),document.addEventListener("mouseup",k)},o=()=>{t.value&&n.value&&t.value.addEventListener("mousedown",i)},a=()=>{t.value&&n.value&&t.value.removeEventListener("mousedown",i)},l=()=>{r={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return c.onMounted(()=>{c.watchEffect(()=>{e.value?o():a()})}),c.onBeforeUnmount(()=>{a()}),{resetPosition:l}};var dA={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const fA=n=>(t,e)=>gA(t,e,c.unref(n)),gA=(n,t,e)=>Yd(e,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=t==null?void 0:t[r])!=null?i:`{${r}}`}`}),pA=n=>{const t=c.computed(()=>c.unref(n).name),e=c.isRef(n)?n:c.ref(n);return{lang:t,locale:e,t:fA(n)}},Ag=Symbol("localeContextKey"),mA=n=>{const t=n||c.inject(Ag,c.ref());return pA(c.computed(()=>t.value||dA))},ya="el",yA="is-",$s=(n,t,e,s,r)=>{let i=`${n}-${t}`;return e&&(i+=`-${e}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Tg=Symbol("namespaceContextKey"),Tc=n=>{const t=n||(c.getCurrentInstance()?c.inject(Tg,c.ref(ya)):c.ref(ya));return c.computed(()=>c.unref(t)||ya)},me=(n,t)=>{const e=Tc(t);return{namespace:e,b:(m="")=>$s(e.value,n,m,"",""),e:m=>m?$s(e.value,n,"",m,""):"",m:m=>m?$s(e.value,n,"","",m):"",be:(m,y)=>m&&y?$s(e.value,n,m,y,""):"",em:(m,y)=>m&&y?$s(e.value,n,"",m,y):"",bm:(m,y)=>m&&y?$s(e.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?$s(e.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${yA}${m}`:""},cssVar:m=>{const y={};for(const b in m)m[b]&&(y[`--${e.value}-${b}`]=m[b]);return y},cssVarName:m=>`--${e.value}-${m}`,cssVarBlock:m=>{const y={};for(const b in m)m[b]&&(y[`--${e.value}-${n}-${b}`]=m[b]);return y},cssVarBlockName:m=>`--${e.value}-${n}-${m}`}},bA=(n,t={})=>{c.isRef(n)||T2("[useLockscreen]","You need to pass a ref param to this function");const e=t.ns||me("popup"),s=c.computed(()=>e.bm("parent","hidden"));if(!Gt||mg(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(k2(document==null?void 0:document.body,s.value),i&&document&&(document.body.style.width=o))},200)};c.watch(n,l=>{if(!l){a();return}i=!mg(document.body,s.value),i&&(o=document.body.style.width),r=R2(e.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,h=D2(document.body,"overflowY");r>0&&(u||h==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),_2(document.body,s.value)}),c.onScopeDispose(()=>a())},wA=ga({type:ct(Boolean),default:null}),xA=ga({type:ct(Function)}),vA=n=>{const t=`update:${n}`,e=`onUpdate:${n}`,s=[t],r={[n]:wA,[e]:xA};return{useModelToggle:({indicator:o,toggleReason:a,shouldHideWhenRouteChanges:l,shouldProceed:u,onShow:h,onHide:f})=>{const d=c.getCurrentInstance(),{emit:g}=d,p=d.props,m=c.computed(()=>Re(p[e])),y=c.computed(()=>p[n]===null),b=C=>{o.value!==!0&&(o.value=!0,a&&(a.value=C),Re(h)&&h(C))},w=C=>{o.value!==!1&&(o.value=!1,a&&(a.value=C),Re(f)&&f(C))},x=C=>{if(p.disabled===!0||Re(u)&&!u())return;const M=m.value&≫M&&g(t,!0),(y.value||!M)&&b(C)},v=C=>{if(p.disabled===!0||!Gt)return;const M=m.value&≫M&&g(t,!1),(y.value||!M)&&w(C)},S=C=>{ha(C)&&(p.disabled&&C?m.value&&g(t,!1):o.value!==C&&(C?b():w()))},E=()=>{o.value?v():x()};return c.watch(()=>p[n],S),l&&d.appContext.config.globalProperties.$route!==void 0&&c.watch(()=>({...d.proxy.$route}),()=>{l.value&&o.value&&v()}),c.onMounted(()=>{S(p[n])}),{hide:v,show:x,toggle:E,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},Ng=n=>{const t=c.getCurrentInstance();return c.computed(()=>{var e,s;return(s=(e=t==null?void 0:t.proxy)==null?void 0:e.$props)==null?void 0:s[n]})};var xe="top",Ve="bottom",je="right",ve="left",Nc="auto",Ri=[xe,Ve,je,ve],Sr="start",Ii="end",CA="clippingParents",_g="viewport",Li="popper",SA="reference",kg=Ri.reduce(function(n,t){return n.concat([t+"-"+Sr,t+"-"+Ii])},[]),_c=[].concat(Ri,[Nc]).reduce(function(n,t){return n.concat([t,t+"-"+Sr,t+"-"+Ii])},[]),EA="beforeRead",OA="read",MA="afterRead",PA="beforeMain",AA="main",TA="afterMain",NA="beforeWrite",_A="write",kA="afterWrite",DA=[EA,OA,MA,PA,AA,TA,NA,_A,kA];function xn(n){return n?(n.nodeName||"").toLowerCase():null}function tn(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Er(n){var t=tn(n).Element;return n instanceof t||n instanceof Element}function $e(n){var t=tn(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function kc(n){if(typeof ShadowRoot>"u")return!1;var t=tn(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function RA(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var s=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!$e(i)||!xn(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(o){var a=r[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function IA(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],i=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:e[s]),a=o.reduce(function(l,u){return l[u]="",l},{});!$e(r)||!xn(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}var Dg={name:"applyStyles",enabled:!0,phase:"write",fn:RA,effect:IA,requires:["computeStyles"]};function vn(n){return n.split("-")[0]}var zs=Math.max,ba=Math.min,Or=Math.round;function Mr(n,t){t===void 0&&(t=!1);var e=n.getBoundingClientRect(),s=1,r=1;if($e(n)&&t){var i=n.offsetHeight,o=n.offsetWidth;o>0&&(s=Or(e.width)/o||1),i>0&&(r=Or(e.height)/i||1)}return{width:e.width/s,height:e.height/r,top:e.top/r,right:e.right/s,bottom:e.bottom/r,left:e.left/s,x:e.left/s,y:e.top/r}}function Dc(n){var t=Mr(n),e=n.offsetWidth,s=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:s}}function Rg(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&kc(e)){var s=t;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Hn(n){return tn(n).getComputedStyle(n)}function LA(n){return["table","td","th"].indexOf(xn(n))>=0}function is(n){return((Er(n)?n.ownerDocument:n.document)||window.document).documentElement}function wa(n){return xn(n)==="html"?n:n.assignedSlot||n.parentNode||(kc(n)?n.host:null)||is(n)}function Ig(n){return!$e(n)||Hn(n).position==="fixed"?null:n.offsetParent}function BA(n){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,e=navigator.userAgent.indexOf("Trident")!==-1;if(e&&$e(n)){var s=Hn(n);if(s.position==="fixed")return null}var r=wa(n);for(kc(r)&&(r=r.host);$e(r)&&["html","body"].indexOf(xn(r))<0;){var i=Hn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Bi(n){for(var t=tn(n),e=Ig(n);e&&LA(e)&&Hn(e).position==="static";)e=Ig(e);return e&&(xn(e)==="html"||xn(e)==="body"&&Hn(e).position==="static")?t:e||BA(n)||t}function Rc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Vi(n,t,e){return zs(n,ba(t,e))}function VA(n,t,e){var s=Vi(n,t,e);return s>e?e:s}function Lg(){return{top:0,right:0,bottom:0,left:0}}function Bg(n){return Object.assign({},Lg(),n)}function Vg(n,t){return t.reduce(function(e,s){return e[s]=n,e},{})}var jA=function(n,t){return n=typeof n=="function"?n(Object.assign({},t.rects,{placement:t.placement})):n,Bg(typeof n!="number"?n:Vg(n,Ri))};function $A(n){var t,e=n.state,s=n.name,r=n.options,i=e.elements.arrow,o=e.modifiersData.popperOffsets,a=vn(e.placement),l=Rc(a),u=[ve,je].indexOf(a)>=0,h=u?"height":"width";if(!(!i||!o)){var f=jA(r.padding,e),d=Dc(i),g=l==="y"?xe:ve,p=l==="y"?Ve:je,m=e.rects.reference[h]+e.rects.reference[l]-o[l]-e.rects.popper[h],y=o[l]-e.rects.reference[l],b=Bi(i),w=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,v=f[g],S=w-d[h]-f[p],E=w/2-d[h]/2+x,C=Vi(v,E,S),M=l;e.modifiersData[s]=(t={},t[M]=C,t.centerOffset=C-E,t)}}function zA(n){var t=n.state,e=n.options,s=e.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||!Rg(t.elements.popper,r)||(t.elements.arrow=r))}var FA={name:"arrow",enabled:!0,phase:"main",fn:$A,effect:zA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pr(n){return n.split("-")[1]}var HA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function UA(n){var t=n.x,e=n.y,s=window,r=s.devicePixelRatio||1;return{x:Or(t*r)/r||0,y:Or(e*r)/r||0}}function jg(n){var t,e=n.popper,s=n.popperRect,r=n.placement,i=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,u=n.adaptive,h=n.roundOffsets,f=n.isFixed,d=o.x,g=d===void 0?0:d,p=o.y,m=p===void 0?0:p,y=typeof h=="function"?h({x:g,y:m}):{x:g,y:m};g=y.x,m=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),x=ve,v=xe,S=window;if(u){var E=Bi(e),C="clientHeight",M="clientWidth";if(E===tn(e)&&(E=is(e),Hn(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),E=E,r===xe||(r===ve||r===je)&&i===Ii){v=Ve;var T=f&&E===S&&S.visualViewport?S.visualViewport.height:E[C];m-=T-s.height,m*=l?1:-1}if(r===ve||(r===xe||r===Ve)&&i===Ii){x=je;var k=f&&E===S&&S.visualViewport?S.visualViewport.width:E[M];g-=k-s.width,g*=l?1:-1}}var _=Object.assign({position:a},u&&HA),D=h===!0?UA({x:g,y:m}):{x:g,y:m};if(g=D.x,m=D.y,l){var N;return Object.assign({},_,(N={},N[v]=w?"0":"",N[x]=b?"0":"",N.transform=(S.devicePixelRatio||1)<=1?"translate("+g+"px, "+m+"px)":"translate3d("+g+"px, "+m+"px, 0)",N))}return Object.assign({},_,(t={},t[v]=w?m+"px":"",t[x]=b?g+"px":"",t.transform="",t))}function GA(n){var t=n.state,e=n.options,s=e.gpuAcceleration,r=s===void 0?!0:s,i=e.adaptive,o=i===void 0?!0:i,a=e.roundOffsets,l=a===void 0?!0:a,u={placement:vn(t.placement),variation:Pr(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,jg(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,jg(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var $g={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:GA,data:{}},xa={passive:!0};function YA(n){var t=n.state,e=n.instance,s=n.options,r=s.scroll,i=r===void 0?!0:r,o=s.resize,a=o===void 0?!0:o,l=tn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(h){h.addEventListener("scroll",e.update,xa)}),a&&l.addEventListener("resize",e.update,xa),function(){i&&u.forEach(function(h){h.removeEventListener("scroll",e.update,xa)}),a&&l.removeEventListener("resize",e.update,xa)}}var zg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:YA,data:{}},WA={left:"right",right:"left",bottom:"top",top:"bottom"};function va(n){return n.replace(/left|right|bottom|top/g,function(t){return WA[t]})}var qA={start:"end",end:"start"};function Fg(n){return n.replace(/start|end/g,function(t){return qA[t]})}function Ic(n){var t=tn(n),e=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:e,scrollTop:s}}function Lc(n){return Mr(is(n)).left+Ic(n).scrollLeft}function JA(n){var t=tn(n),e=is(n),s=t.visualViewport,r=e.clientWidth,i=e.clientHeight,o=0,a=0;return s&&(r=s.width,i=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:r,height:i,x:o+Lc(n),y:a}}function XA(n){var t,e=is(n),s=Ic(n),r=(t=n.ownerDocument)==null?void 0:t.body,i=zs(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=zs(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Lc(n),l=-s.scrollTop;return Hn(r||e).direction==="rtl"&&(a+=zs(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:l}}function Bc(n){var t=Hn(n),e=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+s)}function Hg(n){return["html","body","#document"].indexOf(xn(n))>=0?n.ownerDocument.body:$e(n)&&Bc(n)?n:Hg(wa(n))}function ji(n,t){var e;t===void 0&&(t=[]);var s=Hg(n),r=s===((e=n.ownerDocument)==null?void 0:e.body),i=tn(s),o=r?[i].concat(i.visualViewport||[],Bc(s)?s:[]):s,a=t.concat(o);return r?a:a.concat(ji(wa(o)))}function Vc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function KA(n){var t=Mr(n);return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Ug(n,t){return t===_g?Vc(JA(n)):Er(t)?KA(t):Vc(XA(is(n)))}function ZA(n){var t=ji(wa(n)),e=["absolute","fixed"].indexOf(Hn(n).position)>=0,s=e&&$e(n)?Bi(n):n;return Er(s)?t.filter(function(r){return Er(r)&&Rg(r,s)&&xn(r)!=="body"}):[]}function QA(n,t,e){var s=t==="clippingParents"?ZA(n):[].concat(t),r=[].concat(s,[e]),i=r[0],o=r.reduce(function(a,l){var u=Ug(n,l);return a.top=zs(u.top,a.top),a.right=ba(u.right,a.right),a.bottom=ba(u.bottom,a.bottom),a.left=zs(u.left,a.left),a},Ug(n,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Gg(n){var t=n.reference,e=n.element,s=n.placement,r=s?vn(s):null,i=s?Pr(s):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(r){case xe:l={x:o,y:t.y-e.height};break;case Ve:l={x:o,y:t.y+t.height};break;case je:l={x:t.x+t.width,y:a};break;case ve:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var u=r?Rc(r):null;if(u!=null){var h=u==="y"?"height":"width";switch(i){case Sr:l[u]=l[u]-(t[h]/2-e[h]/2);break;case Ii:l[u]=l[u]+(t[h]/2-e[h]/2);break}}return l}function $i(n,t){t===void 0&&(t={});var e=t,s=e.placement,r=s===void 0?n.placement:s,i=e.boundary,o=i===void 0?CA:i,a=e.rootBoundary,l=a===void 0?_g:a,u=e.elementContext,h=u===void 0?Li:u,f=e.altBoundary,d=f===void 0?!1:f,g=e.padding,p=g===void 0?0:g,m=Bg(typeof p!="number"?p:Vg(p,Ri)),y=h===Li?SA:Li,b=n.rects.popper,w=n.elements[d?y:h],x=QA(Er(w)?w:w.contextElement||is(n.elements.popper),o,l),v=Mr(n.elements.reference),S=Gg({reference:v,element:b,strategy:"absolute",placement:r}),E=Vc(Object.assign({},b,S)),C=h===Li?E:v,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},T=n.modifiersData.offset;if(h===Li&&T){var k=T[r];Object.keys(M).forEach(function(_){var D=[je,Ve].indexOf(_)>=0?1:-1,N=[xe,Ve].indexOf(_)>=0?"y":"x";M[_]+=k[N]*D})}return M}function tT(n,t){t===void 0&&(t={});var e=t,s=e.placement,r=e.boundary,i=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?_c:l,h=Pr(s),f=h?a?kg:kg.filter(function(p){return Pr(p)===h}):Ri,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var g=d.reduce(function(p,m){return p[m]=$i(n,{placement:m,boundary:r,rootBoundary:i,padding:o})[vn(m)],p},{});return Object.keys(g).sort(function(p,m){return g[p]-g[m]})}function eT(n){if(vn(n)===Nc)return[];var t=va(n);return[Fg(n),t,Fg(t)]}function nT(n){var t=n.state,e=n.options,s=n.name;if(!t.modifiersData[s]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,u=e.padding,h=e.boundary,f=e.rootBoundary,d=e.altBoundary,g=e.flipVariations,p=g===void 0?!0:g,m=e.allowedAutoPlacements,y=t.options.placement,b=vn(y),w=b===y,x=l||(w||!p?[va(y)]:eT(y)),v=[y].concat(x).reduce(function(K,nt){return K.concat(vn(nt)===Nc?tT(t,{placement:nt,boundary:h,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):nt)},[]),S=t.rects.reference,E=t.rects.popper,C=new Map,M=!0,T=v[0],k=0;k<v.length;k++){var _=v[k],D=vn(_),N=Pr(_)===Sr,j=[xe,Ve].indexOf(D)>=0,A=j?"width":"height",P=$i(t,{placement:_,boundary:h,rootBoundary:f,altBoundary:d,padding:u}),L=j?N?je:ve:N?Ve:xe;S[A]>E[A]&&(L=va(L));var V=va(L),Y=[];if(i&&Y.push(P[D]<=0),a&&Y.push(P[L]<=0,P[V]<=0),Y.every(function(K){return K})){T=_,M=!1;break}C.set(_,Y)}if(M)for(var ot=p?3:1,F=function(K){var nt=v.find(function(rt){var et=C.get(rt);if(et)return et.slice(0,K).every(function(ft){return ft})});if(nt)return T=nt,"break"},H=ot;H>0;H--){var B=F(H);if(B==="break")break}t.placement!==T&&(t.modifiersData[s]._skip=!0,t.placement=T,t.reset=!0)}}var sT={name:"flip",enabled:!0,phase:"main",fn:nT,requiresIfExists:["offset"],data:{_skip:!1}};function Yg(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function Wg(n){return[xe,je,Ve,ve].some(function(t){return n[t]>=0})}function rT(n){var t=n.state,e=n.name,s=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,o=$i(t,{elementContext:"reference"}),a=$i(t,{altBoundary:!0}),l=Yg(o,s),u=Yg(a,r,i),h=Wg(l),f=Wg(u);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:h,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":f})}var iT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rT};function oT(n,t,e){var s=vn(n),r=[ve,xe].indexOf(s)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,o=i[0],a=i[1];return o=o||0,a=(a||0)*r,[ve,je].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function aT(n){var t=n.state,e=n.options,s=n.name,r=e.offset,i=r===void 0?[0,0]:r,o=_c.reduce(function(h,f){return h[f]=oT(f,t.rects,i),h},{}),a=o[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[s]=o}var lT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:aT};function cT(n){var t=n.state,e=n.name;t.modifiersData[e]=Gg({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var qg={name:"popperOffsets",enabled:!0,phase:"read",fn:cT,data:{}};function uT(n){return n==="x"?"y":"x"}function hT(n){var t=n.state,e=n.options,s=n.name,r=e.mainAxis,i=r===void 0?!0:r,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,u=e.rootBoundary,h=e.altBoundary,f=e.padding,d=e.tether,g=d===void 0?!0:d,p=e.tetherOffset,m=p===void 0?0:p,y=$i(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:h}),b=vn(t.placement),w=Pr(t.placement),x=!w,v=Rc(b),S=uT(v),E=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,T=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,k=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(E){if(i){var N,j=v==="y"?xe:ve,A=v==="y"?Ve:je,P=v==="y"?"height":"width",L=E[v],V=L+y[j],Y=L-y[A],ot=g?-M[P]/2:0,F=w===Sr?C[P]:M[P],H=w===Sr?-M[P]:-C[P],B=t.elements.arrow,K=g&&B?Dc(B):{width:0,height:0},nt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Lg(),rt=nt[j],et=nt[A],ft=Vi(0,C[P],K[P]),ge=x?C[P]/2-ot-ft-rt-k.mainAxis:F-ft-rt-k.mainAxis,St=x?-C[P]/2+ot+ft+et+k.mainAxis:H+ft+et+k.mainAxis,xt=t.elements.arrow&&Bi(t.elements.arrow),An=xt?v==="y"?xt.clientTop||0:xt.clientLeft||0:0,pe=(N=_==null?void 0:_[v])!=null?N:0,dn=L+ge-pe-An,Ts=L+St-pe,Ns=Vi(g?ba(V,dn):V,L,g?zs(Y,Ts):Y);E[v]=Ns,D[v]=Ns-L}if(a){var ai,li=v==="x"?xe:ve,st=v==="x"?Ve:je,ie=E[S],ci=S==="y"?"height":"width",yo=ie+y[li],bl=ie-y[st],ui=[xe,ve].indexOf(b)!==-1,U=(ai=_==null?void 0:_[S])!=null?ai:0,Et=ui?yo:ie-C[ci]-M[ci]-U+k.altAxis,Zn=ui?ie+C[ci]+M[ci]-U-k.altAxis:bl,bo=g&&ui?VA(Et,ie,Zn):Vi(g?Et:yo,ie,g?Zn:bl);E[S]=bo,D[S]=bo-ie}t.modifiersData[s]=D}}var dT={name:"preventOverflow",enabled:!0,phase:"main",fn:hT,requiresIfExists:["offset"]};function fT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function gT(n){return n===tn(n)||!$e(n)?Ic(n):fT(n)}function pT(n){var t=n.getBoundingClientRect(),e=Or(t.width)/n.offsetWidth||1,s=Or(t.height)/n.offsetHeight||1;return e!==1||s!==1}function mT(n,t,e){e===void 0&&(e=!1);var s=$e(t),r=$e(t)&&pT(t),i=is(t),o=Mr(n,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!e)&&((xn(t)!=="body"||Bc(i))&&(a=gT(t)),$e(t)?(l=Mr(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Lc(i))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function yT(n){var t=new Map,e=new Set,s=[];n.forEach(function(i){t.set(i.name,i)});function r(i){e.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&r(l)}}),s.push(i)}return n.forEach(function(i){e.has(i.name)||r(i)}),s}function bT(n){var t=yT(n);return DA.reduce(function(e,s){return e.concat(t.filter(function(r){return r.phase===s}))},[])}function wT(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function xT(n){var t=n.reduce(function(e,s){var r=e[s.name];return e[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,e},{});return Object.keys(t).map(function(e){return t[e]})}var Jg={placement:"bottom",modifiers:[],strategy:"absolute"};function Xg(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function jc(n){n===void 0&&(n={});var t=n,e=t.defaultModifiers,s=e===void 0?[]:e,r=t.defaultOptions,i=r===void 0?Jg:r;return function(o,a,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jg,i),modifiersData:{},elements:{reference:o,popper:a},attributes:{},styles:{}},h=[],f=!1,d={state:u,setOptions:function(m){var y=typeof m=="function"?m(u.options):m;p(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:Er(o)?ji(o):o.contextElement?ji(o.contextElement):[],popper:ji(a)};var b=bT(xT([].concat(s,u.options.modifiers)));return u.orderedModifiers=b.filter(function(w){return w.enabled}),g(),d.update()},forceUpdate:function(){if(!f){var m=u.elements,y=m.reference,b=m.popper;if(Xg(y,b)){u.rects={reference:mT(y,Bi(b),u.options.strategy==="fixed"),popper:Dc(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(M){return u.modifiersData[M.name]=Object.assign({},M.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var x=u.orderedModifiers[w],v=x.fn,S=x.options,E=S===void 0?{}:S,C=x.name;typeof v=="function"&&(u=v({state:u,options:E,name:C,instance:d})||u)}}}},update:wT(function(){return new Promise(function(m){d.forceUpdate(),m(u)})}),destroy:function(){p(),f=!0}};if(!Xg(o,a))return d;d.setOptions(l).then(function(m){!f&&l.onFirstUpdate&&l.onFirstUpdate(m)});function g(){u.orderedModifiers.forEach(function(m){var y=m.name,b=m.options,w=b===void 0?{}:b,x=m.effect;if(typeof x=="function"){var v=x({state:u,name:y,instance:d,options:w}),S=function(){};h.push(v||S)}})}function p(){h.forEach(function(m){return m()}),h=[]}return d}}jc();var vT=[zg,qg,$g,Dg];jc({defaultModifiers:vT});var CT=[zg,qg,$g,Dg,lT,sT,dT,FA,iT],ST=jc({defaultModifiers:CT});const ET=(n,t,e={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:l})=>{const u=OT(l);Object.assign(o.value,u)},requires:["computeStyles"]},r=c.computed(()=>{const{onFirstUpdate:l,placement:u,strategy:h,modifiers:f}=c.unref(e);return{onFirstUpdate:l,placement:u||"bottom",strategy:h||"absolute",modifiers:[...f||[],s,{name:"applyStyles",enabled:!1}]}}),i=c.shallowRef(),o=c.ref({styles:{popper:{position:c.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return c.watch(r,l=>{const u=c.unref(i);u&&u.setOptions(l)},{deep:!0}),c.watch([n,t],([l,u])=>{a(),!(!l||!u)&&(i.value=ST(l,u,c.unref(r)))}),c.onBeforeUnmount(()=>{a()}),{state:c.computed(()=>{var l;return{...((l=c.unref(i))==null?void 0:l.state)||{}}}),styles:c.computed(()=>c.unref(o).styles),attributes:c.computed(()=>c.unref(o).attributes),update:()=>{var l;return(l=c.unref(i))==null?void 0:l.update()},forceUpdate:()=>{var l;return(l=c.unref(i))==null?void 0:l.forceUpdate()},instanceRef:c.computed(()=>c.unref(i))}};function OT(n){const t=Object.keys(n.elements),e=la(t.map(r=>[r,n.styles[r]||{}])),s=la(t.map(r=>[r,n.attributes[r]]));return{styles:e,attributes:s}}const Kg=n=>{if(!n)return{onClick:ss,onMousedown:ss,onMouseup:ss};let t=!1,e=!1;return{onClick:o=>{t&&e&&n(o),t=e=!1},onMousedown:o=>{t=o.target===o.currentTarget},onMouseup:o=>{e=o.target===o.currentTarget}}};function Zg(){let n;const t=(s,r)=>{e(),n=window.setTimeout(s,r)},e=()=>window.clearTimeout(n);return $o(()=>e()),{registerTimeout:t,cancelTimeout:e}}const $c={prefix:Math.floor(Math.random()*1e4),current:0},MT=Symbol("elIdInjection"),Qg=()=>c.getCurrentInstance()?c.inject(MT,$c):$c,Ca=n=>{const t=Qg();!Gt&&t===$c&&Pe("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
16
|
+
`)},{immediate:!0})},dA=(n,t,e,s)=>{let r={offsetX:0,offsetY:0};const i=u=>{const h=u.clientX,f=u.clientY,{offsetX:d,offsetY:g}=r,p=n.value.getBoundingClientRect(),m=p.left,y=p.top,b=p.width,w=p.height,x=document.documentElement.clientWidth,v=document.documentElement.clientHeight,S=-m+d,E=-y+g,C=x-m-b+d,M=v-y-w+g,T=N=>{let k=d+N.clientX-h,R=g+N.clientY-f;s!=null&&s.value||(k=Math.min(Math.max(k,S),C),R=Math.min(Math.max(R,E),M)),r={offsetX:k,offsetY:R},n.value&&(n.value.style.transform=`translate(${ki(k)}, ${ki(R)})`)},_=()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",T),document.addEventListener("mouseup",_)},o=()=>{t.value&&n.value&&t.value.addEventListener("mousedown",i)},a=()=>{t.value&&n.value&&t.value.removeEventListener("mousedown",i)},l=()=>{r={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return c.onMounted(()=>{c.watchEffect(()=>{e.value?o():a()})}),c.onBeforeUnmount(()=>{a()}),{resetPosition:l}};var fA={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const gA=n=>(t,e)=>pA(t,e,c.unref(n)),pA=(n,t,e)=>Yd(e,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=t==null?void 0:t[r])!=null?i:`{${r}}`}`}),mA=n=>{const t=c.computed(()=>c.unref(n).name),e=c.isRef(n)?n:c.ref(n);return{lang:t,locale:e,t:gA(n)}},Ag=Symbol("localeContextKey"),yA=n=>{const t=n||c.inject(Ag,c.ref());return mA(c.computed(()=>t.value||fA))},ya="el",bA="is-",$s=(n,t,e,s,r)=>{let i=`${n}-${t}`;return e&&(i+=`-${e}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Tg=Symbol("namespaceContextKey"),Ac=n=>{const t=n||(c.getCurrentInstance()?c.inject(Tg,c.ref(ya)):c.ref(ya));return c.computed(()=>c.unref(t)||ya)},me=(n,t)=>{const e=Ac(t);return{namespace:e,b:(m="")=>$s(e.value,n,m,"",""),e:m=>m?$s(e.value,n,"",m,""):"",m:m=>m?$s(e.value,n,"","",m):"",be:(m,y)=>m&&y?$s(e.value,n,m,y,""):"",em:(m,y)=>m&&y?$s(e.value,n,"",m,y):"",bm:(m,y)=>m&&y?$s(e.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?$s(e.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${bA}${m}`:""},cssVar:m=>{const y={};for(const b in m)m[b]&&(y[`--${e.value}-${b}`]=m[b]);return y},cssVarName:m=>`--${e.value}-${m}`,cssVarBlock:m=>{const y={};for(const b in m)m[b]&&(y[`--${e.value}-${n}-${b}`]=m[b]);return y},cssVarBlockName:m=>`--${e.value}-${n}-${m}`}},wA=(n,t={})=>{c.isRef(n)||N2("[useLockscreen]","You need to pass a ref param to this function");const e=t.ns||me("popup"),s=c.computed(()=>e.bm("parent","hidden"));if(!Ut||mg(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(D2(document==null?void 0:document.body,s.value),i&&document&&(document.body.style.width=o))},200)};c.watch(n,l=>{if(!l){a();return}i=!mg(document.body,s.value),i&&(o=document.body.style.width),r=I2(e.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,h=R2(document.body,"overflowY");r>0&&(u||h==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),k2(document.body,s.value)}),c.onScopeDispose(()=>a())},xA=ga({type:ct(Boolean),default:null}),vA=ga({type:ct(Function)}),CA=n=>{const t=`update:${n}`,e=`onUpdate:${n}`,s=[t],r={[n]:xA,[e]:vA};return{useModelToggle:({indicator:o,toggleReason:a,shouldHideWhenRouteChanges:l,shouldProceed:u,onShow:h,onHide:f})=>{const d=c.getCurrentInstance(),{emit:g}=d,p=d.props,m=c.computed(()=>Re(p[e])),y=c.computed(()=>p[n]===null),b=C=>{o.value!==!0&&(o.value=!0,a&&(a.value=C),Re(h)&&h(C))},w=C=>{o.value!==!1&&(o.value=!1,a&&(a.value=C),Re(f)&&f(C))},x=C=>{if(p.disabled===!0||Re(u)&&!u())return;const M=m.value&&Ut;M&&g(t,!0),(y.value||!M)&&b(C)},v=C=>{if(p.disabled===!0||!Ut)return;const M=m.value&&Ut;M&&g(t,!1),(y.value||!M)&&w(C)},S=C=>{ha(C)&&(p.disabled&&C?m.value&&g(t,!1):o.value!==C&&(C?b():w()))},E=()=>{o.value?v():x()};return c.watch(()=>p[n],S),l&&d.appContext.config.globalProperties.$route!==void 0&&c.watch(()=>({...d.proxy.$route}),()=>{l.value&&o.value&&v()}),c.onMounted(()=>{S(p[n])}),{hide:v,show:x,toggle:E,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},Ng=n=>{const t=c.getCurrentInstance();return c.computed(()=>{var e,s;return(s=(e=t==null?void 0:t.proxy)==null?void 0:e.$props)==null?void 0:s[n]})};var xe="top",Ve="bottom",je="right",ve="left",Tc="auto",Ri=[xe,Ve,je,ve],Sr="start",Ii="end",SA="clippingParents",_g="viewport",Li="popper",EA="reference",kg=Ri.reduce(function(n,t){return n.concat([t+"-"+Sr,t+"-"+Ii])},[]),Nc=[].concat(Ri,[Tc]).reduce(function(n,t){return n.concat([t,t+"-"+Sr,t+"-"+Ii])},[]),OA="beforeRead",MA="read",PA="afterRead",AA="beforeMain",TA="main",NA="afterMain",_A="beforeWrite",kA="write",DA="afterWrite",RA=[OA,MA,PA,AA,TA,NA,_A,kA,DA];function xn(n){return n?(n.nodeName||"").toLowerCase():null}function tn(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var t=n.ownerDocument;return t&&t.defaultView||window}return n}function Er(n){var t=tn(n).Element;return n instanceof t||n instanceof Element}function $e(n){var t=tn(n).HTMLElement;return n instanceof t||n instanceof HTMLElement}function _c(n){if(typeof ShadowRoot>"u")return!1;var t=tn(n).ShadowRoot;return n instanceof t||n instanceof ShadowRoot}function IA(n){var t=n.state;Object.keys(t.elements).forEach(function(e){var s=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!$e(i)||!xn(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(o){var a=r[o];a===!1?i.removeAttribute(o):i.setAttribute(o,a===!0?"":a)}))})}function LA(n){var t=n.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],i=t.attributes[s]||{},o=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:e[s]),a=o.reduce(function(l,u){return l[u]="",l},{});!$e(r)||!xn(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}var Dg={name:"applyStyles",enabled:!0,phase:"write",fn:IA,effect:LA,requires:["computeStyles"]};function vn(n){return n.split("-")[0]}var zs=Math.max,ba=Math.min,Or=Math.round;function Mr(n,t){t===void 0&&(t=!1);var e=n.getBoundingClientRect(),s=1,r=1;if($e(n)&&t){var i=n.offsetHeight,o=n.offsetWidth;o>0&&(s=Or(e.width)/o||1),i>0&&(r=Or(e.height)/i||1)}return{width:e.width/s,height:e.height/r,top:e.top/r,right:e.right/s,bottom:e.bottom/r,left:e.left/s,x:e.left/s,y:e.top/r}}function kc(n){var t=Mr(n),e=n.offsetWidth,s=n.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:n.offsetLeft,y:n.offsetTop,width:e,height:s}}function Rg(n,t){var e=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(e&&_c(e)){var s=t;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Hn(n){return tn(n).getComputedStyle(n)}function BA(n){return["table","td","th"].indexOf(xn(n))>=0}function is(n){return((Er(n)?n.ownerDocument:n.document)||window.document).documentElement}function wa(n){return xn(n)==="html"?n:n.assignedSlot||n.parentNode||(_c(n)?n.host:null)||is(n)}function Ig(n){return!$e(n)||Hn(n).position==="fixed"?null:n.offsetParent}function VA(n){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,e=navigator.userAgent.indexOf("Trident")!==-1;if(e&&$e(n)){var s=Hn(n);if(s.position==="fixed")return null}var r=wa(n);for(_c(r)&&(r=r.host);$e(r)&&["html","body"].indexOf(xn(r))<0;){var i=Hn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Bi(n){for(var t=tn(n),e=Ig(n);e&&BA(e)&&Hn(e).position==="static";)e=Ig(e);return e&&(xn(e)==="html"||xn(e)==="body"&&Hn(e).position==="static")?t:e||VA(n)||t}function Dc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Vi(n,t,e){return zs(n,ba(t,e))}function jA(n,t,e){var s=Vi(n,t,e);return s>e?e:s}function Lg(){return{top:0,right:0,bottom:0,left:0}}function Bg(n){return Object.assign({},Lg(),n)}function Vg(n,t){return t.reduce(function(e,s){return e[s]=n,e},{})}var $A=function(n,t){return n=typeof n=="function"?n(Object.assign({},t.rects,{placement:t.placement})):n,Bg(typeof n!="number"?n:Vg(n,Ri))};function zA(n){var t,e=n.state,s=n.name,r=n.options,i=e.elements.arrow,o=e.modifiersData.popperOffsets,a=vn(e.placement),l=Dc(a),u=[ve,je].indexOf(a)>=0,h=u?"height":"width";if(!(!i||!o)){var f=$A(r.padding,e),d=kc(i),g=l==="y"?xe:ve,p=l==="y"?Ve:je,m=e.rects.reference[h]+e.rects.reference[l]-o[l]-e.rects.popper[h],y=o[l]-e.rects.reference[l],b=Bi(i),w=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,v=f[g],S=w-d[h]-f[p],E=w/2-d[h]/2+x,C=Vi(v,E,S),M=l;e.modifiersData[s]=(t={},t[M]=C,t.centerOffset=C-E,t)}}function FA(n){var t=n.state,e=n.options,s=e.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||!Rg(t.elements.popper,r)||(t.elements.arrow=r))}var HA={name:"arrow",enabled:!0,phase:"main",fn:zA,effect:FA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pr(n){return n.split("-")[1]}var UA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function GA(n){var t=n.x,e=n.y,s=window,r=s.devicePixelRatio||1;return{x:Or(t*r)/r||0,y:Or(e*r)/r||0}}function jg(n){var t,e=n.popper,s=n.popperRect,r=n.placement,i=n.variation,o=n.offsets,a=n.position,l=n.gpuAcceleration,u=n.adaptive,h=n.roundOffsets,f=n.isFixed,d=o.x,g=d===void 0?0:d,p=o.y,m=p===void 0?0:p,y=typeof h=="function"?h({x:g,y:m}):{x:g,y:m};g=y.x,m=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),x=ve,v=xe,S=window;if(u){var E=Bi(e),C="clientHeight",M="clientWidth";if(E===tn(e)&&(E=is(e),Hn(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",M="scrollWidth")),E=E,r===xe||(r===ve||r===je)&&i===Ii){v=Ve;var T=f&&E===S&&S.visualViewport?S.visualViewport.height:E[C];m-=T-s.height,m*=l?1:-1}if(r===ve||(r===xe||r===Ve)&&i===Ii){x=je;var _=f&&E===S&&S.visualViewport?S.visualViewport.width:E[M];g-=_-s.width,g*=l?1:-1}}var N=Object.assign({position:a},u&&UA),k=h===!0?GA({x:g,y:m}):{x:g,y:m};if(g=k.x,m=k.y,l){var R;return Object.assign({},N,(R={},R[v]=w?"0":"",R[x]=b?"0":"",R.transform=(S.devicePixelRatio||1)<=1?"translate("+g+"px, "+m+"px)":"translate3d("+g+"px, "+m+"px, 0)",R))}return Object.assign({},N,(t={},t[v]=w?m+"px":"",t[x]=b?g+"px":"",t.transform="",t))}function YA(n){var t=n.state,e=n.options,s=e.gpuAcceleration,r=s===void 0?!0:s,i=e.adaptive,o=i===void 0?!0:i,a=e.roundOffsets,l=a===void 0?!0:a,u={placement:vn(t.placement),variation:Pr(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,jg(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,jg(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var $g={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:YA,data:{}},xa={passive:!0};function WA(n){var t=n.state,e=n.instance,s=n.options,r=s.scroll,i=r===void 0?!0:r,o=s.resize,a=o===void 0?!0:o,l=tn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(h){h.addEventListener("scroll",e.update,xa)}),a&&l.addEventListener("resize",e.update,xa),function(){i&&u.forEach(function(h){h.removeEventListener("scroll",e.update,xa)}),a&&l.removeEventListener("resize",e.update,xa)}}var zg={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:WA,data:{}},qA={left:"right",right:"left",bottom:"top",top:"bottom"};function va(n){return n.replace(/left|right|bottom|top/g,function(t){return qA[t]})}var JA={start:"end",end:"start"};function Fg(n){return n.replace(/start|end/g,function(t){return JA[t]})}function Rc(n){var t=tn(n),e=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:e,scrollTop:s}}function Ic(n){return Mr(is(n)).left+Rc(n).scrollLeft}function XA(n){var t=tn(n),e=is(n),s=t.visualViewport,r=e.clientWidth,i=e.clientHeight,o=0,a=0;return s&&(r=s.width,i=s.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=s.offsetLeft,a=s.offsetTop)),{width:r,height:i,x:o+Ic(n),y:a}}function KA(n){var t,e=is(n),s=Rc(n),r=(t=n.ownerDocument)==null?void 0:t.body,i=zs(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=zs(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Ic(n),l=-s.scrollTop;return Hn(r||e).direction==="rtl"&&(a+=zs(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:l}}function Lc(n){var t=Hn(n),e=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+s)}function Hg(n){return["html","body","#document"].indexOf(xn(n))>=0?n.ownerDocument.body:$e(n)&&Lc(n)?n:Hg(wa(n))}function ji(n,t){var e;t===void 0&&(t=[]);var s=Hg(n),r=s===((e=n.ownerDocument)==null?void 0:e.body),i=tn(s),o=r?[i].concat(i.visualViewport||[],Lc(s)?s:[]):s,a=t.concat(o);return r?a:a.concat(ji(wa(o)))}function Bc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function ZA(n){var t=Mr(n);return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Ug(n,t){return t===_g?Bc(XA(n)):Er(t)?ZA(t):Bc(KA(is(n)))}function QA(n){var t=ji(wa(n)),e=["absolute","fixed"].indexOf(Hn(n).position)>=0,s=e&&$e(n)?Bi(n):n;return Er(s)?t.filter(function(r){return Er(r)&&Rg(r,s)&&xn(r)!=="body"}):[]}function tT(n,t,e){var s=t==="clippingParents"?QA(n):[].concat(t),r=[].concat(s,[e]),i=r[0],o=r.reduce(function(a,l){var u=Ug(n,l);return a.top=zs(u.top,a.top),a.right=ba(u.right,a.right),a.bottom=ba(u.bottom,a.bottom),a.left=zs(u.left,a.left),a},Ug(n,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Gg(n){var t=n.reference,e=n.element,s=n.placement,r=s?vn(s):null,i=s?Pr(s):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(r){case xe:l={x:o,y:t.y-e.height};break;case Ve:l={x:o,y:t.y+t.height};break;case je:l={x:t.x+t.width,y:a};break;case ve:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var u=r?Dc(r):null;if(u!=null){var h=u==="y"?"height":"width";switch(i){case Sr:l[u]=l[u]-(t[h]/2-e[h]/2);break;case Ii:l[u]=l[u]+(t[h]/2-e[h]/2);break}}return l}function $i(n,t){t===void 0&&(t={});var e=t,s=e.placement,r=s===void 0?n.placement:s,i=e.boundary,o=i===void 0?SA:i,a=e.rootBoundary,l=a===void 0?_g:a,u=e.elementContext,h=u===void 0?Li:u,f=e.altBoundary,d=f===void 0?!1:f,g=e.padding,p=g===void 0?0:g,m=Bg(typeof p!="number"?p:Vg(p,Ri)),y=h===Li?EA:Li,b=n.rects.popper,w=n.elements[d?y:h],x=tT(Er(w)?w:w.contextElement||is(n.elements.popper),o,l),v=Mr(n.elements.reference),S=Gg({reference:v,element:b,strategy:"absolute",placement:r}),E=Bc(Object.assign({},b,S)),C=h===Li?E:v,M={top:x.top-C.top+m.top,bottom:C.bottom-x.bottom+m.bottom,left:x.left-C.left+m.left,right:C.right-x.right+m.right},T=n.modifiersData.offset;if(h===Li&&T){var _=T[r];Object.keys(M).forEach(function(N){var k=[je,Ve].indexOf(N)>=0?1:-1,R=[xe,Ve].indexOf(N)>=0?"y":"x";M[N]+=_[R]*k})}return M}function eT(n,t){t===void 0&&(t={});var e=t,s=e.placement,r=e.boundary,i=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?Nc:l,h=Pr(s),f=h?a?kg:kg.filter(function(p){return Pr(p)===h}):Ri,d=f.filter(function(p){return u.indexOf(p)>=0});d.length===0&&(d=f);var g=d.reduce(function(p,m){return p[m]=$i(n,{placement:m,boundary:r,rootBoundary:i,padding:o})[vn(m)],p},{});return Object.keys(g).sort(function(p,m){return g[p]-g[m]})}function nT(n){if(vn(n)===Tc)return[];var t=va(n);return[Fg(n),t,Fg(t)]}function sT(n){var t=n.state,e=n.options,s=n.name;if(!t.modifiersData[s]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,u=e.padding,h=e.boundary,f=e.rootBoundary,d=e.altBoundary,g=e.flipVariations,p=g===void 0?!0:g,m=e.allowedAutoPlacements,y=t.options.placement,b=vn(y),w=b===y,x=l||(w||!p?[va(y)]:nT(y)),v=[y].concat(x).reduce(function(K,nt){return K.concat(vn(nt)===Tc?eT(t,{placement:nt,boundary:h,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:m}):nt)},[]),S=t.rects.reference,E=t.rects.popper,C=new Map,M=!0,T=v[0],_=0;_<v.length;_++){var N=v[_],k=vn(N),R=Pr(N)===Sr,I=[xe,Ve].indexOf(k)>=0,A=I?"width":"height",P=$i(t,{placement:N,boundary:h,rootBoundary:f,altBoundary:d,padding:u}),B=I?R?je:ve:R?Ve:xe;S[A]>E[A]&&(B=va(B));var j=va(B),Y=[];if(i&&Y.push(P[k]<=0),a&&Y.push(P[B]<=0,P[j]<=0),Y.every(function(K){return K})){T=N,M=!1;break}C.set(N,Y)}if(M)for(var ot=p?3:1,F=function(K){var nt=v.find(function(rt){var et=C.get(rt);if(et)return et.slice(0,K).every(function(ft){return ft})});if(nt)return T=nt,"break"},H=ot;H>0;H--){var V=F(H);if(V==="break")break}t.placement!==T&&(t.modifiersData[s]._skip=!0,t.placement=T,t.reset=!0)}}var rT={name:"flip",enabled:!0,phase:"main",fn:sT,requiresIfExists:["offset"],data:{_skip:!1}};function Yg(n,t,e){return e===void 0&&(e={x:0,y:0}),{top:n.top-t.height-e.y,right:n.right-t.width+e.x,bottom:n.bottom-t.height+e.y,left:n.left-t.width-e.x}}function Wg(n){return[xe,je,Ve,ve].some(function(t){return n[t]>=0})}function iT(n){var t=n.state,e=n.name,s=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,o=$i(t,{elementContext:"reference"}),a=$i(t,{altBoundary:!0}),l=Yg(o,s),u=Yg(a,r,i),h=Wg(l),f=Wg(u);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:h,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":f})}var oT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iT};function aT(n,t,e){var s=vn(n),r=[ve,xe].indexOf(s)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},t,{placement:n})):e,o=i[0],a=i[1];return o=o||0,a=(a||0)*r,[ve,je].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function lT(n){var t=n.state,e=n.options,s=n.name,r=e.offset,i=r===void 0?[0,0]:r,o=Nc.reduce(function(h,f){return h[f]=aT(f,t.rects,i),h},{}),a=o[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[s]=o}var cT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:lT};function uT(n){var t=n.state,e=n.name;t.modifiersData[e]=Gg({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var qg={name:"popperOffsets",enabled:!0,phase:"read",fn:uT,data:{}};function hT(n){return n==="x"?"y":"x"}function dT(n){var t=n.state,e=n.options,s=n.name,r=e.mainAxis,i=r===void 0?!0:r,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,u=e.rootBoundary,h=e.altBoundary,f=e.padding,d=e.tether,g=d===void 0?!0:d,p=e.tetherOffset,m=p===void 0?0:p,y=$i(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:h}),b=vn(t.placement),w=Pr(t.placement),x=!w,v=Dc(b),S=hT(v),E=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,T=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,_=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(E){if(i){var R,I=v==="y"?xe:ve,A=v==="y"?Ve:je,P=v==="y"?"height":"width",B=E[v],j=B+y[I],Y=B-y[A],ot=g?-M[P]/2:0,F=w===Sr?C[P]:M[P],H=w===Sr?-M[P]:-C[P],V=t.elements.arrow,K=g&&V?kc(V):{width:0,height:0},nt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Lg(),rt=nt[I],et=nt[A],ft=Vi(0,C[P],K[P]),ge=x?C[P]/2-ot-ft-rt-_.mainAxis:F-ft-rt-_.mainAxis,St=x?-C[P]/2+ot+ft+et+_.mainAxis:H+ft+et+_.mainAxis,xt=t.elements.arrow&&Bi(t.elements.arrow),An=xt?v==="y"?xt.clientTop||0:xt.clientLeft||0:0,pe=(R=N==null?void 0:N[v])!=null?R:0,dn=B+ge-pe-An,Ts=B+St-pe,Ns=Vi(g?ba(j,dn):j,B,g?zs(Y,Ts):Y);E[v]=Ns,k[v]=Ns-B}if(a){var ai,li=v==="x"?xe:ve,st=v==="x"?Ve:je,ie=E[S],ci=S==="y"?"height":"width",yo=ie+y[li],yl=ie-y[st],ui=[xe,ve].indexOf(b)!==-1,U=(ai=N==null?void 0:N[S])!=null?ai:0,Et=ui?yo:ie-C[ci]-M[ci]-U+_.altAxis,Zn=ui?ie+C[ci]+M[ci]-U-_.altAxis:yl,bo=g&&ui?jA(Et,ie,Zn):Vi(g?Et:yo,ie,g?Zn:yl);E[S]=bo,k[S]=bo-ie}t.modifiersData[s]=k}}var fT={name:"preventOverflow",enabled:!0,phase:"main",fn:dT,requiresIfExists:["offset"]};function gT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function pT(n){return n===tn(n)||!$e(n)?Rc(n):gT(n)}function mT(n){var t=n.getBoundingClientRect(),e=Or(t.width)/n.offsetWidth||1,s=Or(t.height)/n.offsetHeight||1;return e!==1||s!==1}function yT(n,t,e){e===void 0&&(e=!1);var s=$e(t),r=$e(t)&&mT(t),i=is(t),o=Mr(n,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!e)&&((xn(t)!=="body"||Lc(i))&&(a=pT(t)),$e(t)?(l=Mr(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Ic(i))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function bT(n){var t=new Map,e=new Set,s=[];n.forEach(function(i){t.set(i.name,i)});function r(i){e.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&r(l)}}),s.push(i)}return n.forEach(function(i){e.has(i.name)||r(i)}),s}function wT(n){var t=bT(n);return RA.reduce(function(e,s){return e.concat(t.filter(function(r){return r.phase===s}))},[])}function xT(n){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(n())})})),t}}function vT(n){var t=n.reduce(function(e,s){var r=e[s.name];return e[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,e},{});return Object.keys(t).map(function(e){return t[e]})}var Jg={placement:"bottom",modifiers:[],strategy:"absolute"};function Xg(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Vc(n){n===void 0&&(n={});var t=n,e=t.defaultModifiers,s=e===void 0?[]:e,r=t.defaultOptions,i=r===void 0?Jg:r;return function(o,a,l){l===void 0&&(l=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jg,i),modifiersData:{},elements:{reference:o,popper:a},attributes:{},styles:{}},h=[],f=!1,d={state:u,setOptions:function(m){var y=typeof m=="function"?m(u.options):m;p(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:Er(o)?ji(o):o.contextElement?ji(o.contextElement):[],popper:ji(a)};var b=wT(vT([].concat(s,u.options.modifiers)));return u.orderedModifiers=b.filter(function(w){return w.enabled}),g(),d.update()},forceUpdate:function(){if(!f){var m=u.elements,y=m.reference,b=m.popper;if(Xg(y,b)){u.rects={reference:yT(y,Bi(b),u.options.strategy==="fixed"),popper:kc(b)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(M){return u.modifiersData[M.name]=Object.assign({},M.data)});for(var w=0;w<u.orderedModifiers.length;w++){if(u.reset===!0){u.reset=!1,w=-1;continue}var x=u.orderedModifiers[w],v=x.fn,S=x.options,E=S===void 0?{}:S,C=x.name;typeof v=="function"&&(u=v({state:u,options:E,name:C,instance:d})||u)}}}},update:xT(function(){return new Promise(function(m){d.forceUpdate(),m(u)})}),destroy:function(){p(),f=!0}};if(!Xg(o,a))return d;d.setOptions(l).then(function(m){!f&&l.onFirstUpdate&&l.onFirstUpdate(m)});function g(){u.orderedModifiers.forEach(function(m){var y=m.name,b=m.options,w=b===void 0?{}:b,x=m.effect;if(typeof x=="function"){var v=x({state:u,name:y,instance:d,options:w}),S=function(){};h.push(v||S)}})}function p(){h.forEach(function(m){return m()}),h=[]}return d}}Vc();var CT=[zg,qg,$g,Dg];Vc({defaultModifiers:CT});var ST=[zg,qg,$g,Dg,cT,rT,fT,HA,oT],ET=Vc({defaultModifiers:ST});const OT=(n,t,e={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:l})=>{const u=MT(l);Object.assign(o.value,u)},requires:["computeStyles"]},r=c.computed(()=>{const{onFirstUpdate:l,placement:u,strategy:h,modifiers:f}=c.unref(e);return{onFirstUpdate:l,placement:u||"bottom",strategy:h||"absolute",modifiers:[...f||[],s,{name:"applyStyles",enabled:!1}]}}),i=c.shallowRef(),o=c.ref({styles:{popper:{position:c.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return c.watch(r,l=>{const u=c.unref(i);u&&u.setOptions(l)},{deep:!0}),c.watch([n,t],([l,u])=>{a(),!(!l||!u)&&(i.value=ET(l,u,c.unref(r)))}),c.onBeforeUnmount(()=>{a()}),{state:c.computed(()=>{var l;return{...((l=c.unref(i))==null?void 0:l.state)||{}}}),styles:c.computed(()=>c.unref(o).styles),attributes:c.computed(()=>c.unref(o).attributes),update:()=>{var l;return(l=c.unref(i))==null?void 0:l.update()},forceUpdate:()=>{var l;return(l=c.unref(i))==null?void 0:l.forceUpdate()},instanceRef:c.computed(()=>c.unref(i))}};function MT(n){const t=Object.keys(n.elements),e=la(t.map(r=>[r,n.styles[r]||{}])),s=la(t.map(r=>[r,n.attributes[r]]));return{styles:e,attributes:s}}const Kg=n=>{if(!n)return{onClick:ss,onMousedown:ss,onMouseup:ss};let t=!1,e=!1;return{onClick:o=>{t&&e&&n(o),t=e=!1},onMousedown:o=>{t=o.target===o.currentTarget},onMouseup:o=>{e=o.target===o.currentTarget}}};function Zg(){let n;const t=(s,r)=>{e(),n=window.setTimeout(s,r)},e=()=>window.clearTimeout(n);return $o(()=>e()),{registerTimeout:t,cancelTimeout:e}}const jc={prefix:Math.floor(Math.random()*1e4),current:0},PT=Symbol("elIdInjection"),Qg=()=>c.getCurrentInstance()?c.inject(PT,jc):jc,Ca=n=>{const t=Qg();!Ut&&t===jc&&Pe("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
|
17
17
|
usage: app.provide(ID_INJECTION_KEY, {
|
|
18
18
|
prefix: number,
|
|
19
19
|
current: number,
|
|
20
|
-
})`);const e=
|
|
21
|
-
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function
|
|
20
|
+
})`);const e=Ac();return c.computed(()=>c.unref(n)||`${e.value}-id-${t.prefix}-${t.current++}`)};let Ar=[];const tp=n=>{const t=n;t.key===Cr.esc&&Ar.forEach(e=>e(t))},AT=n=>{c.onMounted(()=>{Ar.length===0&&document.addEventListener("keydown",tp),Ut&&Ar.push(n)}),c.onBeforeUnmount(()=>{Ar=Ar.filter(t=>t!==n),Ar.length===0&&Ut&&document.removeEventListener("keydown",tp)})},ep=()=>{const n=Ac(),t=Qg(),e=c.computed(()=>`${n.value}-popper-container-${t.prefix}`),s=c.computed(()=>`#${e.value}`);return{id:e,selector:s}},TT=n=>{const t=document.createElement("div");return t.id=n,document.body.appendChild(t),t},NT=()=>{const{id:n,selector:t}=ep();return c.onBeforeMount(()=>{Ut&&(process.env.NODE_ENV==="test"||!document.body.querySelector(t.value))&&TT(n.value)}),{id:n,selector:t}},_T=Kt({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),kT=({showAfter:n,hideAfter:t,autoClose:e,open:s,close:r})=>{const{registerTimeout:i}=Zg(),{registerTimeout:o,cancelTimeout:a}=Zg();return{onOpen:h=>{i(()=>{s(h);const f=c.unref(e);Be(f)&&f>0&&o(()=>{r(h)},f)},c.unref(n))},onClose:h=>{a(),i(()=>{r(h)},c.unref(t))}}},np=Symbol("elForwardRef"),DT=n=>{const t=e=>{n.value=e};c.provide(np,{setForwardRef:t})},RT=n=>({mounted(t){n(t)},updated(t){n(t)},unmounted(){n(null)}}),sp={current:0},rp=c.ref(0),ip=2e3,op=Symbol("elZIndexContextKey"),ap=Symbol("zIndexContextKey"),lp=n=>{const t=c.getCurrentInstance()?c.inject(op,sp):sp,e=n||(c.getCurrentInstance()?c.inject(ap,void 0):void 0),s=c.computed(()=>{const o=c.unref(e);return Be(o)?o:ip}),r=c.computed(()=>s.value+rp.value),i=()=>(t.current++,rp.value=t.current,r.value);return!Ut&&!c.inject(op)&&Pe("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
|
21
|
+
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function IT(n){let t;function e(){if(n.value==null)return;const{selectionStart:r,selectionEnd:i,value:o}=n.value;if(r==null||i==null)return;const a=o.slice(0,Math.max(0,r)),l=o.slice(Math.max(0,i));t={selectionStart:r,selectionEnd:i,value:o,beforeTxt:a,afterTxt:l}}function s(){if(n.value==null||t==null)return;const{value:r}=n.value,{beforeTxt:i,afterTxt:o,selectionStart:a}=t;if(i==null||o==null||a==null)return;let l=r.length;if(r.endsWith(o))l=r.length-o.length;else if(r.startsWith(i))l=i.length;else{const u=i[a-1],h=r.indexOf(u,a-1);h!==-1&&(l=h+1)}n.value.setSelectionRange(l,l)}return[e,s]}const $c=ga({type:String,values:Mg,required:!1}),cp=Symbol("size"),LT=()=>{const n=c.inject(cp,{});return c.computed(()=>c.unref(n.size)||"")};function BT(n,{beforeFocus:t,afterFocus:e,beforeBlur:s,afterBlur:r}={}){const i=c.getCurrentInstance(),{emit:o}=i,a=c.shallowRef(),l=c.ref(!1),u=d=>{Re(t)&&t(d)||l.value||(l.value=!0,o("focus",d),e==null||e())},h=d=>{var g;Re(s)&&s(d)||d.relatedTarget&&((g=a.value)!=null&&g.contains(d.relatedTarget))||(l.value=!1,o("blur",d),r==null||r())},f=()=>{var d,g;(d=a.value)!=null&&d.contains(document.activeElement)&&a.value!==document.activeElement||(g=n.value)==null||g.focus()};return c.watch(a,d=>{d&&d.setAttribute("tabindex","-1")}),jn(a,"focus",u,!0),jn(a,"blur",h,!0),jn(a,"click",f,!0),process.env.NODE_ENV==="test"&&c.onMounted(()=>{const d=Fn(n.value)?n.value:document.querySelector("input,textarea");d&&(jn(d,"focus",u,!0),jn(d,"blur",h,!0))}),{isFocused:l,wrapperRef:a,handleFocus:u,handleBlur:h}}function VT({afterComposition:n,emit:t}){const e=c.ref(!1),s=a=>{t==null||t("compositionstart",a),e.value=!0},r=a=>{var l;t==null||t("compositionupdate",a);const u=(l=a.target)==null?void 0:l.value,h=u[u.length-1]||"";e.value=!aA(h)},i=a=>{t==null||t("compositionend",a),e.value&&(e.value=!1,c.nextTick(()=>n(a)))};return{isComposing:e,handleComposition:a=>{a.type==="compositionend"?i(a):r(a)},handleCompositionStart:s,handleCompositionUpdate:r,handleCompositionEnd:i}}const jT=Symbol("emptyValuesContextKey"),$T=Kt({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>Re(n)?!n():!n}}),zT=Kt({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),zc=n=>Oc(zT,n),up=Symbol(),Sa=c.ref();function Fc(n,t=void 0){const e=c.getCurrentInstance()?c.inject(up,Sa):Sa;return n?c.computed(()=>{var s,r;return(r=(s=e.value)==null?void 0:s[n])!=null?r:t}):e}function hp(n,t){const e=Fc(),s=me(n,c.computed(()=>{var a;return((a=e.value)==null?void 0:a.namespace)||ya})),r=yA(c.computed(()=>{var a;return(a=e.value)==null?void 0:a.locale})),i=lp(c.computed(()=>{var a;return((a=e.value)==null?void 0:a.zIndex)||ip})),o=c.computed(()=>{var a;return c.unref(t)||((a=e.value)==null?void 0:a.size)||""});return dp(c.computed(()=>c.unref(e)||{})),{ns:s,locale:r,zIndex:i,size:o}}const dp=(n,t,e=!1)=>{var s;const r=!!c.getCurrentInstance(),i=r?Fc():void 0,o=(s=void 0)!=null?s:r?c.provide:void 0;if(!o){Pe("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=c.computed(()=>{const l=c.unref(n);return i!=null&&i.value?FT(i.value,l):l});return o(up,a),o(Ag,c.computed(()=>a.value.locale)),o(Tg,c.computed(()=>a.value.namespace)),o(ap,c.computed(()=>a.value.zIndex)),o(cp,{size:c.computed(()=>a.value.size||"")}),o(jT,c.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(e||!Sa.value)&&(Sa.value=a.value),a},FT=(n,t)=>{const e=[...new Set([...fg(n),...fg(t)])],s={};for(const r of e)s[r]=t[r]!==void 0?t[r]:n[r];return s},HT=Kt({a11y:{type:Boolean,default:!0},locale:{type:ct(Object)},size:$c,button:{type:ct(Object)},experimentalFeatures:{type:ct(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:ct(Object)},zIndex:Number,namespace:{type:String,default:"el"},...$T}),en={};c.defineComponent({name:"ElConfigProvider",props:HT,setup(n,{slots:t}){c.watch(()=>n.message,s=>{Object.assign(en,s??{})},{immediate:!0,deep:!0});const e=dp(n);return()=>c.renderSlot(t,"default",{config:e==null?void 0:e.value})}});var he=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e};const UT=Kt({size:{type:ct([Number,String])},color:{type:String}}),GT=c.defineComponent({name:"ElIcon",inheritAttrs:!1}),YT=c.defineComponent({...GT,props:UT,setup(n){const t=n,e=me("icon"),s=c.computed(()=>{const{size:r,color:i}=t;return!r&&!i?{}:{fontSize:dg(r)?void 0:ki(r),"--color":i}});return(r,i)=>(c.openBlock(),c.createElementBlock("i",c.mergeProps({class:c.unref(e).b(),style:c.unref(s)},r.$attrs),[c.renderSlot(r.$slots,"default")],16))}});var WT=he(YT,[["__file","icon.vue"]]);const Cn=js(WT),Hc=Symbol("formContextKey"),Ea=Symbol("formItemContextKey"),fp=(n,t={})=>{const e=c.ref(void 0),s=t.prop?e:Ng("size"),r=t.global?e:LT(),i=t.form?{size:void 0}:c.inject(Hc,void 0),o=t.formItem?{size:void 0}:c.inject(Ea,void 0);return c.computed(()=>s.value||c.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},Uc=n=>{const t=Ng("disabled"),e=c.inject(Hc,void 0);return c.computed(()=>t.value||c.unref(n)||(e==null?void 0:e.disabled)||!1)},gp=()=>{const n=c.inject(Hc,void 0),t=c.inject(Ea,void 0);return{form:n,formItem:t}},qT=(n,{formItemContext:t,disableIdGeneration:e,disableIdManagement:s})=>{e||(e=c.ref(!1)),s||(s=c.ref(!1));const r=c.ref();let i;const o=c.computed(()=>{var a;return!!(!(n.label||n.ariaLabel)&&t&&t.inputIds&&((a=t.inputIds)==null?void 0:a.length)<=1)});return c.onMounted(()=>{i=c.watch([c.toRef(n,"id"),e],([a,l])=>{const u=a??(l?void 0:Ca().value);u!==r.value&&(t!=null&&t.removeInputId&&(r.value&&t.removeInputId(r.value),!(s!=null&&s.value)&&!l&&u&&t.addInputId(u)),r.value=u)},{immediate:!0})}),c.onUnmounted(()=>{i&&i(),t!=null&&t.removeInputId&&r.value&&t.removeInputId(r.value)}),{isLabeledByFormItem:o,inputId:r}};let nn;const JT=`
|
|
22
22
|
height:0 !important;
|
|
23
23
|
visibility:hidden !important;
|
|
24
|
-
${
|
|
24
|
+
${mv()?"":"overflow:hidden !important;"}
|
|
25
25
|
position:absolute !important;
|
|
26
26
|
z-index:-1000 !important;
|
|
27
27
|
top:0 !important;
|
|
28
28
|
right:0 !important;
|
|
29
|
-
`,JT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function XT(n){const t=window.getComputedStyle(n),e=t.getPropertyValue("box-sizing"),s=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:JT.map(o=>`${o}:${t.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:e}}function pp(n,t=1,e){var s;nn||(nn=document.createElement("textarea"),document.body.appendChild(nn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=XT(n);nn.setAttribute("style",`${a};${qT}`),nn.value=n.value||n.placeholder||"";let l=nn.scrollHeight;const u={};o==="border-box"?l=l+i:o==="content-box"&&(l=l-r),nn.value="";const h=nn.scrollHeight-r;if(Be(t)){let f=h*t;o==="border-box"&&(f=f+r+i),l=Math.max(f,l),u.minHeight=`${f}px`}if(Be(e)){let f=h*e;o==="border-box"&&(f=f+r+i),l=Math.min(f,l)}return u.height=`${l}px`,(s=nn.parentNode)==null||s.removeChild(nn),nn=void 0,u}const KT=Kt({id:{type:String,default:void 0},size:zc,disabled:Boolean,modelValue:{type:ct([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ct([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Di},prefixIcon:{type:Di},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ct([Object,Array,String]),default:()=>Pg({})},autofocus:Boolean,rows:{type:Number,default:2},...Fc(["ariaLabel"])}),ZT={[Ac]:n=>Xe(n),input:n=>Xe(n),change:n=>Xe(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},QT=c.defineComponent({name:"ElInput",inheritAttrs:!1}),tN=c.defineComponent({...QT,props:KT,emits:ZT,setup(n,{expose:t,emit:e}){const s=n,r=c.useAttrs(),i=c.useSlots(),o=c.computed(()=>{const U={};return s.containerRole==="combobox"&&(U["aria-haspopup"]=r["aria-haspopup"],U["aria-owns"]=r["aria-owns"],U["aria-expanded"]=r["aria-expanded"]),U}),a=c.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(g.value),m.is("disabled",p.value),m.is("exceed",B.value),{[m.b("group")]:i.prepend||i.append,[m.m("prefix")]:i.prefix||s.prefixIcon,[m.m("suffix")]:i.suffix||s.suffixIcon||s.clearable||s.showPassword,[m.bm("suffix","password-clear")]:Y.value&&ot.value,[m.b("hidden")]:s.type==="hidden"},r.class]),l=c.computed(()=>[m.e("wrapper"),m.is("focus",T.value)]),u=cA({excludeKeys:c.computed(()=>Object.keys(o.value))}),{form:h,formItem:f}=gp(),{inputId:d}=WT(s,{formItemContext:f}),g=fp(),p=Gc(),m=me("input"),y=me("textarea"),b=c.shallowRef(),w=c.shallowRef(),x=c.ref(!1),v=c.ref(!1),S=c.ref(),E=c.shallowRef(s.inputStyle),C=c.computed(()=>b.value||w.value),{wrapperRef:M,isFocused:T,handleFocus:k,handleBlur:_}=LT(C,{beforeFocus(){return p.value},afterBlur(){var U;s.validateEvent&&((U=f==null?void 0:f.validate)==null||U.call(f,"blur").catch(Et=>Pe(Et)))}}),D=c.computed(()=>{var U;return(U=h==null?void 0:h.statusIcon)!=null?U:!1}),N=c.computed(()=>(f==null?void 0:f.validateState)||""),j=c.computed(()=>N.value&&nA[N.value]),A=c.computed(()=>v.value?Cg:W2),P=c.computed(()=>[r.style]),L=c.computed(()=>[s.inputStyle,E.value,{resize:s.resize}]),V=c.computed(()=>ua(s.modelValue)?"":String(s.modelValue)),Y=c.computed(()=>s.clearable&&!p.value&&!s.readonly&&!!V.value&&(T.value||x.value)),ot=c.computed(()=>s.showPassword&&!p.value&&!!V.value&&(!!V.value||T.value)),F=c.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!p.value&&!s.readonly&&!s.showPassword),H=c.computed(()=>V.value.length),B=c.computed(()=>!!F.value&&H.value>Number(s.maxlength)),K=c.computed(()=>!!i.suffix||!!s.suffixIcon||Y.value||s.showPassword||F.value||!!N.value&&D.value),[nt,rt]=RT(b);md(w,U=>{if(ge(),!F.value||s.resize!=="both")return;const Et=U[0],{width:Zn}=Et.contentRect;S.value={right:`calc(100% - ${Zn+15+6}px)`}});const et=()=>{const{type:U,autosize:Et}=s;if(!(!Gt||U!=="textarea"||!w.value))if(Et){const Zn=hr(Et)?Et.minRows:void 0,bo=hr(Et)?Et.maxRows:void 0,Jb=pp(w.value,Zn,bo);E.value={overflowY:"hidden",...Jb},c.nextTick(()=>{w.value.offsetHeight,E.value=Jb})}else E.value={minHeight:pp(w.value).minHeight}},ge=(U=>{let Et=!1;return()=>{var Zn;if(Et||!s.autosize)return;((Zn=w.value)==null?void 0:Zn.offsetParent)===null||(U(),Et=!0)}})(et),St=()=>{const U=C.value,Et=s.formatter?s.formatter(V.value):V.value;!U||U.value===Et||(U.value=Et)},xt=async U=>{nt();let{value:Et}=U.target;if(s.formatter&&(Et=s.parser?s.parser(Et):Et),!pe.value){if(Et===V.value){St();return}e(Ac,Et),e("input",Et),await c.nextTick(),St(),rt()}},An=U=>{e("change",U.target.value)},{isComposing:pe,handleCompositionStart:dn,handleCompositionUpdate:Ts,handleCompositionEnd:Ns}=BT({emit:e,afterComposition:xt}),ai=()=>{v.value=!v.value,li()},li=async()=>{var U;await c.nextTick(),(U=C.value)==null||U.focus()},st=()=>{var U;return(U=C.value)==null?void 0:U.blur()},ie=U=>{x.value=!1,e("mouseleave",U)},ci=U=>{x.value=!0,e("mouseenter",U)},yo=U=>{e("keydown",U)},bl=()=>{var U;(U=C.value)==null||U.select()},ui=()=>{e(Ac,""),e("change",""),e("clear"),e("input","")};return c.watch(()=>s.modelValue,()=>{var U;c.nextTick(()=>et()),s.validateEvent&&((U=f==null?void 0:f.validate)==null||U.call(f,"change").catch(Et=>Pe(Et)))}),c.watch(V,()=>St()),c.watch(()=>s.type,async()=>{await c.nextTick(),St(),et()}),c.onMounted(()=>{!s.formatter&&s.parser&&Pe("ElInput","If you set the parser, you also need to set the formatter."),St(),c.nextTick(et)}),t({input:b,textarea:w,ref:C,textareaStyle:L,autosize:c.toRef(s,"autosize"),isComposing:pe,focus:li,blur:st,select:bl,clear:ui,resizeTextarea:et}),(U,Et)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps(c.unref(o),{class:[c.unref(a),{[c.unref(m).bm("group","append")]:U.$slots.append,[c.unref(m).bm("group","prepend")]:U.$slots.prepend}],style:c.unref(P),role:U.containerRole,onMouseenter:ci,onMouseleave:ie}),[c.createCommentVNode(" input "),U.type!=="textarea"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createCommentVNode(" prepend slot "),U.$slots.prepend?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(c.unref(m).be("group","prepend"))},[c.renderSlot(U.$slots,"prepend")],2)):c.createCommentVNode("v-if",!0),c.createElementVNode("div",{ref_key:"wrapperRef",ref:M,class:c.normalizeClass(c.unref(l))},[c.createCommentVNode(" prefix slot "),U.$slots.prefix||U.prefixIcon?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(c.unref(m).e("prefix"))},[c.createElementVNode("span",{class:c.normalizeClass(c.unref(m).e("prefix-inner"))},[c.renderSlot(U.$slots,"prefix"),U.prefixIcon?(c.openBlock(),c.createBlock(c.unref(Cn),{key:0,class:c.normalizeClass(c.unref(m).e("icon"))},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(U.prefixIcon)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0)],2)],2)):c.createCommentVNode("v-if",!0),c.createElementVNode("input",c.mergeProps({id:c.unref(d),ref_key:"input",ref:b,class:c.unref(m).e("inner")},c.unref(u),{minlength:U.minlength,maxlength:U.maxlength,type:U.showPassword?v.value?"text":"password":U.type,disabled:c.unref(p),readonly:U.readonly,autocomplete:U.autocomplete,tabindex:U.tabindex,"aria-label":U.ariaLabel,placeholder:U.placeholder,style:U.inputStyle,form:U.form,autofocus:U.autofocus,onCompositionstart:c.unref(dn),onCompositionupdate:c.unref(Ts),onCompositionend:c.unref(Ns),onInput:xt,onChange:An,onKeydown:yo}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),c.createCommentVNode(" suffix slot "),c.unref(K)?(c.openBlock(),c.createElementBlock("span",{key:1,class:c.normalizeClass(c.unref(m).e("suffix"))},[c.createElementVNode("span",{class:c.normalizeClass(c.unref(m).e("suffix-inner"))},[!c.unref(Y)||!c.unref(ot)||!c.unref(F)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.renderSlot(U.$slots,"suffix"),U.suffixIcon?(c.openBlock(),c.createBlock(c.unref(Cn),{key:0,class:c.normalizeClass(c.unref(m).e("icon"))},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(U.suffixIcon)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0)],64)):c.createCommentVNode("v-if",!0),c.unref(Y)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:1,class:c.normalizeClass([c.unref(m).e("icon"),c.unref(m).e("clear")]),onMousedown:c.withModifiers(c.unref(ss),["prevent"]),onClick:ui},{default:c.withCtx(()=>[c.createVNode(c.unref(bg))]),_:1},8,["class","onMousedown"])):c.createCommentVNode("v-if",!0),c.unref(ot)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:2,class:c.normalizeClass([c.unref(m).e("icon"),c.unref(m).e("password")]),onClick:ai},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(A))))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),c.unref(F)?(c.openBlock(),c.createElementBlock("span",{key:3,class:c.normalizeClass(c.unref(m).e("count"))},[c.createElementVNode("span",{class:c.normalizeClass(c.unref(m).e("count-inner"))},c.toDisplayString(c.unref(H))+" / "+c.toDisplayString(U.maxlength),3)],2)):c.createCommentVNode("v-if",!0),c.unref(N)&&c.unref(j)&&c.unref(D)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:4,class:c.normalizeClass([c.unref(m).e("icon"),c.unref(m).e("validateIcon"),c.unref(m).is("loading",c.unref(N)==="validating")])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(j))))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0)],2)],2)):c.createCommentVNode("v-if",!0)],2),c.createCommentVNode(" append slot "),U.$slots.append?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(c.unref(m).be("group","append"))},[c.renderSlot(U.$slots,"append")],2)):c.createCommentVNode("v-if",!0)],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" textarea "),c.createElementVNode("textarea",c.mergeProps({id:c.unref(d),ref_key:"textarea",ref:w,class:[c.unref(y).e("inner"),c.unref(m).is("focus",c.unref(T))]},c.unref(u),{minlength:U.minlength,maxlength:U.maxlength,tabindex:U.tabindex,disabled:c.unref(p),readonly:U.readonly,autocomplete:U.autocomplete,style:c.unref(L),"aria-label":U.ariaLabel,placeholder:U.placeholder,form:U.form,autofocus:U.autofocus,rows:U.rows,onCompositionstart:c.unref(dn),onCompositionupdate:c.unref(Ts),onCompositionend:c.unref(Ns),onInput:xt,onFocus:c.unref(k),onBlur:c.unref(_),onChange:An,onKeydown:yo}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),c.unref(F)?(c.openBlock(),c.createElementBlock("span",{key:0,style:c.normalizeStyle(S.value),class:c.normalizeClass(c.unref(m).e("count"))},c.toDisplayString(c.unref(H))+" / "+c.toDisplayString(U.maxlength),7)):c.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var eN=he(tN,[["__file","input.vue"]]);const nN=js(eN),Yc=Symbol("popper"),mp=Symbol("popperContent"),yp=Kt({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),sN=c.defineComponent({name:"ElPopper",inheritAttrs:!1}),rN=c.defineComponent({...sN,props:yp,setup(n,{expose:t}){const e=n,s=c.ref(),r=c.ref(),i=c.ref(),o=c.ref(),a=c.computed(()=>e.role),l={triggerRef:s,popperInstanceRef:r,contentRef:i,referenceRef:o,role:a};return t(l),c.provide(Yc,l),(u,h)=>c.renderSlot(u.$slots,"default")}});var iN=he(rN,[["__file","popper.vue"]]);const bp=Kt({arrowOffset:{type:Number,default:5}}),oN=c.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),aN=c.defineComponent({...oN,props:bp,setup(n,{expose:t}){const e=n,s=me("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=c.inject(mp,void 0);return c.watch(()=>e.arrowOffset,a=>{r.value=a}),c.onBeforeUnmount(()=>{i.value=void 0}),t({arrowRef:i}),(a,l)=>(c.openBlock(),c.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:c.normalizeClass(c.unref(s).e("arrow")),style:c.normalizeStyle(c.unref(o)),"data-popper-arrow":""},null,6))}});var lN=he(aN,[["__file","arrow.vue"]]);const Wc="ElOnlyChild",cN=c.defineComponent({name:Wc,setup(n,{slots:t,attrs:e}){var s;const r=c.inject(np),i=DT((s=r==null?void 0:r.setForwardRef)!=null?s:ss);return()=>{var o;const a=(o=t.default)==null?void 0:o.call(t,e);if(!a)return null;if(a.length>1)return Pe(Wc,"requires exact only one valid child."),null;const l=wp(a);return l?c.withDirectives(c.cloneVNode(l,e),[[i]]):(Pe(Wc,"no valid child node found"),null)}}});function wp(n){if(!n)return null;const t=n;for(const e of t){if(hr(e))switch(e.type){case c.Comment:continue;case c.Text:case"svg":return xp(e);case c.Fragment:return wp(e.children);default:return e}return xp(e)}return null}function xp(n){const t=me("only-child");return c.createVNode("span",{class:t.e("content")},[n])}const vp=Kt({virtualRef:{type:ct(Object)},virtualTriggering:Boolean,onMouseenter:{type:ct(Function)},onMouseleave:{type:ct(Function)},onClick:{type:ct(Function)},onKeydown:{type:ct(Function)},onFocus:{type:ct(Function)},onBlur:{type:ct(Function)},onContextmenu:{type:ct(Function)},id:String,open:Boolean}),uN=c.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),hN=c.defineComponent({...uN,props:vp,setup(n,{expose:t}){const e=n,{role:s,triggerRef:r}=c.inject(Yc,void 0);kT(r);const i=c.computed(()=>a.value?e.id:void 0),o=c.computed(()=>{if(s&&s.value==="tooltip")return e.open&&e.id?e.id:void 0}),a=c.computed(()=>{if(s&&s.value!=="tooltip")return s.value}),l=c.computed(()=>a.value?`${e.open}`:void 0);let u;const h=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return c.onMounted(()=>{c.watch(()=>e.virtualRef,f=>{f&&(r.value=ns(f))},{immediate:!0}),c.watch(r,(f,d)=>{u==null||u(),u=void 0,Fn(f)&&(h.forEach(g=>{var p;const m=e[g];m&&(f.addEventListener(g.slice(2).toLowerCase(),m),(p=d==null?void 0:d.removeEventListener)==null||p.call(d,g.slice(2).toLowerCase(),m))}),u=c.watch([i,o,a,l],g=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,m)=>{ua(g[m])?f.removeAttribute(p):f.setAttribute(p,g[m])})},{immediate:!0})),Fn(d)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(g=>d.removeAttribute(g))},{immediate:!0})}),c.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,r.value&&Fn(r.value)){const f=r.value;h.forEach(d=>{const g=e[d];g&&f.removeEventListener(d.slice(2).toLowerCase(),g)}),r.value=void 0}}),t({triggerRef:r}),(f,d)=>f.virtualTriggering?c.createCommentVNode("v-if",!0):(c.openBlock(),c.createBlock(c.unref(cN),c.mergeProps({key:0},f.$attrs,{"aria-controls":c.unref(i),"aria-describedby":c.unref(o),"aria-expanded":c.unref(l),"aria-haspopup":c.unref(a)}),{default:c.withCtx(()=>[c.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var dN=he(hN,[["__file","trigger.vue"]]);const qc="focus-trap.focus-after-trapped",Jc="focus-trap.focus-after-released",fN="focus-trap.focusout-prevented",Cp={cancelable:!0,bubbles:!1},gN={cancelable:!0,bubbles:!1},Sp="focusAfterTrapped",Ep="focusAfterReleased",pN=Symbol("elFocusTrap"),Xc=c.ref(),Oa=c.ref(0),Kc=c.ref(0);let Ma=0;const Op=n=>{const t=[],e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0||s===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)t.push(e.currentNode);return t},Mp=(n,t)=>{for(const e of n)if(!mN(e,t))return e},mN=(n,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(t&&n===t)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},yN=n=>{const t=Op(n),e=Mp(t,n),s=Mp(t.reverse(),n);return[e,s]},bN=n=>n instanceof HTMLInputElement&&"select"in n,os=(n,t)=>{if(n&&n.focus){const e=document.activeElement;n.focus({preventScroll:!0}),Kc.value=window.performance.now(),n!==e&&bN(n)&&t&&n.select()}};function Pp(n,t){const e=[...n],s=n.indexOf(t);return s!==-1&&e.splice(s,1),e}const wN=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=Pp(n,s),n.unshift(s)},remove:s=>{var r,i;n=Pp(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},xN=(n,t=!1)=>{const e=document.activeElement;for(const s of n)if(os(s,t),document.activeElement!==e)return},Ap=wN(),vN=()=>Oa.value>Kc.value,Pa=()=>{Xc.value="pointer",Oa.value=window.performance.now()},Tp=()=>{Xc.value="keyboard",Oa.value=window.performance.now()},CN=()=>(c.onMounted(()=>{Ma===0&&(document.addEventListener("mousedown",Pa),document.addEventListener("touchstart",Pa),document.addEventListener("keydown",Tp)),Ma++}),c.onBeforeUnmount(()=>{Ma--,Ma<=0&&(document.removeEventListener("mousedown",Pa),document.removeEventListener("touchstart",Pa),document.removeEventListener("keydown",Tp))}),{focusReason:Xc,lastUserFocusTimestamp:Oa,lastAutomatedFocusTimestamp:Kc}),Aa=n=>new CustomEvent(fN,{...gN,detail:n}),SN=c.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Sp,Ep,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:t}){const e=c.ref();let s,r;const{focusReason:i}=CN();PT(p=>{n.trapped&&!o.paused&&t("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=p=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:m,altKey:y,ctrlKey:b,metaKey:w,currentTarget:x,shiftKey:v}=p,{loop:S}=n,E=m===Cr.tab&&!y&&!b&&!w,C=document.activeElement;if(E&&C){const M=x,[T,k]=yN(M);if(T&&k){if(!v&&C===k){const D=Aa({focusReason:i.value});t("focusout-prevented",D),D.defaultPrevented||(p.preventDefault(),S&&os(T,!0))}else if(v&&[T,M].includes(C)){const D=Aa({focusReason:i.value});t("focusout-prevented",D),D.defaultPrevented||(p.preventDefault(),S&&os(k,!0))}}else if(C===M){const D=Aa({focusReason:i.value});t("focusout-prevented",D),D.defaultPrevented||p.preventDefault()}}};c.provide(pN,{focusTrapRef:e,onKeydown:a}),c.watch(()=>n.focusTrapEl,p=>{p&&(e.value=p)},{immediate:!0}),c.watch([e],([p],[m])=>{p&&(p.addEventListener("keydown",a),p.addEventListener("focusin",h),p.addEventListener("focusout",f)),m&&(m.removeEventListener("keydown",a),m.removeEventListener("focusin",h),m.removeEventListener("focusout",f))});const l=p=>{t(Sp,p)},u=p=>t(Ep,p),h=p=>{const m=c.unref(e);if(!m)return;const y=p.target,b=p.relatedTarget,w=y&&m.contains(y);n.trapped||b&&m.contains(b)||(s=b),w&&t("focusin",p),!o.paused&&n.trapped&&(w?r=y:os(r,!0))},f=p=>{const m=c.unref(e);if(!(o.paused||!m))if(n.trapped){const y=p.relatedTarget;!ua(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=Aa({focusReason:i.value});t("focusout-prevented",b),b.defaultPrevented||os(r,!0)}},0)}else{const y=p.target;y&&m.contains(y)||t("focusout",p)}};async function d(){await c.nextTick();const p=c.unref(e);if(p){Ap.push(o);const m=p.contains(document.activeElement)?s:document.activeElement;if(s=m,!p.contains(m)){const b=new Event(qc,Cp);p.addEventListener(qc,l),p.dispatchEvent(b),b.defaultPrevented||c.nextTick(()=>{let w=n.focusStartEl;Xe(w)||(os(w),document.activeElement!==w&&(w="first")),w==="first"&&xN(Op(p),!0),(document.activeElement===m||w==="container")&&os(p)})}}}function g(){const p=c.unref(e);if(p){p.removeEventListener(qc,l);const m=new CustomEvent(Jc,{...Cp,detail:{focusReason:i.value}});p.addEventListener(Jc,u),p.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!vN()||p.contains(document.activeElement))&&os(s??document.body),p.removeEventListener(Jc,u),Ap.remove(o)}}return c.onMounted(()=>{n.trapped&&d(),c.watch(()=>n.trapped,p=>{p?d():g()})}),c.onBeforeUnmount(()=>{n.trapped&&g(),e.value&&(e.value.removeEventListener("keydown",a),e.value.removeEventListener("focusin",h),e.value.removeEventListener("focusout",f),e.value=void 0)}),{onKeydown:a}}});function EN(n,t,e,s,r,i){return c.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Np=he(SN,[["render",EN],["__file","focus-trap.vue"]]);const ON=["fixed","absolute"],MN=Kt({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ct(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:_c,default:"bottom"},popperOptions:{type:ct(Object),default:()=>({})},strategy:{type:String,values:ON,default:"absolute"}}),_p=Kt({...MN,id:String,style:{type:ct([String,Array,Object])},className:{type:ct([String,Array,Object])},effect:{type:ct(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ct([String,Array,Object])},popperStyle:{type:ct([String,Array,Object])},referenceEl:{type:ct(Object)},triggerTargetEl:{type:ct(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Fc(["ariaLabel"])}),PN={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},AN=(n,t=[])=>{const{placement:e,strategy:s,popperOptions:r}=n,i={placement:e,strategy:s,...r,modifiers:[...NN(n),...t]};return _N(i,r==null?void 0:r.modifiers),i},TN=n=>{if(Gt)return ns(n)};function NN(n){const{offset:t,gpuAcceleration:e,fallbackPlacements:s}=n;return[{name:"offset",options:{offset:[0,t??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:s}},{name:"computeStyles",options:{gpuAcceleration:e}}]}function _N(n,t){t&&(n.modifiers=[...n.modifiers,...t??[]])}const kN=0,DN=n=>{const{popperInstanceRef:t,contentRef:e,triggerRef:s,role:r}=c.inject(Yc,void 0),i=c.ref(),o=c.ref(),a=c.computed(()=>({name:"eventListeners",enabled:!!n.visible})),l=c.computed(()=>{var b;const w=c.unref(i),x=(b=c.unref(o))!=null?b:kN;return{name:"arrow",enabled:!n2(w),options:{element:w,padding:x}}}),u=c.computed(()=>({onFirstUpdate:()=>{p()},...AN(n,[c.unref(l),c.unref(a)])})),h=c.computed(()=>TN(n.referenceEl)||c.unref(s)),{attributes:f,state:d,styles:g,update:p,forceUpdate:m,instanceRef:y}=ET(h,e,u);return c.watch(y,b=>t.value=b),c.onMounted(()=>{c.watch(()=>{var b;return(b=c.unref(h))==null?void 0:b.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:e,instanceRef:y,state:d,styles:g,role:r,forceUpdate:m,update:p}},RN=(n,{attributes:t,styles:e,role:s})=>{const{nextZIndex:r}=lp(),i=me("popper"),o=c.computed(()=>c.unref(t).popper),a=c.ref(Be(n.zIndex)?n.zIndex:r()),l=c.computed(()=>[i.b(),i.is("pure",n.pure),i.is(n.effect),n.popperClass]),u=c.computed(()=>[{zIndex:c.unref(a)},c.unref(e).popper,n.popperStyle||{}]),h=c.computed(()=>s.value==="dialog"?"false":void 0),f=c.computed(()=>c.unref(e).arrow||{});return{ariaModal:h,arrowStyle:f,contentAttrs:o,contentClass:l,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=Be(n.zIndex)?n.zIndex:r()}}},IN=(n,t)=>{const e=c.ref(!1),s=c.ref();return{focusStartRef:s,trapped:e,onFocusAfterReleased:u=>{var h;((h=u.detail)==null?void 0:h.focusReason)!=="pointer"&&(s.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:u=>{n.visible&&!e.value&&(u.target&&(s.value=u.target),e.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),e.value=!1)},onReleaseRequested:()=>{e.value=!1,t("close")}}},LN=c.defineComponent({name:"ElPopperContent"}),BN=c.defineComponent({...LN,props:_p,emits:PN,setup(n,{expose:t,emit:e}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:l,onFocusoutPrevented:u,onReleaseRequested:h}=IN(s,e),{attributes:f,arrowRef:d,contentRef:g,styles:p,instanceRef:m,role:y,update:b}=DN(s),{ariaModal:w,arrowStyle:x,contentAttrs:v,contentClass:S,contentStyle:E,updateZIndex:C}=RN(s,{styles:p,attributes:f,role:y}),M=c.inject(Ea,void 0),T=c.ref();c.provide(mp,{arrowStyle:x,arrowRef:d,arrowOffset:T}),M&&c.provide(Ea,{...M,addInputId:ss,removeInputId:ss});let k;const _=(N=!0)=>{b(),N&&C()},D=()=>{_(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return c.onMounted(()=>{c.watch(()=>s.triggerTargetEl,(N,j)=>{k==null||k(),k=void 0;const A=c.unref(N||g.value),P=c.unref(j||g.value);Fn(A)&&(k=c.watch([y,()=>s.ariaLabel,w,()=>s.id],L=>{["role","aria-label","aria-modal","id"].forEach((V,Y)=>{ua(L[Y])?A.removeAttribute(V):A.setAttribute(V,L[Y])})},{immediate:!0})),P!==A&&Fn(P)&&["role","aria-label","aria-modal","id"].forEach(L=>{P.removeAttribute(L)})},{immediate:!0}),c.watch(()=>s.visible,D,{immediate:!0})}),c.onBeforeUnmount(()=>{k==null||k(),k=void 0}),t({popperContentRef:g,popperInstanceRef:m,updatePopper:_,contentStyle:E}),(N,j)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps({ref_key:"contentRef",ref:g},c.unref(v),{style:c.unref(E),class:c.unref(S),tabindex:"-1",onMouseenter:A=>N.$emit("mouseenter",A),onMouseleave:A=>N.$emit("mouseleave",A)}),[c.createVNode(c.unref(Np),{trapped:c.unref(i),"trap-on-focus-in":!0,"focus-trap-el":c.unref(g),"focus-start-el":c.unref(r),onFocusAfterTrapped:c.unref(a),onFocusAfterReleased:c.unref(o),onFocusin:c.unref(l),onFocusoutPrevented:c.unref(u),onReleaseRequested:c.unref(h)},{default:c.withCtx(()=>[c.renderSlot(N.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var VN=he(BN,[["__file","content.vue"]]);const jN=js(iN),Zc=Symbol("elTooltip"),kp=Kt({...NT,..._p,appendTo:{type:ct([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ct(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Fc(["ariaLabel"])}),Dp=Kt({...vp,disabled:Boolean,trigger:{type:ct([String,Array]),default:"hover"},triggerKeys:{type:ct(Array),default:()=>[Cr.enter,Cr.space]}}),{useModelToggleProps:$N,useModelToggleEmits:zN,useModelToggle:FN}=vA("visible"),HN=Kt({...yp,...$N,...kp,...Dp,...bp,showArrow:{type:Boolean,default:!0}}),UN=[...zN,"before-show","before-hide","show","hide","open","close"],GN=(n,t)=>yv(n)?n.includes(t):n===t,Tr=(n,t,e)=>s=>{GN(c.unref(n),t)&&e(s)},YN=c.defineComponent({name:"ElTooltipTrigger"}),WN=c.defineComponent({...YN,props:Dp,setup(n,{expose:t}){const e=n,s=me("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:l,onToggle:u}=c.inject(Zc,void 0),h=c.ref(null),f=()=>{if(c.unref(r)||e.disabled)return!0},d=c.toRef(e,"trigger"),g=Vn(f,Tr(d,"hover",a)),p=Vn(f,Tr(d,"hover",l)),m=Vn(f,Tr(d,"click",v=>{v.button===0&&u(v)})),y=Vn(f,Tr(d,"focus",a)),b=Vn(f,Tr(d,"focus",l)),w=Vn(f,Tr(d,"contextmenu",v=>{v.preventDefault(),u(v)})),x=Vn(f,v=>{const{code:S}=v;e.triggerKeys.includes(S)&&(v.preventDefault(),u(v))});return t({triggerRef:h}),(v,S)=>(c.openBlock(),c.createBlock(c.unref(dN),{id:c.unref(i),"virtual-ref":v.virtualRef,open:c.unref(o),"virtual-triggering":v.virtualTriggering,class:c.normalizeClass(c.unref(s).e("trigger")),onBlur:c.unref(b),onClick:c.unref(m),onContextmenu:c.unref(w),onFocus:c.unref(y),onMouseenter:c.unref(g),onMouseleave:c.unref(p),onKeydown:c.unref(x)},{default:c.withCtx(()=>[c.renderSlot(v.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var qN=he(WN,[["__file","trigger.vue"]]);const JN=Kt({to:{type:ct([String,Object]),required:!0},disabled:Boolean});var XN=he(c.defineComponent({__name:"teleport",props:JN,setup(n){return(t,e)=>t.disabled?c.renderSlot(t.$slots,"default",{key:0}):(c.openBlock(),c.createBlock(c.Teleport,{key:1,to:t.to},[c.renderSlot(t.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const KN=js(XN),ZN=c.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),QN=c.defineComponent({...ZN,props:kp,setup(n,{expose:t}){const e=n,{selector:s}=ep(),r=me("tooltip"),i=c.ref(null);let o;const{controlled:a,id:l,open:u,trigger:h,onClose:f,onOpen:d,onShow:g,onHide:p,onBeforeShow:m,onBeforeHide:y}=c.inject(Zc,void 0),b=c.computed(()=>e.transition||`${r.namespace.value}-fade-in-linear`),w=c.computed(()=>process.env.NODE_ENV==="test"?!0:e.persistent);c.onBeforeUnmount(()=>{o==null||o()});const x=c.computed(()=>c.unref(w)?!0:c.unref(u)),v=c.computed(()=>e.disabled?!1:c.unref(u)),S=c.computed(()=>e.appendTo||s.value),E=c.computed(()=>{var P;return(P=e.style)!=null?P:{}}),C=c.ref(!0),M=()=>{p(),C.value=!0},T=()=>{if(c.unref(a))return!0},k=Vn(T,()=>{e.enterable&&c.unref(h)==="hover"&&d()}),_=Vn(T,()=>{c.unref(h)==="hover"&&f()}),D=()=>{var P,L;(L=(P=i.value)==null?void 0:P.updatePopper)==null||L.call(P),m==null||m()},N=()=>{y==null||y()},j=()=>{g(),o=ov(c.computed(()=>{var P;return(P=i.value)==null?void 0:P.popperContentRef}),()=>{if(c.unref(a))return;c.unref(h)!=="hover"&&f()})},A=()=>{e.virtualTriggering||f()};return c.watch(()=>c.unref(u),P=>{P?C.value=!1:o==null||o()},{flush:"post"}),c.watch(()=>e.content,()=>{var P,L;(L=(P=i.value)==null?void 0:P.updatePopper)==null||L.call(P)}),t({contentRef:i}),(P,L)=>(c.openBlock(),c.createBlock(c.unref(KN),{disabled:!P.teleported,to:c.unref(S)},{default:c.withCtx(()=>[c.createVNode(c.Transition,{name:c.unref(b),onAfterLeave:M,onBeforeEnter:D,onAfterEnter:j,onBeforeLeave:N},{default:c.withCtx(()=>[c.unref(x)?c.withDirectives((c.openBlock(),c.createBlock(c.unref(VN),c.mergeProps({key:0,id:c.unref(l),ref_key:"contentRef",ref:i},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":C.value,"boundaries-padding":P.boundariesPadding,"fallback-placements":P.fallbackPlacements,"gpu-acceleration":P.gpuAcceleration,offset:P.offset,placement:P.placement,"popper-options":P.popperOptions,strategy:P.strategy,effect:P.effect,enterable:P.enterable,pure:P.pure,"popper-class":P.popperClass,"popper-style":[P.popperStyle,c.unref(E)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:c.unref(v),"z-index":P.zIndex,onMouseenter:c.unref(k),onMouseleave:c.unref(_),onBlur:A,onClose:c.unref(f)}),{default:c.withCtx(()=>[c.renderSlot(P.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[c.vShow,c.unref(v)]]):c.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var t_=he(QN,[["__file","content.vue"]]);const e_=c.defineComponent({name:"ElTooltip"}),n_=c.defineComponent({...e_,props:HN,emits:UN,setup(n,{expose:t,emit:e}){const s=n;TT();const r=Ca(),i=c.ref(),o=c.ref(),a=()=>{var b;const w=c.unref(i);w&&((b=w.popperInstanceRef)==null||b.update())},l=c.ref(!1),u=c.ref(),{show:h,hide:f,hasUpdateHandler:d}=FN({indicator:l,toggleReason:u}),{onOpen:g,onClose:p}=_T({showAfter:c.toRef(s,"showAfter"),hideAfter:c.toRef(s,"hideAfter"),autoClose:c.toRef(s,"autoClose"),open:h,close:f}),m=c.computed(()=>ha(s.visible)&&!d.value);c.provide(Zc,{controlled:m,id:r,open:c.readonly(l),trigger:c.toRef(s,"trigger"),onOpen:b=>{g(b)},onClose:b=>{p(b)},onToggle:b=>{c.unref(l)?p(b):g(b)},onShow:()=>{e("show",u.value)},onHide:()=>{e("hide",u.value)},onBeforeShow:()=>{e("before-show",u.value)},onBeforeHide:()=>{e("before-hide",u.value)},updatePopper:a}),c.watch(()=>s.disabled,b=>{b&&l.value&&(l.value=!1)});const y=b=>{var w,x;const v=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,S=(b==null?void 0:b.relatedTarget)||document.activeElement;return v&&v.contains(S)};return c.onDeactivated(()=>l.value&&f()),t({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:a,onOpen:g,onClose:p,hide:f}),(b,w)=>(c.openBlock(),c.createBlock(c.unref(jN),{ref_key:"popperRef",ref:i,role:b.role},{default:c.withCtx(()=>[c.createVNode(qN,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:c.withCtx(()=>[b.$slots.default?c.renderSlot(b.$slots,"default",{key:0}):c.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),c.createVNode(t_,{ref_key:"contentRef",ref:o,"aria-label":b.ariaLabel,"boundaries-padding":b.boundariesPadding,content:b.content,disabled:b.disabled,effect:b.effect,enterable:b.enterable,"fallback-placements":b.fallbackPlacements,"hide-after":b.hideAfter,"gpu-acceleration":b.gpuAcceleration,offset:b.offset,persistent:b.persistent,"popper-class":b.popperClass,"popper-style":b.popperStyle,placement:b.placement,"popper-options":b.popperOptions,pure:b.pure,"raw-content":b.rawContent,"reference-el":b.referenceEl,"trigger-target-el":b.triggerTargetEl,"show-after":b.showAfter,strategy:b.strategy,teleported:b.teleported,transition:b.transition,"virtual-triggering":b.virtualTriggering,"z-index":b.zIndex,"append-to":b.appendTo},{default:c.withCtx(()=>[c.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(c.openBlock(),c.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(c.openBlock(),c.createElementBlock("span",{key:1},c.toDisplayString(b.content),1))]),b.showArrow?(c.openBlock(),c.createBlock(c.unref(lN),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):c.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var s_=he(n_,[["__file","tooltip.vue"]]);const Rp=js(s_),r_=Kt({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:ct([String,Object,Array])},offset:{type:ct(Array),default:[0,0]},badgeClass:{type:String}}),i_=c.defineComponent({name:"ElBadge"}),o_=c.defineComponent({...i_,props:r_,setup(n,{expose:t}){const e=n,s=me("badge"),r=c.computed(()=>e.isDot?"":Be(e.value)&&Be(e.max)?e.max<e.value?`${e.max}+`:`${e.value}`:`${e.value}`),i=c.computed(()=>{var o,a,l,u,h;return[{backgroundColor:e.color,marginRight:ki(-((a=(o=e.offset)==null?void 0:o[0])!=null?a:0)),marginTop:ki((u=(l=e.offset)==null?void 0:l[1])!=null?u:0)},(h=e.badgeStyle)!=null?h:{}]});return t({content:r}),(o,a)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(c.unref(s).b())},[c.renderSlot(o.$slots,"default"),c.createVNode(c.Transition,{name:`${c.unref(s).namespace.value}-zoom-in-center`,persisted:""},{default:c.withCtx(()=>[c.withDirectives(c.createElementVNode("sup",{class:c.normalizeClass([c.unref(s).e("content"),c.unref(s).em("content",o.type),c.unref(s).is("fixed",!!o.$slots.default),c.unref(s).is("dot",o.isDot),c.unref(s).is("hide-zero",!o.showZero&&e.value===0),o.badgeClass]),style:c.normalizeStyle(c.unref(i)),textContent:c.toDisplayString(c.unref(r))},null,14,["textContent"]),[[c.vShow,!o.hidden&&(c.unref(r)||o.isDot)]])]),_:1},8,["name"])],2))}});var a_=he(o_,[["__file","badge.vue"]]);const l_=js(a_),Ip=Symbol("buttonGroupContextKey"),c_=(n,t)=>{uA({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},c.computed(()=>n.type==="text"));const e=c.inject(Ip,void 0),s=Hc("button"),{form:r}=gp(),i=fp(c.computed(()=>e==null?void 0:e.size)),o=Gc(),a=c.ref(),l=c.useSlots(),u=c.computed(()=>n.type||(e==null?void 0:e.type)||""),h=c.computed(()=>{var p,m,y;return(y=(m=n.autoInsertSpace)!=null?m:(p=s.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=c.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),d=c.computed(()=>{var p;const m=(p=l.default)==null?void 0:p.call(l);if(h.value&&(m==null?void 0:m.length)===1){const y=m[0];if((y==null?void 0:y.type)===c.Text){const b=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(b.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:a,_props:f,shouldAddSpace:d,handleClick:p=>{if(o.value||n.loading){p.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),t("click",p)}}},Qc=Kt({size:zc,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Di},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Di,default:()=>fa},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ct([String,Object]),default:"button"}}),u_={click:n=>n instanceof MouseEvent};function oe(n,t){h_(n)&&(n="100%");var e=d_(n);return n=t===360?n:Math.min(t,Math.max(0,parseFloat(n))),e&&(n=parseInt(String(n*t),10)/100),Math.abs(n-t)<1e-6?1:(t===360?n=(n<0?n%t+t:n%t)/parseFloat(String(t)):n=n%t/parseFloat(String(t)),n)}function Ta(n){return Math.min(1,Math.max(0,n))}function h_(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function d_(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Lp(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Na(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Fs(n){return n.length===1?"0"+n:String(n)}function f_(n,t,e){return{r:oe(n,255)*255,g:oe(t,255)*255,b:oe(e,255)*255}}function Bp(n,t,e){n=oe(n,255),t=oe(t,255),e=oe(e,255);var s=Math.max(n,t,e),r=Math.min(n,t,e),i=0,o=0,a=(s+r)/2;if(s===r)o=0,i=0;else{var l=s-r;switch(o=a>.5?l/(2-s-r):l/(s+r),s){case n:i=(t-e)/l+(t<e?6:0);break;case t:i=(e-n)/l+2;break;case e:i=(n-t)/l+4;break}i/=6}return{h:i,s:o,l:a}}function tu(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*(6*e):e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function g_(n,t,e){var s,r,i;if(n=oe(n,360),t=oe(t,100),e=oe(e,100),t===0)r=e,i=e,s=e;else{var o=e<.5?e*(1+t):e+t-e*t,a=2*e-o;s=tu(a,o,n+1/3),r=tu(a,o,n),i=tu(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function Vp(n,t,e){n=oe(n,255),t=oe(t,255),e=oe(e,255);var s=Math.max(n,t,e),r=Math.min(n,t,e),i=0,o=s,a=s-r,l=s===0?0:a/s;if(s===r)i=0;else{switch(s){case n:i=(t-e)/a+(t<e?6:0);break;case t:i=(e-n)/a+2;break;case e:i=(n-t)/a+4;break}i/=6}return{h:i,s:l,v:o}}function p_(n,t,e){n=oe(n,360)*6,t=oe(t,100),e=oe(e,100);var s=Math.floor(n),r=n-s,i=e*(1-t),o=e*(1-r*t),a=e*(1-(1-r)*t),l=s%6,u=[e,o,i,i,a,e][l],h=[a,e,e,o,i,i][l],f=[i,i,a,e,e,o][l];return{r:u*255,g:h*255,b:f*255}}function jp(n,t,e,s){var r=[Fs(Math.round(n).toString(16)),Fs(Math.round(t).toString(16)),Fs(Math.round(e).toString(16))];return s&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function m_(n,t,e,s,r){var i=[Fs(Math.round(n).toString(16)),Fs(Math.round(t).toString(16)),Fs(Math.round(e).toString(16)),Fs(y_(s))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function y_(n){return Math.round(parseFloat(n)*255).toString(16)}function $p(n){return Ae(n)/255}function Ae(n){return parseInt(n,16)}function b_(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var eu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function w_(n){var t={r:0,g:0,b:0},e=1,s=null,r=null,i=null,o=!1,a=!1;return typeof n=="string"&&(n=C_(n)),typeof n=="object"&&(Un(n.r)&&Un(n.g)&&Un(n.b)?(t=f_(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Un(n.h)&&Un(n.s)&&Un(n.v)?(s=Na(n.s),r=Na(n.v),t=p_(n.h,s,r),o=!0,a="hsv"):Un(n.h)&&Un(n.s)&&Un(n.l)&&(s=Na(n.s),i=Na(n.l),t=g_(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(e=n.a)),e=Lp(e),{ok:o,format:n.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var x_="[-\\+]?\\d+%?",v_="[-\\+]?\\d*\\.\\d+%?",as="(?:".concat(v_,")|(?:").concat(x_,")"),nu="[\\s|\\(]+(".concat(as,")[,|\\s]+(").concat(as,")[,|\\s]+(").concat(as,")\\s*\\)?"),su="[\\s|\\(]+(".concat(as,")[,|\\s]+(").concat(as,")[,|\\s]+(").concat(as,")[,|\\s]+(").concat(as,")\\s*\\)?"),sn={CSS_UNIT:new RegExp(as),rgb:new RegExp("rgb"+nu),rgba:new RegExp("rgba"+su),hsl:new RegExp("hsl"+nu),hsla:new RegExp("hsla"+su),hsv:new RegExp("hsv"+nu),hsva:new RegExp("hsva"+su),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function C_(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var t=!1;if(eu[n])n=eu[n],t=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=sn.rgb.exec(n);return e?{r:e[1],g:e[2],b:e[3]}:(e=sn.rgba.exec(n),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=sn.hsl.exec(n),e?{h:e[1],s:e[2],l:e[3]}:(e=sn.hsla.exec(n),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=sn.hsv.exec(n),e?{h:e[1],s:e[2],v:e[3]}:(e=sn.hsva.exec(n),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=sn.hex8.exec(n),e?{r:Ae(e[1]),g:Ae(e[2]),b:Ae(e[3]),a:$p(e[4]),format:t?"name":"hex8"}:(e=sn.hex6.exec(n),e?{r:Ae(e[1]),g:Ae(e[2]),b:Ae(e[3]),format:t?"name":"hex"}:(e=sn.hex4.exec(n),e?{r:Ae(e[1]+e[1]),g:Ae(e[2]+e[2]),b:Ae(e[3]+e[3]),a:$p(e[4]+e[4]),format:t?"name":"hex8"}:(e=sn.hex3.exec(n),e?{r:Ae(e[1]+e[1]),g:Ae(e[2]+e[2]),b:Ae(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function Un(n){return!!sn.CSS_UNIT.exec(String(n))}var S_=function(){function n(t,e){t===void 0&&(t=""),e===void 0&&(e={});var s;if(t instanceof n)return t;typeof t=="number"&&(t=b_(t)),this.originalInput=t;var r=w_(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(s=e.format)!==null&&s!==void 0?s:r.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},n.prototype.getLuminance=function(){var t=this.toRgb(),e,s,r,i=t.r/255,o=t.g/255,a=t.b/255;return i<=.03928?e=i/12.92:e=Math.pow((i+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*e+.7152*s+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(t){return this.a=Lp(t),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},n.prototype.toHsv=function(){var t=Vp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},n.prototype.toHsvString=function(){var t=Vp(this.r,this.g,this.b),e=Math.round(t.h*360),s=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(e,", ").concat(s,"%, ").concat(r,"%)"):"hsva(".concat(e,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var t=Bp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},n.prototype.toHslString=function(){var t=Bp(this.r,this.g,this.b),e=Math.round(t.h*360),s=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(e,", ").concat(s,"%, ").concat(r,"%)"):"hsla(".concat(e,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(t){return t===void 0&&(t=!1),jp(this.r,this.g,this.b,t)},n.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},n.prototype.toHex8=function(t){return t===void 0&&(t=!1),m_(this.r,this.g,this.b,this.a,t)},n.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},n.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),s=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(e,", ").concat(s,")"):"rgba(".concat(t,", ").concat(e,", ").concat(s,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var t=function(e){return"".concat(Math.round(oe(e,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var t=function(e){return Math.round(oe(e,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+jp(this.r,this.g,this.b,!1),e=0,s=Object.entries(eu);e<s.length;e++){var r=s[e],i=r[0],o=r[1];if(t===o)return i}return!1},n.prototype.toString=function(t){var e=!!t;t=t??this.format;var s=!1,r=this.a<1&&this.a>=0,i=!e&&r&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),s||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.l+=t/100,e.l=Ta(e.l),new n(e)},n.prototype.brighten=function(t){t===void 0&&(t=10);var e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),new n(e)},n.prototype.darken=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.l-=t/100,e.l=Ta(e.l),new n(e)},n.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},n.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},n.prototype.desaturate=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.s-=t/100,e.s=Ta(e.s),new n(e)},n.prototype.saturate=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.s+=t/100,e.s=Ta(e.s),new n(e)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(t){var e=this.toHsl(),s=(e.h+t)%360;return e.h=s<0?360+s:s,new n(e)},n.prototype.mix=function(t,e){e===void 0&&(e=50);var s=this.toRgb(),r=new n(t).toRgb(),i=e/100,o={r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a};return new n(o)},n.prototype.analogous=function(t,e){t===void 0&&(t=6),e===void 0&&(e=30);var s=this.toHsl(),r=360/e,i=[this];for(s.h=(s.h-(r*t>>1)+720)%360;--t;)s.h=(s.h+r)%360,i.push(new n(s));return i},n.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new n(t)},n.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var e=this.toHsv(),s=e.h,r=e.s,i=e.v,o=[],a=1/t;t--;)o.push(new n({h:s,s:r,v:i})),i=(i+a)%1;return o},n.prototype.splitcomplement=function(){var t=this.toHsl(),e=t.h;return[this,new n({h:(e+72)%360,s:t.s,l:t.l}),new n({h:(e+216)%360,s:t.s,l:t.l})]},n.prototype.onBackground=function(t){var e=this.toRgb(),s=new n(t).toRgb(),r=e.a+s.a*(1-e.a);return new n({r:(e.r*e.a+s.r*s.a*(1-e.a))/r,g:(e.g*e.a+s.g*s.a*(1-e.a))/r,b:(e.b*e.a+s.b*s.a*(1-e.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(t){for(var e=this.toHsl(),s=e.h,r=[this],i=360/t,o=1;o<t;o++)r.push(new n({h:(s+o*i)%360,s:e.s,l:e.l}));return r},n.prototype.equals=function(t){return this.toRgbString()===new n(t).toRgbString()},n}();function ls(n,t=20){return n.mix("#141414",t).toString()}function E_(n){const t=Gc(),e=me("button");return c.computed(()=>{let s={},r=n.color;if(r){const i=r.match(/var\((.*?)\)/);i&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new S_(r),a=n.dark?o.tint(20).toString():ls(o,20);if(n.plain)s=e.cssVarBlock({"bg-color":n.dark?ls(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ls(o,50):o.tint(50).toString(),"hover-text-color":`var(${e.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${e.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(s[e.cssVarBlockName("disabled-bg-color")]=n.dark?ls(o,90):o.tint(90).toString(),s[e.cssVarBlockName("disabled-text-color")]=n.dark?ls(o,50):o.tint(50).toString(),s[e.cssVarBlockName("disabled-border-color")]=n.dark?ls(o,80):o.tint(80).toString());else{const l=n.dark?ls(o,30):o.tint(30).toString(),u=o.isDark()?`var(${e.cssVarName("color-white")})`:`var(${e.cssVarName("color-black")})`;if(s=e.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":l,"hover-text-color":u,"hover-border-color":l,"active-bg-color":a,"active-border-color":a}),t.value){const h=n.dark?ls(o,50):o.tint(50).toString();s[e.cssVarBlockName("disabled-bg-color")]=h,s[e.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${e.cssVarName("color-white")})`,s[e.cssVarBlockName("disabled-border-color")]=h}}}return s})}const O_=c.defineComponent({name:"ElButton"}),M_=c.defineComponent({...O_,props:Qc,emits:u_,setup(n,{expose:t,emit:e}){const s=n,r=E_(s),i=me("button"),{_ref:o,_size:a,_type:l,_disabled:u,_props:h,shouldAddSpace:f,handleClick:d}=c_(s,e),g=c.computed(()=>[i.b(),i.m(l.value),i.m(a.value),i.is("disabled",u.value),i.is("loading",s.loading),i.is("plain",s.plain),i.is("round",s.round),i.is("circle",s.circle),i.is("text",s.text),i.is("link",s.link),i.is("has-bg",s.bg)]);return t({ref:o,size:a,type:l,disabled:u,shouldAddSpace:f}),(p,m)=>(c.openBlock(),c.createBlock(c.resolveDynamicComponent(p.tag),c.mergeProps({ref_key:"_ref",ref:o},c.unref(h),{class:c.unref(g),style:c.unref(r),onClick:c.unref(d)}),{default:c.withCtx(()=>[p.loading?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[p.$slots.loading?c.renderSlot(p.$slots,"loading",{key:0}):(c.openBlock(),c.createBlock(c.unref(Cn),{key:1,class:c.normalizeClass(c.unref(i).is("loading"))},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(c.openBlock(),c.createBlock(c.unref(Cn),{key:1},{default:c.withCtx(()=>[p.icon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(p.icon),{key:0})):c.renderSlot(p.$slots,"icon",{key:1})]),_:3})):c.createCommentVNode("v-if",!0),p.$slots.default?(c.openBlock(),c.createElementBlock("span",{key:2,class:c.normalizeClass({[c.unref(i).em("text","expand")]:c.unref(f)})},[c.renderSlot(p.$slots,"default")],2)):c.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var P_=he(M_,[["__file","button.vue"]]);const A_={size:Qc.size,type:Qc.type},T_=c.defineComponent({name:"ElButtonGroup"}),N_=c.defineComponent({...T_,props:A_,setup(n){const t=n;c.provide(Ip,c.reactive({size:c.toRef(t,"size"),type:c.toRef(t,"type")}));const e=me("button");return(s,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(c.unref(e).b("group"))},[c.renderSlot(s.$slots,"default")],2))}});var zp=he(N_,[["__file","button-group.vue"]]);const __=js(P_,{ButtonGroup:zp});rA(zp);function k_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const ru="_trap-focus-children",Hs=[],Fp=n=>{var t;if(Hs.length===0)return;const e=Hs[Hs.length-1][ru];if(e.length>0&&n.code===Cr.tab){if(e.length===1){n.preventDefault(),document.activeElement!==e[0]&&e[0].focus();return}const s=n.shiftKey,r=n.target===e[0],i=n.target===e[e.length-1];if(r&&s&&(n.preventDefault(),e[e.length-1].focus()),i&&!s&&(n.preventDefault(),e[0].focus()),process.env.NODE_ENV==="test"){const o=e.indexOf(n.target);o!==-1&&((t=e[s?o-1:o+1])==null||t.focus())}}},D_={beforeMount(n){n[ru]=cd(n),Hs.push(n),Hs.length<=1&&document.addEventListener("keydown",Fp)},updated(n){c.nextTick(()=>{n[ru]=cd(n)})},unmounted(){Hs.shift(),Hs.length===0&&document.removeEventListener("keydown",Fp)}},R_=Kt({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:ct([String,Array,Object])},zIndex:{type:ct([String,Number])}}),I_={click:n=>n instanceof MouseEvent},L_="overlay";var B_=c.defineComponent({name:"ElOverlay",props:R_,emits:I_,setup(n,{slots:t,emit:e}){const s=me(L_),r=l=>{e("click",l)},{onClick:i,onMousedown:o,onMouseup:a}=Kg(n.customMaskEvent?void 0:r);return()=>n.mask?c.createVNode("div",{class:[s.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:i,onMousedown:o,onMouseup:a},[c.renderSlot(t,"default")],ma.STYLE|ma.CLASS|ma.PROPS,["onClick","onMouseup","onMousedown"]):c.h("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[c.renderSlot(t,"default")])}});const V_=B_,Hp=["success","info","warning","error"],de=Pg({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Gt?document.body:void 0}),j_=Kt({customClass:{type:String,default:de.customClass},center:{type:Boolean,default:de.center},dangerouslyUseHTMLString:{type:Boolean,default:de.dangerouslyUseHTMLString},duration:{type:Number,default:de.duration},icon:{type:Di,default:de.icon},id:{type:String,default:de.id},message:{type:ct([String,Object,Function]),default:de.message},onClose:{type:ct(Function),default:de.onClose},showClose:{type:Boolean,default:de.showClose},type:{type:String,values:Hp,default:de.type},plain:{type:Boolean,default:de.plain},offset:{type:Number,default:de.offset},zIndex:{type:Number,default:de.zIndex},grouping:{type:Boolean,default:de.grouping},repeatNum:{type:Number,default:de.repeatNum}}),$_={destroy:()=>!0},rn=c.shallowReactive([]),z_=n=>{const t=rn.findIndex(r=>r.id===n),e=rn[t];let s;return t>0&&(s=rn[t-1]),{current:e,prev:s}},F_=n=>{const{prev:t}=z_(n);return t?t.vm.exposed.bottom.value:0},H_=(n,t)=>rn.findIndex(s=>s.id===n)>0?16:t,U_=c.defineComponent({name:"ElMessage"}),G_=c.defineComponent({...U_,props:j_,emits:$_,setup(n,{expose:t}){const e=n,{Close:s}=Og,{ns:r,zIndex:i}=hp("message"),{currentZIndex:o,nextZIndex:a}=i,l=c.ref(),u=c.ref(!1),h=c.ref(0);let f;const d=c.computed(()=>e.type?e.type==="error"?"danger":e.type:"info"),g=c.computed(()=>{const C=e.type;return{[r.bm("icon",C)]:C&&pa[C]}}),p=c.computed(()=>e.icon||pa[e.type]||""),m=c.computed(()=>F_(e.id)),y=c.computed(()=>H_(e.id,e.offset)+m.value),b=c.computed(()=>h.value+y.value),w=c.computed(()=>({top:`${y.value}px`,zIndex:o.value}));function x(){e.duration!==0&&({stop:f}=iv(()=>{S()},e.duration))}function v(){f==null||f()}function S(){u.value=!1}function E({code:C}){C===Cr.esc&&S()}return c.onMounted(()=>{x(),a(),u.value=!0}),c.watch(()=>e.repeatNum,()=>{v(),x()}),jn(document,"keydown",E),md(l,()=>{h.value=l.value.getBoundingClientRect().height}),t({visible:u,bottom:b,close:S}),(C,M)=>(c.openBlock(),c.createBlock(c.Transition,{name:c.unref(r).b("fade"),onBeforeLeave:C.onClose,onAfterLeave:T=>C.$emit("destroy"),persisted:""},{default:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",{id:C.id,ref_key:"messageRef",ref:l,class:c.normalizeClass([c.unref(r).b(),{[c.unref(r).m(C.type)]:C.type},c.unref(r).is("center",C.center),c.unref(r).is("closable",C.showClose),c.unref(r).is("plain",C.plain),C.customClass]),style:c.normalizeStyle(c.unref(w)),role:"alert",onMouseenter:v,onMouseleave:x},[C.repeatNum>1?(c.openBlock(),c.createBlock(c.unref(l_),{key:0,value:C.repeatNum,type:c.unref(d),class:c.normalizeClass(c.unref(r).e("badge"))},null,8,["value","type","class"])):c.createCommentVNode("v-if",!0),c.unref(p)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:1,class:c.normalizeClass([c.unref(r).e("icon"),c.unref(g)])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(p))))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),c.renderSlot(C.$slots,"default",{},()=>[C.dangerouslyUseHTMLString?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),c.createElementVNode("p",{class:c.normalizeClass(c.unref(r).e("content")),innerHTML:C.message},null,10,["innerHTML"])],2112)):(c.openBlock(),c.createElementBlock("p",{key:0,class:c.normalizeClass(c.unref(r).e("content"))},c.toDisplayString(C.message),3))]),C.showClose?(c.openBlock(),c.createBlock(c.unref(Cn),{key:2,class:c.normalizeClass(c.unref(r).e("closeBtn")),onClick:c.withModifiers(S,["stop"])},{default:c.withCtx(()=>[c.createVNode(c.unref(s))]),_:1},8,["class","onClick"])):c.createCommentVNode("v-if",!0)],46,["id"]),[[c.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var Y_=he(G_,[["__file","message.vue"]]);let W_=1;const Up=n=>{const t=!n||Xe(n)||c.isVNode(n)||Re(n)?{message:n}:n,e={...de,...t};if(!e.appendTo)e.appendTo=document.body;else if(Xe(e.appendTo)){let s=document.querySelector(e.appendTo);Fn(s)||(Pe("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),e.appendTo=s}return ha(en.grouping)&&!e.grouping&&(e.grouping=en.grouping),Be(en.duration)&&e.duration===3e3&&(e.duration=en.duration),Be(en.offset)&&e.offset===16&&(e.offset=en.offset),ha(en.showClose)&&!e.showClose&&(e.showClose=en.showClose),e},q_=n=>{const t=rn.indexOf(n);if(t===-1)return;rn.splice(t,1);const{handler:e}=n;e.close()},J_=({appendTo:n,...t},e)=>{const s=`message_${W_++}`,r=t.onClose,i=document.createElement("div"),o={...t,id:s,onClose:()=>{r==null||r(),q_(h)},onDestroy:()=>{c.render(null,i)}},a=c.createVNode(Y_,o,Re(o.message)||c.isVNode(o.message)?{default:Re(o.message)?o.message:()=>o.message}:null);a.appContext=e||Nr._context,c.render(a,i),n.appendChild(i.firstElementChild);const l=a.component,h={id:s,vnode:a,vm:l,handler:{close:()=>{l.exposed.visible.value=!1}},props:a.component.props};return h},Nr=(n={},t)=>{if(!Gt)return{close:()=>{}};const e=Up(n);if(e.grouping&&rn.length){const r=rn.find(({vnode:i})=>{var o;return((o=i.props)==null?void 0:o.message)===e.message});if(r)return r.props.repeatNum+=1,r.props.type=e.type,r.handler}if(Be(en.max)&&rn.length>=en.max)return{close:()=>{}};const s=J_(e,t);return rn.push(s),s.handler};Hp.forEach(n=>{Nr[n]=(t={},e)=>{const s=Up(t);return Nr({...s,type:n},e)}});function X_(n){for(const t of rn)(!n||n===t.props.type)&&t.handler.close()}Nr.closeAll=X_,Nr._context=null;const Bt=sA(Nr,"$message"),K_=c.defineComponent({name:"ElMessageBox",directives:{TrapFocus:D_},components:{ElButton:__,ElFocusTrap:Np,ElInput:nN,ElOverlay:V_,ElIcon:Cn,...Og},inheritAttrs:!1,props:{buttonSize:{type:String,validator:iA},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(n,{emit:t}){const{locale:e,zIndex:s,ns:r,size:i}=hp("message-box",c.computed(()=>n.buttonSize)),{t:o}=e,{nextZIndex:a}=s,l=c.ref(!1),u=c.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:c.markRaw(fa),cancelButtonLoadingIcon:c.markRaw(fa),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),h=c.computed(()=>{const P=u.type;return{[r.bm("icon",P)]:P&&pa[P]}}),f=Ca(),d=Ca(),g=c.computed(()=>u.icon||pa[u.type]||""),p=c.computed(()=>!!u.message),m=c.ref(),y=c.ref(),b=c.ref(),w=c.ref(),x=c.ref(),v=c.computed(()=>u.confirmButtonClass);c.watch(()=>u.inputValue,async P=>{await c.nextTick(),n.boxType==="prompt"&&P!==null&&D()},{immediate:!0}),c.watch(()=>l.value,P=>{var L,V;P&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(V=(L=x.value)==null?void 0:L.$el)!=null?V:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(P?c.nextTick().then(()=>{var Y;w.value&&w.value.$el&&(u.autofocus?b.value=(Y=N())!=null?Y:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const S=c.computed(()=>n.draggable),E=c.computed(()=>n.overflow);hA(m,y,S,E),c.onMounted(async()=>{await c.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",C)}),c.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",C)});function C(){l.value&&(l.value=!1,c.nextTick(()=>{u.action&&t("action",u.action)}))}const M=()=>{n.closeOnClickModal&&_(u.distinguishCancelAndClose?"close":"cancel")},T=Kg(M),k=P=>{if(u.inputType!=="textarea")return P.preventDefault(),_("confirm")},_=P=>{var L;n.boxType==="prompt"&&P==="confirm"&&!D()||(u.action=P,u.beforeClose?(L=u.beforeClose)==null||L.call(u,P,u,C):C())},D=()=>{if(n.boxType==="prompt"){const P=u.inputPattern;if(P&&!P.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;const L=u.inputValidator;if(typeof L=="function"){const V=L(u.inputValue);if(V===!1)return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;if(typeof V=="string")return u.editorErrorMessage=V,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},N=()=>{const P=w.value.$refs;return P.input||P.textarea},j=()=>{_("close")},A=()=>{n.closeOnPressEscape&&j()};return n.lockScroll&&bA(l),{...c.toRefs(u),ns:r,overlayEvent:T,visible:l,hasMessage:p,typeClass:h,contentId:f,inputId:d,btnSize:i,iconComponent:g,confirmButtonClasses:v,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:C,handleClose:j,onCloseRequested:A,handleWrapperClick:M,handleInputEnter:k,handleAction:_,t:o}}});function Z_(n,t,e,s,r,i){const o=c.resolveComponent("el-icon"),a=c.resolveComponent("close"),l=c.resolveComponent("el-input"),u=c.resolveComponent("el-button"),h=c.resolveComponent("el-focus-trap"),f=c.resolveComponent("el-overlay");return c.openBlock(),c.createBlock(c.Transition,{name:"fade-in-linear",onAfterLeave:d=>n.$emit("vanish"),persisted:""},{default:c.withCtx(()=>[c.withDirectives(c.createVNode(f,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:c.withCtx(()=>[c.createElementVNode("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:c.normalizeClass(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[c.createVNode(h,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:c.withCtx(()=>[c.createElementVNode("div",{ref:"rootRef",class:c.normalizeClass([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:c.normalizeStyle(n.customStyle),tabindex:"-1",onClick:c.withModifiers(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(c.openBlock(),c.createElementBlock("div",{key:0,ref:"headerRef",class:c.normalizeClass([n.ns.e("header"),{"show-close":n.showClose}])},[c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("title"))},[n.iconComponent&&n.center?(c.openBlock(),c.createBlock(o,{key:0,class:c.normalizeClass([n.ns.e("status"),n.typeClass])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),c.createElementVNode("span",null,c.toDisplayString(n.title),1)],2),n.showClose?(c.openBlock(),c.createElementBlock("button",{key:0,type:"button",class:c.normalizeClass(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:d=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:c.withKeys(c.withModifiers(d=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[c.createVNode(o,{class:c.normalizeClass(n.ns.e("close"))},{default:c.withCtx(()=>[c.createVNode(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):c.createCommentVNode("v-if",!0)],2)):c.createCommentVNode("v-if",!0),c.createElementVNode("div",{id:n.contentId,class:c.normalizeClass(n.ns.e("content"))},[c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(c.openBlock(),c.createBlock(o,{key:0,class:c.normalizeClass([n.ns.e("status"),n.typeClass])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),n.hasMessage?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(n.ns.e("message"))},[c.renderSlot(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):c.createCommentVNode("v-if",!0)],2),c.withDirectives(c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("input"))},[c.createVNode(l,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":d=>n.inputValue=d,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:c.normalizeClass({invalid:n.validateError}),onKeydown:c.withKeys(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("errormsg")),style:c.normalizeStyle({visibility:n.editorErrorMessage?"visible":"hidden"})},c.toDisplayString(n.editorErrorMessage),7)],2),[[c.vShow,n.showInput]])],10,["id"]),c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("btns"))},[n.showCancelButton?(c.openBlock(),c.createBlock(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:c.normalizeClass([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:d=>n.handleAction("cancel"),onKeydown:c.withKeys(c.withModifiers(d=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):c.createCommentVNode("v-if",!0),c.withDirectives(c.createVNode(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:c.normalizeClass([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:d=>n.handleAction("confirm"),onKeydown:c.withKeys(c.withModifiers(d=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[c.vShow,n.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[c.vShow,n.visible]])]),_:3},8,["onAfterLeave"])}var Q_=he(K_,[["render",Z_],["__file","index.vue"]]);const zi=new Map,tk=n=>{let t=document.body;return n.appendTo&&(Xe(n.appendTo)&&(t=document.querySelector(n.appendTo)),Fn(n.appendTo)&&(t=n.appendTo),Fn(t)||(Pe("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),t=document.body)),t},ek=(n,t,e=null)=>{const s=c.createVNode(Q_,n,Re(n.message)||c.isVNode(n.message)?{default:Re(n.message)?n.message:()=>n.message}:null);return s.appContext=e,c.render(s,t),tk(n).appendChild(t.firstElementChild),s.component},nk=()=>document.createElement("div"),sk=(n,t)=>{const e=nk();n.onVanish=()=>{c.render(null,e),zi.delete(r)},n.onAction=i=>{const o=zi.get(r);let a;n.showInput?a={value:r.inputValue,action:i}:a=i,n.callback?n.callback(a,s.proxy):i==="cancel"||i==="close"?n.distinguishCancelAndClose&&i!=="cancel"?o.reject("close"):o.reject("cancel"):o.resolve(a)};const s=ek(n,e,t),r=s.proxy;for(const i in n)zo(n,i)&&!zo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function _r(n,t=null){if(!Gt)return Promise.reject();let e;return Xe(n)||c.isVNode(n)?n={message:n}:e=n.callback,new Promise((s,r)=>{const i=sk(n,t??_r._context);zi.set(i,{options:n,callback:e,resolve:s,reject:r})})}const rk=["alert","confirm","prompt"],ik={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};rk.forEach(n=>{_r[n]=ok(n)});function ok(n){return(t,e,s,r)=>{let i="";return hr(e)?(s=e,i=""):dg(e)?i="":i=e,_r(Object.assign({title:i,message:t,type:"",...ik[n]},s,{boxType:n}),r)}}_r.close=()=>{zi.forEach((n,t)=>{t.doClose()}),zi.clear()},_r._context=null;const cs=_r;cs.install=n=>{cs._context=n._context,n.config.globalProperties.$msgbox=cs,n.config.globalProperties.$messageBox=cs,n.config.globalProperties.$alert=cs.alert,n.config.globalProperties.$confirm=cs.confirm,n.config.globalProperties.$prompt=cs.prompt};const ak=cs;function Gp(n,t){return function(){return n.apply(t,arguments)}}const{toString:lk}=Object.prototype,{getPrototypeOf:iu}=Object,_a=(n=>t=>{const e=lk.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),on=n=>(n=n.toLowerCase(),t=>_a(t)===n),ka=n=>t=>typeof t===n,{isArray:kr}=Array,Fi=ka("undefined");function ck(n){return n!==null&&!Fi(n)&&n.constructor!==null&&!Fi(n.constructor)&&Te(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Yp=on("ArrayBuffer");function uk(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Yp(n.buffer),t}const hk=ka("string"),Te=ka("function"),Wp=ka("number"),Da=n=>n!==null&&typeof n=="object",dk=n=>n===!0||n===!1,Ra=n=>{if(_a(n)!=="object")return!1;const t=iu(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},fk=on("Date"),gk=on("File"),pk=on("Blob"),mk=on("FileList"),yk=n=>Da(n)&&Te(n.pipe),bk=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||Te(n.append)&&((t=_a(n))==="formdata"||t==="object"&&Te(n.toString)&&n.toString()==="[object FormData]"))},wk=on("URLSearchParams"),[xk,vk,Ck,Sk]=["ReadableStream","Request","Response","Headers"].map(on),Ek=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hi(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),kr(n))for(s=0,r=n.length;s<r;s++)t.call(null,n[s],s,n);else{const i=e?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(s=0;s<o;s++)a=i[s],t.call(null,n[a],a,n)}}function qp(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,r;for(;s-- >0;)if(r=e[s],t===r.toLowerCase())return r;return null}const Us=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Jp=n=>!Fi(n)&&n!==Us;function ou(){const{caseless:n}=Jp(this)&&this||{},t={},e=(s,r)=>{const i=n&&qp(t,r)||r;Ra(t[i])&&Ra(s)?t[i]=ou(t[i],s):Ra(s)?t[i]=ou({},s):kr(s)?t[i]=s.slice():t[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Hi(arguments[s],e);return t}const Ok=(n,t,e,{allOwnKeys:s}={})=>(Hi(t,(r,i)=>{e&&Te(r)?n[i]=Gp(r,e):n[i]=r},{allOwnKeys:s}),n),Mk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Pk=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Ak=(n,t,e,s)=>{let r,i,o;const a={};if(t=t||{},n==null)return t;do{for(r=Object.getOwnPropertyNames(n),i=r.length;i-- >0;)o=r[i],(!s||s(o,n,t))&&!a[o]&&(t[o]=n[o],a[o]=!0);n=e!==!1&&iu(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},Tk=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Nk=n=>{if(!n)return null;if(kr(n))return n;let t=n.length;if(!Wp(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},_k=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&iu(Uint8Array)),kk=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(n,i[0],i[1])}},Dk=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Rk=on("HTMLFormElement"),Ik=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,r){return s.toUpperCase()+r}),Xp=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Lk=on("RegExp"),Kp=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Hi(e,(r,i)=>{let o;(o=t(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},Bk=n=>{Kp(n,(t,e)=>{if(Te(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(Te(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Vk=(n,t)=>{const e={},s=r=>{r.forEach(i=>{e[i]=!0})};return kr(n)?s(n):s(String(n).split(t)),e},jk=()=>{},$k=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t,au="abcdefghijklmnopqrstuvwxyz",Zp="0123456789",Qp={DIGIT:Zp,ALPHA:au,ALPHA_DIGIT:au+au.toUpperCase()+Zp},zk=(n=16,t=Qp.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;n--;)e+=t[Math.random()*s|0];return e};function Fk(n){return!!(n&&Te(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Hk=n=>{const t=new Array(10),e=(s,r)=>{if(Da(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const i=kr(s)?[]:{};return Hi(s,(o,a)=>{const l=e(o,r+1);!Fi(l)&&(i[a]=l)}),t[r]=void 0,i}}return s};return e(n,0)},Uk=on("AsyncFunction"),Gk=n=>n&&(Da(n)||Te(n))&&Te(n.then)&&Te(n.catch),tm=((n,t)=>n?setImmediate:t?((e,s)=>(Us.addEventListener("message",({source:r,data:i})=>{r===Us&&i===e&&s.length&&s.shift()()},!1),r=>{s.push(r),Us.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Te(Us.postMessage)),Yk=typeof queueMicrotask<"u"?queueMicrotask.bind(Us):typeof process<"u"&&process.nextTick||tm,R={isArray:kr,isArrayBuffer:Yp,isBuffer:ck,isFormData:bk,isArrayBufferView:uk,isString:hk,isNumber:Wp,isBoolean:dk,isObject:Da,isPlainObject:Ra,isReadableStream:xk,isRequest:vk,isResponse:Ck,isHeaders:Sk,isUndefined:Fi,isDate:fk,isFile:gk,isBlob:pk,isRegExp:Lk,isFunction:Te,isStream:yk,isURLSearchParams:wk,isTypedArray:_k,isFileList:mk,forEach:Hi,merge:ou,extend:Ok,trim:Ek,stripBOM:Mk,inherits:Pk,toFlatObject:Ak,kindOf:_a,kindOfTest:on,endsWith:Tk,toArray:Nk,forEachEntry:kk,matchAll:Dk,isHTMLForm:Rk,hasOwnProperty:Xp,hasOwnProp:Xp,reduceDescriptors:Kp,freezeMethods:Bk,toObjectSet:Vk,toCamelCase:Ik,noop:jk,toFiniteNumber:$k,findKey:qp,global:Us,isContextDefined:Jp,ALPHABET:Qp,generateString:zk,isSpecCompliantForm:Fk,toJSONObject:Hk,isAsyncFn:Uk,isThenable:Gk,setImmediate:tm,asap:Yk};function at(n,t,e,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}R.inherits(at,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:R.toJSONObject(this.config),code:this.code,status:this.status}}});const em=at.prototype,nm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{nm[n]={value:n}}),Object.defineProperties(at,nm),Object.defineProperty(em,"isAxiosError",{value:!0}),at.from=(n,t,e,s,r,i)=>{const o=Object.create(em);return R.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),at.call(o,n.message,t,e,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const Wk=null;function lu(n){return R.isPlainObject(n)||R.isArray(n)}function sm(n){return R.endsWith(n,"[]")?n.slice(0,-2):n}function rm(n,t,e){return n?n.concat(t).map(function(r,i){return r=sm(r),!e&&i?"["+r+"]":r}).join(e?".":""):t}function qk(n){return R.isArray(n)&&!n.some(lu)}const Jk=R.toFlatObject(R,{},null,function(t){return/^is[A-Z]/.test(t)});function Ia(n,t,e){if(!R.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=R.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!R.isUndefined(y[m])});const s=e.metaTokens,r=e.visitor||h,i=e.dots,o=e.indexes,l=(e.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(t);if(!R.isFunction(r))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(R.isDate(p))return p.toISOString();if(!l&&R.isBlob(p))throw new at("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(p)||R.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function h(p,m,y){let b=p;if(p&&!y&&typeof p=="object"){if(R.endsWith(m,"{}"))m=s?m:m.slice(0,-2),p=JSON.stringify(p);else if(R.isArray(p)&&qk(p)||(R.isFileList(p)||R.endsWith(m,"[]"))&&(b=R.toArray(p)))return m=sm(m),b.forEach(function(x,v){!(R.isUndefined(x)||x===null)&&t.append(o===!0?rm([m],v,i):o===null?m:m+"[]",u(x))}),!1}return lu(p)?!0:(t.append(rm(y,m,i),u(p)),!1)}const f=[],d=Object.assign(Jk,{defaultVisitor:h,convertValue:u,isVisitable:lu});function g(p,m){if(!R.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),R.forEach(p,function(b,w){(!(R.isUndefined(b)||b===null)&&r.call(t,b,R.isString(w)?w.trim():w,m,d))===!0&&g(b,m?m.concat(w):[w])}),f.pop()}}if(!R.isObject(n))throw new TypeError("data must be an object");return g(n),t}function im(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function cu(n,t){this._pairs=[],n&&Ia(n,this,t)}const om=cu.prototype;om.append=function(t,e){this._pairs.push([t,e])},om.toString=function(t){const e=t?function(s){return t.call(this,s,im)}:im;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function Xk(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function am(n,t,e){if(!t)return n;const s=e&&e.encode||Xk,r=e&&e.serialize;let i;if(r?i=r(t,e):i=R.isURLSearchParams(t)?t.toString():new cu(t,e).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class lm{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){R.forEach(this.handlers,function(s){s!==null&&t(s)})}}const cm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Kk={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:cu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},uu=typeof window<"u"&&typeof document<"u",hu=typeof navigator=="object"&&navigator||void 0,Zk=uu&&(!hu||["ReactNative","NativeScript","NS"].indexOf(hu.product)<0),Qk=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",tD=uu&&window.location.href||"http://localhost",Ce={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:uu,hasStandardBrowserEnv:Zk,hasStandardBrowserWebWorkerEnv:Qk,navigator:hu,origin:tD},Symbol.toStringTag,{value:"Module"})),...Kk};function eD(n,t){return Ia(n,new Ce.classes.URLSearchParams,Object.assign({visitor:function(e,s,r,i){return Ce.isNode&&R.isBuffer(e)?(this.append(s,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function nD(n){return R.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function sD(n){const t={},e=Object.keys(n);let s;const r=e.length;let i;for(s=0;s<r;s++)i=e[s],t[i]=n[i];return t}function um(n){function t(e,s,r,i){let o=e[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=e.length;return o=!o&&R.isArray(r)?r.length:o,l?(R.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!R.isObject(r[o]))&&(r[o]=[]),t(e,s,r[o],i)&&R.isArray(r[o])&&(r[o]=sD(r[o])),!a)}if(R.isFormData(n)&&R.isFunction(n.entries)){const e={};return R.forEachEntry(n,(s,r)=>{t(nD(s),r,e,0)}),e}return null}function rD(n,t,e){if(R.isString(n))try{return(t||JSON.parse)(n),R.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const Ui={transitional:cm,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",r=s.indexOf("application/json")>-1,i=R.isObject(t);if(i&&R.isHTMLForm(t)&&(t=new FormData(t)),R.isFormData(t))return r?JSON.stringify(um(t)):t;if(R.isArrayBuffer(t)||R.isBuffer(t)||R.isStream(t)||R.isFile(t)||R.isBlob(t)||R.isReadableStream(t))return t;if(R.isArrayBufferView(t))return t.buffer;if(R.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return eD(t,this.formSerializer).toString();if((a=R.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ia(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),rD(t)):t}],transformResponse:[function(t){const e=this.transitional||Ui.transitional,s=e&&e.forcedJSONParsing,r=this.responseType==="json";if(R.isResponse(t)||R.isReadableStream(t))return t;if(t&&R.isString(t)&&(s&&!this.responseType||r)){const o=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?at.from(a,at.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ce.classes.FormData,Blob:Ce.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],n=>{Ui.headers[n]={}});const iD=R.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oD=n=>{const t={};let e,s,r;return n&&n.split(`
|
|
30
|
-
`).forEach(function(o){r=o.indexOf(":"),e=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!e||t[e]&&
|
|
31
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[hm]=this[hm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Gi(o);s[a]||(uD(r,o),s[a]=!0)}return R.isArray(t)?t.forEach(i):i(t),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(Se.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),R.freezeMethods(Se);function fu(n,t){const e=this||Ui,s=t||e,r=Se.from(s.headers);let i=s.data;return R.forEach(n,function(a){i=a.call(e,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function dm(n){return!!(n&&n.__CANCEL__)}function Dr(n,t,e){at.call(this,n??"canceled",at.ERR_CANCELED,t,e),this.name="CanceledError"}R.inherits(Dr,at,{__CANCEL__:!0});function fm(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new at("Request failed with status code "+e.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function hD(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function dD(n,t){n=n||10;const e=new Array(n),s=new Array(n);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),h=s[i];o||(o=u),e[r]=l,s[r]=u;let f=i,d=0;for(;f!==r;)d+=e[f++],f=f%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),u-o<t)return;const g=h&&u-h;return g?Math.round(d*1e3/g):void 0}}function fD(n,t){let e=0,s=1e3/t,r,i;const o=(u,h=Date.now())=>{e=h,r=null,i&&(clearTimeout(i),i=null),n.apply(null,u)};return[(...u)=>{const h=Date.now(),f=h-e;f>=s?o(u,h):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-f)))},()=>r&&o(r)]}const Ba=(n,t,e=3)=>{let s=0;const r=dD(50,250);return fD(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-s,u=r(l),h=o<=a;s=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&h?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};n(f)},e)},gm=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},pm=n=>(...t)=>R.asap(()=>n(...t)),gD=Ce.hasStandardBrowserEnv?function(){const t=Ce.navigator&&/(msie|trident)/i.test(Ce.navigator.userAgent),e=document.createElement("a");let s;function r(i){let o=i;return t&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return s=r(window.location.href),function(o){const a=R.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),pD=Ce.hasStandardBrowserEnv?{write(n,t,e,s,r,i){const o=[n+"="+encodeURIComponent(t)];R.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),R.isString(s)&&o.push("path="+s),R.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function mD(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function yD(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function mm(n,t){return n&&!mD(t)?yD(n,t):t}const ym=n=>n instanceof Se?{...n}:n;function Gs(n,t){t=t||{};const e={};function s(u,h,f){return R.isPlainObject(u)&&R.isPlainObject(h)?R.merge.call({caseless:f},u,h):R.isPlainObject(h)?R.merge({},h):R.isArray(h)?h.slice():h}function r(u,h,f){if(R.isUndefined(h)){if(!R.isUndefined(u))return s(void 0,u,f)}else return s(u,h,f)}function i(u,h){if(!R.isUndefined(h))return s(void 0,h)}function o(u,h){if(R.isUndefined(h)){if(!R.isUndefined(u))return s(void 0,u)}else return s(void 0,h)}function a(u,h,f){if(f in t)return s(u,h);if(f in n)return s(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,h)=>r(ym(u),ym(h),!0)};return R.forEach(Object.keys(Object.assign({},n,t)),function(h){const f=l[h]||r,d=f(n[h],t[h],h);R.isUndefined(d)&&f!==a||(e[h]=d)}),e}const bm=n=>{const t=Gs({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=Se.from(o),t.url=am(mm(t.baseURL,t.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(R.isFormData(e)){if(Ce.hasStandardBrowserEnv||Ce.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...h].join("; "))}}if(Ce.hasStandardBrowserEnv&&(s&&R.isFunction(s)&&(s=s(t)),s||s!==!1&&gD(t.url))){const u=r&&i&&pD.read(i);u&&o.set(r,u)}return t},bD=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const r=bm(n);let i=r.data;const o=Se.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=r,h,f,d,g,p;function m(){g&&g(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(h),r.signal&&r.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function b(){if(!y)return;const x=Se.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};fm(function(C){e(C),m()},function(C){s(C),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(s(new at("Request aborted",at.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new at("Network Error",at.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||cm;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),s(new at(v,S.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&R.forEach(o.toJSON(),function(v,S){y.setRequestHeader(S,v)}),R.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([d,p]=Ba(u,!0),y.addEventListener("progress",d)),l&&y.upload&&([f,g]=Ba(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(h=x=>{y&&(s(!x||x.type?new Dr(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(h),r.signal&&(r.signal.aborted?h():r.signal.addEventListener("abort",h)));const w=hD(r.url);if(w&&Ce.protocols.indexOf(w)===-1){s(new at("Unsupported protocol "+w+":",at.ERR_BAD_REQUEST,n));return}y.send(i||null)})},wD=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,r;const i=function(u){if(!r){r=!0,a();const h=u instanceof Error?u:this.reason;s.abort(h instanceof at?h:new Dr(h instanceof Error?h.message:h))}};let o=t&&setTimeout(()=>{o=null,i(new at(`timeout ${t} of ms exceeded`,at.ETIMEDOUT))},t);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),n=null)};n.forEach(u=>u.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>R.asap(a),l}},xD=function*(n,t){let e=n.byteLength;if(e<t){yield n;return}let s=0,r;for(;s<e;)r=s+t,yield n.slice(s,r),s=r},vD=async function*(n,t){for await(const e of CD(n))yield*xD(e,t)},CD=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},wm=(n,t,e,s)=>{const r=vD(n,t);let i=0,o,a=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await r.next();if(u){a(),l.close();return}let f=h.byteLength;if(e){let d=i+=f;e(d)}l.enqueue(new Uint8Array(h))}catch(u){throw a(u),u}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},Va=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",xm=Va&&typeof ReadableStream=="function",SD=Va&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),vm=(n,...t)=>{try{return!!n(...t)}catch{return!1}},ED=xm&&vm(()=>{let n=!1;const t=new Request(Ce.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Cm=64*1024,gu=xm&&vm(()=>R.isReadableStream(new Response("").body)),ja={stream:gu&&(n=>n.body)};Va&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ja[t]&&(ja[t]=R.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new at(`Response type '${t}' is not supported`,at.ERR_NOT_SUPPORT,s)})})})(new Response);const OD=async n=>{if(n==null)return 0;if(R.isBlob(n))return n.size;if(R.isSpecCompliantForm(n))return(await new Request(Ce.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(R.isArrayBufferView(n)||R.isArrayBuffer(n))return n.byteLength;if(R.isURLSearchParams(n)&&(n=n+""),R.isString(n))return(await SD(n)).byteLength},MD=async(n,t)=>{const e=R.toFiniteNumber(n.getContentLength());return e??OD(t)},pu={http:Wk,xhr:bD,fetch:Va&&(async n=>{let{url:t,method:e,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:h,withCredentials:f="same-origin",fetchOptions:d}=bm(n);u=u?(u+"").toLowerCase():"text";let g=wD([r,i&&i.toAbortSignal()],o),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let y;try{if(l&&ED&&e!=="get"&&e!=="head"&&(y=await MD(h,s))!==0){let S=new Request(t,{method:"POST",body:s,duplex:"half"}),E;if(R.isFormData(s)&&(E=S.headers.get("content-type"))&&h.setContentType(E),S.body){const[C,M]=gm(y,Ba(pm(l)));s=wm(S.body,Cm,C,M)}}R.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;p=new Request(t,{...d,signal:g,method:e.toUpperCase(),headers:h.normalize().toJSON(),body:s,duplex:"half",credentials:b?f:void 0});let w=await fetch(p);const x=gu&&(u==="stream"||u==="response");if(gu&&(a||x&&m)){const S={};["status","statusText","headers"].forEach(T=>{S[T]=w[T]});const E=R.toFiniteNumber(w.headers.get("content-length")),[C,M]=a&&gm(E,Ba(pm(a),!0))||[];w=new Response(wm(w.body,Cm,C,()=>{M&&M(),m&&m()}),S)}u=u||"text";let v=await ja[R.findKey(ja,u)||"text"](w,n);return!x&&m&&m(),await new Promise((S,E)=>{fm(S,E,{data:v,headers:Se.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:p})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new at("Network Error",at.ERR_NETWORK,n,p),{cause:b.cause||b}):at.from(b,b&&b.code,n,p)}})};R.forEach(pu,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Sm=n=>`- ${n}`,PD=n=>R.isFunction(n)||n===null||n===!1,Em={getAdapter:n=>{n=R.isArray(n)?n:[n];const{length:t}=n;let e,s;const r={};for(let i=0;i<t;i++){e=n[i];let o;if(s=e,!PD(e)&&(s=pu[(o=String(e)).toLowerCase()],s===void 0))throw new at(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
29
|
+
`,XT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function KT(n){const t=window.getComputedStyle(n),e=t.getPropertyValue("box-sizing"),s=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:XT.map(o=>`${o}:${t.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:e}}function pp(n,t=1,e){var s;nn||(nn=document.createElement("textarea"),document.body.appendChild(nn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=KT(n);nn.setAttribute("style",`${a};${JT}`),nn.value=n.value||n.placeholder||"";let l=nn.scrollHeight;const u={};o==="border-box"?l=l+i:o==="content-box"&&(l=l-r),nn.value="";const h=nn.scrollHeight-r;if(Be(t)){let f=h*t;o==="border-box"&&(f=f+r+i),l=Math.max(f,l),u.minHeight=`${f}px`}if(Be(e)){let f=h*e;o==="border-box"&&(f=f+r+i),l=Math.min(f,l)}return u.height=`${l}px`,(s=nn.parentNode)==null||s.removeChild(nn),nn=void 0,u}const ZT=Kt({id:{type:String,default:void 0},size:$c,disabled:Boolean,modelValue:{type:ct([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ct([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Di},prefixIcon:{type:Di},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ct([Object,Array,String]),default:()=>Pg({})},autofocus:Boolean,rows:{type:Number,default:2},...zc(["ariaLabel"])}),QT={[Pc]:n=>Xe(n),input:n=>Xe(n),change:n=>Xe(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},tN=c.defineComponent({name:"ElInput",inheritAttrs:!1}),eN=c.defineComponent({...tN,props:ZT,emits:QT,setup(n,{expose:t,emit:e}){const s=n,r=c.useAttrs(),i=c.useSlots(),o=c.computed(()=>{const U={};return s.containerRole==="combobox"&&(U["aria-haspopup"]=r["aria-haspopup"],U["aria-owns"]=r["aria-owns"],U["aria-expanded"]=r["aria-expanded"]),U}),a=c.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(g.value),m.is("disabled",p.value),m.is("exceed",V.value),{[m.b("group")]:i.prepend||i.append,[m.m("prefix")]:i.prefix||s.prefixIcon,[m.m("suffix")]:i.suffix||s.suffixIcon||s.clearable||s.showPassword,[m.bm("suffix","password-clear")]:Y.value&&ot.value,[m.b("hidden")]:s.type==="hidden"},r.class]),l=c.computed(()=>[m.e("wrapper"),m.is("focus",T.value)]),u=uA({excludeKeys:c.computed(()=>Object.keys(o.value))}),{form:h,formItem:f}=gp(),{inputId:d}=qT(s,{formItemContext:f}),g=fp(),p=Uc(),m=me("input"),y=me("textarea"),b=c.shallowRef(),w=c.shallowRef(),x=c.ref(!1),v=c.ref(!1),S=c.ref(),E=c.shallowRef(s.inputStyle),C=c.computed(()=>b.value||w.value),{wrapperRef:M,isFocused:T,handleFocus:_,handleBlur:N}=BT(C,{beforeFocus(){return p.value},afterBlur(){var U;s.validateEvent&&((U=f==null?void 0:f.validate)==null||U.call(f,"blur").catch(Et=>Pe(Et)))}}),k=c.computed(()=>{var U;return(U=h==null?void 0:h.statusIcon)!=null?U:!1}),R=c.computed(()=>(f==null?void 0:f.validateState)||""),I=c.computed(()=>R.value&&sA[R.value]),A=c.computed(()=>v.value?Cg:q2),P=c.computed(()=>[r.style]),B=c.computed(()=>[s.inputStyle,E.value,{resize:s.resize}]),j=c.computed(()=>ua(s.modelValue)?"":String(s.modelValue)),Y=c.computed(()=>s.clearable&&!p.value&&!s.readonly&&!!j.value&&(T.value||x.value)),ot=c.computed(()=>s.showPassword&&!p.value&&!!j.value&&(!!j.value||T.value)),F=c.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!p.value&&!s.readonly&&!s.showPassword),H=c.computed(()=>j.value.length),V=c.computed(()=>!!F.value&&H.value>Number(s.maxlength)),K=c.computed(()=>!!i.suffix||!!s.suffixIcon||Y.value||s.showPassword||F.value||!!R.value&&k.value),[nt,rt]=IT(b);md(w,U=>{if(ge(),!F.value||s.resize!=="both")return;const Et=U[0],{width:Zn}=Et.contentRect;S.value={right:`calc(100% - ${Zn+15+6}px)`}});const et=()=>{const{type:U,autosize:Et}=s;if(!(!Ut||U!=="textarea"||!w.value))if(Et){const Zn=hr(Et)?Et.minRows:void 0,bo=hr(Et)?Et.maxRows:void 0,Xb=pp(w.value,Zn,bo);E.value={overflowY:"hidden",...Xb},c.nextTick(()=>{w.value.offsetHeight,E.value=Xb})}else E.value={minHeight:pp(w.value).minHeight}},ge=(U=>{let Et=!1;return()=>{var Zn;if(Et||!s.autosize)return;((Zn=w.value)==null?void 0:Zn.offsetParent)===null||(U(),Et=!0)}})(et),St=()=>{const U=C.value,Et=s.formatter?s.formatter(j.value):j.value;!U||U.value===Et||(U.value=Et)},xt=async U=>{nt();let{value:Et}=U.target;if(s.formatter&&(Et=s.parser?s.parser(Et):Et),!pe.value){if(Et===j.value){St();return}e(Pc,Et),e("input",Et),await c.nextTick(),St(),rt()}},An=U=>{e("change",U.target.value)},{isComposing:pe,handleCompositionStart:dn,handleCompositionUpdate:Ts,handleCompositionEnd:Ns}=VT({emit:e,afterComposition:xt}),ai=()=>{v.value=!v.value,li()},li=async()=>{var U;await c.nextTick(),(U=C.value)==null||U.focus()},st=()=>{var U;return(U=C.value)==null?void 0:U.blur()},ie=U=>{x.value=!1,e("mouseleave",U)},ci=U=>{x.value=!0,e("mouseenter",U)},yo=U=>{e("keydown",U)},yl=()=>{var U;(U=C.value)==null||U.select()},ui=()=>{e(Pc,""),e("change",""),e("clear"),e("input","")};return c.watch(()=>s.modelValue,()=>{var U;c.nextTick(()=>et()),s.validateEvent&&((U=f==null?void 0:f.validate)==null||U.call(f,"change").catch(Et=>Pe(Et)))}),c.watch(j,()=>St()),c.watch(()=>s.type,async()=>{await c.nextTick(),St(),et()}),c.onMounted(()=>{!s.formatter&&s.parser&&Pe("ElInput","If you set the parser, you also need to set the formatter."),St(),c.nextTick(et)}),t({input:b,textarea:w,ref:C,textareaStyle:B,autosize:c.toRef(s,"autosize"),isComposing:pe,focus:li,blur:st,select:yl,clear:ui,resizeTextarea:et}),(U,Et)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps(c.unref(o),{class:[c.unref(a),{[c.unref(m).bm("group","append")]:U.$slots.append,[c.unref(m).bm("group","prepend")]:U.$slots.prepend}],style:c.unref(P),role:U.containerRole,onMouseenter:ci,onMouseleave:ie}),[c.createCommentVNode(" input "),U.type!=="textarea"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createCommentVNode(" prepend slot "),U.$slots.prepend?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(c.unref(m).be("group","prepend"))},[c.renderSlot(U.$slots,"prepend")],2)):c.createCommentVNode("v-if",!0),c.createElementVNode("div",{ref_key:"wrapperRef",ref:M,class:c.normalizeClass(c.unref(l))},[c.createCommentVNode(" prefix slot "),U.$slots.prefix||U.prefixIcon?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(c.unref(m).e("prefix"))},[c.createElementVNode("span",{class:c.normalizeClass(c.unref(m).e("prefix-inner"))},[c.renderSlot(U.$slots,"prefix"),U.prefixIcon?(c.openBlock(),c.createBlock(c.unref(Cn),{key:0,class:c.normalizeClass(c.unref(m).e("icon"))},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(U.prefixIcon)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0)],2)],2)):c.createCommentVNode("v-if",!0),c.createElementVNode("input",c.mergeProps({id:c.unref(d),ref_key:"input",ref:b,class:c.unref(m).e("inner")},c.unref(u),{minlength:U.minlength,maxlength:U.maxlength,type:U.showPassword?v.value?"text":"password":U.type,disabled:c.unref(p),readonly:U.readonly,autocomplete:U.autocomplete,tabindex:U.tabindex,"aria-label":U.ariaLabel,placeholder:U.placeholder,style:U.inputStyle,form:U.form,autofocus:U.autofocus,onCompositionstart:c.unref(dn),onCompositionupdate:c.unref(Ts),onCompositionend:c.unref(Ns),onInput:xt,onChange:An,onKeydown:yo}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),c.createCommentVNode(" suffix slot "),c.unref(K)?(c.openBlock(),c.createElementBlock("span",{key:1,class:c.normalizeClass(c.unref(m).e("suffix"))},[c.createElementVNode("span",{class:c.normalizeClass(c.unref(m).e("suffix-inner"))},[!c.unref(Y)||!c.unref(ot)||!c.unref(F)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.renderSlot(U.$slots,"suffix"),U.suffixIcon?(c.openBlock(),c.createBlock(c.unref(Cn),{key:0,class:c.normalizeClass(c.unref(m).e("icon"))},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(U.suffixIcon)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0)],64)):c.createCommentVNode("v-if",!0),c.unref(Y)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:1,class:c.normalizeClass([c.unref(m).e("icon"),c.unref(m).e("clear")]),onMousedown:c.withModifiers(c.unref(ss),["prevent"]),onClick:ui},{default:c.withCtx(()=>[c.createVNode(c.unref(bg))]),_:1},8,["class","onMousedown"])):c.createCommentVNode("v-if",!0),c.unref(ot)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:2,class:c.normalizeClass([c.unref(m).e("icon"),c.unref(m).e("password")]),onClick:ai},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(A))))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),c.unref(F)?(c.openBlock(),c.createElementBlock("span",{key:3,class:c.normalizeClass(c.unref(m).e("count"))},[c.createElementVNode("span",{class:c.normalizeClass(c.unref(m).e("count-inner"))},c.toDisplayString(c.unref(H))+" / "+c.toDisplayString(U.maxlength),3)],2)):c.createCommentVNode("v-if",!0),c.unref(R)&&c.unref(I)&&c.unref(k)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:4,class:c.normalizeClass([c.unref(m).e("icon"),c.unref(m).e("validateIcon"),c.unref(m).is("loading",c.unref(R)==="validating")])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(I))))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0)],2)],2)):c.createCommentVNode("v-if",!0)],2),c.createCommentVNode(" append slot "),U.$slots.append?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(c.unref(m).be("group","append"))},[c.renderSlot(U.$slots,"append")],2)):c.createCommentVNode("v-if",!0)],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" textarea "),c.createElementVNode("textarea",c.mergeProps({id:c.unref(d),ref_key:"textarea",ref:w,class:[c.unref(y).e("inner"),c.unref(m).is("focus",c.unref(T))]},c.unref(u),{minlength:U.minlength,maxlength:U.maxlength,tabindex:U.tabindex,disabled:c.unref(p),readonly:U.readonly,autocomplete:U.autocomplete,style:c.unref(B),"aria-label":U.ariaLabel,placeholder:U.placeholder,form:U.form,autofocus:U.autofocus,rows:U.rows,onCompositionstart:c.unref(dn),onCompositionupdate:c.unref(Ts),onCompositionend:c.unref(Ns),onInput:xt,onFocus:c.unref(_),onBlur:c.unref(N),onChange:An,onKeydown:yo}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),c.unref(F)?(c.openBlock(),c.createElementBlock("span",{key:0,style:c.normalizeStyle(S.value),class:c.normalizeClass(c.unref(m).e("count"))},c.toDisplayString(c.unref(H))+" / "+c.toDisplayString(U.maxlength),7)):c.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var nN=he(eN,[["__file","input.vue"]]);const sN=js(nN),Gc=Symbol("popper"),mp=Symbol("popperContent"),yp=Kt({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),rN=c.defineComponent({name:"ElPopper",inheritAttrs:!1}),iN=c.defineComponent({...rN,props:yp,setup(n,{expose:t}){const e=n,s=c.ref(),r=c.ref(),i=c.ref(),o=c.ref(),a=c.computed(()=>e.role),l={triggerRef:s,popperInstanceRef:r,contentRef:i,referenceRef:o,role:a};return t(l),c.provide(Gc,l),(u,h)=>c.renderSlot(u.$slots,"default")}});var oN=he(iN,[["__file","popper.vue"]]);const bp=Kt({arrowOffset:{type:Number,default:5}}),aN=c.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),lN=c.defineComponent({...aN,props:bp,setup(n,{expose:t}){const e=n,s=me("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=c.inject(mp,void 0);return c.watch(()=>e.arrowOffset,a=>{r.value=a}),c.onBeforeUnmount(()=>{i.value=void 0}),t({arrowRef:i}),(a,l)=>(c.openBlock(),c.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:c.normalizeClass(c.unref(s).e("arrow")),style:c.normalizeStyle(c.unref(o)),"data-popper-arrow":""},null,6))}});var cN=he(lN,[["__file","arrow.vue"]]);const Yc="ElOnlyChild",uN=c.defineComponent({name:Yc,setup(n,{slots:t,attrs:e}){var s;const r=c.inject(np),i=RT((s=r==null?void 0:r.setForwardRef)!=null?s:ss);return()=>{var o;const a=(o=t.default)==null?void 0:o.call(t,e);if(!a)return null;if(a.length>1)return Pe(Yc,"requires exact only one valid child."),null;const l=wp(a);return l?c.withDirectives(c.cloneVNode(l,e),[[i]]):(Pe(Yc,"no valid child node found"),null)}}});function wp(n){if(!n)return null;const t=n;for(const e of t){if(hr(e))switch(e.type){case c.Comment:continue;case c.Text:case"svg":return xp(e);case c.Fragment:return wp(e.children);default:return e}return xp(e)}return null}function xp(n){const t=me("only-child");return c.createVNode("span",{class:t.e("content")},[n])}const vp=Kt({virtualRef:{type:ct(Object)},virtualTriggering:Boolean,onMouseenter:{type:ct(Function)},onMouseleave:{type:ct(Function)},onClick:{type:ct(Function)},onKeydown:{type:ct(Function)},onFocus:{type:ct(Function)},onBlur:{type:ct(Function)},onContextmenu:{type:ct(Function)},id:String,open:Boolean}),hN=c.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),dN=c.defineComponent({...hN,props:vp,setup(n,{expose:t}){const e=n,{role:s,triggerRef:r}=c.inject(Gc,void 0);DT(r);const i=c.computed(()=>a.value?e.id:void 0),o=c.computed(()=>{if(s&&s.value==="tooltip")return e.open&&e.id?e.id:void 0}),a=c.computed(()=>{if(s&&s.value!=="tooltip")return s.value}),l=c.computed(()=>a.value?`${e.open}`:void 0);let u;const h=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return c.onMounted(()=>{c.watch(()=>e.virtualRef,f=>{f&&(r.value=ns(f))},{immediate:!0}),c.watch(r,(f,d)=>{u==null||u(),u=void 0,Fn(f)&&(h.forEach(g=>{var p;const m=e[g];m&&(f.addEventListener(g.slice(2).toLowerCase(),m),(p=d==null?void 0:d.removeEventListener)==null||p.call(d,g.slice(2).toLowerCase(),m))}),u=c.watch([i,o,a,l],g=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((p,m)=>{ua(g[m])?f.removeAttribute(p):f.setAttribute(p,g[m])})},{immediate:!0})),Fn(d)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(g=>d.removeAttribute(g))},{immediate:!0})}),c.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,r.value&&Fn(r.value)){const f=r.value;h.forEach(d=>{const g=e[d];g&&f.removeEventListener(d.slice(2).toLowerCase(),g)}),r.value=void 0}}),t({triggerRef:r}),(f,d)=>f.virtualTriggering?c.createCommentVNode("v-if",!0):(c.openBlock(),c.createBlock(c.unref(uN),c.mergeProps({key:0},f.$attrs,{"aria-controls":c.unref(i),"aria-describedby":c.unref(o),"aria-expanded":c.unref(l),"aria-haspopup":c.unref(a)}),{default:c.withCtx(()=>[c.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var fN=he(dN,[["__file","trigger.vue"]]);const Wc="focus-trap.focus-after-trapped",qc="focus-trap.focus-after-released",gN="focus-trap.focusout-prevented",Cp={cancelable:!0,bubbles:!1},pN={cancelable:!0,bubbles:!1},Sp="focusAfterTrapped",Ep="focusAfterReleased",mN=Symbol("elFocusTrap"),Jc=c.ref(),Oa=c.ref(0),Xc=c.ref(0);let Ma=0;const Op=n=>{const t=[],e=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0||s===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;e.nextNode();)t.push(e.currentNode);return t},Mp=(n,t)=>{for(const e of n)if(!yN(e,t))return e},yN=(n,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(t&&n===t)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},bN=n=>{const t=Op(n),e=Mp(t,n),s=Mp(t.reverse(),n);return[e,s]},wN=n=>n instanceof HTMLInputElement&&"select"in n,os=(n,t)=>{if(n&&n.focus){const e=document.activeElement;n.focus({preventScroll:!0}),Xc.value=window.performance.now(),n!==e&&wN(n)&&t&&n.select()}};function Pp(n,t){const e=[...n],s=n.indexOf(t);return s!==-1&&e.splice(s,1),e}const xN=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=Pp(n,s),n.unshift(s)},remove:s=>{var r,i;n=Pp(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},vN=(n,t=!1)=>{const e=document.activeElement;for(const s of n)if(os(s,t),document.activeElement!==e)return},Ap=xN(),CN=()=>Oa.value>Xc.value,Pa=()=>{Jc.value="pointer",Oa.value=window.performance.now()},Tp=()=>{Jc.value="keyboard",Oa.value=window.performance.now()},SN=()=>(c.onMounted(()=>{Ma===0&&(document.addEventListener("mousedown",Pa),document.addEventListener("touchstart",Pa),document.addEventListener("keydown",Tp)),Ma++}),c.onBeforeUnmount(()=>{Ma--,Ma<=0&&(document.removeEventListener("mousedown",Pa),document.removeEventListener("touchstart",Pa),document.removeEventListener("keydown",Tp))}),{focusReason:Jc,lastUserFocusTimestamp:Oa,lastAutomatedFocusTimestamp:Xc}),Aa=n=>new CustomEvent(gN,{...pN,detail:n}),EN=c.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Sp,Ep,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:t}){const e=c.ref();let s,r;const{focusReason:i}=SN();AT(p=>{n.trapped&&!o.paused&&t("release-requested",p)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=p=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:m,altKey:y,ctrlKey:b,metaKey:w,currentTarget:x,shiftKey:v}=p,{loop:S}=n,E=m===Cr.tab&&!y&&!b&&!w,C=document.activeElement;if(E&&C){const M=x,[T,_]=bN(M);if(T&&_){if(!v&&C===_){const k=Aa({focusReason:i.value});t("focusout-prevented",k),k.defaultPrevented||(p.preventDefault(),S&&os(T,!0))}else if(v&&[T,M].includes(C)){const k=Aa({focusReason:i.value});t("focusout-prevented",k),k.defaultPrevented||(p.preventDefault(),S&&os(_,!0))}}else if(C===M){const k=Aa({focusReason:i.value});t("focusout-prevented",k),k.defaultPrevented||p.preventDefault()}}};c.provide(mN,{focusTrapRef:e,onKeydown:a}),c.watch(()=>n.focusTrapEl,p=>{p&&(e.value=p)},{immediate:!0}),c.watch([e],([p],[m])=>{p&&(p.addEventListener("keydown",a),p.addEventListener("focusin",h),p.addEventListener("focusout",f)),m&&(m.removeEventListener("keydown",a),m.removeEventListener("focusin",h),m.removeEventListener("focusout",f))});const l=p=>{t(Sp,p)},u=p=>t(Ep,p),h=p=>{const m=c.unref(e);if(!m)return;const y=p.target,b=p.relatedTarget,w=y&&m.contains(y);n.trapped||b&&m.contains(b)||(s=b),w&&t("focusin",p),!o.paused&&n.trapped&&(w?r=y:os(r,!0))},f=p=>{const m=c.unref(e);if(!(o.paused||!m))if(n.trapped){const y=p.relatedTarget;!ua(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=Aa({focusReason:i.value});t("focusout-prevented",b),b.defaultPrevented||os(r,!0)}},0)}else{const y=p.target;y&&m.contains(y)||t("focusout",p)}};async function d(){await c.nextTick();const p=c.unref(e);if(p){Ap.push(o);const m=p.contains(document.activeElement)?s:document.activeElement;if(s=m,!p.contains(m)){const b=new Event(Wc,Cp);p.addEventListener(Wc,l),p.dispatchEvent(b),b.defaultPrevented||c.nextTick(()=>{let w=n.focusStartEl;Xe(w)||(os(w),document.activeElement!==w&&(w="first")),w==="first"&&vN(Op(p),!0),(document.activeElement===m||w==="container")&&os(p)})}}}function g(){const p=c.unref(e);if(p){p.removeEventListener(Wc,l);const m=new CustomEvent(qc,{...Cp,detail:{focusReason:i.value}});p.addEventListener(qc,u),p.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!CN()||p.contains(document.activeElement))&&os(s??document.body),p.removeEventListener(qc,u),Ap.remove(o)}}return c.onMounted(()=>{n.trapped&&d(),c.watch(()=>n.trapped,p=>{p?d():g()})}),c.onBeforeUnmount(()=>{n.trapped&&g(),e.value&&(e.value.removeEventListener("keydown",a),e.value.removeEventListener("focusin",h),e.value.removeEventListener("focusout",f),e.value=void 0)}),{onKeydown:a}}});function ON(n,t,e,s,r,i){return c.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Np=he(EN,[["render",ON],["__file","focus-trap.vue"]]);const MN=["fixed","absolute"],PN=Kt({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ct(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Nc,default:"bottom"},popperOptions:{type:ct(Object),default:()=>({})},strategy:{type:String,values:MN,default:"absolute"}}),_p=Kt({...PN,id:String,style:{type:ct([String,Array,Object])},className:{type:ct([String,Array,Object])},effect:{type:ct(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ct([String,Array,Object])},popperStyle:{type:ct([String,Array,Object])},referenceEl:{type:ct(Object)},triggerTargetEl:{type:ct(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...zc(["ariaLabel"])}),AN={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},TN=(n,t=[])=>{const{placement:e,strategy:s,popperOptions:r}=n,i={placement:e,strategy:s,...r,modifiers:[..._N(n),...t]};return kN(i,r==null?void 0:r.modifiers),i},NN=n=>{if(Ut)return ns(n)};function _N(n){const{offset:t,gpuAcceleration:e,fallbackPlacements:s}=n;return[{name:"offset",options:{offset:[0,t??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:s}},{name:"computeStyles",options:{gpuAcceleration:e}}]}function kN(n,t){t&&(n.modifiers=[...n.modifiers,...t??[]])}const DN=0,RN=n=>{const{popperInstanceRef:t,contentRef:e,triggerRef:s,role:r}=c.inject(Gc,void 0),i=c.ref(),o=c.ref(),a=c.computed(()=>({name:"eventListeners",enabled:!!n.visible})),l=c.computed(()=>{var b;const w=c.unref(i),x=(b=c.unref(o))!=null?b:DN;return{name:"arrow",enabled:!s2(w),options:{element:w,padding:x}}}),u=c.computed(()=>({onFirstUpdate:()=>{p()},...TN(n,[c.unref(l),c.unref(a)])})),h=c.computed(()=>NN(n.referenceEl)||c.unref(s)),{attributes:f,state:d,styles:g,update:p,forceUpdate:m,instanceRef:y}=OT(h,e,u);return c.watch(y,b=>t.value=b),c.onMounted(()=>{c.watch(()=>{var b;return(b=c.unref(h))==null?void 0:b.getBoundingClientRect()},()=>{p()})}),{attributes:f,arrowRef:i,contentRef:e,instanceRef:y,state:d,styles:g,role:r,forceUpdate:m,update:p}},IN=(n,{attributes:t,styles:e,role:s})=>{const{nextZIndex:r}=lp(),i=me("popper"),o=c.computed(()=>c.unref(t).popper),a=c.ref(Be(n.zIndex)?n.zIndex:r()),l=c.computed(()=>[i.b(),i.is("pure",n.pure),i.is(n.effect),n.popperClass]),u=c.computed(()=>[{zIndex:c.unref(a)},c.unref(e).popper,n.popperStyle||{}]),h=c.computed(()=>s.value==="dialog"?"false":void 0),f=c.computed(()=>c.unref(e).arrow||{});return{ariaModal:h,arrowStyle:f,contentAttrs:o,contentClass:l,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=Be(n.zIndex)?n.zIndex:r()}}},LN=(n,t)=>{const e=c.ref(!1),s=c.ref();return{focusStartRef:s,trapped:e,onFocusAfterReleased:u=>{var h;((h=u.detail)==null?void 0:h.focusReason)!=="pointer"&&(s.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:u=>{n.visible&&!e.value&&(u.target&&(s.value=u.target),e.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),e.value=!1)},onReleaseRequested:()=>{e.value=!1,t("close")}}},BN=c.defineComponent({name:"ElPopperContent"}),VN=c.defineComponent({...BN,props:_p,emits:AN,setup(n,{expose:t,emit:e}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:l,onFocusoutPrevented:u,onReleaseRequested:h}=LN(s,e),{attributes:f,arrowRef:d,contentRef:g,styles:p,instanceRef:m,role:y,update:b}=RN(s),{ariaModal:w,arrowStyle:x,contentAttrs:v,contentClass:S,contentStyle:E,updateZIndex:C}=IN(s,{styles:p,attributes:f,role:y}),M=c.inject(Ea,void 0),T=c.ref();c.provide(mp,{arrowStyle:x,arrowRef:d,arrowOffset:T}),M&&c.provide(Ea,{...M,addInputId:ss,removeInputId:ss});let _;const N=(R=!0)=>{b(),R&&C()},k=()=>{N(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return c.onMounted(()=>{c.watch(()=>s.triggerTargetEl,(R,I)=>{_==null||_(),_=void 0;const A=c.unref(R||g.value),P=c.unref(I||g.value);Fn(A)&&(_=c.watch([y,()=>s.ariaLabel,w,()=>s.id],B=>{["role","aria-label","aria-modal","id"].forEach((j,Y)=>{ua(B[Y])?A.removeAttribute(j):A.setAttribute(j,B[Y])})},{immediate:!0})),P!==A&&Fn(P)&&["role","aria-label","aria-modal","id"].forEach(B=>{P.removeAttribute(B)})},{immediate:!0}),c.watch(()=>s.visible,k,{immediate:!0})}),c.onBeforeUnmount(()=>{_==null||_(),_=void 0}),t({popperContentRef:g,popperInstanceRef:m,updatePopper:N,contentStyle:E}),(R,I)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps({ref_key:"contentRef",ref:g},c.unref(v),{style:c.unref(E),class:c.unref(S),tabindex:"-1",onMouseenter:A=>R.$emit("mouseenter",A),onMouseleave:A=>R.$emit("mouseleave",A)}),[c.createVNode(c.unref(Np),{trapped:c.unref(i),"trap-on-focus-in":!0,"focus-trap-el":c.unref(g),"focus-start-el":c.unref(r),onFocusAfterTrapped:c.unref(a),onFocusAfterReleased:c.unref(o),onFocusin:c.unref(l),onFocusoutPrevented:c.unref(u),onReleaseRequested:c.unref(h)},{default:c.withCtx(()=>[c.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var jN=he(VN,[["__file","content.vue"]]);const $N=js(oN),Kc=Symbol("elTooltip"),kp=Kt({..._T,..._p,appendTo:{type:ct([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ct(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...zc(["ariaLabel"])}),Dp=Kt({...vp,disabled:Boolean,trigger:{type:ct([String,Array]),default:"hover"},triggerKeys:{type:ct(Array),default:()=>[Cr.enter,Cr.space]}}),{useModelToggleProps:zN,useModelToggleEmits:FN,useModelToggle:HN}=CA("visible"),UN=Kt({...yp,...zN,...kp,...Dp,...bp,showArrow:{type:Boolean,default:!0}}),GN=[...FN,"before-show","before-hide","show","hide","open","close"],YN=(n,t)=>bv(n)?n.includes(t):n===t,Tr=(n,t,e)=>s=>{YN(c.unref(n),t)&&e(s)},WN=c.defineComponent({name:"ElTooltipTrigger"}),qN=c.defineComponent({...WN,props:Dp,setup(n,{expose:t}){const e=n,s=me("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:l,onToggle:u}=c.inject(Kc,void 0),h=c.ref(null),f=()=>{if(c.unref(r)||e.disabled)return!0},d=c.toRef(e,"trigger"),g=Vn(f,Tr(d,"hover",a)),p=Vn(f,Tr(d,"hover",l)),m=Vn(f,Tr(d,"click",v=>{v.button===0&&u(v)})),y=Vn(f,Tr(d,"focus",a)),b=Vn(f,Tr(d,"focus",l)),w=Vn(f,Tr(d,"contextmenu",v=>{v.preventDefault(),u(v)})),x=Vn(f,v=>{const{code:S}=v;e.triggerKeys.includes(S)&&(v.preventDefault(),u(v))});return t({triggerRef:h}),(v,S)=>(c.openBlock(),c.createBlock(c.unref(fN),{id:c.unref(i),"virtual-ref":v.virtualRef,open:c.unref(o),"virtual-triggering":v.virtualTriggering,class:c.normalizeClass(c.unref(s).e("trigger")),onBlur:c.unref(b),onClick:c.unref(m),onContextmenu:c.unref(w),onFocus:c.unref(y),onMouseenter:c.unref(g),onMouseleave:c.unref(p),onKeydown:c.unref(x)},{default:c.withCtx(()=>[c.renderSlot(v.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var JN=he(qN,[["__file","trigger.vue"]]);const XN=Kt({to:{type:ct([String,Object]),required:!0},disabled:Boolean});var KN=he(c.defineComponent({__name:"teleport",props:XN,setup(n){return(t,e)=>t.disabled?c.renderSlot(t.$slots,"default",{key:0}):(c.openBlock(),c.createBlock(c.Teleport,{key:1,to:t.to},[c.renderSlot(t.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const ZN=js(KN),QN=c.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),t_=c.defineComponent({...QN,props:kp,setup(n,{expose:t}){const e=n,{selector:s}=ep(),r=me("tooltip"),i=c.ref(null);let o;const{controlled:a,id:l,open:u,trigger:h,onClose:f,onOpen:d,onShow:g,onHide:p,onBeforeShow:m,onBeforeHide:y}=c.inject(Kc,void 0),b=c.computed(()=>e.transition||`${r.namespace.value}-fade-in-linear`),w=c.computed(()=>process.env.NODE_ENV==="test"?!0:e.persistent);c.onBeforeUnmount(()=>{o==null||o()});const x=c.computed(()=>c.unref(w)?!0:c.unref(u)),v=c.computed(()=>e.disabled?!1:c.unref(u)),S=c.computed(()=>e.appendTo||s.value),E=c.computed(()=>{var P;return(P=e.style)!=null?P:{}}),C=c.ref(!0),M=()=>{p(),C.value=!0},T=()=>{if(c.unref(a))return!0},_=Vn(T,()=>{e.enterable&&c.unref(h)==="hover"&&d()}),N=Vn(T,()=>{c.unref(h)==="hover"&&f()}),k=()=>{var P,B;(B=(P=i.value)==null?void 0:P.updatePopper)==null||B.call(P),m==null||m()},R=()=>{y==null||y()},I=()=>{g(),o=av(c.computed(()=>{var P;return(P=i.value)==null?void 0:P.popperContentRef}),()=>{if(c.unref(a))return;c.unref(h)!=="hover"&&f()})},A=()=>{e.virtualTriggering||f()};return c.watch(()=>c.unref(u),P=>{P?C.value=!1:o==null||o()},{flush:"post"}),c.watch(()=>e.content,()=>{var P,B;(B=(P=i.value)==null?void 0:P.updatePopper)==null||B.call(P)}),t({contentRef:i}),(P,B)=>(c.openBlock(),c.createBlock(c.unref(ZN),{disabled:!P.teleported,to:c.unref(S)},{default:c.withCtx(()=>[c.createVNode(c.Transition,{name:c.unref(b),onAfterLeave:M,onBeforeEnter:k,onAfterEnter:I,onBeforeLeave:R},{default:c.withCtx(()=>[c.unref(x)?c.withDirectives((c.openBlock(),c.createBlock(c.unref(jN),c.mergeProps({key:0,id:c.unref(l),ref_key:"contentRef",ref:i},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":C.value,"boundaries-padding":P.boundariesPadding,"fallback-placements":P.fallbackPlacements,"gpu-acceleration":P.gpuAcceleration,offset:P.offset,placement:P.placement,"popper-options":P.popperOptions,strategy:P.strategy,effect:P.effect,enterable:P.enterable,pure:P.pure,"popper-class":P.popperClass,"popper-style":[P.popperStyle,c.unref(E)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:c.unref(v),"z-index":P.zIndex,onMouseenter:c.unref(_),onMouseleave:c.unref(N),onBlur:A,onClose:c.unref(f)}),{default:c.withCtx(()=>[c.renderSlot(P.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[c.vShow,c.unref(v)]]):c.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var e_=he(t_,[["__file","content.vue"]]);const n_=c.defineComponent({name:"ElTooltip"}),s_=c.defineComponent({...n_,props:UN,emits:GN,setup(n,{expose:t,emit:e}){const s=n;NT();const r=Ca(),i=c.ref(),o=c.ref(),a=()=>{var b;const w=c.unref(i);w&&((b=w.popperInstanceRef)==null||b.update())},l=c.ref(!1),u=c.ref(),{show:h,hide:f,hasUpdateHandler:d}=HN({indicator:l,toggleReason:u}),{onOpen:g,onClose:p}=kT({showAfter:c.toRef(s,"showAfter"),hideAfter:c.toRef(s,"hideAfter"),autoClose:c.toRef(s,"autoClose"),open:h,close:f}),m=c.computed(()=>ha(s.visible)&&!d.value);c.provide(Kc,{controlled:m,id:r,open:c.readonly(l),trigger:c.toRef(s,"trigger"),onOpen:b=>{g(b)},onClose:b=>{p(b)},onToggle:b=>{c.unref(l)?p(b):g(b)},onShow:()=>{e("show",u.value)},onHide:()=>{e("hide",u.value)},onBeforeShow:()=>{e("before-show",u.value)},onBeforeHide:()=>{e("before-hide",u.value)},updatePopper:a}),c.watch(()=>s.disabled,b=>{b&&l.value&&(l.value=!1)});const y=b=>{var w,x;const v=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,S=(b==null?void 0:b.relatedTarget)||document.activeElement;return v&&v.contains(S)};return c.onDeactivated(()=>l.value&&f()),t({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:a,onOpen:g,onClose:p,hide:f}),(b,w)=>(c.openBlock(),c.createBlock(c.unref($N),{ref_key:"popperRef",ref:i,role:b.role},{default:c.withCtx(()=>[c.createVNode(JN,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:c.withCtx(()=>[b.$slots.default?c.renderSlot(b.$slots,"default",{key:0}):c.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),c.createVNode(e_,{ref_key:"contentRef",ref:o,"aria-label":b.ariaLabel,"boundaries-padding":b.boundariesPadding,content:b.content,disabled:b.disabled,effect:b.effect,enterable:b.enterable,"fallback-placements":b.fallbackPlacements,"hide-after":b.hideAfter,"gpu-acceleration":b.gpuAcceleration,offset:b.offset,persistent:b.persistent,"popper-class":b.popperClass,"popper-style":b.popperStyle,placement:b.placement,"popper-options":b.popperOptions,pure:b.pure,"raw-content":b.rawContent,"reference-el":b.referenceEl,"trigger-target-el":b.triggerTargetEl,"show-after":b.showAfter,strategy:b.strategy,teleported:b.teleported,transition:b.transition,"virtual-triggering":b.virtualTriggering,"z-index":b.zIndex,"append-to":b.appendTo},{default:c.withCtx(()=>[c.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(c.openBlock(),c.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(c.openBlock(),c.createElementBlock("span",{key:1},c.toDisplayString(b.content),1))]),b.showArrow?(c.openBlock(),c.createBlock(c.unref(cN),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):c.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var r_=he(s_,[["__file","tooltip.vue"]]);const Rp=js(r_),i_=Kt({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:ct([String,Object,Array])},offset:{type:ct(Array),default:[0,0]},badgeClass:{type:String}}),o_=c.defineComponent({name:"ElBadge"}),a_=c.defineComponent({...o_,props:i_,setup(n,{expose:t}){const e=n,s=me("badge"),r=c.computed(()=>e.isDot?"":Be(e.value)&&Be(e.max)?e.max<e.value?`${e.max}+`:`${e.value}`:`${e.value}`),i=c.computed(()=>{var o,a,l,u,h;return[{backgroundColor:e.color,marginRight:ki(-((a=(o=e.offset)==null?void 0:o[0])!=null?a:0)),marginTop:ki((u=(l=e.offset)==null?void 0:l[1])!=null?u:0)},(h=e.badgeStyle)!=null?h:{}]});return t({content:r}),(o,a)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(c.unref(s).b())},[c.renderSlot(o.$slots,"default"),c.createVNode(c.Transition,{name:`${c.unref(s).namespace.value}-zoom-in-center`,persisted:""},{default:c.withCtx(()=>[c.withDirectives(c.createElementVNode("sup",{class:c.normalizeClass([c.unref(s).e("content"),c.unref(s).em("content",o.type),c.unref(s).is("fixed",!!o.$slots.default),c.unref(s).is("dot",o.isDot),c.unref(s).is("hide-zero",!o.showZero&&e.value===0),o.badgeClass]),style:c.normalizeStyle(c.unref(i)),textContent:c.toDisplayString(c.unref(r))},null,14,["textContent"]),[[c.vShow,!o.hidden&&(c.unref(r)||o.isDot)]])]),_:1},8,["name"])],2))}});var l_=he(a_,[["__file","badge.vue"]]);const c_=js(l_),Ip=Symbol("buttonGroupContextKey"),u_=(n,t)=>{hA({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},c.computed(()=>n.type==="text"));const e=c.inject(Ip,void 0),s=Fc("button"),{form:r}=gp(),i=fp(c.computed(()=>e==null?void 0:e.size)),o=Uc(),a=c.ref(),l=c.useSlots(),u=c.computed(()=>n.type||(e==null?void 0:e.type)||""),h=c.computed(()=>{var p,m,y;return(y=(m=n.autoInsertSpace)!=null?m:(p=s.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),f=c.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),d=c.computed(()=>{var p;const m=(p=l.default)==null?void 0:p.call(l);if(h.value&&(m==null?void 0:m.length)===1){const y=m[0];if((y==null?void 0:y.type)===c.Text){const b=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(b.trim())}}return!1});return{_disabled:o,_size:i,_type:u,_ref:a,_props:f,shouldAddSpace:d,handleClick:p=>{if(o.value||n.loading){p.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),t("click",p)}}},Zc=Kt({size:$c,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Di},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Di,default:()=>fa},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ct([String,Object]),default:"button"}}),h_={click:n=>n instanceof MouseEvent};function oe(n,t){d_(n)&&(n="100%");var e=f_(n);return n=t===360?n:Math.min(t,Math.max(0,parseFloat(n))),e&&(n=parseInt(String(n*t),10)/100),Math.abs(n-t)<1e-6?1:(t===360?n=(n<0?n%t+t:n%t)/parseFloat(String(t)):n=n%t/parseFloat(String(t)),n)}function Ta(n){return Math.min(1,Math.max(0,n))}function d_(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function f_(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Lp(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Na(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Fs(n){return n.length===1?"0"+n:String(n)}function g_(n,t,e){return{r:oe(n,255)*255,g:oe(t,255)*255,b:oe(e,255)*255}}function Bp(n,t,e){n=oe(n,255),t=oe(t,255),e=oe(e,255);var s=Math.max(n,t,e),r=Math.min(n,t,e),i=0,o=0,a=(s+r)/2;if(s===r)o=0,i=0;else{var l=s-r;switch(o=a>.5?l/(2-s-r):l/(s+r),s){case n:i=(t-e)/l+(t<e?6:0);break;case t:i=(e-n)/l+2;break;case e:i=(n-t)/l+4;break}i/=6}return{h:i,s:o,l:a}}function Qc(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*(6*e):e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function p_(n,t,e){var s,r,i;if(n=oe(n,360),t=oe(t,100),e=oe(e,100),t===0)r=e,i=e,s=e;else{var o=e<.5?e*(1+t):e+t-e*t,a=2*e-o;s=Qc(a,o,n+1/3),r=Qc(a,o,n),i=Qc(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function Vp(n,t,e){n=oe(n,255),t=oe(t,255),e=oe(e,255);var s=Math.max(n,t,e),r=Math.min(n,t,e),i=0,o=s,a=s-r,l=s===0?0:a/s;if(s===r)i=0;else{switch(s){case n:i=(t-e)/a+(t<e?6:0);break;case t:i=(e-n)/a+2;break;case e:i=(n-t)/a+4;break}i/=6}return{h:i,s:l,v:o}}function m_(n,t,e){n=oe(n,360)*6,t=oe(t,100),e=oe(e,100);var s=Math.floor(n),r=n-s,i=e*(1-t),o=e*(1-r*t),a=e*(1-(1-r)*t),l=s%6,u=[e,o,i,i,a,e][l],h=[a,e,e,o,i,i][l],f=[i,i,a,e,e,o][l];return{r:u*255,g:h*255,b:f*255}}function jp(n,t,e,s){var r=[Fs(Math.round(n).toString(16)),Fs(Math.round(t).toString(16)),Fs(Math.round(e).toString(16))];return s&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function y_(n,t,e,s,r){var i=[Fs(Math.round(n).toString(16)),Fs(Math.round(t).toString(16)),Fs(Math.round(e).toString(16)),Fs(b_(s))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function b_(n){return Math.round(parseFloat(n)*255).toString(16)}function $p(n){return Ae(n)/255}function Ae(n){return parseInt(n,16)}function w_(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var tu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function x_(n){var t={r:0,g:0,b:0},e=1,s=null,r=null,i=null,o=!1,a=!1;return typeof n=="string"&&(n=S_(n)),typeof n=="object"&&(Un(n.r)&&Un(n.g)&&Un(n.b)?(t=g_(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Un(n.h)&&Un(n.s)&&Un(n.v)?(s=Na(n.s),r=Na(n.v),t=m_(n.h,s,r),o=!0,a="hsv"):Un(n.h)&&Un(n.s)&&Un(n.l)&&(s=Na(n.s),i=Na(n.l),t=p_(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(e=n.a)),e=Lp(e),{ok:o,format:n.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var v_="[-\\+]?\\d+%?",C_="[-\\+]?\\d*\\.\\d+%?",as="(?:".concat(C_,")|(?:").concat(v_,")"),eu="[\\s|\\(]+(".concat(as,")[,|\\s]+(").concat(as,")[,|\\s]+(").concat(as,")\\s*\\)?"),nu="[\\s|\\(]+(".concat(as,")[,|\\s]+(").concat(as,")[,|\\s]+(").concat(as,")[,|\\s]+(").concat(as,")\\s*\\)?"),sn={CSS_UNIT:new RegExp(as),rgb:new RegExp("rgb"+eu),rgba:new RegExp("rgba"+nu),hsl:new RegExp("hsl"+eu),hsla:new RegExp("hsla"+nu),hsv:new RegExp("hsv"+eu),hsva:new RegExp("hsva"+nu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function S_(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var t=!1;if(tu[n])n=tu[n],t=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=sn.rgb.exec(n);return e?{r:e[1],g:e[2],b:e[3]}:(e=sn.rgba.exec(n),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=sn.hsl.exec(n),e?{h:e[1],s:e[2],l:e[3]}:(e=sn.hsla.exec(n),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=sn.hsv.exec(n),e?{h:e[1],s:e[2],v:e[3]}:(e=sn.hsva.exec(n),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=sn.hex8.exec(n),e?{r:Ae(e[1]),g:Ae(e[2]),b:Ae(e[3]),a:$p(e[4]),format:t?"name":"hex8"}:(e=sn.hex6.exec(n),e?{r:Ae(e[1]),g:Ae(e[2]),b:Ae(e[3]),format:t?"name":"hex"}:(e=sn.hex4.exec(n),e?{r:Ae(e[1]+e[1]),g:Ae(e[2]+e[2]),b:Ae(e[3]+e[3]),a:$p(e[4]+e[4]),format:t?"name":"hex8"}:(e=sn.hex3.exec(n),e?{r:Ae(e[1]+e[1]),g:Ae(e[2]+e[2]),b:Ae(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function Un(n){return!!sn.CSS_UNIT.exec(String(n))}var E_=function(){function n(t,e){t===void 0&&(t=""),e===void 0&&(e={});var s;if(t instanceof n)return t;typeof t=="number"&&(t=w_(t)),this.originalInput=t;var r=x_(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(s=e.format)!==null&&s!==void 0?s:r.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},n.prototype.getLuminance=function(){var t=this.toRgb(),e,s,r,i=t.r/255,o=t.g/255,a=t.b/255;return i<=.03928?e=i/12.92:e=Math.pow((i+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*e+.7152*s+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(t){return this.a=Lp(t),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},n.prototype.toHsv=function(){var t=Vp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},n.prototype.toHsvString=function(){var t=Vp(this.r,this.g,this.b),e=Math.round(t.h*360),s=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(e,", ").concat(s,"%, ").concat(r,"%)"):"hsva(".concat(e,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var t=Bp(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},n.prototype.toHslString=function(){var t=Bp(this.r,this.g,this.b),e=Math.round(t.h*360),s=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(e,", ").concat(s,"%, ").concat(r,"%)"):"hsla(".concat(e,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(t){return t===void 0&&(t=!1),jp(this.r,this.g,this.b,t)},n.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},n.prototype.toHex8=function(t){return t===void 0&&(t=!1),y_(this.r,this.g,this.b,this.a,t)},n.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},n.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),s=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(e,", ").concat(s,")"):"rgba(".concat(t,", ").concat(e,", ").concat(s,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var t=function(e){return"".concat(Math.round(oe(e,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var t=function(e){return Math.round(oe(e,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+jp(this.r,this.g,this.b,!1),e=0,s=Object.entries(tu);e<s.length;e++){var r=s[e],i=r[0],o=r[1];if(t===o)return i}return!1},n.prototype.toString=function(t){var e=!!t;t=t??this.format;var s=!1,r=this.a<1&&this.a>=0,i=!e&&r&&(t.startsWith("hex")||t==="name");return i?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(s=this.toRgbString()),t==="prgb"&&(s=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(s=this.toHexString()),t==="hex3"&&(s=this.toHexString(!0)),t==="hex4"&&(s=this.toHex8String(!0)),t==="hex8"&&(s=this.toHex8String()),t==="name"&&(s=this.toName()),t==="hsl"&&(s=this.toHslString()),t==="hsv"&&(s=this.toHsvString()),s||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.l+=t/100,e.l=Ta(e.l),new n(e)},n.prototype.brighten=function(t){t===void 0&&(t=10);var e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),new n(e)},n.prototype.darken=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.l-=t/100,e.l=Ta(e.l),new n(e)},n.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},n.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},n.prototype.desaturate=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.s-=t/100,e.s=Ta(e.s),new n(e)},n.prototype.saturate=function(t){t===void 0&&(t=10);var e=this.toHsl();return e.s+=t/100,e.s=Ta(e.s),new n(e)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(t){var e=this.toHsl(),s=(e.h+t)%360;return e.h=s<0?360+s:s,new n(e)},n.prototype.mix=function(t,e){e===void 0&&(e=50);var s=this.toRgb(),r=new n(t).toRgb(),i=e/100,o={r:(r.r-s.r)*i+s.r,g:(r.g-s.g)*i+s.g,b:(r.b-s.b)*i+s.b,a:(r.a-s.a)*i+s.a};return new n(o)},n.prototype.analogous=function(t,e){t===void 0&&(t=6),e===void 0&&(e=30);var s=this.toHsl(),r=360/e,i=[this];for(s.h=(s.h-(r*t>>1)+720)%360;--t;)s.h=(s.h+r)%360,i.push(new n(s));return i},n.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new n(t)},n.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var e=this.toHsv(),s=e.h,r=e.s,i=e.v,o=[],a=1/t;t--;)o.push(new n({h:s,s:r,v:i})),i=(i+a)%1;return o},n.prototype.splitcomplement=function(){var t=this.toHsl(),e=t.h;return[this,new n({h:(e+72)%360,s:t.s,l:t.l}),new n({h:(e+216)%360,s:t.s,l:t.l})]},n.prototype.onBackground=function(t){var e=this.toRgb(),s=new n(t).toRgb(),r=e.a+s.a*(1-e.a);return new n({r:(e.r*e.a+s.r*s.a*(1-e.a))/r,g:(e.g*e.a+s.g*s.a*(1-e.a))/r,b:(e.b*e.a+s.b*s.a*(1-e.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(t){for(var e=this.toHsl(),s=e.h,r=[this],i=360/t,o=1;o<t;o++)r.push(new n({h:(s+o*i)%360,s:e.s,l:e.l}));return r},n.prototype.equals=function(t){return this.toRgbString()===new n(t).toRgbString()},n}();function ls(n,t=20){return n.mix("#141414",t).toString()}function O_(n){const t=Uc(),e=me("button");return c.computed(()=>{let s={},r=n.color;if(r){const i=r.match(/var\((.*?)\)/);i&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new E_(r),a=n.dark?o.tint(20).toString():ls(o,20);if(n.plain)s=e.cssVarBlock({"bg-color":n.dark?ls(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ls(o,50):o.tint(50).toString(),"hover-text-color":`var(${e.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${e.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(s[e.cssVarBlockName("disabled-bg-color")]=n.dark?ls(o,90):o.tint(90).toString(),s[e.cssVarBlockName("disabled-text-color")]=n.dark?ls(o,50):o.tint(50).toString(),s[e.cssVarBlockName("disabled-border-color")]=n.dark?ls(o,80):o.tint(80).toString());else{const l=n.dark?ls(o,30):o.tint(30).toString(),u=o.isDark()?`var(${e.cssVarName("color-white")})`:`var(${e.cssVarName("color-black")})`;if(s=e.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":l,"hover-text-color":u,"hover-border-color":l,"active-bg-color":a,"active-border-color":a}),t.value){const h=n.dark?ls(o,50):o.tint(50).toString();s[e.cssVarBlockName("disabled-bg-color")]=h,s[e.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${e.cssVarName("color-white")})`,s[e.cssVarBlockName("disabled-border-color")]=h}}}return s})}const M_=c.defineComponent({name:"ElButton"}),P_=c.defineComponent({...M_,props:Zc,emits:h_,setup(n,{expose:t,emit:e}){const s=n,r=O_(s),i=me("button"),{_ref:o,_size:a,_type:l,_disabled:u,_props:h,shouldAddSpace:f,handleClick:d}=u_(s,e),g=c.computed(()=>[i.b(),i.m(l.value),i.m(a.value),i.is("disabled",u.value),i.is("loading",s.loading),i.is("plain",s.plain),i.is("round",s.round),i.is("circle",s.circle),i.is("text",s.text),i.is("link",s.link),i.is("has-bg",s.bg)]);return t({ref:o,size:a,type:l,disabled:u,shouldAddSpace:f}),(p,m)=>(c.openBlock(),c.createBlock(c.resolveDynamicComponent(p.tag),c.mergeProps({ref_key:"_ref",ref:o},c.unref(h),{class:c.unref(g),style:c.unref(r),onClick:c.unref(d)}),{default:c.withCtx(()=>[p.loading?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[p.$slots.loading?c.renderSlot(p.$slots,"loading",{key:0}):(c.openBlock(),c.createBlock(c.unref(Cn),{key:1,class:c.normalizeClass(c.unref(i).is("loading"))},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(p.loadingIcon)))]),_:1},8,["class"]))],64)):p.icon||p.$slots.icon?(c.openBlock(),c.createBlock(c.unref(Cn),{key:1},{default:c.withCtx(()=>[p.icon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(p.icon),{key:0})):c.renderSlot(p.$slots,"icon",{key:1})]),_:3})):c.createCommentVNode("v-if",!0),p.$slots.default?(c.openBlock(),c.createElementBlock("span",{key:2,class:c.normalizeClass({[c.unref(i).em("text","expand")]:c.unref(f)})},[c.renderSlot(p.$slots,"default")],2)):c.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var A_=he(P_,[["__file","button.vue"]]);const T_={size:Zc.size,type:Zc.type},N_=c.defineComponent({name:"ElButtonGroup"}),__=c.defineComponent({...N_,props:T_,setup(n){const t=n;c.provide(Ip,c.reactive({size:c.toRef(t,"size"),type:c.toRef(t,"type")}));const e=me("button");return(s,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(c.unref(e).b("group"))},[c.renderSlot(s.$slots,"default")],2))}});var zp=he(__,[["__file","button-group.vue"]]);const k_=js(A_,{ButtonGroup:zp});iA(zp);function D_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const su="_trap-focus-children",Hs=[],Fp=n=>{var t;if(Hs.length===0)return;const e=Hs[Hs.length-1][su];if(e.length>0&&n.code===Cr.tab){if(e.length===1){n.preventDefault(),document.activeElement!==e[0]&&e[0].focus();return}const s=n.shiftKey,r=n.target===e[0],i=n.target===e[e.length-1];if(r&&s&&(n.preventDefault(),e[e.length-1].focus()),i&&!s&&(n.preventDefault(),e[0].focus()),process.env.NODE_ENV==="test"){const o=e.indexOf(n.target);o!==-1&&((t=e[s?o-1:o+1])==null||t.focus())}}},R_={beforeMount(n){n[su]=cd(n),Hs.push(n),Hs.length<=1&&document.addEventListener("keydown",Fp)},updated(n){c.nextTick(()=>{n[su]=cd(n)})},unmounted(){Hs.shift(),Hs.length===0&&document.removeEventListener("keydown",Fp)}},I_=Kt({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:ct([String,Array,Object])},zIndex:{type:ct([String,Number])}}),L_={click:n=>n instanceof MouseEvent},B_="overlay";var V_=c.defineComponent({name:"ElOverlay",props:I_,emits:L_,setup(n,{slots:t,emit:e}){const s=me(B_),r=l=>{e("click",l)},{onClick:i,onMousedown:o,onMouseup:a}=Kg(n.customMaskEvent?void 0:r);return()=>n.mask?c.createVNode("div",{class:[s.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:i,onMousedown:o,onMouseup:a},[c.renderSlot(t,"default")],ma.STYLE|ma.CLASS|ma.PROPS,["onClick","onMouseup","onMousedown"]):c.h("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[c.renderSlot(t,"default")])}});const j_=V_,Hp=["success","info","warning","error"],de=Pg({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Ut?document.body:void 0}),$_=Kt({customClass:{type:String,default:de.customClass},center:{type:Boolean,default:de.center},dangerouslyUseHTMLString:{type:Boolean,default:de.dangerouslyUseHTMLString},duration:{type:Number,default:de.duration},icon:{type:Di,default:de.icon},id:{type:String,default:de.id},message:{type:ct([String,Object,Function]),default:de.message},onClose:{type:ct(Function),default:de.onClose},showClose:{type:Boolean,default:de.showClose},type:{type:String,values:Hp,default:de.type},plain:{type:Boolean,default:de.plain},offset:{type:Number,default:de.offset},zIndex:{type:Number,default:de.zIndex},grouping:{type:Boolean,default:de.grouping},repeatNum:{type:Number,default:de.repeatNum}}),z_={destroy:()=>!0},rn=c.shallowReactive([]),F_=n=>{const t=rn.findIndex(r=>r.id===n),e=rn[t];let s;return t>0&&(s=rn[t-1]),{current:e,prev:s}},H_=n=>{const{prev:t}=F_(n);return t?t.vm.exposed.bottom.value:0},U_=(n,t)=>rn.findIndex(s=>s.id===n)>0?16:t,G_=c.defineComponent({name:"ElMessage"}),Y_=c.defineComponent({...G_,props:$_,emits:z_,setup(n,{expose:t}){const e=n,{Close:s}=Og,{ns:r,zIndex:i}=hp("message"),{currentZIndex:o,nextZIndex:a}=i,l=c.ref(),u=c.ref(!1),h=c.ref(0);let f;const d=c.computed(()=>e.type?e.type==="error"?"danger":e.type:"info"),g=c.computed(()=>{const C=e.type;return{[r.bm("icon",C)]:C&&pa[C]}}),p=c.computed(()=>e.icon||pa[e.type]||""),m=c.computed(()=>H_(e.id)),y=c.computed(()=>U_(e.id,e.offset)+m.value),b=c.computed(()=>h.value+y.value),w=c.computed(()=>({top:`${y.value}px`,zIndex:o.value}));function x(){e.duration!==0&&({stop:f}=ov(()=>{S()},e.duration))}function v(){f==null||f()}function S(){u.value=!1}function E({code:C}){C===Cr.esc&&S()}return c.onMounted(()=>{x(),a(),u.value=!0}),c.watch(()=>e.repeatNum,()=>{v(),x()}),jn(document,"keydown",E),md(l,()=>{h.value=l.value.getBoundingClientRect().height}),t({visible:u,bottom:b,close:S}),(C,M)=>(c.openBlock(),c.createBlock(c.Transition,{name:c.unref(r).b("fade"),onBeforeLeave:C.onClose,onAfterLeave:T=>C.$emit("destroy"),persisted:""},{default:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",{id:C.id,ref_key:"messageRef",ref:l,class:c.normalizeClass([c.unref(r).b(),{[c.unref(r).m(C.type)]:C.type},c.unref(r).is("center",C.center),c.unref(r).is("closable",C.showClose),c.unref(r).is("plain",C.plain),C.customClass]),style:c.normalizeStyle(c.unref(w)),role:"alert",onMouseenter:v,onMouseleave:x},[C.repeatNum>1?(c.openBlock(),c.createBlock(c.unref(c_),{key:0,value:C.repeatNum,type:c.unref(d),class:c.normalizeClass(c.unref(r).e("badge"))},null,8,["value","type","class"])):c.createCommentVNode("v-if",!0),c.unref(p)?(c.openBlock(),c.createBlock(c.unref(Cn),{key:1,class:c.normalizeClass([c.unref(r).e("icon"),c.unref(g)])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(c.unref(p))))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),c.renderSlot(C.$slots,"default",{},()=>[C.dangerouslyUseHTMLString?(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),c.createElementVNode("p",{class:c.normalizeClass(c.unref(r).e("content")),innerHTML:C.message},null,10,["innerHTML"])],2112)):(c.openBlock(),c.createElementBlock("p",{key:0,class:c.normalizeClass(c.unref(r).e("content"))},c.toDisplayString(C.message),3))]),C.showClose?(c.openBlock(),c.createBlock(c.unref(Cn),{key:2,class:c.normalizeClass(c.unref(r).e("closeBtn")),onClick:c.withModifiers(S,["stop"])},{default:c.withCtx(()=>[c.createVNode(c.unref(s))]),_:1},8,["class","onClick"])):c.createCommentVNode("v-if",!0)],46,["id"]),[[c.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var W_=he(Y_,[["__file","message.vue"]]);let q_=1;const Up=n=>{const t=!n||Xe(n)||c.isVNode(n)||Re(n)?{message:n}:n,e={...de,...t};if(!e.appendTo)e.appendTo=document.body;else if(Xe(e.appendTo)){let s=document.querySelector(e.appendTo);Fn(s)||(Pe("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),e.appendTo=s}return ha(en.grouping)&&!e.grouping&&(e.grouping=en.grouping),Be(en.duration)&&e.duration===3e3&&(e.duration=en.duration),Be(en.offset)&&e.offset===16&&(e.offset=en.offset),ha(en.showClose)&&!e.showClose&&(e.showClose=en.showClose),e},J_=n=>{const t=rn.indexOf(n);if(t===-1)return;rn.splice(t,1);const{handler:e}=n;e.close()},X_=({appendTo:n,...t},e)=>{const s=`message_${q_++}`,r=t.onClose,i=document.createElement("div"),o={...t,id:s,onClose:()=>{r==null||r(),J_(h)},onDestroy:()=>{c.render(null,i)}},a=c.createVNode(W_,o,Re(o.message)||c.isVNode(o.message)?{default:Re(o.message)?o.message:()=>o.message}:null);a.appContext=e||Nr._context,c.render(a,i),n.appendChild(i.firstElementChild);const l=a.component,h={id:s,vnode:a,vm:l,handler:{close:()=>{l.exposed.visible.value=!1}},props:a.component.props};return h},Nr=(n={},t)=>{if(!Ut)return{close:()=>{}};const e=Up(n);if(e.grouping&&rn.length){const r=rn.find(({vnode:i})=>{var o;return((o=i.props)==null?void 0:o.message)===e.message});if(r)return r.props.repeatNum+=1,r.props.type=e.type,r.handler}if(Be(en.max)&&rn.length>=en.max)return{close:()=>{}};const s=X_(e,t);return rn.push(s),s.handler};Hp.forEach(n=>{Nr[n]=(t={},e)=>{const s=Up(t);return Nr({...s,type:n},e)}});function K_(n){for(const t of rn)(!n||n===t.props.type)&&t.handler.close()}Nr.closeAll=K_,Nr._context=null;const Yt=rA(Nr,"$message"),Z_=c.defineComponent({name:"ElMessageBox",directives:{TrapFocus:R_},components:{ElButton:k_,ElFocusTrap:Np,ElInput:sN,ElOverlay:j_,ElIcon:Cn,...Og},inheritAttrs:!1,props:{buttonSize:{type:String,validator:oA},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(n,{emit:t}){const{locale:e,zIndex:s,ns:r,size:i}=hp("message-box",c.computed(()=>n.buttonSize)),{t:o}=e,{nextZIndex:a}=s,l=c.ref(!1),u=c.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:c.markRaw(fa),cancelButtonLoadingIcon:c.markRaw(fa),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),h=c.computed(()=>{const P=u.type;return{[r.bm("icon",P)]:P&&pa[P]}}),f=Ca(),d=Ca(),g=c.computed(()=>u.icon||pa[u.type]||""),p=c.computed(()=>!!u.message),m=c.ref(),y=c.ref(),b=c.ref(),w=c.ref(),x=c.ref(),v=c.computed(()=>u.confirmButtonClass);c.watch(()=>u.inputValue,async P=>{await c.nextTick(),n.boxType==="prompt"&&P!==null&&k()},{immediate:!0}),c.watch(()=>l.value,P=>{var B,j;P&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(j=(B=x.value)==null?void 0:B.$el)!=null?j:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(P?c.nextTick().then(()=>{var Y;w.value&&w.value.$el&&(u.autofocus?b.value=(Y=R())!=null?Y:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const S=c.computed(()=>n.draggable),E=c.computed(()=>n.overflow);dA(m,y,S,E),c.onMounted(async()=>{await c.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",C)}),c.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",C)});function C(){l.value&&(l.value=!1,c.nextTick(()=>{u.action&&t("action",u.action)}))}const M=()=>{n.closeOnClickModal&&N(u.distinguishCancelAndClose?"close":"cancel")},T=Kg(M),_=P=>{if(u.inputType!=="textarea")return P.preventDefault(),N("confirm")},N=P=>{var B;n.boxType==="prompt"&&P==="confirm"&&!k()||(u.action=P,u.beforeClose?(B=u.beforeClose)==null||B.call(u,P,u,C):C())},k=()=>{if(n.boxType==="prompt"){const P=u.inputPattern;if(P&&!P.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;const B=u.inputValidator;if(typeof B=="function"){const j=B(u.inputValue);if(j===!1)return u.editorErrorMessage=u.inputErrorMessage||o("el.messagebox.error"),u.validateError=!0,!1;if(typeof j=="string")return u.editorErrorMessage=j,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},R=()=>{const P=w.value.$refs;return P.input||P.textarea},I=()=>{N("close")},A=()=>{n.closeOnPressEscape&&I()};return n.lockScroll&&wA(l),{...c.toRefs(u),ns:r,overlayEvent:T,visible:l,hasMessage:p,typeClass:h,contentId:f,inputId:d,btnSize:i,iconComponent:g,confirmButtonClasses:v,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:C,handleClose:I,onCloseRequested:A,handleWrapperClick:M,handleInputEnter:_,handleAction:N,t:o}}});function Q_(n,t,e,s,r,i){const o=c.resolveComponent("el-icon"),a=c.resolveComponent("close"),l=c.resolveComponent("el-input"),u=c.resolveComponent("el-button"),h=c.resolveComponent("el-focus-trap"),f=c.resolveComponent("el-overlay");return c.openBlock(),c.createBlock(c.Transition,{name:"fade-in-linear",onAfterLeave:d=>n.$emit("vanish"),persisted:""},{default:c.withCtx(()=>[c.withDirectives(c.createVNode(f,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:c.withCtx(()=>[c.createElementVNode("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:c.normalizeClass(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[c.createVNode(h,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:c.withCtx(()=>[c.createElementVNode("div",{ref:"rootRef",class:c.normalizeClass([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:c.normalizeStyle(n.customStyle),tabindex:"-1",onClick:c.withModifiers(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(c.openBlock(),c.createElementBlock("div",{key:0,ref:"headerRef",class:c.normalizeClass([n.ns.e("header"),{"show-close":n.showClose}])},[c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("title"))},[n.iconComponent&&n.center?(c.openBlock(),c.createBlock(o,{key:0,class:c.normalizeClass([n.ns.e("status"),n.typeClass])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),c.createElementVNode("span",null,c.toDisplayString(n.title),1)],2),n.showClose?(c.openBlock(),c.createElementBlock("button",{key:0,type:"button",class:c.normalizeClass(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:d=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:c.withKeys(c.withModifiers(d=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[c.createVNode(o,{class:c.normalizeClass(n.ns.e("close"))},{default:c.withCtx(()=>[c.createVNode(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):c.createCommentVNode("v-if",!0)],2)):c.createCommentVNode("v-if",!0),c.createElementVNode("div",{id:n.contentId,class:c.normalizeClass(n.ns.e("content"))},[c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(c.openBlock(),c.createBlock(o,{key:0,class:c.normalizeClass([n.ns.e("status"),n.typeClass])},{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):c.createCommentVNode("v-if",!0),n.hasMessage?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(n.ns.e("message"))},[c.renderSlot(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):c.createCommentVNode("v-if",!0)],2),c.withDirectives(c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("input"))},[c.createVNode(l,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":d=>n.inputValue=d,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:c.normalizeClass({invalid:n.validateError}),onKeydown:c.withKeys(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("errormsg")),style:c.normalizeStyle({visibility:n.editorErrorMessage?"visible":"hidden"})},c.toDisplayString(n.editorErrorMessage),7)],2),[[c.vShow,n.showInput]])],10,["id"]),c.createElementVNode("div",{class:c.normalizeClass(n.ns.e("btns"))},[n.showCancelButton?(c.openBlock(),c.createBlock(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:c.normalizeClass([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:d=>n.handleAction("cancel"),onKeydown:c.withKeys(c.withModifiers(d=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):c.createCommentVNode("v-if",!0),c.withDirectives(c.createVNode(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:c.normalizeClass([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:d=>n.handleAction("confirm"),onKeydown:c.withKeys(c.withModifiers(d=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[c.vShow,n.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[c.vShow,n.visible]])]),_:3},8,["onAfterLeave"])}var tk=he(Z_,[["render",Q_],["__file","index.vue"]]);const zi=new Map,ek=n=>{let t=document.body;return n.appendTo&&(Xe(n.appendTo)&&(t=document.querySelector(n.appendTo)),Fn(n.appendTo)&&(t=n.appendTo),Fn(t)||(Pe("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),t=document.body)),t},nk=(n,t,e=null)=>{const s=c.createVNode(tk,n,Re(n.message)||c.isVNode(n.message)?{default:Re(n.message)?n.message:()=>n.message}:null);return s.appContext=e,c.render(s,t),ek(n).appendChild(t.firstElementChild),s.component},sk=()=>document.createElement("div"),rk=(n,t)=>{const e=sk();n.onVanish=()=>{c.render(null,e),zi.delete(r)},n.onAction=i=>{const o=zi.get(r);let a;n.showInput?a={value:r.inputValue,action:i}:a=i,n.callback?n.callback(a,s.proxy):i==="cancel"||i==="close"?n.distinguishCancelAndClose&&i!=="cancel"?o.reject("close"):o.reject("cancel"):o.resolve(a)};const s=nk(n,e,t),r=s.proxy;for(const i in n)zo(n,i)&&!zo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function _r(n,t=null){if(!Ut)return Promise.reject();let e;return Xe(n)||c.isVNode(n)?n={message:n}:e=n.callback,new Promise((s,r)=>{const i=rk(n,t??_r._context);zi.set(i,{options:n,callback:e,resolve:s,reject:r})})}const ik=["alert","confirm","prompt"],ok={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};ik.forEach(n=>{_r[n]=ak(n)});function ak(n){return(t,e,s,r)=>{let i="";return hr(e)?(s=e,i=""):dg(e)?i="":i=e,_r(Object.assign({title:i,message:t,type:"",...ok[n]},s,{boxType:n}),r)}}_r.close=()=>{zi.forEach((n,t)=>{t.doClose()}),zi.clear()},_r._context=null;const cs=_r;cs.install=n=>{cs._context=n._context,n.config.globalProperties.$msgbox=cs,n.config.globalProperties.$messageBox=cs,n.config.globalProperties.$alert=cs.alert,n.config.globalProperties.$confirm=cs.confirm,n.config.globalProperties.$prompt=cs.prompt};const lk=cs;function Gp(n,t){return function(){return n.apply(t,arguments)}}const{toString:ck}=Object.prototype,{getPrototypeOf:ru}=Object,_a=(n=>t=>{const e=ck.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),on=n=>(n=n.toLowerCase(),t=>_a(t)===n),ka=n=>t=>typeof t===n,{isArray:kr}=Array,Fi=ka("undefined");function uk(n){return n!==null&&!Fi(n)&&n.constructor!==null&&!Fi(n.constructor)&&Te(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Yp=on("ArrayBuffer");function hk(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Yp(n.buffer),t}const dk=ka("string"),Te=ka("function"),Wp=ka("number"),Da=n=>n!==null&&typeof n=="object",fk=n=>n===!0||n===!1,Ra=n=>{if(_a(n)!=="object")return!1;const t=ru(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},gk=on("Date"),pk=on("File"),mk=on("Blob"),yk=on("FileList"),bk=n=>Da(n)&&Te(n.pipe),wk=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||Te(n.append)&&((t=_a(n))==="formdata"||t==="object"&&Te(n.toString)&&n.toString()==="[object FormData]"))},xk=on("URLSearchParams"),[vk,Ck,Sk,Ek]=["ReadableStream","Request","Response","Headers"].map(on),Ok=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hi(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),kr(n))for(s=0,r=n.length;s<r;s++)t.call(null,n[s],s,n);else{const i=e?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(s=0;s<o;s++)a=i[s],t.call(null,n[a],a,n)}}function qp(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,r;for(;s-- >0;)if(r=e[s],t===r.toLowerCase())return r;return null}const Us=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Jp=n=>!Fi(n)&&n!==Us;function iu(){const{caseless:n}=Jp(this)&&this||{},t={},e=(s,r)=>{const i=n&&qp(t,r)||r;Ra(t[i])&&Ra(s)?t[i]=iu(t[i],s):Ra(s)?t[i]=iu({},s):kr(s)?t[i]=s.slice():t[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Hi(arguments[s],e);return t}const Mk=(n,t,e,{allOwnKeys:s}={})=>(Hi(t,(r,i)=>{e&&Te(r)?n[i]=Gp(r,e):n[i]=r},{allOwnKeys:s}),n),Pk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Ak=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Tk=(n,t,e,s)=>{let r,i,o;const a={};if(t=t||{},n==null)return t;do{for(r=Object.getOwnPropertyNames(n),i=r.length;i-- >0;)o=r[i],(!s||s(o,n,t))&&!a[o]&&(t[o]=n[o],a[o]=!0);n=e!==!1&&ru(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},Nk=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},_k=n=>{if(!n)return null;if(kr(n))return n;let t=n.length;if(!Wp(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},kk=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&ru(Uint8Array)),Dk=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(n,i[0],i[1])}},Rk=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Ik=on("HTMLFormElement"),Lk=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,r){return s.toUpperCase()+r}),Xp=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Bk=on("RegExp"),Kp=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Hi(e,(r,i)=>{let o;(o=t(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},Vk=n=>{Kp(n,(t,e)=>{if(Te(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(Te(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},jk=(n,t)=>{const e={},s=r=>{r.forEach(i=>{e[i]=!0})};return kr(n)?s(n):s(String(n).split(t)),e},$k=()=>{},zk=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t,ou="abcdefghijklmnopqrstuvwxyz",Zp="0123456789",Qp={DIGIT:Zp,ALPHA:ou,ALPHA_DIGIT:ou+ou.toUpperCase()+Zp},Fk=(n=16,t=Qp.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;n--;)e+=t[Math.random()*s|0];return e};function Hk(n){return!!(n&&Te(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Uk=n=>{const t=new Array(10),e=(s,r)=>{if(Da(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[r]=s;const i=kr(s)?[]:{};return Hi(s,(o,a)=>{const l=e(o,r+1);!Fi(l)&&(i[a]=l)}),t[r]=void 0,i}}return s};return e(n,0)},Gk=on("AsyncFunction"),Yk=n=>n&&(Da(n)||Te(n))&&Te(n.then)&&Te(n.catch),tm=((n,t)=>n?setImmediate:t?((e,s)=>(Us.addEventListener("message",({source:r,data:i})=>{r===Us&&i===e&&s.length&&s.shift()()},!1),r=>{s.push(r),Us.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Te(Us.postMessage)),Wk=typeof queueMicrotask<"u"?queueMicrotask.bind(Us):typeof process<"u"&&process.nextTick||tm,D={isArray:kr,isArrayBuffer:Yp,isBuffer:uk,isFormData:wk,isArrayBufferView:hk,isString:dk,isNumber:Wp,isBoolean:fk,isObject:Da,isPlainObject:Ra,isReadableStream:vk,isRequest:Ck,isResponse:Sk,isHeaders:Ek,isUndefined:Fi,isDate:gk,isFile:pk,isBlob:mk,isRegExp:Bk,isFunction:Te,isStream:bk,isURLSearchParams:xk,isTypedArray:kk,isFileList:yk,forEach:Hi,merge:iu,extend:Mk,trim:Ok,stripBOM:Pk,inherits:Ak,toFlatObject:Tk,kindOf:_a,kindOfTest:on,endsWith:Nk,toArray:_k,forEachEntry:Dk,matchAll:Rk,isHTMLForm:Ik,hasOwnProperty:Xp,hasOwnProp:Xp,reduceDescriptors:Kp,freezeMethods:Vk,toObjectSet:jk,toCamelCase:Lk,noop:$k,toFiniteNumber:zk,findKey:qp,global:Us,isContextDefined:Jp,ALPHABET:Qp,generateString:Fk,isSpecCompliantForm:Hk,toJSONObject:Uk,isAsyncFn:Gk,isThenable:Yk,setImmediate:tm,asap:Wk};function at(n,t,e,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}D.inherits(at,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:D.toJSONObject(this.config),code:this.code,status:this.status}}});const em=at.prototype,nm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{nm[n]={value:n}}),Object.defineProperties(at,nm),Object.defineProperty(em,"isAxiosError",{value:!0}),at.from=(n,t,e,s,r,i)=>{const o=Object.create(em);return D.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),at.call(o,n.message,t,e,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const qk=null;function au(n){return D.isPlainObject(n)||D.isArray(n)}function sm(n){return D.endsWith(n,"[]")?n.slice(0,-2):n}function rm(n,t,e){return n?n.concat(t).map(function(r,i){return r=sm(r),!e&&i?"["+r+"]":r}).join(e?".":""):t}function Jk(n){return D.isArray(n)&&!n.some(au)}const Xk=D.toFlatObject(D,{},null,function(t){return/^is[A-Z]/.test(t)});function Ia(n,t,e){if(!D.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=D.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!D.isUndefined(y[m])});const s=e.metaTokens,r=e.visitor||h,i=e.dots,o=e.indexes,l=(e.Blob||typeof Blob<"u"&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(r))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(D.isDate(p))return p.toISOString();if(!l&&D.isBlob(p))throw new at("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(p)||D.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function h(p,m,y){let b=p;if(p&&!y&&typeof p=="object"){if(D.endsWith(m,"{}"))m=s?m:m.slice(0,-2),p=JSON.stringify(p);else if(D.isArray(p)&&Jk(p)||(D.isFileList(p)||D.endsWith(m,"[]"))&&(b=D.toArray(p)))return m=sm(m),b.forEach(function(x,v){!(D.isUndefined(x)||x===null)&&t.append(o===!0?rm([m],v,i):o===null?m:m+"[]",u(x))}),!1}return au(p)?!0:(t.append(rm(y,m,i),u(p)),!1)}const f=[],d=Object.assign(Xk,{defaultVisitor:h,convertValue:u,isVisitable:au});function g(p,m){if(!D.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(p),D.forEach(p,function(b,w){(!(D.isUndefined(b)||b===null)&&r.call(t,b,D.isString(w)?w.trim():w,m,d))===!0&&g(b,m?m.concat(w):[w])}),f.pop()}}if(!D.isObject(n))throw new TypeError("data must be an object");return g(n),t}function im(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function lu(n,t){this._pairs=[],n&&Ia(n,this,t)}const om=lu.prototype;om.append=function(t,e){this._pairs.push([t,e])},om.toString=function(t){const e=t?function(s){return t.call(this,s,im)}:im;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function Kk(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function am(n,t,e){if(!t)return n;const s=e&&e.encode||Kk,r=e&&e.serialize;let i;if(r?i=r(t,e):i=D.isURLSearchParams(t)?t.toString():new lu(t,e).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class lm{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){D.forEach(this.handlers,function(s){s!==null&&t(s)})}}const cm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Zk={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:lu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},cu=typeof window<"u"&&typeof document<"u",uu=typeof navigator=="object"&&navigator||void 0,Qk=cu&&(!uu||["ReactNative","NativeScript","NS"].indexOf(uu.product)<0),tD=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",eD=cu&&window.location.href||"http://localhost",Ce={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cu,hasStandardBrowserEnv:Qk,hasStandardBrowserWebWorkerEnv:tD,navigator:uu,origin:eD},Symbol.toStringTag,{value:"Module"})),...Zk};function nD(n,t){return Ia(n,new Ce.classes.URLSearchParams,Object.assign({visitor:function(e,s,r,i){return Ce.isNode&&D.isBuffer(e)?(this.append(s,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function sD(n){return D.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rD(n){const t={},e=Object.keys(n);let s;const r=e.length;let i;for(s=0;s<r;s++)i=e[s],t[i]=n[i];return t}function um(n){function t(e,s,r,i){let o=e[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=e.length;return o=!o&&D.isArray(r)?r.length:o,l?(D.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!D.isObject(r[o]))&&(r[o]=[]),t(e,s,r[o],i)&&D.isArray(r[o])&&(r[o]=rD(r[o])),!a)}if(D.isFormData(n)&&D.isFunction(n.entries)){const e={};return D.forEachEntry(n,(s,r)=>{t(sD(s),r,e,0)}),e}return null}function iD(n,t,e){if(D.isString(n))try{return(t||JSON.parse)(n),D.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const Ui={transitional:cm,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",r=s.indexOf("application/json")>-1,i=D.isObject(t);if(i&&D.isHTMLForm(t)&&(t=new FormData(t)),D.isFormData(t))return r?JSON.stringify(um(t)):t;if(D.isArrayBuffer(t)||D.isBuffer(t)||D.isStream(t)||D.isFile(t)||D.isBlob(t)||D.isReadableStream(t))return t;if(D.isArrayBufferView(t))return t.buffer;if(D.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return nD(t,this.formSerializer).toString();if((a=D.isFileList(t))||s.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ia(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),iD(t)):t}],transformResponse:[function(t){const e=this.transitional||Ui.transitional,s=e&&e.forcedJSONParsing,r=this.responseType==="json";if(D.isResponse(t)||D.isReadableStream(t))return t;if(t&&D.isString(t)&&(s&&!this.responseType||r)){const o=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?at.from(a,at.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ce.classes.FormData,Blob:Ce.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};D.forEach(["delete","get","head","post","put","patch"],n=>{Ui.headers[n]={}});const oD=D.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),aD=n=>{const t={};let e,s,r;return n&&n.split(`
|
|
30
|
+
`).forEach(function(o){r=o.indexOf(":"),e=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!e||t[e]&&oD[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},hm=Symbol("internals");function Gi(n){return n&&String(n).trim().toLowerCase()}function La(n){return n===!1||n==null?n:D.isArray(n)?n.map(La):String(n)}function lD(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const cD=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function hu(n,t,e,s,r){if(D.isFunction(s))return s.call(this,t,e);if(r&&(t=e),!!D.isString(t)){if(D.isString(s))return t.indexOf(s)!==-1;if(D.isRegExp(s))return s.test(t)}}function uD(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function hD(n,t){const e=D.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(r,i,o){return this[s].call(this,t,r,i,o)},configurable:!0})})}class Se{constructor(t){t&&this.set(t)}set(t,e,s){const r=this;function i(a,l,u){const h=Gi(l);if(!h)throw new Error("header name must be a non-empty string");const f=D.findKey(r,h);(!f||r[f]===void 0||u===!0||u===void 0&&r[f]!==!1)&&(r[f||l]=La(a))}const o=(a,l)=>D.forEach(a,(u,h)=>i(u,h,l));if(D.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(D.isString(t)&&(t=t.trim())&&!cD(t))o(aD(t),e);else if(D.isHeaders(t))for(const[a,l]of t.entries())i(l,a,s);else t!=null&&i(e,t,s);return this}get(t,e){if(t=Gi(t),t){const s=D.findKey(this,t);if(s){const r=this[s];if(!e)return r;if(e===!0)return lD(r);if(D.isFunction(e))return e.call(this,r,s);if(D.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Gi(t),t){const s=D.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||hu(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let r=!1;function i(o){if(o=Gi(o),o){const a=D.findKey(s,o);a&&(!e||hu(s,s[a],a,e))&&(delete s[a],r=!0)}}return D.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let s=e.length,r=!1;for(;s--;){const i=e[s];(!t||hu(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const e=this,s={};return D.forEach(this,(r,i)=>{const o=D.findKey(s,i);if(o){e[o]=La(r),delete e[i];return}const a=t?uD(i):String(i).trim();a!==i&&delete e[i],e[a]=La(r),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return D.forEach(this,(s,r)=>{s!=null&&s!==!1&&(e[r]=t&&D.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
31
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[hm]=this[hm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Gi(o);s[a]||(hD(r,o),s[a]=!0)}return D.isArray(t)?t.forEach(i):i(t),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.reduceDescriptors(Se.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),D.freezeMethods(Se);function du(n,t){const e=this||Ui,s=t||e,r=Se.from(s.headers);let i=s.data;return D.forEach(n,function(a){i=a.call(e,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function dm(n){return!!(n&&n.__CANCEL__)}function Dr(n,t,e){at.call(this,n??"canceled",at.ERR_CANCELED,t,e),this.name="CanceledError"}D.inherits(Dr,at,{__CANCEL__:!0});function fm(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new at("Request failed with status code "+e.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function dD(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function fD(n,t){n=n||10;const e=new Array(n),s=new Array(n);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),h=s[i];o||(o=u),e[r]=l,s[r]=u;let f=i,d=0;for(;f!==r;)d+=e[f++],f=f%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),u-o<t)return;const g=h&&u-h;return g?Math.round(d*1e3/g):void 0}}function gD(n,t){let e=0,s=1e3/t,r,i;const o=(u,h=Date.now())=>{e=h,r=null,i&&(clearTimeout(i),i=null),n.apply(null,u)};return[(...u)=>{const h=Date.now(),f=h-e;f>=s?o(u,h):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-f)))},()=>r&&o(r)]}const Ba=(n,t,e=3)=>{let s=0;const r=fD(50,250);return gD(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-s,u=r(l),h=o<=a;s=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&h?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};n(f)},e)},gm=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},pm=n=>(...t)=>D.asap(()=>n(...t)),pD=Ce.hasStandardBrowserEnv?function(){const t=Ce.navigator&&/(msie|trident)/i.test(Ce.navigator.userAgent),e=document.createElement("a");let s;function r(i){let o=i;return t&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return s=r(window.location.href),function(o){const a=D.isString(o)?r(o):o;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}(),mD=Ce.hasStandardBrowserEnv?{write(n,t,e,s,r,i){const o=[n+"="+encodeURIComponent(t)];D.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),D.isString(s)&&o.push("path="+s),D.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function yD(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function bD(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function mm(n,t){return n&&!yD(t)?bD(n,t):t}const ym=n=>n instanceof Se?{...n}:n;function Gs(n,t){t=t||{};const e={};function s(u,h,f){return D.isPlainObject(u)&&D.isPlainObject(h)?D.merge.call({caseless:f},u,h):D.isPlainObject(h)?D.merge({},h):D.isArray(h)?h.slice():h}function r(u,h,f){if(D.isUndefined(h)){if(!D.isUndefined(u))return s(void 0,u,f)}else return s(u,h,f)}function i(u,h){if(!D.isUndefined(h))return s(void 0,h)}function o(u,h){if(D.isUndefined(h)){if(!D.isUndefined(u))return s(void 0,u)}else return s(void 0,h)}function a(u,h,f){if(f in t)return s(u,h);if(f in n)return s(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,h)=>r(ym(u),ym(h),!0)};return D.forEach(Object.keys(Object.assign({},n,t)),function(h){const f=l[h]||r,d=f(n[h],t[h],h);D.isUndefined(d)&&f!==a||(e[h]=d)}),e}const bm=n=>{const t=Gs({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=Se.from(o),t.url=am(mm(t.baseURL,t.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(D.isFormData(e)){if(Ce.hasStandardBrowserEnv||Ce.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...h]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...h].join("; "))}}if(Ce.hasStandardBrowserEnv&&(s&&D.isFunction(s)&&(s=s(t)),s||s!==!1&&pD(t.url))){const u=r&&i&&mD.read(i);u&&o.set(r,u)}return t},wD=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const r=bm(n);let i=r.data;const o=Se.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=r,h,f,d,g,p;function m(){g&&g(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(h),r.signal&&r.signal.removeEventListener("abort",h)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function b(){if(!y)return;const x=Se.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};fm(function(C){e(C),m()},function(C){s(C),m()},S),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(s(new at("Request aborted",at.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new at("Network Error",at.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const S=r.transitional||cm;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),s(new at(v,S.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&D.forEach(o.toJSON(),function(v,S){y.setRequestHeader(S,v)}),D.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([d,p]=Ba(u,!0),y.addEventListener("progress",d)),l&&y.upload&&([f,g]=Ba(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(h=x=>{y&&(s(!x||x.type?new Dr(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(h),r.signal&&(r.signal.aborted?h():r.signal.addEventListener("abort",h)));const w=dD(r.url);if(w&&Ce.protocols.indexOf(w)===-1){s(new at("Unsupported protocol "+w+":",at.ERR_BAD_REQUEST,n));return}y.send(i||null)})},xD=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,r;const i=function(u){if(!r){r=!0,a();const h=u instanceof Error?u:this.reason;s.abort(h instanceof at?h:new Dr(h instanceof Error?h.message:h))}};let o=t&&setTimeout(()=>{o=null,i(new at(`timeout ${t} of ms exceeded`,at.ETIMEDOUT))},t);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),n=null)};n.forEach(u=>u.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>D.asap(a),l}},vD=function*(n,t){let e=n.byteLength;if(e<t){yield n;return}let s=0,r;for(;s<e;)r=s+t,yield n.slice(s,r),s=r},CD=async function*(n,t){for await(const e of SD(n))yield*vD(e,t)},SD=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},wm=(n,t,e,s)=>{const r=CD(n,t);let i=0,o,a=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await r.next();if(u){a(),l.close();return}let f=h.byteLength;if(e){let d=i+=f;e(d)}l.enqueue(new Uint8Array(h))}catch(u){throw a(u),u}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},Va=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",xm=Va&&typeof ReadableStream=="function",ED=Va&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),vm=(n,...t)=>{try{return!!n(...t)}catch{return!1}},OD=xm&&vm(()=>{let n=!1;const t=new Request(Ce.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Cm=64*1024,fu=xm&&vm(()=>D.isReadableStream(new Response("").body)),ja={stream:fu&&(n=>n.body)};Va&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ja[t]&&(ja[t]=D.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new at(`Response type '${t}' is not supported`,at.ERR_NOT_SUPPORT,s)})})})(new Response);const MD=async n=>{if(n==null)return 0;if(D.isBlob(n))return n.size;if(D.isSpecCompliantForm(n))return(await new Request(Ce.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(D.isArrayBufferView(n)||D.isArrayBuffer(n))return n.byteLength;if(D.isURLSearchParams(n)&&(n=n+""),D.isString(n))return(await ED(n)).byteLength},PD=async(n,t)=>{const e=D.toFiniteNumber(n.getContentLength());return e??MD(t)},gu={http:qk,xhr:wD,fetch:Va&&(async n=>{let{url:t,method:e,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:h,withCredentials:f="same-origin",fetchOptions:d}=bm(n);u=u?(u+"").toLowerCase():"text";let g=xD([r,i&&i.toAbortSignal()],o),p;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let y;try{if(l&&OD&&e!=="get"&&e!=="head"&&(y=await PD(h,s))!==0){let S=new Request(t,{method:"POST",body:s,duplex:"half"}),E;if(D.isFormData(s)&&(E=S.headers.get("content-type"))&&h.setContentType(E),S.body){const[C,M]=gm(y,Ba(pm(l)));s=wm(S.body,Cm,C,M)}}D.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;p=new Request(t,{...d,signal:g,method:e.toUpperCase(),headers:h.normalize().toJSON(),body:s,duplex:"half",credentials:b?f:void 0});let w=await fetch(p);const x=fu&&(u==="stream"||u==="response");if(fu&&(a||x&&m)){const S={};["status","statusText","headers"].forEach(T=>{S[T]=w[T]});const E=D.toFiniteNumber(w.headers.get("content-length")),[C,M]=a&&gm(E,Ba(pm(a),!0))||[];w=new Response(wm(w.body,Cm,C,()=>{M&&M(),m&&m()}),S)}u=u||"text";let v=await ja[D.findKey(ja,u)||"text"](w,n);return!x&&m&&m(),await new Promise((S,E)=>{fm(S,E,{data:v,headers:Se.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:p})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new at("Network Error",at.ERR_NETWORK,n,p),{cause:b.cause||b}):at.from(b,b&&b.code,n,p)}})};D.forEach(gu,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Sm=n=>`- ${n}`,AD=n=>D.isFunction(n)||n===null||n===!1,Em={getAdapter:n=>{n=D.isArray(n)?n:[n];const{length:t}=n;let e,s;const r={};for(let i=0;i<t;i++){e=n[i];let o;if(s=e,!AD(e)&&(s=gu[(o=String(e)).toLowerCase()],s===void 0))throw new at(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
32
32
|
`+i.map(Sm).join(`
|
|
33
|
-
`):" "+Sm(i[0]):"as no adapter specified";throw new at("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:
|
|
34
|
-
`+i):s.stack=i}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Gs(this.defaults,e);const{transitional:s,paramsSerializer:r,headers:i}=e;s!==void 0&&bu.assertOptions(s,{silentJSONParsing:us.transitional(us.boolean),forcedJSONParsing:us.transitional(us.boolean),clarifyTimeoutError:us.transitional(us.boolean)},!1),r!=null&&(R.isFunction(r)?e.paramsSerializer={serialize:r}:bu.assertOptions(r,{encode:us.function,serialize:us.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=i&&R.merge(i.common,i[e.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),e.headers=Se.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(e)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let h,f=0,d;if(!l){const p=[Om.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,u),d=p.length,h=Promise.resolve(e);f<d;)h=h.then(p[f++],p[f++]);return h}d=a.length;let g=e;for(f=0;f<d;){const p=a[f++],m=a[f++];try{g=p(g)}catch(y){m.call(this,y);break}}try{h=Om.call(this,g)}catch(p){return Promise.reject(p)}for(f=0,d=u.length;f<d;)h=h.then(u[f++],u[f++]);return h}getUri(t){t=Gs(this.defaults,t);const e=mm(t.baseURL,t.url);return am(e,t.params,t.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(t){Ys.prototype[t]=function(e,s){return this.request(Gs(s||{},{method:t,url:e,data:(s||{}).data}))}}),R.forEach(["post","put","patch"],function(t){function e(s){return function(i,o,a){return this.request(Gs(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Ys.prototype[t]=e(),Ys.prototype[t+"Form"]=e(!0)});class wu{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(i){e=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,a){s.reason||(s.reason=new Dr(i,o,a),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new wu(function(r){t=r}),cancel:t}}}function TD(n){return function(e){return n.apply(null,e)}}function ND(n){return R.isObject(n)&&n.isAxiosError===!0}const xu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(xu).forEach(([n,t])=>{xu[t]=n});function Am(n){const t=new Ys(n),e=Gp(Ys.prototype.request,t);return R.extend(e,Ys.prototype,t,{allOwnKeys:!0}),R.extend(e,t,null,{allOwnKeys:!0}),e.create=function(r){return Am(Gs(n,r))},e}const Wt=Am(Ui);Wt.Axios=Ys,Wt.CanceledError=Dr,Wt.CancelToken=wu,Wt.isCancel=dm,Wt.VERSION=Mm,Wt.toFormData=Ia,Wt.AxiosError=at,Wt.Cancel=Wt.CanceledError,Wt.all=function(t){return Promise.all(t)},Wt.spread=TD,Wt.isAxiosError=ND,Wt.mergeConfig=Gs,Wt.AxiosHeaders=Se,Wt.formToJSON=n=>um(R.isHTMLForm(n)?new FormData(n):n),Wt.getAdapter=Em.getAdapter,Wt.HttpStatusCode=xu,Wt.default=Wt;const hs=Wt.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),_D=n=>{hs.defaults.baseURL=n},kD=n=>{hs.interceptors.request.use(t=>{if(n)return t.headers.token=n,t},t=>Promise.reject(t))};hs.interceptors.response.use(n=>(n.data.isOk=n.data.code===200,n.data),n=>{if(n.response)switch(n.response.status){}return Promise.reject(n)});const Yi=(n,t={})=>hs.get(n,{params:t}),$a=(n,t={})=>hs.post(n,t),Tm=(n,t={})=>hs.delete(n,{params:t}),DD=(n,t={})=>hs.post(n,t,{headers:{"Content-Type":"multipart/form-data"}}),Wi=(n,t)=>{const e=document.querySelector(n),s=e.querySelectorAll(".x6-port-body"),r=e.querySelectorAll(".x6-port-label");for(let i=0,o=s.length;i<o;i+=1)s[i].style.visibility=t?"visible":"hidden";for(let i=0,o=r.length;i<o;i+=1)r[i].style.visibility=t?"visible":"hidden"},Nm=n=>Yi("/cny/template/selectOne",{id:n}).then(t=>{if(t!=null&&t.isOk){const e=JSON.parse(t.data.remark);return{background:e.background,grid:e.grid,data:e.data}}else Bt.error((t==null?void 0:t.msg)||"获取失败")}),RD=n=>$a("/cny/custom/arrRealData",n).then(t=>{if(t!=null&&t.isOk)return t.data;Bt.error((t==null?void 0:t.msg)||"获取失败")}),_m={color:"#000000"},km={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},ID={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},za={position:"absolute",args:{x:0,y:0},attrs:{text:{fill:"#5174ff",fontSize:8},circle:{magnet:!0,stroke:"#5174ff",r:4}},label:{position:"top"}},LD={shape:"rect",label:"文本",width:50,height:30,attrs:{body:{fill:"#00000000",stroke:"#00000000",strokeWidth:1,rx:6,ry:6},text:{fill:"#ffffff"},label:{textAnchor:"start",x:-14,y:0}},data:{type:"text",content:"文本",field:[]},ports:{groups:{ports:{portOption:za}}}},vu={line:{stroke:"#ffffff",strokeWidth:1,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}},ports:{groups:{ports:{portOption:za}}}},Gn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},BD={class:"control"},VD={class:"row-column"},jD=Gn({__name:"index",props:{payload:Object},setup(n){var d,g,p,m,y,b,w,x,v,S,E,C,M,T,k,_,D,N,j,A,P;const t=n;console.log(t.payload.value.options.grid);const e=c.ref(((d=t.payload.value.options.background)==null?void 0:d.color)||null),s=c.ref(((p=(g=t.payload.value.options)==null?void 0:g.grid)==null?void 0:p.visible)||null),r=c.ref(((y=(m=t.payload.value.options)==null?void 0:m.grid)==null?void 0:y.size)||10),i=c.ref(((v=(x=(w=(b=t.payload.value.options)==null?void 0:b.grid)==null?void 0:w.args)==null?void 0:x[0])==null?void 0:v.color)||null),o=c.ref(((M=(C=(E=(S=t.payload.value.options)==null?void 0:S.grid)==null?void 0:E.args)==null?void 0:C[0])==null?void 0:M.thickness)||1),a=c.ref(((D=(_=(k=(T=t.payload.value.options)==null?void 0:T.grid)==null?void 0:k.args)==null?void 0:_[1])==null?void 0:D.color)||null),l=c.ref(((P=(A=(j=(N=t.payload.value.options)==null?void 0:N.grid)==null?void 0:j.args)==null?void 0:A[1])==null?void 0:P.thickness)||1),u=c.ref("1"),h=L=>{t.payload.value.drawBackground({color:L})},f=()=>{t.payload.value.drawGrid({visible:s.value,size:r.value,type:"doubleMesh",args:[{color:i.value,thickness:o.value},{color:a.value,thickness:l.value}]})};return(L,V)=>{const Y=c.resolveComponent("el-col"),ot=c.resolveComponent("el-color-picker"),F=c.resolveComponent("el-row"),H=c.resolveComponent("el-switch"),B=c.resolveComponent("el-input-number"),K=c.resolveComponent("el-collapse-item"),nt=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",BD,[c.createVNode(nt,{modelValue:u.value,"onUpdate:modelValue":V[7]||(V[7]=rt=>u.value=rt),accordion:""},{default:c.withCtx(()=>[c.createVNode(K,{title:"基础属性",name:"1"},{default:c.withCtx(()=>[c.createElementVNode("div",VD,[c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[8]||(V[8]=[c.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(ot,{modelValue:e.value,"onUpdate:modelValue":V[0]||(V[0]=rt=>e.value=rt),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[9]||(V[9]=[c.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(H,{modelValue:s.value,"onUpdate:modelValue":V[1]||(V[1]=rt=>s.value=rt),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[10]||(V[10]=[c.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(B,{modelValue:r.value,"onUpdate:modelValue":V[2]||(V[2]=rt=>r.value=rt),min:1,max:20,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[11]||(V[11]=[c.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(ot,{modelValue:i.value,"onUpdate:modelValue":V[3]||(V[3]=rt=>i.value=rt),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[12]||(V[12]=[c.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(ot,{modelValue:a.value,"onUpdate:modelValue":V[4]||(V[4]=rt=>a.value=rt),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[13]||(V[13]=[c.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(B,{modelValue:o.value,"onUpdate:modelValue":V[5]||(V[5]=rt=>o.value=rt),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>V[14]||(V[14]=[c.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(B,{modelValue:l.value,"onUpdate:modelValue":V[6]||(V[6]=rt=>l.value=rt),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-270b8aa5"]]),$D={class:"control"},zD={class:"row-column"},FD={class:"row-column"},Dm=Gn(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object},setup(n){var V,Y,ot,F;const t=n,e=c.ref((V=t.payload.attrs.label)!=null&&V.textAnchor?"0":"1"),s=c.ref([]),r=c.ref([]),i=()=>{Yi("/cny/custom/deviceList").then(H=>{s.value=H.data})},o=c.ref();let a=c.reactive({});const l=()=>{a=s.value.find(H=>H.deviceCode===o.value),a&&u()},u=()=>{Yi("/cny/custom/monitorInfo",{deviceCode:a.deviceCode,fieldType:1}).then(H=>{r.value=H.data})},h=/\$\{(.*?)\}/g,f=H=>H.replace(h,"--"),d=H=>{ak.confirm(`是否确定要添加${a.deviceName}-${H.name}?
|
|
35
|
-
添加后为:--${H.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const B=H.unit??"",K=t.payload.data.content;t.payload.data.content=g.value=K+"${"+a.deviceName+"."+H.name+"}"+B;const nt=K.match(h),rt=(nt==null?void 0:nt.length)||0;t.payload.data.field.push({index:rt,deviceName:a.deviceName,deviceCode:a.deviceCode,field:H.dataField}),t.payload.label=f(t.payload.data.content),console.log("label:",t.payload.label,"content:",t.payload.data.content,"field:",t.payload.data.field)})},g=c.ref(t.payload.data.content||null),p=c.ref(t.payload.attrs.body.fill||null),m=c.ref(t.payload.attrs.body.stroke||null),y=c.ref(t.payload.attrs.body.strokeWidth||null),b=c.ref(t.payload.attrs.body.rx||null),w=c.ref(t.payload.attrs.body.ry||null),x=c.ref(t.payload.attrs.text.fill||null),v=c.ref(t.payload.attrs.text.fontSize||null),S=c.ref(((Y=t.payload.attrs.label)==null?void 0:Y.textAnchor)||null),E=c.ref(((ot=t.payload.attrs.label)==null?void 0:ot.x)||null),C=c.ref(((F=t.payload.attrs.label)==null?void 0:F.y)||null),M=()=>{t.payload.attr("body/fill",p.value),t.payload.attr("body/stroke",m.value),t.payload.attr("body/strokeWidth",y.value),t.payload.attr("body/rx",b.value),t.payload.attr("body/ry",w.value),t.payload.attr("text/fill",x.value),t.payload.attr("text/fontSize",v.value),t.payload.attr("label/textAnchor",S.value),t.payload.attr("label/x",E.value),t.payload.attr("label/y",C.value)},T=c.ref(null),k=()=>{if(t.payload.data.content.length>g.value.length&&t.payload.data.content.endsWith("}")){const H=t.payload.data.content.match(h);if(H){const B=H.length-1;t.payload.data.field.splice(B,1),g.value=t.payload.data.content.substring(0,t.payload.data.content.lastIndexOf("${"))}}t.payload.data.content=g.value,t.payload.label=f(g.value)},_=()=>{if(T.value){const H=T.value.$refs.textarea;H.focus();const B=g.value.length;H.setSelectionRange(B,B)}},D=c.ref([]),N=()=>{D.value=JSON.parse(JSON.stringify(t.payload.getPorts().map(H=>({id:H.id,attrs:H.attrs,args:{x:Number(H.args.x.replace("%","")),y:Number(H.args.y.replace("%",""))}}))))},j=()=>{const H=za;H.attrs.text.text=`${t.payload.getPorts().length+1}`,H.args.x="50%",H.args.y="50%",t.payload.addPorts([{group:"ports",...H}]),N()},A=()=>{Wi("#drawing-board",!0)},P=(H,B,K)=>{t.payload.portProp(H,"args/"+B,K+"%"),N()},L=H=>{t.payload.removePort(H),N()};return c.onMounted(()=>{N(),i(),document.addEventListener("selectionchange",()=>{document.activeElement.tagName==="TEXTAREA"&&_()})}),(H,B)=>{const K=c.resolveComponent("el-input"),nt=c.resolveComponent("el-alert"),rt=c.resolveComponent("el-option"),et=c.resolveComponent("el-select"),ft=c.resolveComponent("el-table-column"),ge=c.resolveComponent("el-table"),St=c.resolveComponent("el-collapse-item"),xt=c.resolveComponent("el-col"),An=c.resolveComponent("el-color-picker"),pe=c.resolveComponent("el-row"),dn=c.resolveComponent("el-input-number"),Ts=c.resolveComponent("el-button"),Ns=c.resolveComponent("el-slider"),ai=c.resolveComponent("el-icon"),li=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",$D,[c.createVNode(li,{modelValue:e.value,"onUpdate:modelValue":B[12]||(B[12]=st=>e.value=st),accordion:""},{default:c.withCtx(()=>[n.payload.data.type==="text"?(c.openBlock(),c.createBlock(St,{key:0,title:"文本内容",name:"0"},{default:c.withCtx(()=>[c.createVNode(K,{ref_key:"inputRef",ref:T,type:"textarea",modelValue:g.value,"onUpdate:modelValue":B[0]||(B[0]=st=>g.value=st),onInput:k,onFocus:_,rows:10},null,8,["modelValue"]),c.createVNode(nt,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),c.createVNode(et,{modelValue:o.value,"onUpdate:modelValue":B[1]||(B[1]=st=>o.value=st),placeholder:"请选择设备",onChange:l,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,st=>(c.openBlock(),c.createBlock(rt,{key:st.deviceCode,label:st.deviceName,value:st.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),c.createVNode(ge,{data:r.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:d},{default:c.withCtx(()=>[c.createVNode(ft,{type:"index",label:"序号",width:"50",align:"center"}),c.createVNode(ft,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),c.createVNode(ft,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),c.createVNode(ft,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):c.createCommentVNode("",!0),c.createVNode(St,{title:"图形设置",name:"1"},{default:c.withCtx(()=>[c.createElementVNode("div",zD,[c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[13]||(B[13]=[c.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(An,{modelValue:p.value,"onUpdate:modelValue":B[2]||(B[2]=st=>p.value=st),"show-alpha":!0,size:"small",onChange:M},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[14]||(B[14]=[c.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(An,{modelValue:m.value,"onUpdate:modelValue":B[3]||(B[3]=st=>m.value=st),"show-alpha":!0,size:"small",onChange:M},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[15]||(B[15]=[c.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:y.value,"onUpdate:modelValue":B[4]||(B[4]=st=>y.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[16]||(B[16]=[c.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:b.value,"onUpdate:modelValue":B[5]||(B[5]=st=>b.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[17]||(B[17]=[c.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:w.value,"onUpdate:modelValue":B[6]||(B[6]=st=>w.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(c.openBlock(),c.createBlock(St,{key:1,title:"文字设置",name:"2"},{default:c.withCtx(()=>[c.createElementVNode("div",FD,[c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[18]||(B[18]=[c.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(An,{modelValue:x.value,"onUpdate:modelValue":B[7]||(B[7]=st=>x.value=st),"show-alpha":!0,size:"small",onChange:M},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[19]||(B[19]=[c.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:v.value,"onUpdate:modelValue":B[8]||(B[8]=st=>v.value=st),size:"small","controls-position":"right",onChange:M,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[20]||(B[20]=[c.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(et,{modelValue:S.value,"onUpdate:modelValue":B[9]||(B[9]=st=>S.value=st),size:"small",onChange:M},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(["start","middle","end"],st=>c.createVNode(rt,{key:st,label:st,value:st},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[21]||(B[21]=[c.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:E.value,"onUpdate:modelValue":B[10]||(B[10]=st=>E.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>B[22]||(B[22]=[c.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:C.value,"onUpdate:modelValue":B[11]||(B[11]=st=>C.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):c.createCommentVNode("",!0),c.createVNode(St,{title:"连接桩设置",name:"3"},{default:c.withCtx(()=>[c.createVNode(Ts,{type:"primary",onClick:j,size:"small"},{default:c.withCtx(()=>B[23]||(B[23]=[c.createTextVNode("添加连接桩")])),_:1}),c.createVNode(Ts,{type:"primary",onClick:A,size:"small"},{default:c.withCtx(()=>B[24]||(B[24]=[c.createTextVNode("显示连接桩")])),_:1}),c.createVNode(ge,{data:D.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:c.withCtx(()=>[c.createVNode(ft,{label:"ID",width:"50",align:"center"},{default:c.withCtx(({row:st})=>[c.createTextVNode(c.toDisplayString(st.attrs.text.text),1)]),_:1}),c.createVNode(ft,{label:"x",width:"100",align:"center"},{default:c.withCtx(({row:st})=>[c.createVNode(Ns,{modelValue:st.args.x,"onUpdate:modelValue":ie=>st.args.x=ie,min:0,max:100,step:1,onInput:ie=>P(st.id,"x",ie)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(ft,{label:"y",width:"100",align:"center"},{default:c.withCtx(({row:st})=>[c.createVNode(Ns,{modelValue:st.args.y,"onUpdate:modelValue":ie=>st.args.y=ie,min:0,max:100,step:1,onInput:ie=>P(st.id,"y",ie)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(ft,{label:"操作",align:"center"},{default:c.withCtx(({row:st})=>[c.createVNode(Ts,{type:"danger",size:"small",onClick:ie=>L(st.id)},{default:c.withCtx(()=>[c.createVNode(ai,null,{default:c.withCtx(()=>[c.createVNode(c.unref(wg))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-764721f9"]]),HD={class:"container"},UD={class:"row-column"},GD={class:"row-column"},YD={class:"row-column"},WD=Gn({__name:"index",props:{payload:Object},setup(n){var l,u,h,f;const t=n,e=c.ref(t.payload.attrs.line.stroke),s=c.reactive({name:((l=t.payload.attrs.line.sourceMarker)==null?void 0:l.name)??null,args:((u=t.payload.attrs.line.sourceMarker)==null?void 0:u.args)??{}}),r=c.reactive({name:((h=t.payload.attrs.line.targetMarker)==null?void 0:h.name)??null,args:((f=t.payload.attrs.line.targetMarker)==null?void 0:f.args)??{}}),i=[{label:"Block",value:"block"},{label:"Classic",value:"classic"},{label:"Diamond",value:"diamond"},{label:"Cross",value:"cross"},{label:"Async",value:"async"},{label:"Circle",value:"circle"},{label:"CirclePlus",value:"circlePlus"},{label:"Ellipse",value:"ellipse"}],o=c.ref("0"),a=()=>{t.payload.attr("line/stroke",e.value),t.payload.attr("line/sourceMarker/name",s.name),t.payload.attr("line/sourceMarker/args",s.args),t.payload.attr("line/targetMarker/name",r.name),t.payload.attr("line/targetMarker/args",r.args),vu.line=t.payload.attrs.line};return(d,g)=>{const p=c.resolveComponent("el-col"),m=c.resolveComponent("el-color-picker"),y=c.resolveComponent("el-row"),b=c.resolveComponent("el-collapse-item"),w=c.resolveComponent("el-option"),x=c.resolveComponent("el-select"),v=c.resolveComponent("el-input-number"),S=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",HD,[c.createVNode(S,{modelValue:o.value,"onUpdate:modelValue":g[9]||(g[9]=E=>o.value=E),accordion:""},{default:c.withCtx(()=>[c.createVNode(b,{title:"线段设置",name:"0"},{default:c.withCtx(()=>[c.createElementVNode("div",UD,[c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[10]||(g[10]=[c.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(m,{modelValue:e.value,"onUpdate:modelValue":g[0]||(g[0]=E=>e.value=E),"show-alpha":!0,size:"small",onChange:a},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),c.createVNode(b,{title:"箭头1设置",name:"1"},{default:c.withCtx(()=>[c.createElementVNode("div",GD,[c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[11]||(g[11]=[c.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(x,{modelValue:s.name,"onUpdate:modelValue":g[1]||(g[1]=E=>s.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,E=>c.createVNode(w,{key:E.value,label:E.label,value:E.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[12]||(g[12]=[c.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:s.args.width,"onUpdate:modelValue":g[2]||(g[2]=E=>s.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[13]||(g[13]=[c.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:s.args.height,"onUpdate:modelValue":g[3]||(g[3]=E=>s.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[14]||(g[14]=[c.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:s.args.offset,"onUpdate:modelValue":g[4]||(g[4]=E=>s.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),c.createVNode(b,{title:"箭头2设置",name:"2"},{default:c.withCtx(()=>[c.createElementVNode("div",YD,[c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[15]||(g[15]=[c.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(x,{modelValue:r.name,"onUpdate:modelValue":g[5]||(g[5]=E=>r.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,E=>c.createVNode(w,{key:E.value,label:E.label,value:E.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[16]||(g[16]=[c.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:r.args.width,"onUpdate:modelValue":g[6]||(g[6]=E=>r.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[17]||(g[17]=[c.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:r.args.height,"onUpdate:modelValue":g[7]||(g[7]=E=>r.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[18]||(g[18]=[c.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:r.args.offset,"onUpdate:modelValue":g[8]||(g[8]=E=>r.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-19905aaf"]]),qD={class:"form-container"},JD=Gn({__name:"Shortcuts",setup(n){const t=c.ref([{name:"复制",windowsKey:"Ctrl + C",macKey:"Command + C"},{name:"粘贴",windowsKey:"Ctrl + V",macKey:"Command + V"},{name:"撤销",windowsKey:"Ctrl + Z",macKey:"Command + Z"},{name:"重做",windowsKey:"Ctrl + Y",macKey:"Command + Y"},{name:"框选",windowsKey:"Alt + LMB",macKey:"option + LMB"},{name:"多选",windowsKey:"Alt + LMB",macKey:"Command + LMB"}]);return(e,s)=>{const r=c.resolveComponent("el-table-column"),i=c.resolveComponent("el-table");return c.openBlock(),c.createElementBlock("div",qD,[c.createVNode(i,{data:t.value,size:"small",border:""},{default:c.withCtx(()=>[c.createVNode(r,{prop:"name",label:"名称"}),c.createVNode(r,{prop:"windowsKey",label:"windows"}),c.createVNode(r,{prop:"macKey",label:"mac"})]),_:1},8,["data"])])}}},[["__scopeId","data-v-99982d47"]]);typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&function(n){n.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){const s=document.createDocumentFragment();e.forEach(r=>{const i=r instanceof Node;s.appendChild(i?r:document.createTextNode(String(r)))}),this.appendChild(s)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class ye{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function t(){return(e,s,r)=>{const i=r.value,o=e.__proto__;r.value=function(...a){this.disposed||(i.call(this,...a),o.dispose.call(this))}}}n.dispose=t})(ye||(ye={}));class Rm{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(t=>{t.dispose()}),this.items.clear())}contains(t){return this.items.has(t)}add(t){this.items.add(t)}remove(t){this.items.delete(t)}clear(){this.items.clear()}}(function(n){function t(e){const s=new n;return e.forEach(r=>{s.add(r)}),s}n.from=t})(Rm||(Rm={}));function Im(n,t,e){if(e)switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2]);case 4:return n.call(t,e[0],e[1],e[2],e[3]);case 5:return n.call(t,e[0],e[1],e[2],e[3],e[4]);case 6:return n.call(t,e[0],e[1],e[2],e[3],e[4],e[5]);default:return n.apply(t,e)}return n.call(t)}function X(n,t,...e){return Im(n,t,e)}function XD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Cu(n){return n!=null&&(n instanceof Promise||XD(n))}function Su(...n){const t=[];if(n.forEach(s=>{Array.isArray(s)?t.push(...s):t.push(s)}),t.some(s=>Cu(s))){const s=t.map(r=>Cu(r)?r:Promise.resolve(r!==!1));return Promise.all(s).then(r=>r.reduce((i,o)=>o!==!1&&i,!0))}return t.every(s=>s!==!1)}function KD(...n){const t=Su(n);return typeof t=="boolean"?Promise.resolve(t):t}function Eu(n,t){const e=[];for(let s=0;s<n.length;s+=2){const r=n[s],i=n[s+1],o=Array.isArray(t)?t:[t],a=Im(r,i,o);e.push(a)}return Su(e)}class ZD{constructor(){this.listeners={}}on(t,e,s){return e==null?this:(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,s),this)}once(t,e,s){const r=(...i)=>(this.off(t,r),Eu([e,s],i));return this.on(t,r,this)}off(t,e,s){if(!(t||e||s))return this.listeners={},this;const r=this.listeners;return(t?[t]:Object.keys(r)).forEach(o=>{const a=r[o];if(a){if(!(e||s)){delete r[o];return}for(let l=a.length-2;l>=0;l-=2)e&&a[l]!==e||s&&a[l+1]!==s||a.splice(l,2)}}),this}trigger(t,...e){let s=!0;if(t!=="*"){const i=this.listeners[t];i!=null&&(s=Eu([...i],e))}const r=this.listeners["*"];return r!=null?Su([s,Eu([...r],[t,...e])]):s}emit(t,...e){return this.trigger(t,...e)}}function QD(n,...t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(e.prototype,s))})})}const tR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])};function eR(n,t){tR(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}class nR{}const sR=/^\s*class\s+/.test(`${nR}`)||/^\s*class\s*\{/.test(`${class{}}`);function Ou(n,t){let e;return sR?e=class extends t{}:(e=function(){return t.apply(this,arguments)},eR(e,t)),Object.defineProperty(e,"name",{value:n}),e}function Lm(n){return n==="__proto__"}function Mu(n,t,e="/"){let s;const r=Array.isArray(t)?t:t.split(e);if(r.length)for(s=n;r.length;){const i=r.shift();if(Object(s)===s&&i&&i in s)s=s[i];else return}return s}function Rr(n,t,e,s="/"){const r=Array.isArray(t)?t:t.split(s),i=r.pop();if(i&&!Lm(i)){let o=n;r.forEach(a=>{Lm(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=e}return n}function Bm(n,t,e="/"){const s=Array.isArray(t)?t.slice():t.split(e),r=s.pop();if(r)if(s.length>0){const i=Mu(n,s);i&&delete i[r]}else delete n[r];return n}var rR=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Nt extends ZD{dispose(){this.off()}}rR([ye.dispose()],Nt.prototype,"dispose",null),function(n){n.dispose=ye.dispose}(Nt||(Nt={})),QD(Nt,ye);const Vm=n=>{const t=Object.create(null);return e=>t[e]||(t[e]=n(e))},jm=Vm(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Pu=Vm(n=>C2(na(n)).replace(/ /g,""));function Au(n){let t=2166136261,e=!1,s=n;for(let r=0,i=s.length;r<i;r+=1){let o=s.charCodeAt(r);o>127&&!e&&(s=unescape(encodeURIComponent(s)),o=s.charCodeAt(r),e=!0),t^=o,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function Fa(){let n="";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let e=0,s=t.length;e<s;e+=1){const r=t[e],i=Math.random()*16|0,o=r==="x"?i:r==="y"?i&3|8:r;n+=o.toString(16)}return n}function iR(n,t,e){const s=Math.min(2,Math.floor(n.length*.34));let r=Math.floor(n.length*.4)+1,i,o=!1;const a=n.toLowerCase();for(const l of t){const u=e(l);if(u!==void 0&&Math.abs(u.length-a.length)<=s){const h=u.toLowerCase();if(h===a){if(u===n)continue;return l}if(o||u.length<3)continue;const f=oR(a,h,r-1);if(f===void 0)continue;f<3?(o=!0,i=l):(r=f,i=l)}}return i}function oR(n,t,e){let s=new Array(t.length+1),r=new Array(t.length+1);const i=e+1;for(let a=0;a<=t.length;a+=1)s[a]=a;for(let a=1;a<=n.length;a+=1){const l=n.charCodeAt(a-1),u=a>e?a-e:1,h=t.length>e+a?e+a:t.length;r[0]=a;let f=a;for(let g=1;g<u;g+=1)r[g]=i;for(let g=u;g<=h;g+=1){const p=l===t.charCodeAt(g-1)?s[g-1]:Math.min(s[g]+1,r[g-1]+1,s[g-1]+2);r[g]=p,f=Math.min(f,p)}for(let g=h+1;g<=t.length;g+=1)r[g]=i;if(f>e)return;const d=s;s=r,r=d}const o=s[t.length];return o>e?void 0:o}function Yn(n){return typeof n=="string"&&n.slice(-1)==="%"}function an(n,t){if(n==null)return 0;let e;if(typeof n=="string"){if(e=parseFloat(n),Yn(n)&&(e/=100,Number.isFinite(e)))return e*t}else e=n;return Number.isFinite(e)?e>0&&e<1?e*t:e:0}function ds(n){if(typeof n=="object"){let e=0,s=0,r=0,i=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(s=i=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(r=e=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(e=n.left),n.top!=null&&Number.isFinite(n.top)&&(s=n.top),n.right!=null&&Number.isFinite(n.right)&&(r=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(i=n.bottom),{top:s,right:r,bottom:i,left:e}}let t=0;return n!=null&&Number.isFinite(n)&&(t=n),{top:t,right:t,bottom:t,left:t}}let Tu=!1,$m=!1,zm=!1,Fm=!1,Hm=!1,Um=!1,Gm=!1,Ym=!1,Wm=!1,qm=!1,Jm=!1,Xm=!1,Km=!1,Zm=!1,Qm=!1,ty=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Tu=n.indexOf("Macintosh")>=0,$m=!!n.match(/(iPad|iPhone|iPod)/g),zm=n.indexOf("Windows")>=0,Fm=n.indexOf("MSIE")>=0,Hm=!!n.match(/Trident\/7\./),Um=!!n.match(/Edge\//),Gm=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,Wm=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,qm=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,Jm=n.indexOf("Firefox/")>=0,Xm=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(ty=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Ym=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,Zm=window.PointerEvent!=null&&!Tu),typeof document=="object"){Km="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){Qm=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},n)}catch{}}var fs;(function(n){n.IS_MAC=Tu,n.IS_IOS=$m,n.IS_WINDOWS=zm,n.IS_IE=Fm,n.IS_IE11=Hm,n.IS_EDGE=Um,n.IS_NETSCAPE=Gm,n.IS_CHROME_APP=Ym,n.IS_CHROME=Wm,n.IS_OPERA=qm,n.IS_FIREFOX=Jm,n.IS_SAFARI=Xm,n.SUPPORT_TOUCH=Km,n.SUPPORT_POINTER=Zm,n.SUPPORT_PASSIVE=Qm,n.NO_FOREIGNOBJECT=ty,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(fs||(fs={})),function(n){function t(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}n.getHMRStatus=t;function e(){return t()==="apply"}n.isApplyingHMR=e;const s={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function r(i){const o=document.createElement(s[i]||"div"),a=`on${i}`;let l=a in o;return l||(o.setAttribute(a,"return;"),l=typeof o[a]=="function"),l}n.isEventSupported=r}(fs||(fs={}));const Nu=/[\t\r\n\f]/g,_u=/\S+/g,Ir=n=>` ${n} `;function Lr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function Sn(n,t){if(n==null||t==null)return!1;const e=Ir(Lr(n)),s=Ir(t);return n.nodeType===1?e.replace(Nu," ").includes(s):!1}function J(n,t){if(!(n==null||t==null)){if(typeof t=="function")return J(n,t(Lr(n)));if(typeof t=="string"&&n.nodeType===1){const e=t.match(_u)||[],s=Ir(Lr(n)).replace(Nu," ");let r=e.reduce((i,o)=>i.indexOf(Ir(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function Dt(n,t){if(n!=null){if(typeof t=="function")return Dt(n,t(Lr(n)));if((!t||typeof t=="string")&&n.nodeType===1){const e=(t||"").match(_u)||[],s=Ir(Lr(n)).replace(Nu," ");let r=e.reduce((i,o)=>{const a=Ir(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=t?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function ln(n,t,e){if(!(n==null||t==null)){if(e!=null&&typeof t=="string"){e?J(n,t):Dt(n,t);return}if(typeof t=="function")return ln(n,t(Lr(n),e),e);typeof t=="string"&&(t.match(_u)||[]).forEach(r=>{Sn(n,r)?Dt(n,r):J(n,r)})}}let ey=0;function aR(){return ey+=1,`v${ey}`}function ku(n){return(n.id==null||n.id==="")&&(n.id=aR()),n.id}function gs(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const ee={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},ny="1.1";function sy(n,t=document){return t.createElement(n)}function Du(n,t=ee.xhtml,e=document){return e.createElementNS(t,n)}function cn(n,t=document){return Du(n,ee.svg,t)}function Ha(n){if(n){const e=`<svg xmlns="${ee.svg}" xmlns:xlink="${ee.xlink}" version="${ny}">${n}</svg>`,{documentElement:s}=lR(e,{async:!1});return s}const t=document.createElementNS(ee.svg,"svg");return t.setAttributeNS(ee.xmlns,"xmlns:xlink",ee.xlink),t.setAttribute("version",ny),t}function lR(n,t={}){let e;try{const s=new DOMParser;if(t.async!=null){const r=s;r.async=t.async}e=s.parseFromString(n,t.mimeType||"text/xml")}catch{e=void 0}if(!e||e.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return e}function cR(n,t=!0){const e=n.nodeName;return t?e.toLowerCase():e.toUpperCase()}function Ru(n){let t=0,e=n.previousSibling;for(;e;)e.nodeType===1&&(t+=1),e=e.previousSibling;return t}function uR(n,t){return n.querySelectorAll(t)}function hR(n,t){return n.querySelector(t)}function ry(n,t,e){const s=n.ownerSVGElement;let r=n.parentNode;for(;r&&r!==e&&r!==s;){if(Sn(r,t))return r;r=r.parentNode}return null}function Iu(n,t){const e=t&&t.parentNode;return n===e||!!(e&&e.nodeType===1&&n.compareDocumentPosition(e)&16)}function ze(n){n&&(Array.isArray(n)?n:[n]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function qi(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Ne(n,t){(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&n.appendChild(s)})}function iy(n,t){const e=n.firstChild;return e?Lu(e,t):Ne(n,t)}function Lu(n,t){const e=n.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(r=>{r!=null&&e.insertBefore(r,n)})}function ps(n,t){t!=null&&t.appendChild(n)}function oy(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function dR(n,t){const e=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!t||Sn(s,t))&&e.push(s);return e}const ay=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function fR(n,t){return n.getAttribute(t)}function Bu(n,t){const e=cy(t);e.ns?n.hasAttributeNS(e.ns,e.local)&&n.removeAttributeNS(e.ns,e.local):n.hasAttribute(t)&&n.removeAttribute(t)}function Vu(n,t,e){if(e==null)return Bu(n,t);const s=cy(t);s.ns&&typeof e=="string"?n.setAttributeNS(s.ns,t,e):t==="id"?n.id=`${e}`:n.setAttribute(t,`${e}`)}function ly(n,t){Object.keys(t).forEach(e=>{Vu(n,e,t[e])})}function ut(n,t,e){if(t==null){const s=n.attributes,r={};for(let i=0;i<s.length;i+=1)r[s[i].name]=s[i].value;return r}if(typeof t=="string"&&e===void 0)return n.getAttribute(t);typeof t=="object"?ly(n,t):Vu(n,t,e)}function cy(n){if(n.indexOf(":")!==-1){const t=n.split(":");return{ns:ee[t[0]],local:t[1]}}return{ns:null,local:n}}function Ji(n){const t={};return Object.keys(n).forEach(e=>{const s=ay.includes(e)?e:jm(e);t[s]=n[e]}),t}function Ua(n){const t={};return n.split(";").forEach(s=>{const r=s.trim();if(r){const i=r.split("=");i.length&&(t[i[0].trim()]=i[1]?i[1].trim():"")}}),t}function ju(n,t){return Object.keys(t).forEach(e=>{if(e==="class")n[e]=n[e]?`${n[e]} ${t[e]}`:t[e];else if(e==="style"){const s=typeof n[e]=="object",r=typeof t[e]=="object";let i,o;s&&r?(i=n[e],o=t[e]):s?(i=n[e],o=Ua(t[e])):r?(i=Ua(n[e]),o=t[e]):(i=Ua(n[e]),o=Ua(t[e])),n[e]=ju(i,o)}else n[e]=t[e]}),n}function gR(n,t,e={}){const s=e.offset||0,r=[],i=[];let o,a,l=null;for(let u=0;u<n.length;u+=1){o=i[u]=n[u];for(let h=0,f=t.length;h<f;h+=1){const d=t[h],g=d.start+s,p=d.end+s;u>=g&&u<p&&(typeof o=="string"?o=i[u]={t:n[u],attrs:d.attrs}:o.attrs=ju(ju({},o.attrs),d.attrs),e.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(h)))}a=i[u-1],a?Lt(o)&&Lt(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(r.push(l),l=o)):Lt(o)||Lt(a)?(l=l,r.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&r.push(l),r}function pR(n){return n.replace(/ /g," ")}var Ws;(function(n){function t(u){const h="data:";return u.substr(0,h.length)===h}n.isDataUrl=t;function e(u,h){if(!u||t(u)){setTimeout(()=>h(null,u));return}const f=()=>{h(new Error(`Failed to load image: ${u}`))},d=window.FileReader?p=>{if(p.status===200){const m=new FileReader;m.onload=y=>{const b=y.target.result;h(null,b)},m.onerror=f,m.readAsDataURL(p.response)}else f()}:p=>{const m=y=>{const w=[];for(let x=0;x<y.length;x+=32768)w.push(String.fromCharCode.apply(null,y.subarray(x,x+32768)));return w.join("")};if(p.status===200){let y=u.split(".").pop()||"png";y==="svg"&&(y="svg+xml");const b=`data:image/${y};base64,`,w=new Uint8Array(p.response),x=b+btoa(m(w));h(null,x)}else f()},g=new XMLHttpRequest;g.responseType=window.FileReader?"blob":"arraybuffer",g.open("GET",u,!0),g.addEventListener("error",f),g.addEventListener("load",()=>d(g)),g.send()}n.imageToDataUri=e;function s(u){let h=u.replace(/\s/g,"");h=decodeURIComponent(h);const f=h.indexOf(","),d=h.slice(0,f),g=d.split(":")[1].split(";")[0],p=h.slice(f+1);let m;d.indexOf("base64")>=0?m=atob(p):m=unescape(encodeURIComponent(p));const y=new Uint8Array(m.length);for(let b=0;b<m.length;b+=1)y[b]=m.charCodeAt(b);return new Blob([y],{type:g})}n.dataUriToBlob=s;function r(u,h){const f=window.navigator.msSaveBlob;if(f)f(u,h);else{const d=window.URL.createObjectURL(u),g=document.createElement("a");g.href=d,g.download=h,document.body.appendChild(g),g.click(),document.body.removeChild(g),window.URL.revokeObjectURL(d)}}n.downloadBlob=r;function i(u,h){const f=s(u);r(f,h)}n.downloadDataUri=i;function o(u){const h=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return h&&h[2]?h[2].replace(/\s+/," ").split(" "):null}function a(u){const h=parseFloat(u);return Number.isNaN(h)?null:h}function l(u,h={}){let f=null;const d=x=>(f==null&&(f=o(u)),f!=null?a(f[x]):null),g=x=>{const v=u.match(x);return v&&v[2]?a(v[2]):null};let p=h.width;if(p==null&&(p=g(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),p==null&&(p=d(2)),p==null)throw new Error("Can not parse width from svg string");let m=h.height;if(m==null&&(m=g(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),m==null&&(m=d(3)),m==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(u).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=l})(Ws||(Ws={}));let qs;const mR={px(n){return n},mm(n){return qs*n},cm(n){return qs*n*10},in(n){return qs*n*25.4},pt(n){return qs*(25.4*n/72)},pc(n){return qs*(25.4*n/6)}};var uy;(function(n){function t(s,r,i){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=s+(i||"px"),a.height=r+(i||"px"),document.body.appendChild(o);const l=o.getBoundingClientRect(),u={width:l.width||0,height:l.height||0};return document.body.removeChild(o),u}n.measure=t;function e(s,r){qs==null&&(qs=t("1","1","mm").width);const i=r?mR[r]:null;return i?i(s):s}n.toPx=e})(uy||(uy={}));const yR=/-(.)/g;function bR(n){return n.replace(yR,(t,e)=>e.toUpperCase())}const $u={},hy=["webkit","ms","moz","o"],dy=typeof document<"u"?document.createElement("div").style:{};function wR(n){for(let t=0;t<hy.length;t+=1){const e=hy[t]+n;if(e in dy)return e}return null}function xR(n){const t=bR(n);if($u[t]==null){const e=t.charAt(0).toUpperCase()+t.slice(1);$u[t]=t in dy?t:wR(e)}return $u[t]}function fy(n,t){const e=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return e&&t?e.getPropertyValue(t)||e[t]:e}const vR={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function CR(n){return/^--/.test(n)}function SR(n,t,e){const s=window.getComputedStyle(n,null);return e?s.getPropertyValue(t)||void 0:s[t]||n.style[t]}function ER(n,t){return!vR[n]&&typeof t=="number"?`${t}px`:t}function qt(n,t,e){if(typeof t=="string"){const s=CR(t);if(s||(t=xR(t)),e===void 0)return SR(n,t,s);s||(e=ER(t,e));const r=n.style;s?r.setProperty(t,e):r[t]=e;return}for(const s in t)qt(n,s,t[s])}const Ga=new WeakMap;function gy(n,t){const e=na(t),s=Ga.get(n);if(s)return s[e]}function OR(n,t,e){const s=na(t),r=Ga.get(n);r?r[s]=e:Ga.set(n,{[s]:e})}function Js(n,t,e){if(!t){const s={};return Object.keys(Ga).forEach(r=>{s[r]=gy(n,r)}),s}if(typeof t=="string"){if(e===void 0)return gy(n,t);OR(n,t,e);return}for(const s in t)Js(n,s,t[s])}class tt{get[Symbol.toStringTag](){return tt.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}constructor(t,e,s){if(!t)throw new TypeError("Invalid element to create vector");let r;if(tt.isVector(t))r=t.node;else if(typeof t=="string")if(t.toLowerCase()==="svg")r=Ha();else if(t[0]==="<"){const i=Ha(t);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(ee.svg,t);else r=t;this.node=r,e&&this.setAttributes(e),s&&this.append(s)}transform(t,e){return t==null?Vr(this.node):(Vr(this.node,t,e),this)}translate(t,e=0,s={}){return t==null?Sy(this.node):(Sy(this.node,t,e,s),this)}rotate(t,e,s,r={}){return t==null?Hu(this.node):(Hu(this.node,t,e,s,r),this)}scale(t,e){return t==null?Uu(this.node):(Uu(this.node,t,e),this)}getTransformToElement(t){const e=tt.toNode(t);return Qi(this.node,e)}removeAttribute(t){return Bu(this.node,t),this}getAttribute(t){return fR(this.node,t)}setAttribute(t,e){return Vu(this.node,t,e),this}setAttributes(t){return ly(this.node,t),this}attr(t,e){return t==null?ut(this.node):typeof t=="string"&&e===void 0?ut(this.node,t):(typeof t=="object"?ut(this.node,t):ut(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:tt.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?tt.create(e):tt.create("defs").appendTo(t)}text(t,e={}){return my(this.node,t,e),this}tagName(){return cR(this.node)}clone(){return tt.create(this.node.cloneNode(!0))}remove(){return ze(this.node),this}empty(){return qi(this.node),this}append(t){return Ne(this.node,tt.toNodes(t)),this}appendTo(t){return ps(this.node,tt.isVector(t)?t.node:t),this}prepend(t){return iy(this.node,tt.toNodes(t)),this}before(t){return Lu(this.node,tt.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(tt.toNode(t),this.node),tt.create(t)}first(){return this.node.firstChild?tt.create(this.node.firstChild):null}last(){return this.node.lastChild?tt.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?tt.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(tt.toNode(t))}find(t){const e=[],s=uR(this.node,t);if(s)for(let r=0,i=s.length;r<i;r+=1)e.push(tt.create(s[r]));return e}findOne(t){const e=hR(this.node,t);return e?tt.create(e):null}findParentByClass(t,e){const s=ry(this.node,t,e);return s?tt.create(s):null}matches(t){const e=this.node;this.node.matches;const s=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return s&&s.call(e,t)}contains(t){return Iu(this.node,tt.isVector(t)?t.node:t)}wrap(t){const e=tt.create(t),s=this.node.parentNode;return s!=null&&s.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(e.node.parentNode==null)return null;if(e=tt.create(e.node.parentNode),t==null)return e;do if(typeof t=="string"?e.matches(t):e instanceof t)return e;while(e=tt.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let s=0;s<t.length;s+=1)t[s].nodeType===1&&e.push(tt.create(t[s]));return e}eachChild(t,e){const s=this.children();for(let r=0,i=s.length;r<i;r+=1)t.call(s[r],s[r],r,s),e&&s[r].eachChild(t,e);return this}index(){return Ru(this.node)}hasClass(t){return Sn(this.node,t)}addClass(t){return J(this.node,t),this}removeClass(t){return Dt(this.node,t),this}toggleClass(t,e){return ln(this.node,t,e),this}toLocalPoint(t,e){return GR(this.node,t,e)}sample(t=1){return this.node instanceof SVGPathElement?TR(this.node,t):[]}toPath(){return tt.create(LR(this.node))}toPathData(){return vy(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function t(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],l=o;return(a==null||a===n.toStringTag)&&l.node instanceof SVGElement&&typeof l.sample=="function"&&typeof l.toPath=="function"}n.isVector=t;function e(o,a,l){return new n(o,a,l)}n.create=e;function s(o){if(o[0]==="<"){const a=Ha(o),l=[];for(let u=0,h=a.childNodes.length;u<h;u+=1){const f=a.childNodes[u];l.push(e(document.importNode(f,!0)))}return l}return[e(o)]}n.createVectors=s;function r(o){return t(o)?o.node:o}n.toNode=r;function i(o){return Array.isArray(o)?o.map(a=>r(a)):[r(o)]}n.toNodes=i})(tt||(tt={}));function MR(n,t){const e=tt.create(t),s=tt.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=tt.create("path").attr("d",r).appendTo(e.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function PR(n,t,e){const s=e.eol,r=e.baseSize,i=e.lineHeight;let o=0,a;const l={},u=t.length-1;for(let h=0;h<=u;h+=1){let f=t[h],d=null;if(typeof f=="object"){const g=f.attrs,p=tt.create("tspan",g);a=p.node;let m=f.t;s&&h===u&&(m+=s),a.textContent=m;const y=g.class;y&&p.addClass(y),e.includeAnnotationIndices&&p.attr("annotations",f.annotations.join(",")),d=parseFloat(g["font-size"]),d===void 0&&(d=r),d&&d>o&&(o=d)}else s&&h===u&&(f+=s),a=document.createTextNode(f||" "),r&&r>o&&(o=r);n.appendChild(a)}return o&&(l.maxFontSize=o),i?l.lineHeight=i:o&&(l.lineHeight=o*1.2),l}const py=/em$/;function Ya(n,t){const e=parseFloat(n);return py.test(n)?e*t:e}function AR(n,t,e,s){if(!Array.isArray(t))return 0;const r=t.length;if(!r)return 0;let i=t[0];const o=Ya(i.maxFontSize,e)||e;let a=0;const l=Ya(s,e);for(let f=1;f<r;f+=1){i=t[f];const d=Ya(i.lineHeight,e)||l;a+=d}const u=Ya(i.maxFontSize,e)||e;let h;switch(n){case"middle":h=o/2-.15*u-a/2;break;case"bottom":h=-(.25*u)-a;break;case"top":default:h=.8*o;break}return h}function my(n,t,e={}){t=pR(t);const s=e.eol;let r=e.textPath;const i=e.textVerticalAnchor,o=i==="middle"||i==="bottom"||i==="top";let a=e.x;a===void 0&&(a=n.getAttribute("x")||0);const l=e.includeAnnotationIndices;let u=e.annotations;u&&!Array.isArray(u)&&(u=[u]);const h=e.lineHeight,f=h==="auto",d=f?"1.5em":h||"1em";let g=!0;const p=n.childNodes;if(p.length===1){const T=p[0];T&&T.tagName.toUpperCase()==="TITLE"&&(g=!1)}g&&qi(n),ut(n,{"xml:space":"preserve",display:t||e.displayEmpty?null:"none"});const m=ut(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&ut(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=MR(r,n)):b=document.createDocumentFragment();let w,x=0,v;const S=t.split(`
|
|
36
|
-
`),E=[],C=S.length-1;for(let T=0;T<=C;T+=1){w=d;let
|
|
37
|
-
`,a=e.fontSize||14,l=e.lineHeight?parseFloat(e.lineHeight):Math.ceil(a*1.4),u=Math.floor(i/l);if(n.indexOf(o)>-1){const y=Fa(),b=[];return n.split(o).map(w=>{const x=by(w,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),e,Object.assign(Object.assign({},s),{eol:y}));x&&b.push(...x.split(y))}),b.slice(0,u).join(o)}const{width:h}=Xi(n,e);if(h<r)return n;const f=[];let d=n,g=h,p=s.ellipsis,m=0;p&&(typeof p!="string"&&(p="…"),m=Xi(p,e).width);for(let y=0;y<u;y+=1)if(g>r)if(y===u-1){const[w]=yy(d,r-m,g,e);f.push(p?`${w}${p}`:w)}else{const[w,x]=yy(d,r,g,e);f.push(w),d=x,g=Xi(d,e).width}else{f.push(d);break}return f.join(o)}const zu=.551784;function ae(n,t,e=NaN){const s=n.getAttribute(t);if(s==null)return e;const r=parseFloat(s);return Number.isNaN(r)?e:r}function TR(n,t=1){const e=n.getTotalLength(),s=[];let r=0,i;for(;r<e;)i=n.getPointAtLength(r),s.push({distance:r,x:i.x,y:i.y}),r+=t;return s}function NR(n){return["M",ae(n,"x1"),ae(n,"y1"),"L",ae(n,"x2"),ae(n,"y2")].join(" ")}function _R(n){const t=Wa(n);return t.length===0?null:`${wy(t)} Z`}function kR(n){const t=Wa(n);return t.length===0?null:wy(t)}function wy(n){return`M ${n.map(e=>`${e.x} ${e.y}`).join(" L")}`}function Wa(n){const t=[],e=n.points;if(e)for(let s=0,r=e.numberOfItems;s<r;s+=1)t.push(e.getItem(s));return t}function DR(n){const t=ae(n,"cx",0),e=ae(n,"cy",0),s=ae(n,"r"),r=s*zu;return["M",t,e-s,"C",t+r,e-s,t+s,e-r,t+s,e,"C",t+s,e+r,t+r,e+s,t,e+s,"C",t-r,e+s,t-s,e+r,t-s,e,"C",t-s,e-r,t-r,e-s,t,e-s,"Z"].join(" ")}function RR(n){const t=ae(n,"cx",0),e=ae(n,"cy",0),s=ae(n,"rx"),r=ae(n,"ry")||s,i=s*zu,o=r*zu;return["M",t,e-r,"C",t+i,e-r,t+s,e-o,t+s,e,"C",t+s,e+o,t+i,e+r,t,e+r,"C",t-i,e+r,t-s,e+o,t-s,e,"C",t-s,e-o,t-i,e-r,t,e-r,"Z"].join(" ")}function IR(n){return xy({x:ae(n,"x",0),y:ae(n,"y",0),width:ae(n,"width",0),height:ae(n,"height",0),rx:ae(n,"rx",0),ry:ae(n,"ry",0)})}function xy(n){let t;const e=n.x,s=n.y,r=n.width,i=n.height,o=Math.min(n.rx||n["top-rx"]||0,r/2),a=Math.min(n.rx||n["bottom-rx"]||0,r/2),l=Math.min(n.ry||n["top-ry"]||0,i/2),u=Math.min(n.ry||n["bottom-ry"]||0,i/2);return o||a||l||u?t=["M",e,s+l,"v",i-l-u,"a",a,u,0,0,0,a,u,"h",r-2*a,"a",a,u,0,0,0,a,-u,"v",-(i-u-l),"a",o,l,0,0,0,-o,-l,"h",-(r-2*o),"a",o,l,0,0,0,-o,l,"Z"]:t=["M",e,s,"H",e+r,"V",s+i,"H",e,"V",s,"Z"],t.join(" ")}function LR(n){const t=cn("path");ut(t,ut(n));const e=vy(n);return e&&t.setAttribute("d",e),t}function vy(n){const t=n.tagName.toLowerCase();switch(t){case"path":return n.getAttribute("d");case"line":return NR(n);case"polygon":return _R(n);case"polyline":return kR(n);case"ellipse":return RR(n);case"circle":return DR(n);case"rect":return IR(n)}throw new Error(`"${t}" cannot be converted to svg path element.`)}const BR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Cy=/[ ,]+/,VR=/^(\w+)\((.*)\)/;function jR(n,t){const s=cn("svg").createSVGPoint();return s.x=n,s.y=t,s}function ne(n){const e=cn("svg").createSVGMatrix();if(n!=null){const s=n,r=e;for(const i in s)r[i]=s[i]}return e}function Ki(n){const t=cn("svg");return n!=null?(n instanceof DOMMatrix||(n=ne(n)),t.createSVGTransformFromMatrix(n)):t.createSVGTransform()}function Zi(n){let t=ne();const e=n!=null&&n.match(BR);if(!e)return t;for(let s=0,r=e.length;s<r;s+=1){const o=e[s].match(VR);if(o){let a,l,u,h,f,d=ne();const g=o[2].split(Cy);switch(o[1].toLowerCase()){case"scale":a=parseFloat(g[0]),l=g[1]===void 0?a:parseFloat(g[1]),d=d.scaleNonUniform(a,l);break;case"translate":u=parseFloat(g[0]),h=parseFloat(g[1]),d=d.translate(u,h);break;case"rotate":f=parseFloat(g[0]),u=parseFloat(g[1])||0,h=parseFloat(g[2])||0,u!==0||h!==0?d=d.translate(u,h).rotate(f).translate(-u,-h):d=d.rotate(f);break;case"skewx":f=parseFloat(g[0]),d=d.skewX(f);break;case"skewy":f=parseFloat(g[0]),d=d.skewY(f);break;case"matrix":d.a=parseFloat(g[0]),d.b=parseFloat(g[1]),d.c=parseFloat(g[2]),d.d=parseFloat(g[3]),d.e=parseFloat(g[4]),d.f=parseFloat(g[5]);break;default:continue}t=t.multiply(d)}}return t}function Br(n){const t=n||{},e=t.a!=null?t.a:1,s=t.b!=null?t.b:0,r=t.c!=null?t.c:0,i=t.d!=null?t.d:1,o=t.e!=null?t.e:0,a=t.f!=null?t.f:0;return`matrix(${e},${s},${r},${i},${o},${a})`}function qa(n){let t,e,s;if(n){const i=Cy;if(n.trim().indexOf("matrix")>=0){const o=Zi(n),a=$R(o);t=[a.translateX,a.translateY],e=[a.rotation],s=[a.scaleX,a.scaleY];const l=[];(t[0]!==0||t[1]!==0)&&l.push(`translate(${t.join(",")})`),(s[0]!==1||s[1]!==1)&&l.push(`scale(${s.join(",")})`),e[0]!==0&&l.push(`rotate(${e[0]})`),n=l.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(t=o[1].split(i));const a=n.match(/rotate\((.*?)\)/);a&&(e=a[1].split(i));const l=n.match(/scale\((.*?)\)/);l&&(s=l[1].split(i))}}const r=s&&s[0]?parseFloat(s[0]):1;return{raw:n||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:e&&e[0]?parseInt(e[0],10):0,cx:e&&e[1]?parseInt(e[1],10):void 0,cy:e&&e[2]?parseInt(e[2],10):void 0},scale:{sx:r,sy:s&&s[1]?parseFloat(s[1]):r}}}function Fu(n,t){const e=t.x*n.a+t.y*n.c+0,s=t.x*n.b+t.y*n.d+0;return{x:e,y:s}}function $R(n){const t=Fu(n,{x:0,y:1}),e=Fu(n,{x:1,y:0}),s=180/Math.PI*Math.atan2(t.y,t.x)-90,r=180/Math.PI*Math.atan2(e.y,e.x);return{skewX:s,skewY:r,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:s}}function zR(n){let t,e,s,r;return n?(t=n.a==null?1:n.a,r=n.d==null?1:n.d,e=n.b,s=n.c):t=r=1,{sx:e?Math.sqrt(t*t+e*e):t,sy:s?Math.sqrt(s*s+r*r):r}}function FR(n){let t={x:0,y:1};n&&(t=Fu(n,t));const e=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:e%360+(e<0?360:0)}}function HR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Vr(n,t,e={}){if(t==null)return Zi(ut(n,"transform"));if(e.absolute){n.setAttribute("transform",Br(t));return}const s=n.transform,r=Ki(t);s.baseVal.appendItem(r)}function Sy(n,t,e=0,s={}){let r=ut(n,"transform");const i=qa(r);if(t==null)return i.translation;r=i.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=s.absolute?t:i.translation.tx+t,a=s.absolute?e:i.translation.ty+e,l=`translate(${o},${a})`;n.setAttribute("transform",`${l} ${r}`.trim())}function Hu(n,t,e,s,r={}){let i=ut(n,"transform");const o=qa(i);if(t==null)return o.rotation;i=o.raw,i=i.replace(/rotate\([^)]*\)/g,"").trim(),t%=360;const a=r.absolute?t:o.rotation.angle+t,l=e!=null&&s!=null?`,${e},${s}`:"",u=`rotate(${a}${l})`;n.setAttribute("transform",`${i} ${u}`.trim())}function Uu(n,t,e){let s=ut(n,"transform");const r=qa(s);if(t==null)return r.scale;e=e??t,s=r.raw,s=s.replace(/scale\([^)]*\)/g,"").trim();const i=`scale(${t},${e})`;n.setAttribute("transform",`${s} ${i}`.trim())}function Qi(n,t){if(gs(t)&&gs(n)){const e=t.getScreenCTM(),s=n.getScreenCTM();if(e&&s)return e.inverse().multiply(s)}return ne()}function UR(n,t){let e=ne();if(gs(t)&&gs(n)){let s=n;const r=[];for(;s&&s!==t;){const i=s.getAttribute("transform")||null,o=Zi(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{e=e.multiply(i)})}return e}function GR(n,t,e){const s=n instanceof SVGSVGElement?n:n.ownerSVGElement,r=s.createSVGPoint();r.x=t,r.y=e;try{const i=s.getScreenCTM(),o=r.matrixTransform(i.inverse()),a=Qi(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var Fe;(function(n){const t={};function e(i){return t[i]||{}}n.get=e;function s(i,o){t[i]=o}n.register=s;function r(i){delete t[i]}n.unregister=r})(Fe||(Fe={}));var Xs;(function(n){const t=new WeakMap;function e(i){return t.has(i)||t.set(i,{events:Object.create(null)}),t.get(i)}n.ensure=e;function s(i){return t.get(i)}n.get=s;function r(i){return t.delete(i)}n.remove=r})(Xs||(Xs={}));var it;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function t(r){r.stopPropagation()}n.stopPropagationCallback=t;function e(r,i,o){r.addEventListener!=null&&r.addEventListener(i,o)}n.addEventListener=e;function s(r,i,o){r.removeEventListener!=null&&r.removeEventListener(i,o)}n.removeEventListener=s})(it||(it={})),function(n){const t=/[^\x20\t\r\n\f]+/g,e=/^([^.]*)(?:\.(.+)|)/;function s(a){return(a||"").match(t)||[""]}n.splitType=s;function r(a){const l=e.exec(a)||[];return{originType:l[1]?l[1].trim():l[1],namespaces:l[2]?l[2].split(".").map(u=>u.trim()).sort():[]}}n.normalizeType=r;function i(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=i;function o(a,l){if(l){const u=a;return u.querySelector!=null&&u.querySelector(l)!=null}return!0}n.isValidSelector=o}(it||(it={})),function(n){let t=0;const e=new WeakMap;function s(a){return e.has(a)||(e.set(a,t),t+=1),e.get(a)}n.ensureHandlerId=s;function r(a){return e.get(a)}n.getHandlerId=r;function i(a){return e.delete(a)}n.removeHandlerId=i;function o(a,l){return e.set(a,l)}n.setHandlerId=o}(it||(it={})),function(n){function t(e,s){const r=[],i=Xs.get(e),o=i&&i.events&&i.events[s.type],a=o&&o.handlers||[],l=o?o.delegateCount:0;if(l>0&&!(s.type==="click"&&typeof s.button=="number"&&s.button>=1)){for(let u=s.target;u!==e;u=u.parentNode||e)if(u.nodeType===1&&!(s.type==="click"&&u.disabled===!0)){const h=[],f={};for(let d=0;d<l;d+=1){const g=a[d],p=g.selector;if(p!=null&&f[p]==null){const m=e,y=[];m.querySelectorAll(p).forEach(b=>{y.push(b)}),f[p]=y.includes(u)}f[p]&&h.push(g)}h.length&&r.push({elem:u,handlers:h})}}return l<a.length&&r.push({elem:e,handlers:a.slice(l)}),r}n.getHandlerQueue=t}(it||(it={})),function(n){function t(e){return e!=null&&e===e.window}n.isWindow=t}(it||(it={})),function(n){function t(e,s){const r=e.nodeType===9?e.documentElement:e,i=s&&s.parentNode;return e===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):e.compareDocumentPosition&&e.compareDocumentPosition(i)&16))}n.contains=t}(it||(it={}));class En{constructor(t,e){this.isDefaultPrevented=it.returnFalse,this.isPropagationStopped=it.returnFalse,this.isImmediatePropagationStopped=it.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=it.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=it.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=it.returnTrue,s&&!this.isSimulated&&s.stopImmediatePropagation(),this.stopPropagation()},typeof t=="string"?this.type=t:t.type&&(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?it.returnTrue:it.returnFalse,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.timeStamp=t.timeStamp),e&&Object.assign(this,e),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function t(e){return e instanceof n?e:new n(e)}n.create=t})(En||(En={})),function(n){function t(e,s){Object.defineProperty(n.prototype,e,{enumerable:!0,configurable:!0,get:typeof s=="function"?function(){if(this.originalEvent)return s(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set(r){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:r})}})}n.addProperty=t}(En||(En={})),function(n){const t={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(t).forEach(e=>n.addProperty(e,t[e]))}(En||(En={})),function(n){Fe.register("load",{noBubble:!0})}(),function(n){Fe.register("beforeunload",{postDispatch(t,e){e.result!==void 0&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}})}(),function(n){Fe.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(t,e){let s;const r=e.relatedTarget,i=e.handleObj;return(!r||r!==t&&!it.contains(t,r))&&(e.type=i.originType,s=i.handler.call(t,e),e.type="mouseover"),s}}),Fe.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(t,e){let s;const r=e.relatedTarget,i=e.handleObj;return(!r||r!==t&&!it.contains(t,r))&&(e.type=i.originType,s=i.handler.call(t,e),e.type="mouseout"),s}})}();var YR=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e},to;(function(n){let t;function e(o,a,l,u,h){if(!it.isValidTarget(o))return;let f;if(typeof l!="function"){const{handler:m,selector:y}=l,b=YR(l,["handler","selector"]);l=m,h=y,f=b}const d=Xs.ensure(o);let g=d.handler;g==null&&(g=d.handler=function(m,...y){return t!==m.type?r(o,m,...y):void 0});const p=it.ensureHandlerId(l);it.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=it.normalizeType(m);if(!y)return;let w=y,x=Fe.get(w);w=(h?x.delegateType:x.bindType)||w,x=Fe.get(w);const v=Object.assign({type:w,originType:y,data:u,selector:h,guid:p,handler:l,namespace:b.join(".")},f),S=d.events;let E=S[w];E||(E=S[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,g)===!1)&&it.addEventListener(o,w,g)),x.add&&(it.removeHandlerId(v.handler),x.add(o,v),it.setHandlerId(v.handler,p)),h?(E.handlers.splice(E.delegateCount,0,v),E.delegateCount+=1):E.handlers.push(v)})}n.on=e;function s(o,a,l,u,h){const f=Xs.get(o);if(!f)return;const d=f.events;d&&(it.splitType(a).forEach(g=>{const{originType:p,namespaces:m}=it.normalizeType(g);if(!p){Object.keys(d).forEach(S=>{s(o,S+g,l,u,!0)});return}let y=p;const b=Fe.get(y);y=(u?b.delegateType:b.bindType)||y;const w=d[y];if(!w)return;const x=m.length>0?new RegExp(`(^|\\.)${m.join("\\.(?:.*\\.|)")}(\\.|$)`):null,v=w.handlers.length;for(let S=w.handlers.length-1;S>=0;S-=1){const E=w.handlers[S];(h||p===E.originType)&&(!l||it.getHandlerId(l)===E.guid)&&(x==null||E.namespace&&x.test(E.namespace))&&(u==null||u===E.selector||u==="**"&&E.selector)&&(w.handlers.splice(S,1),E.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,E))}v&&w.handlers.length===0&&((!b.teardown||b.teardown(o,m,f.handler)===!1)&&it.removeEventListener(o,y,f.handler),delete d[y])}),Object.keys(d).length===0&&Xs.remove(o))}n.off=s;function r(o,a,...l){const u=En.create(a);u.delegateTarget=o;const h=Fe.get(u.type);if(h.preDispatch&&h.preDispatch(o,u)===!1)return;const f=it.getHandlerQueue(o,u);for(let d=0,g=f.length;d<g&&!u.isPropagationStopped();d+=1){const p=f[d];u.currentTarget=p.elem;for(let m=0,y=p.handlers.length;m<y&&!u.isImmediatePropagationStopped();m+=1){const b=p.handlers[m];if(u.rnamespace==null||b.namespace&&u.rnamespace.test(b.namespace)){u.handleObj=b,u.data=b.data;const w=Fe.get(b.originType).handle,x=w?w(p.elem,u,...l):b.handler.call(p.elem,u,...l);x!==void 0&&(u.result=x,x===!1&&(u.preventDefault(),u.stopPropagation()))}}}return h.postDispatch&&h.postDispatch(o,u),u.result}n.dispatch=r;function i(o,a,l,u){let h=o,f=typeof o=="string"?o:o.type,d=typeof o=="string"||h.namespace==null?[]:h.namespace.split(".");const g=l;if(g.nodeType===3||g.nodeType===8)return;f.indexOf(".")>-1&&(d=f.split("."),f=d.shift(),d.sort());const p=f.indexOf(":")<0&&`on${f}`;h=o instanceof En?o:new En(f,typeof o=="object"?o:null),h.namespace=d.join("."),h.rnamespace=h.namespace?new RegExp(`(^|\\.)${d.join("\\.(?:.*\\.|)")}(\\.|$)`):null,h.result=void 0,h.target||(h.target=g);const m=[h];Array.isArray(a)?m.push(...a):m.push(a);const y=Fe.get(f);if(!u&&y.trigger&&y.trigger(g,h,a)===!1)return;let b;const w=[g];if(!u&&!y.noBubble&&!it.isWindow(g)){b=y.delegateType||f;let v=g,S=g.parentNode;for(;S!=null;)w.push(S),v=S,S=S.parentNode;const E=g.ownerDocument||document;if(v===E){const C=v.defaultView||v.parentWindow||window;w.push(C)}}let x=g;for(let v=0,S=w.length;v<S&&!h.isPropagationStopped();v+=1){const E=w[v];x=E,h.type=v>1?b:y.bindType||f;const C=Xs.get(E);C&&C.events[h.type]&&C.handler&&C.handler.call(E,...m);const M=p&&E[p]||null;M&&it.isValidTarget(E)&&(h.result=M.call(E,...m),h.result===!1&&h.preventDefault())}if(h.type=f,!u&&!h.isDefaultPrevented()){const v=y.preventDefault;if((v==null||v(w.pop(),h,a)===!1)&&it.isValidTarget(g)&&p&&typeof g[f]=="function"&&!it.isWindow(g)){const S=g[p];S&&(g[p]=null),t=f,h.isPropagationStopped()&&x.addEventListener(f,it.stopPropagationCallback),g[f](),h.isPropagationStopped()&&x.removeEventListener(f,it.stopPropagationCallback),t=void 0,S&&(g[p]=S)}}return h.result}n.trigger=i})(to||(to={}));var le;(function(n){function t(i,o,a,l,u){return eo.on(i,o,a,l,u),i}n.on=t;function e(i,o,a,l,u){return eo.on(i,o,a,l,u,!0),i}n.once=e;function s(i,o,a,l){return eo.off(i,o,a,l),i}n.off=s;function r(i,o,a,l){return to.trigger(o,a,i,l),i}n.trigger=r})(le||(le={}));var eo;(function(n){function t(s,r,i,o,a,l){if(typeof r=="object"){typeof i!="string"&&(o=o||i,i=void 0),Object.keys(r).forEach(u=>t(s,u,i,o,r[u],l));return}if(o==null&&a==null?(a=i,o=i=void 0):a==null&&(typeof i=="string"?(a=o,o=void 0):(a=o,o=i,i=void 0)),a===!1)a=it.returnFalse;else if(!a)return;if(l){const u=a;a=function(h,...f){return n.off(s,h),u.call(this,h,...f)},it.setHandlerId(a,it.ensureHandlerId(u))}to.on(s,r,a,o,i)}n.on=t;function e(s,r,i,o){const a=r;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;e(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof r=="object"){const l=r;Object.keys(l).forEach(u=>e(s,u,i,l[u]));return}(i===!1||typeof i=="function")&&(o=i,i=void 0),o===!1&&(o=it.returnFalse),to.off(s,r,o,i)}n.off=e})(eo||(eo={}));class Ey{constructor(t,e,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=fs.isEventSupported("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=s,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(t){if(this.onWheelGuard!=null&&!this.onWheelGuard(t))return;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault();let e;(this.deltaX!==0||this.deltaY!==0)&&(t.stopPropagation(),e=!0),e===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Gu(n){const t=n.getBoundingClientRect(),e=n.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}}function WR(n){return n.getBoundingClientRect().width}function qR(n){return n.getBoundingClientRect().height}function Oy(n,t=60){let e=null;return(...s)=>{e&&clearTimeout(e),e=window.setTimeout(()=>{n.apply(this,s)},t)}}function JR(n){let t=null,e=[];const s=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const l=document.createElement("object");return l.onload=()=>{l.contentDocument.defaultView.addEventListener("resize",r),r()},l.style.display="block",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="-1",l.style.opacity="0",l.setAttribute("tabindex","-1"),l.type="text/html",n.appendChild(l),l.data="about:blank",l},r=Oy(()=>{e.forEach(l=>l(n))}),i=l=>{t||(t=s()),e.indexOf(l)===-1&&e.push(l)},o=()=>{t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",r),t.parentNode.removeChild(t),t=null,e=[])};return{element:n,bind:i,destroy:o,unbind:l=>{const u=e.indexOf(l);u!==-1&&e.splice(u,1),e.length===0&&t&&o()}}}function XR(n){let t=null,e=[];const s=Oy(()=>{e.forEach(l=>{l(n)})}),r=()=>{const l=new ResizeObserver(s);return l.observe(n),s(),l},i=l=>{t||(t=r()),e.indexOf(l)===-1&&e.push(l)},o=()=>{t&&(t.disconnect(),e=[],t=null)};return{element:n,bind:i,destroy:o,unbind:l=>{const u=e.indexOf(l);u!==-1&&e.splice(u,1),e.length===0&&t&&o()}}}const KR=typeof ResizeObserver<"u"?XR:JR;var Ja;(function(n){const t=new WeakMap;function e(r){let i=t.get(r);return i||(i=KR(r),t.set(r,i),i)}function s(r){r.destroy(),t.delete(r.element)}n.bind=(r,i)=>{const o=e(r);return o.bind(i),()=>o.unbind(i)},n.clear=r=>{const i=e(r);s(i)}})(Ja||(Ja={}));class no{constructor(t={}){this.comparator=t.comparator||no.defaultComparator,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(t,e,s){const r={priority:t,value:e},i=this.data.length;return s&&(r.id=s,this.index[s]=i),this.data.push(r),this.bubbleUp(i),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const s=this.index[t];if(typeof s>"u")throw new Error(`Node with id '${t}' was not found in the heap.`);const r=this.data,i=r[s].priority,o=this.comparator(e,i);o<0?(r[s].priority=e,this.bubbleUp(s)):o>0&&(r[s].priority=e,this.bubbleDown(s))}remove(){const t=this.data,e=t[0],s=t.pop();return e.id&&delete this.index[e.id],t.length>0&&(t[0]=s,s.id&&(this.index[s.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let s,r,i=t;for(;i>0&&(r=i-1>>>1,this.comparator(e[i].priority,e[r].priority)<0);){s=e[r],e[r]=e[i];let o=e[i].id;o!=null&&(this.index[o]=r),e[i]=s,o=e[i].id,o!=null&&(this.index[o]=i),i=r}}bubbleDown(t){const e=this.data,s=e.length-1;let r=t;for(;;){const i=(r<<1)+1,o=i+1;let a=r;if(i<=s&&this.comparator(e[i].priority,e[a].priority)<0&&(a=i),o<=s&&this.comparator(e[o].priority,e[a].priority)<0&&(a=o),a!==r){const l=e[a];e[a]=e[r];let u=e[r].id;u!=null&&(this.index[u]=a),e[r]=l,u=e[r].id,u!=null&&(this.index[u]=r),r=a}else break}}}(function(n){n.defaultComparator=(t,e)=>t-e})(no||(no={}));var Yu;(function(n){function t(e,s,r=(i,o)=>1){const i={},o={},a={},l=new no;for(i[s]=0,Object.keys(e).forEach(u=>{u!==s&&(i[u]=1/0),l.insert(i[u],u,u)});!l.isEmpty();){const u=l.remove();a[u]=!0;const h=e[u]||[];for(let f=0;f<h.length;f+=1){const d=h[f];if(!a[d]){const g=i[u]+r(u,d);g<i[d]&&(i[d]=g,o[d]=u,l.updatePriority(d,g))}}}return o}n.run=t})(Yu||(Yu={}));class Wn{constructor(t,e,s,r){if(t==null)return this.set(255,255,255,1);if(typeof t=="number")return this.set(t,e,s,r);if(typeof t=="string")return Wn.fromString(t)||this;if(Array.isArray(t))return this.set(t);this.set(t.r,t.g,t.b,t.a==null?1:t.a)}blend(t,e,s){this.set(t.r+(e.r-t.r)*s,t.g+(e.g-t.g)*s,t.b+(e.b-t.b)*s,t.a+(e.a-t.a)*s)}lighten(t){const e=Wn.lighten(this.toArray(),t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}darken(t){this.lighten(-t)}set(t,e,s,r){const i=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:s,l=Array.isArray(t)?t[3]:r;return this.r=Math.round(we(i,0,255)),this.g=Math.round(we(o,0,255)),this.b=Math.round(we(a,0,255)),this.a=l==null?1:we(l,0,1),this}toHex(){return`#${["r","g","b"].map(e=>{const s=this[e].toString(16);return s.length<2?`0${s}`:s}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Wn.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(t){const e=`${this.r},${this.g},${this.b},`;return t?`rgb(${e})`:`rgba(${e},${this.a})`}toGrey(){return Wn.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function t(x){return new n(x)}n.fromArray=t;function e(x){return new n([...p(x),1])}n.fromHex=e;function s(x){const v=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(v){const S=v[1].split(/\s*,\s*/).map(E=>parseInt(E,10));return new n(S)}return null}n.fromRGBA=s;function r(x,v,S){S<0&&++S,S>1&&--S;const E=6*S;return E<1?x+(v-x)*E:2*S<1?v:3*S<2?x+(v-x)*(2/3-S)*6:x}function i(x){const v=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(v){const S=v[2].split(/\s*,\s*/),E=(parseFloat(S[0])%360+360)%360/360,C=parseFloat(S[1])/100,M=parseFloat(S[2])/100,T=S[3]==null?1:parseInt(S[3],10);return new n(u(E,C,M,T))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return e(x);if(x.startsWith("rgb"))return s(x);const v=n.named[x];return v?e(v):i(x)}n.fromString=o;function a(x,v){return n.fromArray([x,x,x,v])}n.makeGrey=a;function l(x,v,S,E){const C=Array.isArray(x)?x[0]:x,M=Array.isArray(x)?x[1]:v,T=Array.isArray(x)?x[2]:S,k=Array.isArray(x)?x[3]:E,_=Math.max(C,M,T),D=Math.min(C,M,T),N=(_+D)/2;let j=0,A=0;if(D!==_){const P=_-D;switch(A=N>.5?P/(2-_-D):P/(_+D),_){case C:j=(M-T)/P+(M<T?6:0);break;case M:j=(T-C)/P+2;break;case T:j=(C-M)/P+4;break}j/=6}return[j,A,N,k??1]}n.rgba2hsla=l;function u(x,v,S,E){const C=Array.isArray(x)?x[0]:x,M=Array.isArray(x)?x[1]:v,T=Array.isArray(x)?x[2]:S,k=Array.isArray(x)?x[3]:E,_=T<=.5?T*(M+1):T+M-T*M,D=2*T-_;return[r(D,_,C+1/3)*256,r(D,_,C)*256,r(D,_,C-1/3)*256,k??1]}n.hsla2rgba=u;function h(x){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),x?void 0:parseFloat(Math.random().toFixed(2)))}n.random=h;function f(){const x="0123456789ABCDEF";let v="#";for(let S=0;S<6;S+=1)v+=x[Math.floor(Math.random()*16)];return v}n.randomHex=f;function d(x){return h(x).toString()}n.randomRGBA=d;function g(x,v){if(typeof x=="string"){const T=x[0]==="#",[k,_,D]=p(x);return v?k*.299+_*.587+D*.114>186?"#000000":"#ffffff":`${T?"#":""}${m(255-k,255-_,255-D)}`}const S=x[0],E=x[1],C=x[2],M=x[3];return v?S*.299+E*.587+C*.114>186?[0,0,0,M]:[255,255,255,M]:[255-S,255-E,255-C,M]}n.invert=g;function p(x){const v=x.indexOf("#")===0?x:`#${x}`;let S=+`0x${v.substr(1)}`;if(!(v.length===4||v.length===7)||Number.isNaN(S))throw new Error("Invalid hex color.");const E=v.length===4?4:8,C=(1<<E)-1,M=["b","g","r"].map(()=>{const T=S&C;return S>>=E,E===4?17*T:T});return[M[2],M[1],M[0]]}function m(x,v,S){const E=C=>C.length<2?`0${C}`:C;return`${E(x.toString(16))}${E(v.toString(16))}${E(S.toString(16))}`}function y(x,v){return w(x,v)}n.lighten=y;function b(x,v){return w(x,-v)}n.darken=b;function w(x,v){if(typeof x=="string"){const C=x[0]==="#",M=parseInt(C?x.substr(1):x,16),T=we((M>>16)+v,0,255),k=we((M>>8&255)+v,0,255),_=we((M&255)+v,0,255);return`${C?"#":""}${(_|k<<8|T<<16).toString(16)}`}const S=m(x[0],x[1],x[2]),E=p(w(S,v));return[E[0],E[1],E[2],x[3]]}})(Wn||(Wn={})),function(n){n.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(Wn||(Wn={}));class Wu{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const s=this.map.get(t);return this.map.delete(t),s}each(t){this.arr.forEach(e=>{const s=this.map.get(e);t(s,e)})}dispose(){this.clear()}}var ms;(function(n){function t(r){const i=[],o=[];return Array.isArray(r)?i.push(...r):r.split("|").forEach(a=>{a.indexOf("&")===-1?i.push(a):o.push(...a.split("&"))}),{or:i,and:o}}n.parse=t;function e(r,i){if(r!=null&&i!=null){const o=t(r),a=t(i),l=o.or.sort(),u=a.or.sort(),h=o.and.sort(),f=a.and.sort(),d=(g,p)=>g.length===p.length&&(g.length===0||g.every((m,y)=>m===p[y]));return d(l,u)&&d(h,f)}return r==null&&i==null}n.equals=e;function s(r,i,o){if(i==null||Array.isArray(i)&&i.length===0)return o?r.altKey!==!0&&r.ctrlKey!==!0&&r.metaKey!==!0&&r.shiftKey!==!0:!0;const{or:a,and:l}=t(i),u=h=>{const f=`${h.toLowerCase()}Key`;return r[f]===!0};return a.some(h=>u(h))&&l.every(h=>u(h))}n.isMatch=s})(ms||(ms={}));var Ks;(function(n){n.linear=t=>t,n.quad=t=>t*t,n.cubic=t=>t*t*t,n.inout=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,s=e*t;return 4*(t<.5?s:3*(t-e)+s-.75)},n.exponential=t=>Math.pow(2,10*(t-1)),n.bounce=t=>{for(let e=0,s=1;;e+=s,s/=2)if(t>=(7-4*e)/11){const r=(11-6*e-11*t)/4;return-r*r+s*s}}})(Ks||(Ks={})),function(n){n.decorators={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,s=1){return r=>{const i=t(r);return i<e?e:i>s?s:i}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}(Ks||(Ks={})),function(n){function t(A){return-1*Math.cos(A*(Math.PI/2))+1}n.easeInSine=t;function e(A){return Math.sin(A*(Math.PI/2))}n.easeOutSine=e;function s(A){return-.5*(Math.cos(Math.PI*A)-1)}n.easeInOutSine=s;function r(A){return A*A}n.easeInQuad=r;function i(A){return A*(2-A)}n.easeOutQuad=i;function o(A){return A<.5?2*A*A:-1+(4-2*A)*A}n.easeInOutQuad=o;function a(A){return A*A*A}n.easeInCubic=a;function l(A){const P=A-1;return P*P*P+1}n.easeOutCubic=l;function u(A){return A<.5?4*A*A*A:(A-1)*(2*A-2)*(2*A-2)+1}n.easeInOutCubic=u;function h(A){return A*A*A*A}n.easeInQuart=h;function f(A){const P=A-1;return 1-P*P*P*P}n.easeOutQuart=f;function d(A){const P=A-1;return A<.5?8*A*A*A*A:1-8*P*P*P*P}n.easeInOutQuart=d;function g(A){return A*A*A*A*A}n.easeInQuint=g;function p(A){const P=A-1;return 1+P*P*P*P*P}n.easeOutQuint=p;function m(A){const P=A-1;return A<.5?16*A*A*A*A*A:1+16*P*P*P*P*P}n.easeInOutQuint=m;function y(A){return A===0?0:Math.pow(2,10*(A-1))}n.easeInExpo=y;function b(A){return A===1?1:-Math.pow(2,-10*A)+1}n.easeOutExpo=b;function w(A){if(A===0||A===1)return A;const P=A*2,L=P-1;return P<1?.5*Math.pow(2,10*L):.5*(-Math.pow(2,-10*L)+2)}n.easeInOutExpo=w;function x(A){const P=A/1;return-1*(Math.sqrt(1-P*A)-1)}n.easeInCirc=x;function v(A){const P=A-1;return Math.sqrt(1-P*P)}n.easeOutCirc=v;function S(A){const P=A*2,L=P-2;return P<1?-.5*(Math.sqrt(1-P*P)-1):.5*(Math.sqrt(1-L*L)+1)}n.easeInOutCirc=S;function E(A,P=1.70158){return A*A*((P+1)*A-P)}n.easeInBack=E;function C(A,P=1.70158){const L=A/1-1;return L*L*((P+1)*L+P)+1}n.easeOutBack=C;function M(A,P=1.70158){const L=A*2,V=L-2,Y=P*1.525;return L<1?.5*L*L*((Y+1)*L-Y):.5*(V*V*((Y+1)*V+Y)+2)}n.easeInOutBack=M;function T(A,P=.7){if(A===0||A===1)return A;const V=A/1-1,Y=1-P,ot=Y/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*V)*Math.sin((V-ot)*(2*Math.PI)/Y))}n.easeInElastic=T;function k(A,P=.7){const L=1-P,V=A*2;if(A===0||A===1)return A;const Y=L/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*V)*Math.sin((V-Y)*(2*Math.PI)/L)+1}n.easeOutElastic=k;function _(A,P=.65){const L=1-P;if(A===0||A===1)return A;const V=A*2,Y=V-1,ot=L/(2*Math.PI)*Math.asin(1);return V<1?-.5*(Math.pow(2,10*Y)*Math.sin((Y-ot)*(2*Math.PI)/L)):Math.pow(2,-10*Y)*Math.sin((Y-ot)*(2*Math.PI)/L)*.5+1}n.easeInOutElastic=_;function D(A){const P=A/1;if(P<1/2.75)return 7.5625*P*P;if(P<2/2.75){const L=P-.5454545454545454;return 7.5625*L*L+.75}if(P<2.5/2.75){const L=P-.8181818181818182;return 7.5625*L*L+.9375}{const L=P-.9545454545454546;return 7.5625*L*L+.984375}}n.easeOutBounce=D;function N(A){return 1-D(1-A)}n.easeInBounce=N;function j(A){return A<.5?N(A*2)*.5:D(A*2-1)*.5+.5}n.easeInOutBounce=j}(Ks||(Ks={}));var Zs;(function(n){n.number=(t,e)=>{const s=e-t;return r=>t+s*r},n.object=(t,e)=>{const s=Object.keys(t);return r=>{const i={};for(let o=s.length-1;o!==-1;o-=1){const a=s[o];i[a]=t[a]+(e[a]-t[a])*r}return i}},n.unit=(t,e)=>{const s=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=s.exec(t),i=s.exec(e),o=i?i[1]:"",a=r?+r[1]:0,l=i?+i[1]:0,u=o.indexOf("."),h=u>0?o[1].length-u-1:0,f=l-a,d=r?r[2]:"";return g=>(a+f*g).toFixed(h)+d},n.color=(t,e)=>{const s=parseInt(t.slice(1),16),r=parseInt(e.slice(1),16),i=s&255,o=(r&255)-i,a=s&65280,l=(r&65280)-a,u=s&16711680,h=(r&16711680)-u;return f=>{const d=i+o*f&255,g=a+l*f&65280,p=u+h*f&16711680;return`#${(1<<24|d|g|p).toString(16).slice(1)}`}}})(Zs||(Zs={}));const so=[];function jr(n,t){const e=so.find(s=>s.name===n);if(!(e&&(e.loadTimes+=1,e.loadTimes>1))&&!fs.isApplyingHMR()){const s=document.createElement("style");s.setAttribute("type","text/css"),s.textContent=t;const r=document.querySelector("head");r&&r.insertBefore(s,r.firstChild),so.push({name:n,loadTimes:1,styleElement:s})}}function $r(n){const t=so.findIndex(e=>e.name===n);if(t>-1){const e=so[t];if(e.loadTimes-=1,e.loadTimes>0)return;let s=e.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,so.splice(t,1)}}var gt;(function(n){function t(s){return 180*s/Math.PI%360}n.toDeg=t,n.toRad=function(s,r=!1){return(r?s:s%360)*Math.PI/180};function e(s){return s%360+(s<0?360:0)}n.normalize=e})(gt||(gt={}));var wt;(function(n){function t(a,l=0){return Number.isInteger(a)?a:+a.toFixed(l)}n.round=t;function e(a,l){let u,h;if(l==null?(h=a??1,u=0):(h=l,u=a??0),h<u){const f=u;u=h,h=f}return Math.floor(Math.random()*(h-u+1)+u)}n.random=e;function s(a,l,u){return Number.isNaN(a)?NaN:Number.isNaN(l)||Number.isNaN(u)?0:l<u?a<l?l:a>u?u:a:a<u?u:a>l?l:a}n.clamp=s;function r(a,l){return l*Math.round(a/l)}n.snapToGrid=r;function i(a,l){return l!=null&&a!=null&&l.x>=a.x&&l.x<=a.x+a.width&&l.y>=a.y&&l.y<=a.y+a.height}n.containsPoint=i;function o(a,l){const u=a.x-l.x,h=a.y-l.y;return u*u+h*h}n.squaredLength=o})(wt||(wt={}));class ys{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class O extends ys{constructor(t,e){super(),this.x=t??0,this.y=e??0}round(t=0){return this.x=wt.round(this.x,t),this.y=wt.round(this.y,t),this}add(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}update(t,e){const s=O.create(t,e);return this.x=s.x,this.y=s.y,this}translate(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}rotate(t,e){const s=O.rotate(this,t,e);return this.x=s.x,this.y=s.y,this}scale(t,e,s=new O){const r=O.create(s);return this.x=r.x+t*(this.x-r.x),this.y=r.y+e*(this.y-r.y),this}closest(t){if(t.length===1)return O.create(t[0]);let e=null,s=1/0;return t.forEach(r=>{const i=this.squaredDistance(r);i<s&&(e=r,s=i)}),e?O.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=O.create(t),s=this.x-e.x,r=this.y-e.y;return s*s+r*r}manhattanDistance(t){const e=O.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new O){const e=O.create(t),s=-(e.y-this.y),r=e.x-this.x;let i=Math.atan2(s,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let s=this.theta(e)-this.theta(t);return s<0&&(s+=360),s}vectorAngle(t){return new O(0,0).angleBetween(this,t)}toPolar(t){return this.update(O.toPolar(this,t)),this}changeInAngle(t,e,s=new O){return this.clone().translate(-t,-e).theta(s)-this.theta(s)}adhereToRect(t){return wt.containsPoint(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=O.create(t),s=gt.toRad(this.y),r=gt.toRad(e.y),i=this.x,o=e.x,a=gt.toRad(o-i),l=Math.sin(a)*Math.cos(r),u=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(a),h=gt.toDeg(Math.atan2(l,u)),f=["NE","E","SE","S","SW","W","NW","N"];let d=h-22.5;return d<0&&(d+=360),d=parseInt(d/45,10),f[d]}cross(t,e){if(t!=null&&e!=null){const s=O.create(t),r=O.create(e);return(r.x-this.x)*(s.y-this.y)-(r.y-this.y)*(s.x-this.x)}return NaN}dot(t){const e=O.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if(typeof t=="number")return new O(this.x-t,this.y-e);const s=O.create(t);return new O(this.x-s.x,this.y-s.y)}lerp(t,e){const s=O.create(t);return new O((1-e)*this.x+e*s.x,(1-e)*this.y+e*s.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const s=O.create(t),r=gt.toRad(s.theta(this));return this.translate(Math.cos(r)*e,-Math.sin(r)*e)}reflection(t){return O.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=wt.snapToGrid(this.x,t),this.y=wt.snapToGrid(this.y,e??t),this}equals(t){const e=O.create(t);return e!=null&&e.x===this.x&&e.y===this.y}clone(){return O.clone(this)}toJSON(){return O.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function t(e){return e!=null&&e instanceof n}n.isPoint=t})(O||(O={})),function(n){function t(s){return s!=null&&typeof s=="object"&&typeof s.x=="number"&&typeof s.y=="number"}n.isPointLike=t;function e(s){return s!=null&&Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"}n.isPointData=e}(O||(O={})),function(n){function t(f,d){return f==null||typeof f=="number"?new n(f,d):e(f)}n.create=t;function e(f){return n.isPoint(f)?new n(f.x,f.y):Array.isArray(f)?new n(f[0],f[1]):new n(f.x,f.y)}n.clone=e;function s(f){return n.isPoint(f)?{x:f.x,y:f.y}:Array.isArray(f)?{x:f[0],y:f[1]}:{x:f.x,y:f.y}}n.toJSON=s;function r(f,d,g=new n){let p=Math.abs(f*Math.cos(d)),m=Math.abs(f*Math.sin(d));const y=e(g),b=gt.normalize(gt.toDeg(d));return b<90?m=-m:b<180?(p=-p,m=-m):b<270&&(p=-p),new n(y.x+p,y.y+m)}n.fromPolar=r;function i(f,d=new n){const g=e(f),p=e(d),m=g.x-p.x,y=g.y-p.y;return new n(Math.sqrt(m*m+y*y),gt.toRad(p.theta(g)))}n.toPolar=i;function o(f,d){return f===d?!0:f!=null&&d!=null?f.x===d.x&&f.y===d.y:!1}n.equals=o;function a(f,d){if(f==null&&d!=null||f!=null&&d==null||f!=null&&d!=null&&f.length!==d.length)return!1;if(f!=null&&d!=null){for(let g=0,p=f.length;g<p;g+=1)if(!o(f[g],d[g]))return!1}return!0}n.equalPoints=a;function l(f,d,g,p){return new n(wt.random(f,d),wt.random(g,p))}n.random=l;function u(f,d,g){const p=gt.toRad(gt.normalize(-d)),m=Math.sin(p),y=Math.cos(p);return h(f,y,m,g)}n.rotate=u;function h(f,d,g,p=new n){const m=e(f),y=e(p),b=m.x-y.x,w=m.y-y.y,x=b*d-w*g,v=w*d+b*g;return new n(x+y.x,v+y.y)}n.rotateEx=h}(O||(O={}));class z extends ys{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new O(this.x,this.y)}get topLeft(){return new O(this.x,this.y)}get topCenter(){return new O(this.x+this.width/2,this.y)}get topRight(){return new O(this.x+this.width,this.y)}get center(){return new O(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new O(this.x,this.y+this.height)}get bottomCenter(){return new O(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new O(this.x+this.width,this.y+this.height)}get corner(){return new O(this.x+this.width,this.y+this.height)}get rightMiddle(){return new O(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new O(this.x,this.y+this.height/2)}get topLine(){return new W(this.topLeft,this.topRight)}get rightLine(){return new W(this.topRight,this.bottomRight)}get bottomLine(){return new W(this.bottomLeft,this.bottomRight)}get leftLine(){return new W(this.topLeft,this.bottomLeft)}constructor(t,e,s,r){super(),this.x=t??0,this.y=e??0,this.width=s??0,this.height=r??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=gt.toRad(t),s=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),i=this.width*r+this.height*s,o=this.width*s+this.height*r;return new z(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(t=0){return this.x=wt.round(this.x,t),this.y=wt.round(this.y,t),this.width=wt.round(this.width,t),this.height=wt.round(this.height,t),this}add(t,e,s,r){const i=z.create(t,e,s,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),l=Math.max(this.x+this.width,i.x+i.width),u=Math.max(this.y+this.height,i.y+i.height);return this.x=o,this.y=a,this.width=l-o,this.height=u-a,this}update(t,e,s,r){const i=z.create(t,e,s,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(t,e){const s=t,r=e??t;return this.x-=s,this.y-=r,this.width+=2*s,this.height+=2*r,this}snapToGrid(t,e){const s=this.origin.snapToGrid(t,e),r=this.corner.snapToGrid(t,e);return this.x=s.x,this.y=s.y,this.width=r.x-s.x,this.height=r.y-s.y,this}translate(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}scale(t,e,s=new O){const r=this.origin.scale(t,e,s);return this.x=r.x,this.y=r.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(t!==0){const s=gt.toRad(t),r=Math.cos(s),i=Math.sin(s);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();o=O.rotateEx(o,r,i,e),a=O.rotateEx(a,r,i,e),l=O.rotateEx(l,r,i,e),u=O.rotateEx(u,r,i,e);const h=new z(o.x,o.y,0,0);h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=z.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const s=z.clone(t),r=e.x,i=e.y;let o=1/0,a=1/0,l=1/0,u=1/0,h=1/0,f=1/0,d=1/0,g=1/0;const p=s.topLeft;p.x<r&&(o=(this.x-r)/(p.x-r)),p.y<i&&(h=(this.y-i)/(p.y-i));const m=s.bottomRight;m.x>r&&(a=(this.x+this.width-r)/(m.x-r)),m.y>i&&(f=(this.y+this.height-i)/(m.y-i));const y=s.topRight;y.x>r&&(l=(this.x+this.width-r)/(y.x-r)),y.y<i&&(d=(this.y-i)/(y.y-i));const b=s.bottomLeft;return b.x<r&&(u=(this.x-r)/(b.x-r)),b.y>i&&(g=(this.y+this.height-i)/(b.y-i)),{sx:Math.min(o,a,l,u),sy:Math.min(h,f,d,g)}}getMaxUniformScaleToFit(t,e=this.center){const s=this.getMaxScaleToFit(t,e);return Math.min(s.sx,s.sy)}containsPoint(t,e){return wt.containsPoint(this,O.create(t,e))}containsRect(t,e,s,r){const i=z.create(t,e,s,r),o=this.x,a=this.y,l=this.width,u=this.height,h=i.x,f=i.y,d=i.width,g=i.height;return l===0||u===0||d===0||g===0?!1:h>=o&&f>=a&&h+d<=o+l&&f+g<=a+u}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=[],r=[];return e.forEach(i=>{const o=t.intersectsWithLine(i);o!==null&&r.indexOf(o.toString())<0&&(s.push(o),r.push(o.toString()))}),s.length>0?s:null}intersectsWithLineFromCenterToPoint(t,e){const s=O.clone(t),r=this.center;let i=null;e!=null&&e!==0&&s.rotate(e,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new W(r,s);for(let l=o.length-1;l>=0;l-=1){const u=o[l].intersectsWithLine(a);if(u!==null){i=u;break}}return i&&e!=null&&e!==0&&i.rotate(-e,r),i}intersectsWithRect(t,e,s,r){const i=z.create(t,e,s,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,l=i.origin,u=i.corner,h=Math.max(o.x,l.x),f=Math.max(o.y,l.y);return new z(h,f,Math.min(a.x,u.x)-h,Math.min(a.y,u.y)-f)}isIntersectWithRect(t,e,s,r){const i=z.create(t,e,s,r),o=this.origin,a=this.corner,l=i.origin,u=i.corner;return!(u.x<=o.x||u.y<=o.y||l.x>=a.x||l.y>=a.y)}normalize(){let t=this.x,e=this.y,s=this.width,r=this.height;return this.width<0&&(t=this.x+this.width,s=-this.width),this.height<0&&(e=this.y+this.height,r=-this.height),this.x=t,this.y=e,this.width=s,this.height=r,this}union(t){const e=z.clone(t),s=this.origin,r=this.corner,i=e.origin,o=e.corner,a=Math.min(s.x,i.x),l=Math.min(s.y,i.y),u=Math.max(r.x,o.x),h=Math.max(r.y,o.y);return new z(a,l,u-a,h-l)}getNearestSideToPoint(t){const e=O.clone(t),s=e.x-this.x,r=this.x+this.width-e.x,i=e.y-this.y,o=this.y+this.height-e.y;let a=s,l="left";return r<a&&(a=r,l="right"),i<a&&(a=i,l="top"),o<a&&(l="bottom"),l}getNearestPointToPoint(t){const e=O.clone(t);if(this.containsPoint(e)){const s=this.getNearestSideToPoint(e);if(s==="left")return new O(this.x,e.y);if(s==="top")return new O(e.x,this.y);if(s==="right")return new O(this.x+this.width,e.y);if(s==="bottom")return new O(e.x,this.y+this.height)}return e.adhereToRect(this)}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new z(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function t(e){return e!=null&&e instanceof n}n.isRectangle=t})(z||(z={})),function(n){function t(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}n.isRectangleLike=t}(z||(z={})),function(n){function t(o,a,l,u){return o==null||typeof o=="number"?new n(o,a,l,u):e(o)}n.create=t;function e(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=e;function s(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=s;function r(o){return new n(0,0,o.width,o.height)}n.fromSize=r;function i(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=i}(z||(z={}));class W extends ys{get center(){return new O((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(t,e,s,r){super(),typeof t=="number"&&typeof e=="number"?(this.start=new O(t,e),this.end=new O(s,r)):(this.start=O.create(t),this.end=O.create(e))}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,s){return this.start.scale(t,e,s),this.end.scale(t,e,s),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const s=t/e;return this.scale(s,s,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:s,end:r}=e,i=s.clone().rotate(270,r),o=r.clone().rotate(90,s);return s.move(o,t),r.move(i,t),e}vector(){return new O(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new O(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),s=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new z(t,e,s-t,r-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new W(this.start,t).vector()),s=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(s)?0:s}pointAt(t){const e=this.start,s=this.end;return t<=0?e.clone():t>=1?s.clone():e.lerp(s,t)}pointAtLength(t){const e=this.start,s=this.end;let r=!0;t<0&&(r=!1,t=-t);const i=this.length();if(t>=i)return r?s.clone():e.clone();const o=(r?t:i-t)/i;return this.pointAt(o)}divideAt(t){const e=this.pointAt(t);return[new W(this.start,e),new W(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new W(this.start,e),new W(e,this.end)]}containsPoint(t){const e=this.start,s=this.end;if(e.cross(t,s)!==0)return!1;const r=this.length();return!(new W(e,t).length()>r||new W(t,s).length()>r)}intersect(t,e){const s=t.intersectsWithLine(this,e);return s?Array.isArray(s)?s:[s]:null}intersectsWithLine(t){const e=new O(this.end.x-this.start.x,this.end.y-this.start.y),s=new O(t.end.x-t.start.x,t.end.y-t.start.y),r=e.x*s.y-e.y*s.x,i=new O(t.start.x-this.start.x,t.start.y-this.start.y),o=i.x*s.y-i.y*s.x,a=i.x*e.y-i.y*e.x;if(r===0||o*r<0||a*r<0)return null;if(r>0){if(o>r||a>r)return null}else if(o<r||a<r)return null;return new O(this.start.x+o*e.x/r,this.start.y+o*e.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=O.clone(t),s=this.start,r=this.end;return((r.x-s.x)*(e.y-s.y)-(r.y-s.y)*(e.x-s.x))/this.length()}pointSquaredDistance(t,e){const s=O.create(t,e);return this.closestPoint(s).squaredDistance(s)}pointDistance(t,e){const s=O.create(t,e);return this.closestPoint(s).distance(s)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,s=this.end,r=this.pointAt(t),i=new W(e,s);return i.translate(r.x-e.x,r.y-e.y),i}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,s=this.end,r=this.pointAtLength(t),i=new W(e,s);return i.translate(r.x-e.x,r.y-e.y),i}relativeCcw(t,e){const s=O.create(t,e);let r=s.x-this.start.x,i=s.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=r*a-i*o;return l===0&&(l=r*o+i*a,l>0&&(r-=o,i-=a,l=r*o+i*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(t){return t!=null&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new W(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function t(e){return e!=null&&e instanceof n}n.isLine=t})(W||(W={}));class un extends ys{get center(){return new O(this.x,this.y)}constructor(t,e,s,r){super(),this.x=t??0,this.y=e??0,this.a=s??0,this.b=r??0}bbox(){return z.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const s=t,r=e??t;return this.a+=2*s,this.b+=2*r,this}normalizedDistance(t,e){const s=O.create(t,e),r=s.x-this.x,i=s.y-this.y,o=this.a,a=this.b;return r*r/(o*o)+i*i/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],s=this.a,r=this.b,i=t.start,o=t.end,a=t.vector(),l=i.diff(new O(this.x,this.y)),u=new O(a.x/(s*s),a.y/(r*r)),h=new O(l.x/(s*s),l.y/(r*r)),f=a.dot(u),d=a.dot(h),g=l.dot(h)-1,p=d*d-f*g;if(p<0)return null;if(p>0){const m=Math.sqrt(p),y=(-d-m)/f,b=(-d+m)/f;if((y<0||y>1)&&(b<0||b>1))return null;y>=0&&y<=1&&e.push(i.lerp(o,y)),b>=0&&b<=1&&e.push(i.lerp(o,b))}else{const m=-d/f;if(m>=0&&m<=1)e.push(i.lerp(o,m));else return null}return e}intersectsWithLineFromCenterToPoint(t,e=0){const s=O.clone(t);e&&s.rotate(e,this.getCenter());const r=s.x-this.x,i=s.y-this.y;let o;if(r===0)return o=this.bbox().getNearestPointToPoint(s),e?o.rotate(-e,this.getCenter()):o;const a=i/r,l=a*a,u=this.a*this.a,h=this.b*this.b;let f=Math.sqrt(1/(1/u+l/h));f=r<0?-f:f;const d=a*f;return o=new O(this.x+f,this.y+d),e?o.rotate(-e,this.getCenter()):o}tangentTheta(t){const e=O.clone(t),s=e.x,r=e.y,i=this.a,o=this.b,a=this.bbox().center,l=a.x,u=a.y,h=30,f=s>a.x+i/2,d=s<a.x-i/2;let g,p;return f||d?(p=s>a.x?r-h:r+h,g=i*i/(s-l)-i*i*(r-u)*(p-u)/(o*o*(s-l))+l):(g=r>a.y?s+h:s-h,p=o*o/(r-u)-o*o*(s-l)*(g-l)/(i*i*(r-u))+u),new O(g,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const s=z.fromEllipse(this);s.rotate(t,e);const r=un.fromRect(s);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new un(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function t(e){return e!=null&&e instanceof n}n.isEllipse=t})(un||(un={})),function(n){function t(r,i,o,a){return r==null||typeof r=="number"?new n(r,i,o,a):e(r)}n.create=t;function e(r){return n.isEllipse(r)?r.clone():Array.isArray(r)?new n(r[0],r[1],r[2],r[3]):new n(r.x,r.y,r.a,r.b)}n.parse=e;function s(r){const i=r.center;return new n(i.x,i.y,r.width/2,r.height/2)}n.fromRect=s}(un||(un={}));const ZR=new RegExp("^[\\s\\dLMCZz,.]*$");function QR(n){return typeof n!="string"?!1:ZR.test(n)}function qu(n,t){return(n%t+t)%t}function tI(n,t,e,s,r){const i=[],o=n[n.length-1],a=t!=null&&t>0,l=t||0;if(s&&a){n=n.slice();const f=n[0],d=new O(o.x+(f.x-o.x)/2,o.y+(f.y-o.y)/2);n.splice(0,0,d)}let u=n[0],h=1;for(e?i.push("M",u.x,u.y):i.push("L",u.x,u.y);h<(s?n.length:n.length-1);){let f=n[qu(h,n.length)],d=u.x-f.x,g=u.y-f.y;if(a&&(d!==0||g!==0)&&(r==null||r.indexOf(h-1)<0)){let p=Math.sqrt(d*d+g*g);const m=d*Math.min(l,p/2)/p,y=g*Math.min(l,p/2)/p,b=f.x+m,w=f.y+y;i.push("L",b,w);let x=n[qu(h+1,n.length)];for(;h<n.length-2&&Math.round(x.x-f.x)===0&&Math.round(x.y-f.y)===0;)x=n[qu(h+2,n.length)],h+=1;d=x.x-f.x,g=x.y-f.y,p=Math.max(1,Math.sqrt(d*d+g*g));const v=d*Math.min(l,p/2)/p,S=g*Math.min(l,p/2)/p,E=f.x+v,C=f.y+S;i.push("Q",f.x,f.y,E,C),f=new O(E,C)}else i.push("L",f.x,f.y);u=f,h+=1}return s?i.push("Z"):i.push("L",o.x,o.y),i.map(f=>typeof f=="string"?f:+f.toFixed(3)).join(" ")}function My(n,t={}){const e=[];return n&&n.length&&n.forEach(s=>{Array.isArray(s)?e.push({x:s[0],y:s[1]}):e.push({x:s.x,y:s.y})}),tI(e,t.round,t.initialMove==null||t.initialMove,t.close,t.exclude)}function Xa(n,t,e,s,r=0,i=0,o=0,a,l){if(e===0||s===0)return[];a-=n,l-=t,e=Math.abs(e),s=Math.abs(s);const u=-a/2,h=-l/2,f=Math.cos(r*Math.PI/180),d=Math.sin(r*Math.PI/180),g=f*u+d*h,p=-1*d*u+f*h,m=g*g,y=p*p,b=e*e,w=s*s,x=m/b+y/w;let v;if(x>1)e=Math.sqrt(x)*e,s=Math.sqrt(x)*s,v=0;else{let et=1;i===o&&(et=-1),v=et*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const S=v*e*p/s,E=-1*v*s*g/e,C=f*S-d*E+a/2,M=d*S+f*E+l/2;let T=Math.atan2((p-E)/s,(g-S)/e)-Math.atan2(0,1),k=T>=0?T:2*Math.PI+T;T=Math.atan2((-p-E)/s,(-g-S)/e)-Math.atan2((p-E)/s,(g-S)/e);let _=T>=0?T:2*Math.PI+T;o===0&&_>0?_-=2*Math.PI:o!==0&&_<0&&(_+=2*Math.PI);const D=_*2/Math.PI,N=Math.ceil(D<0?-1*D:D),j=_/N,A=8/3*Math.sin(j/4)*Math.sin(j/4)/Math.sin(j/2),P=f*e,L=f*s,V=d*e,Y=d*s;let ot=Math.cos(k),F=Math.sin(k),H=-A*(P*F+Y*ot),B=-A*(V*F-L*ot),K=0,nt=0;const rt=[];for(let et=0;et<N;et+=1){k+=j,ot=Math.cos(k),F=Math.sin(k),K=P*ot-Y*F+C,nt=V*ot+L*F+M;const ft=-A*(P*F+Y*ot),ge=-A*(V*F-L*ot),St=et*6;rt[St]=Number(H+n),rt[St+1]=Number(B+t),rt[St+2]=Number(K-ft+n),rt[St+3]=Number(nt-ge+t),rt[St+4]=Number(K+n),rt[St+5]=Number(nt+t),H=K+ft,B=nt+ge}return rt.map(et=>+et.toFixed(2))}function eI(n,t,e,s,r=0,i=0,o=0,a,l){const u=[],h=Xa(n,t,e,s,r,i,o,a,l);if(h!=null)for(let f=0,d=h.length;f<d;f+=6)u.push("C",h[f],h[f+1],h[f+2],h[f+3],h[f+4],h[f+5]);return u.join(" ")}class zt extends ys{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(t){if(super(),t!=null){if(typeof t=="string")return zt.parse(t);this.points=t.map(e=>O.create(e))}else this.points=[]}scale(t,e,s=new O){return this.points.forEach(r=>r.scale(t,e,s)),this}rotate(t,e){return this.points.forEach(s=>s.rotate(t,e)),this}translate(t,e){const s=O.create(t,e);return this.points.forEach(r=>r.translate(s.x,s.y)),this}round(t=0){return this.points.forEach(e=>e.round(t)),this}bbox(){if(this.points.length===0)return new z;let t=1/0,e=-1/0,s=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const l=i[o],u=l.x,h=l.y;u<t&&(t=u),u>e&&(e=u),h<s&&(s=h),h>r&&(r=h)}return new z(t,s,e-t,r-s)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,s=e.length;if(s===0||s===1)return 0;let r=0,i=0,o=1/0;for(let a=0,l=s-1;a<l;a+=1){const u=new W(e[a],e[a+1]),h=u.length(),f=u.closestPointNormalizedLength(t),g=u.pointAt(f).squaredDistance(t);g<o&&(o=g,i=r+f*h),r+=h}return i}closestPointNormalizedLength(t){const e=this.length();return e===0?0:this.closestPointLength(t)/e}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(this.points.length===0)return!1;const e=O.clone(t),s=e.x,r=e.y,i=this.points,o=i.length;let a=o-1,l=0;for(let u=0;u<o;u+=1){const h=i[a],f=i[u];if(e.equals(h))return!0;const d=new W(h,f);if(d.containsPoint(t))return!0;if(r<=h.y&&r>f.y||r>h.y&&r<=f.y){const g=h.x-s>f.x-s?h.x-s:f.x-s;if(g>=0){const p=new O(s+g,r),m=new W(t,p);d.intersectsWithLine(m)&&(l+=1)}}a=u}return l%2===1}intersectsWithLine(t){const e=[];for(let s=0,r=this.points.length-1;s<r;s+=1){const i=this.points[s],o=this.points[s+1],a=t.intersectsWithLine(new W(i,o));a&&e.push(a)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const s=this.points[t],r=this.points[t+1];if(new W(s,r).isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,s=this.points.length-1;e<s;e+=1){const r=this.points[e],i=this.points[e+1];t+=r.distance(i)}return t}pointAt(t){const e=this.points,s=e.length;if(s===0)return null;if(s===1||t<=0)return e[0].clone();if(t>=1)return e[s-1].clone();const i=this.length()*t;return this.pointAtLength(i)}pointAtLength(t){const e=this.points,s=e.length;if(s===0)return null;if(s===1)return e[0].clone();let r=!0;t<0&&(r=!1,t=-t);let i=0;for(let a=0,l=s-1;a<l;a+=1){const u=r?a:l-1-a,h=e[u],f=e[u+1],d=new W(h,f),g=h.distance(f);if(t<=i+g)return d.pointAtLength((r?1:-1)*(t-i));i+=g}return(r?e[s-1]:e[0]).clone()}tangentAt(t){const s=this.points.length;if(s===0||s===1)return null;t<0&&(t=0),t>1&&(t=1);const i=this.length()*t;return this.tangentAtLength(i)}tangentAtLength(t){const e=this.points,s=e.length;if(s===0||s===1)return null;let r=!0;t<0&&(r=!1,t=-t);let i,o=0;for(let a=0,l=s-1;a<l;a+=1){const u=r?a:l-1-a,h=e[u],f=e[u+1],d=new W(h,f),g=h.distance(f);if(d.isDifferentiable()){if(t<=o+g)return d.tangentAtLength((r?1:-1)*(t-o));i=d}o+=g}if(i){const a=r?1:0;return i.tangentAt(a)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const s=t.threshold||0;let r=0;for(;e[r+2];){const i=r,o=r+1,a=r+2,l=e[i],u=e[o],h=e[a];new W(l,h).closestPoint(u).distance(u)<=s?e.splice(o,1):r+=1}return this}toHull(){const t=this.points,e=t.length;if(e===0)return new zt;let s=t[0];for(let d=1;d<e;d+=1)(t[d].y<s.y||t[d].y===s.y&&t[d].x>s.x)&&(s=t[d]);const r=[];for(let d=0;d<e;d+=1){let g=s.theta(t[d]);g===0&&(g=360),r.push([t[d],d,g])}if(r.sort((d,g)=>{let p=d[2]-g[2];return p===0&&(p=g[1]-d[1]),p}),r.length>2){const d=r[r.length-1];r.unshift(d)}const i={},o=[],a=d=>`${d[0].toString()}@${d[1]}`;for(;r.length!==0;){const d=r.pop(),g=d[0];if(i[a(d)])continue;let p=!1;for(;!p;)if(o.length<2)o.push(d),p=!0;else{const m=o.pop(),y=m[0],b=o.pop(),w=b[0],x=w.cross(y,g);if(x<0)o.push(b),o.push(m),o.push(d),p=!0;else if(x===0){const S=y.angleBetween(w,g);Math.abs(S-180)<1e-10||y.equals(g)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((S+1)%360-1)<1e-10&&(o.push(b),r.push(m))}else i[a(m)]=y,o.push(b)}}o.length>2&&o.pop();let l,u=-1;for(let d=0,g=o.length;d<g;d+=1){const p=o[d][1];(l===void 0||p<l)&&(l=p,u=d)}let h=[];if(u>0){const d=o.slice(u),g=o.slice(0,u);h=d.concat(g)}else h=o;const f=[];for(let d=0,g=h.length;d<g;d+=1)f.push(h[d][0]);return new zt(f)}equals(t){return t==null||t.points.length!==this.points.length?!1:t.points.every((e,s)=>e.equals(this.points[s]))}clone(){return new zt(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.serialize()}`).join(" ")}}(function(n){function t(e){return e!=null&&e instanceof n}n.isPolyline=t})(zt||(zt={})),function(n){function t(e){const s=e.trim();if(s==="")return new n;const r=[],i=s.split(/\s*,\s*|\s+/);for(let o=0,a=i.length;o<a;o+=2)r.push({x:+i[o],y:+i[o+1]});return new n(r)}n.parse=t}(zt||(zt={}));class Vt extends ys{constructor(t,e,s,r){super(),this.PRECISION=3,this.start=O.create(t),this.controlPoint1=O.create(e),this.controlPoint2=O.create(s),this.end=O.create(r)}bbox(){const t=this.start,e=this.controlPoint1,s=this.controlPoint2,r=this.end,i=t.x,o=t.y,a=e.x,l=e.y,u=s.x,h=s.y,f=r.x,d=r.y,g=[],p=[[],[]];let m,y,b,w,x,v,S,E;for(let P=0;P<2;P+=1){if(P===0?(y=6*i-12*a+6*u,m=-3*i+9*a-9*u+3*f,b=3*a-3*i):(y=6*o-12*l+6*h,m=-3*o+9*l-9*h+3*d,b=3*l-3*o),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;w=-b/y,w>0&&w<1&&g.push(w);continue}S=y*y-4*b*m,E=Math.sqrt(S),!(S<0)&&(x=(-y+E)/(2*m),x>0&&x<1&&g.push(x),v=(-y-E)/(2*m),v>0&&v<1&&g.push(v))}let C,M,T,k=g.length;const _=k;for(;k;)k-=1,w=g[k],T=1-w,C=T*T*T*i+3*T*T*w*a+3*T*w*w*u+w*w*w*f,p[0][k]=C,M=T*T*T*o+3*T*T*w*l+3*T*w*w*h+w*w*w*d,p[1][k]=M;g[_]=0,g[_+1]=1,p[0][_]=i,p[1][_]=o,p[0][_+1]=f,p[1][_+1]=d,g.length=_+2,p[0].length=_+2,p[1].length=_+2;const D=Math.min.apply(null,p[0]),N=Math.min.apply(null,p[1]),j=Math.max.apply(null,p[0]),A=Math.max.apply(null,p[1]);return new z(D,N,j-D,A-N)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const s=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,s),s)}closestPointNormalizedLength(t,e={}){const s=this.getOptions(e),r=this.closestPointLength(t,s);if(!r)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(t,e={}){const s=this.getPrecision(e),r=this.getDivisions(e),i=Math.pow(10,-s);let o=null,a=0,l=0,u=0,h=0,f=0,d=null;const g=r.length;let p=g>0?1/g:0;for(r.forEach((m,y)=>{const b=m.start.distance(t),w=m.end.distance(t),x=b+w;(d==null||x<d)&&(o=m,a=y*p,l=(y+1)*p,u=b,h=w,d=x,f=m.endpointDistance())});;){const m=u?Math.abs(u-h)/u:0,y=h!=null?Math.abs(u-h)/h:0,b=m<i||y<i,w=u?u<f*i:!0,x=h?h<f*i:!0;if(b||(w||x))return u<=h?a:l;const S=o.divide(.5);p/=2;const E=S[0].start.distance(t),C=S[0].end.distance(t),M=E+C,T=S[1].start.distance(t),k=S[1].end.distance(t),_=T+k;M<=_?(o=S[0],l-=p,u=E,h=C):(o=S[1],a+=p,u=T,h=k)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const s=this.tAt(t,e);return this.divideAtT(s)}divideAtLength(t,e={}){const s=this.tAtLength(t,e);return this.divideAtT(s)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return[new Vt(e,e,e,e),new Vt(e,s,r,i)];if(t>=1)return[new Vt(e,s,r,i),new Vt(i,i,i,i)];const o=this.getSkeletonPoints(t),a=o.startControlPoint1,l=o.startControlPoint2,u=o.divider,h=o.dividerControlPoint1,f=o.dividerControlPoint2;return[new Vt(e,a,l,u),new Vt(u,h,f,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:r.clone()};if(t>=1)return{startControlPoint1:s.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new W(e,s).pointAt(t),a=new W(s,r).pointAt(t),l=new W(r,i).pointAt(t),u=new W(o,a).pointAt(t),h=new W(a,l).pointAt(t),f=new W(u,h).pointAt(t);return{startControlPoint1:o,startControlPoint2:u,divider:f,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(t={}){const e=this.getPrecision(t);let s=[new Vt(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(e===0)return s;let r=this.endpointDistance();const i=Math.pow(10,-e);let o=0;for(;;){o+=1;const a=[];s.forEach(h=>{const f=h.divide(.5);a.push(f[0],f[1])});const l=a.reduce((h,f)=>h+f.endpointDistance(),0),u=l!==0?(l-r)/l:0;if(o>1&&u<i)return a;s=a,r=l}}length(t={}){return this.getDivisions(t).reduce((s,r)=>s+r.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const s=e.precision===void 0?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:s})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const s=this.tAt(t,e);return this.pointAtT(s)}pointAtLength(t,e={}){const s=this.tAtLength(t,e);return this.pointAtT(s)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(s)&&s.equals(r))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const s=this.tAt(t,e);return this.tangentAtT(s)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const s=this.tAtLength(t,e);return this.tangentAtT(s)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),s=e.startControlPoint2,r=e.dividerControlPoint1,i=e.divider,o=new W(s,r);return o.translate(i.x-s.x,i.y-s.y),o}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getDivisions(t={}){if(t.subdivisions!=null)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),s=this.getDivisions(t);return{precision:e,subdivisions:s}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const s=this.getOptions(e),i=this.length(s)*t;return this.tAtLength(i,s)}tAtLength(t,e={}){let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getDivisions(e),o={precision:r,subdivisions:i};let a=null,l,u,h=0,f=0,d=0;const g=i.length;let p=g>0?1/g:0;for(let b=0;b<g;b+=1){const w=s?b:g-1-b,x=i[b],v=x.endpointDistance();if(t<=d+v){a=x,l=w*p,u=(w+1)*p,h=s?t-d:v+d-t,f=s?v+d-t:t-d;break}d+=v}if(a==null)return s?1:0;const m=this.length(o),y=Math.pow(10,-r);for(;;){let b;if(b=m!==0?h/m:0,b<y)return l;if(b=m!==0?f/m:0,b<y)return u;let w,x;const v=a.divide(.5);p/=2;const S=v[0].endpointDistance(),E=v[1].endpointDistance();h<=S?(a=v[0],u-=p,w=h,x=S-w):(a=v[1],l+=p,w=h-S,x=E-w),h=w,f=x}}toPoints(t={}){const e=this.getDivisions(t),s=[e[0].start.clone()];return e.forEach(r=>s.push(r.end.clone())),s}toPolyline(t={}){return new zt(this.toPoints(t))}scale(t,e,s){return this.start.scale(t,e,s),this.controlPoint1.scale(t,e,s),this.controlPoint2.scale(t,e,s),this.end.scale(t,e,s),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return t!=null&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new Vt(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function t(e){return e!=null&&e instanceof n}n.isCurve=t})(Vt||(Vt={})),function(n){function t(r){const i=r.length,o=[],a=[];let l=2;o[0]=r[0]/l;for(let u=1;u<i;u+=1)a[u]=1/l,l=(u<i-1?4:3.5)-a[u],o[u]=(r[u]-o[u-1])/l;for(let u=1;u<i;u+=1)o[i-u-1]-=a[i-u]*o[i-u];return o}function e(r){const i=r.map(d=>O.clone(d)),o=[],a=[],l=i.length-1;if(l===1)return o[0]=new O((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new O(2*o[0].x-i[0].x,2*o[0].y-i[0].y),[o,a];const u=[];for(let d=1;d<l-1;d+=1)u[d]=4*i[d].x+2*i[d+1].x;u[0]=i[0].x+2*i[1].x,u[l-1]=(8*i[l-1].x+i[l].x)/2;const h=t(u);for(let d=1;d<l-1;d+=1)u[d]=4*i[d].y+2*i[d+1].y;u[0]=i[0].y+2*i[1].y,u[l-1]=(8*i[l-1].y+i[l].y)/2;const f=t(u);for(let d=0;d<l;d+=1)o.push(new O(h[d],f[d])),d<l-1?a.push(new O(2*i[d+1].x-h[d+1],2*i[d+1].y-f[d+1])):a.push(new O((i[l].x+h[l-1])/2,(i[l].y+f[l-1])/2));return[o,a]}function s(r){if(r==null||Array.isArray(r)&&r.length<2)throw new Error("At least 2 points are required");const i=e(r),o=[];for(let a=0,l=i[0].length;a<l;a+=1){const u=new O(i[0][a].x,i[0][a].y),h=new O(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,h,r[a+1]))}return o}n.throughPoints=s}(Vt||(Vt={}));class Ka extends ys{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const s=this.length();return t>=1?s:s*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class fe extends Ka{constructor(t,e){super(),W.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=O.create(t,e).round(2)}get type(){return"L"}get line(){return new W(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new fe(e[0]),new fe(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new fe(e[0]),new fe(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new fe(this.end)}scale(t,e,s){return this.end.scale(t,e,s),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(n){function t(...e){const s=e.length,r=e[0];if(W.isLine(r))return new n(r);if(O.isPointLike(r))return s===1?new n(r):e.map(o=>new n(o));if(s===2)return new n(+e[0],+e[1]);const i=[];for(let o=0;o<s;o+=2){const a=+e[o],l=+e[o+1];i.push(new n(a,l))}return i}n.create=t})(fe||(fe={}));class zr extends Ka{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new W(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new fe(e[0]):this.clone(),new fe(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new fe(e[0]):this.clone(),new fe(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new zr}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function t(){return new n}n.create=t})(zr||(zr={}));class Fr extends Ka{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,W.isLine(t)||Vt.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=O.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,s){return this.end.scale(t,e,s),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}clone(){return new Fr(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(n){function t(...e){const s=e.length,r=e[0];if(W.isLine(r))return new n(r);if(Vt.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===1)return new n(r);const o=[];for(let a=0;a<s;a+=1)a===0?o.push(new n(e[a])):o.push(new fe(e[a]));return o}if(s===2)return new n(+e[0],+e[1]);const i=[];for(let o=0;o<s;o+=2){const a=+e[o],l=+e[o+1];o===0?i.push(new n(a,l)):i.push(new fe(a,l))}return i}n.create=t})(Fr||(Fr={}));class He extends Ka{constructor(t,e,s,r,i,o){super(),Vt.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):typeof t=="number"?(this.controlPoint1=new O(t,e).round(2),this.controlPoint2=new O(s,r).round(2),this.endPoint=new O(i,o).round(2)):(this.controlPoint1=O.create(t).round(2),this.controlPoint2=O.create(e).round(2),this.endPoint=O.create(s).round(2))}get type(){return"C"}get curve(){return new Vt(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const s=this.curve.divideAt(t,e);return[new He(s[0]),new He(s[1])]}divideAtLength(t,e={}){const s=this.curve.divideAtLength(t,e);return[new He(s[0]),new He(s[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new He(e[0]),new He(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(s)&&s.equals(r))}scale(t,e,s){return this.controlPoint1.scale(t,e,s),this.controlPoint2.scale(t,e,s),this.end.scale(t,e,s),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new He(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,s=this.end;return[this.type,t.x,t.y,e.x,e.y,s.x,s.y].join(" ")}}(function(n){function t(...e){const s=e.length,r=e[0];if(Vt.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===3)return new n(e[0],e[1],e[2]);const o=[];for(let a=0;a<s;a+=3)o.push(new n(e[a],e[a+1],e[a+2]));return o}if(s===6)return new n(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let o=0;o<s;o+=6)i.push(new n(e[o],e[o+1],e[o+2],e[o+3],e[o+4],e[o+5]));return i}n.create=t})(He||(He={}));function Za(n,t,e){return{x:n*Math.cos(e)-t*Math.sin(e),y:n*Math.sin(e)+t*Math.cos(e)}}function Py(n,t,e,s,r,i){const o=.3333333333333333,a=2/3;return[o*n+a*e,o*t+a*s,o*r+a*e,o*i+a*s,r,i]}function Ay(n,t,e,s,r,i,o,a,l,u){const h=Math.PI*120/180,f=Math.PI/180*(+r||0);let d=[],g,p,m,y,b;if(u)p=u[0],m=u[1],y=u[2],b=u[3];else{g=Za(n,t,-f),n=g.x,t=g.y,g=Za(a,l,-f),a=g.x,l=g.y;const j=(n-a)/2,A=(t-l)/2;let P=j*j/(e*e)+A*A/(s*s);P>1&&(P=Math.sqrt(P),e=P*e,s=P*s);const L=e*e,V=s*s,Y=(i===o?-1:1)*Math.sqrt(Math.abs((L*V-L*A*A-V*j*j)/(L*A*A+V*j*j)));y=Y*e*A/s+(n+a)/2,b=Y*-s*j/e+(t+l)/2,p=Math.asin((t-b)/s),m=Math.asin((l-b)/s),p=n<y?Math.PI-p:p,m=a<y?Math.PI-m:m,p<0&&(p=Math.PI*2+p),m<0&&(m=Math.PI*2+m),o&&p>m&&(p-=Math.PI*2),!o&&m>p&&(m-=Math.PI*2)}let w=m-p;if(Math.abs(w)>h){const j=m,A=a,P=l;m=p+h*(o&&m>p?1:-1),a=y+e*Math.cos(m),l=b+s*Math.sin(m),d=Ay(a,l,e,s,r,0,o,A,P,[m,j,y,b])}w=m-p;const x=Math.cos(p),v=Math.sin(p),S=Math.cos(m),E=Math.sin(m),C=Math.tan(w/4),M=4/3*(e*C),T=4/3*(s*C),k=[n,t],_=[n+M*v,t-T*x],D=[a+M*E,l-T*S],N=[a,l];if(_[0]=2*k[0]-_[0],_[1]=2*k[1]-_[1],u)return[_,D,N].concat(d);{d=[_,D,N].concat(d).join().split(",");const j=[],A=d.length;for(let P=0;P<A;P+=1)j[P]=P%2?Za(+d[P-1],+d[P],f).y:Za(+d[P],+d[P+1],f).x;return j}}function nI(n){if(!n)return null;const t=`
|
|
38
|
-
\v\f\r \u2028\u2029`,e=new RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),s=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return n.replace(e,(o,a,l)=>{const u=[];let h=a.toLowerCase();l.replace(s,(d,g)=>(g&&u.push(+g),d)),h==="m"&&u.length>2&&(i.push([a,...u.splice(0,2)]),h="l",a=a==="m"?"l":"L");const f=r[h];for(;u.length>=f&&(i.push([a,...u.splice(0,f)]),!!f););return o}),i}function sI(n){const t=nI(n);if(!t||!t.length)return[["M",0,0]];let e=0,s=0,r=0,i=0;const o=[];for(let a=0,l=t.length;a<l;a+=1){const u=[];o.push(u);const h=t[a],f=h[0];if(f!==f.toUpperCase())switch(u[0]=f.toUpperCase(),u[0]){case"A":u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5],u[6]=+h[6]+e,u[7]=+h[7]+s;break;case"V":u[1]=+h[1]+s;break;case"H":u[1]=+h[1]+e;break;case"M":r=+h[1]+e,i=+h[2]+s;for(let d=1,g=h.length;d<g;d+=1)u[d]=+h[d]+(d%2?e:s);break;default:for(let d=1,g=h.length;d<g;d+=1)u[d]=+h[d]+(d%2?e:s);break}else for(let d=0,g=h.length;d<g;d+=1)u[d]=h[d];switch(u[0]){case"Z":e=+r,s=+i;break;case"H":e=u[1];break;case"V":s=u[1];break;case"M":r=u[u.length-2],i=u[u.length-1],e=u[u.length-2],s=u[u.length-1];break;default:e=u[u.length-2],s=u[u.length-1];break}}return o}function rI(n){const t=sI(n),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function s(l,u,h){let f,d;if(!l)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(l[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),l[0]){case"M":u.X=l[1],u.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(Ay.apply(0,[u.x,u.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(f=u.x*2-u.bx,d=u.y*2-u.by):(f=u.x,d=u.y),["C",f,d].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(Py(u.x,u.y,u.qx,u.qy,l[1],l[2]));case"Q":return u.qx=l[1],u.qy=l[2],["C"].concat(Py(u.x,u.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],u.y);case"V":return["L"].concat(u.x,l[1])}return l}function r(l,u){if(l[u].length>7){l[u].shift();const h=l[u];for(;h.length;)i[u]="A",u+=1,l.splice(u,0,["C"].concat(h.splice(0,6)));l.splice(u,1),a=t.length}}const i=[];let o="",a=t.length;for(let l=0;l<a;l+=1){let u="";t[l]&&(u=t[l][0]),u!=="C"&&(i[l]=u,l>0&&(o=i[l-1])),t[l]=s(t[l],e,o),i[l]!=="A"&&u==="C"&&(i[l]="C"),r(t,l);const h=t[l],f=h.length;e.x=h[f-2],e.y=h[f-1],e.bx=parseFloat(h[f-4])||e.x,e.by=parseFloat(h[f-3])||e.y}return(!t[0][0]||t[0][0]!=="M")&&t.unshift(["M",0,0]),t}function iI(n){return rI(n).map(t=>t.map(e=>typeof e=="string"?e:wt.round(e,2))).join(",").split(",").join(" ")}class Z extends ys{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(W.isLine(t[0])||Vt.isCurve(t[0])){let e=null;t.forEach((r,i)=>{i===0&&this.appendSegment(Z.createSegment("M",r.start)),e!=null&&!e.end.equals(r.start)&&this.appendSegment(Z.createSegment("M",r.start)),W.isLine(r)?this.appendSegment(Z.createSegment("L",r.end)):Vt.isCurve(r)&&this.appendSegment(Z.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),e=r})}else t.forEach(s=>{s.isSegment&&this.appendSegment(s)});else t!=null&&(W.isLine(t)?(this.appendSegment(Z.createSegment("M",t.start)),this.appendSegment(Z.createSegment("L",t.end))):Vt.isCurve(t)?(this.appendSegment(Z.createSegment("M",t.start)),this.appendSegment(Z.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):zt.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((e,s)=>{const r=s===0?Z.createSegment("M",e):Z.createSegment("L",e);this.appendSegment(r)}):t.isSegment&&this.appendSegment(t))}get start(){const t=this.segments,e=t.length;if(e===0)return null;for(let s=0;s<e;s+=1){const r=t[s];if(r.isVisible)return r.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(e===0)return null;for(let s=e-1;s>=0;s-=1){const r=t[s];if(r.isVisible)return r.end}return t[e-1].end}moveTo(...t){return this.appendSegment(Fr.create.call(null,...t))}lineTo(...t){return this.appendSegment(fe.create.call(null,...t))}curveTo(...t){return this.appendSegment(He.create.call(null,...t))}arcTo(t,e,s,r,i,o,a){const l=this.end||new O,u=typeof o=="number"?Xa(l.x,l.y,t,e,s,r,i,o,a):Xa(l.x,l.y,t,e,s,r,i,o.x,o.y);if(u!=null)for(let h=0,f=u.length;h<f;h+=6)this.curveTo(u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return this}quadTo(t,e,s,r){const i=this.end||new O,o=["M",i.x,i.y];if(typeof t=="number")o.push("Q",t,e,s,r);else{const l=e;o.push("Q",t.x,t.y,l.x,l.y)}const a=Z.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(zr.create())}drawPoints(t,e={}){const s=My(t,e),r=Z.parse(s);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const t=this.segments,e=t.length;if(e===0)return null;let s;for(let i=0;i<e;i+=1){const o=t[i];if(o.isVisible){const a=o.bbox();a!=null&&(s=s?s.union(a):a)}}if(s!=null)return s;const r=t[e-1];return new z(r.end.x,r.end.y,0,0)}appendSegment(t){const e=this.segments.length;let s=e!==0?this.segments[e-1]:null,r;const i=null;if(Array.isArray(t))for(let o=0,a=t.length;o<a;o+=1){const l=t[o];r=this.prepareSegment(l,s,i),this.segments.push(r),s=r}else t!=null&&t.isSegment&&(r=this.prepareSegment(t,s,i),this.segments.push(r));return this}insertSegment(t,e){const s=this.segments.length;if(t<0&&(t=s+t+1),t>s||t<0)throw new Error("Index out of range.");let r,i=null,o=null;if(s!==0&&(t>=1?(i=this.segments[t-1],o=i.nextSegment):(i=null,o=this.segments[0])),!Array.isArray(e))r=this.prepareSegment(e,i,o),this.segments.splice(t,0,r);else for(let a=0,l=e.length;a<l;a+=1){const u=e[a];r=this.prepareSegment(u,i,o),this.segments.splice(t+a,0,r),i=r}return this}removeSegment(t){const e=this.fixIndex(t),s=this.segments.splice(e,1)[0],r=s.previousSegment,i=s.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),s.isSubpathStart&&i&&this.updateSubpathStartSegment(i),s}replaceSegment(t,e){const s=this.fixIndex(t);let r;const i=this.segments[s];let o=i.previousSegment;const a=i.nextSegment;let l=i.isSubpathStart;if(!Array.isArray(e))r=this.prepareSegment(e,o,a),this.segments.splice(s,1,r),l&&r.isSubpathStart&&(l=!1);else{this.segments.splice(t,1);for(let u=0,h=e.length;u<h;u+=1){const f=e[u];r=this.prepareSegment(f,o,a),this.segments.splice(t+u,0,r),o=r,l&&r.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(e===0)throw new Error("Path has no segments.");let s=t;for(;s<0;)s=e+s;if(s>=e||s<0)throw new Error("Index out of range.");return s}segmentAt(t,e={}){const s=this.segmentIndexAt(t,e);return s?this.getSegment(s):null}segmentAtLength(t,e={}){const s=this.segmentIndexAtLength(t,e);return s?this.getSegment(s):null}segmentIndexAt(t,e={}){if(this.segments.length===0)return null;const s=wt.clamp(t,0,1),r=this.getOptions(e),o=this.length(r)*s;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(t,e={}){const s=this.segments.length;if(s===0)return null;let r=!0;t<0&&(r=!1,t=-t);const i=this.getPrecision(e),o=this.getSubdivisions(e);let a=0,l=null;for(let u=0;u<s;u+=1){const h=r?u:s-1-u,f=this.segments[h],d=o[h],g=f.length({precision:i,subdivisions:d});if(f.isVisible){if(t<=a+g)return h;l=h}a+=g}return l}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),s=[];for(let r=0,i=this.segments.length;r<i;r+=1){const a=this.segments[r].getSubdivisions({precision:e});s.push(a)}return s}updateSubpathStartSegment(t){let e=t.previousSegment,s=t;for(;s&&!s.isSubpathStart;)e!=null?s.subpathStartSegment=e.subpathStartSegment:s.subpathStartSegment=null,e=s,s=s.nextSegment}prepareSegment(t,e,s){t.previousSegment=e,t.nextSegment=s,e!=null&&(e.nextSegment=t),s!=null&&(s.previousSegment=t);let r=t;return t.isSubpathStart&&(t.subpathStartSegment=t,r=s),r!=null&&this.updateSubpathStartSegment(r),t}closestPoint(t,e={}){const s=this.closestPointT(t,e);return s?this.pointAtT(s):null}closestPointLength(t,e={}){const s=this.getOptions(e),r=this.closestPointT(t,s);return r?this.lengthAtT(r,s):0}closestPointNormalizedLength(t,e={}){const s=this.getOptions(e),r=this.closestPointLength(t,s);if(r===0)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(t,e={}){if(this.segments.length===0)return null;const s=this.getPrecision(e),r=this.getSubdivisions(e);let i,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const u=this.segments[a],h=r[a];if(u.isVisible){const f=u.closestPointT(t,{precision:s,subdivisions:h}),d=u.pointAtT(f),g=wt.squaredLength(d,t);g<o&&(i={segmentIndex:a,value:f},o=g)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(this.segments.length===0)return null;const s=this.getPrecision(e),r=this.getSubdivisions(e);let i,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const u=this.segments[a],h=r[a];if(u.isDifferentiable()){const f=u.closestPointT(t,{precision:s,subdivisions:h}),d=u.pointAtT(f),g=wt.squaredLength(d,t);g<o&&(i=u.tangentAtT(f),o=g)}}return i||null}containsPoint(t,e={}){const s=this.toPolylines(e);if(!s)return!1;let r=0;for(let i=0,o=s.length;i<o;i+=1)s[i].containsPoint(t)&&(r+=1);return r%2===1}pointAt(t,e={}){if(this.segments.length===0)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const s=this.getOptions(e),i=this.length(s)*t;return this.pointAtLength(i,s)}pointAtLength(t,e={}){if(this.segments.length===0)return null;if(t===0)return this.start.clone();let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a=0;for(let u=0,h=this.segments.length;u<h;u+=1){const f=s?u:h-1-u,d=this.segments[f],g=i[f],p=d.length({precision:r,subdivisions:g});if(d.isVisible){if(t<=a+p)return d.pointAtLength((s?1:-1)*(t-a),{precision:r,subdivisions:g});o=d}a+=p}return o?s?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(t){const e=this.segments,s=e.length;if(s===0)return null;const r=t.segmentIndex;if(r<0)return e[0].pointAtT(0);if(r>=s)return e[s-1].pointAtT(1);const i=wt.clamp(t.value,0,1);return e[r].pointAtT(i)}divideAt(t,e={}){if(this.segments.length===0)return null;const s=wt.clamp(t,0,1),r=this.getOptions(e),o=this.length(r)*s;return this.divideAtLength(o,r)}divideAtLength(t,e={}){if(this.segments.length===0)return null;let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o=0,a,l,u,h,f;for(let S=0,E=this.segments.length;S<E;S+=1){const C=s?S:E-1-S,M=this.getSegment(C),T=i[C],k={precision:r,subdivisions:T},_=M.length(k);if(M.isDifferentiable()&&(u=M,h=C,t<=o+_)){l=C,a=M.divideAtLength((s?1:-1)*(t-o),k);break}o+=_}if(!u)return null;a||(l=h,f=s?1:0,a=u.divideAtT(f));const d=this.clone(),g=l;d.replaceSegment(g,a);const p=g;let m=g+1,y=g+2;a[0].isDifferentiable()||(d.removeSegment(p),m-=1,y-=1);const b=d.getSegment(m).start;d.insertSegment(m,Z.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(d.removeSegment(y-1),y-=1);const w=y-p-1;for(let S=y,E=d.segments.length;S<E;S+=1){const C=this.getSegment(S-w),M=d.getSegment(S);if(M.type==="Z"&&!C.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const T=Z.createSegment("L",C.end);d.replaceSegment(S,T)}}const x=new Z(d.segments.slice(0,m)),v=new Z(d.segments.slice(m));return[x,v]}intersectsWithLine(t,e={}){const s=this.toPolylines(e);if(s==null)return null;let r=null;for(let i=0,o=s.length;i<o;i+=1){const a=s[i],l=t.intersect(a);l&&(r==null&&(r=[]),Array.isArray(l)?r.push(...l):r.push(l))}return r}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1)if(this.segments[t].isDifferentiable())return!0;return!1}isValid(){const t=this.segments;return t.length===0||t[0].type==="M"}length(t={}){if(this.segments.length===0)return 0;const e=this.getSubdivisions(t);let s=0;for(let r=0,i=this.segments.length;r<i;r+=1){const o=this.segments[r],a=e[r];s+=o.length({subdivisions:a})}return s}lengthAtT(t,e={}){const s=this.segments.length;if(s===0)return 0;let r=t.segmentIndex;if(r<0)return 0;let i=wt.clamp(t.value,0,1);r>=s&&(r=s-1,i=1);const o=this.getPrecision(e),a=this.getSubdivisions(e);let l=0;for(let f=0;f<r;f+=1){const d=this.segments[f],g=a[f];l+=d.length({precision:o,subdivisions:g})}const u=this.segments[r],h=a[r];return l+=u.lengthAtT(i,{precision:o,subdivisions:h}),l}tangentAt(t,e={}){if(this.segments.length===0)return null;const s=wt.clamp(t,0,1),r=this.getOptions(e),o=this.length(r)*s;return this.tangentAtLength(o,r)}tangentAtLength(t,e={}){if(this.segments.length===0)return null;let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a=0;for(let l=0,u=this.segments.length;l<u;l+=1){const h=s?l:u-1-l,f=this.segments[h],d=i[h],g=f.length({precision:r,subdivisions:d});if(f.isDifferentiable()){if(t<=a+g)return f.tangentAtLength((s?1:-1)*(t-a),{precision:r,subdivisions:d});o=f}a+=g}if(o){const l=s?1:0;return o.tangentAtT(l)}return null}tangentAtT(t){const e=this.segments.length;if(e===0)return null;const s=t.segmentIndex;if(s<0)return this.segments[0].tangentAtT(0);if(s>=e)return this.segments[e-1].tangentAtT(1);const r=wt.clamp(t.value,0,1);return this.segments[s].tangentAtT(r)}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getSubdivisions(t={}){if(t.segmentSubdivisions==null){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),s=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:s}}toPoints(t={}){const e=this.segments,s=e.length;if(s===0)return null;const r=this.getSubdivisions(t),i=[];let o=[];for(let a=0;a<s;a+=1){const l=e[a];if(l.isVisible){const u=r[a];u.length>0?u.forEach(h=>o.push(h.start)):o.push(l.start)}else o.length>0&&(o.push(e[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(s=>new zt(s)):null}scale(t,e,s){return this.segments.forEach(r=>r.scale(t,e,s)),this}rotate(t,e){return this.segments.forEach(s=>s.rotate(t,e)),this}translate(t,e){return typeof t=="number"?this.segments.forEach(s=>s.translate(t,e)):this.segments.forEach(s=>s.translate(t)),this}clone(){const t=new Z;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(t==null)return!1;const e=this.segments,s=t.segments,r=e.length;if(s.length!==r)return!1;for(let i=0;i<r;i+=1){const o=e[i],a=s[i];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function t(e){return e!=null&&e instanceof n}n.isPath=t})(Z||(Z={})),function(n){function t(s){if(!s)return new n;const r=new n,i=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(s).match(i);if(o!=null)for(let a=0,l=o.length;a<l;a+=1){const u=o[a],h=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,f=u.match(h);if(f!=null){const d=f[0],g=f.slice(1).map(m=>+m),p=e.call(null,d,...g);r.appendSegment(p)}}return r}n.parse=t;function e(s,...r){if(s==="M")return Fr.create.call(null,...r);if(s==="L")return fe.create.call(null,...r);if(s==="C")return He.create.call(null,...r);if(s==="z"||s==="Z")return zr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=e}(Z||(Z={})),function(n){n.normalize=iI,n.isValid=QR,n.drawArc=eI,n.drawPoints=My,n.arcToCurves=Xa}(Z||(Z={}));class Ft{constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,s=!1){if(typeof t=="object"){Object.entries(t).forEach(([o,a])=>{this.register(o,a,e)});return}this.exist(t)&&!s&&!fs.isApplyingHMR()&&this.onDuplicated(t);const r=this.options.process,i=r?X(r,this,t,e):e;return this.data[t]=i,i}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return t?this.data[t]!=null:!1}onDuplicated(t){try{throw this.options.onConflict&&X(this.options.onConflict,this,t),new Error(`${ea(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const s=this.getSpellingSuggestionForName(t),r=e?`${e} ${s2(this.options.type)}`:this.options.type;return`${ea(r)} with name '${t}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(t){return iR(t,Object.keys(this.data),e=>e)}}(function(n){function t(e){return new n(e)}n.create=t})(Ft||(Ft={}));const oI=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,t){const e=t.thickness*t.sx,s=t.thickness*t.sy;ut(n,{width:e,height:s,rx:e,ry:s,fill:t.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,t){let e;const s=t.width,r=t.height,i=t.thickness;s-i>=0&&r-i>=0?e=["M",s,0,"H0 M0 0 V0",r].join(" "):e="M 0 0 0 0",ut(n,{d:e,stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,t){let e;const s=t.factor||1,r=t.width*s,i=t.height*s,o=t.thickness;r-o>=0&&i-o>=0?e=["M",r,0,"H0 M0 0 V0",i].join(" "):e="M 0 0 0 0",t.width=r,t.height=i,ut(n,{d:e,stroke:t.color,"stroke-width":t.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,t){const e=t.sx<=1?t.thickness*t.sx:t.thickness;ut(n,{width:e,height:e,rx:e,ry:e,fill:t.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,t){let e;const s=t.width,r=t.height,i=t.thickness;s-i>=0&&r-i>=0?e=["M",s,0,"H0 M0 0 V0",r].join(" "):e="M 0 0 0 0",ut(n,{d:e,stroke:t.color,"stroke-width":t.thickness})}}},Symbol.toStringTag,{value:"Module"}));class bs{constructor(){this.patterns={},this.root=tt.create(Ha(),{width:"100%",height:"100%"},[cn("defs")]).node}add(t,e){const s=this.root.childNodes[0];s&&s.appendChild(e),this.patterns[t]=e,tt.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return this.patterns[t]!=null}}(function(n){n.presets=oI,n.registry=Ft.create({type:"grid"}),n.registry.register(n.presets,!0)})(bs||(bs={}));const Ty=function(n){const t=document.createElement("canvas"),e=n.width,s=n.height;t.width=e*2,t.height=s;const r=t.getContext("2d");return r.drawImage(n,0,0,e,s),r.translate(2*e,0),r.scale(-1,1),r.drawImage(n,0,0,e,s),t},Ny=function(n){const t=document.createElement("canvas"),e=n.width,s=n.height;t.width=e,t.height=s*2;const r=t.getContext("2d");return r.drawImage(n,0,0,e,s),r.translate(0,2*s),r.scale(1,-1),r.drawImage(n,0,0,e,s),t},_y=function(n){const t=document.createElement("canvas"),e=n.width,s=n.height;t.width=2*e,t.height=2*s;const r=t.getContext("2d");return r.drawImage(n,0,0,e,s),r.setTransform(-1,0,0,-1,t.width,t.height),r.drawImage(n,0,0,e,s),r.setTransform(-1,0,0,1,t.width,0),r.drawImage(n,0,0,e,s),r.setTransform(1,0,0,-1,0,t.height),r.drawImage(n,0,0,e,s),t},aI=Object.freeze(Object.defineProperty({__proto__:null,flipX:Ty,flipXY:_y,flipY:Ny,watermark:function(n,t){const e=n.width,s=n.height,r=document.createElement("canvas");r.width=e*3,r.height=s*3;const i=r.getContext("2d"),o=t.angle!=null?-t.angle:-20,a=gt.toRad(o),l=r.width/4,u=r.height/4;for(let h=0;h<4;h+=1)for(let f=0;f<4;f+=1)(h+f)%2>0&&(i.setTransform(1,0,0,1,(2*h-1)*l,(2*f-1)*u),i.rotate(a),i.drawImage(n,-e/2,-s/2,e,s));return r}},Symbol.toStringTag,{value:"Module"}));var ro;(function(n){n.presets=Object.assign({},aI),n.presets["flip-x"]=Ty,n.presets["flip-y"]=Ny,n.presets["flip-xy"]=_y,n.registry=Ft.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(ro||(ro={}));function Ju(n,t){return n??t}function se(n,t){return n!=null&&Number.isFinite(n)?n:t}function lI(n={}){const t=Ju(n.color,"blue"),e=se(n.width,1),s=se(n.margin,2),r=se(n.opacity,1),i=s,o=s+e;return`
|
|
33
|
+
`):" "+Sm(i[0]):"as no adapter specified";throw new at("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:gu};function pu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Dr(null,n)}function Om(n){return pu(n),n.headers=Se.from(n.headers),n.data=du.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Em.getAdapter(n.adapter||Ui.adapter)(n).then(function(s){return pu(n),s.data=du.call(n,n.transformResponse,s),s.headers=Se.from(s.headers),s},function(s){return dm(s)||(pu(n),s&&s.response&&(s.response.data=du.call(n,n.transformResponse,s.response),s.response.headers=Se.from(s.response.headers))),Promise.reject(s)})}const Mm="1.7.7",mu={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{mu[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Pm={};mu.transitional=function(t,e,s){function r(i,o){return"[Axios v"+Mm+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(t===!1)throw new at(r(o," has been removed"+(e?" in "+e:"")),at.ERR_DEPRECATED);return e&&!Pm[o]&&(Pm[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(i,o,a):!0}};function TD(n,t,e){if(typeof n!="object")throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let r=s.length;for(;r-- >0;){const i=s[r],o=t[i];if(o){const a=n[i],l=a===void 0||o(a,i,n);if(l!==!0)throw new at("option "+i+" must be "+l,at.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new at("Unknown option "+i,at.ERR_BAD_OPTION)}}const yu={assertOptions:TD,validators:mu},us=yu.validators;class Ys{constructor(t){this.defaults=t,this.interceptors={request:new lm,response:new lm}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
34
|
+
`+i):s.stack=i}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Gs(this.defaults,e);const{transitional:s,paramsSerializer:r,headers:i}=e;s!==void 0&&yu.assertOptions(s,{silentJSONParsing:us.transitional(us.boolean),forcedJSONParsing:us.transitional(us.boolean),clarifyTimeoutError:us.transitional(us.boolean)},!1),r!=null&&(D.isFunction(r)?e.paramsSerializer={serialize:r}:yu.assertOptions(r,{encode:us.function,serialize:us.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=i&&D.merge(i.common,i[e.method]);i&&D.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),e.headers=Se.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(e)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let h,f=0,d;if(!l){const p=[Om.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,u),d=p.length,h=Promise.resolve(e);f<d;)h=h.then(p[f++],p[f++]);return h}d=a.length;let g=e;for(f=0;f<d;){const p=a[f++],m=a[f++];try{g=p(g)}catch(y){m.call(this,y);break}}try{h=Om.call(this,g)}catch(p){return Promise.reject(p)}for(f=0,d=u.length;f<d;)h=h.then(u[f++],u[f++]);return h}getUri(t){t=Gs(this.defaults,t);const e=mm(t.baseURL,t.url);return am(e,t.params,t.paramsSerializer)}}D.forEach(["delete","get","head","options"],function(t){Ys.prototype[t]=function(e,s){return this.request(Gs(s||{},{method:t,url:e,data:(s||{}).data}))}}),D.forEach(["post","put","patch"],function(t){function e(s){return function(i,o,a){return this.request(Gs(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Ys.prototype[t]=e(),Ys.prototype[t+"Form"]=e(!0)});class bu{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(i){e=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,a){s.reason||(s.reason=new Dr(i,o,a),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new bu(function(r){t=r}),cancel:t}}}function ND(n){return function(e){return n.apply(null,e)}}function _D(n){return D.isObject(n)&&n.isAxiosError===!0}const wu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wu).forEach(([n,t])=>{wu[t]=n});function Am(n){const t=new Ys(n),e=Gp(Ys.prototype.request,t);return D.extend(e,Ys.prototype,t,{allOwnKeys:!0}),D.extend(e,t,null,{allOwnKeys:!0}),e.create=function(r){return Am(Gs(n,r))},e}const Wt=Am(Ui);Wt.Axios=Ys,Wt.CanceledError=Dr,Wt.CancelToken=bu,Wt.isCancel=dm,Wt.VERSION=Mm,Wt.toFormData=Ia,Wt.AxiosError=at,Wt.Cancel=Wt.CanceledError,Wt.all=function(t){return Promise.all(t)},Wt.spread=ND,Wt.isAxiosError=_D,Wt.mergeConfig=Gs,Wt.AxiosHeaders=Se,Wt.formToJSON=n=>um(D.isHTMLForm(n)?new FormData(n):n),Wt.getAdapter=Em.getAdapter,Wt.HttpStatusCode=wu,Wt.default=Wt;const hs=Wt.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),kD=n=>{hs.defaults.baseURL=n},DD=n=>{hs.interceptors.request.use(t=>{if(n)return t.headers.token=n,t},t=>Promise.reject(t))};hs.interceptors.response.use(n=>(n.data.isOk=n.data.code===200,n.data),n=>{if(n.response)switch(n.response.status){}return Promise.reject(n)});const Yi=(n,t={})=>hs.get(n,{params:t}),$a=(n,t={})=>hs.post(n,t),Tm=(n,t={})=>hs.delete(n,{params:t}),RD=(n,t={})=>hs.post(n,t,{headers:{"Content-Type":"multipart/form-data"}}),Wi=(n,t)=>{const e=document.querySelector(n),s=e.querySelectorAll(".x6-port-body"),r=e.querySelectorAll(".x6-port-label");for(let i=0,o=s.length;i<o;i+=1)s[i].style.visibility=t?"visible":"hidden";for(let i=0,o=r.length;i<o;i+=1)r[i].style.visibility=t?"visible":"hidden"},Nm=n=>Yi("/cny/template/selectOne",{id:n}).then(t=>{if(t!=null&&t.isOk){const e=JSON.parse(t.data.remark);return{background:e.background,grid:e.grid,data:e.data}}else Yt.error((t==null?void 0:t.msg)||"获取失败")}),ID=n=>$a("/cny/custom/arrRealData",n).then(t=>{if(t!=null&&t.isOk)return t.data;Yt.error((t==null?void 0:t.msg)||"获取失败")}),_m={color:"#000000"},km={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},LD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},xu={position:"absolute",args:{x:0,y:0},attrs:{text:{fill:"#5174ff",fontSize:8},circle:{magnet:!0,stroke:"#5174ff",r:4}},label:{position:"top"}},BD={shape:"rect",label:"文本",width:50,height:30,attrs:{body:{fill:"#00000000",stroke:"#00000000",strokeWidth:1,rx:6,ry:6},text:{fill:"#ffffff"},label:{textAnchor:"start",x:-14,y:0}},data:{type:"text",content:"文本",field:[]},ports:{groups:{ports:{portOption:xu}}}},vu={line:{stroke:"#ffffff",strokeWidth:1,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}},Gn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},VD={class:"control"},jD={class:"row-column"},$D=Gn({__name:"index",props:{payload:Object},setup(n){var d,g,p,m,y,b,w,x,v,S,E,C,M,T,_,N,k,R,I,A,P;const t=n,e=c.ref(((d=t.payload.value.options.background)==null?void 0:d.color)||null),s=c.ref(((p=(g=t.payload.value.options)==null?void 0:g.grid)==null?void 0:p.visible)||null),r=c.ref(((y=(m=t.payload.value.options)==null?void 0:m.grid)==null?void 0:y.size)||10),i=c.ref(((v=(x=(w=(b=t.payload.value.options)==null?void 0:b.grid)==null?void 0:w.args)==null?void 0:x[0])==null?void 0:v.color)||null),o=c.ref(((M=(C=(E=(S=t.payload.value.options)==null?void 0:S.grid)==null?void 0:E.args)==null?void 0:C[0])==null?void 0:M.thickness)||1),a=c.ref(((k=(N=(_=(T=t.payload.value.options)==null?void 0:T.grid)==null?void 0:_.args)==null?void 0:N[1])==null?void 0:k.color)||null),l=c.ref(((P=(A=(I=(R=t.payload.value.options)==null?void 0:R.grid)==null?void 0:I.args)==null?void 0:A[1])==null?void 0:P.thickness)||1),u=c.ref("1"),h=B=>{t.payload.value.drawBackground({color:B})},f=()=>{t.payload.value.drawGrid({visible:s.value,size:r.value,type:"doubleMesh",args:[{color:i.value,thickness:o.value},{color:a.value,thickness:l.value}]})};return(B,j)=>{const Y=c.resolveComponent("el-col"),ot=c.resolveComponent("el-color-picker"),F=c.resolveComponent("el-row"),H=c.resolveComponent("el-switch"),V=c.resolveComponent("el-input-number"),K=c.resolveComponent("el-collapse-item"),nt=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",VD,[c.createVNode(nt,{modelValue:u.value,"onUpdate:modelValue":j[7]||(j[7]=rt=>u.value=rt),accordion:""},{default:c.withCtx(()=>[c.createVNode(K,{title:"基础属性",name:"1"},{default:c.withCtx(()=>[c.createElementVNode("div",jD,[c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[8]||(j[8]=[c.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(ot,{modelValue:e.value,"onUpdate:modelValue":j[0]||(j[0]=rt=>e.value=rt),size:"small","show-alpha":"",onChange:h},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[9]||(j[9]=[c.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(H,{modelValue:s.value,"onUpdate:modelValue":j[1]||(j[1]=rt=>s.value=rt),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[10]||(j[10]=[c.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(V,{modelValue:r.value,"onUpdate:modelValue":j[2]||(j[2]=rt=>r.value=rt),min:1,max:20,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[11]||(j[11]=[c.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(ot,{modelValue:i.value,"onUpdate:modelValue":j[3]||(j[3]=rt=>i.value=rt),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[12]||(j[12]=[c.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(ot,{modelValue:a.value,"onUpdate:modelValue":j[4]||(j[4]=rt=>a.value=rt),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[13]||(j[13]=[c.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(V,{modelValue:o.value,"onUpdate:modelValue":j[5]||(j[5]=rt=>o.value=rt),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(F,{gutter:20},{default:c.withCtx(()=>[c.createVNode(Y,{span:12},{default:c.withCtx(()=>j[14]||(j[14]=[c.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),c.createVNode(Y,{span:12},{default:c.withCtx(()=>[c.createVNode(V,{modelValue:l.value,"onUpdate:modelValue":j[6]||(j[6]=rt=>l.value=rt),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]),zD={class:"control"},FD={class:"row-column"},HD={class:"row-column"},Dm=Gn(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object},setup(n){var j,Y,ot,F;const t=n,e=c.ref((j=t.payload.attrs.label)!=null&&j.textAnchor?"0":"1"),s=c.ref([]),r=c.ref([]),i=()=>{Yi("/cny/custom/deviceList").then(H=>{s.value=H.data})},o=c.ref();let a=c.reactive({});const l=()=>{a=s.value.find(H=>H.deviceCode===o.value),a&&u()},u=()=>{Yi("/cny/custom/monitorInfo",{deviceCode:a.deviceCode,fieldType:1}).then(H=>{r.value=H.data})},h=/\$\{(.*?)\}/g,f=H=>H.replace(h,"--"),d=H=>{lk.confirm(`是否确定要添加${a.deviceName}-${H.name}?
|
|
35
|
+
添加后为:--${H.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const V=H.unit??"",K=t.payload.data.content;t.payload.data.content=g.value=K+"${"+a.deviceName+"."+H.name+"}"+V;const nt=K.match(h),rt=(nt==null?void 0:nt.length)||0;t.payload.data.field.push({index:rt,deviceName:a.deviceName,deviceCode:a.deviceCode,field:H.dataField}),t.payload.label=f(t.payload.data.content),console.log("label:",t.payload.label,"content:",t.payload.data.content,"field:",t.payload.data.field)})},g=c.ref(t.payload.data.content||null),p=c.ref(t.payload.attrs.body.fill||null),m=c.ref(t.payload.attrs.body.stroke||null),y=c.ref(t.payload.attrs.body.strokeWidth||null),b=c.ref(t.payload.attrs.body.rx||null),w=c.ref(t.payload.attrs.body.ry||null),x=c.ref(t.payload.attrs.text.fill||null),v=c.ref(t.payload.attrs.text.fontSize||null),S=c.ref(((Y=t.payload.attrs.label)==null?void 0:Y.textAnchor)||null),E=c.ref(((ot=t.payload.attrs.label)==null?void 0:ot.x)||null),C=c.ref(((F=t.payload.attrs.label)==null?void 0:F.y)||null),M=()=>{t.payload.attr("body/fill",p.value),t.payload.attr("body/stroke",m.value),t.payload.attr("body/strokeWidth",y.value),t.payload.attr("body/rx",b.value),t.payload.attr("body/ry",w.value),t.payload.attr("text/fill",x.value),t.payload.attr("text/fontSize",v.value),t.payload.attr("label/textAnchor",S.value),t.payload.attr("label/x",E.value),t.payload.attr("label/y",C.value)},T=c.ref(null),_=()=>{if(t.payload.data.content.length>g.value.length&&t.payload.data.content.endsWith("}")){const H=t.payload.data.content.match(h);if(H){const V=H.length-1;t.payload.data.field.splice(V,1),g.value=t.payload.data.content.substring(0,t.payload.data.content.lastIndexOf("${"))}}t.payload.data.content=g.value,t.payload.label=f(g.value)},N=()=>{if(T.value){const H=T.value.$refs.textarea;H.focus();const V=g.value.length;H.setSelectionRange(V,V)}},k=c.ref([]),R=()=>{k.value=JSON.parse(JSON.stringify(t.payload.getPorts().map(H=>({id:H.id,attrs:H.attrs,args:{x:Number(H.args.x.replace("%","")),y:Number(H.args.y.replace("%",""))}}))))},I=()=>{const H=xu;H.attrs.text.text=`${t.payload.getPorts().length+1}`,H.args.x="50%",H.args.y="50%",t.payload.addPorts([{group:"ports",...H}]),R()},A=()=>{Wi("#drawing-board",!0)},P=(H,V,K)=>{t.payload.portProp(H,"args/"+V,K+"%"),R()},B=H=>{t.payload.removePort(H),R()};return c.onMounted(()=>{R(),i(),document.addEventListener("selectionchange",()=>{document.activeElement.tagName==="TEXTAREA"&&N()})}),(H,V)=>{const K=c.resolveComponent("el-input"),nt=c.resolveComponent("el-alert"),rt=c.resolveComponent("el-option"),et=c.resolveComponent("el-select"),ft=c.resolveComponent("el-table-column"),ge=c.resolveComponent("el-table"),St=c.resolveComponent("el-collapse-item"),xt=c.resolveComponent("el-col"),An=c.resolveComponent("el-color-picker"),pe=c.resolveComponent("el-row"),dn=c.resolveComponent("el-input-number"),Ts=c.resolveComponent("el-button"),Ns=c.resolveComponent("el-slider"),ai=c.resolveComponent("el-icon"),li=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",zD,[c.createVNode(li,{modelValue:e.value,"onUpdate:modelValue":V[12]||(V[12]=st=>e.value=st),accordion:""},{default:c.withCtx(()=>[n.payload.data.type==="text"?(c.openBlock(),c.createBlock(St,{key:0,title:"文本内容",name:"0"},{default:c.withCtx(()=>[c.createVNode(K,{ref_key:"inputRef",ref:T,type:"textarea",modelValue:g.value,"onUpdate:modelValue":V[0]||(V[0]=st=>g.value=st),onInput:_,onFocus:N,rows:10},null,8,["modelValue"]),c.createVNode(nt,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),c.createVNode(et,{modelValue:o.value,"onUpdate:modelValue":V[1]||(V[1]=st=>o.value=st),placeholder:"请选择设备",onChange:l,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,st=>(c.openBlock(),c.createBlock(rt,{key:st.deviceCode,label:st.deviceName,value:st.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),c.createVNode(ge,{data:r.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:d},{default:c.withCtx(()=>[c.createVNode(ft,{type:"index",label:"序号",width:"50",align:"center"}),c.createVNode(ft,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),c.createVNode(ft,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),c.createVNode(ft,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):c.createCommentVNode("",!0),c.createVNode(St,{title:"图形设置",name:"1"},{default:c.withCtx(()=>[c.createElementVNode("div",FD,[c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[13]||(V[13]=[c.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(An,{modelValue:p.value,"onUpdate:modelValue":V[2]||(V[2]=st=>p.value=st),"show-alpha":!0,size:"small",onChange:M},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[14]||(V[14]=[c.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(An,{modelValue:m.value,"onUpdate:modelValue":V[3]||(V[3]=st=>m.value=st),"show-alpha":!0,size:"small",onChange:M},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[15]||(V[15]=[c.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:y.value,"onUpdate:modelValue":V[4]||(V[4]=st=>y.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[16]||(V[16]=[c.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:b.value,"onUpdate:modelValue":V[5]||(V[5]=st=>b.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[17]||(V[17]=[c.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:w.value,"onUpdate:modelValue":V[6]||(V[6]=st=>w.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(c.openBlock(),c.createBlock(St,{key:1,title:"文字设置",name:"2"},{default:c.withCtx(()=>[c.createElementVNode("div",HD,[c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[18]||(V[18]=[c.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(An,{modelValue:x.value,"onUpdate:modelValue":V[7]||(V[7]=st=>x.value=st),"show-alpha":!0,size:"small",onChange:M},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[19]||(V[19]=[c.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:v.value,"onUpdate:modelValue":V[8]||(V[8]=st=>v.value=st),size:"small","controls-position":"right",onChange:M,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[20]||(V[20]=[c.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(et,{modelValue:S.value,"onUpdate:modelValue":V[9]||(V[9]=st=>S.value=st),size:"small",onChange:M},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(["start","middle","end"],st=>c.createVNode(rt,{key:st,label:st,value:st},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[21]||(V[21]=[c.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:E.value,"onUpdate:modelValue":V[10]||(V[10]=st=>E.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(pe,{gutter:20},{default:c.withCtx(()=>[c.createVNode(xt,{span:12},{default:c.withCtx(()=>V[22]||(V[22]=[c.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),c.createVNode(xt,{span:12},{default:c.withCtx(()=>[c.createVNode(dn,{modelValue:C.value,"onUpdate:modelValue":V[11]||(V[11]=st=>C.value=st),size:"small","controls-position":"right",onChange:M,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):c.createCommentVNode("",!0),c.createVNode(St,{title:"连接桩设置",name:"3"},{default:c.withCtx(()=>[c.createVNode(Ts,{type:"primary",onClick:I,size:"small"},{default:c.withCtx(()=>V[23]||(V[23]=[c.createTextVNode("添加连接桩")])),_:1}),c.createVNode(Ts,{type:"primary",onClick:A,size:"small"},{default:c.withCtx(()=>V[24]||(V[24]=[c.createTextVNode("显示连接桩")])),_:1}),c.createVNode(ge,{data:k.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:c.withCtx(()=>[c.createVNode(ft,{label:"ID",width:"50",align:"center"},{default:c.withCtx(({row:st})=>[c.createTextVNode(c.toDisplayString(st.attrs.text.text),1)]),_:1}),c.createVNode(ft,{label:"x",width:"100",align:"center"},{default:c.withCtx(({row:st})=>[c.createVNode(Ns,{modelValue:st.args.x,"onUpdate:modelValue":ie=>st.args.x=ie,min:0,max:100,step:1,onInput:ie=>P(st.id,"x",ie)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(ft,{label:"y",width:"100",align:"center"},{default:c.withCtx(({row:st})=>[c.createVNode(Ns,{modelValue:st.args.y,"onUpdate:modelValue":ie=>st.args.y=ie,min:0,max:100,step:1,onInput:ie=>P(st.id,"y",ie)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(ft,{label:"操作",align:"center"},{default:c.withCtx(({row:st})=>[c.createVNode(Ts,{type:"danger",size:"small",onClick:ie=>B(st.id)},{default:c.withCtx(()=>[c.createVNode(ai,null,{default:c.withCtx(()=>[c.createVNode(c.unref(wg))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-764721f9"]]),UD={class:"container"},GD={class:"row-column"},YD={class:"row-column"},WD={class:"row-column"},qD=Gn({__name:"index",props:{payload:Object},setup(n){var l,u,h,f;const t=n,e=c.ref(t.payload.attrs.line.stroke),s=c.reactive({name:((l=t.payload.attrs.line.sourceMarker)==null?void 0:l.name)??null,args:((u=t.payload.attrs.line.sourceMarker)==null?void 0:u.args)??{}}),r=c.reactive({name:((h=t.payload.attrs.line.targetMarker)==null?void 0:h.name)??null,args:((f=t.payload.attrs.line.targetMarker)==null?void 0:f.args)??{}}),i=[{label:"Block",value:"block"},{label:"Classic",value:"classic"},{label:"Diamond",value:"diamond"},{label:"Cross",value:"cross"},{label:"Async",value:"async"},{label:"Circle",value:"circle"},{label:"CirclePlus",value:"circlePlus"},{label:"Ellipse",value:"ellipse"}],o=c.ref("0"),a=()=>{t.payload.attr("line/stroke",e.value),t.payload.attr("line/sourceMarker/name",s.name),t.payload.attr("line/sourceMarker/args",s.args),t.payload.attr("line/targetMarker/name",r.name),t.payload.attr("line/targetMarker/args",r.args),vu.line=t.payload.attrs.line};return(d,g)=>{const p=c.resolveComponent("el-col"),m=c.resolveComponent("el-color-picker"),y=c.resolveComponent("el-row"),b=c.resolveComponent("el-collapse-item"),w=c.resolveComponent("el-option"),x=c.resolveComponent("el-select"),v=c.resolveComponent("el-input-number"),S=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",UD,[c.createVNode(S,{modelValue:o.value,"onUpdate:modelValue":g[9]||(g[9]=E=>o.value=E),accordion:""},{default:c.withCtx(()=>[c.createVNode(b,{title:"线段设置",name:"0"},{default:c.withCtx(()=>[c.createElementVNode("div",GD,[c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[10]||(g[10]=[c.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(m,{modelValue:e.value,"onUpdate:modelValue":g[0]||(g[0]=E=>e.value=E),"show-alpha":!0,size:"small",onChange:a},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),c.createVNode(b,{title:"箭头1设置",name:"1"},{default:c.withCtx(()=>[c.createElementVNode("div",YD,[c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[11]||(g[11]=[c.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(x,{modelValue:s.name,"onUpdate:modelValue":g[1]||(g[1]=E=>s.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,E=>c.createVNode(w,{key:E.value,label:E.label,value:E.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[12]||(g[12]=[c.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:s.args.width,"onUpdate:modelValue":g[2]||(g[2]=E=>s.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[13]||(g[13]=[c.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:s.args.height,"onUpdate:modelValue":g[3]||(g[3]=E=>s.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[14]||(g[14]=[c.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:s.args.offset,"onUpdate:modelValue":g[4]||(g[4]=E=>s.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),c.createVNode(b,{title:"箭头2设置",name:"2"},{default:c.withCtx(()=>[c.createElementVNode("div",WD,[c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[15]||(g[15]=[c.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(x,{modelValue:r.name,"onUpdate:modelValue":g[5]||(g[5]=E=>r.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,E=>c.createVNode(w,{key:E.value,label:E.label,value:E.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[16]||(g[16]=[c.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:r.args.width,"onUpdate:modelValue":g[6]||(g[6]=E=>r.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[17]||(g[17]=[c.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:r.args.height,"onUpdate:modelValue":g[7]||(g[7]=E=>r.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),c.createVNode(y,{gutter:20},{default:c.withCtx(()=>[c.createVNode(p,{span:12},{default:c.withCtx(()=>g[18]||(g[18]=[c.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),c.createVNode(p,{span:12},{default:c.withCtx(()=>[c.createVNode(v,{modelValue:r.args.offset,"onUpdate:modelValue":g[8]||(g[8]=E=>r.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-19905aaf"]]),JD={class:"form-container"},XD=Gn({__name:"Shortcuts",setup(n){const t=c.ref([{name:"复制",windowsKey:"Ctrl + C",macKey:"Command + C"},{name:"粘贴",windowsKey:"Ctrl + V",macKey:"Command + V"},{name:"撤销",windowsKey:"Ctrl + Z",macKey:"Command + Z"},{name:"重做",windowsKey:"Ctrl + Y",macKey:"Command + Y"},{name:"框选",windowsKey:"Alt + LMB",macKey:"option + LMB"},{name:"多选",windowsKey:"Alt + LMB",macKey:"Command + LMB"}]);return(e,s)=>{const r=c.resolveComponent("el-table-column"),i=c.resolveComponent("el-table");return c.openBlock(),c.createElementBlock("div",JD,[c.createVNode(i,{data:t.value,size:"small",border:""},{default:c.withCtx(()=>[c.createVNode(r,{prop:"name",label:"名称"}),c.createVNode(r,{prop:"windowsKey",label:"windows"}),c.createVNode(r,{prop:"macKey",label:"mac"})]),_:1},8,["data"])])}}},[["__scopeId","data-v-99982d47"]]);typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&function(n){n.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...e){const s=document.createDocumentFragment();e.forEach(r=>{const i=r instanceof Node;s.appendChild(i?r:document.createTextNode(String(r)))}),this.appendChild(s)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);class ye{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function t(){return(e,s,r)=>{const i=r.value,o=e.__proto__;r.value=function(...a){this.disposed||(i.call(this,...a),o.dispose.call(this))}}}n.dispose=t})(ye||(ye={}));class Rm{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(t=>{t.dispose()}),this.items.clear())}contains(t){return this.items.has(t)}add(t){this.items.add(t)}remove(t){this.items.delete(t)}clear(){this.items.clear()}}(function(n){function t(e){const s=new n;return e.forEach(r=>{s.add(r)}),s}n.from=t})(Rm||(Rm={}));function Im(n,t,e){if(e)switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2]);case 4:return n.call(t,e[0],e[1],e[2],e[3]);case 5:return n.call(t,e[0],e[1],e[2],e[3],e[4]);case 6:return n.call(t,e[0],e[1],e[2],e[3],e[4],e[5]);default:return n.apply(t,e)}return n.call(t)}function X(n,t,...e){return Im(n,t,e)}function KD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Cu(n){return n!=null&&(n instanceof Promise||KD(n))}function Su(...n){const t=[];if(n.forEach(s=>{Array.isArray(s)?t.push(...s):t.push(s)}),t.some(s=>Cu(s))){const s=t.map(r=>Cu(r)?r:Promise.resolve(r!==!1));return Promise.all(s).then(r=>r.reduce((i,o)=>o!==!1&&i,!0))}return t.every(s=>s!==!1)}function ZD(...n){const t=Su(n);return typeof t=="boolean"?Promise.resolve(t):t}function Eu(n,t){const e=[];for(let s=0;s<n.length;s+=2){const r=n[s],i=n[s+1],o=Array.isArray(t)?t:[t],a=Im(r,i,o);e.push(a)}return Su(e)}class QD{constructor(){this.listeners={}}on(t,e,s){return e==null?this:(this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e,s),this)}once(t,e,s){const r=(...i)=>(this.off(t,r),Eu([e,s],i));return this.on(t,r,this)}off(t,e,s){if(!(t||e||s))return this.listeners={},this;const r=this.listeners;return(t?[t]:Object.keys(r)).forEach(o=>{const a=r[o];if(a){if(!(e||s)){delete r[o];return}for(let l=a.length-2;l>=0;l-=2)e&&a[l]!==e||s&&a[l+1]!==s||a.splice(l,2)}}),this}trigger(t,...e){let s=!0;if(t!=="*"){const i=this.listeners[t];i!=null&&(s=Eu([...i],e))}const r=this.listeners["*"];return r!=null?Su([s,Eu([...r],[t,...e])]):s}emit(t,...e){return this.trigger(t,...e)}}function tR(n,...t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(e.prototype,s))})})}const eR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])};function nR(n,t){eR(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}class sR{}const rR=/^\s*class\s+/.test(`${sR}`)||/^\s*class\s*\{/.test(`${class{}}`);function Ou(n,t){let e;return rR?e=class extends t{}:(e=function(){return t.apply(this,arguments)},nR(e,t)),Object.defineProperty(e,"name",{value:n}),e}function Lm(n){return n==="__proto__"}function Mu(n,t,e="/"){let s;const r=Array.isArray(t)?t:t.split(e);if(r.length)for(s=n;r.length;){const i=r.shift();if(Object(s)===s&&i&&i in s)s=s[i];else return}return s}function Rr(n,t,e,s="/"){const r=Array.isArray(t)?t:t.split(s),i=r.pop();if(i&&!Lm(i)){let o=n;r.forEach(a=>{Lm(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=e}return n}function Bm(n,t,e="/"){const s=Array.isArray(t)?t.slice():t.split(e),r=s.pop();if(r)if(s.length>0){const i=Mu(n,s);i&&delete i[r]}else delete n[r];return n}var iR=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Nt extends QD{dispose(){this.off()}}iR([ye.dispose()],Nt.prototype,"dispose",null),function(n){n.dispose=ye.dispose}(Nt||(Nt={})),tR(Nt,ye);const Vm=n=>{const t=Object.create(null);return e=>t[e]||(t[e]=n(e))},jm=Vm(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),Pu=Vm(n=>S2(na(n)).replace(/ /g,""));function Au(n){let t=2166136261,e=!1,s=n;for(let r=0,i=s.length;r<i;r+=1){let o=s.charCodeAt(r);o>127&&!e&&(s=unescape(encodeURIComponent(s)),o=s.charCodeAt(r),e=!0),t^=o,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)}return t>>>0}function za(){let n="";const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let e=0,s=t.length;e<s;e+=1){const r=t[e],i=Math.random()*16|0,o=r==="x"?i:r==="y"?i&3|8:r;n+=o.toString(16)}return n}function oR(n,t,e){const s=Math.min(2,Math.floor(n.length*.34));let r=Math.floor(n.length*.4)+1,i,o=!1;const a=n.toLowerCase();for(const l of t){const u=e(l);if(u!==void 0&&Math.abs(u.length-a.length)<=s){const h=u.toLowerCase();if(h===a){if(u===n)continue;return l}if(o||u.length<3)continue;const f=aR(a,h,r-1);if(f===void 0)continue;f<3?(o=!0,i=l):(r=f,i=l)}}return i}function aR(n,t,e){let s=new Array(t.length+1),r=new Array(t.length+1);const i=e+1;for(let a=0;a<=t.length;a+=1)s[a]=a;for(let a=1;a<=n.length;a+=1){const l=n.charCodeAt(a-1),u=a>e?a-e:1,h=t.length>e+a?e+a:t.length;r[0]=a;let f=a;for(let g=1;g<u;g+=1)r[g]=i;for(let g=u;g<=h;g+=1){const p=l===t.charCodeAt(g-1)?s[g-1]:Math.min(s[g]+1,r[g-1]+1,s[g-1]+2);r[g]=p,f=Math.min(f,p)}for(let g=h+1;g<=t.length;g+=1)r[g]=i;if(f>e)return;const d=s;s=r,r=d}const o=s[t.length];return o>e?void 0:o}function Yn(n){return typeof n=="string"&&n.slice(-1)==="%"}function an(n,t){if(n==null)return 0;let e;if(typeof n=="string"){if(e=parseFloat(n),Yn(n)&&(e/=100,Number.isFinite(e)))return e*t}else e=n;return Number.isFinite(e)?e>0&&e<1?e*t:e:0}function ds(n){if(typeof n=="object"){let e=0,s=0,r=0,i=0;return n.vertical!=null&&Number.isFinite(n.vertical)&&(s=i=n.vertical),n.horizontal!=null&&Number.isFinite(n.horizontal)&&(r=e=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(e=n.left),n.top!=null&&Number.isFinite(n.top)&&(s=n.top),n.right!=null&&Number.isFinite(n.right)&&(r=n.right),n.bottom!=null&&Number.isFinite(n.bottom)&&(i=n.bottom),{top:s,right:r,bottom:i,left:e}}let t=0;return n!=null&&Number.isFinite(n)&&(t=n),{top:t,right:t,bottom:t,left:t}}let Tu=!1,$m=!1,zm=!1,Fm=!1,Hm=!1,Um=!1,Gm=!1,Ym=!1,Wm=!1,qm=!1,Jm=!1,Xm=!1,Km=!1,Zm=!1,Qm=!1,ty=!1;if(typeof navigator=="object"){const n=navigator.userAgent;Tu=n.indexOf("Macintosh")>=0,$m=!!n.match(/(iPad|iPhone|iPod)/g),zm=n.indexOf("Windows")>=0,Fm=n.indexOf("MSIE")>=0,Hm=!!n.match(/Trident\/7\./),Um=!!n.match(/Edge\//),Gm=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,Wm=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,qm=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,Jm=n.indexOf("Firefox/")>=0,Xm=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(ty=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(Ym=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,Zm=window.PointerEvent!=null&&!Tu),typeof document=="object"){Km="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){Qm=!0}}),t=document.createElement("div");t.addEventListener&&t.addEventListener("click",()=>{},n)}catch{}}var fs;(function(n){n.IS_MAC=Tu,n.IS_IOS=$m,n.IS_WINDOWS=zm,n.IS_IE=Fm,n.IS_IE11=Hm,n.IS_EDGE=Um,n.IS_NETSCAPE=Gm,n.IS_CHROME_APP=Ym,n.IS_CHROME=Wm,n.IS_OPERA=qm,n.IS_FIREFOX=Jm,n.IS_SAFARI=Xm,n.SUPPORT_TOUCH=Km,n.SUPPORT_POINTER=Zm,n.SUPPORT_PASSIVE=Qm,n.NO_FOREIGNOBJECT=ty,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(fs||(fs={})),function(n){function t(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}n.getHMRStatus=t;function e(){return t()==="apply"}n.isApplyingHMR=e;const s={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function r(i){const o=document.createElement(s[i]||"div"),a=`on${i}`;let l=a in o;return l||(o.setAttribute(a,"return;"),l=typeof o[a]=="function"),l}n.isEventSupported=r}(fs||(fs={}));const Nu=/[\t\r\n\f]/g,_u=/\S+/g,Ir=n=>` ${n} `;function Lr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function Sn(n,t){if(n==null||t==null)return!1;const e=Ir(Lr(n)),s=Ir(t);return n.nodeType===1?e.replace(Nu," ").includes(s):!1}function J(n,t){if(!(n==null||t==null)){if(typeof t=="function")return J(n,t(Lr(n)));if(typeof t=="string"&&n.nodeType===1){const e=t.match(_u)||[],s=Ir(Lr(n)).replace(Nu," ");let r=e.reduce((i,o)=>i.indexOf(Ir(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function Dt(n,t){if(n!=null){if(typeof t=="function")return Dt(n,t(Lr(n)));if((!t||typeof t=="string")&&n.nodeType===1){const e=(t||"").match(_u)||[],s=Ir(Lr(n)).replace(Nu," ");let r=e.reduce((i,o)=>{const a=Ir(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=t?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function ln(n,t,e){if(!(n==null||t==null)){if(e!=null&&typeof t=="string"){e?J(n,t):Dt(n,t);return}if(typeof t=="function")return ln(n,t(Lr(n),e),e);typeof t=="string"&&(t.match(_u)||[]).forEach(r=>{Sn(n,r)?Dt(n,r):J(n,r)})}}let ey=0;function lR(){return ey+=1,`v${ey}`}function ku(n){return(n.id==null||n.id==="")&&(n.id=lR()),n.id}function gs(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const ee={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},ny="1.1";function sy(n,t=document){return t.createElement(n)}function Du(n,t=ee.xhtml,e=document){return e.createElementNS(t,n)}function cn(n,t=document){return Du(n,ee.svg,t)}function Fa(n){if(n){const e=`<svg xmlns="${ee.svg}" xmlns:xlink="${ee.xlink}" version="${ny}">${n}</svg>`,{documentElement:s}=cR(e,{async:!1});return s}const t=document.createElementNS(ee.svg,"svg");return t.setAttributeNS(ee.xmlns,"xmlns:xlink",ee.xlink),t.setAttribute("version",ny),t}function cR(n,t={}){let e;try{const s=new DOMParser;if(t.async!=null){const r=s;r.async=t.async}e=s.parseFromString(n,t.mimeType||"text/xml")}catch{e=void 0}if(!e||e.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return e}function uR(n,t=!0){const e=n.nodeName;return t?e.toLowerCase():e.toUpperCase()}function Ru(n){let t=0,e=n.previousSibling;for(;e;)e.nodeType===1&&(t+=1),e=e.previousSibling;return t}function hR(n,t){return n.querySelectorAll(t)}function dR(n,t){return n.querySelector(t)}function ry(n,t,e){const s=n.ownerSVGElement;let r=n.parentNode;for(;r&&r!==e&&r!==s;){if(Sn(r,t))return r;r=r.parentNode}return null}function Iu(n,t){const e=t&&t.parentNode;return n===e||!!(e&&e.nodeType===1&&n.compareDocumentPosition(e)&16)}function ze(n){n&&(Array.isArray(n)?n:[n]).forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})}function qi(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Ne(n,t){(Array.isArray(t)?t:[t]).forEach(s=>{s!=null&&n.appendChild(s)})}function iy(n,t){const e=n.firstChild;return e?Lu(e,t):Ne(n,t)}function Lu(n,t){const e=n.parentNode;e&&(Array.isArray(t)?t:[t]).forEach(r=>{r!=null&&e.insertBefore(r,n)})}function ps(n,t){t!=null&&t.appendChild(n)}function oy(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function fR(n,t){const e=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!t||Sn(s,t))&&e.push(s);return e}const ay=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function gR(n,t){return n.getAttribute(t)}function Bu(n,t){const e=cy(t);e.ns?n.hasAttributeNS(e.ns,e.local)&&n.removeAttributeNS(e.ns,e.local):n.hasAttribute(t)&&n.removeAttribute(t)}function Vu(n,t,e){if(e==null)return Bu(n,t);const s=cy(t);s.ns&&typeof e=="string"?n.setAttributeNS(s.ns,t,e):t==="id"?n.id=`${e}`:n.setAttribute(t,`${e}`)}function ly(n,t){Object.keys(t).forEach(e=>{Vu(n,e,t[e])})}function ut(n,t,e){if(t==null){const s=n.attributes,r={};for(let i=0;i<s.length;i+=1)r[s[i].name]=s[i].value;return r}if(typeof t=="string"&&e===void 0)return n.getAttribute(t);typeof t=="object"?ly(n,t):Vu(n,t,e)}function cy(n){if(n.indexOf(":")!==-1){const t=n.split(":");return{ns:ee[t[0]],local:t[1]}}return{ns:null,local:n}}function Ji(n){const t={};return Object.keys(n).forEach(e=>{const s=ay.includes(e)?e:jm(e);t[s]=n[e]}),t}function Ha(n){const t={};return n.split(";").forEach(s=>{const r=s.trim();if(r){const i=r.split("=");i.length&&(t[i[0].trim()]=i[1]?i[1].trim():"")}}),t}function ju(n,t){return Object.keys(t).forEach(e=>{if(e==="class")n[e]=n[e]?`${n[e]} ${t[e]}`:t[e];else if(e==="style"){const s=typeof n[e]=="object",r=typeof t[e]=="object";let i,o;s&&r?(i=n[e],o=t[e]):s?(i=n[e],o=Ha(t[e])):r?(i=Ha(n[e]),o=t[e]):(i=Ha(n[e]),o=Ha(t[e])),n[e]=ju(i,o)}else n[e]=t[e]}),n}function pR(n,t,e={}){const s=e.offset||0,r=[],i=[];let o,a,l=null;for(let u=0;u<n.length;u+=1){o=i[u]=n[u];for(let h=0,f=t.length;h<f;h+=1){const d=t[h],g=d.start+s,p=d.end+s;u>=g&&u<p&&(typeof o=="string"?o=i[u]={t:n[u],attrs:d.attrs}:o.attrs=ju(ju({},o.attrs),d.attrs),e.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(h)))}a=i[u-1],a?Lt(o)&&Lt(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(r.push(l),l=o)):Lt(o)||Lt(a)?(l=l,r.push(l),l=o):l=(l||"")+o:l=o}return l!=null&&r.push(l),r}function mR(n){return n.replace(/ /g," ")}var Ws;(function(n){function t(u){const h="data:";return u.substr(0,h.length)===h}n.isDataUrl=t;function e(u,h){if(!u||t(u)){setTimeout(()=>h(null,u));return}const f=()=>{h(new Error(`Failed to load image: ${u}`))},d=window.FileReader?p=>{if(p.status===200){const m=new FileReader;m.onload=y=>{const b=y.target.result;h(null,b)},m.onerror=f,m.readAsDataURL(p.response)}else f()}:p=>{const m=y=>{const w=[];for(let x=0;x<y.length;x+=32768)w.push(String.fromCharCode.apply(null,y.subarray(x,x+32768)));return w.join("")};if(p.status===200){let y=u.split(".").pop()||"png";y==="svg"&&(y="svg+xml");const b=`data:image/${y};base64,`,w=new Uint8Array(p.response),x=b+btoa(m(w));h(null,x)}else f()},g=new XMLHttpRequest;g.responseType=window.FileReader?"blob":"arraybuffer",g.open("GET",u,!0),g.addEventListener("error",f),g.addEventListener("load",()=>d(g)),g.send()}n.imageToDataUri=e;function s(u){let h=u.replace(/\s/g,"");h=decodeURIComponent(h);const f=h.indexOf(","),d=h.slice(0,f),g=d.split(":")[1].split(";")[0],p=h.slice(f+1);let m;d.indexOf("base64")>=0?m=atob(p):m=unescape(encodeURIComponent(p));const y=new Uint8Array(m.length);for(let b=0;b<m.length;b+=1)y[b]=m.charCodeAt(b);return new Blob([y],{type:g})}n.dataUriToBlob=s;function r(u,h){const f=window.navigator.msSaveBlob;if(f)f(u,h);else{const d=window.URL.createObjectURL(u),g=document.createElement("a");g.href=d,g.download=h,document.body.appendChild(g),g.click(),document.body.removeChild(g),window.URL.revokeObjectURL(d)}}n.downloadBlob=r;function i(u,h){const f=s(u);r(f,h)}n.downloadDataUri=i;function o(u){const h=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return h&&h[2]?h[2].replace(/\s+/," ").split(" "):null}function a(u){const h=parseFloat(u);return Number.isNaN(h)?null:h}function l(u,h={}){let f=null;const d=x=>(f==null&&(f=o(u)),f!=null?a(f[x]):null),g=x=>{const v=u.match(x);return v&&v[2]?a(v[2]):null};let p=h.width;if(p==null&&(p=g(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),p==null&&(p=d(2)),p==null)throw new Error("Can not parse width from svg string");let m=h.height;if(m==null&&(m=g(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),m==null&&(m=d(3)),m==null)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(u).replace(/'/g,"%27").replace(/"/g,"%22")}`}n.svgToDataUrl=l})(Ws||(Ws={}));let qs;const yR={px(n){return n},mm(n){return qs*n},cm(n){return qs*n*10},in(n){return qs*n*25.4},pt(n){return qs*(25.4*n/72)},pc(n){return qs*(25.4*n/6)}};var uy;(function(n){function t(s,r,i){const o=document.createElement("div"),a=o.style;a.display="inline-block",a.position="absolute",a.left="-15000px",a.top="-15000px",a.width=s+(i||"px"),a.height=r+(i||"px"),document.body.appendChild(o);const l=o.getBoundingClientRect(),u={width:l.width||0,height:l.height||0};return document.body.removeChild(o),u}n.measure=t;function e(s,r){qs==null&&(qs=t("1","1","mm").width);const i=r?yR[r]:null;return i?i(s):s}n.toPx=e})(uy||(uy={}));const bR=/-(.)/g;function wR(n){return n.replace(bR,(t,e)=>e.toUpperCase())}const $u={},hy=["webkit","ms","moz","o"],dy=typeof document<"u"?document.createElement("div").style:{};function xR(n){for(let t=0;t<hy.length;t+=1){const e=hy[t]+n;if(e in dy)return e}return null}function vR(n){const t=wR(n);if($u[t]==null){const e=t.charAt(0).toUpperCase()+t.slice(1);$u[t]=t in dy?t:xR(e)}return $u[t]}function fy(n,t){const e=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return e&&t?e.getPropertyValue(t)||e[t]:e}const CR={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function SR(n){return/^--/.test(n)}function ER(n,t,e){const s=window.getComputedStyle(n,null);return e?s.getPropertyValue(t)||void 0:s[t]||n.style[t]}function OR(n,t){return!CR[n]&&typeof t=="number"?`${t}px`:t}function qt(n,t,e){if(typeof t=="string"){const s=SR(t);if(s||(t=vR(t)),e===void 0)return ER(n,t,s);s||(e=OR(t,e));const r=n.style;s?r.setProperty(t,e):r[t]=e;return}for(const s in t)qt(n,s,t[s])}const Ua=new WeakMap;function gy(n,t){const e=na(t),s=Ua.get(n);if(s)return s[e]}function MR(n,t,e){const s=na(t),r=Ua.get(n);r?r[s]=e:Ua.set(n,{[s]:e})}function Js(n,t,e){if(!t){const s={};return Object.keys(Ua).forEach(r=>{s[r]=gy(n,r)}),s}if(typeof t=="string"){if(e===void 0)return gy(n,t);MR(n,t,e);return}for(const s in t)Js(n,s,t[s])}class tt{get[Symbol.toStringTag](){return tt.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}constructor(t,e,s){if(!t)throw new TypeError("Invalid element to create vector");let r;if(tt.isVector(t))r=t.node;else if(typeof t=="string")if(t.toLowerCase()==="svg")r=Fa();else if(t[0]==="<"){const i=Fa(t);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(ee.svg,t);else r=t;this.node=r,e&&this.setAttributes(e),s&&this.append(s)}transform(t,e){return t==null?Vr(this.node):(Vr(this.node,t,e),this)}translate(t,e=0,s={}){return t==null?Sy(this.node):(Sy(this.node,t,e,s),this)}rotate(t,e,s,r={}){return t==null?Hu(this.node):(Hu(this.node,t,e,s,r),this)}scale(t,e){return t==null?Uu(this.node):(Uu(this.node,t,e),this)}getTransformToElement(t){const e=tt.toNode(t);return Qi(this.node,e)}removeAttribute(t){return Bu(this.node,t),this}getAttribute(t){return gR(this.node,t)}setAttribute(t,e){return Vu(this.node,t,e),this}setAttributes(t){return ly(this.node,t),this}attr(t,e){return t==null?ut(this.node):typeof t=="string"&&e===void 0?ut(this.node,t):(typeof t=="object"?ut(this.node,t):ut(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:tt.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?tt.create(e):tt.create("defs").appendTo(t)}text(t,e={}){return my(this.node,t,e),this}tagName(){return uR(this.node)}clone(){return tt.create(this.node.cloneNode(!0))}remove(){return ze(this.node),this}empty(){return qi(this.node),this}append(t){return Ne(this.node,tt.toNodes(t)),this}appendTo(t){return ps(this.node,tt.isVector(t)?t.node:t),this}prepend(t){return iy(this.node,tt.toNodes(t)),this}before(t){return Lu(this.node,tt.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(tt.toNode(t),this.node),tt.create(t)}first(){return this.node.firstChild?tt.create(this.node.firstChild):null}last(){return this.node.lastChild?tt.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?tt.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(tt.toNode(t))}find(t){const e=[],s=hR(this.node,t);if(s)for(let r=0,i=s.length;r<i;r+=1)e.push(tt.create(s[r]));return e}findOne(t){const e=dR(this.node,t);return e?tt.create(e):null}findParentByClass(t,e){const s=ry(this.node,t,e);return s?tt.create(s):null}matches(t){const e=this.node;this.node.matches;const s=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return s&&s.call(e,t)}contains(t){return Iu(this.node,tt.isVector(t)?t.node:t)}wrap(t){const e=tt.create(t),s=this.node.parentNode;return s!=null&&s.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(e.node.parentNode==null)return null;if(e=tt.create(e.node.parentNode),t==null)return e;do if(typeof t=="string"?e.matches(t):e instanceof t)return e;while(e=tt.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let s=0;s<t.length;s+=1)t[s].nodeType===1&&e.push(tt.create(t[s]));return e}eachChild(t,e){const s=this.children();for(let r=0,i=s.length;r<i;r+=1)t.call(s[r],s[r],r,s),e&&s[r].eachChild(t,e);return this}index(){return Ru(this.node)}hasClass(t){return Sn(this.node,t)}addClass(t){return J(this.node,t),this}removeClass(t){return Dt(this.node,t),this}toggleClass(t,e){return ln(this.node,t,e),this}toLocalPoint(t,e){return YR(this.node,t,e)}sample(t=1){return this.node instanceof SVGPathElement?NR(this.node,t):[]}toPath(){return tt.create(BR(this.node))}toPathData(){return vy(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function t(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],l=o;return(a==null||a===n.toStringTag)&&l.node instanceof SVGElement&&typeof l.sample=="function"&&typeof l.toPath=="function"}n.isVector=t;function e(o,a,l){return new n(o,a,l)}n.create=e;function s(o){if(o[0]==="<"){const a=Fa(o),l=[];for(let u=0,h=a.childNodes.length;u<h;u+=1){const f=a.childNodes[u];l.push(e(document.importNode(f,!0)))}return l}return[e(o)]}n.createVectors=s;function r(o){return t(o)?o.node:o}n.toNode=r;function i(o){return Array.isArray(o)?o.map(a=>r(a)):[r(o)]}n.toNodes=i})(tt||(tt={}));function PR(n,t){const e=tt.create(t),s=tt.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=tt.create("path").attr("d",r).appendTo(e.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function AR(n,t,e){const s=e.eol,r=e.baseSize,i=e.lineHeight;let o=0,a;const l={},u=t.length-1;for(let h=0;h<=u;h+=1){let f=t[h],d=null;if(typeof f=="object"){const g=f.attrs,p=tt.create("tspan",g);a=p.node;let m=f.t;s&&h===u&&(m+=s),a.textContent=m;const y=g.class;y&&p.addClass(y),e.includeAnnotationIndices&&p.attr("annotations",f.annotations.join(",")),d=parseFloat(g["font-size"]),d===void 0&&(d=r),d&&d>o&&(o=d)}else s&&h===u&&(f+=s),a=document.createTextNode(f||" "),r&&r>o&&(o=r);n.appendChild(a)}return o&&(l.maxFontSize=o),i?l.lineHeight=i:o&&(l.lineHeight=o*1.2),l}const py=/em$/;function Ga(n,t){const e=parseFloat(n);return py.test(n)?e*t:e}function TR(n,t,e,s){if(!Array.isArray(t))return 0;const r=t.length;if(!r)return 0;let i=t[0];const o=Ga(i.maxFontSize,e)||e;let a=0;const l=Ga(s,e);for(let f=1;f<r;f+=1){i=t[f];const d=Ga(i.lineHeight,e)||l;a+=d}const u=Ga(i.maxFontSize,e)||e;let h;switch(n){case"middle":h=o/2-.15*u-a/2;break;case"bottom":h=-(.25*u)-a;break;case"top":default:h=.8*o;break}return h}function my(n,t,e={}){t=mR(t);const s=e.eol;let r=e.textPath;const i=e.textVerticalAnchor,o=i==="middle"||i==="bottom"||i==="top";let a=e.x;a===void 0&&(a=n.getAttribute("x")||0);const l=e.includeAnnotationIndices;let u=e.annotations;u&&!Array.isArray(u)&&(u=[u]);const h=e.lineHeight,f=h==="auto",d=f?"1.5em":h||"1em";let g=!0;const p=n.childNodes;if(p.length===1){const T=p[0];T&&T.tagName.toUpperCase()==="TITLE"&&(g=!1)}g&&qi(n),ut(n,{"xml:space":"preserve",display:t||e.displayEmpty?null:"none"});const m=ut(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&ut(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=PR(r,n)):b=document.createDocumentFragment();let w,x=0,v;const S=t.split(`
|
|
36
|
+
`),E=[],C=S.length-1;for(let T=0;T<=C;T+=1){w=d;let _="v-line";const N=cn("tspan");let k,R=S[T];if(R)if(u){const I=pR(R,u,{offset:-x,includeAnnotationIndices:l});k=AR(N,I,{eol:T!==C&&s,baseSize:y,lineHeight:f?null:d,includeAnnotationIndices:l});const A=k.lineHeight;A&&f&&T!==0&&(w=A),T===0&&(v=k.maxFontSize*.8)}else s&&T!==C&&(R+=s),N.textContent=R;else{N.textContent="-",_+=" v-empty-line";const I=N.style;I.fillOpacity=0,I.strokeOpacity=0,u&&(k={})}k&&E.push(k),T>0&&N.setAttribute("dy",w),(T>0||r)&&N.setAttribute("x",a),N.className.baseVal=_,b.appendChild(N),x+=R.length+1}if(o)if(u)w=TR(i,E,y,d);else if(i==="top")w="0.8em";else{let T;switch(C>0?(T=parseFloat(d)||1,T*=C,py.test(d)||(T/=y)):T=0,i){case"middle":w=`${.3-T/2}em`;break;case"bottom":w=`${-T-.3}em`;break}}else i===0?w="0em":i?w=i:(w=0,n.getAttribute("y")==null&&n.setAttribute("y",`${v||"0.8em"}`));b.firstChild.setAttribute("dy",w),n.appendChild(b)}function Xi(n,t={}){const e=document.createElement("canvas").getContext("2d");if(!n)return{width:0};const s=[],r=t["font-size"]?`${parseFloat(t["font-size"])}px`:"14px";return s.push(t["font-style"]||"normal"),s.push(t["font-variant"]||"normal"),s.push(t["font-weight"]||400),s.push(r),s.push(t["font-family"]||"sans-serif"),e.font=s.join(" "),e.measureText(n)}function yy(n,t,e,s={}){if(t>=e)return[n,""];const r=n.length,i={};let o=Math.round(t/e*r-1);for(o<0&&(o=0);o>=0&&o<r;){const a=n.slice(0,o),l=i[a]||Xi(a,s).width,u=n.slice(0,o+1),h=i[u]||Xi(u,s).width;if(i[a]=l,i[u]=h,l>t)o-=1;else if(h<=t)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function by(n,t,e={},s={}){const r=t.width,i=t.height,o=s.eol||`
|
|
37
|
+
`,a=e.fontSize||14,l=e.lineHeight?parseFloat(e.lineHeight):Math.ceil(a*1.4),u=Math.floor(i/l);if(n.indexOf(o)>-1){const y=za(),b=[];return n.split(o).map(w=>{const x=by(w,Object.assign(Object.assign({},t),{height:Number.MAX_SAFE_INTEGER}),e,Object.assign(Object.assign({},s),{eol:y}));x&&b.push(...x.split(y))}),b.slice(0,u).join(o)}const{width:h}=Xi(n,e);if(h<r)return n;const f=[];let d=n,g=h,p=s.ellipsis,m=0;p&&(typeof p!="string"&&(p="…"),m=Xi(p,e).width);for(let y=0;y<u;y+=1)if(g>r)if(y===u-1){const[w]=yy(d,r-m,g,e);f.push(p?`${w}${p}`:w)}else{const[w,x]=yy(d,r,g,e);f.push(w),d=x,g=Xi(d,e).width}else{f.push(d);break}return f.join(o)}const zu=.551784;function ae(n,t,e=NaN){const s=n.getAttribute(t);if(s==null)return e;const r=parseFloat(s);return Number.isNaN(r)?e:r}function NR(n,t=1){const e=n.getTotalLength(),s=[];let r=0,i;for(;r<e;)i=n.getPointAtLength(r),s.push({distance:r,x:i.x,y:i.y}),r+=t;return s}function _R(n){return["M",ae(n,"x1"),ae(n,"y1"),"L",ae(n,"x2"),ae(n,"y2")].join(" ")}function kR(n){const t=Ya(n);return t.length===0?null:`${wy(t)} Z`}function DR(n){const t=Ya(n);return t.length===0?null:wy(t)}function wy(n){return`M ${n.map(e=>`${e.x} ${e.y}`).join(" L")}`}function Ya(n){const t=[],e=n.points;if(e)for(let s=0,r=e.numberOfItems;s<r;s+=1)t.push(e.getItem(s));return t}function RR(n){const t=ae(n,"cx",0),e=ae(n,"cy",0),s=ae(n,"r"),r=s*zu;return["M",t,e-s,"C",t+r,e-s,t+s,e-r,t+s,e,"C",t+s,e+r,t+r,e+s,t,e+s,"C",t-r,e+s,t-s,e+r,t-s,e,"C",t-s,e-r,t-r,e-s,t,e-s,"Z"].join(" ")}function IR(n){const t=ae(n,"cx",0),e=ae(n,"cy",0),s=ae(n,"rx"),r=ae(n,"ry")||s,i=s*zu,o=r*zu;return["M",t,e-r,"C",t+i,e-r,t+s,e-o,t+s,e,"C",t+s,e+o,t+i,e+r,t,e+r,"C",t-i,e+r,t-s,e+o,t-s,e,"C",t-s,e-o,t-i,e-r,t,e-r,"Z"].join(" ")}function LR(n){return xy({x:ae(n,"x",0),y:ae(n,"y",0),width:ae(n,"width",0),height:ae(n,"height",0),rx:ae(n,"rx",0),ry:ae(n,"ry",0)})}function xy(n){let t;const e=n.x,s=n.y,r=n.width,i=n.height,o=Math.min(n.rx||n["top-rx"]||0,r/2),a=Math.min(n.rx||n["bottom-rx"]||0,r/2),l=Math.min(n.ry||n["top-ry"]||0,i/2),u=Math.min(n.ry||n["bottom-ry"]||0,i/2);return o||a||l||u?t=["M",e,s+l,"v",i-l-u,"a",a,u,0,0,0,a,u,"h",r-2*a,"a",a,u,0,0,0,a,-u,"v",-(i-u-l),"a",o,l,0,0,0,-o,-l,"h",-(r-2*o),"a",o,l,0,0,0,-o,l,"Z"]:t=["M",e,s,"H",e+r,"V",s+i,"H",e,"V",s,"Z"],t.join(" ")}function BR(n){const t=cn("path");ut(t,ut(n));const e=vy(n);return e&&t.setAttribute("d",e),t}function vy(n){const t=n.tagName.toLowerCase();switch(t){case"path":return n.getAttribute("d");case"line":return _R(n);case"polygon":return kR(n);case"polyline":return DR(n);case"ellipse":return IR(n);case"circle":return RR(n);case"rect":return LR(n)}throw new Error(`"${t}" cannot be converted to svg path element.`)}const VR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Cy=/[ ,]+/,jR=/^(\w+)\((.*)\)/;function $R(n,t){const s=cn("svg").createSVGPoint();return s.x=n,s.y=t,s}function ne(n){const e=cn("svg").createSVGMatrix();if(n!=null){const s=n,r=e;for(const i in s)r[i]=s[i]}return e}function Ki(n){const t=cn("svg");return n!=null?(n instanceof DOMMatrix||(n=ne(n)),t.createSVGTransformFromMatrix(n)):t.createSVGTransform()}function Zi(n){let t=ne();const e=n!=null&&n.match(VR);if(!e)return t;for(let s=0,r=e.length;s<r;s+=1){const o=e[s].match(jR);if(o){let a,l,u,h,f,d=ne();const g=o[2].split(Cy);switch(o[1].toLowerCase()){case"scale":a=parseFloat(g[0]),l=g[1]===void 0?a:parseFloat(g[1]),d=d.scaleNonUniform(a,l);break;case"translate":u=parseFloat(g[0]),h=parseFloat(g[1]),d=d.translate(u,h);break;case"rotate":f=parseFloat(g[0]),u=parseFloat(g[1])||0,h=parseFloat(g[2])||0,u!==0||h!==0?d=d.translate(u,h).rotate(f).translate(-u,-h):d=d.rotate(f);break;case"skewx":f=parseFloat(g[0]),d=d.skewX(f);break;case"skewy":f=parseFloat(g[0]),d=d.skewY(f);break;case"matrix":d.a=parseFloat(g[0]),d.b=parseFloat(g[1]),d.c=parseFloat(g[2]),d.d=parseFloat(g[3]),d.e=parseFloat(g[4]),d.f=parseFloat(g[5]);break;default:continue}t=t.multiply(d)}}return t}function Br(n){const t=n||{},e=t.a!=null?t.a:1,s=t.b!=null?t.b:0,r=t.c!=null?t.c:0,i=t.d!=null?t.d:1,o=t.e!=null?t.e:0,a=t.f!=null?t.f:0;return`matrix(${e},${s},${r},${i},${o},${a})`}function Wa(n){let t,e,s;if(n){const i=Cy;if(n.trim().indexOf("matrix")>=0){const o=Zi(n),a=zR(o);t=[a.translateX,a.translateY],e=[a.rotation],s=[a.scaleX,a.scaleY];const l=[];(t[0]!==0||t[1]!==0)&&l.push(`translate(${t.join(",")})`),(s[0]!==1||s[1]!==1)&&l.push(`scale(${s.join(",")})`),e[0]!==0&&l.push(`rotate(${e[0]})`),n=l.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(t=o[1].split(i));const a=n.match(/rotate\((.*?)\)/);a&&(e=a[1].split(i));const l=n.match(/scale\((.*?)\)/);l&&(s=l[1].split(i))}}const r=s&&s[0]?parseFloat(s[0]):1;return{raw:n||"",translation:{tx:t&&t[0]?parseInt(t[0],10):0,ty:t&&t[1]?parseInt(t[1],10):0},rotation:{angle:e&&e[0]?parseInt(e[0],10):0,cx:e&&e[1]?parseInt(e[1],10):void 0,cy:e&&e[2]?parseInt(e[2],10):void 0},scale:{sx:r,sy:s&&s[1]?parseFloat(s[1]):r}}}function Fu(n,t){const e=t.x*n.a+t.y*n.c+0,s=t.x*n.b+t.y*n.d+0;return{x:e,y:s}}function zR(n){const t=Fu(n,{x:0,y:1}),e=Fu(n,{x:1,y:0}),s=180/Math.PI*Math.atan2(t.y,t.x)-90,r=180/Math.PI*Math.atan2(e.y,e.x);return{skewX:s,skewY:r,translateX:n.e,translateY:n.f,scaleX:Math.sqrt(n.a*n.a+n.b*n.b),scaleY:Math.sqrt(n.c*n.c+n.d*n.d),rotation:s}}function FR(n){let t,e,s,r;return n?(t=n.a==null?1:n.a,r=n.d==null?1:n.d,e=n.b,s=n.c):t=r=1,{sx:e?Math.sqrt(t*t+e*e):t,sy:s?Math.sqrt(s*s+r*r):r}}function HR(n){let t={x:0,y:1};n&&(t=Fu(n,t));const e=180*Math.atan2(t.y,t.x)/Math.PI%360-90;return{angle:e%360+(e<0?360:0)}}function UR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Vr(n,t,e={}){if(t==null)return Zi(ut(n,"transform"));if(e.absolute){n.setAttribute("transform",Br(t));return}const s=n.transform,r=Ki(t);s.baseVal.appendItem(r)}function Sy(n,t,e=0,s={}){let r=ut(n,"transform");const i=Wa(r);if(t==null)return i.translation;r=i.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=s.absolute?t:i.translation.tx+t,a=s.absolute?e:i.translation.ty+e,l=`translate(${o},${a})`;n.setAttribute("transform",`${l} ${r}`.trim())}function Hu(n,t,e,s,r={}){let i=ut(n,"transform");const o=Wa(i);if(t==null)return o.rotation;i=o.raw,i=i.replace(/rotate\([^)]*\)/g,"").trim(),t%=360;const a=r.absolute?t:o.rotation.angle+t,l=e!=null&&s!=null?`,${e},${s}`:"",u=`rotate(${a}${l})`;n.setAttribute("transform",`${i} ${u}`.trim())}function Uu(n,t,e){let s=ut(n,"transform");const r=Wa(s);if(t==null)return r.scale;e=e??t,s=r.raw,s=s.replace(/scale\([^)]*\)/g,"").trim();const i=`scale(${t},${e})`;n.setAttribute("transform",`${s} ${i}`.trim())}function Qi(n,t){if(gs(t)&&gs(n)){const e=t.getScreenCTM(),s=n.getScreenCTM();if(e&&s)return e.inverse().multiply(s)}return ne()}function GR(n,t){let e=ne();if(gs(t)&&gs(n)){let s=n;const r=[];for(;s&&s!==t;){const i=s.getAttribute("transform")||null,o=Zi(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{e=e.multiply(i)})}return e}function YR(n,t,e){const s=n instanceof SVGSVGElement?n:n.ownerSVGElement,r=s.createSVGPoint();r.x=t,r.y=e;try{const i=s.getScreenCTM(),o=r.matrixTransform(i.inverse()),a=Qi(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var Fe;(function(n){const t={};function e(i){return t[i]||{}}n.get=e;function s(i,o){t[i]=o}n.register=s;function r(i){delete t[i]}n.unregister=r})(Fe||(Fe={}));var Xs;(function(n){const t=new WeakMap;function e(i){return t.has(i)||t.set(i,{events:Object.create(null)}),t.get(i)}n.ensure=e;function s(i){return t.get(i)}n.get=s;function r(i){return t.delete(i)}n.remove=r})(Xs||(Xs={}));var it;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function t(r){r.stopPropagation()}n.stopPropagationCallback=t;function e(r,i,o){r.addEventListener!=null&&r.addEventListener(i,o)}n.addEventListener=e;function s(r,i,o){r.removeEventListener!=null&&r.removeEventListener(i,o)}n.removeEventListener=s})(it||(it={})),function(n){const t=/[^\x20\t\r\n\f]+/g,e=/^([^.]*)(?:\.(.+)|)/;function s(a){return(a||"").match(t)||[""]}n.splitType=s;function r(a){const l=e.exec(a)||[];return{originType:l[1]?l[1].trim():l[1],namespaces:l[2]?l[2].split(".").map(u=>u.trim()).sort():[]}}n.normalizeType=r;function i(a){return a.nodeType===1||a.nodeType===9||!+a.nodeType}n.isValidTarget=i;function o(a,l){if(l){const u=a;return u.querySelector!=null&&u.querySelector(l)!=null}return!0}n.isValidSelector=o}(it||(it={})),function(n){let t=0;const e=new WeakMap;function s(a){return e.has(a)||(e.set(a,t),t+=1),e.get(a)}n.ensureHandlerId=s;function r(a){return e.get(a)}n.getHandlerId=r;function i(a){return e.delete(a)}n.removeHandlerId=i;function o(a,l){return e.set(a,l)}n.setHandlerId=o}(it||(it={})),function(n){function t(e,s){const r=[],i=Xs.get(e),o=i&&i.events&&i.events[s.type],a=o&&o.handlers||[],l=o?o.delegateCount:0;if(l>0&&!(s.type==="click"&&typeof s.button=="number"&&s.button>=1)){for(let u=s.target;u!==e;u=u.parentNode||e)if(u.nodeType===1&&!(s.type==="click"&&u.disabled===!0)){const h=[],f={};for(let d=0;d<l;d+=1){const g=a[d],p=g.selector;if(p!=null&&f[p]==null){const m=e,y=[];m.querySelectorAll(p).forEach(b=>{y.push(b)}),f[p]=y.includes(u)}f[p]&&h.push(g)}h.length&&r.push({elem:u,handlers:h})}}return l<a.length&&r.push({elem:e,handlers:a.slice(l)}),r}n.getHandlerQueue=t}(it||(it={})),function(n){function t(e){return e!=null&&e===e.window}n.isWindow=t}(it||(it={})),function(n){function t(e,s){const r=e.nodeType===9?e.documentElement:e,i=s&&s.parentNode;return e===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):e.compareDocumentPosition&&e.compareDocumentPosition(i)&16))}n.contains=t}(it||(it={}));class En{constructor(t,e){this.isDefaultPrevented=it.returnFalse,this.isPropagationStopped=it.returnFalse,this.isImmediatePropagationStopped=it.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=it.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=it.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=it.returnTrue,s&&!this.isSimulated&&s.stopImmediatePropagation(),this.stopPropagation()},typeof t=="string"?this.type=t:t.type&&(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?it.returnTrue:it.returnFalse,this.target=t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget,this.timeStamp=t.timeStamp),e&&Object.assign(this,e),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function t(e){return e instanceof n?e:new n(e)}n.create=t})(En||(En={})),function(n){function t(e,s){Object.defineProperty(n.prototype,e,{enumerable:!0,configurable:!0,get:typeof s=="function"?function(){if(this.originalEvent)return s(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set(r){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:r})}})}n.addProperty=t}(En||(En={})),function(n){const t={bubbles:!0,cancelable:!0,eventPhase:!0,detail:!0,view:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pageX:!0,pageY:!0,screenX:!0,screenY:!0,toElement:!0,pointerId:!0,pointerType:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,touches:!0,changedTouches:!0,targetTouches:!0,which:!0,altKey:!0,ctrlKey:!0,metaKey:!0,shiftKey:!0};Object.keys(t).forEach(e=>n.addProperty(e,t[e]))}(En||(En={})),function(n){Fe.register("load",{noBubble:!0})}(),function(n){Fe.register("beforeunload",{postDispatch(t,e){e.result!==void 0&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}})}(),function(n){Fe.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(t,e){let s;const r=e.relatedTarget,i=e.handleObj;return(!r||r!==t&&!it.contains(t,r))&&(e.type=i.originType,s=i.handler.call(t,e),e.type="mouseover"),s}}),Fe.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(t,e){let s;const r=e.relatedTarget,i=e.handleObj;return(!r||r!==t&&!it.contains(t,r))&&(e.type=i.originType,s=i.handler.call(t,e),e.type="mouseout"),s}})}();var WR=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e},to;(function(n){let t;function e(o,a,l,u,h){if(!it.isValidTarget(o))return;let f;if(typeof l!="function"){const{handler:m,selector:y}=l,b=WR(l,["handler","selector"]);l=m,h=y,f=b}const d=Xs.ensure(o);let g=d.handler;g==null&&(g=d.handler=function(m,...y){return t!==m.type?r(o,m,...y):void 0});const p=it.ensureHandlerId(l);it.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=it.normalizeType(m);if(!y)return;let w=y,x=Fe.get(w);w=(h?x.delegateType:x.bindType)||w,x=Fe.get(w);const v=Object.assign({type:w,originType:y,data:u,selector:h,guid:p,handler:l,namespace:b.join(".")},f),S=d.events;let E=S[w];E||(E=S[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,g)===!1)&&it.addEventListener(o,w,g)),x.add&&(it.removeHandlerId(v.handler),x.add(o,v),it.setHandlerId(v.handler,p)),h?(E.handlers.splice(E.delegateCount,0,v),E.delegateCount+=1):E.handlers.push(v)})}n.on=e;function s(o,a,l,u,h){const f=Xs.get(o);if(!f)return;const d=f.events;d&&(it.splitType(a).forEach(g=>{const{originType:p,namespaces:m}=it.normalizeType(g);if(!p){Object.keys(d).forEach(S=>{s(o,S+g,l,u,!0)});return}let y=p;const b=Fe.get(y);y=(u?b.delegateType:b.bindType)||y;const w=d[y];if(!w)return;const x=m.length>0?new RegExp(`(^|\\.)${m.join("\\.(?:.*\\.|)")}(\\.|$)`):null,v=w.handlers.length;for(let S=w.handlers.length-1;S>=0;S-=1){const E=w.handlers[S];(h||p===E.originType)&&(!l||it.getHandlerId(l)===E.guid)&&(x==null||E.namespace&&x.test(E.namespace))&&(u==null||u===E.selector||u==="**"&&E.selector)&&(w.handlers.splice(S,1),E.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,E))}v&&w.handlers.length===0&&((!b.teardown||b.teardown(o,m,f.handler)===!1)&&it.removeEventListener(o,y,f.handler),delete d[y])}),Object.keys(d).length===0&&Xs.remove(o))}n.off=s;function r(o,a,...l){const u=En.create(a);u.delegateTarget=o;const h=Fe.get(u.type);if(h.preDispatch&&h.preDispatch(o,u)===!1)return;const f=it.getHandlerQueue(o,u);for(let d=0,g=f.length;d<g&&!u.isPropagationStopped();d+=1){const p=f[d];u.currentTarget=p.elem;for(let m=0,y=p.handlers.length;m<y&&!u.isImmediatePropagationStopped();m+=1){const b=p.handlers[m];if(u.rnamespace==null||b.namespace&&u.rnamespace.test(b.namespace)){u.handleObj=b,u.data=b.data;const w=Fe.get(b.originType).handle,x=w?w(p.elem,u,...l):b.handler.call(p.elem,u,...l);x!==void 0&&(u.result=x,x===!1&&(u.preventDefault(),u.stopPropagation()))}}}return h.postDispatch&&h.postDispatch(o,u),u.result}n.dispatch=r;function i(o,a,l,u){let h=o,f=typeof o=="string"?o:o.type,d=typeof o=="string"||h.namespace==null?[]:h.namespace.split(".");const g=l;if(g.nodeType===3||g.nodeType===8)return;f.indexOf(".")>-1&&(d=f.split("."),f=d.shift(),d.sort());const p=f.indexOf(":")<0&&`on${f}`;h=o instanceof En?o:new En(f,typeof o=="object"?o:null),h.namespace=d.join("."),h.rnamespace=h.namespace?new RegExp(`(^|\\.)${d.join("\\.(?:.*\\.|)")}(\\.|$)`):null,h.result=void 0,h.target||(h.target=g);const m=[h];Array.isArray(a)?m.push(...a):m.push(a);const y=Fe.get(f);if(!u&&y.trigger&&y.trigger(g,h,a)===!1)return;let b;const w=[g];if(!u&&!y.noBubble&&!it.isWindow(g)){b=y.delegateType||f;let v=g,S=g.parentNode;for(;S!=null;)w.push(S),v=S,S=S.parentNode;const E=g.ownerDocument||document;if(v===E){const C=v.defaultView||v.parentWindow||window;w.push(C)}}let x=g;for(let v=0,S=w.length;v<S&&!h.isPropagationStopped();v+=1){const E=w[v];x=E,h.type=v>1?b:y.bindType||f;const C=Xs.get(E);C&&C.events[h.type]&&C.handler&&C.handler.call(E,...m);const M=p&&E[p]||null;M&&it.isValidTarget(E)&&(h.result=M.call(E,...m),h.result===!1&&h.preventDefault())}if(h.type=f,!u&&!h.isDefaultPrevented()){const v=y.preventDefault;if((v==null||v(w.pop(),h,a)===!1)&&it.isValidTarget(g)&&p&&typeof g[f]=="function"&&!it.isWindow(g)){const S=g[p];S&&(g[p]=null),t=f,h.isPropagationStopped()&&x.addEventListener(f,it.stopPropagationCallback),g[f](),h.isPropagationStopped()&&x.removeEventListener(f,it.stopPropagationCallback),t=void 0,S&&(g[p]=S)}}return h.result}n.trigger=i})(to||(to={}));var le;(function(n){function t(i,o,a,l,u){return eo.on(i,o,a,l,u),i}n.on=t;function e(i,o,a,l,u){return eo.on(i,o,a,l,u,!0),i}n.once=e;function s(i,o,a,l){return eo.off(i,o,a,l),i}n.off=s;function r(i,o,a,l){return to.trigger(o,a,i,l),i}n.trigger=r})(le||(le={}));var eo;(function(n){function t(s,r,i,o,a,l){if(typeof r=="object"){typeof i!="string"&&(o=o||i,i=void 0),Object.keys(r).forEach(u=>t(s,u,i,o,r[u],l));return}if(o==null&&a==null?(a=i,o=i=void 0):a==null&&(typeof i=="string"?(a=o,o=void 0):(a=o,o=i,i=void 0)),a===!1)a=it.returnFalse;else if(!a)return;if(l){const u=a;a=function(h,...f){return n.off(s,h),u.call(this,h,...f)},it.setHandlerId(a,it.ensureHandlerId(u))}to.on(s,r,a,o,i)}n.on=t;function e(s,r,i,o){const a=r;if(a&&a.preventDefault!=null&&a.handleObj!=null){const l=a.handleObj;e(a.delegateTarget,l.namespace?`${l.originType}.${l.namespace}`:l.originType,l.selector,l.handler);return}if(typeof r=="object"){const l=r;Object.keys(l).forEach(u=>e(s,u,i,l[u]));return}(i===!1||typeof i=="function")&&(o=i,i=void 0),o===!1&&(o=it.returnFalse),to.off(s,r,o,i)}n.off=e})(eo||(eo={}));class Ey{constructor(t,e,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=fs.isEventSupported("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=s,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){this.target.addEventListener(this.eventName,this.onWheel,{passive:!1})}disable(){this.target.removeEventListener(this.eventName,this.onWheel)}onWheel(t){if(this.onWheelGuard!=null&&!this.onWheelGuard(t))return;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault();let e;(this.deltaX!==0||this.deltaY!==0)&&(t.stopPropagation(),e=!0),e===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function Gu(n){const t=n.getBoundingClientRect(),e=n.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}}function qR(n){return n.getBoundingClientRect().width}function JR(n){return n.getBoundingClientRect().height}function Oy(n,t=60){let e=null;return(...s)=>{e&&clearTimeout(e),e=window.setTimeout(()=>{n.apply(this,s)},t)}}function XR(n){let t=null,e=[];const s=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const l=document.createElement("object");return l.onload=()=>{l.contentDocument.defaultView.addEventListener("resize",r),r()},l.style.display="block",l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.height="100%",l.style.width="100%",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.zIndex="-1",l.style.opacity="0",l.setAttribute("tabindex","-1"),l.type="text/html",n.appendChild(l),l.data="about:blank",l},r=Oy(()=>{e.forEach(l=>l(n))}),i=l=>{t||(t=s()),e.indexOf(l)===-1&&e.push(l)},o=()=>{t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",r),t.parentNode.removeChild(t),t=null,e=[])};return{element:n,bind:i,destroy:o,unbind:l=>{const u=e.indexOf(l);u!==-1&&e.splice(u,1),e.length===0&&t&&o()}}}function KR(n){let t=null,e=[];const s=Oy(()=>{e.forEach(l=>{l(n)})}),r=()=>{const l=new ResizeObserver(s);return l.observe(n),s(),l},i=l=>{t||(t=r()),e.indexOf(l)===-1&&e.push(l)},o=()=>{t&&(t.disconnect(),e=[],t=null)};return{element:n,bind:i,destroy:o,unbind:l=>{const u=e.indexOf(l);u!==-1&&e.splice(u,1),e.length===0&&t&&o()}}}const ZR=typeof ResizeObserver<"u"?KR:XR;var qa;(function(n){const t=new WeakMap;function e(r){let i=t.get(r);return i||(i=ZR(r),t.set(r,i),i)}function s(r){r.destroy(),t.delete(r.element)}n.bind=(r,i)=>{const o=e(r);return o.bind(i),()=>o.unbind(i)},n.clear=r=>{const i=e(r);s(i)}})(qa||(qa={}));class no{constructor(t={}){this.comparator=t.comparator||no.defaultComparator,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(t,e,s){const r={priority:t,value:e},i=this.data.length;return s&&(r.id=s,this.index[s]=i),this.data.push(r),this.bubbleUp(i),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const s=this.index[t];if(typeof s>"u")throw new Error(`Node with id '${t}' was not found in the heap.`);const r=this.data,i=r[s].priority,o=this.comparator(e,i);o<0?(r[s].priority=e,this.bubbleUp(s)):o>0&&(r[s].priority=e,this.bubbleDown(s))}remove(){const t=this.data,e=t[0],s=t.pop();return e.id&&delete this.index[e.id],t.length>0&&(t[0]=s,s.id&&(this.index[s.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let s,r,i=t;for(;i>0&&(r=i-1>>>1,this.comparator(e[i].priority,e[r].priority)<0);){s=e[r],e[r]=e[i];let o=e[i].id;o!=null&&(this.index[o]=r),e[i]=s,o=e[i].id,o!=null&&(this.index[o]=i),i=r}}bubbleDown(t){const e=this.data,s=e.length-1;let r=t;for(;;){const i=(r<<1)+1,o=i+1;let a=r;if(i<=s&&this.comparator(e[i].priority,e[a].priority)<0&&(a=i),o<=s&&this.comparator(e[o].priority,e[a].priority)<0&&(a=o),a!==r){const l=e[a];e[a]=e[r];let u=e[r].id;u!=null&&(this.index[u]=a),e[r]=l,u=e[r].id,u!=null&&(this.index[u]=r),r=a}else break}}}(function(n){n.defaultComparator=(t,e)=>t-e})(no||(no={}));var Yu;(function(n){function t(e,s,r=(i,o)=>1){const i={},o={},a={},l=new no;for(i[s]=0,Object.keys(e).forEach(u=>{u!==s&&(i[u]=1/0),l.insert(i[u],u,u)});!l.isEmpty();){const u=l.remove();a[u]=!0;const h=e[u]||[];for(let f=0;f<h.length;f+=1){const d=h[f];if(!a[d]){const g=i[u]+r(u,d);g<i[d]&&(i[d]=g,o[d]=u,l.updatePriority(d,g))}}}return o}n.run=t})(Yu||(Yu={}));class Wn{constructor(t,e,s,r){if(t==null)return this.set(255,255,255,1);if(typeof t=="number")return this.set(t,e,s,r);if(typeof t=="string")return Wn.fromString(t)||this;if(Array.isArray(t))return this.set(t);this.set(t.r,t.g,t.b,t.a==null?1:t.a)}blend(t,e,s){this.set(t.r+(e.r-t.r)*s,t.g+(e.g-t.g)*s,t.b+(e.b-t.b)*s,t.a+(e.a-t.a)*s)}lighten(t){const e=Wn.lighten(this.toArray(),t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}darken(t){this.lighten(-t)}set(t,e,s,r){const i=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:s,l=Array.isArray(t)?t[3]:r;return this.r=Math.round(we(i,0,255)),this.g=Math.round(we(o,0,255)),this.b=Math.round(we(a,0,255)),this.a=l==null?1:we(l,0,1),this}toHex(){return`#${["r","g","b"].map(e=>{const s=this[e].toString(16);return s.length<2?`0${s}`:s}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Wn.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(t){const e=`${this.r},${this.g},${this.b},`;return t?`rgb(${e})`:`rgba(${e},${this.a})`}toGrey(){return Wn.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(n){function t(x){return new n(x)}n.fromArray=t;function e(x){return new n([...p(x),1])}n.fromHex=e;function s(x){const v=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(v){const S=v[1].split(/\s*,\s*/).map(E=>parseInt(E,10));return new n(S)}return null}n.fromRGBA=s;function r(x,v,S){S<0&&++S,S>1&&--S;const E=6*S;return E<1?x+(v-x)*E:2*S<1?v:3*S<2?x+(v-x)*(2/3-S)*6:x}function i(x){const v=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(v){const S=v[2].split(/\s*,\s*/),E=(parseFloat(S[0])%360+360)%360/360,C=parseFloat(S[1])/100,M=parseFloat(S[2])/100,T=S[3]==null?1:parseInt(S[3],10);return new n(u(E,C,M,T))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return e(x);if(x.startsWith("rgb"))return s(x);const v=n.named[x];return v?e(v):i(x)}n.fromString=o;function a(x,v){return n.fromArray([x,x,x,v])}n.makeGrey=a;function l(x,v,S,E){const C=Array.isArray(x)?x[0]:x,M=Array.isArray(x)?x[1]:v,T=Array.isArray(x)?x[2]:S,_=Array.isArray(x)?x[3]:E,N=Math.max(C,M,T),k=Math.min(C,M,T),R=(N+k)/2;let I=0,A=0;if(k!==N){const P=N-k;switch(A=R>.5?P/(2-N-k):P/(N+k),N){case C:I=(M-T)/P+(M<T?6:0);break;case M:I=(T-C)/P+2;break;case T:I=(C-M)/P+4;break}I/=6}return[I,A,R,_??1]}n.rgba2hsla=l;function u(x,v,S,E){const C=Array.isArray(x)?x[0]:x,M=Array.isArray(x)?x[1]:v,T=Array.isArray(x)?x[2]:S,_=Array.isArray(x)?x[3]:E,N=T<=.5?T*(M+1):T+M-T*M,k=2*T-N;return[r(k,N,C+1/3)*256,r(k,N,C)*256,r(k,N,C-1/3)*256,_??1]}n.hsla2rgba=u;function h(x){return new n(Math.round(Math.random()*256),Math.round(Math.random()*256),Math.round(Math.random()*256),x?void 0:parseFloat(Math.random().toFixed(2)))}n.random=h;function f(){const x="0123456789ABCDEF";let v="#";for(let S=0;S<6;S+=1)v+=x[Math.floor(Math.random()*16)];return v}n.randomHex=f;function d(x){return h(x).toString()}n.randomRGBA=d;function g(x,v){if(typeof x=="string"){const T=x[0]==="#",[_,N,k]=p(x);return v?_*.299+N*.587+k*.114>186?"#000000":"#ffffff":`${T?"#":""}${m(255-_,255-N,255-k)}`}const S=x[0],E=x[1],C=x[2],M=x[3];return v?S*.299+E*.587+C*.114>186?[0,0,0,M]:[255,255,255,M]:[255-S,255-E,255-C,M]}n.invert=g;function p(x){const v=x.indexOf("#")===0?x:`#${x}`;let S=+`0x${v.substr(1)}`;if(!(v.length===4||v.length===7)||Number.isNaN(S))throw new Error("Invalid hex color.");const E=v.length===4?4:8,C=(1<<E)-1,M=["b","g","r"].map(()=>{const T=S&C;return S>>=E,E===4?17*T:T});return[M[2],M[1],M[0]]}function m(x,v,S){const E=C=>C.length<2?`0${C}`:C;return`${E(x.toString(16))}${E(v.toString(16))}${E(S.toString(16))}`}function y(x,v){return w(x,v)}n.lighten=y;function b(x,v){return w(x,-v)}n.darken=b;function w(x,v){if(typeof x=="string"){const C=x[0]==="#",M=parseInt(C?x.substr(1):x,16),T=we((M>>16)+v,0,255),_=we((M>>8&255)+v,0,255),N=we((M&255)+v,0,255);return`${C?"#":""}${(N|_<<8|T<<16).toString(16)}`}const S=m(x[0],x[1],x[2]),E=p(w(S,v));return[E[0],E[1],E[2],x[3]]}})(Wn||(Wn={})),function(n){n.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(Wn||(Wn={}));class Wu{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const s=this.map.get(t);return this.map.delete(t),s}each(t){this.arr.forEach(e=>{const s=this.map.get(e);t(s,e)})}dispose(){this.clear()}}var ms;(function(n){function t(r){const i=[],o=[];return Array.isArray(r)?i.push(...r):r.split("|").forEach(a=>{a.indexOf("&")===-1?i.push(a):o.push(...a.split("&"))}),{or:i,and:o}}n.parse=t;function e(r,i){if(r!=null&&i!=null){const o=t(r),a=t(i),l=o.or.sort(),u=a.or.sort(),h=o.and.sort(),f=a.and.sort(),d=(g,p)=>g.length===p.length&&(g.length===0||g.every((m,y)=>m===p[y]));return d(l,u)&&d(h,f)}return r==null&&i==null}n.equals=e;function s(r,i,o){if(i==null||Array.isArray(i)&&i.length===0)return o?r.altKey!==!0&&r.ctrlKey!==!0&&r.metaKey!==!0&&r.shiftKey!==!0:!0;const{or:a,and:l}=t(i),u=h=>{const f=`${h.toLowerCase()}Key`;return r[f]===!0};return a.some(h=>u(h))&&l.every(h=>u(h))}n.isMatch=s})(ms||(ms={}));var Ks;(function(n){n.linear=t=>t,n.quad=t=>t*t,n.cubic=t=>t*t*t,n.inout=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,s=e*t;return 4*(t<.5?s:3*(t-e)+s-.75)},n.exponential=t=>Math.pow(2,10*(t-1)),n.bounce=t=>{for(let e=0,s=1;;e+=s,s/=2)if(t>=(7-4*e)/11){const r=(11-6*e-11*t)/4;return-r*r+s*s}}})(Ks||(Ks={})),function(n){n.decorators={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,s=1){return r=>{const i=t(r);return i<e?e:i>s?s:i}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}(Ks||(Ks={})),function(n){function t(A){return-1*Math.cos(A*(Math.PI/2))+1}n.easeInSine=t;function e(A){return Math.sin(A*(Math.PI/2))}n.easeOutSine=e;function s(A){return-.5*(Math.cos(Math.PI*A)-1)}n.easeInOutSine=s;function r(A){return A*A}n.easeInQuad=r;function i(A){return A*(2-A)}n.easeOutQuad=i;function o(A){return A<.5?2*A*A:-1+(4-2*A)*A}n.easeInOutQuad=o;function a(A){return A*A*A}n.easeInCubic=a;function l(A){const P=A-1;return P*P*P+1}n.easeOutCubic=l;function u(A){return A<.5?4*A*A*A:(A-1)*(2*A-2)*(2*A-2)+1}n.easeInOutCubic=u;function h(A){return A*A*A*A}n.easeInQuart=h;function f(A){const P=A-1;return 1-P*P*P*P}n.easeOutQuart=f;function d(A){const P=A-1;return A<.5?8*A*A*A*A:1-8*P*P*P*P}n.easeInOutQuart=d;function g(A){return A*A*A*A*A}n.easeInQuint=g;function p(A){const P=A-1;return 1+P*P*P*P*P}n.easeOutQuint=p;function m(A){const P=A-1;return A<.5?16*A*A*A*A*A:1+16*P*P*P*P*P}n.easeInOutQuint=m;function y(A){return A===0?0:Math.pow(2,10*(A-1))}n.easeInExpo=y;function b(A){return A===1?1:-Math.pow(2,-10*A)+1}n.easeOutExpo=b;function w(A){if(A===0||A===1)return A;const P=A*2,B=P-1;return P<1?.5*Math.pow(2,10*B):.5*(-Math.pow(2,-10*B)+2)}n.easeInOutExpo=w;function x(A){const P=A/1;return-1*(Math.sqrt(1-P*A)-1)}n.easeInCirc=x;function v(A){const P=A-1;return Math.sqrt(1-P*P)}n.easeOutCirc=v;function S(A){const P=A*2,B=P-2;return P<1?-.5*(Math.sqrt(1-P*P)-1):.5*(Math.sqrt(1-B*B)+1)}n.easeInOutCirc=S;function E(A,P=1.70158){return A*A*((P+1)*A-P)}n.easeInBack=E;function C(A,P=1.70158){const B=A/1-1;return B*B*((P+1)*B+P)+1}n.easeOutBack=C;function M(A,P=1.70158){const B=A*2,j=B-2,Y=P*1.525;return B<1?.5*B*B*((Y+1)*B-Y):.5*(j*j*((Y+1)*j+Y)+2)}n.easeInOutBack=M;function T(A,P=.7){if(A===0||A===1)return A;const j=A/1-1,Y=1-P,ot=Y/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*j)*Math.sin((j-ot)*(2*Math.PI)/Y))}n.easeInElastic=T;function _(A,P=.7){const B=1-P,j=A*2;if(A===0||A===1)return A;const Y=B/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*j)*Math.sin((j-Y)*(2*Math.PI)/B)+1}n.easeOutElastic=_;function N(A,P=.65){const B=1-P;if(A===0||A===1)return A;const j=A*2,Y=j-1,ot=B/(2*Math.PI)*Math.asin(1);return j<1?-.5*(Math.pow(2,10*Y)*Math.sin((Y-ot)*(2*Math.PI)/B)):Math.pow(2,-10*Y)*Math.sin((Y-ot)*(2*Math.PI)/B)*.5+1}n.easeInOutElastic=N;function k(A){const P=A/1;if(P<1/2.75)return 7.5625*P*P;if(P<2/2.75){const B=P-.5454545454545454;return 7.5625*B*B+.75}if(P<2.5/2.75){const B=P-.8181818181818182;return 7.5625*B*B+.9375}{const B=P-.9545454545454546;return 7.5625*B*B+.984375}}n.easeOutBounce=k;function R(A){return 1-k(1-A)}n.easeInBounce=R;function I(A){return A<.5?R(A*2)*.5:k(A*2-1)*.5+.5}n.easeInOutBounce=I}(Ks||(Ks={}));var Zs;(function(n){n.number=(t,e)=>{const s=e-t;return r=>t+s*r},n.object=(t,e)=>{const s=Object.keys(t);return r=>{const i={};for(let o=s.length-1;o!==-1;o-=1){const a=s[o];i[a]=t[a]+(e[a]-t[a])*r}return i}},n.unit=(t,e)=>{const s=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=s.exec(t),i=s.exec(e),o=i?i[1]:"",a=r?+r[1]:0,l=i?+i[1]:0,u=o.indexOf("."),h=u>0?o[1].length-u-1:0,f=l-a,d=r?r[2]:"";return g=>(a+f*g).toFixed(h)+d},n.color=(t,e)=>{const s=parseInt(t.slice(1),16),r=parseInt(e.slice(1),16),i=s&255,o=(r&255)-i,a=s&65280,l=(r&65280)-a,u=s&16711680,h=(r&16711680)-u;return f=>{const d=i+o*f&255,g=a+l*f&65280,p=u+h*f&16711680;return`#${(1<<24|d|g|p).toString(16).slice(1)}`}}})(Zs||(Zs={}));const so=[];function jr(n,t){const e=so.find(s=>s.name===n);if(!(e&&(e.loadTimes+=1,e.loadTimes>1))&&!fs.isApplyingHMR()){const s=document.createElement("style");s.setAttribute("type","text/css"),s.textContent=t;const r=document.querySelector("head");r&&r.insertBefore(s,r.firstChild),so.push({name:n,loadTimes:1,styleElement:s})}}function $r(n){const t=so.findIndex(e=>e.name===n);if(t>-1){const e=so[t];if(e.loadTimes-=1,e.loadTimes>0)return;let s=e.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,so.splice(t,1)}}var gt;(function(n){function t(s){return 180*s/Math.PI%360}n.toDeg=t,n.toRad=function(s,r=!1){return(r?s:s%360)*Math.PI/180};function e(s){return s%360+(s<0?360:0)}n.normalize=e})(gt||(gt={}));var wt;(function(n){function t(a,l=0){return Number.isInteger(a)?a:+a.toFixed(l)}n.round=t;function e(a,l){let u,h;if(l==null?(h=a??1,u=0):(h=l,u=a??0),h<u){const f=u;u=h,h=f}return Math.floor(Math.random()*(h-u+1)+u)}n.random=e;function s(a,l,u){return Number.isNaN(a)?NaN:Number.isNaN(l)||Number.isNaN(u)?0:l<u?a<l?l:a>u?u:a:a<u?u:a>l?l:a}n.clamp=s;function r(a,l){return l*Math.round(a/l)}n.snapToGrid=r;function i(a,l){return l!=null&&a!=null&&l.x>=a.x&&l.x<=a.x+a.width&&l.y>=a.y&&l.y<=a.y+a.height}n.containsPoint=i;function o(a,l){const u=a.x-l.x,h=a.y-l.y;return u*u+h*h}n.squaredLength=o})(wt||(wt={}));class ys{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class O extends ys{constructor(t,e){super(),this.x=t??0,this.y=e??0}round(t=0){return this.x=wt.round(this.x,t),this.y=wt.round(this.y,t),this}add(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}update(t,e){const s=O.create(t,e);return this.x=s.x,this.y=s.y,this}translate(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}rotate(t,e){const s=O.rotate(this,t,e);return this.x=s.x,this.y=s.y,this}scale(t,e,s=new O){const r=O.create(s);return this.x=r.x+t*(this.x-r.x),this.y=r.y+e*(this.y-r.y),this}closest(t){if(t.length===1)return O.create(t[0]);let e=null,s=1/0;return t.forEach(r=>{const i=this.squaredDistance(r);i<s&&(e=r,s=i)}),e?O.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=O.create(t),s=this.x-e.x,r=this.y-e.y;return s*s+r*r}manhattanDistance(t){const e=O.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new O){const e=O.create(t),s=-(e.y-this.y),r=e.x-this.x;let i=Math.atan2(s,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let s=this.theta(e)-this.theta(t);return s<0&&(s+=360),s}vectorAngle(t){return new O(0,0).angleBetween(this,t)}toPolar(t){return this.update(O.toPolar(this,t)),this}changeInAngle(t,e,s=new O){return this.clone().translate(-t,-e).theta(s)-this.theta(s)}adhereToRect(t){return wt.containsPoint(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=O.create(t),s=gt.toRad(this.y),r=gt.toRad(e.y),i=this.x,o=e.x,a=gt.toRad(o-i),l=Math.sin(a)*Math.cos(r),u=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(a),h=gt.toDeg(Math.atan2(l,u)),f=["NE","E","SE","S","SW","W","NW","N"];let d=h-22.5;return d<0&&(d+=360),d=parseInt(d/45,10),f[d]}cross(t,e){if(t!=null&&e!=null){const s=O.create(t),r=O.create(e);return(r.x-this.x)*(s.y-this.y)-(r.y-this.y)*(s.x-this.x)}return NaN}dot(t){const e=O.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if(typeof t=="number")return new O(this.x-t,this.y-e);const s=O.create(t);return new O(this.x-s.x,this.y-s.y)}lerp(t,e){const s=O.create(t);return new O((1-e)*this.x+e*s.x,(1-e)*this.y+e*s.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const s=O.create(t),r=gt.toRad(s.theta(this));return this.translate(Math.cos(r)*e,-Math.sin(r)*e)}reflection(t){return O.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=wt.snapToGrid(this.x,t),this.y=wt.snapToGrid(this.y,e??t),this}equals(t){const e=O.create(t);return e!=null&&e.x===this.x&&e.y===this.y}clone(){return O.clone(this)}toJSON(){return O.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function t(e){return e!=null&&e instanceof n}n.isPoint=t})(O||(O={})),function(n){function t(s){return s!=null&&typeof s=="object"&&typeof s.x=="number"&&typeof s.y=="number"}n.isPointLike=t;function e(s){return s!=null&&Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"}n.isPointData=e}(O||(O={})),function(n){function t(f,d){return f==null||typeof f=="number"?new n(f,d):e(f)}n.create=t;function e(f){return n.isPoint(f)?new n(f.x,f.y):Array.isArray(f)?new n(f[0],f[1]):new n(f.x,f.y)}n.clone=e;function s(f){return n.isPoint(f)?{x:f.x,y:f.y}:Array.isArray(f)?{x:f[0],y:f[1]}:{x:f.x,y:f.y}}n.toJSON=s;function r(f,d,g=new n){let p=Math.abs(f*Math.cos(d)),m=Math.abs(f*Math.sin(d));const y=e(g),b=gt.normalize(gt.toDeg(d));return b<90?m=-m:b<180?(p=-p,m=-m):b<270&&(p=-p),new n(y.x+p,y.y+m)}n.fromPolar=r;function i(f,d=new n){const g=e(f),p=e(d),m=g.x-p.x,y=g.y-p.y;return new n(Math.sqrt(m*m+y*y),gt.toRad(p.theta(g)))}n.toPolar=i;function o(f,d){return f===d?!0:f!=null&&d!=null?f.x===d.x&&f.y===d.y:!1}n.equals=o;function a(f,d){if(f==null&&d!=null||f!=null&&d==null||f!=null&&d!=null&&f.length!==d.length)return!1;if(f!=null&&d!=null){for(let g=0,p=f.length;g<p;g+=1)if(!o(f[g],d[g]))return!1}return!0}n.equalPoints=a;function l(f,d,g,p){return new n(wt.random(f,d),wt.random(g,p))}n.random=l;function u(f,d,g){const p=gt.toRad(gt.normalize(-d)),m=Math.sin(p),y=Math.cos(p);return h(f,y,m,g)}n.rotate=u;function h(f,d,g,p=new n){const m=e(f),y=e(p),b=m.x-y.x,w=m.y-y.y,x=b*d-w*g,v=w*d+b*g;return new n(x+y.x,v+y.y)}n.rotateEx=h}(O||(O={}));class z extends ys{get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new O(this.x,this.y)}get topLeft(){return new O(this.x,this.y)}get topCenter(){return new O(this.x+this.width/2,this.y)}get topRight(){return new O(this.x+this.width,this.y)}get center(){return new O(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new O(this.x,this.y+this.height)}get bottomCenter(){return new O(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new O(this.x+this.width,this.y+this.height)}get corner(){return new O(this.x+this.width,this.y+this.height)}get rightMiddle(){return new O(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new O(this.x,this.y+this.height/2)}get topLine(){return new W(this.topLeft,this.topRight)}get rightLine(){return new W(this.topRight,this.bottomRight)}get bottomLine(){return new W(this.bottomLeft,this.bottomRight)}get leftLine(){return new W(this.topLeft,this.bottomLeft)}constructor(t,e,s,r){super(),this.x=t??0,this.y=e??0,this.width=s??0,this.height=r??0}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=gt.toRad(t),s=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),i=this.width*r+this.height*s,o=this.width*s+this.height*r;return new z(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(t=0){return this.x=wt.round(this.x,t),this.y=wt.round(this.y,t),this.width=wt.round(this.width,t),this.height=wt.round(this.height,t),this}add(t,e,s,r){const i=z.create(t,e,s,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),l=Math.max(this.x+this.width,i.x+i.width),u=Math.max(this.y+this.height,i.y+i.height);return this.x=o,this.y=a,this.width=l-o,this.height=u-a,this}update(t,e,s,r){const i=z.create(t,e,s,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(t,e){const s=t,r=e??t;return this.x-=s,this.y-=r,this.width+=2*s,this.height+=2*r,this}snapToGrid(t,e){const s=this.origin.snapToGrid(t,e),r=this.corner.snapToGrid(t,e);return this.x=s.x,this.y=s.y,this.width=r.x-s.x,this.height=r.y-s.y,this}translate(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}scale(t,e,s=new O){const r=this.origin.scale(t,e,s);return this.x=r.x,this.y=r.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(t!==0){const s=gt.toRad(t),r=Math.cos(s),i=Math.sin(s);let o=this.getOrigin(),a=this.getTopRight(),l=this.getBottomRight(),u=this.getBottomLeft();o=O.rotateEx(o,r,i,e),a=O.rotateEx(a,r,i,e),l=O.rotateEx(l,r,i,e),u=O.rotateEx(u,r,i,e);const h=new z(o.x,o.y,0,0);h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),h.add(u.x,u.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=z.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const s=z.clone(t),r=e.x,i=e.y;let o=1/0,a=1/0,l=1/0,u=1/0,h=1/0,f=1/0,d=1/0,g=1/0;const p=s.topLeft;p.x<r&&(o=(this.x-r)/(p.x-r)),p.y<i&&(h=(this.y-i)/(p.y-i));const m=s.bottomRight;m.x>r&&(a=(this.x+this.width-r)/(m.x-r)),m.y>i&&(f=(this.y+this.height-i)/(m.y-i));const y=s.topRight;y.x>r&&(l=(this.x+this.width-r)/(y.x-r)),y.y<i&&(d=(this.y-i)/(y.y-i));const b=s.bottomLeft;return b.x<r&&(u=(this.x-r)/(b.x-r)),b.y>i&&(g=(this.y+this.height-i)/(b.y-i)),{sx:Math.min(o,a,l,u),sy:Math.min(h,f,d,g)}}getMaxUniformScaleToFit(t,e=this.center){const s=this.getMaxScaleToFit(t,e);return Math.min(s.sx,s.sy)}containsPoint(t,e){return wt.containsPoint(this,O.create(t,e))}containsRect(t,e,s,r){const i=z.create(t,e,s,r),o=this.x,a=this.y,l=this.width,u=this.height,h=i.x,f=i.y,d=i.width,g=i.height;return l===0||u===0||d===0||g===0?!1:h>=o&&f>=a&&h+d<=o+l&&f+g<=a+u}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=[],r=[];return e.forEach(i=>{const o=t.intersectsWithLine(i);o!==null&&r.indexOf(o.toString())<0&&(s.push(o),r.push(o.toString()))}),s.length>0?s:null}intersectsWithLineFromCenterToPoint(t,e){const s=O.clone(t),r=this.center;let i=null;e!=null&&e!==0&&s.rotate(e,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new W(r,s);for(let l=o.length-1;l>=0;l-=1){const u=o[l].intersectsWithLine(a);if(u!==null){i=u;break}}return i&&e!=null&&e!==0&&i.rotate(-e,r),i}intersectsWithRect(t,e,s,r){const i=z.create(t,e,s,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,l=i.origin,u=i.corner,h=Math.max(o.x,l.x),f=Math.max(o.y,l.y);return new z(h,f,Math.min(a.x,u.x)-h,Math.min(a.y,u.y)-f)}isIntersectWithRect(t,e,s,r){const i=z.create(t,e,s,r),o=this.origin,a=this.corner,l=i.origin,u=i.corner;return!(u.x<=o.x||u.y<=o.y||l.x>=a.x||l.y>=a.y)}normalize(){let t=this.x,e=this.y,s=this.width,r=this.height;return this.width<0&&(t=this.x+this.width,s=-this.width),this.height<0&&(e=this.y+this.height,r=-this.height),this.x=t,this.y=e,this.width=s,this.height=r,this}union(t){const e=z.clone(t),s=this.origin,r=this.corner,i=e.origin,o=e.corner,a=Math.min(s.x,i.x),l=Math.min(s.y,i.y),u=Math.max(r.x,o.x),h=Math.max(r.y,o.y);return new z(a,l,u-a,h-l)}getNearestSideToPoint(t){const e=O.clone(t),s=e.x-this.x,r=this.x+this.width-e.x,i=e.y-this.y,o=this.y+this.height-e.y;let a=s,l="left";return r<a&&(a=r,l="right"),i<a&&(a=i,l="top"),o<a&&(l="bottom"),l}getNearestPointToPoint(t){const e=O.clone(t);if(this.containsPoint(e)){const s=this.getNearestSideToPoint(e);if(s==="left")return new O(this.x,e.y);if(s==="top")return new O(e.x,this.y);if(s==="right")return new O(this.x+this.width,e.y);if(s==="bottom")return new O(e.x,this.y+this.height)}return e.adhereToRect(this)}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new z(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(n){function t(e){return e!=null&&e instanceof n}n.isRectangle=t})(z||(z={})),function(n){function t(e){return e!=null&&typeof e=="object"&&typeof e.x=="number"&&typeof e.y=="number"&&typeof e.width=="number"&&typeof e.height=="number"}n.isRectangleLike=t}(z||(z={})),function(n){function t(o,a,l,u){return o==null||typeof o=="number"?new n(o,a,l,u):e(o)}n.create=t;function e(o){return n.isRectangle(o)?o.clone():Array.isArray(o)?new n(o[0],o[1],o[2],o[3]):new n(o.x,o.y,o.width,o.height)}n.clone=e;function s(o){return new n(o.x-o.a,o.y-o.b,2*o.a,2*o.b)}n.fromEllipse=s;function r(o){return new n(0,0,o.width,o.height)}n.fromSize=r;function i(o,a){return new n(o.x,o.y,a.width,a.height)}n.fromPositionAndSize=i}(z||(z={}));class W extends ys{get center(){return new O((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(t,e,s,r){super(),typeof t=="number"&&typeof e=="number"?(this.start=new O(t,e),this.end=new O(s,r)):(this.start=O.create(t),this.end=O.create(e))}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,s){return this.start.scale(t,e,s),this.end.scale(t,e,s),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const s=t/e;return this.scale(s,s,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:s,end:r}=e,i=s.clone().rotate(270,r),o=r.clone().rotate(90,s);return s.move(o,t),r.move(i,t),e}vector(){return new O(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new O(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),s=Math.max(this.start.x,this.end.x),r=Math.max(this.start.y,this.end.y);return new z(t,e,s-t,r-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new W(this.start,t).vector()),s=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(s)?0:s}pointAt(t){const e=this.start,s=this.end;return t<=0?e.clone():t>=1?s.clone():e.lerp(s,t)}pointAtLength(t){const e=this.start,s=this.end;let r=!0;t<0&&(r=!1,t=-t);const i=this.length();if(t>=i)return r?s.clone():e.clone();const o=(r?t:i-t)/i;return this.pointAt(o)}divideAt(t){const e=this.pointAt(t);return[new W(this.start,e),new W(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new W(this.start,e),new W(e,this.end)]}containsPoint(t){const e=this.start,s=this.end;if(e.cross(t,s)!==0)return!1;const r=this.length();return!(new W(e,t).length()>r||new W(t,s).length()>r)}intersect(t,e){const s=t.intersectsWithLine(this,e);return s?Array.isArray(s)?s:[s]:null}intersectsWithLine(t){const e=new O(this.end.x-this.start.x,this.end.y-this.start.y),s=new O(t.end.x-t.start.x,t.end.y-t.start.y),r=e.x*s.y-e.y*s.x,i=new O(t.start.x-this.start.x,t.start.y-this.start.y),o=i.x*s.y-i.y*s.x,a=i.x*e.y-i.y*e.x;if(r===0||o*r<0||a*r<0)return null;if(r>0){if(o>r||a>r)return null}else if(o<r||a<r)return null;return new O(this.start.x+o*e.x/r,this.start.y+o*e.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=O.clone(t),s=this.start,r=this.end;return((r.x-s.x)*(e.y-s.y)-(r.y-s.y)*(e.x-s.x))/this.length()}pointSquaredDistance(t,e){const s=O.create(t,e);return this.closestPoint(s).squaredDistance(s)}pointDistance(t,e){const s=O.create(t,e);return this.closestPoint(s).distance(s)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,s=this.end,r=this.pointAt(t),i=new W(e,s);return i.translate(r.x-e.x,r.y-e.y),i}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,s=this.end,r=this.pointAtLength(t),i=new W(e,s);return i.translate(r.x-e.x,r.y-e.y),i}relativeCcw(t,e){const s=O.create(t,e);let r=s.x-this.start.x,i=s.y-this.start.y;const o=this.end.x-this.start.x,a=this.end.y-this.start.y;let l=r*a-i*o;return l===0&&(l=r*o+i*a,l>0&&(r-=o,i-=a,l=r*o+i*a,l<0&&(l=0))),l<0?-1:l>0?1:0}equals(t){return t!=null&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new W(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(n){function t(e){return e!=null&&e instanceof n}n.isLine=t})(W||(W={}));class un extends ys{get center(){return new O(this.x,this.y)}constructor(t,e,s,r){super(),this.x=t??0,this.y=e??0,this.a=s??0,this.b=r??0}bbox(){return z.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const s=t,r=e??t;return this.a+=2*s,this.b+=2*r,this}normalizedDistance(t,e){const s=O.create(t,e),r=s.x-this.x,i=s.y-this.y,o=this.a,a=this.b;return r*r/(o*o)+i*i/(a*a)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],s=this.a,r=this.b,i=t.start,o=t.end,a=t.vector(),l=i.diff(new O(this.x,this.y)),u=new O(a.x/(s*s),a.y/(r*r)),h=new O(l.x/(s*s),l.y/(r*r)),f=a.dot(u),d=a.dot(h),g=l.dot(h)-1,p=d*d-f*g;if(p<0)return null;if(p>0){const m=Math.sqrt(p),y=(-d-m)/f,b=(-d+m)/f;if((y<0||y>1)&&(b<0||b>1))return null;y>=0&&y<=1&&e.push(i.lerp(o,y)),b>=0&&b<=1&&e.push(i.lerp(o,b))}else{const m=-d/f;if(m>=0&&m<=1)e.push(i.lerp(o,m));else return null}return e}intersectsWithLineFromCenterToPoint(t,e=0){const s=O.clone(t);e&&s.rotate(e,this.getCenter());const r=s.x-this.x,i=s.y-this.y;let o;if(r===0)return o=this.bbox().getNearestPointToPoint(s),e?o.rotate(-e,this.getCenter()):o;const a=i/r,l=a*a,u=this.a*this.a,h=this.b*this.b;let f=Math.sqrt(1/(1/u+l/h));f=r<0?-f:f;const d=a*f;return o=new O(this.x+f,this.y+d),e?o.rotate(-e,this.getCenter()):o}tangentTheta(t){const e=O.clone(t),s=e.x,r=e.y,i=this.a,o=this.b,a=this.bbox().center,l=a.x,u=a.y,h=30,f=s>a.x+i/2,d=s<a.x-i/2;let g,p;return f||d?(p=s>a.x?r-h:r+h,g=i*i/(s-l)-i*i*(r-u)*(p-u)/(o*o*(s-l))+l):(g=r>a.y?s+h:s-h,p=o*o/(r-u)-o*o*(s-l)*(g-l)/(i*i*(r-u))+u),new O(g,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const s=z.fromEllipse(this);s.rotate(t,e);const r=un.fromRect(s);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(t,e){const s=O.create(t,e);return this.x+=s.x,this.y+=s.y,this}equals(t){return t!=null&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new un(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(n){function t(e){return e!=null&&e instanceof n}n.isEllipse=t})(un||(un={})),function(n){function t(r,i,o,a){return r==null||typeof r=="number"?new n(r,i,o,a):e(r)}n.create=t;function e(r){return n.isEllipse(r)?r.clone():Array.isArray(r)?new n(r[0],r[1],r[2],r[3]):new n(r.x,r.y,r.a,r.b)}n.parse=e;function s(r){const i=r.center;return new n(i.x,i.y,r.width/2,r.height/2)}n.fromRect=s}(un||(un={}));const QR=new RegExp("^[\\s\\dLMCZz,.]*$");function tI(n){return typeof n!="string"?!1:QR.test(n)}function qu(n,t){return(n%t+t)%t}function eI(n,t,e,s,r){const i=[],o=n[n.length-1],a=t!=null&&t>0,l=t||0;if(s&&a){n=n.slice();const f=n[0],d=new O(o.x+(f.x-o.x)/2,o.y+(f.y-o.y)/2);n.splice(0,0,d)}let u=n[0],h=1;for(e?i.push("M",u.x,u.y):i.push("L",u.x,u.y);h<(s?n.length:n.length-1);){let f=n[qu(h,n.length)],d=u.x-f.x,g=u.y-f.y;if(a&&(d!==0||g!==0)&&(r==null||r.indexOf(h-1)<0)){let p=Math.sqrt(d*d+g*g);const m=d*Math.min(l,p/2)/p,y=g*Math.min(l,p/2)/p,b=f.x+m,w=f.y+y;i.push("L",b,w);let x=n[qu(h+1,n.length)];for(;h<n.length-2&&Math.round(x.x-f.x)===0&&Math.round(x.y-f.y)===0;)x=n[qu(h+2,n.length)],h+=1;d=x.x-f.x,g=x.y-f.y,p=Math.max(1,Math.sqrt(d*d+g*g));const v=d*Math.min(l,p/2)/p,S=g*Math.min(l,p/2)/p,E=f.x+v,C=f.y+S;i.push("Q",f.x,f.y,E,C),f=new O(E,C)}else i.push("L",f.x,f.y);u=f,h+=1}return s?i.push("Z"):i.push("L",o.x,o.y),i.map(f=>typeof f=="string"?f:+f.toFixed(3)).join(" ")}function My(n,t={}){const e=[];return n&&n.length&&n.forEach(s=>{Array.isArray(s)?e.push({x:s[0],y:s[1]}):e.push({x:s.x,y:s.y})}),eI(e,t.round,t.initialMove==null||t.initialMove,t.close,t.exclude)}function Ja(n,t,e,s,r=0,i=0,o=0,a,l){if(e===0||s===0)return[];a-=n,l-=t,e=Math.abs(e),s=Math.abs(s);const u=-a/2,h=-l/2,f=Math.cos(r*Math.PI/180),d=Math.sin(r*Math.PI/180),g=f*u+d*h,p=-1*d*u+f*h,m=g*g,y=p*p,b=e*e,w=s*s,x=m/b+y/w;let v;if(x>1)e=Math.sqrt(x)*e,s=Math.sqrt(x)*s,v=0;else{let et=1;i===o&&(et=-1),v=et*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const S=v*e*p/s,E=-1*v*s*g/e,C=f*S-d*E+a/2,M=d*S+f*E+l/2;let T=Math.atan2((p-E)/s,(g-S)/e)-Math.atan2(0,1),_=T>=0?T:2*Math.PI+T;T=Math.atan2((-p-E)/s,(-g-S)/e)-Math.atan2((p-E)/s,(g-S)/e);let N=T>=0?T:2*Math.PI+T;o===0&&N>0?N-=2*Math.PI:o!==0&&N<0&&(N+=2*Math.PI);const k=N*2/Math.PI,R=Math.ceil(k<0?-1*k:k),I=N/R,A=8/3*Math.sin(I/4)*Math.sin(I/4)/Math.sin(I/2),P=f*e,B=f*s,j=d*e,Y=d*s;let ot=Math.cos(_),F=Math.sin(_),H=-A*(P*F+Y*ot),V=-A*(j*F-B*ot),K=0,nt=0;const rt=[];for(let et=0;et<R;et+=1){_+=I,ot=Math.cos(_),F=Math.sin(_),K=P*ot-Y*F+C,nt=j*ot+B*F+M;const ft=-A*(P*F+Y*ot),ge=-A*(j*F-B*ot),St=et*6;rt[St]=Number(H+n),rt[St+1]=Number(V+t),rt[St+2]=Number(K-ft+n),rt[St+3]=Number(nt-ge+t),rt[St+4]=Number(K+n),rt[St+5]=Number(nt+t),H=K+ft,V=nt+ge}return rt.map(et=>+et.toFixed(2))}function nI(n,t,e,s,r=0,i=0,o=0,a,l){const u=[],h=Ja(n,t,e,s,r,i,o,a,l);if(h!=null)for(let f=0,d=h.length;f<d;f+=6)u.push("C",h[f],h[f+1],h[f+2],h[f+3],h[f+4],h[f+5]);return u.join(" ")}class $t extends ys{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(t){if(super(),t!=null){if(typeof t=="string")return $t.parse(t);this.points=t.map(e=>O.create(e))}else this.points=[]}scale(t,e,s=new O){return this.points.forEach(r=>r.scale(t,e,s)),this}rotate(t,e){return this.points.forEach(s=>s.rotate(t,e)),this}translate(t,e){const s=O.create(t,e);return this.points.forEach(r=>r.translate(s.x,s.y)),this}round(t=0){return this.points.forEach(e=>e.round(t)),this}bbox(){if(this.points.length===0)return new z;let t=1/0,e=-1/0,s=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const l=i[o],u=l.x,h=l.y;u<t&&(t=u),u>e&&(e=u),h<s&&(s=h),h>r&&(r=h)}return new z(t,s,e-t,r-s)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,s=e.length;if(s===0||s===1)return 0;let r=0,i=0,o=1/0;for(let a=0,l=s-1;a<l;a+=1){const u=new W(e[a],e[a+1]),h=u.length(),f=u.closestPointNormalizedLength(t),g=u.pointAt(f).squaredDistance(t);g<o&&(o=g,i=r+f*h),r+=h}return i}closestPointNormalizedLength(t){const e=this.length();return e===0?0:this.closestPointLength(t)/e}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(this.points.length===0)return!1;const e=O.clone(t),s=e.x,r=e.y,i=this.points,o=i.length;let a=o-1,l=0;for(let u=0;u<o;u+=1){const h=i[a],f=i[u];if(e.equals(h))return!0;const d=new W(h,f);if(d.containsPoint(t))return!0;if(r<=h.y&&r>f.y||r>h.y&&r<=f.y){const g=h.x-s>f.x-s?h.x-s:f.x-s;if(g>=0){const p=new O(s+g,r),m=new W(t,p);d.intersectsWithLine(m)&&(l+=1)}}a=u}return l%2===1}intersectsWithLine(t){const e=[];for(let s=0,r=this.points.length-1;s<r;s+=1){const i=this.points[s],o=this.points[s+1],a=t.intersectsWithLine(new W(i,o));a&&e.push(a)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const s=this.points[t],r=this.points[t+1];if(new W(s,r).isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,s=this.points.length-1;e<s;e+=1){const r=this.points[e],i=this.points[e+1];t+=r.distance(i)}return t}pointAt(t){const e=this.points,s=e.length;if(s===0)return null;if(s===1||t<=0)return e[0].clone();if(t>=1)return e[s-1].clone();const i=this.length()*t;return this.pointAtLength(i)}pointAtLength(t){const e=this.points,s=e.length;if(s===0)return null;if(s===1)return e[0].clone();let r=!0;t<0&&(r=!1,t=-t);let i=0;for(let a=0,l=s-1;a<l;a+=1){const u=r?a:l-1-a,h=e[u],f=e[u+1],d=new W(h,f),g=h.distance(f);if(t<=i+g)return d.pointAtLength((r?1:-1)*(t-i));i+=g}return(r?e[s-1]:e[0]).clone()}tangentAt(t){const s=this.points.length;if(s===0||s===1)return null;t<0&&(t=0),t>1&&(t=1);const i=this.length()*t;return this.tangentAtLength(i)}tangentAtLength(t){const e=this.points,s=e.length;if(s===0||s===1)return null;let r=!0;t<0&&(r=!1,t=-t);let i,o=0;for(let a=0,l=s-1;a<l;a+=1){const u=r?a:l-1-a,h=e[u],f=e[u+1],d=new W(h,f),g=h.distance(f);if(d.isDifferentiable()){if(t<=o+g)return d.tangentAtLength((r?1:-1)*(t-o));i=d}o+=g}if(i){const a=r?1:0;return i.tangentAt(a)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const s=t.threshold||0;let r=0;for(;e[r+2];){const i=r,o=r+1,a=r+2,l=e[i],u=e[o],h=e[a];new W(l,h).closestPoint(u).distance(u)<=s?e.splice(o,1):r+=1}return this}toHull(){const t=this.points,e=t.length;if(e===0)return new $t;let s=t[0];for(let d=1;d<e;d+=1)(t[d].y<s.y||t[d].y===s.y&&t[d].x>s.x)&&(s=t[d]);const r=[];for(let d=0;d<e;d+=1){let g=s.theta(t[d]);g===0&&(g=360),r.push([t[d],d,g])}if(r.sort((d,g)=>{let p=d[2]-g[2];return p===0&&(p=g[1]-d[1]),p}),r.length>2){const d=r[r.length-1];r.unshift(d)}const i={},o=[],a=d=>`${d[0].toString()}@${d[1]}`;for(;r.length!==0;){const d=r.pop(),g=d[0];if(i[a(d)])continue;let p=!1;for(;!p;)if(o.length<2)o.push(d),p=!0;else{const m=o.pop(),y=m[0],b=o.pop(),w=b[0],x=w.cross(y,g);if(x<0)o.push(b),o.push(m),o.push(d),p=!0;else if(x===0){const S=y.angleBetween(w,g);Math.abs(S-180)<1e-10||y.equals(g)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((S+1)%360-1)<1e-10&&(o.push(b),r.push(m))}else i[a(m)]=y,o.push(b)}}o.length>2&&o.pop();let l,u=-1;for(let d=0,g=o.length;d<g;d+=1){const p=o[d][1];(l===void 0||p<l)&&(l=p,u=d)}let h=[];if(u>0){const d=o.slice(u),g=o.slice(0,u);h=d.concat(g)}else h=o;const f=[];for(let d=0,g=h.length;d<g;d+=1)f.push(h[d][0]);return new $t(f)}equals(t){return t==null||t.points.length!==this.points.length?!1:t.points.every((e,s)=>e.equals(this.points[s]))}clone(){return new $t(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.serialize()}`).join(" ")}}(function(n){function t(e){return e!=null&&e instanceof n}n.isPolyline=t})($t||($t={})),function(n){function t(e){const s=e.trim();if(s==="")return new n;const r=[],i=s.split(/\s*,\s*|\s+/);for(let o=0,a=i.length;o<a;o+=2)r.push({x:+i[o],y:+i[o+1]});return new n(r)}n.parse=t}($t||($t={}));class Bt extends ys{constructor(t,e,s,r){super(),this.PRECISION=3,this.start=O.create(t),this.controlPoint1=O.create(e),this.controlPoint2=O.create(s),this.end=O.create(r)}bbox(){const t=this.start,e=this.controlPoint1,s=this.controlPoint2,r=this.end,i=t.x,o=t.y,a=e.x,l=e.y,u=s.x,h=s.y,f=r.x,d=r.y,g=[],p=[[],[]];let m,y,b,w,x,v,S,E;for(let P=0;P<2;P+=1){if(P===0?(y=6*i-12*a+6*u,m=-3*i+9*a-9*u+3*f,b=3*a-3*i):(y=6*o-12*l+6*h,m=-3*o+9*l-9*h+3*d,b=3*l-3*o),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;w=-b/y,w>0&&w<1&&g.push(w);continue}S=y*y-4*b*m,E=Math.sqrt(S),!(S<0)&&(x=(-y+E)/(2*m),x>0&&x<1&&g.push(x),v=(-y-E)/(2*m),v>0&&v<1&&g.push(v))}let C,M,T,_=g.length;const N=_;for(;_;)_-=1,w=g[_],T=1-w,C=T*T*T*i+3*T*T*w*a+3*T*w*w*u+w*w*w*f,p[0][_]=C,M=T*T*T*o+3*T*T*w*l+3*T*w*w*h+w*w*w*d,p[1][_]=M;g[N]=0,g[N+1]=1,p[0][N]=i,p[1][N]=o,p[0][N+1]=f,p[1][N+1]=d,g.length=N+2,p[0].length=N+2,p[1].length=N+2;const k=Math.min.apply(null,p[0]),R=Math.min.apply(null,p[1]),I=Math.max.apply(null,p[0]),A=Math.max.apply(null,p[1]);return new z(k,R,I-k,A-R)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const s=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,s),s)}closestPointNormalizedLength(t,e={}){const s=this.getOptions(e),r=this.closestPointLength(t,s);if(!r)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(t,e={}){const s=this.getPrecision(e),r=this.getDivisions(e),i=Math.pow(10,-s);let o=null,a=0,l=0,u=0,h=0,f=0,d=null;const g=r.length;let p=g>0?1/g:0;for(r.forEach((m,y)=>{const b=m.start.distance(t),w=m.end.distance(t),x=b+w;(d==null||x<d)&&(o=m,a=y*p,l=(y+1)*p,u=b,h=w,d=x,f=m.endpointDistance())});;){const m=u?Math.abs(u-h)/u:0,y=h!=null?Math.abs(u-h)/h:0,b=m<i||y<i,w=u?u<f*i:!0,x=h?h<f*i:!0;if(b||(w||x))return u<=h?a:l;const S=o.divide(.5);p/=2;const E=S[0].start.distance(t),C=S[0].end.distance(t),M=E+C,T=S[1].start.distance(t),_=S[1].end.distance(t),N=T+_;M<=N?(o=S[0],l-=p,u=E,h=C):(o=S[1],a+=p,u=T,h=_)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const s=this.tAt(t,e);return this.divideAtT(s)}divideAtLength(t,e={}){const s=this.tAtLength(t,e);return this.divideAtT(s)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return[new Bt(e,e,e,e),new Bt(e,s,r,i)];if(t>=1)return[new Bt(e,s,r,i),new Bt(i,i,i,i)];const o=this.getSkeletonPoints(t),a=o.startControlPoint1,l=o.startControlPoint2,u=o.divider,h=o.dividerControlPoint1,f=o.dividerControlPoint2;return[new Bt(e,a,l,u),new Bt(u,h,f,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:r.clone()};if(t>=1)return{startControlPoint1:s.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new W(e,s).pointAt(t),a=new W(s,r).pointAt(t),l=new W(r,i).pointAt(t),u=new W(o,a).pointAt(t),h=new W(a,l).pointAt(t),f=new W(u,h).pointAt(t);return{startControlPoint1:o,startControlPoint2:u,divider:f,dividerControlPoint1:h,dividerControlPoint2:l}}getSubdivisions(t={}){const e=this.getPrecision(t);let s=[new Bt(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(e===0)return s;let r=this.endpointDistance();const i=Math.pow(10,-e);let o=0;for(;;){o+=1;const a=[];s.forEach(h=>{const f=h.divide(.5);a.push(f[0],f[1])});const l=a.reduce((h,f)=>h+f.endpointDistance(),0),u=l!==0?(l-r)/l:0;if(o>1&&u<i)return a;s=a,r=l}}length(t={}){return this.getDivisions(t).reduce((s,r)=>s+r.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const s=e.precision===void 0?this.PRECISION:e.precision;return this.divide(t)[0].length({precision:s})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const s=this.tAt(t,e);return this.pointAtT(s)}pointAtLength(t,e={}){const s=this.tAtLength(t,e);return this.pointAtT(s)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(s)&&s.equals(r))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const s=this.tAt(t,e);return this.tangentAtT(s)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const s=this.tAtLength(t,e);return this.tangentAtT(s)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),s=e.startControlPoint2,r=e.dividerControlPoint1,i=e.divider,o=new W(s,r);return o.translate(i.x-s.x,i.y-s.y),o}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getDivisions(t={}){if(t.subdivisions!=null)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),s=this.getDivisions(t);return{precision:e,subdivisions:s}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const s=this.getOptions(e),i=this.length(s)*t;return this.tAtLength(i,s)}tAtLength(t,e={}){let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getDivisions(e),o={precision:r,subdivisions:i};let a=null,l,u,h=0,f=0,d=0;const g=i.length;let p=g>0?1/g:0;for(let b=0;b<g;b+=1){const w=s?b:g-1-b,x=i[b],v=x.endpointDistance();if(t<=d+v){a=x,l=w*p,u=(w+1)*p,h=s?t-d:v+d-t,f=s?v+d-t:t-d;break}d+=v}if(a==null)return s?1:0;const m=this.length(o),y=Math.pow(10,-r);for(;;){let b;if(b=m!==0?h/m:0,b<y)return l;if(b=m!==0?f/m:0,b<y)return u;let w,x;const v=a.divide(.5);p/=2;const S=v[0].endpointDistance(),E=v[1].endpointDistance();h<=S?(a=v[0],u-=p,w=h,x=S-w):(a=v[1],l+=p,w=h-S,x=E-w),h=w,f=x}}toPoints(t={}){const e=this.getDivisions(t),s=[e[0].start.clone()];return e.forEach(r=>s.push(r.end.clone())),s}toPolyline(t={}){return new $t(this.toPoints(t))}scale(t,e,s){return this.start.scale(t,e,s),this.controlPoint1.scale(t,e,s),this.controlPoint2.scale(t,e,s),this.end.scale(t,e,s),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return t!=null&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new Bt(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(n){function t(e){return e!=null&&e instanceof n}n.isCurve=t})(Bt||(Bt={})),function(n){function t(r){const i=r.length,o=[],a=[];let l=2;o[0]=r[0]/l;for(let u=1;u<i;u+=1)a[u]=1/l,l=(u<i-1?4:3.5)-a[u],o[u]=(r[u]-o[u-1])/l;for(let u=1;u<i;u+=1)o[i-u-1]-=a[i-u]*o[i-u];return o}function e(r){const i=r.map(d=>O.clone(d)),o=[],a=[],l=i.length-1;if(l===1)return o[0]=new O((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new O(2*o[0].x-i[0].x,2*o[0].y-i[0].y),[o,a];const u=[];for(let d=1;d<l-1;d+=1)u[d]=4*i[d].x+2*i[d+1].x;u[0]=i[0].x+2*i[1].x,u[l-1]=(8*i[l-1].x+i[l].x)/2;const h=t(u);for(let d=1;d<l-1;d+=1)u[d]=4*i[d].y+2*i[d+1].y;u[0]=i[0].y+2*i[1].y,u[l-1]=(8*i[l-1].y+i[l].y)/2;const f=t(u);for(let d=0;d<l;d+=1)o.push(new O(h[d],f[d])),d<l-1?a.push(new O(2*i[d+1].x-h[d+1],2*i[d+1].y-f[d+1])):a.push(new O((i[l].x+h[l-1])/2,(i[l].y+f[l-1])/2));return[o,a]}function s(r){if(r==null||Array.isArray(r)&&r.length<2)throw new Error("At least 2 points are required");const i=e(r),o=[];for(let a=0,l=i[0].length;a<l;a+=1){const u=new O(i[0][a].x,i[0][a].y),h=new O(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,h,r[a+1]))}return o}n.throughPoints=s}(Bt||(Bt={}));class Xa extends ys{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(this.previousSegment==null)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const s=this.length();return t>=1?s:s*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class fe extends Xa{constructor(t,e){super(),W.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=O.create(t,e).round(2)}get type(){return"L"}get line(){return new W(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new fe(e[0]),new fe(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new fe(e[0]),new fe(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new fe(this.end)}scale(t,e,s){return this.end.scale(t,e,s),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(n){function t(...e){const s=e.length,r=e[0];if(W.isLine(r))return new n(r);if(O.isPointLike(r))return s===1?new n(r):e.map(o=>new n(o));if(s===2)return new n(+e[0],+e[1]);const i=[];for(let o=0;o<s;o+=2){const a=+e[o],l=+e[o+1];i.push(new n(a,l))}return i}n.create=t})(fe||(fe={}));class zr extends Xa{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new W(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new fe(e[0]):this.clone(),new fe(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new fe(e[0]):this.clone(),new fe(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new zr}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function t(){return new n}n.create=t})(zr||(zr={}));class Fr extends Xa{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,W.isLine(t)||Bt.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=O.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,s){return this.end.scale(t,e,s),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?this.end.translate(t,e):this.end.translate(t),this}clone(){return new Fr(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(n){function t(...e){const s=e.length,r=e[0];if(W.isLine(r))return new n(r);if(Bt.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===1)return new n(r);const o=[];for(let a=0;a<s;a+=1)a===0?o.push(new n(e[a])):o.push(new fe(e[a]));return o}if(s===2)return new n(+e[0],+e[1]);const i=[];for(let o=0;o<s;o+=2){const a=+e[o],l=+e[o+1];o===0?i.push(new n(a,l)):i.push(new fe(a,l))}return i}n.create=t})(Fr||(Fr={}));class He extends Xa{constructor(t,e,s,r,i,o){super(),Bt.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):typeof t=="number"?(this.controlPoint1=new O(t,e).round(2),this.controlPoint2=new O(s,r).round(2),this.endPoint=new O(i,o).round(2)):(this.controlPoint1=O.create(t).round(2),this.controlPoint2=O.create(e).round(2),this.endPoint=O.create(s).round(2))}get type(){return"C"}get curve(){return new Bt(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const s=this.curve.divideAt(t,e);return[new He(s[0]),new He(s[1])]}divideAtLength(t,e={}){const s=this.curve.divideAtLength(t,e);return[new He(s[0]),new He(s[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new He(e[0]),new He(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(t.equals(e)&&e.equals(s)&&s.equals(r))}scale(t,e,s){return this.controlPoint1.scale(t,e,s),this.controlPoint2.scale(t,e,s),this.end.scale(t,e,s),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return typeof t=="number"?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new He(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,s=this.end;return[this.type,t.x,t.y,e.x,e.y,s.x,s.y].join(" ")}}(function(n){function t(...e){const s=e.length,r=e[0];if(Bt.isCurve(r))return new n(r);if(O.isPointLike(r)){if(s===3)return new n(e[0],e[1],e[2]);const o=[];for(let a=0;a<s;a+=3)o.push(new n(e[a],e[a+1],e[a+2]));return o}if(s===6)return new n(e[0],e[1],e[2],e[3],e[4],e[5]);const i=[];for(let o=0;o<s;o+=6)i.push(new n(e[o],e[o+1],e[o+2],e[o+3],e[o+4],e[o+5]));return i}n.create=t})(He||(He={}));function Ka(n,t,e){return{x:n*Math.cos(e)-t*Math.sin(e),y:n*Math.sin(e)+t*Math.cos(e)}}function Py(n,t,e,s,r,i){const o=.3333333333333333,a=2/3;return[o*n+a*e,o*t+a*s,o*r+a*e,o*i+a*s,r,i]}function Ay(n,t,e,s,r,i,o,a,l,u){const h=Math.PI*120/180,f=Math.PI/180*(+r||0);let d=[],g,p,m,y,b;if(u)p=u[0],m=u[1],y=u[2],b=u[3];else{g=Ka(n,t,-f),n=g.x,t=g.y,g=Ka(a,l,-f),a=g.x,l=g.y;const I=(n-a)/2,A=(t-l)/2;let P=I*I/(e*e)+A*A/(s*s);P>1&&(P=Math.sqrt(P),e=P*e,s=P*s);const B=e*e,j=s*s,Y=(i===o?-1:1)*Math.sqrt(Math.abs((B*j-B*A*A-j*I*I)/(B*A*A+j*I*I)));y=Y*e*A/s+(n+a)/2,b=Y*-s*I/e+(t+l)/2,p=Math.asin((t-b)/s),m=Math.asin((l-b)/s),p=n<y?Math.PI-p:p,m=a<y?Math.PI-m:m,p<0&&(p=Math.PI*2+p),m<0&&(m=Math.PI*2+m),o&&p>m&&(p-=Math.PI*2),!o&&m>p&&(m-=Math.PI*2)}let w=m-p;if(Math.abs(w)>h){const I=m,A=a,P=l;m=p+h*(o&&m>p?1:-1),a=y+e*Math.cos(m),l=b+s*Math.sin(m),d=Ay(a,l,e,s,r,0,o,A,P,[m,I,y,b])}w=m-p;const x=Math.cos(p),v=Math.sin(p),S=Math.cos(m),E=Math.sin(m),C=Math.tan(w/4),M=4/3*(e*C),T=4/3*(s*C),_=[n,t],N=[n+M*v,t-T*x],k=[a+M*E,l-T*S],R=[a,l];if(N[0]=2*_[0]-N[0],N[1]=2*_[1]-N[1],u)return[N,k,R].concat(d);{d=[N,k,R].concat(d).join().split(",");const I=[],A=d.length;for(let P=0;P<A;P+=1)I[P]=P%2?Ka(+d[P-1],+d[P],f).y:Ka(+d[P],+d[P+1],f).x;return I}}function sI(n){if(!n)return null;const t=`
|
|
38
|
+
\v\f\r \u2028\u2029`,e=new RegExp(`([a-z])[${t},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${t}]*,?[${t}]*)+)`,"ig"),s=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${t}]*,?[${t}]*`,"ig"),r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];return n.replace(e,(o,a,l)=>{const u=[];let h=a.toLowerCase();l.replace(s,(d,g)=>(g&&u.push(+g),d)),h==="m"&&u.length>2&&(i.push([a,...u.splice(0,2)]),h="l",a=a==="m"?"l":"L");const f=r[h];for(;u.length>=f&&(i.push([a,...u.splice(0,f)]),!!f););return o}),i}function rI(n){const t=sI(n);if(!t||!t.length)return[["M",0,0]];let e=0,s=0,r=0,i=0;const o=[];for(let a=0,l=t.length;a<l;a+=1){const u=[];o.push(u);const h=t[a],f=h[0];if(f!==f.toUpperCase())switch(u[0]=f.toUpperCase(),u[0]){case"A":u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5],u[6]=+h[6]+e,u[7]=+h[7]+s;break;case"V":u[1]=+h[1]+s;break;case"H":u[1]=+h[1]+e;break;case"M":r=+h[1]+e,i=+h[2]+s;for(let d=1,g=h.length;d<g;d+=1)u[d]=+h[d]+(d%2?e:s);break;default:for(let d=1,g=h.length;d<g;d+=1)u[d]=+h[d]+(d%2?e:s);break}else for(let d=0,g=h.length;d<g;d+=1)u[d]=h[d];switch(u[0]){case"Z":e=+r,s=+i;break;case"H":e=u[1];break;case"V":s=u[1];break;case"M":r=u[u.length-2],i=u[u.length-1],e=u[u.length-2],s=u[u.length-1];break;default:e=u[u.length-2],s=u[u.length-1];break}}return o}function iI(n){const t=rI(n),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function s(l,u,h){let f,d;if(!l)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(l[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),l[0]){case"M":u.X=l[1],u.Y=l[2];break;case"A":return parseFloat(l[1])===0||parseFloat(l[2])===0?["L",l[6],l[7]]:["C"].concat(Ay.apply(0,[u.x,u.y].concat(l.slice(1))));case"S":return h==="C"||h==="S"?(f=u.x*2-u.bx,d=u.y*2-u.by):(f=u.x,d=u.y),["C",f,d].concat(l.slice(1));case"T":return h==="Q"||h==="T"?(u.qx=u.x*2-u.qx,u.qy=u.y*2-u.qy):(u.qx=u.x,u.qy=u.y),["C"].concat(Py(u.x,u.y,u.qx,u.qy,l[1],l[2]));case"Q":return u.qx=l[1],u.qy=l[2],["C"].concat(Py(u.x,u.y,l[1],l[2],l[3],l[4]));case"H":return["L"].concat(l[1],u.y);case"V":return["L"].concat(u.x,l[1])}return l}function r(l,u){if(l[u].length>7){l[u].shift();const h=l[u];for(;h.length;)i[u]="A",u+=1,l.splice(u,0,["C"].concat(h.splice(0,6)));l.splice(u,1),a=t.length}}const i=[];let o="",a=t.length;for(let l=0;l<a;l+=1){let u="";t[l]&&(u=t[l][0]),u!=="C"&&(i[l]=u,l>0&&(o=i[l-1])),t[l]=s(t[l],e,o),i[l]!=="A"&&u==="C"&&(i[l]="C"),r(t,l);const h=t[l],f=h.length;e.x=h[f-2],e.y=h[f-1],e.bx=parseFloat(h[f-4])||e.x,e.by=parseFloat(h[f-3])||e.y}return(!t[0][0]||t[0][0]!=="M")&&t.unshift(["M",0,0]),t}function oI(n){return iI(n).map(t=>t.map(e=>typeof e=="string"?e:wt.round(e,2))).join(",").split(",").join(" ")}class Z extends ys{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(W.isLine(t[0])||Bt.isCurve(t[0])){let e=null;t.forEach((r,i)=>{i===0&&this.appendSegment(Z.createSegment("M",r.start)),e!=null&&!e.end.equals(r.start)&&this.appendSegment(Z.createSegment("M",r.start)),W.isLine(r)?this.appendSegment(Z.createSegment("L",r.end)):Bt.isCurve(r)&&this.appendSegment(Z.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),e=r})}else t.forEach(s=>{s.isSegment&&this.appendSegment(s)});else t!=null&&(W.isLine(t)?(this.appendSegment(Z.createSegment("M",t.start)),this.appendSegment(Z.createSegment("L",t.end))):Bt.isCurve(t)?(this.appendSegment(Z.createSegment("M",t.start)),this.appendSegment(Z.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):$t.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((e,s)=>{const r=s===0?Z.createSegment("M",e):Z.createSegment("L",e);this.appendSegment(r)}):t.isSegment&&this.appendSegment(t))}get start(){const t=this.segments,e=t.length;if(e===0)return null;for(let s=0;s<e;s+=1){const r=t[s];if(r.isVisible)return r.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(e===0)return null;for(let s=e-1;s>=0;s-=1){const r=t[s];if(r.isVisible)return r.end}return t[e-1].end}moveTo(...t){return this.appendSegment(Fr.create.call(null,...t))}lineTo(...t){return this.appendSegment(fe.create.call(null,...t))}curveTo(...t){return this.appendSegment(He.create.call(null,...t))}arcTo(t,e,s,r,i,o,a){const l=this.end||new O,u=typeof o=="number"?Ja(l.x,l.y,t,e,s,r,i,o,a):Ja(l.x,l.y,t,e,s,r,i,o.x,o.y);if(u!=null)for(let h=0,f=u.length;h<f;h+=6)this.curveTo(u[h],u[h+1],u[h+2],u[h+3],u[h+4],u[h+5]);return this}quadTo(t,e,s,r){const i=this.end||new O,o=["M",i.x,i.y];if(typeof t=="number")o.push("Q",t,e,s,r);else{const l=e;o.push("Q",t.x,t.y,l.x,l.y)}const a=Z.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(zr.create())}drawPoints(t,e={}){const s=My(t,e),r=Z.parse(s);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const t=this.segments,e=t.length;if(e===0)return null;let s;for(let i=0;i<e;i+=1){const o=t[i];if(o.isVisible){const a=o.bbox();a!=null&&(s=s?s.union(a):a)}}if(s!=null)return s;const r=t[e-1];return new z(r.end.x,r.end.y,0,0)}appendSegment(t){const e=this.segments.length;let s=e!==0?this.segments[e-1]:null,r;const i=null;if(Array.isArray(t))for(let o=0,a=t.length;o<a;o+=1){const l=t[o];r=this.prepareSegment(l,s,i),this.segments.push(r),s=r}else t!=null&&t.isSegment&&(r=this.prepareSegment(t,s,i),this.segments.push(r));return this}insertSegment(t,e){const s=this.segments.length;if(t<0&&(t=s+t+1),t>s||t<0)throw new Error("Index out of range.");let r,i=null,o=null;if(s!==0&&(t>=1?(i=this.segments[t-1],o=i.nextSegment):(i=null,o=this.segments[0])),!Array.isArray(e))r=this.prepareSegment(e,i,o),this.segments.splice(t,0,r);else for(let a=0,l=e.length;a<l;a+=1){const u=e[a];r=this.prepareSegment(u,i,o),this.segments.splice(t+a,0,r),i=r}return this}removeSegment(t){const e=this.fixIndex(t),s=this.segments.splice(e,1)[0],r=s.previousSegment,i=s.nextSegment;return r&&(r.nextSegment=i),i&&(i.previousSegment=r),s.isSubpathStart&&i&&this.updateSubpathStartSegment(i),s}replaceSegment(t,e){const s=this.fixIndex(t);let r;const i=this.segments[s];let o=i.previousSegment;const a=i.nextSegment;let l=i.isSubpathStart;if(!Array.isArray(e))r=this.prepareSegment(e,o,a),this.segments.splice(s,1,r),l&&r.isSubpathStart&&(l=!1);else{this.segments.splice(t,1);for(let u=0,h=e.length;u<h;u+=1){const f=e[u];r=this.prepareSegment(f,o,a),this.segments.splice(t+u,0,r),o=r,l&&r.isSubpathStart&&(l=!1)}}l&&a&&this.updateSubpathStartSegment(a)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(e===0)throw new Error("Path has no segments.");let s=t;for(;s<0;)s=e+s;if(s>=e||s<0)throw new Error("Index out of range.");return s}segmentAt(t,e={}){const s=this.segmentIndexAt(t,e);return s?this.getSegment(s):null}segmentAtLength(t,e={}){const s=this.segmentIndexAtLength(t,e);return s?this.getSegment(s):null}segmentIndexAt(t,e={}){if(this.segments.length===0)return null;const s=wt.clamp(t,0,1),r=this.getOptions(e),o=this.length(r)*s;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(t,e={}){const s=this.segments.length;if(s===0)return null;let r=!0;t<0&&(r=!1,t=-t);const i=this.getPrecision(e),o=this.getSubdivisions(e);let a=0,l=null;for(let u=0;u<s;u+=1){const h=r?u:s-1-u,f=this.segments[h],d=o[h],g=f.length({precision:i,subdivisions:d});if(f.isVisible){if(t<=a+g)return h;l=h}a+=g}return l}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),s=[];for(let r=0,i=this.segments.length;r<i;r+=1){const a=this.segments[r].getSubdivisions({precision:e});s.push(a)}return s}updateSubpathStartSegment(t){let e=t.previousSegment,s=t;for(;s&&!s.isSubpathStart;)e!=null?s.subpathStartSegment=e.subpathStartSegment:s.subpathStartSegment=null,e=s,s=s.nextSegment}prepareSegment(t,e,s){t.previousSegment=e,t.nextSegment=s,e!=null&&(e.nextSegment=t),s!=null&&(s.previousSegment=t);let r=t;return t.isSubpathStart&&(t.subpathStartSegment=t,r=s),r!=null&&this.updateSubpathStartSegment(r),t}closestPoint(t,e={}){const s=this.closestPointT(t,e);return s?this.pointAtT(s):null}closestPointLength(t,e={}){const s=this.getOptions(e),r=this.closestPointT(t,s);return r?this.lengthAtT(r,s):0}closestPointNormalizedLength(t,e={}){const s=this.getOptions(e),r=this.closestPointLength(t,s);if(r===0)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(t,e={}){if(this.segments.length===0)return null;const s=this.getPrecision(e),r=this.getSubdivisions(e);let i,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const u=this.segments[a],h=r[a];if(u.isVisible){const f=u.closestPointT(t,{precision:s,subdivisions:h}),d=u.pointAtT(f),g=wt.squaredLength(d,t);g<o&&(i={segmentIndex:a,value:f},o=g)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(this.segments.length===0)return null;const s=this.getPrecision(e),r=this.getSubdivisions(e);let i,o=1/0;for(let a=0,l=this.segments.length;a<l;a+=1){const u=this.segments[a],h=r[a];if(u.isDifferentiable()){const f=u.closestPointT(t,{precision:s,subdivisions:h}),d=u.pointAtT(f),g=wt.squaredLength(d,t);g<o&&(i=u.tangentAtT(f),o=g)}}return i||null}containsPoint(t,e={}){const s=this.toPolylines(e);if(!s)return!1;let r=0;for(let i=0,o=s.length;i<o;i+=1)s[i].containsPoint(t)&&(r+=1);return r%2===1}pointAt(t,e={}){if(this.segments.length===0)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const s=this.getOptions(e),i=this.length(s)*t;return this.pointAtLength(i,s)}pointAtLength(t,e={}){if(this.segments.length===0)return null;if(t===0)return this.start.clone();let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a=0;for(let u=0,h=this.segments.length;u<h;u+=1){const f=s?u:h-1-u,d=this.segments[f],g=i[f],p=d.length({precision:r,subdivisions:g});if(d.isVisible){if(t<=a+p)return d.pointAtLength((s?1:-1)*(t-a),{precision:r,subdivisions:g});o=d}a+=p}return o?s?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(t){const e=this.segments,s=e.length;if(s===0)return null;const r=t.segmentIndex;if(r<0)return e[0].pointAtT(0);if(r>=s)return e[s-1].pointAtT(1);const i=wt.clamp(t.value,0,1);return e[r].pointAtT(i)}divideAt(t,e={}){if(this.segments.length===0)return null;const s=wt.clamp(t,0,1),r=this.getOptions(e),o=this.length(r)*s;return this.divideAtLength(o,r)}divideAtLength(t,e={}){if(this.segments.length===0)return null;let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o=0,a,l,u,h,f;for(let S=0,E=this.segments.length;S<E;S+=1){const C=s?S:E-1-S,M=this.getSegment(C),T=i[C],_={precision:r,subdivisions:T},N=M.length(_);if(M.isDifferentiable()&&(u=M,h=C,t<=o+N)){l=C,a=M.divideAtLength((s?1:-1)*(t-o),_);break}o+=N}if(!u)return null;a||(l=h,f=s?1:0,a=u.divideAtT(f));const d=this.clone(),g=l;d.replaceSegment(g,a);const p=g;let m=g+1,y=g+2;a[0].isDifferentiable()||(d.removeSegment(p),m-=1,y-=1);const b=d.getSegment(m).start;d.insertSegment(m,Z.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(d.removeSegment(y-1),y-=1);const w=y-p-1;for(let S=y,E=d.segments.length;S<E;S+=1){const C=this.getSegment(S-w),M=d.getSegment(S);if(M.type==="Z"&&!C.subpathStartSegment.end.equals(M.subpathStartSegment.end)){const T=Z.createSegment("L",C.end);d.replaceSegment(S,T)}}const x=new Z(d.segments.slice(0,m)),v=new Z(d.segments.slice(m));return[x,v]}intersectsWithLine(t,e={}){const s=this.toPolylines(e);if(s==null)return null;let r=null;for(let i=0,o=s.length;i<o;i+=1){const a=s[i],l=t.intersect(a);l&&(r==null&&(r=[]),Array.isArray(l)?r.push(...l):r.push(l))}return r}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1)if(this.segments[t].isDifferentiable())return!0;return!1}isValid(){const t=this.segments;return t.length===0||t[0].type==="M"}length(t={}){if(this.segments.length===0)return 0;const e=this.getSubdivisions(t);let s=0;for(let r=0,i=this.segments.length;r<i;r+=1){const o=this.segments[r],a=e[r];s+=o.length({subdivisions:a})}return s}lengthAtT(t,e={}){const s=this.segments.length;if(s===0)return 0;let r=t.segmentIndex;if(r<0)return 0;let i=wt.clamp(t.value,0,1);r>=s&&(r=s-1,i=1);const o=this.getPrecision(e),a=this.getSubdivisions(e);let l=0;for(let f=0;f<r;f+=1){const d=this.segments[f],g=a[f];l+=d.length({precision:o,subdivisions:g})}const u=this.segments[r],h=a[r];return l+=u.lengthAtT(i,{precision:o,subdivisions:h}),l}tangentAt(t,e={}){if(this.segments.length===0)return null;const s=wt.clamp(t,0,1),r=this.getOptions(e),o=this.length(r)*s;return this.tangentAtLength(o,r)}tangentAtLength(t,e={}){if(this.segments.length===0)return null;let s=!0;t<0&&(s=!1,t=-t);const r=this.getPrecision(e),i=this.getSubdivisions(e);let o,a=0;for(let l=0,u=this.segments.length;l<u;l+=1){const h=s?l:u-1-l,f=this.segments[h],d=i[h],g=f.length({precision:r,subdivisions:d});if(f.isDifferentiable()){if(t<=a+g)return f.tangentAtLength((s?1:-1)*(t-a),{precision:r,subdivisions:d});o=f}a+=g}if(o){const l=s?1:0;return o.tangentAtT(l)}return null}tangentAtT(t){const e=this.segments.length;if(e===0)return null;const s=t.segmentIndex;if(s<0)return this.segments[0].tangentAtT(0);if(s>=e)return this.segments[e-1].tangentAtT(1);const r=wt.clamp(t.value,0,1);return this.segments[s].tangentAtT(r)}getPrecision(t={}){return t.precision==null?this.PRECISION:t.precision}getSubdivisions(t={}){if(t.segmentSubdivisions==null){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),s=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:s}}toPoints(t={}){const e=this.segments,s=e.length;if(s===0)return null;const r=this.getSubdivisions(t),i=[];let o=[];for(let a=0;a<s;a+=1){const l=e[a];if(l.isVisible){const u=r[a];u.length>0?u.forEach(h=>o.push(h.start)):o.push(l.start)}else o.length>0&&(o.push(e[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(s=>new $t(s)):null}scale(t,e,s){return this.segments.forEach(r=>r.scale(t,e,s)),this}rotate(t,e){return this.segments.forEach(s=>s.rotate(t,e)),this}translate(t,e){return typeof t=="number"?this.segments.forEach(s=>s.translate(t,e)):this.segments.forEach(s=>s.translate(t)),this}clone(){const t=new Z;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(t==null)return!1;const e=this.segments,s=t.segments,r=e.length;if(s.length!==r)return!1;for(let i=0;i<r;i+=1){const o=e[i],a=s[i];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function t(e){return e!=null&&e instanceof n}n.isPath=t})(Z||(Z={})),function(n){function t(s){if(!s)return new n;const r=new n,i=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=n.normalize(s).match(i);if(o!=null)for(let a=0,l=o.length;a<l;a+=1){const u=o[a],h=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,f=u.match(h);if(f!=null){const d=f[0],g=f.slice(1).map(m=>+m),p=e.call(null,d,...g);r.appendSegment(p)}}return r}n.parse=t;function e(s,...r){if(s==="M")return Fr.create.call(null,...r);if(s==="L")return fe.create.call(null,...r);if(s==="C")return He.create.call(null,...r);if(s==="z"||s==="Z")return zr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=e}(Z||(Z={})),function(n){n.normalize=oI,n.isValid=tI,n.drawArc=nI,n.drawPoints=My,n.arcToCurves=Ja}(Z||(Z={}));class zt{constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,s=!1){if(typeof t=="object"){Object.entries(t).forEach(([o,a])=>{this.register(o,a,e)});return}this.exist(t)&&!s&&!fs.isApplyingHMR()&&this.onDuplicated(t);const r=this.options.process,i=r?X(r,this,t,e):e;return this.data[t]=i,i}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return t?this.data[t]!=null:!1}onDuplicated(t){try{throw this.options.onConflict&&X(this.options.onConflict,this,t),new Error(`${ea(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const s=this.getSpellingSuggestionForName(t),r=e?`${e} ${r2(this.options.type)}`:this.options.type;return`${ea(r)} with name '${t}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(t){return oR(t,Object.keys(this.data),e=>e)}}(function(n){function t(e){return new n(e)}n.create=t})(zt||(zt={}));const aI=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,t){const e=t.thickness*t.sx,s=t.thickness*t.sy;ut(n,{width:e,height:s,rx:e,ry:s,fill:t.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,t){let e;const s=t.width,r=t.height,i=t.thickness;s-i>=0&&r-i>=0?e=["M",s,0,"H0 M0 0 V0",r].join(" "):e="M 0 0 0 0",ut(n,{d:e,stroke:t.color,"stroke-width":t.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,t){let e;const s=t.factor||1,r=t.width*s,i=t.height*s,o=t.thickness;r-o>=0&&i-o>=0?e=["M",r,0,"H0 M0 0 V0",i].join(" "):e="M 0 0 0 0",t.width=r,t.height=i,ut(n,{d:e,stroke:t.color,"stroke-width":t.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,t){const e=t.sx<=1?t.thickness*t.sx:t.thickness;ut(n,{width:e,height:e,rx:e,ry:e,fill:t.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,t){let e;const s=t.width,r=t.height,i=t.thickness;s-i>=0&&r-i>=0?e=["M",s,0,"H0 M0 0 V0",r].join(" "):e="M 0 0 0 0",ut(n,{d:e,stroke:t.color,"stroke-width":t.thickness})}}},Symbol.toStringTag,{value:"Module"}));class bs{constructor(){this.patterns={},this.root=tt.create(Fa(),{width:"100%",height:"100%"},[cn("defs")]).node}add(t,e){const s=this.root.childNodes[0];s&&s.appendChild(e),this.patterns[t]=e,tt.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return this.patterns[t]!=null}}(function(n){n.presets=aI,n.registry=zt.create({type:"grid"}),n.registry.register(n.presets,!0)})(bs||(bs={}));const Ty=function(n){const t=document.createElement("canvas"),e=n.width,s=n.height;t.width=e*2,t.height=s;const r=t.getContext("2d");return r.drawImage(n,0,0,e,s),r.translate(2*e,0),r.scale(-1,1),r.drawImage(n,0,0,e,s),t},Ny=function(n){const t=document.createElement("canvas"),e=n.width,s=n.height;t.width=e,t.height=s*2;const r=t.getContext("2d");return r.drawImage(n,0,0,e,s),r.translate(0,2*s),r.scale(1,-1),r.drawImage(n,0,0,e,s),t},_y=function(n){const t=document.createElement("canvas"),e=n.width,s=n.height;t.width=2*e,t.height=2*s;const r=t.getContext("2d");return r.drawImage(n,0,0,e,s),r.setTransform(-1,0,0,-1,t.width,t.height),r.drawImage(n,0,0,e,s),r.setTransform(-1,0,0,1,t.width,0),r.drawImage(n,0,0,e,s),r.setTransform(1,0,0,-1,0,t.height),r.drawImage(n,0,0,e,s),t},lI=Object.freeze(Object.defineProperty({__proto__:null,flipX:Ty,flipXY:_y,flipY:Ny,watermark:function(n,t){const e=n.width,s=n.height,r=document.createElement("canvas");r.width=e*3,r.height=s*3;const i=r.getContext("2d"),o=t.angle!=null?-t.angle:-20,a=gt.toRad(o),l=r.width/4,u=r.height/4;for(let h=0;h<4;h+=1)for(let f=0;f<4;f+=1)(h+f)%2>0&&(i.setTransform(1,0,0,1,(2*h-1)*l,(2*f-1)*u),i.rotate(a),i.drawImage(n,-e/2,-s/2,e,s));return r}},Symbol.toStringTag,{value:"Module"}));var ro;(function(n){n.presets=Object.assign({},lI),n.presets["flip-x"]=Ty,n.presets["flip-y"]=Ny,n.presets["flip-xy"]=_y,n.registry=zt.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(ro||(ro={}));function Ju(n,t){return n??t}function se(n,t){return n!=null&&Number.isFinite(n)?n:t}function cI(n={}){const t=Ju(n.color,"blue"),e=se(n.width,1),s=se(n.margin,2),r=se(n.opacity,1),i=s,o=s+e;return`
|
|
39
39
|
<filter>
|
|
40
40
|
<feFlood flood-color="${t}" flood-opacity="${r}" result="colored"/>
|
|
41
41
|
<feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
|
|
@@ -47,7 +47,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
47
47
|
<feMergeNode in="SourceGraphic"/>
|
|
48
48
|
</feMerge>
|
|
49
49
|
</filter>
|
|
50
|
-
`.trim()}function
|
|
50
|
+
`.trim()}function uI(n={}){const t=Ju(n.color,"red"),e=se(n.blur,0),s=se(n.width,1),r=se(n.opacity,1);return`
|
|
51
51
|
<filter>
|
|
52
52
|
<feFlood flood-color="${t}" flood-opacity="${r}" result="colored"/>
|
|
53
53
|
<feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${s}"/>
|
|
@@ -55,11 +55,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
55
55
|
<feGaussianBlur result="blured" in="composed" stdDeviation="${e}"/>
|
|
56
56
|
<feBlend in="SourceGraphic" in2="blured" mode="normal"/>
|
|
57
57
|
</filter>
|
|
58
|
-
`.trim()}function
|
|
58
|
+
`.trim()}function hI(n={}){const t=se(n.x,2);return`
|
|
59
59
|
<filter>
|
|
60
60
|
<feGaussianBlur stdDeviation="${n.y!=null&&Number.isFinite(n.y)?[t,n.y]:t}"/>
|
|
61
61
|
</filter>
|
|
62
|
-
`.trim()}function
|
|
62
|
+
`.trim()}function dI(n={}){const t=se(n.dx,0),e=se(n.dy,0),s=Ju(n.color,"black"),r=se(n.blur,4),i=se(n.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>
|
|
63
63
|
<feDropShadow stdDeviation="${r}" dx="${t}" dy="${e}" flood-color="${s}" flood-opacity="${i}" />
|
|
64
64
|
</filter>`.trim():`<filter>
|
|
65
65
|
<feGaussianBlur in="SourceAlpha" stdDeviation="${r}" />
|
|
@@ -73,23 +73,23 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
73
73
|
<feMergeNode/>
|
|
74
74
|
<feMergeNode in="SourceGraphic"/>
|
|
75
75
|
</feMerge>
|
|
76
|
-
</filter>`.trim()}function
|
|
76
|
+
</filter>`.trim()}function fI(n={}){const t=se(n.amount,1),e=.2126+.7874*(1-t),s=.7152-.7152*(1-t),r=.0722-.0722*(1-t),i=.2126-.2126*(1-t),o=.7152+.2848*(1-t),a=.0722-.0722*(1-t),l=.2126-.2126*(1-t),u=.0722+.9278*(1-t);return`
|
|
77
77
|
<filter>
|
|
78
78
|
<feColorMatrix type="matrix" values="${e} ${s} ${r} 0 0 ${i} ${o} ${a} 0 0 ${l} ${s} ${u} 0 0 0 0 0 1 0"/>
|
|
79
79
|
</filter>
|
|
80
|
-
`.trim()}function
|
|
80
|
+
`.trim()}function gI(n={}){const t=se(n.amount,1),e=.393+.607*(1-t),s=.769-.769*(1-t),r=.189-.189*(1-t),i=.349-.349*(1-t),o=.686+.314*(1-t),a=.168-.168*(1-t),l=.272-.272*(1-t),u=.534-.534*(1-t),h=.131+.869*(1-t);return`
|
|
81
81
|
<filter>
|
|
82
82
|
<feColorMatrix type="matrix" values="${e} ${s} ${r} 0 0 ${i} ${o} ${a} 0 0 ${l} ${u} ${h} 0 0 0 0 0 1 0"/>
|
|
83
83
|
</filter>
|
|
84
|
-
`.trim()}function
|
|
84
|
+
`.trim()}function pI(n={}){return`
|
|
85
85
|
<filter>
|
|
86
86
|
<feColorMatrix type="saturate" values="${1-se(n.amount,1)}"/>
|
|
87
87
|
</filter>
|
|
88
|
-
`.trim()}function
|
|
88
|
+
`.trim()}function mI(n={}){return`
|
|
89
89
|
<filter>
|
|
90
90
|
<feColorMatrix type="hueRotate" values="${se(n.angle,0)}"/>
|
|
91
91
|
</filter>
|
|
92
|
-
`.trim()}function
|
|
92
|
+
`.trim()}function yI(n={}){const t=se(n.amount,1),e=1-t;return`
|
|
93
93
|
<filter>
|
|
94
94
|
<feComponentTransfer>
|
|
95
95
|
<feFuncR type="table" tableValues="${t} ${e}"/>
|
|
@@ -97,7 +97,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
97
97
|
<feFuncB type="table" tableValues="${t} ${e}"/>
|
|
98
98
|
</feComponentTransfer>
|
|
99
99
|
</filter>
|
|
100
|
-
`.trim()}function
|
|
100
|
+
`.trim()}function bI(n={}){const t=se(n.amount,1);return`
|
|
101
101
|
<filter>
|
|
102
102
|
<feComponentTransfer>
|
|
103
103
|
<feFuncR type="linear" slope="${t}"/>
|
|
@@ -105,7 +105,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
105
105
|
<feFuncB type="linear" slope="${t}"/>
|
|
106
106
|
</feComponentTransfer>
|
|
107
107
|
</filter>
|
|
108
|
-
`.trim()}function
|
|
108
|
+
`.trim()}function wI(n={}){const t=se(n.amount,1),e=.5-t/2;return`
|
|
109
109
|
<filter>
|
|
110
110
|
<feComponentTransfer>
|
|
111
111
|
<feFuncR type="linear" slope="${t}" intercept="${e}"/>
|
|
@@ -113,11 +113,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
113
113
|
<feFuncB type="linear" slope="${t}" intercept="${e}"/>
|
|
114
114
|
</feComponentTransfer>
|
|
115
115
|
</filter>
|
|
116
|
-
`.trim()}const wI=Object.freeze(Object.defineProperty({__proto__:null,blur:uI,brightness:yI,contrast:bI,dropShadow:hI,grayScale:dI,highlight:cI,hueRotate:pI,invert:mI,outline:lI,saturate:gI,sepia:fI},Symbol.toStringTag,{value:"Module"}));var Hr;(function(n){n.presets=wI,n.registry=Ft.create({type:"filter"}),n.registry.register(n.presets,!0)})(Hr||(Hr={}));const xI={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},vI={},ky={position:Qa("x","width","origin")},Dy={position:Qa("y","height","origin")},CI={position:Qa("x","width","corner")},SI={position:Qa("y","height","corner")},Ry={set:ws("width","width")},Iy={set:ws("height","height")},EI={set:ws("rx","width")},OI={set:ws("ry","height")},Ly={set:(n=>{const t=ws(n,"width"),e=ws(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?t:e;return X(o,this,s,r)}})("r")},MI={set(n,{refBBox:t}){let e=parseFloat(n);const s=Yn(n);s&&(e/=100);const r=Math.sqrt(t.height*t.height+t.width*t.width);let i;return Number.isFinite(e)&&(s||e>=0&&e<=1?i=e*r:i=Math.max(e+r,0)),{r:i}}},PI={set:ws("cx","width")},AI={set:ws("cy","height")},By={set:$y({resetOffset:!0})},TI={set:$y({resetOffset:!1})},Vy={set:zy({resetOffset:!0})},NI={set:zy({resetOffset:!1})},_I=Ly,kI=By,DI=Vy,RI=ky,II=Dy,LI=Ry,BI=Iy;function Qa(n,t,e){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=Yn(s);o&&(i/=100);let a;if(Number.isFinite(i)){const u=r[e];o||i>0&&i<1?a=u[n]+r[t]*i:a=u[n]+i}const l=new O;return l[n]=a||0,l}}function ws(n,t){return function(e,{refBBox:s}){let r=parseFloat(e);const i=Yn(e);i&&(r/=100);const o={};if(Number.isFinite(r)){const a=i||r>=0&&r<=1?r*s[t]:Math.max(r+s[t],0);o[n]=a}return o}}function jy(n,t){const e="x6-shape",s=t&&t.resetOffset;return function(r,{elem:i,refBBox:o}){let a=Js(i,e);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},Js(i,e,a)}const l=a.shape.clone(),u=a.shapeBBox.clone(),h=u.getOrigin(),f=o.getOrigin();u.x=f.x,u.y=f.y;const d=o.getMaxScaleToFit(u,f),g=u.width===0||o.width===0?1:d.sx,p=u.height===0||o.height===0?1:d.sy;return l.scale(g,p,h),s&&l.translate(-h.x,-h.y),l}}function $y(n){function t(s){return Z.parse(s)}const e=jy(t,n);return(s,r)=>({d:e(s,r).serialize()})}function zy(n){const t=jy(e=>new zt(e),n);return(e,s)=>({points:t(e,s).serialize()})}const VI={qualify:bn,set(n,{view:t}){return`url(#${t.graph.defineGradient(n)})`}},jI={qualify:bn,set(n,{view:t}){const e=t.cell,s=Object.assign({},n);if(e.isEdge()&&s.type==="linearGradient"){const r=t,i=r.sourcePoint,o=r.targetPoint;s.id=`gradient-${s.type}-${e.id}`,s.attrs=Object.assign(Object.assign({},s.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(s.id)}return`url(#${t.graph.defineGradient(s)})`}},Fy={qualify(n,{attrs:t}){return t.textWrap==null||!bn(t.textWrap)},set(n,{view:t,elem:e,attrs:s}){const r="x6-text",i=Js(e,r),o=h=>{try{return JSON.parse(h)}catch{return h}},a={x:s.x,eol:s.eol,annotations:o(s.annotations),textPath:o(s["text-path"]||s.textPath),textVerticalAnchor:s["text-vertical-anchor"]||s.textVerticalAnchor,displayEmpty:(s["display-empty"]||s.displayEmpty)==="true",lineHeight:s["line-height"]||s.lineHeight},l=s["font-size"]||s.fontSize,u=JSON.stringify([n,a]);if(l&&e.setAttribute("font-size",l),i==null||i!==u){const h=a.textPath;if(h!=null&&typeof h=="object"){const f=h.selector;if(typeof f=="string"){const d=t.find(f)[0];d instanceof SVGPathElement&&(ku(d),a.textPath=Object.assign({"xlink:href":`#${d.id}`},h))}}my(e,`${n}`,a),Js(e,r,u)}}},$I={qualify:bn,set(n,{view:t,elem:e,attrs:s,refBBox:r}){const i=n,o=i.width||0;Yn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;Yn(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let l,u=i.text;u==null&&(u=s.text||(e==null?void 0:e.textContent)),u!=null?l=by(`${u}`,r,{"font-weight":s["font-weight"]||s.fontWeight,"font-size":s["font-size"]||s.fontSize,"font-family":s["font-family"]||s.fontFamily,lineHeight:s.lineHeight},{ellipsis:i.ellipsis}):l="",X(Fy.set,this,l,{view:t,elem:e,attrs:s,refBBox:r,cell:t.cell})}},Ur=(n,{attrs:t})=>t.text!==void 0,zI={qualify:Ur},FI={qualify:Ur},HI={qualify:Ur},UI={qualify:Ur},GI={qualify:Ur},YI={qualify:Ur},WI={qualify(n,{elem:t}){return t instanceof SVGElement},set(n,{elem:t}){const e="x6-title",s=`${n}`,r=Js(t,e);if(r==null||r!==s){Js(t,e,s);const i=t.firstChild;if(i&&i.tagName.toUpperCase()==="TITLE"){const o=i;o.textContent=s}else{const o=document.createElementNS(t.namespaceURI,"title");o.textContent=s,t.insertBefore(o,i)}}}},qI={offset:Hy("x","width","right")},JI={offset:Hy("y","height","bottom")},XI={offset(n,{refBBox:t}){return n?{x:-t.x,y:-t.y}:{x:0,y:0}}};function Hy(n,t,e){return(s,{refBBox:r})=>{const i=new O;let o;return s==="middle"?o=r[t]/2:s===e?o=r[t]:typeof s=="number"&&Number.isFinite(s)?o=s>-1&&s<1?-r[t]*s:-s:Yn(s)?o=r[t]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const KI={qualify:bn,set(n,{elem:t}){qt(t,n)}},ZI={set(n,{elem:t}){t.innerHTML=`${n}`}},QI={qualify:bn,set(n,{view:t}){return`url(#${t.graph.defineFilter(n)})`}},tL={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function xs(n,t,e){let s,r;typeof t=="object"?(s=t.x,r=t.y):(s=t,r=e);const i=Z.parse(n),o=i.bbox();if(o){let a=-o.height/2-o.y,l=-o.width/2-o.x;typeof s=="number"&&(l-=s),typeof r=="number"&&(a-=r),i.translate(l,a)}return i.serialize()}var Uy=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const eL=n=>{var{size:t,width:e,height:s,offset:r,open:i}=n,o=Uy(n,["size","width","height","offset","open"]);return Gy({size:t,width:e,height:s,offset:r},i===!0,!0,void 0,o)},nL=n=>{var{size:t,width:e,height:s,offset:r,factor:i}=n,o=Uy(n,["size","width","height","offset","factor"]);return Gy({size:t,width:e,height:s,offset:r},!1,!1,i,o)};function Gy(n,t,e,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,l=new Z,u={};if(t)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!e){const h=we(s,0,1);l.lineTo(o*h,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},u),r),{tagName:"path",d:xs(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var sL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const rL=n=>{var{size:t,width:e,height:s,offset:r}=n,i=sL(n,["size","width","height","offset"]);const o=t||10,a=e||o,l=s||o,u=new Z;return u.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},i),{tagName:"path",d:xs(u.serialize(),r??-a/2)})};var iL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const oL=n=>{var{d:t,offsetX:e,offsetY:s}=n,r=iL(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:xs(t,e,s)})};var aL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const lL=n=>{var{size:t,width:e,height:s,offset:r}=n,i=aL(n,["size","width","height","offset"]);const o=t||10,a=e||o,l=s||o,u=new Z;return u.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:xs(u.serialize(),r||-a/2)})};var cL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const uL=n=>{var{width:t,height:e,offset:s,open:r,flip:i}=n,o=cL(n,["width","height","offset","open","flip"]);let a=e||6;const l=t||10,u=r===!0,h=i===!0,f=Object.assign(Object.assign({},o),{tagName:"path"});h&&(a=-a);const d=new Z;return d.moveTo(0,a).lineTo(l,0),u?f.fill="none":(d.lineTo(l,a),d.close()),f.d=xs(d.serialize(),{x:s||-l/2,y:a/2}),f};var Yy=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const Wy=n=>{var{r:t}=n,e=Yy(n,["r"]);const s=t||5;return Object.assign(Object.assign({cx:s},e),{tagName:"circle",r:s})},hL=n=>{var{r:t}=n,e=Yy(n,["r"]);const s=t||5,r=new Z;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},Wy({r:s})),{fill:"none"}),Object.assign(Object.assign({},e),{tagName:"path",d:xs(r.serialize(),-s)})]}};var dL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const fL=Object.freeze(Object.defineProperty({__proto__:null,async:uL,block:eL,circle:Wy,circlePlus:hL,classic:nL,cross:lL,diamond:rL,ellipse:n=>{var{rx:t,ry:e}=n,s=dL(n,["rx","ry"]);const r=t||5,i=e||5;return Object.assign(Object.assign({cx:r},s),{tagName:"ellipse",rx:r,ry:i})},path:oL},Symbol.toStringTag,{value:"Module"}));var vs;(function(n){n.presets=fL,n.registry=Ft.create({type:"marker"}),n.registry.register(n.presets,!0)})(vs||(vs={})),function(n){n.normalize=xs}(vs||(vs={}));var gL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};function Xu(n){return typeof n=="string"||bn(n)}const pL={qualify:Xu,set(n,{view:t,attrs:e}){return Ku("marker-start",n,t,e)}},mL={qualify:Xu,set(n,{view:t,attrs:e}){return Ku("marker-end",n,t,e,{transform:"rotate(180)"})}},yL={qualify:Xu,set(n,{view:t,attrs:e}){return Ku("marker-mid",n,t,e)}};function Ku(n,t,e,s,r={}){const i=typeof t=="string"?{name:t}:t,{name:o,args:a}=i,l=gL(i,["name","args"]);let u=l;if(o&&typeof o=="string"){const f=vs.registry.get(o);if(f)u=f(Object.assign(Object.assign({},l),a));else return vs.registry.onNotFound(o)}const h=Object.assign(Object.assign(Object.assign({},bL(s,n)),r),u);return{[n]:`url(#${e.graph.defineMarker(h)})`}}function bL(n,t){const e={},s=n.stroke;typeof s=="string"&&(e.stroke=s,e.fill=s);let r=n.strokeOpacity;if(r==null&&(r=n["stroke-opacity"]),r==null&&(r=n.opacity),r!=null&&(e["stroke-opacity"]=r,e["fill-opacity"]=r),t!=="marker-mid"){const i=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);e.refX=t==="marker-start"?o:-o}}return e}const io=(n,{view:t})=>t.cell.isEdge(),wL={qualify:io,set(n,t){var e,s,r,i;const o=t.view,a=n.reverse||!1,l=n.stubs||0;let u;if(Number.isFinite(l)&&l!==0)if(a){let h,f;const d=o.getConnectionLength()||0;l<0?(h=(d+l)/2,f=-l):(h=l,f=d-l*2);const g=o.getConnection();u=(i=(r=(s=(e=g==null?void 0:g.divideAtLength(h))===null||e===void 0?void 0:e[1])===null||s===void 0?void 0:s.divideAtLength(f))===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.serialize()}else{let h;l<0?h=((o.getConnectionLength()||0)+l)/2:h=l;const f=o.getConnection();if(f){const d=f.divideAtLength(h),g=f.divideAtLength(-h);d&&g&&(u=`${d[0].serialize()} ${g[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},qy={qualify:io,set:tl("getTangentAtLength",{rotate:!0})},xL={qualify:io,set:tl("getTangentAtLength",{rotate:!1})},Jy={qualify:io,set:tl("getTangentAtRatio",{rotate:!0})},vL={qualify:io,set:tl("getTangentAtRatio",{rotate:!1})},CL=qy,SL=Jy;function tl(n,t){const e={x:1,y:0};return(s,r)=>{let i,o;const a=r.view,l=a[n](Number(s));return l?(o=t.rotate?l.vector().vectorAngle(e):0,i=l.start):(i=a.path.start,o=0),o===0?{transform:`translate(${i.x},${i.y}')`}:{transform:`translate(${i.x},${i.y}') rotate(${o})`}}}const EL=Object.freeze(Object.defineProperty({__proto__:null,annotations:UI,atConnectionLength:CL,atConnectionLengthIgnoreGradient:xL,atConnectionLengthKeepGradient:qy,atConnectionRatio:SL,atConnectionRatioIgnoreGradient:vL,atConnectionRatioKeepGradient:Jy,connection:wL,displayEmpty:YI,eol:GI,fill:VI,filter:QI,html:ZI,lineHeight:zI,port:tL,ref:vI,refCx:PI,refCy:AI,refD:kI,refDKeepOffset:TI,refDResetOffset:By,refDx:CI,refDy:SI,refHeight:Iy,refHeight2:BI,refPoints:DI,refPointsKeepOffset:NI,refPointsResetOffset:Vy,refR:_I,refRCircumscribed:MI,refRInscribed:Ly,refRx:EI,refRy:OI,refWidth:Ry,refWidth2:LI,refX:ky,refX2:RI,refY:Dy,refY2:II,resetOffset:XI,sourceMarker:pL,stroke:jI,style:KI,targetMarker:mL,text:Fy,textPath:HI,textVerticalAnchor:FI,textWrap:$I,title:WI,vertexMarker:yL,xAlign:qI,yAlign:JI},Symbol.toStringTag,{value:"Module"}));var On;(function(n){function t(e,s,r){return!!(e!=null&&(typeof e=="string"||typeof e.qualify!="function"||X(e.qualify,this,s,r)))}n.isValidDefinition=t})(On||(On={})),function(n){n.presets=Object.assign(Object.assign({},xI),EL),n.registry=Ft.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(On||(On={}));const Ue={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Ue.prefixCls}-${n}`}},Xy=Ue.prefix("highlighted"),OL={highlight(n,t,e){const s=e&&e.className||Xy;J(t,s)},unhighlight(n,t,e){const s=e&&e.className||Xy;Dt(t,s)}},Ky=Ue.prefix("highlight-opacity"),ML={highlight(n,t){J(t,Ky)},unhighlight(n,t){Dt(t,Ky)}};var vt;(function(n){n.normalizeMarker=xs;function t(d,g){const p=jR(d.x,d.y).matrixTransform(g);return new O(p.x,p.y)}n.transformPoint=t;function e(d,g){return new W(t(d.start,g),t(d.end,g))}n.transformLine=e;function s(d,g){let p=d instanceof zt?d.points:d;return Array.isArray(p)||(p=[]),new zt(p.map(m=>t(m,g)))}n.transformPolyline=s;function r(d,g){const m=cn("svg").createSVGPoint();m.x=d.x,m.y=d.y;const y=m.matrixTransform(g);m.x=d.x+d.width,m.y=d.y;const b=m.matrixTransform(g);m.x=d.x+d.width,m.y=d.y+d.height;const w=m.matrixTransform(g);m.x=d.x,m.y=d.y+d.height;const x=m.matrixTransform(g),v=Math.min(y.x,b.x,w.x,x.x),S=Math.max(y.x,b.x,w.x,x.x),E=Math.min(y.y,b.y,w.y,x.y),C=Math.max(y.y,b.y,w.y,x.y);return new z(v,E,S-v,C-E)}n.transformRectangle=r;function i(d,g,p){let m;const y=d.ownerSVGElement;if(!y)return new z(0,0,0,0);try{m=d.getBBox()}catch{m={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(g)return z.create(m);const b=Qi(d,p||y);return r(m,b)}n.bbox=i;function o(d,g={}){let p;if(!d.ownerSVGElement||!gs(d)){if(oy(d)){const{left:w,top:x,width:v,height:S}=a(d);return new z(w,x,v,S)}return new z(0,0,0,0)}let y=g.target;if(!g.recursive){try{p=d.getBBox()}catch{p={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(!y)return z.create(p);const w=Qi(d,y);return r(p,w)}{const w=d.childNodes,x=w.length;if(x===0)return o(d,{target:y});y||(y=d);for(let v=0;v<x;v+=1){const S=w[v];let E;S.childNodes.length===0?E=o(S,{target:y}):E=o(S,{target:y,recursive:!0}),p?p=p.union(E):p=E}return p}}n.getBBox=o;function a(d){let g=0,p=0,m=0,y=0;if(d){let b=d;for(;b;)g+=b.offsetLeft,p+=b.offsetTop,b=b.offsetParent,b&&(g+=parseInt(fy(b,"borderLeft"),10),p+=parseInt(fy(b,"borderTop"),10));m=d.offsetWidth,y=d.offsetHeight}return{left:g,top:p,width:m,height:y}}n.getBoundingOffsetRect=a;function l(d){const g=p=>{const m=d.getAttribute(p),y=m?parseFloat(m):0;return Number.isNaN(y)?0:y};switch(d instanceof SVGElement&&d.nodeName.toLowerCase()){case"rect":return new z(g("x"),g("y"),g("width"),g("height"));case"circle":return new un(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new un(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=Wa(d);return new zt(p)}case"polygon":{const p=Wa(d);return p.length>1&&p.push(p[0]),new zt(p)}case"path":{let p=d.getAttribute("d");return Z.isValid(p)||(p=Z.normalize(p)),Z.parse(p)}case"line":return new W(g("x1"),g("y1"),g("x2"),g("y2"))}return o(d)}n.toGeometryShape=l;function u(d,g,p,m){const y=O.create(g),b=O.create(p);m||(m=d instanceof SVGSVGElement?d:d.ownerSVGElement);const w=Uu(d);d.setAttribute("transform","");const x=o(d,{target:m}).scale(w.sx,w.sy),v=Ki();v.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const S=Ki(),E=y.angleBetween(b,y.clone().translate(1,0));E&&S.setRotate(E,0,0);const C=Ki(),M=y.clone().move(b,x.width/2);C.setTranslate(2*y.x-M.x,2*y.y-M.y);const T=Qi(d,m),k=Ki();k.setMatrix(C.matrix.multiply(S.matrix.multiply(v.matrix.multiply(T.scale(w.sx,w.sy))))),d.setAttribute("transform",Br(k.matrix))}n.translateAndAutoOrient=u;function h(d){if(d==null)return null;let g=d;do{let p=g.tagName;if(typeof p!="string")return null;if(p=p.toUpperCase(),Sn(g,"x6-port"))g=g.nextElementSibling;else if(p==="G")g=g.firstElementChild;else if(p==="TITLE")g=g.nextElementSibling;else break}while(g);return g}n.findShapeNode=h;function f(d){const g=h(d);if(!gs(g)){if(oy(d)){const{left:y,top:b,width:w,height:x}=a(d);return new z(y,b,w,x)}return new z(0,0,0,0)}return l(g).bbox()||z.create()}n.getBBoxV2=f})(vt||(vt={}));const PL={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},AL={highlight(n,t,e){const s=Cs.getHighlighterId(t,e);if(Cs.hasCache(s))return;e=ig({},e,PL);const r=tt.create(t);let i,o;try{i=r.toPathData()}catch{o=vt.bbox(r.node,!0),i=xy(Object.assign(Object.assign({},e),o))}const a=cn("path");if(ut(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},e.attrs?Ji(e.attrs):null)),n.isEdgeElement(t))ut(a,"d",n.getConnectionPathData());else{let h=r.getTransformToElement(n.container);const f=e.padding;if(f){o==null&&(o=vt.bbox(r.node,!0));const d=o.x+o.width/2,g=o.y+o.height/2;o=vt.transformRectangle(o,h);const p=Math.max(o.width,1),m=Math.max(o.height,1),y=(p+f)/p,b=(m+f)/m,w=ne({a:y,b:0,c:0,d:b,e:d-y*d,f:g-b*g});h=h.multiply(w)}Vr(a,h)}J(a,Ue.prefix("highlight-stroke"));const l=n.cell,u=()=>Cs.removeHighlighter(s);l.on("removed",u),l.model&&l.model.on("reseted",u),n.container.appendChild(a),Cs.setCache(s,a)},unhighlight(n,t,e){Cs.removeHighlighter(Cs.getHighlighterId(t,e))}};var Cs;(function(n){function t(o,a){return ku(o),o.id+JSON.stringify(a)}n.getHighlighterId=t;const e={};function s(o,a){e[o]=a}n.setCache=s;function r(o){return e[o]!=null}n.hasCache=r;function i(o){const a=e[o];a&&(ze(a),delete e[o])}n.removeHighlighter=i})(Cs||(Cs={}));const TL=Object.freeze(Object.defineProperty({__proto__:null,className:OL,opacity:ML,stroke:AL},Symbol.toStringTag,{value:"Module"}));var qn;(function(n){function t(e,s){if(typeof s.highlight!="function")throw new Error(`Highlighter '${e}' is missing required \`highlight()\` method`);if(typeof s.unhighlight!="function")throw new Error(`Highlighter '${e}' is missing required \`unhighlight()\` method`)}n.check=t})(qn||(qn={})),function(n){n.presets=TL,n.registry=Ft.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(qn||(qn={}));function Zu(n,t={}){return new O(an(t.x,n.width),an(t.y,n.height))}function Qu(n,t,e){return Object.assign({angle:t,position:n.toJSON()},e)}const NL=(n,t)=>n.map(({x:e,y:s,angle:r})=>Qu(Zu(t,{x:e,y:s}),r||0)),_L=(n,t,e)=>{const s=e.start||0,r=e.step||20;return Zy(n,t,s,(i,o)=>(i+.5-o/2)*r)},kL=(n,t,e)=>{const s=e.start||0,r=e.step||360/n.length;return Zy(n,t,s,i=>i*r)};function Zy(n,t,e,s){const r=t.getCenter(),i=t.getTopCenter(),o=t.width/t.height,a=un.fromRect(t),l=n.length;return n.map((u,h)=>{const f=e+s(h,l),d=i.clone().rotate(-f,r).scale(o,1,r),g=u.compensateRotate?-a.tangentTheta(d):0;return(u.dx||u.dy)&&d.translate(u.dx||0,u.dy||0),u.dr&&d.move(r,u.dr),Qu(d.round(),g,u)})}var DL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const RL=(n,t,e)=>{const s=Zu(t,e.start||t.getOrigin()),r=Zu(t,e.end||t.getCorner());return oo(n,s,r,e)},IL=(n,t,e)=>oo(n,t.getTopLeft(),t.getBottomLeft(),e),LL=(n,t,e)=>oo(n,t.getTopRight(),t.getBottomRight(),e),BL=(n,t,e)=>oo(n,t.getTopLeft(),t.getTopRight(),e),VL=(n,t,e)=>oo(n,t.getBottomLeft(),t.getBottomRight(),e);function oo(n,t,e,s){const r=new W(t,e),i=n.length;return n.map((o,a)=>{var{strict:l}=o,u=DL(o,["strict"]);const h=l||s.strict?(a+1)/(i+1):(a+.5)/i,f=r.pointAt(h);return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),Qu(f.round(),0,u)})}const jL=Object.freeze(Object.defineProperty({__proto__:null,absolute:NL,bottom:VL,ellipse:_L,ellipseSpread:kL,left:IL,line:RL,right:LL,top:BL},Symbol.toStringTag,{value:"Module"}));var Qs;(function(n){n.presets=jL,n.registry=Ft.create({type:"port layout"}),n.registry.register(n.presets,!0)})(Qs||(Qs={}));const $L={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ss(n,t){const{x:e,y:s,angle:r,attrs:i}=t||{};return ig({},{angle:r,attrs:i,position:{x:e,y:s}},n,$L)}const zL=(n,t,e)=>Ss({position:t.getTopLeft()},e),FL=(n,t,e)=>Ss({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},e),HL=(n,t,e)=>Ss({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},e),UL=(n,t,e)=>Ss({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},e),GL=(n,t,e)=>Ss({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},e),YL=(n,t,e)=>Qy(n,t,!1,e),WL=(n,t,e)=>Qy(n,t,!0,e),qL=(n,t,e)=>tb(n,t,!1,e),JL=(n,t,e)=>tb(n,t,!0,e);function Qy(n,t,e,s){const r=s.offset!=null?s.offset:15,i=t.getCenter().theta(n),o=eb(t);let a,l,u,h,f=0;return i<o[1]||i>o[2]?(a=".3em",l=r,u=0,h="start"):i<o[0]?(a="0",l=0,u=-r,e?(f=-90,h="start"):h="middle"):i<o[3]?(a=".3em",l=-r,u=0,h="end"):(a=".6em",l=0,u=r,e?(f=90,h="start"):h="middle"),Ss({position:{x:Math.round(l),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":h}}},s)}function tb(n,t,e,s){const r=s.offset!=null?s.offset:15,i=t.getCenter().theta(n),o=eb(t);let a,l,u,h,f=0;return i<o[1]||i>o[2]?(a=".3em",l=-r,u=0,h="end"):i<o[0]?(a=".6em",l=0,u=r,e?(f=90,h="start"):h="middle"):i<o[3]?(a=".3em",l=r,u=0,h="start"):(a="0em",l=0,u=-r,e?(f=-90,h="start"):h="middle"),Ss({position:{x:Math.round(l),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":h}}},s)}function eb(n){const t=n.getCenter(),e=t.theta(n.getTopLeft()),s=t.theta(n.getBottomLeft()),r=t.theta(n.getBottomRight()),i=t.theta(n.getTopRight());return[e,i,r,s]}const XL=(n,t,e)=>nb(n.diff(t.getCenter()),!1,e),KL=(n,t,e)=>nb(n.diff(t.getCenter()),!0,e);function nb(n,t,e){const s=e.offset!=null?e.offset:20,r=new O(0,0),i=-n.theta(r),o=n.clone().move(r,s).diff(n).round();let a=".3em",l,u=i;return(i+90)%180===0?(l=t?"end":"middle",!t&&i===-270&&(a="0em")):i>-270&&i<-90?(l="start",u=i-180):l="end",Ss({position:o.round().toJSON(),angle:t?u:0,attrs:{".":{y:a,"text-anchor":l}}},e)}const ZL=Object.freeze(Object.defineProperty({__proto__:null,bottom:GL,inside:qL,insideOriented:JL,left:FL,manual:zL,outside:YL,outsideOriented:WL,radial:XL,radialOriented:KL,right:HL,top:UL},Symbol.toStringTag,{value:"Module"}));var Gr;(function(n){n.presets=ZL,n.registry=Ft.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(Gr||(Gr={}));var QL=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class pt extends Nt{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=th.uniqueId(),pt.views[this.cid]=this}confirmUpdate(t,e){return 0}empty(t=this.container){return qi(t),this}unmount(t=this.container){return ze(t),this}remove(t=this.container){return t===this.container?(this.removeEventListeners(document),this.onRemove(),delete pt.views[this.cid],this.disposeContainer&&this.unmount(t)):this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return J(e,Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return Dt(e,Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return qt(e,t),this}setAttrs(t,e=this.container){return t!=null&&e!=null&&ut(e,t),this}findAttr(t,e=this.container){let s=e;for(;s&&s.nodeType===1;){const r=s.getAttribute(t);if(r!=null)return r;if(s===this.container)return null;s=s.parentNode}return null}find(t,e=this.container,s=this.selectors){return pt.find(t,e,s).elems}findOne(t,e=this.container,s=this.selectors){const r=this.find(t,e,s);return r.length>0?r[0]:null}findByAttr(t,e=this.container){let s=e;for(;s&&s.getAttribute;){const r=s.getAttribute(t);if((r!=null||s===this.container)&&r!=="false")return s;s=s.parentNode}return null}getSelector(t,e){let s;if(t===this.container)return typeof e=="string"&&(s=`> ${e}`),s;if(t){const r=Ru(t)+1;s=`${t.tagName.toLowerCase()}:nth-child(${r})`,e&&(s+=` > ${e}`),s=this.getSelector(t.parentNode,s)}return s}prefixClassName(t){return Ue.prefix(t)}delegateEvents(t,e){if(t==null)return this;e||this.undelegateEvents();const s=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(r=>{const i=r.match(s);if(i==null)return;const o=this.getEventHandler(t[r]);typeof o=="function"&&this.delegateEvent(i[1],i[2],o)}),this}undelegateEvents(){return le.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,s){return le.on(this.container,t+this.getEventNamespace(),e,s),this}undelegateEvent(t,e,s){const r=t+this.getEventNamespace();return e==null?le.off(this.container,r):typeof e=="string"?le.off(this.container,r,e,s):le.off(this.container,r,e),this}addEventListeners(t,e,s){if(e==null)return this;const r=this.getEventNamespace();return Object.keys(e).forEach(i=>{const o=this.getEventHandler(e[i]);typeof o=="function"&&le.on(t,i+r,s,o)}),this}removeEventListeners(t){return t!=null&&le.off(t,this.getEventNamespace()),this}getEventNamespace(){return`.${Ue.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if(typeof t=="string"){const s=this[t];typeof s=="function"&&(e=(...r)=>s.call(this,...r))}else e=(...s)=>t.call(this,...s);return e}getEventTarget(t,e={}){const{target:s,type:r,clientX:i=0,clientY:o=0}=t;return e.fromPoint||r==="touchmove"||r==="touchend"?document.elementFromPoint(i,o):s}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return this.getEventData(t).propagationStopped===!0}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(t==null)throw new TypeError("Event object required");let s=t.data;const r=`__${this.cid}__`;return e==null?s==null?{}:s[r]||{}:(s==null&&(s=t.data={}),s[r]==null?s[r]=Object.assign({},e):s[r]=Object.assign(Object.assign({},s[r]),e),s[r])}normalizeEvent(t){return pt.normalizeEvent(t)}dispose(){this.remove()}}QL([pt.dispose()],pt.prototype,"dispose",null),function(n){function t(r,i){return i?cn(r||"g"):Du(r||"div")}n.createElement=t;function e(r,i,o){if(!r||r===".")return{elems:[i]};if(o){const a=o[r];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=r.includes(">")?`:scope ${r}`:r;return{isCSSSelector:!0,elems:Array.prototype.slice.call(i.querySelectorAll(a))}}}n.find=e;function s(r){let i=r;const o=r.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const l in r)a[l]===void 0&&(a[l]=r[l]);i=a}return i}n.normalizeEvent=s}(pt||(pt={})),function(n){n.views={};function t(e){return n.views[e]||null}n.getView=t}(pt||(pt={}));var th;(function(n){let t=0;function e(){const s=`v${t}`;return t+=1,s}n.uniqueId=e})(th||(th={}));class tB{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Wu,this.pathCache={}}get(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(e.matrix==null){const s=this.view.container;e.matrix=UR(t,s)}return ne(e.matrix)}getShape(t){const e=this.get(t);return e.shape==null&&(e.shape=vt.toGeometryShape(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return e.boundingRect==null&&(e.boundingRect=vt.getBBoxV2(t)),e.boundingRect.clone()}}var _t;(function(n){function t(u){return u!=null&&!e(u)}n.isJSONMarkup=t;function e(u){return u!=null&&typeof u=="string"}n.isStringMarkup=e;function s(u){return u==null||e(u)?u:Tt(u)}n.clone=s;function r(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=r;function i(u,h={ns:ee.svg}){const f=document.createDocumentFragment(),d={},g={},p=[{markup:Array.isArray(u)?u:[u],parent:f,ns:h.ns}];for(;p.length>0;){const m=p.pop();let y=m.ns||ee.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const v=x.tagName;if(!v)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const S=y?Du(v,y):sy(v),E=x.attrs;E&&ut(S,Ji(E));const C=x.style;C&&qt(S,C);const M=x.className;M!=null&&S.setAttribute("class",Array.isArray(M)?M.join(" "):M),x.textContent&&(S.textContent=x.textContent);const T=x.selector;if(T!=null){if(g[T])throw new TypeError("Selector must be unique");g[T]=S}if(x.groupSelector){let _=x.groupSelector;Array.isArray(_)||(_=[_]),_.forEach(D=>{d[D]||(d[D]=[]),d[D].push(S)})}w.appendChild(S);const k=x.children;Array.isArray(k)&&p.push({ns:y,markup:k,parent:S})})}return Object.keys(d).forEach(m=>{if(g[m])throw new Error("Ambiguous group selector");g[m]=d[m]}),{fragment:f,selectors:g,groups:d}}n.parseJSONMarkup=i;function o(u){return u instanceof SVGElement?cn("g"):sy("div")}function a(u){if(e(u)){const g=tt.createVectors(u),p=g.length;if(p===1)return{elem:g[0].node};if(p>1){const m=o(g[0].node);return g.forEach(y=>{m.appendChild(y.node)}),{elem:m}}return{}}const h=i(u),f=h.fragment;let d=null;return f.childNodes.length>1?(d=o(f.firstChild),d.appendChild(f)):d=f.firstChild,{elem:d,selectors:h.selectors}}n.renderMarkup=a;function l(u){const h=tt.createVectors(u),f=document.createDocumentFragment();for(let d=0,g=h.length;d<g;d+=1){const p=h[d].node;f.appendChild(p)}return{fragment:f,selectors:{}}}n.parseLabelStringMarkup=l})(_t||(_t={})),function(n){function t(e,s,r){if(e!=null){let i;const o=e.tagName.toLowerCase();if(e===s)return typeof r=="string"?i=`> ${o} > ${r}`:i=`> ${o}`,i;const a=e.parentNode;if(a&&a.childNodes.length>1){const l=Ru(e)+1;i=`${o}:nth-child(${l})`}else i=o;return r&&(i+=` > ${r}`),t(e.parentNode,s,i)}return r}n.getSelector=t}(_t||(_t={})),function(n){function t(){return"g"}n.getPortContainerMarkup=t;function e(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=e;function s(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=s}(_t||(_t={})),function(n){function t(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=t}(_t||(_t={})),function(n){function t(e=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:ee.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:ee.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:e?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=t}(_t||(_t={}));class sb{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let s,r,i,o;const a=[];return Object.keys(e).forEach(l=>{const u=e[l],h=this.getDefinition(l),f=X(On.isValidDefinition,this.view,h,u,{elem:t,attrs:e,cell:this.cell,view:this.view});if(h&&f)typeof h=="string"?(s==null&&(s={}),s[h]=u):u!==null&&a.push({name:l,definition:h});else{s==null&&(s={});const d=ay.includes(l)?l:jm(l);s[d]=u}}),a.forEach(({name:l,definition:u})=>{const h=e[l];typeof u.set=="function"&&(r==null&&(r={}),r[l]=h),typeof u.offset=="function"&&(i==null&&(i={}),i[l]=h),typeof u.position=="function"&&(o==null&&(o={}),o[l]=h)}),{raw:e,normal:s,set:r,offset:i,position:o}}mergeProcessedAttrs(t,e){t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const s=t.normal&&t.normal.transform;s!=null&&e.normal&&(e.normal.transform=s),t.normal=e.normal}findAttrs(t,e,s,r){const i=[],o=new Wu;return Object.keys(t).forEach(a=>{const l=t[a];if(!bn(l))return;const{isCSSSelector:u,elems:h}=pt.find(a,e,r);s[a]=h;for(let f=0,d=h.length;f<d;f+=1){const g=h[f],p=r&&r[a]===g,m=o.get(g);if(m){m.array||(i.push(g),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const y=m.attrs,b=m.priority;if(p)y.unshift(l),b.unshift(-1);else{const w=x2(b,u?-1:d);y.splice(w,0,l),b.splice(w,0,d)}}else o.set(g,{elem:g,attrs:l,priority:p?-1:d,array:!1})}}),i.forEach(a=>{const l=o.get(a),u=l.attrs;l.attrs=u.reduceRight((h,f)=>Yt(h,f),{})}),o}updateRelativeAttrs(t,e,s){const r=e.raw||{};let i=e.normal||{};const o=e.set,a=e.position,l=e.offset,u=()=>({elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:s.clone()});if(o!=null&&Object.keys(o).forEach(y=>{const b=o[y],w=this.getDefinition(y);if(w!=null){const x=X(w.set,this.view,b,u());typeof x=="object"?i=Object.assign(Object.assign({},i),x):x!=null&&(i[y]=x)}}),t instanceof HTMLElement){this.view.setAttrs(i,t);return}const h=i.transform,f=h?`${h}`:null,d=Zi(f),g=new O(d.e,d.f);h&&(delete i.transform,d.e=0,d.f=0);let p=!1;a!=null&&Object.keys(a).forEach(y=>{const b=a[y],w=this.getDefinition(y);if(w!=null){const x=X(w.position,this.view,b,u());x!=null&&(p=!0,g.translate(O.create(x)))}}),this.view.setAttrs(i,t);let m=!1;if(l!=null){const y=this.view.getBoundingRectOfElement(t);if(y.width>0&&y.height>0){const b=vt.transformRectangle(y,d);Object.keys(l).forEach(w=>{const x=l[w],v=this.getDefinition(w);if(v!=null){const S=X(v.offset,this.view,x,{elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:b});S!=null&&(m=!0,g.translate(O.create(S)))}})}}(h!=null||p||m)&&(g.round(1),d.e=g.x,d.f=g.y,t.setAttribute("transform",Br(d)))}update(t,e,s){const r={},i=this.findAttrs(s.attrs||e,t,r,s.selectors),o=s.attrs?this.findAttrs(e,t,r,s.selectors):i,a=[];i.each(h=>{const f=h.elem,d=h.attrs,g=this.processAttrs(f,d);if(g.set==null&&g.position==null&&g.offset==null)this.view.setAttrs(g.normal,f);else{const p=o.get(f),m=p?p.attrs:null,y=m&&d.ref==null?m.ref:d.ref;let b;if(y){if(b=(r[y]||this.view.find(y,t,s.selectors))[0],!b)throw new Error(`"${y}" reference does not exist.`)}else b=null;const w={node:f,refNode:b,attributes:m,processedAttributes:g},x=a.findIndex(v=>v.refNode===f);x>-1?a.splice(x,0,w):a.push(w)}});const l=new Wu;let u;a.forEach(h=>{const f=h.node,d=h.refNode;let g;const p=d!=null&&s.rotatableNode!=null&&Iu(s.rotatableNode,d);if(d&&(g=l.get(d)),!g){const b=p?s.rotatableNode:t;g=d?vt.getBBox(d,{target:b}):s.rootBBox,d&&l.set(d,g)}let m;s.attrs&&h.attributes?(m=this.processAttrs(f,h.attributes),this.mergeProcessedAttrs(m,h.processedAttributes)):m=h.processedAttributes;let y=g;p&&s.rotatableNode!=null&&!s.rotatableNode.contains(f)&&(u||(u=Zi(ut(s.rotatableNode,"transform"))),y=vt.transformRectangle(g,u)),this.updateRelativeAttrs(f,m,y)})}}class rb{get cell(){return this.view.cell}constructor(t,e,s=[]){this.view=t;const r={},i={};let o=0;Object.keys(e).forEach(l=>{let u=e[l];Array.isArray(u)||(u=[u]),u.forEach(h=>{let f=r[h];f||(o+=1,f=r[h]=1<<o),i[l]|=f})});let a=s;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{r[l]||(o+=1,r[l]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=s}getFlag(t){const e=this.flags;return e==null?0:Array.isArray(t)?t.reduce((s,r)=>s|e[r],0):e[t]|0}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs&&Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t}}var eB=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},nB=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Ht extends pt{static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){const e=(u,h)=>h!=null?hg([...Array.isArray(u)?u:[u],...Array.isArray(h)?h:[h]]):Array.isArray(u)?[...u]:[u],s=Tt(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=t,l=nB(t,["bootstrap","actions","events","documentEvents"]);return r&&(s.bootstrap=e(s.bootstrap,r)),i&&Object.entries(i).forEach(([u,h])=>{const f=s.actions[u];h&&f?s.actions[u]=e(f,h):h&&(s.actions[u]=e(h))}),o&&(s.events=Object.assign(Object.assign({},s.events),o)),t.documentEvents&&(s.documentEvents=Object.assign(Object.assign({},s.documentEvents),a)),Yt(s,l)}get[Symbol.toStringTag](){return Ht.toStringTag}constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new sb(this),this.flag=new rb(this,this.options.actions,this.options.bootstrap),this.cache=new tB(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return pt.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,this.options.events!=null&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();e!=null&&this.setAttrs(e,t);const s=this.getContainerStyle();s!=null&&this.setStyle(s,t);const r=this.getContainerClassName();r!=null&&this.addClass(r,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,s,r){if(this.hasAction(t,e)){s();const i=[e];return r&&(typeof r=="string"?i.push(r):i.push(...r)),this.removeAction(t,i)}return t}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:t}){this.onAttrsChange(t)}onAttrsChange(t){let e=this.flag.getChangedFlag();t.updated||!e||(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,e,t))}parseJSONMarkup(t,e){const s=_t.parseJSONMarkup(t),r=s.selectors,i=this.rootSelector;if(e&&i){if(r[i])throw new Error("Invalid root selector");r[i]=e}return s}can(t){let e=this.graph.options.interacting;if(typeof e=="function"&&(e=X(e,this.graph,this)),typeof e=="object"){let s=e[t];return typeof s=="function"&&(s=X(s,this.graph,this)),s!==!1}return typeof e=="boolean"?e:!1}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),s=this.getMatrixOfElement(t),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return vt.transformRectangle(e,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),s=this.getMatrixOfElement(t),r=this.getRootTranslatedMatrix();return vt.transformRectangle(e,r.multiply(s))}getBBox(t={}){let e;if(t.useCellGeometry){const s=this.cell,r=s.isNode()?s.getAngle():0;e=s.getBBox().bbox(r)}else e=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return ne().translate(e.x,e.y)}getRootRotatedMatrix(){let t=ne();const e=this.cell,s=e.isNode()?e.getAngle():0;if(s){const r=e.getBBox(),i=r.width/2,o=r.height/2;t=t.translate(i,o).rotate(s).translate(-i,-o)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,s={}){s.rootBBox==null&&(s.rootBBox=new z),s.selectors==null&&(s.selectors=this.selectors),this.attr.update(t,e,s)}isEdgeElement(t){return this.cell.isEdge()&&(t==null||t===this.container)}prepareHighlight(t,e={}){const s=t||this.container;return e.partial=s===this.container,s}highlight(t,e={}){const s=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:s,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:s,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:s,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const s=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:s,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:s,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:s,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,s,r,i){const o=this.cell,a=this.findAttr("port",t),l=t.getAttribute("data-selector"),u={cell:o.id};return l!=null&&(u.magnet=l),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&l==null&&(u.selector=this.getSelector(t))):l==null&&this.container!==t&&(u.selector=this.getSelector(t)),u}getMagnetFromEdgeTerminal(t){const e=this.cell,s=this.container,r=t.port;let i=t.magnet,o;return r!=null&&e.isNode()&&e.hasPort(r)?o=this.findPortElem(r,i)||s:(i||(i=t.selector),!i&&r!=null&&(i=`[port="${r}"]`),o=this.findOne(i,s,this.selectors)),o}hasTools(t){const e=this.tools;return e==null?!1:t==null?!0:e.name===t}addTools(t){if(this.removeTools(),t){if(!this.can("toolsAddable"))return this;const e=Jt.isToolsView(t)?t:new Jt(t);this.tools=e,e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,s){const r=this,i=r.cell;return e==null||s==null?{e:t,view:r,cell:i}:{e:t,x:e,y:s,view:r,cell:i}}onClick(t,e,s){this.notify("cell:click",this.getEventArgs(t,e,s))}onDblClick(t,e,s){this.notify("cell:dblclick",this.getEventArgs(t,e,s))}onContextMenu(t,e,s){this.notify("cell:contextmenu",this.getEventArgs(t,e,s))}onMouseDown(t,e,s){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,s))}onMouseUp(t,e,s){this.notify("cell:mouseup",this.getEventArgs(t,e,s)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,s){this.notify("cell:mousemove",this.getEventArgs(t,e,s))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,s,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,s)))}onCustomEvent(t,e,s,r){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,s,r))),this.notify(e,Object.assign({},this.getEventArgs(t,s,r)))}onMagnetMouseDown(t,e,s,r){}onMagnetDblClick(t,e,s,r){}onMagnetContextMenu(t,e,s,r){}onLabelMouseDown(t,e,s){}checkMouseleave(t){const e=this.getEventTarget(t,{fromPoint:!0}),s=this.graph.findViewByElem(e);s!==this&&(this.onMouseLeave(t),s&&s.onMouseEnter(t))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}Ht.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},eB([Ht.dispose()],Ht.prototype,"dispose",null),function(n){n.Flag=rb,n.Attr=sb}(Ht||(Ht={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"}n.isCellView=t}(Ht||(Ht={})),function(n){function t(s){return function(r){r.config({priority:s})}}n.priority=t;function e(s){return function(r){r.config({bootstrap:s})}}n.bootstrap=e}(Ht||(Ht={})),function(n){n.registry=Ft.create({type:"view"})}(Ht||(Ht={}));class Jt extends pt{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Jt.toStringTag}constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}createContainer(t,e){const s=t?pt.createElement("g",!0):pt.createElement("div",!1);return J(s,this.prefixClassName("cell-tools")),e.className&&J(s,e.className),s}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!Ht.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(J(this.svgContainer,this.prefixClassName("edge-tools")),J(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(J(this.svgContainer,this.prefixClassName("node-tools")),J(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const s=[];e.forEach(r=>{Jt.ToolItem.isToolItem(r)?r.name==="vertices"?s.unshift(r):s.push(r):(typeof r=="object"?r.name:r)==="vertices"?s.unshift(r):s.push(r)});for(let r=0;r<s.length;r+=1){const i=s[r];let o;if(Jt.ToolItem.isToolItem(i))o=i;else{const a=typeof i=="object"?i.name:i,l=typeof i=="object"?i.args||{}:{};if(a){if(this.cell.isNode()){const u=Wr.registry.get(a);if(u)o=new u(l);else return Wr.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=qr.registry.get(a);if(u)o=new u(l);else return qr.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(t={}){const e=this.tools;return e&&e.forEach(s=>{t.toolId!==s.cid&&s.isVisible()&&s.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(s=>{t===s?s.show():s.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(s=>{s!==t&&!s.isVisible()&&(s.show(),s.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(e=>e.remove()),this.tools=null),ze(this.svgContainer),ze(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const s=t.some(i=>i.options.isSVGElement!==!1),r=t.some(i=>i.options.isSVGElement===!1);s&&(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&r.graph!=null&&r.cell!=null&&typeof r.config=="function"&&typeof r.update=="function"&&typeof r.focus=="function"&&typeof r.blur=="function"&&typeof r.show=="function"&&typeof r.hide=="function"}n.isToolsView=t})(Jt||(Jt={})),function(n){class t extends pt{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return Yt(Tt(this.getDefaults()),s)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return t.toStringTag}constructor(s={}){super(),this.visible=!0,this.options=this.getOptions(s),this.container=pt.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),J(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&J(this.container,this.options.className),this.init()}init(){}getOptions(s){return this.constructor.getOptions(s)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(s,r){return this.cellView=s,this.parent=r,this.stamp(this.container),this.cell.isEdge()?J(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&J(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const s=this.options.markup;if(s){const r=_t.parseJSONMarkup(s);this.container.appendChild(r.fragment),this.childNodes=r.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(s){s&&s.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const s=this.options.focusOpacity;return s!=null&&Number.isFinite(s)&&(this.container.style.opacity=`${s}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(s){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(s,this.cellView)}}t.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=t,function(e){let s=0;function r(o){return o?Pu(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Ou(r(o.name),this);return a.config(o),a}e.define=i}(t=n.ToolItem||(n.ToolItem={})),function(e){e.toStringTag=`X6.${e.name}`;function s(r){if(r==null)return!1;if(r instanceof e)return!0;const i=r[Symbol.toStringTag],o=r;return(i==null||i===e.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}e.isToolItem=s}(t=n.ToolItem||(n.ToolItem={}))}(Jt||(Jt={}));const sB=n=>n;function ib(n,t){return t===0?"0%":`${Math.round(n/t*100)}%`}function ob(n){return(e,s,r,i)=>s.isEdgeElement(r)?iB(n,e,s,r,i):rB(n,e,s,r,i)}function rB(n,t,e,s,r){const i=e.cell,o=i.getAngle(),a=e.getUnrotatedBBoxOfElement(s),l=i.getBBox().getCenter(),u=O.create(r).rotate(o,l);let h=u.x-a.x,f=u.y-a.y;return n&&(h=ib(h,a.width),f=ib(f,a.height)),t.anchor={name:"topLeft",args:{dx:h,dy:f,rotate:!0}},t}function iB(n,t,e,s,r){const i=e.getConnection();if(!i)return t;const o=i.closestPointLength(r);if(n){const a=i.length();t.anchor={name:"ratio",args:{ratio:o/a}}}else t.anchor={name:"length",args:{length:o}};return t}const oB=ob(!0),aB=ob(!1),lB=Object.freeze(Object.defineProperty({__proto__:null,noop:sB,pinAbsolute:aB,pinRelative:oB},Symbol.toStringTag,{value:"Module"}));var eh;(function(n){n.presets=lB,n.registry=Ft.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(eh||(eh={}));function ab(n,t,e,s){return X(eh.presets.pinRelative,this.graph,{},t,e,n,this.cell,s,{}).anchor}function lb(n,t){return t?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Es extends Jt.ToolItem{onRender(){J(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Vr(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:s=0,y:r=0}=e;const{offset:i,useCellGeometry:o,rotate:a}=e;let l=lb(t,o);const u=t.cell.getAngle();a||(l=l.bbox(u));let h=0,f=0;typeof i=="number"?(h=i,f=i):typeof i=="object"&&(h=i.x,f=i.y),s=an(s,l.width),r=an(r,l.height);let d=ne().translate(l.x+l.width/2,l.y+l.height/2);return a&&(d=d.rotate(u)),d=d.translate(s+h-l.width/2,r+f-l.height/2),d}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:s=0,distance:r=0,rotate:i}=e;let o,a,l;const u=an(r,1);u>=0&&u<=1?o=t.getTangentAtRatio(u):o=t.getTangentAtLength(u),o?(a=o.start,l=o.vector().vectorAngle(new O(1,0))||0):(a=t.getConnection().start,l=0);let h=ne().translate(a.x,a.y).rotate(l);return typeof s=="object"?h=h.translate(s.x||0,s.y||0):h=h.translate(0,s),i||(h=h.rotate(-l)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;typeof e=="function"&&X(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Es||(Es={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:t,btn:e}){e.parent.remove(),t.cell.remove({ui:!0,toolId:e.cid})}})}(Es||(Es={}));var cB=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class el extends Jt.ToolItem{onRender(){if(J(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,s=cB(t,["class"]);ut(this.container,Ji(s)),e&&J(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:s,rotate:r}=e,i=ds(e.padding);let o=lb(t,s).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const a=t.cell;if(a.isNode()){const l=a.getAngle();if(l)if(r){const u=a.getBBox().getCenter();Hu(this.container,l,u.x,u.y,{absolute:!0})}else o=o.bbox(l)}return ut(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(el||(el={}));class ao extends Jt.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){const t=this.vertices;for(let e=0,s=t.length;e<s;e+=1){const r=t[e],i=this.options.createHandle,o=this.options.processHandle,a=i({index:e,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(r.x,r.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const t=this.vertices;for(let e=0,s=t.length;e<s;e+=1){const r=t[e],i=this.handles[e];i&&i.updatePosition(r.x,r.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,s=this.vertices,r=t>0?s[t-1]:e.sourceAnchor,i=t<s.length-1?s[t+1]:e.targetAnchor;return{prev:O.create(r),next:O.create(i)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:s,y:r}=this.graph.snapToGrid(e.clientX,e.clientY);return{e,x:s,y:r}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:s,x:r,y:i}=this.getMouseEventArgs(t);this.eventData(s,{start:{x:r,y:i}}),e.notifyMouseDown(s,r,i)}}onHandleChanging({handle:t,e}){const s=this.cellView,r=t.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(e),l={x:o,y:a};this.snapVertex(l,r),s.cell.setVertexAt(r,l,{ui:!0,toolId:this.cid}),t.updatePosition(l.x,l.y),this.options.stopPropagation||s.notifyMouseMove(i,o,a)}stopBatch(t){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),t&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e:t}){const e=this.options,s=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies){this.stopBatch(this.eventData(t).vertexAdded);return}s.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(t).vertexAdded);const{e:i,x:o,y:a}=this.getMouseEventArgs(t);if(!this.options.stopPropagation){s.notifyMouseUp(i,o,a);const{start:l}=this.eventData(i);if(l){const{x:u,y:h}=l;u===o&&h===a&&s.onClick(i,o,a)}}s.checkMouseleave(i),e.onChanged&&e.onChanged({edge:s.cell,edgeView:s})}snapVertex(t,e){const s=this.options.snapRadius||0;if(s>0){const r=this.getNeighborPoints(e),i=r.prev,o=r.next;Math.abs(t.x-i.x)<s?t.x=i.x:Math.abs(t.x-o.x)<s&&(t.x=o.x),Math.abs(t.y-i.y)<s?t.y=r.prev.y:Math.abs(t.y-o.y)<s&&(t.y=o.y)}}onHandleRemove({handle:t,e}){if(this.options.removable){const s=t.options.index,r=this.cellView;r.cell.removeVertexAt(s,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(e))}}allowAddVertex(t){const e=this.guard(t),s=this.options.addable&&this.cellView.can("vertexAddable"),r=this.options.modifiers?ms.isMatch(t,this.options.modifiers):!0;return!e&&s&&r}onPathMouseDown(t){const e=this.cellView;if(!this.allowAddVertex(t))return;t.stopPropagation(),t.preventDefault();const s=this.normalizeEvent(t),r=this.graph.snapToGrid(s.clientX,s.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=e.getVertexIndex(r.x,r.y);this.snapVertex(r,i),e.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[i];this.eventData(s,{vertexAdded:!0}),o.onMouseDown(s)}onRemove(){this.resetHandles()}}(function(n){class t extends pt{get graph(){return this.options.graph}constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=pt.createElement("circle",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(s,r){this.setAttrs({cx:s,cy:r})}onMouseDown(s){this.options.guard(s)||(s.stopPropagation(),s.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data),this.emit("change",{e:s,handle:this}))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(s){this.emit("remove",{e:s,handle:this})}}n.Handle=t})(ao||(ao={})),function(n){const t=Ue.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:e=>new n.Handle(e),markup:[{tagName:"path",selector:"connection",className:t,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${t}`]:"onPathMouseDown",[`touchstart .${t}`]:"onPathMouseDown"}})}(ao||(ao={}));class lo extends Jt.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){J(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.vertices];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let s=0,r=e.length;s<r-1;s+=1){const i=e[s],o=e[s+1],a=this.renderHandle(i,o,s);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(t,e,s){const r=this.options.createHandle({index:s,graph:this.graph,guard:i=>this.guard(i),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(r),this.updateHandle(r,t,e),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let s=0,r=e.length;s<r;s+=1)e[s].options.index+=t}resetAnchor(t,e){const s=this.cellView.cell,r={ui:!0,toolId:this.cid};e?s.prop([t,"anchor"],e,r):s.removeProp([t,"anchor"],r)}snapHandle(t,e,s){const r=t.options.axis,i=t.options.index,l=this.cellView.cell.getVertices(),u=l[i-2]||s.sourceAnchor,h=l[i+1]||s.targetAnchor,f=this.options.snapRadius;return Math.abs(e[r]-u[r])<f?e[r]=u[r]:Math.abs(e[r]-h[r])<f&&(e[r]=h[r]),e}onHandleChanging({handle:t,e}){const s=this.graph,r=this.options,i=this.cellView,o=r.anchor,a=t.options.axis,l=t.options.index-1,u=this.getEventData(e),h=this.normalizeEvent(e),f=s.snapToGrid(h.clientX,h.clientY),d=this.snapHandle(t,f.clone(),u),g=Tt(this.vertices);let p=g[l],m=g[l+1];const y=i.sourceView,b=i.sourceBBox;let w=!1,x=!1;if(p?l===0?b.containsPoint(p)?(g.shift(),this.shiftHandleIndexes(-1),w=!0):(p[a]=d[a],x=!0):p[a]=d[a]:(p=i.sourceAnchor.toJSON(),p[a]=d[a],b.containsPoint(p)?w=!0:(g.unshift(p),this.shiftHandleIndexes(1),x=!0)),typeof o=="function"&&y){if(w){const M=u.sourceAnchor.clone();M[a]=d[a];const T=X(o,i,M,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",T)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const v=i.targetView,S=i.targetBBox;let E=!1,C=!1;if(m?l===g.length-2?S.containsPoint(m)?(g.pop(),E=!0):(m[a]=d[a],C=!0):m[a]=d[a]:(m=i.targetAnchor.toJSON(),m[a]=d[a],S.containsPoint(m)?E=!0:(g.push(m),C=!0)),typeof o=="function"&&v){if(E){const M=u.targetAnchor.clone();M[a]=d[a];const T=X(o,i,M,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",T)}C&&this.resetAnchor("target",u.targetAnchorDef)}O.equalPoints(g,this.vertices)||this.cellView.cell.setVertices(g,{ui:!0,toolId:this.cid}),this.updateHandle(t,p,m,0),r.stopPropagation||i.notifyMouseMove(h,f.x,f.y)}onHandleChange({handle:t,e}){const s=this.options,r=this.handles,i=this.cellView,o=t.options.index;if(Array.isArray(r)){for(let a=0,l=r.length;a<l;a+=1)a!==o&&r[a].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:Tt(this.cell.prop(["source","anchor"])),targetAnchorDef:Tt(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!s.stopPropagation){const a=this.normalizeEvent(e),l=this.graph.snapToGrid(a.clientX,a.clientY);i.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e:t}){const e=this.options,s=this.cellView;e.removeRedundancies&&s.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(t),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||s.notifyMouseUp(r,i.x,i.y),s.checkMouseleave(r),e.onChanged&&e.onChanged({edge:s.cell,edgeView:s})}updateHandle(t,e,s,r=0){const i=this.options.precision||0,o=Math.abs(e.x-s.x)<i,a=Math.abs(e.y-s.y)<i;if(o||a){const l=new W(e,s);if(l.length()<this.options.threshold)t.hide();else{const h=l.getCenter(),f=o?"x":"y";h[f]+=r||0;const d=l.vector().vectorAngle(new O(1,0));t.updatePosition(h.x,h.y,d,this.cellView),t.show(),t.options.axis=f}}else t.hide()}onRemove(){this.resetHandles()}}(function(n){class t extends pt{constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=pt.createElement("rect",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(s,r,i,o){const a=o.getClosestPoint(new O(s,r))||new O(s,r);let l=ne().translate(a.x,a.y);if(a.equals({x:s,y:r}))l=l.rotate(i);else{let h=new W(s,r,a.x,a.y).vector().vectorAngle(new O(1,0));h!==0&&(h+=90),l=l.rotate(h)}this.setAttrs({transform:Br(l),cursor:i%180===0?"row-resize":"col-resize"})}onMouseDown(s){this.options.guard(s)||(this.trigger("change",{e:s,handle:this}),s.stopPropagation(),s.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=t})(lo||(lo={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:t=>new n.Handle(t),anchor:ab})}(lo||(lo={}));class nl extends Jt.ToolItem{get type(){return this.options.type}onRender(){J(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const s=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(s),a=r.cell.prop([s,"anchor"]);e.setAttribute("transform",`translate(${o.x}, ${o.y})`);const l=a?i.customAnchorAttrs:i.defaultAnchorAttrs;l&&Object.keys(l).forEach(u=>{e.setAttribute(u,l[u])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const s=this.type,r=this.cellView,i=r.getTerminalView(s);if(i){const o=i.cell,a=r.getTerminalMagnet(s);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let u,h,f;i.isEdgeElement(a)?(u=i.getBBox(),h=0,f=u.getCenter()):(u=i.getUnrotatedBBoxOfElement(a),h=o.getAngle(),f=u.getCenter(),h&&f.rotate(-h,o.getBBox().getCenter())),u.inflate(l),ut(e,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${f.x}, ${f.y}) rotate(${h})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,s=this.cell;t?s.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):s.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,s=this.cellView,r=s.getTerminalView(e);if(r==null)return;const i=this.normalizeEvent(t),o=r.cell,a=s.getTerminalMagnet(e);let l=this.graph.coord.clientToLocalPoint(i.clientX,i.clientY);const u=this.options.snap;if(typeof u=="function"){const d=X(u,s,l,r,a,e,s,this);l=O.create(d)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const d=r.getClosestPoint(l);d&&(l=d)}else{const d=r.getUnrotatedBBoxOfElement(a),g=o.getAngle(),p=o.getBBox().getCenter(),m=l.clone().rotate(g,p);d.containsPoint(m)||(l=d.getNearestPointToPoint(m).rotate(-g,p))}let h;const f=this.options.anchor;typeof f=="function"&&(h=X(f,s,l,r,a,e,s,this)),this.resetAnchor(h),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(t===!0?void 0:t),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:ab,snap(t,e,s,r,i,o){const a=o.options.snapRadius||0,l=r==="source",u=l?0:-1,h=this.cell.getVertexAt(u)||this.getTerminalAnchor(l?"target":"source");return h&&(Math.abs(h.x-t.x)<a&&(t.x=h.x),Math.abs(h.y-t.y)<a&&(t.y=h.y)),t}})})(nl||(nl={}));const uB=nl.define({name:"source-anchor",type:"source"}),hB=nl.define({name:"target-anchor",type:"target"});var dB=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class sl extends Jt.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,s=dB(t,["class"]);this.setAttrs(s,this.container),e&&J(this.container,e)}}onRender(){J(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,s=e.getTangentAtRatio(t),r=s?s.start:e.getPointAtRatio(t),i=s&&s.vector().vectorAngle(new O(1,0))||0;if(!r)return this;const o=ne().translate(r.x,r.y).rotate(i);return Vr(this.container,o,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const s=this.graph.snapToGrid(t.clientX,t.clientY),r=e.prepareArrowheadDragging(this.type,{x:s.x,y:s.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(t,r),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),s=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,s.x,s.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),s=this.cellView,r=this.graph.snapToGrid(e.clientX,e.clientY);s.onMouseUp(e,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",s.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(sl||(sl={}));const fB=sl.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),gB=sl.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Yr extends Jt.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const t=this.cellView;t&&t.on("cell:dblclick",this.dblClick)}createElement(){const t=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Jt.createElement("div",!1),this.addClass(t,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:t,editor:e}=this;if(!e)return;const{style:s}=e;t.isNode()?this.updateNodeEditorTransform():t.isEdge()&&this.updateEdgeEditorTransform();const{attrs:r}=this.options;s.fontSize=`${r.fontSize}px`,s.fontFamily=r.fontFamily,s.color=r.color,s.backgroundColor=r.backgroundColor;const i=this.getCellText()||"";return e.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:t,cell:e,editor:s}=this;if(!s)return;let r=O.create(),i=20,o="",{x:a,y:l}=this.options;const{width:u,height:h}=this.options;if(typeof a<"u"&&typeof l<"u"){const g=e.getBBox();a=an(a,g.width),l=an(l,g.height),r=g.topLeft.translate(a,l),i=g.width-a*2}else{const g=e.getBBox();r=g.center,i=g.width-4,o="translate(-50%, -50%)"}const f=t.scale(),{style:d}=s;r=t.localToGraph(r),d.left=`${r.x}px`,d.top=`${r.y}px`,d.transform=`scale(${f.sx}, ${f.sy}) ${o}`,d.minWidth=`${i}px`,typeof u=="number"&&(d.width=`${u}px`),typeof h=="number"&&(d.height=`${h}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:t,editor:e}=this;if(!e)return;let s=O.create(),r=20;const{style:i}=e,o=this.event.target,a=o.parentElement;if(a&&Sn(a,this.prefixClassName("edge-label"))){const h=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);const f=a.getAttribute("transform"),{translation:d}=qa(f);s=new O(d.tx,d.ty),r=vt.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=t.clientToLocal(O.create(this.event.clientX,this.event.clientY));const f=this.cellView.path.closestPointLength(s);this.distance=f,this.labelIndex=-1}s=t.localToGraph(s);const u=t.scale();i.left=`${s.x}px`,i.top=`${s.y}px`,i.minWidth=`${r}px`,i.transform=`scale(${u.sx}, ${u.sy}) translate(-50%, -50%)`}onDocumentMouseUp(t){if(this.editor&&t.target!==this.editor){const e=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(e!==""?e:null),this.removeElement()}}onCellDblClick({e:t}){this.editor||(t.stopPropagation(),this.removeElement(),this.event=t,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}getCellText(){const{getText:t}=this.options;if(typeof t=="function")return X(t,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof t=="string"){if(this.cell.isNode())return this.cell.attr(t);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${t}`)}}setCellText(t){const e=this.options.setText;if(typeof e=="function"){X(e,this.cellView,{cell:this.cell,value:t,index:this.labelIndex,distance:this.distance});return}if(typeof e=="string"){if(this.cell.isNode()){t!==null&&this.cell.attr(e,t);return}if(this.cell.isEdge()){const s=this.cell;if(this.labelIndex===-1){if(t){const r={position:{distance:this.distance},attrs:{}};Rr(r,`attrs/${e}`,t),s.appendLabel(r)}}else t!==null?s.prop(`labels/${this.labelIndex}/attrs/${e}`,t):typeof this.labelIndex=="number"&&s.removeLabelAt(this.labelIndex)}}}onRemove(){const t=this.cellView;t&&t.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})})(Yr||(Yr={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(Yr||(Yr={}));var cb=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e},Wr;(function(n){n.presets={boundary:el,button:Es,"button-remove":Es.Remove,"node-editor":Yr.NodeEditor},n.registry=Ft.create({type:"node tool",process(t,e){if(typeof e=="function")return e;let s=Jt.ToolItem;const{inherit:r}=e,i=cb(e,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=t),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(Wr||(Wr={}));var qr;(function(n){n.presets={boundary:el,vertices:ao,segments:lo,button:Es,"button-remove":Es.Remove,"source-anchor":uB,"target-anchor":hB,"source-arrowhead":fB,"target-arrowhead":gB,"edge-editor":Yr.EdgeEditor},n.registry=Ft.create({type:"edge tool",process(t,e){if(typeof e=="function")return e;let s=Jt.ToolItem;const{inherit:r}=e,i=cb(e,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=t),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(qr||(qr={}));const pB=Jn("center"),mB=Jn("topCenter"),yB=Jn("bottomCenter"),bB=Jn("leftMiddle"),wB=Jn("rightMiddle"),xB=Jn("topLeft"),vB=Jn("topRight"),CB=Jn("bottomLeft"),SB=Jn("bottomRight");function Jn(n){return function(t,e,s,r={}){const i=r.rotate?t.getUnrotatedBBoxOfElement(e):t.getBBoxOfElement(e),o=i[n];o.x+=an(r.dx,i.width),o.y+=an(r.dy,i.height);const a=t.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function rl(n){return function(t,e,s,r){if(s instanceof Element){const i=this.graph.findViewByElem(s);let o;if(i)if(i.isEdgeElement(s)){const a=r.fixedAt!=null?r.fixedAt:"50%";o=ub(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new O;return n.call(this,t,e,o,r)}return n.apply(this,arguments)}}function ub(n,t){const e=Yn(t),s=typeof t=="string"?parseFloat(t):t;return e?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const EB=rl(function(n,t,e,s){const r=gt.normalize(n.cell.getAngle()),i=n.getBBoxOfElement(t),o=i.getCenter(),a=i.getTopLeft(),l=i.getBottomRight();let u=s.padding;if(Number.isFinite(u)||(u=0),a.y+u<=e.y&&e.y<=l.y-u){const h=e.y-o.y;o.x+=r===0||r===180?0:h*1/Math.tan(gt.toRad(r)),o.y+=h}else if(a.x+u<=e.x&&e.x<=l.x-u){const h=e.x-o.x;o.y+=r===90||r===270?0:h*Math.tan(gt.toRad(r)),o.x+=h}return o}),OB=function(n,t,e,s,r){const i=n.cell.getConnectionPoint(this.cell,r);return(s.dx||s.dy)&&i.translate(s.dx||0,s.dy||0),i},MB=rl(function(n,t,e,s){let r,i=0,o;const a=n.cell;s.rotate?(r=n.getUnrotatedBBoxOfElement(t),o=a.getBBox().getCenter(),i=a.getAngle()):r=n.getBBoxOfElement(t);const l=s.padding;l!=null&&Number.isFinite(l)&&r.inflate(l),s.rotate&&e.rotate(i,o);const u=r.getNearestSideToPoint(e);let h;switch(u){case"left":h=r.getLeftMiddle();break;case"right":h=r.getRightMiddle();break;case"top":h=r.getTopCenter();break;case"bottom":h=r.getBottomCenter();break}const f=s.direction;return f==="H"?(u==="top"||u==="bottom")&&(e.x<=r.x+r.width?h=r.getLeftMiddle():h=r.getRightMiddle()):f==="V"&&(e.y<=r.y+r.height?h=r.getTopCenter():h=r.getBottomCenter()),s.rotate?h.rotate(-i,o):h}),PB=Object.freeze(Object.defineProperty({__proto__:null,bottom:yB,bottomLeft:CB,bottomRight:SB,center:pB,left:bB,midSide:MB,nodeCenter:OB,orth:EB,right:wB,top:mB,topLeft:xB,topRight:vB},Symbol.toStringTag,{value:"Module"}));var Jr;(function(n){n.presets=PB,n.registry=Ft.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(Jr||(Jr={}));const AB=function(n,t,e,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},TB=function(n,t,e,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},hb=function(n,t,e,s){const r=n.getClosestPoint(e);return r??new O},NB=rl(hb),_B=rl(function(n,t,e,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new W(e.clone().translate(0,1e6),e.clone().translate(0,-1e6)),l=new W(e.clone().translate(1e6,0),e.clone().translate(-1e6,0)),u=a.intersect(i,{segmentSubdivisions:o}),h=l.intersect(i,{segmentSubdivisions:o}),f=[];return u&&f.push(...u),h&&f.push(...h),f.length>0?e.closest(f):s.fallbackAt!=null?ub(n,s.fallbackAt):X(hb,this,n,t,e,s)}),kB=Object.freeze(Object.defineProperty({__proto__:null,closest:NB,length:TB,orth:_B,ratio:AB},Symbol.toStringTag,{value:"Module"}));var Xr;(function(n){n.presets=kB,n.registry=Ft.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(Xr||(Xr={}));function il(n,t,e){let s;if(typeof e=="object"){if(Number.isFinite(e.y)){const i=new W(t,n),{start:o,end:a}=i.parallel(e.y);t=o,n=a}s=e.x}else s=e;if(s==null||!Number.isFinite(s))return n;const r=n.distance(t);return s===0&&r>0?n:n.move(t,-Math.min(s,r-1))}function ol(n){const t=n.getAttribute("stroke-width");return t===null?0:parseFloat(t)||0}function DB(n){if(n==null)return null;let t=n;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}const db=function(n,t,e,s){const r=t.getBBoxOfElement(e);s.stroked&&r.inflate(ol(e)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return il(o,n.start,s.offset)},RB=function(n,t,e,s,r){const i=t.cell,o=i.isNode()?i.getAngle():0;if(o===0)return X(db,this,n,t,e,s,r);const a=t.getUnrotatedBBoxOfElement(e);s.stroked&&a.inflate(ol(e)/2);const l=a.getCenter(),u=n.clone().rotate(o,l),h=u.setLength(1e6).intersect(a),f=h&&h.length?u.start.closest(h).rotate(-o,l):n.end;return il(f,n.start,s.offset)},IB=function(n,t,e,s){let r,i;const o=n.end,a=s.selector;if(typeof a=="string"?r=t.findOne(a):Array.isArray(a)?r=Mu(e,a):r=DB(e),!gs(r)){if(r===e||!gs(e))return o;r=e}const l=t.getShapeOfElement(r),u=t.getMatrixOfElement(r),h=t.getRootTranslatedMatrix(),f=t.getRootRotatedMatrix(),d=h.multiply(f).multiply(u),g=d.inverse(),p=vt.transformLine(n,g),m=p.start.clone(),y=t.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=l.bbox());const v=y.shapeBBox;if(v!=null&&v.containsPoint(m))return o}s.extrapolate===!0&&p.setLength(1e6);let b;if(Z.isPath(l)){const v=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=l.getSegmentSubdivisions({precision:v})),b={precision:v,segmentSubdivisions:y.segmentSubdivisions},i=p.intersect(l,b)}else i=p.intersect(l);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(z.isRectangle(l)?i=l.getNearestPointToPoint(m):un.isEllipse(l)?i=l.intersectsWithLineFromCenterToPoint(m):i=l.closestPoint(m,b));const w=i?vt.transformPoint(i,d):o;let x=s.offset||0;return s.stroked!==!1&&(typeof x=="object"?(x=Object.assign({},x),x.x==null&&(x.x=0),x.x+=ol(r)/2):x+=ol(r)/2),il(w,n.start,x)};function LB(n,t,e=0){const{start:s,end:r}=n;let i,o,a,l;switch(t){case"left":l="x",i=r,o=s,a=-1;break;case"right":l="x",i=s,o=r,a=1;break;case"top":l="y",i=r,o=s,a=-1;break;case"bottom":l="y",i=s,o=r,a=1;break;default:return}s[l]<r[l]?i[l]=o[l]:o[l]=i[l],Number.isFinite(e)&&(i[l]+=a*e,o[l]+=a*e)}const BB=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,t,e,s){const{alignOffset:r,align:i}=s;return i&&LB(n,i,r),il(n.end,n.start,s.offset)},bbox:db,boundary:IB,rect:RB},Symbol.toStringTag,{value:"Module"}));var Kr;(function(n){n.presets=BB,n.registry=Ft.create({type:"connection point"}),n.registry.register(n.presets,!0)})(Kr||(Kr={}));const VB=function(n){return[...n]},jB=function(n,t,e){const s=t.side||"bottom",r=ds(t.padding||40),i=e.sourceBBox,o=e.targetBBox,a=i.getCenter(),l=o.getCenter();let u,h,f;switch(s){case"top":f=-1,u="y",h="height";break;case"left":f=-1,u="x",h="width";break;case"right":f=1,u="x",h="width";break;case"bottom":default:f=1,u="y",h="height";break}return a[u]+=f*(i[h]/2+r[s]),l[u]+=f*(o[h]/2+r[s]),f*(a[u]-l[u])>0?l[u]=a[u]:a[u]=l[u],[a.toJSON(),...n,l.toJSON()]};function al(n){return new z(n.x,n.y,0,0)}function ll(n={}){const t=ds(n.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function fb(n,t={}){return n.sourceBBox.clone().moveAndExpand(ll(t))}function gb(n,t={}){return n.targetBBox.clone().moveAndExpand(ll(t))}function $B(n,t={}){return n.sourceAnchor?n.sourceAnchor:fb(n,t).getCenter()}function zB(n,t={}){return n.targetAnchor?n.targetAnchor:gb(n,t).getCenter()}const pb=function(n,t,e){let s=fb(e,t),r=gb(e,t);const i=$B(e,t),o=zB(e,t);s=s.union(al(i)),r=r.union(al(o));const a=n.map(h=>O.create(h));a.unshift(i),a.push(o);let l=null;const u=[];for(let h=0,f=a.length-1;h<f;h+=1){let d=null;const g=a[h],p=a[h+1],m=Ge.getBearing(g,p)!=null;if(h===0)h+1===f?s.intersectsWithRect(r.clone().inflate(1))?d=Ge.insideNode(g,p,s,r):m||(d=Ge.nodeToNode(g,p,s,r)):s.containsPoint(p)?d=Ge.insideNode(g,p,s,al(p).moveAndExpand(ll(t))):m||(d=Ge.nodeToVertex(g,p,s));else if(h+1===f){const y=m&&Ge.getBearing(p,g)===l;r.containsPoint(g)||y?d=Ge.insideNode(g,p,al(g).moveAndExpand(ll(t)),r,l):m||(d=Ge.vertexToNode(g,p,r,l))}else m||(d=Ge.vertexToVertex(g,p,l));d?(u.push(...d.points),l=d.direction):l=Ge.getBearing(g,p),h+1<f&&u.push(p)}return u};var Ge;(function(n){const t={N:"S",S:"N",E:"W",W:"E"},e={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function s(f,d,g){let p=new O(f.x,d.y);return g.containsPoint(p)&&(p=new O(d.x,f.y)),p}function r(f,d){return f[d==="W"||d==="E"?"width":"height"]}n.getBBoxSize=r;function i(f,d){return f.x===d.x?f.y>d.y?"N":"S":f.y===d.y?f.x>d.x?"W":"E":null}n.getBearing=i;function o(f,d,g){const p=new O(f.x,d.y),m=new O(d.x,f.y),y=i(f,p),b=i(f,m),w=g?t[g]:null,x=y===g||y!==w&&(b===w||b!==g)?p:m;return{points:[x],direction:i(x,d)}}n.vertexToVertex=o;function a(f,d,g){const p=s(f,d,g);return{points:[p],direction:i(p,d)}}n.nodeToVertex=a;function l(f,d,g,p){const m=[new O(f.x,d.y),new O(d.x,f.y)],y=m.filter(x=>!g.containsPoint(x)),b=y.filter(x=>i(x,f)!==p);let w;if(b.length>0)return w=b.filter(x=>i(f,x)===p).pop(),w=w||b[0],{points:[w],direction:i(w,d)};{w=HP(m,y)[0];const x=O.create(d).move(w,-r(g,p)/2);return{points:[s(x,f,g),x],direction:i(x,d)}}}n.vertexToNode=l;function u(f,d,g,p){let m=a(d,f,p);const y=m.points[0];if(g.containsPoint(y)){m=a(f,d,g);const b=m.points[0];if(p.containsPoint(b)){const w=O.create(f).move(b,-r(g,i(f,b))/2),x=O.create(d).move(y,-r(p,i(d,y))/2),v=new W(w,x).getCenter(),S=a(f,v,g),E=o(v,d,S.direction);m.points=[S.points[0],E.points[0]],m.direction=E.direction}}return m}n.nodeToNode=u;function h(f,d,g,p,m){const y=g.union(p).inflate(1),b=y.getCenter(),w=b.distance(d)>b.distance(f),x=w?d:f,v=w?f:d;let S,E,C;m?(S=O.fromPolar(y.width+y.height,e[m],x),S=y.getNearestPointToPoint(S).move(S,-1)):S=y.getNearestPointToPoint(x).move(x,1),E=s(S,v,y);let M;S.round().equals(E.round())?(E=O.fromPolar(y.width+y.height,gt.toRad(S.theta(x))+Math.PI/2,v),E=y.getNearestPointToPoint(E).move(v,1).round(),C=s(S,E,y),M=w?[E,C,S]:[S,C,E]):M=w?[E,S]:[S,E];const T=i(w?S:E,d);return{points:M,direction:T}}n.insideNode=h})(Ge||(Ge={}));const FB={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Os(this.step,this)},directions(){const n=Os(this.step,this),t=Os(this.cost,this);return[{cost:t,offsetX:n,offsetY:0},{cost:t,offsetX:-n,offsetY:0},{cost:t,offsetX:0,offsetY:n},{cost:t,offsetX:0,offsetY:-n}]},penalties(){const n=Os(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Os(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:pb,draggingRouter:null,snapToGrid:!0};function Os(n,t){return typeof n=="function"?n.call(t):n}function HB(n){const t=Object.keys(n).reduce((e,s)=>{const r=e;return s==="fallbackRouter"||s==="draggingRouter"||s==="fallbackRoute"?r[s]=n[s]:r[s]=Os(n[s],n),e},{});if(t.padding){const e=ds(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{const s=new O(0,0),r=new O(e.offsetX,e.offsetY);e.angle=gt.normalize(s.theta(r))}),t}const mb=1,yb=2;class UB{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=mb,this.values[t]=e;const s=v2(this.items,t,r=>this.values[r]);this.items.splice(s,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=yb),t}isOpen(t){return this.hash[t]===mb}isClose(t){return this.hash[t]===yb}isEmpty(){return this.items.length===0}}class GB{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const s=this.options,r=s.excludeTerminals.reduce((u,h)=>{const f=e[h];if(f){const d=t.getCell(f.cell);d&&u.push(d)}return u},[]);let i=[];const o=t.getCell(e.getSourceCellId());o&&(i=ug(i,o.getAncestors().map(u=>u.id)));const a=t.getCell(e.getTargetCellId());a&&(i=ug(i,a.getAncestors().map(u=>u.id)));const l=this.mapGridSize;return t.getNodes().reduce((u,h)=>{const f=r.some(y=>y.id===h.id),d=h.shape?s.excludeShapes.includes(h.shape):!1,g=s.excludeNodes.some(y=>typeof y=="string"?h.id===y:y===h),p=i.includes(h.id),m=d||f||g||p;if(h.isVisible()&&!m){const y=h.getBBox().moveAndExpand(s.paddingBox),b=y.getOrigin().snapToGrid(l),w=y.getCorner().snapToGrid(l);for(let x=b.x;x<=w.x;x+=l)for(let v=b.y;v<=w.y;v+=l){const S=new O(x,v).toString();u[S]==null&&(u[S]=[]),u[S].push(y)}}return u},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),s=this.map[e];return s?s.every(r=>!r.containsPoint(t)):!0}}function bb(n,t){const e=n.sourceBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function wb(n,t){const e=n.targetBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function xb(n,t){return n.sourceAnchor?n.sourceAnchor:bb(n,t).getCenter()}function YB(n,t){return n.targetAnchor?n.targetAnchor:wb(n,t).getCenter()}function nh(n,t,e,s,r){const i=360/e,o=n.theta(WB(n,t,s,r)),a=gt.normalize(o+i/2);return i*Math.floor(a/i)}function WB(n,t,e,s){const r=s.step,i=t.x-n.x,o=t.y-n.y,a=i/e.x,l=o/e.y,u=a*r,h=l*r;return new O(n.x+u,n.y+h)}function vb(n,t){const e=Math.abs(n-t);return e>180?360-e:e}function qB(n,t){const e=t.step;return t.directions.forEach(s=>{s.gridOffsetX=s.offsetX/e*n.x,s.gridOffsetY=s.offsetY/e*n.y}),t.directions}function JB(n,t,e){return{source:t.clone(),x:Cb(e.x-t.x,n),y:Cb(e.y-t.y,n)}}function Cb(n,t){if(!n)return t;const e=Math.abs(n),s=Math.round(e/t);if(!s)return e;const r=s*t,o=(e-r)/s;return t+o}function XB(n,t){const e=t.source,s=wt.snapToGrid(n.x-e.x,t.x)+e.x,r=wt.snapToGrid(n.y-e.y,t.y)+e.y;return new O(s,r)}function co(n,t){return n.round(t)}function cl(n,t,e){return co(XB(n.clone(),t),e)}function uo(n){return n.toString()}function sh(n){return new O(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function Sb(n,t){let e=1/0;for(let s=0,r=t.length;s<r;s+=1){const i=n.manhattanDistance(t[s]);i<e&&(e=i)}return e}function Eb(n,t,e,s,r){const i=r.precision,o=r.directionMap,a=n.diff(t.getCenter()),l=Object.keys(o).reduce((u,h)=>{if(e.includes(h)){const f=o[h],d=new O(n.x+f.x*(Math.abs(a.x)+t.width),n.y+f.y*(Math.abs(a.y)+t.height)),p=new W(n,d).intersect(t)||[];let m,y=null;for(let b=0;b<p.length;b+=1){const w=p[b],x=n.squaredDistance(w);(m==null||x>m)&&(m=x,y=w)}if(y){let b=cl(y,s,i);t.containsPoint(b)&&(b=cl(b.translate(f.x*s.x,f.y*s.y),s,i)),u.push(b)}}return u},[]);return t.containsPoint(n)||l.push(cl(n,s,i)),l}function KB(n,t,e,s,r){const i=[];let o=sh(r.diff(e)),a=uo(e),l=n[a],u;for(;l;){u=t[a];const d=sh(u.diff(l));d.equals(o)||(i.unshift(u),o=d),a=uo(l),l=n[a]}const h=t[a];return sh(h.diff(s)).equals(o)||i.unshift(h),i}function ZB(n,t,e,s,r){const i=r.precision;let o,a;z.isRectangle(t)?o=co(xb(n,r).clone(),i):o=co(t.clone(),i),z.isRectangle(e)?a=co(YB(n,r).clone(),i):a=co(e.clone(),i);const l=JB(r.step,o,a),u=o,h=a;let f,d;if(z.isRectangle(t)?f=Eb(u,t,r.startDirections,l,r):f=[u],z.isRectangle(e)?d=Eb(a,e,r.endDirections,l,r):d=[h],f=f.filter(g=>s.isAccessible(g)),d=d.filter(g=>s.isAccessible(g)),f.length>0&&d.length>0){const g=new UB,p={},m={},y={};for(let k=0,_=f.length;k<_;k+=1){const D=f[k],N=uo(D);g.add(N,Sb(D,d)),p[N]=D,y[N]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,v;const S=qB(l,r),E=S.length,C=d.reduce((k,_)=>{const D=uo(_);return k.push(D),k},[]),M=O.equalPoints(f,d);let T=r.maxLoopCount;for(;!g.isEmpty()&&T>0;){const k=g.pop(),_=p[k],D=m[k],N=y[k],j=_.equals(u),A=D==null;let P;if(A?w?j?P=null:P=nh(u,_,E,l,r):P=b:P=nh(D,_,E,l,r),!(A&&M)&&C.indexOf(k)>=0)return r.previousDirectionAngle=P,KB(m,p,_,u,h);for(let V=0;V<E;V+=1){x=S[V];const Y=x.angle;if(v=vb(P,Y),!(w&&j)&&v>r.maxDirectionChange)continue;const ot=cl(_.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),l,i),F=uo(ot);if(g.isClose(F)||!s.isAccessible(ot))continue;if(C.indexOf(F)>=0&&!ot.equals(h)){const rt=nh(ot,h,E,l,r);if(vb(Y,rt)>r.maxDirectionChange)continue}const H=x.cost,B=j?0:r.penalties[v],K=N+H+B;(!g.isOpen(F)||K<y[F])&&(p[F]=ot,m[F]=_,y[F]=K,g.add(F,K+Sb(ot,d)))}T-=1}}return r.fallbackRoute?X(r.fallbackRoute,this,u,h,r):null}function QB(n,t=10){if(n.length<=1)return n;for(let e=0,s=n.length;e<s-1;e+=1){const r=n[e],i=n[e+1];if(r.x===i.x){const o=t*Math.round(r.x/t);r.x!==o&&(r.x=o,i.x=o)}else if(r.y===i.y){const o=t*Math.round(r.y/t);r.y!==o&&(r.y=o,i.y=o)}}return n}const tV=function(n,t,e){const s=HB(t),r=bb(e,s),i=wb(e,s),o=xb(e,s),a=new GB(s).build(e.graph.model,e.cell),l=n.map(g=>O.create(g)),u=[];let h=o,f,d;for(let g=0,p=l.length;g<=p;g+=1){let m=null;if(f=d||r,d=l[g],d==null){d=i;const b=e.cell;if((b.getSourceCellId()==null||b.getTargetCellId()==null)&&typeof s.draggingRouter=="function"){const x=f===r?o:f,v=d.getOrigin();m=X(s.draggingRouter,e,x,v,s)}}if(m==null&&(m=ZB(e,f,d,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),X(s.fallbackRouter,this,n,s,e);const y=m[0];y&&y.equals(h)&&m.shift(),h=m[m.length-1]||h,u.push(...m)}return s.snapToGrid?QB(u,e.graph.grid.getGridSize()):u},Ob=function(n,t,e){return X(tV,this,n,Object.assign(Object.assign({},FB),t),e)},eV={maxDirectionChange:45,directions(){const n=Os(this.step,this),t=Os(this.cost,this),e=Math.ceil(Math.sqrt(n*n<<1));return[{cost:t,offsetX:n,offsetY:0},{cost:e,offsetX:n,offsetY:n},{cost:t,offsetX:0,offsetY:n},{cost:e,offsetX:-n,offsetY:n},{cost:t,offsetX:-n,offsetY:0},{cost:e,offsetX:-n,offsetY:-n},{cost:t,offsetX:0,offsetY:-n},{cost:e,offsetX:n,offsetY:-n}]},fallbackRoute(n,t,e){const s=n.theta(t),r=[];let i={x:t.x,y:n.y},o={x:n.x,y:t.y};if(s%180>90){const x=i;i=o,o=x}const a=s%90<45?i:o,l=new W(n,a),u=90*Math.ceil(s/90),h=O.fromPolar(l.squaredLength(),gt.toRad(u+135),a),f=new W(t,h),d=l.intersectsWithLine(f),g=d||t,p=d?g:n,m=360/e.directions.length,y=p.theta(t),b=gt.normalize(y+m/2),w=m*Math.floor(b/m);return e.previousDirectionAngle=w,g&&r.push(g.round()),r.push(t),r}},nV=function(n,t,e){return X(Ob,this,n,Object.assign(Object.assign({},eV),t),e)},sV=function(n,t,e){const s=t.offset||32,r=t.min==null?16:t.min;let i=0,o=t.direction;const a=e.sourceBBox,l=e.targetBBox,u=a.getCenter(),h=l.getCenter();if(typeof s=="number"&&(i=s),o==null){let b=l.left-a.right,w=l.top-a.bottom;b>=0&&w>=0?o=b>=w?"L":"T":b<=0&&w>=0?(b=a.left-l.right,b>=0?o=b>=w?"R":"T":o="T"):b>=0&&w<=0?(w=a.top-l.bottom,w>=0?o=b>=w?"L":"B":o="L"):(b=a.left-l.right,w=a.top-l.bottom,b>=0&&w>=0?o=b>=w?"R":"B":b<=0&&w>=0?o="B":b>=0&&w<=0?o="R":o=Math.abs(b)>Math.abs(w)?"R":"B")}o==="H"?o=h.x-u.x>=0?"L":"R":o==="V"&&(o=h.y-u.y>=0?"T":"B"),s==="center"&&(o==="L"?i=(l.left-a.right)/2:o==="R"?i=(a.left-l.right)/2:o==="T"?i=(l.top-a.bottom)/2:o==="B"&&(i=(a.top-l.bottom)/2));let f,d,g;const p=o==="L"||o==="R";if(p){if(h.y===u.y)return[...n];g=o==="L"?1:-1,f="x",d="width"}else{if(h.x===u.x)return[...n];g=o==="T"?1:-1,f="y",d="height"}const m=u.clone(),y=h.clone();if(m[f]+=g*(a[d]/2+i),y[f]-=g*(l[d]/2+i),p){const b=m.x,w=y.x,x=a.width/2+r,v=l.width/2+r;h.x>u.x?w<=b&&(m.x=Math.max(w,u.x+x),y.x=Math.min(b,h.x-v)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,h.x+v))}else{const b=m.y,w=y.y,x=a.height/2+r,v=l.height/2+r;h.y>u.y?w<=b&&(m.y=Math.max(w,u.y+x),y.y=Math.min(b,h.y-v)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,h.y+v))}return[m.toJSON(),...n,y.toJSON()]};function Zr(n,t){if(t!=null&&t!==!1){const e=typeof t=="boolean"?0:t;if(e>0){const s=O.create(n[1]).move(n[2],e),r=O.create(n[1]).move(n[0],e);return[s.toJSON(),...n,r.toJSON()]}{const s=n[1];return[Object.assign({},s),...n,Object.assign({},s)]}}return n}const rV=Object.freeze(Object.defineProperty({__proto__:null,er:sV,loop:function(n,t,e){const s=t.width||50,i=(t.height||80)/2,o=t.angle||"auto",a=e.sourceAnchor,l=e.targetAnchor,u=e.sourceBBox,h=e.targetBBox;if(a.equals(l)){const f=b=>{const w=gt.toRad(b),x=Math.sin(w),v=Math.cos(w),S=new O(a.x+v*s,a.y+x*s),E=new O(S.x-v*i,S.y-x*i),C=E.clone().rotate(-90,S),M=E.clone().rotate(90,S);return[C.toJSON(),S.toJSON(),M.toJSON()]},d=b=>{const w=a.clone().move(b,-1),x=new W(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},g=[0,90,180,270,45,135,225,315];if(typeof o=="number")return Zr(f(o),t.merge);const p=u.getCenter();if(p.equals(a))return Zr(f(0),t.merge);const m=p.angleBetween(a,p.clone().translate(1,0));let y=f(m);if(d(y[1]))return Zr(y,t.merge);for(let b=1,w=g.length;b<w;b+=1)if(y=f(m+g[b]),d(y[1]))return Zr(y,t.merge);return Zr(y,t.merge)}{const f=new W(a,l);let d=f.parallel(-s),g=d.getCenter(),p=d.start.clone().move(d.end,i),m=d.end.clone().move(d.start,i);const y=f.parallel(-1),b=new W(y.start,g),w=new W(y.end,g);if((u.containsPoint(g)||h.containsPoint(g)||u.intersectsWithLine(b)||u.intersectsWithLine(w)||h.intersectsWithLine(b)||h.intersectsWithLine(w))&&(d=f.parallel(s),g=d.getCenter(),p=d.start.clone().move(d.end,i),m=d.end.clone().move(d.start,i)),t.merge){const x=new W(a,l),v=new W(g,x.center).setLength(Number.MAX_SAFE_INTEGER),S=u.intersectsWithLine(v),E=h.intersectsWithLine(v),C=S?Array.isArray(S)?S:[S]:[];E&&(Array.isArray(E)?C.push(...E):C.push(E));const M=x.center.closest(C);M?(e.sourceAnchor=M.clone(),e.targetAnchor=M.clone()):(e.sourceAnchor=x.center.clone(),e.targetAnchor=x.center.clone())}return Zr([p.toJSON(),g.toJSON(),m.toJSON()],t.merge)}},manhattan:Ob,metro:nV,normal:VB,oneSide:jB,orth:pb},Symbol.toStringTag,{value:"Module"}));var Ms;(function(n){n.presets=rV,n.registry=Ft.create({type:"router"}),n.registry.register(n.presets,!0)})(Ms||(Ms={}));const iV=function(n,t,e,s={}){const r=[n,...e,t],i=new zt(r),o=new Z(i);return s.raw?o:o.serialize()},oV=function(n,t,e,s={}){const r=e.length===3?0:1,i=O.create(e[0+r]),o=O.create(e[2+r]),a=O.create(e[1+r]);if(!O.equals(n,t)){const u=new O((n.x+t.x)/2,(n.y+t.y)/2),h=u.angleBetween(O.create(n).rotate(90,u),a);h>1&&(i.rotate(180-h,u),o.rotate(180-h,u),a.rotate(180-h,u))}const l=`
|
|
116
|
+
`.trim()}const xI=Object.freeze(Object.defineProperty({__proto__:null,blur:hI,brightness:bI,contrast:wI,dropShadow:dI,grayScale:fI,highlight:uI,hueRotate:mI,invert:yI,outline:cI,saturate:pI,sepia:gI},Symbol.toStringTag,{value:"Module"}));var Hr;(function(n){n.presets=xI,n.registry=zt.create({type:"filter"}),n.registry.register(n.presets,!0)})(Hr||(Hr={}));const vI={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},CI={},ky={position:Za("x","width","origin")},Dy={position:Za("y","height","origin")},SI={position:Za("x","width","corner")},EI={position:Za("y","height","corner")},Ry={set:ws("width","width")},Iy={set:ws("height","height")},OI={set:ws("rx","width")},MI={set:ws("ry","height")},Ly={set:(n=>{const t=ws(n,"width"),e=ws(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?t:e;return X(o,this,s,r)}})("r")},PI={set(n,{refBBox:t}){let e=parseFloat(n);const s=Yn(n);s&&(e/=100);const r=Math.sqrt(t.height*t.height+t.width*t.width);let i;return Number.isFinite(e)&&(s||e>=0&&e<=1?i=e*r:i=Math.max(e+r,0)),{r:i}}},AI={set:ws("cx","width")},TI={set:ws("cy","height")},By={set:$y({resetOffset:!0})},NI={set:$y({resetOffset:!1})},Vy={set:zy({resetOffset:!0})},_I={set:zy({resetOffset:!1})},kI=Ly,DI=By,RI=Vy,II=ky,LI=Dy,BI=Ry,VI=Iy;function Za(n,t,e){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=Yn(s);o&&(i/=100);let a;if(Number.isFinite(i)){const u=r[e];o||i>0&&i<1?a=u[n]+r[t]*i:a=u[n]+i}const l=new O;return l[n]=a||0,l}}function ws(n,t){return function(e,{refBBox:s}){let r=parseFloat(e);const i=Yn(e);i&&(r/=100);const o={};if(Number.isFinite(r)){const a=i||r>=0&&r<=1?r*s[t]:Math.max(r+s[t],0);o[n]=a}return o}}function jy(n,t){const e="x6-shape",s=t&&t.resetOffset;return function(r,{elem:i,refBBox:o}){let a=Js(i,e);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},Js(i,e,a)}const l=a.shape.clone(),u=a.shapeBBox.clone(),h=u.getOrigin(),f=o.getOrigin();u.x=f.x,u.y=f.y;const d=o.getMaxScaleToFit(u,f),g=u.width===0||o.width===0?1:d.sx,p=u.height===0||o.height===0?1:d.sy;return l.scale(g,p,h),s&&l.translate(-h.x,-h.y),l}}function $y(n){function t(s){return Z.parse(s)}const e=jy(t,n);return(s,r)=>({d:e(s,r).serialize()})}function zy(n){const t=jy(e=>new $t(e),n);return(e,s)=>({points:t(e,s).serialize()})}const jI={qualify:bn,set(n,{view:t}){return`url(#${t.graph.defineGradient(n)})`}},$I={qualify:bn,set(n,{view:t}){const e=t.cell,s=Object.assign({},n);if(e.isEdge()&&s.type==="linearGradient"){const r=t,i=r.sourcePoint,o=r.targetPoint;s.id=`gradient-${s.type}-${e.id}`,s.attrs=Object.assign(Object.assign({},s.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),t.graph.defs.remove(s.id)}return`url(#${t.graph.defineGradient(s)})`}},Fy={qualify(n,{attrs:t}){return t.textWrap==null||!bn(t.textWrap)},set(n,{view:t,elem:e,attrs:s}){const r="x6-text",i=Js(e,r),o=h=>{try{return JSON.parse(h)}catch{return h}},a={x:s.x,eol:s.eol,annotations:o(s.annotations),textPath:o(s["text-path"]||s.textPath),textVerticalAnchor:s["text-vertical-anchor"]||s.textVerticalAnchor,displayEmpty:(s["display-empty"]||s.displayEmpty)==="true",lineHeight:s["line-height"]||s.lineHeight},l=s["font-size"]||s.fontSize,u=JSON.stringify([n,a]);if(l&&e.setAttribute("font-size",l),i==null||i!==u){const h=a.textPath;if(h!=null&&typeof h=="object"){const f=h.selector;if(typeof f=="string"){const d=t.find(f)[0];d instanceof SVGPathElement&&(ku(d),a.textPath=Object.assign({"xlink:href":`#${d.id}`},h))}}my(e,`${n}`,a),Js(e,r,u)}}},zI={qualify:bn,set(n,{view:t,elem:e,attrs:s,refBBox:r}){const i=n,o=i.width||0;Yn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;Yn(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let l,u=i.text;u==null&&(u=s.text||(e==null?void 0:e.textContent)),u!=null?l=by(`${u}`,r,{"font-weight":s["font-weight"]||s.fontWeight,"font-size":s["font-size"]||s.fontSize,"font-family":s["font-family"]||s.fontFamily,lineHeight:s.lineHeight},{ellipsis:i.ellipsis}):l="",X(Fy.set,this,l,{view:t,elem:e,attrs:s,refBBox:r,cell:t.cell})}},Ur=(n,{attrs:t})=>t.text!==void 0,FI={qualify:Ur},HI={qualify:Ur},UI={qualify:Ur},GI={qualify:Ur},YI={qualify:Ur},WI={qualify:Ur},qI={qualify(n,{elem:t}){return t instanceof SVGElement},set(n,{elem:t}){const e="x6-title",s=`${n}`,r=Js(t,e);if(r==null||r!==s){Js(t,e,s);const i=t.firstChild;if(i&&i.tagName.toUpperCase()==="TITLE"){const o=i;o.textContent=s}else{const o=document.createElementNS(t.namespaceURI,"title");o.textContent=s,t.insertBefore(o,i)}}}},JI={offset:Hy("x","width","right")},XI={offset:Hy("y","height","bottom")},KI={offset(n,{refBBox:t}){return n?{x:-t.x,y:-t.y}:{x:0,y:0}}};function Hy(n,t,e){return(s,{refBBox:r})=>{const i=new O;let o;return s==="middle"?o=r[t]/2:s===e?o=r[t]:typeof s=="number"&&Number.isFinite(s)?o=s>-1&&s<1?-r[t]*s:-s:Yn(s)?o=r[t]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const ZI={qualify:bn,set(n,{elem:t}){qt(t,n)}},QI={set(n,{elem:t}){t.innerHTML=`${n}`}},tL={qualify:bn,set(n,{view:t}){return`url(#${t.graph.defineFilter(n)})`}},eL={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function xs(n,t,e){let s,r;typeof t=="object"?(s=t.x,r=t.y):(s=t,r=e);const i=Z.parse(n),o=i.bbox();if(o){let a=-o.height/2-o.y,l=-o.width/2-o.x;typeof s=="number"&&(l-=s),typeof r=="number"&&(a-=r),i.translate(l,a)}return i.serialize()}var Uy=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const nL=n=>{var{size:t,width:e,height:s,offset:r,open:i}=n,o=Uy(n,["size","width","height","offset","open"]);return Gy({size:t,width:e,height:s,offset:r},i===!0,!0,void 0,o)},sL=n=>{var{size:t,width:e,height:s,offset:r,factor:i}=n,o=Uy(n,["size","width","height","offset","factor"]);return Gy({size:t,width:e,height:s,offset:r},!1,!1,i,o)};function Gy(n,t,e,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,l=new Z,u={};if(t)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!e){const h=we(s,0,1);l.lineTo(o*h,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},u),r),{tagName:"path",d:xs(l.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var rL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const iL=n=>{var{size:t,width:e,height:s,offset:r}=n,i=rL(n,["size","width","height","offset"]);const o=t||10,a=e||o,l=s||o,u=new Z;return u.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},i),{tagName:"path",d:xs(u.serialize(),r??-a/2)})};var oL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const aL=n=>{var{d:t,offsetX:e,offsetY:s}=n,r=oL(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:xs(t,e,s)})};var lL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const cL=n=>{var{size:t,width:e,height:s,offset:r}=n,i=lL(n,["size","width","height","offset"]);const o=t||10,a=e||o,l=s||o,u=new Z;return u.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:xs(u.serialize(),r||-a/2)})};var uL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const hL=n=>{var{width:t,height:e,offset:s,open:r,flip:i}=n,o=uL(n,["width","height","offset","open","flip"]);let a=e||6;const l=t||10,u=r===!0,h=i===!0,f=Object.assign(Object.assign({},o),{tagName:"path"});h&&(a=-a);const d=new Z;return d.moveTo(0,a).lineTo(l,0),u?f.fill="none":(d.lineTo(l,a),d.close()),f.d=xs(d.serialize(),{x:s||-l/2,y:a/2}),f};var Yy=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const Wy=n=>{var{r:t}=n,e=Yy(n,["r"]);const s=t||5;return Object.assign(Object.assign({cx:s},e),{tagName:"circle",r:s})},dL=n=>{var{r:t}=n,e=Yy(n,["r"]);const s=t||5,r=new Z;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},Wy({r:s})),{fill:"none"}),Object.assign(Object.assign({},e),{tagName:"path",d:xs(r.serialize(),-s)})]}};var fL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const gL=Object.freeze(Object.defineProperty({__proto__:null,async:hL,block:nL,circle:Wy,circlePlus:dL,classic:sL,cross:cL,diamond:iL,ellipse:n=>{var{rx:t,ry:e}=n,s=fL(n,["rx","ry"]);const r=t||5,i=e||5;return Object.assign(Object.assign({cx:r},s),{tagName:"ellipse",rx:r,ry:i})},path:aL},Symbol.toStringTag,{value:"Module"}));var vs;(function(n){n.presets=gL,n.registry=zt.create({type:"marker"}),n.registry.register(n.presets,!0)})(vs||(vs={})),function(n){n.normalize=xs}(vs||(vs={}));var pL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};function Xu(n){return typeof n=="string"||bn(n)}const mL={qualify:Xu,set(n,{view:t,attrs:e}){return Ku("marker-start",n,t,e)}},yL={qualify:Xu,set(n,{view:t,attrs:e}){return Ku("marker-end",n,t,e,{transform:"rotate(180)"})}},bL={qualify:Xu,set(n,{view:t,attrs:e}){return Ku("marker-mid",n,t,e)}};function Ku(n,t,e,s,r={}){const i=typeof t=="string"?{name:t}:t,{name:o,args:a}=i,l=pL(i,["name","args"]);let u=l;if(o&&typeof o=="string"){const f=vs.registry.get(o);if(f)u=f(Object.assign(Object.assign({},l),a));else return vs.registry.onNotFound(o)}const h=Object.assign(Object.assign(Object.assign({},wL(s,n)),r),u);return{[n]:`url(#${e.graph.defineMarker(h)})`}}function wL(n,t){const e={},s=n.stroke;typeof s=="string"&&(e.stroke=s,e.fill=s);let r=n.strokeOpacity;if(r==null&&(r=n["stroke-opacity"]),r==null&&(r=n.opacity),r!=null&&(e["stroke-opacity"]=r,e["fill-opacity"]=r),t!=="marker-mid"){const i=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);e.refX=t==="marker-start"?o:-o}}return e}const io=(n,{view:t})=>t.cell.isEdge(),xL={qualify:io,set(n,t){var e,s,r,i;const o=t.view,a=n.reverse||!1,l=n.stubs||0;let u;if(Number.isFinite(l)&&l!==0)if(a){let h,f;const d=o.getConnectionLength()||0;l<0?(h=(d+l)/2,f=-l):(h=l,f=d-l*2);const g=o.getConnection();u=(i=(r=(s=(e=g==null?void 0:g.divideAtLength(h))===null||e===void 0?void 0:e[1])===null||s===void 0?void 0:s.divideAtLength(f))===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.serialize()}else{let h;l<0?h=((o.getConnectionLength()||0)+l)/2:h=l;const f=o.getConnection();if(f){const d=f.divideAtLength(h),g=f.divideAtLength(-h);d&&g&&(u=`${d[0].serialize()} ${g[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},qy={qualify:io,set:Qa("getTangentAtLength",{rotate:!0})},vL={qualify:io,set:Qa("getTangentAtLength",{rotate:!1})},Jy={qualify:io,set:Qa("getTangentAtRatio",{rotate:!0})},CL={qualify:io,set:Qa("getTangentAtRatio",{rotate:!1})},SL=qy,EL=Jy;function Qa(n,t){const e={x:1,y:0};return(s,r)=>{let i,o;const a=r.view,l=a[n](Number(s));return l?(o=t.rotate?l.vector().vectorAngle(e):0,i=l.start):(i=a.path.start,o=0),o===0?{transform:`translate(${i.x},${i.y}')`}:{transform:`translate(${i.x},${i.y}') rotate(${o})`}}}const OL=Object.freeze(Object.defineProperty({__proto__:null,annotations:GI,atConnectionLength:SL,atConnectionLengthIgnoreGradient:vL,atConnectionLengthKeepGradient:qy,atConnectionRatio:EL,atConnectionRatioIgnoreGradient:CL,atConnectionRatioKeepGradient:Jy,connection:xL,displayEmpty:WI,eol:YI,fill:jI,filter:tL,html:QI,lineHeight:FI,port:eL,ref:CI,refCx:AI,refCy:TI,refD:DI,refDKeepOffset:NI,refDResetOffset:By,refDx:SI,refDy:EI,refHeight:Iy,refHeight2:VI,refPoints:RI,refPointsKeepOffset:_I,refPointsResetOffset:Vy,refR:kI,refRCircumscribed:PI,refRInscribed:Ly,refRx:OI,refRy:MI,refWidth:Ry,refWidth2:BI,refX:ky,refX2:II,refY:Dy,refY2:LI,resetOffset:KI,sourceMarker:mL,stroke:$I,style:ZI,targetMarker:yL,text:Fy,textPath:UI,textVerticalAnchor:HI,textWrap:zI,title:qI,vertexMarker:bL,xAlign:JI,yAlign:XI},Symbol.toStringTag,{value:"Module"}));var On;(function(n){function t(e,s,r){return!!(e!=null&&(typeof e=="string"||typeof e.qualify!="function"||X(e.qualify,this,s,r)))}n.isValidDefinition=t})(On||(On={})),function(n){n.presets=Object.assign(Object.assign({},vI),OL),n.registry=zt.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(On||(On={}));const Ue={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Ue.prefixCls}-${n}`}},Xy=Ue.prefix("highlighted"),ML={highlight(n,t,e){const s=e&&e.className||Xy;J(t,s)},unhighlight(n,t,e){const s=e&&e.className||Xy;Dt(t,s)}},Ky=Ue.prefix("highlight-opacity"),PL={highlight(n,t){J(t,Ky)},unhighlight(n,t){Dt(t,Ky)}};var vt;(function(n){n.normalizeMarker=xs;function t(d,g){const p=$R(d.x,d.y).matrixTransform(g);return new O(p.x,p.y)}n.transformPoint=t;function e(d,g){return new W(t(d.start,g),t(d.end,g))}n.transformLine=e;function s(d,g){let p=d instanceof $t?d.points:d;return Array.isArray(p)||(p=[]),new $t(p.map(m=>t(m,g)))}n.transformPolyline=s;function r(d,g){const m=cn("svg").createSVGPoint();m.x=d.x,m.y=d.y;const y=m.matrixTransform(g);m.x=d.x+d.width,m.y=d.y;const b=m.matrixTransform(g);m.x=d.x+d.width,m.y=d.y+d.height;const w=m.matrixTransform(g);m.x=d.x,m.y=d.y+d.height;const x=m.matrixTransform(g),v=Math.min(y.x,b.x,w.x,x.x),S=Math.max(y.x,b.x,w.x,x.x),E=Math.min(y.y,b.y,w.y,x.y),C=Math.max(y.y,b.y,w.y,x.y);return new z(v,E,S-v,C-E)}n.transformRectangle=r;function i(d,g,p){let m;const y=d.ownerSVGElement;if(!y)return new z(0,0,0,0);try{m=d.getBBox()}catch{m={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(g)return z.create(m);const b=Qi(d,p||y);return r(m,b)}n.bbox=i;function o(d,g={}){let p;if(!d.ownerSVGElement||!gs(d)){if(oy(d)){const{left:w,top:x,width:v,height:S}=a(d);return new z(w,x,v,S)}return new z(0,0,0,0)}let y=g.target;if(!g.recursive){try{p=d.getBBox()}catch{p={x:d.clientLeft,y:d.clientTop,width:d.clientWidth,height:d.clientHeight}}if(!y)return z.create(p);const w=Qi(d,y);return r(p,w)}{const w=d.childNodes,x=w.length;if(x===0)return o(d,{target:y});y||(y=d);for(let v=0;v<x;v+=1){const S=w[v];let E;S.childNodes.length===0?E=o(S,{target:y}):E=o(S,{target:y,recursive:!0}),p?p=p.union(E):p=E}return p}}n.getBBox=o;function a(d){let g=0,p=0,m=0,y=0;if(d){let b=d;for(;b;)g+=b.offsetLeft,p+=b.offsetTop,b=b.offsetParent,b&&(g+=parseInt(fy(b,"borderLeft"),10),p+=parseInt(fy(b,"borderTop"),10));m=d.offsetWidth,y=d.offsetHeight}return{left:g,top:p,width:m,height:y}}n.getBoundingOffsetRect=a;function l(d){const g=p=>{const m=d.getAttribute(p),y=m?parseFloat(m):0;return Number.isNaN(y)?0:y};switch(d instanceof SVGElement&&d.nodeName.toLowerCase()){case"rect":return new z(g("x"),g("y"),g("width"),g("height"));case"circle":return new un(g("cx"),g("cy"),g("r"),g("r"));case"ellipse":return new un(g("cx"),g("cy"),g("rx"),g("ry"));case"polyline":{const p=Ya(d);return new $t(p)}case"polygon":{const p=Ya(d);return p.length>1&&p.push(p[0]),new $t(p)}case"path":{let p=d.getAttribute("d");return Z.isValid(p)||(p=Z.normalize(p)),Z.parse(p)}case"line":return new W(g("x1"),g("y1"),g("x2"),g("y2"))}return o(d)}n.toGeometryShape=l;function u(d,g,p,m){const y=O.create(g),b=O.create(p);m||(m=d instanceof SVGSVGElement?d:d.ownerSVGElement);const w=Uu(d);d.setAttribute("transform","");const x=o(d,{target:m}).scale(w.sx,w.sy),v=Ki();v.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const S=Ki(),E=y.angleBetween(b,y.clone().translate(1,0));E&&S.setRotate(E,0,0);const C=Ki(),M=y.clone().move(b,x.width/2);C.setTranslate(2*y.x-M.x,2*y.y-M.y);const T=Qi(d,m),_=Ki();_.setMatrix(C.matrix.multiply(S.matrix.multiply(v.matrix.multiply(T.scale(w.sx,w.sy))))),d.setAttribute("transform",Br(_.matrix))}n.translateAndAutoOrient=u;function h(d){if(d==null)return null;let g=d;do{let p=g.tagName;if(typeof p!="string")return null;if(p=p.toUpperCase(),Sn(g,"x6-port"))g=g.nextElementSibling;else if(p==="G")g=g.firstElementChild;else if(p==="TITLE")g=g.nextElementSibling;else break}while(g);return g}n.findShapeNode=h;function f(d){const g=h(d);if(!gs(g)){if(oy(d)){const{left:y,top:b,width:w,height:x}=a(d);return new z(y,b,w,x)}return new z(0,0,0,0)}return l(g).bbox()||z.create()}n.getBBoxV2=f})(vt||(vt={}));const AL={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},TL={highlight(n,t,e){const s=Cs.getHighlighterId(t,e);if(Cs.hasCache(s))return;e=ig({},e,AL);const r=tt.create(t);let i,o;try{i=r.toPathData()}catch{o=vt.bbox(r.node,!0),i=xy(Object.assign(Object.assign({},e),o))}const a=cn("path");if(ut(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},e.attrs?Ji(e.attrs):null)),n.isEdgeElement(t))ut(a,"d",n.getConnectionPathData());else{let h=r.getTransformToElement(n.container);const f=e.padding;if(f){o==null&&(o=vt.bbox(r.node,!0));const d=o.x+o.width/2,g=o.y+o.height/2;o=vt.transformRectangle(o,h);const p=Math.max(o.width,1),m=Math.max(o.height,1),y=(p+f)/p,b=(m+f)/m,w=ne({a:y,b:0,c:0,d:b,e:d-y*d,f:g-b*g});h=h.multiply(w)}Vr(a,h)}J(a,Ue.prefix("highlight-stroke"));const l=n.cell,u=()=>Cs.removeHighlighter(s);l.on("removed",u),l.model&&l.model.on("reseted",u),n.container.appendChild(a),Cs.setCache(s,a)},unhighlight(n,t,e){Cs.removeHighlighter(Cs.getHighlighterId(t,e))}};var Cs;(function(n){function t(o,a){return ku(o),o.id+JSON.stringify(a)}n.getHighlighterId=t;const e={};function s(o,a){e[o]=a}n.setCache=s;function r(o){return e[o]!=null}n.hasCache=r;function i(o){const a=e[o];a&&(ze(a),delete e[o])}n.removeHighlighter=i})(Cs||(Cs={}));const NL=Object.freeze(Object.defineProperty({__proto__:null,className:ML,opacity:PL,stroke:TL},Symbol.toStringTag,{value:"Module"}));var qn;(function(n){function t(e,s){if(typeof s.highlight!="function")throw new Error(`Highlighter '${e}' is missing required \`highlight()\` method`);if(typeof s.unhighlight!="function")throw new Error(`Highlighter '${e}' is missing required \`unhighlight()\` method`)}n.check=t})(qn||(qn={})),function(n){n.presets=NL,n.registry=zt.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(qn||(qn={}));function Zu(n,t={}){return new O(an(t.x,n.width),an(t.y,n.height))}function Qu(n,t,e){return Object.assign({angle:t,position:n.toJSON()},e)}const _L=(n,t)=>n.map(({x:e,y:s,angle:r})=>Qu(Zu(t,{x:e,y:s}),r||0)),kL=(n,t,e)=>{const s=e.start||0,r=e.step||20;return Zy(n,t,s,(i,o)=>(i+.5-o/2)*r)},DL=(n,t,e)=>{const s=e.start||0,r=e.step||360/n.length;return Zy(n,t,s,i=>i*r)};function Zy(n,t,e,s){const r=t.getCenter(),i=t.getTopCenter(),o=t.width/t.height,a=un.fromRect(t),l=n.length;return n.map((u,h)=>{const f=e+s(h,l),d=i.clone().rotate(-f,r).scale(o,1,r),g=u.compensateRotate?-a.tangentTheta(d):0;return(u.dx||u.dy)&&d.translate(u.dx||0,u.dy||0),u.dr&&d.move(r,u.dr),Qu(d.round(),g,u)})}var RL=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};const IL=(n,t,e)=>{const s=Zu(t,e.start||t.getOrigin()),r=Zu(t,e.end||t.getCorner());return oo(n,s,r,e)},LL=(n,t,e)=>oo(n,t.getTopLeft(),t.getBottomLeft(),e),BL=(n,t,e)=>oo(n,t.getTopRight(),t.getBottomRight(),e),VL=(n,t,e)=>oo(n,t.getTopLeft(),t.getTopRight(),e),jL=(n,t,e)=>oo(n,t.getBottomLeft(),t.getBottomRight(),e);function oo(n,t,e,s){const r=new W(t,e),i=n.length;return n.map((o,a)=>{var{strict:l}=o,u=RL(o,["strict"]);const h=l||s.strict?(a+1)/(i+1):(a+.5)/i,f=r.pointAt(h);return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),Qu(f.round(),0,u)})}const $L=Object.freeze(Object.defineProperty({__proto__:null,absolute:_L,bottom:jL,ellipse:kL,ellipseSpread:DL,left:LL,line:IL,right:BL,top:VL},Symbol.toStringTag,{value:"Module"}));var Qs;(function(n){n.presets=$L,n.registry=zt.create({type:"port layout"}),n.registry.register(n.presets,!0)})(Qs||(Qs={}));const zL={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ss(n,t){const{x:e,y:s,angle:r,attrs:i}=t||{};return ig({},{angle:r,attrs:i,position:{x:e,y:s}},n,zL)}const FL=(n,t,e)=>Ss({position:t.getTopLeft()},e),HL=(n,t,e)=>Ss({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},e),UL=(n,t,e)=>Ss({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},e),GL=(n,t,e)=>Ss({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},e),YL=(n,t,e)=>Ss({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},e),WL=(n,t,e)=>Qy(n,t,!1,e),qL=(n,t,e)=>Qy(n,t,!0,e),JL=(n,t,e)=>tb(n,t,!1,e),XL=(n,t,e)=>tb(n,t,!0,e);function Qy(n,t,e,s){const r=s.offset!=null?s.offset:15,i=t.getCenter().theta(n),o=eb(t);let a,l,u,h,f=0;return i<o[1]||i>o[2]?(a=".3em",l=r,u=0,h="start"):i<o[0]?(a="0",l=0,u=-r,e?(f=-90,h="start"):h="middle"):i<o[3]?(a=".3em",l=-r,u=0,h="end"):(a=".6em",l=0,u=r,e?(f=90,h="start"):h="middle"),Ss({position:{x:Math.round(l),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":h}}},s)}function tb(n,t,e,s){const r=s.offset!=null?s.offset:15,i=t.getCenter().theta(n),o=eb(t);let a,l,u,h,f=0;return i<o[1]||i>o[2]?(a=".3em",l=-r,u=0,h="end"):i<o[0]?(a=".6em",l=0,u=r,e?(f=90,h="start"):h="middle"):i<o[3]?(a=".3em",l=r,u=0,h="start"):(a="0em",l=0,u=-r,e?(f=-90,h="start"):h="middle"),Ss({position:{x:Math.round(l),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":h}}},s)}function eb(n){const t=n.getCenter(),e=t.theta(n.getTopLeft()),s=t.theta(n.getBottomLeft()),r=t.theta(n.getBottomRight()),i=t.theta(n.getTopRight());return[e,i,r,s]}const KL=(n,t,e)=>nb(n.diff(t.getCenter()),!1,e),ZL=(n,t,e)=>nb(n.diff(t.getCenter()),!0,e);function nb(n,t,e){const s=e.offset!=null?e.offset:20,r=new O(0,0),i=-n.theta(r),o=n.clone().move(r,s).diff(n).round();let a=".3em",l,u=i;return(i+90)%180===0?(l=t?"end":"middle",!t&&i===-270&&(a="0em")):i>-270&&i<-90?(l="start",u=i-180):l="end",Ss({position:o.round().toJSON(),angle:t?u:0,attrs:{".":{y:a,"text-anchor":l}}},e)}const QL=Object.freeze(Object.defineProperty({__proto__:null,bottom:YL,inside:JL,insideOriented:XL,left:HL,manual:FL,outside:WL,outsideOriented:qL,radial:KL,radialOriented:ZL,right:UL,top:GL},Symbol.toStringTag,{value:"Module"}));var Gr;(function(n){n.presets=QL,n.registry=zt.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(Gr||(Gr={}));var tB=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class pt extends Nt{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=th.uniqueId(),pt.views[this.cid]=this}confirmUpdate(t,e){return 0}empty(t=this.container){return qi(t),this}unmount(t=this.container){return ze(t),this}remove(t=this.container){return t===this.container?(this.removeEventListeners(document),this.onRemove(),delete pt.views[this.cid],this.disposeContainer&&this.unmount(t)):this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return J(e,Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return Dt(e,Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return qt(e,t),this}setAttrs(t,e=this.container){return t!=null&&e!=null&&ut(e,t),this}findAttr(t,e=this.container){let s=e;for(;s&&s.nodeType===1;){const r=s.getAttribute(t);if(r!=null)return r;if(s===this.container)return null;s=s.parentNode}return null}find(t,e=this.container,s=this.selectors){return pt.find(t,e,s).elems}findOne(t,e=this.container,s=this.selectors){const r=this.find(t,e,s);return r.length>0?r[0]:null}findByAttr(t,e=this.container){let s=e;for(;s&&s.getAttribute;){const r=s.getAttribute(t);if((r!=null||s===this.container)&&r!=="false")return s;s=s.parentNode}return null}getSelector(t,e){let s;if(t===this.container)return typeof e=="string"&&(s=`> ${e}`),s;if(t){const r=Ru(t)+1;s=`${t.tagName.toLowerCase()}:nth-child(${r})`,e&&(s+=` > ${e}`),s=this.getSelector(t.parentNode,s)}return s}prefixClassName(t){return Ue.prefix(t)}delegateEvents(t,e){if(t==null)return this;e||this.undelegateEvents();const s=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(r=>{const i=r.match(s);if(i==null)return;const o=this.getEventHandler(t[r]);typeof o=="function"&&this.delegateEvent(i[1],i[2],o)}),this}undelegateEvents(){return le.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,s){return le.on(this.container,t+this.getEventNamespace(),e,s),this}undelegateEvent(t,e,s){const r=t+this.getEventNamespace();return e==null?le.off(this.container,r):typeof e=="string"?le.off(this.container,r,e,s):le.off(this.container,r,e),this}addEventListeners(t,e,s){if(e==null)return this;const r=this.getEventNamespace();return Object.keys(e).forEach(i=>{const o=this.getEventHandler(e[i]);typeof o=="function"&&le.on(t,i+r,s,o)}),this}removeEventListeners(t){return t!=null&&le.off(t,this.getEventNamespace()),this}getEventNamespace(){return`.${Ue.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if(typeof t=="string"){const s=this[t];typeof s=="function"&&(e=(...r)=>s.call(this,...r))}else e=(...s)=>t.call(this,...s);return e}getEventTarget(t,e={}){const{target:s,type:r,clientX:i=0,clientY:o=0}=t;return e.fromPoint||r==="touchmove"||r==="touchend"?document.elementFromPoint(i,o):s}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return this.getEventData(t).propagationStopped===!0}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(t==null)throw new TypeError("Event object required");let s=t.data;const r=`__${this.cid}__`;return e==null?s==null?{}:s[r]||{}:(s==null&&(s=t.data={}),s[r]==null?s[r]=Object.assign({},e):s[r]=Object.assign(Object.assign({},s[r]),e),s[r])}normalizeEvent(t){return pt.normalizeEvent(t)}dispose(){this.remove()}}tB([pt.dispose()],pt.prototype,"dispose",null),function(n){function t(r,i){return i?cn(r||"g"):Du(r||"div")}n.createElement=t;function e(r,i,o){if(!r||r===".")return{elems:[i]};if(o){const a=o[r];if(a)return{elems:Array.isArray(a)?a:[a]}}{const a=r.includes(">")?`:scope ${r}`:r;return{isCSSSelector:!0,elems:Array.prototype.slice.call(i.querySelectorAll(a))}}}n.find=e;function s(r){let i=r;const o=r.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const l in r)a[l]===void 0&&(a[l]=r[l]);i=a}return i}n.normalizeEvent=s}(pt||(pt={})),function(n){n.views={};function t(e){return n.views[e]||null}n.getView=t}(pt||(pt={}));var th;(function(n){let t=0;function e(){const s=`v${t}`;return t+=1,s}n.uniqueId=e})(th||(th={}));class eB{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Wu,this.pathCache={}}get(t){return this.elemCache.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(e.matrix==null){const s=this.view.container;e.matrix=GR(t,s)}return ne(e.matrix)}getShape(t){const e=this.get(t);return e.shape==null&&(e.shape=vt.toGeometryShape(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return e.boundingRect==null&&(e.boundingRect=vt.getBBoxV2(t)),e.boundingRect.clone()}}var _t;(function(n){function t(u){return u!=null&&!e(u)}n.isJSONMarkup=t;function e(u){return u!=null&&typeof u=="string"}n.isStringMarkup=e;function s(u){return u==null||e(u)?u:Tt(u)}n.clone=s;function r(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=r;function i(u,h={ns:ee.svg}){const f=document.createDocumentFragment(),d={},g={},p=[{markup:Array.isArray(u)?u:[u],parent:f,ns:h.ns}];for(;p.length>0;){const m=p.pop();let y=m.ns||ee.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const v=x.tagName;if(!v)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const S=y?Du(v,y):sy(v),E=x.attrs;E&&ut(S,Ji(E));const C=x.style;C&&qt(S,C);const M=x.className;M!=null&&S.setAttribute("class",Array.isArray(M)?M.join(" "):M),x.textContent&&(S.textContent=x.textContent);const T=x.selector;if(T!=null){if(g[T])throw new TypeError("Selector must be unique");g[T]=S}if(x.groupSelector){let N=x.groupSelector;Array.isArray(N)||(N=[N]),N.forEach(k=>{d[k]||(d[k]=[]),d[k].push(S)})}w.appendChild(S);const _=x.children;Array.isArray(_)&&p.push({ns:y,markup:_,parent:S})})}return Object.keys(d).forEach(m=>{if(g[m])throw new Error("Ambiguous group selector");g[m]=d[m]}),{fragment:f,selectors:g,groups:d}}n.parseJSONMarkup=i;function o(u){return u instanceof SVGElement?cn("g"):sy("div")}function a(u){if(e(u)){const g=tt.createVectors(u),p=g.length;if(p===1)return{elem:g[0].node};if(p>1){const m=o(g[0].node);return g.forEach(y=>{m.appendChild(y.node)}),{elem:m}}return{}}const h=i(u),f=h.fragment;let d=null;return f.childNodes.length>1?(d=o(f.firstChild),d.appendChild(f)):d=f.firstChild,{elem:d,selectors:h.selectors}}n.renderMarkup=a;function l(u){const h=tt.createVectors(u),f=document.createDocumentFragment();for(let d=0,g=h.length;d<g;d+=1){const p=h[d].node;f.appendChild(p)}return{fragment:f,selectors:{}}}n.parseLabelStringMarkup=l})(_t||(_t={})),function(n){function t(e,s,r){if(e!=null){let i;const o=e.tagName.toLowerCase();if(e===s)return typeof r=="string"?i=`> ${o} > ${r}`:i=`> ${o}`,i;const a=e.parentNode;if(a&&a.childNodes.length>1){const l=Ru(e)+1;i=`${o}:nth-child(${l})`}else i=o;return r&&(i+=` > ${r}`),t(e.parentNode,s,i)}return r}n.getSelector=t}(_t||(_t={})),function(n){function t(){return"g"}n.getPortContainerMarkup=t;function e(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=e;function s(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=s}(_t||(_t={})),function(n){function t(){return[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}]}n.getEdgeMarkup=t}(_t||(_t={})),function(n){function t(e=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:ee.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:ee.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:e?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=t}(_t||(_t={}));class sb{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let s,r,i,o;const a=[];return Object.keys(e).forEach(l=>{const u=e[l],h=this.getDefinition(l),f=X(On.isValidDefinition,this.view,h,u,{elem:t,attrs:e,cell:this.cell,view:this.view});if(h&&f)typeof h=="string"?(s==null&&(s={}),s[h]=u):u!==null&&a.push({name:l,definition:h});else{s==null&&(s={});const d=ay.includes(l)?l:jm(l);s[d]=u}}),a.forEach(({name:l,definition:u})=>{const h=e[l];typeof u.set=="function"&&(r==null&&(r={}),r[l]=h),typeof u.offset=="function"&&(i==null&&(i={}),i[l]=h),typeof u.position=="function"&&(o==null&&(o={}),o[l]=h)}),{raw:e,normal:s,set:r,offset:i,position:o}}mergeProcessedAttrs(t,e){t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const s=t.normal&&t.normal.transform;s!=null&&e.normal&&(e.normal.transform=s),t.normal=e.normal}findAttrs(t,e,s,r){const i=[],o=new Wu;return Object.keys(t).forEach(a=>{const l=t[a];if(!bn(l))return;const{isCSSSelector:u,elems:h}=pt.find(a,e,r);s[a]=h;for(let f=0,d=h.length;f<d;f+=1){const g=h[f],p=r&&r[a]===g,m=o.get(g);if(m){m.array||(i.push(g),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const y=m.attrs,b=m.priority;if(p)y.unshift(l),b.unshift(-1);else{const w=v2(b,u?-1:d);y.splice(w,0,l),b.splice(w,0,d)}}else o.set(g,{elem:g,attrs:l,priority:p?-1:d,array:!1})}}),i.forEach(a=>{const l=o.get(a),u=l.attrs;l.attrs=u.reduceRight((h,f)=>Gt(h,f),{})}),o}updateRelativeAttrs(t,e,s){const r=e.raw||{};let i=e.normal||{};const o=e.set,a=e.position,l=e.offset,u=()=>({elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:s.clone()});if(o!=null&&Object.keys(o).forEach(y=>{const b=o[y],w=this.getDefinition(y);if(w!=null){const x=X(w.set,this.view,b,u());typeof x=="object"?i=Object.assign(Object.assign({},i),x):x!=null&&(i[y]=x)}}),t instanceof HTMLElement){this.view.setAttrs(i,t);return}const h=i.transform,f=h?`${h}`:null,d=Zi(f),g=new O(d.e,d.f);h&&(delete i.transform,d.e=0,d.f=0);let p=!1;a!=null&&Object.keys(a).forEach(y=>{const b=a[y],w=this.getDefinition(y);if(w!=null){const x=X(w.position,this.view,b,u());x!=null&&(p=!0,g.translate(O.create(x)))}}),this.view.setAttrs(i,t);let m=!1;if(l!=null){const y=this.view.getBoundingRectOfElement(t);if(y.width>0&&y.height>0){const b=vt.transformRectangle(y,d);Object.keys(l).forEach(w=>{const x=l[w],v=this.getDefinition(w);if(v!=null){const S=X(v.offset,this.view,x,{elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:b});S!=null&&(m=!0,g.translate(O.create(S)))}})}}(h!=null||p||m)&&(g.round(1),d.e=g.x,d.f=g.y,t.setAttribute("transform",Br(d)))}update(t,e,s){const r={},i=this.findAttrs(s.attrs||e,t,r,s.selectors),o=s.attrs?this.findAttrs(e,t,r,s.selectors):i,a=[];i.each(h=>{const f=h.elem,d=h.attrs,g=this.processAttrs(f,d);if(g.set==null&&g.position==null&&g.offset==null)this.view.setAttrs(g.normal,f);else{const p=o.get(f),m=p?p.attrs:null,y=m&&d.ref==null?m.ref:d.ref;let b;if(y){if(b=(r[y]||this.view.find(y,t,s.selectors))[0],!b)throw new Error(`"${y}" reference does not exist.`)}else b=null;const w={node:f,refNode:b,attributes:m,processedAttributes:g},x=a.findIndex(v=>v.refNode===f);x>-1?a.splice(x,0,w):a.push(w)}});const l=new Wu;let u;a.forEach(h=>{const f=h.node,d=h.refNode;let g;const p=d!=null&&s.rotatableNode!=null&&Iu(s.rotatableNode,d);if(d&&(g=l.get(d)),!g){const b=p?s.rotatableNode:t;g=d?vt.getBBox(d,{target:b}):s.rootBBox,d&&l.set(d,g)}let m;s.attrs&&h.attributes?(m=this.processAttrs(f,h.attributes),this.mergeProcessedAttrs(m,h.processedAttributes)):m=h.processedAttributes;let y=g;p&&s.rotatableNode!=null&&!s.rotatableNode.contains(f)&&(u||(u=Zi(ut(s.rotatableNode,"transform"))),y=vt.transformRectangle(g,u)),this.updateRelativeAttrs(f,m,y)})}}class rb{get cell(){return this.view.cell}constructor(t,e,s=[]){this.view=t;const r={},i={};let o=0;Object.keys(e).forEach(l=>{let u=e[l];Array.isArray(u)||(u=[u]),u.forEach(h=>{let f=r[h];f||(o+=1,f=r[h]=1<<o),i[l]|=f})});let a=s;if(Array.isArray(a)||(a=[a]),a.forEach(l=>{r[l]||(o+=1,r[l]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=s}getFlag(t){const e=this.flags;return e==null?0:Array.isArray(t)?t.reduce((s,r)=>s|e[r],0):e[t]|0}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs&&Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t}}var nB=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},sB=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Ft extends pt{static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){const e=(u,h)=>h!=null?hg([...Array.isArray(u)?u:[u],...Array.isArray(h)?h:[h]]):Array.isArray(u)?[...u]:[u],s=Tt(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=t,l=sB(t,["bootstrap","actions","events","documentEvents"]);return r&&(s.bootstrap=e(s.bootstrap,r)),i&&Object.entries(i).forEach(([u,h])=>{const f=s.actions[u];h&&f?s.actions[u]=e(f,h):h&&(s.actions[u]=e(h))}),o&&(s.events=Object.assign(Object.assign({},s.events),o)),t.documentEvents&&(s.documentEvents=Object.assign(Object.assign({},s.documentEvents),a)),Gt(s,l)}get[Symbol.toStringTag](){return Ft.toStringTag}constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new sb(this),this.flag=new rb(this,this.options.actions,this.options.bootstrap),this.cache=new eB(this),this.setContainer(this.ensureContainer()),this.setup(),this.init()}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return pt.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,this.options.events!=null&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();e!=null&&this.setAttrs(e,t);const s=this.getContainerStyle();s!=null&&this.setStyle(s,t);const r=this.getContainerClassName();r!=null&&this.addClass(r,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,s,r){if(this.hasAction(t,e)){s();const i=[e];return r&&(typeof r=="string"?i.push(r):i.push(...r)),this.removeAction(t,i)}return t}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:t}){this.onAttrsChange(t)}onAttrsChange(t){let e=this.flag.getChangedFlag();t.updated||!e||(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,e,t))}parseJSONMarkup(t,e){const s=_t.parseJSONMarkup(t),r=s.selectors,i=this.rootSelector;if(e&&i){if(r[i])throw new Error("Invalid root selector");r[i]=e}return s}can(t){let e=this.graph.options.interacting;if(typeof e=="function"&&(e=X(e,this.graph,this)),typeof e=="object"){let s=e[t];return typeof s=="function"&&(s=X(s,this.graph,this)),s!==!1}return typeof e=="boolean"?e:!1}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),s=this.getMatrixOfElement(t),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return vt.transformRectangle(e,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),s=this.getMatrixOfElement(t),r=this.getRootTranslatedMatrix();return vt.transformRectangle(e,r.multiply(s))}getBBox(t={}){let e;if(t.useCellGeometry){const s=this.cell,r=s.isNode()?s.getAngle():0;e=s.getBBox().bbox(r)}else e=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return ne().translate(e.x,e.y)}getRootRotatedMatrix(){let t=ne();const e=this.cell,s=e.isNode()?e.getAngle():0;if(s){const r=e.getBBox(),i=r.width/2,o=r.height/2;t=t.translate(i,o).rotate(s).translate(-i,-o)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,s={}){s.rootBBox==null&&(s.rootBBox=new z),s.selectors==null&&(s.selectors=this.selectors),this.attr.update(t,e,s)}isEdgeElement(t){return this.cell.isEdge()&&(t==null||t===this.container)}prepareHighlight(t,e={}){const s=t||this.container;return e.partial=s===this.container,s}highlight(t,e={}){const s=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:s,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:s,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:s,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const s=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:s,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:s,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:s,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,s,r,i){const o=this.cell,a=this.findAttr("port",t),l=t.getAttribute("data-selector"),u={cell:o.id};return l!=null&&(u.magnet=l),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&l==null&&(u.selector=this.getSelector(t))):l==null&&this.container!==t&&(u.selector=this.getSelector(t)),u}getMagnetFromEdgeTerminal(t){const e=this.cell,s=this.container,r=t.port;let i=t.magnet,o;return r!=null&&e.isNode()&&e.hasPort(r)?o=this.findPortElem(r,i)||s:(i||(i=t.selector),!i&&r!=null&&(i=`[port="${r}"]`),o=this.findOne(i,s,this.selectors)),o}hasTools(t){const e=this.tools;return e==null?!1:t==null?!0:e.name===t}addTools(t){if(this.removeTools(),t){if(!this.can("toolsAddable"))return this;const e=Jt.isToolsView(t)?t:new Jt(t);this.tools=e,e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,s){const r=this,i=r.cell;return e==null||s==null?{e:t,view:r,cell:i}:{e:t,x:e,y:s,view:r,cell:i}}onClick(t,e,s){this.notify("cell:click",this.getEventArgs(t,e,s))}onDblClick(t,e,s){this.notify("cell:dblclick",this.getEventArgs(t,e,s))}onContextMenu(t,e,s){this.notify("cell:contextmenu",this.getEventArgs(t,e,s))}onMouseDown(t,e,s){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,s))}onMouseUp(t,e,s){this.notify("cell:mouseup",this.getEventArgs(t,e,s)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,s){this.notify("cell:mousemove",this.getEventArgs(t,e,s))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,s,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,s)))}onCustomEvent(t,e,s,r){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,s,r))),this.notify(e,Object.assign({},this.getEventArgs(t,s,r)))}onMagnetMouseDown(t,e,s,r){}onMagnetDblClick(t,e,s,r){}onMagnetContextMenu(t,e,s,r){}onLabelMouseDown(t,e,s){}checkMouseleave(t){const e=this.getEventTarget(t,{fromPoint:!0}),s=this.graph.findViewByElem(e);s!==this&&(this.onMouseLeave(t),s&&s.onMouseEnter(t))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}Ft.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},nB([Ft.dispose()],Ft.prototype,"dispose",null),function(n){n.Flag=rb,n.Attr=sb}(Ft||(Ft={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"}n.isCellView=t}(Ft||(Ft={})),function(n){function t(s){return function(r){r.config({priority:s})}}n.priority=t;function e(s){return function(r){r.config({bootstrap:s})}}n.bootstrap=e}(Ft||(Ft={})),function(n){n.registry=zt.create({type:"view"})}(Ft||(Ft={}));class Jt extends pt{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Jt.toStringTag}constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}createContainer(t,e){const s=t?pt.createElement("g",!0):pt.createElement("div",!1);return J(s,this.prefixClassName("cell-tools")),e.className&&J(s,e.className),s}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!Ft.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(J(this.svgContainer,this.prefixClassName("edge-tools")),J(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(J(this.svgContainer,this.prefixClassName("node-tools")),J(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const s=[];e.forEach(r=>{Jt.ToolItem.isToolItem(r)?r.name==="vertices"?s.unshift(r):s.push(r):(typeof r=="object"?r.name:r)==="vertices"?s.unshift(r):s.push(r)});for(let r=0;r<s.length;r+=1){const i=s[r];let o;if(Jt.ToolItem.isToolItem(i))o=i;else{const a=typeof i=="object"?i.name:i,l=typeof i=="object"?i.args||{}:{};if(a){if(this.cell.isNode()){const u=Wr.registry.get(a);if(u)o=new u(l);else return Wr.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=qr.registry.get(a);if(u)o=new u(l);else return qr.registry.onNotFound(a)}}}o&&(o.config(this.cellView,this),o.render(),(o.options.isSVGElement!==!1?this.svgContainer:this.htmlContainer).appendChild(o.container),this.tools.push(o))}return this}update(t={}){const e=this.tools;return e&&e.forEach(s=>{t.toolId!==s.cid&&s.isVisible()&&s.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(s=>{t===s?s.show():s.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(s=>{s!==t&&!s.isVisible()&&(s.show(),s.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(e=>e.remove()),this.tools=null),ze(this.svgContainer),ze(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const s=t.some(i=>i.options.isSVGElement!==!1),r=t.some(i=>i.options.isSVGElement===!1);s&&(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&r.graph!=null&&r.cell!=null&&typeof r.config=="function"&&typeof r.update=="function"&&typeof r.focus=="function"&&typeof r.blur=="function"&&typeof r.show=="function"&&typeof r.hide=="function"}n.isToolsView=t})(Jt||(Jt={})),function(n){class t extends pt{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return Gt(Tt(this.getDefaults()),s)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return t.toStringTag}constructor(s={}){super(),this.visible=!0,this.options=this.getOptions(s),this.container=pt.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),J(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&J(this.container,this.options.className),this.init()}init(){}getOptions(s){return this.constructor.getOptions(s)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(s,r){return this.cellView=s,this.parent=r,this.stamp(this.container),this.cell.isEdge()?J(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&J(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const s=this.options.markup;if(s){const r=_t.parseJSONMarkup(s);this.container.appendChild(r.fragment),this.childNodes=r.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(s){s&&s.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const s=this.options.focusOpacity;return s!=null&&Number.isFinite(s)&&(this.container.style.opacity=`${s}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(s){return this.graph==null||this.cellView==null?!0:this.graph.view.guard(s,this.cellView)}}t.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=t,function(e){let s=0;function r(o){return o?Pu(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Ou(r(o.name),this);return a.config(o),a}e.define=i}(t=n.ToolItem||(n.ToolItem={})),function(e){e.toStringTag=`X6.${e.name}`;function s(r){if(r==null)return!1;if(r instanceof e)return!0;const i=r[Symbol.toStringTag],o=r;return(i==null||i===e.toStringTag)&&o.graph!=null&&o.cell!=null&&typeof o.config=="function"&&typeof o.update=="function"&&typeof o.focus=="function"&&typeof o.blur=="function"&&typeof o.show=="function"&&typeof o.hide=="function"&&typeof o.isVisible=="function"}e.isToolItem=s}(t=n.ToolItem||(n.ToolItem={}))}(Jt||(Jt={}));const rB=n=>n;function ib(n,t){return t===0?"0%":`${Math.round(n/t*100)}%`}function ob(n){return(e,s,r,i)=>s.isEdgeElement(r)?oB(n,e,s,r,i):iB(n,e,s,r,i)}function iB(n,t,e,s,r){const i=e.cell,o=i.getAngle(),a=e.getUnrotatedBBoxOfElement(s),l=i.getBBox().getCenter(),u=O.create(r).rotate(o,l);let h=u.x-a.x,f=u.y-a.y;return n&&(h=ib(h,a.width),f=ib(f,a.height)),t.anchor={name:"topLeft",args:{dx:h,dy:f,rotate:!0}},t}function oB(n,t,e,s,r){const i=e.getConnection();if(!i)return t;const o=i.closestPointLength(r);if(n){const a=i.length();t.anchor={name:"ratio",args:{ratio:o/a}}}else t.anchor={name:"length",args:{length:o}};return t}const aB=ob(!0),lB=ob(!1),cB=Object.freeze(Object.defineProperty({__proto__:null,noop:rB,pinAbsolute:lB,pinRelative:aB},Symbol.toStringTag,{value:"Module"}));var eh;(function(n){n.presets=cB,n.registry=zt.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(eh||(eh={}));function ab(n,t,e,s){return X(eh.presets.pinRelative,this.graph,{},t,e,n,this.cell,s,{}).anchor}function lb(n,t){return t?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class Es extends Jt.ToolItem{onRender(){J(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const e=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Vr(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:s=0,y:r=0}=e;const{offset:i,useCellGeometry:o,rotate:a}=e;let l=lb(t,o);const u=t.cell.getAngle();a||(l=l.bbox(u));let h=0,f=0;typeof i=="number"?(h=i,f=i):typeof i=="object"&&(h=i.x,f=i.y),s=an(s,l.width),r=an(r,l.height);let d=ne().translate(l.x+l.width/2,l.y+l.height/2);return a&&(d=d.rotate(u)),d=d.translate(s+h-l.width/2,r+f-l.height/2),d}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:s=0,distance:r=0,rotate:i}=e;let o,a,l;const u=an(r,1);u>=0&&u<=1?o=t.getTangentAtRatio(u):o=t.getTangentAtLength(u),o?(a=o.start,l=o.vector().vectorAngle(new O(1,0))||0):(a=t.getConnection().start,l=0);let h=ne().translate(a.x,a.y).rotate(l);return typeof s=="object"?h=h.translate(s.x||0,s.y||0):h=h.translate(0,s),i||(h=h.rotate(-l)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;typeof e=="function"&&X(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(Es||(Es={})),function(n){n.Remove=n.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,useCellGeometry:!0,onClick({view:t,btn:e}){e.parent.remove(),t.cell.remove({ui:!0,toolId:e.cid})}})}(Es||(Es={}));var uB=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class tl extends Jt.ToolItem{onRender(){if(J(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,s=uB(t,["class"]);ut(this.container,Ji(s)),e&&J(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:s,rotate:r}=e,i=ds(e.padding);let o=lb(t,s).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const a=t.cell;if(a.isNode()){const l=a.getAngle();if(l)if(r){const u=a.getBBox().getCenter();Hu(this.container,l,u.x,u.y,{absolute:!0})}else o=o.bbox(l)}return ut(this.container,o.toJSON()),this}}(function(n){n.config({name:"boundary",tagName:"rect",padding:10,useCellGeometry:!0,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(tl||(tl={}));class ao extends Jt.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){return this.vertices.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}renderHandles(){const t=this.vertices;for(let e=0,s=t.length;e<s;e+=1){const r=t[e],i=this.options.createHandle,o=this.options.processHandle,a=i({index:e,graph:this.graph,guard:l=>this.guard(l),attrs:this.options.attrs||{}});o&&o(a),a.updatePosition(r.x,r.y),this.stamp(a.container),this.container.appendChild(a.container),this.handles.push(a),this.startHandleListening(a)}}updateHandles(){const t=this.vertices;for(let e=0,s=t.length;e<s;e+=1){const r=t[e],i=this.handles[e];i&&i.updatePosition(r.x,r.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,s=this.vertices,r=t>0?s[t-1]:e.sourceAnchor,i=t<s.length-1?s[t+1]:e.targetAnchor;return{prev:O.create(r),next:O.create(i)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:s,y:r}=this.graph.snapToGrid(e.clientX,e.clientY);return{e,x:s,y:r}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:s,x:r,y:i}=this.getMouseEventArgs(t);this.eventData(s,{start:{x:r,y:i}}),e.notifyMouseDown(s,r,i)}}onHandleChanging({handle:t,e}){const s=this.cellView,r=t.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(e),l={x:o,y:a};this.snapVertex(l,r),s.cell.setVertexAt(r,l,{ui:!0,toolId:this.cid}),t.updatePosition(l.x,l.y),this.options.stopPropagation||s.notifyMouseMove(i,o,a)}stopBatch(t){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),t&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e:t}){const e=this.options,s=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies){this.stopBatch(this.eventData(t).vertexAdded);return}s.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(t).vertexAdded);const{e:i,x:o,y:a}=this.getMouseEventArgs(t);if(!this.options.stopPropagation){s.notifyMouseUp(i,o,a);const{start:l}=this.eventData(i);if(l){const{x:u,y:h}=l;u===o&&h===a&&s.onClick(i,o,a)}}s.checkMouseleave(i),e.onChanged&&e.onChanged({edge:s.cell,edgeView:s})}snapVertex(t,e){const s=this.options.snapRadius||0;if(s>0){const r=this.getNeighborPoints(e),i=r.prev,o=r.next;Math.abs(t.x-i.x)<s?t.x=i.x:Math.abs(t.x-o.x)<s&&(t.x=o.x),Math.abs(t.y-i.y)<s?t.y=r.prev.y:Math.abs(t.y-o.y)<s&&(t.y=o.y)}}onHandleRemove({handle:t,e}){if(this.options.removable){const s=t.options.index,r=this.cellView;r.cell.removeVertexAt(s,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(e))}}allowAddVertex(t){const e=this.guard(t),s=this.options.addable&&this.cellView.can("vertexAddable"),r=this.options.modifiers?ms.isMatch(t,this.options.modifiers):!0;return!e&&s&&r}onPathMouseDown(t){const e=this.cellView;if(!this.allowAddVertex(t))return;t.stopPropagation(),t.preventDefault();const s=this.normalizeEvent(t),r=this.graph.snapToGrid(s.clientX,s.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=e.getVertexIndex(r.x,r.y);this.snapVertex(r,i),e.cell.insertVertex(r,i,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[i];this.eventData(s,{vertexAdded:!0}),o.onMouseDown(s)}onRemove(){this.resetHandles()}}(function(n){class t extends pt{get graph(){return this.options.graph}constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}render(){this.container=pt.createElement("circle",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(s,r){this.setAttrs({cx:s,cy:r})}onMouseDown(s){this.options.guard(s)||(s.stopPropagation(),s.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data),this.emit("change",{e:s,handle:this}))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(s){this.emit("remove",{e:s,handle:this})}}n.Handle=t})(ao||(ao={})),function(n){const t=Ue.prefix("edge-tool-vertex-path");n.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:e=>new n.Handle(e),markup:[{tagName:"path",selector:"connection",className:t,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${t}`]:"onPathMouseDown",[`touchstart .${t}`]:"onPathMouseDown"}})}(ao||(ao={}));class lo extends Jt.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){J(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.vertices];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let s=0,r=e.length;s<r-1;s+=1){const i=e[s],o=e[s+1],a=this.renderHandle(i,o,s);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(t,e,s){const r=this.options.createHandle({index:s,graph:this.graph,guard:i=>this.guard(i),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(r),this.updateHandle(r,t,e),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(e=>{this.stopHandleListening(e),e.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let s=0,r=e.length;s<r;s+=1)e[s].options.index+=t}resetAnchor(t,e){const s=this.cellView.cell,r={ui:!0,toolId:this.cid};e?s.prop([t,"anchor"],e,r):s.removeProp([t,"anchor"],r)}snapHandle(t,e,s){const r=t.options.axis,i=t.options.index,l=this.cellView.cell.getVertices(),u=l[i-2]||s.sourceAnchor,h=l[i+1]||s.targetAnchor,f=this.options.snapRadius;return Math.abs(e[r]-u[r])<f?e[r]=u[r]:Math.abs(e[r]-h[r])<f&&(e[r]=h[r]),e}onHandleChanging({handle:t,e}){const s=this.graph,r=this.options,i=this.cellView,o=r.anchor,a=t.options.axis,l=t.options.index-1,u=this.getEventData(e),h=this.normalizeEvent(e),f=s.snapToGrid(h.clientX,h.clientY),d=this.snapHandle(t,f.clone(),u),g=Tt(this.vertices);let p=g[l],m=g[l+1];const y=i.sourceView,b=i.sourceBBox;let w=!1,x=!1;if(p?l===0?b.containsPoint(p)?(g.shift(),this.shiftHandleIndexes(-1),w=!0):(p[a]=d[a],x=!0):p[a]=d[a]:(p=i.sourceAnchor.toJSON(),p[a]=d[a],b.containsPoint(p)?w=!0:(g.unshift(p),this.shiftHandleIndexes(1),x=!0)),typeof o=="function"&&y){if(w){const M=u.sourceAnchor.clone();M[a]=d[a];const T=X(o,i,M,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",T)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const v=i.targetView,S=i.targetBBox;let E=!1,C=!1;if(m?l===g.length-2?S.containsPoint(m)?(g.pop(),E=!0):(m[a]=d[a],C=!0):m[a]=d[a]:(m=i.targetAnchor.toJSON(),m[a]=d[a],S.containsPoint(m)?E=!0:(g.push(m),C=!0)),typeof o=="function"&&v){if(E){const M=u.targetAnchor.clone();M[a]=d[a];const T=X(o,i,M,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",T)}C&&this.resetAnchor("target",u.targetAnchorDef)}O.equalPoints(g,this.vertices)||this.cellView.cell.setVertices(g,{ui:!0,toolId:this.cid}),this.updateHandle(t,p,m,0),r.stopPropagation||i.notifyMouseMove(h,f.x,f.y)}onHandleChange({handle:t,e}){const s=this.options,r=this.handles,i=this.cellView,o=t.options.index;if(Array.isArray(r)){for(let a=0,l=r.length;a<l;a+=1)a!==o&&r[a].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:Tt(this.cell.prop(["source","anchor"])),targetAnchorDef:Tt(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!s.stopPropagation){const a=this.normalizeEvent(e),l=this.graph.snapToGrid(a.clientX,a.clientY);i.notifyMouseDown(a,l.x,l.y)}}}onHandleChanged({e:t}){const e=this.options,s=this.cellView;e.removeRedundancies&&s.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(t),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||s.notifyMouseUp(r,i.x,i.y),s.checkMouseleave(r),e.onChanged&&e.onChanged({edge:s.cell,edgeView:s})}updateHandle(t,e,s,r=0){const i=this.options.precision||0,o=Math.abs(e.x-s.x)<i,a=Math.abs(e.y-s.y)<i;if(o||a){const l=new W(e,s);if(l.length()<this.options.threshold)t.hide();else{const h=l.getCenter(),f=o?"x":"y";h[f]+=r||0;const d=l.vector().vectorAngle(new O(1,0));t.updatePosition(h.x,h.y,d,this.cellView),t.show(),t.options.axis=f}}else t.hide()}onRemove(){this.resetHandles()}}(function(n){class t extends pt{constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=pt.createElement("rect",!0);const s=this.options.attrs;if(typeof s=="function"){const r=n.getDefaults();this.setAttrs(Object.assign(Object.assign({},r.attrs),s(this)))}else this.setAttrs(s);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(s,r,i,o){const a=o.getClosestPoint(new O(s,r))||new O(s,r);let l=ne().translate(a.x,a.y);if(a.equals({x:s,y:r}))l=l.rotate(i);else{let h=new W(s,r,a.x,a.y).vector().vectorAngle(new O(1,0));h!==0&&(h+=90),l=l.rotate(h)}this.setAttrs({transform:Br(l),cursor:i%180===0?"row-resize":"col-resize"})}onMouseDown(s){this.options.guard(s)||(this.trigger("change",{e:s,handle:this}),s.stopPropagation(),s.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},s.data))}onMouseMove(s){this.emit("changing",{e:s,handle:this})}onMouseUp(s){this.emit("changed",{e:s,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}n.Handle=t})(lo||(lo={})),function(n){n.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:t=>new n.Handle(t),anchor:ab})}(lo||(lo={}));class el extends Jt.ToolItem{get type(){return this.options.type}onRender(){J(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const s=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(s),a=r.cell.prop([s,"anchor"]);e.setAttribute("transform",`translate(${o.x}, ${o.y})`);const l=a?i.customAnchorAttrs:i.defaultAnchorAttrs;l&&Object.keys(l).forEach(u=>{e.setAttribute(u,l[u])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const s=this.type,r=this.cellView,i=r.getTerminalView(s);if(i){const o=i.cell,a=r.getTerminalMagnet(s);let l=this.options.areaPadding||0;Number.isFinite(l)||(l=0);let u,h,f;i.isEdgeElement(a)?(u=i.getBBox(),h=0,f=u.getCenter()):(u=i.getUnrotatedBBoxOfElement(a),h=o.getAngle(),f=u.getCenter(),h&&f.rotate(-h,o.getBBox().getCenter())),u.inflate(l),ut(e,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${f.x}, ${f.y}) rotate(${h})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,s=this.cell;t?s.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):s.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,s=this.cellView,r=s.getTerminalView(e);if(r==null)return;const i=this.normalizeEvent(t),o=r.cell,a=s.getTerminalMagnet(e);let l=this.graph.coord.clientToLocalPoint(i.clientX,i.clientY);const u=this.options.snap;if(typeof u=="function"){const d=X(u,s,l,r,a,e,s,this);l=O.create(d)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const d=r.getClosestPoint(l);d&&(l=d)}else{const d=r.getUnrotatedBBoxOfElement(a),g=o.getAngle(),p=o.getBBox().getCenter(),m=l.clone().rotate(g,p);d.containsPoint(m)||(l=d.getNearestPointToPoint(m).rotate(-g,p))}let h;const f=this.options.anchor;typeof f=="function"&&(h=X(f,s,l,r,a,e,s,this)),this.resetAnchor(h),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(t===!0?void 0:t),this.update()}}(function(n){n.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:ab,snap(t,e,s,r,i,o){const a=o.options.snapRadius||0,l=r==="source",u=l?0:-1,h=this.cell.getVertexAt(u)||this.getTerminalAnchor(l?"target":"source");return h&&(Math.abs(h.x-t.x)<a&&(t.x=h.x),Math.abs(h.y-t.y)<a&&(t.y=h.y)),t}})})(el||(el={}));const hB=el.define({name:"source-anchor",type:"source"}),dB=el.define({name:"target-anchor",type:"target"});var fB=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class nl extends Jt.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,s=fB(t,["class"]);this.setAttrs(s,this.container),e&&J(this.container,e)}}onRender(){J(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,s=e.getTangentAtRatio(t),r=s?s.start:e.getPointAtRatio(t),i=s&&s.vector().vectorAngle(new O(1,0))||0;if(!r)return this;const o=ne().translate(r.x,r.y).rotate(i);return Vr(this.container,o,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const s=this.graph.snapToGrid(t.clientX,t.clientY),r=e.prepareArrowheadDragging(this.type,{x:s.x,y:s.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(t,r),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),s=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,s.x,s.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),s=this.cellView,r=this.graph.snapToGrid(e.clientX,e.clientY);s.onMouseUp(e,r.x,r.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",s.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(n){n.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(nl||(nl={}));const gB=nl.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),pB=nl.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Yr extends Jt.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const t=this.cellView;t&&t.on("cell:dblclick",this.dblClick)}createElement(){const t=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Jt.createElement("div",!1),this.addClass(t,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}removeElement(){this.undelegateDocumentEvents(),this.editor&&(this.container.removeChild(this.editor),this.editor=null)}updateEditor(){const{cell:t,editor:e}=this;if(!e)return;const{style:s}=e;t.isNode()?this.updateNodeEditorTransform():t.isEdge()&&this.updateEdgeEditorTransform();const{attrs:r}=this.options;s.fontSize=`${r.fontSize}px`,s.fontFamily=r.fontFamily,s.color=r.color,s.backgroundColor=r.backgroundColor;const i=this.getCellText()||"";return e.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:t,cell:e,editor:s}=this;if(!s)return;let r=O.create(),i=20,o="",{x:a,y:l}=this.options;const{width:u,height:h}=this.options;if(typeof a<"u"&&typeof l<"u"){const g=e.getBBox();a=an(a,g.width),l=an(l,g.height),r=g.topLeft.translate(a,l),i=g.width-a*2}else{const g=e.getBBox();r=g.center,i=g.width-4,o="translate(-50%, -50%)"}const f=t.scale(),{style:d}=s;r=t.localToGraph(r),d.left=`${r.x}px`,d.top=`${r.y}px`,d.transform=`scale(${f.sx}, ${f.sy}) ${o}`,d.minWidth=`${i}px`,typeof u=="number"&&(d.width=`${u}px`),typeof h=="number"&&(d.height=`${h}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:t,editor:e}=this;if(!e)return;let s=O.create(),r=20;const{style:i}=e,o=this.event.target,a=o.parentElement;if(a&&Sn(a,this.prefixClassName("edge-label"))){const h=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(h,10);const f=a.getAttribute("transform"),{translation:d}=Wa(f);s=new O(d.tx,d.ty),r=vt.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=t.clientToLocal(O.create(this.event.clientX,this.event.clientY));const f=this.cellView.path.closestPointLength(s);this.distance=f,this.labelIndex=-1}s=t.localToGraph(s);const u=t.scale();i.left=`${s.x}px`,i.top=`${s.y}px`,i.minWidth=`${r}px`,i.transform=`scale(${u.sx}, ${u.sy}) translate(-50%, -50%)`}onDocumentMouseUp(t){if(this.editor&&t.target!==this.editor){const e=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(e!==""?e:null),this.removeElement()}}onCellDblClick({e:t}){this.editor||(t.stopPropagation(),this.removeElement(),this.event=t,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}getCellText(){const{getText:t}=this.options;if(typeof t=="function")return X(t,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof t=="string"){if(this.cell.isNode())return this.cell.attr(t);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${t}`)}}setCellText(t){const e=this.options.setText;if(typeof e=="function"){X(e,this.cellView,{cell:this.cell,value:t,index:this.labelIndex,distance:this.distance});return}if(typeof e=="string"){if(this.cell.isNode()){t!==null&&this.cell.attr(e,t);return}if(this.cell.isEdge()){const s=this.cell;if(this.labelIndex===-1){if(t){const r={position:{distance:this.distance},attrs:{}};Rr(r,`attrs/${e}`,t),s.appendLabel(r)}}else t!==null?s.prop(`labels/${this.labelIndex}/attrs/${e}`,t):typeof this.labelIndex=="number"&&s.removeLabelAt(this.labelIndex)}}}onRemove(){const t=this.cellView;t&&t.off("cell:dblclick",this.dblClick),this.removeElement()}}(function(n){n.config({tagName:"div",isSVGElement:!1,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mouseup:"onDocumentMouseUp",touchend:"onDocumentMouseUp",touchcancel:"onDocumentMouseUp"}})})(Yr||(Yr={})),function(n){n.NodeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:"text/text",setText:"text/text"}),n.EdgeEditor=n.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText:"label/text",setText:"label/text"})}(Yr||(Yr={}));var cb=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e},Wr;(function(n){n.presets={boundary:tl,button:Es,"button-remove":Es.Remove,"node-editor":Yr.NodeEditor},n.registry=zt.create({type:"node tool",process(t,e){if(typeof e=="function")return e;let s=Jt.ToolItem;const{inherit:r}=e,i=cb(e,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=t),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(Wr||(Wr={}));var qr;(function(n){n.presets={boundary:tl,vertices:ao,segments:lo,button:Es,"button-remove":Es.Remove,"source-anchor":hB,"target-anchor":dB,"source-arrowhead":gB,"target-arrowhead":pB,"edge-editor":Yr.EdgeEditor},n.registry=zt.create({type:"edge tool",process(t,e){if(typeof e=="function")return e;let s=Jt.ToolItem;const{inherit:r}=e,i=cb(e,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=t),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(qr||(qr={}));const mB=Jn("center"),yB=Jn("topCenter"),bB=Jn("bottomCenter"),wB=Jn("leftMiddle"),xB=Jn("rightMiddle"),vB=Jn("topLeft"),CB=Jn("topRight"),SB=Jn("bottomLeft"),EB=Jn("bottomRight");function Jn(n){return function(t,e,s,r={}){const i=r.rotate?t.getUnrotatedBBoxOfElement(e):t.getBBoxOfElement(e),o=i[n];o.x+=an(r.dx,i.width),o.y+=an(r.dy,i.height);const a=t.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function sl(n){return function(t,e,s,r){if(s instanceof Element){const i=this.graph.findViewByElem(s);let o;if(i)if(i.isEdgeElement(s)){const a=r.fixedAt!=null?r.fixedAt:"50%";o=ub(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new O;return n.call(this,t,e,o,r)}return n.apply(this,arguments)}}function ub(n,t){const e=Yn(t),s=typeof t=="string"?parseFloat(t):t;return e?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const OB=sl(function(n,t,e,s){const r=gt.normalize(n.cell.getAngle()),i=n.getBBoxOfElement(t),o=i.getCenter(),a=i.getTopLeft(),l=i.getBottomRight();let u=s.padding;if(Number.isFinite(u)||(u=0),a.y+u<=e.y&&e.y<=l.y-u){const h=e.y-o.y;o.x+=r===0||r===180?0:h*1/Math.tan(gt.toRad(r)),o.y+=h}else if(a.x+u<=e.x&&e.x<=l.x-u){const h=e.x-o.x;o.y+=r===90||r===270?0:h*Math.tan(gt.toRad(r)),o.x+=h}return o}),MB=function(n,t,e,s,r){const i=n.cell.getConnectionPoint(this.cell,r);return(s.dx||s.dy)&&i.translate(s.dx||0,s.dy||0),i},PB=sl(function(n,t,e,s){let r,i=0,o;const a=n.cell;s.rotate?(r=n.getUnrotatedBBoxOfElement(t),o=a.getBBox().getCenter(),i=a.getAngle()):r=n.getBBoxOfElement(t);const l=s.padding;l!=null&&Number.isFinite(l)&&r.inflate(l),s.rotate&&e.rotate(i,o);const u=r.getNearestSideToPoint(e);let h;switch(u){case"left":h=r.getLeftMiddle();break;case"right":h=r.getRightMiddle();break;case"top":h=r.getTopCenter();break;case"bottom":h=r.getBottomCenter();break}const f=s.direction;return f==="H"?(u==="top"||u==="bottom")&&(e.x<=r.x+r.width?h=r.getLeftMiddle():h=r.getRightMiddle()):f==="V"&&(e.y<=r.y+r.height?h=r.getTopCenter():h=r.getBottomCenter()),s.rotate?h.rotate(-i,o):h}),AB=Object.freeze(Object.defineProperty({__proto__:null,bottom:bB,bottomLeft:SB,bottomRight:EB,center:mB,left:wB,midSide:PB,nodeCenter:MB,orth:OB,right:xB,top:yB,topLeft:vB,topRight:CB},Symbol.toStringTag,{value:"Module"}));var Jr;(function(n){n.presets=AB,n.registry=zt.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(Jr||(Jr={}));const TB=function(n,t,e,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},NB=function(n,t,e,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},hb=function(n,t,e,s){const r=n.getClosestPoint(e);return r??new O},_B=sl(hb),kB=sl(function(n,t,e,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new W(e.clone().translate(0,1e6),e.clone().translate(0,-1e6)),l=new W(e.clone().translate(1e6,0),e.clone().translate(-1e6,0)),u=a.intersect(i,{segmentSubdivisions:o}),h=l.intersect(i,{segmentSubdivisions:o}),f=[];return u&&f.push(...u),h&&f.push(...h),f.length>0?e.closest(f):s.fallbackAt!=null?ub(n,s.fallbackAt):X(hb,this,n,t,e,s)}),DB=Object.freeze(Object.defineProperty({__proto__:null,closest:_B,length:NB,orth:kB,ratio:TB},Symbol.toStringTag,{value:"Module"}));var Xr;(function(n){n.presets=DB,n.registry=zt.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(Xr||(Xr={}));function rl(n,t,e){let s;if(typeof e=="object"){if(Number.isFinite(e.y)){const i=new W(t,n),{start:o,end:a}=i.parallel(e.y);t=o,n=a}s=e.x}else s=e;if(s==null||!Number.isFinite(s))return n;const r=n.distance(t);return s===0&&r>0?n:n.move(t,-Math.min(s,r-1))}function il(n){const t=n.getAttribute("stroke-width");return t===null?0:parseFloat(t)||0}function RB(n){if(n==null)return null;let t=n;do{let e=t.tagName;if(typeof e!="string")return null;if(e=e.toUpperCase(),e==="G")t=t.firstElementChild;else if(e==="TITLE")t=t.nextElementSibling;else break}while(t);return t}const db=function(n,t,e,s){const r=t.getBBoxOfElement(e);s.stroked&&r.inflate(il(e)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return rl(o,n.start,s.offset)},IB=function(n,t,e,s,r){const i=t.cell,o=i.isNode()?i.getAngle():0;if(o===0)return X(db,this,n,t,e,s,r);const a=t.getUnrotatedBBoxOfElement(e);s.stroked&&a.inflate(il(e)/2);const l=a.getCenter(),u=n.clone().rotate(o,l),h=u.setLength(1e6).intersect(a),f=h&&h.length?u.start.closest(h).rotate(-o,l):n.end;return rl(f,n.start,s.offset)},LB=function(n,t,e,s){let r,i;const o=n.end,a=s.selector;if(typeof a=="string"?r=t.findOne(a):Array.isArray(a)?r=Mu(e,a):r=RB(e),!gs(r)){if(r===e||!gs(e))return o;r=e}const l=t.getShapeOfElement(r),u=t.getMatrixOfElement(r),h=t.getRootTranslatedMatrix(),f=t.getRootRotatedMatrix(),d=h.multiply(f).multiply(u),g=d.inverse(),p=vt.transformLine(n,g),m=p.start.clone(),y=t.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=l.bbox());const v=y.shapeBBox;if(v!=null&&v.containsPoint(m))return o}s.extrapolate===!0&&p.setLength(1e6);let b;if(Z.isPath(l)){const v=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=l.getSegmentSubdivisions({precision:v})),b={precision:v,segmentSubdivisions:y.segmentSubdivisions},i=p.intersect(l,b)}else i=p.intersect(l);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(z.isRectangle(l)?i=l.getNearestPointToPoint(m):un.isEllipse(l)?i=l.intersectsWithLineFromCenterToPoint(m):i=l.closestPoint(m,b));const w=i?vt.transformPoint(i,d):o;let x=s.offset||0;return s.stroked!==!1&&(typeof x=="object"?(x=Object.assign({},x),x.x==null&&(x.x=0),x.x+=il(r)/2):x+=il(r)/2),rl(w,n.start,x)};function BB(n,t,e=0){const{start:s,end:r}=n;let i,o,a,l;switch(t){case"left":l="x",i=r,o=s,a=-1;break;case"right":l="x",i=s,o=r,a=1;break;case"top":l="y",i=r,o=s,a=-1;break;case"bottom":l="y",i=s,o=r,a=1;break;default:return}s[l]<r[l]?i[l]=o[l]:o[l]=i[l],Number.isFinite(e)&&(i[l]+=a*e,o[l]+=a*e)}const VB=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,t,e,s){const{alignOffset:r,align:i}=s;return i&&BB(n,i,r),rl(n.end,n.start,s.offset)},bbox:db,boundary:LB,rect:IB},Symbol.toStringTag,{value:"Module"}));var Kr;(function(n){n.presets=VB,n.registry=zt.create({type:"connection point"}),n.registry.register(n.presets,!0)})(Kr||(Kr={}));const jB=function(n){return[...n]},$B=function(n,t,e){const s=t.side||"bottom",r=ds(t.padding||40),i=e.sourceBBox,o=e.targetBBox,a=i.getCenter(),l=o.getCenter();let u,h,f;switch(s){case"top":f=-1,u="y",h="height";break;case"left":f=-1,u="x",h="width";break;case"right":f=1,u="x",h="width";break;case"bottom":default:f=1,u="y",h="height";break}return a[u]+=f*(i[h]/2+r[s]),l[u]+=f*(o[h]/2+r[s]),f*(a[u]-l[u])>0?l[u]=a[u]:a[u]=l[u],[a.toJSON(),...n,l.toJSON()]};function ol(n){return new z(n.x,n.y,0,0)}function al(n={}){const t=ds(n.padding||20);return{x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}function fb(n,t={}){return n.sourceBBox.clone().moveAndExpand(al(t))}function gb(n,t={}){return n.targetBBox.clone().moveAndExpand(al(t))}function zB(n,t={}){return n.sourceAnchor?n.sourceAnchor:fb(n,t).getCenter()}function FB(n,t={}){return n.targetAnchor?n.targetAnchor:gb(n,t).getCenter()}const pb=function(n,t,e){let s=fb(e,t),r=gb(e,t);const i=zB(e,t),o=FB(e,t);s=s.union(ol(i)),r=r.union(ol(o));const a=n.map(h=>O.create(h));a.unshift(i),a.push(o);let l=null;const u=[];for(let h=0,f=a.length-1;h<f;h+=1){let d=null;const g=a[h],p=a[h+1],m=Ge.getBearing(g,p)!=null;if(h===0)h+1===f?s.intersectsWithRect(r.clone().inflate(1))?d=Ge.insideNode(g,p,s,r):m||(d=Ge.nodeToNode(g,p,s,r)):s.containsPoint(p)?d=Ge.insideNode(g,p,s,ol(p).moveAndExpand(al(t))):m||(d=Ge.nodeToVertex(g,p,s));else if(h+1===f){const y=m&&Ge.getBearing(p,g)===l;r.containsPoint(g)||y?d=Ge.insideNode(g,p,ol(g).moveAndExpand(al(t)),r,l):m||(d=Ge.vertexToNode(g,p,r,l))}else m||(d=Ge.vertexToVertex(g,p,l));d?(u.push(...d.points),l=d.direction):l=Ge.getBearing(g,p),h+1<f&&u.push(p)}return u};var Ge;(function(n){const t={N:"S",S:"N",E:"W",W:"E"},e={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function s(f,d,g){let p=new O(f.x,d.y);return g.containsPoint(p)&&(p=new O(d.x,f.y)),p}function r(f,d){return f[d==="W"||d==="E"?"width":"height"]}n.getBBoxSize=r;function i(f,d){return f.x===d.x?f.y>d.y?"N":"S":f.y===d.y?f.x>d.x?"W":"E":null}n.getBearing=i;function o(f,d,g){const p=new O(f.x,d.y),m=new O(d.x,f.y),y=i(f,p),b=i(f,m),w=g?t[g]:null,x=y===g||y!==w&&(b===w||b!==g)?p:m;return{points:[x],direction:i(x,d)}}n.vertexToVertex=o;function a(f,d,g){const p=s(f,d,g);return{points:[p],direction:i(p,d)}}n.nodeToVertex=a;function l(f,d,g,p){const m=[new O(f.x,d.y),new O(d.x,f.y)],y=m.filter(x=>!g.containsPoint(x)),b=y.filter(x=>i(x,f)!==p);let w;if(b.length>0)return w=b.filter(x=>i(f,x)===p).pop(),w=w||b[0],{points:[w],direction:i(w,d)};{w=UP(m,y)[0];const x=O.create(d).move(w,-r(g,p)/2);return{points:[s(x,f,g),x],direction:i(x,d)}}}n.vertexToNode=l;function u(f,d,g,p){let m=a(d,f,p);const y=m.points[0];if(g.containsPoint(y)){m=a(f,d,g);const b=m.points[0];if(p.containsPoint(b)){const w=O.create(f).move(b,-r(g,i(f,b))/2),x=O.create(d).move(y,-r(p,i(d,y))/2),v=new W(w,x).getCenter(),S=a(f,v,g),E=o(v,d,S.direction);m.points=[S.points[0],E.points[0]],m.direction=E.direction}}return m}n.nodeToNode=u;function h(f,d,g,p,m){const y=g.union(p).inflate(1),b=y.getCenter(),w=b.distance(d)>b.distance(f),x=w?d:f,v=w?f:d;let S,E,C;m?(S=O.fromPolar(y.width+y.height,e[m],x),S=y.getNearestPointToPoint(S).move(S,-1)):S=y.getNearestPointToPoint(x).move(x,1),E=s(S,v,y);let M;S.round().equals(E.round())?(E=O.fromPolar(y.width+y.height,gt.toRad(S.theta(x))+Math.PI/2,v),E=y.getNearestPointToPoint(E).move(v,1).round(),C=s(S,E,y),M=w?[E,C,S]:[S,C,E]):M=w?[E,S]:[S,E];const T=i(w?S:E,d);return{points:M,direction:T}}n.insideNode=h})(Ge||(Ge={}));const HB={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeNodes:[],excludeShapes:[],startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){return Os(this.step,this)},directions(){const n=Os(this.step,this),t=Os(this.cost,this);return[{cost:t,offsetX:n,offsetY:0},{cost:t,offsetX:-n,offsetY:0},{cost:t,offsetX:0,offsetY:n},{cost:t,offsetX:0,offsetY:-n}]},penalties(){const n=Os(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=Os(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:pb,draggingRouter:null,snapToGrid:!0};function Os(n,t){return typeof n=="function"?n.call(t):n}function UB(n){const t=Object.keys(n).reduce((e,s)=>{const r=e;return s==="fallbackRouter"||s==="draggingRouter"||s==="fallbackRoute"?r[s]=n[s]:r[s]=Os(n[s],n),e},{});if(t.padding){const e=ds(t.padding);t.paddingBox={x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}return t.directions.forEach(e=>{const s=new O(0,0),r=new O(e.offsetX,e.offsetY);e.angle=gt.normalize(s.theta(r))}),t}const mb=1,yb=2;class GB{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=mb,this.values[t]=e;const s=C2(this.items,t,r=>this.values[r]);this.items.splice(s,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=yb),t}isOpen(t){return this.hash[t]===mb}isClose(t){return this.hash[t]===yb}isEmpty(){return this.items.length===0}}class YB{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const s=this.options,r=s.excludeTerminals.reduce((u,h)=>{const f=e[h];if(f){const d=t.getCell(f.cell);d&&u.push(d)}return u},[]);let i=[];const o=t.getCell(e.getSourceCellId());o&&(i=ug(i,o.getAncestors().map(u=>u.id)));const a=t.getCell(e.getTargetCellId());a&&(i=ug(i,a.getAncestors().map(u=>u.id)));const l=this.mapGridSize;return t.getNodes().reduce((u,h)=>{const f=r.some(y=>y.id===h.id),d=h.shape?s.excludeShapes.includes(h.shape):!1,g=s.excludeNodes.some(y=>typeof y=="string"?h.id===y:y===h),p=i.includes(h.id),m=d||f||g||p;if(h.isVisible()&&!m){const y=h.getBBox().moveAndExpand(s.paddingBox),b=y.getOrigin().snapToGrid(l),w=y.getCorner().snapToGrid(l);for(let x=b.x;x<=w.x;x+=l)for(let v=b.y;v<=w.y;v+=l){const S=new O(x,v).toString();u[S]==null&&(u[S]=[]),u[S].push(y)}}return u},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),s=this.map[e];return s?s.every(r=>!r.containsPoint(t)):!0}}function bb(n,t){const e=n.sourceBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function wb(n,t){const e=n.targetBBox.clone();return t&&t.paddingBox?e.moveAndExpand(t.paddingBox):e}function xb(n,t){return n.sourceAnchor?n.sourceAnchor:bb(n,t).getCenter()}function WB(n,t){return n.targetAnchor?n.targetAnchor:wb(n,t).getCenter()}function nh(n,t,e,s,r){const i=360/e,o=n.theta(qB(n,t,s,r)),a=gt.normalize(o+i/2);return i*Math.floor(a/i)}function qB(n,t,e,s){const r=s.step,i=t.x-n.x,o=t.y-n.y,a=i/e.x,l=o/e.y,u=a*r,h=l*r;return new O(n.x+u,n.y+h)}function vb(n,t){const e=Math.abs(n-t);return e>180?360-e:e}function JB(n,t){const e=t.step;return t.directions.forEach(s=>{s.gridOffsetX=s.offsetX/e*n.x,s.gridOffsetY=s.offsetY/e*n.y}),t.directions}function XB(n,t,e){return{source:t.clone(),x:Cb(e.x-t.x,n),y:Cb(e.y-t.y,n)}}function Cb(n,t){if(!n)return t;const e=Math.abs(n),s=Math.round(e/t);if(!s)return e;const r=s*t,o=(e-r)/s;return t+o}function KB(n,t){const e=t.source,s=wt.snapToGrid(n.x-e.x,t.x)+e.x,r=wt.snapToGrid(n.y-e.y,t.y)+e.y;return new O(s,r)}function co(n,t){return n.round(t)}function ll(n,t,e){return co(KB(n.clone(),t),e)}function uo(n){return n.toString()}function sh(n){return new O(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function Sb(n,t){let e=1/0;for(let s=0,r=t.length;s<r;s+=1){const i=n.manhattanDistance(t[s]);i<e&&(e=i)}return e}function Eb(n,t,e,s,r){const i=r.precision,o=r.directionMap,a=n.diff(t.getCenter()),l=Object.keys(o).reduce((u,h)=>{if(e.includes(h)){const f=o[h],d=new O(n.x+f.x*(Math.abs(a.x)+t.width),n.y+f.y*(Math.abs(a.y)+t.height)),p=new W(n,d).intersect(t)||[];let m,y=null;for(let b=0;b<p.length;b+=1){const w=p[b],x=n.squaredDistance(w);(m==null||x>m)&&(m=x,y=w)}if(y){let b=ll(y,s,i);t.containsPoint(b)&&(b=ll(b.translate(f.x*s.x,f.y*s.y),s,i)),u.push(b)}}return u},[]);return t.containsPoint(n)||l.push(ll(n,s,i)),l}function ZB(n,t,e,s,r){const i=[];let o=sh(r.diff(e)),a=uo(e),l=n[a],u;for(;l;){u=t[a];const d=sh(u.diff(l));d.equals(o)||(i.unshift(u),o=d),a=uo(l),l=n[a]}const h=t[a];return sh(h.diff(s)).equals(o)||i.unshift(h),i}function QB(n,t,e,s,r){const i=r.precision;let o,a;z.isRectangle(t)?o=co(xb(n,r).clone(),i):o=co(t.clone(),i),z.isRectangle(e)?a=co(WB(n,r).clone(),i):a=co(e.clone(),i);const l=XB(r.step,o,a),u=o,h=a;let f,d;if(z.isRectangle(t)?f=Eb(u,t,r.startDirections,l,r):f=[u],z.isRectangle(e)?d=Eb(a,e,r.endDirections,l,r):d=[h],f=f.filter(g=>s.isAccessible(g)),d=d.filter(g=>s.isAccessible(g)),f.length>0&&d.length>0){const g=new GB,p={},m={},y={};for(let _=0,N=f.length;_<N;_+=1){const k=f[_],R=uo(k);g.add(R,Sb(k,d)),p[R]=k,y[R]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,v;const S=JB(l,r),E=S.length,C=d.reduce((_,N)=>{const k=uo(N);return _.push(k),_},[]),M=O.equalPoints(f,d);let T=r.maxLoopCount;for(;!g.isEmpty()&&T>0;){const _=g.pop(),N=p[_],k=m[_],R=y[_],I=N.equals(u),A=k==null;let P;if(A?w?I?P=null:P=nh(u,N,E,l,r):P=b:P=nh(k,N,E,l,r),!(A&&M)&&C.indexOf(_)>=0)return r.previousDirectionAngle=P,ZB(m,p,N,u,h);for(let j=0;j<E;j+=1){x=S[j];const Y=x.angle;if(v=vb(P,Y),!(w&&I)&&v>r.maxDirectionChange)continue;const ot=ll(N.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),l,i),F=uo(ot);if(g.isClose(F)||!s.isAccessible(ot))continue;if(C.indexOf(F)>=0&&!ot.equals(h)){const rt=nh(ot,h,E,l,r);if(vb(Y,rt)>r.maxDirectionChange)continue}const H=x.cost,V=I?0:r.penalties[v],K=R+H+V;(!g.isOpen(F)||K<y[F])&&(p[F]=ot,m[F]=N,y[F]=K,g.add(F,K+Sb(ot,d)))}T-=1}}return r.fallbackRoute?X(r.fallbackRoute,this,u,h,r):null}function tV(n,t=10){if(n.length<=1)return n;for(let e=0,s=n.length;e<s-1;e+=1){const r=n[e],i=n[e+1];if(r.x===i.x){const o=t*Math.round(r.x/t);r.x!==o&&(r.x=o,i.x=o)}else if(r.y===i.y){const o=t*Math.round(r.y/t);r.y!==o&&(r.y=o,i.y=o)}}return n}const eV=function(n,t,e){const s=UB(t),r=bb(e,s),i=wb(e,s),o=xb(e,s),a=new YB(s).build(e.graph.model,e.cell),l=n.map(g=>O.create(g)),u=[];let h=o,f,d;for(let g=0,p=l.length;g<=p;g+=1){let m=null;if(f=d||r,d=l[g],d==null){d=i;const b=e.cell;if((b.getSourceCellId()==null||b.getTargetCellId()==null)&&typeof s.draggingRouter=="function"){const x=f===r?o:f,v=d.getOrigin();m=X(s.draggingRouter,e,x,v,s)}}if(m==null&&(m=QB(e,f,d,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),X(s.fallbackRouter,this,n,s,e);const y=m[0];y&&y.equals(h)&&m.shift(),h=m[m.length-1]||h,u.push(...m)}return s.snapToGrid?tV(u,e.graph.grid.getGridSize()):u},Ob=function(n,t,e){return X(eV,this,n,Object.assign(Object.assign({},HB),t),e)},nV={maxDirectionChange:45,directions(){const n=Os(this.step,this),t=Os(this.cost,this),e=Math.ceil(Math.sqrt(n*n<<1));return[{cost:t,offsetX:n,offsetY:0},{cost:e,offsetX:n,offsetY:n},{cost:t,offsetX:0,offsetY:n},{cost:e,offsetX:-n,offsetY:n},{cost:t,offsetX:-n,offsetY:0},{cost:e,offsetX:-n,offsetY:-n},{cost:t,offsetX:0,offsetY:-n},{cost:e,offsetX:n,offsetY:-n}]},fallbackRoute(n,t,e){const s=n.theta(t),r=[];let i={x:t.x,y:n.y},o={x:n.x,y:t.y};if(s%180>90){const x=i;i=o,o=x}const a=s%90<45?i:o,l=new W(n,a),u=90*Math.ceil(s/90),h=O.fromPolar(l.squaredLength(),gt.toRad(u+135),a),f=new W(t,h),d=l.intersectsWithLine(f),g=d||t,p=d?g:n,m=360/e.directions.length,y=p.theta(t),b=gt.normalize(y+m/2),w=m*Math.floor(b/m);return e.previousDirectionAngle=w,g&&r.push(g.round()),r.push(t),r}},sV=function(n,t,e){return X(Ob,this,n,Object.assign(Object.assign({},nV),t),e)},rV=function(n,t,e){const s=t.offset||32,r=t.min==null?16:t.min;let i=0,o=t.direction;const a=e.sourceBBox,l=e.targetBBox,u=a.getCenter(),h=l.getCenter();if(typeof s=="number"&&(i=s),o==null){let b=l.left-a.right,w=l.top-a.bottom;b>=0&&w>=0?o=b>=w?"L":"T":b<=0&&w>=0?(b=a.left-l.right,b>=0?o=b>=w?"R":"T":o="T"):b>=0&&w<=0?(w=a.top-l.bottom,w>=0?o=b>=w?"L":"B":o="L"):(b=a.left-l.right,w=a.top-l.bottom,b>=0&&w>=0?o=b>=w?"R":"B":b<=0&&w>=0?o="B":b>=0&&w<=0?o="R":o=Math.abs(b)>Math.abs(w)?"R":"B")}o==="H"?o=h.x-u.x>=0?"L":"R":o==="V"&&(o=h.y-u.y>=0?"T":"B"),s==="center"&&(o==="L"?i=(l.left-a.right)/2:o==="R"?i=(a.left-l.right)/2:o==="T"?i=(l.top-a.bottom)/2:o==="B"&&(i=(a.top-l.bottom)/2));let f,d,g;const p=o==="L"||o==="R";if(p){if(h.y===u.y)return[...n];g=o==="L"?1:-1,f="x",d="width"}else{if(h.x===u.x)return[...n];g=o==="T"?1:-1,f="y",d="height"}const m=u.clone(),y=h.clone();if(m[f]+=g*(a[d]/2+i),y[f]-=g*(l[d]/2+i),p){const b=m.x,w=y.x,x=a.width/2+r,v=l.width/2+r;h.x>u.x?w<=b&&(m.x=Math.max(w,u.x+x),y.x=Math.min(b,h.x-v)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,h.x+v))}else{const b=m.y,w=y.y,x=a.height/2+r,v=l.height/2+r;h.y>u.y?w<=b&&(m.y=Math.max(w,u.y+x),y.y=Math.min(b,h.y-v)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,h.y+v))}return[m.toJSON(),...n,y.toJSON()]};function Zr(n,t){if(t!=null&&t!==!1){const e=typeof t=="boolean"?0:t;if(e>0){const s=O.create(n[1]).move(n[2],e),r=O.create(n[1]).move(n[0],e);return[s.toJSON(),...n,r.toJSON()]}{const s=n[1];return[Object.assign({},s),...n,Object.assign({},s)]}}return n}const iV=Object.freeze(Object.defineProperty({__proto__:null,er:rV,loop:function(n,t,e){const s=t.width||50,i=(t.height||80)/2,o=t.angle||"auto",a=e.sourceAnchor,l=e.targetAnchor,u=e.sourceBBox,h=e.targetBBox;if(a.equals(l)){const f=b=>{const w=gt.toRad(b),x=Math.sin(w),v=Math.cos(w),S=new O(a.x+v*s,a.y+x*s),E=new O(S.x-v*i,S.y-x*i),C=E.clone().rotate(-90,S),M=E.clone().rotate(90,S);return[C.toJSON(),S.toJSON(),M.toJSON()]},d=b=>{const w=a.clone().move(b,-1),x=new W(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},g=[0,90,180,270,45,135,225,315];if(typeof o=="number")return Zr(f(o),t.merge);const p=u.getCenter();if(p.equals(a))return Zr(f(0),t.merge);const m=p.angleBetween(a,p.clone().translate(1,0));let y=f(m);if(d(y[1]))return Zr(y,t.merge);for(let b=1,w=g.length;b<w;b+=1)if(y=f(m+g[b]),d(y[1]))return Zr(y,t.merge);return Zr(y,t.merge)}{const f=new W(a,l);let d=f.parallel(-s),g=d.getCenter(),p=d.start.clone().move(d.end,i),m=d.end.clone().move(d.start,i);const y=f.parallel(-1),b=new W(y.start,g),w=new W(y.end,g);if((u.containsPoint(g)||h.containsPoint(g)||u.intersectsWithLine(b)||u.intersectsWithLine(w)||h.intersectsWithLine(b)||h.intersectsWithLine(w))&&(d=f.parallel(s),g=d.getCenter(),p=d.start.clone().move(d.end,i),m=d.end.clone().move(d.start,i)),t.merge){const x=new W(a,l),v=new W(g,x.center).setLength(Number.MAX_SAFE_INTEGER),S=u.intersectsWithLine(v),E=h.intersectsWithLine(v),C=S?Array.isArray(S)?S:[S]:[];E&&(Array.isArray(E)?C.push(...E):C.push(E));const M=x.center.closest(C);M?(e.sourceAnchor=M.clone(),e.targetAnchor=M.clone()):(e.sourceAnchor=x.center.clone(),e.targetAnchor=x.center.clone())}return Zr([p.toJSON(),g.toJSON(),m.toJSON()],t.merge)}},manhattan:Ob,metro:sV,normal:jB,oneSide:$B,orth:pb},Symbol.toStringTag,{value:"Module"}));var Ms;(function(n){n.presets=iV,n.registry=zt.create({type:"router"}),n.registry.register(n.presets,!0)})(Ms||(Ms={}));const oV=function(n,t,e,s={}){const r=[n,...e,t],i=new $t(r),o=new Z(i);return s.raw?o:o.serialize()},aV=function(n,t,e,s={}){const r=e.length===3?0:1,i=O.create(e[0+r]),o=O.create(e[2+r]),a=O.create(e[1+r]);if(!O.equals(n,t)){const u=new O((n.x+t.x)/2,(n.y+t.y)/2),h=u.angleBetween(O.create(n).rotate(90,u),a);h>1&&(i.rotate(180-h,u),o.rotate(180-h,u),a.rotate(180-h,u))}const l=`
|
|
117
117
|
M ${n.x} ${n.y}
|
|
118
118
|
Q ${i.x} ${i.y} ${a.x} ${a.y}
|
|
119
119
|
Q ${o.x} ${o.y} ${t.x} ${t.y}
|
|
120
|
-
`;return s.raw?Z.parse(l):l},aV=function(n,t,e,s={}){const r=new Z;r.appendSegment(Z.createSegment("M",n));const i=1/3,o=2/3,a=s.radius||10;let l,u;for(let h=0,f=e.length;h<f;h+=1){const d=O.create(e[h]),g=e[h-1]||n,p=e[h+1]||t;l=u||d.distance(g)/2,u=d.distance(p)/2;const m=-Math.min(a,l),y=-Math.min(a,u),b=d.clone().move(g,m).round(),w=d.clone().move(p,y).round(),x=new O(i*b.x+o*d.x,o*d.y+i*b.y),v=new O(i*w.x+o*d.x,o*d.y+i*w.y);r.appendSegment(Z.createSegment("L",b)),r.appendSegment(Z.createSegment("C",x,v,w))}return r.appendSegment(Z.createSegment("L",t)),s.raw?r:r.serialize()},lV=function(n,t,e,s={}){let r,i=s.direction;if(e&&e.length!==0){const o=[n,...e,t],a=Vt.throughPoints(o);r=new Z(a)}else if(r=new Z,r.appendSegment(Z.createSegment("M",n)),i||(i=Math.abs(n.x-t.x)>=Math.abs(n.y-t.y)?"H":"V"),i==="H"){const o=(n.x+t.x)/2;r.appendSegment(Z.createSegment("C",o,n.y,o,t.y,t.x,t.y))}else{const o=(n.y+t.y)/2;r.appendSegment(Z.createSegment("C",n.x,o,t.x,o,t.x,t.y))}return s.raw?r:r.serialize()},Mb=1,ul=1/3,hl=2/3;function cV(n){let t=n.graph._jumpOverUpdateList;if(t==null&&(t=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const e=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let s=0;s<e.length;s+=1)e[s].update()})}),n.graph.on("model:reseted",()=>{t=n.graph._jumpOverUpdateList=[]})),t.indexOf(n)<0){t.push(n);const e=()=>t.splice(t.indexOf(n),1);n.cell.once("change:connector",e),n.cell.once("removed",e)}}function rh(n,t,e=[]){const s=[n,...e,t],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new W(i,a))}),r}function uV(n,t){const e=[];return t.forEach(s=>{const r=n.intersectsWithLine(s);r&&e.push(r)}),e}function Pb(n,t){return new W(n,t).squaredLength()}function hV(n,t,e){return t.reduce((s,r,i)=>{if(dl.includes(r))return s;const o=s.pop()||n,a=O.create(r).move(o.start,-e);let l=O.create(r).move(o.start,+e);const u=t[i+1];if(u!=null){const d=l.distance(u);d<=e&&(l=u.move(o.start,d),dl.push(u))}else if(a.distance(o.end)<e*2+Mb)return s.push(o),s;if(l.distance(o.start)<e*2+Mb)return s.push(o),s;const f=new W(a,l);return ho.push(f),s.push(new W(o.start,a),f,new W(l,o.end)),s},[])}function Ab(n,t,e,s){const r=new Z;let i;return i=Z.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(ho.includes(o)){let l,u,h,f;if(e==="arc"){l=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(l+=180);const g=o.getCenter(),p=new W(g,o.end).rotate(l,g);let m;m=new W(o.start,g),h=m.pointAt(2/3).rotate(l,o.start),f=p.pointAt(1/3).rotate(-l,p.end),i=Z.createSegment("C",h,f,p.end),r.appendSegment(i),m=new W(g,o.end),h=p.pointAt(1/3).rotate(l,p.end),f=m.pointAt(1/3).rotate(-l,o.end),i=Z.createSegment("C",h,f,o.end),r.appendSegment(i)}else if(e==="gap")i=Z.createSegment("M",o.end),r.appendSegment(i);else if(e==="cubic"){l=o.start.theta(o.end);const d=t*.6;let g=t*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(g*=-1),h=new O(o.start.x+d,o.start.y+g).rotate(l,o.start),f=new O(o.end.x-d,o.end.y+g).rotate(l,o.end),i=Z.createSegment("C",h,f,o.end),r.appendSegment(i)}}else{const l=n[a+1];s===0||!l||ho.includes(l)?(i=Z.createSegment("L",o.end),r.appendSegment(i)):dV(s,r,o.end,o.start,l.end)}}),r}function dV(n,t,e,s,r){const i=e.distance(s)/2,o=e.distance(r)/2,a=-Math.min(n,i),l=-Math.min(n,o),u=e.clone().move(s,a).round(),h=e.clone().move(r,l).round(),f=new O(ul*u.x+hl*e.x,hl*e.y+ul*u.y),d=new O(ul*h.x+hl*e.x,hl*e.y+ul*h.y);let g;g=Z.createSegment("L",u),t.appendSegment(g),g=Z.createSegment("C",f,d,h),t.appendSegment(g)}let ho,dl;const fV=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,t,e,s={}){ho=[],dl=[],cV(this);const r=s.size||5,i=s.type||"arc",o=s.radius||0,a=s.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return Ab(rh(n,t,e),r,i,o);const f=this.cell,d=h.indexOf(f),g=l.options.connecting.connector||{},p=h.filter((v,S)=>{const E=v.getConnector()||g;return a.includes(E.name)?!1:S>d?E.name!=="jumpover":!0}),m=p.map(v=>l.findViewByCell(v)),y=rh(n,t,e),b=m.map(v=>v==null?[]:v===this?y:rh(v.sourcePoint,v.targetPoint,v.routePoints)),w=[];y.forEach(v=>{const S=p.reduce((E,C,M)=>{if(C!==f){const T=uV(v,b[M]);E.push(...T)}return E},[]).sort((E,C)=>Pb(v.start,E)-Pb(v.start,C));S.length>0?w.push(...hV(v,S,r)):w.push(v)});const x=Ab(w,r,i,o);return ho=[],dl=[],s.raw?x:x.serialize()},loop:oV,normal:iV,rounded:aV,smooth:lV},Symbol.toStringTag,{value:"Module"}));var tr;(function(n){n.presets=fV,n.registry=Ft.create({type:"connector"}),n.registry.register(n.presets,!0)})(tr||(tr={}));var gV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Tb extends Nt{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(Tt(t)),this.changed={}}mutate(t,e={}){const s=e.unset===!0,r=e.silent===!0,i=[],o=this.changing;this.changing=!0,o||(this.previous=Tt(this.data),this.changed={});const a=this.data,l=this.previous,u=this.changed;if(Object.keys(t).forEach(h=>{const f=h,d=t[f];wn(a[f],d)||i.push(f),wn(l[f],d)?delete u[f]:u[f]=d,s?delete a[f]:a[f]=d}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=e,i.forEach(h=>{this.emit("change:*",{key:h,options:e,store:this,current:a[h],previous:l[h]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(t==null)return this.data;const s=this.data[t];return s??e}getPrevious(t){if(this.previous){const e=this.previous[t];return e??void 0}}set(t,e,s){return t!=null&&(typeof t=="object"?this.mutate(t,e):this.mutate({[t]:e},s)),this}remove(t,e){const r={};let i;if(typeof t=="string")r[t]=void 0,i=e;else if(Array.isArray(t))t.forEach(o=>r[o]=void 0),i=e;else{for(const o in this.data)r[o]=void 0;i=t}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(t){return Mu(this.data,t,"/")}setByPath(t,e,s={}){const r="/",i=Array.isArray(t)?[...t]:t.split(r),o=Array.isArray(t)?t.join(r):t,a=i[0],l=i.length;if(s.propertyPath=o,s.propertyValue=e,s.propertyPathArray=i,l===1)this.set(a,e,s);else{const u={};let h=u,f=a;for(let p=1;p<l;p+=1){const m=i[p],y=Number.isFinite(Number(m));h=h[f]=y?[]:{},f=m}Rr(u,i,e,r);const d=Tt(this.data);s.rewrite&&Bm(d,t,r);const g=Yt(d,u);this.set(a,g[a],s)}return this}removeByPath(t,e){const s=Array.isArray(t)?t:t.split("/"),r=s[0];if(s.length===1)this.remove(r,e);else{const i=s.slice(1),o=Tt(this.get(r));o&&Bm(o,i),this.set(r,o,e)}return this}hasChanged(t){return t==null?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(t==null)return this.hasChanged()?Tt(this.changed):null;const e=this.changing?this.previous:this.data,s={};let r;for(const i in t){const o=t[i];wn(e[i],o)||(s[i]=o,r=!0)}return r?Tt(s):null}toJSON(){return Tt(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}gV([Nt.dispose()],Tb.prototype,"dispose",null);class fo{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,s={},r="/"){const i=this.cell.getPropByPath(t),o=BP(s,fo.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,i,e);let u=0;const h=Array.isArray(t)?t.join(r):t,f=Array.isArray(t)?t:t.split(r),d=()=>{const g=new Date().getTime();u===0&&(u=g);let m=(g-u)/o.duration;m<1?this.ids[h]=requestAnimationFrame(d):m=1;const y=l(a(m));this.cell.setPropByPath(f,y),s.progress&&s.progress(Object.assign({progress:m,currentValue:y},this.getArgs(h))),m===1&&(this.cell.notify("transition:complete",this.getArgs(h)),s.complete&&s.complete(this.getArgs(h)),this.cell.notify("transition:finish",this.getArgs(h)),s.finish&&s.finish(this.getArgs(h)),this.clean(h))};return setTimeout(()=>{this.stop(t,void 0,r),this.cache[h]={startValue:i,targetValue:e,options:o},this.ids[h]=requestAnimationFrame(d),this.cell.notify("transition:start",this.getArgs(h)),s.start&&s.start(this.getArgs(h))},s.delay),this.stop.bind(this,t,r,s)}stop(t,e={},s="/"){const r=Array.isArray(t)?t:t.split(s);return Object.keys(this.ids).filter(i=>wn(r,i.split(s).slice(0,r.length))).forEach(i=>{cancelAnimationFrame(this.ids[i]);const o=this.cache[i],a=this.getArgs(i),l=Object.assign(Object.assign({},o.options),e),u=l.jumpedToEnd;u&&o.targetValue!=null&&(this.cell.setPropByPath(i,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),l.complete&&l.complete(Object.assign({},a)));const h=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},h)),l.stop&&l.stop(Object.assign({},h)),this.cell.notify("transition:finish",Object.assign({},a)),l.finish&&l.finish(Object.assign({},a)),this.clean(i)}),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return typeof t=="string"?Ks[t]:t}getInterp(t,e,s){return t?t(e,s):typeof s=="number"?Zs.number(e,s):typeof s=="string"?s[0]==="#"?Zs.color(e,s):Zs.unit(e,s):Zs.object(e,s)}getArgs(t){const e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(fo||(fo={}));var pV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Nb=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class ht extends Nt{static config(t){const{markup:e,propHooks:s,attrHooks:r}=t,i=Nb(t,["markup","propHooks","attrHooks"]);e!=null&&(this.markup=e),s&&(this.propHooks=this.propHooks.slice(),Array.isArray(s)?this.propHooks.push(...s):typeof s=="function"?this.propHooks.push(s):Object.values(s).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),r&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),r)),this.defaults=Yt({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:Tt(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((s,r)=>r?X(r,t,s):s,e)}get[Symbol.toStringTag](){return ht.toStringTag}constructor(t={}){super();const s=this.constructor.getDefaults(!0),r=Yt({},this.preprocess(s),this.preprocess(t));this.id=r.id||Fa(),this.store=new Tb(r),this.animation=new fo(this),this.setup(),this.init(),this.postprocess(t)}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const s=t.id,i=this.constructor.applyPropHooks(this,t);return s==null&&e!==!0&&(i.id=Fa()),i}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:s,previous:r,options:i}=t;this.notify("change:*",{key:e,options:i,current:s,previous:r,cell:this}),this.notify(`change:${e}`,{options:i,current:s,previous:r,cell:this});const o=e;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:s,previous:r,options:i,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this}))}notify(t,e){this.trigger(t,e);const s=this.model;return s&&(s.notify(`cell:${t}`,e),this.isNode()?s.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&s.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return t==null?this.store.get():this.store.get(t,e)}setProp(t,e,s){if(typeof t=="string")this.store.set(t,e,s);else{const r=this.preprocess(t,!0);this.store.set(Yt({},this.getProp(),r),e),this.postprocess(t)}return this}removeProp(t,e){return typeof t=="string"||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return t==null?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,s={}){return this.model&&(t==="children"?this._children=e?e.map(r=>this.model.getCell(r)).filter(r=>r!=null):null:t==="parent"&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,s),this}removePropByPath(t,e={}){const s=Array.isArray(t)?t:t.split("/");return s[0]==="attrs"&&(e.dirty=!0),this.store.removeByPath(s,e),this}prop(t,e,s){return t==null?this.getProp():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getPropByPath(t):e==null?this.removePropByPath(t,s||{}):this.setPropByPath(t,e,s||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){t==null?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let s=e.getMaxZIndex(),r;t.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this],s=s-r.length+1;const i=e.total();let o=e.indexOf(this)!==i-r.length;o||(o=r.some((a,l)=>a.getZIndex()!==s+l)),o&&this.batchUpdate("to-front",()=>{s+=r.length,r.forEach((a,l)=>{a.setZIndex(s+l,t)})})}return this}toBack(t={}){const e=this.model;if(e){let s=e.getMinZIndex(),r;t.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this];let i=e.indexOf(this)!==0;i||(i=r.some((o,a)=>o.getZIndex()!==s+a)),i&&this.batchUpdate("to-back",()=>{s-=r.length,r.forEach((o,a)=>{o.setZIndex(s+a,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){t==null?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");return t==null&&(t=this.constructor.getMarkup()),t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){t==null?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(t==null)this.removeAttrs(e);else{const s=r=>this.store.set("attrs",r,e);if(e.overwrite===!0)s(t);else{const r=this.getAttrs();e.deep===!1?s(Object.assign(Object.assign({},r),t)):s(Yt({},r,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const s=this.constructor.getAttrHooks()||{};let r=s[t]||On.registry.get(t);if(!r){const i=na(t);r=s[i]||On.registry.get(i)}return r||null}getAttrByPath(t){return t==null||t===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,s={}){return this.setPropByPath(this.prefixAttrPath(t),e,s),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,s){return t==null?this.getAttrByPath():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getAttrByPath(t):e==null?this.removeAttrByPath(t,s||{}):this.setAttrByPath(t,e,s||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return this.store.get("visible")!==!1}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const s=typeof t=="boolean"?t:!this.isVisible(),r=typeof t=="boolean"?e:t;return s?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(t==null)this.removeData(e);else{const s=r=>this.store.set("data",r,e);if(e.overwrite===!0)s(t);else{const r=this.getData();e.deep===!1?s(typeof t=="object"?Object.assign(Object.assign({},r),t):t):s(Yt({},r,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(s=>{var r;return(r=this.model)===null||r===void 0?void 0:r.getCell(s)}).filter(s=>s!=null);return this._children=e,[...e]}return null}hasParent(){return this.parent!=null}isParentOf(t){return t!=null&&t.getParent()===this}isChildOf(t){return t!=null&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(t){return this.children==null?-1:this.children.indexOf(t)}getChildAt(t){return this.children!=null&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let s=this.getParent();for(;s;)e.push(s),s=t.deep!==!1?s.getParent():null;return e}getDescendants(t={}){if(t.deep!==!1){if(t.breadthFirst){const e=[],s=this.getChildren()||[];for(;s.length>0;){const r=s.shift(),i=r.getChildren();e.push(r),i&&s.push(...i)}return e}{const e=this.getChildren()||[];return e.forEach(s=>{e.push(...s.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(t==null)return!1;if(e.deep!==!1){let s=this.getParent();for(;s;){if(s===t)return!0;s=s.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return t==null?!1:t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return ht.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,t!=null?this.store.set("children",t.map(s=>s.id),e):this.store.remove("children",e),this}unembed(t,e={}){const s=this.children;if(s!=null&&t!=null){const r=this.getChildIndex(t);r!==-1&&(s.splice(r,1),t.setParent(null,e),this.setChildren(s,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return ht.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,s={}){return t.insertChild(this,e,s),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,s={}){if(t!=null&&t!==this){const r=t.getParent(),i=this!==r;let o=e;if(o==null&&(o=this.getChildCount(),i||(o-=1)),r){const l=r.getChildren();if(l){const u=l.indexOf(t);u>=0&&(t.setParent(null,s),l.splice(u,1),r.setChildren(l,s))}}let a=this.children;if(a==null?(a=[],a.push(t)):a.splice(o,0,t),t.setParent(this,s),this.setChildren(a,s),i&&this.model){const l=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);l&&l.forEach(h=>h.updateParent(s)),u&&u.forEach(h=>h.updateParent(s))}this.model&&this.model.addCell(t,s)}return this}removeFromParent(t={}){const e=this.getParent();if(e!=null){const s=e.getChildIndex(this);e.removeChildAt(s,t)}return this}removeChild(t,e={}){const s=this.getChildIndex(t);return this.removeChildAt(s,e)}removeChildAt(t,e={}){const s=this.getChildAt(t);return this.children!=null&&s!=null&&(this.unembed(s,e),s.remove(e)),s}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),t.deep!==!1&&this.eachChild(s=>s.remove(t)),this.model&&this.model.removeCell(this,t)}),this}transition(t,e,s={},r="/"){return this.animation.start(t,e,s,r)}stopTransition(t,e,s="/"){return this.animation.stop(t,e,s),this}getTransitions(){return this.animation.get()}translate(t,e,s){return this}scale(t,e,s,r){return this}addTools(t,e,s){const r=Array.isArray(t)?t:[t],i=typeof e=="string"?e:null,o=typeof e=="object"?e:typeof s=="object"?s:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let a=Tt(this.getTools());if(a==null||i==null||a.name===i)return a==null&&(a={}),a.items||(a.items=[]),a.name=i,a.items=[...a.items,...r],this.setTools(Object.assign({},a),o)}setTools(t,e={}){return t==null?this.removeTools():this.store.set("tools",ht.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return e==null?!1:t==null?!0:e.name===t}hasTool(t){const e=this.getTools();return e==null?!1:e.items.some(s=>typeof s=="string"?s===t:s.name===t)}removeTool(t,e={}){const s=Tt(this.getTools());if(s){let r=!1;const i=s.items.slice(),o=a=>{i.splice(a,1),r=!0};if(typeof t=="number")o(t);else for(let a=i.length-1;a>=0;a-=1){const l=i[a];(typeof l=="string"?l===t:l.name===t)&&o(a)}r&&(s.items=i,this.setTools(s,e))}return this}getBBox(t){return new z}getConnectionPoint(t,e){return new O}toJSON(t={}){const e=Object.assign({},this.store.get()),s=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const p=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${p.name||s.call(p)}"`)}const i=this.constructor,o=t.diff===!0,a=e.attrs||{},l=i.getDefaults(!0),u=o?this.preprocess(l,!0):l,h=u.attrs||{},f={};Object.entries(e).forEach(([p,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!bn(m))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${s.call(m)}" type of key "${p}" on ${r} "${this.id}"`);if(p!=="attrs"&&p!=="shape"&&o){const y=u[p];wn(m,y)&&delete e[p]}}),Object.keys(a).forEach(p=>{const m=a[p],y=h[p];Object.keys(m).forEach(b=>{const w=m[b],x=y?y[b]:null;w!=null&&typeof w=="object"&&!Array.isArray(w)?Object.keys(w).forEach(v=>{const S=w[v];if(y==null||x==null||!Lt(x)||!wn(x[v],S)){f[p]==null&&(f[p]={}),f[p][b]==null&&(f[p][b]={});const E=f[p][b];E[v]=S}}):(y==null||!wn(x,w))&&(f[p]==null&&(f[p]={}),f[p][b]=w)})});const d=Object.assign(Object.assign({},e),{attrs:ag(f)?void 0:f});d.attrs==null&&delete d.attrs;const g=d;return g.angle===0&&delete g.angle,Tt(g)}clone(t={}){if(!t.deep){const s=Object.assign({},this.store.get());t.keepId||delete s.id,delete s.parent,delete s.children;const r=this.constructor;return new r(s)}return ht.deepClone(this)[this.id]}findView(t){return t.findViewByCell(this)}startBatch(t,e={},s=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),s&&s.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},s=this.model){return s&&s.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,s){const r=this.model;this.startBatch(t,s,r);const i=e();return this.stopBatch(t,s,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}ht.defaults={},ht.attrHooks={},ht.propHooks=[],pV([Nt.dispose()],ht.prototype,"dispose",null),function(n){function t(e){return typeof e=="string"?{items:[e]}:Array.isArray(e)?{items:e}:e.items?e:{items:[e]}}n.normalizeTools=t}(ht||(ht={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"}n.isCell=t}(ht||(ht={})),function(n){function t(...i){const o=i.filter(l=>l!=null).map(l=>l.getAncestors()).sort((l,u)=>l.length-u.length);return o.shift().find(l=>o.every(u=>u.includes(l)))||null}n.getCommonAncestor=t;function e(i,o={}){let a=null;for(let l=0,u=i.length;l<u;l+=1){const h=i[l];let f=h.getBBox(o);if(f){if(h.isNode()){const d=h.getAngle();d!=null&&d!==0&&(f=f.bbox(d))}a=a==null?f:a.union(f)}}return a}n.getCellsBBox=e;function s(i){const o=[i,...i.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=s;function r(i){const o=hg(i),a=o.reduce((l,u)=>(l[u.id]=u.clone(),l),{});return o.forEach(l=>{const u=a[l.id];if(u.isEdge()){const d=u.getSourceCellId(),g=u.getTargetCellId();d&&a[d]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[d].id})),g&&a[g]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[g].id}))}const h=l.getParent();h&&a[h.id]&&u.setParent(a[h.id]);const f=l.getChildren();if(f&&f.length){const d=f.reduce((g,p)=>(a[p.id]&&g.push(a[p.id]),g),[]);d.length>0&&u.setChildren(d)}}),a}n.cloneCells=r}(ht||(ht={})),function(n){n.config({propHooks(t){var{tools:e}=t,s=Nb(t,["tools"]);return e&&(s.tools=n.normalizeTools(e)),s}})}(ht||(ht={}));var Qr;(function(n){let t,e;function s(o,a){return a?t!=null&&t.exist(o):e!=null&&e.exist(o)}n.exist=s;function r(o){t=o}n.setEdgeRegistry=r;function i(o){e=o}n.setNodeRegistry=i})(Qr||(Qr={}));class mV{constructor(t){this.ports=[],this.groups={},this.init(Tt(t))}getPorts(){return this.ports}getGroup(t){return t!=null?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||e.group==null&&t==null)}getPortsLayoutByGroup(t,e){const s=this.getPortsByGroup(t),r=t?this.getGroup(t):null,i=r?r.position:null,o=i?i.name:null;let a;if(o!=null){const f=Qs.registry.get(o);if(f==null)return Qs.registry.onNotFound(o);a=f}else a=Qs.presets.left;const l=s.map(f=>f&&f.position&&f.position.args||{}),u=i&&i.args||{};return a(l,e,u).map((f,d)=>{const g=s[d];return{portLayout:f,portId:g.id,portSize:g.size,portAttrs:g.attrs,labelSize:g.label.size,labelLayout:this.getPortLabelLayout(g,O.create(f.position),e)}})}init(t){const{groups:e,items:s}=t;e!=null&&Object.keys(e).forEach(r=>{this.groups[r]=this.parseGroup(e[r])}),Array.isArray(s)&&s.forEach(r=>{this.ports.push(this.parsePort(r))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),s=this.getGroup(t.group)||{};return e.markup=e.markup||s.markup,e.attrs=Yt({},s.attrs,e.attrs),e.position=this.createPosition(s,e),e.label=Yt({},s.label,this.getLabel(e)),e.zIndex=this.getZIndex(s,e),e.size=Object.assign(Object.assign({},s.size),e.size),e}getZIndex(t,e){return typeof e.zIndex=="number"?e.zIndex:typeof t.zIndex=="number"||t.zIndex==="auto"?t.zIndex:"auto"}createPosition(t,e){return Yt({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if(typeof t=="object")return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(typeof t=="object")return t}return{args:{}}}getLabel(t,e=!1){const s=t.label||{};return s.position=this.getPortLabelPosition(s.position,e),s}getPortLabelLayout(t,e,s){const r=t.label.position.name||"left",i=t.label.position.args||{},o=Gr.registry.get(r)||Gr.presets.left;return o?o(e,s,i):null}}var fl=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};let Ut=class Xb extends ht{get[Symbol.toStringTag](){return Xb.toStringTag}constructor(t={}){super(t),this.initPorts()}preprocess(t,e){const{x:s,y:r,width:i,height:o}=t,a=fl(t,["x","y","width","height"]);if(s!=null||r!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:s??(l?l.x:0),y:r??(l?l.y:0)})}if(i!=null||o!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:i??(l?l.width:0),height:o??(l?l.height:0)})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,s){return t===void 0?this.getSize():typeof t=="number"?this.setSize(t,e,s):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,s){return typeof t=="object"?this.resize(t.width,t.height,e):this.resize(t,e,s),this}resize(t,e,s={}){this.startBatch("resize",s);const r=s.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":e=i.height;break;case"top":case"bottom":t=i.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[r];const l=gt.normalize(this.getAngle()||0);s.absolute&&(a+=Math.floor((l+45)/90),a%=4);const u=this.getBBox();let h;a===0?h=u.getBottomLeft():a===1?h=u.getCorner():a===2?h=u.getTopRight():h=u.getOrigin();const f=h.clone().rotate(-l,u.getCenter()),d=Math.sqrt(t*t+e*e)/2;let g=a*Math.PI/2;g+=Math.atan(a%2===0?e/t:t/e),g-=gt.toRad(l);const m=O.fromPolar(d,g,f).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},s),this.setPosition(m.x,m.y,s)}else this.store.set("size",{width:t,height:e},s);return this.stopBatch("resize",s),this}scale(t,e,s,r={}){const i=this.getBBox().scale(t,e,s??void 0);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this}position(t,e,s){return typeof t=="number"?this.setPosition(t,e,s):this.getPosition(t)}getPosition(t={}){if(t.relative){const s=this.getParent();if(s!=null&&s.isNode()){const r=this.getPosition(),i=s.getPosition();return{x:r.x-i.x,y:r.y-i.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,s={}){let r,i,o;if(typeof t=="object"?(r=t.x,i=t.y,o=e||{}):(r=t,i=e,o=s||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();r+=l.x,i+=l.y}}if(o.deep){const a=this.getPosition();this.translate(r-a.x,i-a.y,o)}else this.store.set("position",{x:r,y:i},o);return this}translate(t=0,e=0,s={}){if(t===0&&e===0)return this;s.translateBy=s.translateBy||this.id;const r=this.getPosition();if(s.restrict!=null&&s.translateBy===this.id){const o=this.getBBox({deep:!0}),a=s.restrict,l=r.x-o.x,u=r.y-o.y,h=Math.max(a.x+l,Math.min(a.x+a.width+l-o.width,r.x+t)),f=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,r.y+e));t=h-r.x,e=f-r.y}const i={x:r.x+t,y:r.y+e};return s.tx=t,s.ty=e,s.transition?(typeof s.transition!="object"&&(s.transition={}),this.transition("position",i,Object.assign(Object.assign({},s.transition),{interp:Zs.object})),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(t,e,s)})):(this.startBatch("translate",s),this.store.set("position",i,s),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(t,e,s)}),this.stopBatch("translate",s)),this}angle(t,e){return t==null?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const s=this.getAngle();if(e.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(s-t,e.center);const a=o.x-r.width/2-i.x,l=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(i.x+a,i.y+l,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(s+t)%360,e);return this}getBBox(t={}){if(t.deep){const e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),ht.getCellsBBox(e)}return z.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const s=this.getBBox(),r=s.getCenter(),i=t.getTerminal(e);if(i==null)return r;const o=i.port;if(!o||!this.hasPort(o))return r;const a=this.getPort(o);if(!a||!a.group)return r;const u=this.getPortsPosition(a.group)[o].position,h=O.create(u).translate(s.getOrigin()),f=this.getAngle();return f&&h.rotate(-f,r),h}fit(t={}){const s=(this.getChildren()||[]).filter(u=>u.isNode());if(s.length===0)return this;this.startBatch("fit-embeds",t),t.deep&&s.forEach(u=>u.fit(t));let{x:r,y:i,width:o,height:a}=ht.getCellsBBox(s);const l=ds(t.padding);return r-=l.left,i-=l.top,o+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:r,y:i},size:{width:o,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||_t.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",_t.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||_t.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",_t.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||_t.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",_t.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return t.items==null&&(t.items=[]),t}getPorts(){return Tt(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return Tt(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return this.getPortIndex(t)!==-1}getPortIndex(t){const e=typeof t=="string"?t:t.id;return e!=null?this.ports.items.findIndex(s=>s.id===e):-1}getPortsPosition(t){const e=this.getSize();return this.port.getPortsLayoutByGroup(t,new z(0,0,e.width,e.height)).reduce((r,i)=>{const o=i.portLayout;return r[i.portId]={position:Object.assign({},o.position),angle:o.angle||0},r},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,s,r){if(typeof e=="string"||Array.isArray(e)){const a=this.prefixPortPath(t,e),l=s;return this.setPropByPath(a,l,r)}const i=this.prefixPortPath(t),o=e;return this.setPropByPath(i,o,s)}removePortProp(t,e,s){return typeof e=="string"||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),s):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,s,r){return e==null?this.getPortProp(t):typeof e=="string"||Array.isArray(e)?arguments.length===2?this.getPortProp(t,e):s==null?this.removePortProp(t,e,r):this.setPortProp(t,e,s,r):this.setPortProp(t,e,s)}prefixPortPath(t,e){const s=this.getPortIndex(t);if(s===-1)throw new Error(`Unable to find port with id: "${t}"`);return e==null||e===""?["ports","items",`${s}`]:Array.isArray(e)?["ports","items",`${s}`,...e]:`ports/items/${s}/${e}`}addPort(t,e){const s=[...this.ports.items];return s.push(t),this.setPropByPath("ports/items",s,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,s){const r=[...this.ports.items];return r.splice(t,0,e),this.setPropByPath("ports/items",r,s),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const s=[...this.ports.items];s.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",s,e)}return this}removePorts(t,e){let s;if(Array.isArray(t)){if(s=e||{},t.length){s.rewrite=!0;const i=[...this.ports.items].filter(o=>!t.some(a=>{const l=typeof a=="string"?a:a.id;return o.id===l}));this.setPropByPath("ports/items",i,s)}}else s=t||{},s.rewrite=!0,this.setPropByPath("ports/items",[],s);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(o=>{o.id&&(e[o.id]=!0)});const s={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!e[o.id]&&(s[o.id]=!0)});const i=this.model;i&&!ag(s)&&(i.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const u=l.getTargetPortId();u&&s[u]&&l.remove()}),i.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const u=l.getSourcePortId();u&&s[u]&&l.remove()}))}validatePorts(){const t={},e=[];return this.ports.items.forEach(s=>{typeof s!="object"&&e.push(`Invalid port ${s}.`),s.id==null&&(s.id=this.generatePortId()),t[s.id]&&e.push("Duplicitied port id."),t[s.id]=!0}),e}generatePortId(){return Fa()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new mV(this.ports);const s=this.port.getPorts(),r=e?s.filter(o=>e.find(a=>a.id===o.id)?null:o):[...s],i=e?e.filter(o=>s.find(a=>a.id===o.id)?null:o):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})}};Ut.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.size=="function"&&typeof r.position=="function"}n.isNode=t}(Ut||(Ut={})),function(n){n.config({propHooks(t){var{ports:e}=t,s=fl(t,["ports"]);return e&&(s.ports=Array.isArray(e)?{items:e}:e),s}})}(Ut||(Ut={})),function(n){n.registry=Ft.create({type:"node",process(t,e){if(Qr.exist(t,!0))throw new Error(`Node with name '${t}' was registered by anthor Edge`);if(typeof e=="function")return e.config({shape:t}),e;let s=n;const{inherit:r}=e,i=fl(e,["inherit"]);if(r)if(typeof r=="string"){const a=this.get(r);a==null?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=t);const o=s.define.call(s,i);return o.config({shape:t}),o}}),Qr.setNodeRegistry(n.registry)}(Ut||(Ut={})),function(n){let t=0;function e(i){return i?Pu(i):(t+=1,`CustomNode${t}`)}function s(i){const{constructorName:o,overwrite:a}=i,l=fl(i,["constructorName","overwrite"]),u=Ou(e(o||l.shape),this);return u.config(l),l.shape&&n.registry.register(l.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"rect",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(Ut||(Ut={}));var gl=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};let jt=class Kb extends ht{get[Symbol.toStringTag](){return Kb.toStringTag}constructor(t={}){super(t)}preprocess(t,e){const{source:s,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:l,targetPort:u,targetPoint:h}=t,d=gl(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),g=p=>typeof p=="string"||typeof p=="number";if(s!=null)if(ht.isCell(s))d.source={cell:s.id};else if(g(s))d.source={cell:s};else if(O.isPoint(s))d.source=s.toJSON();else if(Array.isArray(s))d.source={x:s[0],y:s[1]};else{const p=s.cell;ht.isCell(p)?d.source=Object.assign(Object.assign({},s),{cell:p.id}):d.source=s}if(r!=null||i!=null){let p=d.source;if(r!=null){const m=g(r)?r:r.id;p?p.cell=m:p=d.source={cell:m}}i!=null&&p&&(p.port=i)}else o!=null&&(d.source=O.create(o).toJSON());if(a!=null)if(ht.isCell(a))d.target={cell:a.id};else if(g(a))d.target={cell:a};else if(O.isPoint(a))d.target=a.toJSON();else if(Array.isArray(a))d.target={x:a[0],y:a[1]};else{const p=a.cell;ht.isCell(p)?d.target=Object.assign(Object.assign({},a),{cell:p.id}):d.target=a}if(l!=null||u!=null){let p=d.target;if(l!=null){const m=g(l)?l:l.id;p?p.cell=m:p=d.target={cell:m}}u!=null&&p&&(p.port=u)}else h!=null&&(d.target=O.create(h).toJSON());return super.preprocess(d,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,s={}){return this.setTerminal("source",t,e,s)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,s={}){return this.setTerminal("target",t,e,s)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,s,r={}){if(ht.isCell(e))return this.store.set(t,Yt({},s,{cell:e.id}),r),this;const i=e;return O.isPoint(e)||i.x!=null&&i.y!=null?(this.store.set(t,Yt({},s,{x:i.x,y:i.y}),r),this):(this.store.set(t,Tt(e),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(O.isPointLike(e))return O.create(e);const s=this.getTerminalCell(t);return s?s.getConnectionPoint(this,t):new O}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e=t==="source"?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const s={};for(;e&&e.isEdge();){if(s[e.id])return null;s[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){t==null?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,s){return typeof t=="object"?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},s),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){t==null?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,s){return typeof t=="object"?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},s),this}removeConnector(t={}){return this.store.remove("connector",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return Tt(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,s={}){const r=this.getLabels(),i=r.length;let o=e!=null&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(t)),this.setLabels(r,s)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return t!=null&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,s={}){if(t!=null&&Number.isFinite(t)){const r=this.getLabels();r[t]=this.parseLabel(e),this.setLabels(r,s)}return this}removeLabelAt(t,e={}){const s=this.getLabels(),r=t!=null&&Number.isFinite(t)?t:-1,i=s.splice(r,1);return this.setLabels(s,e),i.length?i[0]:null}parseLabel(t){return typeof t=="string"?this.constructor.parseStringLabel(t):t}onLabelsChanged({previous:t,current:e}){const s=t&&e?e.filter(i=>t.find(o=>i===o||wn(i,o))?null:i):e?[...e]:[],r=t&&e?t.filter(i=>e.find(o=>i===o||wn(i,o))?null:i):t?[...t]:[];s.length>0&&this.notify("labels:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("labels:removed",{removed:r,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const s=Array.isArray(t)?t:[t];return this.store.set("vertices",s.map(r=>O.toJSON(r)),e),this}insertVertex(t,e,s={}){const r=this.getVertices(),i=r.length;let o=e!=null&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,O.toJSON(t)),this.setVertices(r,s)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){return t!=null&&Number.isFinite(t)?this.getVertices()[t]:null}setVertexAt(t,e,s={}){if(t!=null&&Number.isFinite(t)){const r=this.getVertices();r[t]=e,this.setVertices(r,s)}return this}removeVertexAt(t,e={}){const s=this.getVertices(),r=t!=null&&Number.isFinite(t)?t:-1;return s.splice(r,1),this.setVertices(s,e)}onVertexsChanged({previous:t,current:e}){const s=t&&e?e.filter(i=>t.find(o=>O.equals(i,o))?null:i):e?[...e]:[],r=t&&e?t.filter(i=>e.find(o=>O.equals(i,o))?null:i):t?[...t]:[];s.length>0&&this.notify("vertexs:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("vertexs:removed",{removed:r,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||_t.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(t,e,s={}){return s.translateBy=s.translateBy||this.id,s.tx=t,s.ty=e,this.applyToPoints(r=>({x:(r.x||0)+t,y:(r.y||0)+e}),s)}scale(t,e,s,r={}){return this.applyToPoints(i=>O.create(i).scale(t,e,s).toJSON(),r)}applyToPoints(t,e={}){const s={},r=this.getSource(),i=this.getTarget();O.isPointLike(r)&&(s.source=t(r)),O.isPointLike(i)&&(s.target=t(i));const o=this.getVertices();return o.length>0&&(s.vertices=o.map(t)),this.store.set(s,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(e=>O.create(e)),this.getTargetPoint()];return new zt(t)}updateParent(t){let e=null;const s=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return s&&r&&(s===r||s.isDescendantOf(r)?e=r:r.isDescendantOf(s)?e=s:e=ht.getCommonAncestor(s,r)),i&&e&&e.id!==i.id&&i.unembed(this,t),e&&(!i||i.id!==e.id)&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),s=this.getTarget(),r=e.cell,i=s.cell;if(!r||!i)return!1;let o=r===i;if(!o&&t.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(o=a.isAncestorOf(l,t)||l.isAncestorOf(a,t))}return o}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>e!=null);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}};jt.defaults={},function(n){function t(e,s){const r=e,i=s;return r.cell===i.cell?r.port===i.port||r.port==null&&i.port==null:!1}n.equalTerminals=t}(jt||(jt={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function t(e){return{attrs:{label:{text:e}}}}n.parseStringLabel=t}(jt||(jt={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.disconnect=="function"&&typeof r.getSource=="function"&&typeof r.getTarget=="function"}n.isEdge=t}(jt||(jt={})),function(n){n.registry=Ft.create({type:"edge",process(t,e){if(Qr.exist(t,!1))throw new Error(`Edge with name '${t}' was registered by anthor Node`);if(typeof e=="function")return e.config({shape:t}),e;let s=n;const{inherit:r="edge"}=e,i=gl(e,["inherit"]);if(typeof r=="string"){const a=this.get(r||"edge");a==null&&r?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=t);const o=s.define.call(s,i);return o.config({shape:t}),o}}),Qr.setEdgeRegistry(n.registry)}(jt||(jt={})),function(n){let t=0;function e(i){return i?Pu(i):(t+=1,`CustomEdge${t}`)}function s(i){const{constructorName:o,overwrite:a}=i,l=gl(i,["constructorName","overwrite"]),u=Ou(e(o||l.shape),this);return u.config(l),l.shape&&n.registry.register(l.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"edge",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(jt||(jt={})),function(n){const t="basic.edge";n.config({shape:t,propHooks(e){const{label:s,vertices:r}=e,i=gl(e,["label","vertices"]);if(s){i.labels==null&&(i.labels=[]);const o=typeof s=="string"?n.parseStringLabel(s):s;i.labels.push(o)}return r&&Array.isArray(r)&&(i.vertices=r.map(o=>O.create(o).toJSON())),i}}),n.registry.register(t,n)}(jt||(jt={}));var yV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class pl extends Nt{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,s){let r,i;typeof e=="number"?(r=e,i=Object.assign({merge:!1},s)):(r=this.length,i=Object.assign({merge:!1},e)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(t)?t:[t],a=this.comparator&&typeof e!="number"&&i.sort!==!1,l=this.comparator||null;let u=!1;const h=[],f=[];return o.forEach(d=>{const g=this.get(d);g?i.merge&&!d.isSameStore(g)&&(g.setProp(d.getProp(),s),f.push(g),a&&!u&&(l==null||typeof l=="function"?u=g.hasChanged():typeof l=="string"?u=g.hasChanged(l):u=l.some(p=>g.hasChanged(p)))):(h.push(d),this.reference(d))}),h.length&&(a&&(u=!0),this.cells.splice(r,0,...h),this.length=this.cells.length),u&&this.sort({silent:!0}),i.silent||(h.forEach((d,g)=>{const p={cell:d,index:r+g,options:i};this.trigger("added",p),i.dryrun||d.notify("added",Object.assign({},p))}),u&&this.trigger("sorted"),(h.length||f.length)&&this.trigger("updated",{added:h,merged:f,removed:[],options:i})),this}remove(t,e={}){const s=Array.isArray(t)?t:[t],r=this.removeCells(s,e);return!e.silent&&r.length>0&&this.trigger("updated",{options:e,removed:r,added:[],merged:[]}),Array.isArray(t)?r:r[0]}removeCells(t,e){const s=[];for(let r=0;r<t.length;r+=1){const i=this.get(t[r]);if(i==null)continue;const o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],s.push(i),this.unreference(i),e.dryrun||i.remove(),e.silent||(this.trigger("removed",{cell:i,index:o,options:e}),e.dryrun||i.notify("removed",{cell:i,index:o,options:e}))}return s}reset(t,e={}){const s=this.cells.slice();if(s.forEach(r=>this.unreference(r)),this.clean(),this.add(t,Object.assign({silent:!0},e)),!e.silent){const r=this.cells.slice();this.trigger("reseted",{options:e,previous:s,current:r});const i=[],o=[];r.forEach(a=>{s.some(u=>u.id===a.id)||i.push(a)}),s.forEach(a=>{r.some(u=>u.id===a.id)||o.push(a)}),this.trigger("updated",{options:e,added:i,removed:o,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return this.remove(e,t)}get(t){if(t==null)return null;const e=typeof t=="string"||typeof t=="number"?t:t.id;return this.map[e]||null}has(t){return this.get(t)!=null}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return this.comparator!=null&&(this.cells=Pc(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const s=e.cell;this.trigger(`cell:${t}`,e),s&&(s.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:s})):s.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:s})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}yV([pl.dispose()],pl.prototype,"dispose",null);var bV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Zt extends Nt{get[Symbol.toStringTag](){return Zt.toStringTag}constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new pl(t),this.setup()}notify(t,e){this.trigger(t,e);const s=this.graph;return s&&(t==="sorted"||t==="reseted"||t==="updated"?s.trigger(`model:${t}`,e):s.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",e=>this.notify("updated",e)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:e})=>{this.onCellAdded(e)}),t.on("removed",e=>{const s=e.cell;this.onCellRemoved(s,e.options),this.notify("cell:removed",e),s.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:s})):s.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:s}))}),t.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),t.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),t.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const s=t.id;if(t.isEdge()){delete this.edges[s];const r=t.getSource(),i=t.getTarget();if(r&&r.cell){const o=this.outgoings[r.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[r.cell])}if(i&&i.cell){const o=this.incomings[i.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[i.cell])}}else delete this.nodes[s];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(e=>this.onCellAdded(e))}onEdgeTerminalChanged(t,e){const s=e==="source"?this.outgoings:this.incomings,r=t.previous(e);if(r&&r.cell){const o=ht.isCell(r.cell)?r.cell.id:r.cell,a=s[o],l=a?a.indexOf(t.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete s[o])}const i=t.getTerminal(e);if(i&&i.cell){const o=ht.isCell(i.cell)?i.cell.id:i.cell,a=s[o]||[];a.indexOf(t.id)===-1&&a.push(t.id),s[o]=a}}prepareCell(t,e){return!t.model&&(!e||!e.dryrun)&&(t.model=this),t.zIndex==null&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(s=>this.prepareCell(s,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(s=>this.prepareCell(s,{options:e})),this}clear(t={}){const e=this.getCells();if(e.length===0)return this;const s=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const r=e.sort((i,o)=>{const a=i.isEdge()?1:2,l=o.isEdge()?1:2;return a-l});for(;r.length>0;){const i=r.shift();i&&i.remove(s)}},s),this}addNode(t,e={}){const s=Ut.isNode(t)?t:this.createNode(t);return this.addCell(s,e),s}updateNode(t,e={}){const s=this.createNode(t),r=s.getProp();return s.dispose(),this.updateCell(r,e)}createNode(t){return Ut.create(t)}addEdge(t,e={}){const s=jt.isEdge(t)?t:this.createEdge(t);return this.addCell(s,e),s}createEdge(t){return jt.create(t)}updateEdge(t,e={}){const s=this.createEdge(t),r=s.getProp();return s.dispose(),this.updateCell(r,e)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(!this.collection.has(t)&&!this.addings.has(t)&&(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild(s=>this.addCell(s,e)),this.addings.delete(t)),this)}addCells(t,e={}){const s=t.length;if(s===0)return this;const r=Object.assign(Object.assign({},e),{position:s-1,maxPosition:s-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:t})),t.forEach(i=>{this.addCell(i,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:t})),this}updateCell(t,e={}){const s=t.id&&this.getCell(t.id);return s?this.batchUpdate("update",()=>(Object.entries(t).forEach(([r,i])=>s.setProp(r,i,e)),!0),t):!1}removeCell(t,e={}){const s=typeof t=="string"?this.getCell(t):t;return s&&this.has(s)?this.collection.remove(s,e):null}updateCellId(t,e){if(t.id===e)return;this.startBatch("update",{id:e}),t.prop("id",e);const s=t.clone({keepId:!0});return this.addCell(s),this.getConnectedEdges(t).forEach(i=>{const o=i.getSourceCell(),a=i.getTargetCell();o===t&&i.setSource(Object.assign(Object.assign({},i.getSource()),{cell:e})),a===t&&i.setTarget(Object.assign(Object.assign({},i.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),s}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(s=>this.removeCell(s,e))):[]}removeConnectedEdges(t,e={}){const s=this.getConnectedEdges(t);return s.forEach(r=>{r.remove(e)}),s}disconnectConnectedEdges(t,e={}){const s=typeof t=="string"?t:t.id;this.getConnectedEdges(t).forEach(r=>{const i=r.getSourceCellId(),o=r.getTargetCellId();i===s&&r.setSource({x:0,y:0},e),o===s&&r.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(e=>this.getCell(e)).filter(e=>e!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e=typeof t=="string"?t:t.id,s=this.outgoings[e];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getIncomingEdges(t){const e=typeof t=="string"?t:t.id,s=this.incomings[e];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getConnectedEdges(t,e={}){const s=[],r=typeof t=="string"?this.getCell(t):t;if(r==null)return s;const i={},o=e.indirect;let a=e.incoming,l=e.outgoing;a==null&&l==null&&(a=l=!0);const u=(h,f)=>{const d=f?this.getOutgoingEdges(h):this.getIncomingEdges(h);if(d!=null&&d.forEach(g=>{i[g.id]||(s.push(g),i[g.id]=!0,o&&(a&&u(g,!1),l&&u(g,!0)))}),o&&h.isEdge()){const g=f?h.getTargetCell():h.getSourceCell();g&&g.isEdge()&&(i[g.id]||(s.push(g),u(g,f)))}};if(l&&u(r,!0),a&&u(r,!1),e.deep){const h=r.getDescendants({deep:!0}),f={};h.forEach(g=>{g.isNode()&&(f[g.id]=!0)});const d=(g,p)=>{const m=p?this.getOutgoingEdges(g.id):this.getIncomingEdges(g.id);m!=null&&m.forEach(y=>{if(!i[y.id]){const b=y.getSourceCell(),w=y.getTargetCell();if(!e.enclosed&&b&&f[b.id]&&w&&f[w.id])return;s.push(y),i[y.id]=!0}})};h.forEach(g=>{g.isEdge()||(l&&d(g,!0),a&&d(g,!1))})}return s}isBoundary(t,e){const s=typeof t=="string"?this.getCell(t):t,r=e?this.getIncomingEdges(s):this.getOutgoingEdges(s);return r==null||r.length===0}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(s=>{if(this.isBoundary(s,t)){const r=this.getCell(s);r&&e.push(r)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let s=e.incoming,r=e.outgoing;s==null&&r==null&&(s=r=!0);const o=this.getConnectedEdges(t,e).reduce((a,l)=>{const u=l.hasLoop(e),h=l.getSourceCell(),f=l.getTargetCell();return s&&h&&h.isNode()&&!a[h.id]&&(u||h!==t&&(!e.deep||!h.isDescendantOf(t)))&&(a[h.id]=h),r&&f&&f.isNode()&&!a[f.id]&&(u||f!==t&&(!e.deep||!f.isDescendantOf(t)))&&(a[f.id]=f),a},{});if(t.isEdge()){if(s){const a=t.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(r){const a=t.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(t,e,s={}){let r=s.incoming,i=s.outgoing;return r==null&&i==null&&(r=i=!0),this.getConnectedEdges(t,s).some(o=>{const a=o.getSourceCell(),l=o.getTargetCell();return!!(r&&a&&a.id===e.id||i&&l&&l.id===e.id)})}getSuccessors(t,e={}){const s=[];return this.search(t,(r,i)=>{r!==t&&this.matchDistance(i,e.distance)&&s.push(r)},Object.assign(Object.assign({},e),{outgoing:!0})),s}isSuccessor(t,e,s={}){let r=!1;return this.search(t,(i,o)=>{if(i===e&&i!==t&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{outgoing:!0})),r}getPredecessors(t,e={}){const s=[];return this.search(t,(r,i)=>{r!==t&&this.matchDistance(i,e.distance)&&s.push(r)},Object.assign(Object.assign({},e),{incoming:!0})),s}isPredecessor(t,e,s={}){let r=!1;return this.search(t,(i,o)=>{if(i===e&&i!==t&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{incoming:!0})),r}matchDistance(t,e){return e==null?!0:typeof e=="function"?e(t):Array.isArray(e)&&e.includes(t)?!0:t===e}getCommonAncestor(...t){const e=[];return t.forEach(s=>{s&&(Array.isArray(s)?e.push(...s):e.push(s))}),ht.getCommonAncestor(...e)}getSubGraph(t,e={}){const s=[],r={},i=[],o=[],a=l=>{r[l.id]||(s.push(l),r[l.id]=l,l.isEdge()&&o.push(l),l.isNode()&&i.push(l))};return t.forEach(l=>{a(l),e.deep&&l.getDescendants({deep:!0}).forEach(h=>a(h))}),o.forEach(l=>{const u=l.getSourceCell(),h=l.getTargetCell();u&&!r[u.id]&&(s.push(u),r[u.id]=u,u.isNode()&&i.push(u)),h&&!r[h.id]&&(s.push(h),r[h.id]=h,h.isNode()&&i.push(h))}),i.forEach(l=>{this.getConnectedEdges(l,e).forEach(h=>{const f=h.getSourceCell(),d=h.getTargetCell();!r[h.id]&&f&&r[f.id]&&d&&r[d.id]&&(s.push(h),r[h.id]=h)})}),s}cloneSubGraph(t,e={}){const s=this.getSubGraph(t,e);return this.cloneCells(s)}cloneCells(t){return ht.cloneCells(t)}getNodesFromPoint(t,e){const s=typeof t=="number"?{x:t,y:e||0}:t;return this.getNodes().filter(r=>r.getBBox().containsPoint(s))}getNodesInArea(t,e,s,r,i){const o=typeof t=="number"?new z(t,e,s,r):z.create(t),a=typeof t=="number"?i:e,l=a&&a.strict;return this.getNodes().filter(u=>{const h=u.getBBox();return l?o.containsRect(h):o.isIntersectWithRect(h)})}getEdgesInArea(t,e,s,r,i){const o=typeof t=="number"?new z(t,e,s,r):z.create(t),a=typeof t=="number"?i:e,l=a&&a.strict;return this.getEdges().filter(u=>{const h=u.getBBox();return h.width===0?h.inflate(1,0):h.height===0&&h.inflate(0,1),l?o.containsRect(h):o.isIntersectWithRect(h)})}getNodesUnderNode(t,e={}){const s=t.getBBox();return(e.by==null||e.by==="bbox"?this.getNodesInArea(s):this.getNodesFromPoint(s[e.by])).filter(i=>t.id!==i.id&&!i.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return ht.getCellsBBox(t,e)}search(t,e,s={}){s.breadthFirst?this.breadthFirstSearch(t,e,s):this.depthFirstSearch(t,e,s)}breadthFirstSearch(t,e,s={}){const r=[],i={},o={};for(r.push(t),o[t.id]=0;r.length>0;){const a=r.shift();if(a==null||i[a.id]||(i[a.id]=!0,X(e,this,a,o[a.id])===!1))continue;this.getNeighbors(a,s).forEach(u=>{o[u.id]=o[a.id]+1,r.push(u)})}}depthFirstSearch(t,e,s={}){const r=[],i={},o={};for(r.push(t),o[t.id]=0;r.length>0;){const a=r.pop();if(a==null||i[a.id]||(i[a.id]=!0,X(e,this,a,o[a.id])===!1))continue;const l=this.getNeighbors(a,s),u=r.length;l.forEach(h=>{o[h.id]=o[a.id]+1,r.splice(u,0,h)})}}getShortestPath(t,e,s={}){const r={};this.getEdges().forEach(u=>{const h=u.getSourceCellId(),f=u.getTargetCellId();h&&f&&(r[h]||(r[h]=[]),r[f]||(r[f]=[]),r[h].push(f),s.directed||r[f].push(h))});const i=typeof t=="string"?t:t.id,o=Yu.run(r,i,s.weight),a=[];let l=typeof e=="string"?e:e.id;for(o[l]&&a.push(l);l=o[l];)a.unshift(l);return a}translate(t,e,s){return this.getCells().filter(r=>!r.hasParent()).forEach(r=>r.translate(t,e,s)),this}resize(t,e,s){return this.resizeCells(t,e,this.getCells(),s)}resizeCells(t,e,s,r={}){const i=this.getCellsBBox(s);if(i){const o=Math.max(t/i.width,0),a=Math.max(e/i.height,0),l=i.getOrigin();s.forEach(u=>u.scale(o,a,l,r))}return this}toJSON(t={}){return Zt.toJSON(this.getCells(),t)}parseJSON(t){return Zt.fromJSON(t)}fromJSON(t,e={}){const s=this.parseJSON(t);return this.resetCells(s,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,s={}){this.startBatch(t,s);const r=e();return this.stopBatch(t,s),r}hasActiveBatch(t=Object.keys(this.batches)){return(Array.isArray(t)?t:[t]).some(s=>this.batches[s]>0)}dispose(){this.collection.dispose()}}bV([Zt.dispose()],Zt.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.addNode=="function"&&typeof r.addEdge=="function"&&r.collection!=null}n.isModel=t}(Zt||(Zt={})),function(n){function t(s,r={}){return{cells:s.map(i=>i.toJSON(r))}}n.toJSON=t;function e(s){const r=[];return Array.isArray(s)?r.push(...s):(s.cells&&r.push(...s.cells),s.nodes&&s.nodes.forEach(i=>{i.shape==null&&(i.shape="rect"),r.push(i)}),s.edges&&s.edges.forEach(i=>{i.shape==null&&(i.shape="edge"),r.push(i)})),r.map(i=>{const o=i.shape;if(o){if(Ut.registry.exist(o))return Ut.create(i);if(jt.registry.exist(o))return jt.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=e}(Zt||(Zt={}));var wV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};let Ps=class extends Ut{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return t==null?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(t){const{label:e}=t,s=wV(t,["label"]);return e&&Rr(s,"attrs/text/text",e),s},visible:!0})})(Ps||(Ps={}));var xV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};function vV(n,t="body"){return[{tagName:n,selector:t},{tagName:"text",selector:"label"}]}function CV(n="xlink:href"){return e=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=e,o=xV(e,["imageUrl","imageWidth","imageHeight"]);if(s!=null||r!=null||i!=null){const a=()=>{if(o.attrs){const l=o.attrs.image;s!=null&&(l[n]=s),r!=null&&(l.width=r),i!=null&&(l.height=i),o.attrs.image=l}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function ti(n,t,e={}){const s={constructorName:n,markup:vV(n,e.selector),attrs:{[n]:Object.assign({},Ps.bodyAttr)}};return(e.parent||Ps).define(Yt(s,t,{shape:n}))}ti("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const SV=jt.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});ti("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var EV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class ei extends Ps{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return t==null?this.removePoints():this.setAttrByPath("body/refPoints",ei.pointsToString(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function t(e){return typeof e=="string"?e:e.map(s=>Array.isArray(s)?s.join(","):O.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=t,n.config({propHooks(e){const{points:s}=e,r=EV(e,["points"]);if(s){const i=t(s);i&&Rr(r,"attrs/body/refPoints",i)}return r}})})(ei||(ei={})),ti("polygon",{},{parent:ei}),ti("polyline",{},{parent:ei});var OV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};Ps.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:t}=n,e=OV(n,["path"]);return t&&Rr(e,"attrs/body/refD",t),e}});var MV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};Ps.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},fs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:ee.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},Ps.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:t}=n,e=MV(n,["text"]);return t&&Rr(e,"attrs/label/text",t),e},attrHooks:{text:{set(n,{cell:t,view:e,refBBox:s,elem:r,attrs:i}){if(r instanceof HTMLElement)r.textContent=n;else{const o=i.style||{},a={text:n,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),u=On.presets.textWrap;return X(u.set,this,a,{cell:t,view:e,elem:r,refBBox:s,attrs:l}),{fill:o.color||null}}},position(n,{refBBox:t,elem:e}){if(e instanceof SVGElement)return t.getCenter()}}}}),ti("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:CV()},{selector:"image"}),ti("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class hn extends Ht{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return hn.toStringTag}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const s=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?Dt(e,s):J(e,s)}else{const s=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(s):this.addClass(s)}}isNodeView(){return!0}confirmUpdate(t,e={}){let s=t;return this.hasAction(s,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","resize","translate","rotate","ports","tools"])):(s=this.handleAction(s,"resize",()=>this.resize(),"update"),s=this.handleAction(s,"update",()=>this.update(),"ports"),s=this.handleAction(s,"translate",()=>this.translate()),s=this.handleAction(s,"rotate",()=>this.rotate()),s=this.handleAction(s,"ports",()=>this.renderPorts()),s=this.handleAction(s,"tools",()=>{this.getFlag("tools")===t?this.renderTools():this.updateTools(e)})),s}update(t){this.cleanCache(),this.removePorts();const e=this.cell,s=e.getSize(),r=e.getAttrs();this.updateAttrs(this.container,r,{attrs:t===r?null:t,rootBBox:new z(0,0,s.width,s.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.appendChild(e.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}findPortElem(t,e){const s=t?this.portsCache[t]:null;if(!s)return null;const r=s.portContentElement,i=s.portContentSelectors||{};return this.findOne(e,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(t=>{ze(t.portElement)})}renderPorts(){const t=this.container,e=[];t.childNodes.forEach(o=>{e.push(o)});const s=this.cell.getParsedPorts(),r=og(s,"zIndex"),i="auto";r[i]&&r[i].forEach(o=>{const a=this.getPortElement(o);t.append(a),e.push(a)}),Object.keys(r).forEach(o=>{if(o!==i){const a=parseInt(o,10);this.appendPorts(r[o],a,e)}}),this.updatePorts()}appendPorts(t,e,s){const r=t.map(i=>this.getPortElement(i));s[e]||e<0?Lu(s[Math.max(e,0)],r):Ne(this.container,r)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=_t.renderMarkup(this.cell.getPortContainerMarkup());const s=e.elem;if(s==null)throw new Error("Invalid port container markup.");e=_t.renderMarkup(this.getPortMarkup(t));const r=e.elem,i=e.selectors;if(r==null)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},r);let o="x6-port";t.group&&(o+=` x6-port-${t.group}`),J(s,o),J(s,"x6-port"),J(r,"x6-port-body"),s.appendChild(r);let a=i,l,u;if(this.existPortLabel(t)){if(e=_t.renderMarkup(this.getPortLabelMarkup(t.label)),l=e.elem,u=e.selectors,l==null)throw new Error("Invalid port label markup.");if(i&&u){for(const f in u)if(i[f]&&f!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},i),u)}J(l,"x6-port-label"),s.appendChild(l)}return this.portsCache[t.id]={portElement:s,portSelectors:a,portLabelElement:l,portLabelSelectors:u,portContentElement:r,portContentSelectors:i},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:t,node:this.cell,container:s,selectors:a,labelContainer:l,labelSelectors:u,contentContainer:r,contentSelectors:i}),s}updatePorts(){const t=this.cell.getParsedGroups(),e=Object.keys(t);e.length===0?this.updatePortGroup():e.forEach(s=>this.updatePortGroup(s))}updatePortGroup(t){const e=z.fromSize(this.cell.getSize()),s=this.cell.getPortsLayoutByGroup(t,e);for(let r=0,i=s.length;r<i;r+=1){const o=s[r],a=o.portId,l=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(l.portElement,u),o.portAttrs!=null){const f={selectors:l.portSelectors||{}};o.portSize&&(f.rootBBox=z.fromSize(o.portSize)),this.updateAttrs(l.portElement,o.portAttrs,f)}const h=o.labelLayout;if(h&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,h,-(u.angle||0)),h.attrs)){const f={selectors:l.portLabelSelectors||{}};o.labelSize&&(f.rootBBox=z.fromSize(o.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,f)}}}applyPortTransform(t,e,s=0){const r=e.angle,i=e.position,o=ne().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);Vr(t,o,{absolute:!0})}getPortMarkup(t){return t.markup||this.cell.portMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup}existPortLabel(t){return t.attrs&&t.attrs.text}getEventArgs(t,e,s){const r=this,i=r.cell,o=i;return e==null||s==null?{e:t,view:r,node:i,cell:o}:{e:t,x:e,y:s,view:r,node:i,cell:o}}getPortEventArgs(t,e,s){const r=this,i=r.cell,o=i;return s?{e:t,x:s.x,y:s.y,view:r,node:i,cell:o,port:e}:{e:t,view:r,node:i,cell:o,port:e}}notifyMouseDown(t,e,s){super.onMouseDown(t,e,s),this.notify("node:mousedown",this.getEventArgs(t,e,s))}notifyMouseMove(t,e,s){super.onMouseMove(t,e,s),this.notify("node:mousemove",this.getEventArgs(t,e,s))}notifyMouseUp(t,e,s){super.onMouseUp(t,e,s),this.notify("node:mouseup",this.getEventArgs(t,e,s))}notifyPortEvent(t,e,s){const r=this.findAttr("port",e.target);if(r){const i=e.type;t==="node:port:mouseenter"?e.type="mouseenter":t==="node:port:mouseleave"&&(e.type="mouseleave"),this.notify(t,this.getPortEventArgs(e,r,s)),e.type=i}}onClick(t,e,s){super.onClick(t,e,s),this.notify("node:click",this.getEventArgs(t,e,s)),this.notifyPortEvent("node:port:click",t,{x:e,y:s})}onDblClick(t,e,s){super.onDblClick(t,e,s),this.notify("node:dblclick",this.getEventArgs(t,e,s)),this.notifyPortEvent("node:port:dblclick",t,{x:e,y:s})}onContextMenu(t,e,s){super.onContextMenu(t,e,s),this.notify("node:contextmenu",this.getEventArgs(t,e,s)),this.notifyPortEvent("node:port:contextmenu",t,{x:e,y:s})}onMouseDown(t,e,s){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,s),this.notifyPortEvent("node:port:mousedown",t,{x:e,y:s}),this.startNodeDragging(t,e,s))}onMouseMove(t,e,s){const r=this.getEventData(t),i=r.action;if(i==="magnet")this.dragMagnet(t,e,s);else{if(i==="move"){const a=r.targetView||this;a.dragNode(t,e,s),a.notify("node:moving",{e:t,x:e,y:s,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(t,e,s),this.notifyPortEvent("node:port:mousemove",t,{x:e,y:s})}this.setEventData(t,r)}onMouseUp(t,e,s){const r=this.getEventData(t),i=r.action;i==="magnet"?this.stopMagnetDragging(t,e,s):(this.notifyMouseUp(t,e,s),this.notifyPortEvent("node:port:mouseup",t,{x:e,y:s}),i==="move"&&(r.targetView||this).stopNodeDragging(t,e,s));const o=r.targetMagnet;o&&this.onMagnetClick(t,o,e,s),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseenter",t),this.notifyPortEvent("node:port:mouseover",t)}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseleave",t),this.notifyPortEvent("node:port:mouseout",t)}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,s,r){super.onMouseWheel(t,e,s,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,s)))}onMagnetClick(t,e,s,r){const i=this.graph;i.view.getMouseMovedCount(t)>i.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,s,r)))}onMagnetDblClick(t,e,s,r){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,s,r)))}onMagnetContextMenu(t,e,s,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,s,r)))}onMagnetMouseDown(t,e,s,r){this.startMagnetDragging(t,s,r)}onCustomEvent(t,e,s,r){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,s,r))),super.onCustomEvent(t,e,s,r)}prepareEmbedding(t){const e=this.graph,r=this.getEventData(t).cell||this.cell,i=e.findViewByCell(r),o=e.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:r,view:i,cell:r,x:o.x,y:o.y,currentParent:r.getParent()})}processEmbedding(t,e){const s=e.cell||this.cell,r=e.graph||this.graph,i=r.options.embedding,o=i.findParent;let a=typeof o=="function"?X(o,r,{view:this,node:this.cell}).filter(d=>ht.isCell(d)&&this.cell.id!==d.id&&!d.isDescendantOf(this.cell)):r.model.getNodesUnderNode(s,{by:o});if(i.frontOnly&&a.length>0){const d=og(a,"zIndex"),g=i2(Object.keys(d).map(p=>parseInt(p,10)));g&&(a=d[g])}a=a.filter(d=>d.visible);let l=null;const u=e.candidateEmbedView,h=i.validate;for(let d=a.length-1;d>=0;d-=1){const g=a[d];if(u&&u.cell.id===g.id){l=u;break}else{const p=g.findView(r);if(h&&X(h,r,{child:this.cell,parent:p.cell,childView:this,parentView:p})){l=p;break}}}this.clearEmbedding(e),l&&l.highlight(null,{type:"embedding"}),e.candidateEmbedView=l;const f=r.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:s,node:s,view:r.findViewByCell(s),x:f.x,y:f.y,currentParent:s.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const s=e.cell||this.cell,r=e.graph||this.graph,i=r.findViewByCell(s),o=s.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(s,void 0,{ui:!0})):o&&o.unembed(s,{ui:!0}),r.model.getConnectedEdges(s,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),i&&a){const l=r.snapToGrid(t.clientX,t.clientY);i.notify("node:embedded",{e:t,cell:s,x:l.x,y:l.y,node:s,view:r.findViewByCell(s),previousParent:o,currentParent:s.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.findViewByCell(t)}return null}validateMagnet(t,e,s){if(e.getAttribute("magnet")!=="passive"){const r=this.graph.options.connecting.validateMagnet;return r?X(r,this.graph,{e:s,magnet:e,view:t,cell:t.cell}):!0}return!1}startMagnetDragging(t,e,s){if(!this.can("magnetConnectable"))return;t.stopPropagation();const r=t.currentTarget,i=this.graph;this.setEventData(t,{targetMagnet:r}),this.validateMagnet(this,r,t)?(i.options.magnetThreshold<=0&&this.startConnectting(t,r,e,s),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,s),i.view.delegateDragEvents(t,this)}startConnectting(t,e,s,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(e,s,r);i.setEventData(t,i.prepareArrowheadDragging("target",{x:s,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:i}),i.notifyMouseDown(t,s,r)}getDefaultEdge(t,e){let s;const r=this.graph.options.connecting.createEdge;return r&&(s=X(r,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),s}createEdgeFromMagnet(t,e,s){const r=this.graph,i=r.model,o=this.getDefaultEdge(this,t);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(t,e,s,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:e,y:s})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(t,e,s){const r=this.getEventData(t),i=r.edgeView;if(i)i.onMouseMove(t,e,s),this.autoScrollGraph(t.clientX,t.clientY);else{const o=this.graph,a=o.options.magnetThreshold,l=this.getEventTarget(t),u=r.targetMagnet;if(a==="onleave"){if(u===l||u.contains(l))return}else if(o.view.getMouseMovedCount(t)<=a)return;this.startConnectting(t,u,e,s)}}stopMagnetDragging(t,e,s){const i=this.eventData(t).edgeView;i&&(i.onMouseUp(t,e,s),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,s){this.notify("node:unhandled:mousedown",{e:t,x:e,y:s,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,s,r,i){let o=[i];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(i)&&(o=l.filter(u=>u.isNode()))}o.forEach(l=>{this.notify(t,{e,x:s,y:r,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(t){const e=this.graph.options.translating.restrict,s=typeof e=="function"?X(e,this.graph,t):e;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}startNodeDragging(t,e,s){const r=this.getDelegatedView();if(r==null||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,s);this.setEventData(t,{targetView:r,action:"move"});const i=O.create(r.cell.getPosition());r.setEventData(t,{moving:!1,offset:i.diff(e,s),restrict:this.getRestrictArea(r)})}dragNode(t,e,s){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(t),l=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,s,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=wt.snapToGrid(e+l.x,o),f=wt.snapToGrid(s+l.y,o);r.setPosition(h,f,{restrict:u,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}stopNodeDragging(t,e,s){const r=this.getEventData(t);r.embedding&&this.finalizeEmbedding(t,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,s,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(t,e){const s=this.graph.getPlugin("scroller");s&&s.autoScroll(t,e)}}(function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.findPortElem=="function"&&typeof r.resize=="function"&&typeof r.rotate=="function"&&typeof r.translate=="function"}n.isNodeView=t})(hn||(hn={})),hn.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),hn.registry.register("node",hn,!0);var PV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Xn extends Ht{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return Xn.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const s=this.cell.getSource();return new z(s.x,s.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new z(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const s=this.cell.getTarget();return new z(s.x,s.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new z(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let s=t;if(this.hasAction(s,"source")){if(!this.updateTerminalProperties("source"))return s;s=this.removeAction(s,"source")}if(this.hasAction(s,"target")){if(!this.updateTerminalProperties("target"))return s;s=this.removeAction(s,"target")}return this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","labels","tools"]),s):(s=this.handleAction(s,"update",()=>this.update(e)),s=this.handleAction(s,"labels",()=>this.onLabelsChange(e)),s=this.handleAction(s,"tools",()=>this.renderTools()),s)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}customizeLabels(){if(this.labelContainer){const t=this.cell,e=t.labels;for(let s=0,r=e.length;s<r;s+=1){const i=e[s],o=this.labelCache[s],a=this.labelSelectors[s],l=this.graph.options.onEdgeLabelRendered;if(l){const u=l({edge:t,label:i,container:o,selectors:a});u&&(this.labelDestroyFn[s]=u)}}}}destroyCustomizeLabels(){const t=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let e=0,s=t.length;e<s;e+=1){const r=this.labelDestroyFn[e],i=this.labelCache[e],o=this.labelSelectors[e];r&&i&&o&&r({edge:this.cell,label:t[e],container:i,selectors:o})}this.labelDestroyFn={}}renderLabels(){const t=this.cell,e=t.getLabels(),s=e.length;let r=this.labelContainer;if(this.labelCache={},this.labelSelectors={},s<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=cn("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let i=0,o=e.length;i<o;i+=1){const a=e[i],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,h;if(l)u=l.node,h=l.selectors;else{const d=t.getDefaultLabel(),g=this.normalizeLabelMarkup(this.parseLabelMarkup(d.markup));u=g.node,h=g.selectors}u.setAttribute("data-index",`${i}`),r.appendChild(u);const f=this.rootSelector;if(h[f])throw new Error("Ambiguous label root selector.");h[f]=u,this.labelCache[i]=u,this.labelSelectors[i]=h}return r.parentNode==null&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(t={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(e==null)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const s=t.propertyPathArray||[],r=s.length;if(r>1){const i=s[1];if(e[i]){if(r===2)return typeof t.propertyValue=="object"&&ca(t.propertyValue,"markup");if(s[2]!=="markup")return!1}}}return!0}parseLabelMarkup(t){return t?typeof t=="string"?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=tt.createVectors(t),s=document.createDocumentFragment();for(let r=0,i=e.length;r<i;r+=1){const o=e[r].node;s.appendChild(o)}return{fragment:s,selectors:{}}}normalizeLabelMarkup(t){if(t==null)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let s;const r=e.childNodes;return r.length>1||r[0].nodeName.toUpperCase()!=="G"?s=tt.create("g").append(e):s=tt.create(r[0]),s.addClass(this.prefixClassName("edge-label")),{node:s.node,selectors:t.selectors}}updateLabels(){if(this.labelContainer){const t=this.cell,e=t.labels,s=this.can("edgeLabelMovable"),r=t.getDefaultLabel();for(let i=0,o=e.length;i<o;i+=1){const a=this.labelCache[i],l=this.labelSelectors[i];a.setAttribute("cursor",s?"move":"default");const u=e[i],h=Yt({},r.attrs,u.attrs);this.updateAttrs(a,h,{selectors:l,rootBBox:u.size?z.fromSize(u.size):void 0})}}}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}update(t={}){this.cleanCache(),this.updateConnection(t);const e=this.cell.getAttrs(),s=PV(e,["text"]);return s!=null&&this.updateAttrs(this.container,s,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(t),this}removeRedundantLinearVertices(t={}){const e=this.cell,s=e.getVertices(),r=[this.sourceAnchor,...s,this.targetAnchor],i=r.length,o=new zt(r);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),l=a.length;return i===l?0:(e.setVertices(a.slice(1,l-1),t),i-l)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return O.create(this.sourceAnchor);case"target":return O.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return O.create(this.sourcePoint);case"target":return O.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const s=this.sourceView;return s?this.sourceMagnet||s.container:null}case"target":{if(e.raw)return this.targetMagnet;const s=this.targetView;return s?this.targetMagnet||s.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const s=t.tx||0,r=t.ty||0;this.routePoints=new zt(this.routePoints).translate(s,r).points,this.translateConnectionPoints(s,r),this.path.translate(s,r)}else{const s=e.getVertices(),r=this.findAnchors(s);this.sourceAnchor=r.source,this.targetAnchor=r.target,this.routePoints=this.findRoutePoints(s);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,s=e.source,r=e.target,i=t[0],o=t[t.length-1];return r.priority&&!s.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(t,e,s,r){let i,o;const a=this.cell,l=a[t],u=a[s],h=this.getTerminalView(t),f=this.getTerminalView(s),d=this.getTerminalMagnet(t),g=this.getTerminalMagnet(s);if(h){let p;e?p=O.create(e):f?p=g:p=O.create(u),i=this.getAnchor(l.anchor,h,d,p,t)}else i=O.create(l);if(f){const p=O.create(r||i);o=this.getAnchor(u.anchor,f,g,p,s)}else o=O.isPointLike(u)?O.create(u):new O;return{[t]:i,[s]:o}}getAnchor(t,e,s,r,i){const o=e.isEdgeElement(s),a=this.graph.options.connecting;let l=typeof t=="string"?{name:t}:t;if(!l){const f=o?(i==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(i==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof f=="string"?{name:f}:f}if(!l)throw new Error("Anchor should be specified.");let u;const h=l.name;if(o){const f=Xr.registry.get(h);if(typeof f!="function")return Xr.registry.onNotFound(h);u=X(f,this,e,s,r,l.args||{},i)}else{const f=Jr.registry.get(h);if(typeof f!="function")return Jr.registry.onNotFound(h);u=X(f,this,e,s,r,l.args||{},i)}return u?u.round(this.POINT_ROUNDING):new O}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||Ms.presets.normal,s=this.cell.getRouter()||e;let r;if(typeof s=="function")r=X(s,this,t,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ms.registry.get(i):Ms.presets.normal;if(typeof a!="function")return Ms.registry.onNotFound(i);r=X(a,this,t,o,this)}return r==null?t.map(i=>O.create(i)):r.map(i=>O.create(i))}findConnectionPoints(t,e,s){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),l=this.sourceView,u=this.targetView,h=t[0],f=t[t.length-1];let d;if(l&&!l.isEdgeElement(this.sourceMagnet)){const p=this.sourceMagnet||l.container,m=h||s,y=new W(m,e),b=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;d=this.getConnectionPoint(b,l,p,y,"source")}else d=e;let g;if(u&&!u.isEdgeElement(this.targetMagnet)){const p=this.targetMagnet||u.container,m=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,y=f||e,b=new W(y,s);g=this.getConnectionPoint(m,u,p,b,"target")}else g=s;return{source:d,target:g}}getConnectionPoint(t,e,s,r,i){const o=r.end;if(t==null)return o;const a=typeof t=="string"?t:t.name,l=typeof t=="string"?{}:t.args,u=Kr.registry.get(a);if(typeof u!="function")return Kr.registry.onNotFound(a);const h=X(u,this,r,e,s,l||{},i);return h?h.round(this.POINT_ROUNDING):o}findMarkerPoints(t,e,s){const r=f=>{const d=this.cell.getAttrs(),g=Object.keys(d);for(let p=0,m=g.length;p<m;p+=1){const y=d[g[p]];if(y[`${f}Marker`]||y[`${f}-marker`]){const b=y.strokeWidth||y["stroke-width"];if(b)return parseFloat(b);break}}return null},i=t[0],o=t[t.length-1];let a,l;const u=r("source");u&&(a=e.clone().move(i||s,-u));const h=r("target");return h&&(l=s.clone().move(o||e,-h)),this.sourceMarkerPoint=a||e.clone(),this.targetMarkerPoint=l||s.clone(),{source:a,target:l}}findPath(t,e,s){const r=this.cell.getConnector()||this.graph.options.connecting.connector;let i,o,a;if(typeof r=="string"?i=r:(i=r.name,o=r.args),i){const u=tr.registry.get(i);if(typeof u!="function")return tr.registry.onNotFound(i);a=u}else a=tr.presets.normal;const l=X(a,this,e,s,t,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof l=="string"?Z.parse(l):l}translateConnectionPoints(t,e){this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e),this.sourceMarkerPoint.translate(t,e),this.targetMarkerPoint.translate(t,e)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const e=this.cell,s=e.getLabels();if(s.length===0)return this;const r=e.getDefaultLabel(),i=this.normalizeLabelPosition(r.position);for(let o=0,a=s.length;o<a;o+=1){const l=s[o],u=this.labelCache[o];if(!u)continue;const h=this.normalizeLabelPosition(l.position),f=Yt({},i,h),d=this.getLabelTransformationMatrix(f);u.setAttribute("transform",Br(d))}return this}updateTerminalProperties(t){const e=this.cell,s=this.graph,r=e[t],i=r&&r.cell,o=`${t}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(t),!0;const a=s.getCellById(i);if(!a)throw new Error(`Edge's ${t} node with id "${i}" not exists`);const l=a.findView(s);return l?(this[o]=l,this.updateTerminalMagnet(t),!0):!1}updateTerminalMagnet(t){const e=`${t}Magnet`,s=this.getTerminalView(t);if(s){let r=s.getMagnetFromEdgeTerminal(this.cell[t]);r===s.container&&(r=null),this[e]=r}else this[e]=null}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&typeof e.position=="object"&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&typeof e.position=="object")return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&typeof t.position=="object")return t.position.options}mergeLabelPositionArgs(t,e){return t===null?null:t===void 0?e===null?null:e:Yt({},e,t)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const t=this.cache.pathCache;return ca(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const t=this.cache.pathCache;return ca(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const t=this.cache.pathCache;return ca(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return this.path==null?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return this.path==null?null:(Yn(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return this.path==null?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return this.path==null?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return this.path==null?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return this.path==null?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return this.path==null?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,s,r){const i={distance:0};let o=0,a;typeof s=="number"?(o=s,a=r):a=s,a!=null&&(i.options=a);const l=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),h=a&&a.absoluteDistance&&a.reverseDistance,f=this.path,d={segmentSubdivisions:this.getConnectionSubdivisions()},g=new O(t,e),p=f.closestPointT(g,d),m=this.getConnectionLength()||0;let y=f.lengthAtT(p,d);u&&(y=m>0?y/m:0),h&&(y=-1*(m-y)||1),i.distance=y;let b;l||(b=f.tangentAtT(p));let w;if(b)w=b.pointOffset(g);else{const x=f.pointAtT(p),v=g.diff(x);w={x:v.x,y:v.y}}return i.offset=w,i.angle=o,i}normalizeLabelPosition(t){return typeof t=="number"?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),s=e.options||{},r=e.angle||0,i=e.distance,o=i>0&&i<=1;let a=0;const l={x:0,y:0},u=e.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(l.x=u.x),u.y!=null&&(l.y=u.y)));const h=l.x!==0||l.y!==0||a===0,f=s.keepGradient,d=s.ensureLegibility,g=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},m=o?i*this.getConnectionLength():i,y=g.tangentAtLength(m,p);let b,w=r;if(y){if(h)b=y.start,b.translate(l);else{const x=y.clone();x.rotate(-90,y.start),x.setLength(a),b=x.end}f&&(w=y.angle()+r,d&&(w=gt.normalize((w+90)%180-90)))}else b=g.start,h&&b.translate(l);return ne().translate(b.x,b.y).rotate(w)}getVertexIndex(t,e){const r=this.cell.getVertices(),i=this.getClosestPointLength(new O(t,e));let o=0;if(i!=null)for(const a=r.length;o<a;o+=1){const l=r[o],u=this.getClosestPointLength(l);if(u!=null&&i<u)break}return o}getEventArgs(t,e,s){const r=this,i=r.cell,o=i;return e==null||s==null?{e:t,view:r,edge:i,cell:o}:{e:t,x:e,y:s,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(t,e,s){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,s){super.onMouseDown(t,e,s),this.notify("edge:mousedown",this.getEventArgs(t,e,s))}notifyMouseMove(t,e,s){super.onMouseMove(t,e,s),this.notify("edge:mousemove",this.getEventArgs(t,e,s))}notifyMouseUp(t,e,s){super.onMouseUp(t,e,s),this.notify("edge:mouseup",this.getEventArgs(t,e,s))}onClick(t,e,s){super.onClick(t,e,s),this.notify("edge:click",this.getEventArgs(t,e,s))}onDblClick(t,e,s){super.onDblClick(t,e,s),this.notify("edge:dblclick",this.getEventArgs(t,e,s))}onContextMenu(t,e,s){super.onContextMenu(t,e,s),this.notify("edge:contextmenu",this.getEventArgs(t,e,s))}onMouseDown(t,e,s){this.notifyMouseDown(t,e,s),this.startEdgeDragging(t,e,s)}onMouseMove(t,e,s){const r=this.getEventData(t);switch(r.action){case"drag-label":{this.dragLabel(t,e,s);break}case"drag-arrowhead":{this.dragArrowhead(t,e,s);break}case"drag-edge":{this.dragEdge(t,e,s);break}}return this.notifyMouseMove(t,e,s),r}onMouseUp(t,e,s){const r=this.getEventData(t);switch(r.action){case"drag-label":{this.stopLabelDragging(t,e,s);break}case"drag-arrowhead":{this.stopArrowheadDragging(t,e,s);break}case"drag-edge":{this.stopEdgeDragging(t,e,s);break}}return this.notifyMouseUp(t,e,s),this.checkMouseleave(t),r}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,s,r){super.onMouseWheel(t,e,s,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,s)))}onCustomEvent(t,e,s,r){if(ry(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if(e==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,s,r)))}this.notifyMouseDown(t,s,r)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,s,r))),super.onCustomEvent(t,e,s,r)}onLabelMouseDown(t,e,s){this.notifyMouseDown(t,e,s),this.startLabelDragging(t,e,s),this.getEventData(t).stopPropagation&&t.stopPropagation()}startEdgeDragging(t,e,s){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(t,e,s);return}this.setEventData(t,{x:e,y:s,moving:!1,action:"drag-edge"})}dragEdge(t,e,s){const r=this.getEventData(t);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-r.x,s-r.y,{ui:!0}),this.setEventData(t,{x:e,y:s}),this.notify("edge:moving",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,s){const r=this.getEventData(t);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(t,e){const s=this.getTerminalMagnet(t),r={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:e.isNewEdge===!0,terminalType:t,initialMagnet:s,initialTerminal:yc(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(t){const e=[];e[4]=t,e[5]=this;let s,r=0,i=0;t==="source"?(r=2,s="target"):(i=2,s="source");const o=this.cell[s],a=o.cell;if(a){let l;const u=e[r]=this.graph.findViewByCell(a);u&&(l=u.getMagnetFromEdgeTerminal(o),l===u.container&&(l=void 0)),e[r+1]=l}return(l,u)=>(e[i]=l,e[i+1]=l.container===u?void 0:u,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){t.zIndex!=null&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}validateConnection(t,e,s,r,i,o,a){const l=this.graph.options.connecting,u=l.allowLoop,h=l.allowNode,f=l.allowEdge,d=l.allowPort,g=l.allowMulti,p=l.validateConnection,m=o?o.cell:null,y=i==="target"?s:t,b=i==="target"?r:e;let w=!0;const x=v=>{const S=i==="source"?a?a.port:null:m?m.getSourcePortId():null,E=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return X(v,this.graph,{edge:m,edgeView:o,sourceView:t,targetView:s,sourcePort:S,targetPort:E,sourceMagnet:e,targetMagnet:r,sourceCell:t?t.cell:null,targetCell:s?s.cell:null,type:i})};if(u!=null&&(typeof u=="boolean"?!u&&t===s&&(w=!1):w=x(u)),w&&d!=null&&(typeof d=="boolean"?!d&&b&&(w=!1):w=x(d)),w&&f!=null&&(typeof f=="boolean"?!f&&Xn.isEdgeView(y)&&(w=!1):w=x(f)),w&&h!=null&&b==null&&(typeof h=="boolean"?!h&&hn.isNodeView(y)&&(w=!1):w=x(h)),w&&g!=null&&o){const v=o.cell,S=i==="source"?a:v.getSource(),E=i==="target"?a:v.getTarget(),C=a?this.graph.getCellById(a.cell):null;if(S&&E&&S.cell&&E.cell&&C)if(typeof g=="function")w=x(g);else{const M=this.graph.model.getConnectedEdges(C,{outgoing:i==="source",incoming:i==="target"});M.length&&(g==="withPort"?M.some(k=>{const _=k.getSource(),D=k.getTarget();return _&&D&&_.cell===S.cell&&D.cell===E.cell&&_.port!=null&&_.port===S.port&&D.port!=null&&D.port===E.port})&&(w=!1):g||M.some(k=>{const _=k.getSource(),D=k.getTarget();return _&&D&&_.cell===S.cell&&D.cell===E.cell})&&(w=!1))}}return w&&p!=null&&(w=x(p)),w}allowConnectToBlank(t){const e=this.graph,r=e.options.connecting.allowBlank;if(typeof r!="function")return!!r;const i=e.findViewByCell(t),o=t.getSourceCell(),a=t.getTargetCell(),l=e.findViewByCell(o),u=e.findViewByCell(a);return X(r,e,{edge:t,edgeView:i,sourceCell:o,targetCell:a,sourceView:l,targetView:u,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(t,e,s){const r=this.graph;if(!this.allowConnectToBlank(t)){const o=t.getSourceCellId(),a=t.getTargetCellId();if(!(o&&a))return!1}const i=r.options.connecting.validateEdge;return i?X(i,r,{edge:t,type:e,previous:s}):!0}arrowheadDragging(t,e,s,r){r.x=e,r.y=s,r.currentTarget!==t&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(t),r.currentView?(r.currentMagnet=r.currentView.findMagnet(t),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,e,s,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=t,this.cell.prop(r.terminalType,{x:e,y:s},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(t,e,s){const r=t.currentView,i=t.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=t.terminalType,a=r.getEdgeTerminal(i,e,s,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(t,e,s){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a=typeof i=="object"&&i.radius||50,l=typeof i=="object"&&i.anchor||"center",u=r.renderer.findViewsInArea({x:t-a,y:e-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=r.renderer.findEdgeViewsFromPoint({x:t,y:e},a).filter(S=>S!==this);u.push(...v)}const h=s.closestView||null,f=s.closestMagnet||null;s.closestView=null,s.closestMagnet=null;let d,g=Number.MAX_SAFE_INTEGER;const p=new O(t,e);u.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())d=l==="center"?v.cell.getBBox().getCenter().distance(p):v.cell.getBBox().getNearestPointToPoint(p).distance(p);else if(v.isEdgeView()){const S=v.getClosestPoint(p);S?d=S.distance(p):d=Number.MAX_SAFE_INTEGER}d<a&&d<g&&(f===v.container||this.validateConnection(...s.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,t,e,this.cell,s.terminalType)))&&(g=d,s.closestView=v,s.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(S=>{if(S.getAttribute("magnet")!=="false"){const E=v.getBBoxOfElement(S);d=p.distance(E.getCenter()),d<a&&d<g&&(f===S||this.validateConnection(...s.getValidateConnectionArgs(v,S),v.getEdgeTerminal(S,t,e,this.cell,s.terminalType)))&&(g=d,s.closestView=v,s.closestMagnet=S)}})});let m;const y=s.terminalType,b=s.closestView,w=s.closestMagnet,x=f!==w;if(h&&x&&h.unhighlight(f,{type:"magnetAdsorbed"}),b){if(!x)return;b.highlight(w,{type:"magnetAdsorbed"}),m=b.getEdgeTerminal(w,t,e,this.cell,y)}else m={x:t,y:e};this.cell.setTerminal(y,m,{},Object.assign(Object.assign({},s.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,s=t.closestMagnet;e&&s&&(e.unhighlight(s,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(s)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const s=t.terminalType,r=t.initialTerminal,i=this.cell[s];if(i&&!jt.equalTerminals(r,i)){const a=this.graph,l=r,u=l.cell?a.getCellById(l.cell):null,h=l.port,f=u?a.findViewByCell(u):null,d=u||t.isNewEdge?null:O.create(r).toJSON(),g=i,p=g.cell?a.getCellById(g.cell):null,m=g.port,y=p?a.findViewByCell(p):null,b=p?null:O.create(i).toJSON();this.notify("edge:connected",{e,previousCell:u,previousPort:h,previousView:f,previousPoint:d,currentCell:p,currentView:y,currentPort:m,currentPoint:b,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:s,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,s=e.model.getCells();t.marked={};for(let r=0,i=s.length;r<i;r+=1){const o=e.findViewByCell(s[r]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const l=a.filter(u=>this.validateConnection(...t.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,t.x,t.y,this.cell,t.terminalType)));if(l.length>0){for(let u=0,h=l.length;u<h;u+=1)o.highlight(l[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),t.marked[o.cell.id]=l}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(s=>{const r=this.graph.findViewByCell(s);r&&(e[s].forEach(o=>{r.unhighlight(o,{type:"magnetAvailable"})}),r.unhighlight(null,{type:"nodeAvailable"}))}),t.marked=null}startArrowheadDragging(t,e,s){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(t,e,s);return}const i=t.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:e,y:s});this.setEventData(t,o)}dragArrowhead(t,e,s){const r=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,s,r):this.arrowheadDragging(this.getEventTarget(t),e,s,r)}stopArrowheadDragging(t,e,s){const r=this.graph,i=this.getEventData(t);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,e,s),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,t)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(t,e,s){if(this.can("edgeLabelMovable")){const r=t.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),a=this.getLabelPositionArgs(i),l=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,l);this.setEventData(t,{index:i,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,s){const r=this.getEventData(t),i=this.cell.getLabelAt(r.index),o=Yt({},i,{position:this.getLabelPosition(e,s,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)}stopLabelDragging(t,e,s){}}(function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.getConnection=="function"}n.isEdgeView=t})(Xn||(Xn={})),Xn.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),Xn.registry.register("edge",Xn,!0);var AV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Mn extends pt{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(t){super(),this.graph=t;const{selectors:e,fragment:s}=_t.parseJSONMarkup(Mn.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=Mn.snapshoot(this.container),J(this.container,this.prefixClassName("graph")),Ne(this.container,s),this.delegateEvents()}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return t.type==="mousedown"&&t.button===2||this.options.guard&&this.options.guard(t,e)?!0:t.data&&t.data.guarded!==void 0?t.data.guarded:!(e&&e.cell&&ht.isCell(e.cell)||this.svg===t.target||this.container===t.target||this.svg.contains(t.target))}findView(t){return this.graph.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onDblClick(e,r.x,r.y):this.graph.trigger("blank:dblclick",{e,x:r.x,y:r.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onClick(e,r.x,r.y):this.graph.trigger("blank:click",{e,x:r.x,y:r.y})}}isPreventDefaultContextMenu(t){let e=this.options.preventDefaultContextMenu;return typeof e=="function"&&(e=X(e,this.graph,{view:t})),e}onContextMenu(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.isPreventDefaultContextMenu(s)&&t.preventDefault(),this.guard(e,s))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onContextMenu(e,r.x,r.y):this.graph.trigger("blank:contextmenu",{e,x:r.x,y:r.y})}delegateDragEvents(t,e){t.data==null&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const s=this.constructor;this.delegateDocumentEvents(s.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){return this.getEventData(t).mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;this.options.preventDefaultMouseDown&&t.preventDefault();const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onMouseDown(e,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&t.preventDefault(),this.graph.trigger("blank:mousedown",{e,x:r.x,y:r.y})),this.delegateDragEvents(e,s)}onMouseMove(t){const e=this.getEventData(t),s=e.startPosition;if(s&&s.x===t.clientX&&s.y===t.clientY||(e.mouseMovedCount==null&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,e.mouseMovedCount<=this.options.moveThreshold))return;const i=this.normalizeEvent(t),o=this.graph.snapToGrid(i.clientX,i.clientY),a=e.currentView;a?a.onMouseMove(i,o.x,o.y):this.graph.trigger("blank:mousemove",{e:i,x:o.x,y:o.y}),this.setEventData(i,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),s=this.graph.snapToGrid(e.clientX,e.clientY),i=this.getEventData(t).currentView;if(i?i.onMouseUp(e,s.x,s.y):this.graph.trigger("blank:mouseup",{e,x:s.x,y:s.y}),!t.isPropagationStopped()){const o=new En(t,{type:"click",data:t.data});this.onClick(o)}t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(!this.guard(e,s))if(s)s.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e})}}onMouseOut(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(!this.guard(e,s))if(s)s.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e})}}onMouseEnter(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.findViewByElem(e.relatedTarget);if(s){if(r===s)return;s.onMouseEnter(e)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e})}}onMouseLeave(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.findViewByElem(e.relatedTarget);if(s){if(r===s)return;s.onMouseLeave(e)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e})}}onMouseWheel(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=e.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));s?s.onMouseWheel(e,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e,delta:o,x:i.x,y:i.y})}onCustomEvent(t){const e=t.currentTarget,s=e.getAttribute("event")||e.getAttribute("data-event");if(s){const r=this.findView(e);if(r){const i=this.normalizeEvent(t);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,s,o.x,o.y)}}}handleMagnetEvent(t,e){const s=t.currentTarget,r=s.getAttribute("magnet");if(r&&r.toLowerCase()!=="false"){const i=this.findView(s);if(i){const o=this.normalizeEvent(t);if(this.guard(o,i))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);X(e,this.graph,i,o,s,a.x,a.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(e,s,r,i,o)=>{e.onMagnetMouseDown(s,r,i,o)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(e,s,r,i,o)=>{e.onMagnetDblClick(s,r,i,o)})}onMagnetContextMenu(t){const e=this.findView(t.target);this.isPreventDefaultContextMenu(e)&&t.preventDefault(),this.handleMagnetEvent(t,(s,r,i,o,a)=>{s.onMagnetContextMenu(r,i,o,a)})}onLabelMouseDown(t){const e=t.currentTarget,s=this.findView(e);if(s){const r=this.normalizeEvent(t);if(this.guard(r,s))return;const i=this.graph.snapToGrid(r.clientX,r.clientY);s.onLabelMouseDown(r,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}AV([pt.dispose()],Mn.prototype,"dispose",null),function(n){const t=`${Ue.prefixCls}-graph`;n.markup=[{ns:ee.xhtml,tagName:"div",selector:"background",className:`${t}-background`},{ns:ee.xhtml,tagName:"div",selector:"grid",className:`${t}-grid`},{ns:ee.svg,tagName:"svg",selector:"svg",className:`${t}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":ee.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${t}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${t}-svg-primer`},{tagName:"g",selector:"stage",className:`${t}-svg-stage`},{tagName:"g",selector:"decorator",className:`${t}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${t}-svg-overlay`}]}]}];function e(s){const r=s.cloneNode();return s.childNodes.forEach(i=>r.appendChild(i)),()=>{for(qi(s);s.attributes.length>0;)s.removeAttribute(s.attributes[0].name);for(let i=0,o=r.attributes.length;i<o;i+=1){const a=r.attributes[i];s.setAttribute(a.name,a.value)}r.childNodes.forEach(i=>s.appendChild(i))}}n.snapshoot=e}(Mn||(Mn={})),function(n){const t=Ue.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${t}-cell`]:"onMouseEnter",[`mouseleave .${t}-cell`]:"onMouseLeave",[`mouseenter .${t}-cell-tools`]:"onMouseEnter",[`mouseleave .${t}-cell-tools`]:"onMouseLeave",[`mousedown .${t}-cell [event]`]:"onCustomEvent",[`touchstart .${t}-cell [event]`]:"onCustomEvent",[`mousedown .${t}-cell [data-event]`]:"onCustomEvent",[`touchstart .${t}-cell [data-event]`]:"onCustomEvent",[`dblclick .${t}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${t}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${t}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${t}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${t}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${t}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${t}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${t}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${t}-cell image`]:"onImageDragStart",[`mousedown .${t}-edge .${t}-edge-label`]:"onLabelMouseDown",[`touchstart .${t}-edge .${t}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(Mn||(Mn={}));const TV=`.x6-graph {
|
|
120
|
+
`;return s.raw?Z.parse(l):l},lV=function(n,t,e,s={}){const r=new Z;r.appendSegment(Z.createSegment("M",n));const i=1/3,o=2/3,a=s.radius||10;let l,u;for(let h=0,f=e.length;h<f;h+=1){const d=O.create(e[h]),g=e[h-1]||n,p=e[h+1]||t;l=u||d.distance(g)/2,u=d.distance(p)/2;const m=-Math.min(a,l),y=-Math.min(a,u),b=d.clone().move(g,m).round(),w=d.clone().move(p,y).round(),x=new O(i*b.x+o*d.x,o*d.y+i*b.y),v=new O(i*w.x+o*d.x,o*d.y+i*w.y);r.appendSegment(Z.createSegment("L",b)),r.appendSegment(Z.createSegment("C",x,v,w))}return r.appendSegment(Z.createSegment("L",t)),s.raw?r:r.serialize()},cV=function(n,t,e,s={}){let r,i=s.direction;if(e&&e.length!==0){const o=[n,...e,t],a=Bt.throughPoints(o);r=new Z(a)}else if(r=new Z,r.appendSegment(Z.createSegment("M",n)),i||(i=Math.abs(n.x-t.x)>=Math.abs(n.y-t.y)?"H":"V"),i==="H"){const o=(n.x+t.x)/2;r.appendSegment(Z.createSegment("C",o,n.y,o,t.y,t.x,t.y))}else{const o=(n.y+t.y)/2;r.appendSegment(Z.createSegment("C",n.x,o,t.x,o,t.x,t.y))}return s.raw?r:r.serialize()},Mb=1,cl=1/3,ul=2/3;function uV(n){let t=n.graph._jumpOverUpdateList;if(t==null&&(t=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const e=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let s=0;s<e.length;s+=1)e[s].update()})}),n.graph.on("model:reseted",()=>{t=n.graph._jumpOverUpdateList=[]})),t.indexOf(n)<0){t.push(n);const e=()=>t.splice(t.indexOf(n),1);n.cell.once("change:connector",e),n.cell.once("removed",e)}}function rh(n,t,e=[]){const s=[n,...e,t],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new W(i,a))}),r}function hV(n,t){const e=[];return t.forEach(s=>{const r=n.intersectsWithLine(s);r&&e.push(r)}),e}function Pb(n,t){return new W(n,t).squaredLength()}function dV(n,t,e){return t.reduce((s,r,i)=>{if(hl.includes(r))return s;const o=s.pop()||n,a=O.create(r).move(o.start,-e);let l=O.create(r).move(o.start,+e);const u=t[i+1];if(u!=null){const d=l.distance(u);d<=e&&(l=u.move(o.start,d),hl.push(u))}else if(a.distance(o.end)<e*2+Mb)return s.push(o),s;if(l.distance(o.start)<e*2+Mb)return s.push(o),s;const f=new W(a,l);return ho.push(f),s.push(new W(o.start,a),f,new W(l,o.end)),s},[])}function Ab(n,t,e,s){const r=new Z;let i;return i=Z.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(ho.includes(o)){let l,u,h,f;if(e==="arc"){l=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(l+=180);const g=o.getCenter(),p=new W(g,o.end).rotate(l,g);let m;m=new W(o.start,g),h=m.pointAt(2/3).rotate(l,o.start),f=p.pointAt(1/3).rotate(-l,p.end),i=Z.createSegment("C",h,f,p.end),r.appendSegment(i),m=new W(g,o.end),h=p.pointAt(1/3).rotate(l,p.end),f=m.pointAt(1/3).rotate(-l,o.end),i=Z.createSegment("C",h,f,o.end),r.appendSegment(i)}else if(e==="gap")i=Z.createSegment("M",o.end),r.appendSegment(i);else if(e==="cubic"){l=o.start.theta(o.end);const d=t*.6;let g=t*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(g*=-1),h=new O(o.start.x+d,o.start.y+g).rotate(l,o.start),f=new O(o.end.x-d,o.end.y+g).rotate(l,o.end),i=Z.createSegment("C",h,f,o.end),r.appendSegment(i)}}else{const l=n[a+1];s===0||!l||ho.includes(l)?(i=Z.createSegment("L",o.end),r.appendSegment(i)):fV(s,r,o.end,o.start,l.end)}}),r}function fV(n,t,e,s,r){const i=e.distance(s)/2,o=e.distance(r)/2,a=-Math.min(n,i),l=-Math.min(n,o),u=e.clone().move(s,a).round(),h=e.clone().move(r,l).round(),f=new O(cl*u.x+ul*e.x,ul*e.y+cl*u.y),d=new O(cl*h.x+ul*e.x,ul*e.y+cl*h.y);let g;g=Z.createSegment("L",u),t.appendSegment(g),g=Z.createSegment("C",f,d,h),t.appendSegment(g)}let ho,hl;const gV=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,t,e,s={}){ho=[],hl=[],uV(this);const r=s.size||5,i=s.type||"arc",o=s.radius||0,a=s.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(h.length===1)return Ab(rh(n,t,e),r,i,o);const f=this.cell,d=h.indexOf(f),g=l.options.connecting.connector||{},p=h.filter((v,S)=>{const E=v.getConnector()||g;return a.includes(E.name)?!1:S>d?E.name!=="jumpover":!0}),m=p.map(v=>l.findViewByCell(v)),y=rh(n,t,e),b=m.map(v=>v==null?[]:v===this?y:rh(v.sourcePoint,v.targetPoint,v.routePoints)),w=[];y.forEach(v=>{const S=p.reduce((E,C,M)=>{if(C!==f){const T=hV(v,b[M]);E.push(...T)}return E},[]).sort((E,C)=>Pb(v.start,E)-Pb(v.start,C));S.length>0?w.push(...dV(v,S,r)):w.push(v)});const x=Ab(w,r,i,o);return ho=[],hl=[],s.raw?x:x.serialize()},loop:aV,normal:oV,rounded:lV,smooth:cV},Symbol.toStringTag,{value:"Module"}));var tr;(function(n){n.presets=gV,n.registry=zt.create({type:"connector"}),n.registry.register(n.presets,!0)})(tr||(tr={}));var pV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Tb extends Nt{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(Tt(t)),this.changed={}}mutate(t,e={}){const s=e.unset===!0,r=e.silent===!0,i=[],o=this.changing;this.changing=!0,o||(this.previous=Tt(this.data),this.changed={});const a=this.data,l=this.previous,u=this.changed;if(Object.keys(t).forEach(h=>{const f=h,d=t[f];wn(a[f],d)||i.push(f),wn(l[f],d)?delete u[f]:u[f]=d,s?delete a[f]:a[f]=d}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=e,i.forEach(h=>{this.emit("change:*",{key:h,options:e,store:this,current:a[h],previous:l[h]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(t==null)return this.data;const s=this.data[t];return s??e}getPrevious(t){if(this.previous){const e=this.previous[t];return e??void 0}}set(t,e,s){return t!=null&&(typeof t=="object"?this.mutate(t,e):this.mutate({[t]:e},s)),this}remove(t,e){const r={};let i;if(typeof t=="string")r[t]=void 0,i=e;else if(Array.isArray(t))t.forEach(o=>r[o]=void 0),i=e;else{for(const o in this.data)r[o]=void 0;i=t}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(t){return Mu(this.data,t,"/")}setByPath(t,e,s={}){const r="/",i=Array.isArray(t)?[...t]:t.split(r),o=Array.isArray(t)?t.join(r):t,a=i[0],l=i.length;if(s.propertyPath=o,s.propertyValue=e,s.propertyPathArray=i,l===1)this.set(a,e,s);else{const u={};let h=u,f=a;for(let p=1;p<l;p+=1){const m=i[p],y=Number.isFinite(Number(m));h=h[f]=y?[]:{},f=m}Rr(u,i,e,r);const d=Tt(this.data);s.rewrite&&Bm(d,t,r);const g=Gt(d,u);this.set(a,g[a],s)}return this}removeByPath(t,e){const s=Array.isArray(t)?t:t.split("/"),r=s[0];if(s.length===1)this.remove(r,e);else{const i=s.slice(1),o=Tt(this.get(r));o&&Bm(o,i),this.set(r,o,e)}return this}hasChanged(t){return t==null?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(t==null)return this.hasChanged()?Tt(this.changed):null;const e=this.changing?this.previous:this.data,s={};let r;for(const i in t){const o=t[i];wn(e[i],o)||(s[i]=o,r=!0)}return r?Tt(s):null}toJSON(){return Tt(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}pV([Nt.dispose()],Tb.prototype,"dispose",null);class fo{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,s={},r="/"){const i=this.cell.getPropByPath(t),o=VP(s,fo.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,i,e);let u=0;const h=Array.isArray(t)?t.join(r):t,f=Array.isArray(t)?t:t.split(r),d=()=>{const g=new Date().getTime();u===0&&(u=g);let m=(g-u)/o.duration;m<1?this.ids[h]=requestAnimationFrame(d):m=1;const y=l(a(m));this.cell.setPropByPath(f,y),s.progress&&s.progress(Object.assign({progress:m,currentValue:y},this.getArgs(h))),m===1&&(this.cell.notify("transition:complete",this.getArgs(h)),s.complete&&s.complete(this.getArgs(h)),this.cell.notify("transition:finish",this.getArgs(h)),s.finish&&s.finish(this.getArgs(h)),this.clean(h))};return setTimeout(()=>{this.stop(t,void 0,r),this.cache[h]={startValue:i,targetValue:e,options:o},this.ids[h]=requestAnimationFrame(d),this.cell.notify("transition:start",this.getArgs(h)),s.start&&s.start(this.getArgs(h))},s.delay),this.stop.bind(this,t,r,s)}stop(t,e={},s="/"){const r=Array.isArray(t)?t:t.split(s);return Object.keys(this.ids).filter(i=>wn(r,i.split(s).slice(0,r.length))).forEach(i=>{cancelAnimationFrame(this.ids[i]);const o=this.cache[i],a=this.getArgs(i),l=Object.assign(Object.assign({},o.options),e),u=l.jumpedToEnd;u&&o.targetValue!=null&&(this.cell.setPropByPath(i,o.targetValue),this.cell.notify("transition:end",Object.assign({},a)),this.cell.notify("transition:complete",Object.assign({},a)),l.complete&&l.complete(Object.assign({},a)));const h=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},h)),l.stop&&l.stop(Object.assign({},h)),this.cell.notify("transition:finish",Object.assign({},a)),l.finish&&l.finish(Object.assign({},a)),this.clean(i)}),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return typeof t=="string"?Ks[t]:t}getInterp(t,e,s){return t?t(e,s):typeof s=="number"?Zs.number(e,s):typeof s=="string"?s[0]==="#"?Zs.color(e,s):Zs.unit(e,s):Zs.object(e,s)}getArgs(t){const e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(fo||(fo={}));var mV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Nb=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class ht extends Nt{static config(t){const{markup:e,propHooks:s,attrHooks:r}=t,i=Nb(t,["markup","propHooks","attrHooks"]);e!=null&&(this.markup=e),s&&(this.propHooks=this.propHooks.slice(),Array.isArray(s)?this.propHooks.push(...s):typeof s=="function"?this.propHooks.push(s):Object.values(s).forEach(o=>{typeof o=="function"&&this.propHooks.push(o)})),r&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),r)),this.defaults=Gt({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:Tt(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((s,r)=>r?X(r,t,s):s,e)}get[Symbol.toStringTag](){return ht.toStringTag}constructor(t={}){super();const s=this.constructor.getDefaults(!0),r=Gt({},this.preprocess(s),this.preprocess(t));this.id=r.id||za(),this.store=new Tb(r),this.animation=new fo(this),this.setup(),this.init(),this.postprocess(t)}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const s=t.id,i=this.constructor.applyPropHooks(this,t);return s==null&&e!==!0&&(i.id=za()),i}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:s,previous:r,options:i}=t;this.notify("change:*",{key:e,options:i,current:s,previous:r,cell:this}),this.notify(`change:${e}`,{options:i,current:s,previous:r,cell:this});const o=e;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:s,previous:r,options:i,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this}))}notify(t,e){this.trigger(t,e);const s=this.model;return s&&(s.notify(`cell:${t}`,e),this.isNode()?s.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&s.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return t==null?this.store.get():this.store.get(t,e)}setProp(t,e,s){if(typeof t=="string")this.store.set(t,e,s);else{const r=this.preprocess(t,!0);this.store.set(Gt({},this.getProp(),r),e),this.postprocess(t)}return this}removeProp(t,e){return typeof t=="string"||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return t==null?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,s={}){return this.model&&(t==="children"?this._children=e?e.map(r=>this.model.getCell(r)).filter(r=>r!=null):null:t==="parent"&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,s),this}removePropByPath(t,e={}){const s=Array.isArray(t)?t:t.split("/");return s[0]==="attrs"&&(e.dirty=!0),this.store.removeByPath(s,e),this}prop(t,e,s){return t==null?this.getProp():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getPropByPath(t):e==null?this.removePropByPath(t,s||{}):this.setPropByPath(t,e,s||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){t==null?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let s=e.getMaxZIndex(),r;t.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this],s=s-r.length+1;const i=e.total();let o=e.indexOf(this)!==i-r.length;o||(o=r.some((a,l)=>a.getZIndex()!==s+l)),o&&this.batchUpdate("to-front",()=>{s+=r.length,r.forEach((a,l)=>{a.setZIndex(s+l,t)})})}return this}toBack(t={}){const e=this.model;if(e){let s=e.getMinZIndex(),r;t.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this];let i=e.indexOf(this)!==0;i||(i=r.some((o,a)=>o.getZIndex()!==s+a)),i&&this.batchUpdate("to-back",()=>{s-=r.length,r.forEach((o,a)=>{o.setZIndex(s+a,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){t==null?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");return t==null&&(t=this.constructor.getMarkup()),t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){t==null?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(t==null)this.removeAttrs(e);else{const s=r=>this.store.set("attrs",r,e);if(e.overwrite===!0)s(t);else{const r=this.getAttrs();e.deep===!1?s(Object.assign(Object.assign({},r),t)):s(Gt({},r,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const s=this.constructor.getAttrHooks()||{};let r=s[t]||On.registry.get(t);if(!r){const i=na(t);r=s[i]||On.registry.get(i)}return r||null}getAttrByPath(t){return t==null||t===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,s={}){return this.setPropByPath(this.prefixAttrPath(t),e,s),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,s){return t==null?this.getAttrByPath():typeof t=="string"||Array.isArray(t)?arguments.length===1?this.getAttrByPath(t):e==null?this.removeAttrByPath(t,s||{}):this.setAttrByPath(t,e,s||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return this.store.get("visible")!==!1}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const s=typeof t=="boolean"?t:!this.isVisible(),r=typeof t=="boolean"?e:t;return s?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(t==null)this.removeData(e);else{const s=r=>this.store.set("data",r,e);if(e.overwrite===!0)s(t);else{const r=this.getData();e.deep===!1?s(typeof t=="object"?Object.assign(Object.assign({},r),t):t):s(Gt({},r,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(s=>{var r;return(r=this.model)===null||r===void 0?void 0:r.getCell(s)}).filter(s=>s!=null);return this._children=e,[...e]}return null}hasParent(){return this.parent!=null}isParentOf(t){return t!=null&&t.getParent()===this}isChildOf(t){return t!=null&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(t){return this.children==null?-1:this.children.indexOf(t)}getChildAt(t){return this.children!=null&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let s=this.getParent();for(;s;)e.push(s),s=t.deep!==!1?s.getParent():null;return e}getDescendants(t={}){if(t.deep!==!1){if(t.breadthFirst){const e=[],s=this.getChildren()||[];for(;s.length>0;){const r=s.shift(),i=r.getChildren();e.push(r),i&&s.push(...i)}return e}{const e=this.getChildren()||[];return e.forEach(s=>{e.push(...s.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(t==null)return!1;if(e.deep!==!1){let s=this.getParent();for(;s;){if(s===t)return!0;s=s.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return t==null?!1:t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return ht.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,t!=null?this.store.set("children",t.map(s=>s.id),e):this.store.remove("children",e),this}unembed(t,e={}){const s=this.children;if(s!=null&&t!=null){const r=this.getChildIndex(t);r!==-1&&(s.splice(r,1),t.setParent(null,e),this.setChildren(s,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return ht.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,s={}){return t.insertChild(this,e,s),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,s={}){if(t!=null&&t!==this){const r=t.getParent(),i=this!==r;let o=e;if(o==null&&(o=this.getChildCount(),i||(o-=1)),r){const l=r.getChildren();if(l){const u=l.indexOf(t);u>=0&&(t.setParent(null,s),l.splice(u,1),r.setChildren(l,s))}}let a=this.children;if(a==null?(a=[],a.push(t)):a.splice(o,0,t),t.setParent(this,s),this.setChildren(a,s),i&&this.model){const l=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);l&&l.forEach(h=>h.updateParent(s)),u&&u.forEach(h=>h.updateParent(s))}this.model&&this.model.addCell(t,s)}return this}removeFromParent(t={}){const e=this.getParent();if(e!=null){const s=e.getChildIndex(this);e.removeChildAt(s,t)}return this}removeChild(t,e={}){const s=this.getChildIndex(t);return this.removeChildAt(s,e)}removeChildAt(t,e={}){const s=this.getChildAt(t);return this.children!=null&&s!=null&&(this.unembed(s,e),s.remove(e)),s}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),t.deep!==!1&&this.eachChild(s=>s.remove(t)),this.model&&this.model.removeCell(this,t)}),this}transition(t,e,s={},r="/"){return this.animation.start(t,e,s,r)}stopTransition(t,e,s="/"){return this.animation.stop(t,e,s),this}getTransitions(){return this.animation.get()}translate(t,e,s){return this}scale(t,e,s,r){return this}addTools(t,e,s){const r=Array.isArray(t)?t:[t],i=typeof e=="string"?e:null,o=typeof e=="object"?e:typeof s=="object"?s:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let a=Tt(this.getTools());if(a==null||i==null||a.name===i)return a==null&&(a={}),a.items||(a.items=[]),a.name=i,a.items=[...a.items,...r],this.setTools(Object.assign({},a),o)}setTools(t,e={}){return t==null?this.removeTools():this.store.set("tools",ht.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return e==null?!1:t==null?!0:e.name===t}hasTool(t){const e=this.getTools();return e==null?!1:e.items.some(s=>typeof s=="string"?s===t:s.name===t)}removeTool(t,e={}){const s=Tt(this.getTools());if(s){let r=!1;const i=s.items.slice(),o=a=>{i.splice(a,1),r=!0};if(typeof t=="number")o(t);else for(let a=i.length-1;a>=0;a-=1){const l=i[a];(typeof l=="string"?l===t:l.name===t)&&o(a)}r&&(s.items=i,this.setTools(s,e))}return this}getBBox(t){return new z}getConnectionPoint(t,e){return new O}toJSON(t={}){const e=Object.assign({},this.store.get()),s=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const p=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${p.name||s.call(p)}"`)}const i=this.constructor,o=t.diff===!0,a=e.attrs||{},l=i.getDefaults(!0),u=o?this.preprocess(l,!0):l,h=u.attrs||{},f={};Object.entries(e).forEach(([p,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!bn(m))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${s.call(m)}" type of key "${p}" on ${r} "${this.id}"`);if(p!=="attrs"&&p!=="shape"&&o){const y=u[p];wn(m,y)&&delete e[p]}}),Object.keys(a).forEach(p=>{const m=a[p],y=h[p];Object.keys(m).forEach(b=>{const w=m[b],x=y?y[b]:null;w!=null&&typeof w=="object"&&!Array.isArray(w)?Object.keys(w).forEach(v=>{const S=w[v];if(y==null||x==null||!Lt(x)||!wn(x[v],S)){f[p]==null&&(f[p]={}),f[p][b]==null&&(f[p][b]={});const E=f[p][b];E[v]=S}}):(y==null||!wn(x,w))&&(f[p]==null&&(f[p]={}),f[p][b]=w)})});const d=Object.assign(Object.assign({},e),{attrs:ag(f)?void 0:f});d.attrs==null&&delete d.attrs;const g=d;return g.angle===0&&delete g.angle,Tt(g)}clone(t={}){if(!t.deep){const s=Object.assign({},this.store.get());t.keepId||delete s.id,delete s.parent,delete s.children;const r=this.constructor;return new r(s)}return ht.deepClone(this)[this.id]}findView(t){return t.findViewByCell(this)}startBatch(t,e={},s=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),s&&s.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},s=this.model){return s&&s.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,s){const r=this.model;this.startBatch(t,s,r);const i=e();return this.stopBatch(t,s,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}ht.defaults={},ht.attrHooks={},ht.propHooks=[],mV([Nt.dispose()],ht.prototype,"dispose",null),function(n){function t(e){return typeof e=="string"?{items:[e]}:Array.isArray(e)?{items:e}:e.items?e:{items:[e]}}n.normalizeTools=t}(ht||(ht={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"}n.isCell=t}(ht||(ht={})),function(n){function t(...i){const o=i.filter(l=>l!=null).map(l=>l.getAncestors()).sort((l,u)=>l.length-u.length);return o.shift().find(l=>o.every(u=>u.includes(l)))||null}n.getCommonAncestor=t;function e(i,o={}){let a=null;for(let l=0,u=i.length;l<u;l+=1){const h=i[l];let f=h.getBBox(o);if(f){if(h.isNode()){const d=h.getAngle();d!=null&&d!==0&&(f=f.bbox(d))}a=a==null?f:a.union(f)}}return a}n.getCellsBBox=e;function s(i){const o=[i,...i.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=s;function r(i){const o=hg(i),a=o.reduce((l,u)=>(l[u.id]=u.clone(),l),{});return o.forEach(l=>{const u=a[l.id];if(u.isEdge()){const d=u.getSourceCellId(),g=u.getTargetCellId();d&&a[d]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[d].id})),g&&a[g]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[g].id}))}const h=l.getParent();h&&a[h.id]&&u.setParent(a[h.id]);const f=l.getChildren();if(f&&f.length){const d=f.reduce((g,p)=>(a[p.id]&&g.push(a[p.id]),g),[]);d.length>0&&u.setChildren(d)}}),a}n.cloneCells=r}(ht||(ht={})),function(n){n.config({propHooks(t){var{tools:e}=t,s=Nb(t,["tools"]);return e&&(s.tools=n.normalizeTools(e)),s}})}(ht||(ht={}));var Qr;(function(n){let t,e;function s(o,a){return a?t!=null&&t.exist(o):e!=null&&e.exist(o)}n.exist=s;function r(o){t=o}n.setEdgeRegistry=r;function i(o){e=o}n.setNodeRegistry=i})(Qr||(Qr={}));class yV{constructor(t){this.ports=[],this.groups={},this.init(Tt(t))}getPorts(){return this.ports}getGroup(t){return t!=null?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||e.group==null&&t==null)}getPortsLayoutByGroup(t,e){const s=this.getPortsByGroup(t),r=t?this.getGroup(t):null,i=r?r.position:null,o=i?i.name:null;let a;if(o!=null){const f=Qs.registry.get(o);if(f==null)return Qs.registry.onNotFound(o);a=f}else a=Qs.presets.left;const l=s.map(f=>f&&f.position&&f.position.args||{}),u=i&&i.args||{};return a(l,e,u).map((f,d)=>{const g=s[d];return{portLayout:f,portId:g.id,portSize:g.size,portAttrs:g.attrs,labelSize:g.label.size,labelLayout:this.getPortLabelLayout(g,O.create(f.position),e)}})}init(t){const{groups:e,items:s}=t;e!=null&&Object.keys(e).forEach(r=>{this.groups[r]=this.parseGroup(e[r])}),Array.isArray(s)&&s.forEach(r=>{this.ports.push(this.parsePort(r))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),s=this.getGroup(t.group)||{};return e.markup=e.markup||s.markup,e.attrs=Gt({},s.attrs,e.attrs),e.position=this.createPosition(s,e),e.label=Gt({},s.label,this.getLabel(e)),e.zIndex=this.getZIndex(s,e),e.size=Object.assign(Object.assign({},s.size),e.size),e}getZIndex(t,e){return typeof e.zIndex=="number"?e.zIndex:typeof t.zIndex=="number"||t.zIndex==="auto"?t.zIndex:"auto"}createPosition(t,e){return Gt({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if(typeof t=="object")return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(t==null){if(e)return{name:"left",args:{}}}else{if(typeof t=="string")return{name:t,args:{}};if(typeof t=="object")return t}return{args:{}}}getLabel(t,e=!1){const s=t.label||{};return s.position=this.getPortLabelPosition(s.position,e),s}getPortLabelLayout(t,e,s){const r=t.label.position.name||"left",i=t.label.position.args||{},o=Gr.registry.get(r)||Gr.presets.left;return o?o(e,s,i):null}}var dl=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};let Ht=class Kb extends ht{get[Symbol.toStringTag](){return Kb.toStringTag}constructor(t={}){super(t),this.initPorts()}preprocess(t,e){const{x:s,y:r,width:i,height:o}=t,a=dl(t,["x","y","width","height"]);if(s!=null||r!=null){const l=a.position;a.position=Object.assign(Object.assign({},l),{x:s??(l?l.x:0),y:r??(l?l.y:0)})}if(i!=null||o!=null){const l=a.size;a.size=Object.assign(Object.assign({},l),{width:i??(l?l.width:0),height:o??(l?l.height:0)})}return super.preprocess(a,e)}isNode(){return!0}size(t,e,s){return t===void 0?this.getSize():typeof t=="number"?this.setSize(t,e,s):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,s){return typeof t=="object"?this.resize(t.width,t.height,e):this.resize(t,e,s),this}resize(t,e,s={}){this.startBatch("resize",s);const r=s.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":e=i.height;break;case"top":case"bottom":t=i.width;break}let a={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[r];const l=gt.normalize(this.getAngle()||0);s.absolute&&(a+=Math.floor((l+45)/90),a%=4);const u=this.getBBox();let h;a===0?h=u.getBottomLeft():a===1?h=u.getCorner():a===2?h=u.getTopRight():h=u.getOrigin();const f=h.clone().rotate(-l,u.getCenter()),d=Math.sqrt(t*t+e*e)/2;let g=a*Math.PI/2;g+=Math.atan(a%2===0?e/t:t/e),g-=gt.toRad(l);const m=O.fromPolar(d,g,f).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},s),this.setPosition(m.x,m.y,s)}else this.store.set("size",{width:t,height:e},s);return this.stopBatch("resize",s),this}scale(t,e,s,r={}){const i=this.getBBox().scale(t,e,s??void 0);return this.startBatch("scale",r),this.setPosition(i.x,i.y,r),this.resize(i.width,i.height,r),this.stopBatch("scale"),this}position(t,e,s){return typeof t=="number"?this.setPosition(t,e,s):this.getPosition(t)}getPosition(t={}){if(t.relative){const s=this.getParent();if(s!=null&&s.isNode()){const r=this.getPosition(),i=s.getPosition();return{x:r.x-i.x,y:r.y-i.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,s={}){let r,i,o;if(typeof t=="object"?(r=t.x,i=t.y,o=e||{}):(r=t,i=e,o=s||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const l=a.getPosition();r+=l.x,i+=l.y}}if(o.deep){const a=this.getPosition();this.translate(r-a.x,i-a.y,o)}else this.store.set("position",{x:r,y:i},o);return this}translate(t=0,e=0,s={}){if(t===0&&e===0)return this;s.translateBy=s.translateBy||this.id;const r=this.getPosition();if(s.restrict!=null&&s.translateBy===this.id){const o=this.getBBox({deep:!0}),a=s.restrict,l=r.x-o.x,u=r.y-o.y,h=Math.max(a.x+l,Math.min(a.x+a.width+l-o.width,r.x+t)),f=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,r.y+e));t=h-r.x,e=f-r.y}const i={x:r.x+t,y:r.y+e};return s.tx=t,s.ty=e,s.transition?(typeof s.transition!="object"&&(s.transition={}),this.transition("position",i,Object.assign(Object.assign({},s.transition),{interp:Zs.object})),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(t,e,s)})):(this.startBatch("translate",s),this.store.set("position",i,s),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(t,e,s)}),this.stopBatch("translate",s)),this}angle(t,e){return t==null?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const s=this.getAngle();if(e.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(s-t,e.center);const a=o.x-r.width/2-i.x,l=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(i.x+a,i.y+l,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(s+t)%360,e);return this}getBBox(t={}){if(t.deep){const e=this.getDescendants({deep:!0,breadthFirst:!0});return e.push(this),ht.getCellsBBox(e)}return z.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const s=this.getBBox(),r=s.getCenter(),i=t.getTerminal(e);if(i==null)return r;const o=i.port;if(!o||!this.hasPort(o))return r;const a=this.getPort(o);if(!a||!a.group)return r;const u=this.getPortsPosition(a.group)[o].position,h=O.create(u).translate(s.getOrigin()),f=this.getAngle();return f&&h.rotate(-f,r),h}fit(t={}){const s=(this.getChildren()||[]).filter(u=>u.isNode());if(s.length===0)return this;this.startBatch("fit-embeds",t),t.deep&&s.forEach(u=>u.fit(t));let{x:r,y:i,width:o,height:a}=ht.getCellsBBox(s);const l=ds(t.padding);return r-=l.left,i-=l.top,o+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:r,y:i},size:{width:o,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||_t.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",_t.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||_t.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",_t.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||_t.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",_t.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return t.items==null&&(t.items=[]),t}getPorts(){return Tt(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return Tt(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return this.getPortIndex(t)!==-1}getPortIndex(t){const e=typeof t=="string"?t:t.id;return e!=null?this.ports.items.findIndex(s=>s.id===e):-1}getPortsPosition(t){const e=this.getSize();return this.port.getPortsLayoutByGroup(t,new z(0,0,e.width,e.height)).reduce((r,i)=>{const o=i.portLayout;return r[i.portId]={position:Object.assign({},o.position),angle:o.angle||0},r},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,s,r){if(typeof e=="string"||Array.isArray(e)){const a=this.prefixPortPath(t,e),l=s;return this.setPropByPath(a,l,r)}const i=this.prefixPortPath(t),o=e;return this.setPropByPath(i,o,s)}removePortProp(t,e,s){return typeof e=="string"||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),s):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,s,r){return e==null?this.getPortProp(t):typeof e=="string"||Array.isArray(e)?arguments.length===2?this.getPortProp(t,e):s==null?this.removePortProp(t,e,r):this.setPortProp(t,e,s,r):this.setPortProp(t,e,s)}prefixPortPath(t,e){const s=this.getPortIndex(t);if(s===-1)throw new Error(`Unable to find port with id: "${t}"`);return e==null||e===""?["ports","items",`${s}`]:Array.isArray(e)?["ports","items",`${s}`,...e]:`ports/items/${s}/${e}`}addPort(t,e){const s=[...this.ports.items];return s.push(t),this.setPropByPath("ports/items",s,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,s){const r=[...this.ports.items];return r.splice(t,0,e),this.setPropByPath("ports/items",r,s),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const s=[...this.ports.items];s.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",s,e)}return this}removePorts(t,e){let s;if(Array.isArray(t)){if(s=e||{},t.length){s.rewrite=!0;const i=[...this.ports.items].filter(o=>!t.some(a=>{const l=typeof a=="string"?a:a.id;return o.id===l}));this.setPropByPath("ports/items",i,s)}}else s=t||{},s.rewrite=!0,this.setPropByPath("ports/items",[],s);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(o=>{o.id&&(e[o.id]=!0)});const s={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!e[o.id]&&(s[o.id]=!0)});const i=this.model;i&&!ag(s)&&(i.getConnectedEdges(this,{incoming:!0}).forEach(l=>{const u=l.getTargetPortId();u&&s[u]&&l.remove()}),i.getConnectedEdges(this,{outgoing:!0}).forEach(l=>{const u=l.getSourcePortId();u&&s[u]&&l.remove()}))}validatePorts(){const t={},e=[];return this.ports.items.forEach(s=>{typeof s!="object"&&e.push(`Invalid port ${s}.`),s.id==null&&(s.id=this.generatePortId()),t[s.id]&&e.push("Duplicitied port id."),t[s.id]=!0}),e}generatePortId(){return za()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new yV(this.ports);const s=this.port.getPorts(),r=e?s.filter(o=>e.find(a=>a.id===o.id)?null:o):[...s],i=e?e.filter(o=>s.find(a=>a.id===o.id)?null:o):[];r.length>0&&this.notify("ports:added",{added:r,cell:this,node:this}),i.length>0&&this.notify("ports:removed",{removed:i,cell:this,node:this})}};Ht.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.size=="function"&&typeof r.position=="function"}n.isNode=t}(Ht||(Ht={})),function(n){n.config({propHooks(t){var{ports:e}=t,s=dl(t,["ports"]);return e&&(s.ports=Array.isArray(e)?{items:e}:e),s}})}(Ht||(Ht={})),function(n){n.registry=zt.create({type:"node",process(t,e){if(Qr.exist(t,!0))throw new Error(`Node with name '${t}' was registered by anthor Edge`);if(typeof e=="function")return e.config({shape:t}),e;let s=n;const{inherit:r}=e,i=dl(e,["inherit"]);if(r)if(typeof r=="string"){const a=this.get(r);a==null?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=t);const o=s.define.call(s,i);return o.config({shape:t}),o}}),Qr.setNodeRegistry(n.registry)}(Ht||(Ht={})),function(n){let t=0;function e(i){return i?Pu(i):(t+=1,`CustomNode${t}`)}function s(i){const{constructorName:o,overwrite:a}=i,l=dl(i,["constructorName","overwrite"]),u=Ou(e(o||l.shape),this);return u.config(l),l.shape&&n.registry.register(l.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"rect",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(Ht||(Ht={}));var fl=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};let Vt=class Zb extends ht{get[Symbol.toStringTag](){return Zb.toStringTag}constructor(t={}){super(t)}preprocess(t,e){const{source:s,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:l,targetPort:u,targetPoint:h}=t,d=fl(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),g=p=>typeof p=="string"||typeof p=="number";if(s!=null)if(ht.isCell(s))d.source={cell:s.id};else if(g(s))d.source={cell:s};else if(O.isPoint(s))d.source=s.toJSON();else if(Array.isArray(s))d.source={x:s[0],y:s[1]};else{const p=s.cell;ht.isCell(p)?d.source=Object.assign(Object.assign({},s),{cell:p.id}):d.source=s}if(r!=null||i!=null){let p=d.source;if(r!=null){const m=g(r)?r:r.id;p?p.cell=m:p=d.source={cell:m}}i!=null&&p&&(p.port=i)}else o!=null&&(d.source=O.create(o).toJSON());if(a!=null)if(ht.isCell(a))d.target={cell:a.id};else if(g(a))d.target={cell:a};else if(O.isPoint(a))d.target=a.toJSON();else if(Array.isArray(a))d.target={x:a[0],y:a[1]};else{const p=a.cell;ht.isCell(p)?d.target=Object.assign(Object.assign({},a),{cell:p.id}):d.target=a}if(l!=null||u!=null){let p=d.target;if(l!=null){const m=g(l)?l:l.id;p?p.cell=m:p=d.target={cell:m}}u!=null&&p&&(p.port=u)}else h!=null&&(d.target=O.create(h).toJSON());return super.preprocess(d,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,s={}){return this.setTerminal("source",t,e,s)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,s={}){return this.setTerminal("target",t,e,s)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,s,r={}){if(ht.isCell(e))return this.store.set(t,Gt({},s,{cell:e.id}),r),this;const i=e;return O.isPoint(e)||i.x!=null&&i.y!=null?(this.store.set(t,Gt({},s,{x:i.x,y:i.y}),r),this):(this.store.set(t,Tt(e),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(O.isPointLike(e))return O.create(e);const s=this.getTerminalCell(t);return s?s.getConnectionPoint(this,t):new O}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e=t==="source"?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const s={};for(;e&&e.isEdge();){if(s[e.id])return null;s[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){t==null?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,s){return typeof t=="object"?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},s),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){t==null?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,s){return typeof t=="object"?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},s),this}removeConnector(t={}){return this.store.remove("connector",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return Tt(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,s={}){const r=this.getLabels(),i=r.length;let o=e!=null&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(t)),this.setLabels(r,s)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return t!=null&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,s={}){if(t!=null&&Number.isFinite(t)){const r=this.getLabels();r[t]=this.parseLabel(e),this.setLabels(r,s)}return this}removeLabelAt(t,e={}){const s=this.getLabels(),r=t!=null&&Number.isFinite(t)?t:-1,i=s.splice(r,1);return this.setLabels(s,e),i.length?i[0]:null}parseLabel(t){return typeof t=="string"?this.constructor.parseStringLabel(t):t}onLabelsChanged({previous:t,current:e}){const s=t&&e?e.filter(i=>t.find(o=>i===o||wn(i,o))?null:i):e?[...e]:[],r=t&&e?t.filter(i=>e.find(o=>i===o||wn(i,o))?null:i):t?[...t]:[];s.length>0&&this.notify("labels:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("labels:removed",{removed:r,cell:this,edge:this})}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const s=Array.isArray(t)?t:[t];return this.store.set("vertices",s.map(r=>O.toJSON(r)),e),this}insertVertex(t,e,s={}){const r=this.getVertices(),i=r.length;let o=e!=null&&Number.isFinite(e)?e:i;return o<0&&(o=i+o+1),r.splice(o,0,O.toJSON(t)),this.setVertices(r,s)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){return t!=null&&Number.isFinite(t)?this.getVertices()[t]:null}setVertexAt(t,e,s={}){if(t!=null&&Number.isFinite(t)){const r=this.getVertices();r[t]=e,this.setVertices(r,s)}return this}removeVertexAt(t,e={}){const s=this.getVertices(),r=t!=null&&Number.isFinite(t)?t:-1;return s.splice(r,1),this.setVertices(s,e)}onVertexsChanged({previous:t,current:e}){const s=t&&e?e.filter(i=>t.find(o=>O.equals(i,o))?null:i):e?[...e]:[],r=t&&e?t.filter(i=>e.find(o=>O.equals(i,o))?null:i):t?[...t]:[];s.length>0&&this.notify("vertexs:added",{added:s,cell:this,edge:this}),r.length>0&&this.notify("vertexs:removed",{removed:r,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||_t.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(t,e,s={}){return s.translateBy=s.translateBy||this.id,s.tx=t,s.ty=e,this.applyToPoints(r=>({x:(r.x||0)+t,y:(r.y||0)+e}),s)}scale(t,e,s,r={}){return this.applyToPoints(i=>O.create(i).scale(t,e,s).toJSON(),r)}applyToPoints(t,e={}){const s={},r=this.getSource(),i=this.getTarget();O.isPointLike(r)&&(s.source=t(r)),O.isPointLike(i)&&(s.target=t(i));const o=this.getVertices();return o.length>0&&(s.vertices=o.map(t)),this.store.set(s,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(e=>O.create(e)),this.getTargetPoint()];return new $t(t)}updateParent(t){let e=null;const s=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return s&&r&&(s===r||s.isDescendantOf(r)?e=r:r.isDescendantOf(s)?e=s:e=ht.getCommonAncestor(s,r)),i&&e&&e.id!==i.id&&i.unembed(this,t),e&&(!i||i.id!==e.id)&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),s=this.getTarget(),r=e.cell,i=s.cell;if(!r||!i)return!1;let o=r===i;if(!o&&t.deep&&this._model){const a=this.getSourceCell(),l=this.getTargetCell();a&&l&&(o=a.isAncestorOf(l,t)||l.isAncestorOf(a,t))}return o}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(e=>e!=null);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}};Vt.defaults={},function(n){function t(e,s){const r=e,i=s;return r.cell===i.cell?r.port===i.port||r.port==null&&i.port==null:!1}n.equalTerminals=t}(Vt||(Vt={})),function(n){n.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}};function t(e){return{attrs:{label:{text:e}}}}n.parseStringLabel=t}(Vt||(Vt={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"&&typeof r.disconnect=="function"&&typeof r.getSource=="function"&&typeof r.getTarget=="function"}n.isEdge=t}(Vt||(Vt={})),function(n){n.registry=zt.create({type:"edge",process(t,e){if(Qr.exist(t,!1))throw new Error(`Edge with name '${t}' was registered by anthor Node`);if(typeof e=="function")return e.config({shape:t}),e;let s=n;const{inherit:r="edge"}=e,i=fl(e,["inherit"]);if(typeof r=="string"){const a=this.get(r||"edge");a==null&&r?this.onNotFound(r,"inherited"):s=a}else s=r;i.constructorName==null&&(i.constructorName=t);const o=s.define.call(s,i);return o.config({shape:t}),o}}),Qr.setEdgeRegistry(n.registry)}(Vt||(Vt={})),function(n){let t=0;function e(i){return i?Pu(i):(t+=1,`CustomEdge${t}`)}function s(i){const{constructorName:o,overwrite:a}=i,l=fl(i,["constructorName","overwrite"]),u=Ou(e(o||l.shape),this);return u.config(l),l.shape&&n.registry.register(l.shape,u,a),u}n.define=s;function r(i){const o=i.shape||"edge",a=n.registry.get(o);return a?new a(i):n.registry.onNotFound(o)}n.create=r}(Vt||(Vt={})),function(n){const t="basic.edge";n.config({shape:t,propHooks(e){const{label:s,vertices:r}=e,i=fl(e,["label","vertices"]);if(s){i.labels==null&&(i.labels=[]);const o=typeof s=="string"?n.parseStringLabel(s):s;i.labels.push(o)}return r&&Array.isArray(r)&&(i.vertices=r.map(o=>O.create(o).toJSON())),i}}),n.registry.register(t,n)}(Vt||(Vt={}));var bV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class gl extends Nt{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,s){let r,i;typeof e=="number"?(r=e,i=Object.assign({merge:!1},s)):(r=this.length,i=Object.assign({merge:!1},e)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(t)?t:[t],a=this.comparator&&typeof e!="number"&&i.sort!==!1,l=this.comparator||null;let u=!1;const h=[],f=[];return o.forEach(d=>{const g=this.get(d);g?i.merge&&!d.isSameStore(g)&&(g.setProp(d.getProp(),s),f.push(g),a&&!u&&(l==null||typeof l=="function"?u=g.hasChanged():typeof l=="string"?u=g.hasChanged(l):u=l.some(p=>g.hasChanged(p)))):(h.push(d),this.reference(d))}),h.length&&(a&&(u=!0),this.cells.splice(r,0,...h),this.length=this.cells.length),u&&this.sort({silent:!0}),i.silent||(h.forEach((d,g)=>{const p={cell:d,index:r+g,options:i};this.trigger("added",p),i.dryrun||d.notify("added",Object.assign({},p))}),u&&this.trigger("sorted"),(h.length||f.length)&&this.trigger("updated",{added:h,merged:f,removed:[],options:i})),this}remove(t,e={}){const s=Array.isArray(t)?t:[t],r=this.removeCells(s,e);return!e.silent&&r.length>0&&this.trigger("updated",{options:e,removed:r,added:[],merged:[]}),Array.isArray(t)?r:r[0]}removeCells(t,e){const s=[];for(let r=0;r<t.length;r+=1){const i=this.get(t[r]);if(i==null)continue;const o=this.cells.indexOf(i);this.cells.splice(o,1),this.length-=1,delete this.map[i.id],s.push(i),this.unreference(i),e.dryrun||i.remove(),e.silent||(this.trigger("removed",{cell:i,index:o,options:e}),e.dryrun||i.notify("removed",{cell:i,index:o,options:e}))}return s}reset(t,e={}){const s=this.cells.slice();if(s.forEach(r=>this.unreference(r)),this.clean(),this.add(t,Object.assign({silent:!0},e)),!e.silent){const r=this.cells.slice();this.trigger("reseted",{options:e,previous:s,current:r});const i=[],o=[];r.forEach(a=>{s.some(u=>u.id===a.id)||i.push(a)}),s.forEach(a=>{r.some(u=>u.id===a.id)||o.push(a)}),this.trigger("updated",{options:e,added:i,removed:o,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return this.remove(e,t)}get(t){if(t==null)return null;const e=typeof t=="string"||typeof t=="number"?t:t.id;return this.map[e]||null}has(t){return this.get(t)!=null}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return this.comparator!=null&&(this.cells=Mc(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const s=e.cell;this.trigger(`cell:${t}`,e),s&&(s.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:s})):s.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:s})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}bV([gl.dispose()],gl.prototype,"dispose",null);var wV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Zt extends Nt{get[Symbol.toStringTag](){return Zt.toStringTag}constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new gl(t),this.setup()}notify(t,e){this.trigger(t,e);const s=this.graph;return s&&(t==="sorted"||t==="reseted"||t==="updated"?s.trigger(`model:${t}`,e):s.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",e=>this.notify("updated",e)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:e})=>{this.onCellAdded(e)}),t.on("removed",e=>{const s=e.cell;this.onCellRemoved(s,e.options),this.notify("cell:removed",e),s.isNode()?this.notify("node:removed",Object.assign(Object.assign({},e),{node:s})):s.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},e),{edge:s}))}),t.on("reseted",e=>{this.onReset(e.current),this.notify("reseted",e)}),t.on("edge:change:source",({edge:e})=>this.onEdgeTerminalChanged(e,"source")),t.on("edge:change:target",({edge:e})=>{this.onEdgeTerminalChanged(e,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const s=t.id;if(t.isEdge()){delete this.edges[s];const r=t.getSource(),i=t.getTarget();if(r&&r.cell){const o=this.outgoings[r.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.outgoings[r.cell])}if(i&&i.cell){const o=this.incomings[i.cell],a=o?o.indexOf(s):-1;a>=0&&(o.splice(a,1),o.length===0&&delete this.incomings[i.cell])}}else delete this.nodes[s];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(e=>this.onCellAdded(e))}onEdgeTerminalChanged(t,e){const s=e==="source"?this.outgoings:this.incomings,r=t.previous(e);if(r&&r.cell){const o=ht.isCell(r.cell)?r.cell.id:r.cell,a=s[o],l=a?a.indexOf(t.id):-1;l>=0&&(a.splice(l,1),a.length===0&&delete s[o])}const i=t.getTerminal(e);if(i&&i.cell){const o=ht.isCell(i.cell)?i.cell.id:i.cell,a=s[o]||[];a.indexOf(t.id)===-1&&a.push(t.id),s[o]=a}}prepareCell(t,e){return!t.model&&(!e||!e.dryrun)&&(t.model=this),t.zIndex==null&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(s=>this.prepareCell(s,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(s=>this.prepareCell(s,{options:e})),this}clear(t={}){const e=this.getCells();if(e.length===0)return this;const s=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const r=e.sort((i,o)=>{const a=i.isEdge()?1:2,l=o.isEdge()?1:2;return a-l});for(;r.length>0;){const i=r.shift();i&&i.remove(s)}},s),this}addNode(t,e={}){const s=Ht.isNode(t)?t:this.createNode(t);return this.addCell(s,e),s}updateNode(t,e={}){const s=this.createNode(t),r=s.getProp();return s.dispose(),this.updateCell(r,e)}createNode(t){return Ht.create(t)}addEdge(t,e={}){const s=Vt.isEdge(t)?t:this.createEdge(t);return this.addCell(s,e),s}createEdge(t){return Vt.create(t)}updateEdge(t,e={}){const s=this.createEdge(t),r=s.getProp();return s.dispose(),this.updateCell(r,e)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(!this.collection.has(t)&&!this.addings.has(t)&&(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild(s=>this.addCell(s,e)),this.addings.delete(t)),this)}addCells(t,e={}){const s=t.length;if(s===0)return this;const r=Object.assign(Object.assign({},e),{position:s-1,maxPosition:s-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:t})),t.forEach(i=>{this.addCell(i,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:t})),this}updateCell(t,e={}){const s=t.id&&this.getCell(t.id);return s?this.batchUpdate("update",()=>(Object.entries(t).forEach(([r,i])=>s.setProp(r,i,e)),!0),t):!1}removeCell(t,e={}){const s=typeof t=="string"?this.getCell(t):t;return s&&this.has(s)?this.collection.remove(s,e):null}updateCellId(t,e){if(t.id===e)return;this.startBatch("update",{id:e}),t.prop("id",e);const s=t.clone({keepId:!0});return this.addCell(s),this.getConnectedEdges(t).forEach(i=>{const o=i.getSourceCell(),a=i.getTargetCell();o===t&&i.setSource(Object.assign(Object.assign({},i.getSource()),{cell:e})),a===t&&i.setTarget(Object.assign(Object.assign({},i.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),s}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(s=>this.removeCell(s,e))):[]}removeConnectedEdges(t,e={}){const s=this.getConnectedEdges(t);return s.forEach(r=>{r.remove(e)}),s}disconnectConnectedEdges(t,e={}){const s=typeof t=="string"?t:t.id;this.getConnectedEdges(t).forEach(r=>{const i=r.getSourceCellId(),o=r.getTargetCellId();i===s&&r.setSource({x:0,y:0},e),o===s&&r.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(e=>this.getCell(e)).filter(e=>e!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e=typeof t=="string"?t:t.id,s=this.outgoings[e];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getIncomingEdges(t){const e=typeof t=="string"?t:t.id,s=this.incomings[e];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getConnectedEdges(t,e={}){const s=[],r=typeof t=="string"?this.getCell(t):t;if(r==null)return s;const i={},o=e.indirect;let a=e.incoming,l=e.outgoing;a==null&&l==null&&(a=l=!0);const u=(h,f)=>{const d=f?this.getOutgoingEdges(h):this.getIncomingEdges(h);if(d!=null&&d.forEach(g=>{i[g.id]||(s.push(g),i[g.id]=!0,o&&(a&&u(g,!1),l&&u(g,!0)))}),o&&h.isEdge()){const g=f?h.getTargetCell():h.getSourceCell();g&&g.isEdge()&&(i[g.id]||(s.push(g),u(g,f)))}};if(l&&u(r,!0),a&&u(r,!1),e.deep){const h=r.getDescendants({deep:!0}),f={};h.forEach(g=>{g.isNode()&&(f[g.id]=!0)});const d=(g,p)=>{const m=p?this.getOutgoingEdges(g.id):this.getIncomingEdges(g.id);m!=null&&m.forEach(y=>{if(!i[y.id]){const b=y.getSourceCell(),w=y.getTargetCell();if(!e.enclosed&&b&&f[b.id]&&w&&f[w.id])return;s.push(y),i[y.id]=!0}})};h.forEach(g=>{g.isEdge()||(l&&d(g,!0),a&&d(g,!1))})}return s}isBoundary(t,e){const s=typeof t=="string"?this.getCell(t):t,r=e?this.getIncomingEdges(s):this.getOutgoingEdges(s);return r==null||r.length===0}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(s=>{if(this.isBoundary(s,t)){const r=this.getCell(s);r&&e.push(r)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let s=e.incoming,r=e.outgoing;s==null&&r==null&&(s=r=!0);const o=this.getConnectedEdges(t,e).reduce((a,l)=>{const u=l.hasLoop(e),h=l.getSourceCell(),f=l.getTargetCell();return s&&h&&h.isNode()&&!a[h.id]&&(u||h!==t&&(!e.deep||!h.isDescendantOf(t)))&&(a[h.id]=h),r&&f&&f.isNode()&&!a[f.id]&&(u||f!==t&&(!e.deep||!f.isDescendantOf(t)))&&(a[f.id]=f),a},{});if(t.isEdge()){if(s){const a=t.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(r){const a=t.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(t,e,s={}){let r=s.incoming,i=s.outgoing;return r==null&&i==null&&(r=i=!0),this.getConnectedEdges(t,s).some(o=>{const a=o.getSourceCell(),l=o.getTargetCell();return!!(r&&a&&a.id===e.id||i&&l&&l.id===e.id)})}getSuccessors(t,e={}){const s=[];return this.search(t,(r,i)=>{r!==t&&this.matchDistance(i,e.distance)&&s.push(r)},Object.assign(Object.assign({},e),{outgoing:!0})),s}isSuccessor(t,e,s={}){let r=!1;return this.search(t,(i,o)=>{if(i===e&&i!==t&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{outgoing:!0})),r}getPredecessors(t,e={}){const s=[];return this.search(t,(r,i)=>{r!==t&&this.matchDistance(i,e.distance)&&s.push(r)},Object.assign(Object.assign({},e),{incoming:!0})),s}isPredecessor(t,e,s={}){let r=!1;return this.search(t,(i,o)=>{if(i===e&&i!==t&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{incoming:!0})),r}matchDistance(t,e){return e==null?!0:typeof e=="function"?e(t):Array.isArray(e)&&e.includes(t)?!0:t===e}getCommonAncestor(...t){const e=[];return t.forEach(s=>{s&&(Array.isArray(s)?e.push(...s):e.push(s))}),ht.getCommonAncestor(...e)}getSubGraph(t,e={}){const s=[],r={},i=[],o=[],a=l=>{r[l.id]||(s.push(l),r[l.id]=l,l.isEdge()&&o.push(l),l.isNode()&&i.push(l))};return t.forEach(l=>{a(l),e.deep&&l.getDescendants({deep:!0}).forEach(h=>a(h))}),o.forEach(l=>{const u=l.getSourceCell(),h=l.getTargetCell();u&&!r[u.id]&&(s.push(u),r[u.id]=u,u.isNode()&&i.push(u)),h&&!r[h.id]&&(s.push(h),r[h.id]=h,h.isNode()&&i.push(h))}),i.forEach(l=>{this.getConnectedEdges(l,e).forEach(h=>{const f=h.getSourceCell(),d=h.getTargetCell();!r[h.id]&&f&&r[f.id]&&d&&r[d.id]&&(s.push(h),r[h.id]=h)})}),s}cloneSubGraph(t,e={}){const s=this.getSubGraph(t,e);return this.cloneCells(s)}cloneCells(t){return ht.cloneCells(t)}getNodesFromPoint(t,e){const s=typeof t=="number"?{x:t,y:e||0}:t;return this.getNodes().filter(r=>r.getBBox().containsPoint(s))}getNodesInArea(t,e,s,r,i){const o=typeof t=="number"?new z(t,e,s,r):z.create(t),a=typeof t=="number"?i:e,l=a&&a.strict;return this.getNodes().filter(u=>{const h=u.getBBox();return l?o.containsRect(h):o.isIntersectWithRect(h)})}getEdgesInArea(t,e,s,r,i){const o=typeof t=="number"?new z(t,e,s,r):z.create(t),a=typeof t=="number"?i:e,l=a&&a.strict;return this.getEdges().filter(u=>{const h=u.getBBox();return h.width===0?h.inflate(1,0):h.height===0&&h.inflate(0,1),l?o.containsRect(h):o.isIntersectWithRect(h)})}getNodesUnderNode(t,e={}){const s=t.getBBox();return(e.by==null||e.by==="bbox"?this.getNodesInArea(s):this.getNodesFromPoint(s[e.by])).filter(i=>t.id!==i.id&&!i.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return ht.getCellsBBox(t,e)}search(t,e,s={}){s.breadthFirst?this.breadthFirstSearch(t,e,s):this.depthFirstSearch(t,e,s)}breadthFirstSearch(t,e,s={}){const r=[],i={},o={};for(r.push(t),o[t.id]=0;r.length>0;){const a=r.shift();if(a==null||i[a.id]||(i[a.id]=!0,X(e,this,a,o[a.id])===!1))continue;this.getNeighbors(a,s).forEach(u=>{o[u.id]=o[a.id]+1,r.push(u)})}}depthFirstSearch(t,e,s={}){const r=[],i={},o={};for(r.push(t),o[t.id]=0;r.length>0;){const a=r.pop();if(a==null||i[a.id]||(i[a.id]=!0,X(e,this,a,o[a.id])===!1))continue;const l=this.getNeighbors(a,s),u=r.length;l.forEach(h=>{o[h.id]=o[a.id]+1,r.splice(u,0,h)})}}getShortestPath(t,e,s={}){const r={};this.getEdges().forEach(u=>{const h=u.getSourceCellId(),f=u.getTargetCellId();h&&f&&(r[h]||(r[h]=[]),r[f]||(r[f]=[]),r[h].push(f),s.directed||r[f].push(h))});const i=typeof t=="string"?t:t.id,o=Yu.run(r,i,s.weight),a=[];let l=typeof e=="string"?e:e.id;for(o[l]&&a.push(l);l=o[l];)a.unshift(l);return a}translate(t,e,s){return this.getCells().filter(r=>!r.hasParent()).forEach(r=>r.translate(t,e,s)),this}resize(t,e,s){return this.resizeCells(t,e,this.getCells(),s)}resizeCells(t,e,s,r={}){const i=this.getCellsBBox(s);if(i){const o=Math.max(t/i.width,0),a=Math.max(e/i.height,0),l=i.getOrigin();s.forEach(u=>u.scale(o,a,l,r))}return this}toJSON(t={}){return Zt.toJSON(this.getCells(),t)}parseJSON(t){return Zt.fromJSON(t)}fromJSON(t,e={}){const s=this.parseJSON(t);return this.resetCells(s,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,s={}){this.startBatch(t,s);const r=e();return this.stopBatch(t,s),r}hasActiveBatch(t=Object.keys(this.batches)){return(Array.isArray(t)?t:[t]).some(s=>this.batches[s]>0)}dispose(){this.collection.dispose()}}wV([Zt.dispose()],Zt.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.addNode=="function"&&typeof r.addEdge=="function"&&r.collection!=null}n.isModel=t}(Zt||(Zt={})),function(n){function t(s,r={}){return{cells:s.map(i=>i.toJSON(r))}}n.toJSON=t;function e(s){const r=[];return Array.isArray(s)?r.push(...s):(s.cells&&r.push(...s.cells),s.nodes&&s.nodes.forEach(i=>{i.shape==null&&(i.shape="rect"),r.push(i)}),s.edges&&s.edges.forEach(i=>{i.shape==null&&(i.shape="edge"),r.push(i)})),r.map(i=>{const o=i.shape;if(o){if(Ht.registry.exist(o))return Ht.create(i);if(Vt.registry.exist(o))return Vt.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=e}(Zt||(Zt={}));var xV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};let Ps=class extends Ht{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return t==null?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}};(function(n){n.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},n.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},n.config({attrs:{text:Object.assign({},n.labelAttr)},propHooks(t){const{label:e}=t,s=xV(t,["label"]);return e&&Rr(s,"attrs/text/text",e),s},visible:!0})})(Ps||(Ps={}));var vV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};function CV(n,t="body"){return[{tagName:n,selector:t},{tagName:"text",selector:"label"}]}function SV(n="xlink:href"){return e=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=e,o=vV(e,["imageUrl","imageWidth","imageHeight"]);if(s!=null||r!=null||i!=null){const a=()=>{if(o.attrs){const l=o.attrs.image;s!=null&&(l[n]=s),r!=null&&(l.width=r),i!=null&&(l.height=i),o.attrs.image=l}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function ti(n,t,e={}){const s={constructorName:n,markup:CV(n,e.selector),attrs:{[n]:Object.assign({},Ps.bodyAttr)}};return(e.parent||Ps).define(Gt(s,t,{shape:n}))}ti("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const EV=Vt.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});ti("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var OV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class ei extends Ps{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return t==null?this.removePoints():this.setAttrByPath("body/refPoints",ei.pointsToString(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function t(e){return typeof e=="string"?e:e.map(s=>Array.isArray(s)?s.join(","):O.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=t,n.config({propHooks(e){const{points:s}=e,r=OV(e,["points"]);if(s){const i=t(s);i&&Rr(r,"attrs/body/refPoints",i)}return r}})})(ei||(ei={})),ti("polygon",{},{parent:ei}),ti("polyline",{},{parent:ei});var MV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};Ps.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(n){const{path:t}=n,e=MV(n,["path"]);return t&&Rr(e,"attrs/body/refD",t),e}});var PV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};Ps.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},fs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:ee.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},Ps.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:t}=n,e=PV(n,["text"]);return t&&Rr(e,"attrs/label/text",t),e},attrHooks:{text:{set(n,{cell:t,view:e,refBBox:s,elem:r,attrs:i}){if(r instanceof HTMLElement)r.textContent=n;else{const o=i.style||{},a={text:n,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),u=On.presets.textWrap;return X(u.set,this,a,{cell:t,view:e,elem:r,refBBox:s,attrs:l}),{fill:o.color||null}}},position(n,{refBBox:t,elem:e}){if(e instanceof SVGElement)return t.getCenter()}}}}),ti("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:SV()},{selector:"image"}),ti("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class hn extends Ft{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return hn.toStringTag}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const s=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?Dt(e,s):J(e,s)}else{const s=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(s):this.addClass(s)}}isNodeView(){return!0}confirmUpdate(t,e={}){let s=t;return this.hasAction(s,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","resize","translate","rotate","ports","tools"])):(s=this.handleAction(s,"resize",()=>this.resize(),"update"),s=this.handleAction(s,"update",()=>this.update(),"ports"),s=this.handleAction(s,"translate",()=>this.translate()),s=this.handleAction(s,"rotate",()=>this.rotate()),s=this.handleAction(s,"ports",()=>this.renderPorts()),s=this.handleAction(s,"tools",()=>{this.getFlag("tools")===t?this.renderTools():this.updateTools(e)})),s}update(t){this.cleanCache(),this.removePorts();const e=this.cell,s=e.getSize(),r=e.getAttrs();this.updateAttrs(this.container,r,{attrs:t===r?null:t,rootBBox:new z(0,0,s.width,s.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.appendChild(e.fragment)}render(){return this.empty(),this.renderMarkup(),this.resize(),this.updateTransform(),this.renderTools(),this}resize(){this.cell.getAngle()&&this.rotate(),this.update()}translate(){this.updateTransform()}rotate(){this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}findPortElem(t,e){const s=t?this.portsCache[t]:null;if(!s)return null;const r=s.portContentElement,i=s.portContentSelectors||{};return this.findOne(e,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(t=>{ze(t.portElement)})}renderPorts(){const t=this.container,e=[];t.childNodes.forEach(o=>{e.push(o)});const s=this.cell.getParsedPorts(),r=og(s,"zIndex"),i="auto";r[i]&&r[i].forEach(o=>{const a=this.getPortElement(o);t.append(a),e.push(a)}),Object.keys(r).forEach(o=>{if(o!==i){const a=parseInt(o,10);this.appendPorts(r[o],a,e)}}),this.updatePorts()}appendPorts(t,e,s){const r=t.map(i=>this.getPortElement(i));s[e]||e<0?Lu(s[Math.max(e,0)],r):Ne(this.container,r)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=_t.renderMarkup(this.cell.getPortContainerMarkup());const s=e.elem;if(s==null)throw new Error("Invalid port container markup.");e=_t.renderMarkup(this.getPortMarkup(t));const r=e.elem,i=e.selectors;if(r==null)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},r);let o="x6-port";t.group&&(o+=` x6-port-${t.group}`),J(s,o),J(s,"x6-port"),J(r,"x6-port-body"),s.appendChild(r);let a=i,l,u;if(this.existPortLabel(t)){if(e=_t.renderMarkup(this.getPortLabelMarkup(t.label)),l=e.elem,u=e.selectors,l==null)throw new Error("Invalid port label markup.");if(i&&u){for(const f in u)if(i[f]&&f!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},i),u)}J(l,"x6-port-label"),s.appendChild(l)}return this.portsCache[t.id]={portElement:s,portSelectors:a,portLabelElement:l,portLabelSelectors:u,portContentElement:r,portContentSelectors:i},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:t,node:this.cell,container:s,selectors:a,labelContainer:l,labelSelectors:u,contentContainer:r,contentSelectors:i}),s}updatePorts(){const t=this.cell.getParsedGroups(),e=Object.keys(t);e.length===0?this.updatePortGroup():e.forEach(s=>this.updatePortGroup(s))}updatePortGroup(t){const e=z.fromSize(this.cell.getSize()),s=this.cell.getPortsLayoutByGroup(t,e);for(let r=0,i=s.length;r<i;r+=1){const o=s[r],a=o.portId,l=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(l.portElement,u),o.portAttrs!=null){const f={selectors:l.portSelectors||{}};o.portSize&&(f.rootBBox=z.fromSize(o.portSize)),this.updateAttrs(l.portElement,o.portAttrs,f)}const h=o.labelLayout;if(h&&l.portLabelElement&&(this.applyPortTransform(l.portLabelElement,h,-(u.angle||0)),h.attrs)){const f={selectors:l.portLabelSelectors||{}};o.labelSize&&(f.rootBBox=z.fromSize(o.labelSize)),this.updateAttrs(l.portLabelElement,h.attrs,f)}}}applyPortTransform(t,e,s=0){const r=e.angle,i=e.position,o=ne().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);Vr(t,o,{absolute:!0})}getPortMarkup(t){return t.markup||this.cell.portMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup}existPortLabel(t){return t.attrs&&t.attrs.text}getEventArgs(t,e,s){const r=this,i=r.cell,o=i;return e==null||s==null?{e:t,view:r,node:i,cell:o}:{e:t,x:e,y:s,view:r,node:i,cell:o}}getPortEventArgs(t,e,s){const r=this,i=r.cell,o=i;return s?{e:t,x:s.x,y:s.y,view:r,node:i,cell:o,port:e}:{e:t,view:r,node:i,cell:o,port:e}}notifyMouseDown(t,e,s){super.onMouseDown(t,e,s),this.notify("node:mousedown",this.getEventArgs(t,e,s))}notifyMouseMove(t,e,s){super.onMouseMove(t,e,s),this.notify("node:mousemove",this.getEventArgs(t,e,s))}notifyMouseUp(t,e,s){super.onMouseUp(t,e,s),this.notify("node:mouseup",this.getEventArgs(t,e,s))}notifyPortEvent(t,e,s){const r=this.findAttr("port",e.target);if(r){const i=e.type;t==="node:port:mouseenter"?e.type="mouseenter":t==="node:port:mouseleave"&&(e.type="mouseleave"),this.notify(t,this.getPortEventArgs(e,r,s)),e.type=i}}onClick(t,e,s){super.onClick(t,e,s),this.notify("node:click",this.getEventArgs(t,e,s)),this.notifyPortEvent("node:port:click",t,{x:e,y:s})}onDblClick(t,e,s){super.onDblClick(t,e,s),this.notify("node:dblclick",this.getEventArgs(t,e,s)),this.notifyPortEvent("node:port:dblclick",t,{x:e,y:s})}onContextMenu(t,e,s){super.onContextMenu(t,e,s),this.notify("node:contextmenu",this.getEventArgs(t,e,s)),this.notifyPortEvent("node:port:contextmenu",t,{x:e,y:s})}onMouseDown(t,e,s){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,s),this.notifyPortEvent("node:port:mousedown",t,{x:e,y:s}),this.startNodeDragging(t,e,s))}onMouseMove(t,e,s){const r=this.getEventData(t),i=r.action;if(i==="magnet")this.dragMagnet(t,e,s);else{if(i==="move"){const a=r.targetView||this;a.dragNode(t,e,s),a.notify("node:moving",{e:t,x:e,y:s,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(t,e,s),this.notifyPortEvent("node:port:mousemove",t,{x:e,y:s})}this.setEventData(t,r)}onMouseUp(t,e,s){const r=this.getEventData(t),i=r.action;i==="magnet"?this.stopMagnetDragging(t,e,s):(this.notifyMouseUp(t,e,s),this.notifyPortEvent("node:port:mouseup",t,{x:e,y:s}),i==="move"&&(r.targetView||this).stopNodeDragging(t,e,s));const o=r.targetMagnet;o&&this.onMagnetClick(t,o,e,s),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseenter",t),this.notifyPortEvent("node:port:mouseover",t)}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t)),this.notifyPortEvent("node:port:mouseleave",t),this.notifyPortEvent("node:port:mouseout",t)}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,s,r){super.onMouseWheel(t,e,s,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,s)))}onMagnetClick(t,e,s,r){const i=this.graph;i.view.getMouseMovedCount(t)>i.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,s,r)))}onMagnetDblClick(t,e,s,r){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,s,r)))}onMagnetContextMenu(t,e,s,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,s,r)))}onMagnetMouseDown(t,e,s,r){this.startMagnetDragging(t,s,r)}onCustomEvent(t,e,s,r){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,s,r))),super.onCustomEvent(t,e,s,r)}prepareEmbedding(t){const e=this.graph,r=this.getEventData(t).cell||this.cell,i=e.findViewByCell(r),o=e.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:r,view:i,cell:r,x:o.x,y:o.y,currentParent:r.getParent()})}processEmbedding(t,e){const s=e.cell||this.cell,r=e.graph||this.graph,i=r.options.embedding,o=i.findParent;let a=typeof o=="function"?X(o,r,{view:this,node:this.cell}).filter(d=>ht.isCell(d)&&this.cell.id!==d.id&&!d.isDescendantOf(this.cell)):r.model.getNodesUnderNode(s,{by:o});if(i.frontOnly&&a.length>0){const d=og(a,"zIndex"),g=o2(Object.keys(d).map(p=>parseInt(p,10)));g&&(a=d[g])}a=a.filter(d=>d.visible);let l=null;const u=e.candidateEmbedView,h=i.validate;for(let d=a.length-1;d>=0;d-=1){const g=a[d];if(u&&u.cell.id===g.id){l=u;break}else{const p=g.findView(r);if(h&&X(h,r,{child:this.cell,parent:p.cell,childView:this,parentView:p})){l=p;break}}}this.clearEmbedding(e),l&&l.highlight(null,{type:"embedding"}),e.candidateEmbedView=l;const f=r.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:s,node:s,view:r.findViewByCell(s),x:f.x,y:f.y,currentParent:s.getParent(),candidateParent:l?l.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const s=e.cell||this.cell,r=e.graph||this.graph,i=r.findViewByCell(s),o=s.getParent(),a=e.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,(o==null||o.id!==a.cell.id)&&a.cell.insertChild(s,void 0,{ui:!0})):o&&o.unembed(s,{ui:!0}),r.model.getConnectedEdges(s,{deep:!0}).forEach(l=>{l.updateParent({ui:!0})}),i&&a){const l=r.snapToGrid(t.clientX,t.clientY);i.notify("node:embedded",{e:t,cell:s,x:l.x,y:l.y,node:s,view:r.findViewByCell(s),previousParent:o,currentParent:s.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.findViewByCell(t)}return null}validateMagnet(t,e,s){if(e.getAttribute("magnet")!=="passive"){const r=this.graph.options.connecting.validateMagnet;return r?X(r,this.graph,{e:s,magnet:e,view:t,cell:t.cell}):!0}return!1}startMagnetDragging(t,e,s){if(!this.can("magnetConnectable"))return;t.stopPropagation();const r=t.currentTarget,i=this.graph;this.setEventData(t,{targetMagnet:r}),this.validateMagnet(this,r,t)?(i.options.magnetThreshold<=0&&this.startConnectting(t,r,e,s),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,s),i.view.delegateDragEvents(t,this)}startConnectting(t,e,s,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(e,s,r);i.setEventData(t,i.prepareArrowheadDragging("target",{x:s,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:i}),i.notifyMouseDown(t,s,r)}getDefaultEdge(t,e){let s;const r=this.graph.options.connecting.createEdge;return r&&(s=X(r,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),s}createEdgeFromMagnet(t,e,s){const r=this.graph,i=r.model,o=this.getDefaultEdge(this,t);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(t,e,s,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:e,y:s})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(t,e,s){const r=this.getEventData(t),i=r.edgeView;if(i)i.onMouseMove(t,e,s),this.autoScrollGraph(t.clientX,t.clientY);else{const o=this.graph,a=o.options.magnetThreshold,l=this.getEventTarget(t),u=r.targetMagnet;if(a==="onleave"){if(u===l||u.contains(l))return}else if(o.view.getMouseMovedCount(t)<=a)return;this.startConnectting(t,u,e,s)}}stopMagnetDragging(t,e,s){const i=this.eventData(t).edgeView;i&&(i.onMouseUp(t,e,s),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,s){this.notify("node:unhandled:mousedown",{e:t,x:e,y:s,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,s,r,i){let o=[i];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const l=a.getSelectedCells();l.includes(i)&&(o=l.filter(u=>u.isNode()))}o.forEach(l=>{this.notify(t,{e,x:s,y:r,cell:l,node:l,view:l.findView(this.graph)})})}getRestrictArea(t){const e=this.graph.options.translating.restrict,s=typeof e=="function"?X(e,this.graph,t):e;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}startNodeDragging(t,e,s){const r=this.getDelegatedView();if(r==null||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,s);this.setEventData(t,{targetView:r,action:"move"});const i=O.create(r.cell.getPosition());r.setEventData(t,{moving:!1,offset:i.diff(e,s),restrict:this.getRestrictArea(r)})}dragNode(t,e,s){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(t),l=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,s,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=wt.snapToGrid(e+l.x,o),f=wt.snapToGrid(s+l.y,o);r.setPosition(h,f,{restrict:u,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(t),a.embedding=!0),this.processEmbedding(t,a))}stopNodeDragging(t,e,s){const r=this.getEventData(t);r.embedding&&this.finalizeEmbedding(t,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,s,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(t,e){const s=this.graph.getPlugin("scroller");s&&s.autoScroll(t,e)}}(function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.findPortElem=="function"&&typeof r.resize=="function"&&typeof r.rotate=="function"&&typeof r.translate=="function"}n.isNodeView=t})(hn||(hn={})),hn.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),hn.registry.register("node",hn,!0);var AV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Xn extends Ft{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return Xn.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const s=this.cell.getSource();return new z(s.x,s.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new z(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const s=this.cell.getTarget();return new z(s.x,s.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new z(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let s=t;if(this.hasAction(s,"source")){if(!this.updateTerminalProperties("source"))return s;s=this.removeAction(s,"source")}if(this.hasAction(s,"target")){if(!this.updateTerminalProperties("target"))return s;s=this.removeAction(s,"target")}return this.hasAction(s,"render")?(this.render(),s=this.removeAction(s,["render","update","labels","tools"]),s):(s=this.handleAction(s,"update",()=>this.update(e)),s=this.handleAction(s,"labels",()=>this.onLabelsChange(e)),s=this.handleAction(s,"tools",()=>this.renderTools()),s)}render(){return this.empty(),this.renderMarkup(),this.labelContainer=null,this.renderLabels(),this.update(),this.renderTools(),this}renderMarkup(){const t=this.cell.markup;if(t){if(typeof t=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(t)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}customizeLabels(){if(this.labelContainer){const t=this.cell,e=t.labels;for(let s=0,r=e.length;s<r;s+=1){const i=e[s],o=this.labelCache[s],a=this.labelSelectors[s],l=this.graph.options.onEdgeLabelRendered;if(l){const u=l({edge:t,label:i,container:o,selectors:a});u&&(this.labelDestroyFn[s]=u)}}}}destroyCustomizeLabels(){const t=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let e=0,s=t.length;e<s;e+=1){const r=this.labelDestroyFn[e],i=this.labelCache[e],o=this.labelSelectors[e];r&&i&&o&&r({edge:this.cell,label:t[e],container:i,selectors:o})}this.labelDestroyFn={}}renderLabels(){const t=this.cell,e=t.getLabels(),s=e.length;let r=this.labelContainer;if(this.labelCache={},this.labelSelectors={},s<=0)return r&&r.parentNode&&r.parentNode.removeChild(r),this;r?this.empty(r):(r=cn("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let i=0,o=e.length;i<o;i+=1){const a=e[i],l=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,h;if(l)u=l.node,h=l.selectors;else{const d=t.getDefaultLabel(),g=this.normalizeLabelMarkup(this.parseLabelMarkup(d.markup));u=g.node,h=g.selectors}u.setAttribute("data-index",`${i}`),r.appendChild(u);const f=this.rootSelector;if(h[f])throw new Error("Ambiguous label root selector.");h[f]=u,this.labelCache[i]=u,this.labelSelectors[i]=h}return r.parentNode==null&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(t={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(e==null)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const s=t.propertyPathArray||[],r=s.length;if(r>1){const i=s[1];if(e[i]){if(r===2)return typeof t.propertyValue=="object"&&ca(t.propertyValue,"markup");if(s[2]!=="markup")return!1}}}return!0}parseLabelMarkup(t){return t?typeof t=="string"?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=tt.createVectors(t),s=document.createDocumentFragment();for(let r=0,i=e.length;r<i;r+=1){const o=e[r].node;s.appendChild(o)}return{fragment:s,selectors:{}}}normalizeLabelMarkup(t){if(t==null)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let s;const r=e.childNodes;return r.length>1||r[0].nodeName.toUpperCase()!=="G"?s=tt.create("g").append(e):s=tt.create(r[0]),s.addClass(this.prefixClassName("edge-label")),{node:s.node,selectors:t.selectors}}updateLabels(){if(this.labelContainer){const t=this.cell,e=t.labels,s=this.can("edgeLabelMovable"),r=t.getDefaultLabel();for(let i=0,o=e.length;i<o;i+=1){const a=this.labelCache[i],l=this.labelSelectors[i];a.setAttribute("cursor",s?"move":"default");const u=e[i],h=Gt({},r.attrs,u.attrs);this.updateAttrs(a,h,{selectors:l,rootBBox:u.size?z.fromSize(u.size):void 0})}}}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}update(t={}){this.cleanCache(),this.updateConnection(t);const e=this.cell.getAttrs(),s=AV(e,["text"]);return s!=null&&this.updateAttrs(this.container,s,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(t),this}removeRedundantLinearVertices(t={}){const e=this.cell,s=e.getVertices(),r=[this.sourceAnchor,...s,this.targetAnchor],i=r.length,o=new $t(r);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),l=a.length;return i===l?0:(e.setVertices(a.slice(1,l-1),t),i-l)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return O.create(this.sourceAnchor);case"target":return O.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return O.create(this.sourcePoint);case"target":return O.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const s=this.sourceView;return s?this.sourceMagnet||s.container:null}case"target":{if(e.raw)return this.targetMagnet;const s=this.targetView;return s?this.targetMagnet||s.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const s=t.tx||0,r=t.ty||0;this.routePoints=new $t(this.routePoints).translate(s,r).points,this.translateConnectionPoints(s,r),this.path.translate(s,r)}else{const s=e.getVertices(),r=this.findAnchors(s);this.sourceAnchor=r.source,this.targetAnchor=r.target,this.routePoints=this.findRoutePoints(s);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const o=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,o.source||this.sourcePoint,o.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,s=e.source,r=e.target,i=t[0],o=t[t.length-1];return r.priority&&!s.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(t,e,s,r){let i,o;const a=this.cell,l=a[t],u=a[s],h=this.getTerminalView(t),f=this.getTerminalView(s),d=this.getTerminalMagnet(t),g=this.getTerminalMagnet(s);if(h){let p;e?p=O.create(e):f?p=g:p=O.create(u),i=this.getAnchor(l.anchor,h,d,p,t)}else i=O.create(l);if(f){const p=O.create(r||i);o=this.getAnchor(u.anchor,f,g,p,s)}else o=O.isPointLike(u)?O.create(u):new O;return{[t]:i,[s]:o}}getAnchor(t,e,s,r,i){const o=e.isEdgeElement(s),a=this.graph.options.connecting;let l=typeof t=="string"?{name:t}:t;if(!l){const f=o?(i==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(i==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;l=typeof f=="string"?{name:f}:f}if(!l)throw new Error("Anchor should be specified.");let u;const h=l.name;if(o){const f=Xr.registry.get(h);if(typeof f!="function")return Xr.registry.onNotFound(h);u=X(f,this,e,s,r,l.args||{},i)}else{const f=Jr.registry.get(h);if(typeof f!="function")return Jr.registry.onNotFound(h);u=X(f,this,e,s,r,l.args||{},i)}return u?u.round(this.POINT_ROUNDING):new O}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||Ms.presets.normal,s=this.cell.getRouter()||e;let r;if(typeof s=="function")r=X(s,this,t,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ms.registry.get(i):Ms.presets.normal;if(typeof a!="function")return Ms.registry.onNotFound(i);r=X(a,this,t,o,this)}return r==null?t.map(i=>O.create(i)):r.map(i=>O.create(i))}findConnectionPoints(t,e,s){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),l=this.sourceView,u=this.targetView,h=t[0],f=t[t.length-1];let d;if(l&&!l.isEdgeElement(this.sourceMagnet)){const p=this.sourceMagnet||l.container,m=h||s,y=new W(m,e),b=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;d=this.getConnectionPoint(b,l,p,y,"source")}else d=e;let g;if(u&&!u.isEdgeElement(this.targetMagnet)){const p=this.targetMagnet||u.container,m=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,y=f||e,b=new W(y,s);g=this.getConnectionPoint(m,u,p,b,"target")}else g=s;return{source:d,target:g}}getConnectionPoint(t,e,s,r,i){const o=r.end;if(t==null)return o;const a=typeof t=="string"?t:t.name,l=typeof t=="string"?{}:t.args,u=Kr.registry.get(a);if(typeof u!="function")return Kr.registry.onNotFound(a);const h=X(u,this,r,e,s,l||{},i);return h?h.round(this.POINT_ROUNDING):o}findMarkerPoints(t,e,s){const r=f=>{const d=this.cell.getAttrs(),g=Object.keys(d);for(let p=0,m=g.length;p<m;p+=1){const y=d[g[p]];if(y[`${f}Marker`]||y[`${f}-marker`]){const b=y.strokeWidth||y["stroke-width"];if(b)return parseFloat(b);break}}return null},i=t[0],o=t[t.length-1];let a,l;const u=r("source");u&&(a=e.clone().move(i||s,-u));const h=r("target");return h&&(l=s.clone().move(o||e,-h)),this.sourceMarkerPoint=a||e.clone(),this.targetMarkerPoint=l||s.clone(),{source:a,target:l}}findPath(t,e,s){const r=this.cell.getConnector()||this.graph.options.connecting.connector;let i,o,a;if(typeof r=="string"?i=r:(i=r.name,o=r.args),i){const u=tr.registry.get(i);if(typeof u!="function")return tr.registry.onNotFound(i);a=u}else a=tr.presets.normal;const l=X(a,this,e,s,t,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof l=="string"?Z.parse(l):l}translateConnectionPoints(t,e){this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e),this.sourceMarkerPoint.translate(t,e),this.targetMarkerPoint.translate(t,e)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const e=this.cell,s=e.getLabels();if(s.length===0)return this;const r=e.getDefaultLabel(),i=this.normalizeLabelPosition(r.position);for(let o=0,a=s.length;o<a;o+=1){const l=s[o],u=this.labelCache[o];if(!u)continue;const h=this.normalizeLabelPosition(l.position),f=Gt({},i,h),d=this.getLabelTransformationMatrix(f);u.setAttribute("transform",Br(d))}return this}updateTerminalProperties(t){const e=this.cell,s=this.graph,r=e[t],i=r&&r.cell,o=`${t}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(t),!0;const a=s.getCellById(i);if(!a)throw new Error(`Edge's ${t} node with id "${i}" not exists`);const l=a.findView(s);return l?(this[o]=l,this.updateTerminalMagnet(t),!0):!1}updateTerminalMagnet(t){const e=`${t}Magnet`,s=this.getTerminalView(t);if(s){let r=s.getMagnetFromEdgeTerminal(this.cell[t]);r===s.container&&(r=null),this[e]=r}else this[e]=null}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&typeof e.position=="object"&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&typeof e.position=="object")return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&typeof t.position=="object")return t.position.options}mergeLabelPositionArgs(t,e){return t===null?null:t===void 0?e===null?null:e:Gt({},e,t)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const t=this.cache.pathCache;return ca(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const t=this.cache.pathCache;return ca(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const t=this.cache.pathCache;return ca(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return this.path==null?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return this.path==null?null:(Yn(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return this.path==null?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return this.path==null?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return this.path==null?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return this.path==null?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return this.path==null?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,s,r){const i={distance:0};let o=0,a;typeof s=="number"?(o=s,a=r):a=s,a!=null&&(i.options=a);const l=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),h=a&&a.absoluteDistance&&a.reverseDistance,f=this.path,d={segmentSubdivisions:this.getConnectionSubdivisions()},g=new O(t,e),p=f.closestPointT(g,d),m=this.getConnectionLength()||0;let y=f.lengthAtT(p,d);u&&(y=m>0?y/m:0),h&&(y=-1*(m-y)||1),i.distance=y;let b;l||(b=f.tangentAtT(p));let w;if(b)w=b.pointOffset(g);else{const x=f.pointAtT(p),v=g.diff(x);w={x:v.x,y:v.y}}return i.offset=w,i.angle=o,i}normalizeLabelPosition(t){return typeof t=="number"?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),s=e.options||{},r=e.angle||0,i=e.distance,o=i>0&&i<=1;let a=0;const l={x:0,y:0},u=e.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(l.x=u.x),u.y!=null&&(l.y=u.y)));const h=l.x!==0||l.y!==0||a===0,f=s.keepGradient,d=s.ensureLegibility,g=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},m=o?i*this.getConnectionLength():i,y=g.tangentAtLength(m,p);let b,w=r;if(y){if(h)b=y.start,b.translate(l);else{const x=y.clone();x.rotate(-90,y.start),x.setLength(a),b=x.end}f&&(w=y.angle()+r,d&&(w=gt.normalize((w+90)%180-90)))}else b=g.start,h&&b.translate(l);return ne().translate(b.x,b.y).rotate(w)}getVertexIndex(t,e){const r=this.cell.getVertices(),i=this.getClosestPointLength(new O(t,e));let o=0;if(i!=null)for(const a=r.length;o<a;o+=1){const l=r[o],u=this.getClosestPointLength(l);if(u!=null&&i<u)break}return o}getEventArgs(t,e,s){const r=this,i=r.cell,o=i;return e==null||s==null?{e:t,view:r,edge:i,cell:o}:{e:t,x:e,y:s,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(t,e,s){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,s){super.onMouseDown(t,e,s),this.notify("edge:mousedown",this.getEventArgs(t,e,s))}notifyMouseMove(t,e,s){super.onMouseMove(t,e,s),this.notify("edge:mousemove",this.getEventArgs(t,e,s))}notifyMouseUp(t,e,s){super.onMouseUp(t,e,s),this.notify("edge:mouseup",this.getEventArgs(t,e,s))}onClick(t,e,s){super.onClick(t,e,s),this.notify("edge:click",this.getEventArgs(t,e,s))}onDblClick(t,e,s){super.onDblClick(t,e,s),this.notify("edge:dblclick",this.getEventArgs(t,e,s))}onContextMenu(t,e,s){super.onContextMenu(t,e,s),this.notify("edge:contextmenu",this.getEventArgs(t,e,s))}onMouseDown(t,e,s){this.notifyMouseDown(t,e,s),this.startEdgeDragging(t,e,s)}onMouseMove(t,e,s){const r=this.getEventData(t);switch(r.action){case"drag-label":{this.dragLabel(t,e,s);break}case"drag-arrowhead":{this.dragArrowhead(t,e,s);break}case"drag-edge":{this.dragEdge(t,e,s);break}}return this.notifyMouseMove(t,e,s),r}onMouseUp(t,e,s){const r=this.getEventData(t);switch(r.action){case"drag-label":{this.stopLabelDragging(t,e,s);break}case"drag-arrowhead":{this.stopArrowheadDragging(t,e,s);break}case"drag-edge":{this.stopEdgeDragging(t,e,s);break}}return this.notifyMouseUp(t,e,s),this.checkMouseleave(t),r}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,s,r){super.onMouseWheel(t,e,s,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(t,e,s)))}onCustomEvent(t,e,s,r){if(ry(t.target,"edge-tool",this.container)){if(t.stopPropagation(),this.can("useEdgeTools")){if(e==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,s,r)))}this.notifyMouseDown(t,s,r)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,s,r))),super.onCustomEvent(t,e,s,r)}onLabelMouseDown(t,e,s){this.notifyMouseDown(t,e,s),this.startLabelDragging(t,e,s),this.getEventData(t).stopPropagation&&t.stopPropagation()}startEdgeDragging(t,e,s){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(t,e,s);return}this.setEventData(t,{x:e,y:s,moving:!1,action:"drag-edge"})}dragEdge(t,e,s){const r=this.getEventData(t);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-r.x,s-r.y,{ui:!0}),this.setEventData(t,{x:e,y:s}),this.notify("edge:moving",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,s){const r=this.getEventData(t);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:s,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(t,e){const s=this.getTerminalMagnet(t),r={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:e.isNewEdge===!0,terminalType:t,initialMagnet:s,initialTerminal:mc(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(t){const e=[];e[4]=t,e[5]=this;let s,r=0,i=0;t==="source"?(r=2,s="target"):(i=2,s="source");const o=this.cell[s],a=o.cell;if(a){let l;const u=e[r]=this.graph.findViewByCell(a);u&&(l=u.getMagnetFromEdgeTerminal(o),l===u.container&&(l=void 0)),e[r+1]=l}return(l,u)=>(e[i]=l,e[i+1]=l.container===u?void 0:u,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){t.zIndex!=null&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}validateConnection(t,e,s,r,i,o,a){const l=this.graph.options.connecting,u=l.allowLoop,h=l.allowNode,f=l.allowEdge,d=l.allowPort,g=l.allowMulti,p=l.validateConnection,m=o?o.cell:null,y=i==="target"?s:t,b=i==="target"?r:e;let w=!0;const x=v=>{const S=i==="source"?a?a.port:null:m?m.getSourcePortId():null,E=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return X(v,this.graph,{edge:m,edgeView:o,sourceView:t,targetView:s,sourcePort:S,targetPort:E,sourceMagnet:e,targetMagnet:r,sourceCell:t?t.cell:null,targetCell:s?s.cell:null,type:i})};if(u!=null&&(typeof u=="boolean"?!u&&t===s&&(w=!1):w=x(u)),w&&d!=null&&(typeof d=="boolean"?!d&&b&&(w=!1):w=x(d)),w&&f!=null&&(typeof f=="boolean"?!f&&Xn.isEdgeView(y)&&(w=!1):w=x(f)),w&&h!=null&&b==null&&(typeof h=="boolean"?!h&&hn.isNodeView(y)&&(w=!1):w=x(h)),w&&g!=null&&o){const v=o.cell,S=i==="source"?a:v.getSource(),E=i==="target"?a:v.getTarget(),C=a?this.graph.getCellById(a.cell):null;if(S&&E&&S.cell&&E.cell&&C)if(typeof g=="function")w=x(g);else{const M=this.graph.model.getConnectedEdges(C,{outgoing:i==="source",incoming:i==="target"});M.length&&(g==="withPort"?M.some(_=>{const N=_.getSource(),k=_.getTarget();return N&&k&&N.cell===S.cell&&k.cell===E.cell&&N.port!=null&&N.port===S.port&&k.port!=null&&k.port===E.port})&&(w=!1):g||M.some(_=>{const N=_.getSource(),k=_.getTarget();return N&&k&&N.cell===S.cell&&k.cell===E.cell})&&(w=!1))}}return w&&p!=null&&(w=x(p)),w}allowConnectToBlank(t){const e=this.graph,r=e.options.connecting.allowBlank;if(typeof r!="function")return!!r;const i=e.findViewByCell(t),o=t.getSourceCell(),a=t.getTargetCell(),l=e.findViewByCell(o),u=e.findViewByCell(a);return X(r,e,{edge:t,edgeView:i,sourceCell:o,targetCell:a,sourceView:l,targetView:u,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(t,e,s){const r=this.graph;if(!this.allowConnectToBlank(t)){const o=t.getSourceCellId(),a=t.getTargetCellId();if(!(o&&a))return!1}const i=r.options.connecting.validateEdge;return i?X(i,r,{edge:t,type:e,previous:s}):!0}arrowheadDragging(t,e,s,r){r.x=e,r.y=s,r.currentTarget!==t&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(t),r.currentView?(r.currentMagnet=r.currentView.findMagnet(t),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,e,s,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=t,this.cell.prop(r.terminalType,{x:e,y:s},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(t,e,s){const r=t.currentView,i=t.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=t.terminalType,a=r.getEdgeTerminal(i,e,s,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(t,e,s){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a=typeof i=="object"&&i.radius||50,l=typeof i=="object"&&i.anchor||"center",u=r.renderer.findViewsInArea({x:t-a,y:e-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=r.renderer.findEdgeViewsFromPoint({x:t,y:e},a).filter(S=>S!==this);u.push(...v)}const h=s.closestView||null,f=s.closestMagnet||null;s.closestView=null,s.closestMagnet=null;let d,g=Number.MAX_SAFE_INTEGER;const p=new O(t,e);u.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())d=l==="center"?v.cell.getBBox().getCenter().distance(p):v.cell.getBBox().getNearestPointToPoint(p).distance(p);else if(v.isEdgeView()){const S=v.getClosestPoint(p);S?d=S.distance(p):d=Number.MAX_SAFE_INTEGER}d<a&&d<g&&(f===v.container||this.validateConnection(...s.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,t,e,this.cell,s.terminalType)))&&(g=d,s.closestView=v,s.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(S=>{if(S.getAttribute("magnet")!=="false"){const E=v.getBBoxOfElement(S);d=p.distance(E.getCenter()),d<a&&d<g&&(f===S||this.validateConnection(...s.getValidateConnectionArgs(v,S),v.getEdgeTerminal(S,t,e,this.cell,s.terminalType)))&&(g=d,s.closestView=v,s.closestMagnet=S)}})});let m;const y=s.terminalType,b=s.closestView,w=s.closestMagnet,x=f!==w;if(h&&x&&h.unhighlight(f,{type:"magnetAdsorbed"}),b){if(!x)return;b.highlight(w,{type:"magnetAdsorbed"}),m=b.getEdgeTerminal(w,t,e,this.cell,y)}else m={x:t,y:e};this.cell.setTerminal(y,m,{},Object.assign(Object.assign({},s.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,s=t.closestMagnet;e&&s&&(e.unhighlight(s,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(s)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const s=t.terminalType,r=t.initialTerminal,i=this.cell[s];if(i&&!Vt.equalTerminals(r,i)){const a=this.graph,l=r,u=l.cell?a.getCellById(l.cell):null,h=l.port,f=u?a.findViewByCell(u):null,d=u||t.isNewEdge?null:O.create(r).toJSON(),g=i,p=g.cell?a.getCellById(g.cell):null,m=g.port,y=p?a.findViewByCell(p):null,b=p?null:O.create(i).toJSON();this.notify("edge:connected",{e,previousCell:u,previousPort:h,previousView:f,previousPoint:d,currentCell:p,currentView:y,currentPort:m,currentPoint:b,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:s,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,s=e.model.getCells();t.marked={};for(let r=0,i=s.length;r<i;r+=1){const o=e.findViewByCell(s[r]);if(!o||o.cell.id===this.cell.id)continue;const a=Array.prototype.slice.call(o.container.querySelectorAll("[magnet]"));o.container.getAttribute("magnet")!=="false"&&a.push(o.container);const l=a.filter(u=>this.validateConnection(...t.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,t.x,t.y,this.cell,t.terminalType)));if(l.length>0){for(let u=0,h=l.length;u<h;u+=1)o.highlight(l[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),t.marked[o.cell.id]=l}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(s=>{const r=this.graph.findViewByCell(s);r&&(e[s].forEach(o=>{r.unhighlight(o,{type:"magnetAvailable"})}),r.unhighlight(null,{type:"nodeAvailable"}))}),t.marked=null}startArrowheadDragging(t,e,s){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(t,e,s);return}const i=t.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:e,y:s});this.setEventData(t,o)}dragArrowhead(t,e,s){const r=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,s,r):this.arrowheadDragging(this.getEventTarget(t),e,s,r)}stopArrowheadDragging(t,e,s){const r=this.graph,i=this.getEventData(t);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,e,s),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,t)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(t,e,s){if(this.can("edgeLabelMovable")){const r=t.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),a=this.getLabelPositionArgs(i),l=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,l);this.setEventData(t,{index:i,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,s){const r=this.getEventData(t),i=this.cell.getLabelAt(r.index),o=Gt({},i,{position:this.getLabelPosition(e,s,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)}stopLabelDragging(t,e,s){}}(function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag],r=e;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"&&typeof r.update=="function"&&typeof r.getConnection=="function"}n.isEdgeView=t})(Xn||(Xn={})),Xn.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],tools:["tools"],vertices:["vertices","update"]}}),Xn.registry.register("edge",Xn,!0);var TV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Mn extends pt{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(t){super(),this.graph=t;const{selectors:e,fragment:s}=_t.parseJSONMarkup(Mn.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=Mn.snapshoot(this.container),J(this.container,this.prefixClassName("graph")),Ne(this.container,s),this.delegateEvents()}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return t.type==="mousedown"&&t.button===2||this.options.guard&&this.options.guard(t,e)?!0:t.data&&t.data.guarded!==void 0?t.data.guarded:!(e&&e.cell&&ht.isCell(e.cell)||this.svg===t.target||this.container===t.target||this.svg.contains(t.target))}findView(t){return this.graph.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onDblClick(e,r.x,r.y):this.graph.trigger("blank:dblclick",{e,x:r.x,y:r.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onClick(e,r.x,r.y):this.graph.trigger("blank:click",{e,x:r.x,y:r.y})}}isPreventDefaultContextMenu(t){let e=this.options.preventDefaultContextMenu;return typeof e=="function"&&(e=X(e,this.graph,{view:t})),e}onContextMenu(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.isPreventDefaultContextMenu(s)&&t.preventDefault(),this.guard(e,s))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onContextMenu(e,r.x,r.y):this.graph.trigger("blank:contextmenu",{e,x:r.x,y:r.y})}delegateDragEvents(t,e){t.data==null&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const s=this.constructor;this.delegateDocumentEvents(s.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){return this.getEventData(t).mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;this.options.preventDefaultMouseDown&&t.preventDefault();const r=this.graph.snapToGrid(e.clientX,e.clientY);s?s.onMouseDown(e,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&t.preventDefault(),this.graph.trigger("blank:mousedown",{e,x:r.x,y:r.y})),this.delegateDragEvents(e,s)}onMouseMove(t){const e=this.getEventData(t),s=e.startPosition;if(s&&s.x===t.clientX&&s.y===t.clientY||(e.mouseMovedCount==null&&(e.mouseMovedCount=0),e.mouseMovedCount+=1,e.mouseMovedCount<=this.options.moveThreshold))return;const i=this.normalizeEvent(t),o=this.graph.snapToGrid(i.clientX,i.clientY),a=e.currentView;a?a.onMouseMove(i,o.x,o.y):this.graph.trigger("blank:mousemove",{e:i,x:o.x,y:o.y}),this.setEventData(i,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),s=this.graph.snapToGrid(e.clientX,e.clientY),i=this.getEventData(t).currentView;if(i?i.onMouseUp(e,s.x,s.y):this.graph.trigger("blank:mouseup",{e,x:s.x,y:s.y}),!t.isPropagationStopped()){const o=new En(t,{type:"click",data:t.data});this.onClick(o)}t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(!this.guard(e,s))if(s)s.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e})}}onMouseOut(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(!this.guard(e,s))if(s)s.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e})}}onMouseEnter(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.findViewByElem(e.relatedTarget);if(s){if(r===s)return;s.onMouseEnter(e)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e})}}onMouseLeave(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=this.graph.findViewByElem(e.relatedTarget);if(s){if(r===s)return;s.onMouseLeave(e)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e})}}onMouseWheel(t){const e=this.normalizeEvent(t),s=this.findView(e.target);if(this.guard(e,s))return;const r=e.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));s?s.onMouseWheel(e,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e,delta:o,x:i.x,y:i.y})}onCustomEvent(t){const e=t.currentTarget,s=e.getAttribute("event")||e.getAttribute("data-event");if(s){const r=this.findView(e);if(r){const i=this.normalizeEvent(t);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,s,o.x,o.y)}}}handleMagnetEvent(t,e){const s=t.currentTarget,r=s.getAttribute("magnet");if(r&&r.toLowerCase()!=="false"){const i=this.findView(s);if(i){const o=this.normalizeEvent(t);if(this.guard(o,i))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);X(e,this.graph,i,o,s,a.x,a.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(e,s,r,i,o)=>{e.onMagnetMouseDown(s,r,i,o)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(e,s,r,i,o)=>{e.onMagnetDblClick(s,r,i,o)})}onMagnetContextMenu(t){const e=this.findView(t.target);this.isPreventDefaultContextMenu(e)&&t.preventDefault(),this.handleMagnetEvent(t,(s,r,i,o,a)=>{s.onMagnetContextMenu(r,i,o,a)})}onLabelMouseDown(t){const e=t.currentTarget,s=this.findView(e);if(s){const r=this.normalizeEvent(t);if(this.guard(r,s))return;const i=this.graph.snapToGrid(r.clientX,r.clientY);s.onLabelMouseDown(r,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}TV([pt.dispose()],Mn.prototype,"dispose",null),function(n){const t=`${Ue.prefixCls}-graph`;n.markup=[{ns:ee.xhtml,tagName:"div",selector:"background",className:`${t}-background`},{ns:ee.xhtml,tagName:"div",selector:"grid",className:`${t}-grid`},{ns:ee.svg,tagName:"svg",selector:"svg",className:`${t}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":ee.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${t}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${t}-svg-primer`},{tagName:"g",selector:"stage",className:`${t}-svg-stage`},{tagName:"g",selector:"decorator",className:`${t}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${t}-svg-overlay`}]}]}];function e(s){const r=s.cloneNode();return s.childNodes.forEach(i=>r.appendChild(i)),()=>{for(qi(s);s.attributes.length>0;)s.removeAttribute(s.attributes[0].name);for(let i=0,o=r.attributes.length;i<o;i+=1){const a=r.attributes[i];s.setAttribute(a.name,a.value)}r.childNodes.forEach(i=>s.appendChild(i))}}n.snapshoot=e}(Mn||(Mn={})),function(n){const t=Ue.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${t}-cell`]:"onMouseEnter",[`mouseleave .${t}-cell`]:"onMouseLeave",[`mouseenter .${t}-cell-tools`]:"onMouseEnter",[`mouseleave .${t}-cell-tools`]:"onMouseLeave",[`mousedown .${t}-cell [event]`]:"onCustomEvent",[`touchstart .${t}-cell [event]`]:"onCustomEvent",[`mousedown .${t}-cell [data-event]`]:"onCustomEvent",[`touchstart .${t}-cell [data-event]`]:"onCustomEvent",[`dblclick .${t}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${t}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${t}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${t}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${t}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${t}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${t}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${t}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${t}-cell image`]:"onImageDragStart",[`mousedown .${t}-edge .${t}-edge-label`]:"onLabelMouseDown",[`touchstart .${t}-edge .${t}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(Mn||(Mn={}));const NV=`.x6-graph {
|
|
121
121
|
position: relative;
|
|
122
122
|
overflow: hidden;
|
|
123
123
|
outline: none;
|
|
@@ -276,7 +276,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
276
276
|
border: 1px solid #275fc5;
|
|
277
277
|
border-radius: 2px;
|
|
278
278
|
}
|
|
279
|
-
`;class re extends ye{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(t){super(),this.graph=t,this.init()}init(){}}var NV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ih extends re{init(){jr("core",TV)}dispose(){$r("core")}}NV([ih.dispose()],ih.prototype,"dispose",null);var _V=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e},go;(function(n){function t(e){const{grid:s,panning:r,mousewheel:i,embedding:o}=e,a=_V(e,["grid","panning","mousewheel","embedding"]),l=e.container;if(l!=null)a.width==null&&(a.width=l.clientWidth),a.height==null&&(a.height=l.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=Yt({},n.defaults,a),h={size:10,visible:!1};return typeof s=="number"?u.grid={size:s,visible:!1}:typeof s=="boolean"?u.grid=Object.assign(Object.assign({},h),{visible:s}):u.grid=Object.assign(Object.assign({},h),s),["panning","mousewheel","embedding"].forEach(d=>{const g=e[d];typeof g=="boolean"?u[d].enabled=g:u[d]=Object.assign(Object.assign({},u[d]),g)}),u}n.get=t})(go||(go={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Ue.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Ue.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:t,sourceView:e,targetView:s}){return(t==="target"?s:e)!=null},createEdge(){return new SV}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(go||(go={}));var kV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},DV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class oh extends re{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const s=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(t)?t:[t];this.patterns.forEach((l,u)=>{const h=`pattern_${u}`,f=s.a||1,d=s.d||1,{update:g,markup:p}=l,m=DV(l,["update","markup"]),y=Object.assign(Object.assign(Object.assign({},m),i[u]),{sx:f,sy:d,ox:s.e||0,oy:s.f||0,width:e*f,height:e*d});r.has(h)||r.add(h,tt.create("pattern",{id:h,patternUnits:"userSpaceOnUse"},tt.createVectors(p)).node);const b=r.get(h);typeof g=="function"&&g(b.childNodes[0],y);let w=y.ox%y.width;w<0&&(w+=y.width);let x=y.oy%y.height;x<0&&(x+=y.height),ut(b,{x:w,y:x,width:y.width,height:y.height})});const o=new XMLSerializer().serializeToString(r.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new bs),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(e==null)return[Object.assign(Object.assign({},bs.presets.dot),t.args)];const s=bs.registry.get(e);if(s){let r=t.args||[];return Array.isArray(r)||(r=[r]),Array.isArray(s)?s.map((i,o)=>Object.assign(Object.assign({},i),r[o])):[Object.assign(Object.assign({},s),r[0])]}return bs.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}kV([re.dispose()],oh.prototype,"dispose",null);class _b extends re{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),ne(this.viewportMatrix)}setMatrix(t){const e=ne(t),s=Br(e);this.viewport.setAttribute("transform",s),this.viewportMatrix=e,this.viewportTransformString=s}resize(t,e){let s=t===void 0?this.options.width:t,r=e===void 0?this.options.height:e;this.options.width=s,this.options.height=r,typeof s=="number"&&(s=Math.round(s)),typeof r=="number"&&(r=Math.round(r)),this.container.style.width=s==null?"":`${s}px`,this.container.style.height=r==null?"":`${r}px`;const i=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},i)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Oc(t)||(t=this.container.clientWidth),Oc(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return zR(this.getMatrix())}scale(t,e=t,s=0,r=0){if(t=this.clampScale(t),e=this.clampScale(e),s||r){const o=this.getTranslation(),a=o.tx-s*(t-1),l=o.ty-r*(e-1);(a!==o.tx||l!==o.ty)&&this.translate(a,l)}const i=this.getMatrix();return i.a=t,i.d=e,this.setMatrix(i),this.graph.trigger("scale",{sx:t,sy:e,ox:s,oy:r}),this}clampScale(t){const e=this.graph.options.scaling;return we(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let s=t,r=t;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,l=o.height/2;if(e.absolute||(s+=i.sx,r+=i.sy),e.scaleGrid&&(s=Math.round(s/e.scaleGrid)*e.scaleGrid,r=Math.round(r/e.scaleGrid)*e.scaleGrid),e.maxScale&&(s=Math.min(e.maxScale,s),r=Math.min(e.maxScale,r)),e.minScale&&(s=Math.max(e.minScale,s),r=Math.max(e.minScale,r)),e.center&&(a=e.center.x,l=e.center.y),s=this.clampScale(s),r=this.clampScale(r),a||l){const u=this.getTranslation(),h=a-(a-u.tx)*(s/i.sx),f=l-(l-u.ty)*(r/i.sy);(h!==u.tx||f!==u.ty)&&this.translate(h,f)}return this.scale(s,r),this}getRotation(){return FR(this.getMatrix())}rotate(t,e,s){if(e==null||s==null){const i=vt.getBBox(this.stage);e=i.width/2,s=i.height/2}const r=this.getMatrix().translate(e,s).rotate(t).translate(-e,-s);return this.setMatrix(r),this}getTranslation(){return HR(this.getMatrix())}translate(t,e){const s=this.getMatrix();s.e=t||0,s.f=e||0,this.setMatrix(s);const r=this.getTranslation();return this.options.x=r.tx,this.options.y=r.ty,this.graph.trigger("translate",Object.assign({},r)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,s,r){if(typeof t=="object"){const x=t;t=x.gridWidth||1,e=x.gridHeight||1,s=x.padding||0,r=x}else t=t||1,e=e||1,s=s||0,r==null&&(r={});const i=ds(s),o=r.border||0,a=r.contentArea?z.create(r.contentArea):this.getContentArea(r);o>0&&a.inflate(o);const l=this.getScale(),u=this.getTranslation(),h=l.sx,f=l.sy;a.x*=h,a.y*=f,a.width*=h,a.height*=f;let d=Math.max(Math.ceil((a.width+a.x)/t),1)*t,g=Math.max(Math.ceil((a.height+a.y)/e),1)*e,p=0,m=0;(r.allowNewOrigin==="negative"&&a.x<0||r.allowNewOrigin==="positive"&&a.x>=0||r.allowNewOrigin==="any")&&(p=Math.ceil(-a.x/t)*t,p+=i.left,d+=p),(r.allowNewOrigin==="negative"&&a.y<0||r.allowNewOrigin==="positive"&&a.y>=0||r.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/e)*e,m+=i.top,g+=m),d+=i.right,g+=i.bottom,d=Math.max(d,r.minWidth||0),g=Math.max(g,r.minHeight||0),d=Math.min(d,r.maxWidth||Number.MAX_SAFE_INTEGER),g=Math.min(g,r.maxHeight||Number.MAX_SAFE_INTEGER);const y=this.getComputedSize(),b=d!==y.width||g!==y.height;return(p!==u.tx||m!==u.ty)&&this.translate(p,m),b&&this.resize(d,g),new z(-p/h,-m/f,d/h,g/f)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let s,r;if(t.contentArea){const b=t.contentArea;s=this.graph.localToGraph(b),r=O.create(b)}else s=this.getContentBBox(t),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=ds(t.padding),o=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||o,u=t.maxScaleX||a,h=t.minScaleY||o,f=t.maxScaleY||a;let d;if(t.viewportArea)d=t.viewportArea;else{const b=this.getComputedSize(),w=this.getTranslation();d={x:w.tx,y:w.ty,width:b.width,height:b.height}}d=z.create(d).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const g=this.getScale();let p=d.width/s.width*g.sx,m=d.height/s.height*g.sy;t.preserveAspectRatio!==!1&&(p=m=Math.min(p,m));const y=t.scaleGrid;if(y&&(p=y*Math.floor(p/y),m=y*Math.floor(m/y)),p=we(p,l,u),m=we(m,h,f),this.scale(p,m),e){const b=this.options,w=d.x-r.x*p-b.x,x=d.y-r.y*m-b.y;this.translate(w,x)}}getContentArea(t={}){return t.useCellGeometry!==!1?this.model.getAllCellsBBox()||new z:vt.getBBox(this.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=z.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const s=z.create(t),r=this.graph;e.contentArea=s,e.viewportArea==null&&(e.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const i=s.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const s=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=s.width/2,a=s.height/2;t=typeof t=="number"?t:o,e=typeof e=="number"?e:a,t=o-t*r.sx,e=a-e*r.sy,(i.tx!==t||i.ty!==e)&&this.translate(t,e)}centerContent(t){const s=this.graph.getContentArea(t).getCenter();this.centerPoint(s.x,s.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,s){const r=this.getComputedSize();e=an(e,Math.max(0,r.width)),e<0&&(e=r.width+e),s=an(s,Math.max(0,r.height)),s<0&&(s=r.height+s);const i=this.getTranslation(),o=this.getScale(),a=e-t.x*o.sx,l=s-t.y*o.sy;(i.tx!==a||i.ty!==l)&&this.translate(a,l)}positionRect(t,e){const s=z.create(t);switch(e){case"center":return this.positionPoint(s.getCenter(),"50%","50%");case"top":return this.positionPoint(s.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%");case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(s.getTopLeft(),0,0);default:return this}}positionCell(t,e){const s=t.getBBox();return this.positionRect(s,e)}positionContent(t,e){const s=this.graph.getContentArea(e);return this.positionRect(s,t)}}var RV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ah extends re{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",s=t.position||"center";const r=this.graph.transform.getScale(),i=this.graph.translate();if(typeof s=="object"){const o=i.tx+r.sx*(s.x||0),a=i.ty+r.sy*(s.y||0);s=`${o}px ${a}px`}typeof e=="object"&&(e=z.fromSize(e).scale(r.sx,r.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=s}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const s=this.optionsCache;if(s&&s.image!==e.image)return;let r;const i=e.opacity,o=e.size;let a=e.repeat||"no-repeat";const l=ro.registry.get(a);if(typeof l=="function"){const h=e.quality||1;t.width*=h,t.height*=h;const f=l(t,e);if(!(f instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=f.toDataURL("image/png"),e.repeat&&a!==e.repeat?a=e.repeat:a="repeat",typeof o=="object"?(o.width*=f.width/t.width,o.height*=f.height/t.height):o===void 0&&(e.size={width:f.width/h,height:f.height/h})}else r=t.src,o===void 0&&(e.size={width:t.width,height:t.height});s!=null&&typeof e.size=="object"&&e.image===s.image&&e.repeat===s.repeat&&e.quality===s.quality&&(s.size=yc(e.size));const u=this.elem.style;u.backgroundImage=`url(${r})`,u.backgroundRepeat=a,u.opacity=i==null||i>=1?"":`${i}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=yc(e);const s=document.createElement("img");s.onload=()=>this.drawBackgroundImage(s,t),s.setAttribute("crossorigin","anonymous"),s.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}RV([re.dispose()],ah.prototype,"dispose",null);var IV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class lh extends re{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onSpaceKeyDown=this.onSpaceKeyDown.bind(this),this.onSpaceKeyUp=this.onSpaceKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),le.on(this.graph.container,"mousedown",this.onRightMouseDown),le.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Ey(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),le.off(this.graph.container,"mousedown",this.onRightMouseDown),le.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(t,e){return t.spaceKey=this.isSpaceKeyPressed,this.pannable&&ms.isMatch(t,this.widgetOptions.modifiers,e)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),le.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),le.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),s=e.clientX-this.clientX,r=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(s,r)}stopPanning(t){this.panning=!1,this.updateClassName(),le.off(document.body,".panning"),le.off(window,".panning")}updateClassName(){const t=this.view.container,e=this.view.prefixClassName("graph-panning"),s=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(J(t,e),Dt(t,s)):(Dt(t,e),J(t,s)):(Dt(t,e),Dt(t,s))}onMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.getPlugin("selection"),s=e&&e.allowRubberband(t,!0);(this.allowPanning(t,!0)||this.allowPanning(t)&&!s)&&this.startPanning(t)}onRightMouseDown(t){const e=this.widgetOptions.eventTypes;e!=null&&e.includes("rightMouseDown")&&t.button===2&&this.allowPanning(t,!0)&&this.startPanning(t)}onMouseWheel(t,e,s){this.graph.translateBy(-e,-s)}onSpaceKeyDown(t){t.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(t){t.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(t){const e=this.widgetOptions.eventTypes;return(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}allowMouseWheel(t){var e;return this.pannable&&!t.ctrlKey&&((e=this.widgetOptions.eventTypes)===null||e===void 0?void 0:e.includes("mouseWheel"))}autoPanning(t,e){const r=this.graph.getGraphArea();let i=0,o=0;t<=r.left+10&&(i=-10),e<=r.top+10&&(o=-10),t>=r.right-10&&(i=10),e>=r.bottom-10&&(o=10),(i!==0||o!==0)&&this.graph.translateBy(-i,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}IV([re.dispose()],lh.prototype,"dispose",null);var LV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ch extends re{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Ey(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(t){(this.disabled||t)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=this.widgetOptions.guard;return(e==null||e(t))&&ms.isMatch(t,this.widgetOptions.modifiers)}onMouseWheel(t){const e=this.widgetOptions.guard;if((e==null||e(t))&&ms.isMatch(t,this.widgetOptions.modifiers)){const s=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.transform.getScale().sx),t.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*s*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/s)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.currentScale;let o=this.graph.transform.clampScale(i*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=we(o,a,l),o!==i)if(this.widgetOptions.zoomAtMousePosition){const h=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:h.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}LV([ye.dispose()],ch.prototype,"dispose",null);var BV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class kb extends re{init(){this.resetRenderArea=E2(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const t=this.graph.getGraphArea();this.graph.renderer.setRenderArea(t)}}dispose(){this.stopListening()}}BV([re.dispose()],kb.prototype,"dispose",null);class VV{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(t){if(t.priority&Kn.PRIOR)t.cb();else{const e=this.findInsertionIndex(t);e>=0&&this.queue.splice(e,0,t)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const t=this.getCurrentTime();let e;for(;(e=this.queue.shift())&&(e.cb(),!(this.getCurrentTime()-t>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let t;for(;t=this.queue.shift();)try{t.cb()}catch(e){console.log(e)}this.isFlushing=!1}findInsertionIndex(t){let e=0,s=this.queue.length,r=s-1;const i=t.priority;for(;e<=r;){const o=(r-e>>1)+e;i<=this.queue[o].priority?e=o+1:(s=o,r=o-1)}return s}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Kn;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(Kn||(Kn={}));var jV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Qt extends ye{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(t){super(),this.views={},this.willRemoveViews={},this.queue=new VV,this.graph=t,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:t}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const e=this.model.getCells();this.renderViews(e,Object.assign(Object.assign({},t),{queue:e.map(s=>s.id)}))}onCellAdded({cell:t,options:e}){this.renderViews([t],e)}onCellRemoved({cell:t}){this.removeViews([t])}onCellZIndexChanged({cell:t,options:e}){const s=this.views[t.id];s&&this.requestViewUpdate(s.view,Qt.FLAG_INSERT,e,Kn.Update,!0)}onCellVisibleChanged({cell:t,current:e}){this.toggleVisible(t,!!e)}requestViewUpdate(t,e,s={},r=Kn.Update,i=!0){const o=t.cell.id,a=this.views[o];if(!a)return;a.flag=e,a.options=s,(t.hasAction(e,["translate","resize","rotate"])||s.async===!1)&&(r=Kn.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(t,e,s);const h=s.queue;if(h){const f=h.indexOf(t.cell.id);f>=0&&h.splice(f,1),h.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(t).forEach(h=>{this.requestViewUpdate(h.view,h.flag,s,r,!1)}),i&&this.flush()}setRenderArea(t){this.renderArea=t,this.flushWaitingViews()}isViewMounted(t){if(t==null)return!1;const e=this.views[t.cell.id];return e?e.state===Qt.ViewState.MOUNTED:!1}renderViews(t,e={}){t.sort((s,r)=>s.isNode()&&r.isEdge()?-1:0),t.forEach(s=>{const r=s.id,i=this.views;let o=0,a=i[r];if(a)o=Qt.FLAG_INSERT;else{const l=this.createCellView(s);l&&(l.graph=this.graph,o=Qt.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:e,state:Qt.ViewState.CREATED},this.views[r]=a)}a&&this.requestViewUpdate(a.view,o,e,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(t,e,s={}){const r=t.cell,i=r.id,o=this.views[i];if(!o)return;let a=0;this.isUpdatable(t)?(a=this.updateView(t,e,s),o.flag=a):o.state===Qt.ViewState.MOUNTED?(a=this.updateView(t,e,s),o.flag=a):o.state=Qt.ViewState.WAITING,a&&r.isEdge()&&!(a&t.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:Kn.RenderEdge,cb:()=>{this.updateView(t,e,s)}})}removeViews(t){t.forEach(e=>{const s=e.id,r=this.views[s];r&&(this.willRemoveViews[s]=r,delete this.views[s],this.queue.queueJob({id:s,priority:this.getRenderPriority(r.view),cb:()=>{this.removeView(r.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(t=>{if(t&&t.state===Qt.ViewState.WAITING){const{view:e,flag:s,options:r}=t;this.requestViewUpdate(e,s,r,this.getRenderPriority(e),!1)}}),this.flush()}updateView(t,e,s={}){if(t==null)return 0;if(Ht.isCellView(t)){if(e&Qt.FLAG_REMOVE)return this.removeView(t.cell),0;e&Qt.FLAG_INSERT&&(this.insertView(t),e^=Qt.FLAG_INSERT)}return e?t.confirmUpdate(e,s):0}insertView(t){const e=this.views[t.cell.id];if(e){const s=t.cell.getZIndex(),r=this.addZPivot(s);this.container.insertBefore(t.container,r),t.cell.isVisible()||this.toggleVisible(t.cell,!1),e.state=Qt.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:t})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(t=>{t&&this.removeView(t.view)}),this.views={},this.willRemoveViews={}}removeView(t){const e=t.cell,s=this.willRemoveViews[e.id];s&&t&&(s.view.remove(),delete this.willRemoveViews[e.id],this.graph.trigger("view:unmounted",{view:t}))}toggleVisible(t,e){const s=this.model.getConnectedEdges(t);for(let i=0,o=s.length;i<o;i+=1){const a=s[i];if(e){const l=a.getSourceCell(),u=a.getTargetCell();if(l&&!l.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const r=this.views[t.id];r&&qt(r.view.container,{display:e?"unset":"none"})}addZPivot(t=0){this.zPivots==null&&(this.zPivots={});const e=this.zPivots;let s=e[t];if(s)return s;s=e[t]=document.createComment(`z-index:${t+1}`);let r=-1/0;for(const o in e){const a=+o;a<t&&a>r&&(r=a,t-1)}const i=this.container;if(r!==-1/0){const o=e[r];i.insertBefore(s,o.nextSibling)}else i.insertBefore(s,i.firstChild);return s}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),this.zPivots={}}createCellView(t){const e={graph:this.graph},s=this.graph.options.createCellView;if(s){const i=X(s,this.graph,t);if(i)return new i(t,e);if(i===null)return null}const r=t.view;if(r!=null&&typeof r=="string"){const i=Ht.registry.get(r);return i?new i(t,e):Ht.registry.onNotFound(r)}return t.isNode()?new hn(t,e):t.isEdge()?new Xn(t,e):null}getEffectedEdges(t){const e=[],s=t.cell,r=this.model.getConnectedEdges(s);for(let i=0,o=r.length;i<o;i+=1){const a=r[i],l=this.views[a.id];if(!l)continue;const u=l.view;if(!this.isViewMounted(u))continue;const h=["update"];a.getTargetCell()===s&&h.push("target"),a.getSourceCell()===s&&h.push("source"),e.push({id:a.id,view:u,flag:u.getFlag(h)})}return e}isUpdatable(t){if(t.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(t.cell.getBBox()):!0;if(t.isEdgeView()){const e=t.cell,s=e.getSourceCell(),r=e.getTargetCell();if(this.renderArea&&s&&r)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(t){return t.cell.isNode()?Kn.RenderNode:Kn.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(t=>{this.views[t].view.dispose()}),this.views={}}}jV([ye.dispose()],Qt.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(Qt||(Qt={})),function(n){(function(t){t[t.CREATED=0]="CREATED",t[t.MOUNTED=1]="MOUNTED",t[t.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(Qt||(Qt={}));var $V=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class uh extends re{constructor(){super(...arguments),this.schedule=new Qt(this.graph)}requestViewUpdate(t,e,s={}){this.schedule.requestViewUpdate(t,e,s)}isViewMounted(t){return this.schedule.isViewMounted(t)}setRenderArea(t){this.schedule.setRenderArea(t)}findViewByElem(t){if(t==null)return null;const e=this.options.container,s=typeof t=="string"?e.querySelector(t):t instanceof Element?t:t[0];if(s){const r=this.graph.view.findAttr("data-cell-id",s);if(r){const i=this.schedule.views;if(i[r])return i[r].view}}return null}findViewByCell(t){if(t==null)return null;const e=ht.isCell(t)?t.id:t,s=this.schedule.views;return s[e]?s[e].view:null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>s!=null?vt.getBBox(s.container,{target:this.view.stage}).containsPoint(e):!1)}findEdgeViewsFromPoint(t,e=5){return this.model.getEdges().map(s=>this.findViewByCell(s)).filter(s=>{if(s!=null){const r=s.getClosestPoint(t);if(r)return r.distance(t)<=e}return!1})}findViewsInArea(t,e={}){const s=z.create(t);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(e.nodeOnly&&!r.isNodeView())return!1;const i=vt.getBBox(r.container,{target:this.view.stage});return i.width===0?i.inflate(1,0):i.height===0&&i.inflate(0,1),e.strict?s.containsRect(i):s.isIntersectWithRect(i)}return!1})}dispose(){this.schedule.dispose()}}$V([re.dispose()],uh.prototype,"dispose",null);var Db=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Rb extends re{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return this.svg.getElementById(t)!=null}filter(t){let e=t.id;const s=t.name;if(e||(e=`filter-${s}-${this.cid}-${Au(JSON.stringify(t))}`),!this.isDefined(e)){const r=Hr.registry.get(s);if(r==null)return Hr.registry.onNotFound(s);const i=r(t.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});tt.create(_t.sanitize(i),o).appendTo(this.defs)}return e}gradient(t){let e=t.id;const s=t.type;if(e||(e=`gradient-${s}-${this.cid}-${Au(JSON.stringify(t))}`),!this.isDefined(e)){const i=t.stops.map(l=>{const u=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${u}"/>`}),o=`<${s}>${i.join("")}</${s}>`,a=Object.assign({id:e},t.attrs);tt.create(o,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:s,refY:r,markerUnits:i,markerOrient:o,tagName:a,children:l}=t,u=Db(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Au(JSON.stringify(t))}`),!this.isDefined(h)){a!=="path"&&delete u.d;const f=tt.create("marker",{refX:s,refY:r,id:h,overflow:"visible",orient:o??"auto",markerUnits:i||"userSpaceOnUse"},l?l.map(d=>{var{tagName:g}=d,p=Db(d,["tagName"]);return tt.create(`${g}`||"path",Ji(Object.assign(Object.assign({},u),p)))}):[tt.create(a||"path",Ji(u))]);this.defs.appendChild(f.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}class Ib extends re{getClientMatrix(){return ne(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new O(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return(typeof t=="number"?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.graph.matrix())}localToClientPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.getClientMatrix())}localToPagePoint(t,e){return(typeof t=="number"?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.graph.matrix())}localToClientRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.getClientMatrix())}localToPageRect(t,e,s,r){return(typeof t=="number"?this.localToGraphRect(t,e,s,r):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const r=O.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,s,r){const i=z.create(t,e,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var zV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ml extends re{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:s={}}){const r=this.resolveHighlighter(s);if(!r)return;const i=this.getHighlighterId(e,r);if(!this.highlights[i]){const o=r.highlighter;o.highlight(t,e,Object.assign({},r.args)),this.highlights[i]={cellView:t,magnet:e,highlighter:o,args:r.args}}}onCellUnhighlight({magnet:t,options:e={}}){const s=this.resolveHighlighter(e);if(!s)return;const r=this.getHighlighterId(t,s);this.unhighlight(r)}resolveHighlighter(t){const e=this.options;let s=t.highlighter;if(s==null){const a=t.type;s=a&&e.highlighting[a]||e.highlighting.default}if(s==null)return null;const r=typeof s=="string"?{name:s}:s,i=r.name,o=qn.registry.get(i);return o==null?qn.registry.onNotFound(i):(qn.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(t,e){return ku(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}zV([ml.dispose()],ml.prototype,"dispose",null);var FV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Lb extends re{getScroller(){const t=this.graph.getPlugin("scroller");return t&&t.options.enabled?t:null}getContainer(){const t=this.getScroller();return t?t.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const t=this.options.autoResize;if(t)return typeof t=="boolean"?this.getContainer():t}init(){if(this.options.autoResize){const e=this.getSensorTarget();e&&Ja.bind(e,()=>{const s=e.offsetWidth,r=e.offsetHeight;this.resize(s,r)})}}resize(t,e){const s=this.getScroller();s?s.resize(t,e):this.graph.transform.resize(t,e)}dispose(){Ja.clear(this.graph.container)}}FV([re.dispose()],Lb.prototype,"dispose",null);var HV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class I extends Nt{get container(){return this.options.container}get[Symbol.toStringTag](){return I.toStringTag}constructor(t){super(),this.installedPlugins=new Set,this.options=go.get(t),this.css=new ih(this),this.view=new Mn(this),this.defs=new Rb(this),this.coord=new Ib(this),this.transform=new _b(this),this.highlight=new ml(this),this.grid=new oh(this),this.background=new ah(this),this.options.model?this.model=this.options.model:(this.model=new Zt,this.model.graph=this),this.renderer=new uh(this),this.panning=new lh(this),this.mousewheel=new ch(this),this.virtualRender=new kb(this),this.size=new Lb(this)}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(s=>Ut.isNode(s)?s:this.createNode(s)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(s=>jt.isEdge(s)?s:this.createEdge(s)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,s={}){return this.model.isNeighbor(t,e,s)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,s={}){return this.model.isSuccessor(t,e,s)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,s={}){return this.model.isPredecessor(t,e,s)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,s,r,i){return this.model.getNodesInArea(t,e,s,r,i)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,s={}){return this.model.search(t,e,s),this}getShortestPath(t,e,s={}){return this.model.getShortestPath(t,e,s)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,s){const r=typeof t=="string"?t:"update",i=typeof t=="string"?e:t,o=typeof e=="function"?s:e;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(t,e){return this.model.updateCellId(t,e)}findView(t){return ht.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return z.isRectangleLike(t)?this.findViewsInArea(t):O.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const s=typeof t=="number"?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(s)}findViewsInArea(t,e,s,r,i){const o=typeof t=="number"?{x:t,y:e,width:s,height:r}:t,a=typeof t=="number"?i:e;return this.renderer.findViewsInArea(o,a)}matrix(t){return typeof t>"u"?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){const s=this.getPlugin("scroller");return s?s.resize(t,e):this.transform.resize(t,e),this}scale(t,e=t,s=0,r=0){return typeof t>"u"?this.transform.getScale():(this.transform.scale(t,e,s,r),this)}zoom(t,e){const s=this.getPlugin("scroller");if(s){if(typeof t>"u")return s.zoom();s.zoom(t,e)}else{if(typeof t>"u")return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const s=this.getPlugin("scroller");return s?s.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const s=this.getPlugin("scroller");return s?s.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.getPlugin("scroller");return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,s){return typeof t>"u"?this.transform.getRotation():(this.transform.rotate(t,e,s),this)}translate(t,e){return typeof t>"u"?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const s=this.translate(),r=s.tx+t,i=s.ty+e;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,s,r){return this.transform.fitToContent(t,e,s,r)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,s){const r=this.getPlugin("scroller");return r?r.centerPoint(t,e,s):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.getPlugin("scroller");return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const s=this.getPlugin("scroller");return s?s.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,s,r={}){const i=this.getPlugin("scroller");return i?i.positionPoint(t,e,s,r):this.transform.positionPoint(t,e,s),this}positionRect(t,e,s){const r=this.getPlugin("scroller");return r?r.positionRect(t,e,s):this.transform.positionRect(t,e),this}positionCell(t,e,s){const r=this.getPlugin("scroller");return r?r.positionCell(t,e,s):this.transform.positionCell(t,e),this}positionContent(t,e){const s=this.getPlugin("scroller");return s?s.positionContent(t,e):this.transform.positionContent(t,e),this}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,s,r){return z.isRectangleLike(t)?this.coord.pageToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.pageToLocalRect(t,e,s,r):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,s,r){return z.isRectangleLike(t)?this.coord.localToPageRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToPageRect(t,e,s,r):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,s,r){return z.isRectangleLike(t)?this.coord.clientToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToLocalRect(t,e,s,r):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,s,r){return z.isRectangleLike(t)?this.coord.localToClientRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToClientRect(t,e,s,r):this.coord.localToClientPoint(t,e)}localToGraph(t,e,s,r){return z.isRectangleLike(t)?this.coord.localToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToGraphRect(t,e,s,r):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,s,r){return z.isRectangleLike(t)?this.coord.graphToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.graphToLocalRect(t,e,s,r):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,s,r){return z.isRectangleLike(t)?this.coord.clientToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToGraphRect(t,e,s,r):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const s=this.getPlugin("scroller");return s!=null&&(this.options.background==null||!e)?s.drawBackground(t,e):this.background.draw(t),this}clearBackground(t){const e=this.getPlugin("scroller");return e!=null&&(this.options.background==null||!t)?e.clearBackground(t):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return t==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.getPlugin("scroller");return t?t.isPannable():this.panning.pannable}enablePanning(){const t=this.getPlugin("scroller");return t?t.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.getPlugin("scroller");return t?t.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}use(t,...e){return this.installedPlugins.has(t)||(this.installedPlugins.add(t),t.init(this,...e)),this}getPlugin(t){return Array.from(this.installedPlugins).find(e=>e.name===t)}getPlugins(t){return Array.from(this.installedPlugins).filter(e=>t.includes(e.name))}enablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const s=this.getPlugins(e);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.enable)===null||i===void 0||i.call(r)}),this}disablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const s=this.getPlugins(e);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.disable)===null||i===void 0||i.call(r)}),this}isPluginEnabled(t){var e;const s=this.getPlugin(t);return(e=s==null?void 0:s.isEnabled)===null||e===void 0?void 0:e.call(s)}disposePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const s=this.getPlugins(e);return s==null||s.forEach(r=>{r.dispose(),this.installedPlugins.delete(r)}),this}dispose(t=!0){t&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}HV([Nt.dispose()],I.prototype,"dispose",null),function(n){n.View=Mn,n.Renderer=uh,n.MouseWheel=ch,n.DefsManager=Rb,n.GridManager=oh,n.CoordManager=Ib,n.TransformManager=_b,n.HighlightManager=ml,n.BackgroundManager=ah,n.PanningManager=lh}(I||(I={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag];return s==null||s===n.toStringTag}n.isGraph=t}(I||(I={})),function(n){function t(e,s){const r=e instanceof HTMLElement?new n({container:e}):new n(e);return s!=null&&r.fromJSON(s),r}n.render=t}(I||(I={})),function(n){n.registerNode=Ut.registry.register,n.registerEdge=jt.registry.register,n.registerView=Ht.registry.register,n.registerAttr=On.registry.register,n.registerGrid=bs.registry.register,n.registerFilter=Hr.registry.register,n.registerNodeTool=Wr.registry.register,n.registerEdgeTool=qr.registry.register,n.registerBackground=ro.registry.register,n.registerHighlighter=qn.registry.register,n.registerPortLayout=Qs.registry.register,n.registerPortLabelLayout=Gr.registry.register,n.registerMarker=vs.registry.register,n.registerRouter=Ms.registry.register,n.registerConnector=tr.registry.register,n.registerAnchor=Jr.registry.register,n.registerEdgeAnchor=Xr.registry.register,n.registerConnectionPoint=Kr.registry.register}(I||(I={})),function(n){n.unregisterNode=Ut.registry.unregister,n.unregisterEdge=jt.registry.unregister,n.unregisterView=Ht.registry.unregister,n.unregisterAttr=On.registry.unregister,n.unregisterGrid=bs.registry.unregister,n.unregisterFilter=Hr.registry.unregister,n.unregisterNodeTool=Wr.registry.unregister,n.unregisterEdgeTool=qr.registry.unregister,n.unregisterBackground=ro.registry.unregister,n.unregisterHighlighter=qn.registry.unregister,n.unregisterPortLayout=Qs.registry.unregister,n.unregisterPortLabelLayout=Gr.registry.unregister,n.unregisterMarker=vs.registry.unregister,n.unregisterRouter=Ms.registry.unregister,n.unregisterConnector=tr.registry.unregister,n.unregisterAnchor=Jr.registry.unregister,n.unregisterEdgeAnchor=Xr.registry.unregister,n.unregisterConnectionPoint=Kr.registry.unregister}(I||(I={}));var UV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},GV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class ni extends Ut{}(function(n){class t extends hn{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:s}){const r=n.shapeMaps[this.cell.shape];if(r){const{effect:i}=r;(!i||i.includes(s))&&this.renderHTMLComponent()}}confirmUpdate(s){const r=super.confirmUpdate(s);return this.handleAction(r,t.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const s=this.selectors&&this.selectors.foContent;if(s){qi(s);const r=n.shapeMaps[this.cell.shape];if(!r)return;let{html:i}=r;typeof i=="function"&&(i=i(this.cell)),i&&(typeof i=="string"?s.innerHTML=i:Ne(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}UV([t.dispose()],t.prototype,"dispose",null),n.View=t,function(e){e.action="html",e.config({bootstrap:[e.action],actions:{html:e.action}}),hn.registry.register("html-view",e,!0)}(t=n.View||(n.View={}))})(ni||(ni={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},_t.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ut.registry.register("html",n,!0)}(ni||(ni={})),function(n){n.shapeMaps={};function t(e){const{shape:s,html:r,effect:i,inherit:o}=e,a=GV(e,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},I.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=t}(ni||(ni={}));const YV=`.x6-widget-dnd {
|
|
279
|
+
`;class re extends ye{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(t){super(),this.graph=t,this.init()}init(){}}var _V=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ih extends re{init(){jr("core",NV)}dispose(){$r("core")}}_V([ih.dispose()],ih.prototype,"dispose",null);var kV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e},go;(function(n){function t(e){const{grid:s,panning:r,mousewheel:i,embedding:o}=e,a=kV(e,["grid","panning","mousewheel","embedding"]),l=e.container;if(l!=null)a.width==null&&(a.width=l.clientWidth),a.height==null&&(a.height=l.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=Gt({},n.defaults,a),h={size:10,visible:!1};return typeof s=="number"?u.grid={size:s,visible:!1}:typeof s=="boolean"?u.grid=Object.assign(Object.assign({},h),{visible:s}):u.grid=Object.assign(Object.assign({},h),s),["panning","mousewheel","embedding"].forEach(d=>{const g=e[d];typeof g=="boolean"?u[d].enabled=g:u[d]=Object.assign(Object.assign({},u[d]),g)}),u}n.get=t})(go||(go={})),function(n){n.defaults={x:0,y:0,scaling:{min:.01,max:16},grid:{size:10,visible:!1},background:!1,panning:{enabled:!1,eventTypes:["leftMouseDown"]},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Ue.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Ue.prefix("available-magnet")}}},connecting:{snap:!1,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,allowBlank:!0,allowMulti:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",router:"normal",connector:"normal",validateConnection({type:t,sourceView:e,targetView:s}){return(t==="target"?s:e)!=null},createEdge(){return new EV}},translating:{restrict:!1},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},async:!0,virtual:!1,guard:()=>!1}}(go||(go={}));var DV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},RV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class oh extends re{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const s=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(t)?t:[t];this.patterns.forEach((l,u)=>{const h=`pattern_${u}`,f=s.a||1,d=s.d||1,{update:g,markup:p}=l,m=RV(l,["update","markup"]),y=Object.assign(Object.assign(Object.assign({},m),i[u]),{sx:f,sy:d,ox:s.e||0,oy:s.f||0,width:e*f,height:e*d});r.has(h)||r.add(h,tt.create("pattern",{id:h,patternUnits:"userSpaceOnUse"},tt.createVectors(p)).node);const b=r.get(h);typeof g=="function"&&g(b.childNodes[0],y);let w=y.ox%y.width;w<0&&(w+=y.width);let x=y.oy%y.height;x<0&&(x+=y.height),ut(b,{x:w,y:x,width:y.width,height:y.height})});const o=new XMLSerializer().serializeToString(r.root),a=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=a}getInstance(){return this.instance||(this.instance=new bs),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(e==null)return[Object.assign(Object.assign({},bs.presets.dot),t.args)];const s=bs.registry.get(e);if(s){let r=t.args||[];return Array.isArray(r)||(r=[r]),Array.isArray(s)?s.map((i,o)=>Object.assign(Object.assign({},i),r[o])):[Object.assign(Object.assign({},s),r[0])]}return bs.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}DV([re.dispose()],oh.prototype,"dispose",null);class _b extends re{get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get stage(){return this.graph.view.stage}init(){this.resize()}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),ne(this.viewportMatrix)}setMatrix(t){const e=ne(t),s=Br(e);this.viewport.setAttribute("transform",s),this.viewportMatrix=e,this.viewportTransformString=s}resize(t,e){let s=t===void 0?this.options.width:t,r=e===void 0?this.options.height:e;this.options.width=s,this.options.height=r,typeof s=="number"&&(s=Math.round(s)),typeof r=="number"&&(r=Math.round(r)),this.container.style.width=s==null?"":`${s}px`,this.container.style.height=r==null?"":`${r}px`;const i=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},i)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Ec(t)||(t=this.container.clientWidth),Ec(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return FR(this.getMatrix())}scale(t,e=t,s=0,r=0){if(t=this.clampScale(t),e=this.clampScale(e),s||r){const o=this.getTranslation(),a=o.tx-s*(t-1),l=o.ty-r*(e-1);(a!==o.tx||l!==o.ty)&&this.translate(a,l)}const i=this.getMatrix();return i.a=t,i.d=e,this.setMatrix(i),this.graph.trigger("scale",{sx:t,sy:e,ox:s,oy:r}),this}clampScale(t){const e=this.graph.options.scaling;return we(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let s=t,r=t;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,l=o.height/2;if(e.absolute||(s+=i.sx,r+=i.sy),e.scaleGrid&&(s=Math.round(s/e.scaleGrid)*e.scaleGrid,r=Math.round(r/e.scaleGrid)*e.scaleGrid),e.maxScale&&(s=Math.min(e.maxScale,s),r=Math.min(e.maxScale,r)),e.minScale&&(s=Math.max(e.minScale,s),r=Math.max(e.minScale,r)),e.center&&(a=e.center.x,l=e.center.y),s=this.clampScale(s),r=this.clampScale(r),a||l){const u=this.getTranslation(),h=a-(a-u.tx)*(s/i.sx),f=l-(l-u.ty)*(r/i.sy);(h!==u.tx||f!==u.ty)&&this.translate(h,f)}return this.scale(s,r),this}getRotation(){return HR(this.getMatrix())}rotate(t,e,s){if(e==null||s==null){const i=vt.getBBox(this.stage);e=i.width/2,s=i.height/2}const r=this.getMatrix().translate(e,s).rotate(t).translate(-e,-s);return this.setMatrix(r),this}getTranslation(){return UR(this.getMatrix())}translate(t,e){const s=this.getMatrix();s.e=t||0,s.f=e||0,this.setMatrix(s);const r=this.getTranslation();return this.options.x=r.tx,this.options.y=r.ty,this.graph.trigger("translate",Object.assign({},r)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,s,r){if(typeof t=="object"){const x=t;t=x.gridWidth||1,e=x.gridHeight||1,s=x.padding||0,r=x}else t=t||1,e=e||1,s=s||0,r==null&&(r={});const i=ds(s),o=r.border||0,a=r.contentArea?z.create(r.contentArea):this.getContentArea(r);o>0&&a.inflate(o);const l=this.getScale(),u=this.getTranslation(),h=l.sx,f=l.sy;a.x*=h,a.y*=f,a.width*=h,a.height*=f;let d=Math.max(Math.ceil((a.width+a.x)/t),1)*t,g=Math.max(Math.ceil((a.height+a.y)/e),1)*e,p=0,m=0;(r.allowNewOrigin==="negative"&&a.x<0||r.allowNewOrigin==="positive"&&a.x>=0||r.allowNewOrigin==="any")&&(p=Math.ceil(-a.x/t)*t,p+=i.left,d+=p),(r.allowNewOrigin==="negative"&&a.y<0||r.allowNewOrigin==="positive"&&a.y>=0||r.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/e)*e,m+=i.top,g+=m),d+=i.right,g+=i.bottom,d=Math.max(d,r.minWidth||0),g=Math.max(g,r.minHeight||0),d=Math.min(d,r.maxWidth||Number.MAX_SAFE_INTEGER),g=Math.min(g,r.maxHeight||Number.MAX_SAFE_INTEGER);const y=this.getComputedSize(),b=d!==y.width||g!==y.height;return(p!==u.tx||m!==u.ty)&&this.translate(p,m),b&&this.resize(d,g),new z(-p/h,-m/f,d/h,g/f)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let s,r;if(t.contentArea){const b=t.contentArea;s=this.graph.localToGraph(b),r=O.create(b)}else s=this.getContentBBox(t),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=ds(t.padding),o=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||o,u=t.maxScaleX||a,h=t.minScaleY||o,f=t.maxScaleY||a;let d;if(t.viewportArea)d=t.viewportArea;else{const b=this.getComputedSize(),w=this.getTranslation();d={x:w.tx,y:w.ty,width:b.width,height:b.height}}d=z.create(d).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const g=this.getScale();let p=d.width/s.width*g.sx,m=d.height/s.height*g.sy;t.preserveAspectRatio!==!1&&(p=m=Math.min(p,m));const y=t.scaleGrid;if(y&&(p=y*Math.floor(p/y),m=y*Math.floor(m/y)),p=we(p,l,u),m=we(m,h,f),this.scale(p,m),e){const b=this.options,w=d.x-r.x*p-b.x,x=d.y-r.y*m-b.y;this.translate(w,x)}}getContentArea(t={}){return t.useCellGeometry!==!1?this.model.getAllCellsBBox()||new z:vt.getBBox(this.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=z.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const s=z.create(t),r=this.graph;e.contentArea=s,e.viewportArea==null&&(e.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const i=s.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const s=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=s.width/2,a=s.height/2;t=typeof t=="number"?t:o,e=typeof e=="number"?e:a,t=o-t*r.sx,e=a-e*r.sy,(i.tx!==t||i.ty!==e)&&this.translate(t,e)}centerContent(t){const s=this.graph.getContentArea(t).getCenter();this.centerPoint(s.x,s.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,s){const r=this.getComputedSize();e=an(e,Math.max(0,r.width)),e<0&&(e=r.width+e),s=an(s,Math.max(0,r.height)),s<0&&(s=r.height+s);const i=this.getTranslation(),o=this.getScale(),a=e-t.x*o.sx,l=s-t.y*o.sy;(i.tx!==a||i.ty!==l)&&this.translate(a,l)}positionRect(t,e){const s=z.create(t);switch(e){case"center":return this.positionPoint(s.getCenter(),"50%","50%");case"top":return this.positionPoint(s.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(s.getTopRight(),"100%",0);case"right":return this.positionPoint(s.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(s.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(s.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(s.getBottomLeft(),0,"100%");case"left":return this.positionPoint(s.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(s.getTopLeft(),0,0);default:return this}}positionCell(t,e){const s=t.getBBox();return this.positionRect(s,e)}positionContent(t,e){const s=this.graph.getContentArea(e);return this.positionRect(s,t)}}var IV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ah extends re{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",s=t.position||"center";const r=this.graph.transform.getScale(),i=this.graph.translate();if(typeof s=="object"){const o=i.tx+r.sx*(s.x||0),a=i.ty+r.sy*(s.y||0);s=`${o}px ${a}px`}typeof e=="object"&&(e=z.fromSize(e).scale(r.sx,r.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=s}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const s=this.optionsCache;if(s&&s.image!==e.image)return;let r;const i=e.opacity,o=e.size;let a=e.repeat||"no-repeat";const l=ro.registry.get(a);if(typeof l=="function"){const h=e.quality||1;t.width*=h,t.height*=h;const f=l(t,e);if(!(f instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=f.toDataURL("image/png"),e.repeat&&a!==e.repeat?a=e.repeat:a="repeat",typeof o=="object"?(o.width*=f.width/t.width,o.height*=f.height/t.height):o===void 0&&(e.size={width:f.width/h,height:f.height/h})}else r=t.src,o===void 0&&(e.size={width:t.width,height:t.height});s!=null&&typeof e.size=="object"&&e.image===s.image&&e.repeat===s.repeat&&e.quality===s.quality&&(s.size=mc(e.size));const u=this.elem.style;u.backgroundImage=`url(${r})`,u.backgroundRepeat=a,u.opacity=i==null||i>=1?"":`${i}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=mc(e);const s=document.createElement("img");s.onload=()=>this.drawBackgroundImage(s,t),s.setAttribute("crossorigin","anonymous"),s.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}IV([re.dispose()],ah.prototype,"dispose",null);var LV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class lh extends re{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&this.widgetOptions.enabled===!0}init(){this.onRightMouseDown=this.onRightMouseDown.bind(this),this.onSpaceKeyDown=this.onSpaceKeyDown.bind(this),this.onSpaceKeyUp=this.onSpaceKeyUp.bind(this),this.startListening(),this.updateClassName()}startListening(){this.graph.on("blank:mousedown",this.onMouseDown,this),this.graph.on("node:unhandled:mousedown",this.onMouseDown,this),this.graph.on("edge:unhandled:mousedown",this.onMouseDown,this),le.on(this.graph.container,"mousedown",this.onRightMouseDown),le.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Ey(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()}stopListening(){this.graph.off("blank:mousedown",this.onMouseDown,this),this.graph.off("node:unhandled:mousedown",this.onMouseDown,this),this.graph.off("edge:unhandled:mousedown",this.onMouseDown,this),le.off(this.graph.container,"mousedown",this.onRightMouseDown),le.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(t,e){return t.spaceKey=this.isSpaceKeyPressed,this.pannable&&ms.isMatch(t,this.widgetOptions.modifiers,e)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),le.on(document.body,{"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),le.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),s=e.clientX-this.clientX,r=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(s,r)}stopPanning(t){this.panning=!1,this.updateClassName(),le.off(document.body,".panning"),le.off(window,".panning")}updateClassName(){const t=this.view.container,e=this.view.prefixClassName("graph-panning"),s=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(J(t,e),Dt(t,s)):(Dt(t,e),J(t,s)):(Dt(t,e),Dt(t,s))}onMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.getPlugin("selection"),s=e&&e.allowRubberband(t,!0);(this.allowPanning(t,!0)||this.allowPanning(t)&&!s)&&this.startPanning(t)}onRightMouseDown(t){const e=this.widgetOptions.eventTypes;e!=null&&e.includes("rightMouseDown")&&t.button===2&&this.allowPanning(t,!0)&&this.startPanning(t)}onMouseWheel(t,e,s){this.graph.translateBy(-e,-s)}onSpaceKeyDown(t){t.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(t){t.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(t){const e=this.widgetOptions.eventTypes;return(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}allowMouseWheel(t){var e;return this.pannable&&!t.ctrlKey&&((e=this.widgetOptions.eventTypes)===null||e===void 0?void 0:e.includes("mouseWheel"))}autoPanning(t,e){const r=this.graph.getGraphArea();let i=0,o=0;t<=r.left+10&&(i=-10),e<=r.top+10&&(o=-10),t>=r.right-10&&(i=10),e>=r.bottom-10&&(o=10),(i!==0||o!==0)&&this.graph.translateBy(-i,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}LV([re.dispose()],lh.prototype,"dispose",null);var BV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ch extends re{constructor(){super(...arguments),this.cumulatedFactor=1}get widgetOptions(){return this.options.mousewheel}init(){this.container=this.graph.container,this.target=this.widgetOptions.global?document:this.container,this.mousewheelHandle=new Ey(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(t){(this.disabled||t)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=this.widgetOptions.guard;return(e==null||e(t))&&ms.isMatch(t,this.widgetOptions.modifiers)}onMouseWheel(t){const e=this.widgetOptions.guard;if((e==null||e(t))&&ms.isMatch(t,this.widgetOptions.modifiers)){const s=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.transform.getScale().sx),t.deltaY<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*s*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=1.05)):this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:(this.cumulatedFactor=Math.round(this.currentScale*(1/s)*20)/20/this.currentScale,this.cumulatedFactor===1&&(this.cumulatedFactor=.95)),this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.currentScale;let o=this.graph.transform.clampScale(i*this.cumulatedFactor);const a=this.widgetOptions.minScale||Number.MIN_SAFE_INTEGER,l=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=we(o,a,l),o!==i)if(this.widgetOptions.zoomAtMousePosition){const h=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:h.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}BV([ye.dispose()],ch.prototype,"dispose",null);var VV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class kb extends re{init(){this.resetRenderArea=O2(this.resetRenderArea,200,{leading:!0}),this.resetRenderArea(),this.startListening()}startListening(){this.graph.on("translate",this.resetRenderArea,this),this.graph.on("scale",this.resetRenderArea,this),this.graph.on("resize",this.resetRenderArea,this)}stopListening(){this.graph.off("translate",this.resetRenderArea,this),this.graph.off("scale",this.resetRenderArea,this),this.graph.off("resize",this.resetRenderArea,this)}enableVirtualRender(){this.options.virtual=!0,this.resetRenderArea()}disableVirtualRender(){this.options.virtual=!1,this.graph.renderer.setRenderArea(void 0)}resetRenderArea(){if(this.options.virtual){const t=this.graph.getGraphArea();this.graph.renderer.setRenderArea(t)}}dispose(){this.stopListening()}}VV([re.dispose()],kb.prototype,"dispose",null);class jV{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(t){if(t.priority&Kn.PRIOR)t.cb();else{const e=this.findInsertionIndex(t);e>=0&&this.queue.splice(e,0,t)}}queueFlush(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.scheduleJob())}queueFlushSync(){!this.isFlushing&&!this.isFlushPending&&(this.isFlushPending=!0,this.flushJobsSync())}clearJobs(){this.queue.length=0,this.isFlushing=!1,this.isFlushPending=!1,this.cancelScheduleJob()}flushJobs(){this.isFlushPending=!1,this.isFlushing=!0;const t=this.getCurrentTime();let e;for(;(e=this.queue.shift())&&(e.cb(),!(this.getCurrentTime()-t>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let t;for(;t=this.queue.shift();)try{t.cb()}catch(e){console.log(e)}this.isFlushing=!1}findInsertionIndex(t){let e=0,s=this.queue.length,r=s-1;const i=t.priority;for(;e<=r;){const o=(r-e>>1)+e;i<=this.queue[o].priority?e=o+1:(s=o,r=o-1)}return s}scheduleJob(){"requestIdleCallback"in window?(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.requestIdleCallback(this.flushJobs.bind(this),{timeout:100})):(this.scheduleId&&this.cancelScheduleJob(),this.scheduleId=window.setTimeout(this.flushJobs.bind(this)))}cancelScheduleJob(){"cancelIdleCallback"in window?(this.scheduleId&&window.cancelIdleCallback(this.scheduleId),this.scheduleId=0):(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduleId=0)}getCurrentTime(){return typeof performance=="object"&&typeof performance.now=="function"?performance.now():Date.now()-this.initialTime}}var Kn;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(Kn||(Kn={}));var $V=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Qt extends ye{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(t){super(),this.views={},this.willRemoveViews={},this.queue=new jV,this.graph=t,this.init()}init(){this.startListening(),this.renderViews(this.model.getCells())}startListening(){this.model.on("reseted",this.onModelReseted,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("reseted",this.onModelReseted,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}onModelReseted({options:t}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const e=this.model.getCells();this.renderViews(e,Object.assign(Object.assign({},t),{queue:e.map(s=>s.id)}))}onCellAdded({cell:t,options:e}){this.renderViews([t],e)}onCellRemoved({cell:t}){this.removeViews([t])}onCellZIndexChanged({cell:t,options:e}){const s=this.views[t.id];s&&this.requestViewUpdate(s.view,Qt.FLAG_INSERT,e,Kn.Update,!0)}onCellVisibleChanged({cell:t,current:e}){this.toggleVisible(t,!!e)}requestViewUpdate(t,e,s={},r=Kn.Update,i=!0){const o=t.cell.id,a=this.views[o];if(!a)return;a.flag=e,a.options=s,(t.hasAction(e,["translate","resize","rotate"])||s.async===!1)&&(r=Kn.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(t,e,s);const h=s.queue;if(h){const f=h.indexOf(t.cell.id);f>=0&&h.splice(f,1),h.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(t).forEach(h=>{this.requestViewUpdate(h.view,h.flag,s,r,!1)}),i&&this.flush()}setRenderArea(t){this.renderArea=t,this.flushWaitingViews()}isViewMounted(t){if(t==null)return!1;const e=this.views[t.cell.id];return e?e.state===Qt.ViewState.MOUNTED:!1}renderViews(t,e={}){t.sort((s,r)=>s.isNode()&&r.isEdge()?-1:0),t.forEach(s=>{const r=s.id,i=this.views;let o=0,a=i[r];if(a)o=Qt.FLAG_INSERT;else{const l=this.createCellView(s);l&&(l.graph=this.graph,o=Qt.FLAG_INSERT|l.getBootstrapFlag(),a={view:l,flag:o,options:e,state:Qt.ViewState.CREATED},this.views[r]=a)}a&&this.requestViewUpdate(a.view,o,e,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(t,e,s={}){const r=t.cell,i=r.id,o=this.views[i];if(!o)return;let a=0;this.isUpdatable(t)?(a=this.updateView(t,e,s),o.flag=a):o.state===Qt.ViewState.MOUNTED?(a=this.updateView(t,e,s),o.flag=a):o.state=Qt.ViewState.WAITING,a&&r.isEdge()&&!(a&t.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:Kn.RenderEdge,cb:()=>{this.updateView(t,e,s)}})}removeViews(t){t.forEach(e=>{const s=e.id,r=this.views[s];r&&(this.willRemoveViews[s]=r,delete this.views[s],this.queue.queueJob({id:s,priority:this.getRenderPriority(r.view),cb:()=>{this.removeView(r.view)}}))}),this.flush()}flush(){this.graph.options.async?this.queue.queueFlush():this.queue.queueFlushSync()}flushWaitingViews(){Object.values(this.views).forEach(t=>{if(t&&t.state===Qt.ViewState.WAITING){const{view:e,flag:s,options:r}=t;this.requestViewUpdate(e,s,r,this.getRenderPriority(e),!1)}}),this.flush()}updateView(t,e,s={}){if(t==null)return 0;if(Ft.isCellView(t)){if(e&Qt.FLAG_REMOVE)return this.removeView(t.cell),0;e&Qt.FLAG_INSERT&&(this.insertView(t),e^=Qt.FLAG_INSERT)}return e?t.confirmUpdate(e,s):0}insertView(t){const e=this.views[t.cell.id];if(e){const s=t.cell.getZIndex(),r=this.addZPivot(s);this.container.insertBefore(t.container,r),t.cell.isVisible()||this.toggleVisible(t.cell,!1),e.state=Qt.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:t})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(t=>{t&&this.removeView(t.view)}),this.views={},this.willRemoveViews={}}removeView(t){const e=t.cell,s=this.willRemoveViews[e.id];s&&t&&(s.view.remove(),delete this.willRemoveViews[e.id],this.graph.trigger("view:unmounted",{view:t}))}toggleVisible(t,e){const s=this.model.getConnectedEdges(t);for(let i=0,o=s.length;i<o;i+=1){const a=s[i];if(e){const l=a.getSourceCell(),u=a.getTargetCell();if(l&&!l.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const r=this.views[t.id];r&&qt(r.view.container,{display:e?"unset":"none"})}addZPivot(t=0){this.zPivots==null&&(this.zPivots={});const e=this.zPivots;let s=e[t];if(s)return s;s=e[t]=document.createComment(`z-index:${t+1}`);let r=-1/0;for(const o in e){const a=+o;a<t&&a>r&&(r=a,t-1)}const i=this.container;if(r!==-1/0){const o=e[r];i.insertBefore(s,o.nextSibling)}else i.insertBefore(s,i.firstChild);return s}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(t=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),this.zPivots={}}createCellView(t){const e={graph:this.graph},s=this.graph.options.createCellView;if(s){const i=X(s,this.graph,t);if(i)return new i(t,e);if(i===null)return null}const r=t.view;if(r!=null&&typeof r=="string"){const i=Ft.registry.get(r);return i?new i(t,e):Ft.registry.onNotFound(r)}return t.isNode()?new hn(t,e):t.isEdge()?new Xn(t,e):null}getEffectedEdges(t){const e=[],s=t.cell,r=this.model.getConnectedEdges(s);for(let i=0,o=r.length;i<o;i+=1){const a=r[i],l=this.views[a.id];if(!l)continue;const u=l.view;if(!this.isViewMounted(u))continue;const h=["update"];a.getTargetCell()===s&&h.push("target"),a.getSourceCell()===s&&h.push("source"),e.push({id:a.id,view:u,flag:u.getFlag(h)})}return e}isUpdatable(t){if(t.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(t.cell.getBBox()):!0;if(t.isEdgeView()){const e=t.cell,s=e.getSourceCell(),r=e.getTargetCell();if(this.renderArea&&s&&r)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(t){return t.cell.isNode()?Kn.RenderNode:Kn.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(t=>{this.views[t].view.dispose()}),this.views={}}}$V([ye.dispose()],Qt.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(Qt||(Qt={})),function(n){(function(t){t[t.CREATED=0]="CREATED",t[t.MOUNTED=1]="MOUNTED",t[t.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(Qt||(Qt={}));var zV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class uh extends re{constructor(){super(...arguments),this.schedule=new Qt(this.graph)}requestViewUpdate(t,e,s={}){this.schedule.requestViewUpdate(t,e,s)}isViewMounted(t){return this.schedule.isViewMounted(t)}setRenderArea(t){this.schedule.setRenderArea(t)}findViewByElem(t){if(t==null)return null;const e=this.options.container,s=typeof t=="string"?e.querySelector(t):t instanceof Element?t:t[0];if(s){const r=this.graph.view.findAttr("data-cell-id",s);if(r){const i=this.schedule.views;if(i[r])return i[r].view}}return null}findViewByCell(t){if(t==null)return null;const e=ht.isCell(t)?t.id:t,s=this.schedule.views;return s[e]?s[e].view:null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>s!=null?vt.getBBox(s.container,{target:this.view.stage}).containsPoint(e):!1)}findEdgeViewsFromPoint(t,e=5){return this.model.getEdges().map(s=>this.findViewByCell(s)).filter(s=>{if(s!=null){const r=s.getClosestPoint(t);if(r)return r.distance(t)<=e}return!1})}findViewsInArea(t,e={}){const s=z.create(t);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(e.nodeOnly&&!r.isNodeView())return!1;const i=vt.getBBox(r.container,{target:this.view.stage});return i.width===0?i.inflate(1,0):i.height===0&&i.inflate(0,1),e.strict?s.containsRect(i):s.isIntersectWithRect(i)}return!1})}dispose(){this.schedule.dispose()}}zV([re.dispose()],uh.prototype,"dispose",null);var Db=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Rb extends re{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return this.svg.getElementById(t)!=null}filter(t){let e=t.id;const s=t.name;if(e||(e=`filter-${s}-${this.cid}-${Au(JSON.stringify(t))}`),!this.isDefined(e)){const r=Hr.registry.get(s);if(r==null)return Hr.registry.onNotFound(s);const i=r(t.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});tt.create(_t.sanitize(i),o).appendTo(this.defs)}return e}gradient(t){let e=t.id;const s=t.type;if(e||(e=`gradient-${s}-${this.cid}-${Au(JSON.stringify(t))}`),!this.isDefined(e)){const i=t.stops.map(l=>{const u=l.opacity!=null&&Number.isFinite(l.opacity)?l.opacity:1;return`<stop offset="${l.offset}" stop-color="${l.color}" stop-opacity="${u}"/>`}),o=`<${s}>${i.join("")}</${s}>`,a=Object.assign({id:e},t.attrs);tt.create(o,a).appendTo(this.defs)}return e}marker(t){const{id:e,refX:s,refY:r,markerUnits:i,markerOrient:o,tagName:a,children:l}=t,u=Db(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Au(JSON.stringify(t))}`),!this.isDefined(h)){a!=="path"&&delete u.d;const f=tt.create("marker",{refX:s,refY:r,id:h,overflow:"visible",orient:o??"auto",markerUnits:i||"userSpaceOnUse"},l?l.map(d=>{var{tagName:g}=d,p=Db(d,["tagName"]);return tt.create(`${g}`||"path",Ji(Object.assign(Object.assign({},u),p)))}):[tt.create(a||"path",Ji(u))]);this.defs.appendChild(f.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}class Ib extends re{getClientMatrix(){return ne(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new O(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return(typeof t=="number"?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.graph.matrix())}localToClientPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.getClientMatrix())}localToPagePoint(t,e){return(typeof t=="number"?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.graph.matrix())}localToClientRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.getClientMatrix())}localToPageRect(t,e,s,r){return(typeof t=="number"?this.localToGraphRect(t,e,s,r):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const s=O.create(t,e);return vt.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const r=O.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(t,e,s,r){const i=z.create(t,e,s,r);return vt.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,s,r){const i=z.create(t,e,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var FV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class pl extends re{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:s={}}){const r=this.resolveHighlighter(s);if(!r)return;const i=this.getHighlighterId(e,r);if(!this.highlights[i]){const o=r.highlighter;o.highlight(t,e,Object.assign({},r.args)),this.highlights[i]={cellView:t,magnet:e,highlighter:o,args:r.args}}}onCellUnhighlight({magnet:t,options:e={}}){const s=this.resolveHighlighter(e);if(!s)return;const r=this.getHighlighterId(t,s);this.unhighlight(r)}resolveHighlighter(t){const e=this.options;let s=t.highlighter;if(s==null){const a=t.type;s=a&&e.highlighting[a]||e.highlighting.default}if(s==null)return null;const r=typeof s=="string"?{name:s}:s,i=r.name,o=qn.registry.get(i);return o==null?qn.registry.onNotFound(i):(qn.check(i,o),{name:i,highlighter:o,args:r.args||{}})}getHighlighterId(t,e){return ku(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}FV([pl.dispose()],pl.prototype,"dispose",null);var HV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Lb extends re{getScroller(){const t=this.graph.getPlugin("scroller");return t&&t.options.enabled?t:null}getContainer(){const t=this.getScroller();return t?t.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const t=this.options.autoResize;if(t)return typeof t=="boolean"?this.getContainer():t}init(){if(this.options.autoResize){const e=this.getSensorTarget();e&&qa.bind(e,()=>{const s=e.offsetWidth,r=e.offsetHeight;this.resize(s,r)})}}resize(t,e){const s=this.getScroller();s?s.resize(t,e):this.graph.transform.resize(t,e)}dispose(){qa.clear(this.graph.container)}}HV([re.dispose()],Lb.prototype,"dispose",null);var UV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class L extends Nt{get container(){return this.options.container}get[Symbol.toStringTag](){return L.toStringTag}constructor(t){super(),this.installedPlugins=new Set,this.options=go.get(t),this.css=new ih(this),this.view=new Mn(this),this.defs=new Rb(this),this.coord=new Ib(this),this.transform=new _b(this),this.highlight=new pl(this),this.grid=new oh(this),this.background=new ah(this),this.options.model?this.model=this.options.model:(this.model=new Zt,this.model.graph=this),this.renderer=new uh(this),this.panning=new lh(this),this.mousewheel=new ch(this),this.virtualRender=new kb(this),this.size=new Lb(this)}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(s=>Ht.isNode(s)?s:this.createNode(s)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(s=>Vt.isEdge(s)?s:this.createEdge(s)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,s={}){return this.model.isNeighbor(t,e,s)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,s={}){return this.model.isSuccessor(t,e,s)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,s={}){return this.model.isPredecessor(t,e,s)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,s,r,i){return this.model.getNodesInArea(t,e,s,r,i)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,s={}){return this.model.search(t,e,s),this}getShortestPath(t,e,s={}){return this.model.getShortestPath(t,e,s)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,s){const r=typeof t=="string"?t:"update",i=typeof t=="string"?e:t,o=typeof e=="function"?s:e;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(t,e){return this.model.updateCellId(t,e)}findView(t){return ht.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return z.isRectangleLike(t)?this.findViewsInArea(t):O.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const s=typeof t=="number"?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(s)}findViewsInArea(t,e,s,r,i){const o=typeof t=="number"?{x:t,y:e,width:s,height:r}:t,a=typeof t=="number"?i:e;return this.renderer.findViewsInArea(o,a)}matrix(t){return typeof t>"u"?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){const s=this.getPlugin("scroller");return s?s.resize(t,e):this.transform.resize(t,e),this}scale(t,e=t,s=0,r=0){return typeof t>"u"?this.transform.getScale():(this.transform.scale(t,e,s,r),this)}zoom(t,e){const s=this.getPlugin("scroller");if(s){if(typeof t>"u")return s.zoom();s.zoom(t,e)}else{if(typeof t>"u")return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const s=this.getPlugin("scroller");return s?s.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const s=this.getPlugin("scroller");return s?s.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.getPlugin("scroller");return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,s){return typeof t>"u"?this.transform.getRotation():(this.transform.rotate(t,e,s),this)}translate(t,e){return typeof t>"u"?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const s=this.translate(),r=s.tx+t,i=s.ty+e;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,s,r){return this.transform.fitToContent(t,e,s,r)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,s){const r=this.getPlugin("scroller");return r?r.centerPoint(t,e,s):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.getPlugin("scroller");return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const s=this.getPlugin("scroller");return s?s.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,s,r={}){const i=this.getPlugin("scroller");return i?i.positionPoint(t,e,s,r):this.transform.positionPoint(t,e,s),this}positionRect(t,e,s){const r=this.getPlugin("scroller");return r?r.positionRect(t,e,s):this.transform.positionRect(t,e),this}positionCell(t,e,s){const r=this.getPlugin("scroller");return r?r.positionCell(t,e,s):this.transform.positionCell(t,e),this}positionContent(t,e){const s=this.getPlugin("scroller");return s?s.positionContent(t,e):this.transform.positionContent(t,e),this}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,s,r){return z.isRectangleLike(t)?this.coord.pageToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.pageToLocalRect(t,e,s,r):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,s,r){return z.isRectangleLike(t)?this.coord.localToPageRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToPageRect(t,e,s,r):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,s,r){return z.isRectangleLike(t)?this.coord.clientToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToLocalRect(t,e,s,r):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,s,r){return z.isRectangleLike(t)?this.coord.localToClientRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToClientRect(t,e,s,r):this.coord.localToClientPoint(t,e)}localToGraph(t,e,s,r){return z.isRectangleLike(t)?this.coord.localToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToGraphRect(t,e,s,r):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,s,r){return z.isRectangleLike(t)?this.coord.graphToLocalRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.graphToLocalRect(t,e,s,r):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,s,r){return z.isRectangleLike(t)?this.coord.clientToGraphRect(t):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToGraphRect(t,e,s,r):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const s=this.getPlugin("scroller");return s!=null&&(this.options.background==null||!e)?s.drawBackground(t,e):this.background.draw(t),this}clearBackground(t){const e=this.getPlugin("scroller");return e!=null&&(this.options.background==null||!t)?e.clearBackground(t):this.background.clear(),this}enableVirtualRender(){return this.virtualRender.enableVirtualRender(),this}disableVirtualRender(){return this.virtualRender.disableVirtualRender(),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return t==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.getPlugin("scroller");return t?t.isPannable():this.panning.pannable}enablePanning(){const t=this.getPlugin("scroller");return t?t.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.getPlugin("scroller");return t?t.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return t==null?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}use(t,...e){return this.installedPlugins.has(t)||(this.installedPlugins.add(t),t.init(this,...e)),this}getPlugin(t){return Array.from(this.installedPlugins).find(e=>e.name===t)}getPlugins(t){return Array.from(this.installedPlugins).filter(e=>t.includes(e.name))}enablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const s=this.getPlugins(e);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.enable)===null||i===void 0||i.call(r)}),this}disablePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const s=this.getPlugins(e);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.disable)===null||i===void 0||i.call(r)}),this}isPluginEnabled(t){var e;const s=this.getPlugin(t);return(e=s==null?void 0:s.isEnabled)===null||e===void 0?void 0:e.call(s)}disposePlugins(t){let e=t;Array.isArray(e)||(e=[e]);const s=this.getPlugins(e);return s==null||s.forEach(r=>{r.dispose(),this.installedPlugins.delete(r)}),this}dispose(t=!0){t&&this.model.dispose(),this.css.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.highlight.dispose(),this.background.dispose(),this.mousewheel.dispose(),this.panning.dispose(),this.view.dispose(),this.renderer.dispose(),this.installedPlugins.forEach(e=>{e.dispose()})}}UV([Nt.dispose()],L.prototype,"dispose",null),function(n){n.View=Mn,n.Renderer=uh,n.MouseWheel=ch,n.DefsManager=Rb,n.GridManager=oh,n.CoordManager=Ib,n.TransformManager=_b,n.HighlightManager=pl,n.BackgroundManager=ah,n.PanningManager=lh}(L||(L={})),function(n){n.toStringTag=`X6.${n.name}`;function t(e){if(e==null)return!1;if(e instanceof n)return!0;const s=e[Symbol.toStringTag];return s==null||s===n.toStringTag}n.isGraph=t}(L||(L={})),function(n){function t(e,s){const r=e instanceof HTMLElement?new n({container:e}):new n(e);return s!=null&&r.fromJSON(s),r}n.render=t}(L||(L={})),function(n){n.registerNode=Ht.registry.register,n.registerEdge=Vt.registry.register,n.registerView=Ft.registry.register,n.registerAttr=On.registry.register,n.registerGrid=bs.registry.register,n.registerFilter=Hr.registry.register,n.registerNodeTool=Wr.registry.register,n.registerEdgeTool=qr.registry.register,n.registerBackground=ro.registry.register,n.registerHighlighter=qn.registry.register,n.registerPortLayout=Qs.registry.register,n.registerPortLabelLayout=Gr.registry.register,n.registerMarker=vs.registry.register,n.registerRouter=Ms.registry.register,n.registerConnector=tr.registry.register,n.registerAnchor=Jr.registry.register,n.registerEdgeAnchor=Xr.registry.register,n.registerConnectionPoint=Kr.registry.register}(L||(L={})),function(n){n.unregisterNode=Ht.registry.unregister,n.unregisterEdge=Vt.registry.unregister,n.unregisterView=Ft.registry.unregister,n.unregisterAttr=On.registry.unregister,n.unregisterGrid=bs.registry.unregister,n.unregisterFilter=Hr.registry.unregister,n.unregisterNodeTool=Wr.registry.unregister,n.unregisterEdgeTool=qr.registry.unregister,n.unregisterBackground=ro.registry.unregister,n.unregisterHighlighter=qn.registry.unregister,n.unregisterPortLayout=Qs.registry.unregister,n.unregisterPortLabelLayout=Gr.registry.unregister,n.unregisterMarker=vs.registry.unregister,n.unregisterRouter=Ms.registry.unregister,n.unregisterConnector=tr.registry.unregister,n.unregisterAnchor=Jr.registry.unregister,n.unregisterEdgeAnchor=Xr.registry.unregister,n.unregisterConnectionPoint=Kr.registry.unregister}(L||(L={}));var GV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},YV=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class ni extends Ht{}(function(n){class t extends hn{init(){super.init(),this.cell.on("change:*",this.onCellChangeAny,this)}onCellChangeAny({key:s}){const r=n.shapeMaps[this.cell.shape];if(r){const{effect:i}=r;(!i||i.includes(s))&&this.renderHTMLComponent()}}confirmUpdate(s){const r=super.confirmUpdate(s);return this.handleAction(r,t.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const s=this.selectors&&this.selectors.foContent;if(s){qi(s);const r=n.shapeMaps[this.cell.shape];if(!r)return;let{html:i}=r;typeof i=="function"&&(i=i(this.cell)),i&&(typeof i=="string"?s.innerHTML=i:Ne(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}GV([t.dispose()],t.prototype,"dispose",null),n.View=t,function(e){e.action="html",e.config({bootstrap:[e.action],actions:{html:e.action}}),hn.registry.register("html-view",e,!0)}(t=n.View||(n.View={}))})(ni||(ni={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},_t.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ht.registry.register("html",n,!0)}(ni||(ni={})),function(n){n.shapeMaps={};function t(e){const{shape:s,html:r,effect:i,inherit:o}=e,a=YV(e,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},L.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=t}(ni||(ni={}));const WV=`.x6-widget-dnd {
|
|
280
280
|
position: absolute;
|
|
281
281
|
top: -10000px;
|
|
282
282
|
left: -10000px;
|
|
@@ -296,7 +296,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
296
296
|
background: transparent;
|
|
297
297
|
box-shadow: none;
|
|
298
298
|
}
|
|
299
|
-
`;var
|
|
299
|
+
`;var qV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class As extends pt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(t){super(),this.name="dnd",this.options=Object.assign(Object.assign({},As.defaults),t),this.init()}init(){jr(this.name,WV),this.container=document.createElement("div"),J(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new L(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Ne(this.container,this.draggingGraph.container)}start(t,e){const s=e;s.preventDefault(),this.targetModel.startBatch("dnd"),J(this.container,"dragging"),ps(this.container,this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,s.clientX,s.clientY);const r=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:t,cell:t,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(As.documentEvents,s.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(t,e,s){const r=this.draggingGraph,i=r.model,o=this.options.getDragNode(t,{sourceNode:t,draggingGraph:r,targetGraph:this.targetGraph});o.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const h=this.targetGraph.transform.getScale();r.scale(h.sx,h.sy),a*=Math.max(h.sx,h.sy)}else r.scale(1,1);this.clearDragging(),i.resetCells([o]);const l=r.findViewByCell(o);l.undelegateEvents(),l.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const u=l.getBBox();this.geometryBBox=l.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(u.getTopLeft()),this.draggingNode=o,this.draggingView=l,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(e,s)}updateGraphPosition(t,e){const s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,i=this.delta,o=this.geometryBBox,a=this.padding||5,l={left:t-i.x-o.width/2-a+r,top:e-i.y-o.height/2-a+s};return this.draggingGraph&&qt(this.container,{left:`${l.left}px`,top:`${l.top}px`}),l}updateNodePosition(t,e){const s=this.targetGraph.clientToLocal(t,e),r=this.draggingBBox;return s.x-=r.width/2,s.y-=r.height/2,this.draggingNode.position(s.x,s.y),s}snap({cell:t,current:e,options:s}){const r=t;if(s.snapped){const i=this.draggingBBox;r.position(i.x+s.tx,i.y+s.ty,{silent:!0}),this.draggingView.translate(),r.position(e.x,e.y,{silent:!0}),this.snapOffset={x:s.tx,y:s.ty}}else this.snapOffset=null}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const s=this.normalizeEvent(t),r=s.clientX,i=s.clientY;this.updateGraphPosition(r,i);const o=this.updateNodePosition(r,i),a=this.targetGraph.options.embedding.enabled,l=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(a){e.setEventData(s,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const u=e.getEventData(s);l?e.processEmbedding(s,u):e.clearEmbedding(u),this.candidateEmbedView=u.candidateEmbedView}this.isSnaplineEnabled()&&(l?this.snapline.snapOnMoving({e:s,view:e,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const s=this.normalizeEvent(t),r=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,l=i.y;o&&(a+=o.x,l+=o.y),e.position(a,l,{silent:!0});const u=this.drop(e,{x:s.clientX,y:s.clientY}),h=f=>{f?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&r&&(r.setEventData(s,{cell:f,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),r.finalizeEmbedding(s,r.getEventData(s)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Cu(u)?(this.undelegateDocumentEvents(),u.then(h)):h(u)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),Dt(this.container,"dragging"),ze(this.container))}onDropInvalid(){const t=this.draggingNode;t&&this.onDropped(t)}isInsideValidArea(t){let e,s=null;const r=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(s=this.getDropArea(this.options.dndContainer));const o=s&&s.containsPoint(t);if(i)if(i.options.autoResize)e=this.getDropArea(i.container);else{const a=this.getDropArea(i.container);e=this.getDropArea(r.container).intersectsWithRect(a)}else e=this.getDropArea(r.container);return!o&&e&&e.containsPoint(t)}getDropArea(t){const e=Gu(t),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return z.create({x:e.left+parseInt(qt(t,"border-left-width"),10)-r,y:e.top+parseInt(qt(t,"border-top-width"),10)-s,width:t.clientWidth,height:t.clientHeight})}drop(t,e){if(this.isInsideValidArea(e)){const s=this.targetGraph,r=s.model,i=s.clientToLocal(e),o=this.sourceNode,a=this.options.getDropNode(t,{sourceNode:o,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=a.getBBox();i.x+=l.x-l.width/2,i.y+=l.y-l.height/2;const u=this.snapOffset?1:s.getGridSize();a.position(wt.snapToGrid(i.x,u),wt.snapToGrid(i.y,u)),a.removeZIndex();const h=this.options.validateNode,f=h?h(a,{sourceNode:o,draggingNode:t,droppingNode:a,targetGraph:s,draggingGraph:this.draggingGraph}):!0;return typeof f=="boolean"?f?(r.addCell(a,{stencil:this.cid}),a):null:ZD(f).then(d=>d?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),$r(this.name)}}qV([pt.dispose()],As.prototype,"dispose",null),function(n){n.defaults={getDragNode:t=>t.clone(),getDropNode:t=>t.clone()},n.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(As||(As={}));function JV(n,t={}){const e=Zt.isModel(n)?n:new Zt().resetCells(n,{sort:!1,dryrun:!0}),s=e.getNodes(),r=t.columns||1,i=Math.ceil(s.length/r),o=t.dx||0,a=t.dy||0,l=t.center!==!1,u=t.resizeToFit===!0,h=t.marginX||0,f=t.marginY||0,d=[];let g=t.columnWidth;if(g==="compact")for(let w=0;w<r;w+=1){const x=Pn.getNodesInColumn(s,w,r);d.push(Pn.getMaxDim(x,"width")+o)}else{(g==null||g==="auto")&&(g=Pn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)d.push(g)}const p=Pn.accumulate(d,h),m=[];let y=t.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Pn.getNodesInRow(s,w,r);m.push(Pn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Pn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Pn.accumulate(m,f);e.startBatch("layout"),s.forEach((w,x)=>{const v=x%r,S=Math.floor(x/r),E=d[v],C=m[S];let M=0,T=0,_=w.getSize();if(u){let N=E-2*o,k=C-2*a;const R=_.height*(_.width?N/_.width:1),I=_.width*(_.height?k/_.height:1);C<R?N=I:k=R,_={width:N,height:k},w.setSize(_,t)}l&&(M=(E-_.width)/2,T=(C-_.height)/2),w.position(p[v]+o+M,b[S]+a+T,t)}),e.stopBatch("layout")}var Pn;(function(n){function t(i,o){return i.reduce((a,l)=>Math.max(l==null?void 0:l.getSize()[o],a),0)}n.getMaxDim=t;function e(i,o,a){const l=[];for(let u=a*o,h=u+a;u<h;u+=1)i[u]&&l.push(i[u]);return l}n.getNodesInRow=e;function s(i,o,a){const l=[];for(let u=o,h=i.length;u<h;u+=a)i[u]&&l.push(i[u]);return l}n.getNodesInColumn=s;function r(i,o){return i.reduce((a,l,u)=>(a.push(a[u]+l),a),[o||0])}n.accumulate=r})(Pn||(Pn={}));const XV=`.x6-widget-dnd {
|
|
300
300
|
position: absolute;
|
|
301
301
|
top: -10000px;
|
|
302
302
|
left: -10000px;
|
|
@@ -531,7 +531,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
531
531
|
font-size: 12px;
|
|
532
532
|
background: 0 0;
|
|
533
533
|
}
|
|
534
|
-
`;var XV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class si extends pt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(t={}){super(),this.name="stencil",jr(this.name,JV),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},si.defaultOptions),t),this.init()}init(){this.dnd=new As(this.options),this.onSearch=ng(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{t[s]&&this.loadGroup(t[s],s)}),this}unload(t,e){return Array.isArray(t)?this.loadGroup(t,e,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{t[s]&&this.loadGroup(t[s],s,!0)}),this}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),J(e,"collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),Dt(e,"collapsed"))}return this}isGroupCollapsable(t){const e=this.groups[t];return Sn(e,"collapsable")}isGroupCollapsed(t){const e=this.groups[t];return e&&Sn(e,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(t=>this.collapseGroup(t)),this}expandGroups(){return Object.keys(this.groups).forEach(t=>this.expandGroup(t)),this}resizeGroup(t,e){const s=this.graphs[t];return s&&s.resize(e.width,e.height),this}addGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups?this.options.groups.push(...e):this.options.groups=e,e.forEach(s=>this.initGroup(s))}removeGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!e.includes(s.name)),e.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];ze(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),J(this.container,this.prefixClassName(Ee.base)),ut(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),J(this.content,this.prefixClassName(Ee.content)),ps(this.content,this.container)}initSearch(){this.options.search&&(J(this.container,"searchable"),Ne(this.container,this.renderSearch()))}initGroup(t){const e=this.options.stencilGraphOptions||{},s=document.createElement("div");J(s,this.prefixClassName(Ee.group)),ut(s,"data-name",t.name),(t.collapsable==null&&this.options.collapsable||t.collapsable!==!1)&&J(s,"collapsable"),ln(s,"collapsed",t.collapsed===!0);const r=document.createElement("h3");J(r,this.prefixClassName(Ee.groupTitle)),r.innerHTML=t.title||t.name;const i=document.createElement("div");J(i,this.prefixClassName(Ee.groupContent));const o=t.graphOptions,a=new I(Object.assign(Object.assign(Object.assign({},e),o),{container:document.createElement("div"),model:e.model||new Zt,width:t.graphWidth||this.options.stencilGraphWidth,height:t.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),Ne(i,a.container),Ne(s,[r,i]),ps(s,this.content),this.groups[t.name]=s,this.graphs[t.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(t=>{this.initGroup(t)});else{const t=this.options.stencilGraphOptions||{},e=new I(Object.assign(Object.assign({},t),{container:document.createElement("div"),model:t.model||new Zt,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));Ne(this.content,e.container),this.graphs[po.defaultGroupName]=e}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(t=>t.collapsable!==!1),this.options.collapsable?(J(this.container,"collapsable"),this.options.groups&&this.options.groups.every(e=>e.collapsed||e.collapsable===!1)?J(this.container,"collapsed"):Dt(this.container,"collapsed")):Dt(this.container,"collapsable")}setTitle(){const t=document.createElement("div");J(t,this.prefixClassName(Ee.title)),t.innerHTML=this.options.title,ps(t,this.container)}renderSearch(){const t=document.createElement("div");J(t,this.prefixClassName(Ee.search));const e=document.createElement("input");return ut(e,{type:"search",placeholder:this.options.placeholder||"Search"}),J(e,this.prefixClassName(Ee.searchText)),Ne(t,e),t}startListening(){const t=this.prefixClassName(Ee.title),e=this.prefixClassName(Ee.searchText),s=this.prefixClassName(Ee.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(t){t.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(t){t.off("cell:mousedown",this.onDragStart,this)}loadGroup(t,e,s){const r=this.getModel(e);if(r){const l=t.map(u=>Ut.isNode(u)?u:Ut.create(u));s===!0?r.removeCells(l):r.resetCells(l)}const i=this.getGroup(e);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&X(a,this,r,i),!o){const l=this.getGraph(e);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e,node:s}=t,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,e)}filter(t,e){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===po.defaultGroupName?null:i,l=o.model.getNodes().filter(d=>{let g=!1;typeof e=="function"?g=X(e,this,d,t,a,this):typeof e=="boolean"?g=e:g=this.isCellMatched(d,t,e,t.toLowerCase()!==t);const p=o.renderer.findViewByCell(d);return p&&ln(p.container,"unmatched",!g),g}),u=l.length>0,h=this.options,f=new Zt;return f.resetCells(l),h.layout&&X(h.layout,this,f,this.getGroup(i)),this.groups[i]&&ln(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),r||u},!1);ln(this.container,"not-found",!s)}isCellMatched(t,e,s,r){return e&&s?Object.keys(s).some(i=>{if(i==="*"||t.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(l=>{let u=t.getPropByPath(l);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(e)>=0):!1})}return!1}):!0}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){J(this.container,"is-focused")}onSearchFocusOut(){Dt(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(ln(this.container,"collapsed"),Sn(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=t.target.closest(`.${this.prefixClassName(Ee.group)}`);e&&this.toggleGroup(ut(e,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||Sn(o,"collapsed")});ln(this.container,"collapsed",s)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||po.defaultGroupName]}getGroup(t){const e=this.options.groups;return t!=null&&e&&e.length?e.find(s=>s.name===t):null}getGroupByNode(t){const e=this.options.groups;return e?e.find(s=>{const r=this.getModel(s.name);return r?r.has(t.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];this.unregisterGraphEvents(e),e.dispose()}),Object.keys(this.groups).forEach(t=>{const e=this.groups[t];ze(e)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),$r(this.name)}}XV([pt.dispose()],si.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(t,e){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};qV(t,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),e?e.layoutOptions:{}))}},As.defaults)}(si||(si={}));var Ee;(function(n){n.base="widget-stencil",n.title=`${n.base}-title`,n.search=`${n.base}-search`,n.searchText=`${n.search}-text`,n.content=`${n.base}-content`,n.group=`${n.base}-group`,n.groupTitle=`${n.group}-title`,n.groupContent=`${n.group}-content`})(Ee||(Ee={}));var po;(function(n){n.defaultGroupName="__default__"})(po||(po={}));var KV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Bb extends pt{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(t,e,s){super(),this.node=e,this.graph=s,this.options=Object.assign(Object.assign({},te.defaultOptions),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const t=document.createElement("div");ut(t,"draggable","false");const e=t.cloneNode(!0);J(e,this.rotateClassName);const s=te.POSITIONS.map(r=>{const i=t.cloneNode(!0);return J(i,this.resizeClassName),ut(i,"data-position",r),i});this.empty(),Ne(this.container,[...s,e])}render(){return this.renderHandles(),this.view&&this.view.addClass(te.NODE_CLS),J(this.container,this.containerClassName),ln(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),ln(this.container,"no-resize",!this.options.resizable),ln(this.container,"no-rotate",!this.options.rotatable),this.options.className&&J(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const s=gt.normalize(this.node.getAngle()),r=s!==0?`rotate(${s}deg)`:"";return qt(this.container,{transform:r,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(te.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=gt.normalize(this.node.getAngle()),e=Math.floor(t*(te.DIRECTIONS.length/360));if(e!==this.prevShift){const s=te.DIRECTIONS.slice(e).concat(te.DIRECTIONS.slice(0,e)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{Dt(o,te.DIRECTIONS.map(l=>r(l)).join(" ")),J(o,r(s[a]))}),this.prevShift=e}}getTrueDirection(t){const e=gt.normalize(this.node.getAngle());let s=te.POSITIONS.indexOf(t);return s+=Math.floor(e*(te.POSITIONS.length/360)),s%=te.POSITIONS.length,te.POSITIONS[s]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=ut(t.target,"data-position");this.prepareResizing(t,e),this.startAction(t)}prepareResizing(t,e){const s=this.getTrueDirection(e);let r=0,i=0;e.split("-").forEach(u=>{r={left:-1,right:1}[u]||r,i={top:-1,bottom:1}[u]||i});const o=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],l=gt.normalize(this.node.getAngle());this.setEventData(t,{selector:a,direction:o,trueDirection:s,relativeDirection:e,angle:l,resizeX:r,resizeY:i,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.node.getBBox().getCenter(),s=this.normalizeEvent(t),r=this.graph.snapToGrid(s.clientX,s.clientY);this.setEventData(t,{center:e,action:"rotating",angle:gt.normalize(this.node.getAngle()),start:O.create(r).theta(e)}),this.startAction(t)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let s=this.getEventData(t);if(s.action){const r=this.normalizeEvent(t);let i=r.clientX,o=r.clientY;const a=this.graph.getPlugin("scroller"),l=this.options.restrictedResizing;if(l===!0||typeof l=="number"){const g=l===!0?0:l,p=a?Math.max(g,8):g,m=this.graph.container.getBoundingClientRect();i=we(i,m.left+p,m.right-p),o=we(o,m.top+p,m.bottom-p)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const u=this.graph.snapToGrid(i,o),h=this.graph.getGridSize(),f=this.node,d=this.options;if(s.action==="resizing"){s=s,s.resized||(e&&(e.addClass("node-resizing"),this.notify("node:resize",t,e)),s.resized=!0);const g=f.getBBox(),p=O.create(u).rotate(s.angle,g.getCenter()).diff(g[s.selector]);let m=s.resizeX?p.x*s.resizeX:g.width,y=s.resizeY?p.y*s.resizeY:g.height;const b=m,w=y;if(m=wt.snapToGrid(m,h),y=wt.snapToGrid(y,h),m=Math.max(m,d.minWidth||h),y=Math.max(y,d.minHeight||h),m=Math.min(m,d.maxWidth||1/0),y=Math.min(y,d.maxHeight||1/0),d.preserveAspectRatio){const v=g.width*y/g.height,S=g.height*m/g.width;m<v?y=S:m=v}const x=s.relativeDirection;if(d.allowReverse&&(b<=-m||w<=-y)){let v;x==="left"?b<=-m&&(v="right"):x==="right"?b<=-m&&(v="left"):x==="top"?w<=-y&&(v="bottom"):x==="bottom"?w<=-y&&(v="top"):x==="top-left"?b<=-m&&w<=-y?v="bottom-right":b<=-m?v="top-right":w<=-y&&(v="bottom-left"):x==="top-right"?b<=-m&&w<=-y?v="bottom-left":b<=-m?v="top-left":w<=-y&&(v="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?v="top-right":b<=-m?v="bottom-right":w<=-y&&(v="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?v="top-left":b<=-m?v="bottom-left":w<=-y&&(v="top-right"));const S=v;this.stopHandle();const E=this.container.querySelector(`.${this.resizeClassName}[data-position="${S}"]`);this.startHandle(E),this.prepareResizing(t,S),this.onMouseMove(t)}if(g.width!==m||g.height!==y){const v={ui:!0,direction:s.direction,relativeDirection:s.relativeDirection,trueDirection:s.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:d.preserveAspectRatio===!0};f.resize(m,y,v),this.notify("node:resizing",t,e)}}else if(s.action==="rotating"){s=s,s.rotated||(e&&(e.addClass("node-rotating"),this.notify("node:rotate",t,e)),s.rotated=!0);const g=f.getAngle(),p=s.start-O.create(u).theta(s.center);let m=s.angle+p;d.rotateGrid&&(m=wt.snapToGrid(m,d.rotateGrid)),m=gt.normalize(m),g!==m&&(f.rotate(m,{absolute:!0}),this.notify("node:rotating",t,e))}}}onMouseUp(t){const e=this.getEventData(t);e.action&&(this.stopAction(t),this.model.stopBatch(e.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(t){if(this.handle=t||null,J(this.container,`${this.containerClassName}-active`),t){J(t,`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const s=te.DIRECTIONS[te.POSITIONS.indexOf(e)];J(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(Dt(this.container,`${this.containerClassName}-active`),this.handle){Dt(this.handle,`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=te.DIRECTIONS[te.POSITIONS.indexOf(t)];Dt(this.container,`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(te.documentEvents,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),s=this.getEventData(t);e&&(e.removeClass(`node-${s.action}`),s.action==="resizing"&&s.resized?this.notify("node:resized",t,e):s.action==="rotating"&&s.rotated&&this.notify("node:rotated",t,e))}notify(t,e,s,r={}){if(s){const i=s.graph,o=i.view.normalizeEvent(e),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(t,Object.assign({e:o,view:s,node:s.cell,cell:s.cell,x:a.x,y:a.y},r))}}dispose(){this.stopListening(),this.remove(),this.off()}}KV([pt.dispose()],Bb.prototype,"dispose",null);var te;(function(n){n.NODE_CLS="has-widget-transform",n.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],n.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},n.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(te||(te={}));const ZV=`.x6-widget-transform {
|
|
534
|
+
`;var KV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class si extends pt{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(t={}){super(),this.name="stencil",jr(this.name,XV),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},si.defaultOptions),t),this.init()}init(){this.dnd=new As(this.options),this.onSearch=ng(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{t[s]&&this.loadGroup(t[s],s)}),this}unload(t,e){return Array.isArray(t)?this.loadGroup(t,e,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{t[s]&&this.loadGroup(t[s],s,!0)}),this}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),J(e,"collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),Dt(e,"collapsed"))}return this}isGroupCollapsable(t){const e=this.groups[t];return Sn(e,"collapsable")}isGroupCollapsed(t){const e=this.groups[t];return e&&Sn(e,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(t=>this.collapseGroup(t)),this}expandGroups(){return Object.keys(this.groups).forEach(t=>this.expandGroup(t)),this}resizeGroup(t,e){const s=this.graphs[t];return s&&s.resize(e.width,e.height),this}addGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups?this.options.groups.push(...e):this.options.groups=e,e.forEach(s=>this.initGroup(s))}removeGroup(t){const e=Array.isArray(t)?t:[t];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!e.includes(s.name)),e.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];ze(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),J(this.container,this.prefixClassName(Ee.base)),ut(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),J(this.content,this.prefixClassName(Ee.content)),ps(this.content,this.container)}initSearch(){this.options.search&&(J(this.container,"searchable"),Ne(this.container,this.renderSearch()))}initGroup(t){const e=this.options.stencilGraphOptions||{},s=document.createElement("div");J(s,this.prefixClassName(Ee.group)),ut(s,"data-name",t.name),(t.collapsable==null&&this.options.collapsable||t.collapsable!==!1)&&J(s,"collapsable"),ln(s,"collapsed",t.collapsed===!0);const r=document.createElement("h3");J(r,this.prefixClassName(Ee.groupTitle)),r.innerHTML=t.title||t.name;const i=document.createElement("div");J(i,this.prefixClassName(Ee.groupContent));const o=t.graphOptions,a=new L(Object.assign(Object.assign(Object.assign({},e),o),{container:document.createElement("div"),model:e.model||new Zt,width:t.graphWidth||this.options.stencilGraphWidth,height:t.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),Ne(i,a.container),Ne(s,[r,i]),ps(s,this.content),this.groups[t.name]=s,this.graphs[t.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(t=>{this.initGroup(t)});else{const t=this.options.stencilGraphOptions||{},e=new L(Object.assign(Object.assign({},t),{container:document.createElement("div"),model:t.model||new Zt,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));Ne(this.content,e.container),this.graphs[po.defaultGroupName]=e}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(t=>t.collapsable!==!1),this.options.collapsable?(J(this.container,"collapsable"),this.options.groups&&this.options.groups.every(e=>e.collapsed||e.collapsable===!1)?J(this.container,"collapsed"):Dt(this.container,"collapsed")):Dt(this.container,"collapsable")}setTitle(){const t=document.createElement("div");J(t,this.prefixClassName(Ee.title)),t.innerHTML=this.options.title,ps(t,this.container)}renderSearch(){const t=document.createElement("div");J(t,this.prefixClassName(Ee.search));const e=document.createElement("input");return ut(e,{type:"search",placeholder:this.options.placeholder||"Search"}),J(e,this.prefixClassName(Ee.searchText)),Ne(t,e),t}startListening(){const t=this.prefixClassName(Ee.title),e=this.prefixClassName(Ee.searchText),s=this.prefixClassName(Ee.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(t){t.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(t){t.off("cell:mousedown",this.onDragStart,this)}loadGroup(t,e,s){const r=this.getModel(e);if(r){const l=t.map(u=>Ht.isNode(u)?u:Ht.create(u));s===!0?r.removeCells(l):r.resetCells(l)}const i=this.getGroup(e);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&X(a,this,r,i),!o){const l=this.getGraph(e);l.fitToContent({minWidth:l.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e,node:s}=t,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,e)}filter(t,e){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===po.defaultGroupName?null:i,l=o.model.getNodes().filter(d=>{let g=!1;typeof e=="function"?g=X(e,this,d,t,a,this):typeof e=="boolean"?g=e:g=this.isCellMatched(d,t,e,t.toLowerCase()!==t);const p=o.renderer.findViewByCell(d);return p&&ln(p.container,"unmatched",!g),g}),u=l.length>0,h=this.options,f=new Zt;return f.resetCells(l),h.layout&&X(h.layout,this,f,this.getGroup(i)),this.groups[i]&&ln(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),r||u},!1);ln(this.container,"not-found",!s)}isCellMatched(t,e,s,r){return e&&s?Object.keys(s).some(i=>{if(i==="*"||t.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(l=>{let u=t.getPropByPath(l);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(e)>=0):!1})}return!1}):!0}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){J(this.container,"is-focused")}onSearchFocusOut(){Dt(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(ln(this.container,"collapsed"),Sn(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=t.target.closest(`.${this.prefixClassName(Ee.group)}`);e&&this.toggleGroup(ut(e,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||Sn(o,"collapsed")});ln(this.container,"collapsed",s)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||po.defaultGroupName]}getGroup(t){const e=this.options.groups;return t!=null&&e&&e.length?e.find(s=>s.name===t):null}getGroupByNode(t){const e=this.options.groups;return e?e.find(s=>{const r=this.getModel(s.name);return r?r.has(t.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];this.unregisterGraphEvents(e),e.dispose()}),Object.keys(this.groups).forEach(t=>{const e=this.groups[t];ze(e)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),$r(this.name)}}KV([pt.dispose()],si.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(t,e){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};JV(t,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),e?e.layoutOptions:{}))}},As.defaults)}(si||(si={}));var Ee;(function(n){n.base="widget-stencil",n.title=`${n.base}-title`,n.search=`${n.base}-search`,n.searchText=`${n.search}-text`,n.content=`${n.base}-content`,n.group=`${n.base}-group`,n.groupTitle=`${n.group}-title`,n.groupContent=`${n.group}-content`})(Ee||(Ee={}));var po;(function(n){n.defaultGroupName="__default__"})(po||(po={})),L.prototype.toSVG=function(n,t){const e=this.getPlugin("export");e&&e.toSVG(n,t)},L.prototype.toPNG=function(n,t){const e=this.getPlugin("export");e&&e.toPNG(n,t)},L.prototype.toJPEG=function(n,t){const e=this.getPlugin("export");e&&e.toJPEG(n,t)},L.prototype.exportPNG=function(n,t){const e=this.getPlugin("export");e&&e.exportPNG(n,t)},L.prototype.exportJPEG=function(n,t){const e=this.getPlugin("export");e&&e.exportJPEG(n,t)},L.prototype.exportSVG=function(n,t){const e=this.getPlugin("export");e&&e.exportSVG(n,t)};var ZV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Bb extends Nt{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(t){this.graph=t}exportPNG(t="chart",e={}){this.toPNG(s=>{Ws.downloadDataUri(s,t)},e)}exportJPEG(t="chart",e={}){this.toPNG(s=>{Ws.downloadDataUri(s,t)},e)}exportSVG(t="chart",e={}){this.toSVG(s=>{Ws.downloadDataUri(Ws.svgToDataUrl(s),t)},e)}toSVG(t,e={}){this.notify("before:export",e);const s=this.view.svg,r=tt.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),l=e.preserveDimensions;if(l){const f=typeof l=="boolean"?a:l;r.attr({width:f.width,height:f.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),e.copyStyles!==!1){const f=s.ownerDocument,d=Array.from(s.querySelectorAll("*")),g=Array.from(i.querySelectorAll("*")),p=f.styleSheets.length,m=[];for(let w=p-1;w>=0;w-=1)m[w]=f.styleSheets[w],f.styleSheets[w].disabled=!0;const y={};d.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S={};Object.keys(v).forEach(E=>{S[E]=v.getPropertyValue(E)}),y[x]=S}),p!==f.styleSheets.length&&m.forEach((w,x)=>{f.styleSheets[x]=w});for(let w=0;w<p;w+=1)f.styleSheets[w].disabled=!1;const b={};d.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S=y[x],E={};Object.keys(v).forEach(C=>{!Ec(C)&&v.getPropertyValue(C)!==S[C]&&(E[C]=v.getPropertyValue(C))}),b[x]=E}),g.forEach((w,x)=>{qt(w,b[x])})}const u=e.stylesheet;if(typeof u=="string"){const f=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(tt.create("style",{type:"text/css"},[f]))}const h=()=>{const f=e.beforeSerialize;if(typeof f=="function"){const g=X(f,this.graph,i);g instanceof SVGSVGElement&&(i=g)}const d=new XMLSerializer().serializeToString(i).replace(/ /g," ");this.notify("after:export",e),t(d)};if(e.serializeImages){const f=r.find("image").map(d=>new Promise(g=>{const p=d.attr("xlink:href")||d.attr("href");Ws.imageToDataUri(p,(m,y)=>{!m&&y&&d.attr("xlink:href",y),g()})}));Promise.all(f).then(h)}else h()}toDataURL(t,e){let s=e.viewBox||this.graph.getContentBBox();const r=ds(e.padding);e.width&&e.height&&(r.left+r.right>=e.width&&(r.left=r.right=0),r.top+r.bottom>=e.height&&(r.top=r.bottom=0));const i=new z(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(e.width&&e.height){const h=s.width+r.left+r.right,f=s.height+r.top+r.bottom;i.scale(h/e.width,f/e.height)}s=z.create(s).moveAndExpand(i);const o=typeof e.width=="number"&&typeof e.height=="number"?{width:e.width,height:e.height}:s;let a=e.ratio?parseFloat(e.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const l={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const h=document.createElement("canvas"),f=h.getContext("2d");h.width=l.width,h.height=l.height;const d=l.width-1,g=l.height-1;f.fillStyle="rgb(1,1,1)",f.fillRect(d,g,1,1);const p=f.getImageData(d,g,1,1).data;if(p[0]!==1||p[1]!==1||p[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const f=h.getContext("2d");f.fillStyle=e.backgroundColor||"white",f.fillRect(0,0,l.width,l.height);try{f.drawImage(u,0,0,l.width,l.height);const d=h.toDataURL(e.type,e.quality);t(d)}catch{}},this.toSVG(h=>{u.src=`data:image/svg+xml,${encodeURIComponent(h)}`},Object.assign(Object.assign({},e),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.off()}}ZV([Nt.dispose()],Bb.prototype,"dispose",null);const QV={class:"control-box"},tj=Gn({__name:"index",props:{payload:Object},setup(n){const t=n,e=c.ref("3"),s=c.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(t.payload.getPorts().map(u=>({id:u.id,attrs:u.attrs,args:{x:Number(u.args.x.replace("%","")),y:Number(u.args.y.replace("%",""))}}))))},i=()=>{const u=xu;u.attrs.text.text=`${t.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",t.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{Wi("#drawing-board",!0)},a=(u,h,f)=>{t.payload.portProp(u,"args/"+h,f+"%"),r()},l=u=>{t.payload.removePort(u),r()};return c.onMounted(()=>{r()}),(u,h)=>{const f=c.resolveComponent("el-button"),d=c.resolveComponent("el-table-column"),g=c.resolveComponent("el-slider"),p=c.resolveComponent("el-icon"),m=c.resolveComponent("el-table"),y=c.resolveComponent("el-collapse-item"),b=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",QV,[c.createVNode(b,{modelValue:e.value,"onUpdate:modelValue":h[0]||(h[0]=w=>e.value=w),accordion:""},{default:c.withCtx(()=>[c.createVNode(y,{title:"连接桩设置",name:"3"},{default:c.withCtx(()=>[c.createVNode(f,{type:"primary",onClick:i,size:"small"},{default:c.withCtx(()=>h[1]||(h[1]=[c.createTextVNode("添加连接桩")])),_:1}),c.createVNode(f,{type:"primary",onClick:o,size:"small"},{default:c.withCtx(()=>h[2]||(h[2]=[c.createTextVNode("显示连接桩")])),_:1}),c.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:c.withCtx(()=>[c.createVNode(d,{label:"ID",width:"50",align:"center"},{default:c.withCtx(({row:w})=>[c.createTextVNode(c.toDisplayString(w.attrs.text.text),1)]),_:1}),c.createVNode(d,{label:"x",width:"100",align:"center"},{default:c.withCtx(({row:w})=>[c.createVNode(g,{modelValue:w.args.x,"onUpdate:modelValue":x=>w.args.x=x,min:0,max:100,step:1,onInput:x=>a(w.id,"x",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(d,{label:"y",width:"100",align:"center"},{default:c.withCtx(({row:w})=>[c.createVNode(g,{modelValue:w.args.y,"onUpdate:modelValue":x=>w.args.y=x,min:0,max:100,step:1,onInput:x=>a(w.id,"y",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(d,{label:"操作",width:"70",align:"center"},{default:c.withCtx(({row:w})=>[c.createVNode(f,{type:"danger",size:"small",onClick:x=>l(w.id)},{default:c.withCtx(()=>[c.createVNode(p,null,{default:c.withCtx(()=>[c.createVNode(c.unref(wg))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),ml=[{shape:"rect",width:60,height:5,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:0}},data:{type:"base-shape"}},{shape:"rect",width:60,height:20,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape",label:"母线"}},{shape:"circle",width:40,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape"}},{shape:"ellipse",width:60,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff"}},data:{type:"base-shape"}}],Vb={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},hh=Object.assign({name:"wiring-diagram-preview"},{__name:"index",props:{id:{type:String,default:""},background:{type:Object,default:()=>({})},grid:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})}},setup(n){const t=n,e=c.ref([]),s=c.ref(),r=()=>{const y=document.getElementById("preview-container");s.value=new L({container:y,autoResize:!0,panning:!0,mousewheel:!0,connecting:{router:"orth",connectionPoint:{name:"anchor"},anchor:"center"},interacting:{nodeMovable:!1,magnetConnectable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1}}),s.value.on("blank:dblclick",()=>{h()})},i=async()=>{let y,b,w;if(t.id){const{background:x,grid:v,data:S}=await Nm(t.id);y=x,b={},w=S}else y=t.background,b={},w=t.data;s.value.drawBackground(y),s.value.drawGrid(b),s.value.fromJSON(w),l()},o=c.ref(null),a=c.ref([]),l=()=>{a.value=f();const y=/\$\{(.*?)\}/g;a.value.forEach(b=>{if(!b.data||!b.data.field)return;const w=b.data.content.match(y);e.value.push(...b.data.field),w&&(b.matches=w)}),a&&h()},u=c.ref(!0),h=async()=>{if(!e.value.length)return;if(!u.value){Yt.warning("数据正在更新中,请稍后再试");return}o.value&&clearInterval(o.value),u.value=!1;const y=await ID(e.value);if(u.value=!0,!Array.isArray(y)||!y.length)return;let b=0;a.value.forEach((w,x)=>{if(!w.data||!w.data.field)return;if(w.matches){const S=x===0?0:b||0,E=b=S+w.data.field.length;w.label=d(w.data.content,y.slice(S,E))}}),o.value=setTimeout(()=>{h()},1e4)},f=()=>s.value.getNodes().filter(b=>{var w;return((w=b.data)==null?void 0:w.type)==="text"}),d=(y,b)=>{let w=0;return y.replace(/\$\{.*?\}/g,()=>w<b.length?b[w++]:"--")},g=()=>{s.value.zoomToFit({maxScale:10,padding:20})},p=c.shallowRef(),m=()=>{new ResizeObserver(()=>{g()}).observe(p.value)};return c.onMounted(()=>{r(),i(),setTimeout(()=>{Wi("#preview-container",!1),g()},100),m()}),c.onUnmounted(()=>{clearInterval(o.value)}),(y,b)=>(c.openBlock(),c.createElementBlock("div",{id:"preview-container",ref_key:"previewRef",ref:p,onDblclick:g},null,544))}}),ej={class:"form-container"},nj={class:"footer"},sj=Gn({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:t}){const e=n,s=t,r=c.reactive({groupName:"",sort:1,isShow:1}),i=c.reactive({groupName:[{required:!0,message:"请输入分组名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}],isShow:[{required:!0,message:"请选择是否显示",trigger:"change"}]}),o=c.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?$a("/cny/custom/updateGroup",r).then(h=>{h!=null&&h.isOk?(Yt.success("保存成功"),s("close",!0)):Yt.error((h==null?void 0:h.msg)||"保存失败")}):$a("/cny/custom/saveGroup",r).then(h=>{h!=null&&h.isOk?(Yt.success("保存成功"),s("close",!0)):Yt.error((h==null?void 0:h.msg)||"保存失败")});else return!1})},l=()=>{s("close",!1)};return c.onMounted(()=>{var u;(u=e.payload)!=null&&u.id&&(r.id=e.payload.id,r.groupName=e.payload.groupName,r.sort=e.payload.sort,r.isShow=e.payload.isShow)}),(u,h)=>{const f=c.resolveComponent("el-input"),d=c.resolveComponent("el-form-item"),g=c.resolveComponent("el-input-number"),p=c.resolveComponent("el-switch"),m=c.resolveComponent("el-button"),y=c.resolveComponent("el-form");return c.openBlock(),c.createElementBlock("div",ej,[c.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:c.withCtx(()=>[c.createVNode(d,{label:"分组名称",prop:"groupName"},{default:c.withCtx(()=>[c.createVNode(f,{modelValue:r.groupName,"onUpdate:modelValue":h[0]||(h[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),c.createVNode(d,{label:"排序",prop:"sort"},{default:c.withCtx(()=>[c.createVNode(g,{modelValue:r.sort,"onUpdate:modelValue":h[1]||(h[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),c.createVNode(d,{label:"是否显示",prop:"isShow"},{default:c.withCtx(()=>[c.createVNode(p,{modelValue:r.isShow,"onUpdate:modelValue":h[2]||(h[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),c.createElementVNode("div",nj,[c.createVNode(m,{type:"primary",onClick:a},{default:c.withCtx(()=>h[3]||(h[3]=[c.createTextVNode("保存")])),_:1}),c.createVNode(m,{onClick:l},{default:c.withCtx(()=>h[4]||(h[4]=[c.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-a2a7ce25"]]),rj={class:"form-container"},ij={class:"footer"},oj=Gn({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:t}){const e=t,s=n,r=c.shallowRef(null),i=c.reactive({groupId:"",id:"",imageName:"",sort:0,isShow:1,imageUrl:""}),o={imageName:[{required:!0,message:"请输入图片名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}]},a=c.ref(""),l=f=>{if(f.raw.type.indexOf("image")===-1){Yt.error("请上传图片格式的文件");return}const d=new FormData;d.append("file",f.raw),RD("/cny/file/fileUpload",d).then(g=>{g!=null&&g.isOk?(a.value=hs.defaults.baseURL+"/cny/upload/"+(g==null?void 0:g.data),i.imageUrl=g==null?void 0:g.data):Yt.error((g==null?void 0:g.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(f=>{if(f)$a("/cny/custom/savePicture",i).then(d=>{d!=null&&d.isOk?(Yt.success("保存成功"),e("close",!0)):Yt.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},h=()=>{e("close",!1)};return c.onMounted(()=>{var f;(f=s.payload)!=null&&f.id&&(i.id=s.payload.id,i.imageName=s.payload.imageName,i.sort=s.payload.sort,i.isShow=s.payload.isShow,i.imageUrl=s.payload.imageUrl,a.value=i.imageUrl),i.groupId=s.payload.groupId}),(f,d)=>{const g=c.resolveComponent("el-input"),p=c.resolveComponent("el-form-item"),m=c.resolveComponent("el-input-number"),y=c.resolveComponent("el-switch"),b=c.resolveComponent("el-image"),w=c.resolveComponent("el-icon"),x=c.resolveComponent("el-upload"),v=c.resolveComponent("el-button"),S=c.resolveComponent("el-form");return c.openBlock(),c.createElementBlock("div",rj,[c.createVNode(S,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:c.withCtx(()=>[c.createVNode(p,{label:"图片名称",prop:"imageName"},{default:c.withCtx(()=>[c.createVNode(g,{modelValue:i.imageName,"onUpdate:modelValue":d[0]||(d[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),c.createVNode(p,{label:"排序",prop:"sort"},{default:c.withCtx(()=>[c.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":d[1]||(d[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),c.createVNode(p,{label:"是否显示",prop:"isShow"},{default:c.withCtx(()=>[c.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":d[2]||(d[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),c.createVNode(p,{label:"上传",prop:"image"},{default:c.withCtx(()=>[c.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":l,"auto-upload":!1},{default:c.withCtx(()=>[a.value?(c.openBlock(),c.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(c.openBlock(),c.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:c.withCtx(()=>[c.createVNode(c.unref(Z2))]),_:1}))]),_:1})]),_:1}),c.createElementVNode("div",ij,[c.createVNode(v,{type:"primary",onClick:u},{default:c.withCtx(()=>d[3]||(d[3]=[c.createTextVNode("保存")])),_:1}),c.createVNode(v,{onClick:h},{default:c.withCtx(()=>d[4]||(d[4]=[c.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-c7d87a18"]]),aj={class:"form-container"},lj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},cj=["src"],uj=Gn({__name:"image-management",setup(n){const t=c.reactive({items:[]}),e=()=>{Yi("/cny/custom/groupList").then(d=>{t.items=d.data})},s=c.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=d=>{s.show=!0,s.title="编辑图片分组",s.payload={id:d.id,groupName:d.groupName,sort:d.sort,isShow:d.isShow}},o=d=>{Tm("/cny/custom/removeGroup/"+d).then(g=>{g.code===200?(Yt.success("删除成功"),e()):Yt.error(g.msg||"删除失败")})},a=c.reactive({show:!1,title:"新增图片",payload:null}),l=d=>{a.show=!0,a.title="新增图片",a.payload={groupId:d}},u=d=>{a.show=!0,a.title="编辑图片",a.payload={id:d.id,groupId:d.groupId,imageName:d.imageName,sort:d.sort,isShow:d.isShow,imageUrl:d.imageUrl}},h=d=>{Tm("/cny/custom/removePicture/"+d).then(g=>{g.code===200?(Yt.success("删除成功"),e()):Yt.error(g.msg||"删除失败")})},f=d=>{s.show=!1,a.show=!1,d&&e()};return c.onMounted(()=>{e()}),(d,g)=>{const p=c.resolveComponent("el-button"),m=c.resolveComponent("el-table-column"),y=c.resolveComponent("el-table"),b=c.resolveComponent("el-dialog");return c.openBlock(),c.createElementBlock("div",aj,[c.createVNode(p,{type:"primary",onClick:r,size:"small"},{default:c.withCtx(()=>g[2]||(g[2]=[c.createTextVNode("新增图片分组")])),_:1}),c.createVNode(y,{data:t.items,border:"",height:"500"},{default:c.withCtx(()=>[c.createVNode(m,{type:"expand"},{default:c.withCtx(w=>[c.createElementVNode("div",lj,[c.createVNode(p,{type:"primary",size:"small",onClick:x=>l(w.row.id)},{default:c.withCtx(()=>g[3]||(g[3]=[c.createTextVNode("新增图片")])),_:2},1032,["onClick"]),c.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:c.withCtx(()=>[c.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),c.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:c.withCtx(x=>[c.createElementVNode("img",{src:x.row.imageUrl,alt:"",style:{width:"64px",height:"64px"}},null,8,cj)]),_:1}),c.createVNode(m,{label:"排序",prop:"sort",align:"center"}),c.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:c.withCtx(x=>[c.createTextVNode(c.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),c.createVNode(m,{label:"操作",align:"center"},{default:c.withCtx(x=>[c.createVNode(p,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:c.withCtx(()=>g[4]||(g[4]=[c.createTextVNode("编辑")])),_:2},1032,["onClick"]),c.createVNode(p,{type:"danger",size:"small",onClick:v=>h(x.row.id)},{default:c.withCtx(()=>g[5]||(g[5]=[c.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),c.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),c.createVNode(m,{label:"排序",prop:"sort",align:"center"}),c.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:c.withCtx(w=>[c.createTextVNode(c.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),c.createVNode(m,{label:"操作",align:"center"},{default:c.withCtx(w=>[c.createVNode(p,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:c.withCtx(()=>g[6]||(g[6]=[c.createTextVNode("编辑")])),_:2},1032,["onClick"]),c.createVNode(p,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:c.withCtx(()=>g[7]||(g[7]=[c.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),c.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":g[0]||(g[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[s.show?(c.openBlock(),c.createBlock(sj,{key:0,payload:s.payload,onClose:f},null,8,["payload"])):c.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),c.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":g[1]||(g[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[a.show?(c.openBlock(),c.createBlock(oj,{key:0,payload:a.payload,onClose:f},null,8,["payload"])):c.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-75a537f2"]]);var hj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class jb extends pt{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(t,e,s){super(),this.node=e,this.graph=s,this.options=Object.assign(Object.assign({},te.defaultOptions),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const t=document.createElement("div");ut(t,"draggable","false");const e=t.cloneNode(!0);J(e,this.rotateClassName);const s=te.POSITIONS.map(r=>{const i=t.cloneNode(!0);return J(i,this.resizeClassName),ut(i,"data-position",r),i});this.empty(),Ne(this.container,[...s,e])}render(){return this.renderHandles(),this.view&&this.view.addClass(te.NODE_CLS),J(this.container,this.containerClassName),ln(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),ln(this.container,"no-resize",!this.options.resizable),ln(this.container,"no-rotate",!this.options.rotatable),this.options.className&&J(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const s=gt.normalize(this.node.getAngle()),r=s!==0?`rotate(${s}deg)`:"";return qt(this.container,{transform:r,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(te.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=gt.normalize(this.node.getAngle()),e=Math.floor(t*(te.DIRECTIONS.length/360));if(e!==this.prevShift){const s=te.DIRECTIONS.slice(e).concat(te.DIRECTIONS.slice(0,e)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{Dt(o,te.DIRECTIONS.map(l=>r(l)).join(" ")),J(o,r(s[a]))}),this.prevShift=e}}getTrueDirection(t){const e=gt.normalize(this.node.getAngle());let s=te.POSITIONS.indexOf(t);return s+=Math.floor(e*(te.POSITIONS.length/360)),s%=te.POSITIONS.length,te.POSITIONS[s]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=ut(t.target,"data-position");this.prepareResizing(t,e),this.startAction(t)}prepareResizing(t,e){const s=this.getTrueDirection(e);let r=0,i=0;e.split("-").forEach(u=>{r={left:-1,right:1}[u]||r,i={top:-1,bottom:1}[u]||i});const o=this.toValidResizeDirection(e),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],l=gt.normalize(this.node.getAngle());this.setEventData(t,{selector:a,direction:o,trueDirection:s,relativeDirection:e,angle:l,resizeX:r,resizeY:i,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.node.getBBox().getCenter(),s=this.normalizeEvent(t),r=this.graph.snapToGrid(s.clientX,s.clientY);this.setEventData(t,{center:e,action:"rotating",angle:gt.normalize(this.node.getAngle()),start:O.create(r).theta(e)}),this.startAction(t)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let s=this.getEventData(t);if(s.action){const r=this.normalizeEvent(t);let i=r.clientX,o=r.clientY;const a=this.graph.getPlugin("scroller"),l=this.options.restrictedResizing;if(l===!0||typeof l=="number"){const g=l===!0?0:l,p=a?Math.max(g,8):g,m=this.graph.container.getBoundingClientRect();i=we(i,m.left+p,m.right-p),o=we(o,m.top+p,m.bottom-p)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const u=this.graph.snapToGrid(i,o),h=this.graph.getGridSize(),f=this.node,d=this.options;if(s.action==="resizing"){s=s,s.resized||(e&&(e.addClass("node-resizing"),this.notify("node:resize",t,e)),s.resized=!0);const g=f.getBBox(),p=O.create(u).rotate(s.angle,g.getCenter()).diff(g[s.selector]);let m=s.resizeX?p.x*s.resizeX:g.width,y=s.resizeY?p.y*s.resizeY:g.height;const b=m,w=y;if(m=wt.snapToGrid(m,h),y=wt.snapToGrid(y,h),m=Math.max(m,d.minWidth||h),y=Math.max(y,d.minHeight||h),m=Math.min(m,d.maxWidth||1/0),y=Math.min(y,d.maxHeight||1/0),d.preserveAspectRatio){const v=g.width*y/g.height,S=g.height*m/g.width;m<v?y=S:m=v}const x=s.relativeDirection;if(d.allowReverse&&(b<=-m||w<=-y)){let v;x==="left"?b<=-m&&(v="right"):x==="right"?b<=-m&&(v="left"):x==="top"?w<=-y&&(v="bottom"):x==="bottom"?w<=-y&&(v="top"):x==="top-left"?b<=-m&&w<=-y?v="bottom-right":b<=-m?v="top-right":w<=-y&&(v="bottom-left"):x==="top-right"?b<=-m&&w<=-y?v="bottom-left":b<=-m?v="top-left":w<=-y&&(v="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?v="top-right":b<=-m?v="bottom-right":w<=-y&&(v="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?v="top-left":b<=-m?v="bottom-left":w<=-y&&(v="top-right"));const S=v;this.stopHandle();const E=this.container.querySelector(`.${this.resizeClassName}[data-position="${S}"]`);this.startHandle(E),this.prepareResizing(t,S),this.onMouseMove(t)}if(g.width!==m||g.height!==y){const v={ui:!0,direction:s.direction,relativeDirection:s.relativeDirection,trueDirection:s.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:d.preserveAspectRatio===!0};f.resize(m,y,v),this.notify("node:resizing",t,e)}}else if(s.action==="rotating"){s=s,s.rotated||(e&&(e.addClass("node-rotating"),this.notify("node:rotate",t,e)),s.rotated=!0);const g=f.getAngle(),p=s.start-O.create(u).theta(s.center);let m=s.angle+p;d.rotateGrid&&(m=wt.snapToGrid(m,d.rotateGrid)),m=gt.normalize(m),g!==m&&(f.rotate(m,{absolute:!0}),this.notify("node:rotating",t,e))}}}onMouseUp(t){const e=this.getEventData(t);e.action&&(this.stopAction(t),this.model.stopBatch(e.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(t){if(this.handle=t||null,J(this.container,`${this.containerClassName}-active`),t){J(t,`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const s=te.DIRECTIONS[te.POSITIONS.indexOf(e)];J(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(Dt(this.container,`${this.containerClassName}-active`),this.handle){Dt(this.handle,`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=te.DIRECTIONS[te.POSITIONS.indexOf(t)];Dt(this.container,`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(te.documentEvents,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),s=this.getEventData(t);e&&(e.removeClass(`node-${s.action}`),s.action==="resizing"&&s.resized?this.notify("node:resized",t,e):s.action==="rotating"&&s.rotated&&this.notify("node:rotated",t,e))}notify(t,e,s,r={}){if(s){const i=s.graph,o=i.view.normalizeEvent(e),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(t,Object.assign({e:o,view:s,node:s.cell,cell:s.cell,x:a.x,y:a.y},r))}}dispose(){this.stopListening(),this.remove(),this.off()}}hj([pt.dispose()],jb.prototype,"dispose",null);var te;(function(n){n.NODE_CLS="has-widget-transform",n.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],n.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},n.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(te||(te={}));const dj=`.x6-widget-transform {
|
|
535
535
|
position: absolute;
|
|
536
536
|
box-sizing: content-box !important;
|
|
537
537
|
margin: -5px 0 0 -5px;
|
|
@@ -657,7 +657,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
657
657
|
display: block;
|
|
658
658
|
background-color: #808080;
|
|
659
659
|
}
|
|
660
|
-
`;I.prototype.createTransformWidget=function(n){const t=this.getPlugin("transform");return t&&t.createWidget(n),this},I.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var QV=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class er extends Nt{constructor(t={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=t,jr(this.name,ZV)}init(t){this.graph=t,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(t){this.clearWidgets();const e=this.createTransform(t);e&&(this.widgets.set(t,e),e.on("*",(s,r)=>{this.trigger(s,r),this.graph.trigger(s,r)}))}onNodeClick({node:t}){this.createWidget(t)}onBlankMouseDown(){this.clearWidgets()}createTransform(t){const e=this.getTransformOptions(t);return e.resizable||e.rotatable?new Bb(e,t,this.graph):null}getTransformOptions(t){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const e=er.parseOptionGroup(this.graph,t,this.options.resizing),s=er.parseOptionGroup(this.graph,t,this.options.rotating);return{resizable:!!e.enabled,minWidth:e.minWidth||0,maxWidth:e.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:e.minHeight||0,maxHeight:e.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof e.orthogonal=="boolean"?e.orthogonal:!0,restrictedResizing:!!e.restrict,autoScrollOnResizing:typeof e.autoScroll=="boolean"?e.autoScroll:!0,preserveAspectRatio:!!e.preserveAspectRatio,allowReverse:typeof e.allowReverse=="boolean"?e.allowReverse:!0,rotatable:!!s.enabled,rotateGrid:s.grid||15}}clearWidgets(){this.widgets.forEach((t,e)=>{this.graph.getCellById(e.id)&&t.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),$r(this.name)}}QV([Nt.dispose()],er.prototype,"dispose",null),function(n){function t(e,s,r){const i={};return Object.keys(r||{}).forEach(o=>{const a=r[o];i[o]=typeof a=="function"?a.call(e,s):a}),i}n.parseOptionGroup=t}(er||(er={}));var tj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},ej=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Vb extends pt{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(t){super();const{graph:e}=t,s=ej(t,["graph"]);this.graph=e,this.options=Object.assign({},s),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t}render(){const t=this.containerWrapper=new tt("svg"),e=this.horizontal=new tt("line"),s=this.vertical=new tt("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),s.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),s.setAttribute("display","none"),t.append([e,s]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:t,data:e}){t==="resize"&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:s}){const r=t.getDelegatedView();if(r&&this.isNodeMovable(r)){const i=t.cell.getPosition();this.offset={x:e-i.x,y:s-i.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}getRestrictArea(t){const e=this.graph.options.translating.restrict,s=typeof e=="function"?X(e,this.graph,t):e;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const s=this.graph.renderer.findViewByCell(t);if(s&&s.cell.isNode()){const r=t.getBBox(),i=r.bbox(t.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),l=gt.normalize(t.getAngle()),u=this.options.tolerance||0;let h,f,d,g,p,m;const y={vertical:0,horizontal:0},b=e.direction,w=e.trueDirection,x=e.relativeDirection;w.indexOf("right")!==-1?y.vertical=a.x:y.vertical=o.x,w.indexOf("bottom")!==-1?y.horizontal=a.y:y.horizontal=o.y,this.model.getNodes().some(D=>{if(this.isIgnored(t,D))return!1;const N=D.getBBox().bbox(D.getAngle()),j=N.getTopLeft(),A=N.getBottomRight(),P={vertical:[j.x,A.x],horizontal:[j.y,A.y]},L={};return Object.keys(P).forEach(V=>{const Y=V,ot=P[Y].map(F=>({position:F,distance:Math.abs(F-y[Y])})).filter(F=>F.distance<=u);L[Y]=Pc(ot,F=>F.distance)}),h==null&&L.vertical.length>0&&(h=L.vertical[0].position,f=Math.min(i.y,N.y),d=Math.max(a.y,A.y)-f),g==null&&L.horizontal.length>0&&(g=L.horizontal[0].position,p=Math.min(i.x,N.x),m=Math.max(a.x,A.x)-p),h!=null&&g!=null}),this.hide();let v=0,S=0;(g!=null||h!=null)&&(h!=null&&(v=w.indexOf("right")!==-1?h-a.x:o.x-h),g!=null&&(S=w.indexOf("bottom")!==-1?g-a.y:o.y-g));let E=0,C=0;if(l%90===0)l===90||l===270?(E=S,C=v):(E=v,C=S);else{const D=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;g!=null&&h!=null&&(v<S?(S=0,g=void 0):(v=0,h=void 0));const N=gt.toRad(l%90);v&&(E=D===3?v/Math.cos(N):v/Math.sin(N)),S&&(C=D===3?S/Math.cos(N):S/Math.sin(N));const j=D===1||D===3;switch(x){case"top":case"bottom":C=S?S/(j?Math.cos(N):Math.sin(N)):v/(j?Math.sin(N):Math.cos(N));break;case"left":case"right":E=v?v/(j?Math.cos(N):Math.sin(N)):S/(j?Math.sin(N):Math.cos(N));break}}switch(x){case"top":case"bottom":E=0;break;case"left":case"right":C=0;break}const M=this.graph.getGridSize();let T=Math.max(r.width+E,M),k=Math.max(r.height+C,M);e.minWidth&&e.minWidth>M&&(T=Math.max(T,e.minWidth)),e.minHeight&&e.minHeight>M&&(k=Math.max(k,e.minHeight)),e.maxWidth&&(T=Math.min(T,e.maxWidth)),e.maxHeight&&(k=Math.min(k,e.maxHeight)),e.preserveAspectRatio&&(C<E?k=T*(r.height/r.width):T=k*(r.width/r.height)),(T!==r.width||k!==r.height)&&(t.resize(T,k,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),d&&(d+=k-r.height),m&&(m+=T-r.width));const _=t.getBBox().bbox(l);h&&Math.abs(_.x-h)>1&&Math.abs(_.width+_.x-h)>1&&(h=void 0),g&&Math.abs(_.y-g)>1&&Math.abs(_.height+_.y-g)>1&&(g=void 0),this.update({verticalLeft:h,verticalTop:f,verticalHeight:d,horizontalTop:g,horizontalLeft:p,horizontalWidth:m})}}}snapOnMoving({view:t,e,x:s,y:r}){const i=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),l=o.getPosition(),u=new z(s-this.offset.x,r-this.offset.y,a.width,a.height),h=o.getAngle(),f=u.getCenter(),d=u.bbox(h),g=d.getTopLeft(),p=d.getBottomRight(),m=this.options.tolerance||0;let y,b,w,x,v,S,E=0,C=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(o,M))return!1;const T=M.getBBox().bbox(M.getAngle()),k=T.getCenter(),_=T.getTopLeft(),D=T.getBottomRight();return y==null&&(Math.abs(k.x-f.x)<m?(y=k.x,E=.5):Math.abs(_.x-g.x)<m?(y=_.x,E=0):Math.abs(_.x-p.x)<m?(y=_.x,E=1):Math.abs(D.x-p.x)<m?(y=D.x,E=1):Math.abs(D.x-g.x)<m&&(y=D.x),y!=null&&(b=Math.min(d.y,T.y),w=Math.max(p.y,D.y)-b)),x==null&&(Math.abs(k.y-f.y)<m?(x=k.y,C=.5):Math.abs(_.y-g.y)<m?x=_.y:Math.abs(_.y-p.y)<m?(x=_.y,C=1):Math.abs(D.y-p.y)<m?(x=D.y,C=1):Math.abs(D.y-g.y)<m&&(x=D.y),x!=null&&(v=Math.min(d.x,T.x),S=Math.max(p.x,D.x)-v)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(d.y=x-C*d.height),y!=null&&(d.x=y-E*d.width);const M=d.getCenter(),T=M.x-u.width/2,k=M.y-u.height/2,_=T-l.x,D=k-l.y;(_!==0||D!==0)&&(o.translate(_,D,{snapped:!0,restrict:this.getRestrictArea(i)}),S&&(S+=_),w&&(w+=D)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:v,horizontalWidth:S})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||!this.filter(e)}filter(t){const e=this.options.filter;return Array.isArray(e)?e.some(s=>typeof s=="string"?t.shape===s:t.id===s.id):typeof e=="function"?X(e,this.graph,t):!0}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new O(t.horizontalLeft,t.horizontalTop)),s=this.graph.localToGraph(new O(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${s.x}`:"100%",y2:`${s.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new O(t.verticalLeft,t.verticalTop)),s=this.graph.localToGraph(new O(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${s.x}`,y2:this.options.sharp?`${s.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e=typeof t=="number"?t:t!==!1?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}tj([pt.dispose()],Vb.prototype,"dispose",null);const nj=`.x6-widget-snapline {
|
|
660
|
+
`;L.prototype.createTransformWidget=function(n){const t=this.getPlugin("transform");return t&&t.createWidget(n),this},L.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var fj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class er extends Nt{constructor(t={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=t,jr(this.name,dj)}init(t){this.graph=t,!this.disabled&&this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(t){this.clearWidgets();const e=this.createTransform(t);e&&(this.widgets.set(t,e),e.on("*",(s,r)=>{this.trigger(s,r),this.graph.trigger(s,r)}))}onNodeClick({node:t}){this.createWidget(t)}onBlankMouseDown(){this.clearWidgets()}createTransform(t){const e=this.getTransformOptions(t);return e.resizable||e.rotatable?new jb(e,t,this.graph):null}getTransformOptions(t){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),typeof this.options.resizing=="boolean"&&(this.options.resizing={enabled:this.options.resizing}),typeof this.options.rotating=="boolean"&&(this.options.rotating={enabled:this.options.rotating});const e=er.parseOptionGroup(this.graph,t,this.options.resizing),s=er.parseOptionGroup(this.graph,t,this.options.rotating);return{resizable:!!e.enabled,minWidth:e.minWidth||0,maxWidth:e.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:e.minHeight||0,maxHeight:e.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof e.orthogonal=="boolean"?e.orthogonal:!0,restrictedResizing:!!e.restrict,autoScrollOnResizing:typeof e.autoScroll=="boolean"?e.autoScroll:!0,preserveAspectRatio:!!e.preserveAspectRatio,allowReverse:typeof e.allowReverse=="boolean"?e.allowReverse:!0,rotatable:!!s.enabled,rotateGrid:s.grid||15}}clearWidgets(){this.widgets.forEach((t,e)=>{this.graph.getCellById(e.id)&&t.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),$r(this.name)}}fj([Nt.dispose()],er.prototype,"dispose",null),function(n){function t(e,s,r){const i={};return Object.keys(r||{}).forEach(o=>{const a=r[o];i[o]=typeof a=="function"?a.call(e,s):a}),i}n.parseOptionGroup=t}(er||(er={}));var $b={exports:{}};(function(n){(function(t,e,s){if(!t)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function h(C,M,T){if(C.addEventListener){C.addEventListener(M,T,!1);return}C.attachEvent("on"+M,T)}function f(C){if(C.type=="keypress"){var M=String.fromCharCode(C.which);return C.shiftKey||(M=M.toLowerCase()),M}return r[C.which]?r[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function d(C,M){return C.sort().join(",")===M.sort().join(",")}function g(C){var M=[];return C.shiftKey&&M.push("shift"),C.altKey&&M.push("alt"),C.ctrlKey&&M.push("ctrl"),C.metaKey&&M.push("meta"),M}function p(C){if(C.preventDefault){C.preventDefault();return}C.returnValue=!1}function m(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function y(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function b(){if(!l){l={};for(var C in r)C>95&&C<112||r.hasOwnProperty(C)&&(l[r[C]]=C)}return l}function w(C,M,T){return T||(T=b()[C]?"keydown":"keypress"),T=="keypress"&&M.length&&(T="keydown"),T}function x(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function v(C,M){var T,_,N,k=[];for(T=x(C),N=0;N<T.length;++N)_=T[N],a[_]&&(_=a[_]),M&&M!="keypress"&&o[_]&&(_=o[_],k.push("shift")),y(_)&&k.push(_);return M=w(_,k,M),{key:_,modifiers:k,action:M}}function S(C,M){return C===null||C===e?!1:C===M?!0:S(C.parentNode,M)}function E(C){var M=this;if(C=C||e,!(M instanceof E))return new E(C);M.target=C,M._callbacks={},M._directMap={};var T={},_,N=!1,k=!1,R=!1;function I(F){F=F||{};var H=!1,V;for(V in T){if(F[V]){H=!0;continue}T[V]=0}H||(R=!1)}function A(F,H,V,K,nt,rt){var et,ft,ge=[],St=V.type;if(!M._callbacks[F])return[];for(St=="keyup"&&y(F)&&(H=[F]),et=0;et<M._callbacks[F].length;++et)if(ft=M._callbacks[F][et],!(!K&&ft.seq&&T[ft.seq]!=ft.level)&&St==ft.action&&(St=="keypress"&&!V.metaKey&&!V.ctrlKey||d(H,ft.modifiers))){var xt=!K&&ft.combo==nt,An=K&&ft.seq==K&&ft.level==rt;(xt||An)&&M._callbacks[F].splice(et,1),ge.push(ft)}return ge}function P(F,H,V,K){M.stopCallback(H,H.target||H.srcElement,V,K)||F(H,V)===!1&&(p(H),m(H))}M._handleKey=function(F,H,V){var K=A(F,H,V),nt,rt={},et=0,ft=!1;for(nt=0;nt<K.length;++nt)K[nt].seq&&(et=Math.max(et,K[nt].level));for(nt=0;nt<K.length;++nt){if(K[nt].seq){if(K[nt].level!=et)continue;ft=!0,rt[K[nt].seq]=1,P(K[nt].callback,V,K[nt].combo,K[nt].seq);continue}ft||P(K[nt].callback,V,K[nt].combo)}var ge=V.type=="keypress"&&k;V.type==R&&!y(F)&&!ge&&I(rt),k=ft&&V.type=="keydown"};function B(F){typeof F.which!="number"&&(F.which=F.keyCode);var H=f(F);if(H){if(F.type=="keyup"&&N===H){N=!1;return}M.handleKey(H,g(F),F)}}function j(){clearTimeout(_),_=setTimeout(I,1e3)}function Y(F,H,V,K){T[F]=0;function nt(St){return function(){R=St,++T[F],j()}}function rt(St){P(V,St,F),K!=="keyup"&&(N=f(St)),setTimeout(I,10)}for(var et=0;et<H.length;++et){var ft=et+1===H.length,ge=ft?rt:nt(K||v(H[et+1]).action);ot(H[et],ge,K,F,et)}}function ot(F,H,V,K,nt){M._directMap[F+":"+V]=H,F=F.replace(/\s+/g," ");var rt=F.split(" "),et;if(rt.length>1){Y(F,rt,H,V);return}et=v(F,V),M._callbacks[et.key]=M._callbacks[et.key]||[],A(et.key,et.modifiers,{type:et.action},K,F,nt),M._callbacks[et.key][K?"unshift":"push"]({callback:H,modifiers:et.modifiers,action:et.action,seq:K,level:nt,combo:F})}M._bindMultiple=function(F,H,V){for(var K=0;K<F.length;++K)ot(F[K],H,V)},h(C,"keypress",B),h(C,"keydown",B),h(C,"keyup",B)}E.prototype.bind=function(C,M,T){var _=this;return C=C instanceof Array?C:[C],_._bindMultiple.call(_,C,M,T),_},E.prototype.unbind=function(C,M){var T=this;return T.bind.call(T,C,function(){},M)},E.prototype.trigger=function(C,M){var T=this;return T._directMap[C+":"+M]&&T._directMap[C+":"+M]({},C),T},E.prototype.reset=function(){var C=this;return C._callbacks={},C._directMap={},C},E.prototype.stopCallback=function(C,M){var T=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||S(M,T.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var _=C.composedPath()[0];_!==C.target&&(M=_)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},E.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},E.addKeycodes=function(C){for(var M in C)C.hasOwnProperty(M)&&(r[M]=C[M]);l=null},E.init=function(){var C=E(e);for(var M in C)M.charAt(0)!=="_"&&(E[M]=function(T){return function(){return C[T].apply(C,arguments)}}(M))},E.init(),t.Mousetrap=E,n.exports&&(n.exports=E)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})($b);var gj=$b.exports;const pj=D_(gj);var mj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ri extends ye{get graph(){return this.options.graph}constructor(t){super(),this.options=t;const e=this.graph.getPlugin("scroller");this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=ri.createMousetrap(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,s){this.mousetrap.bind(this.getKeys(t),e,s)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}clear(){this.mousetrap.reset()}trigger(t,e){this.mousetrap.trigger(t,e)}focus(t){if(this.isInputEvent(t.e))return;this.target.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(e=>this.formatkey(e))}formatkey(t){const e=t.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),s=this.options.format;return s?X(s,this.graph,e):e}isGraphEvent(t){const e=t.target,s=t.currentTarget;return e?e===this.target||s===this.target||e===document.body?!0:Iu(this.container,e):!1}isInputEvent(t){var e;const s=t.target,r=(e=s==null?void 0:s.tagName)===null||e===void 0?void 0:e.toLowerCase();let i=["input","textarea"].includes(r);return ut(s,"contenteditable")==="true"&&(i=!0),i}isEnabledForEvent(t){const e=!this.disabled&&this.isGraphEvent(t),s=this.isInputEvent(t);if(e){if(s&&(t.key==="Backspace"||t.key==="Delete"))return!1;if(this.options.guard)return X(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}mj([ye.dispose()],ri.prototype,"dispose",null),function(n){function t(e){const s=new pj(e.target),r=s.stopCallback;return s.stopCallback=(i,o,a)=>e.isEnabledForEvent(i)?r?r.call(s,i,o,a):!1:!0,s}n.createMousetrap=t}(ri||(ri={})),L.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},L.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},L.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},L.prototype.toggleKeyboard=function(n){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(n),this},L.prototype.bindKey=function(n,t,e){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,t,e),this},L.prototype.unbindKey=function(n,t){const e=this.getPlugin("keyboard");return e&&e.unbindKey(n,t),this},L.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},L.prototype.triggerKey=function(n,t){const e=this.getPlugin("keyboard");return e&&e.trigger(n,t),this};var yj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class zb extends ye{constructor(t={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},t)}init(t){this.keyboardImpl=new ri(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(t,e,s){return this.keyboardImpl.on(t,e,s),this}trigger(t,e){return this.keyboardImpl.trigger(t,e),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(t,e){return this.keyboardImpl.off(t,e),this}dispose(){this.keyboardImpl.dispose()}}yj([ye.dispose()],zb.prototype,"dispose",null);var bj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},wj=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Fb extends pt{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(t){super();const{graph:e}=t,s=wj(t,["graph"]);this.graph=e,this.options=Object.assign({},s),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t}render(){const t=this.containerWrapper=new tt("svg"),e=this.horizontal=new tt("line"),s=this.vertical=new tt("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),s.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),s.setAttribute("display","none"),t.append([e,s]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:t,data:e}){t==="resize"&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:s}){const r=t.getDelegatedView();if(r&&this.isNodeMovable(r)){const i=t.cell.getPosition();this.offset={x:e-i.x,y:s-i.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}getRestrictArea(t){const e=this.graph.options.translating.restrict,s=typeof e=="function"?X(e,this.graph,t):e;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const s=this.graph.renderer.findViewByCell(t);if(s&&s.cell.isNode()){const r=t.getBBox(),i=r.bbox(t.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),l=gt.normalize(t.getAngle()),u=this.options.tolerance||0;let h,f,d,g,p,m;const y={vertical:0,horizontal:0},b=e.direction,w=e.trueDirection,x=e.relativeDirection;w.indexOf("right")!==-1?y.vertical=a.x:y.vertical=o.x,w.indexOf("bottom")!==-1?y.horizontal=a.y:y.horizontal=o.y,this.model.getNodes().some(k=>{if(this.isIgnored(t,k))return!1;const R=k.getBBox().bbox(k.getAngle()),I=R.getTopLeft(),A=R.getBottomRight(),P={vertical:[I.x,A.x],horizontal:[I.y,A.y]},B={};return Object.keys(P).forEach(j=>{const Y=j,ot=P[Y].map(F=>({position:F,distance:Math.abs(F-y[Y])})).filter(F=>F.distance<=u);B[Y]=Mc(ot,F=>F.distance)}),h==null&&B.vertical.length>0&&(h=B.vertical[0].position,f=Math.min(i.y,R.y),d=Math.max(a.y,A.y)-f),g==null&&B.horizontal.length>0&&(g=B.horizontal[0].position,p=Math.min(i.x,R.x),m=Math.max(a.x,A.x)-p),h!=null&&g!=null}),this.hide();let v=0,S=0;(g!=null||h!=null)&&(h!=null&&(v=w.indexOf("right")!==-1?h-a.x:o.x-h),g!=null&&(S=w.indexOf("bottom")!==-1?g-a.y:o.y-g));let E=0,C=0;if(l%90===0)l===90||l===270?(E=S,C=v):(E=v,C=S);else{const k=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;g!=null&&h!=null&&(v<S?(S=0,g=void 0):(v=0,h=void 0));const R=gt.toRad(l%90);v&&(E=k===3?v/Math.cos(R):v/Math.sin(R)),S&&(C=k===3?S/Math.cos(R):S/Math.sin(R));const I=k===1||k===3;switch(x){case"top":case"bottom":C=S?S/(I?Math.cos(R):Math.sin(R)):v/(I?Math.sin(R):Math.cos(R));break;case"left":case"right":E=v?v/(I?Math.cos(R):Math.sin(R)):S/(I?Math.sin(R):Math.cos(R));break}}switch(x){case"top":case"bottom":E=0;break;case"left":case"right":C=0;break}const M=this.graph.getGridSize();let T=Math.max(r.width+E,M),_=Math.max(r.height+C,M);e.minWidth&&e.minWidth>M&&(T=Math.max(T,e.minWidth)),e.minHeight&&e.minHeight>M&&(_=Math.max(_,e.minHeight)),e.maxWidth&&(T=Math.min(T,e.maxWidth)),e.maxHeight&&(_=Math.min(_,e.maxHeight)),e.preserveAspectRatio&&(C<E?_=T*(r.height/r.width):T=_*(r.width/r.height)),(T!==r.width||_!==r.height)&&(t.resize(T,_,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),d&&(d+=_-r.height),m&&(m+=T-r.width));const N=t.getBBox().bbox(l);h&&Math.abs(N.x-h)>1&&Math.abs(N.width+N.x-h)>1&&(h=void 0),g&&Math.abs(N.y-g)>1&&Math.abs(N.height+N.y-g)>1&&(g=void 0),this.update({verticalLeft:h,verticalTop:f,verticalHeight:d,horizontalTop:g,horizontalLeft:p,horizontalWidth:m})}}}snapOnMoving({view:t,e,x:s,y:r}){const i=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),l=o.getPosition(),u=new z(s-this.offset.x,r-this.offset.y,a.width,a.height),h=o.getAngle(),f=u.getCenter(),d=u.bbox(h),g=d.getTopLeft(),p=d.getBottomRight(),m=this.options.tolerance||0;let y,b,w,x,v,S,E=0,C=0;if(this.model.getNodes().some(M=>{if(this.isIgnored(o,M))return!1;const T=M.getBBox().bbox(M.getAngle()),_=T.getCenter(),N=T.getTopLeft(),k=T.getBottomRight();return y==null&&(Math.abs(_.x-f.x)<m?(y=_.x,E=.5):Math.abs(N.x-g.x)<m?(y=N.x,E=0):Math.abs(N.x-p.x)<m?(y=N.x,E=1):Math.abs(k.x-p.x)<m?(y=k.x,E=1):Math.abs(k.x-g.x)<m&&(y=k.x),y!=null&&(b=Math.min(d.y,T.y),w=Math.max(p.y,k.y)-b)),x==null&&(Math.abs(_.y-f.y)<m?(x=_.y,C=.5):Math.abs(N.y-g.y)<m?x=N.y:Math.abs(N.y-p.y)<m?(x=N.y,C=1):Math.abs(k.y-p.y)<m?(x=k.y,C=1):Math.abs(k.y-g.y)<m&&(x=k.y),x!=null&&(v=Math.min(d.x,T.x),S=Math.max(p.x,k.x)-v)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(d.y=x-C*d.height),y!=null&&(d.x=y-E*d.width);const M=d.getCenter(),T=M.x-u.width/2,_=M.y-u.height/2,N=T-l.x,k=_-l.y;(N!==0||k!==0)&&(o.translate(N,k,{snapped:!0,restrict:this.getRestrictArea(i)}),S&&(S+=N),w&&(w+=k)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:v,horizontalWidth:S})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||!this.filter(e)}filter(t){const e=this.options.filter;return Array.isArray(e)?e.some(s=>typeof s=="string"?t.shape===s:t.id===s.id):typeof e=="function"?X(e,this.graph,t):!0}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new O(t.horizontalLeft,t.horizontalTop)),s=this.graph.localToGraph(new O(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${s.x}`:"100%",y2:`${s.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new O(t.verticalLeft,t.verticalTop)),s=this.graph.localToGraph(new O(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${s.x}`,y2:this.options.sharp?`${s.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),this.container.parentNode==null&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e=typeof t=="number"?t:t!==!1?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}bj([pt.dispose()],Fb.prototype,"dispose",null);const xj=`.x6-widget-snapline {
|
|
661
661
|
position: absolute;
|
|
662
662
|
top: 0;
|
|
663
663
|
right: 0;
|
|
@@ -670,7 +670,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
670
670
|
stroke: #2ecc71;
|
|
671
671
|
stroke-width: 1px;
|
|
672
672
|
}
|
|
673
|
-
`;I.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},I.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},I.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},I.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},I.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},I.prototype.setSnaplineFilter=function(n){const t=this.getPlugin("snapline");return t&&t.setFilter(n),this},I.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},I.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},I.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},I.prototype.toggleSnaplineOnResizing=function(n){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(n),this},I.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},I.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},I.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},I.prototype.toggleSharpSnapline=function(n){const t=this.getPlugin("snapline");return t&&t.toggleSharp(n),this},I.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},I.prototype.setSnaplineTolerance=function(n){const t=this.getPlugin("snapline");return t&&t.setTolerance(n),this};var sj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class jb extends ye{constructor(t={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},t),jr(this.name,nj)}init(t){this.snaplineImpl=new Vb(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(t){if(t!=null)t!==this.isEnabled()&&(t?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(t){return this.snaplineImpl.setFilter(t),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(t){return t!=null?t!==this.isOnResizingEnabled()&&(t?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(t){return t!=null?t!==this.isSharp()&&(t?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(t){return this.snaplineImpl.options.tolerance=t,this}captureCursorOffset(t){this.snaplineImpl.captureCursorOffset(t)}snapOnMoving(t){this.snaplineImpl.snapOnMoving(t)}dispose(){this.snaplineImpl.dispose(),$r(this.name)}}sj([ye.dispose()],jb.prototype,"dispose",null);class rj{constructor(){this.cells=[]}copy(t,e,s={}){this.options=Object.assign({},s);const i=(Zt.isModel(e)?e:e.model).cloneSubGraph(t,s);this.cells=Pc(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(t,e,s={}){this.copy(t,e,s),(I.isGraph(e)?e.model:e).batchUpdate("cut",()=>{t.forEach(i=>i.remove())})}paste(t,e={}){const s=Object.assign(Object.assign({},this.options),e),{offset:r,edgeProps:i,nodeProps:o}=s;let a=20,l=20;r&&(a=typeof r=="number"?r:r.dx,l=typeof r=="number"?r:r.dy),this.deserialize(s);const u=this.cells;u.forEach(f=>{f.model=null,f.removeProp("zIndex"),(a||l)&&f.translate(a,l),o&&f.isNode()&&f.prop(o),i&&f.isEdge()&&f.prop(i)});const h=I.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(u,t,e),u}serialize(t){t.useLocalStorage!==!1&&mo.save(this.cells)}deserialize(t){if(t.useLocalStorage){const e=mo.fetch();e&&(this.cells=e)}}isEmpty(t={}){return t.useLocalStorage&&this.deserialize(t),this.cells.length<=0}clean(){this.options={},this.cells=[],mo.clean()}}var mo;(function(n){const t=`${Ue.prefixCls}.clipboard.cells`;function e(i){if(window.localStorage){const o=i.map(a=>a.toJSON());localStorage.setItem(t,JSON.stringify(o))}}n.save=e;function s(){if(window.localStorage){const i=localStorage.getItem(t),o=i?JSON.parse(i):[];if(o)return Zt.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(t)}n.clean=r})(mo||(mo={})),I.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},I.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},I.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},I.prototype.toggleClipboard=function(n){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(n),this},I.prototype.isClipboardEmpty=function(n){const t=this.getPlugin("clipboard");return t?t.isEmpty(n):!0},I.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},I.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},I.prototype.copy=function(n,t){const e=this.getPlugin("clipboard");return e&&e.copy(n,t),this},I.prototype.cut=function(n,t){const e=this.getPlugin("clipboard");return e&&e.cut(n,t),this},I.prototype.paste=function(n,t){const e=this.getPlugin("clipboard");return e?e.paste(n,t):[]};var ij=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},oj=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class $b extends Nt{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(t={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},t)}init(t){this.graph=t,this.clipboardImpl=new rj,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(t={}){return this.clipboardImpl.isEmpty(t)}getCellsInClipboard(){return this.cells}clean(t){return(!this.disabled||t)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(t,e={}){return this.disabled||(this.clipboardImpl.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}cut(t,e={}){return this.disabled||(this.clipboardImpl.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}paste(t={},e=this.graph){return this.disabled?[]:this.clipboardImpl.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}get commonOptions(){const t=this.options;return oj(t,["enabled"])}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.clean(!0),this.off()}}ij([Nt.dispose()],$b.prototype,"dispose",null);var zb={exports:{}};(function(n){(function(t,e,s){if(!t)return;for(var r={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},a={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function h(C,M,T){if(C.addEventListener){C.addEventListener(M,T,!1);return}C.attachEvent("on"+M,T)}function f(C){if(C.type=="keypress"){var M=String.fromCharCode(C.which);return C.shiftKey||(M=M.toLowerCase()),M}return r[C.which]?r[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function d(C,M){return C.sort().join(",")===M.sort().join(",")}function g(C){var M=[];return C.shiftKey&&M.push("shift"),C.altKey&&M.push("alt"),C.ctrlKey&&M.push("ctrl"),C.metaKey&&M.push("meta"),M}function p(C){if(C.preventDefault){C.preventDefault();return}C.returnValue=!1}function m(C){if(C.stopPropagation){C.stopPropagation();return}C.cancelBubble=!0}function y(C){return C=="shift"||C=="ctrl"||C=="alt"||C=="meta"}function b(){if(!l){l={};for(var C in r)C>95&&C<112||r.hasOwnProperty(C)&&(l[r[C]]=C)}return l}function w(C,M,T){return T||(T=b()[C]?"keydown":"keypress"),T=="keypress"&&M.length&&(T="keydown"),T}function x(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function v(C,M){var T,k,_,D=[];for(T=x(C),_=0;_<T.length;++_)k=T[_],a[k]&&(k=a[k]),M&&M!="keypress"&&o[k]&&(k=o[k],D.push("shift")),y(k)&&D.push(k);return M=w(k,D,M),{key:k,modifiers:D,action:M}}function S(C,M){return C===null||C===e?!1:C===M?!0:S(C.parentNode,M)}function E(C){var M=this;if(C=C||e,!(M instanceof E))return new E(C);M.target=C,M._callbacks={},M._directMap={};var T={},k,_=!1,D=!1,N=!1;function j(F){F=F||{};var H=!1,B;for(B in T){if(F[B]){H=!0;continue}T[B]=0}H||(N=!1)}function A(F,H,B,K,nt,rt){var et,ft,ge=[],St=B.type;if(!M._callbacks[F])return[];for(St=="keyup"&&y(F)&&(H=[F]),et=0;et<M._callbacks[F].length;++et)if(ft=M._callbacks[F][et],!(!K&&ft.seq&&T[ft.seq]!=ft.level)&&St==ft.action&&(St=="keypress"&&!B.metaKey&&!B.ctrlKey||d(H,ft.modifiers))){var xt=!K&&ft.combo==nt,An=K&&ft.seq==K&&ft.level==rt;(xt||An)&&M._callbacks[F].splice(et,1),ge.push(ft)}return ge}function P(F,H,B,K){M.stopCallback(H,H.target||H.srcElement,B,K)||F(H,B)===!1&&(p(H),m(H))}M._handleKey=function(F,H,B){var K=A(F,H,B),nt,rt={},et=0,ft=!1;for(nt=0;nt<K.length;++nt)K[nt].seq&&(et=Math.max(et,K[nt].level));for(nt=0;nt<K.length;++nt){if(K[nt].seq){if(K[nt].level!=et)continue;ft=!0,rt[K[nt].seq]=1,P(K[nt].callback,B,K[nt].combo,K[nt].seq);continue}ft||P(K[nt].callback,B,K[nt].combo)}var ge=B.type=="keypress"&&D;B.type==N&&!y(F)&&!ge&&j(rt),D=ft&&B.type=="keydown"};function L(F){typeof F.which!="number"&&(F.which=F.keyCode);var H=f(F);if(H){if(F.type=="keyup"&&_===H){_=!1;return}M.handleKey(H,g(F),F)}}function V(){clearTimeout(k),k=setTimeout(j,1e3)}function Y(F,H,B,K){T[F]=0;function nt(St){return function(){N=St,++T[F],V()}}function rt(St){P(B,St,F),K!=="keyup"&&(_=f(St)),setTimeout(j,10)}for(var et=0;et<H.length;++et){var ft=et+1===H.length,ge=ft?rt:nt(K||v(H[et+1]).action);ot(H[et],ge,K,F,et)}}function ot(F,H,B,K,nt){M._directMap[F+":"+B]=H,F=F.replace(/\s+/g," ");var rt=F.split(" "),et;if(rt.length>1){Y(F,rt,H,B);return}et=v(F,B),M._callbacks[et.key]=M._callbacks[et.key]||[],A(et.key,et.modifiers,{type:et.action},K,F,nt),M._callbacks[et.key][K?"unshift":"push"]({callback:H,modifiers:et.modifiers,action:et.action,seq:K,level:nt,combo:F})}M._bindMultiple=function(F,H,B){for(var K=0;K<F.length;++K)ot(F[K],H,B)},h(C,"keypress",L),h(C,"keydown",L),h(C,"keyup",L)}E.prototype.bind=function(C,M,T){var k=this;return C=C instanceof Array?C:[C],k._bindMultiple.call(k,C,M,T),k},E.prototype.unbind=function(C,M){var T=this;return T.bind.call(T,C,function(){},M)},E.prototype.trigger=function(C,M){var T=this;return T._directMap[C+":"+M]&&T._directMap[C+":"+M]({},C),T},E.prototype.reset=function(){var C=this;return C._callbacks={},C._directMap={},C},E.prototype.stopCallback=function(C,M){var T=this;if((" "+M.className+" ").indexOf(" mousetrap ")>-1||S(M,T.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var k=C.composedPath()[0];k!==C.target&&(M=k)}return M.tagName=="INPUT"||M.tagName=="SELECT"||M.tagName=="TEXTAREA"||M.isContentEditable},E.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},E.addKeycodes=function(C){for(var M in C)C.hasOwnProperty(M)&&(r[M]=C[M]);l=null},E.init=function(){var C=E(e);for(var M in C)M.charAt(0)!=="_"&&(E[M]=function(T){return function(){return C[T].apply(C,arguments)}}(M))},E.init(),t.Mousetrap=E,n.exports&&(n.exports=E)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(zb);var aj=zb.exports;const lj=k_(aj);var cj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ri extends ye{get graph(){return this.options.graph}constructor(t){super(),this.options=t;const e=this.graph.getPlugin("scroller");this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=ri.createMousetrap(this)}get disabled(){return this.options.enabled!==!0}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,s){this.mousetrap.bind(this.getKeys(t),e,s)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}clear(){this.mousetrap.reset()}trigger(t,e){this.mousetrap.trigger(t,e)}focus(t){if(this.isInputEvent(t.e))return;this.target.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(e=>this.formatkey(e))}formatkey(t){const e=t.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),s=this.options.format;return s?X(s,this.graph,e):e}isGraphEvent(t){const e=t.target,s=t.currentTarget;return e?e===this.target||s===this.target||e===document.body?!0:Iu(this.container,e):!1}isInputEvent(t){var e;const s=t.target,r=(e=s==null?void 0:s.tagName)===null||e===void 0?void 0:e.toLowerCase();let i=["input","textarea"].includes(r);return ut(s,"contenteditable")==="true"&&(i=!0),i}isEnabledForEvent(t){const e=!this.disabled&&this.isGraphEvent(t),s=this.isInputEvent(t);if(e){if(s&&(t.key==="Backspace"||t.key==="Delete"))return!1;if(this.options.guard)return X(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}cj([ye.dispose()],ri.prototype,"dispose",null),function(n){function t(e){const s=new lj(e.target),r=s.stopCallback;return s.stopCallback=(i,o,a)=>e.isEnabledForEvent(i)?r?r.call(s,i,o,a):!1:!0,s}n.createMousetrap=t}(ri||(ri={})),I.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},I.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},I.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},I.prototype.toggleKeyboard=function(n){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(n),this},I.prototype.bindKey=function(n,t,e){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,t,e),this},I.prototype.unbindKey=function(n,t){const e=this.getPlugin("keyboard");return e&&e.unbindKey(n,t),this},I.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},I.prototype.triggerKey=function(n,t){const e=this.getPlugin("keyboard");return e&&e.trigger(n,t),this};var uj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Fb extends ye{constructor(t={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},t)}init(t){this.keyboardImpl=new ri(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(t,e,s){return this.keyboardImpl.on(t,e,s),this}trigger(t,e){return this.keyboardImpl.trigger(t,e),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(t,e){return this.keyboardImpl.off(t,e),this}dispose(){this.keyboardImpl.dispose()}}uj([ye.dispose()],Fb.prototype,"dispose",null);var hj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Hb extends pt{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Oe.classNames.box)}get $boxes(){return dR(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(t){super(),this.options=t,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new pl([],{comparator:Oe.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:s,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a,snapped:l}=e,u=(s!==!0||r&&this.getPointerEventsValue(r)==="none")&&!this.translating&&!o,h=i&&a&&t.id===a;if(u&&(h||l)){this.translating=!0;const f=t.position(),d=t.previous("position"),g=f.x-d.x,p=f.y-d.y;(g!==0||p!==0)&&this.translateSelectedNodes(g,p,t,e),this.translating=!1}}onModelUpdated({removed:t}){t&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const s=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(s,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){if(e.batch){const u=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(u,Object.assign(Object.assign({},e),{ui:!0})),this}const s=this.cells,r=this.filter(Array.isArray(t)?t:[t]),i={},o={};s.forEach(u=>i[u.id]=u),r.forEach(u=>o[u.id]=u);const a=[],l=[];return r.forEach(u=>{i[u.id]||a.push(u)}),s.forEach(u=>{o[u.id]||l.push(u)}),l.length&&this.unselect(l,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),l.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(e)}clean(t={}){return this.length&&(t.batch===!1?this.unselect(this.cells,t):this.collection.reset([],Object.assign(Object.assign({},t),{ui:!0}))),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){t=this.normalizeEvent(t),this.clean();let e,s;const r=this.graph.container;if(t.offsetX!=null&&t.offsetY!=null&&r.contains(t.target))e=t.offsetX,s=t.offsetY;else{const i=Gu(r),o=r.scrollLeft,a=r.scrollTop;e=t.clientX-i.left+window.pageXOffset+o,s=t.clientY-i.top+window.pageYOffset+a}qt(this.container,{top:s,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:s,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Oe.documentEvents,t.data)}filter(t){const e=this.options.filter;return t.filter(s=>Array.isArray(e)?e.some(r=>typeof r=="string"?s.shape===r:s.id===r.id):typeof e=="function"?X(e,this.graph,s):!0)}stopSelecting(t){const e=this.graph,s=this.getEventData(t);switch(s.action){case"selecting":{let i=WR(this.container),o=qR(this.container);const a=Gu(this.container),l=e.pageToLocal(a.left,a.top),u=e.transform.getScale();i/=u.sx,o/=u.sy;const h=new z(l.x,l.y,i,o),f=this.getCellViewsInArea(h).map(d=>d.cell);this.reset(f,{batch:!0}),this.hideRubberband();break}case"translating":{const i=e.snapToGrid(t.clientX,t.clientY);if(!this.options.following){const o=s;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",t,i.x,i.y);break}default:{this.clean();break}}}onMouseUp(t){this.getEventData(t).action&&(this.stopSelecting(t),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(t){this.options.following||t.stopPropagation();const e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);const s=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:s});const r=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,r.x,r.y),this.delegateDocumentEvents(Oe.documentEvents,e.data)}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})}getRestrictArea(){const t=this.graph.options.translating.restrict,e=typeof t=="function"?X(t,this.graph,null):t;return typeof e=="number"?this.graph.transform.getGraphArea().inflate(e):e===!0?this.graph.transform.getGraphArea():e||null}getSelectionOffset(t,e){let s=t.x-e.clientX,r=t.y-e.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=ht.getCellsBBox(o,{deep:!0})||z.create(),l=i.x-a.x,u=i.y-a.y,h=i.x+i.width-(a.x+a.width),f=i.y+i.height-(a.y+a.height);if(s<l&&(s=l),r<u&&(r=u),h<s&&(s=h),f<r&&(r=f),!this.options.following){const d=t.x-e.originX,g=t.y-e.originY;s=d<=l||d>=h?0:s,r=g<=u||g>=f?0:r}}return{dx:s,dy:r}}updateElementPosition(t,e,s){const r=qt(t,"left"),i=qt(t,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;qt(t,"left",o+e),qt(t,"top",a+s)}updateSelectedNodesPosition(t){const{dx:e,dy:s}=t;if(e||s)if(this.translateSelectedNodes(e,s),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const r=this.graph.transform.getScale();for(let i=0,o=this.$boxes,a=o.length;i<a;i+=1)this.updateElementPosition(o[i],e*r.sx,s*r.sy);this.updateElementPosition(this.selectionContainer,e*r.sx,s*r.sy)}}autoScrollGraph(t,e){const s=this.graph.getPlugin("scroller");return s?s.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),s=this.getEventData(e);switch(s.action){case"selecting":{const i=s;i.moving!==!0&&(ps(this.container,this.graph.container),this.showRubberband(),i.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(e.clientX,e.clientY);i.scrollerX+=o,i.scrollerY+=a;const l=e.clientX-i.clientX+i.scrollerX,u=e.clientY-i.clientY+i.scrollerY,h=parseInt(qt(this.container,"left")||"0",10),f=parseInt(qt(this.container,"top")||"0",10);qt(this.container,{left:l<0?i.offsetX+l:h,top:u<0?i.offsetY+u:f,width:Math.abs(l),height:Math.abs(u)});break}case"translating":{const i=this.graph.snapToGrid(e.clientX,e.clientY),o=s,a=this.getSelectionOffset(i,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=i.x),a.dy&&(o.clientY=i.y),this.notifyBoxEvent("box:mousemove",t,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,s,r){const i={},o=[];if(s&&(i[s.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(l=>{i[l.id]=!0})}),r&&r.translateBy){const a=this.graph.getCellById(r.translateBy);a&&(i[a.id]=!0,a.getDescendants({deep:!0}).forEach(l=>{i[l.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!i[a.id]){const l=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});a.translate(t,e,l),this.graph.model.getConnectedEdges(a).forEach(u=>{i[u.id]||(u.translate(t,e,l),i[u.id]=!0)})}})}getCellViewsInArea(t){const e=this.graph,s={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(e.model.getNodesInArea(t,s).map(i=>e.renderer.findViewByCell(i)).filter(i=>i!=null))),this.options.rubberEdge&&(r=r.concat(e.model.getEdgesInArea(t,s).map(i=>e.renderer.findViewByCell(i)).filter(i=>i!=null))),r}notifyBoxEvent(t,e,s,r){const o=this.getEventData(e).activeView;this.trigger(t,{e,view:o,x:s,y:r,cell:o.cell})}getSelectedClassName(t){return this.prefixClassName(`${t.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(ze(this.container.querySelector(`[data-cell-id="${t.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),ze(this.$boxes),this.boxCount=0}hide(){Dt(this.container,this.prefixClassName(Oe.classNames.rubberband)),Dt(this.container,this.prefixClassName(Oe.classNames.selected))}showRubberband(){J(this.container,this.prefixClassName(Oe.classNames.rubberband))}hideRubberband(){Dt(this.container,this.prefixClassName(Oe.classNames.rubberband))}showSelected(){Bu(this.container,"style"),J(this.container,this.prefixClassName(Oe.classNames.selected))}createContainer(){this.container=document.createElement("div"),J(this.container,this.prefixClassName(Oe.classNames.root)),this.options.className&&J(this.container,this.options.className),this.selectionContainer=document.createElement("div"),J(this.selectionContainer,this.prefixClassName(Oe.classNames.inner)),this.selectionContent=document.createElement("div"),J(this.selectionContent,this.prefixClassName(Oe.classNames.content)),Ne(this.selectionContainer,this.selectionContent),ut(this.selectionContainer,"data-selection-length",this.collection.length),iy(this.container,this.selectionContainer)}updateContainerPosition(t){(t.dx||t.dy)&&this.updateElementPosition(this.selectionContainer,t.dx,t.dy)}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0};this.collection.toArray().filter(i=>this.canShowSelectionBox(i)).forEach(i=>{const o=this.graph.renderer.findViewByCell(i);if(o){const a=o.getBBox({useCellGeometry:!0});t.x=Math.min(t.x,a.x),t.y=Math.min(t.y,a.y),e.x=Math.max(e.x,a.x+a.width),e.y=Math.max(e.y,a.y+a.height)}}),qt(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}),ut(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=X(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?ps(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&this.options.showNodeSelectionBox===!0||t.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(t){return typeof t=="string"?t:t(this.cells)}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const s=e.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;J(i,r),J(i,`${r}-${t.isNode()?"node":"edge"}`),ut(i,"data-cell-id",t.id),qt(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),ps(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let t=0,e=this.$boxes,s=e.length;t<s;t+=1){const r=e[t],i=ut(r,"data-cell-id");ze(r),this.boxCount-=1;const o=this.collection.get(i);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const s=this.collection.get(e);if(s)return this.graph.renderer.findViewByCell(s)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(s=>{this.listenCellRemoveEvent(s),this.createSelectionBox(s)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:s}){t.forEach(i=>{this.trigger("cell:selected",{cell:i,options:s}),i.isNode()?this.trigger("node:selected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:selected",{cell:i,options:s,edge:i})}),e.forEach(i=>{this.trigger("cell:unselected",{cell:i,options:s}),i.isNode()?this.trigger("node:unselected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:unselected",{cell:i,options:s,edge:i})});const r={added:t,removed:e,options:s,selected:this.cells.filter(i=>!!this.graph.getCellById(i.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}hj([pt.dispose()],Hb.prototype,"dispose",null);var Oe;(function(n){const t="widget-selection";n.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function e(s){return s.getAncestors().length}n.depthComparator=e})(Oe||(Oe={}));const dj=`.x6-widget-selection {
|
|
673
|
+
`;L.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},L.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},L.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},L.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},L.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},L.prototype.setSnaplineFilter=function(n){const t=this.getPlugin("snapline");return t&&t.setFilter(n),this},L.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},L.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},L.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},L.prototype.toggleSnaplineOnResizing=function(n){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(n),this},L.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},L.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},L.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},L.prototype.toggleSharpSnapline=function(n){const t=this.getPlugin("snapline");return t&&t.toggleSharp(n),this},L.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},L.prototype.setSnaplineTolerance=function(n){const t=this.getPlugin("snapline");return t&&t.setTolerance(n),this};var vj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Hb extends ye{constructor(t={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},t),jr(this.name,xj)}init(t){this.snaplineImpl=new Fb(Object.assign(Object.assign({},this.options),{graph:t}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(t){if(t!=null)t!==this.isEnabled()&&(t?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(t){return this.snaplineImpl.setFilter(t),this}isOnResizingEnabled(){return this.snaplineImpl.options.resizing===!0}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(t){return t!=null?t!==this.isOnResizingEnabled()&&(t?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return this.snaplineImpl.options.sharp===!0}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(t){return t!=null?t!==this.isSharp()&&(t?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(t){return this.snaplineImpl.options.tolerance=t,this}captureCursorOffset(t){this.snaplineImpl.captureCursorOffset(t)}snapOnMoving(t){this.snaplineImpl.snapOnMoving(t)}dispose(){this.snaplineImpl.dispose(),$r(this.name)}}vj([ye.dispose()],Hb.prototype,"dispose",null);class Cj{constructor(){this.cells=[]}copy(t,e,s={}){this.options=Object.assign({},s);const i=(Zt.isModel(e)?e:e.model).cloneSubGraph(t,s);this.cells=Mc(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(t,e,s={}){this.copy(t,e,s),(L.isGraph(e)?e.model:e).batchUpdate("cut",()=>{t.forEach(i=>i.remove())})}paste(t,e={}){const s=Object.assign(Object.assign({},this.options),e),{offset:r,edgeProps:i,nodeProps:o}=s;let a=20,l=20;r&&(a=typeof r=="number"?r:r.dx,l=typeof r=="number"?r:r.dy),this.deserialize(s);const u=this.cells;u.forEach(f=>{f.model=null,f.removeProp("zIndex"),(a||l)&&f.translate(a,l),o&&f.isNode()&&f.prop(o),i&&f.isEdge()&&f.prop(i)});const h=L.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(u,t,e),u}serialize(t){t.useLocalStorage!==!1&&mo.save(this.cells)}deserialize(t){if(t.useLocalStorage){const e=mo.fetch();e&&(this.cells=e)}}isEmpty(t={}){return t.useLocalStorage&&this.deserialize(t),this.cells.length<=0}clean(){this.options={},this.cells=[],mo.clean()}}var mo;(function(n){const t=`${Ue.prefixCls}.clipboard.cells`;function e(i){if(window.localStorage){const o=i.map(a=>a.toJSON());localStorage.setItem(t,JSON.stringify(o))}}n.save=e;function s(){if(window.localStorage){const i=localStorage.getItem(t),o=i?JSON.parse(i):[];if(o)return Zt.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(t)}n.clean=r})(mo||(mo={})),L.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},L.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},L.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},L.prototype.toggleClipboard=function(n){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(n),this},L.prototype.isClipboardEmpty=function(n){const t=this.getPlugin("clipboard");return t?t.isEmpty(n):!0},L.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},L.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},L.prototype.copy=function(n,t){const e=this.getPlugin("clipboard");return e&&e.copy(n,t),this},L.prototype.cut=function(n,t){const e=this.getPlugin("clipboard");return e&&e.cut(n,t),this},L.prototype.paste=function(n,t){const e=this.getPlugin("clipboard");return e?e.paste(n,t):[]};var Sj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Ej=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(e[s[r]]=n[s[r]]);return e};class Ub extends Nt{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(t={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},t)}init(t){this.graph=t,this.clipboardImpl=new Cj,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(t={}){return this.clipboardImpl.isEmpty(t)}getCellsInClipboard(){return this.cells}clean(t){return(!this.disabled||t)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(t,e={}){return this.disabled||(this.clipboardImpl.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}cut(t,e={}){return this.disabled||(this.clipboardImpl.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.notify("clipboard:changed",{cells:t})),this}paste(t={},e=this.graph){return this.disabled?[]:this.clipboardImpl.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}get commonOptions(){const t=this.options;return Ej(t,["enabled"])}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.clean(!0),this.off()}}Sj([Nt.dispose()],Ub.prototype,"dispose",null),L.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},L.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},L.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},L.prototype.toggleHistory=function(n){const t=this.getPlugin("history");return t&&t.toggleEnabled(n),this},L.prototype.undo=function(n){const t=this.getPlugin("history");return t&&t.undo(n),this},L.prototype.redo=function(n){const t=this.getPlugin("history");return t&&t.redo(n),this},L.prototype.undoAndCancel=function(n){const t=this.getPlugin("history");return t&&t.cancel(n),this},L.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},L.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},L.prototype.cleanHistory=function(n){const t=this.getPlugin("history");return t&&t.clean(n),this},L.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},L.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},L.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},L.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var Gb=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ii extends Nt{constructor(t={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:e=0}=t;this.stackSize=e,this.options=It.getOptions(t),this.validator=new ii.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(t){this.graph=t,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStackPush(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const t=this.undoStack.length;return this.stackSize-t}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}get disabled(){return this.options.enabled!==!0}validate(t,...e){return this.validator.validate(t,...e),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:t?t.batch:!1,data:{}}}revertCommand(t,e){this.freezed=!0;const s=Array.isArray(t)?It.sortBatchCommands(t):[t];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},e),Oc(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const s=Array.isArray(t)?It.sortBatchCommands(t):[t];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},e),Oc(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,o)}this.freezed=!1}executeCommand(t,e,s){const r=this.model,i=r.getCell(t.data.id),o=t.event;if(It.isAddEvent(o)&&e||It.isRemoveEvent(o)&&!e)i&&i.remove(s);else if(It.isAddEvent(o)&&!e||It.isRemoveEvent(o)&&e){const a=t.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(It.isChangeEvent(o)){const a=t.data,l=a.key;if(l&&i){const u=e?a.prev[l]:a.next[l];a.key==="attrs"&&this.ensureUndefinedAttrs(u,e?a.next[l]:a.prev[l])&&(s.dirty=!0),i.prop(l,u,s)}}else{const a=this.options.executeCommand;a&&X(a,this,t,e,s)}}addCommand(t,e){if(this.freezed||this.disabled)return;const s=e,r=s.options||{};if(r.dryrun||It.isAddEvent(t)&&this.options.ignoreAdd||It.isRemoveEvent(t)&&this.options.ignoreRemove||It.isChangeEvent(t)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&X(i,this,t,e)===!1)return;t==="cell:change:*"&&(t=`cell:change:${s.key}`);const o=s.cell,a=Zt.isModel(o);let l;if(this.batchCommands){l=this.batchCommands[Math.max(this.lastBatchIndex,0)];const h=a&&!l.modelChange||l.data.id!==o.id,f=l.event!==t;if(this.lastBatchIndex>=0&&(h||f)){const d=this.batchCommands.findIndex(g=>(a&&g.modelChange||g.data.id===o.id)&&g.event===t);d<0||It.isAddEvent(t)||It.isRemoveEvent(t)?l=this.createCommand({batch:!0}):(l=this.batchCommands[d],this.batchCommands.splice(d,1)),this.batchCommands.push(l),this.lastBatchIndex=this.batchCommands.length-1}}else l=this.createCommand({batch:!1});if(It.isAddEvent(t)||It.isRemoveEvent(t)){const h=l.data;return l.event=t,l.options=r,h.id=o.id,h.props=Tt(o.toJSON()),o.isEdge()?h.edge=!0:o.isNode()&&(h.node=!0),this.push(l,r)}if(It.isChangeEvent(t)){const h=e.key,f=l.data;return(!l.batch||!l.event)&&(l.event=t,l.options=r,f.key=h,f.prev==null&&(f.prev={}),f.prev[h]=Tt(o.previous(h)),a?l.modelChange=!0:f.id=o.id),f.next==null&&(f.next={}),f.next[h]=Tt(o.prop(h)),this.push(l,r)}const u=this.options.afterAddCommand;u&&X(u,this,t,e,l),this.push(l,r)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const s=[];for(;e.length>0;){const r=e.shift(),i=r.event,o=r.data.id;if(i!=null&&(o!=null||r.modelChange)){if(It.isAddEvent(i)){const a=e.findIndex(l=>It.isRemoveEvent(l.event)&&l.data.id===o);if(a>=0){e=e.filter((l,u)=>a<u||l.data.id!==o);continue}}else if(It.isRemoveEvent(i)){const a=e.findIndex(l=>It.isAddEvent(l.event)&&l.data.id===o);if(a>=0){e.splice(a,1);continue}}else if(It.isChangeEvent(i)){const a=r.data;if(wn(a.prev,a.next))continue}s.push(r)}}return s}notify(t,e,s){const r=e==null?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:r,options:s}),this.graph.trigger(`history:${t}`,{cmds:r,options:s}),this.emit("change",{cmds:r,options:s}),this.graph.trigger("history:change",{cmds:r,options:s})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],s=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const r=new Set(e.map(o=>o.event));if(r.size!==2||!r.has("cell:change:parent")||!r.has("cell:change:children")||!e.every(o=>{var a;return o.batch&&((a=o.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(s)||s.length!==1)return;const i=s[0];i.event!=="cell:change:position"||!(!((t=i.options)===null||t===void 0)&&t.ui)||(s.push(...e),this.undoStack.pop())}undoStackPush(t){if(this.stackSize===0){this.undoStack.push(t);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(t)}ensureUndefinedAttrs(t,e){let s=!1;return t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(r=>{t[r]===void 0&&e[r]!==void 0?(t[r]=void 0,s=!0):typeof t[r]=="object"&&typeof e[r]=="object"&&(s=this.ensureUndefinedAttrs(t[r],e[r]))}),s}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}Gb([Nt.dispose()],ii.prototype,"dispose",null),function(n){class t extends Nt{constructor(s){super(),this.map={},this.command=s.history,this.cancelInvalid=s.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:s}){return Array.isArray(s)?s.every(r=>this.isValidCommand(r)):this.isValidCommand(s)}isValidCommand(s){if(s.options&&s.options.validation===!1)return!0;const r=s.event&&this.map[s.event]||[];let i=null;return r.forEach(o=>{let a=0;const l=u=>{const h=o[a];a+=1;try{if(h)h(u,s,l);else{i=u;return}}catch(f){l(f)}};l(i)}),i?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:i}),!1):!0}validate(s,...r){const i=Array.isArray(s)?s:s.split(/\s+/);return r.forEach(o=>{if(typeof o!="function")throw new Error(`${i.join(" ")} requires callback functions.`)}),i.forEach(o=>{this.map[o]==null&&(this.map[o]=[]),this.map[o].push(r)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}Gb([Nt.dispose()],t.prototype,"dispose",null),n.Validator=t}(ii||(ii={}));var It;(function(n){function t(o){return o==="cell:added"}n.isAddEvent=t;function e(o){return o==="cell:removed"}n.isRemoveEvent=e;function s(o){return o!=null&&o.startsWith("cell:change:")}n.isChangeEvent=s;function r(o){const a=["cell:added","cell:removed","cell:change:*"],l=["batch:start","batch:stop"],u=o.eventNames?o.eventNames.filter(h=>!(n.isChangeEvent(h)||a.includes(h)||l.includes(h))):a;return Object.assign(Object.assign({enabled:!0},o),{eventNames:u,applyOptionsList:o.applyOptionsList||["propertyPath"],revertOptionsList:o.revertOptionsList||["propertyPath"]})}n.getOptions=r;function i(o){const a=[];for(let l=0,u=o.length;l<u;l+=1){const h=o[l];let f=null;if(n.isAddEvent(h.event)){const d=h.data.id;for(let g=0;g<l;g+=1)if(o[g].data.id===d){f=g;break}}f!==null?a.splice(f,0,h):a.push(h)}return a}n.sortBatchCommands=i})(It||(It={}));var Oj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Yb extends pt{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Oe.classNames.box)}get $boxes(){return fR(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(t){super(),this.options=t,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new gl([],{comparator:Oe.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:s,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a,snapped:l}=e,u=(s!==!0||r&&this.getPointerEventsValue(r)==="none")&&!this.translating&&!o,h=i&&a&&t.id===a;if(u&&(h||l)){this.translating=!0;const f=t.position(),d=t.previous("position"),g=f.x-d.x,p=f.y-d.y;(g!==0||p!==0)&&this.translateSelectedNodes(g,p,t,e),this.translating=!1}}onModelUpdated({removed:t}){t&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const s=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(s,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){if(e.batch){const u=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(u,Object.assign(Object.assign({},e),{ui:!0})),this}const s=this.cells,r=this.filter(Array.isArray(t)?t:[t]),i={},o={};s.forEach(u=>i[u.id]=u),r.forEach(u=>o[u.id]=u);const a=[],l=[];return r.forEach(u=>{i[u.id]||a.push(u)}),s.forEach(u=>{o[u.id]||l.push(u)}),l.length&&this.unselect(l,Object.assign(Object.assign({},e),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},e),{ui:!0})),l.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(e)}clean(t={}){return this.length&&(t.batch===!1?this.unselect(this.cells,t):this.collection.reset([],Object.assign(Object.assign({},t),{ui:!0}))),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){t=this.normalizeEvent(t),this.clean();let e,s;const r=this.graph.container;if(t.offsetX!=null&&t.offsetY!=null&&r.contains(t.target))e=t.offsetX,s=t.offsetY;else{const i=Gu(r),o=r.scrollLeft,a=r.scrollTop;e=t.clientX-i.left+window.pageXOffset+o,s=t.clientY-i.top+window.pageYOffset+a}qt(this.container,{top:s,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:s,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Oe.documentEvents,t.data)}filter(t){const e=this.options.filter;return t.filter(s=>Array.isArray(e)?e.some(r=>typeof r=="string"?s.shape===r:s.id===r.id):typeof e=="function"?X(e,this.graph,s):!0)}stopSelecting(t){const e=this.graph,s=this.getEventData(t);switch(s.action){case"selecting":{let i=qR(this.container),o=JR(this.container);const a=Gu(this.container),l=e.pageToLocal(a.left,a.top),u=e.transform.getScale();i/=u.sx,o/=u.sy;const h=new z(l.x,l.y,i,o),f=this.getCellViewsInArea(h).map(d=>d.cell);this.reset(f,{batch:!0}),this.hideRubberband();break}case"translating":{const i=e.snapToGrid(t.clientX,t.clientY);if(!this.options.following){const o=s;this.updateSelectedNodesPosition({dx:o.clientX-o.originX,dy:o.clientY-o.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",t,i.x,i.y);break}default:{this.clean();break}}}onMouseUp(t){this.getEventData(t).action&&(this.stopSelecting(t),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(t){this.options.following||t.stopPropagation();const e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);const s=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:s});const r=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,r.x,r.y),this.delegateDocumentEvents(Oe.documentEvents,e.data)}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})}getRestrictArea(){const t=this.graph.options.translating.restrict,e=typeof t=="function"?X(t,this.graph,null):t;return typeof e=="number"?this.graph.transform.getGraphArea().inflate(e):e===!0?this.graph.transform.getGraphArea():e||null}getSelectionOffset(t,e){let s=t.x-e.clientX,r=t.y-e.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=ht.getCellsBBox(o,{deep:!0})||z.create(),l=i.x-a.x,u=i.y-a.y,h=i.x+i.width-(a.x+a.width),f=i.y+i.height-(a.y+a.height);if(s<l&&(s=l),r<u&&(r=u),h<s&&(s=h),f<r&&(r=f),!this.options.following){const d=t.x-e.originX,g=t.y-e.originY;s=d<=l||d>=h?0:s,r=g<=u||g>=f?0:r}}return{dx:s,dy:r}}updateElementPosition(t,e,s){const r=qt(t,"left"),i=qt(t,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;qt(t,"left",o+e),qt(t,"top",a+s)}updateSelectedNodesPosition(t){const{dx:e,dy:s}=t;if(e||s)if(this.translateSelectedNodes(e,s),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const r=this.graph.transform.getScale();for(let i=0,o=this.$boxes,a=o.length;i<a;i+=1)this.updateElementPosition(o[i],e*r.sx,s*r.sy);this.updateElementPosition(this.selectionContainer,e*r.sx,s*r.sy)}}autoScrollGraph(t,e){const s=this.graph.getPlugin("scroller");return s?s.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),s=this.getEventData(e);switch(s.action){case"selecting":{const i=s;i.moving!==!0&&(ps(this.container,this.graph.container),this.showRubberband(),i.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(e.clientX,e.clientY);i.scrollerX+=o,i.scrollerY+=a;const l=e.clientX-i.clientX+i.scrollerX,u=e.clientY-i.clientY+i.scrollerY,h=parseInt(qt(this.container,"left")||"0",10),f=parseInt(qt(this.container,"top")||"0",10);qt(this.container,{left:l<0?i.offsetX+l:h,top:u<0?i.offsetY+u:f,width:Math.abs(l),height:Math.abs(u)});break}case"translating":{const i=this.graph.snapToGrid(e.clientX,e.clientY),o=s,a=this.getSelectionOffset(i,o);this.options.following?this.updateSelectedNodesPosition(a):this.updateContainerPosition(a),a.dx&&(o.clientX=i.x),a.dy&&(o.clientY=i.y),this.notifyBoxEvent("box:mousemove",t,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,s,r){const i={},o=[];if(s&&(i[s.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(l=>{i[l.id]=!0})}),r&&r.translateBy){const a=this.graph.getCellById(r.translateBy);a&&(i[a.id]=!0,a.getDescendants({deep:!0}).forEach(l=>{i[l.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!i[a.id]){const l=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});a.translate(t,e,l),this.graph.model.getConnectedEdges(a).forEach(u=>{i[u.id]||(u.translate(t,e,l),i[u.id]=!0)})}})}getCellViewsInArea(t){const e=this.graph,s={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(e.model.getNodesInArea(t,s).map(i=>e.renderer.findViewByCell(i)).filter(i=>i!=null))),this.options.rubberEdge&&(r=r.concat(e.model.getEdgesInArea(t,s).map(i=>e.renderer.findViewByCell(i)).filter(i=>i!=null))),r}notifyBoxEvent(t,e,s,r){const o=this.getEventData(e).activeView;this.trigger(t,{e,view:o,x:s,y:r,cell:o.cell})}getSelectedClassName(t){return this.prefixClassName(`${t.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(ze(this.container.querySelector(`[data-cell-id="${t.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),ze(this.$boxes),this.boxCount=0}hide(){Dt(this.container,this.prefixClassName(Oe.classNames.rubberband)),Dt(this.container,this.prefixClassName(Oe.classNames.selected))}showRubberband(){J(this.container,this.prefixClassName(Oe.classNames.rubberband))}hideRubberband(){Dt(this.container,this.prefixClassName(Oe.classNames.rubberband))}showSelected(){Bu(this.container,"style"),J(this.container,this.prefixClassName(Oe.classNames.selected))}createContainer(){this.container=document.createElement("div"),J(this.container,this.prefixClassName(Oe.classNames.root)),this.options.className&&J(this.container,this.options.className),this.selectionContainer=document.createElement("div"),J(this.selectionContainer,this.prefixClassName(Oe.classNames.inner)),this.selectionContent=document.createElement("div"),J(this.selectionContent,this.prefixClassName(Oe.classNames.content)),Ne(this.selectionContainer,this.selectionContent),ut(this.selectionContainer,"data-selection-length",this.collection.length),iy(this.container,this.selectionContainer)}updateContainerPosition(t){(t.dx||t.dy)&&this.updateElementPosition(this.selectionContainer,t.dx,t.dy)}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0};this.collection.toArray().filter(i=>this.canShowSelectionBox(i)).forEach(i=>{const o=this.graph.renderer.findViewByCell(i);if(o){const a=o.getBBox({useCellGeometry:!0});t.x=Math.min(t.x,a.x),t.y=Math.min(t.y,a.y),e.x=Math.max(e.x,a.x+a.width),e.y=Math.max(e.y,a.y+a.height)}}),qt(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}),ut(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=X(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?ps(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&this.options.showNodeSelectionBox===!0||t.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(t){return typeof t=="string"?t:t(this.cells)}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const s=e.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;J(i,r),J(i,`${r}-${t.isNode()?"node":"edge"}`),ut(i,"data-cell-id",t.id),qt(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),ps(i,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let t=0,e=this.$boxes,s=e.length;t<s;t+=1){const r=e[t],i=ut(r,"data-cell-id");ze(r),this.boxCount-=1;const o=this.collection.get(i);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const s=this.collection.get(e);if(s)return this.graph.renderer.findViewByCell(s)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(s=>{this.listenCellRemoveEvent(s),this.createSelectionBox(s)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:s}){t.forEach(i=>{this.trigger("cell:selected",{cell:i,options:s}),i.isNode()?this.trigger("node:selected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:selected",{cell:i,options:s,edge:i})}),e.forEach(i=>{this.trigger("cell:unselected",{cell:i,options:s}),i.isNode()?this.trigger("node:unselected",{cell:i,options:s,node:i}):i.isEdge()&&this.trigger("edge:unselected",{cell:i,options:s,edge:i})});const r={added:t,removed:e,options:s,selected:this.cells.filter(i=>!!this.graph.getCellById(i.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}Oj([pt.dispose()],Yb.prototype,"dispose",null);var Oe;(function(n){const t="widget-selection";n.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function e(s){return s.getAncestors().length}n.depthComparator=e})(Oe||(Oe={}));const Mj=`.x6-widget-selection {
|
|
674
674
|
position: absolute;
|
|
675
675
|
top: 0;
|
|
676
676
|
left: 0;
|
|
@@ -735,4 +735,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
735
735
|
font-size: 10px;
|
|
736
736
|
background-color: #6a6b8a;
|
|
737
737
|
}
|
|
738
|
-
`;I.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},I.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},I.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},I.prototype.toggleSelection=function(n){const t=this.getPlugin("selection");return t&&t.toggleEnabled(n),this},I.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},I.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},I.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},I.prototype.toggleMultipleSelection=function(n){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(n),this},I.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},I.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},I.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},I.prototype.toggleSelectionMovable=function(n){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(n),this},I.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},I.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},I.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},I.prototype.toggleRubberband=function(n){const t=this.getPlugin("selection");return t&&t.toggleRubberband(n),this},I.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},I.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},I.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},I.prototype.toggleStrictRubberband=function(n){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(n),this},I.prototype.setRubberbandModifiers=function(n){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(n),this},I.prototype.setSelectionFilter=function(n){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(n),this},I.prototype.setSelectionDisplayContent=function(n){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(n),this},I.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},I.prototype.cleanSelection=function(n){const t=this.getPlugin("selection");return t&&t.clean(n),this},I.prototype.resetSelection=function(n,t){const e=this.getPlugin("selection");return e&&e.reset(n,t),this},I.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},I.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},I.prototype.isSelected=function(n){const t=this.getPlugin("selection");return t?t.isSelected(n):!1},I.prototype.select=function(n,t){const e=this.getPlugin("selection");return e&&e.select(n,t),this},I.prototype.unselect=function(n,t){const e=this.getPlugin("selection");return e&&e.unselect(n,t),this};var fj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class ii extends Nt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(t={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},ii.defaultOptions),t),jr(this.name,dj)}init(t){this.graph=t,this.selectionImpl=new Hb(Object.assign(Object.assign({},this.options),{graph:t})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(t){return t!=null?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(t){return t!=null?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(t){return t!=null?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(t){return t!=null?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.setModifiers(t)}setSelectionFilter(t){return this.setFilter(t),this}setSelectionDisplayContent(t){return this.setContent(t),this}isEmpty(){return this.length<=0}clean(t={}){return this.selectionImpl.clean(t),this}reset(t,e={}){return this.selectionImpl.reset(t?this.getCells(t):[],e),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(t){return this.selectionImpl.isSelected(t)}select(t,e={}){const s=this.getCells(t);return s.length&&(this.isMultiple()?this.selectionImpl.select(s,e):this.reset(s.slice(0,1),e)),this}unselect(t,e={}){return this.selectionImpl.unselect(this.getCells(t),e),this}setup(){this.selectionImpl.on("*",(t,e)=>{this.trigger(t,e),this.graph.trigger(t,e)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.panning.allowPanning(t,!0),s=this.graph.getPlugin("scroller"),r=s&&s.allowPanning(t,!0);(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!r&&!e)&&this.startRubberband(t)}allowBlankMouseDown(t){const e=this.options.eventTypes;return(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}onBlankClick(){this.clean()}allowRubberband(t,e){return!this.rubberbandDisabled&&ms.isMatch(t,this.options.modifiers,e)}allowMultipleSelection(t){return this.isMultiple()&&ms.isMatch(t,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const s=this.options;let r=this.disabled;!r&&this.movedMap.has(e)&&(r=s.selectCellOnMoved===!1,r||(r=s.selectNodeOnMoved===!1&&e.isNode()),r||(r=s.selectEdgeOnMoved===!1&&e.isEdge())),r||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}getCells(t){return(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?this.graph.getCellById(e):e).filter(e=>e!=null)}startRubberband(t){return this.rubberbandDisabled||this.selectionImpl.startSelecting(t),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(t){return this.options.modifiers=t,this}setContent(t){return this.selectionImpl.setContent(t),this}setFilter(t){return this.selectionImpl.setFilter(t),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),$r(this.name)}}fj([Nt.dispose()],ii.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]}}(ii||(ii={})),I.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},I.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},I.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},I.prototype.toggleHistory=function(n){const t=this.getPlugin("history");return t&&t.toggleEnabled(n),this},I.prototype.undo=function(n){const t=this.getPlugin("history");return t&&t.undo(n),this},I.prototype.redo=function(n){const t=this.getPlugin("history");return t&&t.redo(n),this},I.prototype.undoAndCancel=function(n){const t=this.getPlugin("history");return t&&t.cancel(n),this},I.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},I.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},I.prototype.cleanHistory=function(n){const t=this.getPlugin("history");return t&&t.clean(n),this},I.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},I.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},I.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},I.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var Ub=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class oi extends Nt{constructor(t={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:e=0}=t;this.stackSize=e,this.options=It.getOptions(t),this.validator=new oi.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(t){this.graph=t,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStackPush(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const t=this.undoStack.length;return this.stackSize-t}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}get disabled(){return this.options.enabled!==!0}validate(t,...e){return this.validator.validate(t,...e),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:t?t.batch:!1,data:{}}}revertCommand(t,e){this.freezed=!0;const s=Array.isArray(t)?It.sortBatchCommands(t):[t];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},e),Mc(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const s=Array.isArray(t)?It.sortBatchCommands(t):[t];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},e),Mc(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,o)}this.freezed=!1}executeCommand(t,e,s){const r=this.model,i=r.getCell(t.data.id),o=t.event;if(It.isAddEvent(o)&&e||It.isRemoveEvent(o)&&!e)i&&i.remove(s);else if(It.isAddEvent(o)&&!e||It.isRemoveEvent(o)&&e){const a=t.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(It.isChangeEvent(o)){const a=t.data,l=a.key;if(l&&i){const u=e?a.prev[l]:a.next[l];a.key==="attrs"&&this.ensureUndefinedAttrs(u,e?a.next[l]:a.prev[l])&&(s.dirty=!0),i.prop(l,u,s)}}else{const a=this.options.executeCommand;a&&X(a,this,t,e,s)}}addCommand(t,e){if(this.freezed||this.disabled)return;const s=e,r=s.options||{};if(r.dryrun||It.isAddEvent(t)&&this.options.ignoreAdd||It.isRemoveEvent(t)&&this.options.ignoreRemove||It.isChangeEvent(t)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&X(i,this,t,e)===!1)return;t==="cell:change:*"&&(t=`cell:change:${s.key}`);const o=s.cell,a=Zt.isModel(o);let l;if(this.batchCommands){l=this.batchCommands[Math.max(this.lastBatchIndex,0)];const h=a&&!l.modelChange||l.data.id!==o.id,f=l.event!==t;if(this.lastBatchIndex>=0&&(h||f)){const d=this.batchCommands.findIndex(g=>(a&&g.modelChange||g.data.id===o.id)&&g.event===t);d<0||It.isAddEvent(t)||It.isRemoveEvent(t)?l=this.createCommand({batch:!0}):(l=this.batchCommands[d],this.batchCommands.splice(d,1)),this.batchCommands.push(l),this.lastBatchIndex=this.batchCommands.length-1}}else l=this.createCommand({batch:!1});if(It.isAddEvent(t)||It.isRemoveEvent(t)){const h=l.data;return l.event=t,l.options=r,h.id=o.id,h.props=Tt(o.toJSON()),o.isEdge()?h.edge=!0:o.isNode()&&(h.node=!0),this.push(l,r)}if(It.isChangeEvent(t)){const h=e.key,f=l.data;return(!l.batch||!l.event)&&(l.event=t,l.options=r,f.key=h,f.prev==null&&(f.prev={}),f.prev[h]=Tt(o.previous(h)),a?l.modelChange=!0:f.id=o.id),f.next==null&&(f.next={}),f.next[h]=Tt(o.prop(h)),this.push(l,r)}const u=this.options.afterAddCommand;u&&X(u,this,t,e,l),this.push(l,r)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const s=[];for(;e.length>0;){const r=e.shift(),i=r.event,o=r.data.id;if(i!=null&&(o!=null||r.modelChange)){if(It.isAddEvent(i)){const a=e.findIndex(l=>It.isRemoveEvent(l.event)&&l.data.id===o);if(a>=0){e=e.filter((l,u)=>a<u||l.data.id!==o);continue}}else if(It.isRemoveEvent(i)){const a=e.findIndex(l=>It.isAddEvent(l.event)&&l.data.id===o);if(a>=0){e.splice(a,1);continue}}else if(It.isChangeEvent(i)){const a=r.data;if(wn(a.prev,a.next))continue}s.push(r)}}return s}notify(t,e,s){const r=e==null?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:r,options:s}),this.graph.trigger(`history:${t}`,{cmds:r,options:s}),this.emit("change",{cmds:r,options:s}),this.graph.trigger("history:change",{cmds:r,options:s})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],s=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const r=new Set(e.map(o=>o.event));if(r.size!==2||!r.has("cell:change:parent")||!r.has("cell:change:children")||!e.every(o=>{var a;return o.batch&&((a=o.options)===null||a===void 0?void 0:a.ui)})||!Array.isArray(s)||s.length!==1)return;const i=s[0];i.event!=="cell:change:position"||!(!((t=i.options)===null||t===void 0)&&t.ui)||(s.push(...e),this.undoStack.pop())}undoStackPush(t){if(this.stackSize===0){this.undoStack.push(t);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(t)}ensureUndefinedAttrs(t,e){let s=!1;return t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&Object.keys(e).forEach(r=>{t[r]===void 0&&e[r]!==void 0?(t[r]=void 0,s=!0):typeof t[r]=="object"&&typeof e[r]=="object"&&(s=this.ensureUndefinedAttrs(t[r],e[r]))}),s}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}Ub([Nt.dispose()],oi.prototype,"dispose",null),function(n){class t extends Nt{constructor(s){super(),this.map={},this.command=s.history,this.cancelInvalid=s.cancelInvalid!==!1,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:s}){return Array.isArray(s)?s.every(r=>this.isValidCommand(r)):this.isValidCommand(s)}isValidCommand(s){if(s.options&&s.options.validation===!1)return!0;const r=s.event&&this.map[s.event]||[];let i=null;return r.forEach(o=>{let a=0;const l=u=>{const h=o[a];a+=1;try{if(h)h(u,s,l);else{i=u;return}}catch(f){l(f)}};l(i)}),i?(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:i}),!1):!0}validate(s,...r){const i=Array.isArray(s)?s:s.split(/\s+/);return r.forEach(o=>{if(typeof o!="function")throw new Error(`${i.join(" ")} requires callback functions.`)}),i.forEach(o=>{this.map[o]==null&&(this.map[o]=[]),this.map[o].push(r)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}Ub([Nt.dispose()],t.prototype,"dispose",null),n.Validator=t}(oi||(oi={}));var It;(function(n){function t(o){return o==="cell:added"}n.isAddEvent=t;function e(o){return o==="cell:removed"}n.isRemoveEvent=e;function s(o){return o!=null&&o.startsWith("cell:change:")}n.isChangeEvent=s;function r(o){const a=["cell:added","cell:removed","cell:change:*"],l=["batch:start","batch:stop"],u=o.eventNames?o.eventNames.filter(h=>!(n.isChangeEvent(h)||a.includes(h)||l.includes(h))):a;return Object.assign(Object.assign({enabled:!0},o),{eventNames:u,applyOptionsList:o.applyOptionsList||["propertyPath"],revertOptionsList:o.revertOptionsList||["propertyPath"]})}n.getOptions=r;function i(o){const a=[];for(let l=0,u=o.length;l<u;l+=1){const h=o[l];let f=null;if(n.isAddEvent(h.event)){const d=h.data.id;for(let g=0;g<l;g+=1)if(o[g].data.id===d){f=g;break}}f!==null?a.splice(f,0,h):a.push(h)}return a}n.sortBatchCommands=i})(It||(It={})),I.prototype.toSVG=function(n,t){const e=this.getPlugin("export");e&&e.toSVG(n,t)},I.prototype.toPNG=function(n,t){const e=this.getPlugin("export");e&&e.toPNG(n,t)},I.prototype.toJPEG=function(n,t){const e=this.getPlugin("export");e&&e.toJPEG(n,t)},I.prototype.exportPNG=function(n,t){const e=this.getPlugin("export");e&&e.exportPNG(n,t)},I.prototype.exportJPEG=function(n,t){const e=this.getPlugin("export");e&&e.exportJPEG(n,t)},I.prototype.exportSVG=function(n,t){const e=this.getPlugin("export");e&&e.exportSVG(n,t)};var gj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class Gb extends Nt{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(t){this.graph=t}exportPNG(t="chart",e={}){this.toPNG(s=>{Ws.downloadDataUri(s,t)},e)}exportJPEG(t="chart",e={}){this.toPNG(s=>{Ws.downloadDataUri(s,t)},e)}exportSVG(t="chart",e={}){this.toSVG(s=>{Ws.downloadDataUri(Ws.svgToDataUrl(s),t)},e)}toSVG(t,e={}){this.notify("before:export",e);const s=this.view.svg,r=tt.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),l=e.preserveDimensions;if(l){const f=typeof l=="boolean"?a:l;r.attr({width:f.width,height:f.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),e.copyStyles!==!1){const f=s.ownerDocument,d=Array.from(s.querySelectorAll("*")),g=Array.from(i.querySelectorAll("*")),p=f.styleSheets.length,m=[];for(let w=p-1;w>=0;w-=1)m[w]=f.styleSheets[w],f.styleSheets[w].disabled=!0;const y={};d.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S={};Object.keys(v).forEach(E=>{S[E]=v.getPropertyValue(E)}),y[x]=S}),p!==f.styleSheets.length&&m.forEach((w,x)=>{f.styleSheets[x]=w});for(let w=0;w<p;w+=1)f.styleSheets[w].disabled=!1;const b={};d.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S=y[x],E={};Object.keys(v).forEach(C=>{!Oc(C)&&v.getPropertyValue(C)!==S[C]&&(E[C]=v.getPropertyValue(C))}),b[x]=E}),g.forEach((w,x)=>{qt(w,b[x])})}const u=e.stylesheet;if(typeof u=="string"){const f=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(tt.create("style",{type:"text/css"},[f]))}const h=()=>{const f=e.beforeSerialize;if(typeof f=="function"){const g=X(f,this.graph,i);g instanceof SVGSVGElement&&(i=g)}const d=new XMLSerializer().serializeToString(i).replace(/ /g," ");this.notify("after:export",e),t(d)};if(e.serializeImages){const f=r.find("image").map(d=>new Promise(g=>{const p=d.attr("xlink:href")||d.attr("href");Ws.imageToDataUri(p,(m,y)=>{!m&&y&&d.attr("xlink:href",y),g()})}));Promise.all(f).then(h)}else h()}toDataURL(t,e){let s=e.viewBox||this.graph.getContentBBox();const r=ds(e.padding);e.width&&e.height&&(r.left+r.right>=e.width&&(r.left=r.right=0),r.top+r.bottom>=e.height&&(r.top=r.bottom=0));const i=new z(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(e.width&&e.height){const h=s.width+r.left+r.right,f=s.height+r.top+r.bottom;i.scale(h/e.width,f/e.height)}s=z.create(s).moveAndExpand(i);const o=typeof e.width=="number"&&typeof e.height=="number"?{width:e.width,height:e.height}:s;let a=e.ratio?parseFloat(e.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const l={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const h=document.createElement("canvas"),f=h.getContext("2d");h.width=l.width,h.height=l.height;const d=l.width-1,g=l.height-1;f.fillStyle="rgb(1,1,1)",f.fillRect(d,g,1,1);const p=f.getImageData(d,g,1,1).data;if(p[0]!==1||p[1]!==1||p[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const h=document.createElement("canvas");h.width=l.width,h.height=l.height;const f=h.getContext("2d");f.fillStyle=e.backgroundColor||"white",f.fillRect(0,0,l.width,l.height);try{f.drawImage(u,0,0,l.width,l.height);const d=h.toDataURL(e.type,e.quality);t(d)}catch{}},this.toSVG(h=>{u.src=`data:image/svg+xml,${encodeURIComponent(h)}`},Object.assign(Object.assign({},e),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}notify(t,e){this.trigger(t,e),this.graph.trigger(t,e)}dispose(){this.off()}}gj([Nt.dispose()],Gb.prototype,"dispose",null);const pj={class:"control-box"},mj=Gn({__name:"index",props:{payload:Object},setup(n){const t=n,e=c.ref("3"),s=c.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(t.payload.getPorts().map(u=>({id:u.id,attrs:u.attrs,args:{x:Number(u.args.x.replace("%","")),y:Number(u.args.y.replace("%",""))}}))))},i=()=>{const u=za;u.attrs.text.text=`${t.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",t.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{Wi("#drawing-board",!0)},a=(u,h,f)=>{t.payload.portProp(u,"args/"+h,f+"%"),r()},l=u=>{t.payload.removePort(u),r()};return c.onMounted(()=>{r()}),(u,h)=>{const f=c.resolveComponent("el-button"),d=c.resolveComponent("el-table-column"),g=c.resolveComponent("el-slider"),p=c.resolveComponent("el-icon"),m=c.resolveComponent("el-table"),y=c.resolveComponent("el-collapse-item"),b=c.resolveComponent("el-collapse");return c.openBlock(),c.createElementBlock("div",pj,[c.createVNode(b,{modelValue:e.value,"onUpdate:modelValue":h[0]||(h[0]=w=>e.value=w),accordion:""},{default:c.withCtx(()=>[c.createVNode(y,{title:"连接桩设置",name:"3"},{default:c.withCtx(()=>[c.createVNode(f,{type:"primary",onClick:i,size:"small"},{default:c.withCtx(()=>h[1]||(h[1]=[c.createTextVNode("添加连接桩")])),_:1}),c.createVNode(f,{type:"primary",onClick:o,size:"small"},{default:c.withCtx(()=>h[2]||(h[2]=[c.createTextVNode("显示连接桩")])),_:1}),c.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:c.withCtx(()=>[c.createVNode(d,{label:"ID",width:"50",align:"center"},{default:c.withCtx(({row:w})=>[c.createTextVNode(c.toDisplayString(w.attrs.text.text),1)]),_:1}),c.createVNode(d,{label:"x",width:"100",align:"center"},{default:c.withCtx(({row:w})=>[c.createVNode(g,{modelValue:w.args.x,"onUpdate:modelValue":x=>w.args.x=x,min:0,max:100,step:1,onInput:x=>a(w.id,"x",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(d,{label:"y",width:"100",align:"center"},{default:c.withCtx(({row:w})=>[c.createVNode(g,{modelValue:w.args.y,"onUpdate:modelValue":x=>w.args.y=x,min:0,max:100,step:1,onInput:x=>a(w.id,"y",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),c.createVNode(d,{label:"操作",width:"70",align:"center"},{default:c.withCtx(({row:w})=>[c.createVNode(f,{type:"danger",size:"small",onClick:x=>l(w.id)},{default:c.withCtx(()=>[c.createVNode(p,null,{default:c.withCtx(()=>[c.createVNode(c.unref(wg))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),yl=[{shape:"rect",width:60,height:5,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:0}},data:{type:"base-shape"}},{shape:"rect",width:60,height:20,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape",label:"母线"}},{shape:"circle",width:40,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape"}},{shape:"ellipse",width:60,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff"}},data:{type:"base-shape"}}],Yb={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},hh=Object.assign({name:"wiring-diagram-preview"},{__name:"index",props:{id:{type:String,default:""},background:{type:Object,default:()=>({})},grid:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})}},setup(n){const t=n,e=c.ref([]),s=c.ref(),r=()=>{const y=document.getElementById("preview-container");s.value=new I({container:y,autoResize:!0,panning:!0,mousewheel:!0,connecting:{router:"orth",connectionPoint:{name:"anchor"},anchor:"center"},interacting:{nodeMovable:!1,magnetConnectable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1}}),s.value.on("blank:dblclick",()=>{h()})},i=async()=>{let y,b,w;if(t.id){const{background:x,grid:v,data:S}=await Nm(t.id);y=x,b={},w=S}else y=t.background,b={},w=t.data;s.value.drawBackground(y),s.value.drawGrid(b),s.value.fromJSON(w),l()},o=c.ref(null),a=c.ref([]),l=()=>{a.value=f();const y=/\$\{(.*?)\}/g;a.value.forEach(b=>{if(!b.data||!b.data.field)return;const w=b.data.content.match(y);e.value.push(...b.data.field),w&&(b.matches=w)}),a&&h()},u=c.ref(!0),h=async()=>{if(!e.value.length)return;if(!u.value){Bt.warning("数据正在更新中,请稍后再试");return}o.value&&clearInterval(o.value),u.value=!1;const y=await RD(e.value);if(u.value=!0,!Array.isArray(y)||!y.length)return;let b=0;a.value.forEach((w,x)=>{if(!w.data||!w.data.field)return;if(w.matches){const S=x===0?0:b||0,E=b=S+w.data.field.length;w.label=d(w.data.content,y.slice(S,E))}}),o.value=setTimeout(()=>{h()},1e4)},f=()=>s.value.getNodes().filter(b=>{var w;return((w=b.data)==null?void 0:w.type)==="text"}),d=(y,b)=>{let w=0;return y.replace(/\$\{.*?\}/g,()=>w<b.length?b[w++]:"--")},g=()=>{s.value.zoomToFit({maxScale:10,padding:20})},p=c.shallowRef(),m=()=>{new ResizeObserver(()=>{g()}).observe(p.value)};return c.onMounted(()=>{r(),i(),setTimeout(()=>{Wi("#preview-container",!1),g()},100),m()}),c.onUnmounted(()=>{clearInterval(o.value)}),(y,b)=>(c.openBlock(),c.createElementBlock("div",{id:"preview-container",ref_key:"previewRef",ref:p,onDblclick:g},null,544))}}),yj={class:"form-container"},bj={class:"footer"},wj=Gn({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:t}){const e=n,s=t,r=c.reactive({groupName:"",sort:1,isShow:1}),i=c.reactive({groupName:[{required:!0,message:"请输入分组名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}],isShow:[{required:!0,message:"请选择是否显示",trigger:"change"}]}),o=c.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?$a("/cny/custom/updateGroup",r).then(h=>{h!=null&&h.isOk?(Bt.success("保存成功"),s("close",!0)):Bt.error((h==null?void 0:h.msg)||"保存失败")}):$a("/cny/custom/saveGroup",r).then(h=>{h!=null&&h.isOk?(Bt.success("保存成功"),s("close",!0)):Bt.error((h==null?void 0:h.msg)||"保存失败")});else return!1})},l=()=>{s("close",!1)};return c.onMounted(()=>{var u;(u=e.payload)!=null&&u.id&&(r.id=e.payload.id,r.groupName=e.payload.groupName,r.sort=e.payload.sort,r.isShow=e.payload.isShow)}),(u,h)=>{const f=c.resolveComponent("el-input"),d=c.resolveComponent("el-form-item"),g=c.resolveComponent("el-input-number"),p=c.resolveComponent("el-switch"),m=c.resolveComponent("el-button"),y=c.resolveComponent("el-form");return c.openBlock(),c.createElementBlock("div",yj,[c.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:c.withCtx(()=>[c.createVNode(d,{label:"分组名称",prop:"groupName"},{default:c.withCtx(()=>[c.createVNode(f,{modelValue:r.groupName,"onUpdate:modelValue":h[0]||(h[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),c.createVNode(d,{label:"排序",prop:"sort"},{default:c.withCtx(()=>[c.createVNode(g,{modelValue:r.sort,"onUpdate:modelValue":h[1]||(h[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),c.createVNode(d,{label:"是否显示",prop:"isShow"},{default:c.withCtx(()=>[c.createVNode(p,{modelValue:r.isShow,"onUpdate:modelValue":h[2]||(h[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),c.createElementVNode("div",bj,[c.createVNode(m,{type:"primary",onClick:a},{default:c.withCtx(()=>h[3]||(h[3]=[c.createTextVNode("保存")])),_:1}),c.createVNode(m,{onClick:l},{default:c.withCtx(()=>h[4]||(h[4]=[c.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-a2a7ce25"]]),xj={class:"form-container"},vj={class:"footer"},Cj=Gn({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:t}){const e=t,s=n,r=c.shallowRef(null),i=c.reactive({groupId:"",id:"",imageName:"",sort:0,isShow:1,imageUrl:""}),o={imageName:[{required:!0,message:"请输入图片名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}]},a=c.ref(""),l=f=>{if(f.raw.type.indexOf("image")===-1){Bt.error("请上传图片格式的文件");return}const d=new FormData;d.append("file",f.raw),DD("/cny/file/fileUpload",d).then(g=>{g!=null&&g.isOk?(a.value=hs.defaults.baseURL+"/cny/upload/"+(g==null?void 0:g.data),i.imageUrl=g==null?void 0:g.data):Bt.error((g==null?void 0:g.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(f=>{if(f)$a("/cny/custom/savePicture",i).then(d=>{d!=null&&d.isOk?(Bt.success("保存成功"),e("close",!0)):Bt.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},h=()=>{e("close",!1)};return c.onMounted(()=>{var f;(f=s.payload)!=null&&f.id&&(i.id=s.payload.id,i.imageName=s.payload.imageName,i.sort=s.payload.sort,i.isShow=s.payload.isShow,i.imageUrl=s.payload.imageUrl,a.value=i.imageUrl),i.groupId=s.payload.groupId}),(f,d)=>{const g=c.resolveComponent("el-input"),p=c.resolveComponent("el-form-item"),m=c.resolveComponent("el-input-number"),y=c.resolveComponent("el-switch"),b=c.resolveComponent("el-image"),w=c.resolveComponent("el-icon"),x=c.resolveComponent("el-upload"),v=c.resolveComponent("el-button"),S=c.resolveComponent("el-form");return c.openBlock(),c.createElementBlock("div",xj,[c.createVNode(S,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:c.withCtx(()=>[c.createVNode(p,{label:"图片名称",prop:"imageName"},{default:c.withCtx(()=>[c.createVNode(g,{modelValue:i.imageName,"onUpdate:modelValue":d[0]||(d[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),c.createVNode(p,{label:"排序",prop:"sort"},{default:c.withCtx(()=>[c.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":d[1]||(d[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),c.createVNode(p,{label:"是否显示",prop:"isShow"},{default:c.withCtx(()=>[c.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":d[2]||(d[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),c.createVNode(p,{label:"上传",prop:"image"},{default:c.withCtx(()=>[c.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":l,"auto-upload":!1},{default:c.withCtx(()=>[a.value?(c.openBlock(),c.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(c.openBlock(),c.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:c.withCtx(()=>[c.createVNode(c.unref(K2))]),_:1}))]),_:1})]),_:1}),c.createElementVNode("div",vj,[c.createVNode(v,{type:"primary",onClick:u},{default:c.withCtx(()=>d[3]||(d[3]=[c.createTextVNode("保存")])),_:1}),c.createVNode(v,{onClick:h},{default:c.withCtx(()=>d[4]||(d[4]=[c.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-c7d87a18"]]),Sj={class:"form-container"},Ej={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},Oj=["src"],Mj=Gn({__name:"image-management",setup(n){const t=c.reactive({items:[]}),e=()=>{Yi("/cny/custom/groupList").then(d=>{t.items=d.data})},s=c.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=d=>{s.show=!0,s.title="编辑图片分组",s.payload={id:d.id,groupName:d.groupName,sort:d.sort,isShow:d.isShow}},o=d=>{Tm("/cny/custom/removeGroup/"+d).then(g=>{g.code===200?(Bt.success("删除成功"),e()):Bt.error(g.msg||"删除失败")})},a=c.reactive({show:!1,title:"新增图片",payload:null}),l=d=>{a.show=!0,a.title="新增图片",a.payload={groupId:d}},u=d=>{a.show=!0,a.title="编辑图片",a.payload={id:d.id,groupId:d.groupId,imageName:d.imageName,sort:d.sort,isShow:d.isShow,imageUrl:d.imageUrl}},h=d=>{Tm("/cny/custom/removePicture/"+d).then(g=>{g.code===200?(Bt.success("删除成功"),e()):Bt.error(g.msg||"删除失败")})},f=d=>{s.show=!1,a.show=!1,d&&e()};return c.onMounted(()=>{e()}),(d,g)=>{const p=c.resolveComponent("el-button"),m=c.resolveComponent("el-table-column"),y=c.resolveComponent("el-table"),b=c.resolveComponent("el-dialog");return c.openBlock(),c.createElementBlock("div",Sj,[c.createVNode(p,{type:"primary",onClick:r,size:"small"},{default:c.withCtx(()=>g[2]||(g[2]=[c.createTextVNode("新增图片分组")])),_:1}),c.createVNode(y,{data:t.items,border:"",height:"500"},{default:c.withCtx(()=>[c.createVNode(m,{type:"expand"},{default:c.withCtx(w=>[c.createElementVNode("div",Ej,[c.createVNode(p,{type:"primary",size:"small",onClick:x=>l(w.row.id)},{default:c.withCtx(()=>g[3]||(g[3]=[c.createTextVNode("新增图片")])),_:2},1032,["onClick"]),c.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:c.withCtx(()=>[c.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),c.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:c.withCtx(x=>[c.createElementVNode("img",{src:x.row.imageUrl,alt:"",style:{width:"64px",height:"64px"}},null,8,Oj)]),_:1}),c.createVNode(m,{label:"排序",prop:"sort",align:"center"}),c.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:c.withCtx(x=>[c.createTextVNode(c.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),c.createVNode(m,{label:"操作",align:"center"},{default:c.withCtx(x=>[c.createVNode(p,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:c.withCtx(()=>g[4]||(g[4]=[c.createTextVNode("编辑")])),_:2},1032,["onClick"]),c.createVNode(p,{type:"danger",size:"small",onClick:v=>h(x.row.id)},{default:c.withCtx(()=>g[5]||(g[5]=[c.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),c.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),c.createVNode(m,{label:"排序",prop:"sort",align:"center"}),c.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:c.withCtx(w=>[c.createTextVNode(c.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),c.createVNode(m,{label:"操作",align:"center"},{default:c.withCtx(w=>[c.createVNode(p,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:c.withCtx(()=>g[6]||(g[6]=[c.createTextVNode("编辑")])),_:2},1032,["onClick"]),c.createVNode(p,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:c.withCtx(()=>g[7]||(g[7]=[c.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),c.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":g[0]||(g[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[s.show?(c.openBlock(),c.createBlock(wj,{key:0,payload:s.payload,onClose:f},null,8,["payload"])):c.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),c.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":g[1]||(g[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[a.show?(c.openBlock(),c.createBlock(Cj,{key:0,payload:a.payload,onClose:f},null,8,["payload"])):c.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-75a537f2"]]),Pj={class:"page-container"},Aj={class:"tool-bar"},Tj={class:"action"},Nj={class:"el-dropdown-link"},_j={class:"action",style:{"margin-right":"50px"}},kj={class:"board"},Dj={class:"drawing-board-box"},Rj={id:"controls"},Ij={key:0,class:"controls-label"},Lj={style:{width:"100%",height:"100%",background:"black"}},Wb=Gn(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""}},emits:["getJson"],setup(n,{emit:t}){const e=n,s=c.ref(),r=c.reactive({label:null,component:c.shallowRef(null)}),i=c.ref(null),o=c.ref(null),a=()=>{const D=document.getElementById("drawing-board");window.__x6_instances__=[],s.value=new I({container:D,autoResize:!0,panning:!0,mousewheel:!0,connecting:{allowEdge:!0,router:"orth",connectionPoint:{name:"anchor"},anchor:"center",createEdge(){return s.value.createEdge({inherit:"edge",attrs:{...vu},zIndex:0})}}}),window.__x6_instances__.push(s.value),s.value.use(new er({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0})),s.value.use(new Fb),s.value.use(new jb),s.value.use(new $b({format(N){return N.replace(/\s/g,"").replace("cmd","command")}})),s.value.use(new oi),s.value.use(new ii({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0})),s.value.bindKey(["delete","backspace"],()=>{const N=s.value.getSelectedCells();return N.length&&s.value.removeCells(N),!1}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{const N=s.value.getSelectedCells();return N.length&&(s.value.copy(N),Bt.success("复制成功")),!1}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{if(!s.value.isClipboardEmpty()){const N=s.value.paste({offset:32});s.value.cleanSelection(),s.value.select(N),Bt.success("粘贴成功")}return!1}),s.value.bindKey(["ctrl+z","cmd + z"],()=>(s.value.canUndo()&&s.value.undo(),!1)),s.value.bindKey(["ctrl+y","cmd + y"],()=>(s.value.canRedo()&&s.value.redo(),!1)),s.value.on("blank:click",({e:N,x:j,y:A})=>{o.value=s,r.component=jD,r.label="画布属性",i.value=G().valueOf()}),s.value.on("cell:click",({cell:N})=>{var j,A,P;if(console.log("cell:click",N,((j=N==null?void 0:N.data)==null?void 0:j.type)??(N==null?void 0:N.shape)),o.value=N,i.value=G().valueOf(),((A=N.data)==null?void 0:A.type)==="text"){r.component=Dm,r.label="文本属性";return}if(((P=N.data)==null?void 0:P.type)==="base-shape"){r.component=Dm,r.label="基础图形属性";return}if((N==null?void 0:N.shape)==="edge"){r.component=WD,r.label="连线属性";return}if((N==null?void 0:N.shape)==="image"){r.component=mj,r.label="图片属性";return}r.component=null,r.label=null}),s.value.on("edge:mouseenter",({cell:N})=>{N.addTools([{name:"vertices",args:{snapRadius:3,attrs:{r:3,fill:"#239edd",cursor:"move","stroke-width":0},modifiers:["alt"]}}])}),s.value.on("edge:mouseleave",({cell:N})=>{N.removeTools()}),s.value.on("node:mouseenter",()=>{Wi("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Wi("#drawing-board",!1)}),s.value.use(new Gb)},l=c.ref(),u=()=>{l.value=new si({target:s.value,...ID,groups:[{name:"基础组件",graphPadding:30}],search(j,A){var P;return((P=j.label)==null?void 0:P.indexOf(A))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:j=>{const A=j.clone({keepId:!0});return A.label!=="文本"&&(A.label=""),A}});const D=s.value.createNode({...LD}),N=yl.map(j=>(j.ports=Yb,s.value.createNode(j)));l.value.load([D,...N],"基础组件"),Yi("/cny/custom/groupList").then(j=>{const A=(j==null?void 0:j.data)||[];A==null||A.forEach(P=>{l.value.addGroup({name:P==null?void 0:P.groupName,graphPadding:30});const L=P==null?void 0:P.pictureList.map(V=>{const Y={shape:"image",imageUrl:V==null?void 0:V.imageUrl,ports:Yb,width:64,height:64,label:V.imageName};return s.value.createNode(Y)});l.value.load(L,P==null?void 0:P.groupName),document.getElementById("stencil").appendChild(l.value.container)})}).finally(()=>{setTimeout(()=>{l.value.container.querySelectorAll(".x6-node").forEach((A,P)=>{if(P>yl.length){const L=A.querySelector("text");A.style.position="relative",L&&(L.style.display="none",L.setAttribute("x","0%"),L.setAttribute("y","40"),L.style.fontSize="12px",L.style.fill="#ffffff")}A.addEventListener("mouseenter",L=>{if(P>yl.length){const V=A.querySelector("text");V&&(V.style.display="block")}}),A.addEventListener("mouseleave",L=>{if(P>yl.length){const V=A.querySelector("text");V&&(V.style.display="none")}})})},20)})},h=D=>{switch(D){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),Bt.warning("关闭对齐线")):(s.value.enableSnapline(),Bt.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),Bt.warning("关闭框选")):(s.value.enableSelection(),Bt.success("开启框选"));break;case"drawLine":g();break;case"adaptive":p();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},f=c.ref(!1),d=c.ref(null),g=()=>{f.value=!0;const D=new Date;s.value.startBatch(D),s.value.disablePanning(),s.value.once("blank:mousedown",({e:N,x:j,y:A})=>{f.value&&(d.value=s.value.addEdge({source:{x:j,y:A},target:{x:j,y:A},attrs:vu,data:{type:"edge",isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:N,x:j,y:A})=>{f.value&&d.value.setTarget({x:j,y:A})}),s.value.on("blank:mouseup",({e:N,x:j,y:A})=>{f.value=!1,s.value.enablePanning(),s.value.stopBatch(D)})},p=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=c.reactive({show:!1}),y=()=>{m.show=!0},b=c.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(_m),s.value.drawGrid(km),Bt.success("清空成功")},v=()=>{const D=G().format("YYYYMMDDHHmmss");s.value.exportPNG(D,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},S=t,E=c.reactive({show:!1,background:null,grid:null,data:null}),C=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},M=()=>{S("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},T=async()=>{if(!e.id){s.value.drawBackground(_m),s.value.drawGrid(km),s.value.fromJSON({cells:[]});return}const{background:D,grid:N,data:j}=await Nm(e.id);s.value.drawBackground(D),s.value.drawGrid(N),s.value.fromJSON(j),p()},k=c.shallowRef(null),_=()=>{new ResizeObserver(()=>{p()}).observe(k.value)};return c.onMounted(()=>{a(),u(),T(),_()}),(D,N)=>{const j=c.resolveComponent("el-icon"),A=c.resolveComponent("el-button"),P=c.resolveComponent("el-dropdown-item"),L=c.resolveComponent("el-dropdown-menu"),V=c.resolveComponent("el-dropdown"),Y=c.resolveComponent("el-scrollbar"),ot=c.resolveComponent("el-dialog"),F=c.resolveComponent("el-drawer");return c.openBlock(),c.createElementBlock("div",Pj,[c.createElementVNode("div",Aj,[c.createElementVNode("div",Tj,[c.createVNode(V,{onCommand:h},{dropdown:c.withCtx(()=>[c.createVNode(L,null,{default:c.withCtx(()=>[c.createVNode(P,{command:"snapLine"},{default:c.withCtx(()=>N[4]||(N[4]=[c.createTextVNode("对齐线")])),_:1}),c.createVNode(P,{command:"select"},{default:c.withCtx(()=>N[5]||(N[5]=[c.createTextVNode("框选")])),_:1}),c.createVNode(P,{command:"drawLine"},{default:c.withCtx(()=>N[6]||(N[6]=[c.createTextVNode("绘制直线")])),_:1}),c.createVNode(P,{command:"adaptive"},{default:c.withCtx(()=>N[7]||(N[7]=[c.createTextVNode("视图自适应")])),_:1}),c.createVNode(P,{command:"shortcuts"},{default:c.withCtx(()=>N[8]||(N[8]=[c.createTextVNode("查看快捷键")])),_:1}),c.createVNode(P,{command:"image"},{default:c.withCtx(()=>N[9]||(N[9]=[c.createTextVNode("图片管理")])),_:1}),c.createVNode(P,{command:"clear"},{default:c.withCtx(()=>N[10]||(N[10]=[c.createTextVNode("清空画布")])),_:1}),c.createVNode(P,{command:"export"},{default:c.withCtx(()=>N[11]||(N[11]=[c.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:c.withCtx(()=>[c.createElementVNode("span",Nj,[c.createVNode(A,{size:"small",text:""},{default:c.withCtx(()=>[N[3]||(N[3]=c.createTextVNode("工具 ")),c.createVNode(j,null,{default:c.withCtx(()=>[c.createVNode(c.unref(L2))]),_:1})]),_:1})])]),_:1})]),c.createElementVNode("div",_j,[c.createVNode(c.unref(Rp),{content:"预览",placement:"bottom"},{default:c.withCtx(()=>[c.createVNode(A,{size:"small",icon:c.unref(Cg),onClick:C},null,8,["icon"])]),_:1}),c.createVNode(c.unref(Rp),{content:"保存",placement:"bottom"},{default:c.withCtx(()=>[c.createVNode(A,{size:"small",icon:c.unref(G2),onClick:M},null,8,["icon"])]),_:1})])]),c.createElementVNode("div",kj,[N[12]||(N[12]=c.createElementVNode("div",{id:"stencil"},null,-1)),c.createElementVNode("div",Dj,[c.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:k},null,512)]),c.createElementVNode("div",Rj,[r.label?(c.openBlock(),c.createElementBlock("div",Ij,c.toDisplayString(r.label),1)):c.createCommentVNode("",!0),c.createVNode(Y,null,{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value},null,8,["graph","payload"]))]),_:1})])]),c.createVNode(ot,{modelValue:m.show,"onUpdate:modelValue":N[0]||(N[0]=H=>m.show=H),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[c.createVNode(JD)]),_:1},8,["modelValue"]),c.createVNode(ot,{modelValue:b.show,"onUpdate:modelValue":N[1]||(N[1]=H=>b.show=H),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[c.createVNode(Mj)]),_:1},8,["modelValue"]),c.createVNode(F,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":N[2]||(N[2]=H=>E.show=H),title:"预览",direction:"ttb",size:"100%"},{default:c.withCtx(()=>[c.createElementVNode("div",Lj,[E.show?(c.openBlock(),c.createBlock(hh,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):c.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-3ec8dc06"]]),Bj=[Wb,hh],qb=(n,t)=>{Bj.forEach(e=>{n.component(e.name,e)})};typeof window<"u"&&window.Vue&&qb(window.Vue);const Vj={install:qb};Rt.WiringDiagramEditor=Wb,Rt.WiringDiagramPreview=hh,Rt.default=Vj,Rt.setBaseURL=_D,Rt.setToken=kD,Object.defineProperties(Rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
738
|
+
`;L.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},L.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},L.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},L.prototype.toggleSelection=function(n){const t=this.getPlugin("selection");return t&&t.toggleEnabled(n),this},L.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},L.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},L.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},L.prototype.toggleMultipleSelection=function(n){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(n),this},L.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},L.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},L.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},L.prototype.toggleSelectionMovable=function(n){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(n),this},L.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},L.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},L.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},L.prototype.toggleRubberband=function(n){const t=this.getPlugin("selection");return t&&t.toggleRubberband(n),this},L.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},L.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},L.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},L.prototype.toggleStrictRubberband=function(n){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(n),this},L.prototype.setRubberbandModifiers=function(n){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(n),this},L.prototype.setSelectionFilter=function(n){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(n),this},L.prototype.setSelectionDisplayContent=function(n){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(n),this},L.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},L.prototype.cleanSelection=function(n){const t=this.getPlugin("selection");return t&&t.clean(n),this},L.prototype.resetSelection=function(n,t){const e=this.getPlugin("selection");return e&&e.reset(n,t),this},L.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},L.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},L.prototype.isSelected=function(n){const t=this.getPlugin("selection");return t?t.isSelected(n):!1},L.prototype.select=function(n,t){const e=this.getPlugin("selection");return e&&e.select(n,t),this},L.prototype.unselect=function(n,t){const e=this.getPlugin("selection");return e&&e.unselect(n,t),this};var Pj=function(n,t,e,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(t,e,i):o(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};class oi extends Nt{get rubberbandDisabled(){return this.options.enabled!==!0||this.options.rubberband!==!0}get disabled(){return this.options.enabled!==!0}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(t={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},oi.defaultOptions),t),jr(this.name,Mj)}init(t){this.graph=t,this.selectionImpl=new Yb(Object.assign(Object.assign({},this.options),{graph:t})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(t){return t!=null?t!==this.isEnabled()&&(t?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(t){return t!=null?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return this.options.movable!==!1}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(t){return t!=null?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(t){return t!=null?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return this.selectionImpl.options.strict===!0}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(t){return t!=null?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.setModifiers(t)}setSelectionFilter(t){return this.setFilter(t),this}setSelectionDisplayContent(t){return this.setContent(t),this}isEmpty(){return this.length<=0}clean(t={}){return this.selectionImpl.clean(t),this}reset(t,e={}){return this.selectionImpl.reset(t?this.getCells(t):[],e),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(t){return this.selectionImpl.isSelected(t)}select(t,e={}){const s=this.getCells(t);return s.length&&(this.isMultiple()?this.selectionImpl.select(s,e):this.reset(s.slice(0,1),e)),this}unselect(t,e={}){return this.selectionImpl.unselect(this.getCells(t),e),this}setup(){this.selectionImpl.on("*",(t,e)=>{this.trigger(t,e),this.graph.trigger(t,e)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){if(!this.allowBlankMouseDown(t))return;const e=this.graph.panning.allowPanning(t,!0),s=this.graph.getPlugin("scroller"),r=s&&s.allowPanning(t,!0);(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!r&&!e)&&this.startRubberband(t)}allowBlankMouseDown(t){const e=this.options.eventTypes;return(e==null?void 0:e.includes("leftMouseDown"))&&t.button===0||(e==null?void 0:e.includes("mouseWheelDown"))&&t.button===1}onBlankClick(){this.clean()}allowRubberband(t,e){return!this.rubberbandDisabled&&ms.isMatch(t,this.options.modifiers,e)}allowMultipleSelection(t){return this.isMultiple()&&ms.isMatch(t,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const s=this.options;let r=this.disabled;!r&&this.movedMap.has(e)&&(r=s.selectCellOnMoved===!1,r||(r=s.selectNodeOnMoved===!1&&e.isNode()),r||(r=s.selectEdgeOnMoved===!1&&e.isEdge())),r||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}getCells(t){return(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?this.graph.getCellById(e):e).filter(e=>e!=null)}startRubberband(t){return this.rubberbandDisabled||this.selectionImpl.startSelecting(t),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(t){return this.options.modifiers=t,this}setContent(t){return this.selectionImpl.setContent(t),this}setFilter(t){return this.selectionImpl.setFilter(t),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),$r(this.name)}}Pj([Nt.dispose()],oi.prototype,"dispose",null),function(n){n.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]}}(oi||(oi={}));const Aj=()=>new er({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),Tj=()=>new zb,Nj=()=>new Hb,_j=()=>new Ub({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),kj=["tools","ports"],Dj=()=>new ii({beforeAddCommand:(n,t)=>{if(kj.includes(t.key))return!1}}),Rj=()=>new oi({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),Ij=n=>{const t=n.getSelectedCells();t.length&&n.removeCells(t)},Lj=n=>{const t=n.getSelectedCells();t.length&&n.copy(t)},Bj=n=>{if(!n.isClipboardEmpty()){const t=n.paste({offset:32});n.cleanSelection(),n.select(t)}},Vj=n=>{n.canUndo()&&n.undo()},jj=n=>{n.canRedo()&&n.redo()},$j=n=>{n.addTools([{name:"vertices",args:{snapRadius:3,attrs:{r:3,fill:"#239edd",cursor:"move","stroke-width":2}}},{name:"segments",args:{attrs:{stroke:"#239edd",strokeWidth:2,strokeDasharray:"5 5"}}},{name:"source-arrowhead",args:{attrs:{stroke:"#239edd"}}},{name:"target-arrowhead",args:{attrs:{stroke:"#239edd"}}}])},Wb=()=>Math.random(),zj={class:"page-container"},Fj={class:"tool-bar"},Hj={class:"action"},Uj={class:"el-dropdown-link"},Gj={class:"action",style:{"margin-right":"50px"}},Yj={class:"board"},Wj={class:"drawing-board-box"},qj={id:"controls"},Jj={key:0,class:"controls-label"},Xj={style:{width:"100%",height:"100%",background:"black"}},qb=Gn(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""}},emits:["getJson"],setup(n,{emit:t}){const e=n,s=c.ref(),r=c.reactive({label:"",component:c.shallowRef(null)}),i=c.ref(null),o=c.ref(null),a=()=>{const k=document.getElementById("drawing-board");s.value=new L({container:k,autoResize:!0,panning:!0,mousewheel:!0,connecting:{snap:!0,allowEdge:!0,highlight:!0,router:"orth",connectionPoint:{name:"anchor"},anchor:"center",createEdge(){return s.value.createEdge({inherit:"edge",attrs:{...vu},zIndex:0})}}}),s.value.use(Aj()),s.value.use(Tj()),s.value.use(Nj()),s.value.use(_j()),s.value.use(Dj()),s.value.use(Rj()),s.value.bindKey(["delete","backspace"],()=>{Ij(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{Lj(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{Bj(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{Vj(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{jj(s.value)});let R=null;s.value.on("edge:mouseenter",({cell:I})=>{clearTimeout(R),I.toFront(),$j(I)}),s.value.on("edge:mouseleave",({cell:I})=>{R=setTimeout(()=>{I.toBack(),I.removeTools()},300)}),s.value.on("node:mouseenter",()=>{Wi("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Wi("#drawing-board",!1)}),s.value.use(new Bb),s.value.on("blank:click",({e:I,x:A,y:P})=>{o.value=s,r.component=$D,r.label="画布属性",i.value=Wb()}),s.value.on("cell:click",({cell:I})=>{var A,P;if(o.value=I,i.value=Wb(),((A=I.data)==null?void 0:A.type)==="text"){r.component=Dm,r.label="文本属性";return}if(((P=I.data)==null?void 0:P.type)==="base-shape"){r.component=Dm,r.label="基础图形属性";return}if((I==null?void 0:I.shape)==="edge"){r.component=qD,r.label="连线属性";return}if((I==null?void 0:I.shape)==="image"){r.component=tj,r.label="图片属性";return}r.component=null,r.label=null})},l=c.ref(),u=()=>{l.value=new si({target:s.value,...LD,groups:[{name:"基础组件",graphPadding:30}],search(I,A){var P;return((P=I.label)==null?void 0:P.indexOf(A))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:I=>{const A=I.clone({keepId:!0});return A.label!=="文本"&&(A.label=""),A}});const k=s.value.createNode({...BD}),R=ml.map(I=>(I.ports=Vb,s.value.createNode(I)));l.value.load([k,...R],"基础组件"),Yi("/cny/custom/groupList").then(I=>{const A=(I==null?void 0:I.data)||[];A==null||A.forEach(P=>{l.value.addGroup({name:P==null?void 0:P.groupName,graphPadding:30});const B=P==null?void 0:P.pictureList.map(j=>{const Y={shape:"image",imageUrl:j==null?void 0:j.imageUrl,ports:Vb,width:64,height:64,label:j.imageName};return s.value.createNode(Y)});l.value.load(B,P==null?void 0:P.groupName),document.getElementById("stencil").appendChild(l.value.container)})}).finally(()=>{setTimeout(()=>{l.value.container.querySelectorAll(".x6-node").forEach((A,P)=>{if(P>ml.length){const B=A.querySelector("text");A.style.position="relative",B&&(B.style.display="none",B.setAttribute("x","0%"),B.setAttribute("y","40"),B.style.fontSize="12px",B.style.fill="#ffffff")}A.addEventListener("mouseenter",B=>{if(P>ml.length){const j=A.querySelector("text");j&&(j.style.display="block")}}),A.addEventListener("mouseleave",B=>{if(P>ml.length){const j=A.querySelector("text");j&&(j.style.display="none")}})})},200)})},h=k=>{switch(k){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),Yt.warning("关闭对齐线")):(s.value.enableSnapline(),Yt.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),Yt.warning("关闭框选")):(s.value.enableSelection(),Yt.success("开启框选"));break;case"drawLine":g();break;case"adaptive":p();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},f=c.ref(!1),d=c.ref(null),g=()=>{f.value=!0;const k=new Date;s.value.startBatch(k),s.value.disablePanning(),s.value.once("blank:mousedown",({e:R,x:I,y:A})=>{f.value&&(d.value=s.value.addEdge({source:{x:I,y:A},target:{x:I,y:A},attrs:vu,data:{type:"edge",isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:R,x:I,y:A})=>{f.value&&d.value.setTarget({x:I,y:A})}),s.value.on("blank:mouseup",({e:R,x:I,y:A})=>{f.value=!1,s.value.enablePanning(),s.value.stopBatch(k)})},p=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=c.reactive({show:!1}),y=()=>{m.show=!0},b=c.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(_m),s.value.drawGrid(km),Yt.success("清空成功")},v=()=>{const k=G().format("YYYYMMDDHHmmss");s.value.exportPNG(k,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},S=t,E=c.reactive({show:!1,background:null,grid:null,data:null}),C=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},M=()=>{S("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},T=async()=>{if(!e.id){s.value.drawBackground(_m),s.value.drawGrid(km),s.value.fromJSON({cells:[]});return}const{background:k,grid:R,data:I}=await Nm(e.id);s.value.drawBackground(k),s.value.drawGrid(R),s.value.fromJSON(I),p()},_=c.shallowRef(null),N=()=>{new ResizeObserver(()=>{p()}).observe(_.value)};return c.onMounted(()=>{a(),u(),T(),N()}),(k,R)=>{const I=c.resolveComponent("el-icon"),A=c.resolveComponent("el-button"),P=c.resolveComponent("el-dropdown-item"),B=c.resolveComponent("el-dropdown-menu"),j=c.resolveComponent("el-dropdown"),Y=c.resolveComponent("el-scrollbar"),ot=c.resolveComponent("el-dialog"),F=c.resolveComponent("el-drawer");return c.openBlock(),c.createElementBlock("div",zj,[c.createElementVNode("div",Fj,[c.createElementVNode("div",Hj,[c.createVNode(j,{onCommand:h},{dropdown:c.withCtx(()=>[c.createVNode(B,null,{default:c.withCtx(()=>[c.createVNode(P,{command:"snapLine"},{default:c.withCtx(()=>R[4]||(R[4]=[c.createTextVNode("对齐线")])),_:1}),c.createVNode(P,{command:"select"},{default:c.withCtx(()=>R[5]||(R[5]=[c.createTextVNode("框选")])),_:1}),c.createVNode(P,{command:"drawLine"},{default:c.withCtx(()=>R[6]||(R[6]=[c.createTextVNode("绘制直线")])),_:1}),c.createVNode(P,{command:"adaptive"},{default:c.withCtx(()=>R[7]||(R[7]=[c.createTextVNode("视图自适应")])),_:1}),c.createVNode(P,{command:"shortcuts"},{default:c.withCtx(()=>R[8]||(R[8]=[c.createTextVNode("查看快捷键")])),_:1}),c.createVNode(P,{command:"image"},{default:c.withCtx(()=>R[9]||(R[9]=[c.createTextVNode("图片管理")])),_:1}),c.createVNode(P,{command:"clear"},{default:c.withCtx(()=>R[10]||(R[10]=[c.createTextVNode("清空画布")])),_:1}),c.createVNode(P,{command:"export"},{default:c.withCtx(()=>R[11]||(R[11]=[c.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:c.withCtx(()=>[c.createElementVNode("span",Uj,[c.createVNode(A,{size:"small",text:""},{default:c.withCtx(()=>[R[3]||(R[3]=c.createTextVNode("工具 ")),c.createVNode(I,null,{default:c.withCtx(()=>[c.createVNode(c.unref(B2))]),_:1})]),_:1})])]),_:1})]),c.createElementVNode("div",Gj,[c.createVNode(c.unref(Rp),{content:"预览",placement:"bottom"},{default:c.withCtx(()=>[c.createVNode(A,{size:"small",icon:c.unref(Cg),onClick:C},null,8,["icon"])]),_:1}),c.createVNode(c.unref(Rp),{content:"保存",placement:"bottom"},{default:c.withCtx(()=>[c.createVNode(A,{size:"small",icon:c.unref(Y2),onClick:M},null,8,["icon"])]),_:1})])]),c.createElementVNode("div",Yj,[R[12]||(R[12]=c.createElementVNode("div",{id:"stencil"},null,-1)),c.createElementVNode("div",Wj,[c.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:_},null,512)]),c.createElementVNode("div",qj,[r.label?(c.openBlock(),c.createElementBlock("div",Jj,c.toDisplayString(r.label),1)):c.createCommentVNode("",!0),c.createVNode(Y,null,{default:c.withCtx(()=>[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value},null,8,["graph","payload"]))]),_:1})])]),c.createVNode(ot,{modelValue:m.show,"onUpdate:modelValue":R[0]||(R[0]=H=>m.show=H),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[c.createVNode(XD)]),_:1},8,["modelValue"]),c.createVNode(ot,{modelValue:b.show,"onUpdate:modelValue":R[1]||(R[1]=H=>b.show=H),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:c.withCtx(()=>[c.createVNode(uj)]),_:1},8,["modelValue"]),c.createVNode(F,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":R[2]||(R[2]=H=>E.show=H),title:"预览",direction:"ttb",size:"100%"},{default:c.withCtx(()=>[c.createElementVNode("div",Xj,[E.show?(c.openBlock(),c.createBlock(hh,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):c.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-bb675844"]]),Kj=[qb,hh],Jb=(n,t)=>{Kj.forEach(e=>{n.component(e.name,e)})};typeof window<"u"&&window.Vue&&Jb(window.Vue);const Zj={install:Jb};Rt.WiringDiagramEditor=qb,Rt.WiringDiagramPreview=hh,Rt.default=Zj,Rt.setBaseURL=kD,Rt.setToken=DD,Object.defineProperties(Rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|