vue-wiring-diagram 1.1.21 → 1.1.22

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.
@@ -3,26 +3,26 @@
3
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
4
  //! license : MIT
5
5
  //! momentjs.com
6
- var Td;function X(){return Td.apply(null,arguments)}function S0(n){Td=n}function Qt(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Rs(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function ve(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Al(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;for(e in n)if(ve(n,e))return!1;return!0}function vt(n){return n===void 0}function Rn(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function wi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function kd(n,e){var t=[],s,r=n.length;for(s=0;s<r;++s)t.push(e(n[s],s));return t}function rs(n,e){for(var t in e)ve(e,t)&&(n[t]=e[t]);return ve(e,"toString")&&(n.toString=e.toString),ve(e,"valueOf")&&(n.valueOf=e.valueOf),n}function vn(n,e,t,s){return ih(n,e,t,s,!0).utc()}function E0(){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 de(n){return n._pf==null&&(n._pf=E0()),n._pf}var _l;Array.prototype.some?_l=Array.prototype.some:_l=function(n){var e=Object(this),t=e.length>>>0,s;for(s=0;s<t;s++)if(s in e&&n.call(this,e[s],s,e))return!0;return!1};function Tl(n){var e=null,t=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(e=de(n),t=_l.call(e.parsedDateParts,function(r){return r!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),n._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=s;else return s;return n._isValid}function Oo(n){var e=vn(NaN);return n!=null?rs(de(e),n):de(e).userInvalidated=!0,e}var Vd=X.momentProperties=[],kl=!1;function Vl(n,e){var t,s,r,i=Vd.length;if(vt(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),vt(e._i)||(n._i=e._i),vt(e._f)||(n._f=e._f),vt(e._l)||(n._l=e._l),vt(e._strict)||(n._strict=e._strict),vt(e._tzm)||(n._tzm=e._tzm),vt(e._isUTC)||(n._isUTC=e._isUTC),vt(e._offset)||(n._offset=e._offset),vt(e._pf)||(n._pf=de(e)),vt(e._locale)||(n._locale=e._locale),i>0)for(t=0;t<i;t++)s=Vd[t],r=e[s],vt(r)||(n[s]=r);return n}function xi(n){Vl(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),kl===!1&&(kl=!0,X.updateOffset(this),kl=!1)}function en(n){return n instanceof xi||n!=null&&n._isAMomentObject!=null}function Dd(n){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function Bt(n,e){var t=!0;return rs(function(){if(X.deprecationHandler!=null&&X.deprecationHandler(null,n),t){var s=[],r,i,o,a=arguments.length;for(i=0;i<a;i++){if(r="",typeof arguments[i]=="object"){r+=`
7
- [`+i+"] ";for(o in arguments[0])ve(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];s.push(r)}Dd(n+`
6
+ var kd;function X(){return kd.apply(null,arguments)}function S0(n){kd=n}function Qt(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Rs(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function ve(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Al(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var e;for(e in n)if(ve(n,e))return!1;return!0}function vt(n){return n===void 0}function Rn(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function wi(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Vd(n,e){var t=[],s,r=n.length;for(s=0;s<r;++s)t.push(e(n[s],s));return t}function rs(n,e){for(var t in e)ve(e,t)&&(n[t]=e[t]);return ve(e,"toString")&&(n.toString=e.toString),ve(e,"valueOf")&&(n.valueOf=e.valueOf),n}function vn(n,e,t,s){return oh(n,e,t,s,!0).utc()}function E0(){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 de(n){return n._pf==null&&(n._pf=E0()),n._pf}var _l;Array.prototype.some?_l=Array.prototype.some:_l=function(n){var e=Object(this),t=e.length>>>0,s;for(s=0;s<t;s++)if(s in e&&n.call(this,e[s],s,e))return!0;return!1};function Tl(n){var e=null,t=!1,s=n._d&&!isNaN(n._d.getTime());if(s&&(e=de(n),t=_l.call(e.parsedDateParts,function(r){return r!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),n._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=s;else return s;return n._isValid}function Oo(n){var e=vn(NaN);return n!=null?rs(de(e),n):de(e).userInvalidated=!0,e}var Dd=X.momentProperties=[],kl=!1;function Vl(n,e){var t,s,r,i=Dd.length;if(vt(e._isAMomentObject)||(n._isAMomentObject=e._isAMomentObject),vt(e._i)||(n._i=e._i),vt(e._f)||(n._f=e._f),vt(e._l)||(n._l=e._l),vt(e._strict)||(n._strict=e._strict),vt(e._tzm)||(n._tzm=e._tzm),vt(e._isUTC)||(n._isUTC=e._isUTC),vt(e._offset)||(n._offset=e._offset),vt(e._pf)||(n._pf=de(e)),vt(e._locale)||(n._locale=e._locale),i>0)for(t=0;t<i;t++)s=Dd[t],r=e[s],vt(r)||(n[s]=r);return n}function xi(n){Vl(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),kl===!1&&(kl=!0,X.updateOffset(this),kl=!1)}function en(n){return n instanceof xi||n!=null&&n._isAMomentObject!=null}function Rd(n){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function Bt(n,e){var t=!0;return rs(function(){if(X.deprecationHandler!=null&&X.deprecationHandler(null,n),t){var s=[],r,i,o,a=arguments.length;for(i=0;i<a;i++){if(r="",typeof arguments[i]=="object"){r+=`
7
+ [`+i+"] ";for(o in arguments[0])ve(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[i];s.push(r)}Rd(n+`
8
8
  Arguments: `+Array.prototype.slice.call(s).join("")+`
9
- `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var Rd={};function Id(n,e){X.deprecationHandler!=null&&X.deprecationHandler(n,e),Rd[n]||(Dd(e),Rd[n]=!0)}X.suppressDeprecationWarnings=!1,X.deprecationHandler=null;function Cn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function O0(n){var e,t;for(t in n)ve(n,t)&&(e=n[t],Cn(e)?this[t]=e:this["_"+t]=e);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Dl(n,e){var t=rs({},n),s;for(s in e)ve(e,s)&&(Rs(n[s])&&Rs(e[s])?(t[s]={},rs(t[s],n[s]),rs(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in n)ve(n,s)&&!ve(e,s)&&Rs(n[s])&&(t[s]=rs({},t[s]));return t}function Rl(n){n!=null&&this.set(n)}var Il;Object.keys?Il=Object.keys:Il=function(n){var e,t=[];for(e in n)ve(n,e)&&t.push(e);return t};var M0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function P0(n,e,t){var s=this._calendar[n]||this._calendar.sameElse;return Cn(s)?s.call(e,t):s}function Sn(n,e,t){var s=""+Math.abs(n),r=e-s.length,i=n>=0;return(i?t?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+s}var Ll=/(\[[^\[]*\])|(\\)?([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,Mo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Bl={},dr={};function ie(n,e,t,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(dr[n]=r),e&&(dr[e[0]]=function(){return Sn(r.apply(this,arguments),e[1],e[2])}),t&&(dr[t]=function(){return this.localeData().ordinal(r.apply(this,arguments),n)})}function N0(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function A0(n){var e=n.match(Ll),t,s;for(t=0,s=e.length;t<s;t++)dr[e[t]]?e[t]=dr[e[t]]:e[t]=N0(e[t]);return function(r){var i="",o;for(o=0;o<s;o++)i+=Cn(e[o])?e[o].call(r,n):e[o];return i}}function Po(n,e){return n.isValid()?(e=Ld(e,n.localeData()),Bl[e]=Bl[e]||A0(e),Bl[e](n)):n.localeData().invalidDate()}function Ld(n,e){var t=5;function s(r){return e.longDateFormat(r)||r}for(Mo.lastIndex=0;t>=0&&Mo.test(n);)n=n.replace(Mo,s),Mo.lastIndex=0,t-=1;return n}var _0={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 T0(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(Ll).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var k0="Invalid date";function V0(){return this._invalidDate}var D0="%d",R0=/\d{1,2}/;function I0(n){return this._ordinal.replace("%d",n)}var L0={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 B0(n,e,t,s){var r=this._relativeTime[t];return Cn(r)?r(n,e,t,s):r.replace(/%d/i,n)}function j0(n,e){var t=this._relativeTime[n>0?"future":"past"];return Cn(t)?t(e):t.replace(/%s/i,e)}var Bd={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 jt(n){return typeof n=="string"?Bd[n]||Bd[n.toLowerCase()]:void 0}function jl(n){var e={},t,s;for(s in n)ve(n,s)&&(t=jt(s),t&&(e[t]=n[s]));return e}var $0={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 z0(n){var e=[],t;for(t in n)ve(n,t)&&e.push({unit:t,priority:$0[t]});return e.sort(function(s,r){return s.priority-r.priority}),e}var jd=/\d/,_t=/\d\d/,$d=/\d{3}/,$l=/\d{4}/,No=/[+-]?\d{6}/,Ae=/\d\d?/,zd=/\d\d\d\d?/,Fd=/\d\d\d\d\d\d?/,Ao=/\d{1,3}/,zl=/\d{1,4}/,_o=/[+-]?\d{1,6}/,hr=/\d+/,To=/[+-]?\d+/,F0=/Z|[+-]\d\d:?\d\d/gi,ko=/Z|[+-]\d\d(?::?\d\d)?/gi,U0=/[+-]?\d+(\.\d{1,3})?/,vi=/[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,fr=/^[1-9]\d?/,Fl=/^([1-9]\d|\d)/,Vo;Vo={};function Q(n,e,t){Vo[n]=Cn(e)?e:function(s,r){return s&&t?t:e}}function H0(n,e){return ve(Vo,n)?Vo[n](e._strict,e._locale):new RegExp(G0(n))}function G0(n){return In(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,r,i){return t||s||r||i}))}function In(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $t(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function me(n){var e=+n,t=0;return e!==0&&isFinite(e)&&(t=$t(e)),t}var Ul={};function Oe(n,e){var t,s=e,r;for(typeof n=="string"&&(n=[n]),Rn(e)&&(s=function(i,o){o[e]=me(i)}),r=n.length,t=0;t<r;t++)Ul[n[t]]=s}function Ci(n,e){Oe(n,function(t,s,r,i){r._w=r._w||{},e(t,r._w,r,i)})}function W0(n,e,t){e!=null&&ve(Ul,n)&&Ul[n](e,t._a,t,n)}function Do(n){return n%4===0&&n%100!==0||n%400===0}var ht=0,Ln=1,En=2,Qe=3,tn=4,Bn=5,Is=6,Y0=7,q0=8;ie("Y",0,0,function(){var n=this.year();return n<=9999?Sn(n,4):"+"+n}),ie(0,["YY",2],0,function(){return this.year()%100}),ie(0,["YYYY",4],0,"year"),ie(0,["YYYYY",5],0,"year"),ie(0,["YYYYYY",6,!0],0,"year"),Q("Y",To),Q("YY",Ae,_t),Q("YYYY",zl,$l),Q("YYYYY",_o,No),Q("YYYYYY",_o,No),Oe(["YYYYY","YYYYYY"],ht),Oe("YYYY",function(n,e){e[ht]=n.length===2?X.parseTwoDigitYear(n):me(n)}),Oe("YY",function(n,e){e[ht]=X.parseTwoDigitYear(n)}),Oe("Y",function(n,e){e[ht]=parseInt(n,10)});function Si(n){return Do(n)?366:365}X.parseTwoDigitYear=function(n){return me(n)+(me(n)>68?1900:2e3)};var Ud=pr("FullYear",!0);function X0(){return Do(this.year())}function pr(n,e){return function(t){return t!=null?(Hd(this,n,t),X.updateOffset(this,e),this):Ei(this,n)}}function Ei(n,e){if(!n.isValid())return NaN;var t=n._d,s=n._isUTC;switch(e){case"Milliseconds":return s?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return s?t.getUTCSeconds():t.getSeconds();case"Minutes":return s?t.getUTCMinutes():t.getMinutes();case"Hours":return s?t.getUTCHours():t.getHours();case"Date":return s?t.getUTCDate():t.getDate();case"Day":return s?t.getUTCDay():t.getDay();case"Month":return s?t.getUTCMonth():t.getMonth();case"FullYear":return s?t.getUTCFullYear():t.getFullYear();default:return NaN}}function Hd(n,e,t){var s,r,i,o,a;if(!(!n.isValid()||isNaN(t))){switch(s=n._d,r=n._isUTC,e){case"Milliseconds":return void(r?s.setUTCMilliseconds(t):s.setMilliseconds(t));case"Seconds":return void(r?s.setUTCSeconds(t):s.setSeconds(t));case"Minutes":return void(r?s.setUTCMinutes(t):s.setMinutes(t));case"Hours":return void(r?s.setUTCHours(t):s.setHours(t));case"Date":return void(r?s.setUTCDate(t):s.setDate(t));case"FullYear":break;default:return}i=t,o=n.month(),a=n.date(),a=a===29&&o===1&&!Do(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function J0(n){return n=jt(n),Cn(this[n])?this[n]():this}function K0(n,e){if(typeof n=="object"){n=jl(n);var t=z0(n),s,r=t.length;for(s=0;s<r;s++)this[t[s].unit](n[t[s].unit])}else if(n=jt(n),Cn(this[n]))return this[n](e);return this}function Z0(n,e){return(n%e+e)%e}var ze;Array.prototype.indexOf?ze=Array.prototype.indexOf:ze=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function Hl(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=Z0(e,12);return n+=(e-t)/12,t===1?Do(n)?29:28:31-t%7%2}ie("M",["MM",2],"Mo",function(){return this.month()+1}),ie("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),ie("MMMM",0,0,function(n){return this.localeData().months(this,n)}),Q("M",Ae,fr),Q("MM",Ae,_t),Q("MMM",function(n,e){return e.monthsShortRegex(n)}),Q("MMMM",function(n,e){return e.monthsRegex(n)}),Oe(["M","MM"],function(n,e){e[Ln]=me(n)-1}),Oe(["MMM","MMMM"],function(n,e,t,s){var r=t._locale.monthsParse(n,s,t._strict);r!=null?e[Ln]=r:de(t).invalidMonth=n});var Q0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Gd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Wd=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ew=vi,tw=vi;function nw(n,e){return n?Qt(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Wd).test(e)?"format":"standalone"][n.month()]:Qt(this._months)?this._months:this._months.standalone}function sw(n,e){return n?Qt(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Wd.test(e)?"format":"standalone"][n.month()]:Qt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function rw(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)i=vn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return t?e==="MMM"?(r=ze.call(this._shortMonthsParse,o),r!==-1?r:null):(r=ze.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=ze.call(this._shortMonthsParse,o),r!==-1?r:(r=ze.call(this._longMonthsParse,o),r!==-1?r:null)):(r=ze.call(this._longMonthsParse,o),r!==-1?r:(r=ze.call(this._shortMonthsParse,o),r!==-1?r:null))}function iw(n,e,t){var s,r,i;if(this._monthsParseExact)return rw.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=vn([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!t&&!this._monthsParse[s]&&(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[s].test(n))return s;if(t&&e==="MMM"&&this._shortMonthsParse[s].test(n))return s;if(!t&&this._monthsParse[s].test(n))return s}}function Yd(n,e){if(!n.isValid())return n;if(typeof e=="string"){if(/^\d+$/.test(e))e=me(e);else if(e=n.localeData().monthsParse(e),!Rn(e))return n}var t=e,s=n.date();return s=s<29?s:Math.min(s,Hl(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,s):n._d.setMonth(t,s),n}function qd(n){return n!=null?(Yd(this,n),X.updateOffset(this,!0),this):Ei(this,"Month")}function ow(){return Hl(this.year(),this.month())}function aw(n){return this._monthsParseExact?(ve(this,"_monthsRegex")||Xd.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(ve(this,"_monthsShortRegex")||(this._monthsShortRegex=ew),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function lw(n){return this._monthsParseExact?(ve(this,"_monthsRegex")||Xd.call(this),n?this._monthsStrictRegex:this._monthsRegex):(ve(this,"_monthsRegex")||(this._monthsRegex=tw),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Xd(){function n(c,u){return u.length-c.length}var e=[],t=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=vn([2e3,r]),o=In(this.monthsShort(i,"")),a=In(this.months(i,"")),e.push(o),t.push(a),s.push(a),s.push(o);e.sort(n),t.sort(n),s.sort(n),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function cw(n,e,t,s,r,i,o){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,s,r,i,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,s,r,i,o),a}function Oi(n){var e,t;return n<100&&n>=0?(t=Array.prototype.slice.call(arguments),t[0]=n+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(n)):e=new Date(Date.UTC.apply(null,arguments)),e}function Ro(n,e,t){var s=7+e-t,r=(7+Oi(n,0,s).getUTCDay()-e)%7;return-r+s-1}function Jd(n,e,t,s,r){var i=(7+t-s)%7,o=Ro(n,s,r),a=1+7*(e-1)+i+o,c,u;return a<=0?(c=n-1,u=Si(c)+a):a>Si(n)?(c=n+1,u=a-Si(n)):(c=n,u=a),{year:c,dayOfYear:u}}function Mi(n,e,t){var s=Ro(n.year(),e,t),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+jn(o,e,t)):r>jn(n.year(),e,t)?(i=r-jn(n.year(),e,t),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function jn(n,e,t){var s=Ro(n,e,t),r=Ro(n+1,e,t);return(Si(n)-s+r)/7}ie("w",["ww",2],"wo","week"),ie("W",["WW",2],"Wo","isoWeek"),Q("w",Ae,fr),Q("ww",Ae,_t),Q("W",Ae,fr),Q("WW",Ae,_t),Ci(["w","ww","W","WW"],function(n,e,t,s){e[s.substr(0,1)]=me(n)});function uw(n){return Mi(n,this._week.dow,this._week.doy).week}var dw={dow:0,doy:6};function hw(){return this._week.dow}function fw(){return this._week.doy}function pw(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function gw(n){var e=Mi(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}ie("d",0,"do","day"),ie("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),ie("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),ie("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),ie("e",0,0,"weekday"),ie("E",0,0,"isoWeekday"),Q("d",Ae),Q("e",Ae),Q("E",Ae),Q("dd",function(n,e){return e.weekdaysMinRegex(n)}),Q("ddd",function(n,e){return e.weekdaysShortRegex(n)}),Q("dddd",function(n,e){return e.weekdaysRegex(n)}),Ci(["dd","ddd","dddd"],function(n,e,t,s){var r=t._locale.weekdaysParse(n,s,t._strict);r!=null?e.d=r:de(t).invalidWeekday=n}),Ci(["d","e","E"],function(n,e,t,s){e[s]=me(n)});function mw(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function yw(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Gl(n,e){return n.slice(e,7).concat(n.slice(0,e))}var bw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Kd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ww="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xw=vi,vw=vi,Cw=vi;function Sw(n,e){var t=Qt(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?Gl(t,this._week.dow):n?t[n.day()]:t}function Ew(n){return n===!0?Gl(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function Ow(n){return n===!0?Gl(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function Mw(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=vn([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 t?e==="dddd"?(r=ze.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=ze.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=ze.call(this._weekdaysParse,o),r!==-1||(r=ze.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=ze.call(this._shortWeekdaysParse,o),r!==-1||(r=ze.call(this._weekdaysParse,o),r!==-1)?r:(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=ze.call(this._minWeekdaysParse,o),r!==-1||(r=ze.call(this._weekdaysParse,o),r!==-1)?r:(r=ze.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function Pw(n,e,t){var s,r,i;if(this._weekdaysParseExact)return Mw.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=vn([2e3,1]).day(s),t&&!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")),t&&e==="dddd"&&this._fullWeekdaysParse[s].test(n))return s;if(t&&e==="ddd"&&this._shortWeekdaysParse[s].test(n))return s;if(t&&e==="dd"&&this._minWeekdaysParse[s].test(n))return s;if(!t&&this._weekdaysParse[s].test(n))return s}}function Nw(n){if(!this.isValid())return n!=null?this:NaN;var e=Ei(this,"Day");return n!=null?(n=mw(n,this.localeData()),this.add(n-e,"d")):e}function Aw(n){if(!this.isValid())return n!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return n==null?e:this.add(n-e,"d")}function _w(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=yw(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Tw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Wl.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(ve(this,"_weekdaysRegex")||(this._weekdaysRegex=xw),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function kw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Wl.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ve(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=vw),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Vw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Wl.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ve(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Cw),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wl(){function n(d,f){return f.length-d.length}var e=[],t=[],s=[],r=[],i,o,a,c,u;for(i=0;i<7;i++)o=vn([2e3,1]).day(i),a=In(this.weekdaysMin(o,"")),c=In(this.weekdaysShort(o,"")),u=In(this.weekdays(o,"")),e.push(a),t.push(c),s.push(u),r.push(a),r.push(c),r.push(u);e.sort(n),t.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("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Yl(){return this.hours()%12||12}function Dw(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,Yl),ie("k",["kk",2],0,Dw),ie("hmm",0,0,function(){return""+Yl.apply(this)+Sn(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+Yl.apply(this)+Sn(this.minutes(),2)+Sn(this.seconds(),2)}),ie("Hmm",0,0,function(){return""+this.hours()+Sn(this.minutes(),2)}),ie("Hmmss",0,0,function(){return""+this.hours()+Sn(this.minutes(),2)+Sn(this.seconds(),2)});function Zd(n,e){ie(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Zd("a",!0),Zd("A",!1);function Qd(n,e){return e._meridiemParse}Q("a",Qd),Q("A",Qd),Q("H",Ae,Fl),Q("h",Ae,fr),Q("k",Ae,fr),Q("HH",Ae,_t),Q("hh",Ae,_t),Q("kk",Ae,_t),Q("hmm",zd),Q("hmmss",Fd),Q("Hmm",zd),Q("Hmmss",Fd),Oe(["H","HH"],Qe),Oe(["k","kk"],function(n,e,t){var s=me(n);e[Qe]=s===24?0:s}),Oe(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n}),Oe(["h","hh"],function(n,e,t){e[Qe]=me(n),de(t).bigHour=!0}),Oe("hmm",function(n,e,t){var s=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s)),de(t).bigHour=!0}),Oe("hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s,2)),e[Bn]=me(n.substr(r)),de(t).bigHour=!0}),Oe("Hmm",function(n,e,t){var s=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s))}),Oe("Hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s,2)),e[Bn]=me(n.substr(r))});function Rw(n){return(n+"").toLowerCase().charAt(0)==="p"}var Iw=/[ap]\.?m?\.?/i,Lw=pr("Hours",!0);function Bw(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var eh={calendar:M0,longDateFormat:_0,invalidDate:k0,ordinal:D0,dayOfMonthOrdinalParse:R0,relativeTime:L0,months:Q0,monthsShort:Gd,week:dw,weekdays:bw,weekdaysMin:ww,weekdaysShort:Kd,meridiemParse:Iw},Re={},Pi={},Ni;function jw(n,e){var t,s=Math.min(n.length,e.length);for(t=0;t<s;t+=1)if(n[t]!==e[t])return t;return s}function th(n){return n&&n.toLowerCase().replace("_","-")}function $w(n){for(var e=0,t,s,r,i;e<n.length;){for(i=th(n[e]).split("-"),t=i.length,s=th(n[e+1]),s=s?s.split("-"):null;t>0;){if(r=Io(i.slice(0,t).join("-")),r)return r;if(s&&s.length>=t&&jw(i,s)>=t-1)break;t--}e++}return Ni}function zw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function Io(n){var e=null,t;if(Re[n]===void 0&&typeof module<"u"&&module&&module.exports&&zw(n))try{e=Ni._abbr,t=require,t("./locale/"+n),is(e)}catch{Re[n]=null}return Re[n]}function is(n,e){var t;return n&&(vt(e)?t=$n(n):t=ql(n,e),t?Ni=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Ni._abbr}function ql(n,e){if(e!==null){var t,s=eh;if(e.abbr=n,Re[n]!=null)Id("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=Re[n]._config;else if(e.parentLocale!=null)if(Re[e.parentLocale]!=null)s=Re[e.parentLocale]._config;else if(t=Io(e.parentLocale),t!=null)s=t._config;else return Pi[e.parentLocale]||(Pi[e.parentLocale]=[]),Pi[e.parentLocale].push({name:n,config:e}),null;return Re[n]=new Rl(Dl(s,e)),Pi[n]&&Pi[n].forEach(function(r){ql(r.name,r.config)}),is(n),Re[n]}else return delete Re[n],null}function Fw(n,e){if(e!=null){var t,s,r=eh;Re[n]!=null&&Re[n].parentLocale!=null?Re[n].set(Dl(Re[n]._config,e)):(s=Io(n),s!=null&&(r=s._config),e=Dl(r,e),s==null&&(e.abbr=n),t=new Rl(e),t.parentLocale=Re[n],Re[n]=t),is(n)}else Re[n]!=null&&(Re[n].parentLocale!=null?(Re[n]=Re[n].parentLocale,n===is()&&is(n)):Re[n]!=null&&delete Re[n]);return Re[n]}function $n(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Ni;if(!Qt(n)){if(e=Io(n),e)return e;n=[n]}return $w(n)}function Uw(){return Il(Re)}function Xl(n){var e,t=n._a;return t&&de(n).overflow===-2&&(e=t[Ln]<0||t[Ln]>11?Ln:t[En]<1||t[En]>Hl(t[ht],t[Ln])?En:t[Qe]<0||t[Qe]>24||t[Qe]===24&&(t[tn]!==0||t[Bn]!==0||t[Is]!==0)?Qe:t[tn]<0||t[tn]>59?tn:t[Bn]<0||t[Bn]>59?Bn:t[Is]<0||t[Is]>999?Is:-1,de(n)._overflowDayOfYear&&(e<ht||e>En)&&(e=En),de(n)._overflowWeeks&&e===-1&&(e=Y0),de(n)._overflowWeekday&&e===-1&&(e=q0),de(n).overflow=e),n}var Hw=/^\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)?)?$/,Gw=/^\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)?)?$/,Ww=/Z|[+-]\d\d(?::?\d\d)?/,Lo=[["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/]],Yw=/^\/?Date\((-?\d+)/i,qw=/^(?:(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}))$/,Xw={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 nh(n){var e,t,s=n._i,r=Hw.exec(s)||Gw.exec(s),i,o,a,c,u=Lo.length,d=Jl.length;if(r){for(de(n).iso=!0,e=0,t=u;e<t;e++)if(Lo[e][1].exec(r[1])){o=Lo[e][0],i=Lo[e][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(e=0,t=d;e<t;e++)if(Jl[e][1].exec(r[3])){a=(r[2]||" ")+Jl[e][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(Ww.exec(r[4]))c="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(c||""),Zl(n)}else n._isValid=!1}function Jw(n,e,t,s,r,i){var o=[Kw(n),Gd.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Kw(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Zw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Qw(n,e,t){if(n){var s=Kd.indexOf(n),r=new Date(e[0],e[1],e[2]).getDay();if(s!==r)return de(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function ex(n,e,t){if(n)return Xw[n];if(e)return 0;var s=parseInt(t,10),r=s%100,i=(s-r)/100;return i*60+r}function sh(n){var e=qw.exec(Zw(n._i)),t;if(e){if(t=Jw(e[4],e[3],e[2],e[5],e[6],e[7]),!Qw(e[1],t,n))return;n._a=t,n._tzm=ex(e[8],e[9],e[10]),n._d=Oi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),de(n).rfc2822=!0}else n._isValid=!1}function tx(n){var e=Yw.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(nh(n),n._isValid===!1)delete n._isValid;else return;if(sh(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:X.createFromInputFallback(n)}X.createFromInputFallback=Bt("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 gr(n,e,t){return n??e??t}function nx(n){var e=new Date(X.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Kl(n){var e,t,s=[],r,i,o;if(!n._d){for(r=nx(n),n._w&&n._a[En]==null&&n._a[Ln]==null&&sx(n),n._dayOfYear!=null&&(o=gr(n._a[ht],r[ht]),(n._dayOfYear>Si(o)||n._dayOfYear===0)&&(de(n)._overflowDayOfYear=!0),t=Oi(o,0,n._dayOfYear),n._a[Ln]=t.getUTCMonth(),n._a[En]=t.getUTCDate()),e=0;e<3&&n._a[e]==null;++e)n._a[e]=s[e]=r[e];for(;e<7;e++)n._a[e]=s[e]=n._a[e]==null?e===2?1:0:n._a[e];n._a[Qe]===24&&n._a[tn]===0&&n._a[Bn]===0&&n._a[Is]===0&&(n._nextDay=!0,n._a[Qe]=0),n._d=(n._useUTC?Oi:cw).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[Qe]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(de(n).weekdayMismatch=!0)}}function sx(n){var e,t,s,r,i,o,a,c,u;e=n._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,o=4,t=gr(e.GG,n._a[ht],Mi(_e(),1,4).year),s=gr(e.W,1),r=gr(e.E,1),(r<1||r>7)&&(c=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=Mi(_e(),i,o),t=gr(e.gg,n._a[ht],u.year),s=gr(e.w,u.week),e.d!=null?(r=e.d,(r<0||r>6)&&(c=!0)):e.e!=null?(r=e.e+i,(e.e<0||e.e>6)&&(c=!0)):r=i),s<1||s>jn(t,i,o)?de(n)._overflowWeeks=!0:c!=null?de(n)._overflowWeekday=!0:(a=Jd(t,s,r,i,o),n._a[ht]=a.year,n._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){},X.RFC_2822=function(){};function Zl(n){if(n._f===X.ISO_8601){nh(n);return}if(n._f===X.RFC_2822){sh(n);return}n._a=[],de(n).empty=!0;var e=""+n._i,t,s,r,i,o,a=e.length,c=0,u,d;for(r=Ld(n._f,n._locale).match(Ll)||[],d=r.length,t=0;t<d;t++)i=r[t],s=(e.match(H0(i,n))||[])[0],s&&(o=e.substr(0,e.indexOf(s)),o.length>0&&de(n).unusedInput.push(o),e=e.slice(e.indexOf(s)+s.length),c+=s.length),dr[i]?(s?de(n).empty=!1:de(n).unusedTokens.push(i),W0(i,s,n)):n._strict&&!s&&de(n).unusedTokens.push(i);de(n).charsLeftOver=a-c,e.length>0&&de(n).unusedInput.push(e),n._a[Qe]<=12&&de(n).bigHour===!0&&n._a[Qe]>0&&(de(n).bigHour=void 0),de(n).parsedDateParts=n._a.slice(0),de(n).meridiem=n._meridiem,n._a[Qe]=rx(n._locale,n._a[Qe],n._meridiem),u=de(n).era,u!==null&&(n._a[ht]=n._locale.erasConvertYear(u,n._a[ht])),Kl(n),Xl(n)}function rx(n,e,t){var s;return t==null?e:n.meridiemHour!=null?n.meridiemHour(e,t):(n.isPM!=null&&(s=n.isPM(t),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function ix(n){var e,t,s,r,i,o,a=!1,c=n._f.length;if(c===0){de(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<c;r++)i=0,o=!1,e=Vl({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[r],Zl(e),Tl(e)&&(o=!0),i+=de(e).charsLeftOver,i+=de(e).unusedTokens.length*10,de(e).score=i,a?i<s&&(s=i,t=e):(s==null||i<s||o)&&(s=i,t=e,o&&(a=!0));rs(n,t||e)}function ox(n){if(!n._d){var e=jl(n._i),t=e.day===void 0?e.date:e.day;n._a=kd([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),Kl(n)}}function ax(n){var e=new xi(Xl(rh(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function rh(n){var e=n._i,t=n._f;return n._locale=n._locale||$n(n._l),e===null||t===void 0&&e===""?Oo({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),en(e)?new xi(Xl(e)):(wi(e)?n._d=e:Qt(t)?ix(n):t?Zl(n):lx(n),Tl(n)||(n._d=null),n))}function lx(n){var e=n._i;vt(e)?n._d=new Date(X.now()):wi(e)?n._d=new Date(e.valueOf()):typeof e=="string"?tx(n):Qt(e)?(n._a=kd(e.slice(0),function(t){return parseInt(t,10)}),Kl(n)):Rs(e)?ox(n):Rn(e)?n._d=new Date(e):X.createFromInputFallback(n)}function ih(n,e,t,s,r){var i={};return(e===!0||e===!1)&&(s=e,e=void 0),(t===!0||t===!1)&&(s=t,t=void 0),(Rs(n)&&Al(n)||Qt(n)&&n.length===0)&&(n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=t,i._i=n,i._f=e,i._strict=s,ax(i)}function _e(n,e,t,s){return ih(n,e,t,s,!1)}var cx=Bt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=_e.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:Oo()}),ux=Bt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=_e.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:Oo()});function oh(n,e){var t,s;if(e.length===1&&Qt(e[0])&&(e=e[0]),!e.length)return _e();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][n](t))&&(t=e[s]);return t}function dx(){var n=[].slice.call(arguments,0);return oh("isBefore",n)}function hx(){var n=[].slice.call(arguments,0);return oh("isAfter",n)}var fx=function(){return Date.now?Date.now():+new Date},Ai=["year","quarter","month","week","day","hour","minute","second","millisecond"];function px(n){var e,t=!1,s,r=Ai.length;for(e in n)if(ve(n,e)&&!(ze.call(Ai,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(s=0;s<r;++s)if(n[Ai[s]]){if(t)return!1;parseFloat(n[Ai[s]])!==me(n[Ai[s]])&&(t=!0)}return!0}function gx(){return this._isValid}function mx(){return nn(NaN)}function Bo(n){var e=jl(n),t=e.year||0,s=e.quarter||0,r=e.month||0,i=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,c=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=px(e),this._milliseconds=+d+u*1e3+c*6e4+a*1e3*60*60,this._days=+o+i*7,this._months=+r+s*3+t*12,this._data={},this._locale=$n(),this._bubble()}function jo(n){return n instanceof Bo}function Ql(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function yx(n,e,t){var s=Math.min(n.length,e.length),r=Math.abs(n.length-e.length),i=0,o;for(o=0;o<s;o++)me(n[o])!==me(e[o])&&i++;return i+r}function ah(n,e){ie(n,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+Sn(~~(t/60),2)+e+Sn(~~t%60,2)})}ah("Z",":"),ah("ZZ",""),Q("Z",ko),Q("ZZ",ko),Oe(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=ec(ko,n)});var bx=/([\+\-]|\d\d)/gi;function ec(n,e){var t=(e||"").match(n),s,r,i;return t===null?null:(s=t[t.length-1]||[],r=(s+"").match(bx)||["-",0,0],i=+(r[1]*60)+me(r[2]),i===0?0:r[0]==="+"?i:-i)}function tc(n,e){var t,s;return e._isUTC?(t=e.clone(),s=(en(n)||wi(n)?n.valueOf():_e(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),X.updateOffset(t,!1),t):_e(n).local()}function nc(n){return-Math.round(n._d.getTimezoneOffset())}X.updateOffset=function(){};function wx(n,e,t){var s=this._offset||0,r;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=ec(ko,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(r=nc(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!e||this._changeInProgress?dh(this,nn(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:nc(this)}function xx(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function vx(n){return this.utcOffset(0,n)}function Cx(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(nc(this),"m")),this}function Sx(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=ec(F0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Ex(n){return this.isValid()?(n=n?_e(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function Ox(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Mx(){if(!vt(this._isDSTShifted))return this._isDSTShifted;var n={},e;return Vl(n,this),n=rh(n),n._a?(e=n._isUTC?vn(n._a):_e(n._a),this._isDSTShifted=this.isValid()&&yx(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Px(){return this.isValid()?!this._isUTC:!1}function Nx(){return this.isValid()?this._isUTC:!1}function lh(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ax=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,_x=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function nn(n,e){var t=n,s=null,r,i,o;return jo(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:Rn(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(s=Ax.exec(n))?(r=s[1]==="-"?-1:1,t={y:0,d:me(s[En])*r,h:me(s[Qe])*r,m:me(s[tn])*r,s:me(s[Bn])*r,ms:me(Ql(s[Is]*1e3))*r}):(s=_x.exec(n))?(r=s[1]==="-"?-1:1,t={y:Ls(s[2],r),M:Ls(s[3],r),w:Ls(s[4],r),d:Ls(s[5],r),h:Ls(s[6],r),m:Ls(s[7],r),s:Ls(s[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(o=Tx(_e(t.from),_e(t.to)),t={},t.ms=o.milliseconds,t.M=o.months),i=new Bo(t),jo(n)&&ve(n,"_locale")&&(i._locale=n._locale),jo(n)&&ve(n,"_isValid")&&(i._isValid=n._isValid),i}nn.fn=Bo.prototype,nn.invalid=mx;function Ls(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function ch(n,e){var t={};return t.months=e.month()-n.month()+(e.year()-n.year())*12,n.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+n.clone().add(t.months,"M"),t}function Tx(n,e){var t;return n.isValid()&&e.isValid()?(e=tc(e,n),n.isBefore(e)?t=ch(n,e):(t=ch(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function uh(n,e){return function(t,s){var r,i;return s!==null&&!isNaN(+s)&&(Id(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=t,t=s,s=i),r=nn(t,s),dh(this,r,n),this}}function dh(n,e,t,s){var r=e._milliseconds,i=Ql(e._days),o=Ql(e._months);n.isValid()&&(s=s??!0,o&&Yd(n,Ei(n,"Month")+o*t),i&&Hd(n,"Date",Ei(n,"Date")+i*t),r&&n._d.setTime(n._d.valueOf()+r*t),s&&X.updateOffset(n,i||o))}var kx=uh(1,"add"),Vx=uh(-1,"subtract");function hh(n){return typeof n=="string"||n instanceof String}function Dx(n){return en(n)||wi(n)||hh(n)||Rn(n)||Ix(n)||Rx(n)||n===null||n===void 0}function Rx(n){var e=Rs(n)&&!Al(n),t=!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],t=t||ve(n,i);return e&&t}function Ix(n){var e=Qt(n),t=!1;return e&&(t=n.filter(function(s){return!Rn(s)&&hh(n)}).length===0),e&&t}function Lx(n){var e=Rs(n)&&!Al(n),t=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,i;for(r=0;r<s.length;r+=1)i=s[r],t=t||ve(n,i);return e&&t}function Bx(n,e){var t=n.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function jx(n,e){arguments.length===1&&(arguments[0]?Dx(arguments[0])?(n=arguments[0],e=void 0):Lx(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||_e(),s=tc(t,this).startOf("day"),r=X.calendarFormat(this,s)||"sameElse",i=e&&(Cn(e[r])?e[r].call(this,t):e[r]);return this.format(i||this.localeData().calendar(r,this,_e(t)))}function $x(){return new xi(this)}function zx(n,e){var t=en(n)?n:_e(n);return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function Fx(n,e){var t=en(n)?n:_e(n);return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function Ux(n,e,t,s){var r=en(n)?n:_e(n),i=en(e)?e:_e(e);return this.isValid()&&r.isValid()&&i.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(r,t):!this.isBefore(r,t))&&(s[1]===")"?this.isBefore(i,t):!this.isAfter(i,t))):!1}function Hx(n,e){var t=en(n)?n:_e(n),s;return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(s=t.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function Gx(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function Wx(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function Yx(n,e,t){var s,r,i;if(!this.isValid())return NaN;if(s=tc(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,e=jt(e),e){case"year":i=$o(this,s)/12;break;case"month":i=$o(this,s);break;case"quarter":i=$o(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 t?i:$t(i)}function $o(n,e){if(n.date()<e.date())return-$o(e,n);var t=(e.year()-n.year())*12+(e.month()-n.month()),s=n.clone().add(t,"months"),r,i;return e-s<0?(r=n.clone().add(t-1,"months"),i=(e-s)/(s-r)):(r=n.clone().add(t+1,"months"),i=(e-s)/(r-s)),-(t+i)||0}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function qx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Xx(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?Po(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Cn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Po(t,"Z")):Po(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jx(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",e="",t,s,r,i;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+n+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(t+s+r+i)}function Kx(n){n||(n=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=Po(this,n);return this.localeData().postformat(e)}function Zx(n,e){return this.isValid()&&(en(n)&&n.isValid()||_e(n).isValid())?nn({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qx(n){return this.from(_e(),n)}function e1(n,e){return this.isValid()&&(en(n)&&n.isValid()||_e(n).isValid())?nn({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function t1(n){return this.to(_e(),n)}function fh(n){var e;return n===void 0?this._locale._abbr:(e=$n(n),e!=null&&(this._locale=e),this)}var ph=Bt("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 gh(){return this._locale}var zo=1e3,mr=60*zo,Fo=60*mr,mh=(365*400+97)*24*Fo;function yr(n,e){return(n%e+e)%e}function yh(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-mh:new Date(n,e,t).valueOf()}function bh(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-mh:Date.UTC(n,e,t)}function n1(n){var e,t;if(n=jt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?bh:yh,n){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=yr(e+(this._isUTC?0:this.utcOffset()*mr),Fo);break;case"minute":e=this._d.valueOf(),e-=yr(e,mr);break;case"second":e=this._d.valueOf(),e-=yr(e,zo);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function s1(n){var e,t;if(n=jt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?bh:yh,n){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Fo-yr(e+(this._isUTC?0:this.utcOffset()*mr),Fo)-1;break;case"minute":e=this._d.valueOf(),e+=mr-yr(e,mr)-1;break;case"second":e=this._d.valueOf(),e+=zo-yr(e,zo)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function r1(){return this._d.valueOf()-(this._offset||0)*6e4}function i1(){return Math.floor(this.valueOf()/1e3)}function o1(){return new Date(this.valueOf())}function a1(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function l1(){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 c1(){return this.isValid()?this.toISOString():null}function u1(){return Tl(this)}function d1(){return rs({},de(this))}function h1(){return de(this).overflow}function f1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ie("N",0,0,"eraAbbr"),ie("NN",0,0,"eraAbbr"),ie("NNN",0,0,"eraAbbr"),ie("NNNN",0,0,"eraName"),ie("NNNNN",0,0,"eraNarrow"),ie("y",["y",1],"yo","eraYear"),ie("y",["yy",2],0,"eraYear"),ie("y",["yyy",3],0,"eraYear"),ie("y",["yyyy",4],0,"eraYear"),Q("N",sc),Q("NN",sc),Q("NNN",sc),Q("NNNN",E1),Q("NNNNN",O1),Oe(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,s){var r=t._locale.erasParse(n,s,t._strict);r?de(t).era=r:de(t).invalidEra=n}),Q("y",hr),Q("yy",hr),Q("yyy",hr),Q("yyyy",hr),Q("yo",M1),Oe(["y","yy","yyy","yyyy"],ht),Oe(["yo"],function(n,e,t,s){var r;t._locale._eraYearOrdinalRegex&&(r=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[ht]=t._locale.eraYearOrdinalParse(n,r):e[ht]=parseInt(n,10)});function p1(n,e){var t,s,r,i=this._eras||$n("en")._eras;for(t=0,s=i.length;t<s;++t){switch(typeof i[t].since){case"string":r=X(i[t].since).startOf("day"),i[t].since=r.valueOf();break}switch(typeof i[t].until){case"undefined":i[t].until=1/0;break;case"string":r=X(i[t].until).startOf("day").valueOf(),i[t].until=r.valueOf();break}}return i}function g1(n,e,t){var s,r,i=this.eras(),o,a,c;for(n=n.toUpperCase(),s=0,r=i.length;s<r;++s)if(o=i[s].name.toUpperCase(),a=i[s].abbr.toUpperCase(),c=i[s].narrow.toUpperCase(),t)switch(e){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(c===n)return i[s];break}else if([o,a,c].indexOf(n)>=0)return i[s]}function m1(n,e){var t=n.since<=n.until?1:-1;return e===void 0?X(n.since).year():X(n.since).year()+(e-n.offset)*t}function y1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].name;return""}function b1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].narrow;return""}function w1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].abbr;return""}function x1(){var n,e,t,s,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=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()-X(r[n].since).year())*t+r[n].offset;return this.year()}function v1(n){return ve(this,"_erasNameRegex")||rc.call(this),n?this._erasNameRegex:this._erasRegex}function C1(n){return ve(this,"_erasAbbrRegex")||rc.call(this),n?this._erasAbbrRegex:this._erasRegex}function S1(n){return ve(this,"_erasNarrowRegex")||rc.call(this),n?this._erasNarrowRegex:this._erasRegex}function sc(n,e){return e.erasAbbrRegex(n)}function E1(n,e){return e.erasNameRegex(n)}function O1(n,e){return e.erasNarrowRegex(n)}function M1(n,e){return e._eraYearOrdinalRegex||hr}function rc(){var n=[],e=[],t=[],s=[],r,i,o,a,c,u=this.eras();for(r=0,i=u.length;r<i;++r)o=In(u[r].name),a=In(u[r].abbr),c=In(u[r].narrow),e.push(o),n.push(a),t.push(c),s.push(o),s.push(a),s.push(c);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}ie(0,["gg",2],0,function(){return this.weekYear()%100}),ie(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Uo(n,e){ie(0,[n,n.length],0,e)}Uo("gggg","weekYear"),Uo("ggggg","weekYear"),Uo("GGGG","isoWeekYear"),Uo("GGGGG","isoWeekYear"),Q("G",To),Q("g",To),Q("GG",Ae,_t),Q("gg",Ae,_t),Q("GGGG",zl,$l),Q("gggg",zl,$l),Q("GGGGG",_o,No),Q("ggggg",_o,No),Ci(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,s){e[s.substr(0,2)]=me(n)}),Ci(["gg","GG"],function(n,e,t,s){e[s]=X.parseTwoDigitYear(n)});function P1(n){return wh.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function N1(n){return wh.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function A1(){return jn(this.year(),1,4)}function _1(){return jn(this.isoWeekYear(),1,4)}function T1(){var n=this.localeData()._week;return jn(this.year(),n.dow,n.doy)}function k1(){var n=this.localeData()._week;return jn(this.weekYear(),n.dow,n.doy)}function wh(n,e,t,s,r){var i;return n==null?Mi(this,s,r).year:(i=jn(n,s,r),e>i&&(e=i),V1.call(this,n,e,t,s,r))}function V1(n,e,t,s,r){var i=Jd(n,e,t,s,r),o=Oi(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}ie("Q",0,"Qo","quarter"),Q("Q",jd),Oe("Q",function(n,e){e[Ln]=(me(n)-1)*3});function D1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}ie("D",["DD",2],"Do","date"),Q("D",Ae,fr),Q("DD",Ae,_t),Q("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Oe(["D","DD"],En),Oe("Do",function(n,e){e[En]=me(n.match(Ae)[0])});var xh=pr("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",Ao),Q("DDDD",$d),Oe(["DDD","DDDD"],function(n,e,t){t._dayOfYear=me(n)});function R1(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}ie("m",["mm",2],0,"minute"),Q("m",Ae,Fl),Q("mm",Ae,_t),Oe(["m","mm"],tn);var I1=pr("Minutes",!1);ie("s",["ss",2],0,"second"),Q("s",Ae,Fl),Q("ss",Ae,_t),Oe(["s","ss"],Bn);var L1=pr("Seconds",!1);ie("S",0,0,function(){return~~(this.millisecond()/100)}),ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ie(0,["SSS",3],0,"millisecond"),ie(0,["SSSS",4],0,function(){return this.millisecond()*10}),ie(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Q("S",Ao,jd),Q("SS",Ao,_t),Q("SSS",Ao,$d);var os,vh;for(os="SSSS";os.length<=9;os+="S")Q(os,hr);function B1(n,e){e[Is]=me(("0."+n)*1e3)}for(os="S";os.length<=9;os+="S")Oe(os,B1);vh=pr("Milliseconds",!1),ie("z",0,0,"zoneAbbr"),ie("zz",0,0,"zoneName");function j1(){return this._isUTC?"UTC":""}function $1(){return this._isUTC?"Coordinated Universal Time":""}var H=xi.prototype;H.add=kx,H.calendar=jx,H.clone=$x,H.diff=Yx,H.endOf=s1,H.format=Kx,H.from=Zx,H.fromNow=Qx,H.to=e1,H.toNow=t1,H.get=J0,H.invalidAt=h1,H.isAfter=zx,H.isBefore=Fx,H.isBetween=Ux,H.isSame=Hx,H.isSameOrAfter=Gx,H.isSameOrBefore=Wx,H.isValid=u1,H.lang=ph,H.locale=fh,H.localeData=gh,H.max=ux,H.min=cx,H.parsingFlags=d1,H.set=K0,H.startOf=n1,H.subtract=Vx,H.toArray=a1,H.toObject=l1,H.toDate=o1,H.toISOString=Xx,H.inspect=Jx,typeof Symbol<"u"&&Symbol.for!=null&&(H[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),H.toJSON=c1,H.toString=qx,H.unix=i1,H.valueOf=r1,H.creationData=f1,H.eraName=y1,H.eraNarrow=b1,H.eraAbbr=w1,H.eraYear=x1,H.year=Ud,H.isLeapYear=X0,H.weekYear=P1,H.isoWeekYear=N1,H.quarter=H.quarters=D1,H.month=qd,H.daysInMonth=ow,H.week=H.weeks=pw,H.isoWeek=H.isoWeeks=gw,H.weeksInYear=T1,H.weeksInWeekYear=k1,H.isoWeeksInYear=A1,H.isoWeeksInISOWeekYear=_1,H.date=xh,H.day=H.days=Nw,H.weekday=Aw,H.isoWeekday=_w,H.dayOfYear=R1,H.hour=H.hours=Lw,H.minute=H.minutes=I1,H.second=H.seconds=L1,H.millisecond=H.milliseconds=vh,H.utcOffset=wx,H.utc=vx,H.local=Cx,H.parseZone=Sx,H.hasAlignedHourOffset=Ex,H.isDST=Ox,H.isLocal=Px,H.isUtcOffset=Nx,H.isUtc=lh,H.isUTC=lh,H.zoneAbbr=j1,H.zoneName=$1,H.dates=Bt("dates accessor is deprecated. Use date instead.",xh),H.months=Bt("months accessor is deprecated. Use month instead",qd),H.years=Bt("years accessor is deprecated. Use year instead",Ud),H.zone=Bt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",xx),H.isDSTShifted=Bt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Mx);function z1(n){return _e(n*1e3)}function F1(){return _e.apply(null,arguments).parseZone()}function Ch(n){return n}var Ce=Rl.prototype;Ce.calendar=P0,Ce.longDateFormat=T0,Ce.invalidDate=V0,Ce.ordinal=I0,Ce.preparse=Ch,Ce.postformat=Ch,Ce.relativeTime=B0,Ce.pastFuture=j0,Ce.set=O0,Ce.eras=p1,Ce.erasParse=g1,Ce.erasConvertYear=m1,Ce.erasAbbrRegex=C1,Ce.erasNameRegex=v1,Ce.erasNarrowRegex=S1,Ce.months=nw,Ce.monthsShort=sw,Ce.monthsParse=iw,Ce.monthsRegex=lw,Ce.monthsShortRegex=aw,Ce.week=uw,Ce.firstDayOfYear=fw,Ce.firstDayOfWeek=hw,Ce.weekdays=Sw,Ce.weekdaysMin=Ow,Ce.weekdaysShort=Ew,Ce.weekdaysParse=Pw,Ce.weekdaysRegex=Tw,Ce.weekdaysShortRegex=kw,Ce.weekdaysMinRegex=Vw,Ce.isPM=Rw,Ce.meridiem=Bw;function Ho(n,e,t,s){var r=$n(),i=vn().set(s,e);return r[t](i,n)}function Sh(n,e,t){if(Rn(n)&&(e=n,n=void 0),n=n||"",e!=null)return Ho(n,e,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Ho(n,s,t,"month");return r}function ic(n,e,t,s){typeof n=="boolean"?(Rn(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,Rn(e)&&(t=e,e=void 0),e=e||"");var r=$n(),i=n?r._week.dow:0,o,a=[];if(t!=null)return Ho(e,(t+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Ho(e,(o+i)%7,s,"day");return a}function U1(n,e){return Sh(n,e,"months")}function H1(n,e){return Sh(n,e,"monthsShort")}function G1(n,e,t){return ic(n,e,t,"weekdays")}function W1(n,e,t){return ic(n,e,t,"weekdaysShort")}function Y1(n,e,t){return ic(n,e,t,"weekdaysMin")}is("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 e=n%10,t=me(n%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return n+t}}),X.lang=Bt("moment.lang is deprecated. Use moment.locale instead.",is),X.langData=Bt("moment.langData is deprecated. Use moment.localeData instead.",$n);var zn=Math.abs;function q1(){var n=this._data;return this._milliseconds=zn(this._milliseconds),this._days=zn(this._days),this._months=zn(this._months),n.milliseconds=zn(n.milliseconds),n.seconds=zn(n.seconds),n.minutes=zn(n.minutes),n.hours=zn(n.hours),n.months=zn(n.months),n.years=zn(n.years),this}function Eh(n,e,t,s){var r=nn(e,t);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function X1(n,e){return Eh(this,n,e,1)}function J1(n,e){return Eh(this,n,e,-1)}function Oh(n){return n<0?Math.floor(n):Math.ceil(n)}function K1(){var n=this._milliseconds,e=this._days,t=this._months,s=this._data,r,i,o,a,c;return n>=0&&e>=0&&t>=0||n<=0&&e<=0&&t<=0||(n+=Oh(oc(t)+e)*864e5,e=0,t=0),s.milliseconds=n%1e3,r=$t(n/1e3),s.seconds=r%60,i=$t(r/60),s.minutes=i%60,o=$t(i/60),s.hours=o%24,e+=$t(o/24),c=$t(Mh(e)),t+=c,e-=Oh(oc(c)),a=$t(t/12),t%=12,s.days=e,s.months=t,s.years=a,this}function Mh(n){return n*4800/146097}function oc(n){return n*146097/4800}function Z1(n){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(n=jt(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+s/864e5,t=this._months+Mh(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(oc(this._months)),n){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+n)}}function Fn(n){return function(){return this.as(n)}}var Ph=Fn("ms"),Q1=Fn("s"),ev=Fn("m"),tv=Fn("h"),nv=Fn("d"),sv=Fn("w"),rv=Fn("M"),iv=Fn("Q"),ov=Fn("y"),av=Ph;function lv(){return nn(this)}function cv(n){return n=jt(n),this.isValid()?this[n+"s"]():NaN}function Bs(n){return function(){return this.isValid()?this._data[n]:NaN}}var uv=Bs("milliseconds"),dv=Bs("seconds"),hv=Bs("minutes"),fv=Bs("hours"),pv=Bs("days"),gv=Bs("months"),mv=Bs("years");function yv(){return $t(this.days()/7)}var Un=Math.round,br={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function bv(n,e,t,s,r){return r.relativeTime(e||1,!!t,n,s)}function wv(n,e,t,s){var r=nn(n).abs(),i=Un(r.as("s")),o=Un(r.as("m")),a=Un(r.as("h")),c=Un(r.as("d")),u=Un(r.as("M")),d=Un(r.as("w")),f=Un(r.as("y")),h=i<=t.ss&&["s",i]||i<t.s&&["ss",i]||o<=1&&["m"]||o<t.m&&["mm",o]||a<=1&&["h"]||a<t.h&&["hh",a]||c<=1&&["d"]||c<t.d&&["dd",c];return t.w!=null&&(h=h||d<=1&&["w"]||d<t.w&&["ww",d]),h=h||u<=1&&["M"]||u<t.M&&["MM",u]||f<=1&&["y"]||["yy",f],h[2]=e,h[3]=+n>0,h[4]=s,bv.apply(null,h)}function xv(n){return n===void 0?Un:typeof n=="function"?(Un=n,!0):!1}function vv(n,e){return br[n]===void 0?!1:e===void 0?br[n]:(br[n]=e,n==="s"&&(br.ss=e-1),!0)}function Cv(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=br,r,i;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(s=Object.assign({},br,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),r=this.localeData(),i=wv(this,!t,s,r),t&&(i=r.pastFuture(+this,i)),r.postformat(i)}var ac=Math.abs;function wr(n){return(n>0)-(n<0)||+n}function Go(){if(!this.isValid())return this.localeData().invalidDate();var n=ac(this._milliseconds)/1e3,e=ac(this._days),t=ac(this._months),s,r,i,o,a=this.asSeconds(),c,u,d,f;return a?(s=$t(n/60),r=$t(s/60),n%=60,s%=60,i=$t(t/12),t%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=wr(this._months)!==wr(a)?"-":"",d=wr(this._days)!==wr(a)?"-":"",f=wr(this._milliseconds)!==wr(a)?"-":"",c+"P"+(i?u+i+"Y":"")+(t?u+t+"M":"")+(e?d+e+"D":"")+(r||s||n?"T":"")+(r?f+r+"H":"")+(s?f+s+"M":"")+(n?f+o+"S":"")):"P0D"}var we=Bo.prototype;we.isValid=gx,we.abs=q1,we.add=X1,we.subtract=J1,we.as=Z1,we.asMilliseconds=Ph,we.asSeconds=Q1,we.asMinutes=ev,we.asHours=tv,we.asDays=nv,we.asWeeks=sv,we.asMonths=rv,we.asQuarters=iv,we.asYears=ov,we.valueOf=av,we._bubble=K1,we.clone=lv,we.get=cv,we.milliseconds=uv,we.seconds=dv,we.minutes=hv,we.hours=fv,we.days=pv,we.weeks=yv,we.months=gv,we.years=mv,we.humanize=Cv,we.toISOString=Go,we.toString=Go,we.toJSON=Go,we.locale=fh,we.localeData=gh,we.toIsoString=Bt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Go),we.lang=ph,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),Q("x",To),Q("X",U0),Oe("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)}),Oe("x",function(n,e,t){t._d=new Date(me(n))});//! moment.js
10
- X.version="2.30.1",S0(_e),X.fn=H,X.min=dx,X.max=hx,X.now=fx,X.utc=vn,X.unix=z1,X.months=U1,X.isDate=wi,X.locale=is,X.invalid=Oo,X.duration=nn,X.isMoment=en,X.weekdays=G1,X.parseZone=F1,X.localeData=$n,X.isDuration=jo,X.monthsShort=H1,X.weekdaysMin=Y1,X.defineLocale=ql,X.updateLocale=Fw,X.locales=Uw,X.weekdaysShort=W1,X.normalizeUnits=jt,X.relativeTimeRounding=xv,X.relativeTimeThreshold=vv,X.calendarFormat=Bx,X.prototype=H,X.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 Sv='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Ev=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,Nh=n=>Array.from(n.querySelectorAll(Sv)).filter(e=>Ov(e)&&Ev(e)),Ov=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}},Hn=(n,e,{checkForDefaultPrevented:t=!0}={})=>r=>{const i=n==null?void 0:n(r);if(t===!1||!i)return e==null?void 0:e(r)};var Ah;const We=typeof window<"u",Mv=n=>typeof n=="string",_h=()=>{},Pv=We&&((Ah=window==null?void 0:window.navigator)==null?void 0:Ah.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function lc(n){return typeof n=="function"?n():l.unref(n)}function Nv(n){return n}function Wo(n){return l.getCurrentScope()?(l.onScopeDispose(n),!0):!1}function Av(n,e=!0){l.getCurrentInstance()?l.onMounted(n):e?n():l.nextTick(n)}function _v(n,e,t={}){const{immediate:s=!0}=t,r=l.ref(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,o()}function c(...u){o(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,n(...u)},lc(e))}return s&&(r.value=!0,We&&c()),Wo(a),{isPending:l.readonly(r),start:c,stop:a}}function as(n){var e;const t=lc(n);return(e=t==null?void 0:t.$el)!=null?e:t}const cc=We?window:void 0;function Gn(...n){let e,t,s,r;if(Mv(n[0])||Array.isArray(n[0])?([t,s,r]=n,e=cc):[e,t,s,r]=n,!e)return _h;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},a=(d,f,h,p)=>(d.addEventListener(f,h,p),()=>d.removeEventListener(f,h,p)),c=l.watch(()=>[as(e),lc(r)],([d,f])=>{o(),d&&i.push(...t.flatMap(h=>s.map(p=>a(d,h,p,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return Wo(u),u}let Th=!1;function Tv(n,e,t={}){const{window:s=cc,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return;Pv&&!Th&&(Th=!0,Array.from(s.document.body.children).forEach(h=>h.addEventListener("click",_h)));let a=!0;const c=h=>r.some(p=>{if(typeof p=="string")return Array.from(s.document.querySelectorAll(p)).some(g=>g===h.target||h.composedPath().includes(g));{const g=as(p);return g&&(h.target===g||h.composedPath().includes(g))}}),d=[Gn(s,"click",h=>{const p=as(n);if(!(!p||p===h.target||h.composedPath().includes(p))){if(h.detail===0&&(a=!c(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:i}),Gn(s,"pointerdown",h=>{const p=as(n);p&&(a=!h.composedPath().includes(p)&&!c(h))},{passive:!0}),o&&Gn(s,"blur",h=>{var p;const g=as(n);((p=s.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(g!=null&&g.contains(s.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function kv(n,e=!1){const t=l.ref(),s=()=>t.value=!!n();return s(),Av(s,e),t}const kh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vh="__vueuse_ssr_handlers__";kh[Vh]=kh[Vh]||{};var Dh=Object.getOwnPropertySymbols,Vv=Object.prototype.hasOwnProperty,Dv=Object.prototype.propertyIsEnumerable,Rv=(n,e)=>{var t={};for(var s in n)Vv.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&Dh)for(var s of Dh(n))e.indexOf(s)<0&&Dv.call(n,s)&&(t[s]=n[s]);return t};function Rh(n,e,t={}){const s=t,{window:r=cc}=s,i=Rv(s,["window"]);let o;const a=kv(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},u=l.watch(()=>as(n),f=>{c(),a.value&&r&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Wo(d),{isSupported:a,stop:d}}var Ih;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(Ih||(Ih={}));var Iv=Object.defineProperty,Lh=Object.getOwnPropertySymbols,Lv=Object.prototype.hasOwnProperty,Bv=Object.prototype.propertyIsEnumerable,Bh=(n,e,t)=>e in n?Iv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jv=(n,e)=>{for(var t in e||(e={}))Lv.call(e,t)&&Bh(n,t,e[t]);if(Lh)for(var t of Lh(e))Bv.call(e,t)&&Bh(n,t,e[t]);return n};jv({linear:Nv},{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 $v=()=>We&&/firefox/i.test(window.navigator.userAgent);/**
9
+ `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var Id={};function Ld(n,e){X.deprecationHandler!=null&&X.deprecationHandler(n,e),Id[n]||(Rd(e),Id[n]=!0)}X.suppressDeprecationWarnings=!1,X.deprecationHandler=null;function Cn(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function O0(n){var e,t;for(t in n)ve(n,t)&&(e=n[t],Cn(e)?this[t]=e:this["_"+t]=e);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Dl(n,e){var t=rs({},n),s;for(s in e)ve(e,s)&&(Rs(n[s])&&Rs(e[s])?(t[s]={},rs(t[s],n[s]),rs(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in n)ve(n,s)&&!ve(e,s)&&Rs(n[s])&&(t[s]=rs({},t[s]));return t}function Rl(n){n!=null&&this.set(n)}var Il;Object.keys?Il=Object.keys:Il=function(n){var e,t=[];for(e in n)ve(n,e)&&t.push(e);return t};var M0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function P0(n,e,t){var s=this._calendar[n]||this._calendar.sameElse;return Cn(s)?s.call(e,t):s}function Sn(n,e,t){var s=""+Math.abs(n),r=e-s.length,i=n>=0;return(i?t?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+s}var Ll=/(\[[^\[]*\])|(\\)?([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,Mo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Bl={},dr={};function ie(n,e,t,s){var r=s;typeof s=="string"&&(r=function(){return this[s]()}),n&&(dr[n]=r),e&&(dr[e[0]]=function(){return Sn(r.apply(this,arguments),e[1],e[2])}),t&&(dr[t]=function(){return this.localeData().ordinal(r.apply(this,arguments),n)})}function N0(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function A0(n){var e=n.match(Ll),t,s;for(t=0,s=e.length;t<s;t++)dr[e[t]]?e[t]=dr[e[t]]:e[t]=N0(e[t]);return function(r){var i="",o;for(o=0;o<s;o++)i+=Cn(e[o])?e[o].call(r,n):e[o];return i}}function Po(n,e){return n.isValid()?(e=Bd(e,n.localeData()),Bl[e]=Bl[e]||A0(e),Bl[e](n)):n.localeData().invalidDate()}function Bd(n,e){var t=5;function s(r){return e.longDateFormat(r)||r}for(Mo.lastIndex=0;t>=0&&Mo.test(n);)n=n.replace(Mo,s),Mo.lastIndex=0,t-=1;return n}var _0={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 T0(n){var e=this._longDateFormat[n],t=this._longDateFormat[n.toUpperCase()];return e||!t?e:(this._longDateFormat[n]=t.match(Ll).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[n])}var k0="Invalid date";function V0(){return this._invalidDate}var D0="%d",R0=/\d{1,2}/;function I0(n){return this._ordinal.replace("%d",n)}var L0={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 B0(n,e,t,s){var r=this._relativeTime[t];return Cn(r)?r(n,e,t,s):r.replace(/%d/i,n)}function j0(n,e){var t=this._relativeTime[n>0?"future":"past"];return Cn(t)?t(e):t.replace(/%s/i,e)}var jd={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 jt(n){return typeof n=="string"?jd[n]||jd[n.toLowerCase()]:void 0}function jl(n){var e={},t,s;for(s in n)ve(n,s)&&(t=jt(s),t&&(e[t]=n[s]));return e}var $0={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 z0(n){var e=[],t;for(t in n)ve(n,t)&&e.push({unit:t,priority:$0[t]});return e.sort(function(s,r){return s.priority-r.priority}),e}var $d=/\d/,_t=/\d\d/,zd=/\d{3}/,$l=/\d{4}/,No=/[+-]?\d{6}/,Ae=/\d\d?/,Fd=/\d\d\d\d?/,Ud=/\d\d\d\d\d\d?/,Ao=/\d{1,3}/,zl=/\d{1,4}/,_o=/[+-]?\d{1,6}/,hr=/\d+/,To=/[+-]?\d+/,F0=/Z|[+-]\d\d:?\d\d/gi,ko=/Z|[+-]\d\d(?::?\d\d)?/gi,U0=/[+-]?\d+(\.\d{1,3})?/,vi=/[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,fr=/^[1-9]\d?/,Fl=/^([1-9]\d|\d)/,Vo;Vo={};function Q(n,e,t){Vo[n]=Cn(e)?e:function(s,r){return s&&t?t:e}}function H0(n,e){return ve(Vo,n)?Vo[n](e._strict,e._locale):new RegExp(G0(n))}function G0(n){return In(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,r,i){return t||s||r||i}))}function In(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $t(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function me(n){var e=+n,t=0;return e!==0&&isFinite(e)&&(t=$t(e)),t}var Ul={};function Oe(n,e){var t,s=e,r;for(typeof n=="string"&&(n=[n]),Rn(e)&&(s=function(i,o){o[e]=me(i)}),r=n.length,t=0;t<r;t++)Ul[n[t]]=s}function Ci(n,e){Oe(n,function(t,s,r,i){r._w=r._w||{},e(t,r._w,r,i)})}function W0(n,e,t){e!=null&&ve(Ul,n)&&Ul[n](e,t._a,t,n)}function Do(n){return n%4===0&&n%100!==0||n%400===0}var ht=0,Ln=1,En=2,Qe=3,tn=4,Bn=5,Is=6,Y0=7,q0=8;ie("Y",0,0,function(){var n=this.year();return n<=9999?Sn(n,4):"+"+n}),ie(0,["YY",2],0,function(){return this.year()%100}),ie(0,["YYYY",4],0,"year"),ie(0,["YYYYY",5],0,"year"),ie(0,["YYYYYY",6,!0],0,"year"),Q("Y",To),Q("YY",Ae,_t),Q("YYYY",zl,$l),Q("YYYYY",_o,No),Q("YYYYYY",_o,No),Oe(["YYYYY","YYYYYY"],ht),Oe("YYYY",function(n,e){e[ht]=n.length===2?X.parseTwoDigitYear(n):me(n)}),Oe("YY",function(n,e){e[ht]=X.parseTwoDigitYear(n)}),Oe("Y",function(n,e){e[ht]=parseInt(n,10)});function Si(n){return Do(n)?366:365}X.parseTwoDigitYear=function(n){return me(n)+(me(n)>68?1900:2e3)};var Hd=pr("FullYear",!0);function X0(){return Do(this.year())}function pr(n,e){return function(t){return t!=null?(Gd(this,n,t),X.updateOffset(this,e),this):Ei(this,n)}}function Ei(n,e){if(!n.isValid())return NaN;var t=n._d,s=n._isUTC;switch(e){case"Milliseconds":return s?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return s?t.getUTCSeconds():t.getSeconds();case"Minutes":return s?t.getUTCMinutes():t.getMinutes();case"Hours":return s?t.getUTCHours():t.getHours();case"Date":return s?t.getUTCDate():t.getDate();case"Day":return s?t.getUTCDay():t.getDay();case"Month":return s?t.getUTCMonth():t.getMonth();case"FullYear":return s?t.getUTCFullYear():t.getFullYear();default:return NaN}}function Gd(n,e,t){var s,r,i,o,a;if(!(!n.isValid()||isNaN(t))){switch(s=n._d,r=n._isUTC,e){case"Milliseconds":return void(r?s.setUTCMilliseconds(t):s.setMilliseconds(t));case"Seconds":return void(r?s.setUTCSeconds(t):s.setSeconds(t));case"Minutes":return void(r?s.setUTCMinutes(t):s.setMinutes(t));case"Hours":return void(r?s.setUTCHours(t):s.setHours(t));case"Date":return void(r?s.setUTCDate(t):s.setDate(t));case"FullYear":break;default:return}i=t,o=n.month(),a=n.date(),a=a===29&&o===1&&!Do(i)?28:a,r?s.setUTCFullYear(i,o,a):s.setFullYear(i,o,a)}}function J0(n){return n=jt(n),Cn(this[n])?this[n]():this}function K0(n,e){if(typeof n=="object"){n=jl(n);var t=z0(n),s,r=t.length;for(s=0;s<r;s++)this[t[s].unit](n[t[s].unit])}else if(n=jt(n),Cn(this[n]))return this[n](e);return this}function Z0(n,e){return(n%e+e)%e}var ze;Array.prototype.indexOf?ze=Array.prototype.indexOf:ze=function(n){var e;for(e=0;e<this.length;++e)if(this[e]===n)return e;return-1};function Hl(n,e){if(isNaN(n)||isNaN(e))return NaN;var t=Z0(e,12);return n+=(e-t)/12,t===1?Do(n)?29:28:31-t%7%2}ie("M",["MM",2],"Mo",function(){return this.month()+1}),ie("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),ie("MMMM",0,0,function(n){return this.localeData().months(this,n)}),Q("M",Ae,fr),Q("MM",Ae,_t),Q("MMM",function(n,e){return e.monthsShortRegex(n)}),Q("MMMM",function(n,e){return e.monthsRegex(n)}),Oe(["M","MM"],function(n,e){e[Ln]=me(n)-1}),Oe(["MMM","MMMM"],function(n,e,t,s){var r=t._locale.monthsParse(n,s,t._strict);r!=null?e[Ln]=r:de(t).invalidMonth=n});var Q0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Wd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ew=vi,tw=vi;function nw(n,e){return n?Qt(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Yd).test(e)?"format":"standalone"][n.month()]:Qt(this._months)?this._months:this._months.standalone}function sw(n,e){return n?Qt(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Yd.test(e)?"format":"standalone"][n.month()]:Qt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function rw(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)i=vn([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(i,"").toLocaleLowerCase();return t?e==="MMM"?(r=ze.call(this._shortMonthsParse,o),r!==-1?r:null):(r=ze.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=ze.call(this._shortMonthsParse,o),r!==-1?r:(r=ze.call(this._longMonthsParse,o),r!==-1?r:null)):(r=ze.call(this._longMonthsParse,o),r!==-1?r:(r=ze.call(this._shortMonthsParse,o),r!==-1?r:null))}function iw(n,e,t){var s,r,i;if(this._monthsParseExact)return rw.call(this,n,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(r=vn([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!t&&!this._monthsParse[s]&&(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[s].test(n))return s;if(t&&e==="MMM"&&this._shortMonthsParse[s].test(n))return s;if(!t&&this._monthsParse[s].test(n))return s}}function qd(n,e){if(!n.isValid())return n;if(typeof e=="string"){if(/^\d+$/.test(e))e=me(e);else if(e=n.localeData().monthsParse(e),!Rn(e))return n}var t=e,s=n.date();return s=s<29?s:Math.min(s,Hl(n.year(),t)),n._isUTC?n._d.setUTCMonth(t,s):n._d.setMonth(t,s),n}function Xd(n){return n!=null?(qd(this,n),X.updateOffset(this,!0),this):Ei(this,"Month")}function ow(){return Hl(this.year(),this.month())}function aw(n){return this._monthsParseExact?(ve(this,"_monthsRegex")||Jd.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(ve(this,"_monthsShortRegex")||(this._monthsShortRegex=ew),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function lw(n){return this._monthsParseExact?(ve(this,"_monthsRegex")||Jd.call(this),n?this._monthsStrictRegex:this._monthsRegex):(ve(this,"_monthsRegex")||(this._monthsRegex=tw),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Jd(){function n(c,u){return u.length-c.length}var e=[],t=[],s=[],r,i,o,a;for(r=0;r<12;r++)i=vn([2e3,r]),o=In(this.monthsShort(i,"")),a=In(this.months(i,"")),e.push(o),t.push(a),s.push(a),s.push(o);e.sort(n),t.sort(n),s.sort(n),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function cw(n,e,t,s,r,i,o){var a;return n<100&&n>=0?(a=new Date(n+400,e,t,s,r,i,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,e,t,s,r,i,o),a}function Oi(n){var e,t;return n<100&&n>=0?(t=Array.prototype.slice.call(arguments),t[0]=n+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(n)):e=new Date(Date.UTC.apply(null,arguments)),e}function Ro(n,e,t){var s=7+e-t,r=(7+Oi(n,0,s).getUTCDay()-e)%7;return-r+s-1}function Kd(n,e,t,s,r){var i=(7+t-s)%7,o=Ro(n,s,r),a=1+7*(e-1)+i+o,c,u;return a<=0?(c=n-1,u=Si(c)+a):a>Si(n)?(c=n+1,u=a-Si(n)):(c=n,u=a),{year:c,dayOfYear:u}}function Mi(n,e,t){var s=Ro(n.year(),e,t),r=Math.floor((n.dayOfYear()-s-1)/7)+1,i,o;return r<1?(o=n.year()-1,i=r+jn(o,e,t)):r>jn(n.year(),e,t)?(i=r-jn(n.year(),e,t),o=n.year()+1):(o=n.year(),i=r),{week:i,year:o}}function jn(n,e,t){var s=Ro(n,e,t),r=Ro(n+1,e,t);return(Si(n)-s+r)/7}ie("w",["ww",2],"wo","week"),ie("W",["WW",2],"Wo","isoWeek"),Q("w",Ae,fr),Q("ww",Ae,_t),Q("W",Ae,fr),Q("WW",Ae,_t),Ci(["w","ww","W","WW"],function(n,e,t,s){e[s.substr(0,1)]=me(n)});function uw(n){return Mi(n,this._week.dow,this._week.doy).week}var dw={dow:0,doy:6};function hw(){return this._week.dow}function fw(){return this._week.doy}function pw(n){var e=this.localeData().week(this);return n==null?e:this.add((n-e)*7,"d")}function gw(n){var e=Mi(this,1,4).week;return n==null?e:this.add((n-e)*7,"d")}ie("d",0,"do","day"),ie("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),ie("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),ie("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),ie("e",0,0,"weekday"),ie("E",0,0,"isoWeekday"),Q("d",Ae),Q("e",Ae),Q("E",Ae),Q("dd",function(n,e){return e.weekdaysMinRegex(n)}),Q("ddd",function(n,e){return e.weekdaysShortRegex(n)}),Q("dddd",function(n,e){return e.weekdaysRegex(n)}),Ci(["dd","ddd","dddd"],function(n,e,t,s){var r=t._locale.weekdaysParse(n,s,t._strict);r!=null?e.d=r:de(t).invalidWeekday=n}),Ci(["d","e","E"],function(n,e,t,s){e[s]=me(n)});function mw(n,e){return typeof n!="string"?n:isNaN(n)?(n=e.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function yw(n,e){return typeof n=="string"?e.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Gl(n,e){return n.slice(e,7).concat(n.slice(0,e))}var bw="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ww="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xw=vi,vw=vi,Cw=vi;function Sw(n,e){var t=Qt(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return n===!0?Gl(t,this._week.dow):n?t[n.day()]:t}function Ew(n){return n===!0?Gl(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function Ow(n){return n===!0?Gl(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function Mw(n,e,t){var s,r,i,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)i=vn([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 t?e==="dddd"?(r=ze.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=ze.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=ze.call(this._weekdaysParse,o),r!==-1||(r=ze.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=ze.call(this._shortWeekdaysParse,o),r!==-1||(r=ze.call(this._weekdaysParse,o),r!==-1)?r:(r=ze.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=ze.call(this._minWeekdaysParse,o),r!==-1||(r=ze.call(this._weekdaysParse,o),r!==-1)?r:(r=ze.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function Pw(n,e,t){var s,r,i;if(this._weekdaysParseExact)return Mw.call(this,n,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(r=vn([2e3,1]).day(s),t&&!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")),t&&e==="dddd"&&this._fullWeekdaysParse[s].test(n))return s;if(t&&e==="ddd"&&this._shortWeekdaysParse[s].test(n))return s;if(t&&e==="dd"&&this._minWeekdaysParse[s].test(n))return s;if(!t&&this._weekdaysParse[s].test(n))return s}}function Nw(n){if(!this.isValid())return n!=null?this:NaN;var e=Ei(this,"Day");return n!=null?(n=mw(n,this.localeData()),this.add(n-e,"d")):e}function Aw(n){if(!this.isValid())return n!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return n==null?e:this.add(n-e,"d")}function _w(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var e=yw(n,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Tw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Wl.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(ve(this,"_weekdaysRegex")||(this._weekdaysRegex=xw),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function kw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Wl.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ve(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=vw),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Vw(n){return this._weekdaysParseExact?(ve(this,"_weekdaysRegex")||Wl.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ve(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Cw),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wl(){function n(d,f){return f.length-d.length}var e=[],t=[],s=[],r=[],i,o,a,c,u;for(i=0;i<7;i++)o=vn([2e3,1]).day(i),a=In(this.weekdaysMin(o,"")),c=In(this.weekdaysShort(o,"")),u=In(this.weekdays(o,"")),e.push(a),t.push(c),s.push(u),r.push(a),r.push(c),r.push(u);e.sort(n),t.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("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Yl(){return this.hours()%12||12}function Dw(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,Yl),ie("k",["kk",2],0,Dw),ie("hmm",0,0,function(){return""+Yl.apply(this)+Sn(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+Yl.apply(this)+Sn(this.minutes(),2)+Sn(this.seconds(),2)}),ie("Hmm",0,0,function(){return""+this.hours()+Sn(this.minutes(),2)}),ie("Hmmss",0,0,function(){return""+this.hours()+Sn(this.minutes(),2)+Sn(this.seconds(),2)});function Qd(n,e){ie(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Qd("a",!0),Qd("A",!1);function eh(n,e){return e._meridiemParse}Q("a",eh),Q("A",eh),Q("H",Ae,Fl),Q("h",Ae,fr),Q("k",Ae,fr),Q("HH",Ae,_t),Q("hh",Ae,_t),Q("kk",Ae,_t),Q("hmm",Fd),Q("hmmss",Ud),Q("Hmm",Fd),Q("Hmmss",Ud),Oe(["H","HH"],Qe),Oe(["k","kk"],function(n,e,t){var s=me(n);e[Qe]=s===24?0:s}),Oe(["a","A"],function(n,e,t){t._isPm=t._locale.isPM(n),t._meridiem=n}),Oe(["h","hh"],function(n,e,t){e[Qe]=me(n),de(t).bigHour=!0}),Oe("hmm",function(n,e,t){var s=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s)),de(t).bigHour=!0}),Oe("hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s,2)),e[Bn]=me(n.substr(r)),de(t).bigHour=!0}),Oe("Hmm",function(n,e,t){var s=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s))}),Oe("Hmmss",function(n,e,t){var s=n.length-4,r=n.length-2;e[Qe]=me(n.substr(0,s)),e[tn]=me(n.substr(s,2)),e[Bn]=me(n.substr(r))});function Rw(n){return(n+"").toLowerCase().charAt(0)==="p"}var Iw=/[ap]\.?m?\.?/i,Lw=pr("Hours",!0);function Bw(n,e,t){return n>11?t?"pm":"PM":t?"am":"AM"}var th={calendar:M0,longDateFormat:_0,invalidDate:k0,ordinal:D0,dayOfMonthOrdinalParse:R0,relativeTime:L0,months:Q0,monthsShort:Wd,week:dw,weekdays:bw,weekdaysMin:ww,weekdaysShort:Zd,meridiemParse:Iw},Re={},Pi={},Ni;function jw(n,e){var t,s=Math.min(n.length,e.length);for(t=0;t<s;t+=1)if(n[t]!==e[t])return t;return s}function nh(n){return n&&n.toLowerCase().replace("_","-")}function $w(n){for(var e=0,t,s,r,i;e<n.length;){for(i=nh(n[e]).split("-"),t=i.length,s=nh(n[e+1]),s=s?s.split("-"):null;t>0;){if(r=Io(i.slice(0,t).join("-")),r)return r;if(s&&s.length>=t&&jw(i,s)>=t-1)break;t--}e++}return Ni}function zw(n){return!!(n&&n.match("^[^/\\\\]*$"))}function Io(n){var e=null,t;if(Re[n]===void 0&&typeof module<"u"&&module&&module.exports&&zw(n))try{e=Ni._abbr,t=require,t("./locale/"+n),is(e)}catch{Re[n]=null}return Re[n]}function is(n,e){var t;return n&&(vt(e)?t=$n(n):t=ql(n,e),t?Ni=t:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Ni._abbr}function ql(n,e){if(e!==null){var t,s=th;if(e.abbr=n,Re[n]!=null)Ld("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=Re[n]._config;else if(e.parentLocale!=null)if(Re[e.parentLocale]!=null)s=Re[e.parentLocale]._config;else if(t=Io(e.parentLocale),t!=null)s=t._config;else return Pi[e.parentLocale]||(Pi[e.parentLocale]=[]),Pi[e.parentLocale].push({name:n,config:e}),null;return Re[n]=new Rl(Dl(s,e)),Pi[n]&&Pi[n].forEach(function(r){ql(r.name,r.config)}),is(n),Re[n]}else return delete Re[n],null}function Fw(n,e){if(e!=null){var t,s,r=th;Re[n]!=null&&Re[n].parentLocale!=null?Re[n].set(Dl(Re[n]._config,e)):(s=Io(n),s!=null&&(r=s._config),e=Dl(r,e),s==null&&(e.abbr=n),t=new Rl(e),t.parentLocale=Re[n],Re[n]=t),is(n)}else Re[n]!=null&&(Re[n].parentLocale!=null?(Re[n]=Re[n].parentLocale,n===is()&&is(n)):Re[n]!=null&&delete Re[n]);return Re[n]}function $n(n){var e;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Ni;if(!Qt(n)){if(e=Io(n),e)return e;n=[n]}return $w(n)}function Uw(){return Il(Re)}function Xl(n){var e,t=n._a;return t&&de(n).overflow===-2&&(e=t[Ln]<0||t[Ln]>11?Ln:t[En]<1||t[En]>Hl(t[ht],t[Ln])?En:t[Qe]<0||t[Qe]>24||t[Qe]===24&&(t[tn]!==0||t[Bn]!==0||t[Is]!==0)?Qe:t[tn]<0||t[tn]>59?tn:t[Bn]<0||t[Bn]>59?Bn:t[Is]<0||t[Is]>999?Is:-1,de(n)._overflowDayOfYear&&(e<ht||e>En)&&(e=En),de(n)._overflowWeeks&&e===-1&&(e=Y0),de(n)._overflowWeekday&&e===-1&&(e=q0),de(n).overflow=e),n}var Hw=/^\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)?)?$/,Gw=/^\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)?)?$/,Ww=/Z|[+-]\d\d(?::?\d\d)?/,Lo=[["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/]],Yw=/^\/?Date\((-?\d+)/i,qw=/^(?:(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}))$/,Xw={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 sh(n){var e,t,s=n._i,r=Hw.exec(s)||Gw.exec(s),i,o,a,c,u=Lo.length,d=Jl.length;if(r){for(de(n).iso=!0,e=0,t=u;e<t;e++)if(Lo[e][1].exec(r[1])){o=Lo[e][0],i=Lo[e][2]!==!1;break}if(o==null){n._isValid=!1;return}if(r[3]){for(e=0,t=d;e<t;e++)if(Jl[e][1].exec(r[3])){a=(r[2]||" ")+Jl[e][0];break}if(a==null){n._isValid=!1;return}}if(!i&&a!=null){n._isValid=!1;return}if(r[4])if(Ww.exec(r[4]))c="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(c||""),Zl(n)}else n._isValid=!1}function Jw(n,e,t,s,r,i){var o=[Kw(n),Wd.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(r,10)];return i&&o.push(parseInt(i,10)),o}function Kw(n){var e=parseInt(n,10);return e<=49?2e3+e:e<=999?1900+e:e}function Zw(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Qw(n,e,t){if(n){var s=Zd.indexOf(n),r=new Date(e[0],e[1],e[2]).getDay();if(s!==r)return de(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function ex(n,e,t){if(n)return Xw[n];if(e)return 0;var s=parseInt(t,10),r=s%100,i=(s-r)/100;return i*60+r}function rh(n){var e=qw.exec(Zw(n._i)),t;if(e){if(t=Jw(e[4],e[3],e[2],e[5],e[6],e[7]),!Qw(e[1],t,n))return;n._a=t,n._tzm=ex(e[8],e[9],e[10]),n._d=Oi.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),de(n).rfc2822=!0}else n._isValid=!1}function tx(n){var e=Yw.exec(n._i);if(e!==null){n._d=new Date(+e[1]);return}if(sh(n),n._isValid===!1)delete n._isValid;else return;if(rh(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:X.createFromInputFallback(n)}X.createFromInputFallback=Bt("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 gr(n,e,t){return n??e??t}function nx(n){var e=new Date(X.now());return n._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Kl(n){var e,t,s=[],r,i,o;if(!n._d){for(r=nx(n),n._w&&n._a[En]==null&&n._a[Ln]==null&&sx(n),n._dayOfYear!=null&&(o=gr(n._a[ht],r[ht]),(n._dayOfYear>Si(o)||n._dayOfYear===0)&&(de(n)._overflowDayOfYear=!0),t=Oi(o,0,n._dayOfYear),n._a[Ln]=t.getUTCMonth(),n._a[En]=t.getUTCDate()),e=0;e<3&&n._a[e]==null;++e)n._a[e]=s[e]=r[e];for(;e<7;e++)n._a[e]=s[e]=n._a[e]==null?e===2?1:0:n._a[e];n._a[Qe]===24&&n._a[tn]===0&&n._a[Bn]===0&&n._a[Is]===0&&(n._nextDay=!0,n._a[Qe]=0),n._d=(n._useUTC?Oi:cw).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[Qe]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==i&&(de(n).weekdayMismatch=!0)}}function sx(n){var e,t,s,r,i,o,a,c,u;e=n._w,e.GG!=null||e.W!=null||e.E!=null?(i=1,o=4,t=gr(e.GG,n._a[ht],Mi(_e(),1,4).year),s=gr(e.W,1),r=gr(e.E,1),(r<1||r>7)&&(c=!0)):(i=n._locale._week.dow,o=n._locale._week.doy,u=Mi(_e(),i,o),t=gr(e.gg,n._a[ht],u.year),s=gr(e.w,u.week),e.d!=null?(r=e.d,(r<0||r>6)&&(c=!0)):e.e!=null?(r=e.e+i,(e.e<0||e.e>6)&&(c=!0)):r=i),s<1||s>jn(t,i,o)?de(n)._overflowWeeks=!0:c!=null?de(n)._overflowWeekday=!0:(a=Kd(t,s,r,i,o),n._a[ht]=a.year,n._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){},X.RFC_2822=function(){};function Zl(n){if(n._f===X.ISO_8601){sh(n);return}if(n._f===X.RFC_2822){rh(n);return}n._a=[],de(n).empty=!0;var e=""+n._i,t,s,r,i,o,a=e.length,c=0,u,d;for(r=Bd(n._f,n._locale).match(Ll)||[],d=r.length,t=0;t<d;t++)i=r[t],s=(e.match(H0(i,n))||[])[0],s&&(o=e.substr(0,e.indexOf(s)),o.length>0&&de(n).unusedInput.push(o),e=e.slice(e.indexOf(s)+s.length),c+=s.length),dr[i]?(s?de(n).empty=!1:de(n).unusedTokens.push(i),W0(i,s,n)):n._strict&&!s&&de(n).unusedTokens.push(i);de(n).charsLeftOver=a-c,e.length>0&&de(n).unusedInput.push(e),n._a[Qe]<=12&&de(n).bigHour===!0&&n._a[Qe]>0&&(de(n).bigHour=void 0),de(n).parsedDateParts=n._a.slice(0),de(n).meridiem=n._meridiem,n._a[Qe]=rx(n._locale,n._a[Qe],n._meridiem),u=de(n).era,u!==null&&(n._a[ht]=n._locale.erasConvertYear(u,n._a[ht])),Kl(n),Xl(n)}function rx(n,e,t){var s;return t==null?e:n.meridiemHour!=null?n.meridiemHour(e,t):(n.isPM!=null&&(s=n.isPM(t),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function ix(n){var e,t,s,r,i,o,a=!1,c=n._f.length;if(c===0){de(n).invalidFormat=!0,n._d=new Date(NaN);return}for(r=0;r<c;r++)i=0,o=!1,e=Vl({},n),n._useUTC!=null&&(e._useUTC=n._useUTC),e._f=n._f[r],Zl(e),Tl(e)&&(o=!0),i+=de(e).charsLeftOver,i+=de(e).unusedTokens.length*10,de(e).score=i,a?i<s&&(s=i,t=e):(s==null||i<s||o)&&(s=i,t=e,o&&(a=!0));rs(n,t||e)}function ox(n){if(!n._d){var e=jl(n._i),t=e.day===void 0?e.date:e.day;n._a=Vd([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),Kl(n)}}function ax(n){var e=new xi(Xl(ih(n)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ih(n){var e=n._i,t=n._f;return n._locale=n._locale||$n(n._l),e===null||t===void 0&&e===""?Oo({nullInput:!0}):(typeof e=="string"&&(n._i=e=n._locale.preparse(e)),en(e)?new xi(Xl(e)):(wi(e)?n._d=e:Qt(t)?ix(n):t?Zl(n):lx(n),Tl(n)||(n._d=null),n))}function lx(n){var e=n._i;vt(e)?n._d=new Date(X.now()):wi(e)?n._d=new Date(e.valueOf()):typeof e=="string"?tx(n):Qt(e)?(n._a=Vd(e.slice(0),function(t){return parseInt(t,10)}),Kl(n)):Rs(e)?ox(n):Rn(e)?n._d=new Date(e):X.createFromInputFallback(n)}function oh(n,e,t,s,r){var i={};return(e===!0||e===!1)&&(s=e,e=void 0),(t===!0||t===!1)&&(s=t,t=void 0),(Rs(n)&&Al(n)||Qt(n)&&n.length===0)&&(n=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=r,i._l=t,i._i=n,i._f=e,i._strict=s,ax(i)}function _e(n,e,t,s){return oh(n,e,t,s,!1)}var cx=Bt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=_e.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:Oo()}),ux=Bt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=_e.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:Oo()});function ah(n,e){var t,s;if(e.length===1&&Qt(e[0])&&(e=e[0]),!e.length)return _e();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][n](t))&&(t=e[s]);return t}function dx(){var n=[].slice.call(arguments,0);return ah("isBefore",n)}function hx(){var n=[].slice.call(arguments,0);return ah("isAfter",n)}var fx=function(){return Date.now?Date.now():+new Date},Ai=["year","quarter","month","week","day","hour","minute","second","millisecond"];function px(n){var e,t=!1,s,r=Ai.length;for(e in n)if(ve(n,e)&&!(ze.call(Ai,e)!==-1&&(n[e]==null||!isNaN(n[e]))))return!1;for(s=0;s<r;++s)if(n[Ai[s]]){if(t)return!1;parseFloat(n[Ai[s]])!==me(n[Ai[s]])&&(t=!0)}return!0}function gx(){return this._isValid}function mx(){return nn(NaN)}function Bo(n){var e=jl(n),t=e.year||0,s=e.quarter||0,r=e.month||0,i=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,c=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=px(e),this._milliseconds=+d+u*1e3+c*6e4+a*1e3*60*60,this._days=+o+i*7,this._months=+r+s*3+t*12,this._data={},this._locale=$n(),this._bubble()}function jo(n){return n instanceof Bo}function Ql(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function yx(n,e,t){var s=Math.min(n.length,e.length),r=Math.abs(n.length-e.length),i=0,o;for(o=0;o<s;o++)me(n[o])!==me(e[o])&&i++;return i+r}function lh(n,e){ie(n,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+Sn(~~(t/60),2)+e+Sn(~~t%60,2)})}lh("Z",":"),lh("ZZ",""),Q("Z",ko),Q("ZZ",ko),Oe(["Z","ZZ"],function(n,e,t){t._useUTC=!0,t._tzm=ec(ko,n)});var bx=/([\+\-]|\d\d)/gi;function ec(n,e){var t=(e||"").match(n),s,r,i;return t===null?null:(s=t[t.length-1]||[],r=(s+"").match(bx)||["-",0,0],i=+(r[1]*60)+me(r[2]),i===0?0:r[0]==="+"?i:-i)}function tc(n,e){var t,s;return e._isUTC?(t=e.clone(),s=(en(n)||wi(n)?n.valueOf():_e(n).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),X.updateOffset(t,!1),t):_e(n).local()}function nc(n){return-Math.round(n._d.getTimezoneOffset())}X.updateOffset=function(){};function wx(n,e,t){var s=this._offset||0,r;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=ec(ko,n),n===null)return this}else Math.abs(n)<16&&!t&&(n=n*60);return!this._isUTC&&e&&(r=nc(this)),this._offset=n,this._isUTC=!0,r!=null&&this.add(r,"m"),s!==n&&(!e||this._changeInProgress?hh(this,nn(n-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:nc(this)}function xx(n,e){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,e),this):-this.utcOffset()}function vx(n){return this.utcOffset(0,n)}function Cx(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(nc(this),"m")),this}function Sx(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=ec(F0,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function Ex(n){return this.isValid()?(n=n?_e(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function Ox(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Mx(){if(!vt(this._isDSTShifted))return this._isDSTShifted;var n={},e;return Vl(n,this),n=ih(n),n._a?(e=n._isUTC?vn(n._a):_e(n._a),this._isDSTShifted=this.isValid()&&yx(n._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Px(){return this.isValid()?!this._isUTC:!1}function Nx(){return this.isValid()?this._isUTC:!1}function ch(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ax=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,_x=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function nn(n,e){var t=n,s=null,r,i,o;return jo(n)?t={ms:n._milliseconds,d:n._days,M:n._months}:Rn(n)||!isNaN(+n)?(t={},e?t[e]=+n:t.milliseconds=+n):(s=Ax.exec(n))?(r=s[1]==="-"?-1:1,t={y:0,d:me(s[En])*r,h:me(s[Qe])*r,m:me(s[tn])*r,s:me(s[Bn])*r,ms:me(Ql(s[Is]*1e3))*r}):(s=_x.exec(n))?(r=s[1]==="-"?-1:1,t={y:Ls(s[2],r),M:Ls(s[3],r),w:Ls(s[4],r),d:Ls(s[5],r),h:Ls(s[6],r),m:Ls(s[7],r),s:Ls(s[8],r)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(o=Tx(_e(t.from),_e(t.to)),t={},t.ms=o.milliseconds,t.M=o.months),i=new Bo(t),jo(n)&&ve(n,"_locale")&&(i._locale=n._locale),jo(n)&&ve(n,"_isValid")&&(i._isValid=n._isValid),i}nn.fn=Bo.prototype,nn.invalid=mx;function Ls(n,e){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*e}function uh(n,e){var t={};return t.months=e.month()-n.month()+(e.year()-n.year())*12,n.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+n.clone().add(t.months,"M"),t}function Tx(n,e){var t;return n.isValid()&&e.isValid()?(e=tc(e,n),n.isBefore(e)?t=uh(n,e):(t=uh(e,n),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function dh(n,e){return function(t,s){var r,i;return s!==null&&!isNaN(+s)&&(Ld(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=t,t=s,s=i),r=nn(t,s),hh(this,r,n),this}}function hh(n,e,t,s){var r=e._milliseconds,i=Ql(e._days),o=Ql(e._months);n.isValid()&&(s=s??!0,o&&qd(n,Ei(n,"Month")+o*t),i&&Gd(n,"Date",Ei(n,"Date")+i*t),r&&n._d.setTime(n._d.valueOf()+r*t),s&&X.updateOffset(n,i||o))}var kx=dh(1,"add"),Vx=dh(-1,"subtract");function fh(n){return typeof n=="string"||n instanceof String}function Dx(n){return en(n)||wi(n)||fh(n)||Rn(n)||Ix(n)||Rx(n)||n===null||n===void 0}function Rx(n){var e=Rs(n)&&!Al(n),t=!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],t=t||ve(n,i);return e&&t}function Ix(n){var e=Qt(n),t=!1;return e&&(t=n.filter(function(s){return!Rn(s)&&fh(n)}).length===0),e&&t}function Lx(n){var e=Rs(n)&&!Al(n),t=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,i;for(r=0;r<s.length;r+=1)i=s[r],t=t||ve(n,i);return e&&t}function Bx(n,e){var t=n.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function jx(n,e){arguments.length===1&&(arguments[0]?Dx(arguments[0])?(n=arguments[0],e=void 0):Lx(arguments[0])&&(e=arguments[0],n=void 0):(n=void 0,e=void 0));var t=n||_e(),s=tc(t,this).startOf("day"),r=X.calendarFormat(this,s)||"sameElse",i=e&&(Cn(e[r])?e[r].call(this,t):e[r]);return this.format(i||this.localeData().calendar(r,this,_e(t)))}function $x(){return new xi(this)}function zx(n,e){var t=en(n)?n:_e(n);return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function Fx(n,e){var t=en(n)?n:_e(n);return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function Ux(n,e,t,s){var r=en(n)?n:_e(n),i=en(e)?e:_e(e);return this.isValid()&&r.isValid()&&i.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(r,t):!this.isBefore(r,t))&&(s[1]===")"?this.isBefore(i,t):!this.isAfter(i,t))):!1}function Hx(n,e){var t=en(n)?n:_e(n),s;return this.isValid()&&t.isValid()?(e=jt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(s=t.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function Gx(n,e){return this.isSame(n,e)||this.isAfter(n,e)}function Wx(n,e){return this.isSame(n,e)||this.isBefore(n,e)}function Yx(n,e,t){var s,r,i;if(!this.isValid())return NaN;if(s=tc(n,this),!s.isValid())return NaN;switch(r=(s.utcOffset()-this.utcOffset())*6e4,e=jt(e),e){case"year":i=$o(this,s)/12;break;case"month":i=$o(this,s);break;case"quarter":i=$o(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 t?i:$t(i)}function $o(n,e){if(n.date()<e.date())return-$o(e,n);var t=(e.year()-n.year())*12+(e.month()-n.month()),s=n.clone().add(t,"months"),r,i;return e-s<0?(r=n.clone().add(t-1,"months"),i=(e-s)/(s-r)):(r=n.clone().add(t+1,"months"),i=(e-s)/(r-s)),-(t+i)||0}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function qx(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Xx(n){if(!this.isValid())return null;var e=n!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?Po(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Cn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Po(t,"Z")):Po(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jx(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",e="",t,s,r,i;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+n+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",i=e+'[")]',this.format(t+s+r+i)}function Kx(n){n||(n=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=Po(this,n);return this.localeData().postformat(e)}function Zx(n,e){return this.isValid()&&(en(n)&&n.isValid()||_e(n).isValid())?nn({to:this,from:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Qx(n){return this.from(_e(),n)}function e1(n,e){return this.isValid()&&(en(n)&&n.isValid()||_e(n).isValid())?nn({from:this,to:n}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function t1(n){return this.to(_e(),n)}function ph(n){var e;return n===void 0?this._locale._abbr:(e=$n(n),e!=null&&(this._locale=e),this)}var gh=Bt("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 mh(){return this._locale}var zo=1e3,mr=60*zo,Fo=60*mr,yh=(365*400+97)*24*Fo;function yr(n,e){return(n%e+e)%e}function bh(n,e,t){return n<100&&n>=0?new Date(n+400,e,t)-yh:new Date(n,e,t).valueOf()}function wh(n,e,t){return n<100&&n>=0?Date.UTC(n+400,e,t)-yh:Date.UTC(n,e,t)}function n1(n){var e,t;if(n=jt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wh:bh,n){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=yr(e+(this._isUTC?0:this.utcOffset()*mr),Fo);break;case"minute":e=this._d.valueOf(),e-=yr(e,mr);break;case"second":e=this._d.valueOf(),e-=yr(e,zo);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function s1(n){var e,t;if(n=jt(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?wh:bh,n){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Fo-yr(e+(this._isUTC?0:this.utcOffset()*mr),Fo)-1;break;case"minute":e=this._d.valueOf(),e+=mr-yr(e,mr)-1;break;case"second":e=this._d.valueOf(),e+=zo-yr(e,zo)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function r1(){return this._d.valueOf()-(this._offset||0)*6e4}function i1(){return Math.floor(this.valueOf()/1e3)}function o1(){return new Date(this.valueOf())}function a1(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function l1(){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 c1(){return this.isValid()?this.toISOString():null}function u1(){return Tl(this)}function d1(){return rs({},de(this))}function h1(){return de(this).overflow}function f1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ie("N",0,0,"eraAbbr"),ie("NN",0,0,"eraAbbr"),ie("NNN",0,0,"eraAbbr"),ie("NNNN",0,0,"eraName"),ie("NNNNN",0,0,"eraNarrow"),ie("y",["y",1],"yo","eraYear"),ie("y",["yy",2],0,"eraYear"),ie("y",["yyy",3],0,"eraYear"),ie("y",["yyyy",4],0,"eraYear"),Q("N",sc),Q("NN",sc),Q("NNN",sc),Q("NNNN",E1),Q("NNNNN",O1),Oe(["N","NN","NNN","NNNN","NNNNN"],function(n,e,t,s){var r=t._locale.erasParse(n,s,t._strict);r?de(t).era=r:de(t).invalidEra=n}),Q("y",hr),Q("yy",hr),Q("yyy",hr),Q("yyyy",hr),Q("yo",M1),Oe(["y","yy","yyy","yyyy"],ht),Oe(["yo"],function(n,e,t,s){var r;t._locale._eraYearOrdinalRegex&&(r=n.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[ht]=t._locale.eraYearOrdinalParse(n,r):e[ht]=parseInt(n,10)});function p1(n,e){var t,s,r,i=this._eras||$n("en")._eras;for(t=0,s=i.length;t<s;++t){switch(typeof i[t].since){case"string":r=X(i[t].since).startOf("day"),i[t].since=r.valueOf();break}switch(typeof i[t].until){case"undefined":i[t].until=1/0;break;case"string":r=X(i[t].until).startOf("day").valueOf(),i[t].until=r.valueOf();break}}return i}function g1(n,e,t){var s,r,i=this.eras(),o,a,c;for(n=n.toUpperCase(),s=0,r=i.length;s<r;++s)if(o=i[s].name.toUpperCase(),a=i[s].abbr.toUpperCase(),c=i[s].narrow.toUpperCase(),t)switch(e){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(c===n)return i[s];break}else if([o,a,c].indexOf(n)>=0)return i[s]}function m1(n,e){var t=n.since<=n.until?1:-1;return e===void 0?X(n.since).year():X(n.since).year()+(e-n.offset)*t}function y1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].name;return""}function b1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].narrow;return""}function w1(){var n,e,t,s=this.localeData().eras();for(n=0,e=s.length;n<e;++n)if(t=this.clone().startOf("day").valueOf(),s[n].since<=t&&t<=s[n].until||s[n].until<=t&&t<=s[n].since)return s[n].abbr;return""}function x1(){var n,e,t,s,r=this.localeData().eras();for(n=0,e=r.length;n<e;++n)if(t=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()-X(r[n].since).year())*t+r[n].offset;return this.year()}function v1(n){return ve(this,"_erasNameRegex")||rc.call(this),n?this._erasNameRegex:this._erasRegex}function C1(n){return ve(this,"_erasAbbrRegex")||rc.call(this),n?this._erasAbbrRegex:this._erasRegex}function S1(n){return ve(this,"_erasNarrowRegex")||rc.call(this),n?this._erasNarrowRegex:this._erasRegex}function sc(n,e){return e.erasAbbrRegex(n)}function E1(n,e){return e.erasNameRegex(n)}function O1(n,e){return e.erasNarrowRegex(n)}function M1(n,e){return e._eraYearOrdinalRegex||hr}function rc(){var n=[],e=[],t=[],s=[],r,i,o,a,c,u=this.eras();for(r=0,i=u.length;r<i;++r)o=In(u[r].name),a=In(u[r].abbr),c=In(u[r].narrow),e.push(o),n.push(a),t.push(c),s.push(o),s.push(a),s.push(c);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}ie(0,["gg",2],0,function(){return this.weekYear()%100}),ie(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Uo(n,e){ie(0,[n,n.length],0,e)}Uo("gggg","weekYear"),Uo("ggggg","weekYear"),Uo("GGGG","isoWeekYear"),Uo("GGGGG","isoWeekYear"),Q("G",To),Q("g",To),Q("GG",Ae,_t),Q("gg",Ae,_t),Q("GGGG",zl,$l),Q("gggg",zl,$l),Q("GGGGG",_o,No),Q("ggggg",_o,No),Ci(["gggg","ggggg","GGGG","GGGGG"],function(n,e,t,s){e[s.substr(0,2)]=me(n)}),Ci(["gg","GG"],function(n,e,t,s){e[s]=X.parseTwoDigitYear(n)});function P1(n){return xh.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function N1(n){return xh.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function A1(){return jn(this.year(),1,4)}function _1(){return jn(this.isoWeekYear(),1,4)}function T1(){var n=this.localeData()._week;return jn(this.year(),n.dow,n.doy)}function k1(){var n=this.localeData()._week;return jn(this.weekYear(),n.dow,n.doy)}function xh(n,e,t,s,r){var i;return n==null?Mi(this,s,r).year:(i=jn(n,s,r),e>i&&(e=i),V1.call(this,n,e,t,s,r))}function V1(n,e,t,s,r){var i=Kd(n,e,t,s,r),o=Oi(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}ie("Q",0,"Qo","quarter"),Q("Q",$d),Oe("Q",function(n,e){e[Ln]=(me(n)-1)*3});function D1(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}ie("D",["DD",2],"Do","date"),Q("D",Ae,fr),Q("DD",Ae,_t),Q("Do",function(n,e){return n?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Oe(["D","DD"],En),Oe("Do",function(n,e){e[En]=me(n.match(Ae)[0])});var vh=pr("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",Ao),Q("DDDD",zd),Oe(["DDD","DDDD"],function(n,e,t){t._dayOfYear=me(n)});function R1(n){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?e:this.add(n-e,"d")}ie("m",["mm",2],0,"minute"),Q("m",Ae,Fl),Q("mm",Ae,_t),Oe(["m","mm"],tn);var I1=pr("Minutes",!1);ie("s",["ss",2],0,"second"),Q("s",Ae,Fl),Q("ss",Ae,_t),Oe(["s","ss"],Bn);var L1=pr("Seconds",!1);ie("S",0,0,function(){return~~(this.millisecond()/100)}),ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ie(0,["SSS",3],0,"millisecond"),ie(0,["SSSS",4],0,function(){return this.millisecond()*10}),ie(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Q("S",Ao,$d),Q("SS",Ao,_t),Q("SSS",Ao,zd);var os,Ch;for(os="SSSS";os.length<=9;os+="S")Q(os,hr);function B1(n,e){e[Is]=me(("0."+n)*1e3)}for(os="S";os.length<=9;os+="S")Oe(os,B1);Ch=pr("Milliseconds",!1),ie("z",0,0,"zoneAbbr"),ie("zz",0,0,"zoneName");function j1(){return this._isUTC?"UTC":""}function $1(){return this._isUTC?"Coordinated Universal Time":""}var H=xi.prototype;H.add=kx,H.calendar=jx,H.clone=$x,H.diff=Yx,H.endOf=s1,H.format=Kx,H.from=Zx,H.fromNow=Qx,H.to=e1,H.toNow=t1,H.get=J0,H.invalidAt=h1,H.isAfter=zx,H.isBefore=Fx,H.isBetween=Ux,H.isSame=Hx,H.isSameOrAfter=Gx,H.isSameOrBefore=Wx,H.isValid=u1,H.lang=gh,H.locale=ph,H.localeData=mh,H.max=ux,H.min=cx,H.parsingFlags=d1,H.set=K0,H.startOf=n1,H.subtract=Vx,H.toArray=a1,H.toObject=l1,H.toDate=o1,H.toISOString=Xx,H.inspect=Jx,typeof Symbol<"u"&&Symbol.for!=null&&(H[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),H.toJSON=c1,H.toString=qx,H.unix=i1,H.valueOf=r1,H.creationData=f1,H.eraName=y1,H.eraNarrow=b1,H.eraAbbr=w1,H.eraYear=x1,H.year=Hd,H.isLeapYear=X0,H.weekYear=P1,H.isoWeekYear=N1,H.quarter=H.quarters=D1,H.month=Xd,H.daysInMonth=ow,H.week=H.weeks=pw,H.isoWeek=H.isoWeeks=gw,H.weeksInYear=T1,H.weeksInWeekYear=k1,H.isoWeeksInYear=A1,H.isoWeeksInISOWeekYear=_1,H.date=vh,H.day=H.days=Nw,H.weekday=Aw,H.isoWeekday=_w,H.dayOfYear=R1,H.hour=H.hours=Lw,H.minute=H.minutes=I1,H.second=H.seconds=L1,H.millisecond=H.milliseconds=Ch,H.utcOffset=wx,H.utc=vx,H.local=Cx,H.parseZone=Sx,H.hasAlignedHourOffset=Ex,H.isDST=Ox,H.isLocal=Px,H.isUtcOffset=Nx,H.isUtc=ch,H.isUTC=ch,H.zoneAbbr=j1,H.zoneName=$1,H.dates=Bt("dates accessor is deprecated. Use date instead.",vh),H.months=Bt("months accessor is deprecated. Use month instead",Xd),H.years=Bt("years accessor is deprecated. Use year instead",Hd),H.zone=Bt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",xx),H.isDSTShifted=Bt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Mx);function z1(n){return _e(n*1e3)}function F1(){return _e.apply(null,arguments).parseZone()}function Sh(n){return n}var Ce=Rl.prototype;Ce.calendar=P0,Ce.longDateFormat=T0,Ce.invalidDate=V0,Ce.ordinal=I0,Ce.preparse=Sh,Ce.postformat=Sh,Ce.relativeTime=B0,Ce.pastFuture=j0,Ce.set=O0,Ce.eras=p1,Ce.erasParse=g1,Ce.erasConvertYear=m1,Ce.erasAbbrRegex=C1,Ce.erasNameRegex=v1,Ce.erasNarrowRegex=S1,Ce.months=nw,Ce.monthsShort=sw,Ce.monthsParse=iw,Ce.monthsRegex=lw,Ce.monthsShortRegex=aw,Ce.week=uw,Ce.firstDayOfYear=fw,Ce.firstDayOfWeek=hw,Ce.weekdays=Sw,Ce.weekdaysMin=Ow,Ce.weekdaysShort=Ew,Ce.weekdaysParse=Pw,Ce.weekdaysRegex=Tw,Ce.weekdaysShortRegex=kw,Ce.weekdaysMinRegex=Vw,Ce.isPM=Rw,Ce.meridiem=Bw;function Ho(n,e,t,s){var r=$n(),i=vn().set(s,e);return r[t](i,n)}function Eh(n,e,t){if(Rn(n)&&(e=n,n=void 0),n=n||"",e!=null)return Ho(n,e,t,"month");var s,r=[];for(s=0;s<12;s++)r[s]=Ho(n,s,t,"month");return r}function ic(n,e,t,s){typeof n=="boolean"?(Rn(e)&&(t=e,e=void 0),e=e||""):(e=n,t=e,n=!1,Rn(e)&&(t=e,e=void 0),e=e||"");var r=$n(),i=n?r._week.dow:0,o,a=[];if(t!=null)return Ho(e,(t+i)%7,s,"day");for(o=0;o<7;o++)a[o]=Ho(e,(o+i)%7,s,"day");return a}function U1(n,e){return Eh(n,e,"months")}function H1(n,e){return Eh(n,e,"monthsShort")}function G1(n,e,t){return ic(n,e,t,"weekdays")}function W1(n,e,t){return ic(n,e,t,"weekdaysShort")}function Y1(n,e,t){return ic(n,e,t,"weekdaysMin")}is("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 e=n%10,t=me(n%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return n+t}}),X.lang=Bt("moment.lang is deprecated. Use moment.locale instead.",is),X.langData=Bt("moment.langData is deprecated. Use moment.localeData instead.",$n);var zn=Math.abs;function q1(){var n=this._data;return this._milliseconds=zn(this._milliseconds),this._days=zn(this._days),this._months=zn(this._months),n.milliseconds=zn(n.milliseconds),n.seconds=zn(n.seconds),n.minutes=zn(n.minutes),n.hours=zn(n.hours),n.months=zn(n.months),n.years=zn(n.years),this}function Oh(n,e,t,s){var r=nn(e,t);return n._milliseconds+=s*r._milliseconds,n._days+=s*r._days,n._months+=s*r._months,n._bubble()}function X1(n,e){return Oh(this,n,e,1)}function J1(n,e){return Oh(this,n,e,-1)}function Mh(n){return n<0?Math.floor(n):Math.ceil(n)}function K1(){var n=this._milliseconds,e=this._days,t=this._months,s=this._data,r,i,o,a,c;return n>=0&&e>=0&&t>=0||n<=0&&e<=0&&t<=0||(n+=Mh(oc(t)+e)*864e5,e=0,t=0),s.milliseconds=n%1e3,r=$t(n/1e3),s.seconds=r%60,i=$t(r/60),s.minutes=i%60,o=$t(i/60),s.hours=o%24,e+=$t(o/24),c=$t(Ph(e)),t+=c,e-=Mh(oc(c)),a=$t(t/12),t%=12,s.days=e,s.months=t,s.years=a,this}function Ph(n){return n*4800/146097}function oc(n){return n*146097/4800}function Z1(n){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(n=jt(n),n==="month"||n==="quarter"||n==="year")switch(e=this._days+s/864e5,t=this._months+Ph(e),n){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(oc(this._months)),n){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+n)}}function Fn(n){return function(){return this.as(n)}}var Nh=Fn("ms"),Q1=Fn("s"),ev=Fn("m"),tv=Fn("h"),nv=Fn("d"),sv=Fn("w"),rv=Fn("M"),iv=Fn("Q"),ov=Fn("y"),av=Nh;function lv(){return nn(this)}function cv(n){return n=jt(n),this.isValid()?this[n+"s"]():NaN}function Bs(n){return function(){return this.isValid()?this._data[n]:NaN}}var uv=Bs("milliseconds"),dv=Bs("seconds"),hv=Bs("minutes"),fv=Bs("hours"),pv=Bs("days"),gv=Bs("months"),mv=Bs("years");function yv(){return $t(this.days()/7)}var Un=Math.round,br={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function bv(n,e,t,s,r){return r.relativeTime(e||1,!!t,n,s)}function wv(n,e,t,s){var r=nn(n).abs(),i=Un(r.as("s")),o=Un(r.as("m")),a=Un(r.as("h")),c=Un(r.as("d")),u=Un(r.as("M")),d=Un(r.as("w")),f=Un(r.as("y")),h=i<=t.ss&&["s",i]||i<t.s&&["ss",i]||o<=1&&["m"]||o<t.m&&["mm",o]||a<=1&&["h"]||a<t.h&&["hh",a]||c<=1&&["d"]||c<t.d&&["dd",c];return t.w!=null&&(h=h||d<=1&&["w"]||d<t.w&&["ww",d]),h=h||u<=1&&["M"]||u<t.M&&["MM",u]||f<=1&&["y"]||["yy",f],h[2]=e,h[3]=+n>0,h[4]=s,bv.apply(null,h)}function xv(n){return n===void 0?Un:typeof n=="function"?(Un=n,!0):!1}function vv(n,e){return br[n]===void 0?!1:e===void 0?br[n]:(br[n]=e,n==="s"&&(br.ss=e-1),!0)}function Cv(n,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=br,r,i;return typeof n=="object"&&(e=n,n=!1),typeof n=="boolean"&&(t=n),typeof e=="object"&&(s=Object.assign({},br,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),r=this.localeData(),i=wv(this,!t,s,r),t&&(i=r.pastFuture(+this,i)),r.postformat(i)}var ac=Math.abs;function wr(n){return(n>0)-(n<0)||+n}function Go(){if(!this.isValid())return this.localeData().invalidDate();var n=ac(this._milliseconds)/1e3,e=ac(this._days),t=ac(this._months),s,r,i,o,a=this.asSeconds(),c,u,d,f;return a?(s=$t(n/60),r=$t(s/60),n%=60,s%=60,i=$t(t/12),t%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=a<0?"-":"",u=wr(this._months)!==wr(a)?"-":"",d=wr(this._days)!==wr(a)?"-":"",f=wr(this._milliseconds)!==wr(a)?"-":"",c+"P"+(i?u+i+"Y":"")+(t?u+t+"M":"")+(e?d+e+"D":"")+(r||s||n?"T":"")+(r?f+r+"H":"")+(s?f+s+"M":"")+(n?f+o+"S":"")):"P0D"}var we=Bo.prototype;we.isValid=gx,we.abs=q1,we.add=X1,we.subtract=J1,we.as=Z1,we.asMilliseconds=Nh,we.asSeconds=Q1,we.asMinutes=ev,we.asHours=tv,we.asDays=nv,we.asWeeks=sv,we.asMonths=rv,we.asQuarters=iv,we.asYears=ov,we.valueOf=av,we._bubble=K1,we.clone=lv,we.get=cv,we.milliseconds=uv,we.seconds=dv,we.minutes=hv,we.hours=fv,we.days=pv,we.weeks=yv,we.months=gv,we.years=mv,we.humanize=Cv,we.toISOString=Go,we.toString=Go,we.toJSON=Go,we.locale=ph,we.localeData=mh,we.toIsoString=Bt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Go),we.lang=gh,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),Q("x",To),Q("X",U0),Oe("X",function(n,e,t){t._d=new Date(parseFloat(n)*1e3)}),Oe("x",function(n,e,t){t._d=new Date(me(n))});//! moment.js
10
+ X.version="2.30.1",S0(_e),X.fn=H,X.min=dx,X.max=hx,X.now=fx,X.utc=vn,X.unix=z1,X.months=U1,X.isDate=wi,X.locale=is,X.invalid=Oo,X.duration=nn,X.isMoment=en,X.weekdays=G1,X.parseZone=F1,X.localeData=$n,X.isDuration=jo,X.monthsShort=H1,X.weekdaysMin=Y1,X.defineLocale=ql,X.updateLocale=Fw,X.locales=Uw,X.weekdaysShort=W1,X.normalizeUnits=jt,X.relativeTimeRounding=xv,X.relativeTimeThreshold=vv,X.calendarFormat=Bx,X.prototype=H,X.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 Sv='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Ev=n=>process.env.NODE_ENV==="test"?!0:getComputedStyle(n).position==="fixed"?!1:n.offsetParent!==null,Ah=n=>Array.from(n.querySelectorAll(Sv)).filter(e=>Ov(e)&&Ev(e)),Ov=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}},Hn=(n,e,{checkForDefaultPrevented:t=!0}={})=>r=>{const i=n==null?void 0:n(r);if(t===!1||!i)return e==null?void 0:e(r)};var _h;const We=typeof window<"u",Mv=n=>typeof n=="string",Th=()=>{},Pv=We&&((_h=window==null?void 0:window.navigator)==null?void 0:_h.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function lc(n){return typeof n=="function"?n():l.unref(n)}function Nv(n){return n}function Wo(n){return l.getCurrentScope()?(l.onScopeDispose(n),!0):!1}function Av(n,e=!0){l.getCurrentInstance()?l.onMounted(n):e?n():l.nextTick(n)}function _v(n,e,t={}){const{immediate:s=!0}=t,r=l.ref(!1);let i=null;function o(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,o()}function c(...u){o(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,n(...u)},lc(e))}return s&&(r.value=!0,We&&c()),Wo(a),{isPending:l.readonly(r),start:c,stop:a}}function as(n){var e;const t=lc(n);return(e=t==null?void 0:t.$el)!=null?e:t}const cc=We?window:void 0;function Gn(...n){let e,t,s,r;if(Mv(n[0])||Array.isArray(n[0])?([t,s,r]=n,e=cc):[e,t,s,r]=n,!e)return Th;Array.isArray(t)||(t=[t]),Array.isArray(s)||(s=[s]);const i=[],o=()=>{i.forEach(d=>d()),i.length=0},a=(d,f,h,p)=>(d.addEventListener(f,h,p),()=>d.removeEventListener(f,h,p)),c=l.watch(()=>[as(e),lc(r)],([d,f])=>{o(),d&&i.push(...t.flatMap(h=>s.map(p=>a(d,h,p,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),o()};return Wo(u),u}let kh=!1;function Tv(n,e,t={}){const{window:s=cc,ignore:r=[],capture:i=!0,detectIframe:o=!1}=t;if(!s)return;Pv&&!kh&&(kh=!0,Array.from(s.document.body.children).forEach(h=>h.addEventListener("click",Th)));let a=!0;const c=h=>r.some(p=>{if(typeof p=="string")return Array.from(s.document.querySelectorAll(p)).some(g=>g===h.target||h.composedPath().includes(g));{const g=as(p);return g&&(h.target===g||h.composedPath().includes(g))}}),d=[Gn(s,"click",h=>{const p=as(n);if(!(!p||p===h.target||h.composedPath().includes(p))){if(h.detail===0&&(a=!c(h)),!a){a=!0;return}e(h)}},{passive:!0,capture:i}),Gn(s,"pointerdown",h=>{const p=as(n);p&&(a=!h.composedPath().includes(p)&&!c(h))},{passive:!0}),o&&Gn(s,"blur",h=>{var p;const g=as(n);((p=s.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(g!=null&&g.contains(s.document.activeElement))&&e(h)})].filter(Boolean);return()=>d.forEach(h=>h())}function kv(n,e=!1){const t=l.ref(),s=()=>t.value=!!n();return s(),Av(s,e),t}const Vh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Dh="__vueuse_ssr_handlers__";Vh[Dh]=Vh[Dh]||{};var Rh=Object.getOwnPropertySymbols,Vv=Object.prototype.hasOwnProperty,Dv=Object.prototype.propertyIsEnumerable,Rv=(n,e)=>{var t={};for(var s in n)Vv.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&Rh)for(var s of Rh(n))e.indexOf(s)<0&&Dv.call(n,s)&&(t[s]=n[s]);return t};function Ih(n,e,t={}){const s=t,{window:r=cc}=s,i=Rv(s,["window"]);let o;const a=kv(()=>r&&"ResizeObserver"in r),c=()=>{o&&(o.disconnect(),o=void 0)},u=l.watch(()=>as(n),f=>{c(),a.value&&r&&f&&(o=new ResizeObserver(e),o.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Wo(d),{isSupported:a,stop:d}}var Lh;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(Lh||(Lh={}));var Iv=Object.defineProperty,Bh=Object.getOwnPropertySymbols,Lv=Object.prototype.hasOwnProperty,Bv=Object.prototype.propertyIsEnumerable,jh=(n,e,t)=>e in n?Iv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,jv=(n,e)=>{for(var t in e||(e={}))Lv.call(e,t)&&jh(n,t,e[t]);if(Bh)for(var t of Bh(e))Bv.call(e,t)&&jh(n,t,e[t]);return n};jv({linear:Nv},{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 $v=()=>We&&/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 ls=()=>{},zv=Object.prototype.hasOwnProperty,Yo=(n,e)=>zv.call(n,e),Fv=Array.isArray,zt=n=>typeof n=="function",sn=n=>typeof n=="string",xr=n=>n!==null&&typeof n=="object",Uv=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hv=/-(\w)/g,Gv=Uv(n=>n.replace(Hv,(e,t)=>t?t.toUpperCase():""));var jh=typeof global=="object"&&global&&global.Object===Object&&global,Wv=typeof self=="object"&&self&&self.Object===Object&&self,rn=jh||Wv||Function("return this")(),Ft=rn.Symbol,$h=Object.prototype,Yv=$h.hasOwnProperty,qv=$h.toString,_i=Ft?Ft.toStringTag:void 0;function Xv(n){var e=Yv.call(n,_i),t=n[_i];try{n[_i]=void 0;var s=!0}catch{}var r=qv.call(n);return s&&(e?n[_i]=t:delete n[_i]),r}var Jv=Object.prototype,Kv=Jv.toString;function Zv(n){return Kv.call(n)}var Qv="[object Null]",eC="[object Undefined]",zh=Ft?Ft.toStringTag:void 0;function cs(n){return n==null?n===void 0?eC:Qv:zh&&zh in Object(n)?Xv(n):Zv(n)}function on(n){return n!=null&&typeof n=="object"}var tC="[object Symbol]";function On(n){return typeof n=="symbol"||on(n)&&cs(n)==tC}function qo(n,e){for(var t=-1,s=n==null?0:n.length,r=Array(s);++t<s;)r[t]=e(n[t],t,n);return r}var ft=Array.isArray,nC=1/0,Fh=Ft?Ft.prototype:void 0,Uh=Fh?Fh.toString:void 0;function Hh(n){if(typeof n=="string")return n;if(ft(n))return qo(n,Hh)+"";if(On(n))return Uh?Uh.call(n):"";var e=n+"";return e=="0"&&1/n==-nC?"-0":e}var sC=/\s/;function rC(n){for(var e=n.length;e--&&sC.test(n.charAt(e)););return e}var iC=/^\s+/;function oC(n){return n&&n.slice(0,rC(n)+1).replace(iC,"")}function Be(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Gh=NaN,aC=/^[-+]0x[0-9a-f]+$/i,lC=/^0b[01]+$/i,cC=/^0o[0-7]+$/i,uC=parseInt;function Ti(n){if(typeof n=="number")return n;if(On(n))return Gh;if(Be(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Be(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=oC(n);var t=lC.test(n);return t||cC.test(n)?uC(n.slice(2),t?2:8):aC.test(n)?Gh:+n}function vr(n){return n}var dC="[object AsyncFunction]",hC="[object Function]",fC="[object GeneratorFunction]",pC="[object Proxy]";function uc(n){if(!Be(n))return!1;var e=cs(n);return e==hC||e==fC||e==dC||e==pC}var dc=rn["__core-js_shared__"],Wh=function(){var n=/[^.]+$/.exec(dc&&dc.keys&&dc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function gC(n){return!!Wh&&Wh in n}var mC=Function.prototype,yC=mC.toString;function js(n){if(n!=null){try{return yC.call(n)}catch{}try{return n+""}catch{}}return""}var bC=/[\\^$.*+?()[\]{}|]/g,wC=/^\[object .+?Constructor\]$/,xC=Function.prototype,vC=Object.prototype,CC=xC.toString,SC=vC.hasOwnProperty,EC=RegExp("^"+CC.call(SC).replace(bC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OC(n){if(!Be(n)||gC(n))return!1;var e=uc(n)?EC:wC;return e.test(js(n))}function MC(n,e){return n==null?void 0:n[e]}function $s(n,e){var t=MC(n,e);return OC(t)?t:void 0}var hc=$s(rn,"WeakMap"),Yh=Object.create,PC=function(){function n(){}return function(e){if(!Be(e))return{};if(Yh)return Yh(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function qh(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function NC(){}function Xh(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var AC=800,_C=16,TC=Date.now;function kC(n){var e=0,t=0;return function(){var s=TC(),r=_C-(s-t);if(t=s,r>0){if(++e>=AC)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function VC(n){return function(){return n}}var Xo=function(){try{var n=$s(Object,"defineProperty");return n({},"",{}),n}catch{}}(),DC=Xo?function(n,e){return Xo(n,"toString",{configurable:!0,enumerable:!1,value:VC(e),writable:!0})}:vr,Jh=kC(DC);function RC(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}function IC(n,e,t,s){for(var r=n.length,i=t+-1;++i<r;)if(e(n[i],i,n))return i;return-1}function LC(n){return n!==n}function BC(n,e,t){for(var s=t-1,r=n.length;++s<r;)if(n[s]===e)return s;return-1}function jC(n,e,t){return e===e?BC(n,e,t):IC(n,LC,t)}function Kh(n,e){var t=n==null?0:n.length;return!!t&&jC(n,e,0)>-1}var $C=9007199254740991,zC=/^(?:0|[1-9]\d*)$/;function Jo(n,e){var t=typeof n;return e=e??$C,!!e&&(t=="number"||t!="symbol"&&zC.test(n))&&n>-1&&n%1==0&&n<e}function Ko(n,e,t){e=="__proto__"&&Xo?Xo(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Cr(n,e){return n===e||n!==n&&e!==e}var FC=Object.prototype,UC=FC.hasOwnProperty;function fc(n,e,t){var s=n[e];(!(UC.call(n,e)&&Cr(s,t))||t===void 0&&!(e in n))&&Ko(n,e,t)}function ki(n,e,t,s){var r=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],c=void 0;c===void 0&&(c=n[a]),r?Ko(t,a,c):fc(t,a,c)}return t}var Zh=Math.max;function Qh(n,e,t){return e=Zh(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Zh(s.length-e,0),o=Array(i);++r<i;)o[r]=s[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=s[r];return a[e]=t(o),qh(n,this,a)}}function Sr(n,e){return Jh(Qh(n,e,vr),n+"")}var HC=9007199254740991;function pc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=HC}function zs(n){return n!=null&&pc(n.length)&&!uc(n)}function Zo(n,e,t){if(!Be(t))return!1;var s=typeof e;return(s=="number"?zs(t)&&Jo(e,t.length):s=="string"&&e in t)?Cr(t[e],n):!1}function ef(n){return Sr(function(e,t){var s=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&Zo(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++s<r;){var a=t[s];a&&n(e,a,s,i)}return e})}var GC=Object.prototype;function Qo(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||GC;return n===t}function WC(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var YC="[object Arguments]";function tf(n){return on(n)&&cs(n)==YC}var nf=Object.prototype,qC=nf.hasOwnProperty,XC=nf.propertyIsEnumerable,Er=tf(function(){return arguments}())?tf:function(n){return on(n)&&qC.call(n,"callee")&&!XC.call(n,"callee")};function JC(){return!1}var sf=typeof xe=="object"&&xe&&!xe.nodeType&&xe,rf=sf&&typeof module=="object"&&module&&!module.nodeType&&module,KC=rf&&rf.exports===sf,of=KC?rn.Buffer:void 0,ZC=of?of.isBuffer:void 0,Or=ZC||JC,QC="[object Arguments]",eS="[object Array]",tS="[object Boolean]",nS="[object Date]",sS="[object Error]",rS="[object Function]",iS="[object Map]",oS="[object Number]",aS="[object Object]",lS="[object RegExp]",cS="[object Set]",uS="[object String]",dS="[object WeakMap]",hS="[object ArrayBuffer]",fS="[object DataView]",pS="[object Float32Array]",gS="[object Float64Array]",mS="[object Int8Array]",yS="[object Int16Array]",bS="[object Int32Array]",wS="[object Uint8Array]",xS="[object Uint8ClampedArray]",vS="[object Uint16Array]",CS="[object Uint32Array]",Te={};Te[pS]=Te[gS]=Te[mS]=Te[yS]=Te[bS]=Te[wS]=Te[xS]=Te[vS]=Te[CS]=!0,Te[QC]=Te[eS]=Te[hS]=Te[tS]=Te[fS]=Te[nS]=Te[sS]=Te[rS]=Te[iS]=Te[oS]=Te[aS]=Te[lS]=Te[cS]=Te[uS]=Te[dS]=!1;function SS(n){return on(n)&&pc(n.length)&&!!Te[cs(n)]}function ea(n){return function(e){return n(e)}}var af=typeof xe=="object"&&xe&&!xe.nodeType&&xe,Vi=af&&typeof module=="object"&&module&&!module.nodeType&&module,ES=Vi&&Vi.exports===af,gc=ES&&jh.process,Mr=function(){try{var n=Vi&&Vi.require&&Vi.require("util").types;return n||gc&&gc.binding&&gc.binding("util")}catch{}}(),lf=Mr&&Mr.isTypedArray,ta=lf?ea(lf):SS,OS=Object.prototype,MS=OS.hasOwnProperty;function cf(n,e){var t=ft(n),s=!t&&Er(n),r=!t&&!s&&Or(n),i=!t&&!s&&!r&&ta(n),o=t||s||r||i,a=o?WC(n.length,String):[],c=a.length;for(var u in n)(e||MS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Jo(u,c)))&&a.push(u);return a}function uf(n,e){return function(t){return n(e(t))}}var PS=uf(Object.keys,Object),NS=Object.prototype,AS=NS.hasOwnProperty;function df(n){if(!Qo(n))return PS(n);var e=[];for(var t in Object(n))AS.call(n,t)&&t!="constructor"&&e.push(t);return e}function Di(n){return zs(n)?cf(n):df(n)}function _S(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var TS=Object.prototype,kS=TS.hasOwnProperty;function VS(n){if(!Be(n))return _S(n);var e=Qo(n),t=[];for(var s in n)s=="constructor"&&(e||!kS.call(n,s))||t.push(s);return t}function Pr(n){return zs(n)?cf(n,!0):VS(n)}var DS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RS=/^\w*$/;function mc(n,e){if(ft(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||On(n)?!0:RS.test(n)||!DS.test(n)||e!=null&&n in Object(e)}var Ri=$s(Object,"create");function IS(){this.__data__=Ri?Ri(null):{},this.size=0}function LS(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var BS="__lodash_hash_undefined__",jS=Object.prototype,$S=jS.hasOwnProperty;function zS(n){var e=this.__data__;if(Ri){var t=e[n];return t===BS?void 0:t}return $S.call(e,n)?e[n]:void 0}var FS=Object.prototype,US=FS.hasOwnProperty;function HS(n){var e=this.__data__;return Ri?e[n]!==void 0:US.call(e,n)}var GS="__lodash_hash_undefined__";function WS(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ri&&e===void 0?GS:e,this}function Fs(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Fs.prototype.clear=IS,Fs.prototype.delete=LS,Fs.prototype.get=zS,Fs.prototype.has=HS,Fs.prototype.set=WS;function YS(){this.__data__=[],this.size=0}function na(n,e){for(var t=n.length;t--;)if(Cr(n[t][0],e))return t;return-1}var qS=Array.prototype,XS=qS.splice;function JS(n){var e=this.__data__,t=na(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():XS.call(e,t,1),--this.size,!0}function KS(n){var e=this.__data__,t=na(e,n);return t<0?void 0:e[t][1]}function ZS(n){return na(this.__data__,n)>-1}function QS(n,e){var t=this.__data__,s=na(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Wn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Wn.prototype.clear=YS,Wn.prototype.delete=JS,Wn.prototype.get=KS,Wn.prototype.has=ZS,Wn.prototype.set=QS;var Ii=$s(rn,"Map");function eE(){this.size=0,this.__data__={hash:new Fs,map:new(Ii||Wn),string:new Fs}}function tE(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function sa(n,e){var t=n.__data__;return tE(e)?t[typeof e=="string"?"string":"hash"]:t.map}function nE(n){var e=sa(this,n).delete(n);return this.size-=e?1:0,e}function sE(n){return sa(this,n).get(n)}function rE(n){return sa(this,n).has(n)}function iE(n,e){var t=sa(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function Yn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Yn.prototype.clear=eE,Yn.prototype.delete=nE,Yn.prototype.get=sE,Yn.prototype.has=rE,Yn.prototype.set=iE;var oE="Expected a function";function yc(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(oE);var t=function(){var s=arguments,r=e?e.apply(this,s):s[0],i=t.cache;if(i.has(r))return i.get(r);var o=n.apply(this,s);return t.cache=i.set(r,o)||i,o};return t.cache=new(yc.Cache||Yn),t}yc.Cache=Yn;var aE=500;function lE(n){var e=yc(n,function(s){return t.size===aE&&t.clear(),s}),t=e.cache;return e}var cE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uE=/\\(\\)?/g,dE=lE(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(cE,function(t,s,r,i){e.push(r?i.replace(uE,"$1"):s||t)}),e});function Li(n){return n==null?"":Hh(n)}function ra(n,e){return ft(n)?n:mc(n,e)?[n]:dE(Li(n))}var hE=1/0;function Bi(n){if(typeof n=="string"||On(n))return n;var e=n+"";return e=="0"&&1/n==-hE?"-0":e}function ia(n,e){e=ra(e,n);for(var t=0,s=e.length;n!=null&&t<s;)n=n[Bi(e[t++])];return t&&t==s?n:void 0}function hf(n,e,t){var s=n==null?void 0:ia(n,e);return s===void 0?t:s}function bc(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var ff=Ft?Ft.isConcatSpreadable:void 0;function fE(n){return ft(n)||Er(n)||!!(ff&&n&&n[ff])}function oa(n,e,t,s,r){var i=-1,o=n.length;for(t||(t=fE),r||(r=[]);++i<o;){var a=n[i];t(a)?bc(r,a):s||(r[r.length]=a)}return r}function pE(n){var e=n==null?0:n.length;return e?oa(n):[]}function gE(n){return Jh(Qh(n,void 0,pE),n+"")}var wc=uf(Object.getPrototypeOf,Object),mE="[object Object]",yE=Function.prototype,bE=Object.prototype,pf=yE.toString,wE=bE.hasOwnProperty,xE=pf.call(Object);function Mn(n){if(!on(n)||cs(n)!=mE)return!1;var e=wc(n);if(e===null)return!0;var t=wE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&pf.call(t)==xE}function vE(n,e,t){var s=-1,r=n.length;e<0&&(e=-e>r?0:r+e),t=t>r?r:t,t<0&&(t+=r),r=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(r);++s<r;)i[s]=n[s+e];return i}function CE(n,e,t){var s=n.length;return t=t===void 0?s:t,!e&&t>=s?n:vE(n,e,t)}var SE="\\ud800-\\udfff",EE="\\u0300-\\u036f",OE="\\ufe20-\\ufe2f",ME="\\u20d0-\\u20ff",PE=EE+OE+ME,NE="\\ufe0e\\ufe0f",AE="\\u200d",_E=RegExp("["+AE+SE+PE+NE+"]");function gf(n){return _E.test(n)}function TE(n){return n.split("")}var mf="\\ud800-\\udfff",kE="\\u0300-\\u036f",VE="\\ufe20-\\ufe2f",DE="\\u20d0-\\u20ff",RE=kE+VE+DE,IE="\\ufe0e\\ufe0f",LE="["+mf+"]",xc="["+RE+"]",vc="\\ud83c[\\udffb-\\udfff]",BE="(?:"+xc+"|"+vc+")",yf="[^"+mf+"]",bf="(?:\\ud83c[\\udde6-\\uddff]){2}",wf="[\\ud800-\\udbff][\\udc00-\\udfff]",jE="\\u200d",xf=BE+"?",vf="["+IE+"]?",$E="(?:"+jE+"(?:"+[yf,bf,wf].join("|")+")"+vf+xf+")*",zE=vf+xf+$E,FE="(?:"+[yf+xc+"?",xc,bf,wf,LE].join("|")+")",UE=RegExp(vc+"(?="+vc+")|"+FE+zE,"g");function HE(n){return n.match(UE)||[]}function GE(n){return gf(n)?HE(n):TE(n)}function Cf(n){return function(e){e=Li(e);var t=gf(e)?GE(e):void 0,s=t?t[0]:e.charAt(0),r=t?CE(t,1).join(""):e.slice(1);return s[n]()+r}}var aa=Cf("toUpperCase");function WE(n){return aa(Li(n).toLowerCase())}function YE(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;)t=e(t,n[r],r,n);return t}function qE(n){return function(e){return n==null?void 0:n[e]}}var XE={À:"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"},JE=qE(XE),KE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ZE="\\u0300-\\u036f",QE="\\ufe20-\\ufe2f",eO="\\u20d0-\\u20ff",tO=ZE+QE+eO,nO="["+tO+"]",sO=RegExp(nO,"g");function rO(n){return n=Li(n),n&&n.replace(KE,JE).replace(sO,"")}var iO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function oO(n){return n.match(iO)||[]}var aO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lO(n){return aO.test(n)}var Sf="\\ud800-\\udfff",cO="\\u0300-\\u036f",uO="\\ufe20-\\ufe2f",dO="\\u20d0-\\u20ff",hO=cO+uO+dO,Ef="\\u2700-\\u27bf",Of="a-z\\xdf-\\xf6\\xf8-\\xff",fO="\\xac\\xb1\\xd7\\xf7",pO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gO="\\u2000-\\u206f",mO=" \\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",Mf="A-Z\\xc0-\\xd6\\xd8-\\xde",yO="\\ufe0e\\ufe0f",Pf=fO+pO+gO+mO,Nf="['’]",Af="["+Pf+"]",bO="["+hO+"]",_f="\\d+",wO="["+Ef+"]",Tf="["+Of+"]",kf="[^"+Sf+Pf+_f+Ef+Of+Mf+"]",xO="\\ud83c[\\udffb-\\udfff]",vO="(?:"+bO+"|"+xO+")",CO="[^"+Sf+"]",Vf="(?:\\ud83c[\\udde6-\\uddff]){2}",Df="[\\ud800-\\udbff][\\udc00-\\udfff]",Nr="["+Mf+"]",SO="\\u200d",Rf="(?:"+Tf+"|"+kf+")",EO="(?:"+Nr+"|"+kf+")",If="(?:"+Nf+"(?:d|ll|m|re|s|t|ve))?",Lf="(?:"+Nf+"(?:D|LL|M|RE|S|T|VE))?",Bf=vO+"?",jf="["+yO+"]?",OO="(?:"+SO+"(?:"+[CO,Vf,Df].join("|")+")"+jf+Bf+")*",MO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",PO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",NO=jf+Bf+OO,AO="(?:"+[wO,Vf,Df].join("|")+")"+NO,_O=RegExp([Nr+"?"+Tf+"+"+If+"(?="+[Af,Nr,"$"].join("|")+")",EO+"+"+Lf+"(?="+[Af,Nr+Rf,"$"].join("|")+")",Nr+"?"+Rf+"+"+If,Nr+"+"+Lf,PO,MO,_f,AO].join("|"),"g");function TO(n){return n.match(_O)||[]}function kO(n,e,t){return n=Li(n),e=e,e===void 0?lO(n)?TO(n):oO(n):n.match(e)||[]}var VO="['’]",DO=RegExp(VO,"g");function $f(n){return function(e){return YE(kO(rO(e).replace(DO,"")),n,"")}}var la=$f(function(n,e,t){return e=e.toLowerCase(),n+(t?WE(e):e)});function RO(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function Ct(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Ti(t),t=t===t?t:0),e!==void 0&&(e=Ti(e),e=e===e?e:0),RO(Ti(n),e,t)}function IO(){this.__data__=new Wn,this.size=0}function LO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function BO(n){return this.__data__.get(n)}function jO(n){return this.__data__.has(n)}var $O=200;function zO(n,e){var t=this.__data__;if(t instanceof Wn){var s=t.__data__;if(!Ii||s.length<$O-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new Yn(s)}return t.set(n,e),this.size=t.size,this}function an(n){var e=this.__data__=new Wn(n);this.size=e.size}an.prototype.clear=IO,an.prototype.delete=LO,an.prototype.get=BO,an.prototype.has=jO,an.prototype.set=zO;function FO(n,e){return n&&ki(e,Di(e),n)}function UO(n,e){return n&&ki(e,Pr(e),n)}var zf=typeof xe=="object"&&xe&&!xe.nodeType&&xe,Ff=zf&&typeof module=="object"&&module&&!module.nodeType&&module,HO=Ff&&Ff.exports===zf,Uf=HO?rn.Buffer:void 0,Hf=Uf?Uf.allocUnsafe:void 0;function Gf(n,e){if(e)return n.slice();var t=n.length,s=Hf?Hf(t):new n.constructor(t);return n.copy(s),s}function GO(n,e){for(var t=-1,s=n==null?0:n.length,r=0,i=[];++t<s;){var o=n[t];e(o,t,n)&&(i[r++]=o)}return i}function Wf(){return[]}var WO=Object.prototype,YO=WO.propertyIsEnumerable,Yf=Object.getOwnPropertySymbols,Cc=Yf?function(n){return n==null?[]:(n=Object(n),GO(Yf(n),function(e){return YO.call(n,e)}))}:Wf;function qO(n,e){return ki(n,Cc(n),e)}var XO=Object.getOwnPropertySymbols,qf=XO?function(n){for(var e=[];n;)bc(e,Cc(n)),n=wc(n);return e}:Wf;function JO(n,e){return ki(n,qf(n),e)}function Xf(n,e,t){var s=e(n);return ft(n)?s:bc(s,t(n))}function Sc(n){return Xf(n,Di,Cc)}function KO(n){return Xf(n,Pr,qf)}var Ec=$s(rn,"DataView"),Oc=$s(rn,"Promise"),Ar=$s(rn,"Set"),Jf="[object Map]",ZO="[object Object]",Kf="[object Promise]",Zf="[object Set]",Qf="[object WeakMap]",ep="[object DataView]",QO=js(Ec),e2=js(Ii),t2=js(Oc),n2=js(Ar),s2=js(hc),Ut=cs;(Ec&&Ut(new Ec(new ArrayBuffer(1)))!=ep||Ii&&Ut(new Ii)!=Jf||Oc&&Ut(Oc.resolve())!=Kf||Ar&&Ut(new Ar)!=Zf||hc&&Ut(new hc)!=Qf)&&(Ut=function(n){var e=cs(n),t=e==ZO?n.constructor:void 0,s=t?js(t):"";if(s)switch(s){case QO:return ep;case e2:return Jf;case t2:return Kf;case n2:return Zf;case s2:return Qf}return e});var r2=Object.prototype,i2=r2.hasOwnProperty;function o2(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&i2.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ca=rn.Uint8Array;function Mc(n){var e=new n.constructor(n.byteLength);return new ca(e).set(new ca(n)),e}function a2(n,e){var t=e?Mc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var l2=/\w*$/;function c2(n){var e=new n.constructor(n.source,l2.exec(n));return e.lastIndex=n.lastIndex,e}var tp=Ft?Ft.prototype:void 0,np=tp?tp.valueOf:void 0;function u2(n){return np?Object(np.call(n)):{}}function sp(n,e){var t=e?Mc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var d2="[object Boolean]",h2="[object Date]",f2="[object Map]",p2="[object Number]",g2="[object RegExp]",m2="[object Set]",y2="[object String]",b2="[object Symbol]",w2="[object ArrayBuffer]",x2="[object DataView]",v2="[object Float32Array]",C2="[object Float64Array]",S2="[object Int8Array]",E2="[object Int16Array]",O2="[object Int32Array]",M2="[object Uint8Array]",P2="[object Uint8ClampedArray]",N2="[object Uint16Array]",A2="[object Uint32Array]";function _2(n,e,t){var s=n.constructor;switch(e){case w2:return Mc(n);case d2:case h2:return new s(+n);case x2:return a2(n,t);case v2:case C2:case S2:case E2:case O2:case M2:case P2:case N2:case A2:return sp(n,t);case f2:return new s;case p2:case y2:return new s(n);case g2:return c2(n);case m2:return new s;case b2:return u2(n)}}function rp(n){return typeof n.constructor=="function"&&!Qo(n)?PC(wc(n)):{}}var T2="[object Map]";function k2(n){return on(n)&&Ut(n)==T2}var ip=Mr&&Mr.isMap,V2=ip?ea(ip):k2,D2="[object Set]";function R2(n){return on(n)&&Ut(n)==D2}var op=Mr&&Mr.isSet,I2=op?ea(op):R2,L2=1,B2=2,j2=4,ap="[object Arguments]",$2="[object Array]",z2="[object Boolean]",F2="[object Date]",U2="[object Error]",lp="[object Function]",H2="[object GeneratorFunction]",G2="[object Map]",W2="[object Number]",cp="[object Object]",Y2="[object RegExp]",q2="[object Set]",X2="[object String]",J2="[object Symbol]",K2="[object WeakMap]",Z2="[object ArrayBuffer]",Q2="[object DataView]",eM="[object Float32Array]",tM="[object Float64Array]",nM="[object Int8Array]",sM="[object Int16Array]",rM="[object Int32Array]",iM="[object Uint8Array]",oM="[object Uint8ClampedArray]",aM="[object Uint16Array]",lM="[object Uint32Array]",Ne={};Ne[ap]=Ne[$2]=Ne[Z2]=Ne[Q2]=Ne[z2]=Ne[F2]=Ne[eM]=Ne[tM]=Ne[nM]=Ne[sM]=Ne[rM]=Ne[G2]=Ne[W2]=Ne[cp]=Ne[Y2]=Ne[q2]=Ne[X2]=Ne[J2]=Ne[iM]=Ne[oM]=Ne[aM]=Ne[lM]=!0,Ne[U2]=Ne[lp]=Ne[K2]=!1;function ji(n,e,t,s,r,i){var o,a=e&L2,c=e&B2,u=e&j2;if(o!==void 0)return o;if(!Be(n))return n;var d=ft(n);if(d){if(o=o2(n),!a)return Xh(n,o)}else{var f=Ut(n),h=f==lp||f==H2;if(Or(n))return Gf(n,a);if(f==cp||f==ap||h&&!r){if(o=c||h?{}:rp(n),!a)return c?JO(n,UO(o,n)):qO(n,FO(o,n))}else{if(!Ne[f])return r?n:{};o=_2(n,f,a)}}i||(i=new an);var p=i.get(n);if(p)return p;i.set(n,o),I2(n)?n.forEach(function(y){o.add(ji(y,e,t,y,n,i))}):V2(n)&&n.forEach(function(y,b){o.set(b,ji(y,e,t,b,n,i))});var g=u?c?KO:Sc:c?Pr:Di,m=d?void 0:g(n);return RC(m||n,function(y,b){m&&(b=y,y=n[b]),fc(o,b,ji(y,e,t,b,n,i))}),o}var cM=4;function Pc(n){return ji(n,cM)}var uM=1,dM=4;function ke(n){return ji(n,uM|dM)}var hM="__lodash_hash_undefined__";function fM(n){return this.__data__.set(n,hM),this}function pM(n){return this.__data__.has(n)}function _r(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Yn;++e<t;)this.add(n[e])}_r.prototype.add=_r.prototype.push=fM,_r.prototype.has=pM;function gM(n,e){for(var t=-1,s=n==null?0:n.length;++t<s;)if(e(n[t],t,n))return!0;return!1}function Nc(n,e){return n.has(e)}var mM=1,yM=2;function up(n,e,t,s,r,i){var o=t&mM,a=n.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=i.get(n),d=i.get(e);if(u&&d)return u==e&&d==n;var f=-1,h=!0,p=t&yM?new _r:void 0;for(i.set(n,e),i.set(e,n);++f<a;){var g=n[f],m=e[f];if(s)var y=o?s(m,g,f,e,n,i):s(g,m,f,n,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!gM(e,function(b,w){if(!Nc(p,w)&&(g===b||r(g,b,t,s,i)))return p.push(w)})){h=!1;break}}else if(!(g===m||r(g,m,t,s,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function bM(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function Ac(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var wM=1,xM=2,vM="[object Boolean]",CM="[object Date]",SM="[object Error]",EM="[object Map]",OM="[object Number]",MM="[object RegExp]",PM="[object Set]",NM="[object String]",AM="[object Symbol]",_M="[object ArrayBuffer]",TM="[object DataView]",dp=Ft?Ft.prototype:void 0,_c=dp?dp.valueOf:void 0;function kM(n,e,t,s,r,i,o){switch(t){case TM:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case _M:return!(n.byteLength!=e.byteLength||!i(new ca(n),new ca(e)));case vM:case CM:case OM:return Cr(+n,+e);case SM:return n.name==e.name&&n.message==e.message;case MM:case NM:return n==e+"";case EM:var a=bM;case PM:var c=s&wM;if(a||(a=Ac),n.size!=e.size&&!c)return!1;var u=o.get(n);if(u)return u==e;s|=xM,o.set(n,e);var d=up(a(n),a(e),s,r,i,o);return o.delete(n),d;case AM:if(_c)return _c.call(n)==_c.call(e)}return!1}var VM=1,DM=Object.prototype,RM=DM.hasOwnProperty;function IM(n,e,t,s,r,i){var o=t&VM,a=Sc(n),c=a.length,u=Sc(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=a[f];if(!(o?h in e:RM.call(e,h)))return!1}var p=i.get(n),g=i.get(e);if(p&&g)return p==e&&g==n;var m=!0;i.set(n,e),i.set(e,n);for(var y=o;++f<c;){h=a[f];var b=n[h],w=e[h];if(s)var x=o?s(w,b,h,e,n,i):s(b,w,h,n,e,i);if(!(x===void 0?b===w||r(b,w,t,s,i):x)){m=!1;break}y||(y=h=="constructor")}if(m&&!y){var v=n.constructor,C=e.constructor;v!=C&&"constructor"in n&&"constructor"in e&&!(typeof v=="function"&&v instanceof v&&typeof C=="function"&&C instanceof C)&&(m=!1)}return i.delete(n),i.delete(e),m}var LM=1,hp="[object Arguments]",fp="[object Array]",ua="[object Object]",BM=Object.prototype,pp=BM.hasOwnProperty;function jM(n,e,t,s,r,i){var o=ft(n),a=ft(e),c=o?fp:Ut(n),u=a?fp:Ut(e);c=c==hp?ua:c,u=u==hp?ua:u;var d=c==ua,f=u==ua,h=c==u;if(h&&Or(n)){if(!Or(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new an),o||ta(n)?up(n,e,t,s,r,i):kM(n,e,c,t,s,r,i);if(!(t&LM)){var p=d&&pp.call(n,"__wrapped__"),g=f&&pp.call(e,"__wrapped__");if(p||g){var m=p?n.value():n,y=g?e.value():e;return i||(i=new an),r(m,y,t,s,i)}}return h?(i||(i=new an),IM(n,e,t,s,r,i)):!1}function da(n,e,t,s,r){return n===e?!0:n==null||e==null||!on(n)&&!on(e)?n!==n&&e!==e:jM(n,e,t,s,da,r)}var $M=1,zM=2;function FM(n,e,t,s){var r=t.length,i=r;if(n==null)return!i;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<i;){o=t[r];var a=o[0],c=n[a],u=o[1];if(o[2]){if(c===void 0&&!(a in n))return!1}else{var d=new an,f;if(!(f===void 0?da(u,c,$M|zM,s,d):f))return!1}}return!0}function gp(n){return n===n&&!Be(n)}function UM(n){for(var e=Di(n),t=e.length;t--;){var s=e[t],r=n[s];e[t]=[s,r,gp(r)]}return e}function mp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function HM(n){var e=UM(n);return e.length==1&&e[0][2]?mp(e[0][0],e[0][1]):function(t){return t===n||FM(t,n,e)}}function GM(n,e){return n!=null&&e in Object(n)}function yp(n,e,t){e=ra(e,n);for(var s=-1,r=e.length,i=!1;++s<r;){var o=Bi(e[s]);if(!(i=n!=null&&t(n,o)))break;n=n[o]}return i||++s!=r?i:(r=n==null?0:n.length,!!r&&pc(r)&&Jo(o,r)&&(ft(n)||Er(n)))}function bp(n,e){return n!=null&&yp(n,e,GM)}var WM=1,YM=2;function qM(n,e){return mc(n)&&gp(e)?mp(Bi(n),e):function(t){var s=hf(t,n);return s===void 0&&s===e?bp(t,n):da(e,s,WM|YM)}}function XM(n){return function(e){return e==null?void 0:e[n]}}function JM(n){return function(e){return ia(e,n)}}function KM(n){return mc(n)?XM(Bi(n)):JM(n)}function Tc(n){return typeof n=="function"?n:n==null?vr:typeof n=="object"?ft(n)?qM(n[0],n[1]):HM(n):KM(n)}function ZM(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;){var o=n[r];e(s,o,t(o),n)}return s}function QM(n){return function(e,t,s){for(var r=-1,i=Object(e),o=s(e),a=o.length;a--;){var c=o[++r];if(t(i[c],c,i)===!1)break}return e}}var wp=QM();function eP(n,e){return n&&wp(n,e,Di)}function tP(n,e){return function(t,s){if(t==null)return t;if(!zs(t))return n(t,s);for(var r=t.length,i=-1,o=Object(t);++i<r&&s(o[i],i,o)!==!1;);return t}}var xp=tP(eP);function nP(n,e,t,s){return xp(n,function(r,i,o){e(s,r,t(r),o)}),s}function sP(n,e){return function(t,s){var r=ft(t)?ZM:nP,i=e?e():{};return r(t,n,Tc(s),i)}}var kc=function(){return rn.Date.now()},rP="Expected a function",iP=Math.max,oP=Math.min;function vp(n,e,t){var s,r,i,o,a,c,u=0,d=!1,f=!1,h=!0;if(typeof n!="function")throw new TypeError(rP);e=Ti(e)||0,Be(t)&&(d=!!t.leading,f="maxWait"in t,i=f?iP(Ti(t.maxWait)||0,e):i,h="trailing"in t?!!t.trailing:h);function p(E){var S=s,O=r;return s=r=void 0,u=E,o=n.apply(O,S),o}function g(E){return u=E,a=setTimeout(b,e),d?p(E):o}function m(E){var S=E-c,O=E-u,A=e-S;return f?oP(A,i-O):A}function y(E){var S=E-c,O=E-u;return c===void 0||S>=e||S<0||f&&O>=i}function b(){var E=kc();if(y(E))return w(E);a=setTimeout(b,m(E))}function w(E){return a=void 0,h&&s?p(E):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=c=r=a=void 0}function v(){return a===void 0?o:w(kc())}function C(){var E=kc(),S=y(E);if(s=arguments,r=this,c=E,S){if(a===void 0)return g(c);if(f)return clearTimeout(a),a=setTimeout(b,e),p(c)}return a===void 0&&(a=setTimeout(b,e)),o}return C.cancel=x,C.flush=v,C}var Cp=Object.prototype,aP=Cp.hasOwnProperty,lP=Sr(function(n,e){n=Object(n);var t=-1,s=e.length,r=s>2?e[2]:void 0;for(r&&Zo(e[0],e[1],r)&&(s=1);++t<s;)for(var i=e[t],o=Pr(i),a=-1,c=o.length;++a<c;){var u=o[a],d=n[u];(d===void 0||Cr(d,Cp[u])&&!aP.call(n,u))&&(n[u]=i[u])}return n});function Vc(n,e,t){(t!==void 0&&!Cr(n[e],t)||t===void 0&&!(e in n))&&Ko(n,e,t)}function ha(n){return on(n)&&zs(n)}function Dc(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function cP(n){return ki(n,Pr(n))}function uP(n,e,t,s,r,i,o){var a=Dc(n,t),c=Dc(e,t),u=o.get(c);if(u){Vc(n,t,u);return}var d=i?i(a,c,t+"",n,e,o):void 0,f=d===void 0;if(f){var h=ft(c),p=!h&&Or(c),g=!h&&!p&&ta(c);d=c,h||p||g?ft(a)?d=a:ha(a)?d=Xh(a):p?(f=!1,d=Gf(c,!0)):g?(f=!1,d=sp(c,!0)):d=[]:Mn(c)||Er(c)?(d=a,Er(a)?d=cP(a):(!Be(a)||uc(a))&&(d=rp(c))):f=!1}f&&(o.set(c,d),r(d,c,s,i,o),o.delete(c)),Vc(n,t,d)}function fa(n,e,t,s,r){n!==e&&wp(e,function(i,o){if(r||(r=new an),Be(i))uP(n,e,o,t,fa,s,r);else{var a=s?s(Dc(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),Vc(n,o,a)}},Pr)}function Sp(n,e,t,s,r,i){return Be(n)&&Be(e)&&(i.set(e,n),fa(n,e,void 0,Sp,i),i.delete(e)),n}var dP=ef(function(n,e,t,s){fa(n,e,t,s)}),Ep=Sr(function(n){return n.push(void 0,Sp),qh(dP,void 0,n)}),hP=200;function fP(n,e,t,s){var r=-1,i=Kh,o=!0,a=n.length,c=[],u=e.length;if(!a)return c;e.length>=hP&&(i=Nc,o=!1,e=new _r(e));e:for(;++r<a;){var d=n[r],f=d;if(d=d!==0?d:0,o&&f===f){for(var h=u;h--;)if(e[h]===f)continue e;c.push(d)}else i(e,f,s)||c.push(d)}return c}var pP=Sr(function(n,e){return ha(n)?fP(n,oa(e,1,ha,!0)):[]});function gP(n,e){var t=-1,s=zs(n)?Array(n.length):[];return xp(n,function(r,i,o){s[++t]=e(r,i,o)}),s}function pa(n){for(var e=-1,t=n==null?0:n.length,s={};++e<t;){var r=n[e];s[r[0]]=r[1]}return s}var mP=Object.prototype,yP=mP.hasOwnProperty,Op=sP(function(n,e,t){yP.call(n,t)?n[t].push(e):Ko(n,t,[e])});function bP(n,e){return n>e}var wP=Object.prototype,xP=wP.hasOwnProperty;function vP(n,e){return n!=null&&xP.call(n,e)}function ga(n,e){return n!=null&&yp(n,e,vP)}var CP="[object Map]",SP="[object Set]",EP=Object.prototype,OP=EP.hasOwnProperty;function Mp(n){if(n==null)return!0;if(zs(n)&&(ft(n)||typeof n=="string"||typeof n.splice=="function"||Or(n)||ta(n)||Er(n)))return!n.length;var e=Ut(n);if(e==CP||e==SP)return!n.size;if(Qo(n))return!df(n).length;for(var t in n)if(OP.call(n,t))return!1;return!0}function Pn(n,e){return da(n,e)}var MP="[object Number]";function Rc(n){return typeof n=="number"||on(n)&&cs(n)==MP}function ma(n){return n==null}function PP(n){return n===void 0}var NP=Cf("toLowerCase");function AP(n,e,t){for(var s=-1,r=n.length;++s<r;){var i=n[s],o=e(i);if(o!=null&&(a===void 0?o===o&&!On(o):t(o,a)))var a=o,c=i}return c}function _P(n){return n&&n.length?AP(n,vr,bP):void 0}var Ye=ef(function(n,e,t){fa(n,e,t)});function TP(n,e,t,s){if(!Be(n))return n;e=ra(e,n);for(var r=-1,i=e.length,o=i-1,a=n;a!=null&&++r<i;){var c=Bi(e[r]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(r!=o){var d=a[c];u=void 0,u===void 0&&(u=Be(d)?d:Jo(e[r+1])?[]:{})}fc(a,c,u),a=a[c]}return n}function kP(n,e,t){for(var s=-1,r=e.length,i={};++s<r;){var o=e[s],a=ia(n,o);t(a,o)&&TP(i,ra(o,n),a)}return i}function VP(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function DP(n,e){if(n!==e){var t=n!==void 0,s=n===null,r=n===n,i=On(n),o=e!==void 0,a=e===null,c=e===e,u=On(e);if(!a&&!u&&!i&&n>e||i&&o&&c&&!a&&!u||s&&o&&c||!t&&c||!r)return 1;if(!s&&!i&&!u&&n<e||u&&t&&r&&!s&&!i||a&&t&&r||!o&&r||!c)return-1}return 0}function RP(n,e,t){for(var s=-1,r=n.criteria,i=e.criteria,o=r.length,a=t.length;++s<o;){var c=DP(r[s],i[s]);if(c){if(s>=a)return c;var u=t[s];return c*(u=="desc"?-1:1)}}return n.index-e.index}function IP(n,e,t){e.length?e=qo(e,function(i){return ft(i)?function(o){return ia(o,i.length===1?i[0]:i)}:i}):e=[vr];var s=-1;e=qo(e,ea(Tc));var r=gP(n,function(i,o,a){var c=qo(e,function(u){return u(i)});return{criteria:c,index:++s,value:i}});return VP(r,function(i,o){return RP(i,o,t)})}function LP(n,e){return kP(n,e,function(t,s){return bp(n,s)})}var Ic=gE(function(n,e){return n==null?{}:LP(n,e)}),Lc=Sr(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Zo(n,e[0],e[1])?e=[]:t>2&&Zo(e[0],e[1],e[2])&&(e=[e[0]]),IP(n,oa(e),[])}),BP=4294967295,jP=BP-1,$P=Math.floor,zP=Math.min;function Pp(n,e,t,s){var r=0,i=n==null?0:n.length;if(i===0)return 0;e=t(e);for(var o=e!==e,a=e===null,c=On(e),u=e===void 0;r<i;){var d=$P((r+i)/2),f=t(n[d]),h=f!==void 0,p=f===null,g=f===f,m=On(f);if(o)var y=g;else u?y=g&&h:a?y=g&&h&&!p:c?y=g&&h&&!p&&!m:p||m?y=!1:y=f<e;y?r=d+1:i=d}return zP(i,jP)}var FP=4294967295,UP=FP>>>1;function HP(n,e,t){var s=0,r=n==null?s:n.length;if(typeof e=="number"&&e===e&&r<=UP){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!On(o)&&o<e?s=i+1:r=i}return r}return Pp(n,e,vr)}function GP(n,e){return HP(n,e)}function WP(n,e,t){return Pp(n,e,Tc(t))}var YP=$f(function(n,e,t){return n+(t?" ":"")+aa(e)}),qP="Expected a function";function XP(n,e,t){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(qP);return Be(t)&&(s="leading"in t?!!t.leading:s,r="trailing"in t?!!t.trailing:r),vp(n,e,{leading:s,maxWait:e,trailing:r})}var JP=1/0,KP=Ar&&1/Ac(new Ar([,-0]))[1]==JP?function(n){return new Ar(n)}:NC,ZP=200;function Np(n,e,t){var s=-1,r=Kh,i=n.length,o=!0,a=[],c=a;if(i>=ZP){var u=KP(n);if(u)return Ac(u);o=!1,r=Nc,c=new _r}else c=a;e:for(;++s<i;){var d=n[s],f=d;if(d=d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;a.push(d)}else r(c,f,t)||(c!==a&&c.push(f),a.push(d))}return a}var Ap=Sr(function(n){return Np(oa(n,1,ha,!0))});function _p(n){return n&&n.length?Np(n):[]}const Tp=n=>n===void 0,ya=n=>typeof n=="boolean",Ht=n=>typeof n=="number",qn=n=>typeof Element>"u"?!1:n instanceof Element,QP=n=>sn(n)?!Number.isNaN(Number(n)):!1,kp=n=>Object.keys(n);class Vp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function eN(n,e){throw new Vp(`[${n}] ${e}`)}function Tt(n,e){if(process.env.NODE_ENV!=="production"){const t=sn(n)?new Vp(`[${n}] ${e}`):n;console.warn(t)}}const tN="utils/dom/style",Dp=(n="")=>n.split(" ").filter(e=>!!e.trim()),Rp=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},nN=(n,e)=>{!n||!e.trim()||n.classList.add(...Dp(e))},sN=(n,e)=>{!n||!e.trim()||n.classList.remove(...Dp(e))},rN=(n,e)=>{var t;if(!We||!n||!e)return"";let s=Gv(e);s==="float"&&(s="cssFloat");try{const r=n.style[s];if(r)return r;const i=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return i?i[s]:""}catch{return n.style[s]}};function $i(n,e="px"){if(!n)return"";if(Ht(n)||QP(n))return`${n}${e}`;if(sn(n))return n;Tt(tN,"binding value must be a string or number")}let ba;const iN=n=>{var e;if(!We)return 0;if(ba!==void 0)return ba;const t=document.createElement("div");t.className=`${n}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const s=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),ba=s-i,ba};/*! Element Plus Icons Vue v2.3.1 */var oN=l.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),aN=oN,lN=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),Ip=lN,cN=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),Lp=cN,uN=l.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),dN=uN,hN=l.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),fN=hN,pN=l.defineComponent({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),Bp=pN,gN=l.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),wa=gN,mN=l.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),jp=mN,yN=l.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),bN=yN,wN=l.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),$p=wN;const zp="__epPropKey",he=n=>n,xN=n=>xr(n)&&!!n[zp],xa=(n,e)=>{if(!xr(n)||xN(n))return n;const{values:t,required:s,default:r,type:i,validator:o}=n,c={type:i,required:!!s,validator:t||o?u=>{let d=!1,f=[];if(t&&(f=Array.from(t),Yo(n,"default")&&f.push(r),d||(d=f.includes(u))),o&&(d||(d=o(u))),!d&&f.length>0){const h=[...new Set(f)].map(p=>JSON.stringify(p)).join(", ");l.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[zp]:!0};return Yo(n,"default")&&(c.default=r),c},et=n=>pa(Object.entries(n).map(([e,t])=>[e,xa(t,e)])),zi=he([String,Object,Function]),Fp={Close:dN,SuccessFilled:jp,InfoFilled:Bp,WarningFilled:$p,CircleCloseFilled:Ip},va={success:jp,warning:$p,error:Ip,info:Bp},vN={validating:wa,success:aN,error:Lp},Us=(n,e)=>{if(n.install=t=>{for(const s of[n,...Object.values(e??{})])t.component(s.name,s)},e)for(const[t,s]of Object.entries(e))n[t]=s;return n},CN=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),SN=n=>(n.install=ls,n),Tr={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"},Bc="update:modelValue",Up=["","default","small","large"],EN=n=>["",...Up].includes(n);var Ca=(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))(Ca||{});const ON=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),Hp=n=>n,MN=["class","style"],PN=/^on[A-Z]/,NN=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,s=l.computed(()=>((t==null?void 0:t.value)||[]).concat(MN)),r=l.getCurrentInstance();return r?l.computed(()=>{var i;return pa(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(e&&PN.test(o))))}):(Tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},AN=({from:n,replacement:e,scope:t,version:s,ref:r,type:i="API"},o)=>{l.watch(()=>l.unref(o),a=>{a&&Tt(t,`[${i}] ${n} is about to be deprecated in version ${s}, please use ${e} instead.
14
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const ls=()=>{},zv=Object.prototype.hasOwnProperty,Yo=(n,e)=>zv.call(n,e),Fv=Array.isArray,zt=n=>typeof n=="function",sn=n=>typeof n=="string",xr=n=>n!==null&&typeof n=="object",Uv=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Hv=/-(\w)/g,Gv=Uv(n=>n.replace(Hv,(e,t)=>t?t.toUpperCase():""));var $h=typeof global=="object"&&global&&global.Object===Object&&global,Wv=typeof self=="object"&&self&&self.Object===Object&&self,rn=$h||Wv||Function("return this")(),Ft=rn.Symbol,zh=Object.prototype,Yv=zh.hasOwnProperty,qv=zh.toString,_i=Ft?Ft.toStringTag:void 0;function Xv(n){var e=Yv.call(n,_i),t=n[_i];try{n[_i]=void 0;var s=!0}catch{}var r=qv.call(n);return s&&(e?n[_i]=t:delete n[_i]),r}var Jv=Object.prototype,Kv=Jv.toString;function Zv(n){return Kv.call(n)}var Qv="[object Null]",eC="[object Undefined]",Fh=Ft?Ft.toStringTag:void 0;function cs(n){return n==null?n===void 0?eC:Qv:Fh&&Fh in Object(n)?Xv(n):Zv(n)}function on(n){return n!=null&&typeof n=="object"}var tC="[object Symbol]";function On(n){return typeof n=="symbol"||on(n)&&cs(n)==tC}function qo(n,e){for(var t=-1,s=n==null?0:n.length,r=Array(s);++t<s;)r[t]=e(n[t],t,n);return r}var ft=Array.isArray,nC=1/0,Uh=Ft?Ft.prototype:void 0,Hh=Uh?Uh.toString:void 0;function Gh(n){if(typeof n=="string")return n;if(ft(n))return qo(n,Gh)+"";if(On(n))return Hh?Hh.call(n):"";var e=n+"";return e=="0"&&1/n==-nC?"-0":e}var sC=/\s/;function rC(n){for(var e=n.length;e--&&sC.test(n.charAt(e)););return e}var iC=/^\s+/;function oC(n){return n&&n.slice(0,rC(n)+1).replace(iC,"")}function Be(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Wh=NaN,aC=/^[-+]0x[0-9a-f]+$/i,lC=/^0b[01]+$/i,cC=/^0o[0-7]+$/i,uC=parseInt;function Ti(n){if(typeof n=="number")return n;if(On(n))return Wh;if(Be(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Be(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=oC(n);var t=lC.test(n);return t||cC.test(n)?uC(n.slice(2),t?2:8):aC.test(n)?Wh:+n}function vr(n){return n}var dC="[object AsyncFunction]",hC="[object Function]",fC="[object GeneratorFunction]",pC="[object Proxy]";function uc(n){if(!Be(n))return!1;var e=cs(n);return e==hC||e==fC||e==dC||e==pC}var dc=rn["__core-js_shared__"],Yh=function(){var n=/[^.]+$/.exec(dc&&dc.keys&&dc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function gC(n){return!!Yh&&Yh in n}var mC=Function.prototype,yC=mC.toString;function js(n){if(n!=null){try{return yC.call(n)}catch{}try{return n+""}catch{}}return""}var bC=/[\\^$.*+?()[\]{}|]/g,wC=/^\[object .+?Constructor\]$/,xC=Function.prototype,vC=Object.prototype,CC=xC.toString,SC=vC.hasOwnProperty,EC=RegExp("^"+CC.call(SC).replace(bC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OC(n){if(!Be(n)||gC(n))return!1;var e=uc(n)?EC:wC;return e.test(js(n))}function MC(n,e){return n==null?void 0:n[e]}function $s(n,e){var t=MC(n,e);return OC(t)?t:void 0}var hc=$s(rn,"WeakMap"),qh=Object.create,PC=function(){function n(){}return function(e){if(!Be(e))return{};if(qh)return qh(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Xh(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function NC(){}function Jh(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var AC=800,_C=16,TC=Date.now;function kC(n){var e=0,t=0;return function(){var s=TC(),r=_C-(s-t);if(t=s,r>0){if(++e>=AC)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function VC(n){return function(){return n}}var Xo=function(){try{var n=$s(Object,"defineProperty");return n({},"",{}),n}catch{}}(),DC=Xo?function(n,e){return Xo(n,"toString",{configurable:!0,enumerable:!1,value:VC(e),writable:!0})}:vr,Kh=kC(DC);function RC(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}function IC(n,e,t,s){for(var r=n.length,i=t+-1;++i<r;)if(e(n[i],i,n))return i;return-1}function LC(n){return n!==n}function BC(n,e,t){for(var s=t-1,r=n.length;++s<r;)if(n[s]===e)return s;return-1}function jC(n,e,t){return e===e?BC(n,e,t):IC(n,LC,t)}function Zh(n,e){var t=n==null?0:n.length;return!!t&&jC(n,e,0)>-1}var $C=9007199254740991,zC=/^(?:0|[1-9]\d*)$/;function Jo(n,e){var t=typeof n;return e=e??$C,!!e&&(t=="number"||t!="symbol"&&zC.test(n))&&n>-1&&n%1==0&&n<e}function Ko(n,e,t){e=="__proto__"&&Xo?Xo(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Cr(n,e){return n===e||n!==n&&e!==e}var FC=Object.prototype,UC=FC.hasOwnProperty;function fc(n,e,t){var s=n[e];(!(UC.call(n,e)&&Cr(s,t))||t===void 0&&!(e in n))&&Ko(n,e,t)}function ki(n,e,t,s){var r=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],c=void 0;c===void 0&&(c=n[a]),r?Ko(t,a,c):fc(t,a,c)}return t}var Qh=Math.max;function ef(n,e,t){return e=Qh(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Qh(s.length-e,0),o=Array(i);++r<i;)o[r]=s[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=s[r];return a[e]=t(o),Xh(n,this,a)}}function Sr(n,e){return Kh(ef(n,e,vr),n+"")}var HC=9007199254740991;function pc(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=HC}function zs(n){return n!=null&&pc(n.length)&&!uc(n)}function Zo(n,e,t){if(!Be(t))return!1;var s=typeof e;return(s=="number"?zs(t)&&Jo(e,t.length):s=="string"&&e in t)?Cr(t[e],n):!1}function tf(n){return Sr(function(e,t){var s=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&Zo(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++s<r;){var a=t[s];a&&n(e,a,s,i)}return e})}var GC=Object.prototype;function Qo(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||GC;return n===t}function WC(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var YC="[object Arguments]";function nf(n){return on(n)&&cs(n)==YC}var sf=Object.prototype,qC=sf.hasOwnProperty,XC=sf.propertyIsEnumerable,Er=nf(function(){return arguments}())?nf:function(n){return on(n)&&qC.call(n,"callee")&&!XC.call(n,"callee")};function JC(){return!1}var rf=typeof xe=="object"&&xe&&!xe.nodeType&&xe,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,KC=of&&of.exports===rf,af=KC?rn.Buffer:void 0,ZC=af?af.isBuffer:void 0,Or=ZC||JC,QC="[object Arguments]",eS="[object Array]",tS="[object Boolean]",nS="[object Date]",sS="[object Error]",rS="[object Function]",iS="[object Map]",oS="[object Number]",aS="[object Object]",lS="[object RegExp]",cS="[object Set]",uS="[object String]",dS="[object WeakMap]",hS="[object ArrayBuffer]",fS="[object DataView]",pS="[object Float32Array]",gS="[object Float64Array]",mS="[object Int8Array]",yS="[object Int16Array]",bS="[object Int32Array]",wS="[object Uint8Array]",xS="[object Uint8ClampedArray]",vS="[object Uint16Array]",CS="[object Uint32Array]",Te={};Te[pS]=Te[gS]=Te[mS]=Te[yS]=Te[bS]=Te[wS]=Te[xS]=Te[vS]=Te[CS]=!0,Te[QC]=Te[eS]=Te[hS]=Te[tS]=Te[fS]=Te[nS]=Te[sS]=Te[rS]=Te[iS]=Te[oS]=Te[aS]=Te[lS]=Te[cS]=Te[uS]=Te[dS]=!1;function SS(n){return on(n)&&pc(n.length)&&!!Te[cs(n)]}function ea(n){return function(e){return n(e)}}var lf=typeof xe=="object"&&xe&&!xe.nodeType&&xe,Vi=lf&&typeof module=="object"&&module&&!module.nodeType&&module,ES=Vi&&Vi.exports===lf,gc=ES&&$h.process,Mr=function(){try{var n=Vi&&Vi.require&&Vi.require("util").types;return n||gc&&gc.binding&&gc.binding("util")}catch{}}(),cf=Mr&&Mr.isTypedArray,ta=cf?ea(cf):SS,OS=Object.prototype,MS=OS.hasOwnProperty;function uf(n,e){var t=ft(n),s=!t&&Er(n),r=!t&&!s&&Or(n),i=!t&&!s&&!r&&ta(n),o=t||s||r||i,a=o?WC(n.length,String):[],c=a.length;for(var u in n)(e||MS.call(n,u))&&!(o&&(u=="length"||r&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Jo(u,c)))&&a.push(u);return a}function df(n,e){return function(t){return n(e(t))}}var PS=df(Object.keys,Object),NS=Object.prototype,AS=NS.hasOwnProperty;function hf(n){if(!Qo(n))return PS(n);var e=[];for(var t in Object(n))AS.call(n,t)&&t!="constructor"&&e.push(t);return e}function Di(n){return zs(n)?uf(n):hf(n)}function _S(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var TS=Object.prototype,kS=TS.hasOwnProperty;function VS(n){if(!Be(n))return _S(n);var e=Qo(n),t=[];for(var s in n)s=="constructor"&&(e||!kS.call(n,s))||t.push(s);return t}function Pr(n){return zs(n)?uf(n,!0):VS(n)}var DS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,RS=/^\w*$/;function mc(n,e){if(ft(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||On(n)?!0:RS.test(n)||!DS.test(n)||e!=null&&n in Object(e)}var Ri=$s(Object,"create");function IS(){this.__data__=Ri?Ri(null):{},this.size=0}function LS(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var BS="__lodash_hash_undefined__",jS=Object.prototype,$S=jS.hasOwnProperty;function zS(n){var e=this.__data__;if(Ri){var t=e[n];return t===BS?void 0:t}return $S.call(e,n)?e[n]:void 0}var FS=Object.prototype,US=FS.hasOwnProperty;function HS(n){var e=this.__data__;return Ri?e[n]!==void 0:US.call(e,n)}var GS="__lodash_hash_undefined__";function WS(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ri&&e===void 0?GS:e,this}function Fs(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Fs.prototype.clear=IS,Fs.prototype.delete=LS,Fs.prototype.get=zS,Fs.prototype.has=HS,Fs.prototype.set=WS;function YS(){this.__data__=[],this.size=0}function na(n,e){for(var t=n.length;t--;)if(Cr(n[t][0],e))return t;return-1}var qS=Array.prototype,XS=qS.splice;function JS(n){var e=this.__data__,t=na(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():XS.call(e,t,1),--this.size,!0}function KS(n){var e=this.__data__,t=na(e,n);return t<0?void 0:e[t][1]}function ZS(n){return na(this.__data__,n)>-1}function QS(n,e){var t=this.__data__,s=na(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Wn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Wn.prototype.clear=YS,Wn.prototype.delete=JS,Wn.prototype.get=KS,Wn.prototype.has=ZS,Wn.prototype.set=QS;var Ii=$s(rn,"Map");function eE(){this.size=0,this.__data__={hash:new Fs,map:new(Ii||Wn),string:new Fs}}function tE(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function sa(n,e){var t=n.__data__;return tE(e)?t[typeof e=="string"?"string":"hash"]:t.map}function nE(n){var e=sa(this,n).delete(n);return this.size-=e?1:0,e}function sE(n){return sa(this,n).get(n)}function rE(n){return sa(this,n).has(n)}function iE(n,e){var t=sa(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function Yn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Yn.prototype.clear=eE,Yn.prototype.delete=nE,Yn.prototype.get=sE,Yn.prototype.has=rE,Yn.prototype.set=iE;var oE="Expected a function";function yc(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(oE);var t=function(){var s=arguments,r=e?e.apply(this,s):s[0],i=t.cache;if(i.has(r))return i.get(r);var o=n.apply(this,s);return t.cache=i.set(r,o)||i,o};return t.cache=new(yc.Cache||Yn),t}yc.Cache=Yn;var aE=500;function lE(n){var e=yc(n,function(s){return t.size===aE&&t.clear(),s}),t=e.cache;return e}var cE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uE=/\\(\\)?/g,dE=lE(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(cE,function(t,s,r,i){e.push(r?i.replace(uE,"$1"):s||t)}),e});function Li(n){return n==null?"":Gh(n)}function ra(n,e){return ft(n)?n:mc(n,e)?[n]:dE(Li(n))}var hE=1/0;function Bi(n){if(typeof n=="string"||On(n))return n;var e=n+"";return e=="0"&&1/n==-hE?"-0":e}function ia(n,e){e=ra(e,n);for(var t=0,s=e.length;n!=null&&t<s;)n=n[Bi(e[t++])];return t&&t==s?n:void 0}function ff(n,e,t){var s=n==null?void 0:ia(n,e);return s===void 0?t:s}function bc(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var pf=Ft?Ft.isConcatSpreadable:void 0;function fE(n){return ft(n)||Er(n)||!!(pf&&n&&n[pf])}function oa(n,e,t,s,r){var i=-1,o=n.length;for(t||(t=fE),r||(r=[]);++i<o;){var a=n[i];t(a)?bc(r,a):s||(r[r.length]=a)}return r}function pE(n){var e=n==null?0:n.length;return e?oa(n):[]}function gE(n){return Kh(ef(n,void 0,pE),n+"")}var wc=df(Object.getPrototypeOf,Object),mE="[object Object]",yE=Function.prototype,bE=Object.prototype,gf=yE.toString,wE=bE.hasOwnProperty,xE=gf.call(Object);function Mn(n){if(!on(n)||cs(n)!=mE)return!1;var e=wc(n);if(e===null)return!0;var t=wE.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&gf.call(t)==xE}function vE(n,e,t){var s=-1,r=n.length;e<0&&(e=-e>r?0:r+e),t=t>r?r:t,t<0&&(t+=r),r=e>t?0:t-e>>>0,e>>>=0;for(var i=Array(r);++s<r;)i[s]=n[s+e];return i}function CE(n,e,t){var s=n.length;return t=t===void 0?s:t,!e&&t>=s?n:vE(n,e,t)}var SE="\\ud800-\\udfff",EE="\\u0300-\\u036f",OE="\\ufe20-\\ufe2f",ME="\\u20d0-\\u20ff",PE=EE+OE+ME,NE="\\ufe0e\\ufe0f",AE="\\u200d",_E=RegExp("["+AE+SE+PE+NE+"]");function mf(n){return _E.test(n)}function TE(n){return n.split("")}var yf="\\ud800-\\udfff",kE="\\u0300-\\u036f",VE="\\ufe20-\\ufe2f",DE="\\u20d0-\\u20ff",RE=kE+VE+DE,IE="\\ufe0e\\ufe0f",LE="["+yf+"]",xc="["+RE+"]",vc="\\ud83c[\\udffb-\\udfff]",BE="(?:"+xc+"|"+vc+")",bf="[^"+yf+"]",wf="(?:\\ud83c[\\udde6-\\uddff]){2}",xf="[\\ud800-\\udbff][\\udc00-\\udfff]",jE="\\u200d",vf=BE+"?",Cf="["+IE+"]?",$E="(?:"+jE+"(?:"+[bf,wf,xf].join("|")+")"+Cf+vf+")*",zE=Cf+vf+$E,FE="(?:"+[bf+xc+"?",xc,wf,xf,LE].join("|")+")",UE=RegExp(vc+"(?="+vc+")|"+FE+zE,"g");function HE(n){return n.match(UE)||[]}function GE(n){return mf(n)?HE(n):TE(n)}function Sf(n){return function(e){e=Li(e);var t=mf(e)?GE(e):void 0,s=t?t[0]:e.charAt(0),r=t?CE(t,1).join(""):e.slice(1);return s[n]()+r}}var aa=Sf("toUpperCase");function WE(n){return aa(Li(n).toLowerCase())}function YE(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;)t=e(t,n[r],r,n);return t}function qE(n){return function(e){return n==null?void 0:n[e]}}var XE={À:"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"},JE=qE(XE),KE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ZE="\\u0300-\\u036f",QE="\\ufe20-\\ufe2f",eO="\\u20d0-\\u20ff",tO=ZE+QE+eO,nO="["+tO+"]",sO=RegExp(nO,"g");function rO(n){return n=Li(n),n&&n.replace(KE,JE).replace(sO,"")}var iO=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function oO(n){return n.match(iO)||[]}var aO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lO(n){return aO.test(n)}var Ef="\\ud800-\\udfff",cO="\\u0300-\\u036f",uO="\\ufe20-\\ufe2f",dO="\\u20d0-\\u20ff",hO=cO+uO+dO,Of="\\u2700-\\u27bf",Mf="a-z\\xdf-\\xf6\\xf8-\\xff",fO="\\xac\\xb1\\xd7\\xf7",pO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gO="\\u2000-\\u206f",mO=" \\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",Pf="A-Z\\xc0-\\xd6\\xd8-\\xde",yO="\\ufe0e\\ufe0f",Nf=fO+pO+gO+mO,Af="['’]",_f="["+Nf+"]",bO="["+hO+"]",Tf="\\d+",wO="["+Of+"]",kf="["+Mf+"]",Vf="[^"+Ef+Nf+Tf+Of+Mf+Pf+"]",xO="\\ud83c[\\udffb-\\udfff]",vO="(?:"+bO+"|"+xO+")",CO="[^"+Ef+"]",Df="(?:\\ud83c[\\udde6-\\uddff]){2}",Rf="[\\ud800-\\udbff][\\udc00-\\udfff]",Nr="["+Pf+"]",SO="\\u200d",If="(?:"+kf+"|"+Vf+")",EO="(?:"+Nr+"|"+Vf+")",Lf="(?:"+Af+"(?:d|ll|m|re|s|t|ve))?",Bf="(?:"+Af+"(?:D|LL|M|RE|S|T|VE))?",jf=vO+"?",$f="["+yO+"]?",OO="(?:"+SO+"(?:"+[CO,Df,Rf].join("|")+")"+$f+jf+")*",MO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",PO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",NO=$f+jf+OO,AO="(?:"+[wO,Df,Rf].join("|")+")"+NO,_O=RegExp([Nr+"?"+kf+"+"+Lf+"(?="+[_f,Nr,"$"].join("|")+")",EO+"+"+Bf+"(?="+[_f,Nr+If,"$"].join("|")+")",Nr+"?"+If+"+"+Lf,Nr+"+"+Bf,PO,MO,Tf,AO].join("|"),"g");function TO(n){return n.match(_O)||[]}function kO(n,e,t){return n=Li(n),e=e,e===void 0?lO(n)?TO(n):oO(n):n.match(e)||[]}var VO="['’]",DO=RegExp(VO,"g");function zf(n){return function(e){return YE(kO(rO(e).replace(DO,"")),n,"")}}var la=zf(function(n,e,t){return e=e.toLowerCase(),n+(t?WE(e):e)});function RO(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function Ct(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Ti(t),t=t===t?t:0),e!==void 0&&(e=Ti(e),e=e===e?e:0),RO(Ti(n),e,t)}function IO(){this.__data__=new Wn,this.size=0}function LO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function BO(n){return this.__data__.get(n)}function jO(n){return this.__data__.has(n)}var $O=200;function zO(n,e){var t=this.__data__;if(t instanceof Wn){var s=t.__data__;if(!Ii||s.length<$O-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new Yn(s)}return t.set(n,e),this.size=t.size,this}function an(n){var e=this.__data__=new Wn(n);this.size=e.size}an.prototype.clear=IO,an.prototype.delete=LO,an.prototype.get=BO,an.prototype.has=jO,an.prototype.set=zO;function FO(n,e){return n&&ki(e,Di(e),n)}function UO(n,e){return n&&ki(e,Pr(e),n)}var Ff=typeof xe=="object"&&xe&&!xe.nodeType&&xe,Uf=Ff&&typeof module=="object"&&module&&!module.nodeType&&module,HO=Uf&&Uf.exports===Ff,Hf=HO?rn.Buffer:void 0,Gf=Hf?Hf.allocUnsafe:void 0;function Wf(n,e){if(e)return n.slice();var t=n.length,s=Gf?Gf(t):new n.constructor(t);return n.copy(s),s}function GO(n,e){for(var t=-1,s=n==null?0:n.length,r=0,i=[];++t<s;){var o=n[t];e(o,t,n)&&(i[r++]=o)}return i}function Yf(){return[]}var WO=Object.prototype,YO=WO.propertyIsEnumerable,qf=Object.getOwnPropertySymbols,Cc=qf?function(n){return n==null?[]:(n=Object(n),GO(qf(n),function(e){return YO.call(n,e)}))}:Yf;function qO(n,e){return ki(n,Cc(n),e)}var XO=Object.getOwnPropertySymbols,Xf=XO?function(n){for(var e=[];n;)bc(e,Cc(n)),n=wc(n);return e}:Yf;function JO(n,e){return ki(n,Xf(n),e)}function Jf(n,e,t){var s=e(n);return ft(n)?s:bc(s,t(n))}function Sc(n){return Jf(n,Di,Cc)}function KO(n){return Jf(n,Pr,Xf)}var Ec=$s(rn,"DataView"),Oc=$s(rn,"Promise"),Ar=$s(rn,"Set"),Kf="[object Map]",ZO="[object Object]",Zf="[object Promise]",Qf="[object Set]",ep="[object WeakMap]",tp="[object DataView]",QO=js(Ec),e2=js(Ii),t2=js(Oc),n2=js(Ar),s2=js(hc),Ut=cs;(Ec&&Ut(new Ec(new ArrayBuffer(1)))!=tp||Ii&&Ut(new Ii)!=Kf||Oc&&Ut(Oc.resolve())!=Zf||Ar&&Ut(new Ar)!=Qf||hc&&Ut(new hc)!=ep)&&(Ut=function(n){var e=cs(n),t=e==ZO?n.constructor:void 0,s=t?js(t):"";if(s)switch(s){case QO:return tp;case e2:return Kf;case t2:return Zf;case n2:return Qf;case s2:return ep}return e});var r2=Object.prototype,i2=r2.hasOwnProperty;function o2(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&i2.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var ca=rn.Uint8Array;function Mc(n){var e=new n.constructor(n.byteLength);return new ca(e).set(new ca(n)),e}function a2(n,e){var t=e?Mc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var l2=/\w*$/;function c2(n){var e=new n.constructor(n.source,l2.exec(n));return e.lastIndex=n.lastIndex,e}var np=Ft?Ft.prototype:void 0,sp=np?np.valueOf:void 0;function u2(n){return sp?Object(sp.call(n)):{}}function rp(n,e){var t=e?Mc(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var d2="[object Boolean]",h2="[object Date]",f2="[object Map]",p2="[object Number]",g2="[object RegExp]",m2="[object Set]",y2="[object String]",b2="[object Symbol]",w2="[object ArrayBuffer]",x2="[object DataView]",v2="[object Float32Array]",C2="[object Float64Array]",S2="[object Int8Array]",E2="[object Int16Array]",O2="[object Int32Array]",M2="[object Uint8Array]",P2="[object Uint8ClampedArray]",N2="[object Uint16Array]",A2="[object Uint32Array]";function _2(n,e,t){var s=n.constructor;switch(e){case w2:return Mc(n);case d2:case h2:return new s(+n);case x2:return a2(n,t);case v2:case C2:case S2:case E2:case O2:case M2:case P2:case N2:case A2:return rp(n,t);case f2:return new s;case p2:case y2:return new s(n);case g2:return c2(n);case m2:return new s;case b2:return u2(n)}}function ip(n){return typeof n.constructor=="function"&&!Qo(n)?PC(wc(n)):{}}var T2="[object Map]";function k2(n){return on(n)&&Ut(n)==T2}var op=Mr&&Mr.isMap,V2=op?ea(op):k2,D2="[object Set]";function R2(n){return on(n)&&Ut(n)==D2}var ap=Mr&&Mr.isSet,I2=ap?ea(ap):R2,L2=1,B2=2,j2=4,lp="[object Arguments]",$2="[object Array]",z2="[object Boolean]",F2="[object Date]",U2="[object Error]",cp="[object Function]",H2="[object GeneratorFunction]",G2="[object Map]",W2="[object Number]",up="[object Object]",Y2="[object RegExp]",q2="[object Set]",X2="[object String]",J2="[object Symbol]",K2="[object WeakMap]",Z2="[object ArrayBuffer]",Q2="[object DataView]",eM="[object Float32Array]",tM="[object Float64Array]",nM="[object Int8Array]",sM="[object Int16Array]",rM="[object Int32Array]",iM="[object Uint8Array]",oM="[object Uint8ClampedArray]",aM="[object Uint16Array]",lM="[object Uint32Array]",Ne={};Ne[lp]=Ne[$2]=Ne[Z2]=Ne[Q2]=Ne[z2]=Ne[F2]=Ne[eM]=Ne[tM]=Ne[nM]=Ne[sM]=Ne[rM]=Ne[G2]=Ne[W2]=Ne[up]=Ne[Y2]=Ne[q2]=Ne[X2]=Ne[J2]=Ne[iM]=Ne[oM]=Ne[aM]=Ne[lM]=!0,Ne[U2]=Ne[cp]=Ne[K2]=!1;function ji(n,e,t,s,r,i){var o,a=e&L2,c=e&B2,u=e&j2;if(o!==void 0)return o;if(!Be(n))return n;var d=ft(n);if(d){if(o=o2(n),!a)return Jh(n,o)}else{var f=Ut(n),h=f==cp||f==H2;if(Or(n))return Wf(n,a);if(f==up||f==lp||h&&!r){if(o=c||h?{}:ip(n),!a)return c?JO(n,UO(o,n)):qO(n,FO(o,n))}else{if(!Ne[f])return r?n:{};o=_2(n,f,a)}}i||(i=new an);var p=i.get(n);if(p)return p;i.set(n,o),I2(n)?n.forEach(function(y){o.add(ji(y,e,t,y,n,i))}):V2(n)&&n.forEach(function(y,b){o.set(b,ji(y,e,t,b,n,i))});var g=u?c?KO:Sc:c?Pr:Di,m=d?void 0:g(n);return RC(m||n,function(y,b){m&&(b=y,y=n[b]),fc(o,b,ji(y,e,t,b,n,i))}),o}var cM=4;function Pc(n){return ji(n,cM)}var uM=1,dM=4;function ke(n){return ji(n,uM|dM)}var hM="__lodash_hash_undefined__";function fM(n){return this.__data__.set(n,hM),this}function pM(n){return this.__data__.has(n)}function _r(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Yn;++e<t;)this.add(n[e])}_r.prototype.add=_r.prototype.push=fM,_r.prototype.has=pM;function gM(n,e){for(var t=-1,s=n==null?0:n.length;++t<s;)if(e(n[t],t,n))return!0;return!1}function Nc(n,e){return n.has(e)}var mM=1,yM=2;function dp(n,e,t,s,r,i){var o=t&mM,a=n.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=i.get(n),d=i.get(e);if(u&&d)return u==e&&d==n;var f=-1,h=!0,p=t&yM?new _r:void 0;for(i.set(n,e),i.set(e,n);++f<a;){var g=n[f],m=e[f];if(s)var y=o?s(m,g,f,e,n,i):s(g,m,f,n,e,i);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!gM(e,function(b,w){if(!Nc(p,w)&&(g===b||r(g,b,t,s,i)))return p.push(w)})){h=!1;break}}else if(!(g===m||r(g,m,t,s,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function bM(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function Ac(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var wM=1,xM=2,vM="[object Boolean]",CM="[object Date]",SM="[object Error]",EM="[object Map]",OM="[object Number]",MM="[object RegExp]",PM="[object Set]",NM="[object String]",AM="[object Symbol]",_M="[object ArrayBuffer]",TM="[object DataView]",hp=Ft?Ft.prototype:void 0,_c=hp?hp.valueOf:void 0;function kM(n,e,t,s,r,i,o){switch(t){case TM:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case _M:return!(n.byteLength!=e.byteLength||!i(new ca(n),new ca(e)));case vM:case CM:case OM:return Cr(+n,+e);case SM:return n.name==e.name&&n.message==e.message;case MM:case NM:return n==e+"";case EM:var a=bM;case PM:var c=s&wM;if(a||(a=Ac),n.size!=e.size&&!c)return!1;var u=o.get(n);if(u)return u==e;s|=xM,o.set(n,e);var d=dp(a(n),a(e),s,r,i,o);return o.delete(n),d;case AM:if(_c)return _c.call(n)==_c.call(e)}return!1}var VM=1,DM=Object.prototype,RM=DM.hasOwnProperty;function IM(n,e,t,s,r,i){var o=t&VM,a=Sc(n),c=a.length,u=Sc(e),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=a[f];if(!(o?h in e:RM.call(e,h)))return!1}var p=i.get(n),g=i.get(e);if(p&&g)return p==e&&g==n;var m=!0;i.set(n,e),i.set(e,n);for(var y=o;++f<c;){h=a[f];var b=n[h],w=e[h];if(s)var x=o?s(w,b,h,e,n,i):s(b,w,h,n,e,i);if(!(x===void 0?b===w||r(b,w,t,s,i):x)){m=!1;break}y||(y=h=="constructor")}if(m&&!y){var S=n.constructor,v=e.constructor;S!=v&&"constructor"in n&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof v=="function"&&v instanceof v)&&(m=!1)}return i.delete(n),i.delete(e),m}var LM=1,fp="[object Arguments]",pp="[object Array]",ua="[object Object]",BM=Object.prototype,gp=BM.hasOwnProperty;function jM(n,e,t,s,r,i){var o=ft(n),a=ft(e),c=o?pp:Ut(n),u=a?pp:Ut(e);c=c==fp?ua:c,u=u==fp?ua:u;var d=c==ua,f=u==ua,h=c==u;if(h&&Or(n)){if(!Or(e))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new an),o||ta(n)?dp(n,e,t,s,r,i):kM(n,e,c,t,s,r,i);if(!(t&LM)){var p=d&&gp.call(n,"__wrapped__"),g=f&&gp.call(e,"__wrapped__");if(p||g){var m=p?n.value():n,y=g?e.value():e;return i||(i=new an),r(m,y,t,s,i)}}return h?(i||(i=new an),IM(n,e,t,s,r,i)):!1}function da(n,e,t,s,r){return n===e?!0:n==null||e==null||!on(n)&&!on(e)?n!==n&&e!==e:jM(n,e,t,s,da,r)}var $M=1,zM=2;function FM(n,e,t,s){var r=t.length,i=r;if(n==null)return!i;for(n=Object(n);r--;){var o=t[r];if(o[2]?o[1]!==n[o[0]]:!(o[0]in n))return!1}for(;++r<i;){o=t[r];var a=o[0],c=n[a],u=o[1];if(o[2]){if(c===void 0&&!(a in n))return!1}else{var d=new an,f;if(!(f===void 0?da(u,c,$M|zM,s,d):f))return!1}}return!0}function mp(n){return n===n&&!Be(n)}function UM(n){for(var e=Di(n),t=e.length;t--;){var s=e[t],r=n[s];e[t]=[s,r,mp(r)]}return e}function yp(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function HM(n){var e=UM(n);return e.length==1&&e[0][2]?yp(e[0][0],e[0][1]):function(t){return t===n||FM(t,n,e)}}function GM(n,e){return n!=null&&e in Object(n)}function bp(n,e,t){e=ra(e,n);for(var s=-1,r=e.length,i=!1;++s<r;){var o=Bi(e[s]);if(!(i=n!=null&&t(n,o)))break;n=n[o]}return i||++s!=r?i:(r=n==null?0:n.length,!!r&&pc(r)&&Jo(o,r)&&(ft(n)||Er(n)))}function wp(n,e){return n!=null&&bp(n,e,GM)}var WM=1,YM=2;function qM(n,e){return mc(n)&&mp(e)?yp(Bi(n),e):function(t){var s=ff(t,n);return s===void 0&&s===e?wp(t,n):da(e,s,WM|YM)}}function XM(n){return function(e){return e==null?void 0:e[n]}}function JM(n){return function(e){return ia(e,n)}}function KM(n){return mc(n)?XM(Bi(n)):JM(n)}function Tc(n){return typeof n=="function"?n:n==null?vr:typeof n=="object"?ft(n)?qM(n[0],n[1]):HM(n):KM(n)}function ZM(n,e,t,s){for(var r=-1,i=n==null?0:n.length;++r<i;){var o=n[r];e(s,o,t(o),n)}return s}function QM(n){return function(e,t,s){for(var r=-1,i=Object(e),o=s(e),a=o.length;a--;){var c=o[++r];if(t(i[c],c,i)===!1)break}return e}}var xp=QM();function eP(n,e){return n&&xp(n,e,Di)}function tP(n,e){return function(t,s){if(t==null)return t;if(!zs(t))return n(t,s);for(var r=t.length,i=-1,o=Object(t);++i<r&&s(o[i],i,o)!==!1;);return t}}var vp=tP(eP);function nP(n,e,t,s){return vp(n,function(r,i,o){e(s,r,t(r),o)}),s}function sP(n,e){return function(t,s){var r=ft(t)?ZM:nP,i=e?e():{};return r(t,n,Tc(s),i)}}var kc=function(){return rn.Date.now()},rP="Expected a function",iP=Math.max,oP=Math.min;function Cp(n,e,t){var s,r,i,o,a,c,u=0,d=!1,f=!1,h=!0;if(typeof n!="function")throw new TypeError(rP);e=Ti(e)||0,Be(t)&&(d=!!t.leading,f="maxWait"in t,i=f?iP(Ti(t.maxWait)||0,e):i,h="trailing"in t?!!t.trailing:h);function p(E){var C=s,O=r;return s=r=void 0,u=E,o=n.apply(O,C),o}function g(E){return u=E,a=setTimeout(b,e),d?p(E):o}function m(E){var C=E-c,O=E-u,A=e-C;return f?oP(A,i-O):A}function y(E){var C=E-c,O=E-u;return c===void 0||C>=e||C<0||f&&O>=i}function b(){var E=kc();if(y(E))return w(E);a=setTimeout(b,m(E))}function w(E){return a=void 0,h&&s?p(E):(s=r=void 0,o)}function x(){a!==void 0&&clearTimeout(a),u=0,s=c=r=a=void 0}function S(){return a===void 0?o:w(kc())}function v(){var E=kc(),C=y(E);if(s=arguments,r=this,c=E,C){if(a===void 0)return g(c);if(f)return clearTimeout(a),a=setTimeout(b,e),p(c)}return a===void 0&&(a=setTimeout(b,e)),o}return v.cancel=x,v.flush=S,v}var Sp=Object.prototype,aP=Sp.hasOwnProperty,lP=Sr(function(n,e){n=Object(n);var t=-1,s=e.length,r=s>2?e[2]:void 0;for(r&&Zo(e[0],e[1],r)&&(s=1);++t<s;)for(var i=e[t],o=Pr(i),a=-1,c=o.length;++a<c;){var u=o[a],d=n[u];(d===void 0||Cr(d,Sp[u])&&!aP.call(n,u))&&(n[u]=i[u])}return n});function Vc(n,e,t){(t!==void 0&&!Cr(n[e],t)||t===void 0&&!(e in n))&&Ko(n,e,t)}function ha(n){return on(n)&&zs(n)}function Dc(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function cP(n){return ki(n,Pr(n))}function uP(n,e,t,s,r,i,o){var a=Dc(n,t),c=Dc(e,t),u=o.get(c);if(u){Vc(n,t,u);return}var d=i?i(a,c,t+"",n,e,o):void 0,f=d===void 0;if(f){var h=ft(c),p=!h&&Or(c),g=!h&&!p&&ta(c);d=c,h||p||g?ft(a)?d=a:ha(a)?d=Jh(a):p?(f=!1,d=Wf(c,!0)):g?(f=!1,d=rp(c,!0)):d=[]:Mn(c)||Er(c)?(d=a,Er(a)?d=cP(a):(!Be(a)||uc(a))&&(d=ip(c))):f=!1}f&&(o.set(c,d),r(d,c,s,i,o),o.delete(c)),Vc(n,t,d)}function fa(n,e,t,s,r){n!==e&&xp(e,function(i,o){if(r||(r=new an),Be(i))uP(n,e,o,t,fa,s,r);else{var a=s?s(Dc(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),Vc(n,o,a)}},Pr)}function Ep(n,e,t,s,r,i){return Be(n)&&Be(e)&&(i.set(e,n),fa(n,e,void 0,Ep,i),i.delete(e)),n}var dP=tf(function(n,e,t,s){fa(n,e,t,s)}),Op=Sr(function(n){return n.push(void 0,Ep),Xh(dP,void 0,n)}),hP=200;function fP(n,e,t,s){var r=-1,i=Zh,o=!0,a=n.length,c=[],u=e.length;if(!a)return c;e.length>=hP&&(i=Nc,o=!1,e=new _r(e));e:for(;++r<a;){var d=n[r],f=d;if(d=d!==0?d:0,o&&f===f){for(var h=u;h--;)if(e[h]===f)continue e;c.push(d)}else i(e,f,s)||c.push(d)}return c}var pP=Sr(function(n,e){return ha(n)?fP(n,oa(e,1,ha,!0)):[]});function gP(n,e){var t=-1,s=zs(n)?Array(n.length):[];return vp(n,function(r,i,o){s[++t]=e(r,i,o)}),s}function pa(n){for(var e=-1,t=n==null?0:n.length,s={};++e<t;){var r=n[e];s[r[0]]=r[1]}return s}var mP=Object.prototype,yP=mP.hasOwnProperty,Mp=sP(function(n,e,t){yP.call(n,t)?n[t].push(e):Ko(n,t,[e])});function bP(n,e){return n>e}var wP=Object.prototype,xP=wP.hasOwnProperty;function vP(n,e){return n!=null&&xP.call(n,e)}function ga(n,e){return n!=null&&bp(n,e,vP)}var CP="[object Map]",SP="[object Set]",EP=Object.prototype,OP=EP.hasOwnProperty;function Pp(n){if(n==null)return!0;if(zs(n)&&(ft(n)||typeof n=="string"||typeof n.splice=="function"||Or(n)||ta(n)||Er(n)))return!n.length;var e=Ut(n);if(e==CP||e==SP)return!n.size;if(Qo(n))return!hf(n).length;for(var t in n)if(OP.call(n,t))return!1;return!0}function Pn(n,e){return da(n,e)}var MP="[object Number]";function Rc(n){return typeof n=="number"||on(n)&&cs(n)==MP}function ma(n){return n==null}function PP(n){return n===void 0}var NP=Sf("toLowerCase");function AP(n,e,t){for(var s=-1,r=n.length;++s<r;){var i=n[s],o=e(i);if(o!=null&&(a===void 0?o===o&&!On(o):t(o,a)))var a=o,c=i}return c}function _P(n){return n&&n.length?AP(n,vr,bP):void 0}var Ye=tf(function(n,e,t){fa(n,e,t)});function TP(n,e,t,s){if(!Be(n))return n;e=ra(e,n);for(var r=-1,i=e.length,o=i-1,a=n;a!=null&&++r<i;){var c=Bi(e[r]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return n;if(r!=o){var d=a[c];u=void 0,u===void 0&&(u=Be(d)?d:Jo(e[r+1])?[]:{})}fc(a,c,u),a=a[c]}return n}function kP(n,e,t){for(var s=-1,r=e.length,i={};++s<r;){var o=e[s],a=ia(n,o);t(a,o)&&TP(i,ra(o,n),a)}return i}function VP(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function DP(n,e){if(n!==e){var t=n!==void 0,s=n===null,r=n===n,i=On(n),o=e!==void 0,a=e===null,c=e===e,u=On(e);if(!a&&!u&&!i&&n>e||i&&o&&c&&!a&&!u||s&&o&&c||!t&&c||!r)return 1;if(!s&&!i&&!u&&n<e||u&&t&&r&&!s&&!i||a&&t&&r||!o&&r||!c)return-1}return 0}function RP(n,e,t){for(var s=-1,r=n.criteria,i=e.criteria,o=r.length,a=t.length;++s<o;){var c=DP(r[s],i[s]);if(c){if(s>=a)return c;var u=t[s];return c*(u=="desc"?-1:1)}}return n.index-e.index}function IP(n,e,t){e.length?e=qo(e,function(i){return ft(i)?function(o){return ia(o,i.length===1?i[0]:i)}:i}):e=[vr];var s=-1;e=qo(e,ea(Tc));var r=gP(n,function(i,o,a){var c=qo(e,function(u){return u(i)});return{criteria:c,index:++s,value:i}});return VP(r,function(i,o){return RP(i,o,t)})}function LP(n,e){return kP(n,e,function(t,s){return wp(n,s)})}var Ic=gE(function(n,e){return n==null?{}:LP(n,e)}),Lc=Sr(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Zo(n,e[0],e[1])?e=[]:t>2&&Zo(e[0],e[1],e[2])&&(e=[e[0]]),IP(n,oa(e),[])}),BP=4294967295,jP=BP-1,$P=Math.floor,zP=Math.min;function Np(n,e,t,s){var r=0,i=n==null?0:n.length;if(i===0)return 0;e=t(e);for(var o=e!==e,a=e===null,c=On(e),u=e===void 0;r<i;){var d=$P((r+i)/2),f=t(n[d]),h=f!==void 0,p=f===null,g=f===f,m=On(f);if(o)var y=g;else u?y=g&&h:a?y=g&&h&&!p:c?y=g&&h&&!p&&!m:p||m?y=!1:y=f<e;y?r=d+1:i=d}return zP(i,jP)}var FP=4294967295,UP=FP>>>1;function HP(n,e,t){var s=0,r=n==null?s:n.length;if(typeof e=="number"&&e===e&&r<=UP){for(;s<r;){var i=s+r>>>1,o=n[i];o!==null&&!On(o)&&o<e?s=i+1:r=i}return r}return Np(n,e,vr)}function GP(n,e){return HP(n,e)}function WP(n,e,t){return Np(n,e,Tc(t))}var YP=zf(function(n,e,t){return n+(t?" ":"")+aa(e)}),qP="Expected a function";function XP(n,e,t){var s=!0,r=!0;if(typeof n!="function")throw new TypeError(qP);return Be(t)&&(s="leading"in t?!!t.leading:s,r="trailing"in t?!!t.trailing:r),Cp(n,e,{leading:s,maxWait:e,trailing:r})}var JP=1/0,KP=Ar&&1/Ac(new Ar([,-0]))[1]==JP?function(n){return new Ar(n)}:NC,ZP=200;function Ap(n,e,t){var s=-1,r=Zh,i=n.length,o=!0,a=[],c=a;if(i>=ZP){var u=KP(n);if(u)return Ac(u);o=!1,r=Nc,c=new _r}else c=a;e:for(;++s<i;){var d=n[s],f=d;if(d=d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;a.push(d)}else r(c,f,t)||(c!==a&&c.push(f),a.push(d))}return a}var _p=Sr(function(n){return Ap(oa(n,1,ha,!0))});function Tp(n){return n&&n.length?Ap(n):[]}const kp=n=>n===void 0,ya=n=>typeof n=="boolean",Ht=n=>typeof n=="number",qn=n=>typeof Element>"u"?!1:n instanceof Element,QP=n=>sn(n)?!Number.isNaN(Number(n)):!1,Vp=n=>Object.keys(n);class Dp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function eN(n,e){throw new Dp(`[${n}] ${e}`)}function Tt(n,e){if(process.env.NODE_ENV!=="production"){const t=sn(n)?new Dp(`[${n}] ${e}`):n;console.warn(t)}}const tN="utils/dom/style",Rp=(n="")=>n.split(" ").filter(e=>!!e.trim()),Ip=(n,e)=>{if(!n||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return n.classList.contains(e)},nN=(n,e)=>{!n||!e.trim()||n.classList.add(...Rp(e))},sN=(n,e)=>{!n||!e.trim()||n.classList.remove(...Rp(e))},rN=(n,e)=>{var t;if(!We||!n||!e)return"";let s=Gv(e);s==="float"&&(s="cssFloat");try{const r=n.style[s];if(r)return r;const i=(t=document.defaultView)==null?void 0:t.getComputedStyle(n,"");return i?i[s]:""}catch{return n.style[s]}};function $i(n,e="px"){if(!n)return"";if(Ht(n)||QP(n))return`${n}${e}`;if(sn(n))return n;Tt(tN,"binding value must be a string or number")}let ba;const iN=n=>{var e;if(!We)return 0;if(ba!==void 0)return ba;const t=document.createElement("div");t.className=`${n}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const s=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),ba=s-i,ba};/*! Element Plus Icons Vue v2.3.1 */var oN=l.defineComponent({name:"CircleCheck",__name:"circle-check",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),aN=oN,lN=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),Lp=lN,cN=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),Bp=cN,uN=l.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),dN=uN,hN=l.defineComponent({name:"Hide",__name:"hide",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),fN=hN,pN=l.defineComponent({name:"InfoFilled",__name:"info-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),jp=pN,gN=l.defineComponent({name:"Loading",__name:"loading",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),wa=gN,mN=l.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),$p=mN,yN=l.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),bN=yN,wN=l.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),zp=wN;const Fp="__epPropKey",he=n=>n,xN=n=>xr(n)&&!!n[Fp],xa=(n,e)=>{if(!xr(n)||xN(n))return n;const{values:t,required:s,default:r,type:i,validator:o}=n,c={type:i,required:!!s,validator:t||o?u=>{let d=!1,f=[];if(t&&(f=Array.from(t),Yo(n,"default")&&f.push(r),d||(d=f.includes(u))),o&&(d||(d=o(u))),!d&&f.length>0){const h=[...new Set(f)].map(p=>JSON.stringify(p)).join(", ");l.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Fp]:!0};return Yo(n,"default")&&(c.default=r),c},et=n=>pa(Object.entries(n).map(([e,t])=>[e,xa(t,e)])),zi=he([String,Object,Function]),Up={Close:dN,SuccessFilled:$p,InfoFilled:jp,WarningFilled:zp,CircleCloseFilled:Lp},va={success:$p,warning:zp,error:Lp,info:jp},vN={validating:wa,success:aN,error:Bp},Us=(n,e)=>{if(n.install=t=>{for(const s of[n,...Object.values(e??{})])t.component(s.name,s)},e)for(const[t,s]of Object.entries(e))n[t]=s;return n},CN=(n,e)=>(n.install=t=>{n._context=t._context,t.config.globalProperties[e]=n},n),SN=n=>(n.install=ls,n),Tr={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"},Bc="update:modelValue",Hp=["","default","small","large"],EN=n=>["",...Hp].includes(n);var Ca=(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))(Ca||{});const ON=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),Gp=n=>n,MN=["class","style"],PN=/^on[A-Z]/,NN=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,s=l.computed(()=>((t==null?void 0:t.value)||[]).concat(MN)),r=l.getCurrentInstance();return r?l.computed(()=>{var i;return pa(Object.entries((i=r.proxy)==null?void 0:i.$attrs).filter(([o])=>!s.value.includes(o)&&!(e&&PN.test(o))))}):(Tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},AN=({from:n,replacement:e,scope:t,version:s,ref:r,type:i="API"},o)=>{l.watch(()=>l.unref(o),a=>{a&&Tt(t,`[${i}] ${n} is about to be deprecated in version ${s}, please use ${e} instead.
15
15
  For more detail, please visit: ${r}
16
- `)},{immediate:!0})},_N=(n,e,t,s)=>{let r={offsetX:0,offsetY:0};const i=u=>{const d=u.clientX,f=u.clientY,{offsetX:h,offsetY:p}=r,g=n.value.getBoundingClientRect(),m=g.left,y=g.top,b=g.width,w=g.height,x=document.documentElement.clientWidth,v=document.documentElement.clientHeight,C=-m+h,E=-y+p,S=x-m-b+h,O=v-y-w+p,A=_=>{let V=h+_.clientX-d,L=p+_.clientY-f;s!=null&&s.value||(V=Math.min(Math.max(V,C),S),L=Math.min(Math.max(L,E),O)),r={offsetX:V,offsetY:L},n.value&&(n.value.style.transform=`translate(${$i(V)}, ${$i(L)})`)},k=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",k)},o=()=>{e.value&&n.value&&e.value.addEventListener("mousedown",i)},a=()=>{e.value&&n.value&&e.value.removeEventListener("mousedown",i)},c=()=>{r={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return l.onMounted(()=>{l.watchEffect(()=>{t.value?o():a()})}),l.onBeforeUnmount(()=>{a()}),{resetPosition:c}};var TN={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 kN=n=>(e,t)=>VN(e,t,l.unref(n)),VN=(n,e,t)=>hf(t,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=e==null?void 0:e[r])!=null?i:`{${r}}`}`}),DN=n=>{const e=l.computed(()=>l.unref(n).name),t=l.isRef(n)?n:l.ref(n);return{lang:e,locale:t,t:kN(n)}},Gp=Symbol("localeContextKey"),RN=n=>{const e=n||l.inject(Gp,l.ref());return DN(l.computed(()=>e.value||TN))},Sa="el",IN="is-",Hs=(n,e,t,s,r)=>{let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Wp=Symbol("namespaceContextKey"),jc=n=>{const e=n||(l.getCurrentInstance()?l.inject(Wp,l.ref(Sa)):l.ref(Sa));return l.computed(()=>l.unref(e)||Sa)},bt=(n,e)=>{const t=jc(e);return{namespace:t,b:(m="")=>Hs(t.value,n,m,"",""),e:m=>m?Hs(t.value,n,"",m,""):"",m:m=>m?Hs(t.value,n,"","",m):"",be:(m,y)=>m&&y?Hs(t.value,n,m,y,""):"",em:(m,y)=>m&&y?Hs(t.value,n,"",m,y):"",bm:(m,y)=>m&&y?Hs(t.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?Hs(t.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${IN}${m}`:""},cssVar:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${b}`]=m[b]);return y},cssVarName:m=>`--${t.value}-${m}`,cssVarBlock:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${n}-${b}`]=m[b]);return y},cssVarBlockName:m=>`--${t.value}-${n}-${m}`}},LN=(n,e={})=>{l.isRef(n)||eN("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||bt("popup"),s=l.computed(()=>t.bm("parent","hidden"));if(!We||Rp(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(sN(document==null?void 0:document.body,s.value),i&&document&&(document.body.style.width=o))},200)};l.watch(n,c=>{if(!c){a();return}i=!Rp(document.body,s.value),i&&(o=document.body.style.width),r=iN(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=rN(document.body,"overflowY");r>0&&(u||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),nN(document.body,s.value)}),l.onScopeDispose(()=>a())},BN=xa({type:he(Boolean),default:null}),jN=xa({type:he(Function)}),$N=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,s=[e],r={[n]:BN,[t]:jN};return{useModelToggle:({indicator:o,toggleReason:a,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const h=l.getCurrentInstance(),{emit:p}=h,g=h.props,m=l.computed(()=>zt(g[t])),y=l.computed(()=>g[n]===null),b=S=>{o.value!==!0&&(o.value=!0,a&&(a.value=S),zt(d)&&d(S))},w=S=>{o.value!==!1&&(o.value=!1,a&&(a.value=S),zt(f)&&f(S))},x=S=>{if(g.disabled===!0||zt(u)&&!u())return;const O=m.value&&We;O&&p(e,!0),(y.value||!O)&&b(S)},v=S=>{if(g.disabled===!0||!We)return;const O=m.value&&We;O&&p(e,!1),(y.value||!O)&&w(S)},C=S=>{ya(S)&&(g.disabled&&S?m.value&&p(e,!1):o.value!==S&&(S?b():w()))},E=()=>{o.value?v():x()};return l.watch(()=>g[n],C),c&&h.appContext.config.globalProperties.$route!==void 0&&l.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&v()}),l.onMounted(()=>{C(g[n])}),{hide:v,show:x,toggle:E,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},Yp=n=>{const e=l.getCurrentInstance();return l.computed(()=>{var t,s;return(s=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:s[n]})};var St="top",Gt="bottom",Wt="right",Et="left",Ea="auto",Fi=[St,Gt,Wt,Et],kr="start",Ui="end",zN="clippingParents",qp="viewport",Hi="popper",FN="reference",Xp=Fi.reduce(function(n,e){return n.concat([e+"-"+kr,e+"-"+Ui])},[]),$c=[].concat(Fi,[Ea]).reduce(function(n,e){return n.concat([e,e+"-"+kr,e+"-"+Ui])},[]),UN="beforeRead",HN="read",GN="afterRead",WN="beforeMain",YN="main",qN="afterMain",XN="beforeWrite",JN="write",KN="afterWrite",zc=[UN,HN,GN,WN,YN,qN,XN,JN,KN];function Nn(n){return n?(n.nodeName||"").toLowerCase():null}function kt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Gs(n){var e=kt(n).Element;return n instanceof e||n instanceof Element}function Vt(n){var e=kt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Fc(n){if(typeof ShadowRoot>"u")return!1;var e=kt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function ZN(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];!Vt(i)||!Nn(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 QN(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var r=e.elements[s],i=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(c,u){return c[u]="",c},{});!Vt(r)||!Nn(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const eA={name:"applyStyles",enabled:!0,phase:"write",fn:ZN,effect:QN,requires:["computeStyles"]};function ln(n){return n.split("-")[0]}var Ws=Math.max,Oa=Math.min,Vr=Math.round;function Uc(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Jp(){return!/^((?!chrome|android).)*safari/i.test(Uc())}function Dr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),r=1,i=1;e&&Vt(n)&&(r=n.offsetWidth>0&&Vr(s.width)/n.offsetWidth||1,i=n.offsetHeight>0&&Vr(s.height)/n.offsetHeight||1);var o=Gs(n)?kt(n):window,a=o.visualViewport,c=!Jp()&&t,u=(s.left+(c&&a?a.offsetLeft:0))/r,d=(s.top+(c&&a?a.offsetTop:0))/i,f=s.width/r,h=s.height/i;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u,x:u,y:d}}function Hc(n){var e=Dr(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function Kp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Fc(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function cn(n){return kt(n).getComputedStyle(n)}function tA(n){return["table","td","th"].indexOf(Nn(n))>=0}function us(n){return((Gs(n)?n.ownerDocument:n.document)||window.document).documentElement}function Ma(n){return Nn(n)==="html"?n:n.assignedSlot||n.parentNode||(Fc(n)?n.host:null)||us(n)}function Zp(n){return!Vt(n)||cn(n).position==="fixed"?null:n.offsetParent}function nA(n){var e=/firefox/i.test(Uc()),t=/Trident/i.test(Uc());if(t&&Vt(n)){var s=cn(n);if(s.position==="fixed")return null}var r=Ma(n);for(Fc(r)&&(r=r.host);Vt(r)&&["html","body"].indexOf(Nn(r))<0;){var i=cn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Gi(n){for(var e=kt(n),t=Zp(n);t&&tA(t)&&cn(t).position==="static";)t=Zp(t);return t&&(Nn(t)==="html"||Nn(t)==="body"&&cn(t).position==="static")?e:t||nA(n)||e}function Gc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Wi(n,e,t){return Ws(n,Oa(e,t))}function sA(n,e,t){var s=Wi(n,e,t);return s>t?t:s}function Qp(){return{top:0,right:0,bottom:0,left:0}}function eg(n){return Object.assign({},Qp(),n)}function tg(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var rA=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,eg(typeof e!="number"?e:tg(e,Fi))};function iA(n){var e,t=n.state,s=n.name,r=n.options,i=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ln(t.placement),c=Gc(a),u=[Et,Wt].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!o)){var f=rA(r.padding,t),h=Hc(i),p=c==="y"?St:Et,g=c==="y"?Gt:Wt,m=t.rects.reference[d]+t.rects.reference[c]-o[c]-t.rects.popper[d],y=o[c]-t.rects.reference[c],b=Gi(i),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,v=f[p],C=w-h[d]-f[g],E=w/2-h[d]/2+x,S=Wi(v,E,C),O=c;t.modifiersData[s]=(e={},e[O]=S,e.centerOffset=S-E,e)}}function oA(n){var e=n.state,t=n.options,s=t.element,r=s===void 0?"[data-popper-arrow]":s;if(r!=null&&!(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r))){if(process.env.NODE_ENV!=="production"&&(Vt(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!Kp(e.elements.popper,r)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}e.elements.arrow=r}}const aA={name:"arrow",enabled:!0,phase:"main",fn:iA,effect:oA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Rr(n){return n.split("-")[1]}var lA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function cA(n,e){var t=n.x,s=n.y,r=e.devicePixelRatio||1;return{x:Vr(t*r)/r||0,y:Vr(s*r)/r||0}}function ng(n){var e,t=n.popper,s=n.popperRect,r=n.placement,i=n.variation,o=n.offsets,a=n.position,c=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,f=n.isFixed,h=o.x,p=h===void 0?0:h,g=o.y,m=g===void 0?0:g,y=typeof d=="function"?d({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),x=Et,v=St,C=window;if(u){var E=Gi(t),S="clientHeight",O="clientWidth";if(E===kt(t)&&(E=us(t),cn(E).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),E=E,r===St||(r===Et||r===Wt)&&i===Ui){v=Gt;var A=f&&E===C&&C.visualViewport?C.visualViewport.height:E[S];m-=A-s.height,m*=c?1:-1}if(r===Et||(r===St||r===Gt)&&i===Ui){x=Wt;var k=f&&E===C&&C.visualViewport?C.visualViewport.width:E[O];p-=k-s.width,p*=c?1:-1}}var _=Object.assign({position:a},u&&lA),V=d===!0?cA({x:p,y:m},kt(t)):{x:p,y:m};if(p=V.x,m=V.y,c){var L;return Object.assign({},_,(L={},L[v]=w?"0":"",L[x]=b?"0":"",L.transform=(C.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",L))}return Object.assign({},_,(e={},e[v]=w?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function uA(n){var e=n.state,t=n.options,s=t.gpuAcceleration,r=s===void 0?!0:s,i=t.adaptive,o=i===void 0?!0:i,a=t.roundOffsets,c=a===void 0?!0:a;if(process.env.NODE_ENV!=="production"){var u=cn(e.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some(function(f){return u.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
16
+ `)},{immediate:!0})},_N=(n,e,t,s)=>{let r={offsetX:0,offsetY:0};const i=u=>{const d=u.clientX,f=u.clientY,{offsetX:h,offsetY:p}=r,g=n.value.getBoundingClientRect(),m=g.left,y=g.top,b=g.width,w=g.height,x=document.documentElement.clientWidth,S=document.documentElement.clientHeight,v=-m+h,E=-y+p,C=x-m-b+h,O=S-y-w+p,A=_=>{let V=h+_.clientX-d,L=p+_.clientY-f;s!=null&&s.value||(V=Math.min(Math.max(V,v),C),L=Math.min(Math.max(L,E),O)),r={offsetX:V,offsetY:L},n.value&&(n.value.style.transform=`translate(${$i(V)}, ${$i(L)})`)},k=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",k)},o=()=>{e.value&&n.value&&e.value.addEventListener("mousedown",i)},a=()=>{e.value&&n.value&&e.value.removeEventListener("mousedown",i)},c=()=>{r={offsetX:0,offsetY:0},n.value&&(n.value.style.transform="none")};return l.onMounted(()=>{l.watchEffect(()=>{t.value?o():a()})}),l.onBeforeUnmount(()=>{a()}),{resetPosition:c}};var TN={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 kN=n=>(e,t)=>VN(e,t,l.unref(n)),VN=(n,e,t)=>ff(t,n,n).replace(/\{(\w+)\}/g,(s,r)=>{var i;return`${(i=e==null?void 0:e[r])!=null?i:`{${r}}`}`}),DN=n=>{const e=l.computed(()=>l.unref(n).name),t=l.isRef(n)?n:l.ref(n);return{lang:e,locale:t,t:kN(n)}},Wp=Symbol("localeContextKey"),RN=n=>{const e=n||l.inject(Wp,l.ref());return DN(l.computed(()=>e.value||TN))},Sa="el",IN="is-",Hs=(n,e,t,s,r)=>{let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i},Yp=Symbol("namespaceContextKey"),jc=n=>{const e=n||(l.getCurrentInstance()?l.inject(Yp,l.ref(Sa)):l.ref(Sa));return l.computed(()=>l.unref(e)||Sa)},bt=(n,e)=>{const t=jc(e);return{namespace:t,b:(m="")=>Hs(t.value,n,m,"",""),e:m=>m?Hs(t.value,n,"",m,""):"",m:m=>m?Hs(t.value,n,"","",m):"",be:(m,y)=>m&&y?Hs(t.value,n,m,y,""):"",em:(m,y)=>m&&y?Hs(t.value,n,"",m,y):"",bm:(m,y)=>m&&y?Hs(t.value,n,m,"",y):"",bem:(m,y,b)=>m&&y&&b?Hs(t.value,n,m,y,b):"",is:(m,...y)=>{const b=y.length>=1?y[0]:!0;return m&&b?`${IN}${m}`:""},cssVar:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${b}`]=m[b]);return y},cssVarName:m=>`--${t.value}-${m}`,cssVarBlock:m=>{const y={};for(const b in m)m[b]&&(y[`--${t.value}-${n}-${b}`]=m[b]);return y},cssVarBlockName:m=>`--${t.value}-${n}-${m}`}},LN=(n,e={})=>{l.isRef(n)||eN("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||bt("popup"),s=l.computed(()=>t.bm("parent","hidden"));if(!We||Ip(document.body,s.value))return;let r=0,i=!1,o="0";const a=()=>{setTimeout(()=>{typeof document>"u"||(sN(document==null?void 0:document.body,s.value),i&&document&&(document.body.style.width=o))},200)};l.watch(n,c=>{if(!c){a();return}i=!Ip(document.body,s.value),i&&(o=document.body.style.width),r=iN(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=rN(document.body,"overflowY");r>0&&(u||d==="scroll")&&i&&(document.body.style.width=`calc(100% - ${r}px)`),nN(document.body,s.value)}),l.onScopeDispose(()=>a())},BN=xa({type:he(Boolean),default:null}),jN=xa({type:he(Function)}),$N=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,s=[e],r={[n]:BN,[t]:jN};return{useModelToggle:({indicator:o,toggleReason:a,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const h=l.getCurrentInstance(),{emit:p}=h,g=h.props,m=l.computed(()=>zt(g[t])),y=l.computed(()=>g[n]===null),b=C=>{o.value!==!0&&(o.value=!0,a&&(a.value=C),zt(d)&&d(C))},w=C=>{o.value!==!1&&(o.value=!1,a&&(a.value=C),zt(f)&&f(C))},x=C=>{if(g.disabled===!0||zt(u)&&!u())return;const O=m.value&&We;O&&p(e,!0),(y.value||!O)&&b(C)},S=C=>{if(g.disabled===!0||!We)return;const O=m.value&&We;O&&p(e,!1),(y.value||!O)&&w(C)},v=C=>{ya(C)&&(g.disabled&&C?m.value&&p(e,!1):o.value!==C&&(C?b():w()))},E=()=>{o.value?S():x()};return l.watch(()=>g[n],v),c&&h.appContext.config.globalProperties.$route!==void 0&&l.watch(()=>({...h.proxy.$route}),()=>{c.value&&o.value&&S()}),l.onMounted(()=>{v(g[n])}),{hide:S,show:x,toggle:E,hasUpdateHandler:m}},useModelToggleProps:r,useModelToggleEmits:s}},qp=n=>{const e=l.getCurrentInstance();return l.computed(()=>{var t,s;return(s=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:s[n]})};var St="top",Gt="bottom",Wt="right",Et="left",Ea="auto",Fi=[St,Gt,Wt,Et],kr="start",Ui="end",zN="clippingParents",Xp="viewport",Hi="popper",FN="reference",Jp=Fi.reduce(function(n,e){return n.concat([e+"-"+kr,e+"-"+Ui])},[]),$c=[].concat(Fi,[Ea]).reduce(function(n,e){return n.concat([e,e+"-"+kr,e+"-"+Ui])},[]),UN="beforeRead",HN="read",GN="afterRead",WN="beforeMain",YN="main",qN="afterMain",XN="beforeWrite",JN="write",KN="afterWrite",zc=[UN,HN,GN,WN,YN,qN,XN,JN,KN];function Nn(n){return n?(n.nodeName||"").toLowerCase():null}function kt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Gs(n){var e=kt(n).Element;return n instanceof e||n instanceof Element}function Vt(n){var e=kt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Fc(n){if(typeof ShadowRoot>"u")return!1;var e=kt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function ZN(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var s=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];!Vt(i)||!Nn(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 QN(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(s){var r=e.elements[s],i=e.attributes[s]||{},o=Object.keys(e.styles.hasOwnProperty(s)?e.styles[s]:t[s]),a=o.reduce(function(c,u){return c[u]="",c},{});!Vt(r)||!Nn(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const eA={name:"applyStyles",enabled:!0,phase:"write",fn:ZN,effect:QN,requires:["computeStyles"]};function ln(n){return n.split("-")[0]}var Ws=Math.max,Oa=Math.min,Vr=Math.round;function Uc(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Kp(){return!/^((?!chrome|android).)*safari/i.test(Uc())}function Dr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var s=n.getBoundingClientRect(),r=1,i=1;e&&Vt(n)&&(r=n.offsetWidth>0&&Vr(s.width)/n.offsetWidth||1,i=n.offsetHeight>0&&Vr(s.height)/n.offsetHeight||1);var o=Gs(n)?kt(n):window,a=o.visualViewport,c=!Kp()&&t,u=(s.left+(c&&a?a.offsetLeft:0))/r,d=(s.top+(c&&a?a.offsetTop:0))/i,f=s.width/r,h=s.height/i;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u,x:u,y:d}}function Hc(n){var e=Dr(n),t=n.offsetWidth,s=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-s)<=1&&(s=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:s}}function Zp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Fc(t)){var s=e;do{if(s&&n.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function cn(n){return kt(n).getComputedStyle(n)}function tA(n){return["table","td","th"].indexOf(Nn(n))>=0}function us(n){return((Gs(n)?n.ownerDocument:n.document)||window.document).documentElement}function Ma(n){return Nn(n)==="html"?n:n.assignedSlot||n.parentNode||(Fc(n)?n.host:null)||us(n)}function Qp(n){return!Vt(n)||cn(n).position==="fixed"?null:n.offsetParent}function nA(n){var e=/firefox/i.test(Uc()),t=/Trident/i.test(Uc());if(t&&Vt(n)){var s=cn(n);if(s.position==="fixed")return null}var r=Ma(n);for(Fc(r)&&(r=r.host);Vt(r)&&["html","body"].indexOf(Nn(r))<0;){var i=cn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Gi(n){for(var e=kt(n),t=Qp(n);t&&tA(t)&&cn(t).position==="static";)t=Qp(t);return t&&(Nn(t)==="html"||Nn(t)==="body"&&cn(t).position==="static")?e:t||nA(n)||e}function Gc(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Wi(n,e,t){return Ws(n,Oa(e,t))}function sA(n,e,t){var s=Wi(n,e,t);return s>t?t:s}function eg(){return{top:0,right:0,bottom:0,left:0}}function tg(n){return Object.assign({},eg(),n)}function ng(n,e){return e.reduce(function(t,s){return t[s]=n,t},{})}var rA=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,tg(typeof e!="number"?e:ng(e,Fi))};function iA(n){var e,t=n.state,s=n.name,r=n.options,i=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ln(t.placement),c=Gc(a),u=[Et,Wt].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!o)){var f=rA(r.padding,t),h=Hc(i),p=c==="y"?St:Et,g=c==="y"?Gt:Wt,m=t.rects.reference[d]+t.rects.reference[c]-o[c]-t.rects.popper[d],y=o[c]-t.rects.reference[c],b=Gi(i),w=b?c==="y"?b.clientHeight||0:b.clientWidth||0:0,x=m/2-y/2,S=f[p],v=w-h[d]-f[g],E=w/2-h[d]/2+x,C=Wi(S,E,v),O=c;t.modifiersData[s]=(e={},e[O]=C,e.centerOffset=C-E,e)}}function oA(n){var e=n.state,t=n.options,s=t.element,r=s===void 0?"[data-popper-arrow]":s;if(r!=null&&!(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r))){if(process.env.NODE_ENV!=="production"&&(Vt(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!Zp(e.elements.popper,r)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}e.elements.arrow=r}}const aA={name:"arrow",enabled:!0,phase:"main",fn:iA,effect:oA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Rr(n){return n.split("-")[1]}var lA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function cA(n,e){var t=n.x,s=n.y,r=e.devicePixelRatio||1;return{x:Vr(t*r)/r||0,y:Vr(s*r)/r||0}}function sg(n){var e,t=n.popper,s=n.popperRect,r=n.placement,i=n.variation,o=n.offsets,a=n.position,c=n.gpuAcceleration,u=n.adaptive,d=n.roundOffsets,f=n.isFixed,h=o.x,p=h===void 0?0:h,g=o.y,m=g===void 0?0:g,y=typeof d=="function"?d({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),x=Et,S=St,v=window;if(u){var E=Gi(t),C="clientHeight",O="clientWidth";if(E===kt(t)&&(E=us(t),cn(E).position!=="static"&&a==="absolute"&&(C="scrollHeight",O="scrollWidth")),E=E,r===St||(r===Et||r===Wt)&&i===Ui){S=Gt;var A=f&&E===v&&v.visualViewport?v.visualViewport.height:E[C];m-=A-s.height,m*=c?1:-1}if(r===Et||(r===St||r===Gt)&&i===Ui){x=Wt;var k=f&&E===v&&v.visualViewport?v.visualViewport.width:E[O];p-=k-s.width,p*=c?1:-1}}var _=Object.assign({position:a},u&&lA),V=d===!0?cA({x:p,y:m},kt(t)):{x:p,y:m};if(p=V.x,m=V.y,c){var L;return Object.assign({},_,(L={},L[S]=w?"0":"",L[x]=b?"0":"",L.transform=(v.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",L))}return Object.assign({},_,(e={},e[S]=w?m+"px":"",e[x]=b?p+"px":"",e.transform="",e))}function uA(n){var e=n.state,t=n.options,s=t.gpuAcceleration,r=s===void 0?!0:s,i=t.adaptive,o=i===void 0?!0:i,a=t.roundOffsets,c=a===void 0?!0:a;if(process.env.NODE_ENV!=="production"){var u=cn(e.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some(function(f){return u.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
17
17
 
18
18
  `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
19
19
 
20
- `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:ln(e.placement),variation:Rr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ng(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ng(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const dA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:uA,data:{}};var Pa={passive:!0};function hA(n){var e=n.state,t=n.instance,s=n.options,r=s.scroll,i=r===void 0?!0:r,o=s.resize,a=o===void 0?!0:o,c=kt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",t.update,Pa)}),a&&c.addEventListener("resize",t.update,Pa),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",t.update,Pa)}),a&&c.removeEventListener("resize",t.update,Pa)}}const fA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:hA,data:{}};var pA={left:"right",right:"left",bottom:"top",top:"bottom"};function Na(n){return n.replace(/left|right|bottom|top/g,function(e){return pA[e]})}var gA={start:"end",end:"start"};function sg(n){return n.replace(/start|end/g,function(e){return gA[e]})}function Wc(n){var e=kt(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function Yc(n){return Dr(us(n)).left+Wc(n).scrollLeft}function mA(n,e){var t=kt(n),s=us(n),r=t.visualViewport,i=s.clientWidth,o=s.clientHeight,a=0,c=0;if(r){i=r.width,o=r.height;var u=Jp();(u||!u&&e==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:o,x:a+Yc(n),y:c}}function yA(n){var e,t=us(n),s=Wc(n),r=(e=n.ownerDocument)==null?void 0:e.body,i=Ws(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Ws(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Yc(n),c=-s.scrollTop;return cn(r||t).direction==="rtl"&&(a+=Ws(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function qc(n){var e=cn(n),t=e.overflow,s=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+s)}function rg(n){return["html","body","#document"].indexOf(Nn(n))>=0?n.ownerDocument.body:Vt(n)&&qc(n)?n:rg(Ma(n))}function Yi(n,e){var t;e===void 0&&(e=[]);var s=rg(n),r=s===((t=n.ownerDocument)==null?void 0:t.body),i=kt(s),o=r?[i].concat(i.visualViewport||[],qc(s)?s:[]):s,a=e.concat(o);return r?a:a.concat(Yi(Ma(o)))}function Xc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function bA(n,e){var t=Dr(n,!1,e==="fixed");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 ig(n,e,t){return e===qp?Xc(mA(n,t)):Gs(e)?bA(e,t):Xc(yA(us(n)))}function wA(n){var e=Yi(Ma(n)),t=["absolute","fixed"].indexOf(cn(n).position)>=0,s=t&&Vt(n)?Gi(n):n;return Gs(s)?e.filter(function(r){return Gs(r)&&Kp(r,s)&&Nn(r)!=="body"}):[]}function xA(n,e,t,s){var r=e==="clippingParents"?wA(n):[].concat(e),i=[].concat(r,[t]),o=i[0],a=i.reduce(function(c,u){var d=ig(n,u,s);return c.top=Ws(d.top,c.top),c.right=Oa(d.right,c.right),c.bottom=Oa(d.bottom,c.bottom),c.left=Ws(d.left,c.left),c},ig(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function og(n){var e=n.reference,t=n.element,s=n.placement,r=s?ln(s):null,i=s?Rr(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(r){case St:c={x:o,y:e.y-t.height};break;case Gt:c={x:o,y:e.y+e.height};break;case Wt:c={x:e.x+e.width,y:a};break;case Et:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=r?Gc(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case kr:c[u]=c[u]-(e[d]/2-t[d]/2);break;case Ui:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function qi(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=s===void 0?n.placement:s,i=t.strategy,o=i===void 0?n.strategy:i,a=t.boundary,c=a===void 0?zN:a,u=t.rootBoundary,d=u===void 0?qp:u,f=t.elementContext,h=f===void 0?Hi:f,p=t.altBoundary,g=p===void 0?!1:p,m=t.padding,y=m===void 0?0:m,b=eg(typeof y!="number"?y:tg(y,Fi)),w=h===Hi?FN:Hi,x=n.rects.popper,v=n.elements[g?w:h],C=xA(Gs(v)?v:v.contextElement||us(n.elements.popper),c,d,o),E=Dr(n.elements.reference),S=og({reference:E,element:x,strategy:"absolute",placement:r}),O=Xc(Object.assign({},x,S)),A=h===Hi?O:E,k={top:C.top-A.top+b.top,bottom:A.bottom-C.bottom+b.bottom,left:C.left-A.left+b.left,right:A.right-C.right+b.right},_=n.modifiersData.offset;if(h===Hi&&_){var V=_[r];Object.keys(k).forEach(function(L){var B=[Wt,Gt].indexOf(L)>=0?1:-1,N=[St,Gt].indexOf(L)>=0?"y":"x";k[L]+=V[N]*B})}return k}function vA(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=t.boundary,i=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,u=c===void 0?$c:c,d=Rr(s),f=d?a?Xp:Xp.filter(function(g){return Rr(g)===d}):Fi,h=f.filter(function(g){return u.indexOf(g)>=0});h.length===0&&(h=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=h.reduce(function(g,m){return g[m]=qi(n,{placement:m,boundary:r,rootBoundary:i,padding:o})[ln(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function CA(n){if(ln(n)===Ea)return[];var e=Na(n);return[sg(n),e,sg(e)]}function SA(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,u=t.padding,d=t.boundary,f=t.rootBoundary,h=t.altBoundary,p=t.flipVariations,g=p===void 0?!0:p,m=t.allowedAutoPlacements,y=e.options.placement,b=ln(y),w=b===y,x=c||(w||!g?[Na(y)]:CA(y)),v=[y].concat(x).reduce(function(F,D){return F.concat(ln(D)===Ea?vA(e,{placement:D,boundary:d,rootBoundary:f,padding:u,flipVariations:g,allowedAutoPlacements:m}):D)},[]),C=e.rects.reference,E=e.rects.popper,S=new Map,O=!0,A=v[0],k=0;k<v.length;k++){var _=v[k],V=ln(_),L=Rr(_)===kr,B=[St,Gt].indexOf(V)>=0,N=B?"width":"height",P=qi(e,{placement:_,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),T=B?L?Wt:Et:L?Gt:St;C[N]>E[N]&&(T=Na(T));var j=Na(T),Y=[];if(i&&Y.push(P[V]<=0),a&&Y.push(P[T]<=0,P[j]<=0),Y.every(function(F){return F})){A=_,O=!1;break}S.set(_,Y)}if(O)for(var te=g?3:1,z=function(D){var q=v.find(function(J){var ae=S.get(J);if(ae)return ae.slice(0,D).every(function(Z){return Z})});if(q)return A=q,"break"},I=te;I>0;I--){var U=z(I);if(U==="break")break}e.placement!==A&&(e.modifiersData[s]._skip=!0,e.placement=A,e.reset=!0)}}const EA={name:"flip",enabled:!0,phase:"main",fn:SA,requiresIfExists:["offset"],data:{_skip:!1}};function ag(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function lg(n){return[St,Wt,Gt,Et].some(function(e){return n[e]>=0})}function OA(n){var e=n.state,t=n.name,s=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=qi(e,{elementContext:"reference"}),a=qi(e,{altBoundary:!0}),c=ag(o,s),u=ag(a,r,i),d=lg(c),f=lg(u);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const MA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:OA};function PA(n,e,t){var s=ln(n),r=[Et,St].indexOf(s)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=i[0],a=i[1];return o=o||0,a=(a||0)*r,[Et,Wt].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function NA(n){var e=n.state,t=n.options,s=n.name,r=t.offset,i=r===void 0?[0,0]:r,o=$c.reduce(function(d,f){return d[f]=PA(f,e.rects,i),d},{}),a=o[e.placement],c=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[s]=o}const AA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:NA};function _A(n){var e=n.state,t=n.name;e.modifiersData[t]=og({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const TA={name:"popperOffsets",enabled:!0,phase:"read",fn:_A,data:{}};function kA(n){return n==="x"?"y":"x"}function VA(n){var e=n.state,t=n.options,s=n.name,r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,u=t.rootBoundary,d=t.altBoundary,f=t.padding,h=t.tether,p=h===void 0?!0:h,g=t.tetherOffset,m=g===void 0?0:g,y=qi(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),b=ln(e.placement),w=Rr(e.placement),x=!w,v=Gc(b),C=kA(v),E=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,k=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,V={x:0,y:0};if(E){if(i){var L,B=v==="y"?St:Et,N=v==="y"?Gt:Wt,P=v==="y"?"height":"width",T=E[v],j=T+y[B],Y=T-y[N],te=p?-O[P]/2:0,z=w===kr?S[P]:O[P],I=w===kr?-O[P]:-S[P],U=e.elements.arrow,F=p&&U?Hc(U):{width:0,height:0},D=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Qp(),q=D[B],J=D[N],ae=Wi(0,S[P],F[P]),Z=x?S[P]/2-te-ae-q-k.mainAxis:z-ae-q-k.mainAxis,fe=x?-S[P]/2+te+ae+J+k.mainAxis:I+ae+J+k.mainAxis,Ze=e.elements.arrow&&Gi(e.elements.arrow),yt=Ze?v==="y"?Ze.clientTop||0:Ze.clientLeft||0:0,Me=(L=_==null?void 0:_[v])!=null?L:0,ne=T+Z-Me-yt,xt=T+fe-Me,Zt=Wi(p?Oa(j,ne):j,T,p?Ws(Y,xt):Y);E[v]=Zt,V[v]=Zt-T}if(a){var Ds,ur=v==="x"?St:Et,So=v==="x"?Gt:Wt,xn=E[C],le=C==="y"?"height":"width",At=xn+y[ur],Nl=xn-y[So],bi=[St,Et].indexOf(b)!==-1,W=(Ds=_==null?void 0:_[C])!=null?Ds:0,Pe=bi?At:xn-S[le]-O[le]-W+k.altAxis,ss=bi?xn+S[le]+O[le]-W-k.altAxis:Nl,Eo=p&&bi?sA(Pe,xn,ss):Wi(p?Pe:At,xn,p?ss:Nl);E[C]=Eo,V[C]=Eo-xn}e.modifiersData[s]=V}}const DA={name:"preventOverflow",enabled:!0,phase:"main",fn:VA,requiresIfExists:["offset"]};function RA(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function IA(n){return n===kt(n)||!Vt(n)?Wc(n):RA(n)}function LA(n){var e=n.getBoundingClientRect(),t=Vr(e.width)/n.offsetWidth||1,s=Vr(e.height)/n.offsetHeight||1;return t!==1||s!==1}function BA(n,e,t){t===void 0&&(t=!1);var s=Vt(e),r=Vt(e)&&LA(e),i=us(e),o=Dr(n,r,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((Nn(e)!=="body"||qc(i))&&(a=IA(e)),Vt(e)?(c=Dr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Yc(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function jA(n){var e=new Map,t=new Set,s=[];n.forEach(function(i){e.set(i.name,i)});function r(i){t.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&r(c)}}),s.push(i)}return n.forEach(function(i){t.has(i.name)||r(i)}),s}function $A(n){var e=jA(n);return zc.reduce(function(t,s){return t.concat(e.filter(function(r){return r.phase===s}))},[])}function zA(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function ds(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return[].concat(t).reduce(function(r,i){return r.replace(/%s/,i)},n)}var Ys='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',FA='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',cg=["name","enabled","phase","fn","effect","requires","options"];function UA(n){n.forEach(function(e){[].concat(Object.keys(e),cg).filter(function(t,s,r){return r.indexOf(t)===s}).forEach(function(t){switch(t){case"name":typeof e.name!="string"&&console.error(ds(Ys,String(e.name),'"name"','"string"','"'+String(e.name)+'"'));break;case"enabled":typeof e.enabled!="boolean"&&console.error(ds(Ys,e.name,'"enabled"','"boolean"','"'+String(e.enabled)+'"'));break;case"phase":zc.indexOf(e.phase)<0&&console.error(ds(Ys,e.name,'"phase"',"either "+zc.join(", "),'"'+String(e.phase)+'"'));break;case"fn":typeof e.fn!="function"&&console.error(ds(Ys,e.name,'"fn"','"function"','"'+String(e.fn)+'"'));break;case"effect":e.effect!=null&&typeof e.effect!="function"&&console.error(ds(Ys,e.name,'"effect"','"function"','"'+String(e.fn)+'"'));break;case"requires":e.requires!=null&&!Array.isArray(e.requires)&&console.error(ds(Ys,e.name,'"requires"','"array"','"'+String(e.requires)+'"'));break;case"requiresIfExists":Array.isArray(e.requiresIfExists)||console.error(ds(Ys,e.name,'"requiresIfExists"','"array"','"'+String(e.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+e.name+'" modifier, valid properties are '+cg.map(function(s){return'"'+s+'"'}).join(", ")+'; but "'+t+'" was provided.')}e.requires&&e.requires.forEach(function(s){n.find(function(r){return r.name===s})==null&&console.error(ds(FA,String(e.name),s,s))})})})}function HA(n,e){var t=new Set;return n.filter(function(s){var r=e(s);if(!t.has(r))return t.add(r),!0})}function GA(n){var e=n.reduce(function(t,s){var r=t[s.name];return t[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var ug="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",WA="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",dg={placement:"bottom",modifiers:[],strategy:"absolute"};function hg(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function YA(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,r=e.defaultOptions,i=r===void 0?dg:r;return function(a,c,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},dg,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;m(),d.options=Object.assign({},i,d.options,w),d.scrollParents={reference:Gs(a)?Yi(a):a.contextElement?Yi(a.contextElement):[],popper:Yi(c)};var x=$A(GA([].concat(s,d.options.modifiers)));if(d.orderedModifiers=x.filter(function(_){return _.enabled}),process.env.NODE_ENV!=="production"){var v=HA([].concat(x,d.options.modifiers),function(_){var V=_.name;return V});if(UA(v),ln(d.options.placement)===Ea){var C=d.orderedModifiers.find(function(_){var V=_.name;return V==="flip"});C||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var E=cn(c),S=E.marginTop,O=E.marginRight,A=E.marginBottom,k=E.marginLeft;[S,O,A,k].some(function(_){return parseFloat(_)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return g(),p.update()},forceUpdate:function(){if(!h){var b=d.elements,w=b.reference,x=b.popper;if(!hg(w,x)){process.env.NODE_ENV!=="production"&&console.error(ug);return}d.rects={reference:BA(w,Gi(x),d.options.strategy==="fixed"),popper:Hc(x)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(_){return d.modifiersData[_.name]=Object.assign({},_.data)});for(var v=0,C=0;C<d.orderedModifiers.length;C++){if(process.env.NODE_ENV!=="production"&&(v+=1,v>100)){console.error(WA);break}if(d.reset===!0){d.reset=!1,C=-1;continue}var E=d.orderedModifiers[C],S=E.fn,O=E.options,A=O===void 0?{}:O,k=E.name;typeof S=="function"&&(d=S({state:d,options:A,name:k,instance:p})||d)}}},update:zA(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){m(),h=!0}};if(!hg(a,c))return process.env.NODE_ENV!=="production"&&console.error(ug),p;p.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){d.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,x=w===void 0?{}:w,v=y.effect;if(typeof v=="function"){var C=v({state:d,name:b,instance:p,options:x}),E=function(){};f.push(C||E)}})}function m(){f.forEach(function(y){return y()}),f=[]}return p}}var qA=[fA,TA,dA,eA,AA,EA,DA,aA,MA],XA=YA({defaultModifiers:qA});const JA=(n,e,t={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=KA(c);Object.assign(o.value,u)},requires:["computeStyles"]},r=l.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=l.unref(t);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],s,{name:"applyStyles",enabled:!1}]}}),i=l.shallowRef(),o=l.ref({styles:{popper:{position:l.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return l.watch(r,c=>{const u=l.unref(i);u&&u.setOptions(c)},{deep:!0}),l.watch([n,e],([c,u])=>{a(),!(!c||!u)&&(i.value=XA(c,u,l.unref(r)))}),l.onBeforeUnmount(()=>{a()}),{state:l.computed(()=>{var c;return{...((c=l.unref(i))==null?void 0:c.state)||{}}}),styles:l.computed(()=>l.unref(o).styles),attributes:l.computed(()=>l.unref(o).attributes),update:()=>{var c;return(c=l.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=l.unref(i))==null?void 0:c.forceUpdate()},instanceRef:l.computed(()=>l.unref(i))}};function KA(n){const e=Object.keys(n.elements),t=pa(e.map(r=>[r,n.styles[r]||{}])),s=pa(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:s}}const fg=n=>{if(!n)return{onClick:ls,onMousedown:ls,onMouseup:ls};let e=!1,t=!1;return{onClick:o=>{e&&t&&n(o),e=t=!1},onMousedown:o=>{e=o.target===o.currentTarget},onMouseup:o=>{t=o.target===o.currentTarget}}};function pg(){let n;const e=(s,r)=>{t(),n=window.setTimeout(s,r)},t=()=>window.clearTimeout(n);return Wo(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Jc={prefix:Math.floor(Math.random()*1e4),current:0},ZA=Symbol("elIdInjection"),gg=()=>l.getCurrentInstance()?l.inject(ZA,Jc):Jc,Aa=n=>{const e=gg();!We&&e===Jc&&Tt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
20
+ `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:ln(e.placement),variation:Rr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,sg(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,sg(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const dA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:uA,data:{}};var Pa={passive:!0};function hA(n){var e=n.state,t=n.instance,s=n.options,r=s.scroll,i=r===void 0?!0:r,o=s.resize,a=o===void 0?!0:o,c=kt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",t.update,Pa)}),a&&c.addEventListener("resize",t.update,Pa),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",t.update,Pa)}),a&&c.removeEventListener("resize",t.update,Pa)}}const fA={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:hA,data:{}};var pA={left:"right",right:"left",bottom:"top",top:"bottom"};function Na(n){return n.replace(/left|right|bottom|top/g,function(e){return pA[e]})}var gA={start:"end",end:"start"};function rg(n){return n.replace(/start|end/g,function(e){return gA[e]})}function Wc(n){var e=kt(n),t=e.pageXOffset,s=e.pageYOffset;return{scrollLeft:t,scrollTop:s}}function Yc(n){return Dr(us(n)).left+Wc(n).scrollLeft}function mA(n,e){var t=kt(n),s=us(n),r=t.visualViewport,i=s.clientWidth,o=s.clientHeight,a=0,c=0;if(r){i=r.width,o=r.height;var u=Kp();(u||!u&&e==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:o,x:a+Yc(n),y:c}}function yA(n){var e,t=us(n),s=Wc(n),r=(e=n.ownerDocument)==null?void 0:e.body,i=Ws(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Ws(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+Yc(n),c=-s.scrollTop;return cn(r||t).direction==="rtl"&&(a+=Ws(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:o,x:a,y:c}}function qc(n){var e=cn(n),t=e.overflow,s=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+s)}function ig(n){return["html","body","#document"].indexOf(Nn(n))>=0?n.ownerDocument.body:Vt(n)&&qc(n)?n:ig(Ma(n))}function Yi(n,e){var t;e===void 0&&(e=[]);var s=ig(n),r=s===((t=n.ownerDocument)==null?void 0:t.body),i=kt(s),o=r?[i].concat(i.visualViewport||[],qc(s)?s:[]):s,a=e.concat(o);return r?a:a.concat(Yi(Ma(o)))}function Xc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function bA(n,e){var t=Dr(n,!1,e==="fixed");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 og(n,e,t){return e===Xp?Xc(mA(n,t)):Gs(e)?bA(e,t):Xc(yA(us(n)))}function wA(n){var e=Yi(Ma(n)),t=["absolute","fixed"].indexOf(cn(n).position)>=0,s=t&&Vt(n)?Gi(n):n;return Gs(s)?e.filter(function(r){return Gs(r)&&Zp(r,s)&&Nn(r)!=="body"}):[]}function xA(n,e,t,s){var r=e==="clippingParents"?wA(n):[].concat(e),i=[].concat(r,[t]),o=i[0],a=i.reduce(function(c,u){var d=og(n,u,s);return c.top=Ws(d.top,c.top),c.right=Oa(d.right,c.right),c.bottom=Oa(d.bottom,c.bottom),c.left=Ws(d.left,c.left),c},og(n,o,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ag(n){var e=n.reference,t=n.element,s=n.placement,r=s?ln(s):null,i=s?Rr(s):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(r){case St:c={x:o,y:e.y-t.height};break;case Gt:c={x:o,y:e.y+e.height};break;case Wt:c={x:e.x+e.width,y:a};break;case Et:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var u=r?Gc(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case kr:c[u]=c[u]-(e[d]/2-t[d]/2);break;case Ui:c[u]=c[u]+(e[d]/2-t[d]/2);break}}return c}function qi(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=s===void 0?n.placement:s,i=t.strategy,o=i===void 0?n.strategy:i,a=t.boundary,c=a===void 0?zN:a,u=t.rootBoundary,d=u===void 0?Xp:u,f=t.elementContext,h=f===void 0?Hi:f,p=t.altBoundary,g=p===void 0?!1:p,m=t.padding,y=m===void 0?0:m,b=tg(typeof y!="number"?y:ng(y,Fi)),w=h===Hi?FN:Hi,x=n.rects.popper,S=n.elements[g?w:h],v=xA(Gs(S)?S:S.contextElement||us(n.elements.popper),c,d,o),E=Dr(n.elements.reference),C=ag({reference:E,element:x,strategy:"absolute",placement:r}),O=Xc(Object.assign({},x,C)),A=h===Hi?O:E,k={top:v.top-A.top+b.top,bottom:A.bottom-v.bottom+b.bottom,left:v.left-A.left+b.left,right:A.right-v.right+b.right},_=n.modifiersData.offset;if(h===Hi&&_){var V=_[r];Object.keys(k).forEach(function(L){var B=[Wt,Gt].indexOf(L)>=0?1:-1,N=[St,Gt].indexOf(L)>=0?"y":"x";k[L]+=V[N]*B})}return k}function vA(n,e){e===void 0&&(e={});var t=e,s=t.placement,r=t.boundary,i=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,u=c===void 0?$c:c,d=Rr(s),f=d?a?Jp:Jp.filter(function(g){return Rr(g)===d}):Fi,h=f.filter(function(g){return u.indexOf(g)>=0});h.length===0&&(h=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=h.reduce(function(g,m){return g[m]=qi(n,{placement:m,boundary:r,rootBoundary:i,padding:o})[ln(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}function CA(n){if(ln(n)===Ea)return[];var e=Na(n);return[rg(n),e,rg(e)]}function SA(n){var e=n.state,t=n.options,s=n.name;if(!e.modifiersData[s]._skip){for(var r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,u=t.padding,d=t.boundary,f=t.rootBoundary,h=t.altBoundary,p=t.flipVariations,g=p===void 0?!0:p,m=t.allowedAutoPlacements,y=e.options.placement,b=ln(y),w=b===y,x=c||(w||!g?[Na(y)]:CA(y)),S=[y].concat(x).reduce(function(F,D){return F.concat(ln(D)===Ea?vA(e,{placement:D,boundary:d,rootBoundary:f,padding:u,flipVariations:g,allowedAutoPlacements:m}):D)},[]),v=e.rects.reference,E=e.rects.popper,C=new Map,O=!0,A=S[0],k=0;k<S.length;k++){var _=S[k],V=ln(_),L=Rr(_)===kr,B=[St,Gt].indexOf(V)>=0,N=B?"width":"height",P=qi(e,{placement:_,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),T=B?L?Wt:Et:L?Gt:St;v[N]>E[N]&&(T=Na(T));var j=Na(T),Y=[];if(i&&Y.push(P[V]<=0),a&&Y.push(P[T]<=0,P[j]<=0),Y.every(function(F){return F})){A=_,O=!1;break}C.set(_,Y)}if(O)for(var te=g?3:1,z=function(D){var q=S.find(function(J){var ae=C.get(J);if(ae)return ae.slice(0,D).every(function(Z){return Z})});if(q)return A=q,"break"},I=te;I>0;I--){var U=z(I);if(U==="break")break}e.placement!==A&&(e.modifiersData[s]._skip=!0,e.placement=A,e.reset=!0)}}const EA={name:"flip",enabled:!0,phase:"main",fn:SA,requiresIfExists:["offset"],data:{_skip:!1}};function lg(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function cg(n){return[St,Wt,Gt,Et].some(function(e){return n[e]>=0})}function OA(n){var e=n.state,t=n.name,s=e.rects.reference,r=e.rects.popper,i=e.modifiersData.preventOverflow,o=qi(e,{elementContext:"reference"}),a=qi(e,{altBoundary:!0}),c=lg(o,s),u=lg(a,r,i),d=cg(c),f=cg(u);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const MA={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:OA};function PA(n,e,t){var s=ln(n),r=[Et,St].indexOf(s)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,o=i[0],a=i[1];return o=o||0,a=(a||0)*r,[Et,Wt].indexOf(s)>=0?{x:a,y:o}:{x:o,y:a}}function NA(n){var e=n.state,t=n.options,s=n.name,r=t.offset,i=r===void 0?[0,0]:r,o=$c.reduce(function(d,f){return d[f]=PA(f,e.rects,i),d},{}),a=o[e.placement],c=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[s]=o}const AA={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:NA};function _A(n){var e=n.state,t=n.name;e.modifiersData[t]=ag({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const TA={name:"popperOffsets",enabled:!0,phase:"read",fn:_A,data:{}};function kA(n){return n==="x"?"y":"x"}function VA(n){var e=n.state,t=n.options,s=n.name,r=t.mainAxis,i=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,u=t.rootBoundary,d=t.altBoundary,f=t.padding,h=t.tether,p=h===void 0?!0:h,g=t.tetherOffset,m=g===void 0?0:g,y=qi(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),b=ln(e.placement),w=Rr(e.placement),x=!w,S=Gc(b),v=kA(S),E=e.modifiersData.popperOffsets,C=e.rects.reference,O=e.rects.popper,A=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,k=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,V={x:0,y:0};if(E){if(i){var L,B=S==="y"?St:Et,N=S==="y"?Gt:Wt,P=S==="y"?"height":"width",T=E[S],j=T+y[B],Y=T-y[N],te=p?-O[P]/2:0,z=w===kr?C[P]:O[P],I=w===kr?-O[P]:-C[P],U=e.elements.arrow,F=p&&U?Hc(U):{width:0,height:0},D=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:eg(),q=D[B],J=D[N],ae=Wi(0,C[P],F[P]),Z=x?C[P]/2-te-ae-q-k.mainAxis:z-ae-q-k.mainAxis,fe=x?-C[P]/2+te+ae+J+k.mainAxis:I+ae+J+k.mainAxis,Ze=e.elements.arrow&&Gi(e.elements.arrow),yt=Ze?S==="y"?Ze.clientTop||0:Ze.clientLeft||0:0,Me=(L=_==null?void 0:_[S])!=null?L:0,ne=T+Z-Me-yt,xt=T+fe-Me,Zt=Wi(p?Oa(j,ne):j,T,p?Ws(Y,xt):Y);E[S]=Zt,V[S]=Zt-T}if(a){var Ds,ur=S==="x"?St:Et,So=S==="x"?Gt:Wt,xn=E[v],le=v==="y"?"height":"width",At=xn+y[ur],Nl=xn-y[So],bi=[St,Et].indexOf(b)!==-1,W=(Ds=_==null?void 0:_[v])!=null?Ds:0,Pe=bi?At:xn-C[le]-O[le]-W+k.altAxis,ss=bi?xn+C[le]+O[le]-W-k.altAxis:Nl,Eo=p&&bi?sA(Pe,xn,ss):Wi(p?Pe:At,xn,p?ss:Nl);E[v]=Eo,V[v]=Eo-xn}e.modifiersData[s]=V}}const DA={name:"preventOverflow",enabled:!0,phase:"main",fn:VA,requiresIfExists:["offset"]};function RA(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function IA(n){return n===kt(n)||!Vt(n)?Wc(n):RA(n)}function LA(n){var e=n.getBoundingClientRect(),t=Vr(e.width)/n.offsetWidth||1,s=Vr(e.height)/n.offsetHeight||1;return t!==1||s!==1}function BA(n,e,t){t===void 0&&(t=!1);var s=Vt(e),r=Vt(e)&&LA(e),i=us(e),o=Dr(n,r,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!t)&&((Nn(e)!=="body"||qc(i))&&(a=IA(e)),Vt(e)?(c=Dr(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=Yc(i))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function jA(n){var e=new Map,t=new Set,s=[];n.forEach(function(i){e.set(i.name,i)});function r(i){t.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&r(c)}}),s.push(i)}return n.forEach(function(i){t.has(i.name)||r(i)}),s}function $A(n){var e=jA(n);return zc.reduce(function(t,s){return t.concat(e.filter(function(r){return r.phase===s}))},[])}function zA(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function ds(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return[].concat(t).reduce(function(r,i){return r.replace(/%s/,i)},n)}var Ys='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',FA='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',ug=["name","enabled","phase","fn","effect","requires","options"];function UA(n){n.forEach(function(e){[].concat(Object.keys(e),ug).filter(function(t,s,r){return r.indexOf(t)===s}).forEach(function(t){switch(t){case"name":typeof e.name!="string"&&console.error(ds(Ys,String(e.name),'"name"','"string"','"'+String(e.name)+'"'));break;case"enabled":typeof e.enabled!="boolean"&&console.error(ds(Ys,e.name,'"enabled"','"boolean"','"'+String(e.enabled)+'"'));break;case"phase":zc.indexOf(e.phase)<0&&console.error(ds(Ys,e.name,'"phase"',"either "+zc.join(", "),'"'+String(e.phase)+'"'));break;case"fn":typeof e.fn!="function"&&console.error(ds(Ys,e.name,'"fn"','"function"','"'+String(e.fn)+'"'));break;case"effect":e.effect!=null&&typeof e.effect!="function"&&console.error(ds(Ys,e.name,'"effect"','"function"','"'+String(e.fn)+'"'));break;case"requires":e.requires!=null&&!Array.isArray(e.requires)&&console.error(ds(Ys,e.name,'"requires"','"array"','"'+String(e.requires)+'"'));break;case"requiresIfExists":Array.isArray(e.requiresIfExists)||console.error(ds(Ys,e.name,'"requiresIfExists"','"array"','"'+String(e.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+e.name+'" modifier, valid properties are '+ug.map(function(s){return'"'+s+'"'}).join(", ")+'; but "'+t+'" was provided.')}e.requires&&e.requires.forEach(function(s){n.find(function(r){return r.name===s})==null&&console.error(ds(FA,String(e.name),s,s))})})})}function HA(n,e){var t=new Set;return n.filter(function(s){var r=e(s);if(!t.has(r))return t.add(r),!0})}function GA(n){var e=n.reduce(function(t,s){var r=t[s.name];return t[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,t},{});return Object.keys(e).map(function(t){return e[t]})}var dg="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",WA="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",hg={placement:"bottom",modifiers:[],strategy:"absolute"};function fg(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function YA(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,s=t===void 0?[]:t,r=e.defaultOptions,i=r===void 0?hg:r;return function(a,c,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},hg,i),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;m(),d.options=Object.assign({},i,d.options,w),d.scrollParents={reference:Gs(a)?Yi(a):a.contextElement?Yi(a.contextElement):[],popper:Yi(c)};var x=$A(GA([].concat(s,d.options.modifiers)));if(d.orderedModifiers=x.filter(function(_){return _.enabled}),process.env.NODE_ENV!=="production"){var S=HA([].concat(x,d.options.modifiers),function(_){var V=_.name;return V});if(UA(S),ln(d.options.placement)===Ea){var v=d.orderedModifiers.find(function(_){var V=_.name;return V==="flip"});v||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var E=cn(c),C=E.marginTop,O=E.marginRight,A=E.marginBottom,k=E.marginLeft;[C,O,A,k].some(function(_){return parseFloat(_)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return g(),p.update()},forceUpdate:function(){if(!h){var b=d.elements,w=b.reference,x=b.popper;if(!fg(w,x)){process.env.NODE_ENV!=="production"&&console.error(dg);return}d.rects={reference:BA(w,Gi(x),d.options.strategy==="fixed"),popper:Hc(x)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(_){return d.modifiersData[_.name]=Object.assign({},_.data)});for(var S=0,v=0;v<d.orderedModifiers.length;v++){if(process.env.NODE_ENV!=="production"&&(S+=1,S>100)){console.error(WA);break}if(d.reset===!0){d.reset=!1,v=-1;continue}var E=d.orderedModifiers[v],C=E.fn,O=E.options,A=O===void 0?{}:O,k=E.name;typeof C=="function"&&(d=C({state:d,options:A,name:k,instance:p})||d)}}},update:zA(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){m(),h=!0}};if(!fg(a,c))return process.env.NODE_ENV!=="production"&&console.error(dg),p;p.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function g(){d.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,x=w===void 0?{}:w,S=y.effect;if(typeof S=="function"){var v=S({state:d,name:b,instance:p,options:x}),E=function(){};f.push(v||E)}})}function m(){f.forEach(function(y){return y()}),f=[]}return p}}var qA=[fA,TA,dA,eA,AA,EA,DA,aA,MA],XA=YA({defaultModifiers:qA});const JA=(n,e,t={})=>{const s={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=KA(c);Object.assign(o.value,u)},requires:["computeStyles"]},r=l.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=l.unref(t);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],s,{name:"applyStyles",enabled:!1}]}}),i=l.shallowRef(),o=l.ref({styles:{popper:{position:l.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return l.watch(r,c=>{const u=l.unref(i);u&&u.setOptions(c)},{deep:!0}),l.watch([n,e],([c,u])=>{a(),!(!c||!u)&&(i.value=XA(c,u,l.unref(r)))}),l.onBeforeUnmount(()=>{a()}),{state:l.computed(()=>{var c;return{...((c=l.unref(i))==null?void 0:c.state)||{}}}),styles:l.computed(()=>l.unref(o).styles),attributes:l.computed(()=>l.unref(o).attributes),update:()=>{var c;return(c=l.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=l.unref(i))==null?void 0:c.forceUpdate()},instanceRef:l.computed(()=>l.unref(i))}};function KA(n){const e=Object.keys(n.elements),t=pa(e.map(r=>[r,n.styles[r]||{}])),s=pa(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:s}}const pg=n=>{if(!n)return{onClick:ls,onMousedown:ls,onMouseup:ls};let e=!1,t=!1;return{onClick:o=>{e&&t&&n(o),e=t=!1},onMousedown:o=>{e=o.target===o.currentTarget},onMouseup:o=>{t=o.target===o.currentTarget}}};function gg(){let n;const e=(s,r)=>{t(),n=window.setTimeout(s,r)},t=()=>window.clearTimeout(n);return Wo(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Jc={prefix:Math.floor(Math.random()*1e4),current:0},ZA=Symbol("elIdInjection"),mg=()=>l.getCurrentInstance()?l.inject(ZA,Jc):Jc,Aa=n=>{const e=mg();!We&&e===Jc&&Tt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
21
21
  usage: app.provide(ID_INJECTION_KEY, {
22
22
  prefix: number,
23
23
  current: number,
24
- })`);const t=jc();return l.computed(()=>l.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let Ir=[];const mg=n=>{const e=n;e.key===Tr.esc&&Ir.forEach(t=>t(e))},QA=n=>{l.onMounted(()=>{Ir.length===0&&document.addEventListener("keydown",mg),We&&Ir.push(n)}),l.onBeforeUnmount(()=>{Ir=Ir.filter(e=>e!==n),Ir.length===0&&We&&document.removeEventListener("keydown",mg)})},yg=()=>{const n=jc(),e=gg(),t=l.computed(()=>`${n.value}-popper-container-${e.prefix}`),s=l.computed(()=>`#${t.value}`);return{id:t,selector:s}},e_=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},t_=()=>{const{id:n,selector:e}=yg();return l.onBeforeMount(()=>{We&&(process.env.NODE_ENV==="test"||!document.body.querySelector(e.value))&&e_(n.value)}),{id:n,selector:e}},n_=et({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),s_=({showAfter:n,hideAfter:e,autoClose:t,open:s,close:r})=>{const{registerTimeout:i}=pg(),{registerTimeout:o,cancelTimeout:a}=pg();return{onOpen:d=>{i(()=>{s(d);const f=l.unref(t);Ht(f)&&f>0&&o(()=>{r(d)},f)},l.unref(n))},onClose:d=>{a(),i(()=>{r(d)},l.unref(e))}}},bg=Symbol("elForwardRef"),r_=n=>{const e=t=>{n.value=t};l.provide(bg,{setForwardRef:e})},i_=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),wg={current:0},xg=l.ref(0),vg=2e3,Cg=Symbol("elZIndexContextKey"),Sg=Symbol("zIndexContextKey"),Eg=n=>{const e=l.getCurrentInstance()?l.inject(Cg,wg):wg,t=n||(l.getCurrentInstance()?l.inject(Sg,void 0):void 0),s=l.computed(()=>{const o=l.unref(t);return Ht(o)?o:vg}),r=l.computed(()=>s.value+xg.value),i=()=>(e.current++,xg.value=e.current,r.value);return!We&&!l.inject(Cg)&&Tt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
25
- usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function o_(n){let e;function t(){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)),c=o.slice(Math.max(0,i));e={selectionStart:r,selectionEnd:i,value:o,beforeTxt:a,afterTxt:c}}function s(){if(n.value==null||e==null)return;const{value:r}=n.value,{beforeTxt:i,afterTxt:o,selectionStart:a}=e;if(i==null||o==null||a==null)return;let c=r.length;if(r.endsWith(o))c=r.length-o.length;else if(r.startsWith(i))c=i.length;else{const u=i[a-1],d=r.indexOf(u,a-1);d!==-1&&(c=d+1)}n.value.setSelectionRange(c,c)}return[t,s]}const Kc=xa({type:String,values:Up,required:!1}),Og=Symbol("size"),a_=()=>{const n=l.inject(Og,{});return l.computed(()=>l.unref(n.size)||"")};function l_(n,{beforeFocus:e,afterFocus:t,beforeBlur:s,afterBlur:r}={}){const i=l.getCurrentInstance(),{emit:o}=i,a=l.shallowRef(),c=l.ref(!1),u=h=>{zt(e)&&e(h)||c.value||(c.value=!0,o("focus",h),t==null||t())},d=h=>{var p;zt(s)&&s(h)||h.relatedTarget&&((p=a.value)!=null&&p.contains(h.relatedTarget))||(c.value=!1,o("blur",h),r==null||r())},f=()=>{var h,p;(h=a.value)!=null&&h.contains(document.activeElement)&&a.value!==document.activeElement||(p=n.value)==null||p.focus()};return l.watch(a,h=>{h&&h.setAttribute("tabindex","-1")}),Gn(a,"focus",u,!0),Gn(a,"blur",d,!0),Gn(a,"click",f,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const h=qn(n.value)?n.value:document.querySelector("input,textarea");h&&(Gn(h,"focus",u,!0),Gn(h,"blur",d,!0))}),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}function c_({afterComposition:n,emit:e}){const t=l.ref(!1),s=a=>{e==null||e("compositionstart",a),t.value=!0},r=a=>{var c;e==null||e("compositionupdate",a);const u=(c=a.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!ON(d)},i=a=>{e==null||e("compositionend",a),t.value&&(t.value=!1,l.nextTick(()=>n(a)))};return{isComposing:t,handleComposition:a=>{a.type==="compositionend"?i(a):r(a)},handleCompositionStart:s,handleCompositionUpdate:r,handleCompositionEnd:i}}const u_=Symbol("emptyValuesContextKey"),d_=et({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>zt(n)?!n():!n}}),h_=et({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Zc=n=>Ic(h_,n),Mg=Symbol(),_a=l.ref();function Qc(n,e=void 0){const t=l.getCurrentInstance()?l.inject(Mg,_a):_a;return n?l.computed(()=>{var s,r;return(r=(s=t.value)==null?void 0:s[n])!=null?r:e}):t}function Pg(n,e){const t=Qc(),s=bt(n,l.computed(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||Sa})),r=RN(l.computed(()=>{var a;return(a=t.value)==null?void 0:a.locale})),i=Eg(l.computed(()=>{var a;return((a=t.value)==null?void 0:a.zIndex)||vg})),o=l.computed(()=>{var a;return l.unref(e)||((a=t.value)==null?void 0:a.size)||""});return Ng(l.computed(()=>l.unref(t)||{})),{ns:s,locale:r,zIndex:i,size:o}}const Ng=(n,e,t=!1)=>{var s;const r=!!l.getCurrentInstance(),i=r?Qc():void 0,o=(s=void 0)!=null?s:r?l.provide:void 0;if(!o){Tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=l.computed(()=>{const c=l.unref(n);return i!=null&&i.value?f_(i.value,c):c});return o(Mg,a),o(Gp,l.computed(()=>a.value.locale)),o(Wp,l.computed(()=>a.value.namespace)),o(Sg,l.computed(()=>a.value.zIndex)),o(Og,{size:l.computed(()=>a.value.size||"")}),o(u_,l.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!_a.value)&&(_a.value=a.value),a},f_=(n,e)=>{const t=[...new Set([...kp(n),...kp(e)])],s={};for(const r of t)s[r]=e[r]!==void 0?e[r]:n[r];return s},p_=et({a11y:{type:Boolean,default:!0},locale:{type:he(Object)},size:Kc,button:{type:he(Object)},experimentalFeatures:{type:he(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:he(Object)},zIndex:Number,namespace:{type:String,default:"el"},...d_}),un={};l.defineComponent({name:"ElConfigProvider",props:p_,setup(n,{slots:e}){l.watch(()=>n.message,s=>{Object.assign(un,s??{})},{immediate:!0,deep:!0});const t=Ng(n);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var pt=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};const g_=et({size:{type:he([Number,String])},color:{type:String}}),m_=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),y_=l.defineComponent({...m_,props:g_,setup(n){const e=n,t=bt("icon"),s=l.computed(()=>{const{size:r,color:i}=e;return!r&&!i?{}:{fontSize:Tp(r)?void 0:$i(r),"--color":i}});return(r,i)=>(l.openBlock(),l.createElementBlock("i",l.mergeProps({class:l.unref(t).b(),style:l.unref(s)},r.$attrs),[l.renderSlot(r.$slots,"default")],16))}});var b_=pt(y_,[["__file","icon.vue"]]);const An=Us(b_),eu=Symbol("formContextKey"),Ta=Symbol("formItemContextKey"),Ag=(n,e={})=>{const t=l.ref(void 0),s=e.prop?t:Yp("size"),r=e.global?t:a_(),i=e.form?{size:void 0}:l.inject(eu,void 0),o=e.formItem?{size:void 0}:l.inject(Ta,void 0);return l.computed(()=>s.value||l.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},tu=n=>{const e=Yp("disabled"),t=l.inject(eu,void 0);return l.computed(()=>e.value||l.unref(n)||(t==null?void 0:t.disabled)||!1)},_g=()=>{const n=l.inject(eu,void 0),e=l.inject(Ta,void 0);return{form:n,formItem:e}},w_=(n,{formItemContext:e,disableIdGeneration:t,disableIdManagement:s})=>{t||(t=l.ref(!1)),s||(s=l.ref(!1));const r=l.ref();let i;const o=l.computed(()=>{var a;return!!(!(n.label||n.ariaLabel)&&e&&e.inputIds&&((a=e.inputIds)==null?void 0:a.length)<=1)});return l.onMounted(()=>{i=l.watch([l.toRef(n,"id"),t],([a,c])=>{const u=a??(c?void 0:Aa().value);u!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(s!=null&&s.value)&&!c&&u&&e.addInputId(u)),r.value=u)},{immediate:!0})}),l.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:o,inputId:r}};let dn;const x_=`
24
+ })`);const t=jc();return l.computed(()=>l.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let Ir=[];const yg=n=>{const e=n;e.key===Tr.esc&&Ir.forEach(t=>t(e))},QA=n=>{l.onMounted(()=>{Ir.length===0&&document.addEventListener("keydown",yg),We&&Ir.push(n)}),l.onBeforeUnmount(()=>{Ir=Ir.filter(e=>e!==n),Ir.length===0&&We&&document.removeEventListener("keydown",yg)})},bg=()=>{const n=jc(),e=mg(),t=l.computed(()=>`${n.value}-popper-container-${e.prefix}`),s=l.computed(()=>`#${t.value}`);return{id:t,selector:s}},e_=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},t_=()=>{const{id:n,selector:e}=bg();return l.onBeforeMount(()=>{We&&(process.env.NODE_ENV==="test"||!document.body.querySelector(e.value))&&e_(n.value)}),{id:n,selector:e}},n_=et({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),s_=({showAfter:n,hideAfter:e,autoClose:t,open:s,close:r})=>{const{registerTimeout:i}=gg(),{registerTimeout:o,cancelTimeout:a}=gg();return{onOpen:d=>{i(()=>{s(d);const f=l.unref(t);Ht(f)&&f>0&&o(()=>{r(d)},f)},l.unref(n))},onClose:d=>{a(),i(()=>{r(d)},l.unref(e))}}},wg=Symbol("elForwardRef"),r_=n=>{const e=t=>{n.value=t};l.provide(wg,{setForwardRef:e})},i_=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),xg={current:0},vg=l.ref(0),Cg=2e3,Sg=Symbol("elZIndexContextKey"),Eg=Symbol("zIndexContextKey"),Og=n=>{const e=l.getCurrentInstance()?l.inject(Sg,xg):xg,t=n||(l.getCurrentInstance()?l.inject(Eg,void 0):void 0),s=l.computed(()=>{const o=l.unref(t);return Ht(o)?o:Cg}),r=l.computed(()=>s.value+vg.value),i=()=>(e.current++,vg.value=e.current,r.value);return!We&&!l.inject(Sg)&&Tt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
25
+ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,currentZIndex:r,nextZIndex:i}};function o_(n){let e;function t(){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)),c=o.slice(Math.max(0,i));e={selectionStart:r,selectionEnd:i,value:o,beforeTxt:a,afterTxt:c}}function s(){if(n.value==null||e==null)return;const{value:r}=n.value,{beforeTxt:i,afterTxt:o,selectionStart:a}=e;if(i==null||o==null||a==null)return;let c=r.length;if(r.endsWith(o))c=r.length-o.length;else if(r.startsWith(i))c=i.length;else{const u=i[a-1],d=r.indexOf(u,a-1);d!==-1&&(c=d+1)}n.value.setSelectionRange(c,c)}return[t,s]}const Kc=xa({type:String,values:Hp,required:!1}),Mg=Symbol("size"),a_=()=>{const n=l.inject(Mg,{});return l.computed(()=>l.unref(n.size)||"")};function l_(n,{beforeFocus:e,afterFocus:t,beforeBlur:s,afterBlur:r}={}){const i=l.getCurrentInstance(),{emit:o}=i,a=l.shallowRef(),c=l.ref(!1),u=h=>{zt(e)&&e(h)||c.value||(c.value=!0,o("focus",h),t==null||t())},d=h=>{var p;zt(s)&&s(h)||h.relatedTarget&&((p=a.value)!=null&&p.contains(h.relatedTarget))||(c.value=!1,o("blur",h),r==null||r())},f=()=>{var h,p;(h=a.value)!=null&&h.contains(document.activeElement)&&a.value!==document.activeElement||(p=n.value)==null||p.focus()};return l.watch(a,h=>{h&&h.setAttribute("tabindex","-1")}),Gn(a,"focus",u,!0),Gn(a,"blur",d,!0),Gn(a,"click",f,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const h=qn(n.value)?n.value:document.querySelector("input,textarea");h&&(Gn(h,"focus",u,!0),Gn(h,"blur",d,!0))}),{isFocused:c,wrapperRef:a,handleFocus:u,handleBlur:d}}function c_({afterComposition:n,emit:e}){const t=l.ref(!1),s=a=>{e==null||e("compositionstart",a),t.value=!0},r=a=>{var c;e==null||e("compositionupdate",a);const u=(c=a.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!ON(d)},i=a=>{e==null||e("compositionend",a),t.value&&(t.value=!1,l.nextTick(()=>n(a)))};return{isComposing:t,handleComposition:a=>{a.type==="compositionend"?i(a):r(a)},handleCompositionStart:s,handleCompositionUpdate:r,handleCompositionEnd:i}}const u_=Symbol("emptyValuesContextKey"),d_=et({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>zt(n)?!n():!n}}),h_=et({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Zc=n=>Ic(h_,n),Pg=Symbol(),_a=l.ref();function Qc(n,e=void 0){const t=l.getCurrentInstance()?l.inject(Pg,_a):_a;return n?l.computed(()=>{var s,r;return(r=(s=t.value)==null?void 0:s[n])!=null?r:e}):t}function Ng(n,e){const t=Qc(),s=bt(n,l.computed(()=>{var a;return((a=t.value)==null?void 0:a.namespace)||Sa})),r=RN(l.computed(()=>{var a;return(a=t.value)==null?void 0:a.locale})),i=Og(l.computed(()=>{var a;return((a=t.value)==null?void 0:a.zIndex)||Cg})),o=l.computed(()=>{var a;return l.unref(e)||((a=t.value)==null?void 0:a.size)||""});return Ag(l.computed(()=>l.unref(t)||{})),{ns:s,locale:r,zIndex:i,size:o}}const Ag=(n,e,t=!1)=>{var s;const r=!!l.getCurrentInstance(),i=r?Qc():void 0,o=(s=void 0)!=null?s:r?l.provide:void 0;if(!o){Tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const a=l.computed(()=>{const c=l.unref(n);return i!=null&&i.value?f_(i.value,c):c});return o(Pg,a),o(Wp,l.computed(()=>a.value.locale)),o(Yp,l.computed(()=>a.value.namespace)),o(Eg,l.computed(()=>a.value.zIndex)),o(Mg,{size:l.computed(()=>a.value.size||"")}),o(u_,l.computed(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(t||!_a.value)&&(_a.value=a.value),a},f_=(n,e)=>{const t=[...new Set([...Vp(n),...Vp(e)])],s={};for(const r of t)s[r]=e[r]!==void 0?e[r]:n[r];return s},p_=et({a11y:{type:Boolean,default:!0},locale:{type:he(Object)},size:Kc,button:{type:he(Object)},experimentalFeatures:{type:he(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:he(Object)},zIndex:Number,namespace:{type:String,default:"el"},...d_}),un={};l.defineComponent({name:"ElConfigProvider",props:p_,setup(n,{slots:e}){l.watch(()=>n.message,s=>{Object.assign(un,s??{})},{immediate:!0,deep:!0});const t=Ag(n);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var pt=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t};const g_=et({size:{type:he([Number,String])},color:{type:String}}),m_=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),y_=l.defineComponent({...m_,props:g_,setup(n){const e=n,t=bt("icon"),s=l.computed(()=>{const{size:r,color:i}=e;return!r&&!i?{}:{fontSize:kp(r)?void 0:$i(r),"--color":i}});return(r,i)=>(l.openBlock(),l.createElementBlock("i",l.mergeProps({class:l.unref(t).b(),style:l.unref(s)},r.$attrs),[l.renderSlot(r.$slots,"default")],16))}});var b_=pt(y_,[["__file","icon.vue"]]);const An=Us(b_),eu=Symbol("formContextKey"),Ta=Symbol("formItemContextKey"),_g=(n,e={})=>{const t=l.ref(void 0),s=e.prop?t:qp("size"),r=e.global?t:a_(),i=e.form?{size:void 0}:l.inject(eu,void 0),o=e.formItem?{size:void 0}:l.inject(Ta,void 0);return l.computed(()=>s.value||l.unref(n)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||r.value||"")},tu=n=>{const e=qp("disabled"),t=l.inject(eu,void 0);return l.computed(()=>e.value||l.unref(n)||(t==null?void 0:t.disabled)||!1)},Tg=()=>{const n=l.inject(eu,void 0),e=l.inject(Ta,void 0);return{form:n,formItem:e}},w_=(n,{formItemContext:e,disableIdGeneration:t,disableIdManagement:s})=>{t||(t=l.ref(!1)),s||(s=l.ref(!1));const r=l.ref();let i;const o=l.computed(()=>{var a;return!!(!(n.label||n.ariaLabel)&&e&&e.inputIds&&((a=e.inputIds)==null?void 0:a.length)<=1)});return l.onMounted(()=>{i=l.watch([l.toRef(n,"id"),t],([a,c])=>{const u=a??(c?void 0:Aa().value);u!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(s!=null&&s.value)&&!c&&u&&e.addInputId(u)),r.value=u)},{immediate:!0})}),l.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:o,inputId:r}};let dn;const x_=`
26
26
  height:0 !important;
27
27
  visibility:hidden !important;
28
28
  ${$v()?"":"overflow:hidden !important;"}
@@ -30,15 +30,15 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
30
30
  z-index:-1000 !important;
31
31
  top:0 !important;
32
32
  right:0 !important;
33
- `,v_=["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 C_(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),s=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:v_.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:t}}function Tg(n,e=1,t){var s;dn||(dn=document.createElement("textarea"),document.body.appendChild(dn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=C_(n);dn.setAttribute("style",`${a};${x_}`),dn.value=n.value||n.placeholder||"";let c=dn.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-r),dn.value="";const d=dn.scrollHeight-r;if(Ht(e)){let f=d*e;o==="border-box"&&(f=f+r+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(Ht(t)){let f=d*t;o==="border-box"&&(f=f+r+i),c=Math.min(f,c)}return u.height=`${c}px`,(s=dn.parentNode)==null||s.removeChild(dn),dn=void 0,u}const S_=et({id:{type:String,default:void 0},size:Kc,disabled:Boolean,modelValue:{type:he([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:he([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:zi},prefixIcon:{type:zi},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:he([Object,Array,String]),default:()=>Hp({})},autofocus:Boolean,rows:{type:Number,default:2},...Zc(["ariaLabel"])}),E_={[Bc]:n=>sn(n),input:n=>sn(n),change:n=>sn(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},O_=l.defineComponent({name:"ElInput",inheritAttrs:!1}),M_=l.defineComponent({...O_,props:S_,emits:E_,setup(n,{expose:e,emit:t}){const s=n,r=l.useAttrs(),i=l.useSlots(),o=l.computed(()=>{const W={};return s.containerRole==="combobox"&&(W["aria-haspopup"]=r["aria-haspopup"],W["aria-owns"]=r["aria-owns"],W["aria-expanded"]=r["aria-expanded"]),W}),a=l.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(p.value),m.is("disabled",g.value),m.is("exceed",U.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&&te.value,[m.b("hidden")]:s.type==="hidden"},r.class]),c=l.computed(()=>[m.e("wrapper"),m.is("focus",A.value)]),u=NN({excludeKeys:l.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=_g(),{inputId:h}=w_(s,{formItemContext:f}),p=Ag(),g=tu(),m=bt("input"),y=bt("textarea"),b=l.shallowRef(),w=l.shallowRef(),x=l.ref(!1),v=l.ref(!1),C=l.ref(),E=l.shallowRef(s.inputStyle),S=l.computed(()=>b.value||w.value),{wrapperRef:O,isFocused:A,handleFocus:k,handleBlur:_}=l_(S,{beforeFocus(){return g.value},afterBlur(){var W;s.validateEvent&&((W=f==null?void 0:f.validate)==null||W.call(f,"blur").catch(Pe=>Tt(Pe)))}}),V=l.computed(()=>{var W;return(W=d==null?void 0:d.statusIcon)!=null?W:!1}),L=l.computed(()=>(f==null?void 0:f.validateState)||""),B=l.computed(()=>L.value&&vN[L.value]),N=l.computed(()=>v.value?bN:fN),P=l.computed(()=>[r.style]),T=l.computed(()=>[s.inputStyle,E.value,{resize:s.resize}]),j=l.computed(()=>ma(s.modelValue)?"":String(s.modelValue)),Y=l.computed(()=>s.clearable&&!g.value&&!s.readonly&&!!j.value&&(A.value||x.value)),te=l.computed(()=>s.showPassword&&!g.value&&!!j.value&&(!!j.value||A.value)),z=l.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!g.value&&!s.readonly&&!s.showPassword),I=l.computed(()=>j.value.length),U=l.computed(()=>!!z.value&&I.value>Number(s.maxlength)),F=l.computed(()=>!!i.suffix||!!s.suffixIcon||Y.value||s.showPassword||z.value||!!L.value&&V.value),[D,q]=o_(b);Rh(w,W=>{if(Z(),!z.value||s.resize!=="both")return;const Pe=W[0],{width:ss}=Pe.contentRect;C.value={right:`calc(100% - ${ss+15+6}px)`}});const J=()=>{const{type:W,autosize:Pe}=s;if(!(!We||W!=="textarea"||!w.value))if(Pe){const ss=xr(Pe)?Pe.minRows:void 0,Eo=xr(Pe)?Pe.maxRows:void 0,x0=Tg(w.value,ss,Eo);E.value={overflowY:"hidden",...x0},l.nextTick(()=>{w.value.offsetHeight,E.value=x0})}else E.value={minHeight:Tg(w.value).minHeight}},Z=(W=>{let Pe=!1;return()=>{var ss;if(Pe||!s.autosize)return;((ss=w.value)==null?void 0:ss.offsetParent)===null||(W(),Pe=!0)}})(J),fe=()=>{const W=S.value,Pe=s.formatter?s.formatter(j.value):j.value;!W||W.value===Pe||(W.value=Pe)},Ze=async W=>{D();let{value:Pe}=W.target;if(s.formatter&&(Pe=s.parser?s.parser(Pe):Pe),!Me.value){if(Pe===j.value){fe();return}t(Bc,Pe),t("input",Pe),await l.nextTick(),fe(),q()}},yt=W=>{t("change",W.target.value)},{isComposing:Me,handleCompositionStart:ne,handleCompositionUpdate:xt,handleCompositionEnd:Zt}=c_({emit:t,afterComposition:Ze}),Ds=()=>{v.value=!v.value,ur()},ur=async()=>{var W;await l.nextTick(),(W=S.value)==null||W.focus()},So=()=>{var W;return(W=S.value)==null?void 0:W.blur()},xn=W=>{x.value=!1,t("mouseleave",W)},le=W=>{x.value=!0,t("mouseenter",W)},At=W=>{t("keydown",W)},Nl=()=>{var W;(W=S.value)==null||W.select()},bi=()=>{t(Bc,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>s.modelValue,()=>{var W;l.nextTick(()=>J()),s.validateEvent&&((W=f==null?void 0:f.validate)==null||W.call(f,"change").catch(Pe=>Tt(Pe)))}),l.watch(j,()=>fe()),l.watch(()=>s.type,async()=>{await l.nextTick(),fe(),J()}),l.onMounted(()=>{!s.formatter&&s.parser&&Tt("ElInput","If you set the parser, you also need to set the formatter."),fe(),l.nextTick(J)}),e({input:b,textarea:w,ref:S,textareaStyle:T,autosize:l.toRef(s,"autosize"),isComposing:Me,focus:ur,blur:So,select:Nl,clear:bi,resizeTextarea:J}),(W,Pe)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(o),{class:[l.unref(a),{[l.unref(m).bm("group","append")]:W.$slots.append,[l.unref(m).bm("group","prepend")]:W.$slots.prepend}],style:l.unref(P),role:W.containerRole,onMouseenter:le,onMouseleave:xn}),[l.createCommentVNode(" input "),W.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),W.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(m).be("group","prepend"))},[l.renderSlot(W.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:O,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),W.$slots.prefix||W.prefixIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(l.unref(m).e("prefix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("prefix-inner"))},[l.renderSlot(W.$slots,"prefix"),W.prefixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(W.prefixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("input",l.mergeProps({id:l.unref(h),ref_key:"input",ref:b,class:l.unref(m).e("inner")},l.unref(u),{minlength:W.minlength,maxlength:W.maxlength,type:W.showPassword?v.value?"text":"password":W.type,disabled:l.unref(g),readonly:W.readonly,autocomplete:W.autocomplete,tabindex:W.tabindex,"aria-label":W.ariaLabel,placeholder:W.placeholder,style:W.inputStyle,form:W.form,autofocus:W.autofocus,onCompositionstart:l.unref(ne),onCompositionupdate:l.unref(xt),onCompositionend:l.unref(Zt),onInput:Ze,onChange:yt,onKeydown:At}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(F)?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(l.unref(m).e("suffix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("suffix-inner"))},[!l.unref(Y)||!l.unref(te)||!l.unref(z)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(W.$slots,"suffix"),W.suffixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(W.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(Y)?(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("clear")]),onMousedown:l.withModifiers(l.unref(ls),["prevent"]),onClick:bi},{default:l.withCtx(()=>[l.createVNode(l.unref(Lp))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(te)?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("password")]),onClick:Ds},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(N))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(z)?(l.openBlock(),l.createElementBlock("span",{key:3,class:l.normalizeClass(l.unref(m).e("count"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("count-inner"))},l.toDisplayString(l.unref(I))+" / "+l.toDisplayString(W.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(L)&&l.unref(B)&&l.unref(V)?(l.openBlock(),l.createBlock(l.unref(An),{key:4,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("validateIcon"),l.unref(m).is("loading",l.unref(L)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(B))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),W.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(m).be("group","append"))},[l.renderSlot(W.$slots,"append")],2)):l.createCommentVNode("v-if",!0)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" textarea "),l.createElementVNode("textarea",l.mergeProps({id:l.unref(h),ref_key:"textarea",ref:w,class:[l.unref(y).e("inner"),l.unref(m).is("focus",l.unref(A))]},l.unref(u),{minlength:W.minlength,maxlength:W.maxlength,tabindex:W.tabindex,disabled:l.unref(g),readonly:W.readonly,autocomplete:W.autocomplete,style:l.unref(T),"aria-label":W.ariaLabel,placeholder:W.placeholder,form:W.form,autofocus:W.autofocus,rows:W.rows,onCompositionstart:l.unref(ne),onCompositionupdate:l.unref(xt),onCompositionend:l.unref(Zt),onInput:Ze,onFocus:l.unref(k),onBlur:l.unref(_),onChange:yt,onKeydown:At}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),l.unref(z)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(C.value),class:l.normalizeClass(l.unref(m).e("count"))},l.toDisplayString(l.unref(I))+" / "+l.toDisplayString(W.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var P_=pt(M_,[["__file","input.vue"]]);const N_=Us(P_),nu=Symbol("popper"),kg=Symbol("popperContent"),Vg=et({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),A_=l.defineComponent({name:"ElPopper",inheritAttrs:!1}),__=l.defineComponent({...A_,props:Vg,setup(n,{expose:e}){const t=n,s=l.ref(),r=l.ref(),i=l.ref(),o=l.ref(),a=l.computed(()=>t.role),c={triggerRef:s,popperInstanceRef:r,contentRef:i,referenceRef:o,role:a};return e(c),l.provide(nu,c),(u,d)=>l.renderSlot(u.$slots,"default")}});var T_=pt(__,[["__file","popper.vue"]]);const Dg=et({arrowOffset:{type:Number,default:5}}),k_=l.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),V_=l.defineComponent({...k_,props:Dg,setup(n,{expose:e}){const t=n,s=bt("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=l.inject(kg,void 0);return l.watch(()=>t.arrowOffset,a=>{r.value=a}),l.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(a,c)=>(l.openBlock(),l.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:l.normalizeClass(l.unref(s).e("arrow")),style:l.normalizeStyle(l.unref(o)),"data-popper-arrow":""},null,6))}});var D_=pt(V_,[["__file","arrow.vue"]]);const su="ElOnlyChild",R_=l.defineComponent({name:su,setup(n,{slots:e,attrs:t}){var s;const r=l.inject(bg),i=i_((s=r==null?void 0:r.setForwardRef)!=null?s:ls);return()=>{var o;const a=(o=e.default)==null?void 0:o.call(e,t);if(!a)return null;if(a.length>1)return Tt(su,"requires exact only one valid child."),null;const c=Rg(a);return c?l.withDirectives(l.cloneVNode(c,t),[[i]]):(Tt(su,"no valid child node found"),null)}}});function Rg(n){if(!n)return null;const e=n;for(const t of e){if(xr(t))switch(t.type){case l.Comment:continue;case l.Text:case"svg":return Ig(t);case l.Fragment:return Rg(t.children);default:return t}return Ig(t)}return null}function Ig(n){const e=bt("only-child");return l.createVNode("span",{class:e.e("content")},[n])}const Lg=et({virtualRef:{type:he(Object)},virtualTriggering:Boolean,onMouseenter:{type:he(Function)},onMouseleave:{type:he(Function)},onClick:{type:he(Function)},onKeydown:{type:he(Function)},onFocus:{type:he(Function)},onBlur:{type:he(Function)},onContextmenu:{type:he(Function)},id:String,open:Boolean}),I_=l.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),L_=l.defineComponent({...I_,props:Lg,setup(n,{expose:e}){const t=n,{role:s,triggerRef:r}=l.inject(nu,void 0);r_(r);const i=l.computed(()=>a.value?t.id:void 0),o=l.computed(()=>{if(s&&s.value==="tooltip")return t.open&&t.id?t.id:void 0}),a=l.computed(()=>{if(s&&s.value!=="tooltip")return s.value}),c=l.computed(()=>a.value?`${t.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return l.onMounted(()=>{l.watch(()=>t.virtualRef,f=>{f&&(r.value=as(f))},{immediate:!0}),l.watch(r,(f,h)=>{u==null||u(),u=void 0,qn(f)&&(d.forEach(p=>{var g;const m=t[p];m&&(f.addEventListener(p.slice(2).toLowerCase(),m),(g=h==null?void 0:h.removeEventListener)==null||g.call(h,p.slice(2).toLowerCase(),m))}),u=l.watch([i,o,a,c],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((g,m)=>{ma(p[m])?f.removeAttribute(g):f.setAttribute(g,p[m])})},{immediate:!0})),qn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>h.removeAttribute(p))},{immediate:!0})}),l.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,r.value&&qn(r.value)){const f=r.value;d.forEach(h=>{const p=t[h];p&&f.removeEventListener(h.slice(2).toLowerCase(),p)}),r.value=void 0}}),e({triggerRef:r}),(f,h)=>f.virtualTriggering?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock(l.unref(R_),l.mergeProps({key:0},f.$attrs,{"aria-controls":l.unref(i),"aria-describedby":l.unref(o),"aria-expanded":l.unref(c),"aria-haspopup":l.unref(a)}),{default:l.withCtx(()=>[l.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var B_=pt(L_,[["__file","trigger.vue"]]);const ru="focus-trap.focus-after-trapped",iu="focus-trap.focus-after-released",j_="focus-trap.focusout-prevented",Bg={cancelable:!0,bubbles:!1},$_={cancelable:!0,bubbles:!1},jg="focusAfterTrapped",$g="focusAfterReleased",z_=Symbol("elFocusTrap"),ou=l.ref(),ka=l.ref(0),au=l.ref(0);let Va=0;const zg=n=>{const e=[],t=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(;t.nextNode();)e.push(t.currentNode);return e},Fg=(n,e)=>{for(const t of n)if(!F_(t,e))return t},F_=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},U_=n=>{const e=zg(n),t=Fg(e,n),s=Fg(e.reverse(),n);return[t,s]},H_=n=>n instanceof HTMLInputElement&&"select"in n,hs=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),au.value=window.performance.now(),n!==t&&H_(n)&&e&&n.select()}};function Ug(n,e){const t=[...n],s=n.indexOf(e);return s!==-1&&t.splice(s,1),t}const G_=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=Ug(n,s),n.unshift(s)},remove:s=>{var r,i;n=Ug(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},W_=(n,e=!1)=>{const t=document.activeElement;for(const s of n)if(hs(s,e),document.activeElement!==t)return},Hg=G_(),Y_=()=>ka.value>au.value,Da=()=>{ou.value="pointer",ka.value=window.performance.now()},Gg=()=>{ou.value="keyboard",ka.value=window.performance.now()},q_=()=>(l.onMounted(()=>{Va===0&&(document.addEventListener("mousedown",Da),document.addEventListener("touchstart",Da),document.addEventListener("keydown",Gg)),Va++}),l.onBeforeUnmount(()=>{Va--,Va<=0&&(document.removeEventListener("mousedown",Da),document.removeEventListener("touchstart",Da),document.removeEventListener("keydown",Gg))}),{focusReason:ou,lastUserFocusTimestamp:ka,lastAutomatedFocusTimestamp:au}),Ra=n=>new CustomEvent(j_,{...$_,detail:n}),X_=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[jg,$g,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=l.ref();let s,r;const{focusReason:i}=q_();QA(g=>{n.trapped&&!o.paused&&e("release-requested",g)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=g=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:m,altKey:y,ctrlKey:b,metaKey:w,currentTarget:x,shiftKey:v}=g,{loop:C}=n,E=m===Tr.tab&&!y&&!b&&!w,S=document.activeElement;if(E&&S){const O=x,[A,k]=U_(O);if(A&&k){if(!v&&S===k){const V=Ra({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),C&&hs(A,!0))}else if(v&&[A,O].includes(S)){const V=Ra({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),C&&hs(k,!0))}}else if(S===O){const V=Ra({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||g.preventDefault()}}};l.provide(z_,{focusTrapRef:t,onKeydown:a}),l.watch(()=>n.focusTrapEl,g=>{g&&(t.value=g)},{immediate:!0}),l.watch([t],([g],[m])=>{g&&(g.addEventListener("keydown",a),g.addEventListener("focusin",d),g.addEventListener("focusout",f)),m&&(m.removeEventListener("keydown",a),m.removeEventListener("focusin",d),m.removeEventListener("focusout",f))});const c=g=>{e(jg,g)},u=g=>e($g,g),d=g=>{const m=l.unref(t);if(!m)return;const y=g.target,b=g.relatedTarget,w=y&&m.contains(y);n.trapped||b&&m.contains(b)||(s=b),w&&e("focusin",g),!o.paused&&n.trapped&&(w?r=y:hs(r,!0))},f=g=>{const m=l.unref(t);if(!(o.paused||!m))if(n.trapped){const y=g.relatedTarget;!ma(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=Ra({focusReason:i.value});e("focusout-prevented",b),b.defaultPrevented||hs(r,!0)}},0)}else{const y=g.target;y&&m.contains(y)||e("focusout",g)}};async function h(){await l.nextTick();const g=l.unref(t);if(g){Hg.push(o);const m=g.contains(document.activeElement)?s:document.activeElement;if(s=m,!g.contains(m)){const b=new Event(ru,Bg);g.addEventListener(ru,c),g.dispatchEvent(b),b.defaultPrevented||l.nextTick(()=>{let w=n.focusStartEl;sn(w)||(hs(w),document.activeElement!==w&&(w="first")),w==="first"&&W_(zg(g),!0),(document.activeElement===m||w==="container")&&hs(g)})}}}function p(){const g=l.unref(t);if(g){g.removeEventListener(ru,c);const m=new CustomEvent(iu,{...Bg,detail:{focusReason:i.value}});g.addEventListener(iu,u),g.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!Y_()||g.contains(document.activeElement))&&hs(s??document.body),g.removeEventListener(iu,u),Hg.remove(o)}}return l.onMounted(()=>{n.trapped&&h(),l.watch(()=>n.trapped,g=>{g?h():p()})}),l.onBeforeUnmount(()=>{n.trapped&&p(),t.value&&(t.value.removeEventListener("keydown",a),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",f),t.value=void 0)}),{onKeydown:a}}});function J_(n,e,t,s,r,i){return l.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Wg=pt(X_,[["render",J_],["__file","focus-trap.vue"]]);const K_=["fixed","absolute"],Z_=et({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:he(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:$c,default:"bottom"},popperOptions:{type:he(Object),default:()=>({})},strategy:{type:String,values:K_,default:"absolute"}}),Yg=et({...Z_,id:String,style:{type:he([String,Array,Object])},className:{type:he([String,Array,Object])},effect:{type:he(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:he([String,Array,Object])},popperStyle:{type:he([String,Array,Object])},referenceEl:{type:he(Object)},triggerTargetEl:{type:he(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Zc(["ariaLabel"])}),Q_={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},eT=(n,e=[])=>{const{placement:t,strategy:s,popperOptions:r}=n,i={placement:t,strategy:s,...r,modifiers:[...nT(n),...e]};return sT(i,r==null?void 0:r.modifiers),i},tT=n=>{if(We)return as(n)};function nT(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:s}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:s}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function sT(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const rT=0,iT=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:s,role:r}=l.inject(nu,void 0),i=l.ref(),o=l.ref(),a=l.computed(()=>({name:"eventListeners",enabled:!!n.visible})),c=l.computed(()=>{var b;const w=l.unref(i),x=(b=l.unref(o))!=null?b:rT;return{name:"arrow",enabled:!PP(w),options:{element:w,padding:x}}}),u=l.computed(()=>({onFirstUpdate:()=>{g()},...eT(n,[l.unref(c),l.unref(a)])})),d=l.computed(()=>tT(n.referenceEl)||l.unref(s)),{attributes:f,state:h,styles:p,update:g,forceUpdate:m,instanceRef:y}=JA(d,t,u);return l.watch(y,b=>e.value=b),l.onMounted(()=>{l.watch(()=>{var b;return(b=l.unref(d))==null?void 0:b.getBoundingClientRect()},()=>{g()})}),{attributes:f,arrowRef:i,contentRef:t,instanceRef:y,state:h,styles:p,role:r,forceUpdate:m,update:g}},oT=(n,{attributes:e,styles:t,role:s})=>{const{nextZIndex:r}=Eg(),i=bt("popper"),o=l.computed(()=>l.unref(e).popper),a=l.ref(Ht(n.zIndex)?n.zIndex:r()),c=l.computed(()=>[i.b(),i.is("pure",n.pure),i.is(n.effect),n.popperClass]),u=l.computed(()=>[{zIndex:l.unref(a)},l.unref(t).popper,n.popperStyle||{}]),d=l.computed(()=>s.value==="dialog"?"false":void 0),f=l.computed(()=>l.unref(t).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=Ht(n.zIndex)?n.zIndex:r()}}},aT=(n,e)=>{const t=l.ref(!1),s=l.ref();return{focusStartRef:s,trapped:t,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(s.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{n.visible&&!t.value&&(u.target&&(s.value=u.target),t.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},lT=l.defineComponent({name:"ElPopperContent"}),cT=l.defineComponent({...lT,props:Yg,emits:Q_,setup(n,{expose:e,emit:t}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=aT(s,t),{attributes:f,arrowRef:h,contentRef:p,styles:g,instanceRef:m,role:y,update:b}=iT(s),{ariaModal:w,arrowStyle:x,contentAttrs:v,contentClass:C,contentStyle:E,updateZIndex:S}=oT(s,{styles:g,attributes:f,role:y}),O=l.inject(Ta,void 0),A=l.ref();l.provide(kg,{arrowStyle:x,arrowRef:h,arrowOffset:A}),O&&l.provide(Ta,{...O,addInputId:ls,removeInputId:ls});let k;const _=(L=!0)=>{b(),L&&S()},V=()=>{_(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return l.onMounted(()=>{l.watch(()=>s.triggerTargetEl,(L,B)=>{k==null||k(),k=void 0;const N=l.unref(L||p.value),P=l.unref(B||p.value);qn(N)&&(k=l.watch([y,()=>s.ariaLabel,w,()=>s.id],T=>{["role","aria-label","aria-modal","id"].forEach((j,Y)=>{ma(T[Y])?N.removeAttribute(j):N.setAttribute(j,T[Y])})},{immediate:!0})),P!==N&&qn(P)&&["role","aria-label","aria-modal","id"].forEach(T=>{P.removeAttribute(T)})},{immediate:!0}),l.watch(()=>s.visible,V,{immediate:!0})}),l.onBeforeUnmount(()=>{k==null||k(),k=void 0}),e({popperContentRef:p,popperInstanceRef:m,updatePopper:_,contentStyle:E}),(L,B)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({ref_key:"contentRef",ref:p},l.unref(v),{style:l.unref(E),class:l.unref(C),tabindex:"-1",onMouseenter:N=>L.$emit("mouseenter",N),onMouseleave:N=>L.$emit("mouseleave",N)}),[l.createVNode(l.unref(Wg),{trapped:l.unref(i),"trap-on-focus-in":!0,"focus-trap-el":l.unref(p),"focus-start-el":l.unref(r),onFocusAfterTrapped:l.unref(a),onFocusAfterReleased:l.unref(o),onFocusin:l.unref(c),onFocusoutPrevented:l.unref(u),onReleaseRequested:l.unref(d)},{default:l.withCtx(()=>[l.renderSlot(L.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var uT=pt(cT,[["__file","content.vue"]]);const dT=Us(T_),lu=Symbol("elTooltip"),qg=et({...n_,...Yg,appendTo:{type:he([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:he(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Zc(["ariaLabel"])}),Xg=et({...Lg,disabled:Boolean,trigger:{type:he([String,Array]),default:"hover"},triggerKeys:{type:he(Array),default:()=>[Tr.enter,Tr.space]}}),{useModelToggleProps:hT,useModelToggleEmits:fT,useModelToggle:pT}=$N("visible"),gT=et({...Vg,...hT,...qg,...Xg,...Dg,showArrow:{type:Boolean,default:!0}}),mT=[...fT,"before-show","before-hide","show","hide","open","close"],yT=(n,e)=>Fv(n)?n.includes(e):n===e,Lr=(n,e,t)=>s=>{yT(l.unref(n),e)&&t(s)},bT=l.defineComponent({name:"ElTooltipTrigger"}),wT=l.defineComponent({...bT,props:Xg,setup(n,{expose:e}){const t=n,s=bt("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:c,onToggle:u}=l.inject(lu,void 0),d=l.ref(null),f=()=>{if(l.unref(r)||t.disabled)return!0},h=l.toRef(t,"trigger"),p=Hn(f,Lr(h,"hover",a)),g=Hn(f,Lr(h,"hover",c)),m=Hn(f,Lr(h,"click",v=>{v.button===0&&u(v)})),y=Hn(f,Lr(h,"focus",a)),b=Hn(f,Lr(h,"focus",c)),w=Hn(f,Lr(h,"contextmenu",v=>{v.preventDefault(),u(v)})),x=Hn(f,v=>{const{code:C}=v;t.triggerKeys.includes(C)&&(v.preventDefault(),u(v))});return e({triggerRef:d}),(v,C)=>(l.openBlock(),l.createBlock(l.unref(B_),{id:l.unref(i),"virtual-ref":v.virtualRef,open:l.unref(o),"virtual-triggering":v.virtualTriggering,class:l.normalizeClass(l.unref(s).e("trigger")),onBlur:l.unref(b),onClick:l.unref(m),onContextmenu:l.unref(w),onFocus:l.unref(y),onMouseenter:l.unref(p),onMouseleave:l.unref(g),onKeydown:l.unref(x)},{default:l.withCtx(()=>[l.renderSlot(v.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var xT=pt(wT,[["__file","trigger.vue"]]);const vT=et({to:{type:he([String,Object]),required:!0},disabled:Boolean});var CT=pt(l.defineComponent({__name:"teleport",props:vT,setup(n){return(e,t)=>e.disabled?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(),l.createBlock(l.Teleport,{key:1,to:e.to},[l.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const ST=Us(CT),ET=l.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),OT=l.defineComponent({...ET,props:qg,setup(n,{expose:e}){const t=n,{selector:s}=yg(),r=bt("tooltip"),i=l.ref(null);let o;const{controlled:a,id:c,open:u,trigger:d,onClose:f,onOpen:h,onShow:p,onHide:g,onBeforeShow:m,onBeforeHide:y}=l.inject(lu,void 0),b=l.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),w=l.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);l.onBeforeUnmount(()=>{o==null||o()});const x=l.computed(()=>l.unref(w)?!0:l.unref(u)),v=l.computed(()=>t.disabled?!1:l.unref(u)),C=l.computed(()=>t.appendTo||s.value),E=l.computed(()=>{var P;return(P=t.style)!=null?P:{}}),S=l.ref(!0),O=()=>{g(),S.value=!0},A=()=>{if(l.unref(a))return!0},k=Hn(A,()=>{t.enterable&&l.unref(d)==="hover"&&h()}),_=Hn(A,()=>{l.unref(d)==="hover"&&f()}),V=()=>{var P,T;(T=(P=i.value)==null?void 0:P.updatePopper)==null||T.call(P),m==null||m()},L=()=>{y==null||y()},B=()=>{p(),o=Tv(l.computed(()=>{var P;return(P=i.value)==null?void 0:P.popperContentRef}),()=>{if(l.unref(a))return;l.unref(d)!=="hover"&&f()})},N=()=>{t.virtualTriggering||f()};return l.watch(()=>l.unref(u),P=>{P?S.value=!1:o==null||o()},{flush:"post"}),l.watch(()=>t.content,()=>{var P,T;(T=(P=i.value)==null?void 0:P.updatePopper)==null||T.call(P)}),e({contentRef:i}),(P,T)=>(l.openBlock(),l.createBlock(l.unref(ST),{disabled:!P.teleported,to:l.unref(C)},{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(b),onAfterLeave:O,onBeforeEnter:V,onAfterEnter:B,onBeforeLeave:L},{default:l.withCtx(()=>[l.unref(x)?l.withDirectives((l.openBlock(),l.createBlock(l.unref(uT),l.mergeProps({key:0,id:l.unref(c),ref_key:"contentRef",ref:i},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":S.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,l.unref(E)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:l.unref(v),"z-index":P.zIndex,onMouseenter:l.unref(k),onMouseleave:l.unref(_),onBlur:N,onClose:l.unref(f)}),{default:l.withCtx(()=>[l.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"])),[[l.vShow,l.unref(v)]]):l.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var MT=pt(OT,[["__file","content.vue"]]);const PT=l.defineComponent({name:"ElTooltip"}),NT=l.defineComponent({...PT,props:gT,emits:mT,setup(n,{expose:e,emit:t}){const s=n;t_();const r=Aa(),i=l.ref(),o=l.ref(),a=()=>{var b;const w=l.unref(i);w&&((b=w.popperInstanceRef)==null||b.update())},c=l.ref(!1),u=l.ref(),{show:d,hide:f,hasUpdateHandler:h}=pT({indicator:c,toggleReason:u}),{onOpen:p,onClose:g}=s_({showAfter:l.toRef(s,"showAfter"),hideAfter:l.toRef(s,"hideAfter"),autoClose:l.toRef(s,"autoClose"),open:d,close:f}),m=l.computed(()=>ya(s.visible)&&!h.value);l.provide(lu,{controlled:m,id:r,open:l.readonly(c),trigger:l.toRef(s,"trigger"),onOpen:b=>{p(b)},onClose:b=>{g(b)},onToggle:b=>{l.unref(c)?g(b):p(b)},onShow:()=>{t("show",u.value)},onHide:()=>{t("hide",u.value)},onBeforeShow:()=>{t("before-show",u.value)},onBeforeHide:()=>{t("before-hide",u.value)},updatePopper:a}),l.watch(()=>s.disabled,b=>{b&&c.value&&(c.value=!1)});const y=b=>{var w,x;const v=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,C=(b==null?void 0:b.relatedTarget)||document.activeElement;return v&&v.contains(C)};return l.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:a,onOpen:p,onClose:g,hide:f}),(b,w)=>(l.openBlock(),l.createBlock(l.unref(dT),{ref_key:"popperRef",ref:i,role:b.role},{default:l.withCtx(()=>[l.createVNode(xT,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:l.withCtx(()=>[b.$slots.default?l.renderSlot(b.$slots,"default",{key:0}):l.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),l.createVNode(MT,{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:l.withCtx(()=>[l.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(l.openBlock(),l.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(l.openBlock(),l.createElementBlock("span",{key:1},l.toDisplayString(b.content),1))]),b.showArrow?(l.openBlock(),l.createBlock(l.unref(D_),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):l.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 AT=pt(NT,[["__file","tooltip.vue"]]);const Jg=Us(AT),_T=et({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:he([String,Object,Array])},offset:{type:he(Array),default:[0,0]},badgeClass:{type:String}}),TT=l.defineComponent({name:"ElBadge"}),kT=l.defineComponent({...TT,props:_T,setup(n,{expose:e}){const t=n,s=bt("badge"),r=l.computed(()=>t.isDot?"":Ht(t.value)&&Ht(t.max)?t.max<t.value?`${t.max}+`:`${t.value}`:`${t.value}`),i=l.computed(()=>{var o,a,c,u,d;return[{backgroundColor:t.color,marginRight:$i(-((a=(o=t.offset)==null?void 0:o[0])!=null?a:0)),marginTop:$i((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:r}),(o,a)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(s).b())},[l.renderSlot(o.$slots,"default"),l.createVNode(l.Transition,{name:`${l.unref(s).namespace.value}-zoom-in-center`,persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("sup",{class:l.normalizeClass([l.unref(s).e("content"),l.unref(s).em("content",o.type),l.unref(s).is("fixed",!!o.$slots.default),l.unref(s).is("dot",o.isDot),l.unref(s).is("hide-zero",!o.showZero&&t.value===0),o.badgeClass]),style:l.normalizeStyle(l.unref(i)),textContent:l.toDisplayString(l.unref(r))},null,14,["textContent"]),[[l.vShow,!o.hidden&&(l.unref(r)||o.isDot)]])]),_:1},8,["name"])],2))}});var VT=pt(kT,[["__file","badge.vue"]]);const DT=Us(VT),Kg=Symbol("buttonGroupContextKey"),RT=(n,e)=>{AN({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},l.computed(()=>n.type==="text"));const t=l.inject(Kg,void 0),s=Qc("button"),{form:r}=_g(),i=Ag(l.computed(()=>t==null?void 0:t.size)),o=tu(),a=l.ref(),c=l.useSlots(),u=l.computed(()=>n.type||(t==null?void 0:t.type)||""),d=l.computed(()=>{var g,m,y;return(y=(m=n.autoInsertSpace)!=null?m:(g=s.value)==null?void 0:g.autoInsertSpace)!=null?y:!1}),f=l.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),h=l.computed(()=>{var g;const m=(g=c.default)==null?void 0:g.call(c);if(d.value&&(m==null?void 0:m.length)===1){const y=m[0];if((y==null?void 0:y.type)===l.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:h,handleClick:g=>{if(o.value||n.loading){g.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",g)}}},cu=et({size:Kc,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:zi},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:zi,default:()=>wa},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:he([String,Object]),default:"button"}}),IT={click:n=>n instanceof MouseEvent};function ct(n,e){LT(n)&&(n="100%");var t=BT(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function Ia(n){return Math.min(1,Math.max(0,n))}function LT(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function BT(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Zg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function La(n){return n<=1?"".concat(Number(n)*100,"%"):n}function qs(n){return n.length===1?"0"+n:String(n)}function jT(n,e,t){return{r:ct(n,255)*255,g:ct(e,255)*255,b:ct(t,255)*255}}function Qg(n,e,t){n=ct(n,255),e=ct(e,255),t=ct(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=0,a=(s+r)/2;if(s===r)o=0,i=0;else{var c=s-r;switch(o=a>.5?c/(2-s-r):c/(s+r),s){case n:i=(e-t)/c+(e<t?6:0);break;case e:i=(t-n)/c+2;break;case t:i=(n-e)/c+4;break}i/=6}return{h:i,s:o,l:a}}function uu(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function $T(n,e,t){var s,r,i;if(n=ct(n,360),e=ct(e,100),t=ct(t,100),e===0)r=t,i=t,s=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;s=uu(a,o,n+1/3),r=uu(a,o,n),i=uu(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function em(n,e,t){n=ct(n,255),e=ct(e,255),t=ct(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=s,a=s-r,c=s===0?0:a/s;if(s===r)i=0;else{switch(s){case n:i=(e-t)/a+(e<t?6:0);break;case e:i=(t-n)/a+2;break;case t:i=(n-e)/a+4;break}i/=6}return{h:i,s:c,v:o}}function zT(n,e,t){n=ct(n,360)*6,e=ct(e,100),t=ct(t,100);var s=Math.floor(n),r=n-s,i=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),c=s%6,u=[t,o,i,i,a,t][c],d=[a,t,t,o,i,i][c],f=[i,i,a,t,t,o][c];return{r:u*255,g:d*255,b:f*255}}function tm(n,e,t,s){var r=[qs(Math.round(n).toString(16)),qs(Math.round(e).toString(16)),qs(Math.round(t).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 FT(n,e,t,s,r){var i=[qs(Math.round(n).toString(16)),qs(Math.round(e).toString(16)),qs(Math.round(t).toString(16)),qs(UT(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 UT(n){return Math.round(parseFloat(n)*255).toString(16)}function nm(n){return Dt(n)/255}function Dt(n){return parseInt(n,16)}function HT(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var du={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 GT(n){var e={r:0,g:0,b:0},t=1,s=null,r=null,i=null,o=!1,a=!1;return typeof n=="string"&&(n=qT(n)),typeof n=="object"&&(Xn(n.r)&&Xn(n.g)&&Xn(n.b)?(e=jT(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Xn(n.h)&&Xn(n.s)&&Xn(n.v)?(s=La(n.s),r=La(n.v),e=zT(n.h,s,r),o=!0,a="hsv"):Xn(n.h)&&Xn(n.s)&&Xn(n.l)&&(s=La(n.s),i=La(n.l),e=$T(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Zg(t),{ok:o,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var WT="[-\\+]?\\d+%?",YT="[-\\+]?\\d*\\.\\d+%?",fs="(?:".concat(YT,")|(?:").concat(WT,")"),hu="[\\s|\\(]+(".concat(fs,")[,|\\s]+(").concat(fs,")[,|\\s]+(").concat(fs,")\\s*\\)?"),fu="[\\s|\\(]+(".concat(fs,")[,|\\s]+(").concat(fs,")[,|\\s]+(").concat(fs,")[,|\\s]+(").concat(fs,")\\s*\\)?"),hn={CSS_UNIT:new RegExp(fs),rgb:new RegExp("rgb"+hu),rgba:new RegExp("rgba"+fu),hsl:new RegExp("hsl"+hu),hsla:new RegExp("hsla"+fu),hsv:new RegExp("hsv"+hu),hsva:new RegExp("hsva"+fu),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 qT(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(du[n])n=du[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=hn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=hn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=hn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=hn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=hn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=hn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=hn.hex8.exec(n),t?{r:Dt(t[1]),g:Dt(t[2]),b:Dt(t[3]),a:nm(t[4]),format:e?"name":"hex8"}:(t=hn.hex6.exec(n),t?{r:Dt(t[1]),g:Dt(t[2]),b:Dt(t[3]),format:e?"name":"hex"}:(t=hn.hex4.exec(n),t?{r:Dt(t[1]+t[1]),g:Dt(t[2]+t[2]),b:Dt(t[3]+t[3]),a:nm(t[4]+t[4]),format:e?"name":"hex8"}:(t=hn.hex3.exec(n),t?{r:Dt(t[1]+t[1]),g:Dt(t[2]+t[2]),b:Dt(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Xn(n){return!!hn.CSS_UNIT.exec(String(n))}var XT=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var s;if(e instanceof n)return e;typeof e=="number"&&(e=HT(e)),this.originalInput=e;var r=GT(e);this.originalInput=e,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=t.format)!==null&&s!==void 0?s:r.format,this.gradientType=t.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 e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,s,r,i=e.r/255,o=e.g/255,a=e.b/255;return i<=.03928?t=i/12.92:t=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*t+.7152*s+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=Zg(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=em(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=em(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=Qg(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=Qg(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),tm(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),FT(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},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 e=Math.round(this.r),t=Math.round(this.g),s=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(s,")"):"rgba(".concat(e,", ").concat(t,", ").concat(s,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(ct(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(ct(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+tm(this.r,this.g,this.b,!1),t=0,s=Object.entries(du);t<s.length;t++){var r=s[t],i=r[0],o=r[1];if(e===o)return i}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var s=!1,r=this.a<1&&this.a>=0,i=!t&&r&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(s=this.toRgbString()),e==="prgb"&&(s=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(s=this.toHexString()),e==="hex3"&&(s=this.toHexString(!0)),e==="hex4"&&(s=this.toHex8String(!0)),e==="hex8"&&(s=this.toHex8String()),e==="name"&&(s=this.toName()),e==="hsl"&&(s=this.toHslString()),e==="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(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Ia(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Ia(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Ia(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Ia(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),s=(t.h+e)%360;return t.h=s<0?360+s:s,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var s=this.toRgb(),r=new n(e).toRgb(),i=t/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(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var s=this.toHsl(),r=360/t,i=[this];for(s.h=(s.h-(r*e>>1)+720)%360;--e;)s.h=(s.h+r)%360,i.push(new n(s));return i},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),s=t.h,r=t.s,i=t.v,o=[],a=1/e;e--;)o.push(new n({h:s,s:r,v:i})),i=(i+a)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),s=new n(e).toRgb(),r=t.a+s.a*(1-t.a);return new n({r:(t.r*t.a+s.r*s.a*(1-t.a))/r,g:(t.g*t.a+s.g*s.a*(1-t.a))/r,b:(t.b*t.a+s.b*s.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),s=t.h,r=[this],i=360/e,o=1;o<e;o++)r.push(new n({h:(s+o*i)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function ps(n,e=20){return n.mix("#141414",e).toString()}function JT(n){const e=tu(),t=bt("button");return l.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 XT(r),a=n.dark?o.tint(20).toString():ps(o,20);if(n.plain)s=t.cssVarBlock({"bg-color":n.dark?ps(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ps(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":a}),e.value&&(s[t.cssVarBlockName("disabled-bg-color")]=n.dark?ps(o,90):o.tint(90).toString(),s[t.cssVarBlockName("disabled-text-color")]=n.dark?ps(o,50):o.tint(50).toString(),s[t.cssVarBlockName("disabled-border-color")]=n.dark?ps(o,80):o.tint(80).toString());else{const c=n.dark?ps(o,30):o.tint(30).toString(),u=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(s=t.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":a,"active-border-color":a}),e.value){const d=n.dark?ps(o,50):o.tint(50).toString();s[t.cssVarBlockName("disabled-bg-color")]=d,s[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,s[t.cssVarBlockName("disabled-border-color")]=d}}}return s})}const KT=l.defineComponent({name:"ElButton"}),ZT=l.defineComponent({...KT,props:cu,emits:IT,setup(n,{expose:e,emit:t}){const s=n,r=JT(s),i=bt("button"),{_ref:o,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=RT(s,t),p=l.computed(()=>[i.b(),i.m(c.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 e({ref:o,size:a,type:c,disabled:u,shouldAddSpace:f}),(g,m)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.tag),l.mergeProps({ref_key:"_ref",ref:o},l.unref(d),{class:l.unref(p),style:l.unref(r),onClick:l.unref(h)}),{default:l.withCtx(()=>[g.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[g.$slots.loading?l.renderSlot(g.$slots,"loading",{key:0}):(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass(l.unref(i).is("loading"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.loadingIcon)))]),_:1},8,["class"]))],64)):g.icon||g.$slots.icon?(l.openBlock(),l.createBlock(l.unref(An),{key:1},{default:l.withCtx(()=>[g.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.icon),{key:0})):l.renderSlot(g.$slots,"icon",{key:1})]),_:3})):l.createCommentVNode("v-if",!0),g.$slots.default?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass({[l.unref(i).em("text","expand")]:l.unref(f)})},[l.renderSlot(g.$slots,"default")],2)):l.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var QT=pt(ZT,[["__file","button.vue"]]);const ek={size:cu.size,type:cu.type},tk=l.defineComponent({name:"ElButtonGroup"}),nk=l.defineComponent({...tk,props:ek,setup(n){const e=n;l.provide(Kg,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=bt("button");return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(s.$slots,"default")],2))}});var sm=pt(nk,[["__file","button-group.vue"]]);const sk=Us(QT,{ButtonGroup:sm});SN(sm);function rk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const pu="_trap-focus-children",Xs=[],rm=n=>{var e;if(Xs.length===0)return;const t=Xs[Xs.length-1][pu];if(t.length>0&&n.code===Tr.tab){if(t.length===1){n.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const s=n.shiftKey,r=n.target===t[0],i=n.target===t[t.length-1];if(r&&s&&(n.preventDefault(),t[t.length-1].focus()),i&&!s&&(n.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const o=t.indexOf(n.target);o!==-1&&((e=t[s?o-1:o+1])==null||e.focus())}}},ik={beforeMount(n){n[pu]=Nh(n),Xs.push(n),Xs.length<=1&&document.addEventListener("keydown",rm)},updated(n){l.nextTick(()=>{n[pu]=Nh(n)})},unmounted(){Xs.shift(),Xs.length===0&&document.removeEventListener("keydown",rm)}},ok=et({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:he([String,Array,Object])},zIndex:{type:he([String,Number])}}),ak={click:n=>n instanceof MouseEvent},lk="overlay";var ck=l.defineComponent({name:"ElOverlay",props:ok,emits:ak,setup(n,{slots:e,emit:t}){const s=bt(lk),r=c=>{t("click",c)},{onClick:i,onMousedown:o,onMouseup:a}=fg(n.customMaskEvent?void 0:r);return()=>n.mask?l.createVNode("div",{class:[s.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:i,onMousedown:o,onMouseup:a},[l.renderSlot(e,"default")],Ca.STYLE|Ca.CLASS|Ca.PROPS,["onClick","onMouseup","onMousedown"]):l.h("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[l.renderSlot(e,"default")])}});const uk=ck,im=["success","info","warning","error"],gt=Hp({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:We?document.body:void 0}),dk=et({customClass:{type:String,default:gt.customClass},center:{type:Boolean,default:gt.center},dangerouslyUseHTMLString:{type:Boolean,default:gt.dangerouslyUseHTMLString},duration:{type:Number,default:gt.duration},icon:{type:zi,default:gt.icon},id:{type:String,default:gt.id},message:{type:he([String,Object,Function]),default:gt.message},onClose:{type:he(Function),default:gt.onClose},showClose:{type:Boolean,default:gt.showClose},type:{type:String,values:im,default:gt.type},plain:{type:Boolean,default:gt.plain},offset:{type:Number,default:gt.offset},zIndex:{type:Number,default:gt.zIndex},grouping:{type:Boolean,default:gt.grouping},repeatNum:{type:Number,default:gt.repeatNum}}),hk={destroy:()=>!0},fn=l.shallowReactive([]),fk=n=>{const e=fn.findIndex(r=>r.id===n),t=fn[e];let s;return e>0&&(s=fn[e-1]),{current:t,prev:s}},pk=n=>{const{prev:e}=fk(n);return e?e.vm.exposed.bottom.value:0},gk=(n,e)=>fn.findIndex(s=>s.id===n)>0?16:e,mk=l.defineComponent({name:"ElMessage"}),yk=l.defineComponent({...mk,props:dk,emits:hk,setup(n,{expose:e}){const t=n,{Close:s}=Fp,{ns:r,zIndex:i}=Pg("message"),{currentZIndex:o,nextZIndex:a}=i,c=l.ref(),u=l.ref(!1),d=l.ref(0);let f;const h=l.computed(()=>t.type?t.type==="error"?"danger":t.type:"info"),p=l.computed(()=>{const S=t.type;return{[r.bm("icon",S)]:S&&va[S]}}),g=l.computed(()=>t.icon||va[t.type]||""),m=l.computed(()=>pk(t.id)),y=l.computed(()=>gk(t.id,t.offset)+m.value),b=l.computed(()=>d.value+y.value),w=l.computed(()=>({top:`${y.value}px`,zIndex:o.value}));function x(){t.duration!==0&&({stop:f}=_v(()=>{C()},t.duration))}function v(){f==null||f()}function C(){u.value=!1}function E({code:S}){S===Tr.esc&&C()}return l.onMounted(()=>{x(),a(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{v(),x()}),Gn(document,"keydown",E),Rh(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:b,close:C}),(S,O)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:S.onClose,onAfterLeave:A=>S.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:S.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(S.type)]:S.type},l.unref(r).is("center",S.center),l.unref(r).is("closable",S.showClose),l.unref(r).is("plain",S.plain),S.customClass]),style:l.normalizeStyle(l.unref(w)),role:"alert",onMouseenter:v,onMouseleave:x},[S.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(DT),{key:0,value:S.repeatNum,type:l.unref(h),class:l.normalizeClass(l.unref(r).e("badge"))},null,8,["value","type","class"])):l.createCommentVNode("v-if",!0),l.unref(g)?(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass([l.unref(r).e("icon"),l.unref(p)])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(g))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.renderSlot(S.$slots,"default",{},()=>[S.dangerouslyUseHTMLString?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),l.createElementVNode("p",{class:l.normalizeClass(l.unref(r).e("content")),innerHTML:S.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(S.message),3))]),S.showClose?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(C,["stop"])},{default:l.withCtx(()=>[l.createVNode(l.unref(s))]),_:1},8,["class","onClick"])):l.createCommentVNode("v-if",!0)],46,["id"]),[[l.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var bk=pt(yk,[["__file","message.vue"]]);let wk=1;const om=n=>{const e=!n||sn(n)||l.isVNode(n)||zt(n)?{message:n}:n,t={...gt,...e};if(!t.appendTo)t.appendTo=document.body;else if(sn(t.appendTo)){let s=document.querySelector(t.appendTo);qn(s)||(Tt("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),t.appendTo=s}return ya(un.grouping)&&!t.grouping&&(t.grouping=un.grouping),Ht(un.duration)&&t.duration===3e3&&(t.duration=un.duration),Ht(un.offset)&&t.offset===16&&(t.offset=un.offset),ya(un.showClose)&&!t.showClose&&(t.showClose=un.showClose),t},xk=n=>{const e=fn.indexOf(n);if(e===-1)return;fn.splice(e,1);const{handler:t}=n;t.close()},vk=({appendTo:n,...e},t)=>{const s=`message_${wk++}`,r=e.onClose,i=document.createElement("div"),o={...e,id:s,onClose:()=>{r==null||r(),xk(d)},onDestroy:()=>{l.render(null,i)}},a=l.createVNode(bk,o,zt(o.message)||l.isVNode(o.message)?{default:zt(o.message)?o.message:()=>o.message}:null);a.appContext=t||Br._context,l.render(a,i),n.appendChild(i.firstElementChild);const c=a.component,d={id:s,vnode:a,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:a.component.props};return d},Br=(n={},e)=>{if(!We)return{close:()=>{}};const t=om(n);if(t.grouping&&fn.length){const r=fn.find(({vnode:i})=>{var o;return((o=i.props)==null?void 0:o.message)===t.message});if(r)return r.props.repeatNum+=1,r.props.type=t.type,r.handler}if(Ht(un.max)&&fn.length>=un.max)return{close:()=>{}};const s=vk(t,e);return fn.push(s),s.handler};im.forEach(n=>{Br[n]=(e={},t)=>{const s=om(e);return Br({...s,type:n},t)}});function Ck(n){for(const e of fn)(!n||n===e.props.type)&&e.handler.close()}Br.closeAll=Ck,Br._context=null;const qe=CN(Br,"$message"),Sk=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:ik},components:{ElButton:sk,ElFocusTrap:Wg,ElInput:N_,ElOverlay:uk,ElIcon:An,...Fp},inheritAttrs:!1,props:{buttonSize:{type:String,validator:EN},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:e}){const{locale:t,zIndex:s,ns:r,size:i}=Pg("message-box",l.computed(()=>n.buttonSize)),{t:o}=t,{nextZIndex:a}=s,c=l.ref(!1),u=l.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:l.markRaw(wa),cancelButtonLoadingIcon:l.markRaw(wa),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=l.computed(()=>{const P=u.type;return{[r.bm("icon",P)]:P&&va[P]}}),f=Aa(),h=Aa(),p=l.computed(()=>u.icon||va[u.type]||""),g=l.computed(()=>!!u.message),m=l.ref(),y=l.ref(),b=l.ref(),w=l.ref(),x=l.ref(),v=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async P=>{await l.nextTick(),n.boxType==="prompt"&&P!==null&&V()},{immediate:!0}),l.watch(()=>c.value,P=>{var T,j;P&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(j=(T=x.value)==null?void 0:T.$el)!=null?j:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(P?l.nextTick().then(()=>{var Y;w.value&&w.value.$el&&(u.autofocus?b.value=(Y=L())!=null?Y:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const C=l.computed(()=>n.draggable),E=l.computed(()=>n.overflow);_N(m,y,C,E),l.onMounted(async()=>{await l.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",S)}),l.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const O=()=>{n.closeOnClickModal&&_(u.distinguishCancelAndClose?"close":"cancel")},A=fg(O),k=P=>{if(u.inputType!=="textarea")return P.preventDefault(),_("confirm")},_=P=>{var T;n.boxType==="prompt"&&P==="confirm"&&!V()||(u.action=P,u.beforeClose?(T=u.beforeClose)==null||T.call(u,P,u,S):S())},V=()=>{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 T=u.inputValidator;if(typeof T=="function"){const j=T(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},L=()=>{const P=w.value.$refs;return P.input||P.textarea},B=()=>{_("close")},N=()=>{n.closeOnPressEscape&&B()};return n.lockScroll&&LN(c),{...l.toRefs(u),ns:r,overlayEvent:A,visible:c,hasMessage:g,typeClass:d,contentId:f,inputId:h,btnSize:i,iconComponent:p,confirmButtonClasses:v,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:S,handleClose:B,onCloseRequested:N,handleWrapperClick:O,handleInputEnter:k,handleAction:_,t:o}}});function Ek(n,e,t,s,r,i){const o=l.resolveComponent("el-icon"),a=l.resolveComponent("close"),c=l.resolveComponent("el-input"),u=l.resolveComponent("el-button"),d=l.resolveComponent("el-focus-trap"),f=l.resolveComponent("el-overlay");return l.openBlock(),l.createBlock(l.Transition,{name:"fade-in-linear",onAfterLeave:h=>n.$emit("vanish"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(f,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:l.withCtx(()=>[l.createElementVNode("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:l.normalizeClass(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[l.createVNode(d,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:l.withCtx(()=>[l.createElementVNode("div",{ref:"rootRef",class:l.normalizeClass([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:l.normalizeStyle(n.customStyle),tabindex:"-1",onClick:l.withModifiers(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,ref:"headerRef",class:l.normalizeClass([n.ns.e("header"),{"show-close":n.showClose}])},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("title"))},[n.iconComponent&&n.center?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.createElementVNode("span",null,l.toDisplayString(n.title),1)],2),n.showClose?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:h=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[l.createVNode(o,{class:l.normalizeClass(n.ns.e("close"))},{default:l.withCtx(()=>[l.createVNode(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):l.createCommentVNode("v-if",!0)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{id:n.contentId,class:l.normalizeClass(n.ns.e("content"))},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),n.hasMessage?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(n.ns.e("message"))},[l.renderSlot(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):l.createCommentVNode("v-if",!0)],2),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("input"))},[l.createVNode(c,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":h=>n.inputValue=h,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:l.normalizeClass({invalid:n.validateError}),onKeydown:l.withKeys(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("errormsg")),style:l.normalizeStyle({visibility:n.editorErrorMessage?"visible":"hidden"})},l.toDisplayString(n.editorErrorMessage),7)],2),[[l.vShow,n.showInput]])],10,["id"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("btns"))},[n.showCancelButton?(l.openBlock(),l.createBlock(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:l.normalizeClass([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:h=>n.handleAction("cancel"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:l.normalizeClass([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:h=>n.handleAction("confirm"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[l.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"]),[[l.vShow,n.visible]])]),_:3},8,["onAfterLeave"])}var Ok=pt(Sk,[["render",Ek],["__file","index.vue"]]);const Xi=new Map,Mk=n=>{let e=document.body;return n.appendTo&&(sn(n.appendTo)&&(e=document.querySelector(n.appendTo)),qn(n.appendTo)&&(e=n.appendTo),qn(e)||(Tt("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},Pk=(n,e,t=null)=>{const s=l.createVNode(Ok,n,zt(n.message)||l.isVNode(n.message)?{default:zt(n.message)?n.message:()=>n.message}:null);return s.appContext=t,l.render(s,e),Mk(n).appendChild(e.firstElementChild),s.component},Nk=()=>document.createElement("div"),Ak=(n,e)=>{const t=Nk();n.onVanish=()=>{l.render(null,t),Xi.delete(r)},n.onAction=i=>{const o=Xi.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=Pk(n,t,e),r=s.proxy;for(const i in n)Yo(n,i)&&!Yo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function jr(n,e=null){if(!We)return Promise.reject();let t;return sn(n)||l.isVNode(n)?n={message:n}:t=n.callback,new Promise((s,r)=>{const i=Ak(n,e??jr._context);Xi.set(i,{options:n,callback:t,resolve:s,reject:r})})}const _k=["alert","confirm","prompt"],Tk={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};_k.forEach(n=>{jr[n]=kk(n)});function kk(n){return(e,t,s,r)=>{let i="";return xr(t)?(s=t,i=""):Tp(t)?i="":i=t,jr(Object.assign({title:i,message:e,type:"",...Tk[n]},s,{boxType:n}),r)}}jr.close=()=>{Xi.forEach((n,e)=>{e.doClose()}),Xi.clear()},jr._context=null;const gs=jr;gs.install=n=>{gs._context=n._context,n.config.globalProperties.$msgbox=gs,n.config.globalProperties.$messageBox=gs,n.config.globalProperties.$alert=gs.alert,n.config.globalProperties.$confirm=gs.confirm,n.config.globalProperties.$prompt=gs.prompt};const Vk=gs;function am(n,e){return function(){return n.apply(e,arguments)}}const{toString:Dk}=Object.prototype,{getPrototypeOf:gu}=Object,Ba=(n=>e=>{const t=Dk.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),pn=n=>(n=n.toLowerCase(),e=>Ba(e)===n),ja=n=>e=>typeof e===n,{isArray:$r}=Array,Ji=ja("undefined");function Rk(n){return n!==null&&!Ji(n)&&n.constructor!==null&&!Ji(n.constructor)&&Rt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const lm=pn("ArrayBuffer");function Ik(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&lm(n.buffer),e}const Lk=ja("string"),Rt=ja("function"),cm=ja("number"),$a=n=>n!==null&&typeof n=="object",Bk=n=>n===!0||n===!1,za=n=>{if(Ba(n)!=="object")return!1;const e=gu(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},jk=pn("Date"),$k=pn("File"),zk=pn("Blob"),Fk=pn("FileList"),Uk=n=>$a(n)&&Rt(n.pipe),Hk=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Rt(n.append)&&((e=Ba(n))==="formdata"||e==="object"&&Rt(n.toString)&&n.toString()==="[object FormData]"))},Gk=pn("URLSearchParams"),[Wk,Yk,qk,Xk]=["ReadableStream","Request","Response","Headers"].map(pn),Jk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ki(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),$r(n))for(s=0,r=n.length;s<r;s++)e.call(null,n[s],s,n);else{const i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,n[a],a,n)}}function um(n,e){e=e.toLowerCase();const t=Object.keys(n);let s=t.length,r;for(;s-- >0;)if(r=t[s],e===r.toLowerCase())return r;return null}const Js=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,dm=n=>!Ji(n)&&n!==Js;function mu(){const{caseless:n}=dm(this)&&this||{},e={},t=(s,r)=>{const i=n&&um(e,r)||r;za(e[i])&&za(s)?e[i]=mu(e[i],s):za(s)?e[i]=mu({},s):$r(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Ki(arguments[s],t);return e}const Kk=(n,e,t,{allOwnKeys:s}={})=>(Ki(e,(r,i)=>{t&&Rt(r)?n[i]=am(r,t):n[i]=r},{allOwnKeys:s}),n),Zk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Qk=(n,e,t,s)=>{n.prototype=Object.create(e.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},eV=(n,e,t,s)=>{let r,i,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),i=r.length;i-- >0;)o=r[i],(!s||s(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&gu(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},tV=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const s=n.indexOf(e,t);return s!==-1&&s===t},nV=n=>{if(!n)return null;if($r(n))return n;let e=n.length;if(!cm(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},sV=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&gu(Uint8Array)),rV=(n,e)=>{const s=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(n,i[0],i[1])}},iV=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},oV=pn("HTMLFormElement"),aV=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),hm=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),lV=pn("RegExp"),fm=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};Ki(t,(r,i)=>{let o;(o=e(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},cV=n=>{fm(n,(e,t)=>{if(Rt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(Rt(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},uV=(n,e)=>{const t={},s=r=>{r.forEach(i=>{t[i]=!0})};return $r(n)?s(n):s(String(n).split(e)),t},dV=()=>{},hV=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,yu="abcdefghijklmnopqrstuvwxyz",pm="0123456789",gm={DIGIT:pm,ALPHA:yu,ALPHA_DIGIT:yu+yu.toUpperCase()+pm},fV=(n=16,e=gm.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;n--;)t+=e[Math.random()*s|0];return t};function pV(n){return!!(n&&Rt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const gV=n=>{const e=new Array(10),t=(s,r)=>{if($a(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=$r(s)?[]:{};return Ki(s,(o,a)=>{const c=t(o,r+1);!Ji(c)&&(i[a]=c)}),e[r]=void 0,i}}return s};return t(n,0)},mV=pn("AsyncFunction"),yV=n=>n&&($a(n)||Rt(n))&&Rt(n.then)&&Rt(n.catch),mm=((n,e)=>n?setImmediate:e?((t,s)=>(Js.addEventListener("message",({source:r,data:i})=>{r===Js&&i===t&&s.length&&s.shift()()},!1),r=>{s.push(r),Js.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Rt(Js.postMessage)),bV=typeof queueMicrotask<"u"?queueMicrotask.bind(Js):typeof process<"u"&&process.nextTick||mm,R={isArray:$r,isArrayBuffer:lm,isBuffer:Rk,isFormData:Hk,isArrayBufferView:Ik,isString:Lk,isNumber:cm,isBoolean:Bk,isObject:$a,isPlainObject:za,isReadableStream:Wk,isRequest:Yk,isResponse:qk,isHeaders:Xk,isUndefined:Ji,isDate:jk,isFile:$k,isBlob:zk,isRegExp:lV,isFunction:Rt,isStream:Uk,isURLSearchParams:Gk,isTypedArray:sV,isFileList:Fk,forEach:Ki,merge:mu,extend:Kk,trim:Jk,stripBOM:Zk,inherits:Qk,toFlatObject:eV,kindOf:Ba,kindOfTest:pn,endsWith:tV,toArray:nV,forEachEntry:rV,matchAll:iV,isHTMLForm:oV,hasOwnProperty:hm,hasOwnProp:hm,reduceDescriptors:fm,freezeMethods:cV,toObjectSet:uV,toCamelCase:aV,noop:dV,toFiniteNumber:hV,findKey:um,global:Js,isContextDefined:dm,ALPHABET:gm,generateString:fV,isSpecCompliantForm:pV,toJSONObject:gV,isAsyncFn:mV,isThenable:yV,setImmediate:mm,asap:bV};function ue(n,e,t,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}R.inherits(ue,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 ym=ue.prototype,bm={};["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=>{bm[n]={value:n}}),Object.defineProperties(ue,bm),Object.defineProperty(ym,"isAxiosError",{value:!0}),ue.from=(n,e,t,s,r,i)=>{const o=Object.create(ym);return R.toFlatObject(n,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ue.call(o,n.message,e,t,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const wV=null;function bu(n){return R.isPlainObject(n)||R.isArray(n)}function wm(n){return R.endsWith(n,"[]")?n.slice(0,-2):n}function xm(n,e,t){return n?n.concat(e).map(function(r,i){return r=wm(r),!t&&i?"["+r+"]":r}).join(t?".":""):e}function xV(n){return R.isArray(n)&&!n.some(bu)}const vV=R.toFlatObject(R,{},null,function(e){return/^is[A-Z]/.test(e)});function Fa(n,e,t){if(!R.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=R.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!R.isUndefined(y[m])});const s=t.metaTokens,r=t.visitor||d,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(e);if(!R.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(R.isDate(g))return g.toISOString();if(!c&&R.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(g)||R.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(R.endsWith(m,"{}"))m=s?m:m.slice(0,-2),g=JSON.stringify(g);else if(R.isArray(g)&&xV(g)||(R.isFileList(g)||R.endsWith(m,"[]"))&&(b=R.toArray(g)))return m=wm(m),b.forEach(function(x,v){!(R.isUndefined(x)||x===null)&&e.append(o===!0?xm([m],v,i):o===null?m:m+"[]",u(x))}),!1}return bu(g)?!0:(e.append(xm(y,m,i),u(g)),!1)}const f=[],h=Object.assign(vV,{defaultVisitor:d,convertValue:u,isVisitable:bu});function p(g,m){if(!R.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),R.forEach(g,function(b,w){(!(R.isUndefined(b)||b===null)&&r.call(e,b,R.isString(w)?w.trim():w,m,h))===!0&&p(b,m?m.concat(w):[w])}),f.pop()}}if(!R.isObject(n))throw new TypeError("data must be an object");return p(n),e}function vm(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function wu(n,e){this._pairs=[],n&&Fa(n,this,e)}const Cm=wu.prototype;Cm.append=function(e,t){this._pairs.push([e,t])},Cm.toString=function(e){const t=e?function(s){return e.call(this,s,vm)}:vm;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function CV(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Sm(n,e,t){if(!e)return n;const s=t&&t.encode||CV,r=t&&t.serialize;let i;if(r?i=r(e,t):i=R.isURLSearchParams(e)?e.toString():new wu(e,t).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Em{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){R.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Om={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},SV={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:wu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xu=typeof window<"u"&&typeof document<"u",vu=typeof navigator=="object"&&navigator||void 0,EV=xu&&(!vu||["ReactNative","NativeScript","NS"].indexOf(vu.product)<0),OV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MV=xu&&window.location.href||"http://localhost",Ot={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xu,hasStandardBrowserEnv:EV,hasStandardBrowserWebWorkerEnv:OV,navigator:vu,origin:MV},Symbol.toStringTag,{value:"Module"})),...SV};function PV(n,e){return Fa(n,new Ot.classes.URLSearchParams,Object.assign({visitor:function(t,s,r,i){return Ot.isNode&&R.isBuffer(t)?(this.append(s,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function NV(n){return R.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function AV(n){const e={},t=Object.keys(n);let s;const r=t.length;let i;for(s=0;s<r;s++)i=t[s],e[i]=n[i];return e}function Mm(n){function e(t,s,r,i){let o=t[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=t.length;return o=!o&&R.isArray(r)?r.length:o,c?(R.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!R.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],i)&&R.isArray(r[o])&&(r[o]=AV(r[o])),!a)}if(R.isFormData(n)&&R.isFunction(n.entries)){const t={};return R.forEachEntry(n,(s,r)=>{e(NV(s),r,t,0)}),t}return null}function _V(n,e,t){if(R.isString(n))try{return(e||JSON.parse)(n),R.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const Zi={transitional:Om,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return r?JSON.stringify(Mm(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e)||R.isReadableStream(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return PV(e,this.formSerializer).toString();if((a=R.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fa(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),_V(e)):e}],transformResponse:[function(e){const t=this.transitional||Zi.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(R.isResponse(e)||R.isReadableStream(e))return e;if(e&&R.isString(e)&&(s&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?ue.from(a,ue.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],n=>{Zi.headers[n]={}});const TV=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"]),kV=n=>{const e={};let t,s,r;return n&&n.split(`
34
- `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&TV[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Pm=Symbol("internals");function Qi(n){return n&&String(n).trim().toLowerCase()}function Ua(n){return n===!1||n==null?n:R.isArray(n)?n.map(Ua):String(n)}function VV(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(n);)e[s[1]]=s[2];return e}const DV=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Cu(n,e,t,s,r){if(R.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!R.isString(e)){if(R.isString(s))return e.indexOf(s)!==-1;if(R.isRegExp(s))return s.test(e)}}function RV(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function IV(n,e){const t=R.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+t,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class Mt{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function i(a,c,u){const d=Qi(c);if(!d)throw new Error("header name must be a non-empty string");const f=R.findKey(r,d);(!f||r[f]===void 0||u===!0||u===void 0&&r[f]!==!1)&&(r[f||c]=Ua(a))}const o=(a,c)=>R.forEach(a,(u,d)=>i(u,d,c));if(R.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(R.isString(e)&&(e=e.trim())&&!DV(e))o(kV(e),t);else if(R.isHeaders(e))for(const[a,c]of e.entries())i(c,a,s);else e!=null&&i(t,e,s);return this}get(e,t){if(e=Qi(e),e){const s=R.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return VV(r);if(R.isFunction(t))return t.call(this,r,s);if(R.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Qi(e),e){const s=R.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||Cu(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function i(o){if(o=Qi(o),o){const a=R.findKey(s,o);a&&(!t||Cu(s,s[a],a,t))&&(delete s[a],r=!0)}}return R.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let s=t.length,r=!1;for(;s--;){const i=t[s];(!e||Cu(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,s={};return R.forEach(this,(r,i)=>{const o=R.findKey(s,i);if(o){t[o]=Ua(r),delete t[i];return}const a=e?RV(i):String(i).trim();a!==i&&delete t[i],t[a]=Ua(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return R.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&R.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
35
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Pm]=this[Pm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Qi(o);s[a]||(IV(r,o),s[a]=!0)}return R.isArray(e)?e.forEach(i):i(e),this}}Mt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(Mt.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}}),R.freezeMethods(Mt);function Su(n,e){const t=this||Zi,s=e||t,r=Mt.from(s.headers);let i=s.data;return R.forEach(n,function(a){i=a.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function Nm(n){return!!(n&&n.__CANCEL__)}function zr(n,e,t){ue.call(this,n??"canceled",ue.ERR_CANCELED,e,t),this.name="CanceledError"}R.inherits(zr,ue,{__CANCEL__:!0});function Am(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new ue("Request failed with status code "+t.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function LV(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function BV(n,e){n=n||10;const t=new Array(n),s=new Array(n);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=s[i];o||(o=u),t[r]=c,s[r]=u;let f=i,h=0;for(;f!==r;)h+=t[f++],f=f%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),u-o<e)return;const p=d&&u-d;return p?Math.round(h*1e3/p):void 0}}function jV(n,e){let t=0,s=1e3/e,r,i;const o=(u,d=Date.now())=>{t=d,r=null,i&&(clearTimeout(i),i=null),n.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-t;f>=s?o(u,d):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-f)))},()=>r&&o(r)]}const Ha=(n,e,t=3)=>{let s=0;const r=BV(50,250);return jV(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-s,u=r(c),d=o<=a;s=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(f)},t)},_m=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},Tm=n=>(...e)=>R.asap(()=>n(...e)),$V=Ot.hasStandardBrowserEnv?function(){const e=Ot.navigator&&/(msie|trident)/i.test(Ot.navigator.userAgent),t=document.createElement("a");let s;function r(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.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}}(),zV=Ot.hasStandardBrowserEnv?{write(n,e,t,s,r,i){const o=[n+"="+encodeURIComponent(e)];R.isNumber(t)&&o.push("expires="+new Date(t).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 e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function FV(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function UV(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function km(n,e){return n&&!FV(e)?UV(n,e):e}const Vm=n=>n instanceof Mt?{...n}:n;function Ks(n,e){e=e||{};const t={};function s(u,d,f){return R.isPlainObject(u)&&R.isPlainObject(d)?R.merge.call({caseless:f},u,d):R.isPlainObject(d)?R.merge({},d):R.isArray(d)?d.slice():d}function r(u,d,f){if(R.isUndefined(d)){if(!R.isUndefined(u))return s(void 0,u,f)}else return s(u,d,f)}function i(u,d){if(!R.isUndefined(d))return s(void 0,d)}function o(u,d){if(R.isUndefined(d)){if(!R.isUndefined(u))return s(void 0,u)}else return s(void 0,d)}function a(u,d,f){if(f in e)return s(u,d);if(f in n)return s(void 0,u)}const c={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,d)=>r(Vm(u),Vm(d),!0)};return R.forEach(Object.keys(Object.assign({},n,e)),function(d){const f=c[d]||r,h=f(n[d],e[d],d);R.isUndefined(h)&&f!==a||(t[d]=h)}),t}const Dm=n=>{const e=Ks({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Mt.from(o),e.url=Sm(km(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(R.isFormData(t)){if(Ot.hasStandardBrowserEnv||Ot.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Ot.hasStandardBrowserEnv&&(s&&R.isFunction(s)&&(s=s(e)),s||s!==!1&&$V(e.url))){const u=r&&i&&zV.read(i);u&&o.set(r,u)}return e},HV=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,s){const r=Dm(n);let i=r.data;const o=Mt.from(r.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=r,d,f,h,p,g;function m(){p&&p(),g&&g(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function b(){if(!y)return;const x=Mt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};Am(function(S){t(S),m()},function(S){s(S),m()},C),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 ue("Request aborted",ue.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new ue("Network Error",ue.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let v=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||Om;r.timeoutErrorMessage&&(v=r.timeoutErrorMessage),s(new ue(v,C.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&R.forEach(o.toJSON(),function(v,C){y.setRequestHeader(C,v)}),R.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([h,g]=Ha(u,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,p]=Ha(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new zr(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const w=LV(r.url);if(w&&Ot.protocols.indexOf(w)===-1){s(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,n));return}y.send(i||null)})},GV=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let s=new AbortController,r;const i=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;s.abort(d instanceof ue?d:new zr(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);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:c}=s;return c.unsubscribe=()=>R.asap(a),c}},WV=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let s=0,r;for(;s<t;)r=s+e,yield n.slice(s,r),s=r},YV=async function*(n,e){for await(const t of qV(n))yield*WV(t,e)},qV=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Rm=(n,e,t,s)=>{const r=YV(n,e);let i=0,o,a=c=>{o||(o=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){a(),c.close();return}let f=d.byteLength;if(t){let h=i+=f;t(h)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},Ga=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Im=Ga&&typeof ReadableStream=="function",XV=Ga&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Lm=(n,...e)=>{try{return!!n(...e)}catch{return!1}},JV=Im&&Lm(()=>{let n=!1;const e=new Request(Ot.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Bm=64*1024,Eu=Im&&Lm(()=>R.isReadableStream(new Response("").body)),Wa={stream:Eu&&(n=>n.body)};Ga&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Wa[e]&&(Wa[e]=R.isFunction(n[e])?t=>t[e]():(t,s)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,s)})})})(new Response);const KV=async n=>{if(n==null)return 0;if(R.isBlob(n))return n.size;if(R.isSpecCompliantForm(n))return(await new Request(Ot.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 XV(n)).byteLength},ZV=async(n,e)=>{const t=R.toFiniteNumber(n.getContentLength());return t??KV(e)},Ou={http:wV,xhr:HV,fetch:Ga&&(async n=>{let{url:e,method:t,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=Dm(n);u=u?(u+"").toLowerCase():"text";let p=GV([r,i&&i.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&JV&&t!=="get"&&t!=="head"&&(y=await ZV(d,s))!==0){let C=new Request(e,{method:"POST",body:s,duplex:"half"}),E;if(R.isFormData(s)&&(E=C.headers.get("content-type"))&&d.setContentType(E),C.body){const[S,O]=_m(y,Ha(Tm(c)));s=Rm(C.body,Bm,S,O)}}R.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(e,{...h,signal:p,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:b?f:void 0});let w=await fetch(g);const x=Eu&&(u==="stream"||u==="response");if(Eu&&(a||x&&m)){const C={};["status","statusText","headers"].forEach(A=>{C[A]=w[A]});const E=R.toFiniteNumber(w.headers.get("content-length")),[S,O]=a&&_m(E,Ha(Tm(a),!0))||[];w=new Response(Rm(w.body,Bm,S,()=>{O&&O(),m&&m()}),C)}u=u||"text";let v=await Wa[R.findKey(Wa,u)||"text"](w,n);return!x&&m&&m(),await new Promise((C,E)=>{Am(C,E,{data:v,headers:Mt.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,n,g),{cause:b.cause||b}):ue.from(b,b&&b.code,n,g)}})};R.forEach(Ou,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const jm=n=>`- ${n}`,QV=n=>R.isFunction(n)||n===null||n===!1,$m={getAdapter:n=>{n=R.isArray(n)?n:[n];const{length:e}=n;let t,s;const r={};for(let i=0;i<e;i++){t=n[i];let o;if(s=t,!QV(t)&&(s=Ou[(o=String(t)).toLowerCase()],s===void 0))throw new ue(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
36
- `+i.map(jm).join(`
37
- `):" "+jm(i[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:Ou};function Mu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new zr(null,n)}function zm(n){return Mu(n),n.headers=Mt.from(n.headers),n.data=Su.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),$m.getAdapter(n.adapter||Zi.adapter)(n).then(function(s){return Mu(n),s.data=Su.call(n,n.transformResponse,s),s.headers=Mt.from(s.headers),s},function(s){return Nm(s)||(Mu(n),s&&s.response&&(s.response.data=Su.call(n,n.transformResponse,s.response),s.response.headers=Mt.from(s.response.headers))),Promise.reject(s)})}const Fm="1.7.7",Pu={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Pu[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const Um={};Pu.transitional=function(e,t,s){function r(i,o){return"[Axios v"+Fm+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new ue(r(o," has been removed"+(t?" in "+t:"")),ue.ERR_DEPRECATED);return t&&!Um[o]&&(Um[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};function eD(n,e,t){if(typeof n!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=n[i],c=a===void 0||o(a,i,n);if(c!==!0)throw new ue("option "+i+" must be "+c,ue.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new ue("Unknown option "+i,ue.ERR_BAD_OPTION)}}const Nu={assertOptions:eD,validators:Pu},ms=Nu.validators;class Zs{constructor(e){this.defaults=e,this.interceptors={request:new Em,response:new Em}}async request(e,t){try{return await this._request(e,t)}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+=`
38
- `+i):s.stack=i}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Ks(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:i}=t;s!==void 0&&Nu.assertOptions(s,{silentJSONParsing:ms.transitional(ms.boolean),forcedJSONParsing:ms.transitional(ms.boolean),clarifyTimeoutError:ms.transitional(ms.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:Nu.assertOptions(r,{encode:ms.function,serialize:ms.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&R.merge(i.common,i[t.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=Mt.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[zm.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),h=g.length,d=Promise.resolve(t);f<h;)d=d.then(g[f++],g[f++]);return d}h=a.length;let p=t;for(f=0;f<h;){const g=a[f++],m=a[f++];try{p=g(p)}catch(y){m.call(this,y);break}}try{d=zm.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(e){e=Ks(this.defaults,e);const t=km(e.baseURL,e.url);return Sm(t,e.params,e.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(e){Zs.prototype[e]=function(t,s){return this.request(Ks(s||{},{method:e,url:t,data:(s||{}).data}))}}),R.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,a){return this.request(Ks(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Zs.prototype[e]=t(),Zs.prototype[e+"Form"]=t(!0)});class Au{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=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},e(function(i,o,a){s.reason||(s.reason=new zr(i,o,a),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Au(function(r){e=r}),cancel:e}}}function tD(n){return function(t){return n.apply(null,t)}}function nD(n){return R.isObject(n)&&n.isAxiosError===!0}const _u={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(_u).forEach(([n,e])=>{_u[e]=n});function Hm(n){const e=new Zs(n),t=am(Zs.prototype.request,e);return R.extend(t,Zs.prototype,e,{allOwnKeys:!0}),R.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Hm(Ks(n,r))},t}const Xe=Hm(Zi);Xe.Axios=Zs,Xe.CanceledError=zr,Xe.CancelToken=Au,Xe.isCancel=Nm,Xe.VERSION=Fm,Xe.toFormData=Fa,Xe.AxiosError=ue,Xe.Cancel=Xe.CanceledError,Xe.all=function(e){return Promise.all(e)},Xe.spread=tD,Xe.isAxiosError=nD,Xe.mergeConfig=Ks,Xe.AxiosHeaders=Mt,Xe.formToJSON=n=>Mm(R.isHTMLForm(n)?new FormData(n):n),Xe.getAdapter=$m.getAdapter,Xe.HttpStatusCode=_u,Xe.default=Xe;const Jn=Xe.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),sD=n=>{Jn.defaults.baseURL=n},rD=n=>{Jn.interceptors.request.use(e=>{if(n)return e.headers.token=n,e},e=>Promise.reject(e))};Jn.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 Qs=(n,e={})=>Jn.get(n,{params:e}),Ya=(n,e={})=>Jn.post(n,e),Gm=(n,e={})=>Jn.delete(n,{params:e}),iD=(n,e={})=>Jn.post(n,e,{headers:{"Content-Type":"multipart/form-data"}}),Fr=(n,e)=>{const t=document.querySelector(n),s=t.querySelectorAll(".x6-port-body"),r=t.querySelectorAll(".x6-port-label");for(let i=0,o=s.length;i<o;i+=1)s[i].style.visibility=e?"visible":"hidden";for(let i=0,o=r.length;i<o;i+=1)r[i].style.visibility=e?"visible":"hidden"},Tu=n=>Qs("/custom/deviceList",{itemIds:n}).then(e=>{if(e!=null&&e.isOk)return e.data}),ku=n=>Qs("/custom/monitorInfo",{deviceCode:n,fieldType:1}).then(e=>{if(e!=null&&e.isOk)return e.data}),Wm=n=>Qs("/template/selectOne",{id:n}).then(e=>{if(e!=null&&e.isOk){const t=JSON.parse(e.data.remark);return t===null?null:{background:t.background,grid:t.grid,data:t.data}}else qe.error((e==null?void 0:e.msg)||"获取失败")}),oD=n=>Ya("/custom/arrRealData2",n).then(e=>{if(e!=null&&e.isOk)return e.data;qe.error((e==null?void 0:e.msg)||"获取失败")}),qa={color:"#000000"},Xa={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},aD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},Vu={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:"文本",fields:[]},ports:{groups:{ports:{portOption:Vu}}}},Ja={markup:[{tagName:"path",selector:"line",groupSelector:"lines"}],attrs:{wrap:{strokeWidth:10},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},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}}}},Ym={markup:[{tagName:"path",selector:"line",groupSelector:"lines"},{tagName:"path",selector:"pipe",groupSelector:"lines"}],attrs:{wrap:{strokeWidth:10},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},line:{stroke:"#ffffff",strokeWidth:1,targetMarker:null,sourceMarker:null},pipe:{stroke:"#2364DD",strokeWidth:1,strokeDasharray:5,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}}},Ka="M 0 -6 8 0 0 6 z",qm="M 0 -6 -8 0 0 6 z",Xm={attrs:{wrap:{strokeWidth:10},arrow:{d:Ka,fill:"#ED8A19",stroke:"#ED8A19",style:{animation:"flashing 2s infinite linear"},display:"block"},arrow1:{atConnectionRatio:.5},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},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}}},markup:[{tagName:"path",selector:"line",groupSelector:"lines"},{tagName:"path",groupSelector:"arrow",selector:"arrow1"}]},tt={markup:Ja.markup,attrs:Ja.attrs},It=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},cD={class:"control"},uD={class:"row-column"},dD=It({__name:"index",props:{payload:Object},setup(n){var h,p,g,m,y,b,w,x,v,C,E,S,O,A,k,_,V,L,B,N,P;const e=n,t=l.ref(((h=e.payload.value.options.background)==null?void 0:h.color)||null),s=l.ref(((g=(p=e.payload.value.options)==null?void 0:p.grid)==null?void 0:g.visible)||null),r=l.ref(((y=(m=e.payload.value.options)==null?void 0:m.grid)==null?void 0:y.size)||10),i=l.ref(((v=(x=(w=(b=e.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=l.ref(((O=(S=(E=(C=e.payload.value.options)==null?void 0:C.grid)==null?void 0:E.args)==null?void 0:S[0])==null?void 0:O.thickness)||1),a=l.ref(((V=(_=(k=(A=e.payload.value.options)==null?void 0:A.grid)==null?void 0:k.args)==null?void 0:_[1])==null?void 0:V.color)||null),c=l.ref(((P=(N=(B=(L=e.payload.value.options)==null?void 0:L.grid)==null?void 0:B.args)==null?void 0:N[1])==null?void 0:P.thickness)||1),u=l.ref("1"),d=T=>{e.payload.value.drawBackground({color:T})},f=()=>{e.payload.value.drawGrid({visible:s.value,size:r.value,type:"doubleMesh",args:[{color:i.value,thickness:o.value},{color:a.value,thickness:c.value}]})};return(T,j)=>{const Y=l.resolveComponent("el-col"),te=l.resolveComponent("el-color-picker"),z=l.resolveComponent("el-row"),I=l.resolveComponent("el-switch"),U=l.resolveComponent("el-input-number"),F=l.resolveComponent("el-collapse-item"),D=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",cD,[l.createVNode(D,{modelValue:u.value,"onUpdate:modelValue":j[7]||(j[7]=q=>u.value=q),accordion:""},{default:l.withCtx(()=>[l.createVNode(F,{title:"基础属性",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",uD,[l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[8]||(j[8]=[l.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:t.value,"onUpdate:modelValue":j[0]||(j[0]=q=>t.value=q),size:"small","show-alpha":"",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[9]||(j[9]=[l.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(I,{modelValue:s.value,"onUpdate:modelValue":j[1]||(j[1]=q=>s.value=q),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[10]||(j[10]=[l.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:r.value,"onUpdate:modelValue":j[2]||(j[2]=q=>r.value=q),min:1,max:20,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[11]||(j[11]=[l.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:i.value,"onUpdate:modelValue":j[3]||(j[3]=q=>i.value=q),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[12]||(j[12]=[l.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:a.value,"onUpdate:modelValue":j[4]||(j[4]=q=>a.value=q),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[13]||(j[13]=[l.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:o.value,"onUpdate:modelValue":j[5]||(j[5]=q=>o.value=q),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[14]||(j[14]=[l.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:c.value,"onUpdate:modelValue":j[6]||(j[6]=q=>c.value=q),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]);/*! Element Plus Icons Vue v2.3.1 */var hD=l.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),fD=hD,pD=l.defineComponent({name:"DeleteFilled",__name:"delete-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),Jm=pD,gD=l.defineComponent({name:"Document",__name:"document",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),mD=gD,yD=l.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),bD=yD,wD=l.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),xD=wD;typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const s=document.createDocumentFragment();t.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 wt{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,s,r)=>{const i=r.value,o=t.__proto__;r.value=function(...a){this.disposed||(i.call(this,...a),o.dispose.call(this))}}}n.dispose=e})(wt||(wt={}));class Km{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const s=new n;return t.forEach(r=>{s.add(r)}),s}n.from=e})(Km||(Km={}));function Zm(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function se(n,e,...t){return Zm(n,e,t)}function vD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Du(n){return n!=null&&(n instanceof Promise||vD(n))}function Ru(...n){const e=[];if(n.forEach(s=>{Array.isArray(s)?e.push(...s):e.push(s)}),e.some(s=>Du(s))){const s=e.map(r=>Du(r)?r:Promise.resolve(r!==!1));return Promise.all(s).then(r=>r.reduce((i,o)=>o!==!1&&i,!0))}return e.every(s=>s!==!1)}function CD(...n){const e=Ru(n);return typeof e=="boolean"?Promise.resolve(e):e}function Iu(n,e){const t=[];for(let s=0;s<n.length;s+=2){const r=n[s],i=n[s+1],o=Array.isArray(e)?e:[e],a=Zm(r,i,o);t.push(a)}return Ru(t)}class SD{constructor(){this.listeners={}}on(e,t,s){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,s),this)}once(e,t,s){const r=(...i)=>(this.off(e,r),Iu([t,s],i));return this.on(e,r,this)}off(e,t,s){if(!(e||t||s))return this.listeners={},this;const r=this.listeners;return(e?[e]:Object.keys(r)).forEach(o=>{const a=r[o];if(a){if(!(t||s)){delete r[o];return}for(let c=a.length-2;c>=0;c-=2)t&&a[c]!==t||s&&a[c+1]!==s||a.splice(c,2)}}),this}trigger(e,...t){let s=!0;if(e!=="*"){const i=this.listeners[e];i!=null&&(s=Iu([...i],t))}const r=this.listeners["*"];return r!=null?Ru([s,Iu([...r],[e,...t])]):s}emit(e,...t){return this.trigger(e,...t)}}function ED(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(t.prototype,s))})})}const OD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function MD(n,e){OD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}class PD{}const ND=/^\s*class\s+/.test(`${PD}`)||/^\s*class\s*\{/.test(`${class{}}`);function Lu(n,e){let t;return ND?t=class extends e{}:(t=function(){return e.apply(this,arguments)},MD(t,e)),Object.defineProperty(t,"name",{value:n}),t}function Qm(n){return n==="__proto__"}function Bu(n,e,t="/"){let s;const r=Array.isArray(e)?e:e.split(t);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 Ur(n,e,t,s="/"){const r=Array.isArray(e)?e:e.split(s),i=r.pop();if(i&&!Qm(i)){let o=n;r.forEach(a=>{Qm(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=t}return n}function ey(n,e,t="/"){const s=Array.isArray(e)?e.slice():e.split(t),r=s.pop();if(r)if(s.length>0){const i=Bu(n,s);i&&delete i[r]}else delete n[r];return n}var AD=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Ve extends SD{dispose(){this.off()}}AD([wt.dispose()],Ve.prototype,"dispose",null),function(n){n.dispose=wt.dispose}(Ve||(Ve={})),ED(Ve,wt);const ty=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ny=ty(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),ju=ty(n=>YP(la(n)).replace(/ /g,""));function $u(n){let e=2166136261,t=!1,s=n;for(let r=0,i=s.length;r<i;r+=1){let o=s.charCodeAt(r);o>127&&!t&&(s=unescape(encodeURIComponent(s)),o=s.charCodeAt(r),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Za(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=Math.random()*16|0,o=r==="x"?i:r==="y"?i&3|8:r;n+=o.toString(16)}return n}function _D(n,e,t){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 c of e){const u=t(c);if(u!==void 0&&Math.abs(u.length-a.length)<=s){const d=u.toLowerCase();if(d===a){if(u===n)continue;return c}if(o||u.length<3)continue;const f=TD(a,d,r-1);if(f===void 0)continue;f<3?(o=!0,i=c):(r=f,i=c)}}return i}function TD(n,e,t){let s=new Array(e.length+1),r=new Array(e.length+1);const i=t+1;for(let a=0;a<=e.length;a+=1)s[a]=a;for(let a=1;a<=n.length;a+=1){const c=n.charCodeAt(a-1),u=a>t?a-t:1,d=e.length>t+a?t+a:e.length;r[0]=a;let f=a;for(let p=1;p<u;p+=1)r[p]=i;for(let p=u;p<=d;p+=1){const g=c===e.charCodeAt(p-1)?s[p-1]:Math.min(s[p]+1,r[p-1]+1,s[p-1]+2);r[p]=g,f=Math.min(f,g)}for(let p=d+1;p<=e.length;p+=1)r[p]=i;if(f>t)return;const h=s;s=r,r=h}const o=s[e.length];return o>t?void 0:o}function Kn(n){return typeof n=="string"&&n.slice(-1)==="%"}function gn(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Kn(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function ys(n){if(typeof n=="object"){let t=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=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=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:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let zu=!1,sy=!1,ry=!1,iy=!1,oy=!1,ay=!1,ly=!1,cy=!1,uy=!1,dy=!1,hy=!1,fy=!1,py=!1,gy=!1,my=!1,yy=!1;if(typeof navigator=="object"){const n=navigator.userAgent;zu=n.indexOf("Macintosh")>=0,sy=!!n.match(/(iPad|iPhone|iPod)/g),ry=n.indexOf("Windows")>=0,iy=n.indexOf("MSIE")>=0,oy=!!n.match(/Trident\/7\./),ay=!!n.match(/Edge\//),ly=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,uy=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,dy=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,hy=n.indexOf("Firefox/")>=0,fy=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(yy=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(cy=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,gy=window.PointerEvent!=null&&!zu),typeof document=="object"){py="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){my=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var bs;(function(n){n.IS_MAC=zu,n.IS_IOS=sy,n.IS_WINDOWS=ry,n.IS_IE=iy,n.IS_IE11=oy,n.IS_EDGE=ay,n.IS_NETSCAPE=ly,n.IS_CHROME_APP=cy,n.IS_CHROME=uy,n.IS_OPERA=dy,n.IS_FIREFOX=hy,n.IS_SAFARI=fy,n.SUPPORT_TOUCH=py,n.SUPPORT_POINTER=gy,n.SUPPORT_PASSIVE=my,n.NO_FOREIGNOBJECT=yy,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(bs||(bs={})),function(n){function e(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;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 c=a in o;return c||(o.setAttribute(a,"return;"),c=typeof o[a]=="function"),c}n.isEventSupported=r}(bs||(bs={}));const Fu=/[\t\r\n\f]/g,Uu=/\S+/g,Hr=n=>` ${n} `;function Gr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function _n(n,e){if(n==null||e==null)return!1;const t=Hr(Gr(n)),s=Hr(e);return n.nodeType===1?t.replace(Fu," ").includes(s):!1}function ee(n,e){if(!(n==null||e==null)){if(typeof e=="function")return ee(n,e(Gr(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(Uu)||[],s=Hr(Gr(n)).replace(Fu," ");let r=t.reduce((i,o)=>i.indexOf(Hr(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function Ie(n,e){if(n!=null){if(typeof e=="function")return Ie(n,e(Gr(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(Uu)||[],s=Hr(Gr(n)).replace(Fu," ");let r=t.reduce((i,o)=>{const a=Hr(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=e?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function mn(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?ee(n,e):Ie(n,e);return}if(typeof e=="function")return mn(n,e(Gr(n),t),t);typeof e=="string"&&(e.match(Uu)||[]).forEach(r=>{_n(n,r)?Ie(n,r):ee(n,r)})}}let by=0;function kD(){return by+=1,`v${by}`}function Hu(n){return(n.id==null||n.id==="")&&(n.id=kD()),n.id}function ws(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const it={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"},wy="1.1";function xy(n,e=document){return e.createElement(n)}function Gu(n,e=it.xhtml,t=document){return t.createElementNS(e,n)}function yn(n,e=document){return Gu(n,it.svg,e)}function Qa(n){if(n){const t=`<svg xmlns="${it.svg}" xmlns:xlink="${it.xlink}" version="${wy}">${n}</svg>`,{documentElement:s}=VD(t,{async:!1});return s}const e=document.createElementNS(it.svg,"svg");return e.setAttributeNS(it.xmlns,"xmlns:xlink",it.xlink),e.setAttribute("version",wy),e}function VD(n,e={}){let t;try{const s=new DOMParser;if(e.async!=null){const r=s;r.async=e.async}t=s.parseFromString(n,e.mimeType||"text/xml")}catch{t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function DD(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Wu(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function RD(n,e){return n.querySelectorAll(e)}function ID(n,e){return n.querySelector(e)}function vy(n,e,t){const s=n.ownerSVGElement;let r=n.parentNode;for(;r&&r!==t&&r!==s;){if(_n(r,e))return r;r=r.parentNode}return null}function Yu(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Yt(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Lt(n,e){(Array.isArray(e)?e:[e]).forEach(s=>{s!=null&&n.appendChild(s)})}function Cy(n,e){const t=n.firstChild;return t?qu(t,e):Lt(n,e)}function qu(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&t.insertBefore(r,n)})}function xs(n,e){e!=null&&e.appendChild(n)}function Sy(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function LD(n,e){const t=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!e||_n(s,e))&&t.push(s);return t}const Ey=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function BD(n,e){return n.getAttribute(e)}function Xu(n,e){const t=My(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Ju(n,e,t){if(t==null)return Xu(n,e);const s=My(e);s.ns&&typeof t=="string"?n.setAttributeNS(s.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function Oy(n,e){Object.keys(e).forEach(t=>{Ju(n,t,e[t])})}function pe(n,e,t){if(e==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 e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?Oy(n,e):Ju(n,e,t)}function My(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:it[e[0]],local:e[1]}}return{ns:null,local:n}}function to(n){const e={};return Object.keys(n).forEach(t=>{const s=Ey.includes(t)?t:ny(t);e[s]=n[t]}),e}function el(n){const e={};return n.split(";").forEach(s=>{const r=s.trim();if(r){const i=r.split("=");i.length&&(e[i[0].trim()]=i[1]?i[1].trim():"")}}),e}function Ku(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const s=typeof n[t]=="object",r=typeof e[t]=="object";let i,o;s&&r?(i=n[t],o=e[t]):s?(i=n[t],o=el(e[t])):r?(i=el(n[t]),o=e[t]):(i=el(n[t]),o=el(e[t])),n[t]=Ku(i,o)}else n[t]=e[t]}),n}function jD(n,e,t={}){const s=t.offset||0,r=[],i=[];let o,a,c=null;for(let u=0;u<n.length;u+=1){o=i[u]=n[u];for(let d=0,f=e.length;d<f;d+=1){const h=e[d],p=h.start+s,g=h.end+s;u>=p&&u<g&&(typeof o=="string"?o=i[u]={t:n[u],attrs:h.attrs}:o.attrs=Ku(Ku({},o.attrs),h.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(d)))}a=i[u-1],a?Be(o)&&Be(a)?(c=c,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?c.t+=o.t:(r.push(c),c=o)):Be(o)||Be(a)?(c=c,r.push(c),c=o):c=(c||"")+o:c=o}return c!=null&&r.push(c),r}function $D(n){return n.replace(/ /g," ")}var er;(function(n){function e(u){const d="data:";return u.substr(0,d.length)===d}n.isDataUrl=e;function t(u,d){if(!u||e(u)){setTimeout(()=>d(null,u));return}const f=()=>{d(new Error(`Failed to load image: ${u}`))},h=window.FileReader?g=>{if(g.status===200){const m=new FileReader;m.onload=y=>{const b=y.target.result;d(null,b)},m.onerror=f,m.readAsDataURL(g.response)}else f()}:g=>{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(g.status===200){let y=u.split(".").pop()||"png";y==="svg"&&(y="svg+xml");const b=`data:image/${y};base64,`,w=new Uint8Array(g.response),x=b+btoa(m(w));d(null,x)}else f()},p=new XMLHttpRequest;p.responseType=window.FileReader?"blob":"arraybuffer",p.open("GET",u,!0),p.addEventListener("error",f),p.addEventListener("load",()=>h(p)),p.send()}n.imageToDataUri=t;function s(u){let d=u.replace(/\s/g,"");d=decodeURIComponent(d);const f=d.indexOf(","),h=d.slice(0,f),p=h.split(":")[1].split(";")[0],g=d.slice(f+1);let m;h.indexOf("base64")>=0?m=atob(g):m=unescape(encodeURIComponent(g));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:p})}n.dataUriToBlob=s;function r(u,d){const f=window.navigator.msSaveBlob;if(f)f(u,d);else{const h=window.URL.createObjectURL(u),p=document.createElement("a");p.href=h,p.download=d,document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(h)}}n.downloadBlob=r;function i(u,d){const f=s(u);r(f,d)}n.downloadDataUri=i;function o(u){const d=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return d&&d[2]?d[2].replace(/\s+/," ").split(" "):null}function a(u){const d=parseFloat(u);return Number.isNaN(d)?null:d}function c(u,d={}){let f=null;const h=x=>(f==null&&(f=o(u)),f!=null?a(f[x]):null),p=x=>{const v=u.match(x);return v&&v[2]?a(v[2]):null};let g=d.width;if(g==null&&(g=p(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=h(2)),g==null)throw new Error("Can not parse width from svg string");let m=d.height;if(m==null&&(m=p(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),m==null&&(m=h(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=c})(er||(er={}));let tr;const zD={px(n){return n},mm(n){return tr*n},cm(n){return tr*n*10},in(n){return tr*n*25.4},pt(n){return tr*(25.4*n/72)},pc(n){return tr*(25.4*n/6)}};var Py;(function(n){function e(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 c=o.getBoundingClientRect(),u={width:c.width||0,height:c.height||0};return document.body.removeChild(o),u}n.measure=e;function t(s,r){tr==null&&(tr=e("1","1","mm").width);const i=r?zD[r]:null;return i?i(s):s}n.toPx=t})(Py||(Py={}));const FD=/-(.)/g;function UD(n){return n.replace(FD,(e,t)=>t.toUpperCase())}const Zu={},Ny=["webkit","ms","moz","o"],Ay=typeof document<"u"?document.createElement("div").style:{};function HD(n){for(let e=0;e<Ny.length;e+=1){const t=Ny[e]+n;if(t in Ay)return t}return null}function GD(n){const e=UD(n);if(Zu[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Zu[e]=e in Ay?e:HD(t)}return Zu[e]}function _y(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const WD={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 YD(n){return/^--/.test(n)}function qD(n,e,t){const s=window.getComputedStyle(n,null);return t?s.getPropertyValue(e)||void 0:s[e]||n.style[e]}function XD(n,e){return!WD[n]&&typeof e=="number"?`${e}px`:e}function Je(n,e,t){if(typeof e=="string"){const s=YD(e);if(s||(e=GD(e)),t===void 0)return qD(n,e,s);s||(t=XD(e,t));const r=n.style;s?r.setProperty(e,t):r[e]=t;return}for(const s in e)Je(n,s,e[s])}const tl=new WeakMap;function Ty(n,e){const t=la(e),s=tl.get(n);if(s)return s[t]}function JD(n,e,t){const s=la(e),r=tl.get(n);r?r[s]=t:tl.set(n,{[s]:t})}function nr(n,e,t){if(!e){const s={};return Object.keys(tl).forEach(r=>{s[r]=Ty(n,r)}),s}if(typeof e=="string"){if(t===void 0)return Ty(n,e);JD(n,e,t);return}for(const s in e)nr(n,s,e[s])}class oe{get[Symbol.toStringTag](){return oe.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,s){if(!e)throw new TypeError("Invalid element to create vector");let r;if(oe.isVector(e))r=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")r=Qa();else if(e[0]==="<"){const i=Qa(e);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(it.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),s&&this.append(s)}transform(e,t){return e==null?Yr(this.node):(Yr(this.node,e,t),this)}translate(e,t=0,s={}){return e==null?$y(this.node):($y(this.node,e,t,s),this)}rotate(e,t,s,r={}){return e==null?td(this.node):(td(this.node,e,t,s,r),this)}scale(e,t){return e==null?nd(this.node):(nd(this.node,e,t),this)}getTransformToElement(e){const t=oe.toNode(e);return io(this.node,t)}removeAttribute(e){return Xu(this.node,e),this}getAttribute(e){return BD(this.node,e)}setAttribute(e,t){return Ju(this.node,e,t),this}setAttributes(e){return Oy(this.node,e),this}attr(e,t){return e==null?pe(this.node):typeof e=="string"&&t===void 0?pe(this.node,e):(typeof e=="object"?pe(this.node,e):pe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:oe.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?oe.create(t):oe.create("defs").appendTo(e)}text(e,t={}){return Vy(this.node,e,t),this}tagName(){return DD(this.node)}clone(){return oe.create(this.node.cloneNode(!0))}remove(){return Yt(this.node),this}empty(){return eo(this.node),this}append(e){return Lt(this.node,oe.toNodes(e)),this}appendTo(e){return xs(this.node,oe.isVector(e)?e.node:e),this}prepend(e){return Cy(this.node,oe.toNodes(e)),this}before(e){return qu(this.node,oe.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(oe.toNode(e),this.node),oe.create(e)}first(){return this.node.firstChild?oe.create(this.node.firstChild):null}last(){return this.node.lastChild?oe.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?oe.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(oe.toNode(e))}find(e){const t=[],s=RD(this.node,e);if(s)for(let r=0,i=s.length;r<i;r+=1)t.push(oe.create(s[r]));return t}findOne(e){const t=ID(this.node,e);return t?oe.create(t):null}findParentByClass(e,t){const s=vy(this.node,e,t);return s?oe.create(s):null}matches(e){const t=this.node;this.node.matches;const s=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return s&&s.call(t,e)}contains(e){return Yu(this.node,oe.isVector(e)?e.node:e)}wrap(e){const t=oe.create(e),s=this.node.parentNode;return s!=null&&s.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=oe.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=oe.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let s=0;s<e.length;s+=1)e[s].nodeType===1&&t.push(oe.create(e[s]));return t}eachChild(e,t){const s=this.children();for(let r=0,i=s.length;r<i;r+=1)e.call(s[r],s[r],r,s),t&&s[r].eachChild(e,t);return this}index(){return Wu(this.node)}hasClass(e){return _n(this.node,e)}addClass(e){return ee(this.node,e),this}removeClass(e){return Ie(this.node,e),this}toggleClass(e,t){return mn(this.node,e,t),this}toLocalPoint(e,t){return mR(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?eR(this.node,e):[]}toPath(){return oe.create(aR(this.node))}toPathData(){return By(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],c=o;return(a==null||a===n.toStringTag)&&c.node instanceof SVGElement&&typeof c.sample=="function"&&typeof c.toPath=="function"}n.isVector=e;function t(o,a,c){return new n(o,a,c)}n.create=t;function s(o){if(o[0]==="<"){const a=Qa(o),c=[];for(let u=0,d=a.childNodes.length;u<d;u+=1){const f=a.childNodes[u];c.push(t(document.importNode(f,!0)))}return c}return[t(o)]}n.createVectors=s;function r(o){return e(o)?o.node:o}n.toNode=r;function i(o){return Array.isArray(o)?o.map(a=>r(a)):[r(o)]}n.toNodes=i})(oe||(oe={}));function KD(n,e){const t=oe.create(e),s=oe.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=oe.create("path").attr("d",r).appendTo(t.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function ZD(n,e,t){const s=t.eol,r=t.baseSize,i=t.lineHeight;let o=0,a;const c={},u=e.length-1;for(let d=0;d<=u;d+=1){let f=e[d],h=null;if(typeof f=="object"){const p=f.attrs,g=oe.create("tspan",p);a=g.node;let m=f.t;s&&d===u&&(m+=s),a.textContent=m;const y=p.class;y&&g.addClass(y),t.includeAnnotationIndices&&g.attr("annotations",f.annotations.join(",")),h=parseFloat(p["font-size"]),h===void 0&&(h=r),h&&h>o&&(o=h)}else s&&d===u&&(f+=s),a=document.createTextNode(f||" "),r&&r>o&&(o=r);n.appendChild(a)}return o&&(c.maxFontSize=o),i?c.lineHeight=i:o&&(c.lineHeight=o*1.2),c}const ky=/em$/;function nl(n,e){const t=parseFloat(n);return ky.test(n)?t*e:t}function QD(n,e,t,s){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let i=e[0];const o=nl(i.maxFontSize,t)||t;let a=0;const c=nl(s,t);for(let f=1;f<r;f+=1){i=e[f];const h=nl(i.lineHeight,t)||c;a+=h}const u=nl(i.maxFontSize,t)||t;let d;switch(n){case"middle":d=o/2-.15*u-a/2;break;case"bottom":d=-(.25*u)-a;break;case"top":default:d=.8*o;break}return d}function Vy(n,e,t={}){e=$D(e);const s=t.eol;let r=t.textPath;const i=t.textVerticalAnchor,o=i==="middle"||i==="bottom"||i==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const c=t.includeAnnotationIndices;let u=t.annotations;u&&!Array.isArray(u)&&(u=[u]);const d=t.lineHeight,f=d==="auto",h=f?"1.5em":d||"1em";let p=!0;const g=n.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&eo(n),pe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const m=pe(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&pe(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=KD(r,n)):b=document.createDocumentFragment();let w,x=0,v;const C=e.split(`
39
- `),E=[],S=C.length-1;for(let A=0;A<=S;A+=1){w=h;let k="v-line";const _=yn("tspan");let V,L=C[A];if(L)if(u){const B=jD(L,u,{offset:-x,includeAnnotationIndices:c});V=ZD(_,B,{eol:A!==S&&s,baseSize:y,lineHeight:f?null:h,includeAnnotationIndices:c});const N=V.lineHeight;N&&f&&A!==0&&(w=N),A===0&&(v=V.maxFontSize*.8)}else s&&A!==S&&(L+=s),_.textContent=L;else{_.textContent="-",k+=" v-empty-line";const B=_.style;B.fillOpacity=0,B.strokeOpacity=0,u&&(V={})}V&&E.push(V),A>0&&_.setAttribute("dy",w),(A>0||r)&&_.setAttribute("x",a),_.className.baseVal=k,b.appendChild(_),x+=L.length+1}if(o)if(u)w=QD(i,E,y,h);else if(i==="top")w="0.8em";else{let A;switch(S>0?(A=parseFloat(h)||1,A*=S,ky.test(h)||(A/=y)):A=0,i){case"middle":w=`${.3-A/2}em`;break;case"bottom":w=`${-A-.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 no(n,e={}){const t=document.createElement("canvas").getContext("2d");if(!n)return{width:0};const s=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return s.push(e["font-style"]||"normal"),s.push(e["font-variant"]||"normal"),s.push(e["font-weight"]||400),s.push(r),s.push(e["font-family"]||"sans-serif"),t.font=s.join(" "),t.measureText(n)}function Dy(n,e,t,s={}){if(e>=t)return[n,""];const r=n.length,i={};let o=Math.round(e/t*r-1);for(o<0&&(o=0);o>=0&&o<r;){const a=n.slice(0,o),c=i[a]||no(a,s).width,u=n.slice(0,o+1),d=i[u]||no(u,s).width;if(i[a]=c,i[u]=d,c>e)o-=1;else if(d<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function Ry(n,e,t={},s={}){const r=e.width,i=e.height,o=s.eol||`
40
- `,a=t.fontSize||14,c=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(a*1.4),u=Math.floor(i/c);if(n.indexOf(o)>-1){const y=Za(),b=[];return n.split(o).map(w=>{const x=Ry(w,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),t,Object.assign(Object.assign({},s),{eol:y}));x&&b.push(...x.split(y))}),b.slice(0,u).join(o)}const{width:d}=no(n,t);if(d<r)return n;const f=[];let h=n,p=d,g=s.ellipsis,m=0;g&&(typeof g!="string"&&(g="…"),m=no(g,t).width);for(let y=0;y<u;y+=1)if(p>r)if(y===u-1){const[w]=Dy(h,r-m,p,t);f.push(g?`${w}${g}`:w)}else{const[w,x]=Dy(h,r,p,t);f.push(w),h=x,p=no(h,t).width}else{f.push(h);break}return f.join(o)}const Qu=.551784;function ut(n,e,t=NaN){const s=n.getAttribute(e);if(s==null)return t;const r=parseFloat(s);return Number.isNaN(r)?t:r}function eR(n,e=1){const t=n.getTotalLength(),s=[];let r=0,i;for(;r<t;)i=n.getPointAtLength(r),s.push({distance:r,x:i.x,y:i.y}),r+=e;return s}function tR(n){return["M",ut(n,"x1"),ut(n,"y1"),"L",ut(n,"x2"),ut(n,"y2")].join(" ")}function nR(n){const e=sl(n);return e.length===0?null:`${Iy(e)} Z`}function sR(n){const e=sl(n);return e.length===0?null:Iy(e)}function Iy(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function sl(n){const e=[],t=n.points;if(t)for(let s=0,r=t.numberOfItems;s<r;s+=1)e.push(t.getItem(s));return e}function rR(n){const e=ut(n,"cx",0),t=ut(n,"cy",0),s=ut(n,"r"),r=s*Qu;return["M",e,t-s,"C",e+r,t-s,e+s,t-r,e+s,t,"C",e+s,t+r,e+r,t+s,e,t+s,"C",e-r,t+s,e-s,t+r,e-s,t,"C",e-s,t-r,e-r,t-s,e,t-s,"Z"].join(" ")}function iR(n){const e=ut(n,"cx",0),t=ut(n,"cy",0),s=ut(n,"rx"),r=ut(n,"ry")||s,i=s*Qu,o=r*Qu;return["M",e,t-r,"C",e+i,t-r,e+s,t-o,e+s,t,"C",e+s,t+o,e+i,t+r,e,t+r,"C",e-i,t+r,e-s,t+o,e-s,t,"C",e-s,t-o,e-i,t-r,e,t-r,"Z"].join(" ")}function oR(n){return Ly({x:ut(n,"x",0),y:ut(n,"y",0),width:ut(n,"width",0),height:ut(n,"height",0),rx:ut(n,"rx",0),ry:ut(n,"ry",0)})}function Ly(n){let e;const t=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),c=Math.min(n.ry||n["top-ry"]||0,i/2),u=Math.min(n.ry||n["bottom-ry"]||0,i/2);return o||a||c||u?e=["M",t,s+c,"v",i-c-u,"a",a,u,0,0,0,a,u,"h",r-2*a,"a",a,u,0,0,0,a,-u,"v",-(i-u-c),"a",o,c,0,0,0,-o,-c,"h",-(r-2*o),"a",o,c,0,0,0,-o,c,"Z"]:e=["M",t,s,"H",t+r,"V",s+i,"H",t,"V",s,"Z"],e.join(" ")}function aR(n){const e=yn("path");pe(e,pe(n));const t=By(n);return t&&e.setAttribute("d",t),e}function By(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return tR(n);case"polygon":return nR(n);case"polyline":return sR(n);case"ellipse":return iR(n);case"circle":return rR(n);case"rect":return oR(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const lR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,jy=/[ ,]+/,cR=/^(\w+)\((.*)\)/;function uR(n,e){const s=yn("svg").createSVGPoint();return s.x=n,s.y=e,s}function ot(n){const t=yn("svg").createSVGMatrix();if(n!=null){const s=n,r=t;for(const i in s)r[i]=s[i]}return t}function so(n){const e=yn("svg");return n!=null?(n instanceof DOMMatrix||(n=ot(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function ro(n){let e=ot();const t=n!=null&&n.match(lR);if(!t)return e;for(let s=0,r=t.length;s<r;s+=1){const o=t[s].match(cR);if(o){let a,c,u,d,f,h=ot();const p=o[2].split(jy);switch(o[1].toLowerCase()){case"scale":a=parseFloat(p[0]),c=p[1]===void 0?a:parseFloat(p[1]),h=h.scaleNonUniform(a,c);break;case"translate":u=parseFloat(p[0]),d=parseFloat(p[1]),h=h.translate(u,d);break;case"rotate":f=parseFloat(p[0]),u=parseFloat(p[1])||0,d=parseFloat(p[2])||0,u!==0||d!==0?h=h.translate(u,d).rotate(f).translate(-u,-d):h=h.rotate(f);break;case"skewx":f=parseFloat(p[0]),h=h.skewX(f);break;case"skewy":f=parseFloat(p[0]),h=h.skewY(f);break;case"matrix":h.a=parseFloat(p[0]),h.b=parseFloat(p[1]),h.c=parseFloat(p[2]),h.d=parseFloat(p[3]),h.e=parseFloat(p[4]),h.f=parseFloat(p[5]);break;default:continue}e=e.multiply(h)}}return e}function Wr(n){const e=n||{},t=e.a!=null?e.a:1,s=e.b!=null?e.b:0,r=e.c!=null?e.c:0,i=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${s},${r},${i},${o},${a})`}function rl(n){let e,t,s;if(n){const i=jy;if(n.trim().indexOf("matrix")>=0){const o=ro(n),a=dR(o);e=[a.translateX,a.translateY],t=[a.rotation],s=[a.scaleX,a.scaleY];const c=[];(e[0]!==0||e[1]!==0)&&c.push(`translate(${e.join(",")})`),(s[0]!==1||s[1]!==1)&&c.push(`scale(${s.join(",")})`),t[0]!==0&&c.push(`rotate(${t[0]})`),n=c.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(i));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(i));const c=n.match(/scale\((.*?)\)/);c&&(s=c[1].split(i))}}const r=s&&s[0]?parseFloat(s[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:r,sy:s&&s[1]?parseFloat(s[1]):r}}}function ed(n,e){const t=e.x*n.a+e.y*n.c+0,s=e.x*n.b+e.y*n.d+0;return{x:t,y:s}}function dR(n){const e=ed(n,{x:0,y:1}),t=ed(n,{x:1,y:0}),s=180/Math.PI*Math.atan2(e.y,e.x)-90,r=180/Math.PI*Math.atan2(t.y,t.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 hR(n){let e,t,s,r;return n?(e=n.a==null?1:n.a,r=n.d==null?1:n.d,t=n.b,s=n.c):e=r=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:s?Math.sqrt(s*s+r*r):r}}function fR(n){let e={x:0,y:1};n&&(e=ed(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function pR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Yr(n,e,t={}){if(e==null)return ro(pe(n,"transform"));if(t.absolute){n.setAttribute("transform",Wr(e));return}const s=n.transform,r=so(e);s.baseVal.appendItem(r)}function $y(n,e,t=0,s={}){let r=pe(n,"transform");const i=rl(r);if(e==null)return i.translation;r=i.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=s.absolute?e:i.translation.tx+e,a=s.absolute?t:i.translation.ty+t,c=`translate(${o},${a})`;n.setAttribute("transform",`${c} ${r}`.trim())}function td(n,e,t,s,r={}){let i=pe(n,"transform");const o=rl(i);if(e==null)return o.rotation;i=o.raw,i=i.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=r.absolute?e:o.rotation.angle+e,c=t!=null&&s!=null?`,${t},${s}`:"",u=`rotate(${a}${c})`;n.setAttribute("transform",`${i} ${u}`.trim())}function nd(n,e,t){let s=pe(n,"transform");const r=rl(s);if(e==null)return r.scale;t=t??e,s=r.raw,s=s.replace(/scale\([^)]*\)/g,"").trim();const i=`scale(${e},${t})`;n.setAttribute("transform",`${s} ${i}`.trim())}function io(n,e){if(ws(e)&&ws(n)){const t=e.getScreenCTM(),s=n.getScreenCTM();if(t&&s)return t.inverse().multiply(s)}return ot()}function gR(n,e){let t=ot();if(ws(e)&&ws(n)){let s=n;const r=[];for(;s&&s!==e;){const i=s.getAttribute("transform")||null,o=ro(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{t=t.multiply(i)})}return t}function mR(n,e,t){const s=n instanceof SVGSVGElement?n:n.ownerSVGElement,r=s.createSVGPoint();r.x=e,r.y=t;try{const i=s.getScreenCTM(),o=r.matrixTransform(i.inverse()),a=io(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var qt;(function(n){const e={};function t(i){return e[i]||{}}n.get=t;function s(i,o){e[i]=o}n.register=s;function r(i){delete e[i]}n.unregister=r})(qt||(qt={}));var sr;(function(n){const e=new WeakMap;function t(i){return e.has(i)||e.set(i,{events:Object.create(null)}),e.get(i)}n.ensure=t;function s(i){return e.get(i)}n.get=s;function r(i){return e.delete(i)}n.remove=r})(sr||(sr={}));var ce;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(r){r.stopPropagation()}n.stopPropagationCallback=e;function t(r,i,o){r.addEventListener!=null&&r.addEventListener(i,o)}n.addEventListener=t;function s(r,i,o){r.removeEventListener!=null&&r.removeEventListener(i,o)}n.removeEventListener=s})(ce||(ce={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function s(a){return(a||"").match(e)||[""]}n.splitType=s;function r(a){const c=t.exec(a)||[];return{originType:c[1]?c[1].trim():c[1],namespaces:c[2]?c[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,c){if(c){const u=a;return u.querySelector!=null&&u.querySelector(c)!=null}return!0}n.isValidSelector=o}(ce||(ce={})),function(n){let e=0;const t=new WeakMap;function s(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=s;function r(a){return t.get(a)}n.getHandlerId=r;function i(a){return t.delete(a)}n.removeHandlerId=i;function o(a,c){return t.set(a,c)}n.setHandlerId=o}(ce||(ce={})),function(n){function e(t,s){const r=[],i=sr.get(t),o=i&&i.events&&i.events[s.type],a=o&&o.handlers||[],c=o?o.delegateCount:0;if(c>0&&!(s.type==="click"&&typeof s.button=="number"&&s.button>=1)){for(let u=s.target;u!==t;u=u.parentNode||t)if(u.nodeType===1&&!(s.type==="click"&&u.disabled===!0)){const d=[],f={};for(let h=0;h<c;h+=1){const p=a[h],g=p.selector;if(g!=null&&f[g]==null){const m=t,y=[];m.querySelectorAll(g).forEach(b=>{y.push(b)}),f[g]=y.includes(u)}f[g]&&d.push(p)}d.length&&r.push({elem:u,handlers:d})}}return c<a.length&&r.push({elem:t,handlers:a.slice(c)}),r}n.getHandlerQueue=e}(ce||(ce={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ce||(ce={})),function(n){function e(t,s){const r=t.nodeType===9?t.documentElement:t,i=s&&s.parentNode;return t===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):t.compareDocumentPosition&&t.compareDocumentPosition(i)&16))}n.contains=e}(ce||(ce={}));class Tn{constructor(e,t){this.isDefaultPrevented=ce.returnFalse,this.isPropagationStopped=ce.returnFalse,this.isImmediatePropagationStopped=ce.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=ce.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ce.returnTrue:ce.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Tn||(Tn={})),function(n){function e(t,s){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof s=="function"?function(){if(this.originalEvent)return s(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(r){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:r})}})}n.addProperty=e}(Tn||(Tn={})),function(n){const e={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(e).forEach(t=>n.addProperty(t,e[t]))}(Tn||(Tn={})),function(n){qt.register("load",{noBubble:!0})}(),function(n){qt.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){qt.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseover"),s}}),qt.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseout"),s}})}();var yR=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},oo;(function(n){let e;function t(o,a,c,u,d){if(!ce.isValidTarget(o))return;let f;if(typeof c!="function"){const{handler:m,selector:y}=c,b=yR(c,["handler","selector"]);c=m,d=y,f=b}const h=sr.ensure(o);let p=h.handler;p==null&&(p=h.handler=function(m,...y){return e!==m.type?r(o,m,...y):void 0});const g=ce.ensureHandlerId(c);ce.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=ce.normalizeType(m);if(!y)return;let w=y,x=qt.get(w);w=(d?x.delegateType:x.bindType)||w,x=qt.get(w);const v=Object.assign({type:w,originType:y,data:u,selector:d,guid:g,handler:c,namespace:b.join(".")},f),C=h.events;let E=C[w];E||(E=C[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,p)===!1)&&ce.addEventListener(o,w,p)),x.add&&(ce.removeHandlerId(v.handler),x.add(o,v),ce.setHandlerId(v.handler,g)),d?(E.handlers.splice(E.delegateCount,0,v),E.delegateCount+=1):E.handlers.push(v)})}n.on=t;function s(o,a,c,u,d){const f=sr.get(o);if(!f)return;const h=f.events;h&&(ce.splitType(a).forEach(p=>{const{originType:g,namespaces:m}=ce.normalizeType(p);if(!g){Object.keys(h).forEach(C=>{s(o,C+p,c,u,!0)});return}let y=g;const b=qt.get(y);y=(u?b.delegateType:b.bindType)||y;const w=h[y];if(!w)return;const x=m.length>0?new RegExp(`(^|\\.)${m.join("\\.(?:.*\\.|)")}(\\.|$)`):null,v=w.handlers.length;for(let C=w.handlers.length-1;C>=0;C-=1){const E=w.handlers[C];(d||g===E.originType)&&(!c||ce.getHandlerId(c)===E.guid)&&(x==null||E.namespace&&x.test(E.namespace))&&(u==null||u===E.selector||u==="**"&&E.selector)&&(w.handlers.splice(C,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)&&ce.removeEventListener(o,y,f.handler),delete h[y])}),Object.keys(h).length===0&&sr.remove(o))}n.off=s;function r(o,a,...c){const u=Tn.create(a);u.delegateTarget=o;const d=qt.get(u.type);if(d.preDispatch&&d.preDispatch(o,u)===!1)return;const f=ce.getHandlerQueue(o,u);for(let h=0,p=f.length;h<p&&!u.isPropagationStopped();h+=1){const g=f[h];u.currentTarget=g.elem;for(let m=0,y=g.handlers.length;m<y&&!u.isImmediatePropagationStopped();m+=1){const b=g.handlers[m];if(u.rnamespace==null||b.namespace&&u.rnamespace.test(b.namespace)){u.handleObj=b,u.data=b.data;const w=qt.get(b.originType).handle,x=w?w(g.elem,u,...c):b.handler.call(g.elem,u,...c);x!==void 0&&(u.result=x,x===!1&&(u.preventDefault(),u.stopPropagation()))}}}return d.postDispatch&&d.postDispatch(o,u),u.result}n.dispatch=r;function i(o,a,c,u){let d=o,f=typeof o=="string"?o:o.type,h=typeof o=="string"||d.namespace==null?[]:d.namespace.split(".");const p=c;if(p.nodeType===3||p.nodeType===8)return;f.indexOf(".")>-1&&(h=f.split("."),f=h.shift(),h.sort());const g=f.indexOf(":")<0&&`on${f}`;d=o instanceof Tn?o:new Tn(f,typeof o=="object"?o:null),d.namespace=h.join("."),d.rnamespace=d.namespace?new RegExp(`(^|\\.)${h.join("\\.(?:.*\\.|)")}(\\.|$)`):null,d.result=void 0,d.target||(d.target=p);const m=[d];Array.isArray(a)?m.push(...a):m.push(a);const y=qt.get(f);if(!u&&y.trigger&&y.trigger(p,d,a)===!1)return;let b;const w=[p];if(!u&&!y.noBubble&&!ce.isWindow(p)){b=y.delegateType||f;let v=p,C=p.parentNode;for(;C!=null;)w.push(C),v=C,C=C.parentNode;const E=p.ownerDocument||document;if(v===E){const S=v.defaultView||v.parentWindow||window;w.push(S)}}let x=p;for(let v=0,C=w.length;v<C&&!d.isPropagationStopped();v+=1){const E=w[v];x=E,d.type=v>1?b:y.bindType||f;const S=sr.get(E);S&&S.events[d.type]&&S.handler&&S.handler.call(E,...m);const O=g&&E[g]||null;O&&ce.isValidTarget(E)&&(d.result=O.call(E,...m),d.result===!1&&d.preventDefault())}if(d.type=f,!u&&!d.isDefaultPrevented()){const v=y.preventDefault;if((v==null||v(w.pop(),d,a)===!1)&&ce.isValidTarget(p)&&g&&typeof p[f]=="function"&&!ce.isWindow(p)){const C=p[g];C&&(p[g]=null),e=f,d.isPropagationStopped()&&x.addEventListener(f,ce.stopPropagationCallback),p[f](),d.isPropagationStopped()&&x.removeEventListener(f,ce.stopPropagationCallback),e=void 0,C&&(p[g]=C)}}return d.result}n.trigger=i})(oo||(oo={}));var dt;(function(n){function e(i,o,a,c,u){return ao.on(i,o,a,c,u),i}n.on=e;function t(i,o,a,c,u){return ao.on(i,o,a,c,u,!0),i}n.once=t;function s(i,o,a,c){return ao.off(i,o,a,c),i}n.off=s;function r(i,o,a,c){return oo.trigger(o,a,i,c),i}n.trigger=r})(dt||(dt={}));var ao;(function(n){function e(s,r,i,o,a,c){if(typeof r=="object"){typeof i!="string"&&(o=o||i,i=void 0),Object.keys(r).forEach(u=>e(s,u,i,o,r[u],c));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=ce.returnFalse;else if(!a)return;if(c){const u=a;a=function(d,...f){return n.off(s,d),u.call(this,d,...f)},ce.setHandlerId(a,ce.ensureHandlerId(u))}oo.on(s,r,a,o,i)}n.on=e;function t(s,r,i,o){const a=r;if(a&&a.preventDefault!=null&&a.handleObj!=null){const c=a.handleObj;t(a.delegateTarget,c.namespace?`${c.originType}.${c.namespace}`:c.originType,c.selector,c.handler);return}if(typeof r=="object"){const c=r;Object.keys(c).forEach(u=>t(s,u,i,c[u]));return}(i===!1||typeof i=="function")&&(o=i,i=void 0),o===!1&&(o=ce.returnFalse),oo.off(s,r,o,i)}n.off=t})(ao||(ao={}));class zy{constructor(e,t,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=bs.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,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(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function sd(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function bR(n){return n.getBoundingClientRect().width}function wR(n){return n.getBoundingClientRect().height}function Fy(n,e=60){let t=null;return(...s)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,s)},e)}}function xR(n){let e=null,t=[];const s=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const c=document.createElement("object");return c.onload=()=>{c.contentDocument.defaultView.addEventListener("resize",r),r()},c.style.display="block",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.height="100%",c.style.width="100%",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="-1",c.style.opacity="0",c.setAttribute("tabindex","-1"),c.type="text/html",n.appendChild(c),c.data="about:blank",c},r=Fy(()=>{t.forEach(c=>c(n))}),i=c=>{e||(e=s()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}function vR(n){let e=null,t=[];const s=Fy(()=>{t.forEach(c=>{c(n)})}),r=()=>{const c=new ResizeObserver(s);return c.observe(n),s(),c},i=c=>{e||(e=r()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}const CR=typeof ResizeObserver<"u"?vR:xR;var il;(function(n){const e=new WeakMap;function t(r){let i=e.get(r);return i||(i=CR(r),e.set(r,i),i)}function s(r){r.destroy(),e.delete(r.element)}n.bind=(r,i)=>{const o=t(r);return o.bind(i),()=>o.unbind(i)},n.clear=r=>{const i=t(r);s(i)}})(il||(il={}));class lo{constructor(e={}){this.comparator=e.comparator||lo.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,s){const r={priority:e,value:t},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(e,t){const s=this.index[e];if(typeof s>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const r=this.data,i=r[s].priority,o=this.comparator(t,i);o<0?(r[s].priority=t,this.bubbleUp(s)):o>0&&(r[s].priority=t,this.bubbleDown(s))}remove(){const e=this.data,t=e[0],s=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=s,s.id&&(this.index[s.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let s,r,i=e;for(;i>0&&(r=i-1>>>1,this.comparator(t[i].priority,t[r].priority)<0);){s=t[r],t[r]=t[i];let o=t[i].id;o!=null&&(this.index[o]=r),t[i]=s,o=t[i].id,o!=null&&(this.index[o]=i),i=r}}bubbleDown(e){const t=this.data,s=t.length-1;let r=e;for(;;){const i=(r<<1)+1,o=i+1;let a=r;if(i<=s&&this.comparator(t[i].priority,t[a].priority)<0&&(a=i),o<=s&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==r){const c=t[a];t[a]=t[r];let u=t[r].id;u!=null&&(this.index[u]=a),t[r]=c,u=t[r].id,u!=null&&(this.index[u]=r),r=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(lo||(lo={}));var rd;(function(n){function e(t,s,r=(i,o)=>1){const i={},o={},a={},c=new lo;for(i[s]=0,Object.keys(t).forEach(u=>{u!==s&&(i[u]=1/0),c.insert(i[u],u,u)});!c.isEmpty();){const u=c.remove();a[u]=!0;const d=t[u]||[];for(let f=0;f<d.length;f+=1){const h=d[f];if(!a[h]){const p=i[u]+r(u,h);p<i[h]&&(i[h]=p,o[h]=u,c.updatePriority(h,p))}}}return o}n.run=e})(rd||(rd={}));class Zn{constructor(e,t,s,r){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,s,r);if(typeof e=="string")return Zn.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,s){this.set(e.r+(t.r-e.r)*s,e.g+(t.g-e.g)*s,e.b+(t.b-e.b)*s,e.a+(t.a-e.a)*s)}lighten(e){const t=Zn.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,s,r){const i=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:s,c=Array.isArray(e)?e[3]:r;return this.r=Math.round(Ct(i,0,255)),this.g=Math.round(Ct(o,0,255)),this.b=Math.round(Ct(a,0,255)),this.a=c==null?1:Ct(c,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const s=this[t].toString(16);return s.length<2?`0${s}`:s}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Zn.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return Zn.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 e(x){return new n(x)}n.fromArray=e;function t(x){return new n([...g(x),1])}n.fromHex=t;function s(x){const v=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(v){const C=v[1].split(/\s*,\s*/).map(E=>parseInt(E,10));return new n(C)}return null}n.fromRGBA=s;function r(x,v,C){C<0&&++C,C>1&&--C;const E=6*C;return E<1?x+(v-x)*E:2*C<1?v:3*C<2?x+(v-x)*(2/3-C)*6:x}function i(x){const v=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(v){const C=v[2].split(/\s*,\s*/),E=(parseFloat(C[0])%360+360)%360/360,S=parseFloat(C[1])/100,O=parseFloat(C[2])/100,A=C[3]==null?1:parseInt(C[3],10);return new n(u(E,S,O,A))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return t(x);if(x.startsWith("rgb"))return s(x);const v=n.named[x];return v?t(v):i(x)}n.fromString=o;function a(x,v){return n.fromArray([x,x,x,v])}n.makeGrey=a;function c(x,v,C,E){const S=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:v,A=Array.isArray(x)?x[2]:C,k=Array.isArray(x)?x[3]:E,_=Math.max(S,O,A),V=Math.min(S,O,A),L=(_+V)/2;let B=0,N=0;if(V!==_){const P=_-V;switch(N=L>.5?P/(2-_-V):P/(_+V),_){case S:B=(O-A)/P+(O<A?6:0);break;case O:B=(A-S)/P+2;break;case A:B=(S-O)/P+4;break}B/=6}return[B,N,L,k??1]}n.rgba2hsla=c;function u(x,v,C,E){const S=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:v,A=Array.isArray(x)?x[2]:C,k=Array.isArray(x)?x[3]:E,_=A<=.5?A*(O+1):A+O-A*O,V=2*A-_;return[r(V,_,S+1/3)*256,r(V,_,S)*256,r(V,_,S-1/3)*256,k??1]}n.hsla2rgba=u;function d(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=d;function f(){const x="0123456789ABCDEF";let v="#";for(let C=0;C<6;C+=1)v+=x[Math.floor(Math.random()*16)];return v}n.randomHex=f;function h(x){return d(x).toString()}n.randomRGBA=h;function p(x,v){if(typeof x=="string"){const A=x[0]==="#",[k,_,V]=g(x);return v?k*.299+_*.587+V*.114>186?"#000000":"#ffffff":`${A?"#":""}${m(255-k,255-_,255-V)}`}const C=x[0],E=x[1],S=x[2],O=x[3];return v?C*.299+E*.587+S*.114>186?[0,0,0,O]:[255,255,255,O]:[255-C,255-E,255-S,O]}n.invert=p;function g(x){const v=x.indexOf("#")===0?x:`#${x}`;let C=+`0x${v.substr(1)}`;if(!(v.length===4||v.length===7)||Number.isNaN(C))throw new Error("Invalid hex color.");const E=v.length===4?4:8,S=(1<<E)-1,O=["b","g","r"].map(()=>{const A=C&S;return C>>=E,E===4?17*A:A});return[O[2],O[1],O[0]]}function m(x,v,C){const E=S=>S.length<2?`0${S}`:S;return`${E(x.toString(16))}${E(v.toString(16))}${E(C.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 S=x[0]==="#",O=parseInt(S?x.substr(1):x,16),A=Ct((O>>16)+v,0,255),k=Ct((O>>8&255)+v,0,255),_=Ct((O&255)+v,0,255);return`${S?"#":""}${(_|k<<8|A<<16).toString(16)}`}const C=m(x[0],x[1],x[2]),E=g(w(C,v));return[E[0],E[1],E[2],x[3]]}})(Zn||(Zn={})),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"}}(Zn||(Zn={}));class id{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const s=this.map.get(e);return this.map.delete(e),s}each(e){this.arr.forEach(t=>{const s=this.map.get(t);e(s,t)})}dispose(){this.clear()}}var vs;(function(n){function e(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=e;function t(r,i){if(r!=null&&i!=null){const o=e(r),a=e(i),c=o.or.sort(),u=a.or.sort(),d=o.and.sort(),f=a.and.sort(),h=(p,g)=>p.length===g.length&&(p.length===0||p.every((m,y)=>m===g[y]));return h(c,u)&&h(d,f)}return r==null&&i==null}n.equals=t;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:c}=e(i),u=d=>{const f=`${d.toLowerCase()}Key`;return r[f]===!0};return a.some(d=>u(d))&&c.every(d=>u(d))}n.isMatch=s})(vs||(vs={}));var rr;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,s=t*e;return 4*(e<.5?s:3*(e-t)+s-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,s=1;;t+=s,s/=2)if(e>=(7-4*t)/11){const r=(11-6*t-11*e)/4;return-r*r+s*s}}})(rr||(rr={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,s=1){return r=>{const i=e(r);return i<t?t:i>s?s:i}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(rr||(rr={})),function(n){function e(N){return-1*Math.cos(N*(Math.PI/2))+1}n.easeInSine=e;function t(N){return Math.sin(N*(Math.PI/2))}n.easeOutSine=t;function s(N){return-.5*(Math.cos(Math.PI*N)-1)}n.easeInOutSine=s;function r(N){return N*N}n.easeInQuad=r;function i(N){return N*(2-N)}n.easeOutQuad=i;function o(N){return N<.5?2*N*N:-1+(4-2*N)*N}n.easeInOutQuad=o;function a(N){return N*N*N}n.easeInCubic=a;function c(N){const P=N-1;return P*P*P+1}n.easeOutCubic=c;function u(N){return N<.5?4*N*N*N:(N-1)*(2*N-2)*(2*N-2)+1}n.easeInOutCubic=u;function d(N){return N*N*N*N}n.easeInQuart=d;function f(N){const P=N-1;return 1-P*P*P*P}n.easeOutQuart=f;function h(N){const P=N-1;return N<.5?8*N*N*N*N:1-8*P*P*P*P}n.easeInOutQuart=h;function p(N){return N*N*N*N*N}n.easeInQuint=p;function g(N){const P=N-1;return 1+P*P*P*P*P}n.easeOutQuint=g;function m(N){const P=N-1;return N<.5?16*N*N*N*N*N:1+16*P*P*P*P*P}n.easeInOutQuint=m;function y(N){return N===0?0:Math.pow(2,10*(N-1))}n.easeInExpo=y;function b(N){return N===1?1:-Math.pow(2,-10*N)+1}n.easeOutExpo=b;function w(N){if(N===0||N===1)return N;const P=N*2,T=P-1;return P<1?.5*Math.pow(2,10*T):.5*(-Math.pow(2,-10*T)+2)}n.easeInOutExpo=w;function x(N){const P=N/1;return-1*(Math.sqrt(1-P*N)-1)}n.easeInCirc=x;function v(N){const P=N-1;return Math.sqrt(1-P*P)}n.easeOutCirc=v;function C(N){const P=N*2,T=P-2;return P<1?-.5*(Math.sqrt(1-P*P)-1):.5*(Math.sqrt(1-T*T)+1)}n.easeInOutCirc=C;function E(N,P=1.70158){return N*N*((P+1)*N-P)}n.easeInBack=E;function S(N,P=1.70158){const T=N/1-1;return T*T*((P+1)*T+P)+1}n.easeOutBack=S;function O(N,P=1.70158){const T=N*2,j=T-2,Y=P*1.525;return T<1?.5*T*T*((Y+1)*T-Y):.5*(j*j*((Y+1)*j+Y)+2)}n.easeInOutBack=O;function A(N,P=.7){if(N===0||N===1)return N;const j=N/1-1,Y=1-P,te=Y/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*j)*Math.sin((j-te)*(2*Math.PI)/Y))}n.easeInElastic=A;function k(N,P=.7){const T=1-P,j=N*2;if(N===0||N===1)return N;const Y=T/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*j)*Math.sin((j-Y)*(2*Math.PI)/T)+1}n.easeOutElastic=k;function _(N,P=.65){const T=1-P;if(N===0||N===1)return N;const j=N*2,Y=j-1,te=T/(2*Math.PI)*Math.asin(1);return j<1?-.5*(Math.pow(2,10*Y)*Math.sin((Y-te)*(2*Math.PI)/T)):Math.pow(2,-10*Y)*Math.sin((Y-te)*(2*Math.PI)/T)*.5+1}n.easeInOutElastic=_;function V(N){const P=N/1;if(P<1/2.75)return 7.5625*P*P;if(P<2/2.75){const T=P-.5454545454545454;return 7.5625*T*T+.75}if(P<2.5/2.75){const T=P-.8181818181818182;return 7.5625*T*T+.9375}{const T=P-.9545454545454546;return 7.5625*T*T+.984375}}n.easeOutBounce=V;function L(N){return 1-V(1-N)}n.easeInBounce=L;function B(N){return N<.5?L(N*2)*.5:V(N*2-1)*.5+.5}n.easeInOutBounce=B}(rr||(rr={}));var ir;(function(n){n.number=(e,t)=>{const s=t-e;return r=>e+s*r},n.object=(e,t)=>{const s=Object.keys(e);return r=>{const i={};for(let o=s.length-1;o!==-1;o-=1){const a=s[o];i[a]=e[a]+(t[a]-e[a])*r}return i}},n.unit=(e,t)=>{const s=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=s.exec(e),i=s.exec(t),o=i?i[1]:"",a=r?+r[1]:0,c=i?+i[1]:0,u=o.indexOf("."),d=u>0?o[1].length-u-1:0,f=c-a,h=r?r[2]:"";return p=>(a+f*p).toFixed(d)+h},n.color=(e,t)=>{const s=parseInt(e.slice(1),16),r=parseInt(t.slice(1),16),i=s&255,o=(r&255)-i,a=s&65280,c=(r&65280)-a,u=s&16711680,d=(r&16711680)-u;return f=>{const h=i+o*f&255,p=a+c*f&65280,g=u+d*f&16711680;return`#${(1<<24|h|p|g).toString(16).slice(1)}`}}})(ir||(ir={}));const co=[];function qr(n,e){const t=co.find(s=>s.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!bs.isApplyingHMR()){const s=document.createElement("style");s.setAttribute("type","text/css"),s.textContent=e;const r=document.querySelector("head");r&&r.insertBefore(s,r.firstChild),co.push({name:n,loadTimes:1,styleElement:s})}}function Xr(n){const e=co.findIndex(t=>t.name===n);if(e>-1){const t=co[e];if(t.loadTimes-=1,t.loadTimes>0)return;let s=t.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,co.splice(e,1)}}var ye;(function(n){function e(s){return 180*s/Math.PI%360}n.toDeg=e,n.toRad=function(s,r=!1){return(r?s:s%360)*Math.PI/180};function t(s){return s%360+(s<0?360:0)}n.normalize=t})(ye||(ye={}));var Se;(function(n){function e(a,c=0){return Number.isInteger(a)?a:+a.toFixed(c)}n.round=e;function t(a,c){let u,d;if(c==null?(d=a??1,u=0):(d=c,u=a??0),d<u){const f=u;u=d,d=f}return Math.floor(Math.random()*(d-u+1)+u)}n.random=t;function s(a,c,u){return Number.isNaN(a)?NaN:Number.isNaN(c)||Number.isNaN(u)?0:c<u?a<c?c:a>u?u:a:a<u?u:a>c?c:a}n.clamp=s;function r(a,c){return c*Math.round(a/c)}n.snapToGrid=r;function i(a,c){return c!=null&&a!=null&&c.x>=a.x&&c.x<=a.x+a.width&&c.y>=a.y&&c.y<=a.y+a.height}n.containsPoint=i;function o(a,c){const u=a.x-c.x,d=a.y-c.y;return u*u+d*d}n.squaredLength=o})(Se||(Se={}));class Cs{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class M extends Cs{constructor(e,t){super(),this.x=e??0,this.y=t??0}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this}add(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}update(e,t){const s=M.create(e,t);return this.x=s.x,this.y=s.y,this}translate(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}rotate(e,t){const s=M.rotate(this,e,t);return this.x=s.x,this.y=s.y,this}scale(e,t,s=new M){const r=M.create(s);return this.x=r.x+e*(this.x-r.x),this.y=r.y+t*(this.y-r.y),this}closest(e){if(e.length===1)return M.create(e[0]);let t=null,s=1/0;return e.forEach(r=>{const i=this.squaredDistance(r);i<s&&(t=r,s=i)}),t?M.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=M.create(e),s=this.x-t.x,r=this.y-t.y;return s*s+r*r}manhattanDistance(e){const t=M.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new M){const t=M.create(e),s=-(t.y-this.y),r=t.x-this.x;let i=Math.atan2(s,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let s=this.theta(t)-this.theta(e);return s<0&&(s+=360),s}vectorAngle(e){return new M(0,0).angleBetween(this,e)}toPolar(e){return this.update(M.toPolar(this,e)),this}changeInAngle(e,t,s=new M){return this.clone().translate(-e,-t).theta(s)-this.theta(s)}adhereToRect(e){return Se.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=M.create(e),s=ye.toRad(this.y),r=ye.toRad(t.y),i=this.x,o=t.x,a=ye.toRad(o-i),c=Math.sin(a)*Math.cos(r),u=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(a),d=ye.toDeg(Math.atan2(c,u)),f=["NE","E","SE","S","SW","W","NW","N"];let h=d-22.5;return h<0&&(h+=360),h=parseInt(h/45,10),f[h]}cross(e,t){if(e!=null&&t!=null){const s=M.create(e),r=M.create(t);return(r.x-this.x)*(s.y-this.y)-(r.y-this.y)*(s.x-this.x)}return NaN}dot(e){const t=M.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new M(this.x-e,this.y-t);const s=M.create(e);return new M(this.x-s.x,this.y-s.y)}lerp(e,t){const s=M.create(e);return new M((1-t)*this.x+t*s.x,(1-t)*this.y+t*s.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const s=M.create(e),r=ye.toRad(s.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return M.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Se.snapToGrid(this.x,e),this.y=Se.snapToGrid(this.y,t??e),this}equals(e){const t=M.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return M.clone(this)}toJSON(){return M.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(M||(M={})),function(n){function e(s){return s!=null&&typeof s=="object"&&typeof s.x=="number"&&typeof s.y=="number"}n.isPointLike=e;function t(s){return s!=null&&Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"}n.isPointData=t}(M||(M={})),function(n){function e(f,h){return f==null||typeof f=="number"?new n(f,h):t(f)}n.create=e;function t(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=t;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,h,p=new n){let g=Math.abs(f*Math.cos(h)),m=Math.abs(f*Math.sin(h));const y=t(p),b=ye.normalize(ye.toDeg(h));return b<90?m=-m:b<180?(g=-g,m=-m):b<270&&(g=-g),new n(y.x+g,y.y+m)}n.fromPolar=r;function i(f,h=new n){const p=t(f),g=t(h),m=p.x-g.x,y=p.y-g.y;return new n(Math.sqrt(m*m+y*y),ye.toRad(g.theta(p)))}n.toPolar=i;function o(f,h){return f===h?!0:f!=null&&h!=null?f.x===h.x&&f.y===h.y:!1}n.equals=o;function a(f,h){if(f==null&&h!=null||f!=null&&h==null||f!=null&&h!=null&&f.length!==h.length)return!1;if(f!=null&&h!=null){for(let p=0,g=f.length;p<g;p+=1)if(!o(f[p],h[p]))return!1}return!0}n.equalPoints=a;function c(f,h,p,g){return new n(Se.random(f,h),Se.random(p,g))}n.random=c;function u(f,h,p){const g=ye.toRad(ye.normalize(-h)),m=Math.sin(g),y=Math.cos(g);return d(f,y,m,p)}n.rotate=u;function d(f,h,p,g=new n){const m=t(f),y=t(g),b=m.x-y.x,w=m.y-y.y,x=b*h-w*p,v=w*h+b*p;return new n(x+y.x,v+y.y)}n.rotateEx=d}(M||(M={}));class G extends Cs{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 M(this.x,this.y)}get topLeft(){return new M(this.x,this.y)}get topCenter(){return new M(this.x+this.width/2,this.y)}get topRight(){return new M(this.x+this.width,this.y)}get center(){return new M(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new M(this.x,this.y+this.height)}get bottomCenter(){return new M(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new M(this.x+this.width,this.y+this.height)}get corner(){return new M(this.x+this.width,this.y+this.height)}get rightMiddle(){return new M(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new M(this.x,this.y+this.height/2)}get topLine(){return new K(this.topLeft,this.topRight)}get rightLine(){return new K(this.topRight,this.bottomRight)}get bottomLine(){return new K(this.bottomLeft,this.bottomRight)}get leftLine(){return new K(this.topLeft,this.bottomLeft)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??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(e){if(!e)return this.clone();const t=ye.toRad(e),s=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),i=this.width*r+this.height*s,o=this.width*s+this.height*r;return new G(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this.width=Se.round(this.width,e),this.height=Se.round(this.height,e),this}add(e,t,s,r){const i=G.create(e,t,s,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),c=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=c-o,this.height=u-a,this}update(e,t,s,r){const i=G.create(e,t,s,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(e,t){const s=e,r=t??e;return this.x-=s,this.y-=r,this.width+=2*s,this.height+=2*r,this}snapToGrid(e,t){const s=this.origin.snapToGrid(e,t),r=this.corner.snapToGrid(e,t);return this.x=s.x,this.y=s.y,this.width=r.x-s.x,this.height=r.y-s.y,this}translate(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}scale(e,t,s=new M){const r=this.origin.scale(e,t,s);return this.x=r.x,this.y=r.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const s=ye.toRad(e),r=Math.cos(s),i=Math.sin(s);let o=this.getOrigin(),a=this.getTopRight(),c=this.getBottomRight(),u=this.getBottomLeft();o=M.rotateEx(o,r,i,t),a=M.rotateEx(a,r,i,t),c=M.rotateEx(c,r,i,t),u=M.rotateEx(u,r,i,t);const d=new G(o.x,o.y,0,0);d.add(a.x,a.y,0,0),d.add(c.x,c.y,0,0),d.add(u.x,u.y,0,0),this.update(d)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=G.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const s=G.clone(e),r=t.x,i=t.y;let o=1/0,a=1/0,c=1/0,u=1/0,d=1/0,f=1/0,h=1/0,p=1/0;const g=s.topLeft;g.x<r&&(o=(this.x-r)/(g.x-r)),g.y<i&&(d=(this.y-i)/(g.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&&(c=(this.x+this.width-r)/(y.x-r)),y.y<i&&(h=(this.y-i)/(y.y-i));const b=s.bottomLeft;return b.x<r&&(u=(this.x-r)/(b.x-r)),b.y>i&&(p=(this.y+this.height-i)/(b.y-i)),{sx:Math.min(o,a,c,u),sy:Math.min(d,f,h,p)}}getMaxUniformScaleToFit(e,t=this.center){const s=this.getMaxScaleToFit(e,t);return Math.min(s.sx,s.sy)}containsPoint(e,t){return Se.containsPoint(this,M.create(e,t))}containsRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.x,a=this.y,c=this.width,u=this.height,d=i.x,f=i.y,h=i.width,p=i.height;return c===0||u===0||h===0||p===0?!1:d>=o&&f>=a&&d+h<=o+c&&f+p<=a+u}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=[],r=[];return t.forEach(i=>{const o=e.intersectsWithLine(i);o!==null&&r.indexOf(o.toString())<0&&(s.push(o),r.push(o.toString()))}),s.length>0?s:null}intersectsWithLineFromCenterToPoint(e,t){const s=M.clone(e),r=this.center;let i=null;t!=null&&t!==0&&s.rotate(t,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new K(r,s);for(let c=o.length-1;c>=0;c-=1){const u=o[c].intersectsWithLine(a);if(u!==null){i=u;break}}return i&&t!=null&&t!==0&&i.rotate(-t,r),i}intersectsWithRect(e,t,s,r){const i=G.create(e,t,s,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,c=i.origin,u=i.corner,d=Math.max(o.x,c.x),f=Math.max(o.y,c.y);return new G(d,f,Math.min(a.x,u.x)-d,Math.min(a.y,u.y)-f)}isIntersectWithRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.origin,a=this.corner,c=i.origin,u=i.corner;return!(u.x<=o.x||u.y<=o.y||c.x>=a.x||c.y>=a.y)}normalize(){let e=this.x,t=this.y,s=this.width,r=this.height;return this.width<0&&(e=this.x+this.width,s=-this.width),this.height<0&&(t=this.y+this.height,r=-this.height),this.x=e,this.y=t,this.width=s,this.height=r,this}union(e){const t=G.clone(e),s=this.origin,r=this.corner,i=t.origin,o=t.corner,a=Math.min(s.x,i.x),c=Math.min(s.y,i.y),u=Math.max(r.x,o.x),d=Math.max(r.y,o.y);return new G(a,c,u-a,d-c)}getNearestSideToPoint(e){const t=M.clone(e),s=t.x-this.x,r=this.x+this.width-t.x,i=t.y-this.y,o=this.y+this.height-t.y;let a=s,c="left";return r<a&&(a=r,c="right"),i<a&&(a=i,c="top"),o<a&&(c="bottom"),c}getNearestPointToPoint(e){const t=M.clone(e);if(this.containsPoint(t)){const s=this.getNearestSideToPoint(t);if(s==="left")return new M(this.x,t.y);if(s==="top")return new M(t.x,this.y);if(s==="right")return new M(this.x+this.width,t.y);if(s==="bottom")return new M(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new G(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 e(t){return t!=null&&t instanceof n}n.isRectangle=e})(G||(G={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(G||(G={})),function(n){function e(o,a,c,u){return o==null||typeof o=="number"?new n(o,a,c,u):t(o)}n.create=e;function t(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=t;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}(G||(G={}));class K extends Cs{get center(){return new M((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,s,r){super(),typeof e=="number"&&typeof t=="number"?(this.start=new M(e,t),this.end=new M(s,r)):(this.start=M.create(e),this.end=M.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,s){return this.start.scale(e,t,s),this.end.scale(e,t,s),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const s=e/t;return this.scale(s,s,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:s,end:r}=t,i=s.clone().rotate(270,r),o=r.clone().rotate(90,s);return s.move(o,e),r.move(i,e),t}vector(){return new M(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new M(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=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 G(e,t,s-e,r-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new K(this.start,e).vector()),s=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(s)?0:s}pointAt(e){const t=this.start,s=this.end;return e<=0?t.clone():e>=1?s.clone():t.lerp(s,e)}pointAtLength(e){const t=this.start,s=this.end;let r=!0;e<0&&(r=!1,e=-e);const i=this.length();if(e>=i)return r?s.clone():t.clone();const o=(r?e:i-e)/i;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new K(this.start,t),new K(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new K(this.start,t),new K(t,this.end)]}containsPoint(e){const t=this.start,s=this.end;if(t.cross(e,s)!==0)return!1;const r=this.length();return!(new K(t,e).length()>r||new K(e,s).length()>r)}intersect(e,t){const s=e.intersectsWithLine(this,t);return s?Array.isArray(s)?s:[s]:null}intersectsWithLine(e){const t=new M(this.end.x-this.start.x,this.end.y-this.start.y),s=new M(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*s.y-t.y*s.x,i=new M(e.start.x-this.start.x,e.start.y-this.start.y),o=i.x*s.y-i.y*s.x,a=i.x*t.y-i.y*t.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 M(this.start.x+o*t.x/r,this.start.y+o*t.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=M.clone(e),s=this.start,r=this.end;return((r.x-s.x)*(t.y-s.y)-(r.y-s.y)*(t.x-s.x))/this.length()}pointSquaredDistance(e,t){const s=M.create(e,t);return this.closestPoint(s).squaredDistance(s)}pointDistance(e,t){const s=M.create(e,t);return this.closestPoint(s).distance(s)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAt(e),i=new K(t,s);return i.translate(r.x-t.x,r.y-t.y),i}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAtLength(e),i=new K(t,s);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){const s=M.create(e,t);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 c=r*a-i*o;return c===0&&(c=r*o+i*a,c>0&&(r-=o,i-=a,c=r*o+i*a,c<0&&(c=0))),c<0?-1:c>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new K(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 e(t){return t!=null&&t instanceof n}n.isLine=e})(K||(K={}));class bn extends Cs{get center(){return new M(this.x,this.y)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??0,this.a=s??0,this.b=r??0}bbox(){return G.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const s=e,r=t??e;return this.a+=2*s,this.b+=2*r,this}normalizedDistance(e,t){const s=M.create(e,t),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(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],s=this.a,r=this.b,i=e.start,o=e.end,a=e.vector(),c=i.diff(new M(this.x,this.y)),u=new M(a.x/(s*s),a.y/(r*r)),d=new M(c.x/(s*s),c.y/(r*r)),f=a.dot(u),h=a.dot(d),p=c.dot(d)-1,g=h*h-f*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-h-m)/f,b=(-h+m)/f;if((y<0||y>1)&&(b<0||b>1))return null;y>=0&&y<=1&&t.push(i.lerp(o,y)),b>=0&&b<=1&&t.push(i.lerp(o,b))}else{const m=-h/f;if(m>=0&&m<=1)t.push(i.lerp(o,m));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const s=M.clone(e);t&&s.rotate(t,this.getCenter());const r=s.x-this.x,i=s.y-this.y;let o;if(r===0)return o=this.bbox().getNearestPointToPoint(s),t?o.rotate(-t,this.getCenter()):o;const a=i/r,c=a*a,u=this.a*this.a,d=this.b*this.b;let f=Math.sqrt(1/(1/u+c/d));f=r<0?-f:f;const h=a*f;return o=new M(this.x+f,this.y+h),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=M.clone(e),s=t.x,r=t.y,i=this.a,o=this.b,a=this.bbox().center,c=a.x,u=a.y,d=30,f=s>a.x+i/2,h=s<a.x-i/2;let p,g;return f||h?(g=s>a.x?r-d:r+d,p=i*i/(s-c)-i*i*(r-u)*(g-u)/(o*o*(s-c))+c):(p=r>a.y?s+d:s-d,g=o*o/(r-u)-o*o*(s-c)*(p-c)/(i*i*(r-u))+u),new M(p,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const s=G.fromEllipse(this);s.rotate(e,t);const r=bn.fromRect(s);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new bn(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 e(t){return t!=null&&t instanceof n}n.isEllipse=e})(bn||(bn={})),function(n){function e(r,i,o,a){return r==null||typeof r=="number"?new n(r,i,o,a):t(r)}n.create=e;function t(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=t;function s(r){const i=r.center;return new n(i.x,i.y,r.width/2,r.height/2)}n.fromRect=s}(bn||(bn={}));const SR=new RegExp("^[\\s\\dLMCZz,.]*$");function ER(n){return typeof n!="string"?!1:SR.test(n)}function od(n,e){return(n%e+e)%e}function OR(n,e,t,s,r){const i=[],o=n[n.length-1],a=e!=null&&e>0,c=e||0;if(s&&a){n=n.slice();const f=n[0],h=new M(o.x+(f.x-o.x)/2,o.y+(f.y-o.y)/2);n.splice(0,0,h)}let u=n[0],d=1;for(t?i.push("M",u.x,u.y):i.push("L",u.x,u.y);d<(s?n.length:n.length-1);){let f=n[od(d,n.length)],h=u.x-f.x,p=u.y-f.y;if(a&&(h!==0||p!==0)&&(r==null||r.indexOf(d-1)<0)){let g=Math.sqrt(h*h+p*p);const m=h*Math.min(c,g/2)/g,y=p*Math.min(c,g/2)/g,b=f.x+m,w=f.y+y;i.push("L",b,w);let x=n[od(d+1,n.length)];for(;d<n.length-2&&Math.round(x.x-f.x)===0&&Math.round(x.y-f.y)===0;)x=n[od(d+2,n.length)],d+=1;h=x.x-f.x,p=x.y-f.y,g=Math.max(1,Math.sqrt(h*h+p*p));const v=h*Math.min(c,g/2)/g,C=p*Math.min(c,g/2)/g,E=f.x+v,S=f.y+C;i.push("Q",f.x,f.y,E,S),f=new M(E,S)}else i.push("L",f.x,f.y);u=f,d+=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 Uy(n,e={}){const t=[];return n&&n.length&&n.forEach(s=>{Array.isArray(s)?t.push({x:s[0],y:s[1]}):t.push({x:s.x,y:s.y})}),OR(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ol(n,e,t,s,r=0,i=0,o=0,a,c){if(t===0||s===0)return[];a-=n,c-=e,t=Math.abs(t),s=Math.abs(s);const u=-a/2,d=-c/2,f=Math.cos(r*Math.PI/180),h=Math.sin(r*Math.PI/180),p=f*u+h*d,g=-1*h*u+f*d,m=p*p,y=g*g,b=t*t,w=s*s,x=m/b+y/w;let v;if(x>1)t=Math.sqrt(x)*t,s=Math.sqrt(x)*s,v=0;else{let J=1;i===o&&(J=-1),v=J*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const C=v*t*g/s,E=-1*v*s*p/t,S=f*C-h*E+a/2,O=h*C+f*E+c/2;let A=Math.atan2((g-E)/s,(p-C)/t)-Math.atan2(0,1),k=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-E)/s,(-p-C)/t)-Math.atan2((g-E)/s,(p-C)/t);let _=A>=0?A:2*Math.PI+A;o===0&&_>0?_-=2*Math.PI:o!==0&&_<0&&(_+=2*Math.PI);const V=_*2/Math.PI,L=Math.ceil(V<0?-1*V:V),B=_/L,N=8/3*Math.sin(B/4)*Math.sin(B/4)/Math.sin(B/2),P=f*t,T=f*s,j=h*t,Y=h*s;let te=Math.cos(k),z=Math.sin(k),I=-N*(P*z+Y*te),U=-N*(j*z-T*te),F=0,D=0;const q=[];for(let J=0;J<L;J+=1){k+=B,te=Math.cos(k),z=Math.sin(k),F=P*te-Y*z+S,D=j*te+T*z+O;const ae=-N*(P*z+Y*te),Z=-N*(j*z-T*te),fe=J*6;q[fe]=Number(I+n),q[fe+1]=Number(U+e),q[fe+2]=Number(F-ae+n),q[fe+3]=Number(D-Z+e),q[fe+4]=Number(F+n),q[fe+5]=Number(D+e),I=F+ae,U=D+Z}return q.map(J=>+J.toFixed(2))}function MR(n,e,t,s,r=0,i=0,o=0,a,c){const u=[],d=ol(n,e,t,s,r,i,o,a,c);if(d!=null)for(let f=0,h=d.length;f<h;f+=6)u.push("C",d[f],d[f+1],d[f+2],d[f+3],d[f+4],d[f+5]);return u.join(" ")}class Fe extends Cs{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return Fe.parse(e);this.points=e.map(t=>M.create(t))}else this.points=[]}scale(e,t,s=new M){return this.points.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.points.forEach(s=>s.rotate(e,t)),this}translate(e,t){const s=M.create(e,t);return this.points.forEach(r=>r.translate(s.x,s.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new G;let e=1/0,t=-1/0,s=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const c=i[o],u=c.x,d=c.y;u<e&&(e=u),u>t&&(t=u),d<s&&(s=d),d>r&&(r=d)}return new G(e,s,t-e,r-s)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,s=t.length;if(s===0||s===1)return 0;let r=0,i=0,o=1/0;for(let a=0,c=s-1;a<c;a+=1){const u=new K(t[a],t[a+1]),d=u.length(),f=u.closestPointNormalizedLength(e),p=u.pointAt(f).squaredDistance(e);p<o&&(o=p,i=r+f*d),r+=d}return i}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=M.clone(e),s=t.x,r=t.y,i=this.points,o=i.length;let a=o-1,c=0;for(let u=0;u<o;u+=1){const d=i[a],f=i[u];if(t.equals(d))return!0;const h=new K(d,f);if(h.containsPoint(e))return!0;if(r<=d.y&&r>f.y||r>d.y&&r<=f.y){const p=d.x-s>f.x-s?d.x-s:f.x-s;if(p>=0){const g=new M(s+p,r),m=new K(e,g);h.intersectsWithLine(m)&&(c+=1)}}a=u}return c%2===1}intersectsWithLine(e){const t=[];for(let s=0,r=this.points.length-1;s<r;s+=1){const i=this.points[s],o=this.points[s+1],a=e.intersectsWithLine(new K(i,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const s=this.points[e],r=this.points[e+1];if(new K(s,r).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,s=this.points.length-1;t<s;t+=1){const r=this.points[t],i=this.points[t+1];e+=r.distance(i)}return e}pointAt(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1||e<=0)return t[0].clone();if(e>=1)return t[s-1].clone();const i=this.length()*e;return this.pointAtLength(i)}pointAtLength(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1)return t[0].clone();let r=!0;e<0&&(r=!1,e=-e);let i=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],f=t[u+1],h=new K(d,f),p=d.distance(f);if(e<=i+p)return h.pointAtLength((r?1:-1)*(e-i));i+=p}return(r?t[s-1]:t[0]).clone()}tangentAt(e){const s=this.points.length;if(s===0||s===1)return null;e<0&&(e=0),e>1&&(e=1);const i=this.length()*e;return this.tangentAtLength(i)}tangentAtLength(e){const t=this.points,s=t.length;if(s===0||s===1)return null;let r=!0;e<0&&(r=!1,e=-e);let i,o=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],f=t[u+1],h=new K(d,f),p=d.distance(f);if(h.isDifferentiable()){if(e<=o+p)return h.tangentAtLength((r?1:-1)*(e-o));i=h}o+=p}if(i){const a=r?1:0;return i.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const s=e.threshold||0;let r=0;for(;t[r+2];){const i=r,o=r+1,a=r+2,c=t[i],u=t[o],d=t[a];new K(c,d).closestPoint(u).distance(u)<=s?t.splice(o,1):r+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new Fe;let s=e[0];for(let h=1;h<t;h+=1)(e[h].y<s.y||e[h].y===s.y&&e[h].x>s.x)&&(s=e[h]);const r=[];for(let h=0;h<t;h+=1){let p=s.theta(e[h]);p===0&&(p=360),r.push([e[h],h,p])}if(r.sort((h,p)=>{let g=h[2]-p[2];return g===0&&(g=p[1]-h[1]),g}),r.length>2){const h=r[r.length-1];r.unshift(h)}const i={},o=[],a=h=>`${h[0].toString()}@${h[1]}`;for(;r.length!==0;){const h=r.pop(),p=h[0];if(i[a(h)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(h),g=!0;else{const m=o.pop(),y=m[0],b=o.pop(),w=b[0],x=w.cross(y,p);if(x<0)o.push(b),o.push(m),o.push(h),g=!0;else if(x===0){const C=y.angleBetween(w,p);Math.abs(C-180)<1e-10||y.equals(p)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((C+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 c,u=-1;for(let h=0,p=o.length;h<p;h+=1){const g=o[h][1];(c===void 0||g<c)&&(c=g,u=h)}let d=[];if(u>0){const h=o.slice(u),p=o.slice(0,u);d=h.concat(p)}else d=o;const f=[];for(let h=0,p=d.length;h<p;h+=1)f.push(d[h][0]);return new Fe(f)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,s)=>t.equals(this.points[s]))}clone(){return new Fe(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(Fe||(Fe={})),function(n){function e(t){const s=t.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=e}(Fe||(Fe={}));class je extends Cs{constructor(e,t,s,r){super(),this.PRECISION=3,this.start=M.create(e),this.controlPoint1=M.create(t),this.controlPoint2=M.create(s),this.end=M.create(r)}bbox(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end,i=e.x,o=e.y,a=t.x,c=t.y,u=s.x,d=s.y,f=r.x,h=r.y,p=[],g=[[],[]];let m,y,b,w,x,v,C,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*c+6*d,m=-3*o+9*c-9*d+3*h,b=3*c-3*o),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;w=-b/y,w>0&&w<1&&p.push(w);continue}C=y*y-4*b*m,E=Math.sqrt(C),!(C<0)&&(x=(-y+E)/(2*m),x>0&&x<1&&p.push(x),v=(-y-E)/(2*m),v>0&&v<1&&p.push(v))}let S,O,A,k=p.length;const _=k;for(;k;)k-=1,w=p[k],A=1-w,S=A*A*A*i+3*A*A*w*a+3*A*w*w*u+w*w*w*f,g[0][k]=S,O=A*A*A*o+3*A*A*w*c+3*A*w*w*d+w*w*w*h,g[1][k]=O;p[_]=0,p[_+1]=1,g[0][_]=i,g[1][_]=o,g[0][_+1]=f,g[1][_+1]=h,p.length=_+2,g[0].length=_+2,g[1].length=_+2;const V=Math.min.apply(null,g[0]),L=Math.min.apply(null,g[1]),B=Math.max.apply(null,g[0]),N=Math.max.apply(null,g[1]);return new G(V,L,B-V,N-L)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const s=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,s),s)}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(!r)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){const s=this.getPrecision(t),r=this.getDivisions(t),i=Math.pow(10,-s);let o=null,a=0,c=0,u=0,d=0,f=0,h=null;const p=r.length;let g=p>0?1/p:0;for(r.forEach((m,y)=>{const b=m.start.distance(e),w=m.end.distance(e),x=b+w;(h==null||x<h)&&(o=m,a=y*g,c=(y+1)*g,u=b,d=w,h=x,f=m.endpointDistance())});;){const m=u?Math.abs(u-d)/u:0,y=d!=null?Math.abs(u-d)/d:0,b=m<i||y<i,w=u?u<f*i:!0,x=d?d<f*i:!0;if(b||(w||x))return u<=d?a:c;const C=o.divide(.5);g/=2;const E=C[0].start.distance(e),S=C[0].end.distance(e),O=E+S,A=C[1].start.distance(e),k=C[1].end.distance(e),_=A+k;O<=_?(o=C[0],c-=g,u=E,d=S):(o=C[1],a+=g,u=A,d=k)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const s=this.tAt(e,t);return this.divideAtT(s)}divideAtLength(e,t={}){const s=this.tAtLength(e,t);return this.divideAtT(s)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return[new je(t,t,t,t),new je(t,s,r,i)];if(e>=1)return[new je(t,s,r,i),new je(i,i,i,i)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,c=o.startControlPoint2,u=o.divider,d=o.dividerControlPoint1,f=o.dividerControlPoint2;return[new je(t,a,c,u),new je(u,d,f,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:r.clone()};if(e>=1)return{startControlPoint1:s.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new K(t,s).pointAt(e),a=new K(s,r).pointAt(e),c=new K(r,i).pointAt(e),u=new K(o,a).pointAt(e),d=new K(a,c).pointAt(e),f=new K(u,d).pointAt(e);return{startControlPoint1:o,startControlPoint2:u,divider:f,dividerControlPoint1:d,dividerControlPoint2:c}}getSubdivisions(e={}){const t=this.getPrecision(e);let s=[new je(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return s;let r=this.endpointDistance();const i=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];s.forEach(d=>{const f=d.divide(.5);a.push(f[0],f[1])});const c=a.reduce((d,f)=>d+f.endpointDistance(),0),u=c!==0?(c-r)/c:0;if(o>1&&u<i)return a;s=a,r=c}}length(e={}){return this.getDivisions(e).reduce((s,r)=>s+r.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const s=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:s})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.tAt(e,t);return this.pointAtT(s)}pointAtLength(e,t={}){const s=this.tAtLength(e,t);return this.pointAtT(s)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const s=this.tAt(e,t);return this.tangentAtT(s)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const s=this.tAtLength(e,t);return this.tangentAtT(s)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),s=t.startControlPoint2,r=t.dividerControlPoint1,i=t.divider,o=new K(s,r);return o.translate(i.x-s.x,i.y-s.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),s=this.getDivisions(e);return{precision:t,subdivisions:s}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const s=this.getOptions(t),i=this.length(s)*e;return this.tAtLength(i,s)}tAtLength(e,t={}){let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getDivisions(t),o={precision:r,subdivisions:i};let a=null,c,u,d=0,f=0,h=0;const p=i.length;let g=p>0?1/p:0;for(let b=0;b<p;b+=1){const w=s?b:p-1-b,x=i[b],v=x.endpointDistance();if(e<=h+v){a=x,c=w*g,u=(w+1)*g,d=s?e-h:v+h-e,f=s?v+h-e:e-h;break}h+=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?d/m:0,b<y)return c;if(b=m!==0?f/m:0,b<y)return u;let w,x;const v=a.divide(.5);g/=2;const C=v[0].endpointDistance(),E=v[1].endpointDistance();d<=C?(a=v[0],u-=g,w=d,x=C-w):(a=v[1],c+=g,w=d-C,x=E-w),d=w,f=x}}toPoints(e={}){const t=this.getDivisions(e),s=[t[0].start.clone()];return t.forEach(r=>s.push(r.end.clone())),s}toPolyline(e={}){return new Fe(this.toPoints(e))}scale(e,t,s){return this.start.scale(e,t,s),this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new je(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 e(t){return t!=null&&t instanceof n}n.isCurve=e})(je||(je={})),function(n){function e(r){const i=r.length,o=[],a=[];let c=2;o[0]=r[0]/c;for(let u=1;u<i;u+=1)a[u]=1/c,c=(u<i-1?4:3.5)-a[u],o[u]=(r[u]-o[u-1])/c;for(let u=1;u<i;u+=1)o[i-u-1]-=a[i-u]*o[i-u];return o}function t(r){const i=r.map(h=>M.clone(h)),o=[],a=[],c=i.length-1;if(c===1)return o[0]=new M((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new M(2*o[0].x-i[0].x,2*o[0].y-i[0].y),[o,a];const u=[];for(let h=1;h<c-1;h+=1)u[h]=4*i[h].x+2*i[h+1].x;u[0]=i[0].x+2*i[1].x,u[c-1]=(8*i[c-1].x+i[c].x)/2;const d=e(u);for(let h=1;h<c-1;h+=1)u[h]=4*i[h].y+2*i[h+1].y;u[0]=i[0].y+2*i[1].y,u[c-1]=(8*i[c-1].y+i[c].y)/2;const f=e(u);for(let h=0;h<c;h+=1)o.push(new M(d[h],f[h])),h<c-1?a.push(new M(2*i[h+1].x-d[h+1],2*i[h+1].y-f[h+1])):a.push(new M((i[c].x+d[c-1])/2,(i[c].y+f[c-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=t(r),o=[];for(let a=0,c=i[0].length;a<c;a+=1){const u=new M(i[0][a].x,i[0][a].y),d=new M(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,d,r[a+1]))}return o}n.throughPoints=s}(je||(je={}));class al extends Cs{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(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const s=this.length();return e>=1?s:s*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class mt extends al{constructor(e,t){super(),K.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=M.create(e,t).round(2)}get type(){return"L"}get line(){return new K(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new mt(t[0]),new mt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new mt(t[0]),new mt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new mt(this.end)}scale(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(K.isLine(r))return new n(r);if(M.isPointLike(r))return s===1?new n(r):t.map(o=>new n(o));if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];i.push(new n(a,c))}return i}n.create=e})(mt||(mt={}));class Jr extends al{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 K(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new mt(t[0]):this.clone(),new mt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new mt(t[0]):this.clone(),new mt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new Jr}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(Jr||(Jr={}));class Kr extends al{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,K.isLine(e)||je.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=M.create(e,t).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(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new Kr(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(K.isLine(r))return new n(r);if(je.isCurve(r))return new n(r);if(M.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(t[a])):o.push(new mt(t[a]));return o}if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];o===0?i.push(new n(a,c)):i.push(new mt(a,c))}return i}n.create=e})(Kr||(Kr={}));class Xt extends al{constructor(e,t,s,r,i,o){super(),je.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new M(e,t).round(2),this.controlPoint2=new M(s,r).round(2),this.endPoint=new M(i,o).round(2)):(this.controlPoint1=M.create(e).round(2),this.controlPoint2=M.create(t).round(2),this.endPoint=M.create(s).round(2))}get type(){return"C"}get curve(){return new je(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const s=this.curve.divideAt(e,t);return[new Xt(s[0]),new Xt(s[1])]}divideAtLength(e,t={}){const s=this.curve.divideAtLength(e,t);return[new Xt(s[0]),new Xt(s[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new Xt(t[0]),new Xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}scale(e,t,s){return this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new Xt(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 e=this.controlPoint1,t=this.controlPoint2,s=this.end;return[this.type,e.x,e.y,t.x,t.y,s.x,s.y].join(" ")}}(function(n){function e(...t){const s=t.length,r=t[0];if(je.isCurve(r))return new n(r);if(M.isPointLike(r)){if(s===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<s;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(s===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const i=[];for(let o=0;o<s;o+=6)i.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return i}n.create=e})(Xt||(Xt={}));function ll(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function Hy(n,e,t,s,r,i){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*s,o*r+a*t,o*i+a*s,r,i]}function Gy(n,e,t,s,r,i,o,a,c,u){const d=Math.PI*120/180,f=Math.PI/180*(+r||0);let h=[],p,g,m,y,b;if(u)g=u[0],m=u[1],y=u[2],b=u[3];else{p=ll(n,e,-f),n=p.x,e=p.y,p=ll(a,c,-f),a=p.x,c=p.y;const B=(n-a)/2,N=(e-c)/2;let P=B*B/(t*t)+N*N/(s*s);P>1&&(P=Math.sqrt(P),t=P*t,s=P*s);const T=t*t,j=s*s,Y=(i===o?-1:1)*Math.sqrt(Math.abs((T*j-T*N*N-j*B*B)/(T*N*N+j*B*B)));y=Y*t*N/s+(n+a)/2,b=Y*-s*B/t+(e+c)/2,g=Math.asin((e-b)/s),m=Math.asin((c-b)/s),g=n<y?Math.PI-g:g,m=a<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),o&&g>m&&(g-=Math.PI*2),!o&&m>g&&(m-=Math.PI*2)}let w=m-g;if(Math.abs(w)>d){const B=m,N=a,P=c;m=g+d*(o&&m>g?1:-1),a=y+t*Math.cos(m),c=b+s*Math.sin(m),h=Gy(a,c,t,s,r,0,o,N,P,[m,B,y,b])}w=m-g;const x=Math.cos(g),v=Math.sin(g),C=Math.cos(m),E=Math.sin(m),S=Math.tan(w/4),O=4/3*(t*S),A=4/3*(s*S),k=[n,e],_=[n+O*v,e-A*x],V=[a+O*E,c-A*C],L=[a,c];if(_[0]=2*k[0]-_[0],_[1]=2*k[1]-_[1],u)return[_,V,L].concat(h);{h=[_,V,L].concat(h).join().split(",");const B=[],N=h.length;for(let P=0;P<N;P+=1)B[P]=P%2?ll(+h[P-1],+h[P],f).y:ll(+h[P],+h[P+1],f).x;return B}}function PR(n){if(!n)return null;const e=`
41
- \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),s=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"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(t,(o,a,c)=>{const u=[];let d=a.toLowerCase();c.replace(s,(h,p)=>(p&&u.push(+p),h)),d==="m"&&u.length>2&&(i.push([a,...u.splice(0,2)]),d="l",a=a==="m"?"l":"L");const f=r[d];for(;u.length>=f&&(i.push([a,...u.splice(0,f)]),!!f););return o}),i}function NR(n){const e=PR(n);if(!e||!e.length)return[["M",0,0]];let t=0,s=0,r=0,i=0;const o=[];for(let a=0,c=e.length;a<c;a+=1){const u=[];o.push(u);const d=e[a],f=d[0];if(f!==f.toUpperCase())switch(u[0]=f.toUpperCase(),u[0]){case"A":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+d[6]+t,u[7]=+d[7]+s;break;case"V":u[1]=+d[1]+s;break;case"H":u[1]=+d[1]+t;break;case"M":r=+d[1]+t,i=+d[2]+s;for(let h=1,p=d.length;h<p;h+=1)u[h]=+d[h]+(h%2?t:s);break;default:for(let h=1,p=d.length;h<p;h+=1)u[h]=+d[h]+(h%2?t:s);break}else for(let h=0,p=d.length;h<p;h+=1)u[h]=d[h];switch(u[0]){case"Z":t=+r,s=+i;break;case"H":t=u[1];break;case"V":s=u[1];break;case"M":r=u[u.length-2],i=u[u.length-1],t=u[u.length-2],s=u[u.length-1];break;default:t=u[u.length-2],s=u[u.length-1];break}}return o}function AR(n){const e=NR(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function s(c,u,d){let f,h;if(!c)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(c[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),c[0]){case"M":u.X=c[1],u.Y=c[2];break;case"A":return parseFloat(c[1])===0||parseFloat(c[2])===0?["L",c[6],c[7]]:["C"].concat(Gy.apply(0,[u.x,u.y].concat(c.slice(1))));case"S":return d==="C"||d==="S"?(f=u.x*2-u.bx,h=u.y*2-u.by):(f=u.x,h=u.y),["C",f,h].concat(c.slice(1));case"T":return d==="Q"||d==="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(Hy(u.x,u.y,u.qx,u.qy,c[1],c[2]));case"Q":return u.qx=c[1],u.qy=c[2],["C"].concat(Hy(u.x,u.y,c[1],c[2],c[3],c[4]));case"H":return["L"].concat(c[1],u.y);case"V":return["L"].concat(u.x,c[1])}return c}function r(c,u){if(c[u].length>7){c[u].shift();const d=c[u];for(;d.length;)i[u]="A",u+=1,c.splice(u,0,["C"].concat(d.splice(0,6)));c.splice(u,1),a=e.length}}const i=[];let o="",a=e.length;for(let c=0;c<a;c+=1){let u="";e[c]&&(u=e[c][0]),u!=="C"&&(i[c]=u,c>0&&(o=i[c-1])),e[c]=s(e[c],t,o),i[c]!=="A"&&u==="C"&&(i[c]="C"),r(e,c);const d=e[c],f=d.length;t.x=d[f-2],t.y=d[f-1],t.bx=parseFloat(d[f-4])||t.x,t.by=parseFloat(d[f-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function _R(n){return AR(n).map(e=>e.map(t=>typeof t=="string"?t:Se.round(t,2))).join(",").split(",").join(" ")}class re extends Cs{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(K.isLine(e[0])||je.isCurve(e[0])){let t=null;e.forEach((r,i)=>{i===0&&this.appendSegment(re.createSegment("M",r.start)),t!=null&&!t.end.equals(r.start)&&this.appendSegment(re.createSegment("M",r.start)),K.isLine(r)?this.appendSegment(re.createSegment("L",r.end)):je.isCurve(r)&&this.appendSegment(re.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),t=r})}else e.forEach(s=>{s.isSegment&&this.appendSegment(s)});else e!=null&&(K.isLine(e)?(this.appendSegment(re.createSegment("M",e.start)),this.appendSegment(re.createSegment("L",e.end))):je.isCurve(e)?(this.appendSegment(re.createSegment("M",e.start)),this.appendSegment(re.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):Fe.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,s)=>{const r=s===0?re.createSegment("M",t):re.createSegment("L",t);this.appendSegment(r)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=0;s<t;s+=1){const r=e[s];if(r.isVisible)return r.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=t-1;s>=0;s-=1){const r=e[s];if(r.isVisible)return r.end}return e[t-1].end}moveTo(...e){return this.appendSegment(Kr.create.call(null,...e))}lineTo(...e){return this.appendSegment(mt.create.call(null,...e))}curveTo(...e){return this.appendSegment(Xt.create.call(null,...e))}arcTo(e,t,s,r,i,o,a){const c=this.end||new M,u=typeof o=="number"?ol(c.x,c.y,e,t,s,r,i,o,a):ol(c.x,c.y,e,t,s,r,i,o.x,o.y);if(u!=null)for(let d=0,f=u.length;d<f;d+=6)this.curveTo(u[d],u[d+1],u[d+2],u[d+3],u[d+4],u[d+5]);return this}quadTo(e,t,s,r){const i=this.end||new M,o=["M",i.x,i.y];if(typeof e=="number")o.push("Q",e,t,s,r);else{const c=t;o.push("Q",e.x,e.y,c.x,c.y)}const a=re.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Jr.create())}drawPoints(e,t={}){const s=Uy(e,t),r=re.parse(s);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let s;for(let i=0;i<t;i+=1){const o=e[i];if(o.isVisible){const a=o.bbox();a!=null&&(s=s?s.union(a):a)}}if(s!=null)return s;const r=e[t-1];return new G(r.end.x,r.end.y,0,0)}appendSegment(e){const t=this.segments.length;let s=t!==0?this.segments[t-1]:null,r;const i=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const c=e[o];r=this.prepareSegment(c,s,i),this.segments.push(r),s=r}else e!=null&&e.isSegment&&(r=this.prepareSegment(e,s,i),this.segments.push(r));return this}insertSegment(e,t){const s=this.segments.length;if(e<0&&(e=s+e+1),e>s||e<0)throw new Error("Index out of range.");let r,i=null,o=null;if(s!==0&&(e>=1?(i=this.segments[e-1],o=i.nextSegment):(i=null,o=this.segments[0])),!Array.isArray(t))r=this.prepareSegment(t,i,o),this.segments.splice(e,0,r);else for(let a=0,c=t.length;a<c;a+=1){const u=t[a];r=this.prepareSegment(u,i,o),this.segments.splice(e+a,0,r),i=r}return this}removeSegment(e){const t=this.fixIndex(e),s=this.segments.splice(t,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(e,t){const s=this.fixIndex(e);let r;const i=this.segments[s];let o=i.previousSegment;const a=i.nextSegment;let c=i.isSubpathStart;if(!Array.isArray(t))r=this.prepareSegment(t,o,a),this.segments.splice(s,1,r),c&&r.isSubpathStart&&(c=!1);else{this.segments.splice(e,1);for(let u=0,d=t.length;u<d;u+=1){const f=t[u];r=this.prepareSegment(f,o,a),this.segments.splice(e+u,0,r),o=r,c&&r.isSubpathStart&&(c=!1)}}c&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let s=e;for(;s<0;)s=t+s;if(s>=t||s<0)throw new Error("Index out of range.");return s}segmentAt(e,t={}){const s=this.segmentIndexAt(e,t);return s?this.getSegment(s):null}segmentAtLength(e,t={}){const s=this.segmentIndexAtLength(e,t);return s?this.getSegment(s):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const s=Se.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(e,t={}){const s=this.segments.length;if(s===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,c=null;for(let u=0;u<s;u+=1){const d=r?u:s-1-u,f=this.segments[d],h=o[d],p=f.length({precision:i,subdivisions:h});if(f.isVisible){if(e<=a+p)return d;c=d}a+=p}return c}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),s=[];for(let r=0,i=this.segments.length;r<i;r+=1){const a=this.segments[r].getSubdivisions({precision:t});s.push(a)}return s}updateSubpathStartSegment(e){let t=e.previousSegment,s=e;for(;s&&!s.isSubpathStart;)t!=null?s.subpathStartSegment=t.subpathStartSegment:s.subpathStartSegment=null,t=s,s=s.nextSegment}prepareSegment(e,t,s){e.previousSegment=t,e.nextSegment=s,t!=null&&(t.nextSegment=e),s!=null&&(s.previousSegment=e);let r=e;return e.isSubpathStart&&(e.subpathStartSegment=e,r=s),r!=null&&this.updateSubpathStartSegment(r),e}closestPoint(e,t={}){const s=this.closestPointT(e,t);return s?this.pointAtT(s):null}closestPointLength(e,t={}){const s=this.getOptions(t),r=this.closestPointT(e,s);return r?this.lengthAtT(r,s):0}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(r===0)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isVisible){const f=u.closestPointT(e,{precision:s,subdivisions:d}),h=u.pointAtT(f),p=Se.squaredLength(h,e);p<o&&(i={segmentIndex:a,value:f},o=p)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isDifferentiable()){const f=u.closestPointT(e,{precision:s,subdivisions:d}),h=u.pointAtT(f),p=Se.squaredLength(h,e);p<o&&(i=u.tangentAtT(f),o=p)}}return i||null}containsPoint(e,t={}){const s=this.toPolylines(t);if(!s)return!1;let r=0;for(let i=0,o=s.length;i<o;i+=1)s[i].containsPoint(e)&&(r+=1);return r%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.getOptions(t),i=this.length(s)*e;return this.pointAtLength(i,s)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let u=0,d=this.segments.length;u<d;u+=1){const f=s?u:d-1-u,h=this.segments[f],p=i[f],g=h.length({precision:r,subdivisions:p});if(h.isVisible){if(e<=a+g)return h.pointAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:p});o=h}a+=g}return o?s?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,s=t.length;if(s===0)return null;const r=e.segmentIndex;if(r<0)return t[0].pointAtT(0);if(r>=s)return t[s-1].pointAtT(1);const i=Se.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(this.segments.length===0)return null;const s=Se.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.divideAtLength(o,r)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o=0,a,c,u,d,f;for(let C=0,E=this.segments.length;C<E;C+=1){const S=s?C:E-1-C,O=this.getSegment(S),A=i[S],k={precision:r,subdivisions:A},_=O.length(k);if(O.isDifferentiable()&&(u=O,d=S,e<=o+_)){c=S,a=O.divideAtLength((s?1:-1)*(e-o),k);break}o+=_}if(!u)return null;a||(c=d,f=s?1:0,a=u.divideAtT(f));const h=this.clone(),p=c;h.replaceSegment(p,a);const g=p;let m=p+1,y=p+2;a[0].isDifferentiable()||(h.removeSegment(g),m-=1,y-=1);const b=h.getSegment(m).start;h.insertSegment(m,re.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(h.removeSegment(y-1),y-=1);const w=y-g-1;for(let C=y,E=h.segments.length;C<E;C+=1){const S=this.getSegment(C-w),O=h.getSegment(C);if(O.type==="Z"&&!S.subpathStartSegment.end.equals(O.subpathStartSegment.end)){const A=re.createSegment("L",S.end);h.replaceSegment(C,A)}}const x=new re(h.segments.slice(0,m)),v=new re(h.segments.slice(m));return[x,v]}intersectsWithLine(e,t={}){const s=this.toPolylines(t);if(s==null)return null;let r=null;for(let i=0,o=s.length;i<o;i+=1){const a=s[i],c=e.intersect(a);c&&(r==null&&(r=[]),Array.isArray(c)?r.push(...c):r.push(c))}return r}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let s=0;for(let r=0,i=this.segments.length;r<i;r+=1){const o=this.segments[r],a=t[r];s+=o.length({subdivisions:a})}return s}lengthAtT(e,t={}){const s=this.segments.length;if(s===0)return 0;let r=e.segmentIndex;if(r<0)return 0;let i=Se.clamp(e.value,0,1);r>=s&&(r=s-1,i=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let c=0;for(let f=0;f<r;f+=1){const h=this.segments[f],p=a[f];c+=h.length({precision:o,subdivisions:p})}const u=this.segments[r],d=a[r];return c+=u.lengthAtT(i,{precision:o,subdivisions:d}),c}tangentAt(e,t={}){if(this.segments.length===0)return null;const s=Se.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.tangentAtLength(o,r)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const d=s?c:u-1-c,f=this.segments[d],h=i[d],p=f.length({precision:r,subdivisions:h});if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:h});o=f}a+=p}if(o){const c=s?1:0;return o.tangentAtT(c)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const s=e.segmentIndex;if(s<0)return this.segments[0].tangentAtT(0);if(s>=t)return this.segments[t-1].tangentAtT(1);const r=Se.clamp(e.value,0,1);return this.segments[s].tangentAtT(r)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),s=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:s}}toPoints(e={}){const t=this.segments,s=t.length;if(s===0)return null;const r=this.getSubdivisions(e),i=[];let o=[];for(let a=0;a<s;a+=1){const c=t[a];if(c.isVisible){const u=r[a];u.length>0?u.forEach(d=>o.push(d.start)):o.push(c.start)}else o.length>0&&(o.push(t[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(s=>new Fe(s)):null}scale(e,t,s){return this.segments.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.segments.forEach(s=>s.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(s=>s.translate(e,t)):this.segments.forEach(s=>s.translate(e)),this}clone(){const e=new re;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,s=e.segments,r=t.length;if(s.length!==r)return!1;for(let i=0;i<r;i+=1){const o=t[i],a=s[i];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(re||(re={})),function(n){function e(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,c=o.length;a<c;a+=1){const u=o[a],d=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,f=u.match(d);if(f!=null){const h=f[0],p=f.slice(1).map(m=>+m),g=t.call(null,h,...p);r.appendSegment(g)}}return r}n.parse=e;function t(s,...r){if(s==="M")return Kr.create.call(null,...r);if(s==="L")return mt.create.call(null,...r);if(s==="C")return Xt.create.call(null,...r);if(s==="z"||s==="Z")return Jr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=t}(re||(re={})),function(n){n.normalize=_R,n.isValid=ER,n.drawArc=MR,n.drawPoints=Uy,n.arcToCurves=ol}(re||(re={}));class Ue{constructor(e){this.options=Object.assign({},e),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(e,t,s=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!s&&!bs.isApplyingHMR()&&this.onDuplicated(e);const r=this.options.process,i=r?se(r,this,e,t):t;return this.data[e]=i,i}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&se(this.options.onConflict,this,e),new Error(`${aa(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const s=this.getSpellingSuggestionForName(e),r=t?`${t} ${NP(this.options.type)}`:this.options.type;return`${aa(r)} with name '${e}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(e){return _D(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ue||(Ue={}));const TR=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,s=e.thickness*e.sy;pe(n,{width:t,height:s,rx:t,ry:s,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const s=e.factor||1,r=e.width*s,i=e.height*s,o=e.thickness;r-o>=0&&i-o>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",e.width=r,e.height=i,pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;pe(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Ss{constructor(){this.patterns={},this.root=oe.create(Qa(),{width:"100%",height:"100%"},[yn("defs")]).node}add(e,t){const s=this.root.childNodes[0];s&&s.appendChild(t),this.patterns[e]=t,oe.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=TR,n.registry=Ue.create({type:"grid"}),n.registry.register(n.presets,!0)})(Ss||(Ss={}));const Wy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t*2,e.height=s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(2*t,0),r.scale(-1,1),r.drawImage(n,0,0,t,s),e},Yy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t,e.height=s*2;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(0,2*s),r.scale(1,-1),r.drawImage(n,0,0,t,s),e},qy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=2*t,e.height=2*s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,-1,e.width,e.height),r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,1,e.width,0),r.drawImage(n,0,0,t,s),r.setTransform(1,0,0,-1,0,e.height),r.drawImage(n,0,0,t,s),e},kR=Object.freeze(Object.defineProperty({__proto__:null,flipX:Wy,flipXY:qy,flipY:Yy,watermark:function(n,e){const t=n.width,s=n.height,r=document.createElement("canvas");r.width=t*3,r.height=s*3;const i=r.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ye.toRad(o),c=r.width/4,u=r.height/4;for(let d=0;d<4;d+=1)for(let f=0;f<4;f+=1)(d+f)%2>0&&(i.setTransform(1,0,0,1,(2*d-1)*c,(2*f-1)*u),i.rotate(a),i.drawImage(n,-t/2,-s/2,t,s));return r}},Symbol.toStringTag,{value:"Module"}));var uo;(function(n){n.presets=Object.assign({},kR),n.presets["flip-x"]=Wy,n.presets["flip-y"]=Yy,n.presets["flip-xy"]=qy,n.registry=Ue.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(uo||(uo={}));function ad(n,e){return n??e}function at(n,e){return n!=null&&Number.isFinite(n)?n:e}function VR(n={}){const e=ad(n.color,"blue"),t=at(n.width,1),s=at(n.margin,2),r=at(n.opacity,1),i=s,o=s+t;return`
33
+ `,v_=["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 C_(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),s=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:v_.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:s,borderSize:r,boxSizing:t}}function kg(n,e=1,t){var s;dn||(dn=document.createElement("textarea"),document.body.appendChild(dn));const{paddingSize:r,borderSize:i,boxSizing:o,contextStyle:a}=C_(n);dn.setAttribute("style",`${a};${x_}`),dn.value=n.value||n.placeholder||"";let c=dn.scrollHeight;const u={};o==="border-box"?c=c+i:o==="content-box"&&(c=c-r),dn.value="";const d=dn.scrollHeight-r;if(Ht(e)){let f=d*e;o==="border-box"&&(f=f+r+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(Ht(t)){let f=d*t;o==="border-box"&&(f=f+r+i),c=Math.min(f,c)}return u.height=`${c}px`,(s=dn.parentNode)==null||s.removeChild(dn),dn=void 0,u}const S_=et({id:{type:String,default:void 0},size:Kc,disabled:Boolean,modelValue:{type:he([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:he([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:zi},prefixIcon:{type:zi},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:he([Object,Array,String]),default:()=>Gp({})},autofocus:Boolean,rows:{type:Number,default:2},...Zc(["ariaLabel"])}),E_={[Bc]:n=>sn(n),input:n=>sn(n),change:n=>sn(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},O_=l.defineComponent({name:"ElInput",inheritAttrs:!1}),M_=l.defineComponent({...O_,props:S_,emits:E_,setup(n,{expose:e,emit:t}){const s=n,r=l.useAttrs(),i=l.useSlots(),o=l.computed(()=>{const W={};return s.containerRole==="combobox"&&(W["aria-haspopup"]=r["aria-haspopup"],W["aria-owns"]=r["aria-owns"],W["aria-expanded"]=r["aria-expanded"]),W}),a=l.computed(()=>[s.type==="textarea"?y.b():m.b(),m.m(p.value),m.is("disabled",g.value),m.is("exceed",U.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&&te.value,[m.b("hidden")]:s.type==="hidden"},r.class]),c=l.computed(()=>[m.e("wrapper"),m.is("focus",A.value)]),u=NN({excludeKeys:l.computed(()=>Object.keys(o.value))}),{form:d,formItem:f}=Tg(),{inputId:h}=w_(s,{formItemContext:f}),p=_g(),g=tu(),m=bt("input"),y=bt("textarea"),b=l.shallowRef(),w=l.shallowRef(),x=l.ref(!1),S=l.ref(!1),v=l.ref(),E=l.shallowRef(s.inputStyle),C=l.computed(()=>b.value||w.value),{wrapperRef:O,isFocused:A,handleFocus:k,handleBlur:_}=l_(C,{beforeFocus(){return g.value},afterBlur(){var W;s.validateEvent&&((W=f==null?void 0:f.validate)==null||W.call(f,"blur").catch(Pe=>Tt(Pe)))}}),V=l.computed(()=>{var W;return(W=d==null?void 0:d.statusIcon)!=null?W:!1}),L=l.computed(()=>(f==null?void 0:f.validateState)||""),B=l.computed(()=>L.value&&vN[L.value]),N=l.computed(()=>S.value?bN:fN),P=l.computed(()=>[r.style]),T=l.computed(()=>[s.inputStyle,E.value,{resize:s.resize}]),j=l.computed(()=>ma(s.modelValue)?"":String(s.modelValue)),Y=l.computed(()=>s.clearable&&!g.value&&!s.readonly&&!!j.value&&(A.value||x.value)),te=l.computed(()=>s.showPassword&&!g.value&&!!j.value&&(!!j.value||A.value)),z=l.computed(()=>s.showWordLimit&&!!s.maxlength&&(s.type==="text"||s.type==="textarea")&&!g.value&&!s.readonly&&!s.showPassword),I=l.computed(()=>j.value.length),U=l.computed(()=>!!z.value&&I.value>Number(s.maxlength)),F=l.computed(()=>!!i.suffix||!!s.suffixIcon||Y.value||s.showPassword||z.value||!!L.value&&V.value),[D,q]=o_(b);Ih(w,W=>{if(Z(),!z.value||s.resize!=="both")return;const Pe=W[0],{width:ss}=Pe.contentRect;v.value={right:`calc(100% - ${ss+15+6}px)`}});const J=()=>{const{type:W,autosize:Pe}=s;if(!(!We||W!=="textarea"||!w.value))if(Pe){const ss=xr(Pe)?Pe.minRows:void 0,Eo=xr(Pe)?Pe.maxRows:void 0,x0=kg(w.value,ss,Eo);E.value={overflowY:"hidden",...x0},l.nextTick(()=>{w.value.offsetHeight,E.value=x0})}else E.value={minHeight:kg(w.value).minHeight}},Z=(W=>{let Pe=!1;return()=>{var ss;if(Pe||!s.autosize)return;((ss=w.value)==null?void 0:ss.offsetParent)===null||(W(),Pe=!0)}})(J),fe=()=>{const W=C.value,Pe=s.formatter?s.formatter(j.value):j.value;!W||W.value===Pe||(W.value=Pe)},Ze=async W=>{D();let{value:Pe}=W.target;if(s.formatter&&(Pe=s.parser?s.parser(Pe):Pe),!Me.value){if(Pe===j.value){fe();return}t(Bc,Pe),t("input",Pe),await l.nextTick(),fe(),q()}},yt=W=>{t("change",W.target.value)},{isComposing:Me,handleCompositionStart:ne,handleCompositionUpdate:xt,handleCompositionEnd:Zt}=c_({emit:t,afterComposition:Ze}),Ds=()=>{S.value=!S.value,ur()},ur=async()=>{var W;await l.nextTick(),(W=C.value)==null||W.focus()},So=()=>{var W;return(W=C.value)==null?void 0:W.blur()},xn=W=>{x.value=!1,t("mouseleave",W)},le=W=>{x.value=!0,t("mouseenter",W)},At=W=>{t("keydown",W)},Nl=()=>{var W;(W=C.value)==null||W.select()},bi=()=>{t(Bc,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>s.modelValue,()=>{var W;l.nextTick(()=>J()),s.validateEvent&&((W=f==null?void 0:f.validate)==null||W.call(f,"change").catch(Pe=>Tt(Pe)))}),l.watch(j,()=>fe()),l.watch(()=>s.type,async()=>{await l.nextTick(),fe(),J()}),l.onMounted(()=>{!s.formatter&&s.parser&&Tt("ElInput","If you set the parser, you also need to set the formatter."),fe(),l.nextTick(J)}),e({input:b,textarea:w,ref:C,textareaStyle:T,autosize:l.toRef(s,"autosize"),isComposing:Me,focus:ur,blur:So,select:Nl,clear:bi,resizeTextarea:J}),(W,Pe)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(o),{class:[l.unref(a),{[l.unref(m).bm("group","append")]:W.$slots.append,[l.unref(m).bm("group","prepend")]:W.$slots.prepend}],style:l.unref(P),role:W.containerRole,onMouseenter:le,onMouseleave:xn}),[l.createCommentVNode(" input "),W.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),W.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(m).be("group","prepend"))},[l.renderSlot(W.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:O,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),W.$slots.prefix||W.prefixIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(l.unref(m).e("prefix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("prefix-inner"))},[l.renderSlot(W.$slots,"prefix"),W.prefixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(W.prefixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("input",l.mergeProps({id:l.unref(h),ref_key:"input",ref:b,class:l.unref(m).e("inner")},l.unref(u),{minlength:W.minlength,maxlength:W.maxlength,type:W.showPassword?S.value?"text":"password":W.type,disabled:l.unref(g),readonly:W.readonly,autocomplete:W.autocomplete,tabindex:W.tabindex,"aria-label":W.ariaLabel,placeholder:W.placeholder,style:W.inputStyle,form:W.form,autofocus:W.autofocus,onCompositionstart:l.unref(ne),onCompositionupdate:l.unref(xt),onCompositionend:l.unref(Zt),onInput:Ze,onChange:yt,onKeydown:At}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(F)?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(l.unref(m).e("suffix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("suffix-inner"))},[!l.unref(Y)||!l.unref(te)||!l.unref(z)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(W.$slots,"suffix"),W.suffixIcon?(l.openBlock(),l.createBlock(l.unref(An),{key:0,class:l.normalizeClass(l.unref(m).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(W.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(Y)?(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("clear")]),onMousedown:l.withModifiers(l.unref(ls),["prevent"]),onClick:bi},{default:l.withCtx(()=>[l.createVNode(l.unref(Bp))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(te)?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("password")]),onClick:Ds},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(N))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(z)?(l.openBlock(),l.createElementBlock("span",{key:3,class:l.normalizeClass(l.unref(m).e("count"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(m).e("count-inner"))},l.toDisplayString(l.unref(I))+" / "+l.toDisplayString(W.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(L)&&l.unref(B)&&l.unref(V)?(l.openBlock(),l.createBlock(l.unref(An),{key:4,class:l.normalizeClass([l.unref(m).e("icon"),l.unref(m).e("validateIcon"),l.unref(m).is("loading",l.unref(L)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(B))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),W.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(m).be("group","append"))},[l.renderSlot(W.$slots,"append")],2)):l.createCommentVNode("v-if",!0)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" textarea "),l.createElementVNode("textarea",l.mergeProps({id:l.unref(h),ref_key:"textarea",ref:w,class:[l.unref(y).e("inner"),l.unref(m).is("focus",l.unref(A))]},l.unref(u),{minlength:W.minlength,maxlength:W.maxlength,tabindex:W.tabindex,disabled:l.unref(g),readonly:W.readonly,autocomplete:W.autocomplete,style:l.unref(T),"aria-label":W.ariaLabel,placeholder:W.placeholder,form:W.form,autofocus:W.autofocus,rows:W.rows,onCompositionstart:l.unref(ne),onCompositionupdate:l.unref(xt),onCompositionend:l.unref(Zt),onInput:Ze,onFocus:l.unref(k),onBlur:l.unref(_),onChange:yt,onKeydown:At}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),l.unref(z)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(v.value),class:l.normalizeClass(l.unref(m).e("count"))},l.toDisplayString(l.unref(I))+" / "+l.toDisplayString(W.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var P_=pt(M_,[["__file","input.vue"]]);const N_=Us(P_),nu=Symbol("popper"),Vg=Symbol("popperContent"),Dg=et({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),A_=l.defineComponent({name:"ElPopper",inheritAttrs:!1}),__=l.defineComponent({...A_,props:Dg,setup(n,{expose:e}){const t=n,s=l.ref(),r=l.ref(),i=l.ref(),o=l.ref(),a=l.computed(()=>t.role),c={triggerRef:s,popperInstanceRef:r,contentRef:i,referenceRef:o,role:a};return e(c),l.provide(nu,c),(u,d)=>l.renderSlot(u.$slots,"default")}});var T_=pt(__,[["__file","popper.vue"]]);const Rg=et({arrowOffset:{type:Number,default:5}}),k_=l.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),V_=l.defineComponent({...k_,props:Rg,setup(n,{expose:e}){const t=n,s=bt("popper"),{arrowOffset:r,arrowRef:i,arrowStyle:o}=l.inject(Vg,void 0);return l.watch(()=>t.arrowOffset,a=>{r.value=a}),l.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(a,c)=>(l.openBlock(),l.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:l.normalizeClass(l.unref(s).e("arrow")),style:l.normalizeStyle(l.unref(o)),"data-popper-arrow":""},null,6))}});var D_=pt(V_,[["__file","arrow.vue"]]);const su="ElOnlyChild",R_=l.defineComponent({name:su,setup(n,{slots:e,attrs:t}){var s;const r=l.inject(wg),i=i_((s=r==null?void 0:r.setForwardRef)!=null?s:ls);return()=>{var o;const a=(o=e.default)==null?void 0:o.call(e,t);if(!a)return null;if(a.length>1)return Tt(su,"requires exact only one valid child."),null;const c=Ig(a);return c?l.withDirectives(l.cloneVNode(c,t),[[i]]):(Tt(su,"no valid child node found"),null)}}});function Ig(n){if(!n)return null;const e=n;for(const t of e){if(xr(t))switch(t.type){case l.Comment:continue;case l.Text:case"svg":return Lg(t);case l.Fragment:return Ig(t.children);default:return t}return Lg(t)}return null}function Lg(n){const e=bt("only-child");return l.createVNode("span",{class:e.e("content")},[n])}const Bg=et({virtualRef:{type:he(Object)},virtualTriggering:Boolean,onMouseenter:{type:he(Function)},onMouseleave:{type:he(Function)},onClick:{type:he(Function)},onKeydown:{type:he(Function)},onFocus:{type:he(Function)},onBlur:{type:he(Function)},onContextmenu:{type:he(Function)},id:String,open:Boolean}),I_=l.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),L_=l.defineComponent({...I_,props:Bg,setup(n,{expose:e}){const t=n,{role:s,triggerRef:r}=l.inject(nu,void 0);r_(r);const i=l.computed(()=>a.value?t.id:void 0),o=l.computed(()=>{if(s&&s.value==="tooltip")return t.open&&t.id?t.id:void 0}),a=l.computed(()=>{if(s&&s.value!=="tooltip")return s.value}),c=l.computed(()=>a.value?`${t.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return l.onMounted(()=>{l.watch(()=>t.virtualRef,f=>{f&&(r.value=as(f))},{immediate:!0}),l.watch(r,(f,h)=>{u==null||u(),u=void 0,qn(f)&&(d.forEach(p=>{var g;const m=t[p];m&&(f.addEventListener(p.slice(2).toLowerCase(),m),(g=h==null?void 0:h.removeEventListener)==null||g.call(h,p.slice(2).toLowerCase(),m))}),u=l.watch([i,o,a,c],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((g,m)=>{ma(p[m])?f.removeAttribute(g):f.setAttribute(g,p[m])})},{immediate:!0})),qn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>h.removeAttribute(p))},{immediate:!0})}),l.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,r.value&&qn(r.value)){const f=r.value;d.forEach(h=>{const p=t[h];p&&f.removeEventListener(h.slice(2).toLowerCase(),p)}),r.value=void 0}}),e({triggerRef:r}),(f,h)=>f.virtualTriggering?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createBlock(l.unref(R_),l.mergeProps({key:0},f.$attrs,{"aria-controls":l.unref(i),"aria-describedby":l.unref(o),"aria-expanded":l.unref(c),"aria-haspopup":l.unref(a)}),{default:l.withCtx(()=>[l.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var B_=pt(L_,[["__file","trigger.vue"]]);const ru="focus-trap.focus-after-trapped",iu="focus-trap.focus-after-released",j_="focus-trap.focusout-prevented",jg={cancelable:!0,bubbles:!1},$_={cancelable:!0,bubbles:!1},$g="focusAfterTrapped",zg="focusAfterReleased",z_=Symbol("elFocusTrap"),ou=l.ref(),ka=l.ref(0),au=l.ref(0);let Va=0;const Fg=n=>{const e=[],t=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(;t.nextNode();)e.push(t.currentNode);return e},Ug=(n,e)=>{for(const t of n)if(!F_(t,e))return t},F_=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},U_=n=>{const e=Fg(n),t=Ug(e,n),s=Ug(e.reverse(),n);return[t,s]},H_=n=>n instanceof HTMLInputElement&&"select"in n,hs=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),au.value=window.performance.now(),n!==t&&H_(n)&&e&&n.select()}};function Hg(n,e){const t=[...n],s=n.indexOf(e);return s!==-1&&t.splice(s,1),t}const G_=()=>{let n=[];return{push:s=>{const r=n[0];r&&s!==r&&r.pause(),n=Hg(n,s),n.unshift(s)},remove:s=>{var r,i;n=Hg(n,s),(i=(r=n[0])==null?void 0:r.resume)==null||i.call(r)}}},W_=(n,e=!1)=>{const t=document.activeElement;for(const s of n)if(hs(s,e),document.activeElement!==t)return},Gg=G_(),Y_=()=>ka.value>au.value,Da=()=>{ou.value="pointer",ka.value=window.performance.now()},Wg=()=>{ou.value="keyboard",ka.value=window.performance.now()},q_=()=>(l.onMounted(()=>{Va===0&&(document.addEventListener("mousedown",Da),document.addEventListener("touchstart",Da),document.addEventListener("keydown",Wg)),Va++}),l.onBeforeUnmount(()=>{Va--,Va<=0&&(document.removeEventListener("mousedown",Da),document.removeEventListener("touchstart",Da),document.removeEventListener("keydown",Wg))}),{focusReason:ou,lastUserFocusTimestamp:ka,lastAutomatedFocusTimestamp:au}),Ra=n=>new CustomEvent(j_,{...$_,detail:n}),X_=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[$g,zg,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=l.ref();let s,r;const{focusReason:i}=q_();QA(g=>{n.trapped&&!o.paused&&e("release-requested",g)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=g=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:m,altKey:y,ctrlKey:b,metaKey:w,currentTarget:x,shiftKey:S}=g,{loop:v}=n,E=m===Tr.tab&&!y&&!b&&!w,C=document.activeElement;if(E&&C){const O=x,[A,k]=U_(O);if(A&&k){if(!S&&C===k){const V=Ra({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),v&&hs(A,!0))}else if(S&&[A,O].includes(C)){const V=Ra({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||(g.preventDefault(),v&&hs(k,!0))}}else if(C===O){const V=Ra({focusReason:i.value});e("focusout-prevented",V),V.defaultPrevented||g.preventDefault()}}};l.provide(z_,{focusTrapRef:t,onKeydown:a}),l.watch(()=>n.focusTrapEl,g=>{g&&(t.value=g)},{immediate:!0}),l.watch([t],([g],[m])=>{g&&(g.addEventListener("keydown",a),g.addEventListener("focusin",d),g.addEventListener("focusout",f)),m&&(m.removeEventListener("keydown",a),m.removeEventListener("focusin",d),m.removeEventListener("focusout",f))});const c=g=>{e($g,g)},u=g=>e(zg,g),d=g=>{const m=l.unref(t);if(!m)return;const y=g.target,b=g.relatedTarget,w=y&&m.contains(y);n.trapped||b&&m.contains(b)||(s=b),w&&e("focusin",g),!o.paused&&n.trapped&&(w?r=y:hs(r,!0))},f=g=>{const m=l.unref(t);if(!(o.paused||!m))if(n.trapped){const y=g.relatedTarget;!ma(y)&&!m.contains(y)&&setTimeout(()=>{if(!o.paused&&n.trapped){const b=Ra({focusReason:i.value});e("focusout-prevented",b),b.defaultPrevented||hs(r,!0)}},0)}else{const y=g.target;y&&m.contains(y)||e("focusout",g)}};async function h(){await l.nextTick();const g=l.unref(t);if(g){Gg.push(o);const m=g.contains(document.activeElement)?s:document.activeElement;if(s=m,!g.contains(m)){const b=new Event(ru,jg);g.addEventListener(ru,c),g.dispatchEvent(b),b.defaultPrevented||l.nextTick(()=>{let w=n.focusStartEl;sn(w)||(hs(w),document.activeElement!==w&&(w="first")),w==="first"&&W_(Fg(g),!0),(document.activeElement===m||w==="container")&&hs(g)})}}}function p(){const g=l.unref(t);if(g){g.removeEventListener(ru,c);const m=new CustomEvent(iu,{...jg,detail:{focusReason:i.value}});g.addEventListener(iu,u),g.dispatchEvent(m),!m.defaultPrevented&&(i.value=="keyboard"||!Y_()||g.contains(document.activeElement))&&hs(s??document.body),g.removeEventListener(iu,u),Gg.remove(o)}}return l.onMounted(()=>{n.trapped&&h(),l.watch(()=>n.trapped,g=>{g?h():p()})}),l.onBeforeUnmount(()=>{n.trapped&&p(),t.value&&(t.value.removeEventListener("keydown",a),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",f),t.value=void 0)}),{onKeydown:a}}});function J_(n,e,t,s,r,i){return l.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Yg=pt(X_,[["render",J_],["__file","focus-trap.vue"]]);const K_=["fixed","absolute"],Z_=et({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:he(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:$c,default:"bottom"},popperOptions:{type:he(Object),default:()=>({})},strategy:{type:String,values:K_,default:"absolute"}}),qg=et({...Z_,id:String,style:{type:he([String,Array,Object])},className:{type:he([String,Array,Object])},effect:{type:he(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:he([String,Array,Object])},popperStyle:{type:he([String,Array,Object])},referenceEl:{type:he(Object)},triggerTargetEl:{type:he(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Zc(["ariaLabel"])}),Q_={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},eT=(n,e=[])=>{const{placement:t,strategy:s,popperOptions:r}=n,i={placement:t,strategy:s,...r,modifiers:[...nT(n),...e]};return sT(i,r==null?void 0:r.modifiers),i},tT=n=>{if(We)return as(n)};function nT(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:s}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:s}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function sT(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const rT=0,iT=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:s,role:r}=l.inject(nu,void 0),i=l.ref(),o=l.ref(),a=l.computed(()=>({name:"eventListeners",enabled:!!n.visible})),c=l.computed(()=>{var b;const w=l.unref(i),x=(b=l.unref(o))!=null?b:rT;return{name:"arrow",enabled:!PP(w),options:{element:w,padding:x}}}),u=l.computed(()=>({onFirstUpdate:()=>{g()},...eT(n,[l.unref(c),l.unref(a)])})),d=l.computed(()=>tT(n.referenceEl)||l.unref(s)),{attributes:f,state:h,styles:p,update:g,forceUpdate:m,instanceRef:y}=JA(d,t,u);return l.watch(y,b=>e.value=b),l.onMounted(()=>{l.watch(()=>{var b;return(b=l.unref(d))==null?void 0:b.getBoundingClientRect()},()=>{g()})}),{attributes:f,arrowRef:i,contentRef:t,instanceRef:y,state:h,styles:p,role:r,forceUpdate:m,update:g}},oT=(n,{attributes:e,styles:t,role:s})=>{const{nextZIndex:r}=Og(),i=bt("popper"),o=l.computed(()=>l.unref(e).popper),a=l.ref(Ht(n.zIndex)?n.zIndex:r()),c=l.computed(()=>[i.b(),i.is("pure",n.pure),i.is(n.effect),n.popperClass]),u=l.computed(()=>[{zIndex:l.unref(a)},l.unref(t).popper,n.popperStyle||{}]),d=l.computed(()=>s.value==="dialog"?"false":void 0),f=l.computed(()=>l.unref(t).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:o,contentClass:c,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=Ht(n.zIndex)?n.zIndex:r()}}},aT=(n,e)=>{const t=l.ref(!1),s=l.ref();return{focusStartRef:s,trapped:t,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(s.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{n.visible&&!t.value&&(u.target&&(s.value=u.target),t.value=!0)},onFocusoutPrevented:u=>{n.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},lT=l.defineComponent({name:"ElPopperContent"}),cT=l.defineComponent({...lT,props:qg,emits:Q_,setup(n,{expose:e,emit:t}){const s=n,{focusStartRef:r,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=aT(s,t),{attributes:f,arrowRef:h,contentRef:p,styles:g,instanceRef:m,role:y,update:b}=iT(s),{ariaModal:w,arrowStyle:x,contentAttrs:S,contentClass:v,contentStyle:E,updateZIndex:C}=oT(s,{styles:g,attributes:f,role:y}),O=l.inject(Ta,void 0),A=l.ref();l.provide(Vg,{arrowStyle:x,arrowRef:h,arrowOffset:A}),O&&l.provide(Ta,{...O,addInputId:ls,removeInputId:ls});let k;const _=(L=!0)=>{b(),L&&C()},V=()=>{_(!1),s.visible&&s.focusOnShow?i.value=!0:s.visible===!1&&(i.value=!1)};return l.onMounted(()=>{l.watch(()=>s.triggerTargetEl,(L,B)=>{k==null||k(),k=void 0;const N=l.unref(L||p.value),P=l.unref(B||p.value);qn(N)&&(k=l.watch([y,()=>s.ariaLabel,w,()=>s.id],T=>{["role","aria-label","aria-modal","id"].forEach((j,Y)=>{ma(T[Y])?N.removeAttribute(j):N.setAttribute(j,T[Y])})},{immediate:!0})),P!==N&&qn(P)&&["role","aria-label","aria-modal","id"].forEach(T=>{P.removeAttribute(T)})},{immediate:!0}),l.watch(()=>s.visible,V,{immediate:!0})}),l.onBeforeUnmount(()=>{k==null||k(),k=void 0}),e({popperContentRef:p,popperInstanceRef:m,updatePopper:_,contentStyle:E}),(L,B)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps({ref_key:"contentRef",ref:p},l.unref(S),{style:l.unref(E),class:l.unref(v),tabindex:"-1",onMouseenter:N=>L.$emit("mouseenter",N),onMouseleave:N=>L.$emit("mouseleave",N)}),[l.createVNode(l.unref(Yg),{trapped:l.unref(i),"trap-on-focus-in":!0,"focus-trap-el":l.unref(p),"focus-start-el":l.unref(r),onFocusAfterTrapped:l.unref(a),onFocusAfterReleased:l.unref(o),onFocusin:l.unref(c),onFocusoutPrevented:l.unref(u),onReleaseRequested:l.unref(d)},{default:l.withCtx(()=>[l.renderSlot(L.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var uT=pt(cT,[["__file","content.vue"]]);const dT=Us(T_),lu=Symbol("elTooltip"),Xg=et({...n_,...qg,appendTo:{type:he([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:he(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Zc(["ariaLabel"])}),Jg=et({...Bg,disabled:Boolean,trigger:{type:he([String,Array]),default:"hover"},triggerKeys:{type:he(Array),default:()=>[Tr.enter,Tr.space]}}),{useModelToggleProps:hT,useModelToggleEmits:fT,useModelToggle:pT}=$N("visible"),gT=et({...Dg,...hT,...Xg,...Jg,...Rg,showArrow:{type:Boolean,default:!0}}),mT=[...fT,"before-show","before-hide","show","hide","open","close"],yT=(n,e)=>Fv(n)?n.includes(e):n===e,Lr=(n,e,t)=>s=>{yT(l.unref(n),e)&&t(s)},bT=l.defineComponent({name:"ElTooltipTrigger"}),wT=l.defineComponent({...bT,props:Jg,setup(n,{expose:e}){const t=n,s=bt("tooltip"),{controlled:r,id:i,open:o,onOpen:a,onClose:c,onToggle:u}=l.inject(lu,void 0),d=l.ref(null),f=()=>{if(l.unref(r)||t.disabled)return!0},h=l.toRef(t,"trigger"),p=Hn(f,Lr(h,"hover",a)),g=Hn(f,Lr(h,"hover",c)),m=Hn(f,Lr(h,"click",S=>{S.button===0&&u(S)})),y=Hn(f,Lr(h,"focus",a)),b=Hn(f,Lr(h,"focus",c)),w=Hn(f,Lr(h,"contextmenu",S=>{S.preventDefault(),u(S)})),x=Hn(f,S=>{const{code:v}=S;t.triggerKeys.includes(v)&&(S.preventDefault(),u(S))});return e({triggerRef:d}),(S,v)=>(l.openBlock(),l.createBlock(l.unref(B_),{id:l.unref(i),"virtual-ref":S.virtualRef,open:l.unref(o),"virtual-triggering":S.virtualTriggering,class:l.normalizeClass(l.unref(s).e("trigger")),onBlur:l.unref(b),onClick:l.unref(m),onContextmenu:l.unref(w),onFocus:l.unref(y),onMouseenter:l.unref(p),onMouseleave:l.unref(g),onKeydown:l.unref(x)},{default:l.withCtx(()=>[l.renderSlot(S.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var xT=pt(wT,[["__file","trigger.vue"]]);const vT=et({to:{type:he([String,Object]),required:!0},disabled:Boolean});var CT=pt(l.defineComponent({__name:"teleport",props:vT,setup(n){return(e,t)=>e.disabled?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(),l.createBlock(l.Teleport,{key:1,to:e.to},[l.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const ST=Us(CT),ET=l.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),OT=l.defineComponent({...ET,props:Xg,setup(n,{expose:e}){const t=n,{selector:s}=bg(),r=bt("tooltip"),i=l.ref(null);let o;const{controlled:a,id:c,open:u,trigger:d,onClose:f,onOpen:h,onShow:p,onHide:g,onBeforeShow:m,onBeforeHide:y}=l.inject(lu,void 0),b=l.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),w=l.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);l.onBeforeUnmount(()=>{o==null||o()});const x=l.computed(()=>l.unref(w)?!0:l.unref(u)),S=l.computed(()=>t.disabled?!1:l.unref(u)),v=l.computed(()=>t.appendTo||s.value),E=l.computed(()=>{var P;return(P=t.style)!=null?P:{}}),C=l.ref(!0),O=()=>{g(),C.value=!0},A=()=>{if(l.unref(a))return!0},k=Hn(A,()=>{t.enterable&&l.unref(d)==="hover"&&h()}),_=Hn(A,()=>{l.unref(d)==="hover"&&f()}),V=()=>{var P,T;(T=(P=i.value)==null?void 0:P.updatePopper)==null||T.call(P),m==null||m()},L=()=>{y==null||y()},B=()=>{p(),o=Tv(l.computed(()=>{var P;return(P=i.value)==null?void 0:P.popperContentRef}),()=>{if(l.unref(a))return;l.unref(d)!=="hover"&&f()})},N=()=>{t.virtualTriggering||f()};return l.watch(()=>l.unref(u),P=>{P?C.value=!1:o==null||o()},{flush:"post"}),l.watch(()=>t.content,()=>{var P,T;(T=(P=i.value)==null?void 0:P.updatePopper)==null||T.call(P)}),e({contentRef:i}),(P,T)=>(l.openBlock(),l.createBlock(l.unref(ST),{disabled:!P.teleported,to:l.unref(v)},{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(b),onAfterLeave:O,onBeforeEnter:V,onAfterEnter:B,onBeforeLeave:L},{default:l.withCtx(()=>[l.unref(x)?l.withDirectives((l.openBlock(),l.createBlock(l.unref(uT),l.mergeProps({key:0,id:l.unref(c),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,l.unref(E)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:l.unref(S),"z-index":P.zIndex,onMouseenter:l.unref(k),onMouseleave:l.unref(_),onBlur:N,onClose:l.unref(f)}),{default:l.withCtx(()=>[l.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"])),[[l.vShow,l.unref(S)]]):l.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var MT=pt(OT,[["__file","content.vue"]]);const PT=l.defineComponent({name:"ElTooltip"}),NT=l.defineComponent({...PT,props:gT,emits:mT,setup(n,{expose:e,emit:t}){const s=n;t_();const r=Aa(),i=l.ref(),o=l.ref(),a=()=>{var b;const w=l.unref(i);w&&((b=w.popperInstanceRef)==null||b.update())},c=l.ref(!1),u=l.ref(),{show:d,hide:f,hasUpdateHandler:h}=pT({indicator:c,toggleReason:u}),{onOpen:p,onClose:g}=s_({showAfter:l.toRef(s,"showAfter"),hideAfter:l.toRef(s,"hideAfter"),autoClose:l.toRef(s,"autoClose"),open:d,close:f}),m=l.computed(()=>ya(s.visible)&&!h.value);l.provide(lu,{controlled:m,id:r,open:l.readonly(c),trigger:l.toRef(s,"trigger"),onOpen:b=>{p(b)},onClose:b=>{g(b)},onToggle:b=>{l.unref(c)?g(b):p(b)},onShow:()=>{t("show",u.value)},onHide:()=>{t("hide",u.value)},onBeforeShow:()=>{t("before-show",u.value)},onBeforeHide:()=>{t("before-hide",u.value)},updatePopper:a}),l.watch(()=>s.disabled,b=>{b&&c.value&&(c.value=!1)});const y=b=>{var w,x;const S=(x=(w=o.value)==null?void 0:w.contentRef)==null?void 0:x.popperContentRef,v=(b==null?void 0:b.relatedTarget)||document.activeElement;return S&&S.contains(v)};return l.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:o,isFocusInsideContent:y,updatePopper:a,onOpen:p,onClose:g,hide:f}),(b,w)=>(l.openBlock(),l.createBlock(l.unref(dT),{ref_key:"popperRef",ref:i,role:b.role},{default:l.withCtx(()=>[l.createVNode(xT,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:l.withCtx(()=>[b.$slots.default?l.renderSlot(b.$slots,"default",{key:0}):l.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),l.createVNode(MT,{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:l.withCtx(()=>[l.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(l.openBlock(),l.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(l.openBlock(),l.createElementBlock("span",{key:1},l.toDisplayString(b.content),1))]),b.showArrow?(l.openBlock(),l.createBlock(l.unref(D_),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):l.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 AT=pt(NT,[["__file","tooltip.vue"]]);const Kg=Us(AT),_T=et({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:he([String,Object,Array])},offset:{type:he(Array),default:[0,0]},badgeClass:{type:String}}),TT=l.defineComponent({name:"ElBadge"}),kT=l.defineComponent({...TT,props:_T,setup(n,{expose:e}){const t=n,s=bt("badge"),r=l.computed(()=>t.isDot?"":Ht(t.value)&&Ht(t.max)?t.max<t.value?`${t.max}+`:`${t.value}`:`${t.value}`),i=l.computed(()=>{var o,a,c,u,d;return[{backgroundColor:t.color,marginRight:$i(-((a=(o=t.offset)==null?void 0:o[0])!=null?a:0)),marginTop:$i((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:r}),(o,a)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(s).b())},[l.renderSlot(o.$slots,"default"),l.createVNode(l.Transition,{name:`${l.unref(s).namespace.value}-zoom-in-center`,persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("sup",{class:l.normalizeClass([l.unref(s).e("content"),l.unref(s).em("content",o.type),l.unref(s).is("fixed",!!o.$slots.default),l.unref(s).is("dot",o.isDot),l.unref(s).is("hide-zero",!o.showZero&&t.value===0),o.badgeClass]),style:l.normalizeStyle(l.unref(i)),textContent:l.toDisplayString(l.unref(r))},null,14,["textContent"]),[[l.vShow,!o.hidden&&(l.unref(r)||o.isDot)]])]),_:1},8,["name"])],2))}});var VT=pt(kT,[["__file","badge.vue"]]);const DT=Us(VT),Zg=Symbol("buttonGroupContextKey"),RT=(n,e)=>{AN({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},l.computed(()=>n.type==="text"));const t=l.inject(Zg,void 0),s=Qc("button"),{form:r}=Tg(),i=_g(l.computed(()=>t==null?void 0:t.size)),o=tu(),a=l.ref(),c=l.useSlots(),u=l.computed(()=>n.type||(t==null?void 0:t.type)||""),d=l.computed(()=>{var g,m,y;return(y=(m=n.autoInsertSpace)!=null?m:(g=s.value)==null?void 0:g.autoInsertSpace)!=null?y:!1}),f=l.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),h=l.computed(()=>{var g;const m=(g=c.default)==null?void 0:g.call(c);if(d.value&&(m==null?void 0:m.length)===1){const y=m[0];if((y==null?void 0:y.type)===l.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:h,handleClick:g=>{if(o.value||n.loading){g.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",g)}}},cu=et({size:Kc,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:zi},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:zi,default:()=>wa},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:he([String,Object]),default:"button"}}),IT={click:n=>n instanceof MouseEvent};function ct(n,e){LT(n)&&(n="100%");var t=BT(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function Ia(n){return Math.min(1,Math.max(0,n))}function LT(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function BT(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Qg(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function La(n){return n<=1?"".concat(Number(n)*100,"%"):n}function qs(n){return n.length===1?"0"+n:String(n)}function jT(n,e,t){return{r:ct(n,255)*255,g:ct(e,255)*255,b:ct(t,255)*255}}function em(n,e,t){n=ct(n,255),e=ct(e,255),t=ct(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=0,a=(s+r)/2;if(s===r)o=0,i=0;else{var c=s-r;switch(o=a>.5?c/(2-s-r):c/(s+r),s){case n:i=(e-t)/c+(e<t?6:0);break;case e:i=(t-n)/c+2;break;case t:i=(n-e)/c+4;break}i/=6}return{h:i,s:o,l:a}}function uu(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function $T(n,e,t){var s,r,i;if(n=ct(n,360),e=ct(e,100),t=ct(t,100),e===0)r=t,i=t,s=t;else{var o=t<.5?t*(1+e):t+e-t*e,a=2*t-o;s=uu(a,o,n+1/3),r=uu(a,o,n),i=uu(a,o,n-1/3)}return{r:s*255,g:r*255,b:i*255}}function tm(n,e,t){n=ct(n,255),e=ct(e,255),t=ct(t,255);var s=Math.max(n,e,t),r=Math.min(n,e,t),i=0,o=s,a=s-r,c=s===0?0:a/s;if(s===r)i=0;else{switch(s){case n:i=(e-t)/a+(e<t?6:0);break;case e:i=(t-n)/a+2;break;case t:i=(n-e)/a+4;break}i/=6}return{h:i,s:c,v:o}}function zT(n,e,t){n=ct(n,360)*6,e=ct(e,100),t=ct(t,100);var s=Math.floor(n),r=n-s,i=t*(1-e),o=t*(1-r*e),a=t*(1-(1-r)*e),c=s%6,u=[t,o,i,i,a,t][c],d=[a,t,t,o,i,i][c],f=[i,i,a,t,t,o][c];return{r:u*255,g:d*255,b:f*255}}function nm(n,e,t,s){var r=[qs(Math.round(n).toString(16)),qs(Math.round(e).toString(16)),qs(Math.round(t).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 FT(n,e,t,s,r){var i=[qs(Math.round(n).toString(16)),qs(Math.round(e).toString(16)),qs(Math.round(t).toString(16)),qs(UT(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 UT(n){return Math.round(parseFloat(n)*255).toString(16)}function sm(n){return Dt(n)/255}function Dt(n){return parseInt(n,16)}function HT(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var du={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 GT(n){var e={r:0,g:0,b:0},t=1,s=null,r=null,i=null,o=!1,a=!1;return typeof n=="string"&&(n=qT(n)),typeof n=="object"&&(Xn(n.r)&&Xn(n.g)&&Xn(n.b)?(e=jT(n.r,n.g,n.b),o=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Xn(n.h)&&Xn(n.s)&&Xn(n.v)?(s=La(n.s),r=La(n.v),e=zT(n.h,s,r),o=!0,a="hsv"):Xn(n.h)&&Xn(n.s)&&Xn(n.l)&&(s=La(n.s),i=La(n.l),e=$T(n.h,s,i),o=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Qg(t),{ok:o,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var WT="[-\\+]?\\d+%?",YT="[-\\+]?\\d*\\.\\d+%?",fs="(?:".concat(YT,")|(?:").concat(WT,")"),hu="[\\s|\\(]+(".concat(fs,")[,|\\s]+(").concat(fs,")[,|\\s]+(").concat(fs,")\\s*\\)?"),fu="[\\s|\\(]+(".concat(fs,")[,|\\s]+(").concat(fs,")[,|\\s]+(").concat(fs,")[,|\\s]+(").concat(fs,")\\s*\\)?"),hn={CSS_UNIT:new RegExp(fs),rgb:new RegExp("rgb"+hu),rgba:new RegExp("rgba"+fu),hsl:new RegExp("hsl"+hu),hsla:new RegExp("hsla"+fu),hsv:new RegExp("hsv"+hu),hsva:new RegExp("hsva"+fu),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 qT(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(du[n])n=du[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=hn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=hn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=hn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=hn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=hn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=hn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=hn.hex8.exec(n),t?{r:Dt(t[1]),g:Dt(t[2]),b:Dt(t[3]),a:sm(t[4]),format:e?"name":"hex8"}:(t=hn.hex6.exec(n),t?{r:Dt(t[1]),g:Dt(t[2]),b:Dt(t[3]),format:e?"name":"hex"}:(t=hn.hex4.exec(n),t?{r:Dt(t[1]+t[1]),g:Dt(t[2]+t[2]),b:Dt(t[3]+t[3]),a:sm(t[4]+t[4]),format:e?"name":"hex8"}:(t=hn.hex3.exec(n),t?{r:Dt(t[1]+t[1]),g:Dt(t[2]+t[2]),b:Dt(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function Xn(n){return!!hn.CSS_UNIT.exec(String(n))}var XT=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var s;if(e instanceof n)return e;typeof e=="number"&&(e=HT(e)),this.originalInput=e;var r=GT(e);this.originalInput=e,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=t.format)!==null&&s!==void 0?s:r.format,this.gradientType=t.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 e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,s,r,i=e.r/255,o=e.g/255,a=e.b/255;return i<=.03928?t=i/12.92:t=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*t+.7152*s+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=Qg(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=tm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=tm(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=em(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=em(this.r,this.g,this.b),t=Math.round(e.h*360),s=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(s,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(s,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),nm(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),FT(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},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 e=Math.round(this.r),t=Math.round(this.g),s=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(s,")"):"rgba(".concat(e,", ").concat(t,", ").concat(s,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(ct(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(ct(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+nm(this.r,this.g,this.b,!1),t=0,s=Object.entries(du);t<s.length;t++){var r=s[t],i=r[0],o=r[1];if(e===o)return i}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var s=!1,r=this.a<1&&this.a>=0,i=!t&&r&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(s=this.toRgbString()),e==="prgb"&&(s=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(s=this.toHexString()),e==="hex3"&&(s=this.toHexString(!0)),e==="hex4"&&(s=this.toHex8String(!0)),e==="hex8"&&(s=this.toHex8String()),e==="name"&&(s=this.toName()),e==="hsl"&&(s=this.toHslString()),e==="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(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Ia(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Ia(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Ia(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Ia(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),s=(t.h+e)%360;return t.h=s<0?360+s:s,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var s=this.toRgb(),r=new n(e).toRgb(),i=t/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(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var s=this.toHsl(),r=360/t,i=[this];for(s.h=(s.h-(r*e>>1)+720)%360;--e;)s.h=(s.h+r)%360,i.push(new n(s));return i},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),s=t.h,r=t.s,i=t.v,o=[],a=1/e;e--;)o.push(new n({h:s,s:r,v:i})),i=(i+a)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),s=new n(e).toRgb(),r=t.a+s.a*(1-t.a);return new n({r:(t.r*t.a+s.r*s.a*(1-t.a))/r,g:(t.g*t.a+s.g*s.a*(1-t.a))/r,b:(t.b*t.a+s.b*s.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),s=t.h,r=[this],i=360/e,o=1;o<e;o++)r.push(new n({h:(s+o*i)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function ps(n,e=20){return n.mix("#141414",e).toString()}function JT(n){const e=tu(),t=bt("button");return l.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 XT(r),a=n.dark?o.tint(20).toString():ps(o,20);if(n.plain)s=t.cssVarBlock({"bg-color":n.dark?ps(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?ps(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":a}),e.value&&(s[t.cssVarBlockName("disabled-bg-color")]=n.dark?ps(o,90):o.tint(90).toString(),s[t.cssVarBlockName("disabled-text-color")]=n.dark?ps(o,50):o.tint(50).toString(),s[t.cssVarBlockName("disabled-border-color")]=n.dark?ps(o,80):o.tint(80).toString());else{const c=n.dark?ps(o,30):o.tint(30).toString(),u=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(s=t.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":a,"active-border-color":a}),e.value){const d=n.dark?ps(o,50):o.tint(50).toString();s[t.cssVarBlockName("disabled-bg-color")]=d,s[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,s[t.cssVarBlockName("disabled-border-color")]=d}}}return s})}const KT=l.defineComponent({name:"ElButton"}),ZT=l.defineComponent({...KT,props:cu,emits:IT,setup(n,{expose:e,emit:t}){const s=n,r=JT(s),i=bt("button"),{_ref:o,_size:a,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:h}=RT(s,t),p=l.computed(()=>[i.b(),i.m(c.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 e({ref:o,size:a,type:c,disabled:u,shouldAddSpace:f}),(g,m)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.tag),l.mergeProps({ref_key:"_ref",ref:o},l.unref(d),{class:l.unref(p),style:l.unref(r),onClick:l.unref(h)}),{default:l.withCtx(()=>[g.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[g.$slots.loading?l.renderSlot(g.$slots,"loading",{key:0}):(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass(l.unref(i).is("loading"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.loadingIcon)))]),_:1},8,["class"]))],64)):g.icon||g.$slots.icon?(l.openBlock(),l.createBlock(l.unref(An),{key:1},{default:l.withCtx(()=>[g.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.icon),{key:0})):l.renderSlot(g.$slots,"icon",{key:1})]),_:3})):l.createCommentVNode("v-if",!0),g.$slots.default?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass({[l.unref(i).em("text","expand")]:l.unref(f)})},[l.renderSlot(g.$slots,"default")],2)):l.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var QT=pt(ZT,[["__file","button.vue"]]);const ek={size:cu.size,type:cu.type},tk=l.defineComponent({name:"ElButtonGroup"}),nk=l.defineComponent({...tk,props:ek,setup(n){const e=n;l.provide(Zg,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=bt("button");return(s,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(s.$slots,"default")],2))}});var rm=pt(nk,[["__file","button-group.vue"]]);const sk=Us(QT,{ButtonGroup:rm});SN(rm);function rk(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const pu="_trap-focus-children",Xs=[],im=n=>{var e;if(Xs.length===0)return;const t=Xs[Xs.length-1][pu];if(t.length>0&&n.code===Tr.tab){if(t.length===1){n.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const s=n.shiftKey,r=n.target===t[0],i=n.target===t[t.length-1];if(r&&s&&(n.preventDefault(),t[t.length-1].focus()),i&&!s&&(n.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const o=t.indexOf(n.target);o!==-1&&((e=t[s?o-1:o+1])==null||e.focus())}}},ik={beforeMount(n){n[pu]=Ah(n),Xs.push(n),Xs.length<=1&&document.addEventListener("keydown",im)},updated(n){l.nextTick(()=>{n[pu]=Ah(n)})},unmounted(){Xs.shift(),Xs.length===0&&document.removeEventListener("keydown",im)}},ok=et({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:he([String,Array,Object])},zIndex:{type:he([String,Number])}}),ak={click:n=>n instanceof MouseEvent},lk="overlay";var ck=l.defineComponent({name:"ElOverlay",props:ok,emits:ak,setup(n,{slots:e,emit:t}){const s=bt(lk),r=c=>{t("click",c)},{onClick:i,onMousedown:o,onMouseup:a}=pg(n.customMaskEvent?void 0:r);return()=>n.mask?l.createVNode("div",{class:[s.b(),n.overlayClass],style:{zIndex:n.zIndex},onClick:i,onMousedown:o,onMouseup:a},[l.renderSlot(e,"default")],Ca.STYLE|Ca.CLASS|Ca.PROPS,["onClick","onMouseup","onMousedown"]):l.h("div",{class:n.overlayClass,style:{zIndex:n.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[l.renderSlot(e,"default")])}});const uk=ck,om=["success","info","warning","error"],gt=Gp({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:We?document.body:void 0}),dk=et({customClass:{type:String,default:gt.customClass},center:{type:Boolean,default:gt.center},dangerouslyUseHTMLString:{type:Boolean,default:gt.dangerouslyUseHTMLString},duration:{type:Number,default:gt.duration},icon:{type:zi,default:gt.icon},id:{type:String,default:gt.id},message:{type:he([String,Object,Function]),default:gt.message},onClose:{type:he(Function),default:gt.onClose},showClose:{type:Boolean,default:gt.showClose},type:{type:String,values:om,default:gt.type},plain:{type:Boolean,default:gt.plain},offset:{type:Number,default:gt.offset},zIndex:{type:Number,default:gt.zIndex},grouping:{type:Boolean,default:gt.grouping},repeatNum:{type:Number,default:gt.repeatNum}}),hk={destroy:()=>!0},fn=l.shallowReactive([]),fk=n=>{const e=fn.findIndex(r=>r.id===n),t=fn[e];let s;return e>0&&(s=fn[e-1]),{current:t,prev:s}},pk=n=>{const{prev:e}=fk(n);return e?e.vm.exposed.bottom.value:0},gk=(n,e)=>fn.findIndex(s=>s.id===n)>0?16:e,mk=l.defineComponent({name:"ElMessage"}),yk=l.defineComponent({...mk,props:dk,emits:hk,setup(n,{expose:e}){const t=n,{Close:s}=Up,{ns:r,zIndex:i}=Ng("message"),{currentZIndex:o,nextZIndex:a}=i,c=l.ref(),u=l.ref(!1),d=l.ref(0);let f;const h=l.computed(()=>t.type?t.type==="error"?"danger":t.type:"info"),p=l.computed(()=>{const C=t.type;return{[r.bm("icon",C)]:C&&va[C]}}),g=l.computed(()=>t.icon||va[t.type]||""),m=l.computed(()=>pk(t.id)),y=l.computed(()=>gk(t.id,t.offset)+m.value),b=l.computed(()=>d.value+y.value),w=l.computed(()=>({top:`${y.value}px`,zIndex:o.value}));function x(){t.duration!==0&&({stop:f}=_v(()=>{v()},t.duration))}function S(){f==null||f()}function v(){u.value=!1}function E({code:C}){C===Tr.esc&&v()}return l.onMounted(()=>{x(),a(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{S(),x()}),Gn(document,"keydown",E),Ih(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:b,close:v}),(C,O)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:C.onClose,onAfterLeave:A=>C.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:C.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(C.type)]:C.type},l.unref(r).is("center",C.center),l.unref(r).is("closable",C.showClose),l.unref(r).is("plain",C.plain),C.customClass]),style:l.normalizeStyle(l.unref(w)),role:"alert",onMouseenter:S,onMouseleave:x},[C.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(DT),{key:0,value:C.repeatNum,type:l.unref(h),class:l.normalizeClass(l.unref(r).e("badge"))},null,8,["value","type","class"])):l.createCommentVNode("v-if",!0),l.unref(g)?(l.openBlock(),l.createBlock(l.unref(An),{key:1,class:l.normalizeClass([l.unref(r).e("icon"),l.unref(p)])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(g))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.renderSlot(C.$slots,"default",{},()=>[C.dangerouslyUseHTMLString?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),l.createElementVNode("p",{class:l.normalizeClass(l.unref(r).e("content")),innerHTML:C.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(C.message),3))]),C.showClose?(l.openBlock(),l.createBlock(l.unref(An),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(v,["stop"])},{default:l.withCtx(()=>[l.createVNode(l.unref(s))]),_:1},8,["class","onClick"])):l.createCommentVNode("v-if",!0)],46,["id"]),[[l.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var bk=pt(yk,[["__file","message.vue"]]);let wk=1;const am=n=>{const e=!n||sn(n)||l.isVNode(n)||zt(n)?{message:n}:n,t={...gt,...e};if(!t.appendTo)t.appendTo=document.body;else if(sn(t.appendTo)){let s=document.querySelector(t.appendTo);qn(s)||(Tt("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),s=document.body),t.appendTo=s}return ya(un.grouping)&&!t.grouping&&(t.grouping=un.grouping),Ht(un.duration)&&t.duration===3e3&&(t.duration=un.duration),Ht(un.offset)&&t.offset===16&&(t.offset=un.offset),ya(un.showClose)&&!t.showClose&&(t.showClose=un.showClose),t},xk=n=>{const e=fn.indexOf(n);if(e===-1)return;fn.splice(e,1);const{handler:t}=n;t.close()},vk=({appendTo:n,...e},t)=>{const s=`message_${wk++}`,r=e.onClose,i=document.createElement("div"),o={...e,id:s,onClose:()=>{r==null||r(),xk(d)},onDestroy:()=>{l.render(null,i)}},a=l.createVNode(bk,o,zt(o.message)||l.isVNode(o.message)?{default:zt(o.message)?o.message:()=>o.message}:null);a.appContext=t||Br._context,l.render(a,i),n.appendChild(i.firstElementChild);const c=a.component,d={id:s,vnode:a,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:a.component.props};return d},Br=(n={},e)=>{if(!We)return{close:()=>{}};const t=am(n);if(t.grouping&&fn.length){const r=fn.find(({vnode:i})=>{var o;return((o=i.props)==null?void 0:o.message)===t.message});if(r)return r.props.repeatNum+=1,r.props.type=t.type,r.handler}if(Ht(un.max)&&fn.length>=un.max)return{close:()=>{}};const s=vk(t,e);return fn.push(s),s.handler};om.forEach(n=>{Br[n]=(e={},t)=>{const s=am(e);return Br({...s,type:n},t)}});function Ck(n){for(const e of fn)(!n||n===e.props.type)&&e.handler.close()}Br.closeAll=Ck,Br._context=null;const qe=CN(Br,"$message"),Sk=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:ik},components:{ElButton:sk,ElFocusTrap:Yg,ElInput:N_,ElOverlay:uk,ElIcon:An,...Up},inheritAttrs:!1,props:{buttonSize:{type:String,validator:EN},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:e}){const{locale:t,zIndex:s,ns:r,size:i}=Ng("message-box",l.computed(()=>n.buttonSize)),{t:o}=t,{nextZIndex:a}=s,c=l.ref(!1),u=l.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:l.markRaw(wa),cancelButtonLoadingIcon:l.markRaw(wa),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=l.computed(()=>{const P=u.type;return{[r.bm("icon",P)]:P&&va[P]}}),f=Aa(),h=Aa(),p=l.computed(()=>u.icon||va[u.type]||""),g=l.computed(()=>!!u.message),m=l.ref(),y=l.ref(),b=l.ref(),w=l.ref(),x=l.ref(),S=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async P=>{await l.nextTick(),n.boxType==="prompt"&&P!==null&&V()},{immediate:!0}),l.watch(()=>c.value,P=>{var T,j;P&&(n.boxType!=="prompt"&&(u.autofocus?b.value=(j=(T=x.value)==null?void 0:T.$el)!=null?j:m.value:b.value=m.value),u.zIndex=a()),n.boxType==="prompt"&&(P?l.nextTick().then(()=>{var Y;w.value&&w.value.$el&&(u.autofocus?b.value=(Y=L())!=null?Y:m.value:b.value=m.value)}):(u.editorErrorMessage="",u.validateError=!1))});const v=l.computed(()=>n.draggable),E=l.computed(()=>n.overflow);_N(m,y,v,E),l.onMounted(async()=>{await l.nextTick(),n.closeOnHashChange&&window.addEventListener("hashchange",C)}),l.onBeforeUnmount(()=>{n.closeOnHashChange&&window.removeEventListener("hashchange",C)});function C(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const O=()=>{n.closeOnClickModal&&_(u.distinguishCancelAndClose?"close":"cancel")},A=pg(O),k=P=>{if(u.inputType!=="textarea")return P.preventDefault(),_("confirm")},_=P=>{var T;n.boxType==="prompt"&&P==="confirm"&&!V()||(u.action=P,u.beforeClose?(T=u.beforeClose)==null||T.call(u,P,u,C):C())},V=()=>{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 T=u.inputValidator;if(typeof T=="function"){const j=T(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},L=()=>{const P=w.value.$refs;return P.input||P.textarea},B=()=>{_("close")},N=()=>{n.closeOnPressEscape&&B()};return n.lockScroll&&LN(c),{...l.toRefs(u),ns:r,overlayEvent:A,visible:c,hasMessage:g,typeClass:d,contentId:f,inputId:h,btnSize:i,iconComponent:p,confirmButtonClasses:S,rootRef:m,focusStartRef:b,headerRef:y,inputRef:w,confirmRef:x,doClose:C,handleClose:B,onCloseRequested:N,handleWrapperClick:O,handleInputEnter:k,handleAction:_,t:o}}});function Ek(n,e,t,s,r,i){const o=l.resolveComponent("el-icon"),a=l.resolveComponent("close"),c=l.resolveComponent("el-input"),u=l.resolveComponent("el-button"),d=l.resolveComponent("el-focus-trap"),f=l.resolveComponent("el-overlay");return l.openBlock(),l.createBlock(l.Transition,{name:"fade-in-linear",onAfterLeave:h=>n.$emit("vanish"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(f,{"z-index":n.zIndex,"overlay-class":[n.ns.is("message-box"),n.modalClass],mask:n.modal},{default:l.withCtx(()=>[l.createElementVNode("div",{role:"dialog","aria-label":n.title,"aria-modal":"true","aria-describedby":n.showInput?void 0:n.contentId,class:l.normalizeClass(`${n.ns.namespace.value}-overlay-message-box`),onClick:n.overlayEvent.onClick,onMousedown:n.overlayEvent.onMousedown,onMouseup:n.overlayEvent.onMouseup},[l.createVNode(d,{loop:"",trapped:n.visible,"focus-trap-el":n.rootRef,"focus-start-el":n.focusStartRef,onReleaseRequested:n.onCloseRequested},{default:l.withCtx(()=>[l.createElementVNode("div",{ref:"rootRef",class:l.normalizeClass([n.ns.b(),n.customClass,n.ns.is("draggable",n.draggable),{[n.ns.m("center")]:n.center}]),style:l.normalizeStyle(n.customStyle),tabindex:"-1",onClick:l.withModifiers(()=>{},["stop"])},[n.title!==null&&n.title!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,ref:"headerRef",class:l.normalizeClass([n.ns.e("header"),{"show-close":n.showClose}])},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("title"))},[n.iconComponent&&n.center?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.createElementVNode("span",null,l.toDisplayString(n.title),1)],2),n.showClose?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(n.ns.e("headerbtn")),"aria-label":n.t("el.messagebox.close"),onClick:h=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction(n.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[l.createVNode(o,{class:l.normalizeClass(n.ns.e("close"))},{default:l.withCtx(()=>[l.createVNode(a)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):l.createCommentVNode("v-if",!0)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{id:n.contentId,class:l.normalizeClass(n.ns.e("content"))},[l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("container"))},[n.iconComponent&&!n.center&&n.hasMessage?(l.openBlock(),l.createBlock(o,{key:0,class:l.normalizeClass([n.ns.e("status"),n.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),n.hasMessage?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(n.ns.e("message"))},[l.renderSlot(n.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:1,for:n.showInput?n.inputId:void 0,innerHTML:n.message},null,8,["for","innerHTML"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.showInput?"label":"p"),{key:0,for:n.showInput?n.inputId:void 0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.dangerouslyUseHTMLString?"":n.message),1)]),_:1},8,["for"]))])],2)):l.createCommentVNode("v-if",!0)],2),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("input"))},[l.createVNode(c,{id:n.inputId,ref:"inputRef",modelValue:n.inputValue,"onUpdate:modelValue":h=>n.inputValue=h,type:n.inputType,placeholder:n.inputPlaceholder,"aria-invalid":n.validateError,class:l.normalizeClass({invalid:n.validateError}),onKeydown:l.withKeys(n.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("errormsg")),style:l.normalizeStyle({visibility:n.editorErrorMessage?"visible":"hidden"})},l.toDisplayString(n.editorErrorMessage),7)],2),[[l.vShow,n.showInput]])],10,["id"]),l.createElementVNode("div",{class:l.normalizeClass(n.ns.e("btns"))},[n.showCancelButton?(l.openBlock(),l.createBlock(u,{key:0,loading:n.cancelButtonLoading,"loading-icon":n.cancelButtonLoadingIcon,class:l.normalizeClass([n.cancelButtonClass]),round:n.roundButton,size:n.btnSize,onClick:h=>n.handleAction("cancel"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction("cancel"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.cancelButtonText||n.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode(u,{ref:"confirmRef",type:"primary",loading:n.confirmButtonLoading,"loading-icon":n.confirmButtonLoadingIcon,class:l.normalizeClass([n.confirmButtonClasses]),round:n.roundButton,disabled:n.confirmButtonDisabled,size:n.btnSize,onClick:h=>n.handleAction("confirm"),onKeydown:l.withKeys(l.withModifiers(h=>n.handleAction("confirm"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.confirmButtonText||n.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[l.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"]),[[l.vShow,n.visible]])]),_:3},8,["onAfterLeave"])}var Ok=pt(Sk,[["render",Ek],["__file","index.vue"]]);const Xi=new Map,Mk=n=>{let e=document.body;return n.appendTo&&(sn(n.appendTo)&&(e=document.querySelector(n.appendTo)),qn(n.appendTo)&&(e=n.appendTo),qn(e)||(Tt("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},Pk=(n,e,t=null)=>{const s=l.createVNode(Ok,n,zt(n.message)||l.isVNode(n.message)?{default:zt(n.message)?n.message:()=>n.message}:null);return s.appContext=t,l.render(s,e),Mk(n).appendChild(e.firstElementChild),s.component},Nk=()=>document.createElement("div"),Ak=(n,e)=>{const t=Nk();n.onVanish=()=>{l.render(null,t),Xi.delete(r)},n.onAction=i=>{const o=Xi.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=Pk(n,t,e),r=s.proxy;for(const i in n)Yo(n,i)&&!Yo(r.$props,i)&&(r[i]=n[i]);return r.visible=!0,r};function jr(n,e=null){if(!We)return Promise.reject();let t;return sn(n)||l.isVNode(n)?n={message:n}:t=n.callback,new Promise((s,r)=>{const i=Ak(n,e??jr._context);Xi.set(i,{options:n,callback:t,resolve:s,reject:r})})}const _k=["alert","confirm","prompt"],Tk={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};_k.forEach(n=>{jr[n]=kk(n)});function kk(n){return(e,t,s,r)=>{let i="";return xr(t)?(s=t,i=""):kp(t)?i="":i=t,jr(Object.assign({title:i,message:e,type:"",...Tk[n]},s,{boxType:n}),r)}}jr.close=()=>{Xi.forEach((n,e)=>{e.doClose()}),Xi.clear()},jr._context=null;const gs=jr;gs.install=n=>{gs._context=n._context,n.config.globalProperties.$msgbox=gs,n.config.globalProperties.$messageBox=gs,n.config.globalProperties.$alert=gs.alert,n.config.globalProperties.$confirm=gs.confirm,n.config.globalProperties.$prompt=gs.prompt};const Vk=gs;function lm(n,e){return function(){return n.apply(e,arguments)}}const{toString:Dk}=Object.prototype,{getPrototypeOf:gu}=Object,Ba=(n=>e=>{const t=Dk.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),pn=n=>(n=n.toLowerCase(),e=>Ba(e)===n),ja=n=>e=>typeof e===n,{isArray:$r}=Array,Ji=ja("undefined");function Rk(n){return n!==null&&!Ji(n)&&n.constructor!==null&&!Ji(n.constructor)&&Rt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const cm=pn("ArrayBuffer");function Ik(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&cm(n.buffer),e}const Lk=ja("string"),Rt=ja("function"),um=ja("number"),$a=n=>n!==null&&typeof n=="object",Bk=n=>n===!0||n===!1,za=n=>{if(Ba(n)!=="object")return!1;const e=gu(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},jk=pn("Date"),$k=pn("File"),zk=pn("Blob"),Fk=pn("FileList"),Uk=n=>$a(n)&&Rt(n.pipe),Hk=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Rt(n.append)&&((e=Ba(n))==="formdata"||e==="object"&&Rt(n.toString)&&n.toString()==="[object FormData]"))},Gk=pn("URLSearchParams"),[Wk,Yk,qk,Xk]=["ReadableStream","Request","Response","Headers"].map(pn),Jk=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ki(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let s,r;if(typeof n!="object"&&(n=[n]),$r(n))for(s=0,r=n.length;s<r;s++)e.call(null,n[s],s,n);else{const i=t?Object.getOwnPropertyNames(n):Object.keys(n),o=i.length;let a;for(s=0;s<o;s++)a=i[s],e.call(null,n[a],a,n)}}function dm(n,e){e=e.toLowerCase();const t=Object.keys(n);let s=t.length,r;for(;s-- >0;)if(r=t[s],e===r.toLowerCase())return r;return null}const Js=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hm=n=>!Ji(n)&&n!==Js;function mu(){const{caseless:n}=hm(this)&&this||{},e={},t=(s,r)=>{const i=n&&dm(e,r)||r;za(e[i])&&za(s)?e[i]=mu(e[i],s):za(s)?e[i]=mu({},s):$r(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&Ki(arguments[s],t);return e}const Kk=(n,e,t,{allOwnKeys:s}={})=>(Ki(e,(r,i)=>{t&&Rt(r)?n[i]=lm(r,t):n[i]=r},{allOwnKeys:s}),n),Zk=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Qk=(n,e,t,s)=>{n.prototype=Object.create(e.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},eV=(n,e,t,s)=>{let r,i,o;const a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),i=r.length;i-- >0;)o=r[i],(!s||s(o,n,e))&&!a[o]&&(e[o]=n[o],a[o]=!0);n=t!==!1&&gu(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},tV=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const s=n.indexOf(e,t);return s!==-1&&s===t},nV=n=>{if(!n)return null;if($r(n))return n;let e=n.length;if(!um(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},sV=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&gu(Uint8Array)),rV=(n,e)=>{const s=(n&&n[Symbol.iterator]).call(n);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(n,i[0],i[1])}},iV=(n,e)=>{let t;const s=[];for(;(t=n.exec(e))!==null;)s.push(t);return s},oV=pn("HTMLFormElement"),aV=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,r){return s.toUpperCase()+r}),fm=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),lV=pn("RegExp"),pm=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),s={};Ki(t,(r,i)=>{let o;(o=e(r,i,n))!==!1&&(s[i]=o||r)}),Object.defineProperties(n,s)},cV=n=>{pm(n,(e,t)=>{if(Rt(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=n[t];if(Rt(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},uV=(n,e)=>{const t={},s=r=>{r.forEach(i=>{t[i]=!0})};return $r(n)?s(n):s(String(n).split(e)),t},dV=()=>{},hV=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,yu="abcdefghijklmnopqrstuvwxyz",gm="0123456789",mm={DIGIT:gm,ALPHA:yu,ALPHA_DIGIT:yu+yu.toUpperCase()+gm},fV=(n=16,e=mm.ALPHA_DIGIT)=>{let t="";const{length:s}=e;for(;n--;)t+=e[Math.random()*s|0];return t};function pV(n){return!!(n&&Rt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const gV=n=>{const e=new Array(10),t=(s,r)=>{if($a(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const i=$r(s)?[]:{};return Ki(s,(o,a)=>{const c=t(o,r+1);!Ji(c)&&(i[a]=c)}),e[r]=void 0,i}}return s};return t(n,0)},mV=pn("AsyncFunction"),yV=n=>n&&($a(n)||Rt(n))&&Rt(n.then)&&Rt(n.catch),ym=((n,e)=>n?setImmediate:e?((t,s)=>(Js.addEventListener("message",({source:r,data:i})=>{r===Js&&i===t&&s.length&&s.shift()()},!1),r=>{s.push(r),Js.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Rt(Js.postMessage)),bV=typeof queueMicrotask<"u"?queueMicrotask.bind(Js):typeof process<"u"&&process.nextTick||ym,R={isArray:$r,isArrayBuffer:cm,isBuffer:Rk,isFormData:Hk,isArrayBufferView:Ik,isString:Lk,isNumber:um,isBoolean:Bk,isObject:$a,isPlainObject:za,isReadableStream:Wk,isRequest:Yk,isResponse:qk,isHeaders:Xk,isUndefined:Ji,isDate:jk,isFile:$k,isBlob:zk,isRegExp:lV,isFunction:Rt,isStream:Uk,isURLSearchParams:Gk,isTypedArray:sV,isFileList:Fk,forEach:Ki,merge:mu,extend:Kk,trim:Jk,stripBOM:Zk,inherits:Qk,toFlatObject:eV,kindOf:Ba,kindOfTest:pn,endsWith:tV,toArray:nV,forEachEntry:rV,matchAll:iV,isHTMLForm:oV,hasOwnProperty:fm,hasOwnProp:fm,reduceDescriptors:pm,freezeMethods:cV,toObjectSet:uV,toCamelCase:aV,noop:dV,toFiniteNumber:hV,findKey:dm,global:Js,isContextDefined:hm,ALPHABET:mm,generateString:fV,isSpecCompliantForm:pV,toJSONObject:gV,isAsyncFn:mV,isThenable:yV,setImmediate:ym,asap:bV};function ue(n,e,t,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}R.inherits(ue,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 bm=ue.prototype,wm={};["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=>{wm[n]={value:n}}),Object.defineProperties(ue,wm),Object.defineProperty(bm,"isAxiosError",{value:!0}),ue.from=(n,e,t,s,r,i)=>{const o=Object.create(bm);return R.toFlatObject(n,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ue.call(o,n.message,e,t,s,r),o.cause=n,o.name=n.name,i&&Object.assign(o,i),o};const wV=null;function bu(n){return R.isPlainObject(n)||R.isArray(n)}function xm(n){return R.endsWith(n,"[]")?n.slice(0,-2):n}function vm(n,e,t){return n?n.concat(e).map(function(r,i){return r=xm(r),!t&&i?"["+r+"]":r}).join(t?".":""):e}function xV(n){return R.isArray(n)&&!n.some(bu)}const vV=R.toFlatObject(R,{},null,function(e){return/^is[A-Z]/.test(e)});function Fa(n,e,t){if(!R.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=R.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!R.isUndefined(y[m])});const s=t.metaTokens,r=t.visitor||d,i=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&R.isSpecCompliantForm(e);if(!R.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(R.isDate(g))return g.toISOString();if(!c&&R.isBlob(g))throw new ue("Blob is not supported. Use a Buffer instead.");return R.isArrayBuffer(g)||R.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,y){let b=g;if(g&&!y&&typeof g=="object"){if(R.endsWith(m,"{}"))m=s?m:m.slice(0,-2),g=JSON.stringify(g);else if(R.isArray(g)&&xV(g)||(R.isFileList(g)||R.endsWith(m,"[]"))&&(b=R.toArray(g)))return m=xm(m),b.forEach(function(x,S){!(R.isUndefined(x)||x===null)&&e.append(o===!0?vm([m],S,i):o===null?m:m+"[]",u(x))}),!1}return bu(g)?!0:(e.append(vm(y,m,i),u(g)),!1)}const f=[],h=Object.assign(vV,{defaultVisitor:d,convertValue:u,isVisitable:bu});function p(g,m){if(!R.isUndefined(g)){if(f.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));f.push(g),R.forEach(g,function(b,w){(!(R.isUndefined(b)||b===null)&&r.call(e,b,R.isString(w)?w.trim():w,m,h))===!0&&p(b,m?m.concat(w):[w])}),f.pop()}}if(!R.isObject(n))throw new TypeError("data must be an object");return p(n),e}function Cm(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function wu(n,e){this._pairs=[],n&&Fa(n,this,e)}const Sm=wu.prototype;Sm.append=function(e,t){this._pairs.push([e,t])},Sm.toString=function(e){const t=e?function(s){return e.call(this,s,Cm)}:Cm;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function CV(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Em(n,e,t){if(!e)return n;const s=t&&t.encode||CV,r=t&&t.serialize;let i;if(r?i=r(e,t):i=R.isURLSearchParams(e)?e.toString():new wu(e,t).toString(s),i){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}class Om{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){R.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Mm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},SV={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:wu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xu=typeof window<"u"&&typeof document<"u",vu=typeof navigator=="object"&&navigator||void 0,EV=xu&&(!vu||["ReactNative","NativeScript","NS"].indexOf(vu.product)<0),OV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MV=xu&&window.location.href||"http://localhost",Ot={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xu,hasStandardBrowserEnv:EV,hasStandardBrowserWebWorkerEnv:OV,navigator:vu,origin:MV},Symbol.toStringTag,{value:"Module"})),...SV};function PV(n,e){return Fa(n,new Ot.classes.URLSearchParams,Object.assign({visitor:function(t,s,r,i){return Ot.isNode&&R.isBuffer(t)?(this.append(s,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function NV(n){return R.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function AV(n){const e={},t=Object.keys(n);let s;const r=t.length;let i;for(s=0;s<r;s++)i=t[s],e[i]=n[i];return e}function Pm(n){function e(t,s,r,i){let o=t[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=t.length;return o=!o&&R.isArray(r)?r.length:o,c?(R.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!R.isObject(r[o]))&&(r[o]=[]),e(t,s,r[o],i)&&R.isArray(r[o])&&(r[o]=AV(r[o])),!a)}if(R.isFormData(n)&&R.isFunction(n.entries)){const t={};return R.forEachEntry(n,(s,r)=>{e(NV(s),r,t,0)}),t}return null}function _V(n,e,t){if(R.isString(n))try{return(e||JSON.parse)(n),R.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const Zi={transitional:Mm,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,i=R.isObject(e);if(i&&R.isHTMLForm(e)&&(e=new FormData(e)),R.isFormData(e))return r?JSON.stringify(Pm(e)):e;if(R.isArrayBuffer(e)||R.isBuffer(e)||R.isStream(e)||R.isFile(e)||R.isBlob(e)||R.isReadableStream(e))return e;if(R.isArrayBufferView(e))return e.buffer;if(R.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return PV(e,this.formSerializer).toString();if((a=R.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Fa(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),_V(e)):e}],transformResponse:[function(e){const t=this.transitional||Zi.transitional,s=t&&t.forcedJSONParsing,r=this.responseType==="json";if(R.isResponse(e)||R.isReadableStream(e))return e;if(e&&R.isString(e)&&(s&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(o)throw a.name==="SyntaxError"?ue.from(a,ue.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ot.classes.FormData,Blob:Ot.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};R.forEach(["delete","get","head","post","put","patch"],n=>{Zi.headers[n]={}});const TV=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"]),kV=n=>{const e={};let t,s,r;return n&&n.split(`
34
+ `).forEach(function(o){r=o.indexOf(":"),t=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!t||e[t]&&TV[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Nm=Symbol("internals");function Qi(n){return n&&String(n).trim().toLowerCase()}function Ua(n){return n===!1||n==null?n:R.isArray(n)?n.map(Ua):String(n)}function VV(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(n);)e[s[1]]=s[2];return e}const DV=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Cu(n,e,t,s,r){if(R.isFunction(s))return s.call(this,e,t);if(r&&(e=t),!!R.isString(e)){if(R.isString(s))return e.indexOf(s)!==-1;if(R.isRegExp(s))return s.test(e)}}function RV(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function IV(n,e){const t=R.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+t,{value:function(r,i,o){return this[s].call(this,e,r,i,o)},configurable:!0})})}class Mt{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function i(a,c,u){const d=Qi(c);if(!d)throw new Error("header name must be a non-empty string");const f=R.findKey(r,d);(!f||r[f]===void 0||u===!0||u===void 0&&r[f]!==!1)&&(r[f||c]=Ua(a))}const o=(a,c)=>R.forEach(a,(u,d)=>i(u,d,c));if(R.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(R.isString(e)&&(e=e.trim())&&!DV(e))o(kV(e),t);else if(R.isHeaders(e))for(const[a,c]of e.entries())i(c,a,s);else e!=null&&i(t,e,s);return this}get(e,t){if(e=Qi(e),e){const s=R.findKey(this,e);if(s){const r=this[s];if(!t)return r;if(t===!0)return VV(r);if(R.isFunction(t))return t.call(this,r,s);if(R.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Qi(e),e){const s=R.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||Cu(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let r=!1;function i(o){if(o=Qi(o),o){const a=R.findKey(s,o);a&&(!t||Cu(s,s[a],a,t))&&(delete s[a],r=!0)}}return R.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let s=t.length,r=!1;for(;s--;){const i=t[s];(!e||Cu(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const t=this,s={};return R.forEach(this,(r,i)=>{const o=R.findKey(s,i);if(o){t[o]=Ua(r),delete t[i];return}const a=e?RV(i):String(i).trim();a!==i&&delete t[i],t[a]=Ua(r),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return R.forEach(this,(s,r)=>{s!=null&&s!==!1&&(t[r]=e&&R.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
35
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Nm]=this[Nm]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Qi(o);s[a]||(IV(r,o),s[a]=!0)}return R.isArray(e)?e.forEach(i):i(e),this}}Mt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(Mt.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(s){this[t]=s}}}),R.freezeMethods(Mt);function Su(n,e){const t=this||Zi,s=e||t,r=Mt.from(s.headers);let i=s.data;return R.forEach(n,function(a){i=a.call(t,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function Am(n){return!!(n&&n.__CANCEL__)}function zr(n,e,t){ue.call(this,n??"canceled",ue.ERR_CANCELED,e,t),this.name="CanceledError"}R.inherits(zr,ue,{__CANCEL__:!0});function _m(n,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?n(t):e(new ue("Request failed with status code "+t.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function LV(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function BV(n,e){n=n||10;const t=new Array(n),s=new Array(n);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=s[i];o||(o=u),t[r]=c,s[r]=u;let f=i,h=0;for(;f!==r;)h+=t[f++],f=f%n;if(r=(r+1)%n,r===i&&(i=(i+1)%n),u-o<e)return;const p=d&&u-d;return p?Math.round(h*1e3/p):void 0}}function jV(n,e){let t=0,s=1e3/e,r,i;const o=(u,d=Date.now())=>{t=d,r=null,i&&(clearTimeout(i),i=null),n.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-t;f>=s?o(u,d):(r=u,i||(i=setTimeout(()=>{i=null,o(r)},s-f)))},()=>r&&o(r)]}const Ha=(n,e,t=3)=>{let s=0;const r=BV(50,250);return jV(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-s,u=r(c),d=o<=a;s=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(f)},t)},Tm=(n,e)=>{const t=n!=null;return[s=>e[0]({lengthComputable:t,total:n,loaded:s}),e[1]]},km=n=>(...e)=>R.asap(()=>n(...e)),$V=Ot.hasStandardBrowserEnv?function(){const e=Ot.navigator&&/(msie|trident)/i.test(Ot.navigator.userAgent),t=document.createElement("a");let s;function r(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.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}}(),zV=Ot.hasStandardBrowserEnv?{write(n,e,t,s,r,i){const o=[n+"="+encodeURIComponent(e)];R.isNumber(t)&&o.push("expires="+new Date(t).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 e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function FV(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function UV(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Vm(n,e){return n&&!FV(e)?UV(n,e):e}const Dm=n=>n instanceof Mt?{...n}:n;function Ks(n,e){e=e||{};const t={};function s(u,d,f){return R.isPlainObject(u)&&R.isPlainObject(d)?R.merge.call({caseless:f},u,d):R.isPlainObject(d)?R.merge({},d):R.isArray(d)?d.slice():d}function r(u,d,f){if(R.isUndefined(d)){if(!R.isUndefined(u))return s(void 0,u,f)}else return s(u,d,f)}function i(u,d){if(!R.isUndefined(d))return s(void 0,d)}function o(u,d){if(R.isUndefined(d)){if(!R.isUndefined(u))return s(void 0,u)}else return s(void 0,d)}function a(u,d,f){if(f in e)return s(u,d);if(f in n)return s(void 0,u)}const c={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,d)=>r(Dm(u),Dm(d),!0)};return R.forEach(Object.keys(Object.assign({},n,e)),function(d){const f=c[d]||r,h=f(n[d],e[d],d);R.isUndefined(h)&&f!==a||(t[d]=h)}),t}const Rm=n=>{const e=Ks({},n);let{data:t,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=Mt.from(o),e.url=Em(Vm(e.baseURL,e.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(R.isFormData(t)){if(Ot.hasStandardBrowserEnv||Ot.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Ot.hasStandardBrowserEnv&&(s&&R.isFunction(s)&&(s=s(e)),s||s!==!1&&$V(e.url))){const u=r&&i&&zV.read(i);u&&o.set(r,u)}return e},HV=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,s){const r=Rm(n);let i=r.data;const o=Mt.from(r.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=r,d,f,h,p,g;function m(){p&&p(),g&&g(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function b(){if(!y)return;const x=Mt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),v={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:n,request:y};_m(function(C){t(C),m()},function(C){s(C),m()},v),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 ue("Request aborted",ue.ECONNABORTED,n,y)),y=null)},y.onerror=function(){s(new ue("Network Error",ue.ERR_NETWORK,n,y)),y=null},y.ontimeout=function(){let S=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const v=r.transitional||Mm;r.timeoutErrorMessage&&(S=r.timeoutErrorMessage),s(new ue(S,v.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,n,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&R.forEach(o.toJSON(),function(S,v){y.setRequestHeader(v,S)}),R.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),a&&a!=="json"&&(y.responseType=r.responseType),u&&([h,g]=Ha(u,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,p]=Ha(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",p)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new zr(null,n,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const w=LV(r.url);if(w&&Ot.protocols.indexOf(w)===-1){s(new ue("Unsupported protocol "+w+":",ue.ERR_BAD_REQUEST,n));return}y.send(i||null)})},GV=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let s=new AbortController,r;const i=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;s.abort(d instanceof ue?d:new zr(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);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:c}=s;return c.unsubscribe=()=>R.asap(a),c}},WV=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let s=0,r;for(;s<t;)r=s+e,yield n.slice(s,r),s=r},YV=async function*(n,e){for await(const t of qV(n))yield*WV(t,e)},qV=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Im=(n,e,t,s)=>{const r=YV(n,e);let i=0,o,a=c=>{o||(o=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){a(),c.close();return}let f=d.byteLength;if(t){let h=i+=f;t(h)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},Ga=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Lm=Ga&&typeof ReadableStream=="function",XV=Ga&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Bm=(n,...e)=>{try{return!!n(...e)}catch{return!1}},JV=Lm&&Bm(()=>{let n=!1;const e=new Request(Ot.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),jm=64*1024,Eu=Lm&&Bm(()=>R.isReadableStream(new Response("").body)),Wa={stream:Eu&&(n=>n.body)};Ga&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Wa[e]&&(Wa[e]=R.isFunction(n[e])?t=>t[e]():(t,s)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,s)})})})(new Response);const KV=async n=>{if(n==null)return 0;if(R.isBlob(n))return n.size;if(R.isSpecCompliantForm(n))return(await new Request(Ot.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 XV(n)).byteLength},ZV=async(n,e)=>{const t=R.toFiniteNumber(n.getContentLength());return t??KV(e)},Ou={http:wV,xhr:HV,fetch:Ga&&(async n=>{let{url:e,method:t,data:s,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:h}=Rm(n);u=u?(u+"").toLowerCase():"text";let p=GV([r,i&&i.toAbortSignal()],o),g;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(c&&JV&&t!=="get"&&t!=="head"&&(y=await ZV(d,s))!==0){let v=new Request(e,{method:"POST",body:s,duplex:"half"}),E;if(R.isFormData(s)&&(E=v.headers.get("content-type"))&&d.setContentType(E),v.body){const[C,O]=Tm(y,Ha(km(c)));s=Im(v.body,jm,C,O)}}R.isString(f)||(f=f?"include":"omit");const b="credentials"in Request.prototype;g=new Request(e,{...h,signal:p,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:b?f:void 0});let w=await fetch(g);const x=Eu&&(u==="stream"||u==="response");if(Eu&&(a||x&&m)){const v={};["status","statusText","headers"].forEach(A=>{v[A]=w[A]});const E=R.toFiniteNumber(w.headers.get("content-length")),[C,O]=a&&Tm(E,Ha(km(a),!0))||[];w=new Response(Im(w.body,jm,C,()=>{O&&O(),m&&m()}),v)}u=u||"text";let S=await Wa[R.findKey(Wa,u)||"text"](w,n);return!x&&m&&m(),await new Promise((v,E)=>{_m(v,E,{data:S,headers:Mt.from(w.headers),status:w.status,statusText:w.statusText,config:n,request:g})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/fetch/i.test(b.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,n,g),{cause:b.cause||b}):ue.from(b,b&&b.code,n,g)}})};R.forEach(Ou,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const $m=n=>`- ${n}`,QV=n=>R.isFunction(n)||n===null||n===!1,zm={getAdapter:n=>{n=R.isArray(n)?n:[n];const{length:e}=n;let t,s;const r={};for(let i=0;i<e;i++){t=n[i];let o;if(s=t,!QV(t)&&(s=Ou[(o=String(t)).toLowerCase()],s===void 0))throw new ue(`Unknown adapter '${o}'`);if(s)break;r[o||"#"+i]=s}if(!s){const i=Object.entries(r).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
36
+ `+i.map($m).join(`
37
+ `):" "+$m(i[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:Ou};function Mu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new zr(null,n)}function Fm(n){return Mu(n),n.headers=Mt.from(n.headers),n.data=Su.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),zm.getAdapter(n.adapter||Zi.adapter)(n).then(function(s){return Mu(n),s.data=Su.call(n,n.transformResponse,s),s.headers=Mt.from(s.headers),s},function(s){return Am(s)||(Mu(n),s&&s.response&&(s.response.data=Su.call(n,n.transformResponse,s.response),s.response.headers=Mt.from(s.response.headers))),Promise.reject(s)})}const Um="1.7.7",Pu={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Pu[n]=function(s){return typeof s===n||"a"+(e<1?"n ":" ")+n}});const Hm={};Pu.transitional=function(e,t,s){function r(i,o){return"[Axios v"+Um+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(e===!1)throw new ue(r(o," has been removed"+(t?" in "+t:"")),ue.ERR_DEPRECATED);return t&&!Hm[o]&&(Hm[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}};function eD(n,e,t){if(typeof n!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let r=s.length;for(;r-- >0;){const i=s[r],o=e[i];if(o){const a=n[i],c=a===void 0||o(a,i,n);if(c!==!0)throw new ue("option "+i+" must be "+c,ue.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new ue("Unknown option "+i,ue.ERR_BAD_OPTION)}}const Nu={assertOptions:eD,validators:Pu},ms=Nu.validators;class Zs{constructor(e){this.defaults=e,this.interceptors={request:new Om,response:new Om}}async request(e,t){try{return await this._request(e,t)}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+=`
38
+ `+i):s.stack=i}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Ks(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:i}=t;s!==void 0&&Nu.assertOptions(s,{silentJSONParsing:ms.transitional(ms.boolean),forcedJSONParsing:ms.transitional(ms.boolean),clarifyTimeoutError:ms.transitional(ms.boolean)},!1),r!=null&&(R.isFunction(r)?t.paramsSerializer={serialize:r}:Nu.assertOptions(r,{encode:ms.function,serialize:ms.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&R.merge(i.common,i[t.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),t.headers=Mt.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(c=c&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,h;if(!c){const g=[Fm.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),h=g.length,d=Promise.resolve(t);f<h;)d=d.then(g[f++],g[f++]);return d}h=a.length;let p=t;for(f=0;f<h;){const g=a[f++],m=a[f++];try{p=g(p)}catch(y){m.call(this,y);break}}try{d=Fm.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(e){e=Ks(this.defaults,e);const t=Vm(e.baseURL,e.url);return Em(t,e.params,e.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(e){Zs.prototype[e]=function(t,s){return this.request(Ks(s||{},{method:e,url:t,data:(s||{}).data}))}}),R.forEach(["post","put","patch"],function(e){function t(s){return function(i,o,a){return this.request(Ks(a||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Zs.prototype[e]=t(),Zs.prototype[e+"Form"]=t(!0)});class Au{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=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},e(function(i,o,a){s.reason||(s.reason=new zr(i,o,a),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Au(function(r){e=r}),cancel:e}}}function tD(n){return function(t){return n.apply(null,t)}}function nD(n){return R.isObject(n)&&n.isAxiosError===!0}const _u={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(_u).forEach(([n,e])=>{_u[e]=n});function Gm(n){const e=new Zs(n),t=lm(Zs.prototype.request,e);return R.extend(t,Zs.prototype,e,{allOwnKeys:!0}),R.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return Gm(Ks(n,r))},t}const Xe=Gm(Zi);Xe.Axios=Zs,Xe.CanceledError=zr,Xe.CancelToken=Au,Xe.isCancel=Am,Xe.VERSION=Um,Xe.toFormData=Fa,Xe.AxiosError=ue,Xe.Cancel=Xe.CanceledError,Xe.all=function(e){return Promise.all(e)},Xe.spread=tD,Xe.isAxiosError=nD,Xe.mergeConfig=Ks,Xe.AxiosHeaders=Mt,Xe.formToJSON=n=>Pm(R.isHTMLForm(n)?new FormData(n):n),Xe.getAdapter=zm.getAdapter,Xe.HttpStatusCode=_u,Xe.default=Xe;const Jn=Xe.create({baseURL:"http://localhost:8001",timeout:1e4,headers:{"Content-Type":"application/json"}}),sD=n=>{Jn.defaults.baseURL=n},rD=n=>{Jn.interceptors.request.use(e=>{if(n)return e.headers.token=n,e},e=>Promise.reject(e))};Jn.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 Qs=(n,e={})=>Jn.get(n,{params:e}),Ya=(n,e={})=>Jn.post(n,e),Wm=(n,e={})=>Jn.delete(n,{params:e}),iD=(n,e={})=>Jn.post(n,e,{headers:{"Content-Type":"multipart/form-data"}}),Fr=(n,e)=>{const t=document.querySelector(n),s=t.querySelectorAll(".x6-port-body"),r=t.querySelectorAll(".x6-port-label");for(let i=0,o=s.length;i<o;i+=1)s[i].style.visibility=e?"visible":"hidden";for(let i=0,o=r.length;i<o;i+=1)r[i].style.visibility=e?"visible":"hidden"},Tu=n=>Qs("/custom/deviceList",{itemIds:n}).then(e=>{if(e!=null&&e.isOk)return e.data}),ku=n=>Qs("/custom/monitorInfo",{deviceCode:n,fieldType:1}).then(e=>{if(e!=null&&e.isOk)return e.data}),Ym=n=>Qs("/template/selectOne",{id:n}).then(e=>{if(e!=null&&e.isOk){const t=JSON.parse(e.data.remark);return t===null?null:{background:t.background,grid:t.grid,data:t.data}}else qe.error((e==null?void 0:e.msg)||"获取失败")}),oD=n=>Ya("/custom/arrRealData2",n).then(e=>{if(e!=null&&e.isOk)return e.data;qe.error((e==null?void 0:e.msg)||"获取失败")}),qa={color:"#000000"},Xa={size:10,visible:!1,type:"doubleMesh",args:[{color:"#282828",thickness:1},{color:"#363636",thickness:2,factor:4}]},aD={stencilGraphWidth:300,stencilGraphHeight:0,layoutOptions:{columns:3,columnWidth:74,resizeToFit:!0,center:!0}},Vu={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:"文本",fields:[]},ports:{groups:{ports:{portOption:Vu}}}},Ja={markup:[{tagName:"path",selector:"line",groupSelector:"lines"}],attrs:{wrap:{strokeWidth:10},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},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}}}},qm={markup:[{tagName:"path",selector:"line",groupSelector:"lines"},{tagName:"path",selector:"pipe",groupSelector:"lines"}],attrs:{wrap:{strokeWidth:10},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},line:{stroke:"#ffffff",strokeWidth:1,targetMarker:null,sourceMarker:null},pipe:{stroke:"#2364DD",strokeWidth:1,strokeDasharray:5,sourceMarker:{args:{width:10,height:10,offset:0},name:null},targetMarker:{args:{width:10,height:10,offset:0},name:null}}}},Ka="M 0 -6 8 0 0 6 z",Xm="M 0 -6 -8 0 0 6 z",Jm={attrs:{wrap:{strokeWidth:10},arrow:{d:Ka,fill:"#ED8A19",stroke:"#ED8A19",style:{animation:"flashing 2s infinite linear"},display:"block"},arrow1:{atConnectionRatio:.5},lines:{connection:!0,strokeLinejoin:"round",fill:"none",strokeWidth:2},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}}},markup:[{tagName:"path",selector:"line",groupSelector:"lines"},{tagName:"path",groupSelector:"arrow",selector:"arrow1"}]},tt={markup:Ja.markup,attrs:Ja.attrs},It=(n,e)=>{const t=n.__vccOpts||n;for(const[s,r]of e)t[s]=r;return t},cD={class:"control"},uD={class:"row-column"},dD=It({__name:"index",props:{payload:Object},setup(n){var h,p,g,m,y,b,w,x,S,v,E,C,O,A,k,_,V,L,B,N,P;const e=n,t=l.ref(((h=e.payload.value.options.background)==null?void 0:h.color)||null),s=l.ref(((g=(p=e.payload.value.options)==null?void 0:p.grid)==null?void 0:g.visible)||null),r=l.ref(((y=(m=e.payload.value.options)==null?void 0:m.grid)==null?void 0:y.size)||10),i=l.ref(((S=(x=(w=(b=e.payload.value.options)==null?void 0:b.grid)==null?void 0:w.args)==null?void 0:x[0])==null?void 0:S.color)||null),o=l.ref(((O=(C=(E=(v=e.payload.value.options)==null?void 0:v.grid)==null?void 0:E.args)==null?void 0:C[0])==null?void 0:O.thickness)||1),a=l.ref(((V=(_=(k=(A=e.payload.value.options)==null?void 0:A.grid)==null?void 0:k.args)==null?void 0:_[1])==null?void 0:V.color)||null),c=l.ref(((P=(N=(B=(L=e.payload.value.options)==null?void 0:L.grid)==null?void 0:B.args)==null?void 0:N[1])==null?void 0:P.thickness)||1),u=l.ref("1"),d=T=>{e.payload.value.drawBackground({color:T})},f=()=>{e.payload.value.drawGrid({visible:s.value,size:r.value,type:"doubleMesh",args:[{color:i.value,thickness:o.value},{color:a.value,thickness:c.value}]})};return(T,j)=>{const Y=l.resolveComponent("el-col"),te=l.resolveComponent("el-color-picker"),z=l.resolveComponent("el-row"),I=l.resolveComponent("el-switch"),U=l.resolveComponent("el-input-number"),F=l.resolveComponent("el-collapse-item"),D=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",cD,[l.createVNode(D,{modelValue:u.value,"onUpdate:modelValue":j[7]||(j[7]=q=>u.value=q),accordion:""},{default:l.withCtx(()=>[l.createVNode(F,{title:"基础属性",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",uD,[l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[8]||(j[8]=[l.createElementVNode("div",{class:"row-label"},"背景色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:t.value,"onUpdate:modelValue":j[0]||(j[0]=q=>t.value=q),size:"small","show-alpha":"",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[9]||(j[9]=[l.createElementVNode("div",{class:"row-label"},"网格",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(I,{modelValue:s.value,"onUpdate:modelValue":j[1]||(j[1]=q=>s.value=q),"active-value":!0,"inactive-value":!1,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[10]||(j[10]=[l.createElementVNode("div",{class:"row-label"},"网格大小",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:r.value,"onUpdate:modelValue":j[2]||(j[2]=q=>r.value=q),min:1,max:20,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[11]||(j[11]=[l.createElementVNode("div",{class:"row-label"},"主网格颜色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:i.value,"onUpdate:modelValue":j[3]||(j[3]=q=>i.value=q),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[12]||(j[12]=[l.createElementVNode("div",{class:"row-label"},"次网格颜色",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(te,{modelValue:a.value,"onUpdate:modelValue":j[4]||(j[4]=q=>a.value=q),size:"small","show-alpha":"",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[13]||(j[13]=[l.createElementVNode("div",{class:"row-label"},"主网格粗细",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:o.value,"onUpdate:modelValue":j[5]||(j[5]=q=>o.value=q),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(z,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Y,{span:12},{default:l.withCtx(()=>j[14]||(j[14]=[l.createElementVNode("div",{class:"row-label"},"次网格粗细",-1)])),_:1}),l.createVNode(Y,{span:12},{default:l.withCtx(()=>[l.createVNode(U,{modelValue:c.value,"onUpdate:modelValue":j[6]||(j[6]=q=>c.value=q),min:.5,max:10,size:"small","controls-position":"right",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-5dd827ed"]]);/*! Element Plus Icons Vue v2.3.1 */var hD=l.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),fD=hD,pD=l.defineComponent({name:"DeleteFilled",__name:"delete-filled",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),Km=pD,gD=l.defineComponent({name:"Document",__name:"document",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),mD=gD,yD=l.defineComponent({name:"Plus",__name:"plus",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),bD=yD,wD=l.defineComponent({name:"View",__name:"view",setup(n){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),xD=wD;typeof window=="object"&&window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window<"u"&&function(n){n.forEach(e=>{Object.prototype.hasOwnProperty.call(e,"append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const s=document.createDocumentFragment();t.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 wt{get disposed(){return this._disposed===!0}dispose(){this._disposed=!0}}(function(n){function e(){return(t,s,r)=>{const i=r.value,o=t.__proto__;r.value=function(...a){this.disposed||(i.call(this,...a),o.dispose.call(this))}}}n.dispose=e})(wt||(wt={}));class Zm{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(e=>{e.dispose()}),this.items.clear())}contains(e){return this.items.has(e)}add(e){this.items.add(e)}remove(e){this.items.delete(e)}clear(){this.items.clear()}}(function(n){function e(t){const s=new n;return t.forEach(r=>{s.add(r)}),s}n.from=e})(Zm||(Zm={}));function Qm(n,e,t){if(t)switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2]);case 4:return n.call(e,t[0],t[1],t[2],t[3]);case 5:return n.call(e,t[0],t[1],t[2],t[3],t[4]);case 6:return n.call(e,t[0],t[1],t[2],t[3],t[4],t[5]);default:return n.apply(e,t)}return n.call(e)}function se(n,e,...t){return Qm(n,e,t)}function vD(n){return typeof n=="object"&&n.then&&typeof n.then=="function"}function Du(n){return n!=null&&(n instanceof Promise||vD(n))}function Ru(...n){const e=[];if(n.forEach(s=>{Array.isArray(s)?e.push(...s):e.push(s)}),e.some(s=>Du(s))){const s=e.map(r=>Du(r)?r:Promise.resolve(r!==!1));return Promise.all(s).then(r=>r.reduce((i,o)=>o!==!1&&i,!0))}return e.every(s=>s!==!1)}function CD(...n){const e=Ru(n);return typeof e=="boolean"?Promise.resolve(e):e}function Iu(n,e){const t=[];for(let s=0;s<n.length;s+=2){const r=n[s],i=n[s+1],o=Array.isArray(e)?e:[e],a=Qm(r,i,o);t.push(a)}return Ru(t)}class SD{constructor(){this.listeners={}}on(e,t,s){return t==null?this:(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t,s),this)}once(e,t,s){const r=(...i)=>(this.off(e,r),Iu([t,s],i));return this.on(e,r,this)}off(e,t,s){if(!(e||t||s))return this.listeners={},this;const r=this.listeners;return(e?[e]:Object.keys(r)).forEach(o=>{const a=r[o];if(a){if(!(t||s)){delete r[o];return}for(let c=a.length-2;c>=0;c-=2)t&&a[c]!==t||s&&a[c+1]!==s||a.splice(c,2)}}),this}trigger(e,...t){let s=!0;if(e!=="*"){const i=this.listeners[e];i!=null&&(s=Iu([...i],t))}const r=this.listeners["*"];return r!=null?Ru([s,Iu([...r],[e,...t])]):s}emit(e,...t){return this.trigger(e,...t)}}function ED(n,...e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(s=>{s!=="constructor"&&Object.defineProperty(n.prototype,s,Object.getOwnPropertyDescriptor(t.prototype,s))})})}const OD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])};function MD(n,e){OD(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}class PD{}const ND=/^\s*class\s+/.test(`${PD}`)||/^\s*class\s*\{/.test(`${class{}}`);function Lu(n,e){let t;return ND?t=class extends e{}:(t=function(){return e.apply(this,arguments)},MD(t,e)),Object.defineProperty(t,"name",{value:n}),t}function ey(n){return n==="__proto__"}function Bu(n,e,t="/"){let s;const r=Array.isArray(e)?e:e.split(t);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 Ur(n,e,t,s="/"){const r=Array.isArray(e)?e:e.split(s),i=r.pop();if(i&&!ey(i)){let o=n;r.forEach(a=>{ey(a)||(o[a]==null&&(o[a]={}),o=o[a])}),o[i]=t}return n}function ty(n,e,t="/"){const s=Array.isArray(e)?e.slice():e.split(t),r=s.pop();if(r)if(s.length>0){const i=Bu(n,s);i&&delete i[r]}else delete n[r];return n}var AD=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Ve extends SD{dispose(){this.off()}}AD([wt.dispose()],Ve.prototype,"dispose",null),function(n){n.dispose=wt.dispose}(Ve||(Ve={})),ED(Ve,wt);const ny=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},sy=ny(n=>n.replace(/\B([A-Z])/g,"-$1").toLowerCase()),ju=ny(n=>YP(la(n)).replace(/ /g,""));function $u(n){let e=2166136261,t=!1,s=n;for(let r=0,i=s.length;r<i;r+=1){let o=s.charCodeAt(r);o>127&&!t&&(s=unescape(encodeURIComponent(s)),o=s.charCodeAt(r),t=!0),e^=o,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Za(){let n="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=Math.random()*16|0,o=r==="x"?i:r==="y"?i&3|8:r;n+=o.toString(16)}return n}function _D(n,e,t){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 c of e){const u=t(c);if(u!==void 0&&Math.abs(u.length-a.length)<=s){const d=u.toLowerCase();if(d===a){if(u===n)continue;return c}if(o||u.length<3)continue;const f=TD(a,d,r-1);if(f===void 0)continue;f<3?(o=!0,i=c):(r=f,i=c)}}return i}function TD(n,e,t){let s=new Array(e.length+1),r=new Array(e.length+1);const i=t+1;for(let a=0;a<=e.length;a+=1)s[a]=a;for(let a=1;a<=n.length;a+=1){const c=n.charCodeAt(a-1),u=a>t?a-t:1,d=e.length>t+a?t+a:e.length;r[0]=a;let f=a;for(let p=1;p<u;p+=1)r[p]=i;for(let p=u;p<=d;p+=1){const g=c===e.charCodeAt(p-1)?s[p-1]:Math.min(s[p]+1,r[p-1]+1,s[p-1]+2);r[p]=g,f=Math.min(f,g)}for(let p=d+1;p<=e.length;p+=1)r[p]=i;if(f>t)return;const h=s;s=r,r=h}const o=s[e.length];return o>t?void 0:o}function Kn(n){return typeof n=="string"&&n.slice(-1)==="%"}function gn(n,e){if(n==null)return 0;let t;if(typeof n=="string"){if(t=parseFloat(n),Kn(n)&&(t/=100,Number.isFinite(t)))return t*e}else t=n;return Number.isFinite(t)?t>0&&t<1?t*e:t:0}function ys(n){if(typeof n=="object"){let t=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=t=n.horizontal),n.left!=null&&Number.isFinite(n.left)&&(t=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:t}}let e=0;return n!=null&&Number.isFinite(n)&&(e=n),{top:e,right:e,bottom:e,left:e}}let zu=!1,ry=!1,iy=!1,oy=!1,ay=!1,ly=!1,cy=!1,uy=!1,dy=!1,hy=!1,fy=!1,py=!1,gy=!1,my=!1,yy=!1,by=!1;if(typeof navigator=="object"){const n=navigator.userAgent;zu=n.indexOf("Macintosh")>=0,ry=!!n.match(/(iPad|iPhone|iPod)/g),iy=n.indexOf("Windows")>=0,oy=n.indexOf("MSIE")>=0,ay=!!n.match(/Trident\/7\./),ly=!!n.match(/Edge\//),cy=n.indexOf("Mozilla/")>=0&&n.indexOf("MSIE")<0&&n.indexOf("Edge/")<0,dy=n.indexOf("Chrome/")>=0&&n.indexOf("Edge/")<0,hy=n.indexOf("Opera/")>=0||n.indexOf("OPR/")>=0,fy=n.indexOf("Firefox/")>=0,py=n.indexOf("AppleWebKit/")>=0&&n.indexOf("Chrome/")<0&&n.indexOf("Edge/")<0,typeof document=="object"&&(by=!document.createElementNS||`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`!="[object SVGForeignObjectElement]"||n.indexOf("Opera/")>=0)}if(typeof window=="object"&&(uy=window.chrome!=null&&window.chrome.app!=null&&window.chrome.app.runtime!=null,my=window.PointerEvent!=null&&!zu),typeof document=="object"){gy="ontouchstart"in document.documentElement;try{const n=Object.defineProperty({},"passive",{get(){yy=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},n)}catch{}}var bs;(function(n){n.IS_MAC=zu,n.IS_IOS=ry,n.IS_WINDOWS=iy,n.IS_IE=oy,n.IS_IE11=ay,n.IS_EDGE=ly,n.IS_NETSCAPE=cy,n.IS_CHROME_APP=uy,n.IS_CHROME=dy,n.IS_OPERA=hy,n.IS_FIREFOX=fy,n.IS_SAFARI=py,n.SUPPORT_TOUCH=gy,n.SUPPORT_POINTER=my,n.SUPPORT_PASSIVE=yy,n.NO_FOREIGNOBJECT=by,n.SUPPORT_FOREIGNOBJECT=!n.NO_FOREIGNOBJECT})(bs||(bs={})),function(n){function e(){const i=window.module;return i!=null&&i.hot!=null&&i.hot.status!=null?i.hot.status():"unkonwn"}n.getHMRStatus=e;function t(){return e()==="apply"}n.isApplyingHMR=t;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 c=a in o;return c||(o.setAttribute(a,"return;"),c=typeof o[a]=="function"),c}n.isEventSupported=r}(bs||(bs={}));const Fu=/[\t\r\n\f]/g,Uu=/\S+/g,Hr=n=>` ${n} `;function Gr(n){return n&&n.getAttribute&&n.getAttribute("class")||""}function _n(n,e){if(n==null||e==null)return!1;const t=Hr(Gr(n)),s=Hr(e);return n.nodeType===1?t.replace(Fu," ").includes(s):!1}function ee(n,e){if(!(n==null||e==null)){if(typeof e=="function")return ee(n,e(Gr(n)));if(typeof e=="string"&&n.nodeType===1){const t=e.match(Uu)||[],s=Hr(Gr(n)).replace(Fu," ");let r=t.reduce((i,o)=>i.indexOf(Hr(o))<0?`${i}${o} `:i,s);r=r.trim(),s!==r&&n.setAttribute("class",r)}}}function Ie(n,e){if(n!=null){if(typeof e=="function")return Ie(n,e(Gr(n)));if((!e||typeof e=="string")&&n.nodeType===1){const t=(e||"").match(Uu)||[],s=Hr(Gr(n)).replace(Fu," ");let r=t.reduce((i,o)=>{const a=Hr(o);return i.indexOf(a)>-1?i.replace(a," "):i},s);r=e?r.trim():"",s!==r&&n.setAttribute("class",r)}}}function mn(n,e,t){if(!(n==null||e==null)){if(t!=null&&typeof e=="string"){t?ee(n,e):Ie(n,e);return}if(typeof e=="function")return mn(n,e(Gr(n),t),t);typeof e=="string"&&(e.match(Uu)||[]).forEach(r=>{_n(n,r)?Ie(n,r):ee(n,r)})}}let wy=0;function kD(){return wy+=1,`v${wy}`}function Hu(n){return(n.id==null||n.id==="")&&(n.id=kD()),n.id}function ws(n){return n==null?!1:typeof n.getScreenCTM=="function"&&n instanceof SVGElement}const it={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"},xy="1.1";function vy(n,e=document){return e.createElement(n)}function Gu(n,e=it.xhtml,t=document){return t.createElementNS(e,n)}function yn(n,e=document){return Gu(n,it.svg,e)}function Qa(n){if(n){const t=`<svg xmlns="${it.svg}" xmlns:xlink="${it.xlink}" version="${xy}">${n}</svg>`,{documentElement:s}=VD(t,{async:!1});return s}const e=document.createElementNS(it.svg,"svg");return e.setAttributeNS(it.xmlns,"xmlns:xlink",it.xlink),e.setAttribute("version",xy),e}function VD(n,e={}){let t;try{const s=new DOMParser;if(e.async!=null){const r=s;r.async=e.async}t=s.parseFromString(n,e.mimeType||"text/xml")}catch{t=void 0}if(!t||t.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${n}`);return t}function DD(n,e=!0){const t=n.nodeName;return e?t.toLowerCase():t.toUpperCase()}function Wu(n){let e=0,t=n.previousSibling;for(;t;)t.nodeType===1&&(e+=1),t=t.previousSibling;return e}function RD(n,e){return n.querySelectorAll(e)}function ID(n,e){return n.querySelector(e)}function Cy(n,e,t){const s=n.ownerSVGElement;let r=n.parentNode;for(;r&&r!==t&&r!==s;){if(_n(r,e))return r;r=r.parentNode}return null}function Yu(n,e){const t=e&&e.parentNode;return n===t||!!(t&&t.nodeType===1&&n.compareDocumentPosition(t)&16)}function Yt(n){n&&(Array.isArray(n)?n:[n]).forEach(t=>{t.parentNode&&t.parentNode.removeChild(t)})}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Lt(n,e){(Array.isArray(e)?e:[e]).forEach(s=>{s!=null&&n.appendChild(s)})}function Sy(n,e){const t=n.firstChild;return t?qu(t,e):Lt(n,e)}function qu(n,e){const t=n.parentNode;t&&(Array.isArray(e)?e:[e]).forEach(r=>{r!=null&&t.insertBefore(r,n)})}function xs(n,e){e!=null&&e.appendChild(n)}function Ey(n){try{return n instanceof HTMLElement}catch{return typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"}}function LD(n,e){const t=[];let s=n.firstChild;for(;s;s=s.nextSibling)s.nodeType===1&&(!e||_n(s,e))&&t.push(s);return t}const Oy=["viewBox","attributeName","attributeType","repeatCount","textLength","lengthAdjust","gradientUnits"];function BD(n,e){return n.getAttribute(e)}function Xu(n,e){const t=Py(e);t.ns?n.hasAttributeNS(t.ns,t.local)&&n.removeAttributeNS(t.ns,t.local):n.hasAttribute(e)&&n.removeAttribute(e)}function Ju(n,e,t){if(t==null)return Xu(n,e);const s=Py(e);s.ns&&typeof t=="string"?n.setAttributeNS(s.ns,e,t):e==="id"?n.id=`${t}`:n.setAttribute(e,`${t}`)}function My(n,e){Object.keys(e).forEach(t=>{Ju(n,t,e[t])})}function pe(n,e,t){if(e==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 e=="string"&&t===void 0)return n.getAttribute(e);typeof e=="object"?My(n,e):Ju(n,e,t)}function Py(n){if(n.indexOf(":")!==-1){const e=n.split(":");return{ns:it[e[0]],local:e[1]}}return{ns:null,local:n}}function to(n){const e={};return Object.keys(n).forEach(t=>{const s=Oy.includes(t)?t:sy(t);e[s]=n[t]}),e}function el(n){const e={};return n.split(";").forEach(s=>{const r=s.trim();if(r){const i=r.split("=");i.length&&(e[i[0].trim()]=i[1]?i[1].trim():"")}}),e}function Ku(n,e){return Object.keys(e).forEach(t=>{if(t==="class")n[t]=n[t]?`${n[t]} ${e[t]}`:e[t];else if(t==="style"){const s=typeof n[t]=="object",r=typeof e[t]=="object";let i,o;s&&r?(i=n[t],o=e[t]):s?(i=n[t],o=el(e[t])):r?(i=el(n[t]),o=e[t]):(i=el(n[t]),o=el(e[t])),n[t]=Ku(i,o)}else n[t]=e[t]}),n}function jD(n,e,t={}){const s=t.offset||0,r=[],i=[];let o,a,c=null;for(let u=0;u<n.length;u+=1){o=i[u]=n[u];for(let d=0,f=e.length;d<f;d+=1){const h=e[d],p=h.start+s,g=h.end+s;u>=p&&u<g&&(typeof o=="string"?o=i[u]={t:n[u],attrs:h.attrs}:o.attrs=Ku(Ku({},o.attrs),h.attrs),t.includeAnnotationIndices&&(o.annotations==null&&(o.annotations=[]),o.annotations.push(d)))}a=i[u-1],a?Be(o)&&Be(a)?(c=c,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?c.t+=o.t:(r.push(c),c=o)):Be(o)||Be(a)?(c=c,r.push(c),c=o):c=(c||"")+o:c=o}return c!=null&&r.push(c),r}function $D(n){return n.replace(/ /g," ")}var er;(function(n){function e(u){const d="data:";return u.substr(0,d.length)===d}n.isDataUrl=e;function t(u,d){if(!u||e(u)){setTimeout(()=>d(null,u));return}const f=()=>{d(new Error(`Failed to load image: ${u}`))},h=window.FileReader?g=>{if(g.status===200){const m=new FileReader;m.onload=y=>{const b=y.target.result;d(null,b)},m.onerror=f,m.readAsDataURL(g.response)}else f()}:g=>{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(g.status===200){let y=u.split(".").pop()||"png";y==="svg"&&(y="svg+xml");const b=`data:image/${y};base64,`,w=new Uint8Array(g.response),x=b+btoa(m(w));d(null,x)}else f()},p=new XMLHttpRequest;p.responseType=window.FileReader?"blob":"arraybuffer",p.open("GET",u,!0),p.addEventListener("error",f),p.addEventListener("load",()=>h(p)),p.send()}n.imageToDataUri=t;function s(u){let d=u.replace(/\s/g,"");d=decodeURIComponent(d);const f=d.indexOf(","),h=d.slice(0,f),p=h.split(":")[1].split(";")[0],g=d.slice(f+1);let m;h.indexOf("base64")>=0?m=atob(g):m=unescape(encodeURIComponent(g));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:p})}n.dataUriToBlob=s;function r(u,d){const f=window.navigator.msSaveBlob;if(f)f(u,d);else{const h=window.URL.createObjectURL(u),p=document.createElement("a");p.href=h,p.download=d,document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(h)}}n.downloadBlob=r;function i(u,d){const f=s(u);r(f,d)}n.downloadDataUri=i;function o(u){const d=u.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return d&&d[2]?d[2].replace(/\s+/," ").split(" "):null}function a(u){const d=parseFloat(u);return Number.isNaN(d)?null:d}function c(u,d={}){let f=null;const h=x=>(f==null&&(f=o(u)),f!=null?a(f[x]):null),p=x=>{const S=u.match(x);return S&&S[2]?a(S[2]):null};let g=d.width;if(g==null&&(g=p(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),g==null&&(g=h(2)),g==null)throw new Error("Can not parse width from svg string");let m=d.height;if(m==null&&(m=p(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),m==null&&(m=h(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=c})(er||(er={}));let tr;const zD={px(n){return n},mm(n){return tr*n},cm(n){return tr*n*10},in(n){return tr*n*25.4},pt(n){return tr*(25.4*n/72)},pc(n){return tr*(25.4*n/6)}};var Ny;(function(n){function e(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 c=o.getBoundingClientRect(),u={width:c.width||0,height:c.height||0};return document.body.removeChild(o),u}n.measure=e;function t(s,r){tr==null&&(tr=e("1","1","mm").width);const i=r?zD[r]:null;return i?i(s):s}n.toPx=t})(Ny||(Ny={}));const FD=/-(.)/g;function UD(n){return n.replace(FD,(e,t)=>t.toUpperCase())}const Zu={},Ay=["webkit","ms","moz","o"],_y=typeof document<"u"?document.createElement("div").style:{};function HD(n){for(let e=0;e<Ay.length;e+=1){const t=Ay[e]+n;if(t in _y)return t}return null}function GD(n){const e=UD(n);if(Zu[e]==null){const t=e.charAt(0).toUpperCase()+e.slice(1);Zu[e]=e in _y?e:HD(t)}return Zu[e]}function Ty(n,e){const t=n.ownerDocument&&n.ownerDocument.defaultView&&n.ownerDocument.defaultView.opener?n.ownerDocument.defaultView.getComputedStyle(n,null):window.getComputedStyle(n,null);return t&&e?t.getPropertyValue(e)||t[e]:t}const WD={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 YD(n){return/^--/.test(n)}function qD(n,e,t){const s=window.getComputedStyle(n,null);return t?s.getPropertyValue(e)||void 0:s[e]||n.style[e]}function XD(n,e){return!WD[n]&&typeof e=="number"?`${e}px`:e}function Je(n,e,t){if(typeof e=="string"){const s=YD(e);if(s||(e=GD(e)),t===void 0)return qD(n,e,s);s||(t=XD(e,t));const r=n.style;s?r.setProperty(e,t):r[e]=t;return}for(const s in e)Je(n,s,e[s])}const tl=new WeakMap;function ky(n,e){const t=la(e),s=tl.get(n);if(s)return s[t]}function JD(n,e,t){const s=la(e),r=tl.get(n);r?r[s]=t:tl.set(n,{[s]:t})}function nr(n,e,t){if(!e){const s={};return Object.keys(tl).forEach(r=>{s[r]=ky(n,r)}),s}if(typeof e=="string"){if(t===void 0)return ky(n,e);JD(n,e,t);return}for(const s in e)nr(n,s,e[s])}class oe{get[Symbol.toStringTag](){return oe.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(e){this.node.id=e}constructor(e,t,s){if(!e)throw new TypeError("Invalid element to create vector");let r;if(oe.isVector(e))r=e.node;else if(typeof e=="string")if(e.toLowerCase()==="svg")r=Qa();else if(e[0]==="<"){const i=Qa(e);r=document.importNode(i.firstChild,!0)}else r=document.createElementNS(it.svg,e);else r=e;this.node=r,t&&this.setAttributes(t),s&&this.append(s)}transform(e,t){return e==null?Yr(this.node):(Yr(this.node,e,t),this)}translate(e,t=0,s={}){return e==null?zy(this.node):(zy(this.node,e,t,s),this)}rotate(e,t,s,r={}){return e==null?td(this.node):(td(this.node,e,t,s,r),this)}scale(e,t){return e==null?nd(this.node):(nd(this.node,e,t),this)}getTransformToElement(e){const t=oe.toNode(e);return io(this.node,t)}removeAttribute(e){return Xu(this.node,e),this}getAttribute(e){return BD(this.node,e)}setAttribute(e,t){return Ju(this.node,e,t),this}setAttributes(e){return My(this.node,e),this}attr(e,t){return e==null?pe(this.node):typeof e=="string"&&t===void 0?pe(this.node,e):(typeof e=="object"?pe(this.node,e):pe(this.node,e,t),this)}svg(){return this.node instanceof SVGSVGElement?this:oe.create(this.node.ownerSVGElement)}defs(){const e=this.svg()||this,t=e.node.getElementsByTagName("defs")[0];return t?oe.create(t):oe.create("defs").appendTo(e)}text(e,t={}){return Dy(this.node,e,t),this}tagName(){return DD(this.node)}clone(){return oe.create(this.node.cloneNode(!0))}remove(){return Yt(this.node),this}empty(){return eo(this.node),this}append(e){return Lt(this.node,oe.toNodes(e)),this}appendTo(e){return xs(this.node,oe.isVector(e)?e.node:e),this}prepend(e){return Sy(this.node,oe.toNodes(e)),this}before(e){return qu(this.node,oe.toNodes(e)),this}replace(e){return this.node.parentNode&&this.node.parentNode.replaceChild(oe.toNode(e),this.node),oe.create(e)}first(){return this.node.firstChild?oe.create(this.node.firstChild):null}last(){return this.node.lastChild?oe.create(this.node.lastChild):null}get(e){const t=this.node.childNodes[e];return t?oe.create(t):null}indexOf(e){return Array.prototype.slice.call(this.node.childNodes).indexOf(oe.toNode(e))}find(e){const t=[],s=RD(this.node,e);if(s)for(let r=0,i=s.length;r<i;r+=1)t.push(oe.create(s[r]));return t}findOne(e){const t=ID(this.node,e);return t?oe.create(t):null}findParentByClass(e,t){const s=Cy(this.node,e,t);return s?oe.create(s):null}matches(e){const t=this.node;this.node.matches;const s=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector||null;return s&&s.call(t,e)}contains(e){return Yu(this.node,oe.isVector(e)?e.node:e)}wrap(e){const t=oe.create(e),s=this.node.parentNode;return s!=null&&s.insertBefore(t.node,this.node),t.append(this)}parent(e){let t=this;if(t.node.parentNode==null)return null;if(t=oe.create(t.node.parentNode),e==null)return t;do if(typeof e=="string"?t.matches(e):t instanceof e)return t;while(t=oe.create(t.node.parentNode));return t}children(){const e=this.node.childNodes,t=[];for(let s=0;s<e.length;s+=1)e[s].nodeType===1&&t.push(oe.create(e[s]));return t}eachChild(e,t){const s=this.children();for(let r=0,i=s.length;r<i;r+=1)e.call(s[r],s[r],r,s),t&&s[r].eachChild(e,t);return this}index(){return Wu(this.node)}hasClass(e){return _n(this.node,e)}addClass(e){return ee(this.node,e),this}removeClass(e){return Ie(this.node,e),this}toggleClass(e,t){return mn(this.node,e,t),this}toLocalPoint(e,t){return mR(this.node,e,t)}sample(e=1){return this.node instanceof SVGPathElement?eR(this.node,e):[]}toPath(){return oe.create(aR(this.node))}toPathData(){return jy(this.node)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(o){if(o==null)return!1;if(o instanceof n)return!0;const a=o[Symbol.toStringTag],c=o;return(a==null||a===n.toStringTag)&&c.node instanceof SVGElement&&typeof c.sample=="function"&&typeof c.toPath=="function"}n.isVector=e;function t(o,a,c){return new n(o,a,c)}n.create=t;function s(o){if(o[0]==="<"){const a=Qa(o),c=[];for(let u=0,d=a.childNodes.length;u<d;u+=1){const f=a.childNodes[u];c.push(t(document.importNode(f,!0)))}return c}return[t(o)]}n.createVectors=s;function r(o){return e(o)?o.node:o}n.toNode=r;function i(o){return Array.isArray(o)?o.map(a=>r(a)):[r(o)]}n.toNodes=i})(oe||(oe={}));function KD(n,e){const t=oe.create(e),s=oe.create("textPath"),r=n.d;if(r&&n["xlink:href"]===void 0){const i=oe.create("path").attr("d",r).appendTo(t.defs());s.attr("xlink:href",`#${i.id}`)}return typeof n=="object"&&s.attr(n),s.node}function ZD(n,e,t){const s=t.eol,r=t.baseSize,i=t.lineHeight;let o=0,a;const c={},u=e.length-1;for(let d=0;d<=u;d+=1){let f=e[d],h=null;if(typeof f=="object"){const p=f.attrs,g=oe.create("tspan",p);a=g.node;let m=f.t;s&&d===u&&(m+=s),a.textContent=m;const y=p.class;y&&g.addClass(y),t.includeAnnotationIndices&&g.attr("annotations",f.annotations.join(",")),h=parseFloat(p["font-size"]),h===void 0&&(h=r),h&&h>o&&(o=h)}else s&&d===u&&(f+=s),a=document.createTextNode(f||" "),r&&r>o&&(o=r);n.appendChild(a)}return o&&(c.maxFontSize=o),i?c.lineHeight=i:o&&(c.lineHeight=o*1.2),c}const Vy=/em$/;function nl(n,e){const t=parseFloat(n);return Vy.test(n)?t*e:t}function QD(n,e,t,s){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let i=e[0];const o=nl(i.maxFontSize,t)||t;let a=0;const c=nl(s,t);for(let f=1;f<r;f+=1){i=e[f];const h=nl(i.lineHeight,t)||c;a+=h}const u=nl(i.maxFontSize,t)||t;let d;switch(n){case"middle":d=o/2-.15*u-a/2;break;case"bottom":d=-(.25*u)-a;break;case"top":default:d=.8*o;break}return d}function Dy(n,e,t={}){e=$D(e);const s=t.eol;let r=t.textPath;const i=t.textVerticalAnchor,o=i==="middle"||i==="bottom"||i==="top";let a=t.x;a===void 0&&(a=n.getAttribute("x")||0);const c=t.includeAnnotationIndices;let u=t.annotations;u&&!Array.isArray(u)&&(u=[u]);const d=t.lineHeight,f=d==="auto",h=f?"1.5em":d||"1em";let p=!0;const g=n.childNodes;if(g.length===1){const A=g[0];A&&A.tagName.toUpperCase()==="TITLE"&&(p=!1)}p&&eo(n),pe(n,{"xml:space":"preserve",display:e||t.displayEmpty?null:"none"});const m=pe(n,"font-size");let y=parseFloat(m);y||(y=16,(o||u)&&!m&&pe(n,"font-size",`${y}`));let b;r?(typeof r=="string"&&(r={d:r}),b=KD(r,n)):b=document.createDocumentFragment();let w,x=0,S;const v=e.split(`
39
+ `),E=[],C=v.length-1;for(let A=0;A<=C;A+=1){w=h;let k="v-line";const _=yn("tspan");let V,L=v[A];if(L)if(u){const B=jD(L,u,{offset:-x,includeAnnotationIndices:c});V=ZD(_,B,{eol:A!==C&&s,baseSize:y,lineHeight:f?null:h,includeAnnotationIndices:c});const N=V.lineHeight;N&&f&&A!==0&&(w=N),A===0&&(S=V.maxFontSize*.8)}else s&&A!==C&&(L+=s),_.textContent=L;else{_.textContent="-",k+=" v-empty-line";const B=_.style;B.fillOpacity=0,B.strokeOpacity=0,u&&(V={})}V&&E.push(V),A>0&&_.setAttribute("dy",w),(A>0||r)&&_.setAttribute("x",a),_.className.baseVal=k,b.appendChild(_),x+=L.length+1}if(o)if(u)w=QD(i,E,y,h);else if(i==="top")w="0.8em";else{let A;switch(C>0?(A=parseFloat(h)||1,A*=C,Vy.test(h)||(A/=y)):A=0,i){case"middle":w=`${.3-A/2}em`;break;case"bottom":w=`${-A-.3}em`;break}}else i===0?w="0em":i?w=i:(w=0,n.getAttribute("y")==null&&n.setAttribute("y",`${S||"0.8em"}`));b.firstChild.setAttribute("dy",w),n.appendChild(b)}function no(n,e={}){const t=document.createElement("canvas").getContext("2d");if(!n)return{width:0};const s=[],r=e["font-size"]?`${parseFloat(e["font-size"])}px`:"14px";return s.push(e["font-style"]||"normal"),s.push(e["font-variant"]||"normal"),s.push(e["font-weight"]||400),s.push(r),s.push(e["font-family"]||"sans-serif"),t.font=s.join(" "),t.measureText(n)}function Ry(n,e,t,s={}){if(e>=t)return[n,""];const r=n.length,i={};let o=Math.round(e/t*r-1);for(o<0&&(o=0);o>=0&&o<r;){const a=n.slice(0,o),c=i[a]||no(a,s).width,u=n.slice(0,o+1),d=i[u]||no(u,s).width;if(i[a]=c,i[u]=d,c>e)o-=1;else if(d<=e)o+=1;else break}return[n.slice(0,o),n.slice(o)]}function Iy(n,e,t={},s={}){const r=e.width,i=e.height,o=s.eol||`
40
+ `,a=t.fontSize||14,c=t.lineHeight?parseFloat(t.lineHeight):Math.ceil(a*1.4),u=Math.floor(i/c);if(n.indexOf(o)>-1){const y=Za(),b=[];return n.split(o).map(w=>{const x=Iy(w,Object.assign(Object.assign({},e),{height:Number.MAX_SAFE_INTEGER}),t,Object.assign(Object.assign({},s),{eol:y}));x&&b.push(...x.split(y))}),b.slice(0,u).join(o)}const{width:d}=no(n,t);if(d<r)return n;const f=[];let h=n,p=d,g=s.ellipsis,m=0;g&&(typeof g!="string"&&(g="…"),m=no(g,t).width);for(let y=0;y<u;y+=1)if(p>r)if(y===u-1){const[w]=Ry(h,r-m,p,t);f.push(g?`${w}${g}`:w)}else{const[w,x]=Ry(h,r,p,t);f.push(w),h=x,p=no(h,t).width}else{f.push(h);break}return f.join(o)}const Qu=.551784;function ut(n,e,t=NaN){const s=n.getAttribute(e);if(s==null)return t;const r=parseFloat(s);return Number.isNaN(r)?t:r}function eR(n,e=1){const t=n.getTotalLength(),s=[];let r=0,i;for(;r<t;)i=n.getPointAtLength(r),s.push({distance:r,x:i.x,y:i.y}),r+=e;return s}function tR(n){return["M",ut(n,"x1"),ut(n,"y1"),"L",ut(n,"x2"),ut(n,"y2")].join(" ")}function nR(n){const e=sl(n);return e.length===0?null:`${Ly(e)} Z`}function sR(n){const e=sl(n);return e.length===0?null:Ly(e)}function Ly(n){return`M ${n.map(t=>`${t.x} ${t.y}`).join(" L")}`}function sl(n){const e=[],t=n.points;if(t)for(let s=0,r=t.numberOfItems;s<r;s+=1)e.push(t.getItem(s));return e}function rR(n){const e=ut(n,"cx",0),t=ut(n,"cy",0),s=ut(n,"r"),r=s*Qu;return["M",e,t-s,"C",e+r,t-s,e+s,t-r,e+s,t,"C",e+s,t+r,e+r,t+s,e,t+s,"C",e-r,t+s,e-s,t+r,e-s,t,"C",e-s,t-r,e-r,t-s,e,t-s,"Z"].join(" ")}function iR(n){const e=ut(n,"cx",0),t=ut(n,"cy",0),s=ut(n,"rx"),r=ut(n,"ry")||s,i=s*Qu,o=r*Qu;return["M",e,t-r,"C",e+i,t-r,e+s,t-o,e+s,t,"C",e+s,t+o,e+i,t+r,e,t+r,"C",e-i,t+r,e-s,t+o,e-s,t,"C",e-s,t-o,e-i,t-r,e,t-r,"Z"].join(" ")}function oR(n){return By({x:ut(n,"x",0),y:ut(n,"y",0),width:ut(n,"width",0),height:ut(n,"height",0),rx:ut(n,"rx",0),ry:ut(n,"ry",0)})}function By(n){let e;const t=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),c=Math.min(n.ry||n["top-ry"]||0,i/2),u=Math.min(n.ry||n["bottom-ry"]||0,i/2);return o||a||c||u?e=["M",t,s+c,"v",i-c-u,"a",a,u,0,0,0,a,u,"h",r-2*a,"a",a,u,0,0,0,a,-u,"v",-(i-u-c),"a",o,c,0,0,0,-o,-c,"h",-(r-2*o),"a",o,c,0,0,0,-o,c,"Z"]:e=["M",t,s,"H",t+r,"V",s+i,"H",t,"V",s,"Z"],e.join(" ")}function aR(n){const e=yn("path");pe(e,pe(n));const t=jy(n);return t&&e.setAttribute("d",t),e}function jy(n){const e=n.tagName.toLowerCase();switch(e){case"path":return n.getAttribute("d");case"line":return tR(n);case"polygon":return nR(n);case"polyline":return sR(n);case"ellipse":return iR(n);case"circle":return rR(n);case"rect":return oR(n)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const lR=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,$y=/[ ,]+/,cR=/^(\w+)\((.*)\)/;function uR(n,e){const s=yn("svg").createSVGPoint();return s.x=n,s.y=e,s}function ot(n){const t=yn("svg").createSVGMatrix();if(n!=null){const s=n,r=t;for(const i in s)r[i]=s[i]}return t}function so(n){const e=yn("svg");return n!=null?(n instanceof DOMMatrix||(n=ot(n)),e.createSVGTransformFromMatrix(n)):e.createSVGTransform()}function ro(n){let e=ot();const t=n!=null&&n.match(lR);if(!t)return e;for(let s=0,r=t.length;s<r;s+=1){const o=t[s].match(cR);if(o){let a,c,u,d,f,h=ot();const p=o[2].split($y);switch(o[1].toLowerCase()){case"scale":a=parseFloat(p[0]),c=p[1]===void 0?a:parseFloat(p[1]),h=h.scaleNonUniform(a,c);break;case"translate":u=parseFloat(p[0]),d=parseFloat(p[1]),h=h.translate(u,d);break;case"rotate":f=parseFloat(p[0]),u=parseFloat(p[1])||0,d=parseFloat(p[2])||0,u!==0||d!==0?h=h.translate(u,d).rotate(f).translate(-u,-d):h=h.rotate(f);break;case"skewx":f=parseFloat(p[0]),h=h.skewX(f);break;case"skewy":f=parseFloat(p[0]),h=h.skewY(f);break;case"matrix":h.a=parseFloat(p[0]),h.b=parseFloat(p[1]),h.c=parseFloat(p[2]),h.d=parseFloat(p[3]),h.e=parseFloat(p[4]),h.f=parseFloat(p[5]);break;default:continue}e=e.multiply(h)}}return e}function Wr(n){const e=n||{},t=e.a!=null?e.a:1,s=e.b!=null?e.b:0,r=e.c!=null?e.c:0,i=e.d!=null?e.d:1,o=e.e!=null?e.e:0,a=e.f!=null?e.f:0;return`matrix(${t},${s},${r},${i},${o},${a})`}function rl(n){let e,t,s;if(n){const i=$y;if(n.trim().indexOf("matrix")>=0){const o=ro(n),a=dR(o);e=[a.translateX,a.translateY],t=[a.rotation],s=[a.scaleX,a.scaleY];const c=[];(e[0]!==0||e[1]!==0)&&c.push(`translate(${e.join(",")})`),(s[0]!==1||s[1]!==1)&&c.push(`scale(${s.join(",")})`),t[0]!==0&&c.push(`rotate(${t[0]})`),n=c.join(" ")}else{const o=n.match(/translate\((.*?)\)/);o&&(e=o[1].split(i));const a=n.match(/rotate\((.*?)\)/);a&&(t=a[1].split(i));const c=n.match(/scale\((.*?)\)/);c&&(s=c[1].split(i))}}const r=s&&s[0]?parseFloat(s[0]):1;return{raw:n||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:t&&t[0]?parseInt(t[0],10):0,cx:t&&t[1]?parseInt(t[1],10):void 0,cy:t&&t[2]?parseInt(t[2],10):void 0},scale:{sx:r,sy:s&&s[1]?parseFloat(s[1]):r}}}function ed(n,e){const t=e.x*n.a+e.y*n.c+0,s=e.x*n.b+e.y*n.d+0;return{x:t,y:s}}function dR(n){const e=ed(n,{x:0,y:1}),t=ed(n,{x:1,y:0}),s=180/Math.PI*Math.atan2(e.y,e.x)-90,r=180/Math.PI*Math.atan2(t.y,t.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 hR(n){let e,t,s,r;return n?(e=n.a==null?1:n.a,r=n.d==null?1:n.d,t=n.b,s=n.c):e=r=1,{sx:t?Math.sqrt(e*e+t*t):e,sy:s?Math.sqrt(s*s+r*r):r}}function fR(n){let e={x:0,y:1};n&&(e=ed(n,e));const t=180*Math.atan2(e.y,e.x)/Math.PI%360-90;return{angle:t%360+(t<0?360:0)}}function pR(n){return{tx:n&&n.e||0,ty:n&&n.f||0}}function Yr(n,e,t={}){if(e==null)return ro(pe(n,"transform"));if(t.absolute){n.setAttribute("transform",Wr(e));return}const s=n.transform,r=so(e);s.baseVal.appendItem(r)}function zy(n,e,t=0,s={}){let r=pe(n,"transform");const i=rl(r);if(e==null)return i.translation;r=i.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=s.absolute?e:i.translation.tx+e,a=s.absolute?t:i.translation.ty+t,c=`translate(${o},${a})`;n.setAttribute("transform",`${c} ${r}`.trim())}function td(n,e,t,s,r={}){let i=pe(n,"transform");const o=rl(i);if(e==null)return o.rotation;i=o.raw,i=i.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=r.absolute?e:o.rotation.angle+e,c=t!=null&&s!=null?`,${t},${s}`:"",u=`rotate(${a}${c})`;n.setAttribute("transform",`${i} ${u}`.trim())}function nd(n,e,t){let s=pe(n,"transform");const r=rl(s);if(e==null)return r.scale;t=t??e,s=r.raw,s=s.replace(/scale\([^)]*\)/g,"").trim();const i=`scale(${e},${t})`;n.setAttribute("transform",`${s} ${i}`.trim())}function io(n,e){if(ws(e)&&ws(n)){const t=e.getScreenCTM(),s=n.getScreenCTM();if(t&&s)return t.inverse().multiply(s)}return ot()}function gR(n,e){let t=ot();if(ws(e)&&ws(n)){let s=n;const r=[];for(;s&&s!==e;){const i=s.getAttribute("transform")||null,o=ro(i);r.push(o),s=s.parentNode}r.reverse().forEach(i=>{t=t.multiply(i)})}return t}function mR(n,e,t){const s=n instanceof SVGSVGElement?n:n.ownerSVGElement,r=s.createSVGPoint();r.x=e,r.y=t;try{const i=s.getScreenCTM(),o=r.matrixTransform(i.inverse()),a=io(n,s).inverse();return o.matrixTransform(a)}catch{return r}}var qt;(function(n){const e={};function t(i){return e[i]||{}}n.get=t;function s(i,o){e[i]=o}n.register=s;function r(i){delete e[i]}n.unregister=r})(qt||(qt={}));var sr;(function(n){const e=new WeakMap;function t(i){return e.has(i)||e.set(i,{events:Object.create(null)}),e.get(i)}n.ensure=t;function s(i){return e.get(i)}n.get=s;function r(i){return e.delete(i)}n.remove=r})(sr||(sr={}));var ce;(function(n){n.returnTrue=()=>!0,n.returnFalse=()=>!1;function e(r){r.stopPropagation()}n.stopPropagationCallback=e;function t(r,i,o){r.addEventListener!=null&&r.addEventListener(i,o)}n.addEventListener=t;function s(r,i,o){r.removeEventListener!=null&&r.removeEventListener(i,o)}n.removeEventListener=s})(ce||(ce={})),function(n){const e=/[^\x20\t\r\n\f]+/g,t=/^([^.]*)(?:\.(.+)|)/;function s(a){return(a||"").match(e)||[""]}n.splitType=s;function r(a){const c=t.exec(a)||[];return{originType:c[1]?c[1].trim():c[1],namespaces:c[2]?c[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,c){if(c){const u=a;return u.querySelector!=null&&u.querySelector(c)!=null}return!0}n.isValidSelector=o}(ce||(ce={})),function(n){let e=0;const t=new WeakMap;function s(a){return t.has(a)||(t.set(a,e),e+=1),t.get(a)}n.ensureHandlerId=s;function r(a){return t.get(a)}n.getHandlerId=r;function i(a){return t.delete(a)}n.removeHandlerId=i;function o(a,c){return t.set(a,c)}n.setHandlerId=o}(ce||(ce={})),function(n){function e(t,s){const r=[],i=sr.get(t),o=i&&i.events&&i.events[s.type],a=o&&o.handlers||[],c=o?o.delegateCount:0;if(c>0&&!(s.type==="click"&&typeof s.button=="number"&&s.button>=1)){for(let u=s.target;u!==t;u=u.parentNode||t)if(u.nodeType===1&&!(s.type==="click"&&u.disabled===!0)){const d=[],f={};for(let h=0;h<c;h+=1){const p=a[h],g=p.selector;if(g!=null&&f[g]==null){const m=t,y=[];m.querySelectorAll(g).forEach(b=>{y.push(b)}),f[g]=y.includes(u)}f[g]&&d.push(p)}d.length&&r.push({elem:u,handlers:d})}}return c<a.length&&r.push({elem:t,handlers:a.slice(c)}),r}n.getHandlerQueue=e}(ce||(ce={})),function(n){function e(t){return t!=null&&t===t.window}n.isWindow=e}(ce||(ce={})),function(n){function e(t,s){const r=t.nodeType===9?t.documentElement:t,i=s&&s.parentNode;return t===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):t.compareDocumentPosition&&t.compareDocumentPosition(i)&16))}n.contains=e}(ce||(ce={}));class Tn{constructor(e,t){this.isDefaultPrevented=ce.returnFalse,this.isPropagationStopped=ce.returnFalse,this.isImmediatePropagationStopped=ce.returnFalse,this.isSimulated=!1,this.preventDefault=()=>{const s=this.originalEvent;this.isDefaultPrevented=ce.returnTrue,s&&!this.isSimulated&&s.preventDefault()},this.stopPropagation=()=>{const s=this.originalEvent;this.isPropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopPropagation()},this.stopImmediatePropagation=()=>{const s=this.originalEvent;this.isImmediatePropagationStopped=ce.returnTrue,s&&!this.isSimulated&&s.stopImmediatePropagation(),this.stopPropagation()},typeof e=="string"?this.type=e:e.type&&(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ce.returnTrue:ce.returnFalse,this.target=e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget,this.timeStamp=e.timeStamp),t&&Object.assign(this,t),this.timeStamp||(this.timeStamp=Date.now())}}(function(n){function e(t){return t instanceof n?t:new n(t)}n.create=e})(Tn||(Tn={})),function(n){function e(t,s){Object.defineProperty(n.prototype,t,{enumerable:!0,configurable:!0,get:typeof s=="function"?function(){if(this.originalEvent)return s(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set(r){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:r})}})}n.addProperty=e}(Tn||(Tn={})),function(n){const e={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(e).forEach(t=>n.addProperty(t,e[t]))}(Tn||(Tn={})),function(n){qt.register("load",{noBubble:!0})}(),function(n){qt.register("beforeunload",{postDispatch(e,t){t.result!==void 0&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}})}(),function(n){qt.register("mouseenter",{delegateType:"mouseover",bindType:"mouseover",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseover"),s}}),qt.register("mouseleave",{delegateType:"mouseout",bindType:"mouseout",handle(e,t){let s;const r=t.relatedTarget,i=t.handleObj;return(!r||r!==e&&!ce.contains(e,r))&&(t.type=i.originType,s=i.handler.call(e,t),t.type="mouseout"),s}})}();var yR=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},oo;(function(n){let e;function t(o,a,c,u,d){if(!ce.isValidTarget(o))return;let f;if(typeof c!="function"){const{handler:m,selector:y}=c,b=yR(c,["handler","selector"]);c=m,d=y,f=b}const h=sr.ensure(o);let p=h.handler;p==null&&(p=h.handler=function(m,...y){return e!==m.type?r(o,m,...y):void 0});const g=ce.ensureHandlerId(c);ce.splitType(a).forEach(m=>{const{originType:y,namespaces:b}=ce.normalizeType(m);if(!y)return;let w=y,x=qt.get(w);w=(d?x.delegateType:x.bindType)||w,x=qt.get(w);const S=Object.assign({type:w,originType:y,data:u,selector:d,guid:g,handler:c,namespace:b.join(".")},f),v=h.events;let E=v[w];E||(E=v[w]={handlers:[],delegateCount:0},(!x.setup||x.setup(o,u,b,p)===!1)&&ce.addEventListener(o,w,p)),x.add&&(ce.removeHandlerId(S.handler),x.add(o,S),ce.setHandlerId(S.handler,g)),d?(E.handlers.splice(E.delegateCount,0,S),E.delegateCount+=1):E.handlers.push(S)})}n.on=t;function s(o,a,c,u,d){const f=sr.get(o);if(!f)return;const h=f.events;h&&(ce.splitType(a).forEach(p=>{const{originType:g,namespaces:m}=ce.normalizeType(p);if(!g){Object.keys(h).forEach(v=>{s(o,v+p,c,u,!0)});return}let y=g;const b=qt.get(y);y=(u?b.delegateType:b.bindType)||y;const w=h[y];if(!w)return;const x=m.length>0?new RegExp(`(^|\\.)${m.join("\\.(?:.*\\.|)")}(\\.|$)`):null,S=w.handlers.length;for(let v=w.handlers.length-1;v>=0;v-=1){const E=w.handlers[v];(d||g===E.originType)&&(!c||ce.getHandlerId(c)===E.guid)&&(x==null||E.namespace&&x.test(E.namespace))&&(u==null||u===E.selector||u==="**"&&E.selector)&&(w.handlers.splice(v,1),E.selector&&(w.delegateCount-=1),b.remove&&b.remove(o,E))}S&&w.handlers.length===0&&((!b.teardown||b.teardown(o,m,f.handler)===!1)&&ce.removeEventListener(o,y,f.handler),delete h[y])}),Object.keys(h).length===0&&sr.remove(o))}n.off=s;function r(o,a,...c){const u=Tn.create(a);u.delegateTarget=o;const d=qt.get(u.type);if(d.preDispatch&&d.preDispatch(o,u)===!1)return;const f=ce.getHandlerQueue(o,u);for(let h=0,p=f.length;h<p&&!u.isPropagationStopped();h+=1){const g=f[h];u.currentTarget=g.elem;for(let m=0,y=g.handlers.length;m<y&&!u.isImmediatePropagationStopped();m+=1){const b=g.handlers[m];if(u.rnamespace==null||b.namespace&&u.rnamespace.test(b.namespace)){u.handleObj=b,u.data=b.data;const w=qt.get(b.originType).handle,x=w?w(g.elem,u,...c):b.handler.call(g.elem,u,...c);x!==void 0&&(u.result=x,x===!1&&(u.preventDefault(),u.stopPropagation()))}}}return d.postDispatch&&d.postDispatch(o,u),u.result}n.dispatch=r;function i(o,a,c,u){let d=o,f=typeof o=="string"?o:o.type,h=typeof o=="string"||d.namespace==null?[]:d.namespace.split(".");const p=c;if(p.nodeType===3||p.nodeType===8)return;f.indexOf(".")>-1&&(h=f.split("."),f=h.shift(),h.sort());const g=f.indexOf(":")<0&&`on${f}`;d=o instanceof Tn?o:new Tn(f,typeof o=="object"?o:null),d.namespace=h.join("."),d.rnamespace=d.namespace?new RegExp(`(^|\\.)${h.join("\\.(?:.*\\.|)")}(\\.|$)`):null,d.result=void 0,d.target||(d.target=p);const m=[d];Array.isArray(a)?m.push(...a):m.push(a);const y=qt.get(f);if(!u&&y.trigger&&y.trigger(p,d,a)===!1)return;let b;const w=[p];if(!u&&!y.noBubble&&!ce.isWindow(p)){b=y.delegateType||f;let S=p,v=p.parentNode;for(;v!=null;)w.push(v),S=v,v=v.parentNode;const E=p.ownerDocument||document;if(S===E){const C=S.defaultView||S.parentWindow||window;w.push(C)}}let x=p;for(let S=0,v=w.length;S<v&&!d.isPropagationStopped();S+=1){const E=w[S];x=E,d.type=S>1?b:y.bindType||f;const C=sr.get(E);C&&C.events[d.type]&&C.handler&&C.handler.call(E,...m);const O=g&&E[g]||null;O&&ce.isValidTarget(E)&&(d.result=O.call(E,...m),d.result===!1&&d.preventDefault())}if(d.type=f,!u&&!d.isDefaultPrevented()){const S=y.preventDefault;if((S==null||S(w.pop(),d,a)===!1)&&ce.isValidTarget(p)&&g&&typeof p[f]=="function"&&!ce.isWindow(p)){const v=p[g];v&&(p[g]=null),e=f,d.isPropagationStopped()&&x.addEventListener(f,ce.stopPropagationCallback),p[f](),d.isPropagationStopped()&&x.removeEventListener(f,ce.stopPropagationCallback),e=void 0,v&&(p[g]=v)}}return d.result}n.trigger=i})(oo||(oo={}));var dt;(function(n){function e(i,o,a,c,u){return ao.on(i,o,a,c,u),i}n.on=e;function t(i,o,a,c,u){return ao.on(i,o,a,c,u,!0),i}n.once=t;function s(i,o,a,c){return ao.off(i,o,a,c),i}n.off=s;function r(i,o,a,c){return oo.trigger(o,a,i,c),i}n.trigger=r})(dt||(dt={}));var ao;(function(n){function e(s,r,i,o,a,c){if(typeof r=="object"){typeof i!="string"&&(o=o||i,i=void 0),Object.keys(r).forEach(u=>e(s,u,i,o,r[u],c));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=ce.returnFalse;else if(!a)return;if(c){const u=a;a=function(d,...f){return n.off(s,d),u.call(this,d,...f)},ce.setHandlerId(a,ce.ensureHandlerId(u))}oo.on(s,r,a,o,i)}n.on=e;function t(s,r,i,o){const a=r;if(a&&a.preventDefault!=null&&a.handleObj!=null){const c=a.handleObj;t(a.delegateTarget,c.namespace?`${c.originType}.${c.namespace}`:c.originType,c.selector,c.handler);return}if(typeof r=="object"){const c=r;Object.keys(c).forEach(u=>t(s,u,i,c[u]));return}(i===!1||typeof i=="function")&&(o=i,i=void 0),o===!1&&(o=ce.returnFalse),oo.off(s,r,o,i)}n.off=t})(ao||(ao={}));class Fy{constructor(e,t,s){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=bs.isEventSupported("wheel")?"wheel":"mousewheel",this.target=e,this.onWheelCallback=t,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(e){if(this.onWheelGuard!=null&&!this.onWheelGuard(e))return;this.deltaX+=e.deltaX,this.deltaY+=e.deltaY,e.preventDefault();let t;(this.deltaX!==0||this.deltaY!==0)&&(e.stopPropagation(),t=!0),t===!0&&this.animationFrameId===0&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(e)}))}didWheel(e){this.animationFrameId=0,this.onWheelCallback(e,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}function sd(n){const e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView;return{top:e.top+t.pageYOffset,left:e.left+t.pageXOffset}}function bR(n){return n.getBoundingClientRect().width}function wR(n){return n.getBoundingClientRect().height}function Uy(n,e=60){let t=null;return(...s)=>{t&&clearTimeout(t),t=window.setTimeout(()=>{n.apply(this,s)},e)}}function xR(n){let e=null,t=[];const s=()=>{if(getComputedStyle(n).position==="static"){const u=n.style;u.position="relative"}const c=document.createElement("object");return c.onload=()=>{c.contentDocument.defaultView.addEventListener("resize",r),r()},c.style.display="block",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.height="100%",c.style.width="100%",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="-1",c.style.opacity="0",c.setAttribute("tabindex","-1"),c.type="text/html",n.appendChild(c),c.data="about:blank",c},r=Uy(()=>{t.forEach(c=>c(n))}),i=c=>{e||(e=s()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,t=[])};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}function vR(n){let e=null,t=[];const s=Uy(()=>{t.forEach(c=>{c(n)})}),r=()=>{const c=new ResizeObserver(s);return c.observe(n),s(),c},i=c=>{e||(e=r()),t.indexOf(c)===-1&&t.push(c)},o=()=>{e&&(e.disconnect(),t=[],e=null)};return{element:n,bind:i,destroy:o,unbind:c=>{const u=t.indexOf(c);u!==-1&&t.splice(u,1),t.length===0&&e&&o()}}}const CR=typeof ResizeObserver<"u"?vR:xR;var il;(function(n){const e=new WeakMap;function t(r){let i=e.get(r);return i||(i=CR(r),e.set(r,i),i)}function s(r){r.destroy(),e.delete(r.element)}n.bind=(r,i)=>{const o=t(r);return o.bind(i),()=>o.unbind(i)},n.clear=r=>{const i=t(r);s(i)}})(il||(il={}));class lo{constructor(e={}){this.comparator=e.comparator||lo.defaultComparator,this.index={},this.data=e.data||[],this.heapify()}isEmpty(){return this.data.length===0}insert(e,t,s){const r={priority:e,value:t},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(e,t){const s=this.index[e];if(typeof s>"u")throw new Error(`Node with id '${e}' was not found in the heap.`);const r=this.data,i=r[s].priority,o=this.comparator(t,i);o<0?(r[s].priority=t,this.bubbleUp(s)):o>0&&(r[s].priority=t,this.bubbleDown(s))}remove(){const e=this.data,t=e[0],s=e.pop();return t.id&&delete this.index[t.id],e.length>0&&(e[0]=s,s.id&&(this.index[s.id]=0),this.bubbleDown(0)),t?t.value:null}heapify(){for(let e=0;e<this.data.length;e+=1)this.bubbleUp(e)}bubbleUp(e){const t=this.data;let s,r,i=e;for(;i>0&&(r=i-1>>>1,this.comparator(t[i].priority,t[r].priority)<0);){s=t[r],t[r]=t[i];let o=t[i].id;o!=null&&(this.index[o]=r),t[i]=s,o=t[i].id,o!=null&&(this.index[o]=i),i=r}}bubbleDown(e){const t=this.data,s=t.length-1;let r=e;for(;;){const i=(r<<1)+1,o=i+1;let a=r;if(i<=s&&this.comparator(t[i].priority,t[a].priority)<0&&(a=i),o<=s&&this.comparator(t[o].priority,t[a].priority)<0&&(a=o),a!==r){const c=t[a];t[a]=t[r];let u=t[r].id;u!=null&&(this.index[u]=a),t[r]=c,u=t[r].id,u!=null&&(this.index[u]=r),r=a}else break}}}(function(n){n.defaultComparator=(e,t)=>e-t})(lo||(lo={}));var rd;(function(n){function e(t,s,r=(i,o)=>1){const i={},o={},a={},c=new lo;for(i[s]=0,Object.keys(t).forEach(u=>{u!==s&&(i[u]=1/0),c.insert(i[u],u,u)});!c.isEmpty();){const u=c.remove();a[u]=!0;const d=t[u]||[];for(let f=0;f<d.length;f+=1){const h=d[f];if(!a[h]){const p=i[u]+r(u,h);p<i[h]&&(i[h]=p,o[h]=u,c.updatePriority(h,p))}}}return o}n.run=e})(rd||(rd={}));class Zn{constructor(e,t,s,r){if(e==null)return this.set(255,255,255,1);if(typeof e=="number")return this.set(e,t,s,r);if(typeof e=="string")return Zn.fromString(e)||this;if(Array.isArray(e))return this.set(e);this.set(e.r,e.g,e.b,e.a==null?1:e.a)}blend(e,t,s){this.set(e.r+(t.r-e.r)*s,e.g+(t.g-e.g)*s,e.b+(t.b-e.b)*s,e.a+(t.a-e.a)*s)}lighten(e){const t=Zn.lighten(this.toArray(),e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}darken(e){this.lighten(-e)}set(e,t,s,r){const i=Array.isArray(e)?e[0]:e,o=Array.isArray(e)?e[1]:t,a=Array.isArray(e)?e[2]:s,c=Array.isArray(e)?e[3]:r;return this.r=Math.round(Ct(i,0,255)),this.g=Math.round(Ct(o,0,255)),this.b=Math.round(Ct(a,0,255)),this.a=c==null?1:Ct(c,0,1),this}toHex(){return`#${["r","g","b"].map(t=>{const s=this[t].toString(16);return s.length<2?`0${s}`:s}).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Zn.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(e){const t=`${this.r},${this.g},${this.b},`;return e?`rgb(${t})`:`rgba(${t},${this.a})`}toGrey(){return Zn.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 e(x){return new n(x)}n.fromArray=e;function t(x){return new n([...g(x),1])}n.fromHex=t;function s(x){const S=x.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(S){const v=S[1].split(/\s*,\s*/).map(E=>parseInt(E,10));return new n(v)}return null}n.fromRGBA=s;function r(x,S,v){v<0&&++v,v>1&&--v;const E=6*v;return E<1?x+(S-x)*E:2*v<1?S:3*v<2?x+(S-x)*(2/3-v)*6:x}function i(x){const S=x.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(S){const v=S[2].split(/\s*,\s*/),E=(parseFloat(v[0])%360+360)%360/360,C=parseFloat(v[1])/100,O=parseFloat(v[2])/100,A=v[3]==null?1:parseInt(v[3],10);return new n(u(E,C,O,A))}return null}n.fromHSLA=i;function o(x){if(x.startsWith("#"))return t(x);if(x.startsWith("rgb"))return s(x);const S=n.named[x];return S?t(S):i(x)}n.fromString=o;function a(x,S){return n.fromArray([x,x,x,S])}n.makeGrey=a;function c(x,S,v,E){const C=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:S,A=Array.isArray(x)?x[2]:v,k=Array.isArray(x)?x[3]:E,_=Math.max(C,O,A),V=Math.min(C,O,A),L=(_+V)/2;let B=0,N=0;if(V!==_){const P=_-V;switch(N=L>.5?P/(2-_-V):P/(_+V),_){case C:B=(O-A)/P+(O<A?6:0);break;case O:B=(A-C)/P+2;break;case A:B=(C-O)/P+4;break}B/=6}return[B,N,L,k??1]}n.rgba2hsla=c;function u(x,S,v,E){const C=Array.isArray(x)?x[0]:x,O=Array.isArray(x)?x[1]:S,A=Array.isArray(x)?x[2]:v,k=Array.isArray(x)?x[3]:E,_=A<=.5?A*(O+1):A+O-A*O,V=2*A-_;return[r(V,_,C+1/3)*256,r(V,_,C)*256,r(V,_,C-1/3)*256,k??1]}n.hsla2rgba=u;function d(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=d;function f(){const x="0123456789ABCDEF";let S="#";for(let v=0;v<6;v+=1)S+=x[Math.floor(Math.random()*16)];return S}n.randomHex=f;function h(x){return d(x).toString()}n.randomRGBA=h;function p(x,S){if(typeof x=="string"){const A=x[0]==="#",[k,_,V]=g(x);return S?k*.299+_*.587+V*.114>186?"#000000":"#ffffff":`${A?"#":""}${m(255-k,255-_,255-V)}`}const v=x[0],E=x[1],C=x[2],O=x[3];return S?v*.299+E*.587+C*.114>186?[0,0,0,O]:[255,255,255,O]:[255-v,255-E,255-C,O]}n.invert=p;function g(x){const S=x.indexOf("#")===0?x:`#${x}`;let v=+`0x${S.substr(1)}`;if(!(S.length===4||S.length===7)||Number.isNaN(v))throw new Error("Invalid hex color.");const E=S.length===4?4:8,C=(1<<E)-1,O=["b","g","r"].map(()=>{const A=v&C;return v>>=E,E===4?17*A:A});return[O[2],O[1],O[0]]}function m(x,S,v){const E=C=>C.length<2?`0${C}`:C;return`${E(x.toString(16))}${E(S.toString(16))}${E(v.toString(16))}`}function y(x,S){return w(x,S)}n.lighten=y;function b(x,S){return w(x,-S)}n.darken=b;function w(x,S){if(typeof x=="string"){const C=x[0]==="#",O=parseInt(C?x.substr(1):x,16),A=Ct((O>>16)+S,0,255),k=Ct((O>>8&255)+S,0,255),_=Ct((O&255)+S,0,255);return`${C?"#":""}${(_|k<<8|A<<16).toString(16)}`}const v=m(x[0],x[1],x[2]),E=g(w(v,S));return[E[0],E[1],E[2],x[3]]}})(Zn||(Zn={})),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"}}(Zn||(Zn={}));class id{constructor(){this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){this.map.set(e,t),this.arr.push(e)}delete(e){const t=this.arr.indexOf(e);t>=0&&this.arr.splice(t,1);const s=this.map.get(e);return this.map.delete(e),s}each(e){this.arr.forEach(t=>{const s=this.map.get(t);e(s,t)})}dispose(){this.clear()}}var vs;(function(n){function e(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=e;function t(r,i){if(r!=null&&i!=null){const o=e(r),a=e(i),c=o.or.sort(),u=a.or.sort(),d=o.and.sort(),f=a.and.sort(),h=(p,g)=>p.length===g.length&&(p.length===0||p.every((m,y)=>m===g[y]));return h(c,u)&&h(d,f)}return r==null&&i==null}n.equals=t;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:c}=e(i),u=d=>{const f=`${d.toLowerCase()}Key`;return r[f]===!0};return a.some(d=>u(d))&&c.every(d=>u(d))}n.isMatch=s})(vs||(vs={}));var rr;(function(n){n.linear=e=>e,n.quad=e=>e*e,n.cubic=e=>e*e*e,n.inout=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=e*e,s=t*e;return 4*(e<.5?s:3*(e-t)+s-.75)},n.exponential=e=>Math.pow(2,10*(e-1)),n.bounce=e=>{for(let t=0,s=1;;t+=s,s/=2)if(e>=(7-4*t)/11){const r=(11-6*t-11*e)/4;return-r*r+s*s}}})(rr||(rr={})),function(n){n.decorators={reverse(e){return t=>1-e(1-t)},reflect(e){return t=>.5*(t<.5?e(2*t):2-e(2-2*t))},clamp(e,t=0,s=1){return r=>{const i=e(r);return i<t?t:i>s?s:i}},back(e=1.70158){return t=>t*t*((e+1)*t-e)},elastic(e=1.5){return t=>Math.pow(2,10*(t-1))*Math.cos(20*Math.PI*e/3*t)}}}(rr||(rr={})),function(n){function e(N){return-1*Math.cos(N*(Math.PI/2))+1}n.easeInSine=e;function t(N){return Math.sin(N*(Math.PI/2))}n.easeOutSine=t;function s(N){return-.5*(Math.cos(Math.PI*N)-1)}n.easeInOutSine=s;function r(N){return N*N}n.easeInQuad=r;function i(N){return N*(2-N)}n.easeOutQuad=i;function o(N){return N<.5?2*N*N:-1+(4-2*N)*N}n.easeInOutQuad=o;function a(N){return N*N*N}n.easeInCubic=a;function c(N){const P=N-1;return P*P*P+1}n.easeOutCubic=c;function u(N){return N<.5?4*N*N*N:(N-1)*(2*N-2)*(2*N-2)+1}n.easeInOutCubic=u;function d(N){return N*N*N*N}n.easeInQuart=d;function f(N){const P=N-1;return 1-P*P*P*P}n.easeOutQuart=f;function h(N){const P=N-1;return N<.5?8*N*N*N*N:1-8*P*P*P*P}n.easeInOutQuart=h;function p(N){return N*N*N*N*N}n.easeInQuint=p;function g(N){const P=N-1;return 1+P*P*P*P*P}n.easeOutQuint=g;function m(N){const P=N-1;return N<.5?16*N*N*N*N*N:1+16*P*P*P*P*P}n.easeInOutQuint=m;function y(N){return N===0?0:Math.pow(2,10*(N-1))}n.easeInExpo=y;function b(N){return N===1?1:-Math.pow(2,-10*N)+1}n.easeOutExpo=b;function w(N){if(N===0||N===1)return N;const P=N*2,T=P-1;return P<1?.5*Math.pow(2,10*T):.5*(-Math.pow(2,-10*T)+2)}n.easeInOutExpo=w;function x(N){const P=N/1;return-1*(Math.sqrt(1-P*N)-1)}n.easeInCirc=x;function S(N){const P=N-1;return Math.sqrt(1-P*P)}n.easeOutCirc=S;function v(N){const P=N*2,T=P-2;return P<1?-.5*(Math.sqrt(1-P*P)-1):.5*(Math.sqrt(1-T*T)+1)}n.easeInOutCirc=v;function E(N,P=1.70158){return N*N*((P+1)*N-P)}n.easeInBack=E;function C(N,P=1.70158){const T=N/1-1;return T*T*((P+1)*T+P)+1}n.easeOutBack=C;function O(N,P=1.70158){const T=N*2,j=T-2,Y=P*1.525;return T<1?.5*T*T*((Y+1)*T-Y):.5*(j*j*((Y+1)*j+Y)+2)}n.easeInOutBack=O;function A(N,P=.7){if(N===0||N===1)return N;const j=N/1-1,Y=1-P,te=Y/(2*Math.PI)*Math.asin(1);return-(Math.pow(2,10*j)*Math.sin((j-te)*(2*Math.PI)/Y))}n.easeInElastic=A;function k(N,P=.7){const T=1-P,j=N*2;if(N===0||N===1)return N;const Y=T/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*j)*Math.sin((j-Y)*(2*Math.PI)/T)+1}n.easeOutElastic=k;function _(N,P=.65){const T=1-P;if(N===0||N===1)return N;const j=N*2,Y=j-1,te=T/(2*Math.PI)*Math.asin(1);return j<1?-.5*(Math.pow(2,10*Y)*Math.sin((Y-te)*(2*Math.PI)/T)):Math.pow(2,-10*Y)*Math.sin((Y-te)*(2*Math.PI)/T)*.5+1}n.easeInOutElastic=_;function V(N){const P=N/1;if(P<1/2.75)return 7.5625*P*P;if(P<2/2.75){const T=P-.5454545454545454;return 7.5625*T*T+.75}if(P<2.5/2.75){const T=P-.8181818181818182;return 7.5625*T*T+.9375}{const T=P-.9545454545454546;return 7.5625*T*T+.984375}}n.easeOutBounce=V;function L(N){return 1-V(1-N)}n.easeInBounce=L;function B(N){return N<.5?L(N*2)*.5:V(N*2-1)*.5+.5}n.easeInOutBounce=B}(rr||(rr={}));var ir;(function(n){n.number=(e,t)=>{const s=t-e;return r=>e+s*r},n.object=(e,t)=>{const s=Object.keys(e);return r=>{const i={};for(let o=s.length-1;o!==-1;o-=1){const a=s[o];i[a]=e[a]+(t[a]-e[a])*r}return i}},n.unit=(e,t)=>{const s=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,r=s.exec(e),i=s.exec(t),o=i?i[1]:"",a=r?+r[1]:0,c=i?+i[1]:0,u=o.indexOf("."),d=u>0?o[1].length-u-1:0,f=c-a,h=r?r[2]:"";return p=>(a+f*p).toFixed(d)+h},n.color=(e,t)=>{const s=parseInt(e.slice(1),16),r=parseInt(t.slice(1),16),i=s&255,o=(r&255)-i,a=s&65280,c=(r&65280)-a,u=s&16711680,d=(r&16711680)-u;return f=>{const h=i+o*f&255,p=a+c*f&65280,g=u+d*f&16711680;return`#${(1<<24|h|p|g).toString(16).slice(1)}`}}})(ir||(ir={}));const co=[];function qr(n,e){const t=co.find(s=>s.name===n);if(!(t&&(t.loadTimes+=1,t.loadTimes>1))&&!bs.isApplyingHMR()){const s=document.createElement("style");s.setAttribute("type","text/css"),s.textContent=e;const r=document.querySelector("head");r&&r.insertBefore(s,r.firstChild),co.push({name:n,loadTimes:1,styleElement:s})}}function Xr(n){const e=co.findIndex(t=>t.name===n);if(e>-1){const t=co[e];if(t.loadTimes-=1,t.loadTimes>0)return;let s=t.styleElement;s&&s.parentNode&&s.parentNode.removeChild(s),s=null,co.splice(e,1)}}var ye;(function(n){function e(s){return 180*s/Math.PI%360}n.toDeg=e,n.toRad=function(s,r=!1){return(r?s:s%360)*Math.PI/180};function t(s){return s%360+(s<0?360:0)}n.normalize=t})(ye||(ye={}));var Se;(function(n){function e(a,c=0){return Number.isInteger(a)?a:+a.toFixed(c)}n.round=e;function t(a,c){let u,d;if(c==null?(d=a??1,u=0):(d=c,u=a??0),d<u){const f=u;u=d,d=f}return Math.floor(Math.random()*(d-u+1)+u)}n.random=t;function s(a,c,u){return Number.isNaN(a)?NaN:Number.isNaN(c)||Number.isNaN(u)?0:c<u?a<c?c:a>u?u:a:a<u?u:a>c?c:a}n.clamp=s;function r(a,c){return c*Math.round(a/c)}n.snapToGrid=r;function i(a,c){return c!=null&&a!=null&&c.x>=a.x&&c.x<=a.x+a.width&&c.y>=a.y&&c.y<=a.y+a.height}n.containsPoint=i;function o(a,c){const u=a.x-c.x,d=a.y-c.y;return u*u+d*d}n.squaredLength=o})(Se||(Se={}));class Cs{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class M extends Cs{constructor(e,t){super(),this.x=e??0,this.y=t??0}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this}add(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}update(e,t){const s=M.create(e,t);return this.x=s.x,this.y=s.y,this}translate(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}rotate(e,t){const s=M.rotate(this,e,t);return this.x=s.x,this.y=s.y,this}scale(e,t,s=new M){const r=M.create(s);return this.x=r.x+e*(this.x-r.x),this.y=r.y+t*(this.y-r.y),this}closest(e){if(e.length===1)return M.create(e[0]);let t=null,s=1/0;return e.forEach(r=>{const i=this.squaredDistance(r);i<s&&(t=r,s=i)}),t?M.create(t):null}distance(e){return Math.sqrt(this.squaredDistance(e))}squaredDistance(e){const t=M.create(e),s=this.x-t.x,r=this.y-t.y;return s*s+r*r}manhattanDistance(e){const t=M.create(e);return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(e=new M){const t=M.create(e),s=-(t.y-this.y),r=t.x-this.x;let i=Math.atan2(s,r);return i<0&&(i=2*Math.PI+i),180*i/Math.PI}angleBetween(e,t){if(this.equals(e)||this.equals(t))return NaN;let s=this.theta(t)-this.theta(e);return s<0&&(s+=360),s}vectorAngle(e){return new M(0,0).angleBetween(this,e)}toPolar(e){return this.update(M.toPolar(this,e)),this}changeInAngle(e,t,s=new M){return this.clone().translate(-e,-t).theta(s)-this.theta(s)}adhereToRect(e){return Se.containsPoint(e,this)||(this.x=Math.min(Math.max(this.x,e.x),e.x+e.width),this.y=Math.min(Math.max(this.y,e.y),e.y+e.height)),this}bearing(e){const t=M.create(e),s=ye.toRad(this.y),r=ye.toRad(t.y),i=this.x,o=t.x,a=ye.toRad(o-i),c=Math.sin(a)*Math.cos(r),u=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(a),d=ye.toDeg(Math.atan2(c,u)),f=["NE","E","SE","S","SW","W","NW","N"];let h=d-22.5;return h<0&&(h+=360),h=parseInt(h/45,10),f[h]}cross(e,t){if(e!=null&&t!=null){const s=M.create(e),r=M.create(t);return(r.x-this.x)*(s.y-this.y)-(r.y-this.y)*(s.x-this.x)}return NaN}dot(e){const t=M.create(e);return this.x*t.x+this.y*t.y}diff(e,t){if(typeof e=="number")return new M(this.x-e,this.y-t);const s=M.create(e);return new M(this.x-s.x,this.y-s.y)}lerp(e,t){const s=M.create(e);return new M((1-t)*this.x+t*s.x,(1-t)*this.y+t*s.y)}normalize(e=1){const t=e/this.magnitude();return this.scale(t,t)}move(e,t){const s=M.create(e),r=ye.toRad(s.theta(this));return this.translate(Math.cos(r)*t,-Math.sin(r)*t)}reflection(e){return M.create(e).move(this,this.distance(e))}snapToGrid(e,t){return this.x=Se.snapToGrid(this.x,e),this.y=Se.snapToGrid(this.y,t??e),this}equals(e){const t=M.create(e);return t!=null&&t.x===this.x&&t.y===this.y}clone(){return M.clone(this)}toJSON(){return M.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPoint=e})(M||(M={})),function(n){function e(s){return s!=null&&typeof s=="object"&&typeof s.x=="number"&&typeof s.y=="number"}n.isPointLike=e;function t(s){return s!=null&&Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"}n.isPointData=t}(M||(M={})),function(n){function e(f,h){return f==null||typeof f=="number"?new n(f,h):t(f)}n.create=e;function t(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=t;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,h,p=new n){let g=Math.abs(f*Math.cos(h)),m=Math.abs(f*Math.sin(h));const y=t(p),b=ye.normalize(ye.toDeg(h));return b<90?m=-m:b<180?(g=-g,m=-m):b<270&&(g=-g),new n(y.x+g,y.y+m)}n.fromPolar=r;function i(f,h=new n){const p=t(f),g=t(h),m=p.x-g.x,y=p.y-g.y;return new n(Math.sqrt(m*m+y*y),ye.toRad(g.theta(p)))}n.toPolar=i;function o(f,h){return f===h?!0:f!=null&&h!=null?f.x===h.x&&f.y===h.y:!1}n.equals=o;function a(f,h){if(f==null&&h!=null||f!=null&&h==null||f!=null&&h!=null&&f.length!==h.length)return!1;if(f!=null&&h!=null){for(let p=0,g=f.length;p<g;p+=1)if(!o(f[p],h[p]))return!1}return!0}n.equalPoints=a;function c(f,h,p,g){return new n(Se.random(f,h),Se.random(p,g))}n.random=c;function u(f,h,p){const g=ye.toRad(ye.normalize(-h)),m=Math.sin(g),y=Math.cos(g);return d(f,y,m,p)}n.rotate=u;function d(f,h,p,g=new n){const m=t(f),y=t(g),b=m.x-y.x,w=m.y-y.y,x=b*h-w*p,S=w*h+b*p;return new n(x+y.x,S+y.y)}n.rotateEx=d}(M||(M={}));class G extends Cs{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 M(this.x,this.y)}get topLeft(){return new M(this.x,this.y)}get topCenter(){return new M(this.x+this.width/2,this.y)}get topRight(){return new M(this.x+this.width,this.y)}get center(){return new M(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new M(this.x,this.y+this.height)}get bottomCenter(){return new M(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new M(this.x+this.width,this.y+this.height)}get corner(){return new M(this.x+this.width,this.y+this.height)}get rightMiddle(){return new M(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new M(this.x,this.y+this.height/2)}get topLine(){return new K(this.topLeft,this.topRight)}get rightLine(){return new K(this.topRight,this.bottomRight)}get bottomLine(){return new K(this.bottomLeft,this.bottomRight)}get leftLine(){return new K(this.topLeft,this.bottomLeft)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??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(e){if(!e)return this.clone();const t=ye.toRad(e),s=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),i=this.width*r+this.height*s,o=this.width*s+this.height*r;return new G(this.x+(this.width-i)/2,this.y+(this.height-o)/2,i,o)}round(e=0){return this.x=Se.round(this.x,e),this.y=Se.round(this.y,e),this.width=Se.round(this.width,e),this.height=Se.round(this.height,e),this}add(e,t,s,r){const i=G.create(e,t,s,r),o=Math.min(this.x,i.x),a=Math.min(this.y,i.y),c=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=c-o,this.height=u-a,this}update(e,t,s,r){const i=G.create(e,t,s,r);return this.x=i.x,this.y=i.y,this.width=i.width,this.height=i.height,this}inflate(e,t){const s=e,r=t??e;return this.x-=s,this.y-=r,this.width+=2*s,this.height+=2*r,this}snapToGrid(e,t){const s=this.origin.snapToGrid(e,t),r=this.corner.snapToGrid(e,t);return this.x=s.x,this.y=s.y,this.width=r.x-s.x,this.height=r.y-s.y,this}translate(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}scale(e,t,s=new M){const r=this.origin.scale(e,t,s);return this.x=r.x,this.y=r.y,this.width*=e,this.height*=t,this}rotate(e,t=this.getCenter()){if(e!==0){const s=ye.toRad(e),r=Math.cos(s),i=Math.sin(s);let o=this.getOrigin(),a=this.getTopRight(),c=this.getBottomRight(),u=this.getBottomLeft();o=M.rotateEx(o,r,i,t),a=M.rotateEx(a,r,i,t),c=M.rotateEx(c,r,i,t),u=M.rotateEx(u,r,i,t);const d=new G(o.x,o.y,0,0);d.add(a.x,a.y,0,0),d.add(c.x,c.y,0,0),d.add(u.x,u.y,0,0),this.update(d)}return this}rotate90(){const e=(this.width-this.height)/2;this.x+=e,this.y-=e;const t=this.width;return this.width=this.height,this.height=t,this}moveAndExpand(e){const t=G.clone(e);return this.x+=t.x||0,this.y+=t.y||0,this.width+=t.width||0,this.height+=t.height||0,this}getMaxScaleToFit(e,t=this.center){const s=G.clone(e),r=t.x,i=t.y;let o=1/0,a=1/0,c=1/0,u=1/0,d=1/0,f=1/0,h=1/0,p=1/0;const g=s.topLeft;g.x<r&&(o=(this.x-r)/(g.x-r)),g.y<i&&(d=(this.y-i)/(g.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&&(c=(this.x+this.width-r)/(y.x-r)),y.y<i&&(h=(this.y-i)/(y.y-i));const b=s.bottomLeft;return b.x<r&&(u=(this.x-r)/(b.x-r)),b.y>i&&(p=(this.y+this.height-i)/(b.y-i)),{sx:Math.min(o,a,c,u),sy:Math.min(d,f,h,p)}}getMaxUniformScaleToFit(e,t=this.center){const s=this.getMaxScaleToFit(e,t);return Math.min(s.sx,s.sy)}containsPoint(e,t){return Se.containsPoint(this,M.create(e,t))}containsRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.x,a=this.y,c=this.width,u=this.height,d=i.x,f=i.y,h=i.width,p=i.height;return c===0||u===0||h===0||p===0?!1:d>=o&&f>=a&&d+h<=o+c&&f+p<=a+u}intersectsWithLine(e){const t=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],s=[],r=[];return t.forEach(i=>{const o=e.intersectsWithLine(i);o!==null&&r.indexOf(o.toString())<0&&(s.push(o),r.push(o.toString()))}),s.length>0?s:null}intersectsWithLineFromCenterToPoint(e,t){const s=M.clone(e),r=this.center;let i=null;t!=null&&t!==0&&s.rotate(t,r);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],a=new K(r,s);for(let c=o.length-1;c>=0;c-=1){const u=o[c].intersectsWithLine(a);if(u!==null){i=u;break}}return i&&t!=null&&t!==0&&i.rotate(-t,r),i}intersectsWithRect(e,t,s,r){const i=G.create(e,t,s,r);if(!this.isIntersectWithRect(i))return null;const o=this.origin,a=this.corner,c=i.origin,u=i.corner,d=Math.max(o.x,c.x),f=Math.max(o.y,c.y);return new G(d,f,Math.min(a.x,u.x)-d,Math.min(a.y,u.y)-f)}isIntersectWithRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.origin,a=this.corner,c=i.origin,u=i.corner;return!(u.x<=o.x||u.y<=o.y||c.x>=a.x||c.y>=a.y)}normalize(){let e=this.x,t=this.y,s=this.width,r=this.height;return this.width<0&&(e=this.x+this.width,s=-this.width),this.height<0&&(t=this.y+this.height,r=-this.height),this.x=e,this.y=t,this.width=s,this.height=r,this}union(e){const t=G.clone(e),s=this.origin,r=this.corner,i=t.origin,o=t.corner,a=Math.min(s.x,i.x),c=Math.min(s.y,i.y),u=Math.max(r.x,o.x),d=Math.max(r.y,o.y);return new G(a,c,u-a,d-c)}getNearestSideToPoint(e){const t=M.clone(e),s=t.x-this.x,r=this.x+this.width-t.x,i=t.y-this.y,o=this.y+this.height-t.y;let a=s,c="left";return r<a&&(a=r,c="right"),i<a&&(a=i,c="top"),o<a&&(c="bottom"),c}getNearestPointToPoint(e){const t=M.clone(e);if(this.containsPoint(t)){const s=this.getNearestSideToPoint(t);if(s==="left")return new M(this.x,t.y);if(s==="top")return new M(t.x,this.y);if(s==="right")return new M(this.x+this.width,t.y);if(s==="bottom")return new M(t.x,this.y+this.height)}return t.adhereToRect(this)}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}clone(){return new G(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 e(t){return t!=null&&t instanceof n}n.isRectangle=e})(G||(G={})),function(n){function e(t){return t!=null&&typeof t=="object"&&typeof t.x=="number"&&typeof t.y=="number"&&typeof t.width=="number"&&typeof t.height=="number"}n.isRectangleLike=e}(G||(G={})),function(n){function e(o,a,c,u){return o==null||typeof o=="number"?new n(o,a,c,u):t(o)}n.create=e;function t(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=t;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}(G||(G={}));class K extends Cs{get center(){return new M((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}constructor(e,t,s,r){super(),typeof e=="number"&&typeof t=="number"?(this.start=new M(e,t),this.end=new M(s,r)):(this.start=M.create(e),this.end=M.create(t))}getCenter(){return this.center}round(e=0){return this.start.round(e),this.end.round(e),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.end.translate(e)),this}rotate(e,t){return this.start.rotate(e,t),this.end.rotate(e,t),this}scale(e,t,s){return this.start.scale(e,t,s),this.end.scale(e,t,s),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const e=this.start.x-this.end.x,t=this.start.y-this.end.y;return e*e+t*t}setLength(e){const t=this.length();if(!t)return this;const s=e/t;return this.scale(s,s,this.start)}parallel(e){const t=this.clone();if(!t.isDifferentiable())return t;const{start:s,end:r}=t,i=s.clone().rotate(270,r),o=r.clone().rotate(90,s);return s.move(o,e),r.move(i,e),t}vector(){return new M(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const e=new M(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,e)}bbox(){const e=Math.min(this.start.x,this.end.x),t=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 G(e,t,s-e,r-t)}bearing(){return this.start.bearing(this.end)}closestPoint(e){return this.pointAt(this.closestPointNormalizedLength(e))}closestPointLength(e){return this.closestPointNormalizedLength(e)*this.length()}closestPointTangent(e){return this.tangentAt(this.closestPointNormalizedLength(e))}closestPointNormalizedLength(e){const t=this.vector().dot(new K(this.start,e).vector()),s=Math.min(1,Math.max(0,t/this.squaredLength()));return Number.isNaN(s)?0:s}pointAt(e){const t=this.start,s=this.end;return e<=0?t.clone():e>=1?s.clone():t.lerp(s,e)}pointAtLength(e){const t=this.start,s=this.end;let r=!0;e<0&&(r=!1,e=-e);const i=this.length();if(e>=i)return r?s.clone():t.clone();const o=(r?e:i-e)/i;return this.pointAt(o)}divideAt(e){const t=this.pointAt(e);return[new K(this.start,t),new K(t,this.end)]}divideAtLength(e){const t=this.pointAtLength(e);return[new K(this.start,t),new K(t,this.end)]}containsPoint(e){const t=this.start,s=this.end;if(t.cross(e,s)!==0)return!1;const r=this.length();return!(new K(t,e).length()>r||new K(e,s).length()>r)}intersect(e,t){const s=e.intersectsWithLine(this,t);return s?Array.isArray(s)?s:[s]:null}intersectsWithLine(e){const t=new M(this.end.x-this.start.x,this.end.y-this.start.y),s=new M(e.end.x-e.start.x,e.end.y-e.start.y),r=t.x*s.y-t.y*s.x,i=new M(e.start.x-this.start.x,e.start.y-this.start.y),o=i.x*s.y-i.y*s.x,a=i.x*t.y-i.y*t.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 M(this.start.x+o*t.x/r,this.start.y+o*t.y/r)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(e){const t=M.clone(e),s=this.start,r=this.end;return((r.x-s.x)*(t.y-s.y)-(r.y-s.y)*(t.x-s.x))/this.length()}pointSquaredDistance(e,t){const s=M.create(e,t);return this.closestPoint(s).squaredDistance(s)}pointDistance(e,t){const s=M.create(e,t);return this.closestPoint(s).distance(s)}tangentAt(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAt(e),i=new K(t,s);return i.translate(r.x-t.x,r.y-t.y),i}tangentAtLength(e){if(!this.isDifferentiable())return null;const t=this.start,s=this.end,r=this.pointAtLength(e),i=new K(t,s);return i.translate(r.x-t.x,r.y-t.y),i}relativeCcw(e,t){const s=M.create(e,t);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 c=r*a-i*o;return c===0&&(c=r*o+i*a,c>0&&(r-=o,i-=a,c=r*o+i*a,c<0&&(c=0))),c<0?-1:c>0?1:0}equals(e){return e!=null&&this.start.x===e.start.x&&this.start.y===e.start.y&&this.end.x===e.end.x&&this.end.y===e.end.y}clone(){return new K(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 e(t){return t!=null&&t instanceof n}n.isLine=e})(K||(K={}));class bn extends Cs{get center(){return new M(this.x,this.y)}constructor(e,t,s,r){super(),this.x=e??0,this.y=t??0,this.a=s??0,this.b=r??0}bbox(){return G.fromEllipse(this)}getCenter(){return this.center}inflate(e,t){const s=e,r=t??e;return this.a+=2*s,this.b+=2*r,this}normalizedDistance(e,t){const s=M.create(e,t),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(e,t){return this.normalizedDistance(e,t)<=1}intersectsWithLine(e){const t=[],s=this.a,r=this.b,i=e.start,o=e.end,a=e.vector(),c=i.diff(new M(this.x,this.y)),u=new M(a.x/(s*s),a.y/(r*r)),d=new M(c.x/(s*s),c.y/(r*r)),f=a.dot(u),h=a.dot(d),p=c.dot(d)-1,g=h*h-f*p;if(g<0)return null;if(g>0){const m=Math.sqrt(g),y=(-h-m)/f,b=(-h+m)/f;if((y<0||y>1)&&(b<0||b>1))return null;y>=0&&y<=1&&t.push(i.lerp(o,y)),b>=0&&b<=1&&t.push(i.lerp(o,b))}else{const m=-h/f;if(m>=0&&m<=1)t.push(i.lerp(o,m));else return null}return t}intersectsWithLineFromCenterToPoint(e,t=0){const s=M.clone(e);t&&s.rotate(t,this.getCenter());const r=s.x-this.x,i=s.y-this.y;let o;if(r===0)return o=this.bbox().getNearestPointToPoint(s),t?o.rotate(-t,this.getCenter()):o;const a=i/r,c=a*a,u=this.a*this.a,d=this.b*this.b;let f=Math.sqrt(1/(1/u+c/d));f=r<0?-f:f;const h=a*f;return o=new M(this.x+f,this.y+h),t?o.rotate(-t,this.getCenter()):o}tangentTheta(e){const t=M.clone(e),s=t.x,r=t.y,i=this.a,o=this.b,a=this.bbox().center,c=a.x,u=a.y,d=30,f=s>a.x+i/2,h=s<a.x-i/2;let p,g;return f||h?(g=s>a.x?r-d:r+d,p=i*i/(s-c)-i*i*(r-u)*(g-u)/(o*o*(s-c))+c):(p=r>a.y?s+d:s-d,g=o*o/(r-u)-o*o*(s-c)*(p-c)/(i*i*(r-u))+u),new M(p,g).theta(t)}scale(e,t){return this.a*=e,this.b*=t,this}rotate(e,t){const s=G.fromEllipse(this);s.rotate(e,t);const r=bn.fromRect(s);return this.a=r.a,this.b=r.b,this.x=r.x,this.y=r.y,this}translate(e,t){const s=M.create(e,t);return this.x+=s.x,this.y+=s.y,this}equals(e){return e!=null&&e.x===this.x&&e.y===this.y&&e.a===this.a&&e.b===this.b}clone(){return new bn(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 e(t){return t!=null&&t instanceof n}n.isEllipse=e})(bn||(bn={})),function(n){function e(r,i,o,a){return r==null||typeof r=="number"?new n(r,i,o,a):t(r)}n.create=e;function t(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=t;function s(r){const i=r.center;return new n(i.x,i.y,r.width/2,r.height/2)}n.fromRect=s}(bn||(bn={}));const SR=new RegExp("^[\\s\\dLMCZz,.]*$");function ER(n){return typeof n!="string"?!1:SR.test(n)}function od(n,e){return(n%e+e)%e}function OR(n,e,t,s,r){const i=[],o=n[n.length-1],a=e!=null&&e>0,c=e||0;if(s&&a){n=n.slice();const f=n[0],h=new M(o.x+(f.x-o.x)/2,o.y+(f.y-o.y)/2);n.splice(0,0,h)}let u=n[0],d=1;for(t?i.push("M",u.x,u.y):i.push("L",u.x,u.y);d<(s?n.length:n.length-1);){let f=n[od(d,n.length)],h=u.x-f.x,p=u.y-f.y;if(a&&(h!==0||p!==0)&&(r==null||r.indexOf(d-1)<0)){let g=Math.sqrt(h*h+p*p);const m=h*Math.min(c,g/2)/g,y=p*Math.min(c,g/2)/g,b=f.x+m,w=f.y+y;i.push("L",b,w);let x=n[od(d+1,n.length)];for(;d<n.length-2&&Math.round(x.x-f.x)===0&&Math.round(x.y-f.y)===0;)x=n[od(d+2,n.length)],d+=1;h=x.x-f.x,p=x.y-f.y,g=Math.max(1,Math.sqrt(h*h+p*p));const S=h*Math.min(c,g/2)/g,v=p*Math.min(c,g/2)/g,E=f.x+S,C=f.y+v;i.push("Q",f.x,f.y,E,C),f=new M(E,C)}else i.push("L",f.x,f.y);u=f,d+=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 Hy(n,e={}){const t=[];return n&&n.length&&n.forEach(s=>{Array.isArray(s)?t.push({x:s[0],y:s[1]}):t.push({x:s.x,y:s.y})}),OR(t,e.round,e.initialMove==null||e.initialMove,e.close,e.exclude)}function ol(n,e,t,s,r=0,i=0,o=0,a,c){if(t===0||s===0)return[];a-=n,c-=e,t=Math.abs(t),s=Math.abs(s);const u=-a/2,d=-c/2,f=Math.cos(r*Math.PI/180),h=Math.sin(r*Math.PI/180),p=f*u+h*d,g=-1*h*u+f*d,m=p*p,y=g*g,b=t*t,w=s*s,x=m/b+y/w;let S;if(x>1)t=Math.sqrt(x)*t,s=Math.sqrt(x)*s,S=0;else{let J=1;i===o&&(J=-1),S=J*Math.sqrt((b*w-b*y-w*m)/(b*y+w*m))}const v=S*t*g/s,E=-1*S*s*p/t,C=f*v-h*E+a/2,O=h*v+f*E+c/2;let A=Math.atan2((g-E)/s,(p-v)/t)-Math.atan2(0,1),k=A>=0?A:2*Math.PI+A;A=Math.atan2((-g-E)/s,(-p-v)/t)-Math.atan2((g-E)/s,(p-v)/t);let _=A>=0?A:2*Math.PI+A;o===0&&_>0?_-=2*Math.PI:o!==0&&_<0&&(_+=2*Math.PI);const V=_*2/Math.PI,L=Math.ceil(V<0?-1*V:V),B=_/L,N=8/3*Math.sin(B/4)*Math.sin(B/4)/Math.sin(B/2),P=f*t,T=f*s,j=h*t,Y=h*s;let te=Math.cos(k),z=Math.sin(k),I=-N*(P*z+Y*te),U=-N*(j*z-T*te),F=0,D=0;const q=[];for(let J=0;J<L;J+=1){k+=B,te=Math.cos(k),z=Math.sin(k),F=P*te-Y*z+C,D=j*te+T*z+O;const ae=-N*(P*z+Y*te),Z=-N*(j*z-T*te),fe=J*6;q[fe]=Number(I+n),q[fe+1]=Number(U+e),q[fe+2]=Number(F-ae+n),q[fe+3]=Number(D-Z+e),q[fe+4]=Number(F+n),q[fe+5]=Number(D+e),I=F+ae,U=D+Z}return q.map(J=>+J.toFixed(2))}function MR(n,e,t,s,r=0,i=0,o=0,a,c){const u=[],d=ol(n,e,t,s,r,i,o,a,c);if(d!=null)for(let f=0,h=d.length;f<h;f+=6)u.push("C",d[f],d[f+1],d[f+2],d[f+3],d[f+4],d[f+5]);return u.join(" ")}class Fe extends Cs{get start(){return this.points[0]||null}get end(){return this.points[this.points.length-1]||null}constructor(e){if(super(),e!=null){if(typeof e=="string")return Fe.parse(e);this.points=e.map(t=>M.create(t))}else this.points=[]}scale(e,t,s=new M){return this.points.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.points.forEach(s=>s.rotate(e,t)),this}translate(e,t){const s=M.create(e,t);return this.points.forEach(r=>r.translate(s.x,s.y)),this}round(e=0){return this.points.forEach(t=>t.round(e)),this}bbox(){if(this.points.length===0)return new G;let e=1/0,t=-1/0,s=1/0,r=-1/0;const i=this.points;for(let o=0,a=i.length;o<a;o+=1){const c=i[o],u=c.x,d=c.y;u<e&&(e=u),u>t&&(t=u),d<s&&(s=d),d>r&&(r=d)}return new G(e,s,t-e,r-s)}closestPoint(e){const t=this.closestPointLength(e);return this.pointAtLength(t)}closestPointLength(e){const t=this.points,s=t.length;if(s===0||s===1)return 0;let r=0,i=0,o=1/0;for(let a=0,c=s-1;a<c;a+=1){const u=new K(t[a],t[a+1]),d=u.length(),f=u.closestPointNormalizedLength(e),p=u.pointAt(f).squaredDistance(e);p<o&&(o=p,i=r+f*d),r+=d}return i}closestPointNormalizedLength(e){const t=this.length();return t===0?0:this.closestPointLength(e)/t}closestPointTangent(e){const t=this.closestPointLength(e);return this.tangentAtLength(t)}containsPoint(e){if(this.points.length===0)return!1;const t=M.clone(e),s=t.x,r=t.y,i=this.points,o=i.length;let a=o-1,c=0;for(let u=0;u<o;u+=1){const d=i[a],f=i[u];if(t.equals(d))return!0;const h=new K(d,f);if(h.containsPoint(e))return!0;if(r<=d.y&&r>f.y||r>d.y&&r<=f.y){const p=d.x-s>f.x-s?d.x-s:f.x-s;if(p>=0){const g=new M(s+p,r),m=new K(e,g);h.intersectsWithLine(m)&&(c+=1)}}a=u}return c%2===1}intersectsWithLine(e){const t=[];for(let s=0,r=this.points.length-1;s<r;s+=1){const i=this.points[s],o=this.points[s+1],a=e.intersectsWithLine(new K(i,o));a&&t.push(a)}return t.length>0?t:null}isDifferentiable(){for(let e=0,t=this.points.length-1;e<t;e+=1){const s=this.points[e],r=this.points[e+1];if(new K(s,r).isDifferentiable())return!0}return!1}length(){let e=0;for(let t=0,s=this.points.length-1;t<s;t+=1){const r=this.points[t],i=this.points[t+1];e+=r.distance(i)}return e}pointAt(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1||e<=0)return t[0].clone();if(e>=1)return t[s-1].clone();const i=this.length()*e;return this.pointAtLength(i)}pointAtLength(e){const t=this.points,s=t.length;if(s===0)return null;if(s===1)return t[0].clone();let r=!0;e<0&&(r=!1,e=-e);let i=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],f=t[u+1],h=new K(d,f),p=d.distance(f);if(e<=i+p)return h.pointAtLength((r?1:-1)*(e-i));i+=p}return(r?t[s-1]:t[0]).clone()}tangentAt(e){const s=this.points.length;if(s===0||s===1)return null;e<0&&(e=0),e>1&&(e=1);const i=this.length()*e;return this.tangentAtLength(i)}tangentAtLength(e){const t=this.points,s=t.length;if(s===0||s===1)return null;let r=!0;e<0&&(r=!1,e=-e);let i,o=0;for(let a=0,c=s-1;a<c;a+=1){const u=r?a:c-1-a,d=t[u],f=t[u+1],h=new K(d,f),p=d.distance(f);if(h.isDifferentiable()){if(e<=o+p)return h.tangentAtLength((r?1:-1)*(e-o));i=h}o+=p}if(i){const a=r?1:0;return i.tangentAt(a)}return null}simplify(e={}){const t=this.points;if(t.length<3)return this;const s=e.threshold||0;let r=0;for(;t[r+2];){const i=r,o=r+1,a=r+2,c=t[i],u=t[o],d=t[a];new K(c,d).closestPoint(u).distance(u)<=s?t.splice(o,1):r+=1}return this}toHull(){const e=this.points,t=e.length;if(t===0)return new Fe;let s=e[0];for(let h=1;h<t;h+=1)(e[h].y<s.y||e[h].y===s.y&&e[h].x>s.x)&&(s=e[h]);const r=[];for(let h=0;h<t;h+=1){let p=s.theta(e[h]);p===0&&(p=360),r.push([e[h],h,p])}if(r.sort((h,p)=>{let g=h[2]-p[2];return g===0&&(g=p[1]-h[1]),g}),r.length>2){const h=r[r.length-1];r.unshift(h)}const i={},o=[],a=h=>`${h[0].toString()}@${h[1]}`;for(;r.length!==0;){const h=r.pop(),p=h[0];if(i[a(h)])continue;let g=!1;for(;!g;)if(o.length<2)o.push(h),g=!0;else{const m=o.pop(),y=m[0],b=o.pop(),w=b[0],x=w.cross(y,p);if(x<0)o.push(b),o.push(m),o.push(h),g=!0;else if(x===0){const v=y.angleBetween(w,p);Math.abs(v-180)<1e-10||y.equals(p)||w.equals(y)?(i[a(m)]=y,o.push(b)):Math.abs((v+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 c,u=-1;for(let h=0,p=o.length;h<p;h+=1){const g=o[h][1];(c===void 0||g<c)&&(c=g,u=h)}let d=[];if(u>0){const h=o.slice(u),p=o.slice(0,u);d=h.concat(p)}else d=o;const f=[];for(let h=0,p=d.length;h<p;h+=1)f.push(d[h][0]);return new Fe(f)}equals(e){return e==null||e.points.length!==this.points.length?!1:e.points.every((t,s)=>t.equals(this.points[s]))}clone(){return new Fe(this.points.map(e=>e.clone()))}toJSON(){return this.points.map(e=>e.toJSON())}serialize(){return this.points.map(e=>`${e.serialize()}`).join(" ")}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPolyline=e})(Fe||(Fe={})),function(n){function e(t){const s=t.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=e}(Fe||(Fe={}));class je extends Cs{constructor(e,t,s,r){super(),this.PRECISION=3,this.start=M.create(e),this.controlPoint1=M.create(t),this.controlPoint2=M.create(s),this.end=M.create(r)}bbox(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end,i=e.x,o=e.y,a=t.x,c=t.y,u=s.x,d=s.y,f=r.x,h=r.y,p=[],g=[[],[]];let m,y,b,w,x,S,v,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*c+6*d,m=-3*o+9*c-9*d+3*h,b=3*c-3*o),Math.abs(m)<1e-12){if(Math.abs(y)<1e-12)continue;w=-b/y,w>0&&w<1&&p.push(w);continue}v=y*y-4*b*m,E=Math.sqrt(v),!(v<0)&&(x=(-y+E)/(2*m),x>0&&x<1&&p.push(x),S=(-y-E)/(2*m),S>0&&S<1&&p.push(S))}let C,O,A,k=p.length;const _=k;for(;k;)k-=1,w=p[k],A=1-w,C=A*A*A*i+3*A*A*w*a+3*A*w*w*u+w*w*w*f,g[0][k]=C,O=A*A*A*o+3*A*A*w*c+3*A*w*w*d+w*w*w*h,g[1][k]=O;p[_]=0,p[_+1]=1,g[0][_]=i,g[1][_]=o,g[0][_+1]=f,g[1][_+1]=h,p.length=_+2,g[0].length=_+2,g[1].length=_+2;const V=Math.min.apply(null,g[0]),L=Math.min.apply(null,g[1]),B=Math.max.apply(null,g[0]),N=Math.max.apply(null,g[1]);return new G(V,L,B-V,N-L)}closestPoint(e,t={}){return this.pointAtT(this.closestPointT(e,t))}closestPointLength(e,t={}){const s=this.getOptions(t);return this.lengthAtT(this.closestPointT(e,s),s)}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(!r)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){const s=this.getPrecision(t),r=this.getDivisions(t),i=Math.pow(10,-s);let o=null,a=0,c=0,u=0,d=0,f=0,h=null;const p=r.length;let g=p>0?1/p:0;for(r.forEach((m,y)=>{const b=m.start.distance(e),w=m.end.distance(e),x=b+w;(h==null||x<h)&&(o=m,a=y*g,c=(y+1)*g,u=b,d=w,h=x,f=m.endpointDistance())});;){const m=u?Math.abs(u-d)/u:0,y=d!=null?Math.abs(u-d)/d:0,b=m<i||y<i,w=u?u<f*i:!0,x=d?d<f*i:!0;if(b||(w||x))return u<=d?a:c;const v=o.divide(.5);g/=2;const E=v[0].start.distance(e),C=v[0].end.distance(e),O=E+C,A=v[1].start.distance(e),k=v[1].end.distance(e),_=A+k;O<=_?(o=v[0],c-=g,u=E,d=C):(o=v[1],a+=g,u=A,d=k)}}closestPointTangent(e,t={}){return this.tangentAtT(this.closestPointT(e,t))}containsPoint(e,t={}){return this.toPolyline(t).containsPoint(e)}divideAt(e,t={}){if(e<=0)return this.divideAtT(0);if(e>=1)return this.divideAtT(1);const s=this.tAt(e,t);return this.divideAtT(s)}divideAtLength(e,t={}){const s=this.tAtLength(e,t);return this.divideAtT(s)}divide(e){return this.divideAtT(e)}divideAtT(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return[new je(t,t,t,t),new je(t,s,r,i)];if(e>=1)return[new je(t,s,r,i),new je(i,i,i,i)];const o=this.getSkeletonPoints(e),a=o.startControlPoint1,c=o.startControlPoint2,u=o.divider,d=o.dividerControlPoint1,f=o.dividerControlPoint2;return[new je(t,a,c,u),new je(u,d,f,i)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(e){const t=this.start,s=this.controlPoint1,r=this.controlPoint2,i=this.end;if(e<=0)return{startControlPoint1:t.clone(),startControlPoint2:t.clone(),divider:t.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:r.clone()};if(e>=1)return{startControlPoint1:s.clone(),startControlPoint2:r.clone(),divider:i.clone(),dividerControlPoint1:i.clone(),dividerControlPoint2:i.clone()};const o=new K(t,s).pointAt(e),a=new K(s,r).pointAt(e),c=new K(r,i).pointAt(e),u=new K(o,a).pointAt(e),d=new K(a,c).pointAt(e),f=new K(u,d).pointAt(e);return{startControlPoint1:o,startControlPoint2:u,divider:f,dividerControlPoint1:d,dividerControlPoint2:c}}getSubdivisions(e={}){const t=this.getPrecision(e);let s=[new je(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(t===0)return s;let r=this.endpointDistance();const i=Math.pow(10,-t);let o=0;for(;;){o+=1;const a=[];s.forEach(d=>{const f=d.divide(.5);a.push(f[0],f[1])});const c=a.reduce((d,f)=>d+f.endpointDistance(),0),u=c!==0?(c-r)/c:0;if(o>1&&u<i)return a;s=a,r=c}}length(e={}){return this.getDivisions(e).reduce((s,r)=>s+r.endpointDistance(),0)}lengthAtT(e,t={}){if(e<=0)return 0;const s=t.precision===void 0?this.PRECISION:t.precision;return this.divide(e)[0].length({precision:s})}pointAt(e,t={}){if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.tAt(e,t);return this.pointAtT(s)}pointAtLength(e,t={}){const s=this.tAtLength(e,t);return this.pointAtT(s)}pointAtT(e){return e<=0?this.start.clone():e>=1?this.end.clone():this.getSkeletonPoints(e).divider}isDifferentiable(){const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}tangentAt(e,t={}){if(!this.isDifferentiable())return null;e<0?e=0:e>1&&(e=1);const s=this.tAt(e,t);return this.tangentAtT(s)}tangentAtLength(e,t={}){if(!this.isDifferentiable())return null;const s=this.tAtLength(e,t);return this.tangentAtT(s)}tangentAtT(e){if(!this.isDifferentiable())return null;e<0&&(e=0),e>1&&(e=1);const t=this.getSkeletonPoints(e),s=t.startControlPoint2,r=t.dividerControlPoint1,i=t.divider,o=new K(s,r);return o.translate(i.x-s.x,i.y-s.y),o}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getDivisions(e={}){if(e.subdivisions!=null)return e.subdivisions;const t=this.getPrecision(e);return this.getSubdivisions({precision:t})}getOptions(e={}){const t=this.getPrecision(e),s=this.getDivisions(e);return{precision:t,subdivisions:s}}tAt(e,t={}){if(e<=0)return 0;if(e>=1)return 1;const s=this.getOptions(t),i=this.length(s)*e;return this.tAtLength(i,s)}tAtLength(e,t={}){let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getDivisions(t),o={precision:r,subdivisions:i};let a=null,c,u,d=0,f=0,h=0;const p=i.length;let g=p>0?1/p:0;for(let b=0;b<p;b+=1){const w=s?b:p-1-b,x=i[b],S=x.endpointDistance();if(e<=h+S){a=x,c=w*g,u=(w+1)*g,d=s?e-h:S+h-e,f=s?S+h-e:e-h;break}h+=S}if(a==null)return s?1:0;const m=this.length(o),y=Math.pow(10,-r);for(;;){let b;if(b=m!==0?d/m:0,b<y)return c;if(b=m!==0?f/m:0,b<y)return u;let w,x;const S=a.divide(.5);g/=2;const v=S[0].endpointDistance(),E=S[1].endpointDistance();d<=v?(a=S[0],u-=g,w=d,x=v-w):(a=S[1],c+=g,w=d-v,x=E-w),d=w,f=x}}toPoints(e={}){const t=this.getDivisions(e),s=[t[0].start.clone()];return t.forEach(r=>s.push(r.end.clone())),s}toPolyline(e={}){return new Fe(this.toPoints(e))}scale(e,t,s){return this.start.scale(e,t,s),this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.start.rotate(e,t),this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.start.translate(e,t),this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.start.translate(e),this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return e!=null&&this.start.equals(e.start)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)&&this.end.equals(e.end)}clone(){return new je(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 e(t){return t!=null&&t instanceof n}n.isCurve=e})(je||(je={})),function(n){function e(r){const i=r.length,o=[],a=[];let c=2;o[0]=r[0]/c;for(let u=1;u<i;u+=1)a[u]=1/c,c=(u<i-1?4:3.5)-a[u],o[u]=(r[u]-o[u-1])/c;for(let u=1;u<i;u+=1)o[i-u-1]-=a[i-u]*o[i-u];return o}function t(r){const i=r.map(h=>M.clone(h)),o=[],a=[],c=i.length-1;if(c===1)return o[0]=new M((2*i[0].x+i[1].x)/3,(2*i[0].y+i[1].y)/3),a[0]=new M(2*o[0].x-i[0].x,2*o[0].y-i[0].y),[o,a];const u=[];for(let h=1;h<c-1;h+=1)u[h]=4*i[h].x+2*i[h+1].x;u[0]=i[0].x+2*i[1].x,u[c-1]=(8*i[c-1].x+i[c].x)/2;const d=e(u);for(let h=1;h<c-1;h+=1)u[h]=4*i[h].y+2*i[h+1].y;u[0]=i[0].y+2*i[1].y,u[c-1]=(8*i[c-1].y+i[c].y)/2;const f=e(u);for(let h=0;h<c;h+=1)o.push(new M(d[h],f[h])),h<c-1?a.push(new M(2*i[h+1].x-d[h+1],2*i[h+1].y-f[h+1])):a.push(new M((i[c].x+d[c-1])/2,(i[c].y+f[c-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=t(r),o=[];for(let a=0,c=i[0].length;a<c;a+=1){const u=new M(i[0][a].x,i[0][a].y),d=new M(i[1][a].x,i[1][a].y);o.push(new n(r[a],u,d,r[a+1]))}return o}n.throughPoints=s}(je||(je={}));class al extends Cs{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(e,t){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(e);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(e,t){if(e<=0)return 0;const s=this.length();return e>=1?s:s*e}divideAtT(e){if(this.divideAt)return this.divideAt(e);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(e){if(this.pointAt)return this.pointAt(e);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(e){if(this.tangentAt)return this.tangentAt(e);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class mt extends al{constructor(e,t){super(),K.isLine(e)?this.endPoint=e.end.clone().round(2):this.endPoint=M.create(e,t).round(2)}get type(){return"L"}get line(){return new K(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[new mt(t[0]),new mt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[new mt(t[0]),new mt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return this.previousSegment==null?!1:!this.start.equals(this.end)}clone(){return new mt(this.end)}scale(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(K.isLine(r))return new n(r);if(M.isPointLike(r))return s===1?new n(r):t.map(o=>new n(o));if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];i.push(new n(a,c))}return i}n.create=e})(mt||(mt={}));class Jr extends al{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 K(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(e){return this.line.closestPoint(e)}closestPointLength(e){return this.line.closestPointLength(e)}closestPointNormalizedLength(e){return this.line.closestPointNormalizedLength(e)}closestPointTangent(e){return this.line.closestPointTangent(e)}length(){return this.line.length()}divideAt(e){const t=this.line.divideAt(e);return[t[1].isDifferentiable()?new mt(t[0]):this.clone(),new mt(t[1])]}divideAtLength(e){const t=this.line.divideAtLength(e);return[t[1].isDifferentiable()?new mt(t[0]):this.clone(),new mt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.line.pointAt(e)}pointAtLength(e){return this.line.pointAtLength(e)}tangentAt(e){return this.line.tangentAt(e)}tangentAtLength(e){return this.line.tangentAtLength(e)}isDifferentiable(){return!this.previousSegment||!this.subpathStartSegment?!1:!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(e){return this.type===e.type&&this.start.equals(e.start)&&this.end.equals(e.end)}clone(){return new Jr}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(n){function e(){return new n}n.create=e})(Jr||(Jr={}));class Kr extends al{constructor(e,t){super(),this.isVisible=!1,this.isSubpathStart=!0,K.isLine(e)||je.isCurve(e)?this.endPoint=e.end.clone().round(2):this.endPoint=M.create(e,t).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(e,t,s){return this.end.scale(e,t,s),this}rotate(e,t){return this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?this.end.translate(e,t):this.end.translate(e),this}clone(){return new Kr(this.end)}equals(e){return this.type===e.type&&this.end.equals(e.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const e=this.end;return`${this.type} ${e.x} ${e.y}`}}(function(n){function e(...t){const s=t.length,r=t[0];if(K.isLine(r))return new n(r);if(je.isCurve(r))return new n(r);if(M.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(t[a])):o.push(new mt(t[a]));return o}if(s===2)return new n(+t[0],+t[1]);const i=[];for(let o=0;o<s;o+=2){const a=+t[o],c=+t[o+1];o===0?i.push(new n(a,c)):i.push(new mt(a,c))}return i}n.create=e})(Kr||(Kr={}));class Xt extends al{constructor(e,t,s,r,i,o){super(),je.isCurve(e)?(this.controlPoint1=e.controlPoint1.clone().round(2),this.controlPoint2=e.controlPoint2.clone().round(2),this.endPoint=e.end.clone().round(2)):typeof e=="number"?(this.controlPoint1=new M(e,t).round(2),this.controlPoint2=new M(s,r).round(2),this.endPoint=new M(i,o).round(2)):(this.controlPoint1=M.create(e).round(2),this.controlPoint2=M.create(t).round(2),this.endPoint=M.create(s).round(2))}get type(){return"C"}get curve(){return new je(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(e){return this.curve.closestPoint(e)}closestPointLength(e){return this.curve.closestPointLength(e)}closestPointNormalizedLength(e){return this.curve.closestPointNormalizedLength(e)}closestPointTangent(e){return this.curve.closestPointTangent(e)}length(){return this.curve.length()}divideAt(e,t={}){const s=this.curve.divideAt(e,t);return[new Xt(s[0]),new Xt(s[1])]}divideAtLength(e,t={}){const s=this.curve.divideAtLength(e,t);return[new Xt(s[0]),new Xt(s[1])]}divideAtT(e){const t=this.curve.divideAtT(e);return[new Xt(t[0]),new Xt(t[1])]}getSubdivisions(){return[]}pointAt(e){return this.curve.pointAt(e)}pointAtLength(e){return this.curve.pointAtLength(e)}tangentAt(e){return this.curve.tangentAt(e)}tangentAtLength(e){return this.curve.tangentAtLength(e)}isDifferentiable(){if(!this.previousSegment)return!1;const e=this.start,t=this.controlPoint1,s=this.controlPoint2,r=this.end;return!(e.equals(t)&&t.equals(s)&&s.equals(r))}scale(e,t,s){return this.controlPoint1.scale(e,t,s),this.controlPoint2.scale(e,t,s),this.end.scale(e,t,s),this}rotate(e,t){return this.controlPoint1.rotate(e,t),this.controlPoint2.rotate(e,t),this.end.rotate(e,t),this}translate(e,t){return typeof e=="number"?(this.controlPoint1.translate(e,t),this.controlPoint2.translate(e,t),this.end.translate(e,t)):(this.controlPoint1.translate(e),this.controlPoint2.translate(e),this.end.translate(e)),this}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)&&this.controlPoint1.equals(e.controlPoint1)&&this.controlPoint2.equals(e.controlPoint2)}clone(){return new Xt(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 e=this.controlPoint1,t=this.controlPoint2,s=this.end;return[this.type,e.x,e.y,t.x,t.y,s.x,s.y].join(" ")}}(function(n){function e(...t){const s=t.length,r=t[0];if(je.isCurve(r))return new n(r);if(M.isPointLike(r)){if(s===3)return new n(t[0],t[1],t[2]);const o=[];for(let a=0;a<s;a+=3)o.push(new n(t[a],t[a+1],t[a+2]));return o}if(s===6)return new n(t[0],t[1],t[2],t[3],t[4],t[5]);const i=[];for(let o=0;o<s;o+=6)i.push(new n(t[o],t[o+1],t[o+2],t[o+3],t[o+4],t[o+5]));return i}n.create=e})(Xt||(Xt={}));function ll(n,e,t){return{x:n*Math.cos(t)-e*Math.sin(t),y:n*Math.sin(t)+e*Math.cos(t)}}function Gy(n,e,t,s,r,i){const o=.3333333333333333,a=2/3;return[o*n+a*t,o*e+a*s,o*r+a*t,o*i+a*s,r,i]}function Wy(n,e,t,s,r,i,o,a,c,u){const d=Math.PI*120/180,f=Math.PI/180*(+r||0);let h=[],p,g,m,y,b;if(u)g=u[0],m=u[1],y=u[2],b=u[3];else{p=ll(n,e,-f),n=p.x,e=p.y,p=ll(a,c,-f),a=p.x,c=p.y;const B=(n-a)/2,N=(e-c)/2;let P=B*B/(t*t)+N*N/(s*s);P>1&&(P=Math.sqrt(P),t=P*t,s=P*s);const T=t*t,j=s*s,Y=(i===o?-1:1)*Math.sqrt(Math.abs((T*j-T*N*N-j*B*B)/(T*N*N+j*B*B)));y=Y*t*N/s+(n+a)/2,b=Y*-s*B/t+(e+c)/2,g=Math.asin((e-b)/s),m=Math.asin((c-b)/s),g=n<y?Math.PI-g:g,m=a<y?Math.PI-m:m,g<0&&(g=Math.PI*2+g),m<0&&(m=Math.PI*2+m),o&&g>m&&(g-=Math.PI*2),!o&&m>g&&(m-=Math.PI*2)}let w=m-g;if(Math.abs(w)>d){const B=m,N=a,P=c;m=g+d*(o&&m>g?1:-1),a=y+t*Math.cos(m),c=b+s*Math.sin(m),h=Wy(a,c,t,s,r,0,o,N,P,[m,B,y,b])}w=m-g;const x=Math.cos(g),S=Math.sin(g),v=Math.cos(m),E=Math.sin(m),C=Math.tan(w/4),O=4/3*(t*C),A=4/3*(s*C),k=[n,e],_=[n+O*S,e-A*x],V=[a+O*E,c-A*v],L=[a,c];if(_[0]=2*k[0]-_[0],_[1]=2*k[1]-_[1],u)return[_,V,L].concat(h);{h=[_,V,L].concat(h).join().split(",");const B=[],N=h.length;for(let P=0;P<N;P+=1)B[P]=P%2?ll(+h[P-1],+h[P],f).y:ll(+h[P],+h[P+1],f).x;return B}}function PR(n){if(!n)return null;const e=`
41
+ \v\f\r   ᠎              \u2028\u2029`,t=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),s=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"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(t,(o,a,c)=>{const u=[];let d=a.toLowerCase();c.replace(s,(h,p)=>(p&&u.push(+p),h)),d==="m"&&u.length>2&&(i.push([a,...u.splice(0,2)]),d="l",a=a==="m"?"l":"L");const f=r[d];for(;u.length>=f&&(i.push([a,...u.splice(0,f)]),!!f););return o}),i}function NR(n){const e=PR(n);if(!e||!e.length)return[["M",0,0]];let t=0,s=0,r=0,i=0;const o=[];for(let a=0,c=e.length;a<c;a+=1){const u=[];o.push(u);const d=e[a],f=d[0];if(f!==f.toUpperCase())switch(u[0]=f.toUpperCase(),u[0]){case"A":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+d[6]+t,u[7]=+d[7]+s;break;case"V":u[1]=+d[1]+s;break;case"H":u[1]=+d[1]+t;break;case"M":r=+d[1]+t,i=+d[2]+s;for(let h=1,p=d.length;h<p;h+=1)u[h]=+d[h]+(h%2?t:s);break;default:for(let h=1,p=d.length;h<p;h+=1)u[h]=+d[h]+(h%2?t:s);break}else for(let h=0,p=d.length;h<p;h+=1)u[h]=d[h];switch(u[0]){case"Z":t=+r,s=+i;break;case"H":t=u[1];break;case"V":s=u[1];break;case"M":r=u[u.length-2],i=u[u.length-1],t=u[u.length-2],s=u[u.length-1];break;default:t=u[u.length-2],s=u[u.length-1];break}}return o}function AR(n){const e=NR(n),t={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function s(c,u,d){let f,h;if(!c)return["C",u.x,u.y,u.x,u.y,u.x,u.y];switch(c[0]in{T:1,Q:1}||(u.qx=null,u.qy=null),c[0]){case"M":u.X=c[1],u.Y=c[2];break;case"A":return parseFloat(c[1])===0||parseFloat(c[2])===0?["L",c[6],c[7]]:["C"].concat(Wy.apply(0,[u.x,u.y].concat(c.slice(1))));case"S":return d==="C"||d==="S"?(f=u.x*2-u.bx,h=u.y*2-u.by):(f=u.x,h=u.y),["C",f,h].concat(c.slice(1));case"T":return d==="Q"||d==="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(Gy(u.x,u.y,u.qx,u.qy,c[1],c[2]));case"Q":return u.qx=c[1],u.qy=c[2],["C"].concat(Gy(u.x,u.y,c[1],c[2],c[3],c[4]));case"H":return["L"].concat(c[1],u.y);case"V":return["L"].concat(u.x,c[1])}return c}function r(c,u){if(c[u].length>7){c[u].shift();const d=c[u];for(;d.length;)i[u]="A",u+=1,c.splice(u,0,["C"].concat(d.splice(0,6)));c.splice(u,1),a=e.length}}const i=[];let o="",a=e.length;for(let c=0;c<a;c+=1){let u="";e[c]&&(u=e[c][0]),u!=="C"&&(i[c]=u,c>0&&(o=i[c-1])),e[c]=s(e[c],t,o),i[c]!=="A"&&u==="C"&&(i[c]="C"),r(e,c);const d=e[c],f=d.length;t.x=d[f-2],t.y=d[f-1],t.bx=parseFloat(d[f-4])||t.x,t.by=parseFloat(d[f-3])||t.y}return(!e[0][0]||e[0][0]!=="M")&&e.unshift(["M",0,0]),e}function _R(n){return AR(n).map(e=>e.map(t=>typeof t=="string"?t:Se.round(t,2))).join(",").split(",").join(" ")}class re extends Cs{constructor(e){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(e))if(K.isLine(e[0])||je.isCurve(e[0])){let t=null;e.forEach((r,i)=>{i===0&&this.appendSegment(re.createSegment("M",r.start)),t!=null&&!t.end.equals(r.start)&&this.appendSegment(re.createSegment("M",r.start)),K.isLine(r)?this.appendSegment(re.createSegment("L",r.end)):je.isCurve(r)&&this.appendSegment(re.createSegment("C",r.controlPoint1,r.controlPoint2,r.end)),t=r})}else e.forEach(s=>{s.isSegment&&this.appendSegment(s)});else e!=null&&(K.isLine(e)?(this.appendSegment(re.createSegment("M",e.start)),this.appendSegment(re.createSegment("L",e.end))):je.isCurve(e)?(this.appendSegment(re.createSegment("M",e.start)),this.appendSegment(re.createSegment("C",e.controlPoint1,e.controlPoint2,e.end))):Fe.isPolyline(e)?e.points&&e.points.length&&e.points.forEach((t,s)=>{const r=s===0?re.createSegment("M",t):re.createSegment("L",t);this.appendSegment(r)}):e.isSegment&&this.appendSegment(e))}get start(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=0;s<t;s+=1){const r=e[s];if(r.isVisible)return r.start}return e[t-1].end}get end(){const e=this.segments,t=e.length;if(t===0)return null;for(let s=t-1;s>=0;s-=1){const r=e[s];if(r.isVisible)return r.end}return e[t-1].end}moveTo(...e){return this.appendSegment(Kr.create.call(null,...e))}lineTo(...e){return this.appendSegment(mt.create.call(null,...e))}curveTo(...e){return this.appendSegment(Xt.create.call(null,...e))}arcTo(e,t,s,r,i,o,a){const c=this.end||new M,u=typeof o=="number"?ol(c.x,c.y,e,t,s,r,i,o,a):ol(c.x,c.y,e,t,s,r,i,o.x,o.y);if(u!=null)for(let d=0,f=u.length;d<f;d+=6)this.curveTo(u[d],u[d+1],u[d+2],u[d+3],u[d+4],u[d+5]);return this}quadTo(e,t,s,r){const i=this.end||new M,o=["M",i.x,i.y];if(typeof e=="number")o.push("Q",e,t,s,r);else{const c=t;o.push("Q",e.x,e.y,c.x,c.y)}const a=re.parse(o.join(" "));return this.appendSegment(a.segments.slice(1)),this}close(){return this.appendSegment(Jr.create())}drawPoints(e,t={}){const s=Hy(e,t),r=re.parse(s);r&&r.segments&&this.appendSegment(r.segments)}bbox(){const e=this.segments,t=e.length;if(t===0)return null;let s;for(let i=0;i<t;i+=1){const o=e[i];if(o.isVisible){const a=o.bbox();a!=null&&(s=s?s.union(a):a)}}if(s!=null)return s;const r=e[t-1];return new G(r.end.x,r.end.y,0,0)}appendSegment(e){const t=this.segments.length;let s=t!==0?this.segments[t-1]:null,r;const i=null;if(Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const c=e[o];r=this.prepareSegment(c,s,i),this.segments.push(r),s=r}else e!=null&&e.isSegment&&(r=this.prepareSegment(e,s,i),this.segments.push(r));return this}insertSegment(e,t){const s=this.segments.length;if(e<0&&(e=s+e+1),e>s||e<0)throw new Error("Index out of range.");let r,i=null,o=null;if(s!==0&&(e>=1?(i=this.segments[e-1],o=i.nextSegment):(i=null,o=this.segments[0])),!Array.isArray(t))r=this.prepareSegment(t,i,o),this.segments.splice(e,0,r);else for(let a=0,c=t.length;a<c;a+=1){const u=t[a];r=this.prepareSegment(u,i,o),this.segments.splice(e+a,0,r),i=r}return this}removeSegment(e){const t=this.fixIndex(e),s=this.segments.splice(t,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(e,t){const s=this.fixIndex(e);let r;const i=this.segments[s];let o=i.previousSegment;const a=i.nextSegment;let c=i.isSubpathStart;if(!Array.isArray(t))r=this.prepareSegment(t,o,a),this.segments.splice(s,1,r),c&&r.isSubpathStart&&(c=!1);else{this.segments.splice(e,1);for(let u=0,d=t.length;u<d;u+=1){const f=t[u];r=this.prepareSegment(f,o,a),this.segments.splice(e+u,0,r),o=r,c&&r.isSubpathStart&&(c=!1)}}c&&a&&this.updateSubpathStartSegment(a)}getSegment(e){const t=this.fixIndex(e);return this.segments[t]}fixIndex(e){const t=this.segments.length;if(t===0)throw new Error("Path has no segments.");let s=e;for(;s<0;)s=t+s;if(s>=t||s<0)throw new Error("Index out of range.");return s}segmentAt(e,t={}){const s=this.segmentIndexAt(e,t);return s?this.getSegment(s):null}segmentAtLength(e,t={}){const s=this.segmentIndexAtLength(e,t);return s?this.getSegment(s):null}segmentIndexAt(e,t={}){if(this.segments.length===0)return null;const s=Se.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.segmentIndexAtLength(o,r)}segmentIndexAtLength(e,t={}){const s=this.segments.length;if(s===0)return null;let r=!0;e<0&&(r=!1,e=-e);const i=this.getPrecision(t),o=this.getSubdivisions(t);let a=0,c=null;for(let u=0;u<s;u+=1){const d=r?u:s-1-u,f=this.segments[d],h=o[d],p=f.length({precision:i,subdivisions:h});if(f.isVisible){if(e<=a+p)return d;c=d}a+=p}return c}getSegmentSubdivisions(e={}){const t=this.getPrecision(e),s=[];for(let r=0,i=this.segments.length;r<i;r+=1){const a=this.segments[r].getSubdivisions({precision:t});s.push(a)}return s}updateSubpathStartSegment(e){let t=e.previousSegment,s=e;for(;s&&!s.isSubpathStart;)t!=null?s.subpathStartSegment=t.subpathStartSegment:s.subpathStartSegment=null,t=s,s=s.nextSegment}prepareSegment(e,t,s){e.previousSegment=t,e.nextSegment=s,t!=null&&(t.nextSegment=e),s!=null&&(s.previousSegment=e);let r=e;return e.isSubpathStart&&(e.subpathStartSegment=e,r=s),r!=null&&this.updateSubpathStartSegment(r),e}closestPoint(e,t={}){const s=this.closestPointT(e,t);return s?this.pointAtT(s):null}closestPointLength(e,t={}){const s=this.getOptions(t),r=this.closestPointT(e,s);return r?this.lengthAtT(r,s):0}closestPointNormalizedLength(e,t={}){const s=this.getOptions(t),r=this.closestPointLength(e,s);if(r===0)return 0;const i=this.length(s);return i===0?0:r/i}closestPointT(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isVisible){const f=u.closestPointT(e,{precision:s,subdivisions:d}),h=u.pointAtT(f),p=Se.squaredLength(h,e);p<o&&(i={segmentIndex:a,value:f},o=p)}}return i||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(e,t={}){if(this.segments.length===0)return null;const s=this.getPrecision(t),r=this.getSubdivisions(t);let i,o=1/0;for(let a=0,c=this.segments.length;a<c;a+=1){const u=this.segments[a],d=r[a];if(u.isDifferentiable()){const f=u.closestPointT(e,{precision:s,subdivisions:d}),h=u.pointAtT(f),p=Se.squaredLength(h,e);p<o&&(i=u.tangentAtT(f),o=p)}}return i||null}containsPoint(e,t={}){const s=this.toPolylines(t);if(!s)return!1;let r=0;for(let i=0,o=s.length;i<o;i+=1)s[i].containsPoint(e)&&(r+=1);return r%2===1}pointAt(e,t={}){if(this.segments.length===0)return null;if(e<=0)return this.start.clone();if(e>=1)return this.end.clone();const s=this.getOptions(t),i=this.length(s)*e;return this.pointAtLength(i,s)}pointAtLength(e,t={}){if(this.segments.length===0)return null;if(e===0)return this.start.clone();let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let u=0,d=this.segments.length;u<d;u+=1){const f=s?u:d-1-u,h=this.segments[f],p=i[f],g=h.length({precision:r,subdivisions:p});if(h.isVisible){if(e<=a+g)return h.pointAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:p});o=h}a+=g}return o?s?o.end:o.start:this.segments[this.segments.length-1].end.clone()}pointAtT(e){const t=this.segments,s=t.length;if(s===0)return null;const r=e.segmentIndex;if(r<0)return t[0].pointAtT(0);if(r>=s)return t[s-1].pointAtT(1);const i=Se.clamp(e.value,0,1);return t[r].pointAtT(i)}divideAt(e,t={}){if(this.segments.length===0)return null;const s=Se.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.divideAtLength(o,r)}divideAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o=0,a,c,u,d,f;for(let v=0,E=this.segments.length;v<E;v+=1){const C=s?v:E-1-v,O=this.getSegment(C),A=i[C],k={precision:r,subdivisions:A},_=O.length(k);if(O.isDifferentiable()&&(u=O,d=C,e<=o+_)){c=C,a=O.divideAtLength((s?1:-1)*(e-o),k);break}o+=_}if(!u)return null;a||(c=d,f=s?1:0,a=u.divideAtT(f));const h=this.clone(),p=c;h.replaceSegment(p,a);const g=p;let m=p+1,y=p+2;a[0].isDifferentiable()||(h.removeSegment(g),m-=1,y-=1);const b=h.getSegment(m).start;h.insertSegment(m,re.createSegment("M",b)),y+=1,a[1].isDifferentiable()||(h.removeSegment(y-1),y-=1);const w=y-g-1;for(let v=y,E=h.segments.length;v<E;v+=1){const C=this.getSegment(v-w),O=h.getSegment(v);if(O.type==="Z"&&!C.subpathStartSegment.end.equals(O.subpathStartSegment.end)){const A=re.createSegment("L",C.end);h.replaceSegment(v,A)}}const x=new re(h.segments.slice(0,m)),S=new re(h.segments.slice(m));return[x,S]}intersectsWithLine(e,t={}){const s=this.toPolylines(t);if(s==null)return null;let r=null;for(let i=0,o=s.length;i<o;i+=1){const a=s[i],c=e.intersect(a);c&&(r==null&&(r=[]),Array.isArray(c)?r.push(...c):r.push(c))}return r}isDifferentiable(){for(let e=0,t=this.segments.length;e<t;e+=1)if(this.segments[e].isDifferentiable())return!0;return!1}isValid(){const e=this.segments;return e.length===0||e[0].type==="M"}length(e={}){if(this.segments.length===0)return 0;const t=this.getSubdivisions(e);let s=0;for(let r=0,i=this.segments.length;r<i;r+=1){const o=this.segments[r],a=t[r];s+=o.length({subdivisions:a})}return s}lengthAtT(e,t={}){const s=this.segments.length;if(s===0)return 0;let r=e.segmentIndex;if(r<0)return 0;let i=Se.clamp(e.value,0,1);r>=s&&(r=s-1,i=1);const o=this.getPrecision(t),a=this.getSubdivisions(t);let c=0;for(let f=0;f<r;f+=1){const h=this.segments[f],p=a[f];c+=h.length({precision:o,subdivisions:p})}const u=this.segments[r],d=a[r];return c+=u.lengthAtT(i,{precision:o,subdivisions:d}),c}tangentAt(e,t={}){if(this.segments.length===0)return null;const s=Se.clamp(e,0,1),r=this.getOptions(t),o=this.length(r)*s;return this.tangentAtLength(o,r)}tangentAtLength(e,t={}){if(this.segments.length===0)return null;let s=!0;e<0&&(s=!1,e=-e);const r=this.getPrecision(t),i=this.getSubdivisions(t);let o,a=0;for(let c=0,u=this.segments.length;c<u;c+=1){const d=s?c:u-1-c,f=this.segments[d],h=i[d],p=f.length({precision:r,subdivisions:h});if(f.isDifferentiable()){if(e<=a+p)return f.tangentAtLength((s?1:-1)*(e-a),{precision:r,subdivisions:h});o=f}a+=p}if(o){const c=s?1:0;return o.tangentAtT(c)}return null}tangentAtT(e){const t=this.segments.length;if(t===0)return null;const s=e.segmentIndex;if(s<0)return this.segments[0].tangentAtT(0);if(s>=t)return this.segments[t-1].tangentAtT(1);const r=Se.clamp(e.value,0,1);return this.segments[s].tangentAtT(r)}getPrecision(e={}){return e.precision==null?this.PRECISION:e.precision}getSubdivisions(e={}){if(e.segmentSubdivisions==null){const t=this.getPrecision(e);return this.getSegmentSubdivisions({precision:t})}return e.segmentSubdivisions}getOptions(e={}){const t=this.getPrecision(e),s=this.getSubdivisions(e);return{precision:t,segmentSubdivisions:s}}toPoints(e={}){const t=this.segments,s=t.length;if(s===0)return null;const r=this.getSubdivisions(e),i=[];let o=[];for(let a=0;a<s;a+=1){const c=t[a];if(c.isVisible){const u=r[a];u.length>0?u.forEach(d=>o.push(d.start)):o.push(c.start)}else o.length>0&&(o.push(t[a-1].end),i.push(o),o=[])}return o.length>0&&(o.push(this.end),i.push(o)),i}toPolylines(e={}){const t=this.toPoints(e);return t?t.map(s=>new Fe(s)):null}scale(e,t,s){return this.segments.forEach(r=>r.scale(e,t,s)),this}rotate(e,t){return this.segments.forEach(s=>s.rotate(e,t)),this}translate(e,t){return typeof e=="number"?this.segments.forEach(s=>s.translate(e,t)):this.segments.forEach(s=>s.translate(e)),this}clone(){const e=new re;return this.segments.forEach(t=>e.appendSegment(t.clone())),e}equals(e){if(e==null)return!1;const t=this.segments,s=e.segments,r=t.length;if(s.length!==r)return!1;for(let i=0;i<r;i+=1){const o=t[i],a=s[i];if(o.type!==a.type||!o.equals(a))return!1}return!0}toJSON(){return this.segments.map(e=>e.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(e=>e.serialize()).join(" ")}toString(){return this.serialize()}}(function(n){function e(t){return t!=null&&t instanceof n}n.isPath=e})(re||(re={})),function(n){function e(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,c=o.length;a<c;a+=1){const u=o[a],d=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,f=u.match(d);if(f!=null){const h=f[0],p=f.slice(1).map(m=>+m),g=t.call(null,h,...p);r.appendSegment(g)}}return r}n.parse=e;function t(s,...r){if(s==="M")return Kr.create.call(null,...r);if(s==="L")return mt.create.call(null,...r);if(s==="C")return Xt.create.call(null,...r);if(s==="z"||s==="Z")return Jr.create();throw new Error(`Invalid path segment type "${s}"`)}n.createSegment=t}(re||(re={})),function(n){n.normalize=_R,n.isValid=ER,n.drawArc=MR,n.drawPoints=Hy,n.arcToCurves=ol}(re||(re={}));class Ue{constructor(e){this.options=Object.assign({},e),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(e,t,s=!1){if(typeof e=="object"){Object.entries(e).forEach(([o,a])=>{this.register(o,a,t)});return}this.exist(e)&&!s&&!bs.isApplyingHMR()&&this.onDuplicated(e);const r=this.options.process,i=r?se(r,this,e,t):t;return this.data[e]=i,i}unregister(e){const t=e?this.data[e]:null;return delete this.data[e],t}get(e){return e?this.data[e]:null}exist(e){return e?this.data[e]!=null:!1}onDuplicated(e){try{throw this.options.onConflict&&se(this.options.onConflict,this,e),new Error(`${aa(this.options.type)} with name '${e}' already registered.`)}catch(t){throw t}}onNotFound(e,t){throw new Error(this.getSpellingSuggestion(e,t))}getSpellingSuggestion(e,t){const s=this.getSpellingSuggestionForName(e),r=t?`${t} ${NP(this.options.type)}`:this.options.type;return`${aa(r)} with name '${e}' does not exist.${s?` Did you mean '${s}'?`:""}`}getSpellingSuggestionForName(e){return _D(e,Object.keys(this.data),t=>t)}}(function(n){function e(t){return new n(t)}n.create=e})(Ue||(Ue={}));const TR=Object.freeze(Object.defineProperty({__proto__:null,dot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.thickness*e.sx,s=e.thickness*e.sy;pe(n,{width:t,height:s,rx:t,ry:s,fill:e.color})}},doubleMesh:[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(n,e){let t;const s=e.factor||1,r=e.width*s,i=e.height*s,o=e.thickness;r-o>=0&&i-o>=0?t=["M",r,0,"H0 M0 0 V0",i].join(" "):t="M 0 0 0 0",e.width=r,e.height=i,pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}],fixedDot:{color:"#aaaaaa",thickness:1,markup:"rect",update(n,e){const t=e.sx<=1?e.thickness*e.sx:e.thickness;pe(n,{width:t,height:t,rx:t,ry:t,fill:e.color})}},mesh:{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(n,e){let t;const s=e.width,r=e.height,i=e.thickness;s-i>=0&&r-i>=0?t=["M",s,0,"H0 M0 0 V0",r].join(" "):t="M 0 0 0 0",pe(n,{d:t,stroke:e.color,"stroke-width":e.thickness})}}},Symbol.toStringTag,{value:"Module"}));class Ss{constructor(){this.patterns={},this.root=oe.create(Qa(),{width:"100%",height:"100%"},[yn("defs")]).node}add(e,t){const s=this.root.childNodes[0];s&&s.appendChild(t),this.patterns[e]=t,oe.create("rect",{width:"100%",height:"100%",fill:`url(#${e})`}).appendTo(this.root)}get(e){return this.patterns[e]}has(e){return this.patterns[e]!=null}}(function(n){n.presets=TR,n.registry=Ue.create({type:"grid"}),n.registry.register(n.presets,!0)})(Ss||(Ss={}));const Yy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t*2,e.height=s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(2*t,0),r.scale(-1,1),r.drawImage(n,0,0,t,s),e},qy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=t,e.height=s*2;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.translate(0,2*s),r.scale(1,-1),r.drawImage(n,0,0,t,s),e},Xy=function(n){const e=document.createElement("canvas"),t=n.width,s=n.height;e.width=2*t,e.height=2*s;const r=e.getContext("2d");return r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,-1,e.width,e.height),r.drawImage(n,0,0,t,s),r.setTransform(-1,0,0,1,e.width,0),r.drawImage(n,0,0,t,s),r.setTransform(1,0,0,-1,0,e.height),r.drawImage(n,0,0,t,s),e},kR=Object.freeze(Object.defineProperty({__proto__:null,flipX:Yy,flipXY:Xy,flipY:qy,watermark:function(n,e){const t=n.width,s=n.height,r=document.createElement("canvas");r.width=t*3,r.height=s*3;const i=r.getContext("2d"),o=e.angle!=null?-e.angle:-20,a=ye.toRad(o),c=r.width/4,u=r.height/4;for(let d=0;d<4;d+=1)for(let f=0;f<4;f+=1)(d+f)%2>0&&(i.setTransform(1,0,0,1,(2*d-1)*c,(2*f-1)*u),i.rotate(a),i.drawImage(n,-t/2,-s/2,t,s));return r}},Symbol.toStringTag,{value:"Module"}));var uo;(function(n){n.presets=Object.assign({},kR),n.presets["flip-x"]=Yy,n.presets["flip-y"]=qy,n.presets["flip-xy"]=Xy,n.registry=Ue.create({type:"background pattern"}),n.registry.register(n.presets,!0)})(uo||(uo={}));function ad(n,e){return n??e}function at(n,e){return n!=null&&Number.isFinite(n)?n:e}function VR(n={}){const e=ad(n.color,"blue"),t=at(n.width,1),s=at(n.margin,2),r=at(n.opacity,1),i=s,o=s+t;return`
42
42
  <filter>
43
43
  <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>
44
44
  <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />
@@ -116,11 +116,11 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
116
116
  <feFuncB type="linear" slope="${e}" intercept="${t}"/>
117
117
  </feComponentTransfer>
118
118
  </filter>
119
- `.trim()}const HR=Object.freeze(Object.defineProperty({__proto__:null,blur:RR,brightness:FR,contrast:UR,dropShadow:IR,grayScale:LR,highlight:DR,hueRotate:$R,invert:zR,outline:VR,saturate:jR,sepia:BR},Symbol.toStringTag,{value:"Module"}));var Zr;(function(n){n.presets=HR,n.registry=Ue.create({type:"filter"}),n.registry.register(n.presets,!0)})(Zr||(Zr={}));const GR={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"},WR={},Xy={position:cl("x","width","origin")},Jy={position:cl("y","height","origin")},YR={position:cl("x","width","corner")},qR={position:cl("y","height","corner")},Ky={set:Es("width","width")},Zy={set:Es("height","height")},XR={set:Es("rx","width")},JR={set:Es("ry","height")},Qy={set:(n=>{const e=Es(n,"width"),t=Es(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?e:t;return se(o,this,s,r)}})("r")},KR={set(n,{refBBox:e}){let t=parseFloat(n);const s=Kn(n);s&&(t/=100);const r=Math.sqrt(e.height*e.height+e.width*e.width);let i;return Number.isFinite(t)&&(s||t>=0&&t<=1?i=t*r:i=Math.max(t+r,0)),{r:i}}},ZR={set:Es("cx","width")},QR={set:Es("cy","height")},eb={set:sb({resetOffset:!0})},eI={set:sb({resetOffset:!1})},tb={set:rb({resetOffset:!0})},tI={set:rb({resetOffset:!1})},nI=Qy,sI=eb,rI=tb,iI=Xy,oI=Jy,aI=Ky,lI=Zy;function cl(n,e,t){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=Kn(s);o&&(i/=100);let a;if(Number.isFinite(i)){const u=r[t];o||i>0&&i<1?a=u[n]+r[e]*i:a=u[n]+i}const c=new M;return c[n]=a||0,c}}function Es(n,e){return function(t,{refBBox:s}){let r=parseFloat(t);const i=Kn(t);i&&(r/=100);const o={};if(Number.isFinite(r)){const a=i||r>=0&&r<=1?r*s[e]:Math.max(r+s[e],0);o[n]=a}return o}}function nb(n,e){const t="x6-shape",s=e&&e.resetOffset;return function(r,{elem:i,refBBox:o}){let a=nr(i,t);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},nr(i,t,a)}const c=a.shape.clone(),u=a.shapeBBox.clone(),d=u.getOrigin(),f=o.getOrigin();u.x=f.x,u.y=f.y;const h=o.getMaxScaleToFit(u,f),p=u.width===0||o.width===0?1:h.sx,g=u.height===0||o.height===0?1:h.sy;return c.scale(p,g,d),s&&c.translate(-d.x,-d.y),c}}function sb(n){function e(s){return re.parse(s)}const t=nb(e,n);return(s,r)=>({d:t(s,r).serialize()})}function rb(n){const e=nb(t=>new Fe(t),n);return(t,s)=>({points:e(t,s).serialize()})}const cI={qualify:Mn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},uI={qualify:Mn,set(n,{view:e}){const t=e.cell,s=Object.assign({},n);if(t.isEdge()&&s.type==="linearGradient"){const r=e,i=r.sourcePoint,o=r.targetPoint;s.id=`gradient-${s.type}-${t.id}`,s.attrs=Object.assign(Object.assign({},s.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(s.id)}return`url(#${e.graph.defineGradient(s)})`}},ib={qualify(n,{attrs:e}){return e.textWrap==null||!Mn(e.textWrap)},set(n,{view:e,elem:t,attrs:s}){const r="x6-text",i=nr(t,r),o=d=>{try{return JSON.parse(d)}catch{return d}},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},c=s["font-size"]||s.fontSize,u=JSON.stringify([n,a]);if(c&&t.setAttribute("font-size",c),i==null||i!==u){const d=a.textPath;if(d!=null&&typeof d=="object"){const f=d.selector;if(typeof f=="string"){const h=e.find(f)[0];h instanceof SVGPathElement&&(Hu(h),a.textPath=Object.assign({"xlink:href":`#${h.id}`},d))}}Vy(t,`${n}`,a),nr(t,r,u)}}},dI={qualify:Mn,set(n,{view:e,elem:t,attrs:s,refBBox:r}){const i=n,o=i.width||0;Kn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;Kn(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let c,u=i.text;u==null&&(u=s.text||(t==null?void 0:t.textContent)),u!=null?c=Ry(`${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}):c="",se(ib.set,this,c,{view:e,elem:t,attrs:s,refBBox:r,cell:e.cell})}},Qr=(n,{attrs:e})=>e.text!==void 0,hI={qualify:Qr},fI={qualify:Qr},pI={qualify:Qr},gI={qualify:Qr},mI={qualify:Qr},yI={qualify:Qr},bI={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",s=`${n}`,r=nr(e,t);if(r==null||r!==s){nr(e,t,s);const i=e.firstChild;if(i&&i.tagName.toUpperCase()==="TITLE"){const o=i;o.textContent=s}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=s,e.insertBefore(o,i)}}}},wI={offset:ob("x","width","right")},xI={offset:ob("y","height","bottom")},vI={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ob(n,e,t){return(s,{refBBox:r})=>{const i=new M;let o;return s==="middle"?o=r[e]/2:s===t?o=r[e]:typeof s=="number"&&Number.isFinite(s)?o=s>-1&&s<1?-r[e]*s:-s:Kn(s)?o=r[e]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const CI={qualify:Mn,set(n,{elem:e}){Je(e,n)}},SI={set(n,{elem:e}){e.innerHTML=`${n}`}},EI={qualify:Mn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},OI={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Os(n,e,t){let s,r;typeof e=="object"?(s=e.x,r=e.y):(s=e,r=t);const i=re.parse(n),o=i.bbox();if(o){let a=-o.height/2-o.y,c=-o.width/2-o.x;typeof s=="number"&&(c-=s),typeof r=="number"&&(a-=r),i.translate(c,a)}return i.serialize()}var ab=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const MI=n=>{var{size:e,width:t,height:s,offset:r,open:i}=n,o=ab(n,["size","width","height","offset","open"]);return lb({size:e,width:t,height:s,offset:r},i===!0,!0,void 0,o)},PI=n=>{var{size:e,width:t,height:s,offset:r,factor:i}=n,o=ab(n,["size","width","height","offset","factor"]);return lb({size:e,width:t,height:s,offset:r},!1,!1,i,o)};function lb(n,e,t,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,c=new re,u={};if(e)c.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(c.moveTo(0,a/2),c.lineTo(o,0),!t){const d=Ct(s,0,1);c.lineTo(o*d,a/2)}c.lineTo(o,a),c.close()}return Object.assign(Object.assign(Object.assign({},u),r),{tagName:"path",d:Os(c.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var NI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const AI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=NI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new re;return u.moveTo(0,c/2).lineTo(a/2,0).lineTo(a,c/2).lineTo(a/2,c).close(),Object.assign(Object.assign({},i),{tagName:"path",d:Os(u.serialize(),r??-a/2)})};var _I=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const TI=n=>{var{d:e,offsetX:t,offsetY:s}=n,r=_I(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Os(e,t,s)})};var kI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const VI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=kI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new re;return u.moveTo(0,0).lineTo(a,c).moveTo(0,c).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:Os(u.serialize(),r||-a/2)})};var DI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const RI=n=>{var{width:e,height:t,offset:s,open:r,flip:i}=n,o=DI(n,["width","height","offset","open","flip"]);let a=t||6;const c=e||10,u=r===!0,d=i===!0,f=Object.assign(Object.assign({},o),{tagName:"path"});d&&(a=-a);const h=new re;return h.moveTo(0,a).lineTo(c,0),u?f.fill="none":(h.lineTo(c,a),h.close()),f.d=Os(h.serialize(),{x:s||-c/2,y:a/2}),f};var cb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const ub=n=>{var{r:e}=n,t=cb(n,["r"]);const s=e||5;return Object.assign(Object.assign({cx:s},t),{tagName:"circle",r:s})},II=n=>{var{r:e}=n,t=cb(n,["r"]);const s=e||5,r=new re;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},ub({r:s})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Os(r.serialize(),-s)})]}};var LI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const BI=Object.freeze(Object.defineProperty({__proto__:null,async:RI,block:MI,circle:ub,circlePlus:II,classic:PI,cross:VI,diamond:AI,ellipse:n=>{var{rx:e,ry:t}=n,s=LI(n,["rx","ry"]);const r=e||5,i=t||5;return Object.assign(Object.assign({cx:r},s),{tagName:"ellipse",rx:r,ry:i})},path:TI},Symbol.toStringTag,{value:"Module"}));var Ms;(function(n){n.presets=BI,n.registry=Ue.create({type:"marker"}),n.registry.register(n.presets,!0)})(Ms||(Ms={})),function(n){n.normalize=Os}(Ms||(Ms={}));var jI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function ld(n){return typeof n=="string"||Mn(n)}const $I={qualify:ld,set(n,{view:e,attrs:t}){return cd("marker-start",n,e,t)}},zI={qualify:ld,set(n,{view:e,attrs:t}){return cd("marker-end",n,e,t,{transform:"rotate(180)"})}},FI={qualify:ld,set(n,{view:e,attrs:t}){return cd("marker-mid",n,e,t)}};function cd(n,e,t,s,r={}){const i=typeof e=="string"?{name:e}:e,{name:o,args:a}=i,c=jI(i,["name","args"]);let u=c;if(o&&typeof o=="string"){const f=Ms.registry.get(o);if(f)u=f(Object.assign(Object.assign({},c),a));else return Ms.registry.onNotFound(o)}const d=Object.assign(Object.assign(Object.assign({},UI(s,n)),r),u);return{[n]:`url(#${t.graph.defineMarker(d)})`}}function UI(n,e){const t={},s=n.stroke;typeof s=="string"&&(t.stroke=s,t.fill=s);let r=n.strokeOpacity;if(r==null&&(r=n["stroke-opacity"]),r==null&&(r=n.opacity),r!=null&&(t["stroke-opacity"]=r,t["fill-opacity"]=r),e!=="marker-mid"){const i=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);t.refX=e==="marker-start"?o:-o}}return t}const ho=(n,{view:e})=>e.cell.isEdge(),HI={qualify:ho,set(n,e){var t,s,r,i;const o=e.view,a=n.reverse||!1,c=n.stubs||0;let u;if(Number.isFinite(c)&&c!==0)if(a){let d,f;const h=o.getConnectionLength()||0;c<0?(d=(h+c)/2,f=-c):(d=c,f=h-c*2);const p=o.getConnection();u=(i=(r=(s=(t=p==null?void 0:p.divideAtLength(d))===null||t===void 0?void 0:t[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 d;c<0?d=((o.getConnectionLength()||0)+c)/2:d=c;const f=o.getConnection();if(f){const h=f.divideAtLength(d),p=f.divideAtLength(-d);h&&p&&(u=`${h[0].serialize()} ${p[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},db={qualify:ho,set:ul("getTangentAtLength",{rotate:!0})},GI={qualify:ho,set:ul("getTangentAtLength",{rotate:!1})},hb={qualify:ho,set:ul("getTangentAtRatio",{rotate:!0})},WI={qualify:ho,set:ul("getTangentAtRatio",{rotate:!1})},YI=db,qI=hb;function ul(n,e){const t={x:1,y:0};return(s,r)=>{let i,o;const a=r.view,c=a[n](Number(s));return c?(o=e.rotate?c.vector().vectorAngle(t):0,i=c.start):(i=a.path.start,o=0),o===0?{transform:`translate(${i.x},${i.y}')`}:{transform:`translate(${i.x},${i.y}') rotate(${o})`}}}const XI=Object.freeze(Object.defineProperty({__proto__:null,annotations:gI,atConnectionLength:YI,atConnectionLengthIgnoreGradient:GI,atConnectionLengthKeepGradient:db,atConnectionRatio:qI,atConnectionRatioIgnoreGradient:WI,atConnectionRatioKeepGradient:hb,connection:HI,displayEmpty:yI,eol:mI,fill:cI,filter:EI,html:SI,lineHeight:hI,port:OI,ref:WR,refCx:ZR,refCy:QR,refD:sI,refDKeepOffset:eI,refDResetOffset:eb,refDx:YR,refDy:qR,refHeight:Zy,refHeight2:lI,refPoints:rI,refPointsKeepOffset:tI,refPointsResetOffset:tb,refR:nI,refRCircumscribed:KR,refRInscribed:Qy,refRx:XR,refRy:JR,refWidth:Ky,refWidth2:aI,refX:Xy,refX2:iI,refY:Jy,refY2:oI,resetOffset:vI,sourceMarker:$I,stroke:uI,style:CI,targetMarker:zI,text:ib,textPath:pI,textVerticalAnchor:fI,textWrap:dI,title:bI,vertexMarker:FI,xAlign:wI,yAlign:xI},Symbol.toStringTag,{value:"Module"}));var kn;(function(n){function e(t,s,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||se(t.qualify,this,s,r)))}n.isValidDefinition=e})(kn||(kn={})),function(n){n.presets=Object.assign(Object.assign({},GR),XI),n.registry=Ue.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(kn||(kn={}));const Jt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Jt.prefixCls}-${n}`}},fb=Jt.prefix("highlighted"),JI={highlight(n,e,t){const s=t&&t.className||fb;ee(e,s)},unhighlight(n,e,t){const s=t&&t.className||fb;Ie(e,s)}},pb=Jt.prefix("highlight-opacity"),KI={highlight(n,e){ee(e,pb)},unhighlight(n,e){Ie(e,pb)}};var Ee;(function(n){n.normalizeMarker=Os;function e(h,p){const g=uR(h.x,h.y).matrixTransform(p);return new M(g.x,g.y)}n.transformPoint=e;function t(h,p){return new K(e(h.start,p),e(h.end,p))}n.transformLine=t;function s(h,p){let g=h instanceof Fe?h.points:h;return Array.isArray(g)||(g=[]),new Fe(g.map(m=>e(m,p)))}n.transformPolyline=s;function r(h,p){const m=yn("svg").createSVGPoint();m.x=h.x,m.y=h.y;const y=m.matrixTransform(p);m.x=h.x+h.width,m.y=h.y;const b=m.matrixTransform(p);m.x=h.x+h.width,m.y=h.y+h.height;const w=m.matrixTransform(p);m.x=h.x,m.y=h.y+h.height;const x=m.matrixTransform(p),v=Math.min(y.x,b.x,w.x,x.x),C=Math.max(y.x,b.x,w.x,x.x),E=Math.min(y.y,b.y,w.y,x.y),S=Math.max(y.y,b.y,w.y,x.y);return new G(v,E,C-v,S-E)}n.transformRectangle=r;function i(h,p,g){let m;const y=h.ownerSVGElement;if(!y)return new G(0,0,0,0);try{m=h.getBBox()}catch{m={x:h.clientLeft,y:h.clientTop,width:h.clientWidth,height:h.clientHeight}}if(p)return G.create(m);const b=io(h,g||y);return r(m,b)}n.bbox=i;function o(h,p={}){let g;if(!h.ownerSVGElement||!ws(h)){if(Sy(h)){const{left:w,top:x,width:v,height:C}=a(h);return new G(w,x,v,C)}return new G(0,0,0,0)}let y=p.target;if(!p.recursive){try{g=h.getBBox()}catch{g={x:h.clientLeft,y:h.clientTop,width:h.clientWidth,height:h.clientHeight}}if(!y)return G.create(g);const w=io(h,y);return r(g,w)}{const w=h.childNodes,x=w.length;if(x===0)return o(h,{target:y});y||(y=h);for(let v=0;v<x;v+=1){const C=w[v];let E;C.childNodes.length===0?E=o(C,{target:y}):E=o(C,{target:y,recursive:!0}),g?g=g.union(E):g=E}return g}}n.getBBox=o;function a(h){let p=0,g=0,m=0,y=0;if(h){let b=h;for(;b;)p+=b.offsetLeft,g+=b.offsetTop,b=b.offsetParent,b&&(p+=parseInt(_y(b,"borderLeft"),10),g+=parseInt(_y(b,"borderTop"),10));m=h.offsetWidth,y=h.offsetHeight}return{left:p,top:g,width:m,height:y}}n.getBoundingOffsetRect=a;function c(h){const p=g=>{const m=h.getAttribute(g),y=m?parseFloat(m):0;return Number.isNaN(y)?0:y};switch(h instanceof SVGElement&&h.nodeName.toLowerCase()){case"rect":return new G(p("x"),p("y"),p("width"),p("height"));case"circle":return new bn(p("cx"),p("cy"),p("r"),p("r"));case"ellipse":return new bn(p("cx"),p("cy"),p("rx"),p("ry"));case"polyline":{const g=sl(h);return new Fe(g)}case"polygon":{const g=sl(h);return g.length>1&&g.push(g[0]),new Fe(g)}case"path":{let g=h.getAttribute("d");return re.isValid(g)||(g=re.normalize(g)),re.parse(g)}case"line":return new K(p("x1"),p("y1"),p("x2"),p("y2"))}return o(h)}n.toGeometryShape=c;function u(h,p,g,m){const y=M.create(p),b=M.create(g);m||(m=h instanceof SVGSVGElement?h:h.ownerSVGElement);const w=nd(h);h.setAttribute("transform","");const x=o(h,{target:m}).scale(w.sx,w.sy),v=so();v.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const C=so(),E=y.angleBetween(b,y.clone().translate(1,0));E&&C.setRotate(E,0,0);const S=so(),O=y.clone().move(b,x.width/2);S.setTranslate(2*y.x-O.x,2*y.y-O.y);const A=io(h,m),k=so();k.setMatrix(S.matrix.multiply(C.matrix.multiply(v.matrix.multiply(A.scale(w.sx,w.sy))))),h.setAttribute("transform",Wr(k.matrix))}n.translateAndAutoOrient=u;function d(h){if(h==null)return null;let p=h;do{let g=p.tagName;if(typeof g!="string")return null;if(g=g.toUpperCase(),_n(p,"x6-port"))p=p.nextElementSibling;else if(g==="G")p=p.firstElementChild;else if(g==="TITLE")p=p.nextElementSibling;else break}while(p);return p}n.findShapeNode=d;function f(h){const p=d(h);if(!ws(p)){if(Sy(h)){const{left:y,top:b,width:w,height:x}=a(h);return new G(y,b,w,x)}return new G(0,0,0,0)}return c(p).bbox()||G.create()}n.getBBoxV2=f})(Ee||(Ee={}));const ZI={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},QI={highlight(n,e,t){const s=Ps.getHighlighterId(e,t);if(Ps.hasCache(s))return;t=Ep({},t,ZI);const r=oe.create(e);let i,o;try{i=r.toPathData()}catch{o=Ee.bbox(r.node,!0),i=Ly(Object.assign(Object.assign({},t),o))}const a=yn("path");if(pe(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?to(t.attrs):null)),n.isEdgeElement(e))pe(a,"d",n.getConnectionPathData());else{let d=r.getTransformToElement(n.container);const f=t.padding;if(f){o==null&&(o=Ee.bbox(r.node,!0));const h=o.x+o.width/2,p=o.y+o.height/2;o=Ee.transformRectangle(o,d);const g=Math.max(o.width,1),m=Math.max(o.height,1),y=(g+f)/g,b=(m+f)/m,w=ot({a:y,b:0,c:0,d:b,e:h-y*h,f:p-b*p});d=d.multiply(w)}Yr(a,d)}ee(a,Jt.prefix("highlight-stroke"));const c=n.cell,u=()=>Ps.removeHighlighter(s);c.on("removed",u),c.model&&c.model.on("reseted",u),n.container.appendChild(a),Ps.setCache(s,a)},unhighlight(n,e,t){Ps.removeHighlighter(Ps.getHighlighterId(e,t))}};var Ps;(function(n){function e(o,a){return Hu(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function s(o,a){t[o]=a}n.setCache=s;function r(o){return t[o]!=null}n.hasCache=r;function i(o){const a=t[o];a&&(Yt(a),delete t[o])}n.removeHighlighter=i})(Ps||(Ps={}));const eL=Object.freeze(Object.defineProperty({__proto__:null,className:JI,opacity:KI,stroke:QI},Symbol.toStringTag,{value:"Module"}));var Qn;(function(n){function e(t,s){if(typeof s.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof s.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(Qn||(Qn={})),function(n){n.presets=eL,n.registry=Ue.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(Qn||(Qn={}));function ud(n,e={}){return new M(gn(e.x,n.width),gn(e.y,n.height))}function dd(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const tL=(n,e)=>n.map(({x:t,y:s,angle:r})=>dd(ud(e,{x:t,y:s}),r||0)),nL=(n,e,t)=>{const s=t.start||0,r=t.step||20;return gb(n,e,s,(i,o)=>(i+.5-o/2)*r)},sL=(n,e,t)=>{const s=t.start||0,r=t.step||360/n.length;return gb(n,e,s,i=>i*r)};function gb(n,e,t,s){const r=e.getCenter(),i=e.getTopCenter(),o=e.width/e.height,a=bn.fromRect(e),c=n.length;return n.map((u,d)=>{const f=t+s(d,c),h=i.clone().rotate(-f,r).scale(o,1,r),p=u.compensateRotate?-a.tangentTheta(h):0;return(u.dx||u.dy)&&h.translate(u.dx||0,u.dy||0),u.dr&&h.move(r,u.dr),dd(h.round(),p,u)})}var rL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const iL=(n,e,t)=>{const s=ud(e,t.start||e.getOrigin()),r=ud(e,t.end||e.getCorner());return fo(n,s,r,t)},oL=(n,e,t)=>fo(n,e.getTopLeft(),e.getBottomLeft(),t),aL=(n,e,t)=>fo(n,e.getTopRight(),e.getBottomRight(),t),lL=(n,e,t)=>fo(n,e.getTopLeft(),e.getTopRight(),t),cL=(n,e,t)=>fo(n,e.getBottomLeft(),e.getBottomRight(),t);function fo(n,e,t,s){const r=new K(e,t),i=n.length;return n.map((o,a)=>{var{strict:c}=o,u=rL(o,["strict"]);const d=c||s.strict?(a+1)/(i+1):(a+.5)/i,f=r.pointAt(d);return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),dd(f.round(),0,u)})}const uL=Object.freeze(Object.defineProperty({__proto__:null,absolute:tL,bottom:cL,ellipse:nL,ellipseSpread:sL,left:oL,line:iL,right:aL,top:lL},Symbol.toStringTag,{value:"Module"}));var or;(function(n){n.presets=uL,n.registry=Ue.create({type:"port layout"}),n.registry.register(n.presets,!0)})(or||(or={}));const dL={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ns(n,e){const{x:t,y:s,angle:r,attrs:i}=e||{};return Ep({},{angle:r,attrs:i,position:{x:t,y:s}},n,dL)}const hL=(n,e,t)=>Ns({position:e.getTopLeft()},t),fL=(n,e,t)=>Ns({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),pL=(n,e,t)=>Ns({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),gL=(n,e,t)=>Ns({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),mL=(n,e,t)=>Ns({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),yL=(n,e,t)=>mb(n,e,!1,t),bL=(n,e,t)=>mb(n,e,!0,t),wL=(n,e,t)=>yb(n,e,!1,t),xL=(n,e,t)=>yb(n,e,!0,t);function mb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=bb(e);let a,c,u,d,f=0;return i<o[1]||i>o[2]?(a=".3em",c=r,u=0,d="start"):i<o[0]?(a="0",c=0,u=-r,t?(f=-90,d="start"):d="middle"):i<o[3]?(a=".3em",c=-r,u=0,d="end"):(a=".6em",c=0,u=r,t?(f=90,d="start"):d="middle"),Ns({position:{x:Math.round(c),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":d}}},s)}function yb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=bb(e);let a,c,u,d,f=0;return i<o[1]||i>o[2]?(a=".3em",c=-r,u=0,d="end"):i<o[0]?(a=".6em",c=0,u=r,t?(f=90,d="start"):d="middle"):i<o[3]?(a=".3em",c=r,u=0,d="start"):(a="0em",c=0,u=-r,t?(f=-90,d="start"):d="middle"),Ns({position:{x:Math.round(c),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":d}}},s)}function bb(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),s=e.theta(n.getBottomLeft()),r=e.theta(n.getBottomRight()),i=e.theta(n.getTopRight());return[t,i,r,s]}const vL=(n,e,t)=>wb(n.diff(e.getCenter()),!1,t),CL=(n,e,t)=>wb(n.diff(e.getCenter()),!0,t);function wb(n,e,t){const s=t.offset!=null?t.offset:20,r=new M(0,0),i=-n.theta(r),o=n.clone().move(r,s).diff(n).round();let a=".3em",c,u=i;return(i+90)%180===0?(c=e?"end":"middle",!e&&i===-270&&(a="0em")):i>-270&&i<-90?(c="start",u=i-180):c="end",Ns({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":c}}},t)}const SL=Object.freeze(Object.defineProperty({__proto__:null,bottom:mL,inside:wL,insideOriented:xL,left:fL,manual:hL,outside:yL,outsideOriented:bL,radial:vL,radialOriented:CL,right:pL,top:gL},Symbol.toStringTag,{value:"Module"}));var ei;(function(n){n.presets=SL,n.registry=Ue.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(ei||(ei={}));var EL=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class be extends Ve{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=hd.uniqueId(),be.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return eo(e),this}unmount(e=this.container){return Yt(e),this}remove(e=this.container){return e===this.container?(this.removeEventListeners(document),this.onRemove(),delete be.views[this.cid],this.disposeContainer&&this.unmount(e)):this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return ee(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return Ie(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Je(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&pe(t,e),this}findAttr(e,t=this.container){let s=t;for(;s&&s.nodeType===1;){const r=s.getAttribute(e);if(r!=null)return r;if(s===this.container)return null;s=s.parentNode}return null}find(e,t=this.container,s=this.selectors){return be.find(e,t,s).elems}findOne(e,t=this.container,s=this.selectors){const r=this.find(e,t,s);return r.length>0?r[0]:null}findByAttr(e,t=this.container){let s=t;for(;s&&s.getAttribute;){const r=s.getAttribute(e);if((r!=null||s===this.container)&&r!=="false")return s;s=s.parentNode}return null}getSelector(e,t){let s;if(e===this.container)return typeof t=="string"&&(s=`> ${t}`),s;if(e){const r=Wu(e)+1;s=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(s+=` > ${t}`),s=this.getSelector(e.parentNode,s)}return s}prefixClassName(e){return Jt.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const s=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(r=>{const i=r.match(s);if(i==null)return;const o=this.getEventHandler(e[r]);typeof o=="function"&&this.delegateEvent(i[1],i[2],o)}),this}undelegateEvents(){return dt.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,s){return dt.on(this.container,e+this.getEventNamespace(),t,s),this}undelegateEvent(e,t,s){const r=e+this.getEventNamespace();return t==null?dt.off(this.container,r):typeof t=="string"?dt.off(this.container,r,t,s):dt.off(this.container,r,t),this}addEventListeners(e,t,s){if(t==null)return this;const r=this.getEventNamespace();return Object.keys(t).forEach(i=>{const o=this.getEventHandler(t[i]);typeof o=="function"&&dt.on(e,i+r,s,o)}),this}removeEventListeners(e){return e!=null&&dt.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Jt.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const s=this[e];typeof s=="function"&&(t=(...r)=>s.call(this,...r))}else t=(...s)=>e.call(this,...s);return t}getEventTarget(e,t={}){const{target:s,type:r,clientX:i=0,clientY:o=0}=e;return t.fromPoint||r==="touchmove"||r==="touchend"?document.elementFromPoint(i,o):s}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let s=e.data;const r=`__${this.cid}__`;return t==null?s==null?{}:s[r]||{}:(s==null&&(s=e.data={}),s[r]==null?s[r]=Object.assign({},t):s[r]=Object.assign(Object.assign({},s[r]),t),s[r])}normalizeEvent(e){return be.normalizeEvent(e)}dispose(){this.remove()}}EL([be.dispose()],be.prototype,"dispose",null),function(n){function e(r,i){return i?yn(r||"g"):Gu(r||"div")}n.createElement=e;function t(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=t;function s(r){let i=r;const o=r.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const c in r)a[c]===void 0&&(a[c]=r[c]);i=a}return i}n.normalizeEvent=s}(be||(be={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(be||(be={}));var hd;(function(n){let e=0;function t(){const s=`v${e}`;return e+=1,s}n.uniqueId=t})(hd||(hd={}));class OL{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new id,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const s=this.view.container;t.matrix=gR(e,s)}return ot(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Ee.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Ee.getBBoxV2(e)),t.boundingRect.clone()}}var De;(function(n){function e(u){return u!=null&&!t(u)}n.isJSONMarkup=e;function t(u){return u!=null&&typeof u=="string"}n.isStringMarkup=t;function s(u){return u==null||t(u)?u:ke(u)}n.clone=s;function r(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=r;function i(u,d={ns:it.svg}){const f=document.createDocumentFragment(),h={},p={},g=[{markup:Array.isArray(u)?u:[u],parent:f,ns:d.ns}];for(;g.length>0;){const m=g.pop();let y=m.ns||it.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 C=y?Gu(v,y):xy(v),E=x.attrs;E&&pe(C,to(E));const S=x.style;S&&Je(C,S);const O=x.className;O!=null&&C.setAttribute("class",Array.isArray(O)?O.join(" "):O),x.textContent&&(C.textContent=x.textContent);const A=x.selector;if(A!=null){if(p[A])throw new TypeError("Selector must be unique");p[A]=C}if(x.groupSelector){let _=x.groupSelector;Array.isArray(_)||(_=[_]),_.forEach(V=>{h[V]||(h[V]=[]),h[V].push(C)})}w.appendChild(C);const k=x.children;Array.isArray(k)&&g.push({ns:y,markup:k,parent:C})})}return Object.keys(h).forEach(m=>{if(p[m])throw new Error("Ambiguous group selector");p[m]=h[m]}),{fragment:f,selectors:p,groups:h}}n.parseJSONMarkup=i;function o(u){return u instanceof SVGElement?yn("g"):xy("div")}function a(u){if(t(u)){const p=oe.createVectors(u),g=p.length;if(g===1)return{elem:p[0].node};if(g>1){const m=o(p[0].node);return p.forEach(y=>{m.appendChild(y.node)}),{elem:m}}return{}}const d=i(u),f=d.fragment;let h=null;return f.childNodes.length>1?(h=o(f.firstChild),h.appendChild(f)):h=f.firstChild,{elem:h,selectors:d.selectors}}n.renderMarkup=a;function c(u){const d=oe.createVectors(u),f=document.createDocumentFragment();for(let h=0,p=d.length;h<p;h+=1){const g=d[h].node;f.appendChild(g)}return{fragment:f,selectors:{}}}n.parseLabelStringMarkup=c})(De||(De={})),function(n){function e(t,s,r){if(t!=null){let i;const o=t.tagName.toLowerCase();if(t===s)return typeof r=="string"?i=`> ${o} > ${r}`:i=`> ${o}`,i;const a=t.parentNode;if(a&&a.childNodes.length>1){const c=Wu(t)+1;i=`${o}:nth-child(${c})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,s,i)}return r}n.getSelector=e}(De||(De={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function s(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=s}(De||(De={})),function(n){function e(){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=e}(De||(De={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:it.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:it.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(De||(De={}));class xb{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let s,r,i,o;const a=[];return Object.keys(t).forEach(c=>{const u=t[c],d=this.getDefinition(c),f=se(kn.isValidDefinition,this.view,d,u,{elem:e,attrs:t,cell:this.cell,view:this.view});if(d&&f)typeof d=="string"?(s==null&&(s={}),s[d]=u):u!==null&&a.push({name:c,definition:d});else{s==null&&(s={});const h=Ey.includes(c)?c:ny(c);s[h]=u}}),a.forEach(({name:c,definition:u})=>{const d=t[c];typeof u.set=="function"&&(r==null&&(r={}),r[c]=d),typeof u.offset=="function"&&(i==null&&(i={}),i[c]=d),typeof u.position=="function"&&(o==null&&(o={}),o[c]=d)}),{raw:t,normal:s,set:r,offset:i,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const s=e.normal&&e.normal.transform;s!=null&&t.normal&&(t.normal.transform=s),e.normal=t.normal}findAttrs(e,t,s,r){const i=[],o=new id;return Object.keys(e).forEach(a=>{const c=e[a];if(!Mn(c))return;const{isCSSSelector:u,elems:d}=be.find(a,t,r);s[a]=d;for(let f=0,h=d.length;f<h;f+=1){const p=d[f],g=r&&r[a]===p,m=o.get(p);if(m){m.array||(i.push(p),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const y=m.attrs,b=m.priority;if(g)y.unshift(c),b.unshift(-1);else{const w=GP(b,u?-1:h);y.splice(w,0,c),b.splice(w,0,h)}}else o.set(p,{elem:p,attrs:c,priority:g?-1:h,array:!1})}}),i.forEach(a=>{const c=o.get(a),u=c.attrs;c.attrs=u.reduceRight((d,f)=>Ye(d,f),{})}),o}updateRelativeAttrs(e,t,s){const r=t.raw||{};let i=t.normal||{};const o=t.set,a=t.position,c=t.offset,u=()=>({elem:e,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=se(w.set,this.view,b,u());typeof x=="object"?i=Object.assign(Object.assign({},i),x):x!=null&&(i[y]=x)}}),e instanceof HTMLElement){this.view.setAttrs(i,e);return}const d=i.transform,f=d?`${d}`:null,h=ro(f),p=new M(h.e,h.f);d&&(delete i.transform,h.e=0,h.f=0);let g=!1;a!=null&&Object.keys(a).forEach(y=>{const b=a[y],w=this.getDefinition(y);if(w!=null){const x=se(w.position,this.view,b,u());x!=null&&(g=!0,p.translate(M.create(x)))}}),this.view.setAttrs(i,e);let m=!1;if(c!=null){const y=this.view.getBoundingRectOfElement(e);if(y.width>0&&y.height>0){const b=Ee.transformRectangle(y,h);Object.keys(c).forEach(w=>{const x=c[w],v=this.getDefinition(w);if(v!=null){const C=se(v.offset,this.view,x,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:b});C!=null&&(m=!0,p.translate(M.create(C)))}})}}(d!=null||g||m)&&(p.round(1),h.e=p.x,h.f=p.y,e.setAttribute("transform",Wr(h)))}update(e,t,s){const r={},i=this.findAttrs(s.attrs||t,e,r,s.selectors),o=s.attrs?this.findAttrs(t,e,r,s.selectors):i,a=[];i.each(d=>{const f=d.elem,h=d.attrs,p=this.processAttrs(f,h);if(p.set==null&&p.position==null&&p.offset==null)this.view.setAttrs(p.normal,f);else{const g=o.get(f),m=g?g.attrs:null,y=m&&h.ref==null?m.ref:h.ref;let b;if(y){if(b=(r[y]||this.view.find(y,e,s.selectors))[0],!b)throw new Error(`"${y}" reference does not exist.`)}else b=null;const w={node:f,refNode:b,attributes:m,processedAttributes:p},x=a.findIndex(v=>v.refNode===f);x>-1?a.splice(x,0,w):a.push(w)}});const c=new id;let u;a.forEach(d=>{const f=d.node,h=d.refNode;let p;const g=h!=null&&s.rotatableNode!=null&&Yu(s.rotatableNode,h);if(h&&(p=c.get(h)),!p){const b=g?s.rotatableNode:e;p=h?Ee.getBBox(h,{target:b}):s.rootBBox,h&&c.set(h,p)}let m;s.attrs&&d.attributes?(m=this.processAttrs(f,d.attributes),this.mergeProcessedAttrs(m,d.processedAttributes)):m=d.processedAttributes;let y=p;g&&s.rotatableNode!=null&&!s.rotatableNode.contains(f)&&(u||(u=ro(pe(s.rotatableNode,"transform"))),y=Ee.transformRectangle(p,u)),this.updateRelativeAttrs(f,m,y)})}}class vb{get cell(){return this.view.cell}constructor(e,t,s=[]){this.view=e;const r={},i={};let o=0;Object.keys(t).forEach(c=>{let u=t[c];Array.isArray(u)||(u=[u]),u.forEach(d=>{let f=r[d];f||(o+=1,f=r[d]=1<<o),i[c]|=f})});let a=s;if(Array.isArray(a)||(a=[a]),a.forEach(c=>{r[c]||(o+=1,r[c]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=s}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((s,r)=>s|t[r],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var ML=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},PL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class He extends be{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,d)=>d!=null?_p([...Array.isArray(u)?u:[u],...Array.isArray(d)?d:[d]]):Array.isArray(u)?[...u]:[u],s=ke(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=e,c=PL(e,["bootstrap","actions","events","documentEvents"]);return r&&(s.bootstrap=t(s.bootstrap,r)),i&&Object.entries(i).forEach(([u,d])=>{const f=s.actions[u];d&&f?s.actions[u]=t(f,d):d&&(s.actions[u]=t(d))}),o&&(s.events=Object.assign(Object.assign({},s.events),o)),e.documentEvents&&(s.documentEvents=Object.assign(Object.assign({},s.documentEvents),a)),Ye(s,c)}get[Symbol.toStringTag](){return He.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new xb(this),this.flag=new vb(this,this.options.actions,this.options.bootstrap),this.cache=new OL(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(e){return this.getConstructor().getOptions(e)}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 be.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const s=this.getContainerStyle();s!=null&&this.setStyle(s,e);const r=this.getContainerClassName();r!=null&&this.addClass(r,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,s,r){if(this.hasAction(e,t)){s();const i=[t];return r&&(typeof r=="string"?i.push(r):i.push(...r)),this.removeAction(e,i)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const s=De.parseJSONMarkup(e),r=s.selectors,i=this.rootSelector;if(t&&i){if(r[i])throw new Error("Invalid root selector");r[i]=t}return s}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=se(t,this.graph,this)),typeof t=="object"){let s=t[e];return typeof s=="function"&&(s=se(s,this.graph,this)),s!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return Ee.transformRectangle(t,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return Ee.transformRectangle(t,r.multiply(s))}getBBox(e={}){let t;if(e.useCellGeometry){const s=this.cell,r=s.isNode()?s.getAngle():0;t=s.getBBox().bbox(r)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return ot().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ot();const t=this.cell,s=t.isNode()?t.getAngle():0;if(s){const r=t.getBBox(),i=r.width/2,o=r.height/2;e=e.translate(i,o).rotate(s).translate(-i,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,s={}){s.rootBBox==null&&(s.rootBBox=new G),s.selectors==null&&(s.selectors=this.selectors),this.attr.update(e,t,s)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const s=e||this.container;return t.partial=s===this.container,s}highlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,s,r,i){const o=this.cell,a=this.findAttr("port",e),c=e.getAttribute("data-selector"),u={cell:o.id};return c!=null&&(u.magnet=c),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&c==null&&(u.selector=this.getSelector(e))):c==null&&this.container!==e&&(u.selector=this.getSelector(e)),u}getMagnetFromEdgeTerminal(e){const t=this.cell,s=this.container,r=e.port;let i=e.magnet,o;return r!=null&&t.isNode()&&t.hasPort(r)?o=this.findPortElem(r,i)||s:(i||(i=e.selector),!i&&r!=null&&(i=`[port="${r}"]`),o=this.findOne(i,s,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;const t=Ke.isToolsView(e)?e:new Ke(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),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 e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,s){const r=this,i=r.cell;return t==null||s==null?{e,view:r,cell:i}:{e,x:t,y:s,view:r,cell:i}}onClick(e,t,s){this.notify("cell:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){this.notify("cell:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){this.notify("cell:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,s))}onMouseUp(e,t,s){this.notify("cell:mouseup",this.getEventArgs(e,t,s)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,s){this.notify("cell:mousemove",this.getEventArgs(e,t,s))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),this.notify(t,Object.assign({},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){}onMagnetDblClick(e,t,s,r){}onMagnetContextMenu(e,t,s,r){}onLabelMouseDown(e,t,s){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),s=this.graph.findViewByElem(t);s!==this&&(this.onMouseLeave(e),s&&s.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}He.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},ML([He.dispose()],He.prototype,"dispose",null),function(n){n.Flag=vb,n.Attr=xb}(He||(He={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"}n.isCellView=e}(He||(He={})),function(n){function e(s){return function(r){r.config({priority:s})}}n.priority=e;function t(s){return function(r){r.config({bootstrap:s})}}n.bootstrap=t}(He||(He={})),function(n){n.registry=Ue.create({type:"view"})}(He||(He={}));class Ke extends be{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Ke.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const s=e?be.createElement("g",!0):be.createElement("div",!1);return ee(s,this.prefixClassName("cell-tools")),t.className&&ee(s,t.className),s}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!He.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(ee(this.svgContainer,this.prefixClassName("edge-tools")),ee(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(ee(this.svgContainer,this.prefixClassName("node-tools")),ee(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 t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const s=[];t.forEach(r=>{Ke.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(Ke.ToolItem.isToolItem(i))o=i;else{const a=typeof i=="object"?i.name:i,c=typeof i=="object"?i.args||{}:{};if(a){if(this.cell.isNode()){const u=ni.registry.get(a);if(u)o=new u(c);else return ni.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=si.registry.get(a);if(u)o=new u(c);else return si.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(e={}){const t=this.tools;return t&&t.forEach(s=>{e.toolId!==s.cid&&s.isVisible()&&s.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(s=>{e===s?s.show():s.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(s=>{s!==e&&!s.isVisible()&&(s.show(),s.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),Yt(this.svgContainer),Yt(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const s=e.some(i=>i.options.isSVGElement!==!1),r=e.some(i=>i.options.isSVGElement===!1);s&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e})(Ke||(Ke={})),function(n){class e extends be{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return Ye(ke(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 e.toStringTag}constructor(s={}){super(),this.visible=!0,this.options=this.getOptions(s),this.container=be.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),ee(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&ee(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()?ee(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&ee(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=De.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)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let s=0;function r(o){return o?ju(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Lu(r(o.name),this);return a.config(o),a}t.define=i}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function s(r){if(r==null)return!1;if(r instanceof t)return!0;const i=r[Symbol.toStringTag],o=r;return(i==null||i===t.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"}t.isToolItem=s}(e=n.ToolItem||(n.ToolItem={}))}(Ke||(Ke={}));const NL=n=>n;function Cb(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Sb(n){return(t,s,r,i)=>s.isEdgeElement(r)?_L(n,t,s,r,i):AL(n,t,s,r,i)}function AL(n,e,t,s,r){const i=t.cell,o=i.getAngle(),a=t.getUnrotatedBBoxOfElement(s),c=i.getBBox().getCenter(),u=M.create(r).rotate(o,c);let d=u.x-a.x,f=u.y-a.y;return n&&(d=Cb(d,a.width),f=Cb(f,a.height)),e.anchor={name:"topLeft",args:{dx:d,dy:f,rotate:!0}},e}function _L(n,e,t,s,r){const i=t.getConnection();if(!i)return e;const o=i.closestPointLength(r);if(n){const a=i.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const TL=Sb(!0),kL=Sb(!1),VL=Object.freeze(Object.defineProperty({__proto__:null,noop:NL,pinAbsolute:kL,pinRelative:TL},Symbol.toStringTag,{value:"Module"}));var fd;(function(n){n.presets=VL,n.registry=Ue.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(fd||(fd={}));function Eb(n,e,t,s){return se(fd.presets.pinRelative,this.graph,{},e,t,n,this.cell,s,{}).anchor}function Ob(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class As extends Ke.ToolItem{onRender(){ee(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Yr(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:s=0,y:r=0}=t;const{offset:i,useCellGeometry:o,rotate:a}=t;let c=Ob(e,o);const u=e.cell.getAngle();a||(c=c.bbox(u));let d=0,f=0;typeof i=="number"?(d=i,f=i):typeof i=="object"&&(d=i.x,f=i.y),s=gn(s,c.width),r=gn(r,c.height);let h=ot().translate(c.x+c.width/2,c.y+c.height/2);return a&&(h=h.rotate(u)),h=h.translate(s+d-c.width/2,r+f-c.height/2),h}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:s=0,distance:r=0,rotate:i}=t;let o,a,c;const u=gn(r,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,c=o.vector().vectorAngle(new M(1,0))||0):(a=e.getConnection().start,c=0);let d=ot().translate(a.x,a.y).rotate(c);return typeof s=="object"?d=d.translate(s.x||0,s.y||0):d=d.translate(0,s),i||(d=d.rotate(-c)),d}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&se(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(As||(As={})),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:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(As||(As={}));var DL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class dl extends Ke.ToolItem{onRender(){if(ee(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,s=DL(e,["class"]);pe(this.container,to(s)),t&&ee(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:s,rotate:r}=t,i=ys(t.padding);let o=Ob(e,s).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const a=e.cell;if(a.isNode()){const c=a.getAngle();if(c)if(r){const u=a.getBBox().getCenter();td(this.container,c,u.x,u.y,{absolute:!0})}else o=o.bbox(c)}return pe(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"}})})(dl||(dl={}));class po extends Ke.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 e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.options.createHandle,o=this.options.processHandle,a=i({index:t,graph:this.graph,guard:c=>this.guard(c),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 e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.handles[t];i&&i.updatePosition(r.x,r.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,s=this.vertices,r=e>0?s[e-1]:t.sourceAnchor,i=e<s.length-1?s[e+1]:t.targetAnchor;return{prev:M.create(r),next:M.create(i)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:s,y:r}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:s,y:r}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:s,x:r,y:i}=this.getMouseEventArgs(e);this.eventData(s,{start:{x:r,y:i}}),t.notifyMouseDown(s,r,i)}}onHandleChanging({handle:e,e:t}){const s=this.cellView,r=e.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(t),c={x:o,y:a};this.snapVertex(c,r),s.cell.setVertexAt(r,c,{ui:!0,toolId:this.cid}),e.updatePosition(c.x,c.y),this.options.stopPropagation||s.notifyMouseMove(i,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,s=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}s.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:i,x:o,y:a}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){s.notifyMouseUp(i,o,a);const{start:c}=this.eventData(i);if(c){const{x:u,y:d}=c;u===o&&d===a&&s.onClick(i,o,a)}}s.checkMouseleave(i),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}snapVertex(e,t){const s=this.options.snapRadius||0;if(s>0){const r=this.getNeighborPoints(t),i=r.prev,o=r.next;Math.abs(e.x-i.x)<s?e.x=i.x:Math.abs(e.x-o.x)<s&&(e.x=o.x),Math.abs(e.y-i.y)<s?e.y=r.prev.y:Math.abs(e.y-o.y)<s&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const s=e.options.index,r=this.cellView;r.cell.removeVertexAt(s,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),s=this.options.addable&&this.cellView.can("vertexAddable"),r=this.options.modifiers?vs.isMatch(e,this.options.modifiers):!0;return!t&&s&&r}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=t.getVertexIndex(r.x,r.y);this.snapVertex(r,i),t.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 e extends be{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=be.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=e})(po||(po={})),function(n){const e=Jt.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:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(po||(po={}));class go extends Ke.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){ee(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let s=0,r=t.length;s<r-1;s+=1){const i=t[s],o=t[s+1],a=this.renderHandle(i,o,s);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,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,e,t),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let s=0,r=t.length;s<r;s+=1)t[s].options.index+=e}resetAnchor(e,t){const s=this.cellView.cell,r={ui:!0,toolId:this.cid};t?s.prop([e,"anchor"],t,r):s.removeProp([e,"anchor"],r)}snapHandle(e,t,s){const r=e.options.axis,i=e.options.index,c=this.cellView.cell.getVertices(),u=c[i-2]||s.sourceAnchor,d=c[i+1]||s.targetAnchor,f=this.options.snapRadius;return Math.abs(t[r]-u[r])<f?t[r]=u[r]:Math.abs(t[r]-d[r])<f&&(t[r]=d[r]),t}onHandleChanging({handle:e,e:t}){const s=this.graph,r=this.options,i=this.cellView,o=r.anchor,a=e.options.axis,c=e.options.index-1,u=this.getEventData(t),d=this.normalizeEvent(t),f=s.snapToGrid(d.clientX,d.clientY),h=this.snapHandle(e,f.clone(),u),p=ke(this.vertices);let g=p[c],m=p[c+1];const y=i.sourceView,b=i.sourceBBox;let w=!1,x=!1;if(g?c===0?b.containsPoint(g)?(p.shift(),this.shiftHandleIndexes(-1),w=!0):(g[a]=h[a],x=!0):g[a]=h[a]:(g=i.sourceAnchor.toJSON(),g[a]=h[a],b.containsPoint(g)?w=!0:(p.unshift(g),this.shiftHandleIndexes(1),x=!0)),typeof o=="function"&&y){if(w){const O=u.sourceAnchor.clone();O[a]=h[a];const A=se(o,i,O,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",A)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const v=i.targetView,C=i.targetBBox;let E=!1,S=!1;if(m?c===p.length-2?C.containsPoint(m)?(p.pop(),E=!0):(m[a]=h[a],S=!0):m[a]=h[a]:(m=i.targetAnchor.toJSON(),m[a]=h[a],C.containsPoint(m)?E=!0:(p.push(m),S=!0)),typeof o=="function"&&v){if(E){const O=u.targetAnchor.clone();O[a]=h[a];const A=se(o,i,O,v,i.targetMagnet||v.container,"target",i,this);this.resetAnchor("target",A)}S&&this.resetAnchor("target",u.targetAnchorDef)}M.equalPoints(p,this.vertices)||this.cellView.cell.setVertices(p,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,m,0),r.stopPropagation||i.notifyMouseMove(d,f.x,f.y)}onHandleChange({handle:e,e:t}){const s=this.options,r=this.handles,i=this.cellView,o=e.options.index;if(Array.isArray(r)){for(let a=0,c=r.length;a<c;a+=1)a!==o&&r[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:ke(this.cell.prop(["source","anchor"])),targetAnchorDef:ke(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!s.stopPropagation){const a=this.normalizeEvent(t),c=this.graph.snapToGrid(a.clientX,a.clientY);i.notifyMouseDown(a,c.x,c.y)}}}onHandleChanged({e}){const t=this.options,s=this.cellView;t.removeRedundancies&&s.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||s.notifyMouseUp(r,i.x,i.y),s.checkMouseleave(r),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}updateHandle(e,t,s,r=0){const i=this.options.precision||0,o=Math.abs(t.x-s.x)<i,a=Math.abs(t.y-s.y)<i;if(o||a){const c=new K(t,s);if(c.length()<this.options.threshold)e.hide();else{const d=c.getCenter(),f=o?"x":"y";d[f]+=r||0;const h=c.vector().vectorAngle(new M(1,0));e.updatePosition(d.x,d.y,h,this.cellView),e.show(),e.options.axis=f}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends be{constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=be.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 M(s,r))||new M(s,r);let c=ot().translate(a.x,a.y);if(a.equals({x:s,y:r}))c=c.rotate(i);else{let d=new K(s,r,a.x,a.y).vector().vectorAngle(new M(1,0));d!==0&&(d+=90),c=c.rotate(d)}this.setAttrs({transform:Wr(c),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=e})(go||(go={})),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:e=>new n.Handle(e),anchor:Eb})}(go||(go={}));class hl extends Ke.ToolItem{get type(){return this.options.type}onRender(){ee(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const s=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(s),a=r.cell.prop([s,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const c=a?i.customAnchorAttrs:i.defaultAnchorAttrs;c&&Object.keys(c).forEach(u=>{t.setAttribute(u,c[u])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const s=this.type,r=this.cellView,i=r.getTerminalView(s);if(i){const o=i.cell,a=r.getTerminalMagnet(s);let c=this.options.areaPadding||0;Number.isFinite(c)||(c=0);let u,d,f;i.isEdgeElement(a)?(u=i.getBBox(),d=0,f=u.getCenter()):(u=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),f=u.getCenter(),d&&f.rotate(-d,o.getBBox().getCenter())),u.inflate(c),pe(t,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${f.x}, ${f.y}) rotate(${d})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.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(e){const t=this.type,s=this.cell;e?s.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):s.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,s=this.cellView,r=s.getTerminalView(t);if(r==null)return;const i=this.normalizeEvent(e),o=r.cell,a=s.getTerminalMagnet(t);let c=this.graph.coord.clientToLocalPoint(i.clientX,i.clientY);const u=this.options.snap;if(typeof u=="function"){const h=se(u,s,c,r,a,t,s,this);c=M.create(h)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const h=r.getClosestPoint(c);h&&(c=h)}else{const h=r.getUnrotatedBBoxOfElement(a),p=o.getAngle(),g=o.getBBox().getCenter(),m=c.clone().rotate(p,g);h.containsPoint(m)||(c=h.getNearestPointToPoint(m).rotate(-p,g))}let d;const f=this.options.anchor;typeof f=="function"&&(d=se(f,s,c,r,a,t,s,this)),this.resetAnchor(d),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),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:Eb,snap(e,t,s,r,i,o){const a=o.options.snapRadius||0,c=r==="source",u=c?0:-1,d=this.cell.getVertexAt(u)||this.getTerminalAnchor(c?"target":"source");return d&&(Math.abs(d.x-e.x)<a&&(e.x=d.x),Math.abs(d.y-e.y)<a&&(e.y=d.y)),e}})})(hl||(hl={}));const RL=hl.define({name:"source-anchor",type:"source"}),IL=hl.define({name:"target-anchor",type:"target"});var LL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class fl extends Ke.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,s=LL(e,["class"]);this.setAttrs(s,this.container),t&&ee(this.container,t)}}onRender(){ee(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,s=t.getTangentAtRatio(e),r=s?s.start:t.getPointAtRatio(e),i=s&&s.vector().vectorAngle(new M(1,0))||0;if(!r)return this;const o=ot().translate(r.x,r.y).rotate(i);return Yr(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const s=this.graph.snapToGrid(e.clientX,e.clientY),r=t.prepareArrowheadDragging(this.type,{x:s.x,y:s.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,r),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,s.x,s.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.cellView,r=this.graph.snapToGrid(t.clientX,t.clientY);s.onMouseUp(t,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"}})})(fl||(fl={}));const BL=fl.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"}}),jL=fl.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 ti extends Ke.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Ke.createElement("div",!1),this.addClass(e,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:e,editor:t}=this;if(!t)return;const{style:s}=t;e.isNode()?this.updateNodeEditorTransform():e.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 t.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:s}=this;if(!s)return;let r=M.create(),i=20,o="",{x:a,y:c}=this.options;const{width:u,height:d}=this.options;if(typeof a<"u"&&typeof c<"u"){const p=t.getBBox();a=gn(a,p.width),c=gn(c,p.height),r=p.topLeft.translate(a,c),i=p.width-a*2}else{const p=t.getBBox();r=p.center,i=p.width-4,o="translate(-50%, -50%)"}const f=e.scale(),{style:h}=s;r=e.localToGraph(r),h.left=`${r.x}px`,h.top=`${r.y}px`,h.transform=`scale(${f.sx}, ${f.sy}) ${o}`,h.minWidth=`${i}px`,typeof u=="number"&&(h.width=`${u}px`),typeof d=="number"&&(h.height=`${d}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let s=M.create(),r=20;const{style:i}=t,o=this.event.target,a=o.parentElement;if(a&&_n(a,this.prefixClassName("edge-label"))){const d=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(d,10);const f=a.getAttribute("transform"),{translation:h}=rl(f);s=new M(h.tx,h.ty),r=Ee.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=e.clientToLocal(M.create(this.event.clientX,this.event.clientY));const f=this.cellView.path.closestPointLength(s);this.distance=f,this.labelIndex=-1}s=e.localToGraph(s);const u=e.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(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){this.editor||(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return se(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){se(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const s=this.cell;if(this.labelIndex===-1){if(e){const r={position:{distance:this.distance},attrs:{}};Ur(r,`attrs/${t}`,e),s.appendLabel(r)}}else e!==null?s.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&s.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.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"}})})(ti||(ti={})),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"})}(ti||(ti={}));var Mb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},ni;(function(n){n.presets={boundary:dl,button:As,"button-remove":As.Remove,"node-editor":ti.NodeEditor},n.registry=Ue.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let s=Ke.ToolItem;const{inherit:r}=t,i=Mb(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(ni||(ni={}));var si;(function(n){n.presets={boundary:dl,vertices:po,segments:go,button:As,"button-remove":As.Remove,"source-anchor":RL,"target-anchor":IL,"source-arrowhead":BL,"target-arrowhead":jL,"edge-editor":ti.EdgeEditor},n.registry=Ue.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let s=Ke.ToolItem;const{inherit:r}=t,i=Mb(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(si||(si={}));const $L=es("center"),zL=es("topCenter"),FL=es("bottomCenter"),UL=es("leftMiddle"),HL=es("rightMiddle"),GL=es("topLeft"),WL=es("topRight"),YL=es("bottomLeft"),qL=es("bottomRight");function es(n){return function(e,t,s,r={}){const i=r.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=i[n];o.x+=gn(r.dx,i.width),o.y+=gn(r.dy,i.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function pl(n){return function(e,t,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=Pb(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new M;return n.call(this,e,t,o,r)}return n.apply(this,arguments)}}function Pb(n,e){const t=Kn(e),s=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const XL=pl(function(n,e,t,s){const r=ye.normalize(n.cell.getAngle()),i=n.getBBoxOfElement(e),o=i.getCenter(),a=i.getTopLeft(),c=i.getBottomRight();let u=s.padding;if(Number.isFinite(u)||(u=0),a.y+u<=t.y&&t.y<=c.y-u){const d=t.y-o.y;o.x+=r===0||r===180?0:d*1/Math.tan(ye.toRad(r)),o.y+=d}else if(a.x+u<=t.x&&t.x<=c.x-u){const d=t.x-o.x;o.y+=r===90||r===270?0:d*Math.tan(ye.toRad(r)),o.x+=d}return o}),JL=function(n,e,t,s,r){const i=n.cell.getConnectionPoint(this.cell,r);return(s.dx||s.dy)&&i.translate(s.dx||0,s.dy||0),i},KL=pl(function(n,e,t,s){let r,i=0,o;const a=n.cell;s.rotate?(r=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),i=a.getAngle()):r=n.getBBoxOfElement(e);const c=s.padding;c!=null&&Number.isFinite(c)&&r.inflate(c),s.rotate&&t.rotate(i,o);const u=r.getNearestSideToPoint(t);let d;switch(u){case"left":d=r.getLeftMiddle();break;case"right":d=r.getRightMiddle();break;case"top":d=r.getTopCenter();break;case"bottom":d=r.getBottomCenter();break}const f=s.direction;return f==="H"?(u==="top"||u==="bottom")&&(t.x<=r.x+r.width?d=r.getLeftMiddle():d=r.getRightMiddle()):f==="V"&&(t.y<=r.y+r.height?d=r.getTopCenter():d=r.getBottomCenter()),s.rotate?d.rotate(-i,o):d}),ZL=Object.freeze(Object.defineProperty({__proto__:null,bottom:FL,bottomLeft:YL,bottomRight:qL,center:$L,left:UL,midSide:KL,nodeCenter:JL,orth:XL,right:HL,top:zL,topLeft:GL,topRight:WL},Symbol.toStringTag,{value:"Module"}));var ri;(function(n){n.presets=ZL,n.registry=Ue.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(ri||(ri={}));const QL=function(n,e,t,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},eB=function(n,e,t,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},Nb=function(n,e,t,s){const r=n.getClosestPoint(t);return r??new M},tB=pl(Nb),nB=pl(function(n,e,t,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new K(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),c=new K(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),u=a.intersect(i,{segmentSubdivisions:o}),d=c.intersect(i,{segmentSubdivisions:o}),f=[];return u&&f.push(...u),d&&f.push(...d),f.length>0?t.closest(f):s.fallbackAt!=null?Pb(n,s.fallbackAt):se(Nb,this,n,e,t,s)}),sB=Object.freeze(Object.defineProperty({__proto__:null,closest:tB,length:eB,orth:nB,ratio:QL},Symbol.toStringTag,{value:"Module"}));var ii;(function(n){n.presets=sB,n.registry=Ue.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(ii||(ii={}));function gl(n,e,t){let s;if(typeof t=="object"){if(Number.isFinite(t.y)){const i=new K(e,n),{start:o,end:a}=i.parallel(t.y);e=o,n=a}s=t.x}else s=t;if(s==null||!Number.isFinite(s))return n;const r=n.distance(e);return s===0&&r>0?n:n.move(e,-Math.min(s,r-1))}function ml(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function rB(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const Ab=function(n,e,t,s){const r=e.getBBoxOfElement(t);s.stroked&&r.inflate(ml(t)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return gl(o,n.start,s.offset)},iB=function(n,e,t,s,r){const i=e.cell,o=i.isNode()?i.getAngle():0;if(o===0)return se(Ab,this,n,e,t,s,r);const a=e.getUnrotatedBBoxOfElement(t);s.stroked&&a.inflate(ml(t)/2);const c=a.getCenter(),u=n.clone().rotate(o,c),d=u.setLength(1e6).intersect(a),f=d&&d.length?u.start.closest(d).rotate(-o,c):n.end;return gl(f,n.start,s.offset)},oB=function(n,e,t,s){let r,i;const o=n.end,a=s.selector;if(typeof a=="string"?r=e.findOne(a):Array.isArray(a)?r=Bu(t,a):r=rB(t),!ws(r)){if(r===t||!ws(t))return o;r=t}const c=e.getShapeOfElement(r),u=e.getMatrixOfElement(r),d=e.getRootTranslatedMatrix(),f=e.getRootRotatedMatrix(),h=d.multiply(f).multiply(u),p=h.inverse(),g=Ee.transformLine(n,p),m=g.start.clone(),y=e.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=c.bbox());const v=y.shapeBBox;if(v!=null&&v.containsPoint(m))return o}s.extrapolate===!0&&g.setLength(1e6);let b;if(re.isPath(c)){const v=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:v})),b={precision:v,segmentSubdivisions:y.segmentSubdivisions},i=g.intersect(c,b)}else i=g.intersect(c);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(G.isRectangle(c)?i=c.getNearestPointToPoint(m):bn.isEllipse(c)?i=c.intersectsWithLineFromCenterToPoint(m):i=c.closestPoint(m,b));const w=i?Ee.transformPoint(i,h):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+=ml(r)/2):x+=ml(r)/2),gl(w,n.start,x)};function aB(n,e,t=0){const{start:s,end:r}=n;let i,o,a,c;switch(e){case"left":c="x",i=r,o=s,a=-1;break;case"right":c="x",i=s,o=r,a=1;break;case"top":c="y",i=r,o=s,a=-1;break;case"bottom":c="y",i=s,o=r,a=1;break;default:return}s[c]<r[c]?i[c]=o[c]:o[c]=i[c],Number.isFinite(t)&&(i[c]+=a*t,o[c]+=a*t)}const lB=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,s){const{alignOffset:r,align:i}=s;return i&&aB(n,i,r),gl(n.end,n.start,s.offset)},bbox:Ab,boundary:oB,rect:iB},Symbol.toStringTag,{value:"Module"}));var oi;(function(n){n.presets=lB,n.registry=Ue.create({type:"connection point"}),n.registry.register(n.presets,!0)})(oi||(oi={}));const cB=function(n){return[...n]},uB=function(n,e,t){const s=e.side||"bottom",r=ys(e.padding||40),i=t.sourceBBox,o=t.targetBBox,a=i.getCenter(),c=o.getCenter();let u,d,f;switch(s){case"top":f=-1,u="y",d="height";break;case"left":f=-1,u="x",d="width";break;case"right":f=1,u="x",d="width";break;case"bottom":default:f=1,u="y",d="height";break}return a[u]+=f*(i[d]/2+r[s]),c[u]+=f*(o[d]/2+r[s]),f*(a[u]-c[u])>0?c[u]=a[u]:a[u]=c[u],[a.toJSON(),...n,c.toJSON()]};function yl(n){return new G(n.x,n.y,0,0)}function bl(n={}){const e=ys(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function _b(n,e={}){return n.sourceBBox.clone().moveAndExpand(bl(e))}function Tb(n,e={}){return n.targetBBox.clone().moveAndExpand(bl(e))}function dB(n,e={}){return n.sourceAnchor?n.sourceAnchor:_b(n,e).getCenter()}function hB(n,e={}){return n.targetAnchor?n.targetAnchor:Tb(n,e).getCenter()}const kb=function(n,e,t){let s=_b(t,e),r=Tb(t,e);const i=dB(t,e),o=hB(t,e);s=s.union(yl(i)),r=r.union(yl(o));const a=n.map(d=>M.create(d));a.unshift(i),a.push(o);let c=null;const u=[];for(let d=0,f=a.length-1;d<f;d+=1){let h=null;const p=a[d],g=a[d+1],m=Kt.getBearing(p,g)!=null;if(d===0)d+1===f?s.intersectsWithRect(r.clone().inflate(1))?h=Kt.insideNode(p,g,s,r):m||(h=Kt.nodeToNode(p,g,s,r)):s.containsPoint(g)?h=Kt.insideNode(p,g,s,yl(g).moveAndExpand(bl(e))):m||(h=Kt.nodeToVertex(p,g,s));else if(d+1===f){const y=m&&Kt.getBearing(g,p)===c;r.containsPoint(p)||y?h=Kt.insideNode(p,g,yl(p).moveAndExpand(bl(e)),r,c):m||(h=Kt.vertexToNode(p,g,r,c))}else m||(h=Kt.vertexToVertex(p,g,c));h?(u.push(...h.points),c=h.direction):c=Kt.getBearing(p,g),d+1<f&&u.push(g)}return u};var Kt;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function s(f,h,p){let g=new M(f.x,h.y);return p.containsPoint(g)&&(g=new M(h.x,f.y)),g}function r(f,h){return f[h==="W"||h==="E"?"width":"height"]}n.getBBoxSize=r;function i(f,h){return f.x===h.x?f.y>h.y?"N":"S":f.y===h.y?f.x>h.x?"W":"E":null}n.getBearing=i;function o(f,h,p){const g=new M(f.x,h.y),m=new M(h.x,f.y),y=i(f,g),b=i(f,m),w=p?e[p]:null,x=y===p||y!==w&&(b===w||b!==p)?g:m;return{points:[x],direction:i(x,h)}}n.vertexToVertex=o;function a(f,h,p){const g=s(f,h,p);return{points:[g],direction:i(g,h)}}n.nodeToVertex=a;function c(f,h,p,g){const m=[new M(f.x,h.y),new M(h.x,f.y)],y=m.filter(x=>!p.containsPoint(x)),b=y.filter(x=>i(x,f)!==g);let w;if(b.length>0)return w=b.filter(x=>i(f,x)===g).pop(),w=w||b[0],{points:[w],direction:i(w,h)};{w=pP(m,y)[0];const x=M.create(h).move(w,-r(p,g)/2);return{points:[s(x,f,p),x],direction:i(x,h)}}}n.vertexToNode=c;function u(f,h,p,g){let m=a(h,f,g);const y=m.points[0];if(p.containsPoint(y)){m=a(f,h,p);const b=m.points[0];if(g.containsPoint(b)){const w=M.create(f).move(b,-r(p,i(f,b))/2),x=M.create(h).move(y,-r(g,i(h,y))/2),v=new K(w,x).getCenter(),C=a(f,v,p),E=o(v,h,C.direction);m.points=[C.points[0],E.points[0]],m.direction=E.direction}}return m}n.nodeToNode=u;function d(f,h,p,g,m){const y=p.union(g).inflate(1),b=y.getCenter(),w=b.distance(h)>b.distance(f),x=w?h:f,v=w?f:h;let C,E,S;m?(C=M.fromPolar(y.width+y.height,t[m],x),C=y.getNearestPointToPoint(C).move(C,-1)):C=y.getNearestPointToPoint(x).move(x,1),E=s(C,v,y);let O;C.round().equals(E.round())?(E=M.fromPolar(y.width+y.height,ye.toRad(C.theta(x))+Math.PI/2,v),E=y.getNearestPointToPoint(E).move(v,1).round(),S=s(C,E,y),O=w?[E,S,C]:[C,S,E]):O=w?[E,C]:[C,E];const A=i(w?C:E,h);return{points:O,direction:A}}n.insideNode=d})(Kt||(Kt={}));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 _s(this.step,this)},directions(){const n=_s(this.step,this),e=_s(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=_s(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=_s(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:kb,draggingRouter:null,snapToGrid:!0};function _s(n,e){return typeof n=="function"?n.call(e):n}function pB(n){const e=Object.keys(n).reduce((t,s)=>{const r=t;return s==="fallbackRouter"||s==="draggingRouter"||s==="fallbackRoute"?r[s]=n[s]:r[s]=_s(n[s],n),t},{});if(e.padding){const t=ys(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const s=new M(0,0),r=new M(t.offsetX,t.offsetY);t.angle=ye.normalize(s.theta(r))}),e}const Vb=1,Db=2;class gB{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Vb,this.values[e]=t;const s=WP(this.items,e,r=>this.values[r]);this.items.splice(s,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Db),e}isOpen(e){return this.hash[e]===Vb}isClose(e){return this.hash[e]===Db}isEmpty(){return this.items.length===0}}class mB{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const s=this.options,r=s.excludeTerminals.reduce((u,d)=>{const f=t[d];if(f){const h=e.getCell(f.cell);h&&u.push(h)}return u},[]);let i=[];const o=e.getCell(t.getSourceCellId());o&&(i=Ap(i,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(i=Ap(i,a.getAncestors().map(u=>u.id)));const c=this.mapGridSize;return e.getNodes().reduce((u,d)=>{const f=r.some(y=>y.id===d.id),h=d.shape?s.excludeShapes.includes(d.shape):!1,p=s.excludeNodes.some(y=>typeof y=="string"?d.id===y:y===d),g=i.includes(d.id),m=h||f||p||g;if(d.isVisible()&&!m){const y=d.getBBox().moveAndExpand(s.paddingBox),b=y.getOrigin().snapToGrid(c),w=y.getCorner().snapToGrid(c);for(let x=b.x;x<=w.x;x+=c)for(let v=b.y;v<=w.y;v+=c){const C=new M(x,v).toString();u[C]==null&&(u[C]=[]),u[C].push(y)}}return u},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),s=this.map[t];return s?s.every(r=>!r.containsPoint(e)):!0}}function Rb(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Ib(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Lb(n,e){return n.sourceAnchor?n.sourceAnchor:Rb(n,e).getCenter()}function yB(n,e){return n.targetAnchor?n.targetAnchor:Ib(n,e).getCenter()}function pd(n,e,t,s,r){const i=360/t,o=n.theta(bB(n,e,s,r)),a=ye.normalize(o+i/2);return i*Math.floor(a/i)}function bB(n,e,t,s){const r=s.step,i=e.x-n.x,o=e.y-n.y,a=i/t.x,c=o/t.y,u=a*r,d=c*r;return new M(n.x+u,n.y+d)}function Bb(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function wB(n,e){const t=e.step;return e.directions.forEach(s=>{s.gridOffsetX=s.offsetX/t*n.x,s.gridOffsetY=s.offsetY/t*n.y}),e.directions}function xB(n,e,t){return{source:e.clone(),x:jb(t.x-e.x,n),y:jb(t.y-e.y,n)}}function jb(n,e){if(!n)return e;const t=Math.abs(n),s=Math.round(t/e);if(!s)return t;const r=s*e,o=(t-r)/s;return e+o}function vB(n,e){const t=e.source,s=Se.snapToGrid(n.x-t.x,e.x)+t.x,r=Se.snapToGrid(n.y-t.y,e.y)+t.y;return new M(s,r)}function mo(n,e){return n.round(e)}function wl(n,e,t){return mo(vB(n.clone(),e),t)}function yo(n){return n.toString()}function gd(n){return new M(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function $b(n,e){let t=1/0;for(let s=0,r=e.length;s<r;s+=1){const i=n.manhattanDistance(e[s]);i<t&&(t=i)}return t}function zb(n,e,t,s,r){const i=r.precision,o=r.directionMap,a=n.diff(e.getCenter()),c=Object.keys(o).reduce((u,d)=>{if(t.includes(d)){const f=o[d],h=new M(n.x+f.x*(Math.abs(a.x)+e.width),n.y+f.y*(Math.abs(a.y)+e.height)),g=new K(n,h).intersect(e)||[];let m,y=null;for(let b=0;b<g.length;b+=1){const w=g[b],x=n.squaredDistance(w);(m==null||x>m)&&(m=x,y=w)}if(y){let b=wl(y,s,i);e.containsPoint(b)&&(b=wl(b.translate(f.x*s.x,f.y*s.y),s,i)),u.push(b)}}return u},[]);return e.containsPoint(n)||c.push(wl(n,s,i)),c}function CB(n,e,t,s,r){const i=[];let o=gd(r.diff(t)),a=yo(t),c=n[a],u;for(;c;){u=e[a];const h=gd(u.diff(c));h.equals(o)||(i.unshift(u),o=h),a=yo(c),c=n[a]}const d=e[a];return gd(d.diff(s)).equals(o)||i.unshift(d),i}function SB(n,e,t,s,r){const i=r.precision;let o,a;G.isRectangle(e)?o=mo(Lb(n,r).clone(),i):o=mo(e.clone(),i),G.isRectangle(t)?a=mo(yB(n,r).clone(),i):a=mo(t.clone(),i);const c=xB(r.step,o,a),u=o,d=a;let f,h;if(G.isRectangle(e)?f=zb(u,e,r.startDirections,c,r):f=[u],G.isRectangle(t)?h=zb(a,t,r.endDirections,c,r):h=[d],f=f.filter(p=>s.isAccessible(p)),h=h.filter(p=>s.isAccessible(p)),f.length>0&&h.length>0){const p=new gB,g={},m={},y={};for(let k=0,_=f.length;k<_;k+=1){const V=f[k],L=yo(V);p.add(L,$b(V,h)),g[L]=V,y[L]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,v;const C=wB(c,r),E=C.length,S=h.reduce((k,_)=>{const V=yo(_);return k.push(V),k},[]),O=M.equalPoints(f,h);let A=r.maxLoopCount;for(;!p.isEmpty()&&A>0;){const k=p.pop(),_=g[k],V=m[k],L=y[k],B=_.equals(u),N=V==null;let P;if(N?w?B?P=null:P=pd(u,_,E,c,r):P=b:P=pd(V,_,E,c,r),!(N&&O)&&S.indexOf(k)>=0)return r.previousDirectionAngle=P,CB(m,g,_,u,d);for(let j=0;j<E;j+=1){x=C[j];const Y=x.angle;if(v=Bb(P,Y),!(w&&B)&&v>r.maxDirectionChange)continue;const te=wl(_.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),c,i),z=yo(te);if(p.isClose(z)||!s.isAccessible(te))continue;if(S.indexOf(z)>=0&&!te.equals(d)){const q=pd(te,d,E,c,r);if(Bb(Y,q)>r.maxDirectionChange)continue}const I=x.cost,U=B?0:r.penalties[v],F=L+I+U;(!p.isOpen(z)||F<y[z])&&(g[z]=te,m[z]=_,y[z]=F,p.add(z,F+$b(te,h)))}A-=1}}return r.fallbackRoute?se(r.fallbackRoute,this,u,d,r):null}function EB(n,e=10){if(n.length<=1)return n;for(let t=0,s=n.length;t<s-1;t+=1){const r=n[t],i=n[t+1];if(r.x===i.x){const o=e*Math.round(r.x/e);r.x!==o&&(r.x=o,i.x=o)}else if(r.y===i.y){const o=e*Math.round(r.y/e);r.y!==o&&(r.y=o,i.y=o)}}return n}const OB=function(n,e,t){const s=pB(e),r=Rb(t,s),i=Ib(t,s),o=Lb(t,s),a=new mB(s).build(t.graph.model,t.cell),c=n.map(p=>M.create(p)),u=[];let d=o,f,h;for(let p=0,g=c.length;p<=g;p+=1){let m=null;if(f=h||r,h=c[p],h==null){h=i;const b=t.cell;if((b.getSourceCellId()==null||b.getTargetCellId()==null)&&typeof s.draggingRouter=="function"){const x=f===r?o:f,v=h.getOrigin();m=se(s.draggingRouter,t,x,v,s)}}if(m==null&&(m=SB(t,f,h,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),se(s.fallbackRouter,this,n,s,t);const y=m[0];y&&y.equals(d)&&m.shift(),d=m[m.length-1]||d,u.push(...m)}return s.snapToGrid?EB(u,t.graph.grid.getGridSize()):u},Fb=function(n,e,t){return se(OB,this,n,Object.assign(Object.assign({},fB),e),t)},MB={maxDirectionChange:45,directions(){const n=_s(this.step,this),e=_s(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const s=n.theta(e),r=[];let i={x:e.x,y:n.y},o={x:n.x,y:e.y};if(s%180>90){const x=i;i=o,o=x}const a=s%90<45?i:o,c=new K(n,a),u=90*Math.ceil(s/90),d=M.fromPolar(c.squaredLength(),ye.toRad(u+135),a),f=new K(e,d),h=c.intersectsWithLine(f),p=h||e,g=h?p:n,m=360/t.directions.length,y=g.theta(e),b=ye.normalize(y+m/2),w=m*Math.floor(b/m);return t.previousDirectionAngle=w,p&&r.push(p.round()),r.push(e),r}},PB=function(n,e,t){return se(Fb,this,n,Object.assign(Object.assign({},MB),e),t)},NB=function(n,e,t){const s=e.offset||32,r=e.min==null?16:e.min;let i=0,o=e.direction;const a=t.sourceBBox,c=t.targetBBox,u=a.getCenter(),d=c.getCenter();if(typeof s=="number"&&(i=s),o==null){let b=c.left-a.right,w=c.top-a.bottom;b>=0&&w>=0?o=b>=w?"L":"T":b<=0&&w>=0?(b=a.left-c.right,b>=0?o=b>=w?"R":"T":o="T"):b>=0&&w<=0?(w=a.top-c.bottom,w>=0?o=b>=w?"L":"B":o="L"):(b=a.left-c.right,w=a.top-c.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=d.x-u.x>=0?"L":"R":o==="V"&&(o=d.y-u.y>=0?"T":"B"),s==="center"&&(o==="L"?i=(c.left-a.right)/2:o==="R"?i=(a.left-c.right)/2:o==="T"?i=(c.top-a.bottom)/2:o==="B"&&(i=(a.top-c.bottom)/2));let f,h,p;const g=o==="L"||o==="R";if(g){if(d.y===u.y)return[...n];p=o==="L"?1:-1,f="x",h="width"}else{if(d.x===u.x)return[...n];p=o==="T"?1:-1,f="y",h="height"}const m=u.clone(),y=d.clone();if(m[f]+=p*(a[h]/2+i),y[f]-=p*(c[h]/2+i),g){const b=m.x,w=y.x,x=a.width/2+r,v=c.width/2+r;d.x>u.x?w<=b&&(m.x=Math.max(w,u.x+x),y.x=Math.min(b,d.x-v)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,d.x+v))}else{const b=m.y,w=y.y,x=a.height/2+r,v=c.height/2+r;d.y>u.y?w<=b&&(m.y=Math.max(w,u.y+x),y.y=Math.min(b,d.y-v)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,d.y+v))}return[m.toJSON(),...n,y.toJSON()]};function ai(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const s=M.create(n[1]).move(n[2],t),r=M.create(n[1]).move(n[0],t);return[s.toJSON(),...n,r.toJSON()]}{const s=n[1];return[Object.assign({},s),...n,Object.assign({},s)]}}return n}const AB=Object.freeze(Object.defineProperty({__proto__:null,er:NB,loop:function(n,e,t){const s=e.width||50,i=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,c=t.targetAnchor,u=t.sourceBBox,d=t.targetBBox;if(a.equals(c)){const f=b=>{const w=ye.toRad(b),x=Math.sin(w),v=Math.cos(w),C=new M(a.x+v*s,a.y+x*s),E=new M(C.x-v*i,C.y-x*i),S=E.clone().rotate(-90,C),O=E.clone().rotate(90,C);return[S.toJSON(),C.toJSON(),O.toJSON()]},h=b=>{const w=a.clone().move(b,-1),x=new K(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},p=[0,90,180,270,45,135,225,315];if(typeof o=="number")return ai(f(o),e.merge);const g=u.getCenter();if(g.equals(a))return ai(f(0),e.merge);const m=g.angleBetween(a,g.clone().translate(1,0));let y=f(m);if(h(y[1]))return ai(y,e.merge);for(let b=1,w=p.length;b<w;b+=1)if(y=f(m+p[b]),h(y[1]))return ai(y,e.merge);return ai(y,e.merge)}{const f=new K(a,c);let h=f.parallel(-s),p=h.getCenter(),g=h.start.clone().move(h.end,i),m=h.end.clone().move(h.start,i);const y=f.parallel(-1),b=new K(y.start,p),w=new K(y.end,p);if((u.containsPoint(p)||d.containsPoint(p)||u.intersectsWithLine(b)||u.intersectsWithLine(w)||d.intersectsWithLine(b)||d.intersectsWithLine(w))&&(h=f.parallel(s),p=h.getCenter(),g=h.start.clone().move(h.end,i),m=h.end.clone().move(h.start,i)),e.merge){const x=new K(a,c),v=new K(p,x.center).setLength(Number.MAX_SAFE_INTEGER),C=u.intersectsWithLine(v),E=d.intersectsWithLine(v),S=C?Array.isArray(C)?C:[C]:[];E&&(Array.isArray(E)?S.push(...E):S.push(E));const O=x.center.closest(S);O?(t.sourceAnchor=O.clone(),t.targetAnchor=O.clone()):(t.sourceAnchor=x.center.clone(),t.targetAnchor=x.center.clone())}return ai([g.toJSON(),p.toJSON(),m.toJSON()],e.merge)}},manhattan:Fb,metro:PB,normal:cB,oneSide:uB,orth:kb},Symbol.toStringTag,{value:"Module"}));var Ts;(function(n){n.presets=AB,n.registry=Ue.create({type:"router"}),n.registry.register(n.presets,!0)})(Ts||(Ts={}));const _B=function(n,e,t,s={}){const r=[n,...t,e],i=new Fe(r),o=new re(i);return s.raw?o:o.serialize()},TB=function(n,e,t,s={}){const r=t.length===3?0:1,i=M.create(t[0+r]),o=M.create(t[2+r]),a=M.create(t[1+r]);if(!M.equals(n,e)){const u=new M((n.x+e.x)/2,(n.y+e.y)/2),d=u.angleBetween(M.create(n).rotate(90,u),a);d>1&&(i.rotate(180-d,u),o.rotate(180-d,u),a.rotate(180-d,u))}const c=`
119
+ `.trim()}const HR=Object.freeze(Object.defineProperty({__proto__:null,blur:RR,brightness:FR,contrast:UR,dropShadow:IR,grayScale:LR,highlight:DR,hueRotate:$R,invert:zR,outline:VR,saturate:jR,sepia:BR},Symbol.toStringTag,{value:"Module"}));var Zr;(function(n){n.presets=HR,n.registry=Ue.create({type:"filter"}),n.registry.register(n.presets,!0)})(Zr||(Zr={}));const GR={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"},WR={},Jy={position:cl("x","width","origin")},Ky={position:cl("y","height","origin")},YR={position:cl("x","width","corner")},qR={position:cl("y","height","corner")},Zy={set:Es("width","width")},Qy={set:Es("height","height")},XR={set:Es("rx","width")},JR={set:Es("ry","height")},eb={set:(n=>{const e=Es(n,"width"),t=Es(n,"height");return function(s,r){const i=r.refBBox,o=i.height>i.width?e:t;return se(o,this,s,r)}})("r")},KR={set(n,{refBBox:e}){let t=parseFloat(n);const s=Kn(n);s&&(t/=100);const r=Math.sqrt(e.height*e.height+e.width*e.width);let i;return Number.isFinite(t)&&(s||t>=0&&t<=1?i=t*r:i=Math.max(t+r,0)),{r:i}}},ZR={set:Es("cx","width")},QR={set:Es("cy","height")},tb={set:rb({resetOffset:!0})},eI={set:rb({resetOffset:!1})},nb={set:ib({resetOffset:!0})},tI={set:ib({resetOffset:!1})},nI=eb,sI=tb,rI=nb,iI=Jy,oI=Ky,aI=Zy,lI=Qy;function cl(n,e,t){return(s,{refBBox:r})=>{if(s==null)return null;let i=parseFloat(s);const o=Kn(s);o&&(i/=100);let a;if(Number.isFinite(i)){const u=r[t];o||i>0&&i<1?a=u[n]+r[e]*i:a=u[n]+i}const c=new M;return c[n]=a||0,c}}function Es(n,e){return function(t,{refBBox:s}){let r=parseFloat(t);const i=Kn(t);i&&(r/=100);const o={};if(Number.isFinite(r)){const a=i||r>=0&&r<=1?r*s[e]:Math.max(r+s[e],0);o[n]=a}return o}}function sb(n,e){const t="x6-shape",s=e&&e.resetOffset;return function(r,{elem:i,refBBox:o}){let a=nr(i,t);if(!a||a.value!==r){const m=n(r);a={value:r,shape:m,shapeBBox:m.bbox()},nr(i,t,a)}const c=a.shape.clone(),u=a.shapeBBox.clone(),d=u.getOrigin(),f=o.getOrigin();u.x=f.x,u.y=f.y;const h=o.getMaxScaleToFit(u,f),p=u.width===0||o.width===0?1:h.sx,g=u.height===0||o.height===0?1:h.sy;return c.scale(p,g,d),s&&c.translate(-d.x,-d.y),c}}function rb(n){function e(s){return re.parse(s)}const t=sb(e,n);return(s,r)=>({d:t(s,r).serialize()})}function ib(n){const e=sb(t=>new Fe(t),n);return(t,s)=>({points:e(t,s).serialize()})}const cI={qualify:Mn,set(n,{view:e}){return`url(#${e.graph.defineGradient(n)})`}},uI={qualify:Mn,set(n,{view:e}){const t=e.cell,s=Object.assign({},n);if(t.isEdge()&&s.type==="linearGradient"){const r=e,i=r.sourcePoint,o=r.targetPoint;s.id=`gradient-${s.type}-${t.id}`,s.attrs=Object.assign(Object.assign({},s.attrs),{x1:i.x,y1:i.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(s.id)}return`url(#${e.graph.defineGradient(s)})`}},ob={qualify(n,{attrs:e}){return e.textWrap==null||!Mn(e.textWrap)},set(n,{view:e,elem:t,attrs:s}){const r="x6-text",i=nr(t,r),o=d=>{try{return JSON.parse(d)}catch{return d}},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},c=s["font-size"]||s.fontSize,u=JSON.stringify([n,a]);if(c&&t.setAttribute("font-size",c),i==null||i!==u){const d=a.textPath;if(d!=null&&typeof d=="object"){const f=d.selector;if(typeof f=="string"){const h=e.find(f)[0];h instanceof SVGPathElement&&(Hu(h),a.textPath=Object.assign({"xlink:href":`#${h.id}`},d))}}Dy(t,`${n}`,a),nr(t,r,u)}}},dI={qualify:Mn,set(n,{view:e,elem:t,attrs:s,refBBox:r}){const i=n,o=i.width||0;Kn(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=i.height||0;Kn(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let c,u=i.text;u==null&&(u=s.text||(t==null?void 0:t.textContent)),u!=null?c=Iy(`${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}):c="",se(ob.set,this,c,{view:e,elem:t,attrs:s,refBBox:r,cell:e.cell})}},Qr=(n,{attrs:e})=>e.text!==void 0,hI={qualify:Qr},fI={qualify:Qr},pI={qualify:Qr},gI={qualify:Qr},mI={qualify:Qr},yI={qualify:Qr},bI={qualify(n,{elem:e}){return e instanceof SVGElement},set(n,{elem:e}){const t="x6-title",s=`${n}`,r=nr(e,t);if(r==null||r!==s){nr(e,t,s);const i=e.firstChild;if(i&&i.tagName.toUpperCase()==="TITLE"){const o=i;o.textContent=s}else{const o=document.createElementNS(e.namespaceURI,"title");o.textContent=s,e.insertBefore(o,i)}}}},wI={offset:ab("x","width","right")},xI={offset:ab("y","height","bottom")},vI={offset(n,{refBBox:e}){return n?{x:-e.x,y:-e.y}:{x:0,y:0}}};function ab(n,e,t){return(s,{refBBox:r})=>{const i=new M;let o;return s==="middle"?o=r[e]/2:s===t?o=r[e]:typeof s=="number"&&Number.isFinite(s)?o=s>-1&&s<1?-r[e]*s:-s:Kn(s)?o=r[e]*parseFloat(s)/100:o=0,i[n]=-(r[n]+o),i}}const CI={qualify:Mn,set(n,{elem:e}){Je(e,n)}},SI={set(n,{elem:e}){e.innerHTML=`${n}`}},EI={qualify:Mn,set(n,{view:e}){return`url(#${e.graph.defineFilter(n)})`}},OI={set(n){return n!=null&&typeof n=="object"&&n.id?n.id:n}};function Os(n,e,t){let s,r;typeof e=="object"?(s=e.x,r=e.y):(s=e,r=t);const i=re.parse(n),o=i.bbox();if(o){let a=-o.height/2-o.y,c=-o.width/2-o.x;typeof s=="number"&&(c-=s),typeof r=="number"&&(a-=r),i.translate(c,a)}return i.serialize()}var lb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const MI=n=>{var{size:e,width:t,height:s,offset:r,open:i}=n,o=lb(n,["size","width","height","offset","open"]);return cb({size:e,width:t,height:s,offset:r},i===!0,!0,void 0,o)},PI=n=>{var{size:e,width:t,height:s,offset:r,factor:i}=n,o=lb(n,["size","width","height","offset","factor"]);return cb({size:e,width:t,height:s,offset:r},!1,!1,i,o)};function cb(n,e,t,s=3/4,r={}){const i=n.size||10,o=n.width||i,a=n.height||i,c=new re,u={};if(e)c.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),u.fill="none";else{if(c.moveTo(0,a/2),c.lineTo(o,0),!t){const d=Ct(s,0,1);c.lineTo(o*d,a/2)}c.lineTo(o,a),c.close()}return Object.assign(Object.assign(Object.assign({},u),r),{tagName:"path",d:Os(c.serialize(),{x:n.offset!=null?n.offset:-o/2})})}var NI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const AI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=NI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new re;return u.moveTo(0,c/2).lineTo(a/2,0).lineTo(a,c/2).lineTo(a/2,c).close(),Object.assign(Object.assign({},i),{tagName:"path",d:Os(u.serialize(),r??-a/2)})};var _I=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const TI=n=>{var{d:e,offsetX:t,offsetY:s}=n,r=_I(n,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Os(e,t,s)})};var kI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const VI=n=>{var{size:e,width:t,height:s,offset:r}=n,i=kI(n,["size","width","height","offset"]);const o=e||10,a=t||o,c=s||o,u=new re;return u.moveTo(0,0).lineTo(a,c).moveTo(0,c).lineTo(a,0),Object.assign(Object.assign({},i),{tagName:"path",fill:"none",d:Os(u.serialize(),r||-a/2)})};var DI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const RI=n=>{var{width:e,height:t,offset:s,open:r,flip:i}=n,o=DI(n,["width","height","offset","open","flip"]);let a=t||6;const c=e||10,u=r===!0,d=i===!0,f=Object.assign(Object.assign({},o),{tagName:"path"});d&&(a=-a);const h=new re;return h.moveTo(0,a).lineTo(c,0),u?f.fill="none":(h.lineTo(c,a),h.close()),f.d=Os(h.serialize(),{x:s||-c/2,y:a/2}),f};var ub=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const db=n=>{var{r:e}=n,t=ub(n,["r"]);const s=e||5;return Object.assign(Object.assign({cx:s},t),{tagName:"circle",r:s})},II=n=>{var{r:e}=n,t=ub(n,["r"]);const s=e||5,r=new re;return r.moveTo(s,0).lineTo(s,s*2),r.moveTo(0,s).lineTo(s*2,s),{children:[Object.assign(Object.assign({},db({r:s})),{fill:"none"}),Object.assign(Object.assign({},t),{tagName:"path",d:Os(r.serialize(),-s)})]}};var LI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const BI=Object.freeze(Object.defineProperty({__proto__:null,async:RI,block:MI,circle:db,circlePlus:II,classic:PI,cross:VI,diamond:AI,ellipse:n=>{var{rx:e,ry:t}=n,s=LI(n,["rx","ry"]);const r=e||5,i=t||5;return Object.assign(Object.assign({cx:r},s),{tagName:"ellipse",rx:r,ry:i})},path:TI},Symbol.toStringTag,{value:"Module"}));var Ms;(function(n){n.presets=BI,n.registry=Ue.create({type:"marker"}),n.registry.register(n.presets,!0)})(Ms||(Ms={})),function(n){n.normalize=Os}(Ms||(Ms={}));var jI=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function ld(n){return typeof n=="string"||Mn(n)}const $I={qualify:ld,set(n,{view:e,attrs:t}){return cd("marker-start",n,e,t)}},zI={qualify:ld,set(n,{view:e,attrs:t}){return cd("marker-end",n,e,t,{transform:"rotate(180)"})}},FI={qualify:ld,set(n,{view:e,attrs:t}){return cd("marker-mid",n,e,t)}};function cd(n,e,t,s,r={}){const i=typeof e=="string"?{name:e}:e,{name:o,args:a}=i,c=jI(i,["name","args"]);let u=c;if(o&&typeof o=="string"){const f=Ms.registry.get(o);if(f)u=f(Object.assign(Object.assign({},c),a));else return Ms.registry.onNotFound(o)}const d=Object.assign(Object.assign(Object.assign({},UI(s,n)),r),u);return{[n]:`url(#${t.graph.defineMarker(d)})`}}function UI(n,e){const t={},s=n.stroke;typeof s=="string"&&(t.stroke=s,t.fill=s);let r=n.strokeOpacity;if(r==null&&(r=n["stroke-opacity"]),r==null&&(r=n.opacity),r!=null&&(t["stroke-opacity"]=r,t["fill-opacity"]=r),e!=="marker-mid"){const i=parseFloat(n.strokeWidth||n["stroke-width"]);if(Number.isFinite(i)&&i>1){const o=Math.ceil(i/2);t.refX=e==="marker-start"?o:-o}}return t}const ho=(n,{view:e})=>e.cell.isEdge(),HI={qualify:ho,set(n,e){var t,s,r,i;const o=e.view,a=n.reverse||!1,c=n.stubs||0;let u;if(Number.isFinite(c)&&c!==0)if(a){let d,f;const h=o.getConnectionLength()||0;c<0?(d=(h+c)/2,f=-c):(d=c,f=h-c*2);const p=o.getConnection();u=(i=(r=(s=(t=p==null?void 0:p.divideAtLength(d))===null||t===void 0?void 0:t[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 d;c<0?d=((o.getConnectionLength()||0)+c)/2:d=c;const f=o.getConnection();if(f){const h=f.divideAtLength(d),p=f.divideAtLength(-d);h&&p&&(u=`${h[0].serialize()} ${p[1].serialize()}`)}}return{d:u||o.getConnectionPathData()}}},hb={qualify:ho,set:ul("getTangentAtLength",{rotate:!0})},GI={qualify:ho,set:ul("getTangentAtLength",{rotate:!1})},fb={qualify:ho,set:ul("getTangentAtRatio",{rotate:!0})},WI={qualify:ho,set:ul("getTangentAtRatio",{rotate:!1})},YI=hb,qI=fb;function ul(n,e){const t={x:1,y:0};return(s,r)=>{let i,o;const a=r.view,c=a[n](Number(s));return c?(o=e.rotate?c.vector().vectorAngle(t):0,i=c.start):(i=a.path.start,o=0),o===0?{transform:`translate(${i.x},${i.y}')`}:{transform:`translate(${i.x},${i.y}') rotate(${o})`}}}const XI=Object.freeze(Object.defineProperty({__proto__:null,annotations:gI,atConnectionLength:YI,atConnectionLengthIgnoreGradient:GI,atConnectionLengthKeepGradient:hb,atConnectionRatio:qI,atConnectionRatioIgnoreGradient:WI,atConnectionRatioKeepGradient:fb,connection:HI,displayEmpty:yI,eol:mI,fill:cI,filter:EI,html:SI,lineHeight:hI,port:OI,ref:WR,refCx:ZR,refCy:QR,refD:sI,refDKeepOffset:eI,refDResetOffset:tb,refDx:YR,refDy:qR,refHeight:Qy,refHeight2:lI,refPoints:rI,refPointsKeepOffset:tI,refPointsResetOffset:nb,refR:nI,refRCircumscribed:KR,refRInscribed:eb,refRx:XR,refRy:JR,refWidth:Zy,refWidth2:aI,refX:Jy,refX2:iI,refY:Ky,refY2:oI,resetOffset:vI,sourceMarker:$I,stroke:uI,style:CI,targetMarker:zI,text:ob,textPath:pI,textVerticalAnchor:fI,textWrap:dI,title:bI,vertexMarker:FI,xAlign:wI,yAlign:xI},Symbol.toStringTag,{value:"Module"}));var kn;(function(n){function e(t,s,r){return!!(t!=null&&(typeof t=="string"||typeof t.qualify!="function"||se(t.qualify,this,s,r)))}n.isValidDefinition=e})(kn||(kn={})),function(n){n.presets=Object.assign(Object.assign({},GR),XI),n.registry=Ue.create({type:"attribute definition"}),n.registry.register(n.presets,!0)}(kn||(kn={}));const Jt={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,prefix(n){return`${Jt.prefixCls}-${n}`}},pb=Jt.prefix("highlighted"),JI={highlight(n,e,t){const s=t&&t.className||pb;ee(e,s)},unhighlight(n,e,t){const s=t&&t.className||pb;Ie(e,s)}},gb=Jt.prefix("highlight-opacity"),KI={highlight(n,e){ee(e,gb)},unhighlight(n,e){Ie(e,gb)}};var Ee;(function(n){n.normalizeMarker=Os;function e(h,p){const g=uR(h.x,h.y).matrixTransform(p);return new M(g.x,g.y)}n.transformPoint=e;function t(h,p){return new K(e(h.start,p),e(h.end,p))}n.transformLine=t;function s(h,p){let g=h instanceof Fe?h.points:h;return Array.isArray(g)||(g=[]),new Fe(g.map(m=>e(m,p)))}n.transformPolyline=s;function r(h,p){const m=yn("svg").createSVGPoint();m.x=h.x,m.y=h.y;const y=m.matrixTransform(p);m.x=h.x+h.width,m.y=h.y;const b=m.matrixTransform(p);m.x=h.x+h.width,m.y=h.y+h.height;const w=m.matrixTransform(p);m.x=h.x,m.y=h.y+h.height;const x=m.matrixTransform(p),S=Math.min(y.x,b.x,w.x,x.x),v=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 G(S,E,v-S,C-E)}n.transformRectangle=r;function i(h,p,g){let m;const y=h.ownerSVGElement;if(!y)return new G(0,0,0,0);try{m=h.getBBox()}catch{m={x:h.clientLeft,y:h.clientTop,width:h.clientWidth,height:h.clientHeight}}if(p)return G.create(m);const b=io(h,g||y);return r(m,b)}n.bbox=i;function o(h,p={}){let g;if(!h.ownerSVGElement||!ws(h)){if(Ey(h)){const{left:w,top:x,width:S,height:v}=a(h);return new G(w,x,S,v)}return new G(0,0,0,0)}let y=p.target;if(!p.recursive){try{g=h.getBBox()}catch{g={x:h.clientLeft,y:h.clientTop,width:h.clientWidth,height:h.clientHeight}}if(!y)return G.create(g);const w=io(h,y);return r(g,w)}{const w=h.childNodes,x=w.length;if(x===0)return o(h,{target:y});y||(y=h);for(let S=0;S<x;S+=1){const v=w[S];let E;v.childNodes.length===0?E=o(v,{target:y}):E=o(v,{target:y,recursive:!0}),g?g=g.union(E):g=E}return g}}n.getBBox=o;function a(h){let p=0,g=0,m=0,y=0;if(h){let b=h;for(;b;)p+=b.offsetLeft,g+=b.offsetTop,b=b.offsetParent,b&&(p+=parseInt(Ty(b,"borderLeft"),10),g+=parseInt(Ty(b,"borderTop"),10));m=h.offsetWidth,y=h.offsetHeight}return{left:p,top:g,width:m,height:y}}n.getBoundingOffsetRect=a;function c(h){const p=g=>{const m=h.getAttribute(g),y=m?parseFloat(m):0;return Number.isNaN(y)?0:y};switch(h instanceof SVGElement&&h.nodeName.toLowerCase()){case"rect":return new G(p("x"),p("y"),p("width"),p("height"));case"circle":return new bn(p("cx"),p("cy"),p("r"),p("r"));case"ellipse":return new bn(p("cx"),p("cy"),p("rx"),p("ry"));case"polyline":{const g=sl(h);return new Fe(g)}case"polygon":{const g=sl(h);return g.length>1&&g.push(g[0]),new Fe(g)}case"path":{let g=h.getAttribute("d");return re.isValid(g)||(g=re.normalize(g)),re.parse(g)}case"line":return new K(p("x1"),p("y1"),p("x2"),p("y2"))}return o(h)}n.toGeometryShape=c;function u(h,p,g,m){const y=M.create(p),b=M.create(g);m||(m=h instanceof SVGSVGElement?h:h.ownerSVGElement);const w=nd(h);h.setAttribute("transform","");const x=o(h,{target:m}).scale(w.sx,w.sy),S=so();S.setTranslate(-x.x-x.width/2,-x.y-x.height/2);const v=so(),E=y.angleBetween(b,y.clone().translate(1,0));E&&v.setRotate(E,0,0);const C=so(),O=y.clone().move(b,x.width/2);C.setTranslate(2*y.x-O.x,2*y.y-O.y);const A=io(h,m),k=so();k.setMatrix(C.matrix.multiply(v.matrix.multiply(S.matrix.multiply(A.scale(w.sx,w.sy))))),h.setAttribute("transform",Wr(k.matrix))}n.translateAndAutoOrient=u;function d(h){if(h==null)return null;let p=h;do{let g=p.tagName;if(typeof g!="string")return null;if(g=g.toUpperCase(),_n(p,"x6-port"))p=p.nextElementSibling;else if(g==="G")p=p.firstElementChild;else if(g==="TITLE")p=p.nextElementSibling;else break}while(p);return p}n.findShapeNode=d;function f(h){const p=d(h);if(!ws(p)){if(Ey(h)){const{left:y,top:b,width:w,height:x}=a(h);return new G(y,b,w,x)}return new G(0,0,0,0)}return c(p).bbox()||G.create()}n.getBBoxV2=f})(Ee||(Ee={}));const ZI={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},QI={highlight(n,e,t){const s=Ps.getHighlighterId(e,t);if(Ps.hasCache(s))return;t=Op({},t,ZI);const r=oe.create(e);let i,o;try{i=r.toPathData()}catch{o=Ee.bbox(r.node,!0),i=By(Object.assign(Object.assign({},t),o))}const a=yn("path");if(pe(a,Object.assign({d:i,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},t.attrs?to(t.attrs):null)),n.isEdgeElement(e))pe(a,"d",n.getConnectionPathData());else{let d=r.getTransformToElement(n.container);const f=t.padding;if(f){o==null&&(o=Ee.bbox(r.node,!0));const h=o.x+o.width/2,p=o.y+o.height/2;o=Ee.transformRectangle(o,d);const g=Math.max(o.width,1),m=Math.max(o.height,1),y=(g+f)/g,b=(m+f)/m,w=ot({a:y,b:0,c:0,d:b,e:h-y*h,f:p-b*p});d=d.multiply(w)}Yr(a,d)}ee(a,Jt.prefix("highlight-stroke"));const c=n.cell,u=()=>Ps.removeHighlighter(s);c.on("removed",u),c.model&&c.model.on("reseted",u),n.container.appendChild(a),Ps.setCache(s,a)},unhighlight(n,e,t){Ps.removeHighlighter(Ps.getHighlighterId(e,t))}};var Ps;(function(n){function e(o,a){return Hu(o),o.id+JSON.stringify(a)}n.getHighlighterId=e;const t={};function s(o,a){t[o]=a}n.setCache=s;function r(o){return t[o]!=null}n.hasCache=r;function i(o){const a=t[o];a&&(Yt(a),delete t[o])}n.removeHighlighter=i})(Ps||(Ps={}));const eL=Object.freeze(Object.defineProperty({__proto__:null,className:JI,opacity:KI,stroke:QI},Symbol.toStringTag,{value:"Module"}));var Qn;(function(n){function e(t,s){if(typeof s.highlight!="function")throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if(typeof s.unhighlight!="function")throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}n.check=e})(Qn||(Qn={})),function(n){n.presets=eL,n.registry=Ue.create({type:"highlighter"}),n.registry.register(n.presets,!0)}(Qn||(Qn={}));function ud(n,e={}){return new M(gn(e.x,n.width),gn(e.y,n.height))}function dd(n,e,t){return Object.assign({angle:e,position:n.toJSON()},t)}const tL=(n,e)=>n.map(({x:t,y:s,angle:r})=>dd(ud(e,{x:t,y:s}),r||0)),nL=(n,e,t)=>{const s=t.start||0,r=t.step||20;return mb(n,e,s,(i,o)=>(i+.5-o/2)*r)},sL=(n,e,t)=>{const s=t.start||0,r=t.step||360/n.length;return mb(n,e,s,i=>i*r)};function mb(n,e,t,s){const r=e.getCenter(),i=e.getTopCenter(),o=e.width/e.height,a=bn.fromRect(e),c=n.length;return n.map((u,d)=>{const f=t+s(d,c),h=i.clone().rotate(-f,r).scale(o,1,r),p=u.compensateRotate?-a.tangentTheta(h):0;return(u.dx||u.dy)&&h.translate(u.dx||0,u.dy||0),u.dr&&h.move(r,u.dr),dd(h.round(),p,u)})}var rL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const iL=(n,e,t)=>{const s=ud(e,t.start||e.getOrigin()),r=ud(e,t.end||e.getCorner());return fo(n,s,r,t)},oL=(n,e,t)=>fo(n,e.getTopLeft(),e.getBottomLeft(),t),aL=(n,e,t)=>fo(n,e.getTopRight(),e.getBottomRight(),t),lL=(n,e,t)=>fo(n,e.getTopLeft(),e.getTopRight(),t),cL=(n,e,t)=>fo(n,e.getBottomLeft(),e.getBottomRight(),t);function fo(n,e,t,s){const r=new K(e,t),i=n.length;return n.map((o,a)=>{var{strict:c}=o,u=rL(o,["strict"]);const d=c||s.strict?(a+1)/(i+1):(a+.5)/i,f=r.pointAt(d);return(u.dx||u.dy)&&f.translate(u.dx||0,u.dy||0),dd(f.round(),0,u)})}const uL=Object.freeze(Object.defineProperty({__proto__:null,absolute:tL,bottom:cL,ellipse:nL,ellipseSpread:sL,left:oL,line:iL,right:aL,top:lL},Symbol.toStringTag,{value:"Module"}));var or;(function(n){n.presets=uL,n.registry=Ue.create({type:"port layout"}),n.registry.register(n.presets,!0)})(or||(or={}));const dL={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ns(n,e){const{x:t,y:s,angle:r,attrs:i}=e||{};return Op({},{angle:r,attrs:i,position:{x:t,y:s}},n,dL)}const hL=(n,e,t)=>Ns({position:e.getTopLeft()},t),fL=(n,e,t)=>Ns({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},t),pL=(n,e,t)=>Ns({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},t),gL=(n,e,t)=>Ns({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},t),mL=(n,e,t)=>Ns({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},t),yL=(n,e,t)=>yb(n,e,!1,t),bL=(n,e,t)=>yb(n,e,!0,t),wL=(n,e,t)=>bb(n,e,!1,t),xL=(n,e,t)=>bb(n,e,!0,t);function yb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=wb(e);let a,c,u,d,f=0;return i<o[1]||i>o[2]?(a=".3em",c=r,u=0,d="start"):i<o[0]?(a="0",c=0,u=-r,t?(f=-90,d="start"):d="middle"):i<o[3]?(a=".3em",c=-r,u=0,d="end"):(a=".6em",c=0,u=r,t?(f=90,d="start"):d="middle"),Ns({position:{x:Math.round(c),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":d}}},s)}function bb(n,e,t,s){const r=s.offset!=null?s.offset:15,i=e.getCenter().theta(n),o=wb(e);let a,c,u,d,f=0;return i<o[1]||i>o[2]?(a=".3em",c=-r,u=0,d="end"):i<o[0]?(a=".6em",c=0,u=r,t?(f=90,d="start"):d="middle"):i<o[3]?(a=".3em",c=r,u=0,d="start"):(a="0em",c=0,u=-r,t?(f=-90,d="start"):d="middle"),Ns({position:{x:Math.round(c),y:Math.round(u)},angle:f,attrs:{".":{y:a,"text-anchor":d}}},s)}function wb(n){const e=n.getCenter(),t=e.theta(n.getTopLeft()),s=e.theta(n.getBottomLeft()),r=e.theta(n.getBottomRight()),i=e.theta(n.getTopRight());return[t,i,r,s]}const vL=(n,e,t)=>xb(n.diff(e.getCenter()),!1,t),CL=(n,e,t)=>xb(n.diff(e.getCenter()),!0,t);function xb(n,e,t){const s=t.offset!=null?t.offset:20,r=new M(0,0),i=-n.theta(r),o=n.clone().move(r,s).diff(n).round();let a=".3em",c,u=i;return(i+90)%180===0?(c=e?"end":"middle",!e&&i===-270&&(a="0em")):i>-270&&i<-90?(c="start",u=i-180):c="end",Ns({position:o.round().toJSON(),angle:e?u:0,attrs:{".":{y:a,"text-anchor":c}}},t)}const SL=Object.freeze(Object.defineProperty({__proto__:null,bottom:mL,inside:wL,insideOriented:xL,left:fL,manual:hL,outside:yL,outsideOriented:bL,radial:vL,radialOriented:CL,right:pL,top:gL},Symbol.toStringTag,{value:"Module"}));var ei;(function(n){n.presets=SL,n.registry=Ue.create({type:"port label layout"}),n.registry.register(n.presets,!0)})(ei||(ei={}));var EL=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class be extends Ve{get priority(){return 2}get disposeContainer(){return!0}constructor(){super(),this.cid=hd.uniqueId(),be.views[this.cid]=this}confirmUpdate(e,t){return 0}empty(e=this.container){return eo(e),this}unmount(e=this.container){return Yt(e),this}remove(e=this.container){return e===this.container?(this.removeEventListeners(document),this.onRemove(),delete be.views[this.cid],this.disposeContainer&&this.unmount(e)):this.unmount(e),this}onRemove(){}setClass(e,t=this.container){t.classList.value=Array.isArray(e)?e.join(" "):e}addClass(e,t=this.container){return ee(t,Array.isArray(e)?e.join(" "):e),this}removeClass(e,t=this.container){return Ie(t,Array.isArray(e)?e.join(" "):e),this}setStyle(e,t=this.container){return Je(t,e),this}setAttrs(e,t=this.container){return e!=null&&t!=null&&pe(t,e),this}findAttr(e,t=this.container){let s=t;for(;s&&s.nodeType===1;){const r=s.getAttribute(e);if(r!=null)return r;if(s===this.container)return null;s=s.parentNode}return null}find(e,t=this.container,s=this.selectors){return be.find(e,t,s).elems}findOne(e,t=this.container,s=this.selectors){const r=this.find(e,t,s);return r.length>0?r[0]:null}findByAttr(e,t=this.container){let s=t;for(;s&&s.getAttribute;){const r=s.getAttribute(e);if((r!=null||s===this.container)&&r!=="false")return s;s=s.parentNode}return null}getSelector(e,t){let s;if(e===this.container)return typeof t=="string"&&(s=`> ${t}`),s;if(e){const r=Wu(e)+1;s=`${e.tagName.toLowerCase()}:nth-child(${r})`,t&&(s+=` > ${t}`),s=this.getSelector(e.parentNode,s)}return s}prefixClassName(e){return Jt.prefix(e)}delegateEvents(e,t){if(e==null)return this;t||this.undelegateEvents();const s=/^(\S+)\s*(.*)$/;return Object.keys(e).forEach(r=>{const i=r.match(s);if(i==null)return;const o=this.getEventHandler(e[r]);typeof o=="function"&&this.delegateEvent(i[1],i[2],o)}),this}undelegateEvents(){return dt.off(this.container,this.getEventNamespace()),this}delegateDocumentEvents(e,t){return this.addEventListeners(document,e,t),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(e,t,s){return dt.on(this.container,e+this.getEventNamespace(),t,s),this}undelegateEvent(e,t,s){const r=e+this.getEventNamespace();return t==null?dt.off(this.container,r):typeof t=="string"?dt.off(this.container,r,t,s):dt.off(this.container,r,t),this}addEventListeners(e,t,s){if(t==null)return this;const r=this.getEventNamespace();return Object.keys(t).forEach(i=>{const o=this.getEventHandler(t[i]);typeof o=="function"&&dt.on(e,i+r,s,o)}),this}removeEventListeners(e){return e!=null&&dt.off(e,this.getEventNamespace()),this}getEventNamespace(){return`.${Jt.prefixCls}-event-${this.cid}`}getEventHandler(e){let t;if(typeof e=="string"){const s=this[e];typeof s=="function"&&(t=(...r)=>s.call(this,...r))}else t=(...s)=>e.call(this,...s);return t}getEventTarget(e,t={}){const{target:s,type:r,clientX:i=0,clientY:o=0}=e;return t.fromPoint||r==="touchmove"||r==="touchend"?document.elementFromPoint(i,o):s}stopPropagation(e){return this.setEventData(e,{propagationStopped:!0}),this}isPropagationStopped(e){return this.getEventData(e).propagationStopped===!0}getEventData(e){return this.eventData(e)}setEventData(e,t){return this.eventData(e,t)}eventData(e,t){if(e==null)throw new TypeError("Event object required");let s=e.data;const r=`__${this.cid}__`;return t==null?s==null?{}:s[r]||{}:(s==null&&(s=e.data={}),s[r]==null?s[r]=Object.assign({},t):s[r]=Object.assign(Object.assign({},s[r]),t),s[r])}normalizeEvent(e){return be.normalizeEvent(e)}dispose(){this.remove()}}EL([be.dispose()],be.prototype,"dispose",null),function(n){function e(r,i){return i?yn(r||"g"):Gu(r||"div")}n.createElement=e;function t(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=t;function s(r){let i=r;const o=r.originalEvent,a=o&&o.changedTouches&&o.changedTouches[0];if(a){for(const c in r)a[c]===void 0&&(a[c]=r[c]);i=a}return i}n.normalizeEvent=s}(be||(be={})),function(n){n.views={};function e(t){return n.views[t]||null}n.getView=e}(be||(be={}));var hd;(function(n){let e=0;function t(){const s=`v${e}`;return e+=1,s}n.uniqueId=t})(hd||(hd={}));class OL{constructor(e){this.view=e,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new id,this.pathCache={}}get(e){return this.elemCache.has(e)||this.elemCache.set(e,{}),this.elemCache.get(e)}getData(e){const t=this.get(e);return t.data||(t.data={}),t.data}getMatrix(e){const t=this.get(e);if(t.matrix==null){const s=this.view.container;t.matrix=gR(e,s)}return ot(t.matrix)}getShape(e){const t=this.get(e);return t.shape==null&&(t.shape=Ee.toGeometryShape(e)),t.shape.clone()}getBoundingRect(e){const t=this.get(e);return t.boundingRect==null&&(t.boundingRect=Ee.getBBoxV2(e)),t.boundingRect.clone()}}var De;(function(n){function e(u){return u!=null&&!t(u)}n.isJSONMarkup=e;function t(u){return u!=null&&typeof u=="string"}n.isStringMarkup=t;function s(u){return u==null||t(u)?u:ke(u)}n.clone=s;function r(u){return`${u}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}n.sanitize=r;function i(u,d={ns:it.svg}){const f=document.createDocumentFragment(),h={},p={},g=[{markup:Array.isArray(u)?u:[u],parent:f,ns:d.ns}];for(;g.length>0;){const m=g.pop();let y=m.ns||it.svg;const b=m.markup,w=m.parent;b.forEach(x=>{const S=x.tagName;if(!S)throw new TypeError("Invalid tagName");x.ns&&(y=x.ns);const v=y?Gu(S,y):vy(S),E=x.attrs;E&&pe(v,to(E));const C=x.style;C&&Je(v,C);const O=x.className;O!=null&&v.setAttribute("class",Array.isArray(O)?O.join(" "):O),x.textContent&&(v.textContent=x.textContent);const A=x.selector;if(A!=null){if(p[A])throw new TypeError("Selector must be unique");p[A]=v}if(x.groupSelector){let _=x.groupSelector;Array.isArray(_)||(_=[_]),_.forEach(V=>{h[V]||(h[V]=[]),h[V].push(v)})}w.appendChild(v);const k=x.children;Array.isArray(k)&&g.push({ns:y,markup:k,parent:v})})}return Object.keys(h).forEach(m=>{if(p[m])throw new Error("Ambiguous group selector");p[m]=h[m]}),{fragment:f,selectors:p,groups:h}}n.parseJSONMarkup=i;function o(u){return u instanceof SVGElement?yn("g"):vy("div")}function a(u){if(t(u)){const p=oe.createVectors(u),g=p.length;if(g===1)return{elem:p[0].node};if(g>1){const m=o(p[0].node);return p.forEach(y=>{m.appendChild(y.node)}),{elem:m}}return{}}const d=i(u),f=d.fragment;let h=null;return f.childNodes.length>1?(h=o(f.firstChild),h.appendChild(f)):h=f.firstChild,{elem:h,selectors:d.selectors}}n.renderMarkup=a;function c(u){const d=oe.createVectors(u),f=document.createDocumentFragment();for(let h=0,p=d.length;h<p;h+=1){const g=d[h].node;f.appendChild(g)}return{fragment:f,selectors:{}}}n.parseLabelStringMarkup=c})(De||(De={})),function(n){function e(t,s,r){if(t!=null){let i;const o=t.tagName.toLowerCase();if(t===s)return typeof r=="string"?i=`> ${o} > ${r}`:i=`> ${o}`,i;const a=t.parentNode;if(a&&a.childNodes.length>1){const c=Wu(t)+1;i=`${o}:nth-child(${c})`}else i=o;return r&&(i+=` > ${r}`),e(t.parentNode,s,i)}return r}n.getSelector=e}(De||(De={})),function(n){function e(){return"g"}n.getPortContainerMarkup=e;function t(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}n.getPortMarkup=t;function s(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}n.getPortLabelMarkup=s}(De||(De={})),function(n){function e(){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=e}(De||(De={})),function(n){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:it.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:it.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}n.getForeignObjectMarkup=e}(De||(De={}));class vb{constructor(e){this.view=e}get cell(){return this.view.cell}getDefinition(e){return this.cell.getAttrDefinition(e)}processAttrs(e,t){let s,r,i,o;const a=[];return Object.keys(t).forEach(c=>{const u=t[c],d=this.getDefinition(c),f=se(kn.isValidDefinition,this.view,d,u,{elem:e,attrs:t,cell:this.cell,view:this.view});if(d&&f)typeof d=="string"?(s==null&&(s={}),s[d]=u):u!==null&&a.push({name:c,definition:d});else{s==null&&(s={});const h=Oy.includes(c)?c:sy(c);s[h]=u}}),a.forEach(({name:c,definition:u})=>{const d=t[c];typeof u.set=="function"&&(r==null&&(r={}),r[c]=d),typeof u.offset=="function"&&(i==null&&(i={}),i[c]=d),typeof u.position=="function"&&(o==null&&(o={}),o[c]=d)}),{raw:t,normal:s,set:r,offset:i,position:o}}mergeProcessedAttrs(e,t){e.set=Object.assign(Object.assign({},e.set),t.set),e.position=Object.assign(Object.assign({},e.position),t.position),e.offset=Object.assign(Object.assign({},e.offset),t.offset);const s=e.normal&&e.normal.transform;s!=null&&t.normal&&(t.normal.transform=s),e.normal=t.normal}findAttrs(e,t,s,r){const i=[],o=new id;return Object.keys(e).forEach(a=>{const c=e[a];if(!Mn(c))return;const{isCSSSelector:u,elems:d}=be.find(a,t,r);s[a]=d;for(let f=0,h=d.length;f<h;f+=1){const p=d[f],g=r&&r[a]===p,m=o.get(p);if(m){m.array||(i.push(p),m.array=!0,m.attrs=[m.attrs],m.priority=[m.priority]);const y=m.attrs,b=m.priority;if(g)y.unshift(c),b.unshift(-1);else{const w=GP(b,u?-1:h);y.splice(w,0,c),b.splice(w,0,h)}}else o.set(p,{elem:p,attrs:c,priority:g?-1:h,array:!1})}}),i.forEach(a=>{const c=o.get(a),u=c.attrs;c.attrs=u.reduceRight((d,f)=>Ye(d,f),{})}),o}updateRelativeAttrs(e,t,s){const r=t.raw||{};let i=t.normal||{};const o=t.set,a=t.position,c=t.offset,u=()=>({elem:e,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=se(w.set,this.view,b,u());typeof x=="object"?i=Object.assign(Object.assign({},i),x):x!=null&&(i[y]=x)}}),e instanceof HTMLElement){this.view.setAttrs(i,e);return}const d=i.transform,f=d?`${d}`:null,h=ro(f),p=new M(h.e,h.f);d&&(delete i.transform,h.e=0,h.f=0);let g=!1;a!=null&&Object.keys(a).forEach(y=>{const b=a[y],w=this.getDefinition(y);if(w!=null){const x=se(w.position,this.view,b,u());x!=null&&(g=!0,p.translate(M.create(x)))}}),this.view.setAttrs(i,e);let m=!1;if(c!=null){const y=this.view.getBoundingRectOfElement(e);if(y.width>0&&y.height>0){const b=Ee.transformRectangle(y,h);Object.keys(c).forEach(w=>{const x=c[w],S=this.getDefinition(w);if(S!=null){const v=se(S.offset,this.view,x,{elem:e,cell:this.cell,view:this.view,attrs:r,refBBox:b});v!=null&&(m=!0,p.translate(M.create(v)))}})}}(d!=null||g||m)&&(p.round(1),h.e=p.x,h.f=p.y,e.setAttribute("transform",Wr(h)))}update(e,t,s){const r={},i=this.findAttrs(s.attrs||t,e,r,s.selectors),o=s.attrs?this.findAttrs(t,e,r,s.selectors):i,a=[];i.each(d=>{const f=d.elem,h=d.attrs,p=this.processAttrs(f,h);if(p.set==null&&p.position==null&&p.offset==null)this.view.setAttrs(p.normal,f);else{const g=o.get(f),m=g?g.attrs:null,y=m&&h.ref==null?m.ref:h.ref;let b;if(y){if(b=(r[y]||this.view.find(y,e,s.selectors))[0],!b)throw new Error(`"${y}" reference does not exist.`)}else b=null;const w={node:f,refNode:b,attributes:m,processedAttributes:p},x=a.findIndex(S=>S.refNode===f);x>-1?a.splice(x,0,w):a.push(w)}});const c=new id;let u;a.forEach(d=>{const f=d.node,h=d.refNode;let p;const g=h!=null&&s.rotatableNode!=null&&Yu(s.rotatableNode,h);if(h&&(p=c.get(h)),!p){const b=g?s.rotatableNode:e;p=h?Ee.getBBox(h,{target:b}):s.rootBBox,h&&c.set(h,p)}let m;s.attrs&&d.attributes?(m=this.processAttrs(f,d.attributes),this.mergeProcessedAttrs(m,d.processedAttributes)):m=d.processedAttributes;let y=p;g&&s.rotatableNode!=null&&!s.rotatableNode.contains(f)&&(u||(u=ro(pe(s.rotatableNode,"transform"))),y=Ee.transformRectangle(p,u)),this.updateRelativeAttrs(f,m,y)})}}class Cb{get cell(){return this.view.cell}constructor(e,t,s=[]){this.view=e;const r={},i={};let o=0;Object.keys(t).forEach(c=>{let u=t[c];Array.isArray(u)||(u=[u]),u.forEach(d=>{let f=r[d];f||(o+=1,f=r[d]=1<<o),i[c]|=f})});let a=s;if(Array.isArray(a)||(a=[a]),a.forEach(c=>{r[c]||(o+=1,r[c]=1<<o)}),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=r,this.attrs=i,this.bootstrap=s}getFlag(e){const t=this.flags;return t==null?0:Array.isArray(e)?e.reduce((s,r)=>s|t[r],0):t[e]|0}hasAction(e,t){return e&this.getFlag(t)}removeAction(e,t){return e^e&this.getFlag(t)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let e=0;return this.attrs&&Object.keys(this.attrs).forEach(t=>{this.cell.hasChanged(t)&&(e|=this.attrs[t])}),e}}var ML=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},PL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class He extends be{static getDefaults(){return this.defaults}static config(e){this.defaults=this.getOptions(e)}static getOptions(e){const t=(u,d)=>d!=null?Tp([...Array.isArray(u)?u:[u],...Array.isArray(d)?d:[d]]):Array.isArray(u)?[...u]:[u],s=ke(this.getDefaults()),{bootstrap:r,actions:i,events:o,documentEvents:a}=e,c=PL(e,["bootstrap","actions","events","documentEvents"]);return r&&(s.bootstrap=t(s.bootstrap,r)),i&&Object.entries(i).forEach(([u,d])=>{const f=s.actions[u];d&&f?s.actions[u]=t(f,d):d&&(s.actions[u]=t(d))}),o&&(s.events=Object.assign(Object.assign({},s.events),o)),e.documentEvents&&(s.documentEvents=Object.assign(Object.assign({},s.documentEvents),a)),Ye(s,c)}get[Symbol.toStringTag](){return He.toStringTag}constructor(e,t={}){super(),this.cell=e,this.options=this.ensureOptions(t),this.graph=this.options.graph,this.attr=new vb(this),this.flag=new Cb(this,this.options.actions,this.options.bootstrap),this.cache=new OL(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(e){return this.getConstructor().getOptions(e)}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 be.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(e){if(this.container!==e){this.undelegateEvents(),this.container=e,this.options.events!=null&&this.delegateEvents(this.options.events);const t=this.getContainerAttrs();t!=null&&this.setAttrs(t,e);const s=this.getContainerStyle();s!=null&&this.setStyle(s,e);const r=this.getContainerClassName();r!=null&&this.addClass(r,e)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(e,t={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(e){return this.flag.getFlag(e)}hasAction(e,t){return this.flag.hasAction(e,t)}removeAction(e,t){return this.flag.removeAction(e,t)}handleAction(e,t,s,r){if(this.hasAction(e,t)){s();const i=[t];return r&&(typeof r=="string"?i.push(r):i.push(...r)),this.removeAction(e,i)}return e}setup(){this.cell.on("changed",this.onCellChanged,this)}onCellChanged({options:e}){this.onAttrsChange(e)}onAttrsChange(e){let t=this.flag.getChangedFlag();e.updated||!t||(e.dirty&&this.hasAction(t,"update")&&(t|=this.getFlag("render")),e.toolId&&(e.async=!1),this.graph!=null&&this.graph.renderer.requestViewUpdate(this,t,e))}parseJSONMarkup(e,t){const s=De.parseJSONMarkup(e),r=s.selectors,i=this.rootSelector;if(t&&i){if(r[i])throw new Error("Invalid root selector");r[i]=t}return s}can(e){let t=this.graph.options.interacting;if(typeof t=="function"&&(t=se(t,this.graph,this)),typeof t=="object"){let s=t[e];return typeof s=="function"&&(s=se(s,this.graph,this)),s!==!1}return typeof t=="boolean"?t:!1}cleanCache(){return this.cache.clean(),this}getCache(e){return this.cache.get(e)}getDataOfElement(e){return this.cache.getData(e)}getMatrixOfElement(e){return this.cache.getMatrix(e)}getShapeOfElement(e){return this.cache.getShape(e)}getBoundingRectOfElement(e){return this.cache.getBoundingRect(e)}getBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootRotatedMatrix(),i=this.getRootTranslatedMatrix();return Ee.transformRectangle(t,i.multiply(r).multiply(s))}getUnrotatedBBoxOfElement(e){const t=this.getBoundingRectOfElement(e),s=this.getMatrixOfElement(e),r=this.getRootTranslatedMatrix();return Ee.transformRectangle(t,r.multiply(s))}getBBox(e={}){let t;if(e.useCellGeometry){const s=this.cell,r=s.isNode()?s.getAngle():0;t=s.getBBox().bbox(r)}else t=this.getBBoxOfElement(this.container);return this.graph.coord.localToGraphRect(t)}getRootTranslatedMatrix(){const e=this.cell,t=e.isNode()?e.getPosition():{x:0,y:0};return ot().translate(t.x,t.y)}getRootRotatedMatrix(){let e=ot();const t=this.cell,s=t.isNode()?t.getAngle():0;if(s){const r=t.getBBox(),i=r.width/2,o=r.height/2;e=e.translate(i,o).rotate(s).translate(-i,-o)}return e}findMagnet(e=this.container){return this.findByAttr("magnet",e)}updateAttrs(e,t,s={}){s.rootBBox==null&&(s.rootBBox=new G),s.selectors==null&&(s.selectors=this.selectors),this.attr.update(e,t,s)}isEdgeElement(e){return this.cell.isEdge()&&(e==null||e===this.container)}prepareHighlight(e,t={}){const s=e||this.container;return t.partial=s===this.container,s}highlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:highlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}),this}unhighlight(e,t={}){const s=this.prepareHighlight(e,t);return this.notify("cell:unhighlight",{magnet:s,options:t,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:s,options:t,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:s,options:t,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(e,t){}getEdgeTerminal(e,t,s,r,i){const o=this.cell,a=this.findAttr("port",e),c=e.getAttribute("data-selector"),u={cell:o.id};return c!=null&&(u.magnet=c),a!=null?(u.port=a,o.isNode()&&!o.hasPort(a)&&c==null&&(u.selector=this.getSelector(e))):c==null&&this.container!==e&&(u.selector=this.getSelector(e)),u}getMagnetFromEdgeTerminal(e){const t=this.cell,s=this.container,r=e.port;let i=e.magnet,o;return r!=null&&t.isNode()&&t.hasPort(r)?o=this.findPortElem(r,i)||s:(i||(i=e.selector),!i&&r!=null&&(i=`[port="${r}"]`),o=this.findOne(i,s,this.selectors)),o}hasTools(e){const t=this.tools;return t==null?!1:e==null?!0:t.name===e}addTools(e){if(this.removeTools(),e){if(!this.can("toolsAddable"))return this;const t=Ke.isToolsView(e)?e:new Ke(e);this.tools=t,t.config({view:this}),t.mount()}return this}updateTools(e={}){return this.tools&&this.tools.update(e),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 e=this.cell.getTools();return this.addTools(e),this}notify(e,t){return this.trigger(e,t),this.graph.trigger(e,t),this}getEventArgs(e,t,s){const r=this,i=r.cell;return t==null||s==null?{e,view:r,cell:i}:{e,x:t,y:s,view:r,cell:i}}onClick(e,t,s){this.notify("cell:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){this.notify("cell:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){this.notify("cell:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(e,t,s))}onMouseUp(e,t,s){this.notify("cell:mouseup",this.getEventArgs(e,t,s)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(e,t,s){this.notify("cell:mousemove",this.getEventArgs(e,t,s))}onMouseOver(e){this.notify("cell:mouseover",this.getEventArgs(e))}onMouseOut(e){this.notify("cell:mouseout",this.getEventArgs(e))}onMouseEnter(e){this.notify("cell:mouseenter",this.getEventArgs(e))}onMouseLeave(e){this.notify("cell:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){this.notify("cell:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){this.notify("cell:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),this.notify(t,Object.assign({},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){}onMagnetDblClick(e,t,s,r){}onMagnetContextMenu(e,t,s,r){}onLabelMouseDown(e,t,s){}checkMouseleave(e){const t=this.getEventTarget(e,{fromPoint:!0}),s=this.graph.findViewByElem(t);s!==this&&(this.onMouseLeave(e),s&&s.onMouseEnter(e))}dispose(){this.cell.off("changed",this.onCellChanged,this)}}He.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},ML([He.dispose()],He.prototype,"dispose",null),function(n){n.Flag=Cb,n.Attr=vb}(He||(He={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNodeView=="function"&&typeof r.isEdgeView=="function"&&typeof r.confirmUpdate=="function"}n.isCellView=e}(He||(He={})),function(n){function e(s){return function(r){r.config({priority:s})}}n.priority=e;function t(s){return function(r){r.config({bootstrap:s})}}n.bootstrap=t}(He||(He={})),function(n){n.registry=Ue.create({type:"view"})}(He||(He={}));class Ke extends be{get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return Ke.toStringTag}constructor(e={}){super(),this.svgContainer=this.createContainer(!0,e),this.htmlContainer=this.createContainer(!1,e),this.config(e)}createContainer(e,t){const s=e?be.createElement("g",!0):be.createElement("div",!1);return ee(s,this.prefixClassName("cell-tools")),t.className&&ee(s,t.className),s}config(e){if(this.options=Object.assign(Object.assign({},this.options),e),!He.isCellView(e.view)||e.view===this.cellView)return this;this.cellView=e.view,this.cell.isEdge()?(ee(this.svgContainer,this.prefixClassName("edge-tools")),ee(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(ee(this.svgContainer,this.prefixClassName("node-tools")),ee(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 t=this.options.items;if(!Array.isArray(t))return this;this.tools=[];const s=[];t.forEach(r=>{Ke.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(Ke.ToolItem.isToolItem(i))o=i;else{const a=typeof i=="object"?i.name:i,c=typeof i=="object"?i.args||{}:{};if(a){if(this.cell.isNode()){const u=ni.registry.get(a);if(u)o=new u(c);else return ni.registry.onNotFound(a)}else if(this.cell.isEdge()){const u=si.registry.get(a);if(u)o=new u(c);else return si.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(e={}){const t=this.tools;return t&&t.forEach(s=>{e.toolId!==s.cid&&s.isVisible()&&s.update()}),this}focus(e){const t=this.tools;return t&&t.forEach(s=>{e===s?s.show():s.hide()}),this}blur(e){const t=this.tools;return t&&t.forEach(s=>{s!==e&&!s.isVisible()&&(s.show(),s.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const e=this.tools;return e&&(e.forEach(t=>t.remove()),this.tools=null),Yt(this.svgContainer),Yt(this.htmlContainer),super.remove()}mount(){const e=this.tools,t=this.cellView;if(t&&e){const s=e.some(i=>i.options.isSVGElement!==!1),r=e.some(i=>i.options.isSVGElement===!1);s&&(this.options.local?t.container:t.graph.view.decorator).appendChild(this.svgContainer),r&&this.graph.container.appendChild(this.htmlContainer)}return this}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e})(Ke||(Ke={})),function(n){class e extends be{static getDefaults(){return this.defaults}static config(s){this.defaults=this.getOptions(s)}static getOptions(s){return Ye(ke(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 e.toStringTag}constructor(s={}){super(),this.visible=!0,this.options=this.getOptions(s),this.container=be.createElement(this.options.tagName||"g",this.options.isSVGElement!==!1),ee(this.container,this.prefixClassName("cell-tool")),typeof this.options.className=="string"&&ee(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()?ee(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&ee(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=De.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)}}e.defaults={isSVGElement:!0,tagName:"g"},n.ToolItem=e,function(t){let s=0;function r(o){return o?ju(o):(s+=1,`CustomTool${s}`)}function i(o){const a=Lu(r(o.name),this);return a.config(o),a}t.define=i}(e=n.ToolItem||(n.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`;function s(r){if(r==null)return!1;if(r instanceof t)return!0;const i=r[Symbol.toStringTag],o=r;return(i==null||i===t.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"}t.isToolItem=s}(e=n.ToolItem||(n.ToolItem={}))}(Ke||(Ke={}));const NL=n=>n;function Sb(n,e){return e===0?"0%":`${Math.round(n/e*100)}%`}function Eb(n){return(t,s,r,i)=>s.isEdgeElement(r)?_L(n,t,s,r,i):AL(n,t,s,r,i)}function AL(n,e,t,s,r){const i=t.cell,o=i.getAngle(),a=t.getUnrotatedBBoxOfElement(s),c=i.getBBox().getCenter(),u=M.create(r).rotate(o,c);let d=u.x-a.x,f=u.y-a.y;return n&&(d=Sb(d,a.width),f=Sb(f,a.height)),e.anchor={name:"topLeft",args:{dx:d,dy:f,rotate:!0}},e}function _L(n,e,t,s,r){const i=t.getConnection();if(!i)return e;const o=i.closestPointLength(r);if(n){const a=i.length();e.anchor={name:"ratio",args:{ratio:o/a}}}else e.anchor={name:"length",args:{length:o}};return e}const TL=Eb(!0),kL=Eb(!1),VL=Object.freeze(Object.defineProperty({__proto__:null,noop:NL,pinAbsolute:kL,pinRelative:TL},Symbol.toStringTag,{value:"Module"}));var fd;(function(n){n.presets=VL,n.registry=Ue.create({type:"connection strategy"}),n.registry.register(n.presets,!0)})(fd||(fd={}));function Ob(n,e,t,s){return se(fd.presets.pinRelative,this.graph,{},e,t,n,this.cell,s,{}).anchor}function Mb(n,e){return e?n.cell.getBBox():n.cell.isEdge()?n.getConnection().bbox():n.getUnrotatedBBoxOfElement(n.container)}class As extends Ke.ToolItem{onRender(){ee(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Yr(this.container,t,{absolute:!0})}getNodeMatrix(){const e=this.cellView,t=this.options;let{x:s=0,y:r=0}=t;const{offset:i,useCellGeometry:o,rotate:a}=t;let c=Mb(e,o);const u=e.cell.getAngle();a||(c=c.bbox(u));let d=0,f=0;typeof i=="number"?(d=i,f=i):typeof i=="object"&&(d=i.x,f=i.y),s=gn(s,c.width),r=gn(r,c.height);let h=ot().translate(c.x+c.width/2,c.y+c.height/2);return a&&(h=h.rotate(u)),h=h.translate(s+d-c.width/2,r+f-c.height/2),h}getEdgeMatrix(){const e=this.cellView,t=this.options,{offset:s=0,distance:r=0,rotate:i}=t;let o,a,c;const u=gn(r,1);u>=0&&u<=1?o=e.getTangentAtRatio(u):o=e.getTangentAtLength(u),o?(a=o.start,c=o.vector().vectorAngle(new M(1,0))||0):(a=e.getConnection().start,c=0);let d=ot().translate(a.x,a.y).rotate(c);return typeof s=="object"?d=d.translate(s.x||0,s.y||0):d=d.translate(0,s),i||(d=d.rotate(-c)),d}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.options.onClick;typeof t=="function"&&se(t,this.cellView,{e,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(n){n.config({name:"button",useCellGeometry:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(As||(As={})),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:e,btn:t}){t.parent.remove(),e.cell.remove({ui:!0,toolId:t.cid})}})}(As||(As={}));var DL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class dl extends Ke.ToolItem{onRender(){if(ee(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const e=this.options.attrs,{class:t}=e,s=DL(e,["class"]);pe(this.container,to(s)),t&&ee(this.container,t)}this.update()}update(){const e=this.cellView,t=this.options,{useCellGeometry:s,rotate:r}=t,i=ys(t.padding);let o=Mb(e,s).moveAndExpand({x:-i.left,y:-i.top,width:i.left+i.right,height:i.top+i.bottom});const a=e.cell;if(a.isNode()){const c=a.getAngle();if(c)if(r){const u=a.getBBox().getCenter();td(this.container,c,u.x,u.y,{absolute:!0})}else o=o.bbox(c)}return pe(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"}})})(dl||(dl={}));class po extends Ke.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 e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.options.createHandle,o=this.options.processHandle,a=i({index:t,graph:this.graph,guard:c=>this.guard(c),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 e=this.vertices;for(let t=0,s=e.length;t<s;t+=1){const r=e[t],i=this.handles[t];i&&i.updatePosition(r.x,r.y)}}updatePath(){const e=this.childNodes.connection;e&&e.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.on("remove",this.onHandleRemove,this)}stopHandleListening(e){const t=this.cellView;t.can("vertexMovable")&&(e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)),t.can("vertexDeletable")&&e.off("remove",this.onHandleRemove,this)}getNeighborPoints(e){const t=this.cellView,s=this.vertices,r=e>0?s[e-1]:t.sourceAnchor,i=e<s.length-1?s[e+1]:t.targetAnchor;return{prev:M.create(r),next:M.create(i)}}getMouseEventArgs(e){const t=this.normalizeEvent(e),{x:s,y:r}=this.graph.snapToGrid(t.clientX,t.clientY);return{e:t,x:s,y:r}}onHandleChange({e}){this.focus();const t=this.cellView;if(t.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:s,x:r,y:i}=this.getMouseEventArgs(e);this.eventData(s,{start:{x:r,y:i}}),t.notifyMouseDown(s,r,i)}}onHandleChanging({handle:e,e:t}){const s=this.cellView,r=e.options.index,{e:i,x:o,y:a}=this.getMouseEventArgs(t),c={x:o,y:a};this.snapVertex(c,r),s.cell.setVertexAt(r,c,{ui:!0,toolId:this.cid}),e.updatePosition(c.x,c.y),this.options.stopPropagation||s.notifyMouseMove(i,o,a)}stopBatch(e){this.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),e&&this.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid})}onHandleChanged({e}){const t=this.options,s=this.cellView;if(t.addable&&this.updatePath(),!t.removeRedundancies){this.stopBatch(this.eventData(e).vertexAdded);return}s.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&this.render(),this.blur(),this.stopBatch(this.eventData(e).vertexAdded);const{e:i,x:o,y:a}=this.getMouseEventArgs(e);if(!this.options.stopPropagation){s.notifyMouseUp(i,o,a);const{start:c}=this.eventData(i);if(c){const{x:u,y:d}=c;u===o&&d===a&&s.onClick(i,o,a)}}s.checkMouseleave(i),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}snapVertex(e,t){const s=this.options.snapRadius||0;if(s>0){const r=this.getNeighborPoints(t),i=r.prev,o=r.next;Math.abs(e.x-i.x)<s?e.x=i.x:Math.abs(e.x-o.x)<s&&(e.x=o.x),Math.abs(e.y-i.y)<s?e.y=r.prev.y:Math.abs(e.y-o.y)<s&&(e.y=o.y)}}onHandleRemove({handle:e,e:t}){if(this.options.removable){const s=e.options.index,r=this.cellView;r.cell.removeVertexAt(s,{ui:!0}),this.options.addable&&this.updatePath(),r.checkMouseleave(this.normalizeEvent(t))}}allowAddVertex(e){const t=this.guard(e),s=this.options.addable&&this.cellView.can("vertexAddable"),r=this.options.modifiers?vs.isMatch(e,this.options.modifiers):!0;return!t&&s&&r}onPathMouseDown(e){const t=this.cellView;if(!this.allowAddVertex(e))return;e.stopPropagation(),e.preventDefault();const s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY).toJSON();t.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const i=t.getVertexIndex(r.x,r.y);this.snapVertex(r,i),t.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 e extends be{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=be.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=e})(po||(po={})),function(n){const e=Jt.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:t=>new n.Handle(t),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(po||(po={}));class go extends Ke.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){ee(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const e=this.cellView,t=[...this.vertices];t.unshift(e.sourcePoint),t.push(e.targetPoint);for(let s=0,r=t.length;s<r-1;s+=1){const i=t[s],o=t[s+1],a=this.renderHandle(i,o,s);this.stamp(a.container),this.handles.push(a)}return this}renderHandle(e,t,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,e,t),this.container.appendChild(r.container),this.startHandleListening(r),r}startHandleListening(e){e.on("change",this.onHandleChange,this),e.on("changing",this.onHandleChanging,this),e.on("changed",this.onHandleChanged,this)}stopHandleListening(e){e.off("change",this.onHandleChange,this),e.off("changing",this.onHandleChanging,this),e.off("changed",this.onHandleChanged,this)}resetHandles(){const e=this.handles;this.handles=[],e&&e.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(e){const t=this.handles;for(let s=0,r=t.length;s<r;s+=1)t[s].options.index+=e}resetAnchor(e,t){const s=this.cellView.cell,r={ui:!0,toolId:this.cid};t?s.prop([e,"anchor"],t,r):s.removeProp([e,"anchor"],r)}snapHandle(e,t,s){const r=e.options.axis,i=e.options.index,c=this.cellView.cell.getVertices(),u=c[i-2]||s.sourceAnchor,d=c[i+1]||s.targetAnchor,f=this.options.snapRadius;return Math.abs(t[r]-u[r])<f?t[r]=u[r]:Math.abs(t[r]-d[r])<f&&(t[r]=d[r]),t}onHandleChanging({handle:e,e:t}){const s=this.graph,r=this.options,i=this.cellView,o=r.anchor,a=e.options.axis,c=e.options.index-1,u=this.getEventData(t),d=this.normalizeEvent(t),f=s.snapToGrid(d.clientX,d.clientY),h=this.snapHandle(e,f.clone(),u),p=ke(this.vertices);let g=p[c],m=p[c+1];const y=i.sourceView,b=i.sourceBBox;let w=!1,x=!1;if(g?c===0?b.containsPoint(g)?(p.shift(),this.shiftHandleIndexes(-1),w=!0):(g[a]=h[a],x=!0):g[a]=h[a]:(g=i.sourceAnchor.toJSON(),g[a]=h[a],b.containsPoint(g)?w=!0:(p.unshift(g),this.shiftHandleIndexes(1),x=!0)),typeof o=="function"&&y){if(w){const O=u.sourceAnchor.clone();O[a]=h[a];const A=se(o,i,O,y,i.sourceMagnet||y.container,"source",i,this);this.resetAnchor("source",A)}x&&this.resetAnchor("source",u.sourceAnchorDef)}const S=i.targetView,v=i.targetBBox;let E=!1,C=!1;if(m?c===p.length-2?v.containsPoint(m)?(p.pop(),E=!0):(m[a]=h[a],C=!0):m[a]=h[a]:(m=i.targetAnchor.toJSON(),m[a]=h[a],v.containsPoint(m)?E=!0:(p.push(m),C=!0)),typeof o=="function"&&S){if(E){const O=u.targetAnchor.clone();O[a]=h[a];const A=se(o,i,O,S,i.targetMagnet||S.container,"target",i,this);this.resetAnchor("target",A)}C&&this.resetAnchor("target",u.targetAnchorDef)}M.equalPoints(p,this.vertices)||this.cellView.cell.setVertices(p,{ui:!0,toolId:this.cid}),this.updateHandle(e,g,m,0),r.stopPropagation||i.notifyMouseMove(d,f.x,f.y)}onHandleChange({handle:e,e:t}){const s=this.options,r=this.handles,i=this.cellView,o=e.options.index;if(Array.isArray(r)){for(let a=0,c=r.length;a<c;a+=1)a!==o&&r[a].hide();if(this.focus(),this.setEventData(t,{sourceAnchor:i.sourceAnchor.clone(),targetAnchor:i.targetAnchor.clone(),sourceAnchorDef:ke(this.cell.prop(["source","anchor"])),targetAnchorDef:ke(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!s.stopPropagation){const a=this.normalizeEvent(t),c=this.graph.snapToGrid(a.clientX,a.clientY);i.notifyMouseDown(a,c.x,c.y)}}}onHandleChanged({e}){const t=this.options,s=this.cellView;t.removeRedundancies&&s.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const r=this.normalizeEvent(e),i=this.graph.snapToGrid(r.clientX,r.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),t.stopPropagation||s.notifyMouseUp(r,i.x,i.y),s.checkMouseleave(r),t.onChanged&&t.onChanged({edge:s.cell,edgeView:s})}updateHandle(e,t,s,r=0){const i=this.options.precision||0,o=Math.abs(t.x-s.x)<i,a=Math.abs(t.y-s.y)<i;if(o||a){const c=new K(t,s);if(c.length()<this.options.threshold)e.hide();else{const d=c.getCenter(),f=o?"x":"y";d[f]+=r||0;const h=c.vector().vectorAngle(new M(1,0));e.updatePosition(d.x,d.y,h,this.cellView),e.show(),e.options.axis=f}}else e.hide()}onRemove(){this.resetHandles()}}(function(n){class e extends be{constructor(s){super(),this.options=s,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=be.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 M(s,r))||new M(s,r);let c=ot().translate(a.x,a.y);if(a.equals({x:s,y:r}))c=c.rotate(i);else{let d=new K(s,r,a.x,a.y).vector().vectorAngle(new M(1,0));d!==0&&(d+=90),c=c.rotate(d)}this.setAttrs({transform:Wr(c),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=e})(go||(go={})),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:e=>new n.Handle(e),anchor:Ob})}(go||(go={}));class hl extends Ke.ToolItem{get type(){return this.options.type}onRender(){ee(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const e=this.type;return this.cellView.getTerminalView(e)?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const e=this.childNodes;if(!e)return;const t=e.anchor;if(!t)return;const s=this.type,r=this.cellView,i=this.options,o=r.getTerminalAnchor(s),a=r.cell.prop([s,"anchor"]);t.setAttribute("transform",`translate(${o.x}, ${o.y})`);const c=a?i.customAnchorAttrs:i.defaultAnchorAttrs;c&&Object.keys(c).forEach(u=>{t.setAttribute(u,c[u])})}updateArea(){const e=this.childNodes;if(!e)return;const t=e.area;if(!t)return;const s=this.type,r=this.cellView,i=r.getTerminalView(s);if(i){const o=i.cell,a=r.getTerminalMagnet(s);let c=this.options.areaPadding||0;Number.isFinite(c)||(c=0);let u,d,f;i.isEdgeElement(a)?(u=i.getBBox(),d=0,f=u.getCenter()):(u=i.getUnrotatedBBoxOfElement(a),d=o.getAngle(),f=u.getCenter(),d&&f.rotate(-d,o.getBBox().getCenter())),u.inflate(c),pe(t,{x:-u.width/2,y:-u.height/2,width:u.width,height:u.height,transform:`translate(${f.x}, ${f.y}) rotate(${d})`})}}toggleArea(e){if(this.childNodes){const t=this.childNodes.area;t&&(t.style.display=e?"":"none")}}onMouseDown(e){this.guard(e)||(e.stopPropagation(),e.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(e){const t=this.type,s=this.cell;e?s.prop([t,"anchor"],e,{rewrite:!0,ui:!0,toolId:this.cid}):s.removeProp([t,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(e){const t=this.type,s=this.cellView,r=s.getTerminalView(t);if(r==null)return;const i=this.normalizeEvent(e),o=r.cell,a=s.getTerminalMagnet(t);let c=this.graph.coord.clientToLocalPoint(i.clientX,i.clientY);const u=this.options.snap;if(typeof u=="function"){const h=se(u,s,c,r,a,t,s,this);c=M.create(h)}if(this.options.restrictArea)if(r.isEdgeElement(a)){const h=r.getClosestPoint(c);h&&(c=h)}else{const h=r.getUnrotatedBBoxOfElement(a),p=o.getAngle(),g=o.getBBox().getCenter(),m=c.clone().rotate(p,g);h.containsPoint(m)||(c=h.getNearestPointToPoint(m).rotate(-p,g))}let d;const f=this.options.anchor;typeof f=="function"&&(d=se(f,s,c,r,a,t,s,this)),this.resetAnchor(d),this.update()}onMouseUp(e){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const t=this.cellView;this.options.removeRedundancies&&t.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const e=this.options.resetAnchor;e&&this.resetAnchor(e===!0?void 0:e),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:Ob,snap(e,t,s,r,i,o){const a=o.options.snapRadius||0,c=r==="source",u=c?0:-1,d=this.cell.getVertexAt(u)||this.getTerminalAnchor(c?"target":"source");return d&&(Math.abs(d.x-e.x)<a&&(e.x=d.x),Math.abs(d.y-e.y)<a&&(e.y=d.y)),e}})})(hl||(hl={}));const RL=hl.define({name:"source-anchor",type:"source"}),IL=hl.define({name:"target-anchor",type:"target"});var LL=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class fl extends Ke.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const e=this.options.attrs,{class:t}=e,s=LL(e,["class"]);this.setAttrs(s,this.container),t&&ee(this.container,t)}}onRender(){ee(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const e=this.ratio,t=this.cellView,s=t.getTangentAtRatio(e),r=s?s.start:t.getPointAtRatio(e),i=s&&s.vector().vectorAngle(new M(1,0))||0;if(!r)return this;const o=ot().translate(r.x,r.y).rotate(i);return Yr(this.container,o,{absolute:!0}),this}onMouseDown(e){if(this.guard(e))return;e.stopPropagation(),e.preventDefault();const t=this.cellView;if(t.can("arrowheadMovable")){t.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const s=this.graph.snapToGrid(e.clientX,e.clientY),r=t.prepareArrowheadDragging(this.type,{x:s.x,y:s.y,options:Object.assign(Object.assign({},this.options),{toolId:this.cid})});this.cellView.setEventData(e,r),this.delegateDocumentEvents(this.options.documentEvents,e.data),t.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(e){const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY);this.cellView.onMouseMove(t,s.x,s.y),this.update()}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.cellView,r=this.graph.snapToGrid(t.clientX,t.clientY);s.onMouseUp(t,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"}})})(fl||(fl={}));const BL=fl.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"}}),jL=fl.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 ti extends Ke.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5,this.dblClick=this.onCellDblClick.bind(this)}onRender(){const e=this.cellView;e&&e.on("cell:dblclick",this.dblClick)}createElement(){const e=[this.prefixClassName(`${this.cell.isEdge()?"edge":"node"}-tool-editor`),this.prefixClassName("cell-tool-editor")];this.editor=Ke.createElement("div",!1),this.addClass(e,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:e,editor:t}=this;if(!t)return;const{style:s}=t;e.isNode()?this.updateNodeEditorTransform():e.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 t.innerText=i,this.setCellText(""),this}updateNodeEditorTransform(){const{graph:e,cell:t,editor:s}=this;if(!s)return;let r=M.create(),i=20,o="",{x:a,y:c}=this.options;const{width:u,height:d}=this.options;if(typeof a<"u"&&typeof c<"u"){const p=t.getBBox();a=gn(a,p.width),c=gn(c,p.height),r=p.topLeft.translate(a,c),i=p.width-a*2}else{const p=t.getBBox();r=p.center,i=p.width-4,o="translate(-50%, -50%)"}const f=e.scale(),{style:h}=s;r=e.localToGraph(r),h.left=`${r.x}px`,h.top=`${r.y}px`,h.transform=`scale(${f.sx}, ${f.sy}) ${o}`,h.minWidth=`${i}px`,typeof u=="number"&&(h.width=`${u}px`),typeof d=="number"&&(h.height=`${d}px`)}updateEdgeEditorTransform(){if(!this.event)return;const{graph:e,editor:t}=this;if(!t)return;let s=M.create(),r=20;const{style:i}=t,o=this.event.target,a=o.parentElement;if(a&&_n(a,this.prefixClassName("edge-label"))){const d=a.getAttribute("data-index")||"0";this.labelIndex=parseInt(d,10);const f=a.getAttribute("transform"),{translation:h}=rl(f);s=new M(h.tx,h.ty),r=Ee.getBBox(o).width}else{if(!this.options.labelAddable)return this;s=e.clientToLocal(M.create(this.event.clientX,this.event.clientY));const f=this.cellView.path.closestPointLength(s);this.distance=f,this.labelIndex=-1}s=e.localToGraph(s);const u=e.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(e){if(this.editor&&e.target!==this.editor){const t=this.editor.innerText.replace(/\n$/,"")||"";this.setCellText(t!==""?t:null),this.removeElement()}}onCellDblClick({e}){this.editor||(e.stopPropagation(),this.removeElement(),this.event=e,this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents))}onMouseDown(e){e.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor&&(this.editor.focus(),this.selectText())})}selectText(){if(window.getSelection&&this.editor){const e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.editor),t.removeAllRanges(),t.addRange(e)}}getCellText(){const{getText:e}=this.options;if(typeof e=="function")return se(e,this.cellView,{cell:this.cell,index:this.labelIndex});if(typeof e=="string"){if(this.cell.isNode())return this.cell.attr(e);if(this.cell.isEdge()&&this.labelIndex!==-1)return this.cell.prop(`labels/${this.labelIndex}/attrs/${e}`)}}setCellText(e){const t=this.options.setText;if(typeof t=="function"){se(t,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance});return}if(typeof t=="string"){if(this.cell.isNode()){e!==null&&this.cell.attr(t,e);return}if(this.cell.isEdge()){const s=this.cell;if(this.labelIndex===-1){if(e){const r={position:{distance:this.distance},attrs:{}};Ur(r,`attrs/${t}`,e),s.appendLabel(r)}}else e!==null?s.prop(`labels/${this.labelIndex}/attrs/${t}`,e):typeof this.labelIndex=="number"&&s.removeLabelAt(this.labelIndex)}}}onRemove(){const e=this.cellView;e&&e.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"}})})(ti||(ti={})),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"})}(ti||(ti={}));var Pb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},ni;(function(n){n.presets={boundary:dl,button:As,"button-remove":As.Remove,"node-editor":ti.NodeEditor},n.registry=Ue.create({type:"node tool",process(e,t){if(typeof t=="function")return t;let s=Ke.ToolItem;const{inherit:r}=t,i=Pb(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(ni||(ni={}));var si;(function(n){n.presets={boundary:dl,vertices:po,segments:go,button:As,"button-remove":As.Remove,"source-anchor":RL,"target-anchor":IL,"source-arrowhead":BL,"target-arrowhead":jL,"edge-editor":ti.EdgeEditor},n.registry=Ue.create({type:"edge tool",process(e,t){if(typeof t=="function")return t;let s=Ke.ToolItem;const{inherit:r}=t,i=Pb(t,["inherit"]);if(r){const o=this.get(r);o==null?this.onNotFound(r,"inherited"):s=o}return i.name==null&&(i.name=e),s.define.call(s,i)}}),n.registry.register(n.presets,!0)})(si||(si={}));const $L=es("center"),zL=es("topCenter"),FL=es("bottomCenter"),UL=es("leftMiddle"),HL=es("rightMiddle"),GL=es("topLeft"),WL=es("topRight"),YL=es("bottomLeft"),qL=es("bottomRight");function es(n){return function(e,t,s,r={}){const i=r.rotate?e.getUnrotatedBBoxOfElement(t):e.getBBoxOfElement(t),o=i[n];o.x+=gn(r.dx,i.width),o.y+=gn(r.dy,i.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function pl(n){return function(e,t,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=Nb(i,a)}else o=i.getBBoxOfElement(s).getCenter();else o=new M;return n.call(this,e,t,o,r)}return n.apply(this,arguments)}}function Nb(n,e){const t=Kn(e),s=typeof e=="string"?parseFloat(e):e;return t?n.getPointAtRatio(s/100):n.getPointAtLength(s)}const XL=pl(function(n,e,t,s){const r=ye.normalize(n.cell.getAngle()),i=n.getBBoxOfElement(e),o=i.getCenter(),a=i.getTopLeft(),c=i.getBottomRight();let u=s.padding;if(Number.isFinite(u)||(u=0),a.y+u<=t.y&&t.y<=c.y-u){const d=t.y-o.y;o.x+=r===0||r===180?0:d*1/Math.tan(ye.toRad(r)),o.y+=d}else if(a.x+u<=t.x&&t.x<=c.x-u){const d=t.x-o.x;o.y+=r===90||r===270?0:d*Math.tan(ye.toRad(r)),o.x+=d}return o}),JL=function(n,e,t,s,r){const i=n.cell.getConnectionPoint(this.cell,r);return(s.dx||s.dy)&&i.translate(s.dx||0,s.dy||0),i},KL=pl(function(n,e,t,s){let r,i=0,o;const a=n.cell;s.rotate?(r=n.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),i=a.getAngle()):r=n.getBBoxOfElement(e);const c=s.padding;c!=null&&Number.isFinite(c)&&r.inflate(c),s.rotate&&t.rotate(i,o);const u=r.getNearestSideToPoint(t);let d;switch(u){case"left":d=r.getLeftMiddle();break;case"right":d=r.getRightMiddle();break;case"top":d=r.getTopCenter();break;case"bottom":d=r.getBottomCenter();break}const f=s.direction;return f==="H"?(u==="top"||u==="bottom")&&(t.x<=r.x+r.width?d=r.getLeftMiddle():d=r.getRightMiddle()):f==="V"&&(t.y<=r.y+r.height?d=r.getTopCenter():d=r.getBottomCenter()),s.rotate?d.rotate(-i,o):d}),ZL=Object.freeze(Object.defineProperty({__proto__:null,bottom:FL,bottomLeft:YL,bottomRight:qL,center:$L,left:UL,midSide:KL,nodeCenter:JL,orth:XL,right:HL,top:zL,topLeft:GL,topRight:WL},Symbol.toStringTag,{value:"Module"}));var ri;(function(n){n.presets=ZL,n.registry=Ue.create({type:"node endpoint"}),n.registry.register(n.presets,!0)})(ri||(ri={}));const QL=function(n,e,t,s){let r=s.ratio!=null?s.ratio:.5;return r>1&&(r/=100),n.getPointAtRatio(r)},eB=function(n,e,t,s){const r=s.length!=null?s.length:20;return n.getPointAtLength(r)},Ab=function(n,e,t,s){const r=n.getClosestPoint(t);return r??new M},tB=pl(Ab),nB=pl(function(n,e,t,s){const i=n.getConnection(),o=n.getConnectionSubdivisions(),a=new K(t.clone().translate(0,1e6),t.clone().translate(0,-1e6)),c=new K(t.clone().translate(1e6,0),t.clone().translate(-1e6,0)),u=a.intersect(i,{segmentSubdivisions:o}),d=c.intersect(i,{segmentSubdivisions:o}),f=[];return u&&f.push(...u),d&&f.push(...d),f.length>0?t.closest(f):s.fallbackAt!=null?Nb(n,s.fallbackAt):se(Ab,this,n,e,t,s)}),sB=Object.freeze(Object.defineProperty({__proto__:null,closest:tB,length:eB,orth:nB,ratio:QL},Symbol.toStringTag,{value:"Module"}));var ii;(function(n){n.presets=sB,n.registry=Ue.create({type:"edge endpoint"}),n.registry.register(n.presets,!0)})(ii||(ii={}));function gl(n,e,t){let s;if(typeof t=="object"){if(Number.isFinite(t.y)){const i=new K(e,n),{start:o,end:a}=i.parallel(t.y);e=o,n=a}s=t.x}else s=t;if(s==null||!Number.isFinite(s))return n;const r=n.distance(e);return s===0&&r>0?n:n.move(e,-Math.min(s,r-1))}function ml(n){const e=n.getAttribute("stroke-width");return e===null?0:parseFloat(e)||0}function rB(n){if(n==null)return null;let e=n;do{let t=e.tagName;if(typeof t!="string")return null;if(t=t.toUpperCase(),t==="G")e=e.firstElementChild;else if(t==="TITLE")e=e.nextElementSibling;else break}while(e);return e}const _b=function(n,e,t,s){const r=e.getBBoxOfElement(t);s.stroked&&r.inflate(ml(t)/2);const i=n.intersect(r),o=i&&i.length?n.start.closest(i):n.end;return gl(o,n.start,s.offset)},iB=function(n,e,t,s,r){const i=e.cell,o=i.isNode()?i.getAngle():0;if(o===0)return se(_b,this,n,e,t,s,r);const a=e.getUnrotatedBBoxOfElement(t);s.stroked&&a.inflate(ml(t)/2);const c=a.getCenter(),u=n.clone().rotate(o,c),d=u.setLength(1e6).intersect(a),f=d&&d.length?u.start.closest(d).rotate(-o,c):n.end;return gl(f,n.start,s.offset)},oB=function(n,e,t,s){let r,i;const o=n.end,a=s.selector;if(typeof a=="string"?r=e.findOne(a):Array.isArray(a)?r=Bu(t,a):r=rB(t),!ws(r)){if(r===t||!ws(t))return o;r=t}const c=e.getShapeOfElement(r),u=e.getMatrixOfElement(r),d=e.getRootTranslatedMatrix(),f=e.getRootRotatedMatrix(),h=d.multiply(f).multiply(u),p=h.inverse(),g=Ee.transformLine(n,p),m=g.start.clone(),y=e.getDataOfElement(r);if(s.insideout===!1){y.shapeBBox==null&&(y.shapeBBox=c.bbox());const S=y.shapeBBox;if(S!=null&&S.containsPoint(m))return o}s.extrapolate===!0&&g.setLength(1e6);let b;if(re.isPath(c)){const S=s.precision||2;y.segmentSubdivisions==null&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:S})),b={precision:S,segmentSubdivisions:y.segmentSubdivisions},i=g.intersect(c,b)}else i=g.intersect(c);i?Array.isArray(i)&&(i=m.closest(i)):s.sticky===!0&&(G.isRectangle(c)?i=c.getNearestPointToPoint(m):bn.isEllipse(c)?i=c.intersectsWithLineFromCenterToPoint(m):i=c.closestPoint(m,b));const w=i?Ee.transformPoint(i,h):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+=ml(r)/2):x+=ml(r)/2),gl(w,n.start,x)};function aB(n,e,t=0){const{start:s,end:r}=n;let i,o,a,c;switch(e){case"left":c="x",i=r,o=s,a=-1;break;case"right":c="x",i=s,o=r,a=1;break;case"top":c="y",i=r,o=s,a=-1;break;case"bottom":c="y",i=s,o=r,a=1;break;default:return}s[c]<r[c]?i[c]=o[c]:o[c]=i[c],Number.isFinite(t)&&(i[c]+=a*t,o[c]+=a*t)}const lB=Object.freeze(Object.defineProperty({__proto__:null,anchor:function(n,e,t,s){const{alignOffset:r,align:i}=s;return i&&aB(n,i,r),gl(n.end,n.start,s.offset)},bbox:_b,boundary:oB,rect:iB},Symbol.toStringTag,{value:"Module"}));var oi;(function(n){n.presets=lB,n.registry=Ue.create({type:"connection point"}),n.registry.register(n.presets,!0)})(oi||(oi={}));const cB=function(n){return[...n]},uB=function(n,e,t){const s=e.side||"bottom",r=ys(e.padding||40),i=t.sourceBBox,o=t.targetBBox,a=i.getCenter(),c=o.getCenter();let u,d,f;switch(s){case"top":f=-1,u="y",d="height";break;case"left":f=-1,u="x",d="width";break;case"right":f=1,u="x",d="width";break;case"bottom":default:f=1,u="y",d="height";break}return a[u]+=f*(i[d]/2+r[s]),c[u]+=f*(o[d]/2+r[s]),f*(a[u]-c[u])>0?c[u]=a[u]:a[u]=c[u],[a.toJSON(),...n,c.toJSON()]};function yl(n){return new G(n.x,n.y,0,0)}function bl(n={}){const e=ys(n.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Tb(n,e={}){return n.sourceBBox.clone().moveAndExpand(bl(e))}function kb(n,e={}){return n.targetBBox.clone().moveAndExpand(bl(e))}function dB(n,e={}){return n.sourceAnchor?n.sourceAnchor:Tb(n,e).getCenter()}function hB(n,e={}){return n.targetAnchor?n.targetAnchor:kb(n,e).getCenter()}const Vb=function(n,e,t){let s=Tb(t,e),r=kb(t,e);const i=dB(t,e),o=hB(t,e);s=s.union(yl(i)),r=r.union(yl(o));const a=n.map(d=>M.create(d));a.unshift(i),a.push(o);let c=null;const u=[];for(let d=0,f=a.length-1;d<f;d+=1){let h=null;const p=a[d],g=a[d+1],m=Kt.getBearing(p,g)!=null;if(d===0)d+1===f?s.intersectsWithRect(r.clone().inflate(1))?h=Kt.insideNode(p,g,s,r):m||(h=Kt.nodeToNode(p,g,s,r)):s.containsPoint(g)?h=Kt.insideNode(p,g,s,yl(g).moveAndExpand(bl(e))):m||(h=Kt.nodeToVertex(p,g,s));else if(d+1===f){const y=m&&Kt.getBearing(g,p)===c;r.containsPoint(p)||y?h=Kt.insideNode(p,g,yl(p).moveAndExpand(bl(e)),r,c):m||(h=Kt.vertexToNode(p,g,r,c))}else m||(h=Kt.vertexToVertex(p,g,c));h?(u.push(...h.points),c=h.direction):c=Kt.getBearing(p,g),d+1<f&&u.push(g)}return u};var Kt;(function(n){const e={N:"S",S:"N",E:"W",W:"E"},t={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function s(f,h,p){let g=new M(f.x,h.y);return p.containsPoint(g)&&(g=new M(h.x,f.y)),g}function r(f,h){return f[h==="W"||h==="E"?"width":"height"]}n.getBBoxSize=r;function i(f,h){return f.x===h.x?f.y>h.y?"N":"S":f.y===h.y?f.x>h.x?"W":"E":null}n.getBearing=i;function o(f,h,p){const g=new M(f.x,h.y),m=new M(h.x,f.y),y=i(f,g),b=i(f,m),w=p?e[p]:null,x=y===p||y!==w&&(b===w||b!==p)?g:m;return{points:[x],direction:i(x,h)}}n.vertexToVertex=o;function a(f,h,p){const g=s(f,h,p);return{points:[g],direction:i(g,h)}}n.nodeToVertex=a;function c(f,h,p,g){const m=[new M(f.x,h.y),new M(h.x,f.y)],y=m.filter(x=>!p.containsPoint(x)),b=y.filter(x=>i(x,f)!==g);let w;if(b.length>0)return w=b.filter(x=>i(f,x)===g).pop(),w=w||b[0],{points:[w],direction:i(w,h)};{w=pP(m,y)[0];const x=M.create(h).move(w,-r(p,g)/2);return{points:[s(x,f,p),x],direction:i(x,h)}}}n.vertexToNode=c;function u(f,h,p,g){let m=a(h,f,g);const y=m.points[0];if(p.containsPoint(y)){m=a(f,h,p);const b=m.points[0];if(g.containsPoint(b)){const w=M.create(f).move(b,-r(p,i(f,b))/2),x=M.create(h).move(y,-r(g,i(h,y))/2),S=new K(w,x).getCenter(),v=a(f,S,p),E=o(S,h,v.direction);m.points=[v.points[0],E.points[0]],m.direction=E.direction}}return m}n.nodeToNode=u;function d(f,h,p,g,m){const y=p.union(g).inflate(1),b=y.getCenter(),w=b.distance(h)>b.distance(f),x=w?h:f,S=w?f:h;let v,E,C;m?(v=M.fromPolar(y.width+y.height,t[m],x),v=y.getNearestPointToPoint(v).move(v,-1)):v=y.getNearestPointToPoint(x).move(x,1),E=s(v,S,y);let O;v.round().equals(E.round())?(E=M.fromPolar(y.width+y.height,ye.toRad(v.theta(x))+Math.PI/2,S),E=y.getNearestPointToPoint(E).move(S,1).round(),C=s(v,E,y),O=w?[E,C,v]:[v,C,E]):O=w?[E,v]:[v,E];const A=i(w?v:E,h);return{points:O,direction:A}}n.insideNode=d})(Kt||(Kt={}));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 _s(this.step,this)},directions(){const n=_s(this.step,this),e=_s(this.cost,this);return[{cost:e,offsetX:n,offsetY:0},{cost:e,offsetX:-n,offsetY:0},{cost:e,offsetX:0,offsetY:n},{cost:e,offsetX:0,offsetY:-n}]},penalties(){const n=_s(this.step,this);return{0:0,45:n/2,90:n/2}},paddingBox(){const n=_s(this.step,this);return{x:-n,y:-n,width:2*n,height:2*n}},fallbackRouter:Vb,draggingRouter:null,snapToGrid:!0};function _s(n,e){return typeof n=="function"?n.call(e):n}function pB(n){const e=Object.keys(n).reduce((t,s)=>{const r=t;return s==="fallbackRouter"||s==="draggingRouter"||s==="fallbackRoute"?r[s]=n[s]:r[s]=_s(n[s],n),t},{});if(e.padding){const t=ys(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const s=new M(0,0),r=new M(t.offsetX,t.offsetY);t.angle=ye.normalize(s.theta(r))}),e}const Db=1,Rb=2;class gB{constructor(){this.items=[],this.hash={},this.values={}}add(e,t){this.hash[e]?this.items.splice(this.items.indexOf(e),1):this.hash[e]=Db,this.values[e]=t;const s=WP(this.items,e,r=>this.values[r]);this.items.splice(s,0,e)}pop(){const e=this.items.shift();return e&&(this.hash[e]=Rb),e}isOpen(e){return this.hash[e]===Db}isClose(e){return this.hash[e]===Rb}isEmpty(){return this.items.length===0}}class mB{constructor(e){this.options=e,this.mapGridSize=100,this.map={}}build(e,t){const s=this.options,r=s.excludeTerminals.reduce((u,d)=>{const f=t[d];if(f){const h=e.getCell(f.cell);h&&u.push(h)}return u},[]);let i=[];const o=e.getCell(t.getSourceCellId());o&&(i=_p(i,o.getAncestors().map(u=>u.id)));const a=e.getCell(t.getTargetCellId());a&&(i=_p(i,a.getAncestors().map(u=>u.id)));const c=this.mapGridSize;return e.getNodes().reduce((u,d)=>{const f=r.some(y=>y.id===d.id),h=d.shape?s.excludeShapes.includes(d.shape):!1,p=s.excludeNodes.some(y=>typeof y=="string"?d.id===y:y===d),g=i.includes(d.id),m=h||f||p||g;if(d.isVisible()&&!m){const y=d.getBBox().moveAndExpand(s.paddingBox),b=y.getOrigin().snapToGrid(c),w=y.getCorner().snapToGrid(c);for(let x=b.x;x<=w.x;x+=c)for(let S=b.y;S<=w.y;S+=c){const v=new M(x,S).toString();u[v]==null&&(u[v]=[]),u[v].push(y)}}return u},this.map),this}isAccessible(e){const t=e.clone().snapToGrid(this.mapGridSize).toString(),s=this.map[t];return s?s.every(r=>!r.containsPoint(e)):!0}}function Ib(n,e){const t=n.sourceBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Lb(n,e){const t=n.targetBBox.clone();return e&&e.paddingBox?t.moveAndExpand(e.paddingBox):t}function Bb(n,e){return n.sourceAnchor?n.sourceAnchor:Ib(n,e).getCenter()}function yB(n,e){return n.targetAnchor?n.targetAnchor:Lb(n,e).getCenter()}function pd(n,e,t,s,r){const i=360/t,o=n.theta(bB(n,e,s,r)),a=ye.normalize(o+i/2);return i*Math.floor(a/i)}function bB(n,e,t,s){const r=s.step,i=e.x-n.x,o=e.y-n.y,a=i/t.x,c=o/t.y,u=a*r,d=c*r;return new M(n.x+u,n.y+d)}function jb(n,e){const t=Math.abs(n-e);return t>180?360-t:t}function wB(n,e){const t=e.step;return e.directions.forEach(s=>{s.gridOffsetX=s.offsetX/t*n.x,s.gridOffsetY=s.offsetY/t*n.y}),e.directions}function xB(n,e,t){return{source:e.clone(),x:$b(t.x-e.x,n),y:$b(t.y-e.y,n)}}function $b(n,e){if(!n)return e;const t=Math.abs(n),s=Math.round(t/e);if(!s)return t;const r=s*e,o=(t-r)/s;return e+o}function vB(n,e){const t=e.source,s=Se.snapToGrid(n.x-t.x,e.x)+t.x,r=Se.snapToGrid(n.y-t.y,e.y)+t.y;return new M(s,r)}function mo(n,e){return n.round(e)}function wl(n,e,t){return mo(vB(n.clone(),e),t)}function yo(n){return n.toString()}function gd(n){return new M(n.x===0?0:Math.abs(n.x)/n.x,n.y===0?0:Math.abs(n.y)/n.y)}function zb(n,e){let t=1/0;for(let s=0,r=e.length;s<r;s+=1){const i=n.manhattanDistance(e[s]);i<t&&(t=i)}return t}function Fb(n,e,t,s,r){const i=r.precision,o=r.directionMap,a=n.diff(e.getCenter()),c=Object.keys(o).reduce((u,d)=>{if(t.includes(d)){const f=o[d],h=new M(n.x+f.x*(Math.abs(a.x)+e.width),n.y+f.y*(Math.abs(a.y)+e.height)),g=new K(n,h).intersect(e)||[];let m,y=null;for(let b=0;b<g.length;b+=1){const w=g[b],x=n.squaredDistance(w);(m==null||x>m)&&(m=x,y=w)}if(y){let b=wl(y,s,i);e.containsPoint(b)&&(b=wl(b.translate(f.x*s.x,f.y*s.y),s,i)),u.push(b)}}return u},[]);return e.containsPoint(n)||c.push(wl(n,s,i)),c}function CB(n,e,t,s,r){const i=[];let o=gd(r.diff(t)),a=yo(t),c=n[a],u;for(;c;){u=e[a];const h=gd(u.diff(c));h.equals(o)||(i.unshift(u),o=h),a=yo(c),c=n[a]}const d=e[a];return gd(d.diff(s)).equals(o)||i.unshift(d),i}function SB(n,e,t,s,r){const i=r.precision;let o,a;G.isRectangle(e)?o=mo(Bb(n,r).clone(),i):o=mo(e.clone(),i),G.isRectangle(t)?a=mo(yB(n,r).clone(),i):a=mo(t.clone(),i);const c=xB(r.step,o,a),u=o,d=a;let f,h;if(G.isRectangle(e)?f=Fb(u,e,r.startDirections,c,r):f=[u],G.isRectangle(t)?h=Fb(a,t,r.endDirections,c,r):h=[d],f=f.filter(p=>s.isAccessible(p)),h=h.filter(p=>s.isAccessible(p)),f.length>0&&h.length>0){const p=new gB,g={},m={},y={};for(let k=0,_=f.length;k<_;k+=1){const V=f[k],L=yo(V);p.add(L,zb(V,h)),g[L]=V,y[L]=0}const b=r.previousDirectionAngle,w=b===void 0;let x,S;const v=wB(c,r),E=v.length,C=h.reduce((k,_)=>{const V=yo(_);return k.push(V),k},[]),O=M.equalPoints(f,h);let A=r.maxLoopCount;for(;!p.isEmpty()&&A>0;){const k=p.pop(),_=g[k],V=m[k],L=y[k],B=_.equals(u),N=V==null;let P;if(N?w?B?P=null:P=pd(u,_,E,c,r):P=b:P=pd(V,_,E,c,r),!(N&&O)&&C.indexOf(k)>=0)return r.previousDirectionAngle=P,CB(m,g,_,u,d);for(let j=0;j<E;j+=1){x=v[j];const Y=x.angle;if(S=jb(P,Y),!(w&&B)&&S>r.maxDirectionChange)continue;const te=wl(_.clone().translate(x.gridOffsetX||0,x.gridOffsetY||0),c,i),z=yo(te);if(p.isClose(z)||!s.isAccessible(te))continue;if(C.indexOf(z)>=0&&!te.equals(d)){const q=pd(te,d,E,c,r);if(jb(Y,q)>r.maxDirectionChange)continue}const I=x.cost,U=B?0:r.penalties[S],F=L+I+U;(!p.isOpen(z)||F<y[z])&&(g[z]=te,m[z]=_,y[z]=F,p.add(z,F+zb(te,h)))}A-=1}}return r.fallbackRoute?se(r.fallbackRoute,this,u,d,r):null}function EB(n,e=10){if(n.length<=1)return n;for(let t=0,s=n.length;t<s-1;t+=1){const r=n[t],i=n[t+1];if(r.x===i.x){const o=e*Math.round(r.x/e);r.x!==o&&(r.x=o,i.x=o)}else if(r.y===i.y){const o=e*Math.round(r.y/e);r.y!==o&&(r.y=o,i.y=o)}}return n}const OB=function(n,e,t){const s=pB(e),r=Ib(t,s),i=Lb(t,s),o=Bb(t,s),a=new mB(s).build(t.graph.model,t.cell),c=n.map(p=>M.create(p)),u=[];let d=o,f,h;for(let p=0,g=c.length;p<=g;p+=1){let m=null;if(f=h||r,h=c[p],h==null){h=i;const b=t.cell;if((b.getSourceCellId()==null||b.getTargetCellId()==null)&&typeof s.draggingRouter=="function"){const x=f===r?o:f,S=h.getOrigin();m=se(s.draggingRouter,t,x,S,s)}}if(m==null&&(m=SB(t,f,h,a,s)),m===null)return console.warn("Unable to execute manhattan algorithm, use orth instead"),se(s.fallbackRouter,this,n,s,t);const y=m[0];y&&y.equals(d)&&m.shift(),d=m[m.length-1]||d,u.push(...m)}return s.snapToGrid?EB(u,t.graph.grid.getGridSize()):u},Ub=function(n,e,t){return se(OB,this,n,Object.assign(Object.assign({},fB),e),t)},MB={maxDirectionChange:45,directions(){const n=_s(this.step,this),e=_s(this.cost,this),t=Math.ceil(Math.sqrt(n*n<<1));return[{cost:e,offsetX:n,offsetY:0},{cost:t,offsetX:n,offsetY:n},{cost:e,offsetX:0,offsetY:n},{cost:t,offsetX:-n,offsetY:n},{cost:e,offsetX:-n,offsetY:0},{cost:t,offsetX:-n,offsetY:-n},{cost:e,offsetX:0,offsetY:-n},{cost:t,offsetX:n,offsetY:-n}]},fallbackRoute(n,e,t){const s=n.theta(e),r=[];let i={x:e.x,y:n.y},o={x:n.x,y:e.y};if(s%180>90){const x=i;i=o,o=x}const a=s%90<45?i:o,c=new K(n,a),u=90*Math.ceil(s/90),d=M.fromPolar(c.squaredLength(),ye.toRad(u+135),a),f=new K(e,d),h=c.intersectsWithLine(f),p=h||e,g=h?p:n,m=360/t.directions.length,y=g.theta(e),b=ye.normalize(y+m/2),w=m*Math.floor(b/m);return t.previousDirectionAngle=w,p&&r.push(p.round()),r.push(e),r}},PB=function(n,e,t){return se(Ub,this,n,Object.assign(Object.assign({},MB),e),t)},NB=function(n,e,t){const s=e.offset||32,r=e.min==null?16:e.min;let i=0,o=e.direction;const a=t.sourceBBox,c=t.targetBBox,u=a.getCenter(),d=c.getCenter();if(typeof s=="number"&&(i=s),o==null){let b=c.left-a.right,w=c.top-a.bottom;b>=0&&w>=0?o=b>=w?"L":"T":b<=0&&w>=0?(b=a.left-c.right,b>=0?o=b>=w?"R":"T":o="T"):b>=0&&w<=0?(w=a.top-c.bottom,w>=0?o=b>=w?"L":"B":o="L"):(b=a.left-c.right,w=a.top-c.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=d.x-u.x>=0?"L":"R":o==="V"&&(o=d.y-u.y>=0?"T":"B"),s==="center"&&(o==="L"?i=(c.left-a.right)/2:o==="R"?i=(a.left-c.right)/2:o==="T"?i=(c.top-a.bottom)/2:o==="B"&&(i=(a.top-c.bottom)/2));let f,h,p;const g=o==="L"||o==="R";if(g){if(d.y===u.y)return[...n];p=o==="L"?1:-1,f="x",h="width"}else{if(d.x===u.x)return[...n];p=o==="T"?1:-1,f="y",h="height"}const m=u.clone(),y=d.clone();if(m[f]+=p*(a[h]/2+i),y[f]-=p*(c[h]/2+i),g){const b=m.x,w=y.x,x=a.width/2+r,S=c.width/2+r;d.x>u.x?w<=b&&(m.x=Math.max(w,u.x+x),y.x=Math.min(b,d.x-S)):w>=b&&(m.x=Math.min(w,u.x-x),y.x=Math.max(b,d.x+S))}else{const b=m.y,w=y.y,x=a.height/2+r,S=c.height/2+r;d.y>u.y?w<=b&&(m.y=Math.max(w,u.y+x),y.y=Math.min(b,d.y-S)):w>=b&&(m.y=Math.min(w,u.y-x),y.y=Math.max(b,d.y+S))}return[m.toJSON(),...n,y.toJSON()]};function ai(n,e){if(e!=null&&e!==!1){const t=typeof e=="boolean"?0:e;if(t>0){const s=M.create(n[1]).move(n[2],t),r=M.create(n[1]).move(n[0],t);return[s.toJSON(),...n,r.toJSON()]}{const s=n[1];return[Object.assign({},s),...n,Object.assign({},s)]}}return n}const AB=Object.freeze(Object.defineProperty({__proto__:null,er:NB,loop:function(n,e,t){const s=e.width||50,i=(e.height||80)/2,o=e.angle||"auto",a=t.sourceAnchor,c=t.targetAnchor,u=t.sourceBBox,d=t.targetBBox;if(a.equals(c)){const f=b=>{const w=ye.toRad(b),x=Math.sin(w),S=Math.cos(w),v=new M(a.x+S*s,a.y+x*s),E=new M(v.x-S*i,v.y-x*i),C=E.clone().rotate(-90,v),O=E.clone().rotate(90,v);return[C.toJSON(),v.toJSON(),O.toJSON()]},h=b=>{const w=a.clone().move(b,-1),x=new K(w,b);return!u.containsPoint(b)&&!u.intersectsWithLine(x)},p=[0,90,180,270,45,135,225,315];if(typeof o=="number")return ai(f(o),e.merge);const g=u.getCenter();if(g.equals(a))return ai(f(0),e.merge);const m=g.angleBetween(a,g.clone().translate(1,0));let y=f(m);if(h(y[1]))return ai(y,e.merge);for(let b=1,w=p.length;b<w;b+=1)if(y=f(m+p[b]),h(y[1]))return ai(y,e.merge);return ai(y,e.merge)}{const f=new K(a,c);let h=f.parallel(-s),p=h.getCenter(),g=h.start.clone().move(h.end,i),m=h.end.clone().move(h.start,i);const y=f.parallel(-1),b=new K(y.start,p),w=new K(y.end,p);if((u.containsPoint(p)||d.containsPoint(p)||u.intersectsWithLine(b)||u.intersectsWithLine(w)||d.intersectsWithLine(b)||d.intersectsWithLine(w))&&(h=f.parallel(s),p=h.getCenter(),g=h.start.clone().move(h.end,i),m=h.end.clone().move(h.start,i)),e.merge){const x=new K(a,c),S=new K(p,x.center).setLength(Number.MAX_SAFE_INTEGER),v=u.intersectsWithLine(S),E=d.intersectsWithLine(S),C=v?Array.isArray(v)?v:[v]:[];E&&(Array.isArray(E)?C.push(...E):C.push(E));const O=x.center.closest(C);O?(t.sourceAnchor=O.clone(),t.targetAnchor=O.clone()):(t.sourceAnchor=x.center.clone(),t.targetAnchor=x.center.clone())}return ai([g.toJSON(),p.toJSON(),m.toJSON()],e.merge)}},manhattan:Ub,metro:PB,normal:cB,oneSide:uB,orth:Vb},Symbol.toStringTag,{value:"Module"}));var Ts;(function(n){n.presets=AB,n.registry=Ue.create({type:"router"}),n.registry.register(n.presets,!0)})(Ts||(Ts={}));const _B=function(n,e,t,s={}){const r=[n,...t,e],i=new Fe(r),o=new re(i);return s.raw?o:o.serialize()},TB=function(n,e,t,s={}){const r=t.length===3?0:1,i=M.create(t[0+r]),o=M.create(t[2+r]),a=M.create(t[1+r]);if(!M.equals(n,e)){const u=new M((n.x+e.x)/2,(n.y+e.y)/2),d=u.angleBetween(M.create(n).rotate(90,u),a);d>1&&(i.rotate(180-d,u),o.rotate(180-d,u),a.rotate(180-d,u))}const c=`
120
120
  M ${n.x} ${n.y}
121
121
  Q ${i.x} ${i.y} ${a.x} ${a.y}
122
122
  Q ${o.x} ${o.y} ${e.x} ${e.y}
123
- `;return s.raw?re.parse(c):c},kB=function(n,e,t,s={}){const r=new re;r.appendSegment(re.createSegment("M",n));const i=1/3,o=2/3,a=s.radius||10;let c,u;for(let d=0,f=t.length;d<f;d+=1){const h=M.create(t[d]),p=t[d-1]||n,g=t[d+1]||e;c=u||h.distance(p)/2,u=h.distance(g)/2;const m=-Math.min(a,c),y=-Math.min(a,u),b=h.clone().move(p,m).round(),w=h.clone().move(g,y).round(),x=new M(i*b.x+o*h.x,o*h.y+i*b.y),v=new M(i*w.x+o*h.x,o*h.y+i*w.y);r.appendSegment(re.createSegment("L",b)),r.appendSegment(re.createSegment("C",x,v,w))}return r.appendSegment(re.createSegment("L",e)),s.raw?r:r.serialize()},VB=function(n,e,t,s={}){let r,i=s.direction;if(t&&t.length!==0){const o=[n,...t,e],a=je.throughPoints(o);r=new re(a)}else if(r=new re,r.appendSegment(re.createSegment("M",n)),i||(i=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),i==="H"){const o=(n.x+e.x)/2;r.appendSegment(re.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;r.appendSegment(re.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return s.raw?r:r.serialize()},Ub=1,xl=1/3,vl=2/3;function DB(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let s=0;s<t.length;s+=1)t[s].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function md(n,e,t=[]){const s=[n,...t,e],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new K(i,a))}),r}function RB(n,e){const t=[];return e.forEach(s=>{const r=n.intersectsWithLine(s);r&&t.push(r)}),t}function Hb(n,e){return new K(n,e).squaredLength()}function IB(n,e,t){return e.reduce((s,r,i)=>{if(Cl.includes(r))return s;const o=s.pop()||n,a=M.create(r).move(o.start,-t);let c=M.create(r).move(o.start,+t);const u=e[i+1];if(u!=null){const h=c.distance(u);h<=t&&(c=u.move(o.start,h),Cl.push(u))}else if(a.distance(o.end)<t*2+Ub)return s.push(o),s;if(c.distance(o.start)<t*2+Ub)return s.push(o),s;const f=new K(a,c);return bo.push(f),s.push(new K(o.start,a),f,new K(c,o.end)),s},[])}function Gb(n,e,t,s){const r=new re;let i;return i=re.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(bo.includes(o)){let c,u,d,f;if(t==="arc"){c=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(c+=180);const p=o.getCenter(),g=new K(p,o.end).rotate(c,p);let m;m=new K(o.start,p),d=m.pointAt(2/3).rotate(c,o.start),f=g.pointAt(1/3).rotate(-c,g.end),i=re.createSegment("C",d,f,g.end),r.appendSegment(i),m=new K(p,o.end),d=g.pointAt(1/3).rotate(c,g.end),f=m.pointAt(1/3).rotate(-c,o.end),i=re.createSegment("C",d,f,o.end),r.appendSegment(i)}else if(t==="gap")i=re.createSegment("M",o.end),r.appendSegment(i);else if(t==="cubic"){c=o.start.theta(o.end);const h=e*.6;let p=e*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(p*=-1),d=new M(o.start.x+h,o.start.y+p).rotate(c,o.start),f=new M(o.end.x-h,o.end.y+p).rotate(c,o.end),i=re.createSegment("C",d,f,o.end),r.appendSegment(i)}}else{const c=n[a+1];s===0||!c||bo.includes(c)?(i=re.createSegment("L",o.end),r.appendSegment(i)):LB(s,r,o.end,o.start,c.end)}}),r}function LB(n,e,t,s,r){const i=t.distance(s)/2,o=t.distance(r)/2,a=-Math.min(n,i),c=-Math.min(n,o),u=t.clone().move(s,a).round(),d=t.clone().move(r,c).round(),f=new M(xl*u.x+vl*t.x,vl*t.y+xl*u.y),h=new M(xl*d.x+vl*t.x,vl*t.y+xl*d.y);let p;p=re.createSegment("L",u),e.appendSegment(p),p=re.createSegment("C",f,h,d),e.appendSegment(p)}let bo,Cl;const BB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,s={}){bo=[],Cl=[],DB(this);const r=s.size||5,i=s.type||"arc",o=s.radius||0,a=s.ignoreConnectors||["smooth"],c=this.graph,d=c.model.getEdges();if(d.length===1)return Gb(md(n,e,t),r,i,o);const f=this.cell,h=d.indexOf(f),p=c.options.connecting.connector||{},g=d.filter((v,C)=>{const E=v.getConnector()||p;return a.includes(E.name)?!1:C>h?E.name!=="jumpover":!0}),m=g.map(v=>c.findViewByCell(v)),y=md(n,e,t),b=m.map(v=>v==null?[]:v===this?y:md(v.sourcePoint,v.targetPoint,v.routePoints)),w=[];y.forEach(v=>{const C=g.reduce((E,S,O)=>{if(S!==f){const A=RB(v,b[O]);E.push(...A)}return E},[]).sort((E,S)=>Hb(v.start,E)-Hb(v.start,S));C.length>0?w.push(...IB(v,C,r)):w.push(v)});const x=Gb(w,r,i,o);return bo=[],Cl=[],s.raw?x:x.serialize()},loop:TB,normal:_B,rounded:kB,smooth:VB},Symbol.toStringTag,{value:"Module"}));var ar;(function(n){n.presets=BB,n.registry=Ue.create({type:"connector"}),n.registry.register(n.presets,!0)})(ar||(ar={}));var jB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Wb extends Ve{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ke(e)),this.changed={}}mutate(e,t={}){const s=t.unset===!0,r=t.silent===!0,i=[],o=this.changing;this.changing=!0,o||(this.previous=ke(this.data),this.changed={});const a=this.data,c=this.previous,u=this.changed;if(Object.keys(e).forEach(d=>{const f=d,h=e[f];Pn(a[f],h)||i.push(f),Pn(c[f],h)?delete u[f]:u[f]=h,s?delete a[f]:a[f]=h}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=t,i.forEach(d=>{this.emit("change:*",{key:d,options:t,store:this,current:a[d],previous:c[d]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:c,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const s=this.data[e];return s??t}getPrevious(e){if(this.previous){const t=this.previous[e];return t??void 0}}set(e,t,s){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},s)),this}remove(e,t){const r={};let i;if(typeof e=="string")r[e]=void 0,i=t;else if(Array.isArray(e))e.forEach(o=>r[o]=void 0),i=t;else{for(const o in this.data)r[o]=void 0;i=e}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(e){return Bu(this.data,e,"/")}setByPath(e,t,s={}){const r="/",i=Array.isArray(e)?[...e]:e.split(r),o=Array.isArray(e)?e.join(r):e,a=i[0],c=i.length;if(s.propertyPath=o,s.propertyValue=t,s.propertyPathArray=i,c===1)this.set(a,t,s);else{const u={};let d=u,f=a;for(let g=1;g<c;g+=1){const m=i[g],y=Number.isFinite(Number(m));d=d[f]=y?[]:{},f=m}Ur(u,i,t,r);const h=ke(this.data);s.rewrite&&ey(h,e,r);const p=Ye(h,u);this.set(a,p[a],s)}return this}removeByPath(e,t){const s=Array.isArray(e)?e:e.split("/"),r=s[0];if(s.length===1)this.remove(r,t);else{const i=s.slice(1),o=ke(this.get(r));o&&ey(o,i),this.set(r,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?ke(this.changed):null;const t=this.changing?this.previous:this.data,s={};let r;for(const i in e){const o=e[i];Pn(t[i],o)||(s[i]=o,r=!0)}return r?ke(s):null}toJSON(){return ke(this.data)}clone(){const e=this.constructor;return new e(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})}}jB([Ve.dispose()],Wb.prototype,"dispose",null);class wo{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,s={},r="/"){const i=this.cell.getPropByPath(e),o=lP(s,wo.defaultOptions),a=this.getTiming(o.timing),c=this.getInterp(o.interp,i,t);let u=0;const d=Array.isArray(e)?e.join(r):e,f=Array.isArray(e)?e:e.split(r),h=()=>{const p=new Date().getTime();u===0&&(u=p);let m=(p-u)/o.duration;m<1?this.ids[d]=requestAnimationFrame(h):m=1;const y=c(a(m));this.cell.setPropByPath(f,y),s.progress&&s.progress(Object.assign({progress:m,currentValue:y},this.getArgs(d))),m===1&&(this.cell.notify("transition:complete",this.getArgs(d)),s.complete&&s.complete(this.getArgs(d)),this.cell.notify("transition:finish",this.getArgs(d)),s.finish&&s.finish(this.getArgs(d)),this.clean(d))};return setTimeout(()=>{this.stop(e,void 0,r),this.cache[d]={startValue:i,targetValue:t,options:o},this.ids[d]=requestAnimationFrame(h),this.cell.notify("transition:start",this.getArgs(d)),s.start&&s.start(this.getArgs(d))},s.delay),this.stop.bind(this,e,r,s)}stop(e,t={},s="/"){const r=Array.isArray(e)?e:e.split(s);return Object.keys(this.ids).filter(i=>Pn(r,i.split(s).slice(0,r.length))).forEach(i=>{cancelAnimationFrame(this.ids[i]);const o=this.cache[i],a=this.getArgs(i),c=Object.assign(Object.assign({},o.options),t),u=c.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)),c.complete&&c.complete(Object.assign({},a)));const d=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},d)),c.stop&&c.stop(Object.assign({},d)),this.cell.notify("transition:finish",Object.assign({},a)),c.finish&&c.finish(Object.assign({},a)),this.clean(i)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?rr[e]:e}getInterp(e,t,s){return e?e(t,s):typeof s=="number"?ir.number(t,s):typeof s=="string"?s[0]==="#"?ir.color(t,s):ir.unit(t,s):ir.object(t,s)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(wo||(wo={}));var $B=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},Yb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ge extends Ve{static config(e){const{markup:t,propHooks:s,attrHooks:r}=e,i=Yb(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),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=Ye({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ke(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((s,r)=>r?se(r,e,s):s,t)}get[Symbol.toStringTag](){return ge.toStringTag}constructor(e={}){super();const s=this.constructor.getDefaults(!0),r=Ye({},this.preprocess(s),this.preprocess(e));this.id=r.id||Za(),this.store=new Wb(r),this.animation=new wo(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const s=e.id,i=this.constructor.applyPropHooks(this,e);return s==null&&t!==!0&&(i.id=Za()),i}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:s,previous:r,options:i}=e;this.notify("change:*",{key:t,options:i,current:s,previous:r,cell:this}),this.notify(`change:${t}`,{options:i,current:s,previous:r,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:s,previous:r,options:i,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const s=this.model;return s&&(s.notify(`cell:${e}`,t),this.isNode()?s.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&s.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,s){if(typeof e=="string")this.store.set(e,t,s);else{const r=this.preprocess(e,!0);this.store.set(Ye({},this.getProp(),r),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,s={}){return this.model&&(e==="children"?this._children=t?t.map(r=>this.model.getCell(r)).filter(r=>r!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,s),this}removePropByPath(e,t={}){const s=Array.isArray(e)?e:e.split("/");return s[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(s,t),this}prop(e,t,s){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,s||{}):this.setPropByPath(e,t,s||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let s=t.getMaxZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this],s=s-r.length+1;const i=t.total();let o=t.indexOf(this)!==i-r.length;o||(o=r.some((a,c)=>a.getZIndex()!==s+c)),o&&this.batchUpdate("to-front",()=>{s+=r.length,r.forEach((a,c)=>{a.setZIndex(s+c,e)})})}return this}toBack(e={}){const t=this.model;if(t){let s=t.getMinZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this];let i=t.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,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const s=r=>this.store.set("attrs",r,t);if(t.overwrite===!0)s(e);else{const r=this.getAttrs();t.deep===!1?s(Object.assign(Object.assign({},r),e)):s(Ye({},r,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const s=this.constructor.getAttrHooks()||{};let r=s[e]||kn.registry.get(e);if(!r){const i=la(e);r=s[i]||kn.registry.get(i)}return r||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,s={}){return this.setPropByPath(this.prefixAttrPath(e),t,s),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,s){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,s||{}):this.setAttrByPath(e,t,s||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const s=typeof e=="boolean"?e:!this.isVisible(),r=typeof e=="boolean"?t:e;return s?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const s=r=>this.store.set("data",r,t);if(t.overwrite===!0)s(e);else{const r=this.getData();t.deep===!1?s(typeof e=="object"?Object.assign(Object.assign({},r),e):e):s(Ye({},r,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(s=>{var r;return(r=this.model)===null||r===void 0?void 0:r.getCell(s)}).filter(s=>s!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let s=this.getParent();for(;s;)t.push(s),s=e.deep!==!1?s.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],s=this.getChildren()||[];for(;s.length>0;){const r=s.shift(),i=r.getChildren();t.push(r),i&&s.push(...i)}return t}{const t=this.getChildren()||[];return t.forEach(s=>{t.push(...s.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let s=this.getParent();for(;s;){if(s===e)return!0;s=s.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return ge.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(s=>s.id),t):this.store.remove("children",t),this}unembed(e,t={}){const s=this.children;if(s!=null&&e!=null){const r=this.getChildIndex(e);r!==-1&&(s.splice(r,1),e.setParent(null,t),this.setChildren(s,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return ge.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,s={}){return e.insertChild(this,t,s),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,s={}){if(e!=null&&e!==this){const r=e.getParent(),i=this!==r;let o=t;if(o==null&&(o=this.getChildCount(),i||(o-=1)),r){const c=r.getChildren();if(c){const u=c.indexOf(e);u>=0&&(e.setParent(null,s),c.splice(u,1),r.setChildren(c,s))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,s),this.setChildren(a,s),i&&this.model){const c=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);c&&c.forEach(d=>d.updateParent(s)),u&&u.forEach(d=>d.updateParent(s))}this.model&&this.model.addCell(e,s)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const s=t.getChildIndex(this);t.removeChildAt(s,e)}return this}removeChild(e,t={}){const s=this.getChildIndex(e);return this.removeChildAt(s,t)}removeChildAt(e,t={}){const s=this.getChildAt(e);return this.children!=null&&s!=null&&(this.unembed(s,t),s.remove(t)),s}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(s=>s.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,s={},r="/"){return this.animation.start(e,t,s,r)}stopTransition(e,t,s="/"){return this.animation.stop(e,t,s),this}getTransitions(){return this.animation.get()}translate(e,t,s){return this}scale(e,t,s,r){return this}addTools(e,t,s){const r=Array.isArray(e)?e:[e],i=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof s=="object"?s:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let a=ke(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(e,t={}){return e==null?this.removeTools():this.store.set("tools",ge.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(s=>typeof s=="string"?s===e:s.name===e)}removeTool(e,t={}){const s=ke(this.getTools());if(s){let r=!1;const i=s.items.slice(),o=a=>{i.splice(a,1),r=!0};if(typeof e=="number")o(e);else for(let a=i.length-1;a>=0;a-=1){const c=i[a];(typeof c=="string"?c===e:c.name===e)&&o(a)}r&&(s.items=i,this.setTools(s,t))}return this}getBBox(e){return new G}getConnectionPoint(e,t){return new M}toJSON(e={}){const t=Object.assign({},this.store.get()),s=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${g.name||s.call(g)}"`)}const i=this.constructor,o=e.diff===!0,a=t.attrs||{},c=i.getDefaults(!0),u=o?this.preprocess(c,!0):c,d=u.attrs||{},f={};Object.entries(t).forEach(([g,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!Mn(m))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${s.call(m)}" type of key "${g}" on ${r} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const y=u[g];Pn(m,y)&&delete t[g]}}),Object.keys(a).forEach(g=>{const m=a[g],y=d[g];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 C=w[v];if(y==null||x==null||!Be(x)||!Pn(x[v],C)){f[g]==null&&(f[g]={}),f[g][b]==null&&(f[g][b]={});const E=f[g][b];E[v]=C}}):(y==null||!Pn(x,w))&&(f[g]==null&&(f[g]={}),f[g][b]=w)})});const h=Object.assign(Object.assign({},t),{attrs:Mp(f)?void 0:f});h.attrs==null&&delete h.attrs;const p=h;return p.angle===0&&delete p.angle,ke(p)}clone(e={}){if(!e.deep){const s=Object.assign({},this.store.get());e.keepId||delete s.id,delete s.parent,delete s.children;const r=this.constructor;return new r(s)}return ge.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},s=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),s&&s.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},s=this.model){return s&&s.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,s){const r=this.model;this.startBatch(e,s,r);const i=t();return this.stopBatch(e,s,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}ge.defaults={},ge.attrHooks={},ge.propHooks=[],$B([Ve.dispose()],ge.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(ge||(ge={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"}n.isCell=e}(ge||(ge={})),function(n){function e(...i){const o=i.filter(c=>c!=null).map(c=>c.getAncestors()).sort((c,u)=>c.length-u.length);return o.shift().find(c=>o.every(u=>u.includes(c)))||null}n.getCommonAncestor=e;function t(i,o={}){let a=null;for(let c=0,u=i.length;c<u;c+=1){const d=i[c];let f=d.getBBox(o);if(f){if(d.isNode()){const h=d.getAngle();h!=null&&h!==0&&(f=f.bbox(h))}a=a==null?f:a.union(f)}}return a}n.getCellsBBox=t;function s(i){const o=[i,...i.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=s;function r(i){const o=_p(i),a=o.reduce((c,u)=>(c[u.id]=u.clone(),c),{});return o.forEach(c=>{const u=a[c.id];if(u.isEdge()){const h=u.getSourceCellId(),p=u.getTargetCellId();h&&a[h]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[h].id})),p&&a[p]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[p].id}))}const d=c.getParent();d&&a[d.id]&&u.setParent(a[d.id]);const f=c.getChildren();if(f&&f.length){const h=f.reduce((p,g)=>(a[g.id]&&p.push(a[g.id]),p),[]);h.length>0&&u.setChildren(h)}}),a}n.cloneCells=r}(ge||(ge={})),function(n){n.config({propHooks(e){var{tools:t}=e,s=Yb(e,["tools"]);return t&&(s.tools=n.normalizeTools(t)),s}})}(ge||(ge={}));var li;(function(n){let e,t;function s(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=s;function r(o){e=o}n.setEdgeRegistry=r;function i(o){t=o}n.setNodeRegistry=i})(li||(li={}));class zB{constructor(e){this.ports=[],this.groups={},this.init(ke(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const s=this.getPortsByGroup(e),r=e?this.getGroup(e):null,i=r?r.position:null,o=i?i.name:null;let a;if(o!=null){const f=or.registry.get(o);if(f==null)return or.registry.onNotFound(o);a=f}else a=or.presets.left;const c=s.map(f=>f&&f.position&&f.position.args||{}),u=i&&i.args||{};return a(c,t,u).map((f,h)=>{const p=s[h];return{portLayout:f,portId:p.id,portSize:p.size,portAttrs:p.attrs,labelSize:p.label.size,labelLayout:this.getPortLabelLayout(p,M.create(f.position),t)}})}init(e){const{groups:t,items:s}=e;t!=null&&Object.keys(t).forEach(r=>{this.groups[r]=this.parseGroup(t[r])}),Array.isArray(s)&&s.forEach(r=>{this.ports.push(this.parsePort(r))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),s=this.getGroup(e.group)||{};return t.markup=t.markup||s.markup,t.attrs=Ye({},s.attrs,t.attrs),t.position=this.createPosition(s,t),t.label=Ye({},s.label,this.getLabel(t)),t.zIndex=this.getZIndex(s,t),t.size=Object.assign(Object.assign({},s.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return Ye({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const s=e.label||{};return s.position=this.getPortLabelPosition(s.position,t),s}getPortLabelLayout(e,t,s){const r=e.label.position.name||"left",i=e.label.position.args||{},o=ei.registry.get(r)||ei.presets.left;return o?o(t,s,i):null}}var Sl=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let Ge=class v0 extends ge{get[Symbol.toStringTag](){return v0.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:s,y:r,width:i,height:o}=e,a=Sl(e,["x","y","width","height"]);if(s!=null||r!=null){const c=a.position;a.position=Object.assign(Object.assign({},c),{x:s??(c?c.x:0),y:r??(c?c.y:0)})}if(i!=null||o!=null){const c=a.size;a.size=Object.assign(Object.assign({},c),{width:i??(c?c.width:0),height:o??(c?c.height:0)})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,s){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,s):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,s){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,s),this}resize(e,t,s={}){this.startBatch("resize",s);const r=s.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":t=i.height;break;case"top":case"bottom":e=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 c=ye.normalize(this.getAngle()||0);s.absolute&&(a+=Math.floor((c+45)/90),a%=4);const u=this.getBBox();let d;a===0?d=u.getBottomLeft():a===1?d=u.getCorner():a===2?d=u.getTopRight():d=u.getOrigin();const f=d.clone().rotate(-c,u.getCenter()),h=Math.sqrt(e*e+t*t)/2;let p=a*Math.PI/2;p+=Math.atan(a%2===0?t/e:e/t),p-=ye.toRad(c);const m=M.fromPolar(h,p,f).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},s),this.setPosition(m.x,m.y,s)}else this.store.set("size",{width:e,height:t},s);return this.stopBatch("resize",s),this}scale(e,t,s,r={}){const i=this.getBBox().scale(e,t,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(e,t,s){return typeof e=="number"?this.setPosition(e,t,s):this.getPosition(e)}getPosition(e={}){if(e.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 t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,s={}){let r,i,o;if(typeof e=="object"?(r=e.x,i=e.y,o=t||{}):(r=e,i=t,o=s||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const c=a.getPosition();r+=c.x,i+=c.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(e=0,t=0,s={}){if(e===0&&t===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,c=r.x-o.x,u=r.y-o.y,d=Math.max(a.x+c,Math.min(a.x+a.width+c-o.width,r.x+e)),f=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,r.y+t));e=d-r.x,t=f-r.y}const i={x:r.x+e,y:r.y+t};return s.tx=e,s.ty=t,s.transition?(typeof s.transition!="object"&&(s.transition={}),this.transition("position",i,Object.assign(Object.assign({},s.transition),{interp:ir.object})),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,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(e,t,s)}),this.stopBatch("translate",s)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const s=this.getAngle();if(t.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(s-e,t.center);const a=o.x-r.width/2-i.x,c=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(i.x+a,i.y+c,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(s+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),ge.getCellsBBox(t)}return G.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const s=this.getBBox(),r=s.getCenter(),i=e.getTerminal(t);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,d=M.create(u).translate(s.getOrigin()),f=this.getAngle();return f&&d.rotate(-f,r),d}fit(e={}){const s=(this.getChildren()||[]).filter(u=>u.isNode());if(s.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&s.forEach(u=>u.fit(e));let{x:r,y:i,width:o,height:a}=ge.getCellsBBox(s);const c=ys(e.padding);return r-=c.left,i-=c.top,o+=c.left+c.right,a+=c.bottom+c.top,this.store.set({position:{x:r,y:i},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||De.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",De.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||De.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",De.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||De.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",De.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return ke(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ke(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(s=>s.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new G(0,0,t.width,t.height)).reduce((r,i)=>{const o=i.portLayout;return r[i.portId]={position:Object.assign({},o.position),angle:o.angle||0},r},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,s,r){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),c=s;return this.setPropByPath(a,c,r)}const i=this.prefixPortPath(e),o=t;return this.setPropByPath(i,o,s)}removePortProp(e,t,s){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),s):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,s,r){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):s==null?this.removePortProp(e,t,r):this.setPortProp(e,t,s,r):this.setPortProp(e,t,s)}prefixPortPath(e,t){const s=this.getPortIndex(e);if(s===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${s}`]:Array.isArray(t)?["ports","items",`${s}`,...t]:`ports/items/${s}/${t}`}addPort(e,t){const s=[...this.ports.items];return s.push(e),this.setPropByPath("ports/items",s,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,s){const r=[...this.ports.items];return r.splice(e,0,t),this.setPropByPath("ports/items",r,s),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const s=[...this.ports.items];s.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",s,t)}return this}removePorts(e,t){let s;if(Array.isArray(e)){if(s=t||{},e.length){s.rewrite=!0;const i=[...this.ports.items].filter(o=>!e.some(a=>{const c=typeof a=="string"?a:a.id;return o.id===c}));this.setPropByPath("ports/items",i,s)}}else s=e||{},s.rewrite=!0,this.setPropByPath("ports/items",[],s);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const s={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(s[o.id]=!0)});const i=this.model;i&&!Mp(s)&&(i.getConnectedEdges(this,{incoming:!0}).forEach(c=>{const u=c.getTargetPortId();u&&s[u]&&c.remove()}),i.getConnectedEdges(this,{outgoing:!0}).forEach(c=>{const u=c.getSourcePortId();u&&s[u]&&c.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(s=>{typeof s!="object"&&t.push(`Invalid port ${s}.`),s.id==null&&(s.id=this.generatePortId()),e[s.id]&&t.push("Duplicitied port id."),e[s.id]=!0}),t}generatePortId(){return Za()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new zB(this.ports);const s=this.port.getPorts(),r=t?s.filter(o=>t.find(a=>a.id===o.id)?null:o):[...s],i=t?t.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})}};Ge.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e}(Ge||(Ge={})),function(n){n.config({propHooks(e){var{ports:t}=e,s=Sl(e,["ports"]);return t&&(s.ports=Array.isArray(t)?{items:t}:t),s}})}(Ge||(Ge={})),function(n){n.registry=Ue.create({type:"node",process(e,t){if(li.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r}=t,i=Sl(t,["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=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),li.setNodeRegistry(n.registry)}(Ge||(Ge={})),function(n){let e=0;function t(i){return i?ju(i):(e+=1,`CustomNode${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=Sl(i,["constructorName","overwrite"]),u=Lu(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.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}(Ge||(Ge={}));var El=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let $e=class C0 extends ge{get[Symbol.toStringTag](){return C0.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:s,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:c,targetPort:u,targetPoint:d}=e,h=El(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),p=g=>typeof g=="string"||typeof g=="number";if(s!=null)if(ge.isCell(s))h.source={cell:s.id};else if(p(s))h.source={cell:s};else if(M.isPoint(s))h.source=s.toJSON();else if(Array.isArray(s))h.source={x:s[0],y:s[1]};else{const g=s.cell;ge.isCell(g)?h.source=Object.assign(Object.assign({},s),{cell:g.id}):h.source=s}if(r!=null||i!=null){let g=h.source;if(r!=null){const m=p(r)?r:r.id;g?g.cell=m:g=h.source={cell:m}}i!=null&&g&&(g.port=i)}else o!=null&&(h.source=M.create(o).toJSON());if(a!=null)if(ge.isCell(a))h.target={cell:a.id};else if(p(a))h.target={cell:a};else if(M.isPoint(a))h.target=a.toJSON();else if(Array.isArray(a))h.target={x:a[0],y:a[1]};else{const g=a.cell;ge.isCell(g)?h.target=Object.assign(Object.assign({},a),{cell:g.id}):h.target=a}if(c!=null||u!=null){let g=h.target;if(c!=null){const m=p(c)?c:c.id;g?g.cell=m:g=h.target={cell:m}}u!=null&&g&&(g.port=u)}else d!=null&&(h.target=M.create(d).toJSON());return super.preprocess(h,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,s={}){return this.setTerminal("source",e,t,s)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,s={}){return this.setTerminal("target",e,t,s)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,s,r={}){if(ge.isCell(t))return this.store.set(e,Ye({},s,{cell:t.id}),r),this;const i=t;return M.isPoint(t)||i.x!=null&&i.y!=null?(this.store.set(e,Ye({},s,{x:i.x,y:i.y}),r),this):(this.store.set(e,ke(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(M.isPointLike(t))return M.create(t);const s=this.getTerminalCell(e);return s?s.getConnectionPoint(this,e):new M}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const s={};for(;t&&t.isEdge();){if(s[t.id])return null;s[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,s){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},s),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,s){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},s),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return ke(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,s={}){const r=this.getLabels(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(e)),this.setLabels(r,s)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getLabels();r[e]=this.parseLabel(t),this.setLabels(r,s)}return this}removeLabelAt(e,t={}){const s=this.getLabels(),r=e!=null&&Number.isFinite(e)?e:-1,i=s.splice(r,1);return this.setLabels(s,t),i.length?i[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>i===o||Pn(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>i===o||Pn(i,o))?null:i):e?[...e]:[];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(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const s=Array.isArray(e)?e:[e];return this.store.set("vertices",s.map(r=>M.toJSON(r)),t),this}insertVertex(e,t,s={}){const r=this.getVertices(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,M.toJSON(e)),this.setVertices(r,s)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getVertices();r[e]=t,this.setVertices(r,s)}return this}removeVertexAt(e,t={}){const s=this.getVertices(),r=e!=null&&Number.isFinite(e)?e:-1;return s.splice(r,1),this.setVertices(s,t)}onVertexsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>M.equals(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>M.equals(i,o))?null:i):e?[...e]:[];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")||De.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,s={}){return s.translateBy=s.translateBy||this.id,s.tx=e,s.ty=t,this.applyToPoints(r=>({x:(r.x||0)+e,y:(r.y||0)+t}),s)}scale(e,t,s,r={}){return this.applyToPoints(i=>M.create(i).scale(e,t,s).toJSON(),r)}applyToPoints(e,t={}){const s={},r=this.getSource(),i=this.getTarget();M.isPointLike(r)&&(s.source=e(r)),M.isPointLike(i)&&(s.target=e(i));const o=this.getVertices();return o.length>0&&(s.vertices=o.map(e)),this.store.set(s,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>M.create(t)),this.getTargetPoint()];return new Fe(e)}updateParent(e){let t=null;const s=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return s&&r&&(s===r||s.isDescendantOf(r)?t=r:r.isDescendantOf(s)?t=s:t=ge.getCommonAncestor(s,r)),i&&t&&t.id!==i.id&&i.unembed(this,e),t&&(!i||i.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),s=this.getTarget(),r=t.cell,i=s.cell;if(!r||!i)return!1;let o=r===i;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),c=this.getTargetCell();a&&c&&(o=a.isAncestorOf(c,e)||c.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};$e.defaults={},function(n){function e(t,s){const r=t,i=s;return r.cell===i.cell?r.port===i.port||r.port==null&&i.port==null:!1}n.equalTerminals=e}($e||($e={})),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 e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}($e||($e={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e}($e||($e={})),function(n){n.registry=Ue.create({type:"edge",process(e,t){if(li.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r="edge"}=t,i=El(t,["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=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),li.setEdgeRegistry(n.registry)}($e||($e={})),function(n){let e=0;function t(i){return i?ju(i):(e+=1,`CustomEdge${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=El(i,["constructorName","overwrite"]),u=Lu(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.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}($e||($e={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:s,vertices:r}=t,i=El(t,["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=>M.create(o).toJSON())),i}}),n.registry.register(e,n)}($e||($e={}));var FB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Ol extends Ve{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,s){let r,i;typeof t=="number"?(r=t,i=Object.assign({merge:!1},s)):(r=this.length,i=Object.assign({merge:!1},t)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&i.sort!==!1,c=this.comparator||null;let u=!1;const d=[],f=[];return o.forEach(h=>{const p=this.get(h);p?i.merge&&!h.isSameStore(p)&&(p.setProp(h.getProp(),s),f.push(p),a&&!u&&(c==null||typeof c=="function"?u=p.hasChanged():typeof c=="string"?u=p.hasChanged(c):u=c.some(g=>p.hasChanged(g)))):(d.push(h),this.reference(h))}),d.length&&(a&&(u=!0),this.cells.splice(r,0,...d),this.length=this.cells.length),u&&this.sort({silent:!0}),i.silent||(d.forEach((h,p)=>{const g={cell:h,index:r+p,options:i};this.trigger("added",g),i.dryrun||h.notify("added",Object.assign({},g))}),u&&this.trigger("sorted"),(d.length||f.length)&&this.trigger("updated",{added:d,merged:f,removed:[],options:i})),this}remove(e,t={}){const s=Array.isArray(e)?e:[e],r=this.removeCells(s,t);return!t.silent&&r.length>0&&this.trigger("updated",{options:t,removed:r,added:[],merged:[]}),Array.isArray(e)?r:r[0]}removeCells(e,t){const s=[];for(let r=0;r<e.length;r+=1){const i=this.get(e[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),t.dryrun||i.remove(),t.silent||(this.trigger("removed",{cell:i,index:o,options:t}),t.dryrun||i.notify("removed",{cell:i,index:o,options:t}))}return s}reset(e,t={}){const s=this.cells.slice();if(s.forEach(r=>this.unreference(r)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const r=this.cells.slice();this.trigger("reseted",{options:t,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:t,added:i,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Lc(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const s=t.cell;this.trigger(`cell:${e}`,t),s&&(s.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:s})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}FB([Ol.dispose()],Ol.prototype,"dispose",null);var UB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class nt extends Ve{get[Symbol.toStringTag](){return nt.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Ol(e),this.setup()}notify(e,t){this.trigger(e,t);const s=this.graph;return s&&(e==="sorted"||e==="reseted"||e==="updated"?s.trigger(`model:${e}`,t):s.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const s=t.cell;this.onCellRemoved(s,t.options),this.notify("cell:removed",t),s.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:s}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const s=e.id;if(e.isEdge()){delete this.edges[s];const r=e.getSource(),i=e.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];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const s=t==="source"?this.outgoings:this.incomings,r=e.previous(t);if(r&&r.cell){const o=ge.isCell(r.cell)?r.cell.id:r.cell,a=s[o],c=a?a.indexOf(e.id):-1;c>=0&&(a.splice(c,1),a.length===0&&delete s[o])}const i=e.getTerminal(t);if(i&&i.cell){const o=ge.isCell(i.cell)?i.cell.id:i.cell,a=s[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),s[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(s=>this.prepareCell(s,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(s=>this.prepareCell(s,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const s=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const r=t.sort((i,o)=>{const a=i.isEdge()?1:2,c=o.isEdge()?1:2;return a-c});for(;r.length>0;){const i=r.shift();i&&i.remove(s)}},s),this}addNode(e,t={}){const s=Ge.isNode(e)?e:this.createNode(e);return this.addCell(s,t),s}updateNode(e,t={}){const s=this.createNode(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}createNode(e){return Ge.create(e)}addEdge(e,t={}){const s=$e.isEdge(e)?e:this.createEdge(e);return this.addCell(s,t),s}createEdge(e){return $e.create(e)}updateEdge(e,t={}){const s=this.createEdge(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(s=>this.addCell(s,t)),this.addings.delete(e)),this)}addCells(e,t={}){const s=e.length;if(s===0)return this;const r=Object.assign(Object.assign({},t),{position:s-1,maxPosition:s-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:e})),e.forEach(i=>{this.addCell(i,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:e})),this}updateCell(e,t={}){const s=e.id&&this.getCell(e.id);return s?this.batchUpdate("update",()=>(Object.entries(e).forEach(([r,i])=>s.setProp(r,i,t)),!0),e):!1}removeCell(e,t={}){const s=typeof e=="string"?this.getCell(e):e;return s&&this.has(s)?this.collection.remove(s,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);const s=e.clone({keepId:!0});return this.addCell(s),this.getConnectedEdges(e).forEach(i=>{const o=i.getSourceCell(),a=i.getTargetCell();o===e&&i.setSource(Object.assign(Object.assign({},i.getSource()),{cell:t})),a===e&&i.setTarget(Object.assign(Object.assign({},i.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),s}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(s=>this.removeCell(s,t))):[]}removeConnectedEdges(e,t={}){const s=this.getConnectedEdges(e);return s.forEach(r=>{r.remove(t)}),s}disconnectConnectedEdges(e,t={}){const s=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(r=>{const i=r.getSourceCellId(),o=r.getTargetCellId();i===s&&r.setSource({x:0,y:0},t),o===s&&r.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,s=this.outgoings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,s=this.incomings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getConnectedEdges(e,t={}){const s=[],r=typeof e=="string"?this.getCell(e):e;if(r==null)return s;const i={},o=t.indirect;let a=t.incoming,c=t.outgoing;a==null&&c==null&&(a=c=!0);const u=(d,f)=>{const h=f?this.getOutgoingEdges(d):this.getIncomingEdges(d);if(h!=null&&h.forEach(p=>{i[p.id]||(s.push(p),i[p.id]=!0,o&&(a&&u(p,!1),c&&u(p,!0)))}),o&&d.isEdge()){const p=f?d.getTargetCell():d.getSourceCell();p&&p.isEdge()&&(i[p.id]||(s.push(p),u(p,f)))}};if(c&&u(r,!0),a&&u(r,!1),t.deep){const d=r.getDescendants({deep:!0}),f={};d.forEach(p=>{p.isNode()&&(f[p.id]=!0)});const h=(p,g)=>{const m=g?this.getOutgoingEdges(p.id):this.getIncomingEdges(p.id);m!=null&&m.forEach(y=>{if(!i[y.id]){const b=y.getSourceCell(),w=y.getTargetCell();if(!t.enclosed&&b&&f[b.id]&&w&&f[w.id])return;s.push(y),i[y.id]=!0}})};d.forEach(p=>{p.isEdge()||(c&&h(p,!0),a&&h(p,!1))})}return s}isBoundary(e,t){const s=typeof e=="string"?this.getCell(e):e,r=t?this.getIncomingEdges(s):this.getOutgoingEdges(s);return r==null||r.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(s=>{if(this.isBoundary(s,e)){const r=this.getCell(s);r&&t.push(r)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let s=t.incoming,r=t.outgoing;s==null&&r==null&&(s=r=!0);const o=this.getConnectedEdges(e,t).reduce((a,c)=>{const u=c.hasLoop(t),d=c.getSourceCell(),f=c.getTargetCell();return s&&d&&d.isNode()&&!a[d.id]&&(u||d!==e&&(!t.deep||!d.isDescendantOf(e)))&&(a[d.id]=d),r&&f&&f.isNode()&&!a[f.id]&&(u||f!==e&&(!t.deep||!f.isDescendantOf(e)))&&(a[f.id]=f),a},{});if(e.isEdge()){if(s){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(r){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,s={}){let r=s.incoming,i=s.outgoing;return r==null&&i==null&&(r=i=!0),this.getConnectedEdges(e,s).some(o=>{const a=o.getSourceCell(),c=o.getTargetCell();return!!(r&&a&&a.id===t.id||i&&c&&c.id===t.id)})}getSuccessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{outgoing:!0})),s}isSuccessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{outgoing:!0})),r}getPredecessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{incoming:!0})),s}isPredecessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{incoming:!0})),r}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(s=>{s&&(Array.isArray(s)?t.push(...s):t.push(s))}),ge.getCommonAncestor(...t)}getSubGraph(e,t={}){const s=[],r={},i=[],o=[],a=c=>{r[c.id]||(s.push(c),r[c.id]=c,c.isEdge()&&o.push(c),c.isNode()&&i.push(c))};return e.forEach(c=>{a(c),t.deep&&c.getDescendants({deep:!0}).forEach(d=>a(d))}),o.forEach(c=>{const u=c.getSourceCell(),d=c.getTargetCell();u&&!r[u.id]&&(s.push(u),r[u.id]=u,u.isNode()&&i.push(u)),d&&!r[d.id]&&(s.push(d),r[d.id]=d,d.isNode()&&i.push(d))}),i.forEach(c=>{this.getConnectedEdges(c,t).forEach(d=>{const f=d.getSourceCell(),h=d.getTargetCell();!r[d.id]&&f&&r[f.id]&&h&&r[h.id]&&(s.push(d),r[d.id]=d)})}),s}cloneSubGraph(e,t={}){const s=this.getSubGraph(e,t);return this.cloneCells(s)}cloneCells(e){return ge.cloneCells(e)}getNodesFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(r=>r.getBBox().containsPoint(s))}getNodesInArea(e,t,s,r,i){const o=typeof e=="number"?new G(e,t,s,r):G.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getNodes().filter(u=>{const d=u.getBBox();return c?o.containsRect(d):o.isIntersectWithRect(d)})}getEdgesInArea(e,t,s,r,i){const o=typeof e=="number"?new G(e,t,s,r):G.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getEdges().filter(u=>{const d=u.getBBox();return d.width===0?d.inflate(1,0):d.height===0&&d.inflate(0,1),c?o.containsRect(d):o.isIntersectWithRect(d)})}getNodesUnderNode(e,t={}){const s=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(s):this.getNodesFromPoint(s[t.by])).filter(i=>e.id!==i.id&&!i.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return ge.getCellsBBox(e,t)}search(e,t,s={}){s.breadthFirst?this.breadthFirstSearch(e,t,s):this.depthFirstSearch(e,t,s)}breadthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.shift();if(a==null||i[a.id]||(i[a.id]=!0,se(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,s).forEach(u=>{o[u.id]=o[a.id]+1,r.push(u)})}}depthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.pop();if(a==null||i[a.id]||(i[a.id]=!0,se(t,this,a,o[a.id])===!1))continue;const c=this.getNeighbors(a,s),u=r.length;c.forEach(d=>{o[d.id]=o[a.id]+1,r.splice(u,0,d)})}}getShortestPath(e,t,s={}){const r={};this.getEdges().forEach(u=>{const d=u.getSourceCellId(),f=u.getTargetCellId();d&&f&&(r[d]||(r[d]=[]),r[f]||(r[f]=[]),r[d].push(f),s.directed||r[f].push(d))});const i=typeof e=="string"?e:e.id,o=rd.run(r,i,s.weight),a=[];let c=typeof t=="string"?t:t.id;for(o[c]&&a.push(c);c=o[c];)a.unshift(c);return a}translate(e,t,s){return this.getCells().filter(r=>!r.hasParent()).forEach(r=>r.translate(e,t,s)),this}resize(e,t,s){return this.resizeCells(e,t,this.getCells(),s)}resizeCells(e,t,s,r={}){const i=this.getCellsBBox(s);if(i){const o=Math.max(e/i.width,0),a=Math.max(t/i.height,0),c=i.getOrigin();s.forEach(u=>u.scale(o,a,c,r))}return this}toJSON(e={}){return nt.toJSON(this.getCells(),e)}parseJSON(e){return nt.fromJSON(e)}fromJSON(e,t={}){const s=this.parseJSON(e);return this.resetCells(s,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,s={}){this.startBatch(e,s);const r=t();return this.stopBatch(e,s),r}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(s=>this.batches[s]>0)}dispose(){this.collection.dispose()}}UB([nt.dispose()],nt.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.addNode=="function"&&typeof r.addEdge=="function"&&r.collection!=null}n.isModel=e}(nt||(nt={})),function(n){function e(s,r={}){return{cells:s.map(i=>i.toJSON(r))}}n.toJSON=e;function t(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(Ge.registry.exist(o))return Ge.create(i);if($e.registry.exist(o))return $e.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(nt||(nt={}));var HB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let ks=class extends Ge{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),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(e){const{label:t}=e,s=HB(e,["label"]);return t&&Ur(s,"attrs/text/text",t),s},visible:!0})})(ks||(ks={}));var GB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function WB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function YB(n="xlink:href"){return t=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=t,o=GB(t,["imageUrl","imageWidth","imageHeight"]);if(s!=null||r!=null||i!=null){const a=()=>{if(o.attrs){const c=o.attrs.image;s!=null&&(c[n]=s),r!=null&&(c.width=r),i!=null&&(c.height=i),o.attrs.image=c}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function ci(n,e,t={}){const s={constructorName:n,markup:WB(n,t.selector),attrs:{[n]:Object.assign({},ks.bodyAttr)}};return(t.parent||ks).define(Ye(s,e,{shape:n}))}ci("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const qB=$e.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"}}});ci("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var XB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ui extends ks{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",ui.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(s=>Array.isArray(s)?s.join(","):M.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:s}=t,r=XB(t,["points"]);if(s){const i=e(s);i&&Ur(r,"attrs/body/refPoints",i)}return r}})})(ui||(ui={})),ci("polygon",{},{parent:ui}),ci("polyline",{},{parent:ui});var JB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};ks.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:e}=n,t=JB(n,["path"]);return e&&Ur(t,"attrs/body/refD",e),t}});var KB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};ks.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},bs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:it.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({},ks.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=KB(n,["text"]);return e&&Ur(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,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%"},c=Object.assign({textVerticalAnchor:"middle"},o),u=kn.presets.textWrap;return se(u.set,this,a,{cell:e,view:t,elem:r,refBBox:s,attrs:c}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),ci("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:YB()},{selector:"image"}),ci("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class wn extends He{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return wn.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const s=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?Ie(t,s):ee(t,s)}else{const s=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(s):this.addClass(s)}}isNodeView(){return!0}confirmUpdate(e,t={}){let s=e;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")===e?this.renderTools():this.updateTools(t)})),s}update(e){this.cleanCache(),this.removePorts();const t=this.cell,s=t.getSize(),r=t.getAttrs();this.updateAttrs(this.container,r,{attrs:e===r?null:e,rootBBox:new G(0,0,s.width,s.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.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 e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const s=e?this.portsCache[e]:null;if(!s)return null;const r=s.portContentElement,i=s.portContentSelectors||{};return this.findOne(t,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{Yt(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const s=this.cell.getParsedPorts(),r=Op(s,"zIndex"),i="auto";r[i]&&r[i].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(r).forEach(o=>{if(o!==i){const a=parseInt(o,10);this.appendPorts(r[o],a,t)}}),this.updatePorts()}appendPorts(e,t,s){const r=e.map(i=>this.getPortElement(i));s[t]||t<0?qu(s[Math.max(t,0)],r):Lt(this.container,r)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=De.renderMarkup(this.cell.getPortContainerMarkup());const s=t.elem;if(s==null)throw new Error("Invalid port container markup.");t=De.renderMarkup(this.getPortMarkup(e));const r=t.elem,i=t.selectors;if(r==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},r);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),ee(s,o),ee(s,"x6-port"),ee(r,"x6-port-body"),s.appendChild(r);let a=i,c,u;if(this.existPortLabel(e)){if(t=De.renderMarkup(this.getPortLabelMarkup(e.label)),c=t.elem,u=t.selectors,c==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)}ee(c,"x6-port-label"),s.appendChild(c)}return this.portsCache[e.id]={portElement:s,portSelectors:a,portLabelElement:c,portLabelSelectors:u,portContentElement:r,portContentSelectors:i},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:s,selectors:a,labelContainer:c,labelSelectors:u,contentContainer:r,contentSelectors:i}),s}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(s=>this.updatePortGroup(s))}updatePortGroup(e){const t=G.fromSize(this.cell.getSize()),s=this.cell.getPortsLayoutByGroup(e,t);for(let r=0,i=s.length;r<i;r+=1){const o=s[r],a=o.portId,c=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(c.portElement,u),o.portAttrs!=null){const f={selectors:c.portSelectors||{}};o.portSize&&(f.rootBBox=G.fromSize(o.portSize)),this.updateAttrs(c.portElement,o.portAttrs,f)}const d=o.labelLayout;if(d&&c.portLabelElement&&(this.applyPortTransform(c.portLabelElement,d,-(u.angle||0)),d.attrs)){const f={selectors:c.portLabelSelectors||{}};o.labelSize&&(f.rootBBox=G.fromSize(o.labelSize)),this.updateAttrs(c.portLabelElement,d.attrs,f)}}}applyPortTransform(e,t,s=0){const r=t.angle,i=t.position,o=ot().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);Yr(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,node:i,cell:o}:{e,x:t,y:s,view:r,node:i,cell:o}}getPortEventArgs(e,t,s){const r=this,i=r.cell,o=i;return s?{e,x:s.x,y:s.y,view:r,node:i,cell:o,port:t}:{e,view:r,node:i,cell:o,port:t}}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("node:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("node:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("node:mouseup",this.getEventArgs(e,t,s))}notifyPortEvent(e,t,s){const r=this.findAttr("port",t.target);if(r){const i=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,r,s)),t.type=i}}onClick(e,t,s){super.onClick(e,t,s),this.notify("node:click",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:click",e,{x:t,y:s})}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("node:dblclick",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:s})}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("node:contextmenu",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:s})}onMouseDown(e,t,s){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,s),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:s}),this.startNodeDragging(e,t,s))}onMouseMove(e,t,s){const r=this.getEventData(e),i=r.action;if(i==="magnet")this.dragMagnet(e,t,s);else{if(i==="move"){const a=r.targetView||this;a.dragNode(e,t,s),a.notify("node:moving",{e,x:t,y:s,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,s),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:s})}this.setEventData(e,r)}onMouseUp(e,t,s){const r=this.getEventData(e),i=r.action;i==="magnet"?this.stopMagnetDragging(e,t,s):(this.notifyMouseUp(e,t,s),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:s}),i==="move"&&(r.targetView||this).stopNodeDragging(e,t,s));const o=r.targetMagnet;o&&this.onMagnetClick(e,o,t,s),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onMagnetClick(e,t,s,r){const i=this.graph;i.view.getMouseMovedCount(e)>i.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetDblClick(e,t,s,r){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetContextMenu(e,t,s,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){this.startMagnetDragging(e,s,r)}onCustomEvent(e,t,s,r){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}prepareEmbedding(e){const t=this.graph,r=this.getEventData(e).cell||this.cell,i=t.findViewByCell(r),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:r,view:i,cell:r,x:o.x,y:o.y,currentParent:r.getParent()})}processEmbedding(e,t){const s=t.cell||this.cell,r=t.graph||this.graph,i=r.options.embedding,o=i.findParent;let a=typeof o=="function"?se(o,r,{view:this,node:this.cell}).filter(h=>ge.isCell(h)&&this.cell.id!==h.id&&!h.isDescendantOf(this.cell)):r.model.getNodesUnderNode(s,{by:o});if(i.frontOnly&&a.length>0){const h=Op(a,"zIndex"),p=_P(Object.keys(h).map(g=>parseInt(g,10)));p&&(a=h[p])}a=a.filter(h=>h.visible);let c=null;const u=t.candidateEmbedView,d=i.validate;for(let h=a.length-1;h>=0;h-=1){const p=a[h];if(u&&u.cell.id===p.id){c=u;break}else{const g=p.findView(r);if(d&&se(d,r,{child:this.cell,parent:g.cell,childView:this,parentView:g})){c=g;break}}}this.clearEmbedding(t),c&&c.highlight(null,{type:"embedding"}),t.candidateEmbedView=c;const f=r.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:s,node:s,view:r.findViewByCell(s),x:f.x,y:f.y,currentParent:s.getParent(),candidateParent:c?c.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const s=t.cell||this.cell,r=t.graph||this.graph,i=r.findViewByCell(s),o=s.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.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(c=>{c.updateParent({ui:!0})}),i&&a){const c=r.snapToGrid(e.clientX,e.clientY);i.notify("node:embedded",{e,cell:s,x:c.x,y:c.y,node:s,view:r.findViewByCell(s),previousParent:o,currentParent:s.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,s){if(t.getAttribute("magnet")!=="passive"){const r=this.graph.options.connecting.validateMagnet;return r?se(r,this.graph,{e:s,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,s){if(!this.can("magnetConnectable"))return;e.stopPropagation();const r=e.currentTarget,i=this.graph;this.setEventData(e,{targetMagnet:r}),this.validateMagnet(this,r,e)?(i.options.magnetThreshold<=0&&this.startConnectting(e,r,t,s),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,s),i.view.delegateDragEvents(e,this)}startConnectting(e,t,s,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(t,s,r);i.setEventData(e,i.prepareArrowheadDragging("target",{x:s,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:i}),i.notifyMouseDown(e,s,r)}getDefaultEdge(e,t){let s;const r=this.graph.options.connecting.createEdge;return r&&(s=se(r,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),s}createEdgeFromMagnet(e,t,s){const r=this.graph,i=r.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,s,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:s})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(e,t,s){const r=this.getEventData(e),i=r.edgeView;if(i)i.onMouseMove(e,t,s),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,c=this.getEventTarget(e),u=r.targetMagnet;if(a==="onleave"){if(u===c||u.contains(c))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,u,t,s)}}stopMagnetDragging(e,t,s){const i=this.eventData(e).edgeView;i&&(i.onMouseUp(e,t,s),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,s){this.notify("node:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,s,r,i){let o=[i];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const c=a.getSelectedCells();c.includes(i)&&(o=c.filter(u=>u.isNode()))}o.forEach(c=>{this.notify(e,{e:t,x:s,y:r,cell:c,node:c,view:c.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?se(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}startNodeDragging(e,t,s){const r=this.getDelegatedView();if(r==null||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,s);this.setEventData(e,{targetView:r,action:"move"});const i=M.create(r.cell.getPosition());r.setEventData(e,{moving:!1,offset:i.diff(t,s),restrict:this.getRestrictArea(r)})}dragNode(e,t,s){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(e),c=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,s,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const d=Se.snapToGrid(t+c.x,o),f=Se.snapToGrid(s+c.y,o);r.setPosition(d,f,{restrict:u,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,s){const r=this.getEventData(e);r.embedding&&this.finalizeEmbedding(e,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,s,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");s&&s.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e})(wn||(wn={})),wn.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"]}}),wn.registry.register("node",wn,!0);var ZB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ts extends He{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return ts.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const s=this.cell.getSource();return new G(s.x,s.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new G(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const s=this.cell.getTarget();return new G(s.x,s.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new G(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let s=e;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(t)),s=this.handleAction(s,"labels",()=>this.onLabelsChange(t)),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 e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let s=0,r=t.length;s<r;s+=1){const i=t[s],o=this.labelCache[s],a=this.labelSelectors[s],c=this.graph.options.onEdgeLabelRendered;if(c){const u=c({edge:e,label:i,container:o,selectors:a});u&&(this.labelDestroyFn[s]=u)}}}}destroyCustomizeLabels(){const e=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let t=0,s=e.length;t<s;t+=1){const r=this.labelDestroyFn[t],i=this.labelCache[t],o=this.labelSelectors[t];r&&i&&o&&r({edge:this.cell,label:e[t],container:i,selectors:o})}this.labelDestroyFn={}}renderLabels(){const e=this.cell,t=e.getLabels(),s=t.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=yn("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let i=0,o=t.length;i<o;i+=1){const a=t[i],c=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,d;if(c)u=c.node,d=c.selectors;else{const h=e.getDefaultLabel(),p=this.normalizeLabelMarkup(this.parseLabelMarkup(h.markup));u=p.node,d=p.selectors}u.setAttribute("data-index",`${i}`),r.appendChild(u);const f=this.rootSelector;if(d[f])throw new Error("Ambiguous label root selector.");d[f]=u,this.labelCache[i]=u,this.labelSelectors[i]=d}return r.parentNode==null&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const s=e.propertyPathArray||[],r=s.length;if(r>1){const i=s[1];if(t[i]){if(r===2)return typeof e.propertyValue=="object"&&ga(e.propertyValue,"markup");if(s[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=oe.createVectors(e),s=document.createDocumentFragment();for(let r=0,i=t.length;r<i;r+=1){const o=t[r].node;s.appendChild(o)}return{fragment:s,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let s;const r=t.childNodes;return r.length>1||r[0].nodeName.toUpperCase()!=="G"?s=oe.create("g").append(t):s=oe.create(r[0]),s.addClass(this.prefixClassName("edge-label")),{node:s.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,s=this.can("edgeLabelMovable"),r=e.getDefaultLabel();for(let i=0,o=t.length;i<o;i+=1){const a=this.labelCache[i],c=this.labelSelectors[i];a.setAttribute("cursor",s?"move":"default");const u=t[i],d=Ye({},r.attrs,u.attrs);this.updateAttrs(a,d,{selectors:c,rootBBox:u.size?G.fromSize(u.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs(),s=ZB(t,["text"]);return s!=null&&this.updateAttrs(this.container,s,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,s=t.getVertices(),r=[this.sourceAnchor,...s,this.targetAnchor],i=r.length,o=new Fe(r);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),c=a.length;return i===c?0:(t.setVertices(a.slice(1,c-1),e),i-c)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return M.create(this.sourceAnchor);case"target":return M.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return M.create(this.sourcePoint);case"target":return M.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const s=this.sourceView;return s?this.sourceMagnet||s.container:null}case"target":{if(t.raw)return this.targetMagnet;const s=this.targetView;return s?this.targetMagnet||s.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const s=e.tx||0,r=e.ty||0;this.routePoints=new Fe(this.routePoints).translate(s,r).points,this.translateConnectionPoints(s,r),this.path.translate(s,r)}else{const s=t.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(e){const t=this.cell,s=t.source,r=t.target,i=e[0],o=e[e.length-1];return r.priority&&!s.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(e,t,s,r){let i,o;const a=this.cell,c=a[e],u=a[s],d=this.getTerminalView(e),f=this.getTerminalView(s),h=this.getTerminalMagnet(e),p=this.getTerminalMagnet(s);if(d){let g;t?g=M.create(t):f?g=p:g=M.create(u),i=this.getAnchor(c.anchor,d,h,g,e)}else i=M.create(c);if(f){const g=M.create(r||i);o=this.getAnchor(u.anchor,f,p,g,s)}else o=M.isPointLike(u)?M.create(u):new M;return{[e]:i,[s]:o}}getAnchor(e,t,s,r,i){const o=t.isEdgeElement(s),a=this.graph.options.connecting;let c=typeof e=="string"?{name:e}:e;if(!c){const f=o?(i==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(i==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;c=typeof f=="string"?{name:f}:f}if(!c)throw new Error("Anchor should be specified.");let u;const d=c.name;if(o){const f=ii.registry.get(d);if(typeof f!="function")return ii.registry.onNotFound(d);u=se(f,this,t,s,r,c.args||{},i)}else{const f=ri.registry.get(d);if(typeof f!="function")return ri.registry.onNotFound(d);u=se(f,this,t,s,r,c.args||{},i)}return u?u.round(this.POINT_ROUNDING):new M}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Ts.presets.normal,s=this.cell.getRouter()||t;let r;if(typeof s=="function")r=se(s,this,e,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ts.registry.get(i):Ts.presets.normal;if(typeof a!="function")return Ts.registry.onNotFound(i);r=se(a,this,e,o,this)}return r==null?e.map(i=>M.create(i)):r.map(i=>M.create(i))}findConnectionPoints(e,t,s){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),c=this.sourceView,u=this.targetView,d=e[0],f=e[e.length-1];let h;if(c&&!c.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||c.container,m=d||s,y=new K(m,t),b=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;h=this.getConnectionPoint(b,c,g,y,"source")}else h=t;let p;if(u&&!u.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||u.container,m=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,y=f||t,b=new K(y,s);p=this.getConnectionPoint(m,u,g,b,"target")}else p=s;return{source:h,target:p}}getConnectionPoint(e,t,s,r,i){const o=r.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,c=typeof e=="string"?{}:e.args,u=oi.registry.get(a);if(typeof u!="function")return oi.registry.onNotFound(a);const d=se(u,this,r,t,s,c||{},i);return d?d.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,s){const r=f=>{const h=this.cell.getAttrs(),p=Object.keys(h);for(let g=0,m=p.length;g<m;g+=1){const y=h[p[g]];if(y[`${f}Marker`]||y[`${f}-marker`]){const b=y.strokeWidth||y["stroke-width"];if(b)return parseFloat(b);break}}return null},i=e[0],o=e[e.length-1];let a,c;const u=r("source");u&&(a=t.clone().move(i||s,-u));const d=r("target");return d&&(c=s.clone().move(o||t,-d)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=c||s.clone(),{source:a,target:c}}findPath(e,t,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=ar.registry.get(i);if(typeof u!="function")return ar.registry.onNotFound(i);a=u}else a=ar.presets.normal;const c=se(a,this,t,s,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof c=="string"?re.parse(c):c}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,s=t.getLabels();if(s.length===0)return this;const r=t.getDefaultLabel(),i=this.normalizeLabelPosition(r.position);for(let o=0,a=s.length;o<a;o+=1){const c=s[o],u=this.labelCache[o];if(!u)continue;const d=this.normalizeLabelPosition(c.position),f=Ye({},i,d),h=this.getLabelTransformationMatrix(f);u.setAttribute("transform",Wr(h))}return this}updateTerminalProperties(e){const t=this.cell,s=this.graph,r=t[e],i=r&&r.cell,o=`${e}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=s.getCellById(i);if(!a)throw new Error(`Edge's ${e} node with id "${i}" not exists`);const c=a.findView(s);return c?(this[o]=c,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,s=this.getTerminalView(e);if(s){let r=s.getMagnetFromEdgeTerminal(this.cell[e]);r===s.container&&(r=null),this[t]=r}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:Ye({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return ga(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return ga(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return ga(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(Kn(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,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 c=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),d=a&&a.absoluteDistance&&a.reverseDistance,f=this.path,h={segmentSubdivisions:this.getConnectionSubdivisions()},p=new M(e,t),g=f.closestPointT(p,h),m=this.getConnectionLength()||0;let y=f.lengthAtT(g,h);u&&(y=m>0?y/m:0),d&&(y=-1*(m-y)||1),i.distance=y;let b;c||(b=f.tangentAtT(g));let w;if(b)w=b.pointOffset(p);else{const x=f.pointAtT(g),v=p.diff(x);w={x:v.x,y:v.y}}return i.offset=w,i.angle=o,i}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),s=t.options||{},r=t.angle||0,i=t.distance,o=i>0&&i<=1;let a=0;const c={x:0,y:0},u=t.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(c.x=u.x),u.y!=null&&(c.y=u.y)));const d=c.x!==0||c.y!==0||a===0,f=s.keepGradient,h=s.ensureLegibility,p=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},m=o?i*this.getConnectionLength():i,y=p.tangentAtLength(m,g);let b,w=r;if(y){if(d)b=y.start,b.translate(c);else{const x=y.clone();x.rotate(-90,y.start),x.setLength(a),b=x.end}f&&(w=y.angle()+r,h&&(w=ye.normalize((w+90)%180-90)))}else b=p.start,d&&b.translate(c);return ot().translate(b.x,b.y).rotate(w)}getVertexIndex(e,t){const r=this.cell.getVertices(),i=this.getClosestPointLength(new M(e,t));let o=0;if(i!=null)for(const a=r.length;o<a;o+=1){const c=r[o],u=this.getClosestPointLength(c);if(u!=null&&i<u)break}return o}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,edge:i,cell:o}:{e,x:t,y:s,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(e,t,s){this.notify("edge:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("edge:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("edge:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("edge:mouseup",this.getEventArgs(e,t,s))}onClick(e,t,s){super.onClick(e,t,s),this.notify("edge:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("edge:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("edge:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startEdgeDragging(e,t,s)}onMouseMove(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.dragLabel(e,t,s);break}case"drag-arrowhead":{this.dragArrowhead(e,t,s);break}case"drag-edge":{this.dragEdge(e,t,s);break}}return this.notifyMouseMove(e,t,s),r}onMouseUp(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.stopLabelDragging(e,t,s);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,s);break}case"drag-edge":{this.stopEdgeDragging(e,t,s);break}}return this.notifyMouseUp(e,t,s),this.checkMouseleave(e),r}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){if(vy(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r)))}this.notifyMouseDown(e,s,r)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}onLabelMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startLabelDragging(e,t,s),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,s){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,s);return}this.setEventData(e,{x:t,y:s,moving:!1,action:"drag-edge"})}dragEdge(e,t,s){const r=this.getEventData(e);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-r.x,s-r.y,{ui:!0}),this.setEventData(e,{x:t,y:s}),this.notify("edge:moving",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,s){const r=this.getEventData(e);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(e,t){const s=this.getTerminalMagnet(e),r={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:s,initialTerminal:Pc(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let s,r=0,i=0;e==="source"?(r=2,s="target"):(i=2,s="source");const o=this.cell[s],a=o.cell;if(a){let c;const u=t[r]=this.graph.findViewByCell(a);u&&(c=u.getMagnetFromEdgeTerminal(o),c===u.container&&(c=void 0)),t[r+1]=c}return(c,u)=>(t[i]=c,t[i+1]=c.container===u?void 0:u,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,s,r,i,o,a){const c=this.graph.options.connecting,u=c.allowLoop,d=c.allowNode,f=c.allowEdge,h=c.allowPort,p=c.allowMulti,g=c.validateConnection,m=o?o.cell:null,y=i==="target"?s:e,b=i==="target"?r:t;let w=!0;const x=v=>{const C=i==="source"?a?a.port:null:m?m.getSourcePortId():null,E=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return se(v,this.graph,{edge:m,edgeView:o,sourceView:e,targetView:s,sourcePort:C,targetPort:E,sourceMagnet:t,targetMagnet:r,sourceCell:e?e.cell:null,targetCell:s?s.cell:null,type:i})};if(u!=null&&(typeof u=="boolean"?!u&&e===s&&(w=!1):w=x(u)),w&&h!=null&&(typeof h=="boolean"?!h&&b&&(w=!1):w=x(h)),w&&f!=null&&(typeof f=="boolean"?!f&&ts.isEdgeView(y)&&(w=!1):w=x(f)),w&&d!=null&&b==null&&(typeof d=="boolean"?!d&&wn.isNodeView(y)&&(w=!1):w=x(d)),w&&p!=null&&o){const v=o.cell,C=i==="source"?a:v.getSource(),E=i==="target"?a:v.getTarget(),S=a?this.graph.getCellById(a.cell):null;if(C&&E&&C.cell&&E.cell&&S)if(typeof p=="function")w=x(p);else{const O=this.graph.model.getConnectedEdges(S,{outgoing:i==="source",incoming:i==="target"});O.length&&(p==="withPort"?O.some(k=>{const _=k.getSource(),V=k.getTarget();return _&&V&&_.cell===C.cell&&V.cell===E.cell&&_.port!=null&&_.port===C.port&&V.port!=null&&V.port===E.port})&&(w=!1):p||O.some(k=>{const _=k.getSource(),V=k.getTarget();return _&&V&&_.cell===C.cell&&V.cell===E.cell})&&(w=!1))}}return w&&g!=null&&(w=x(g)),w}allowConnectToBlank(e){const t=this.graph,r=t.options.connecting.allowBlank;if(typeof r!="function")return!!r;const i=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),c=t.findViewByCell(o),u=t.findViewByCell(a);return se(r,t,{edge:e,edgeView:i,sourceCell:o,targetCell:a,sourceView:c,targetView:u,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(e,t,s){const r=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const i=r.options.connecting.validateEdge;return i?se(i,r,{edge:e,type:t,previous:s}):!0}arrowheadDragging(e,t,s,r){r.x=t,r.y=s,r.currentTarget!==e&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(e),r.currentView?(r.currentMagnet=r.currentView.findMagnet(e),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,t,s,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=e,this.cell.prop(r.terminalType,{x:t,y:s},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(e,t,s){const r=e.currentView,i=e.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=e.terminalType,a=r.getEdgeTerminal(i,t,s,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,s){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a=typeof i=="object"&&i.radius||50,c=typeof i=="object"&&i.anchor||"center",u=r.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const v=r.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(C=>C!==this);u.push(...v)}const d=s.closestView||null,f=s.closestMagnet||null;s.closestView=null,s.closestMagnet=null;let h,p=Number.MAX_SAFE_INTEGER;const g=new M(e,t);u.forEach(v=>{if(v.container.getAttribute("magnet")!=="false"){if(v.isNodeView())h=c==="center"?v.cell.getBBox().getCenter().distance(g):v.cell.getBBox().getNearestPointToPoint(g).distance(g);else if(v.isEdgeView()){const C=v.getClosestPoint(g);C?h=C.distance(g):h=Number.MAX_SAFE_INTEGER}h<a&&h<p&&(f===v.container||this.validateConnection(...s.getValidateConnectionArgs(v,null),v.getEdgeTerminal(v.container,e,t,this.cell,s.terminalType)))&&(p=h,s.closestView=v,s.closestMagnet=v.container)}v.container.querySelectorAll("[magnet]").forEach(C=>{if(C.getAttribute("magnet")!=="false"){const E=v.getBBoxOfElement(C);h=g.distance(E.getCenter()),h<a&&h<p&&(f===C||this.validateConnection(...s.getValidateConnectionArgs(v,C),v.getEdgeTerminal(C,e,t,this.cell,s.terminalType)))&&(p=h,s.closestView=v,s.closestMagnet=C)}})});let m;const y=s.terminalType,b=s.closestView,w=s.closestMagnet,x=f!==w;if(d&&x&&d.unhighlight(f,{type:"magnetAdsorbed"}),b){if(!x)return;b.highlight(w,{type:"magnetAdsorbed"}),m=b.getEdgeTerminal(w,e,t,this.cell,y)}else m={x:e,y:t};this.cell.setTerminal(y,m,{},Object.assign(Object.assign({},s.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,s=e.closestMagnet;t&&s&&(t.unhighlight(s,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(s)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const s=e.terminalType,r=e.initialTerminal,i=this.cell[s];if(i&&!$e.equalTerminals(r,i)){const a=this.graph,c=r,u=c.cell?a.getCellById(c.cell):null,d=c.port,f=u?a.findViewByCell(u):null,h=u||e.isNewEdge?null:M.create(r).toJSON(),p=i,g=p.cell?a.getCellById(p.cell):null,m=p.port,y=g?a.findViewByCell(g):null,b=g?null:M.create(i).toJSON();this.notify("edge:connected",{e:t,previousCell:u,previousPort:d,previousView:f,previousPoint:h,currentCell:g,currentView:y,currentPort:m,currentPoint:b,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:s,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,s=t.model.getCells();e.marked={};for(let r=0,i=s.length;r<i;r+=1){const o=t.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 c=a.filter(u=>this.validateConnection(...e.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,e.x,e.y,this.cell,e.terminalType)));if(c.length>0){for(let u=0,d=c.length;u<d;u+=1)o.highlight(c[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=c}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(s=>{const r=this.graph.findViewByCell(s);r&&(t[s].forEach(o=>{r.unhighlight(o,{type:"magnetAvailable"})}),r.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,s){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,s);return}const i=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:t,y:s});this.setEventData(e,o)}dragArrowhead(e,t,s){const r=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,s,r):this.arrowheadDragging(this.getEventTarget(e),t,s,r)}stopArrowheadDragging(e,t,s){const r=this.graph,i=this.getEventData(e);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,t,s),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,e)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(e,t,s){if(this.can("edgeLabelMovable")){const r=e.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),a=this.getLabelPositionArgs(i),c=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,c);this.setEventData(e,{index:i,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,s){const r=this.getEventData(e),i=this.cell.getLabelAt(r.index),o=Ye({},i,{position:this.getLabelPosition(t,s,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)}stopLabelDragging(e,t,s){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e})(ts||(ts={})),ts.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"]}}),ts.registry.register("edge",ts,!0);var QB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Vn extends be{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:s}=De.parseJSONMarkup(Vn.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=Vn.snapshoot(this.container),ee(this.container,this.prefixClassName("graph")),Lt(this.container,s),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&ge.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onDblClick(t,r.x,r.y):this.graph.trigger("blank:dblclick",{e:t,x:r.x,y:r.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onClick(t,r.x,r.y):this.graph.trigger("blank:click",{e:t,x:r.x,y:r.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=se(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.isPreventDefaultContextMenu(s)&&e.preventDefault(),this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onContextMenu(t,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:t,x:r.x,y:r.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const s=this.constructor;this.delegateDocumentEvents(s.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;this.options.preventDefaultMouseDown&&e.preventDefault();const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onMouseDown(t,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:r.x,y:r.y})),this.delegateDragEvents(t,s)}onMouseMove(e){const t=this.getEventData(e),s=t.startPosition;if(s&&s.x===e.clientX&&s.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const i=this.normalizeEvent(e),o=this.graph.snapToGrid(i.clientX,i.clientY),a=t.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,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY),i=this.getEventData(e).currentView;if(i?i.onMouseUp(t,s.x,s.y):this.graph.trigger("blank:mouseup",{e:t,x:s.x,y:s.y}),!e.isPropagationStopped()){const o=new Tn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseEnter(t)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseLeave(t)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=t.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));s?s.onMouseWheel(t,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:i.x,y:i.y})}onCustomEvent(e){const t=e.currentTarget,s=t.getAttribute("event")||t.getAttribute("data-event");if(s){const r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,s,o.x,o.y)}}}handleMagnetEvent(e,t){const s=e.currentTarget,r=s.getAttribute("magnet");if(r&&r.toLowerCase()!=="false"){const i=this.findView(s);if(i){const o=this.normalizeEvent(e);if(this.guard(o,i))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);se(t,this.graph,i,o,s,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetMouseDown(s,r,i,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetDblClick(s,r,i,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(s,r,i,o,a)=>{s.onMagnetContextMenu(r,i,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,s=this.findView(t);if(s){const r=this.normalizeEvent(e);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=()=>{}}}QB([be.dispose()],Vn.prototype,"dispose",null),function(n){const e=`${Jt.prefixCls}-graph`;n.markup=[{ns:it.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:it.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:it.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":it.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(s){const r=s.cloneNode();return s.childNodes.forEach(i=>r.appendChild(i)),()=>{for(eo(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=t}(Vn||(Vn={})),function(n){const e=Jt.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(Vn||(Vn={}));const e3=`.x6-graph {
123
+ `;return s.raw?re.parse(c):c},kB=function(n,e,t,s={}){const r=new re;r.appendSegment(re.createSegment("M",n));const i=1/3,o=2/3,a=s.radius||10;let c,u;for(let d=0,f=t.length;d<f;d+=1){const h=M.create(t[d]),p=t[d-1]||n,g=t[d+1]||e;c=u||h.distance(p)/2,u=h.distance(g)/2;const m=-Math.min(a,c),y=-Math.min(a,u),b=h.clone().move(p,m).round(),w=h.clone().move(g,y).round(),x=new M(i*b.x+o*h.x,o*h.y+i*b.y),S=new M(i*w.x+o*h.x,o*h.y+i*w.y);r.appendSegment(re.createSegment("L",b)),r.appendSegment(re.createSegment("C",x,S,w))}return r.appendSegment(re.createSegment("L",e)),s.raw?r:r.serialize()},VB=function(n,e,t,s={}){let r,i=s.direction;if(t&&t.length!==0){const o=[n,...t,e],a=je.throughPoints(o);r=new re(a)}else if(r=new re,r.appendSegment(re.createSegment("M",n)),i||(i=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y)?"H":"V"),i==="H"){const o=(n.x+e.x)/2;r.appendSegment(re.createSegment("C",o,n.y,o,e.y,e.x,e.y))}else{const o=(n.y+e.y)/2;r.appendSegment(re.createSegment("C",n.x,o,e.x,o,e.x,e.y))}return s.raw?r:r.serialize()},Hb=1,xl=1/3,vl=2/3;function DB(n){let e=n.graph._jumpOverUpdateList;if(e==null&&(e=n.graph._jumpOverUpdateList=[],n.graph.on("cell:mouseup",()=>{const t=n.graph._jumpOverUpdateList;setTimeout(()=>{for(let s=0;s<t.length;s+=1)t[s].update()})}),n.graph.on("model:reseted",()=>{e=n.graph._jumpOverUpdateList=[]})),e.indexOf(n)<0){e.push(n);const t=()=>e.splice(e.indexOf(n),1);n.cell.once("change:connector",t),n.cell.once("removed",t)}}function md(n,e,t=[]){const s=[n,...t,e],r=[];return s.forEach((i,o)=>{const a=s[o+1];a!=null&&r.push(new K(i,a))}),r}function RB(n,e){const t=[];return e.forEach(s=>{const r=n.intersectsWithLine(s);r&&t.push(r)}),t}function Gb(n,e){return new K(n,e).squaredLength()}function IB(n,e,t){return e.reduce((s,r,i)=>{if(Cl.includes(r))return s;const o=s.pop()||n,a=M.create(r).move(o.start,-t);let c=M.create(r).move(o.start,+t);const u=e[i+1];if(u!=null){const h=c.distance(u);h<=t&&(c=u.move(o.start,h),Cl.push(u))}else if(a.distance(o.end)<t*2+Hb)return s.push(o),s;if(c.distance(o.start)<t*2+Hb)return s.push(o),s;const f=new K(a,c);return bo.push(f),s.push(new K(o.start,a),f,new K(c,o.end)),s},[])}function Wb(n,e,t,s){const r=new re;let i;return i=re.createSegment("M",n[0].start),r.appendSegment(i),n.forEach((o,a)=>{if(bo.includes(o)){let c,u,d,f;if(t==="arc"){c=-90,u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(c+=180);const p=o.getCenter(),g=new K(p,o.end).rotate(c,p);let m;m=new K(o.start,p),d=m.pointAt(2/3).rotate(c,o.start),f=g.pointAt(1/3).rotate(-c,g.end),i=re.createSegment("C",d,f,g.end),r.appendSegment(i),m=new K(p,o.end),d=g.pointAt(1/3).rotate(c,g.end),f=m.pointAt(1/3).rotate(-c,o.end),i=re.createSegment("C",d,f,o.end),r.appendSegment(i)}else if(t==="gap")i=re.createSegment("M",o.end),r.appendSegment(i);else if(t==="cubic"){c=o.start.theta(o.end);const h=e*.6;let p=e*1.35;u=o.start.diff(o.end),(u.x<0||u.x===0&&u.y<0)&&(p*=-1),d=new M(o.start.x+h,o.start.y+p).rotate(c,o.start),f=new M(o.end.x-h,o.end.y+p).rotate(c,o.end),i=re.createSegment("C",d,f,o.end),r.appendSegment(i)}}else{const c=n[a+1];s===0||!c||bo.includes(c)?(i=re.createSegment("L",o.end),r.appendSegment(i)):LB(s,r,o.end,o.start,c.end)}}),r}function LB(n,e,t,s,r){const i=t.distance(s)/2,o=t.distance(r)/2,a=-Math.min(n,i),c=-Math.min(n,o),u=t.clone().move(s,a).round(),d=t.clone().move(r,c).round(),f=new M(xl*u.x+vl*t.x,vl*t.y+xl*u.y),h=new M(xl*d.x+vl*t.x,vl*t.y+xl*d.y);let p;p=re.createSegment("L",u),e.appendSegment(p),p=re.createSegment("C",f,h,d),e.appendSegment(p)}let bo,Cl;const BB=Object.freeze(Object.defineProperty({__proto__:null,jumpover:function(n,e,t,s={}){bo=[],Cl=[],DB(this);const r=s.size||5,i=s.type||"arc",o=s.radius||0,a=s.ignoreConnectors||["smooth"],c=this.graph,d=c.model.getEdges();if(d.length===1)return Wb(md(n,e,t),r,i,o);const f=this.cell,h=d.indexOf(f),p=c.options.connecting.connector||{},g=d.filter((S,v)=>{const E=S.getConnector()||p;return a.includes(E.name)?!1:v>h?E.name!=="jumpover":!0}),m=g.map(S=>c.findViewByCell(S)),y=md(n,e,t),b=m.map(S=>S==null?[]:S===this?y:md(S.sourcePoint,S.targetPoint,S.routePoints)),w=[];y.forEach(S=>{const v=g.reduce((E,C,O)=>{if(C!==f){const A=RB(S,b[O]);E.push(...A)}return E},[]).sort((E,C)=>Gb(S.start,E)-Gb(S.start,C));v.length>0?w.push(...IB(S,v,r)):w.push(S)});const x=Wb(w,r,i,o);return bo=[],Cl=[],s.raw?x:x.serialize()},loop:TB,normal:_B,rounded:kB,smooth:VB},Symbol.toStringTag,{value:"Module"}));var ar;(function(n){n.presets=BB,n.registry=Ue.create({type:"connector"}),n.registry.register(n.presets,!0)})(ar||(ar={}));var jB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Yb extends Ve{constructor(e={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ke(e)),this.changed={}}mutate(e,t={}){const s=t.unset===!0,r=t.silent===!0,i=[],o=this.changing;this.changing=!0,o||(this.previous=ke(this.data),this.changed={});const a=this.data,c=this.previous,u=this.changed;if(Object.keys(e).forEach(d=>{const f=d,h=e[f];Pn(a[f],h)||i.push(f),Pn(c[f],h)?delete u[f]:u[f]=h,s?delete a[f]:a[f]=h}),!r&&i.length>0&&(this.pending=!0,this.pendingOptions=t,i.forEach(d=>{this.emit("change:*",{key:d,options:t,store:this,current:a[d],previous:c[d]})})),o)return this;if(!r)for(;this.pending;)this.pending=!1,this.emit("changed",{current:a,previous:c,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(e,t){if(e==null)return this.data;const s=this.data[e];return s??t}getPrevious(e){if(this.previous){const t=this.previous[e];return t??void 0}}set(e,t,s){return e!=null&&(typeof e=="object"?this.mutate(e,t):this.mutate({[e]:t},s)),this}remove(e,t){const r={};let i;if(typeof e=="string")r[e]=void 0,i=t;else if(Array.isArray(e))e.forEach(o=>r[o]=void 0),i=t;else{for(const o in this.data)r[o]=void 0;i=e}return this.mutate(r,Object.assign(Object.assign({},i),{unset:!0})),this}getByPath(e){return Bu(this.data,e,"/")}setByPath(e,t,s={}){const r="/",i=Array.isArray(e)?[...e]:e.split(r),o=Array.isArray(e)?e.join(r):e,a=i[0],c=i.length;if(s.propertyPath=o,s.propertyValue=t,s.propertyPathArray=i,c===1)this.set(a,t,s);else{const u={};let d=u,f=a;for(let g=1;g<c;g+=1){const m=i[g],y=Number.isFinite(Number(m));d=d[f]=y?[]:{},f=m}Ur(u,i,t,r);const h=ke(this.data);s.rewrite&&ty(h,e,r);const p=Ye(h,u);this.set(a,p[a],s)}return this}removeByPath(e,t){const s=Array.isArray(e)?e:e.split("/"),r=s[0];if(s.length===1)this.remove(r,t);else{const i=s.slice(1),o=ke(this.get(r));o&&ty(o,i),this.set(r,o,t)}return this}hasChanged(e){return e==null?Object.keys(this.changed).length>0:e in this.changed}getChanges(e){if(e==null)return this.hasChanged()?ke(this.changed):null;const t=this.changing?this.previous:this.data,s={};let r;for(const i in e){const o=e[i];Pn(t[i],o)||(s[i]=o,r=!0)}return r?ke(s):null}toJSON(){return ke(this.data)}clone(){const e=this.constructor;return new e(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})}}jB([Ve.dispose()],Yb.prototype,"dispose",null);class wo{constructor(e){this.cell=e,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(e,t,s={},r="/"){const i=this.cell.getPropByPath(e),o=lP(s,wo.defaultOptions),a=this.getTiming(o.timing),c=this.getInterp(o.interp,i,t);let u=0;const d=Array.isArray(e)?e.join(r):e,f=Array.isArray(e)?e:e.split(r),h=()=>{const p=new Date().getTime();u===0&&(u=p);let m=(p-u)/o.duration;m<1?this.ids[d]=requestAnimationFrame(h):m=1;const y=c(a(m));this.cell.setPropByPath(f,y),s.progress&&s.progress(Object.assign({progress:m,currentValue:y},this.getArgs(d))),m===1&&(this.cell.notify("transition:complete",this.getArgs(d)),s.complete&&s.complete(this.getArgs(d)),this.cell.notify("transition:finish",this.getArgs(d)),s.finish&&s.finish(this.getArgs(d)),this.clean(d))};return setTimeout(()=>{this.stop(e,void 0,r),this.cache[d]={startValue:i,targetValue:t,options:o},this.ids[d]=requestAnimationFrame(h),this.cell.notify("transition:start",this.getArgs(d)),s.start&&s.start(this.getArgs(d))},s.delay),this.stop.bind(this,e,r,s)}stop(e,t={},s="/"){const r=Array.isArray(e)?e:e.split(s);return Object.keys(this.ids).filter(i=>Pn(r,i.split(s).slice(0,r.length))).forEach(i=>{cancelAnimationFrame(this.ids[i]);const o=this.cache[i],a=this.getArgs(i),c=Object.assign(Object.assign({},o.options),t),u=c.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)),c.complete&&c.complete(Object.assign({},a)));const d=Object.assign({jumpedToEnd:u},a);this.cell.notify("transition:stop",Object.assign({},d)),c.stop&&c.stop(Object.assign({},d)),this.cell.notify("transition:finish",Object.assign({},a)),c.finish&&c.finish(Object.assign({},a)),this.clean(i)}),this}clean(e){delete this.ids[e],delete this.cache[e]}getTiming(e){return typeof e=="string"?rr[e]:e}getInterp(e,t,s){return e?e(t,s):typeof s=="number"?ir.number(t,s):typeof s=="string"?s[0]==="#"?ir.color(t,s):ir.unit(t,s):ir.object(t,s)}getArgs(e){const t=this.cache[e];return{path:e,startValue:t.startValue,targetValue:t.targetValue,cell:this.cell}}}(function(n){n.defaultOptions={delay:10,duration:100,timing:"linear"}})(wo||(wo={}));var $B=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},qb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ge extends Ve{static config(e){const{markup:t,propHooks:s,attrHooks:r}=e,i=qb(e,["markup","propHooks","attrHooks"]);t!=null&&(this.markup=t),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=Ye({},this.defaults,i)}static getMarkup(){return this.markup}static getDefaults(e){return e?this.defaults:ke(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(e,t){return this.propHooks.reduce((s,r)=>r?se(r,e,s):s,t)}get[Symbol.toStringTag](){return ge.toStringTag}constructor(e={}){super();const s=this.constructor.getDefaults(!0),r=Ye({},this.preprocess(s),this.preprocess(e));this.id=r.id||Za(),this.store=new Yb(r),this.animation=new wo(this),this.setup(),this.init(),this.postprocess(e)}init(){}get model(){return this._model}set model(e){this._model!==e&&(this._model=e)}preprocess(e,t){const s=e.id,i=this.constructor.applyPropHooks(this,e);return s==null&&t!==!0&&(i.id=Za()),i}postprocess(e){}setup(){this.store.on("change:*",e=>{const{key:t,current:s,previous:r,options:i}=e;this.notify("change:*",{key:t,options:i,current:s,previous:r,cell:this}),this.notify(`change:${t}`,{options:i,current:s,previous:r,cell:this});const o=t;(o==="source"||o==="target")&&this.notify("change:terminal",{type:o,current:s,previous:r,options:i,cell:this})}),this.store.on("changed",({options:e})=>this.notify("changed",{options:e,cell:this}))}notify(e,t){this.trigger(e,t);const s=this.model;return s&&(s.notify(`cell:${e}`,t),this.isNode()?s.notify(`node:${e}`,Object.assign(Object.assign({},t),{node:this})):this.isEdge()&&s.notify(`edge:${e}`,Object.assign(Object.assign({},t),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(e){return this.store===e.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(e,t){return e==null?this.store.get():this.store.get(e,t)}setProp(e,t,s){if(typeof e=="string")this.store.set(e,t,s);else{const r=this.preprocess(e,!0);this.store.set(Ye({},this.getProp(),r),t),this.postprocess(e)}return this}removeProp(e,t){return typeof e=="string"||Array.isArray(e)?this.store.removeByPath(e,t):this.store.remove(t),this}hasChanged(e){return e==null?this.store.hasChanged():this.store.hasChanged(e)}getPropByPath(e){return this.store.getByPath(e)}setPropByPath(e,t,s={}){return this.model&&(e==="children"?this._children=t?t.map(r=>this.model.getCell(r)).filter(r=>r!=null):null:e==="parent"&&(this._parent=t?this.model.getCell(t):null)),this.store.setByPath(e,t,s),this}removePropByPath(e,t={}){const s=Array.isArray(e)?e:e.split("/");return s[0]==="attrs"&&(t.dirty=!0),this.store.removeByPath(s,t),this}prop(e,t,s){return e==null?this.getProp():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getPropByPath(e):t==null?this.removePropByPath(e,s||{}):this.setPropByPath(e,t,s||{}):this.setProp(e,t||{})}previous(e){return this.store.getPrevious(e)}get zIndex(){return this.getZIndex()}set zIndex(e){e==null?this.removeZIndex():this.setZIndex(e)}getZIndex(){return this.store.get("zIndex")}setZIndex(e,t={}){return this.store.set("zIndex",e,t),this}removeZIndex(e={}){return this.store.remove("zIndex",e),this}toFront(e={}){const t=this.model;if(t){let s=t.getMaxZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this],s=s-r.length+1;const i=t.total();let o=t.indexOf(this)!==i-r.length;o||(o=r.some((a,c)=>a.getZIndex()!==s+c)),o&&this.batchUpdate("to-front",()=>{s+=r.length,r.forEach((a,c)=>{a.setZIndex(s+c,e)})})}return this}toBack(e={}){const t=this.model;if(t){let s=t.getMinZIndex(),r;e.deep?(r=this.getDescendants({deep:!0,breadthFirst:!0}),r.unshift(this)):r=[this];let i=t.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,e)})})}return this}get markup(){return this.getMarkup()}set markup(e){e==null?this.removeMarkup():this.setMarkup(e)}getMarkup(){let e=this.store.get("markup");return e==null&&(e=this.constructor.getMarkup()),e}setMarkup(e,t={}){return this.store.set("markup",e,t),this}removeMarkup(e={}){return this.store.remove("markup",e),this}get attrs(){return this.getAttrs()}set attrs(e){e==null?this.removeAttrs():this.setAttrs(e)}getAttrs(){const e=this.store.get("attrs");return e?Object.assign({},e):{}}setAttrs(e,t={}){if(e==null)this.removeAttrs(t);else{const s=r=>this.store.set("attrs",r,t);if(t.overwrite===!0)s(e);else{const r=this.getAttrs();t.deep===!1?s(Object.assign(Object.assign({},r),e)):s(Ye({},r,e))}}return this}replaceAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateAttrs(e,t={}){return this.setAttrs(e,Object.assign(Object.assign({},t),{deep:!1}))}removeAttrs(e={}){return this.store.remove("attrs",e),this}getAttrDefinition(e){if(!e)return null;const s=this.constructor.getAttrHooks()||{};let r=s[e]||kn.registry.get(e);if(!r){const i=la(e);r=s[i]||kn.registry.get(i)}return r||null}getAttrByPath(e){return e==null||e===""?this.getAttrs():this.getPropByPath(this.prefixAttrPath(e))}setAttrByPath(e,t,s={}){return this.setPropByPath(this.prefixAttrPath(e),t,s),this}removeAttrByPath(e,t={}){return this.removePropByPath(this.prefixAttrPath(e),t),this}prefixAttrPath(e){return Array.isArray(e)?["attrs"].concat(e):`attrs/${e}`}attr(e,t,s){return e==null?this.getAttrByPath():typeof e=="string"||Array.isArray(e)?arguments.length===1?this.getAttrByPath(e):t==null?this.removeAttrByPath(e,s||{}):this.setAttrByPath(e,t,s||{}):this.setAttrs(e,t||{})}get visible(){return this.isVisible()}set visible(e){this.setVisible(e)}setVisible(e,t={}){return this.store.set("visible",e,t),this}isVisible(){return this.store.get("visible")!==!1}show(e={}){return this.isVisible()||this.setVisible(!0,e),this}hide(e={}){return this.isVisible()&&this.setVisible(!1,e),this}toggleVisible(e,t={}){const s=typeof e=="boolean"?e:!this.isVisible(),r=typeof e=="boolean"?t:e;return s?this.show(r):this.hide(r),this}get data(){return this.getData()}set data(e){this.setData(e)}getData(){return this.store.get("data")}setData(e,t={}){if(e==null)this.removeData(t);else{const s=r=>this.store.set("data",r,t);if(t.overwrite===!0)s(e);else{const r=this.getData();t.deep===!1?s(typeof e=="object"?Object.assign(Object.assign({},r),e):e):s(Ye({},r,e))}}return this}replaceData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{overwrite:!0}))}updateData(e,t={}){return this.setData(e,Object.assign(Object.assign({},t),{deep:!1}))}removeData(e={}){return this.store.remove("data",e),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const e=this.getParentId();if(e&&this.model){const t=this.model.getCell(e);return this._parent=t,t}return null}getChildren(){const e=this.store.get("children");if(e&&e.length&&this.model){const t=e.map(s=>{var r;return(r=this.model)===null||r===void 0?void 0:r.getCell(s)}).filter(s=>s!=null);return this._children=t,[...t]}return null}hasParent(){return this.parent!=null}isParentOf(e){return e!=null&&e.getParent()===this}isChildOf(e){return e!=null&&this.getParent()===e}eachChild(e,t){return this.children&&this.children.forEach(e,t),this}filterChild(e,t){return this.children?this.children.filter(e,t):[]}getChildCount(){return this.children==null?0:this.children.length}getChildIndex(e){return this.children==null?-1:this.children.indexOf(e)}getChildAt(e){return this.children!=null&&e>=0?this.children[e]:null}getAncestors(e={}){const t=[];let s=this.getParent();for(;s;)t.push(s),s=e.deep!==!1?s.getParent():null;return t}getDescendants(e={}){if(e.deep!==!1){if(e.breadthFirst){const t=[],s=this.getChildren()||[];for(;s.length>0;){const r=s.shift(),i=r.getChildren();t.push(r),i&&s.push(...i)}return t}{const t=this.getChildren()||[];return t.forEach(s=>{t.push(...s.getDescendants(e))}),t}}return this.getChildren()||[]}isDescendantOf(e,t={}){if(e==null)return!1;if(t.deep!==!1){let s=this.getParent();for(;s;){if(s===e)return!0;s=s.getParent()}return!1}return this.isChildOf(e)}isAncestorOf(e,t={}){return e==null?!1:e.isDescendantOf(this,t)}contains(e){return this.isAncestorOf(e)}getCommonAncestor(...e){return ge.getCommonAncestor(this,...e)}setParent(e,t={}){return this._parent=e,e?this.store.set("parent",e.id,t):this.store.remove("parent",t),this}setChildren(e,t={}){return this._children=e,e!=null?this.store.set("children",e.map(s=>s.id),t):this.store.remove("children",t),this}unembed(e,t={}){const s=this.children;if(s!=null&&e!=null){const r=this.getChildIndex(e);r!==-1&&(s.splice(r,1),e.setParent(null,t),this.setChildren(s,t))}return this}embed(e,t={}){return e.addTo(this,t),this}addTo(e,t={}){return ge.isCell(e)?e.addChild(this,t):e.addCell(this,t),this}insertTo(e,t,s={}){return e.insertChild(this,t,s),this}addChild(e,t={}){return this.insertChild(e,void 0,t)}insertChild(e,t,s={}){if(e!=null&&e!==this){const r=e.getParent(),i=this!==r;let o=t;if(o==null&&(o=this.getChildCount(),i||(o-=1)),r){const c=r.getChildren();if(c){const u=c.indexOf(e);u>=0&&(e.setParent(null,s),c.splice(u,1),r.setChildren(c,s))}}let a=this.children;if(a==null?(a=[],a.push(e)):a.splice(o,0,e),e.setParent(this,s),this.setChildren(a,s),i&&this.model){const c=this.model.getIncomingEdges(this),u=this.model.getOutgoingEdges(this);c&&c.forEach(d=>d.updateParent(s)),u&&u.forEach(d=>d.updateParent(s))}this.model&&this.model.addCell(e,s)}return this}removeFromParent(e={}){const t=this.getParent();if(t!=null){const s=t.getChildIndex(this);t.removeChildAt(s,e)}return this}removeChild(e,t={}){const s=this.getChildIndex(e);return this.removeChildAt(s,t)}removeChildAt(e,t={}){const s=this.getChildAt(e);return this.children!=null&&s!=null&&(this.unembed(s,t),s.remove(t)),s}remove(e={}){return this.batchUpdate("remove",()=>{const t=this.getParent();t&&t.removeChild(this,e),e.deep!==!1&&this.eachChild(s=>s.remove(e)),this.model&&this.model.removeCell(this,e)}),this}transition(e,t,s={},r="/"){return this.animation.start(e,t,s,r)}stopTransition(e,t,s="/"){return this.animation.stop(e,t,s),this}getTransitions(){return this.animation.get()}translate(e,t,s){return this}scale(e,t,s,r){return this}addTools(e,t,s){const r=Array.isArray(e)?e:[e],i=typeof t=="string"?t:null,o=typeof t=="object"?t:typeof s=="object"?s:{};if(o.reset)return this.setTools({name:i,items:r,local:o.local},o);let a=ke(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(e,t={}){return e==null?this.removeTools():this.store.set("tools",ge.normalizeTools(e),t),this}getTools(){return this.store.get("tools")}removeTools(e={}){return this.store.remove("tools",e),this}hasTools(e){const t=this.getTools();return t==null?!1:e==null?!0:t.name===e}hasTool(e){const t=this.getTools();return t==null?!1:t.items.some(s=>typeof s=="string"?s===e:s.name===e)}removeTool(e,t={}){const s=ke(this.getTools());if(s){let r=!1;const i=s.items.slice(),o=a=>{i.splice(a,1),r=!0};if(typeof e=="number")o(e);else for(let a=i.length-1;a>=0;a-=1){const c=i[a];(typeof c=="string"?c===e:c.name===e)&&o(a)}r&&(s.items=i,this.setTools(s,t))}return this}getBBox(e){return new G}getConnectionPoint(e,t){return new M}toJSON(e={}){const t=Object.assign({},this.store.get()),s=Object.prototype.toString,r=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!t.shape){const g=this.constructor;throw new Error(`Unable to serialize ${r} missing "shape" prop, check the ${r} "${g.name||s.call(g)}"`)}const i=this.constructor,o=e.diff===!0,a=t.attrs||{},c=i.getDefaults(!0),u=o?this.preprocess(c,!0):c,d=u.attrs||{},f={};Object.entries(t).forEach(([g,m])=>{if(m!=null&&!Array.isArray(m)&&typeof m=="object"&&!Mn(m))throw new Error(`Can only serialize ${r} with plain-object props, but got a "${s.call(m)}" type of key "${g}" on ${r} "${this.id}"`);if(g!=="attrs"&&g!=="shape"&&o){const y=u[g];Pn(m,y)&&delete t[g]}}),Object.keys(a).forEach(g=>{const m=a[g],y=d[g];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(S=>{const v=w[S];if(y==null||x==null||!Be(x)||!Pn(x[S],v)){f[g]==null&&(f[g]={}),f[g][b]==null&&(f[g][b]={});const E=f[g][b];E[S]=v}}):(y==null||!Pn(x,w))&&(f[g]==null&&(f[g]={}),f[g][b]=w)})});const h=Object.assign(Object.assign({},t),{attrs:Pp(f)?void 0:f});h.attrs==null&&delete h.attrs;const p=h;return p.angle===0&&delete p.angle,ke(p)}clone(e={}){if(!e.deep){const s=Object.assign({},this.store.get());e.keepId||delete s.id,delete s.parent,delete s.children;const r=this.constructor;return new r(s)}return ge.deepClone(this)[this.id]}findView(e){return e.findViewByCell(this)}startBatch(e,t={},s=this.model){return this.notify("batch:start",{name:e,data:t,cell:this}),s&&s.startBatch(e,Object.assign(Object.assign({},t),{cell:this})),this}stopBatch(e,t={},s=this.model){return s&&s.stopBatch(e,Object.assign(Object.assign({},t),{cell:this})),this.notify("batch:stop",{name:e,data:t,cell:this}),this}batchUpdate(e,t,s){const r=this.model;this.startBatch(e,s,r);const i=t();return this.stopBatch(e,s,r),i}dispose(){this.removeFromParent(),this.store.dispose()}}ge.defaults={},ge.attrHooks={},ge.propHooks=[],$B([Ve.dispose()],ge.prototype,"dispose",null),function(n){function e(t){return typeof t=="string"?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}n.normalizeTools=e}(ge||(ge={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.isNode=="function"&&typeof r.isEdge=="function"&&typeof r.prop=="function"&&typeof r.attr=="function"}n.isCell=e}(ge||(ge={})),function(n){function e(...i){const o=i.filter(c=>c!=null).map(c=>c.getAncestors()).sort((c,u)=>c.length-u.length);return o.shift().find(c=>o.every(u=>u.includes(c)))||null}n.getCommonAncestor=e;function t(i,o={}){let a=null;for(let c=0,u=i.length;c<u;c+=1){const d=i[c];let f=d.getBBox(o);if(f){if(d.isNode()){const h=d.getAngle();h!=null&&h!==0&&(f=f.bbox(h))}a=a==null?f:a.union(f)}}return a}n.getCellsBBox=t;function s(i){const o=[i,...i.getDescendants({deep:!0})];return n.cloneCells(o)}n.deepClone=s;function r(i){const o=Tp(i),a=o.reduce((c,u)=>(c[u.id]=u.clone(),c),{});return o.forEach(c=>{const u=a[c.id];if(u.isEdge()){const h=u.getSourceCellId(),p=u.getTargetCellId();h&&a[h]&&u.setSource(Object.assign(Object.assign({},u.getSource()),{cell:a[h].id})),p&&a[p]&&u.setTarget(Object.assign(Object.assign({},u.getTarget()),{cell:a[p].id}))}const d=c.getParent();d&&a[d.id]&&u.setParent(a[d.id]);const f=c.getChildren();if(f&&f.length){const h=f.reduce((p,g)=>(a[g.id]&&p.push(a[g.id]),p),[]);h.length>0&&u.setChildren(h)}}),a}n.cloneCells=r}(ge||(ge={})),function(n){n.config({propHooks(e){var{tools:t}=e,s=qb(e,["tools"]);return t&&(s.tools=n.normalizeTools(t)),s}})}(ge||(ge={}));var li;(function(n){let e,t;function s(o,a){return a?e!=null&&e.exist(o):t!=null&&t.exist(o)}n.exist=s;function r(o){e=o}n.setEdgeRegistry=r;function i(o){t=o}n.setNodeRegistry=i})(li||(li={}));class zB{constructor(e){this.ports=[],this.groups={},this.init(ke(e))}getPorts(){return this.ports}getGroup(e){return e!=null?this.groups[e]:null}getPortsByGroup(e){return this.ports.filter(t=>t.group===e||t.group==null&&e==null)}getPortsLayoutByGroup(e,t){const s=this.getPortsByGroup(e),r=e?this.getGroup(e):null,i=r?r.position:null,o=i?i.name:null;let a;if(o!=null){const f=or.registry.get(o);if(f==null)return or.registry.onNotFound(o);a=f}else a=or.presets.left;const c=s.map(f=>f&&f.position&&f.position.args||{}),u=i&&i.args||{};return a(c,t,u).map((f,h)=>{const p=s[h];return{portLayout:f,portId:p.id,portSize:p.size,portAttrs:p.attrs,labelSize:p.label.size,labelLayout:this.getPortLabelLayout(p,M.create(f.position),t)}})}init(e){const{groups:t,items:s}=e;t!=null&&Object.keys(t).forEach(r=>{this.groups[r]=this.parseGroup(t[r])}),Array.isArray(s)&&s.forEach(r=>{this.ports.push(this.parsePort(r))})}parseGroup(e){return Object.assign(Object.assign({},e),{label:this.getLabel(e,!0),position:this.getPortPosition(e.position,!0)})}parsePort(e){const t=Object.assign({},e),s=this.getGroup(e.group)||{};return t.markup=t.markup||s.markup,t.attrs=Ye({},s.attrs,t.attrs),t.position=this.createPosition(s,t),t.label=Ye({},s.label,this.getLabel(t)),t.zIndex=this.getZIndex(s,t),t.size=Object.assign(Object.assign({},s.size),t.size),t}getZIndex(e,t){return typeof t.zIndex=="number"?t.zIndex:typeof e.zIndex=="number"||e.zIndex==="auto"?e.zIndex:"auto"}createPosition(e,t){return Ye({name:"left",args:{}},e.position,{args:t.args})}getPortPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(Array.isArray(e))return{name:"absolute",args:{x:e[0],y:e[1]}};if(typeof e=="object")return e}return{args:{}}}getPortLabelPosition(e,t=!1){if(e==null){if(t)return{name:"left",args:{}}}else{if(typeof e=="string")return{name:e,args:{}};if(typeof e=="object")return e}return{args:{}}}getLabel(e,t=!1){const s=e.label||{};return s.position=this.getPortLabelPosition(s.position,t),s}getPortLabelLayout(e,t,s){const r=e.label.position.name||"left",i=e.label.position.args||{},o=ei.registry.get(r)||ei.presets.left;return o?o(t,s,i):null}}var Sl=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let Ge=class v0 extends ge{get[Symbol.toStringTag](){return v0.toStringTag}constructor(e={}){super(e),this.initPorts()}preprocess(e,t){const{x:s,y:r,width:i,height:o}=e,a=Sl(e,["x","y","width","height"]);if(s!=null||r!=null){const c=a.position;a.position=Object.assign(Object.assign({},c),{x:s??(c?c.x:0),y:r??(c?c.y:0)})}if(i!=null||o!=null){const c=a.size;a.size=Object.assign(Object.assign({},c),{width:i??(c?c.width:0),height:o??(c?c.height:0)})}return super.preprocess(a,t)}isNode(){return!0}size(e,t,s){return e===void 0?this.getSize():typeof e=="number"?this.setSize(e,t,s):this.setSize(e,t)}getSize(){const e=this.store.get("size");return e?Object.assign({},e):{width:1,height:1}}setSize(e,t,s){return typeof e=="object"?this.resize(e.width,e.height,t):this.resize(e,t,s),this}resize(e,t,s={}){this.startBatch("resize",s);const r=s.direction;if(r){const i=this.getSize();switch(r){case"left":case"right":t=i.height;break;case"top":case"bottom":e=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 c=ye.normalize(this.getAngle()||0);s.absolute&&(a+=Math.floor((c+45)/90),a%=4);const u=this.getBBox();let d;a===0?d=u.getBottomLeft():a===1?d=u.getCorner():a===2?d=u.getTopRight():d=u.getOrigin();const f=d.clone().rotate(-c,u.getCenter()),h=Math.sqrt(e*e+t*t)/2;let p=a*Math.PI/2;p+=Math.atan(a%2===0?t/e:e/t),p-=ye.toRad(c);const m=M.fromPolar(h,p,f).clone().translate(e/-2,t/-2);this.store.set("size",{width:e,height:t},s),this.setPosition(m.x,m.y,s)}else this.store.set("size",{width:e,height:t},s);return this.stopBatch("resize",s),this}scale(e,t,s,r={}){const i=this.getBBox().scale(e,t,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(e,t,s){return typeof e=="number"?this.setPosition(e,t,s):this.getPosition(e)}getPosition(e={}){if(e.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 t=this.store.get("position");return t?Object.assign({},t):{x:0,y:0}}setPosition(e,t,s={}){let r,i,o;if(typeof e=="object"?(r=e.x,i=e.y,o=t||{}):(r=e,i=t,o=s||{}),o.relative){const a=this.getParent();if(a!=null&&a.isNode()){const c=a.getPosition();r+=c.x,i+=c.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(e=0,t=0,s={}){if(e===0&&t===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,c=r.x-o.x,u=r.y-o.y,d=Math.max(a.x+c,Math.min(a.x+a.width+c-o.width,r.x+e)),f=Math.max(a.y+u,Math.min(a.y+a.height+u-o.height,r.y+t));e=d-r.x,t=f-r.y}const i={x:r.x+e,y:r.y+t};return s.tx=e,s.ty=t,s.transition?(typeof s.transition!="object"&&(s.transition={}),this.transition("position",i,Object.assign(Object.assign({},s.transition),{interp:ir.object})),this.eachChild(o=>{var a;((a=s.exclude)===null||a===void 0?void 0:a.includes(o))||o.translate(e,t,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(e,t,s)}),this.stopBatch("translate",s)),this}angle(e,t){return e==null?this.getAngle():this.rotate(e,t)}getAngle(){return this.store.get("angle",0)}rotate(e,t={}){const s=this.getAngle();if(t.center){const r=this.getSize(),i=this.getPosition(),o=this.getBBox().getCenter();o.rotate(s-e,t.center);const a=o.x-r.width/2-i.x,c=o.y-r.height/2-i.y;this.startBatch("rotate",{angle:e,options:t}),this.setPosition(i.x+a,i.y+c,t),this.rotate(e,Object.assign(Object.assign({},t),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",t.absolute?e:(s+e)%360,t);return this}getBBox(e={}){if(e.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),ge.getCellsBBox(t)}return G.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(e,t){const s=this.getBBox(),r=s.getCenter(),i=e.getTerminal(t);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,d=M.create(u).translate(s.getOrigin()),f=this.getAngle();return f&&d.rotate(-f,r),d}fit(e={}){const s=(this.getChildren()||[]).filter(u=>u.isNode());if(s.length===0)return this;this.startBatch("fit-embeds",e),e.deep&&s.forEach(u=>u.fit(e));let{x:r,y:i,width:o,height:a}=ge.getCellsBBox(s);const c=ys(e.padding);return r-=c.left,i-=c.top,o+=c.left+c.right,a+=c.bottom+c.top,this.store.set({position:{x:r,y:i},size:{width:o,height:a}},e),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(e){this.setPortContainerMarkup(e)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||De.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(e,t={}){return this.store.set("portContainerMarkup",De.clone(e),t),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(e){this.setPortMarkup(e)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||De.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(e,t={}){return this.store.set("portMarkup",De.clone(e),t),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(e){this.setPortLabelMarkup(e)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||De.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(e,t={}){return this.store.set("portLabelMarkup",De.clone(e),t),this}get ports(){const e=this.store.get("ports",{items:[]});return e.items==null&&(e.items=[]),e}getPorts(){return ke(this.ports.items)}getPortsByGroup(e){return this.getPorts().filter(t=>t.group===e)}getPort(e){return ke(this.ports.items.find(t=>t.id&&t.id===e))}getPortAt(e){return this.ports.items[e]||null}hasPorts(){return this.ports.items.length>0}hasPort(e){return this.getPortIndex(e)!==-1}getPortIndex(e){const t=typeof e=="string"?e:e.id;return t!=null?this.ports.items.findIndex(s=>s.id===t):-1}getPortsPosition(e){const t=this.getSize();return this.port.getPortsLayoutByGroup(e,new G(0,0,t.width,t.height)).reduce((r,i)=>{const o=i.portLayout;return r[i.portId]={position:Object.assign({},o.position),angle:o.angle||0},r},{})}getPortProp(e,t){return this.getPropByPath(this.prefixPortPath(e,t))}setPortProp(e,t,s,r){if(typeof t=="string"||Array.isArray(t)){const a=this.prefixPortPath(e,t),c=s;return this.setPropByPath(a,c,r)}const i=this.prefixPortPath(e),o=t;return this.setPropByPath(i,o,s)}removePortProp(e,t,s){return typeof t=="string"||Array.isArray(t)?this.removePropByPath(this.prefixPortPath(e,t),s):this.removePropByPath(this.prefixPortPath(e),t)}portProp(e,t,s,r){return t==null?this.getPortProp(e):typeof t=="string"||Array.isArray(t)?arguments.length===2?this.getPortProp(e,t):s==null?this.removePortProp(e,t,r):this.setPortProp(e,t,s,r):this.setPortProp(e,t,s)}prefixPortPath(e,t){const s=this.getPortIndex(e);if(s===-1)throw new Error(`Unable to find port with id: "${e}"`);return t==null||t===""?["ports","items",`${s}`]:Array.isArray(t)?["ports","items",`${s}`,...t]:`ports/items/${s}/${t}`}addPort(e,t){const s=[...this.ports.items];return s.push(e),this.setPropByPath("ports/items",s,t),this}addPorts(e,t){return this.setPropByPath("ports/items",[...this.ports.items,...e],t),this}insertPort(e,t,s){const r=[...this.ports.items];return r.splice(e,0,t),this.setPropByPath("ports/items",r,s),this}removePort(e,t={}){return this.removePortAt(this.getPortIndex(e),t)}removePortAt(e,t={}){if(e>=0){const s=[...this.ports.items];s.splice(e,1),t.rewrite=!0,this.setPropByPath("ports/items",s,t)}return this}removePorts(e,t){let s;if(Array.isArray(e)){if(s=t||{},e.length){s.rewrite=!0;const i=[...this.ports.items].filter(o=>!e.some(a=>{const c=typeof a=="string"?a:a.id;return o.id===c}));this.setPropByPath("ports/items",i,s)}}else s=e||{},s.rewrite=!0,this.setPropByPath("ports/items",[],s);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(e,t){return this.port.getPortsLayoutByGroup(e,t)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const e=this.ports,t={};e.items.forEach(o=>{o.id&&(t[o.id]=!0)});const s={};(this.store.getPrevious("ports")||{items:[]}).items.forEach(o=>{o.id&&!t[o.id]&&(s[o.id]=!0)});const i=this.model;i&&!Pp(s)&&(i.getConnectedEdges(this,{incoming:!0}).forEach(c=>{const u=c.getTargetPortId();u&&s[u]&&c.remove()}),i.getConnectedEdges(this,{outgoing:!0}).forEach(c=>{const u=c.getSourcePortId();u&&s[u]&&c.remove()}))}validatePorts(){const e={},t=[];return this.ports.items.forEach(s=>{typeof s!="object"&&t.push(`Invalid port ${s}.`),s.id==null&&(s.id=this.generatePortId()),e[s.id]&&t.push("Duplicitied port id."),e[s.id]=!0}),t}generatePortId(){return Za()}updatePortData(){const e=this.validatePorts();if(e.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(e.join(" "));const t=this.port?this.port.getPorts():null;this.port=new zB(this.ports);const s=this.port.getPorts(),r=t?s.filter(o=>t.find(a=>a.id===o.id)?null:o):[...s],i=t?t.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})}};Ge.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e}(Ge||(Ge={})),function(n){n.config({propHooks(e){var{ports:t}=e,s=Sl(e,["ports"]);return t&&(s.ports=Array.isArray(t)?{items:t}:t),s}})}(Ge||(Ge={})),function(n){n.registry=Ue.create({type:"node",process(e,t){if(li.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r}=t,i=Sl(t,["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=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),li.setNodeRegistry(n.registry)}(Ge||(Ge={})),function(n){let e=0;function t(i){return i?ju(i):(e+=1,`CustomNode${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=Sl(i,["constructorName","overwrite"]),u=Lu(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.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}(Ge||(Ge={}));var El=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let $e=class C0 extends ge{get[Symbol.toStringTag](){return C0.toStringTag}constructor(e={}){super(e)}preprocess(e,t){const{source:s,sourceCell:r,sourcePort:i,sourcePoint:o,target:a,targetCell:c,targetPort:u,targetPoint:d}=e,h=El(e,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),p=g=>typeof g=="string"||typeof g=="number";if(s!=null)if(ge.isCell(s))h.source={cell:s.id};else if(p(s))h.source={cell:s};else if(M.isPoint(s))h.source=s.toJSON();else if(Array.isArray(s))h.source={x:s[0],y:s[1]};else{const g=s.cell;ge.isCell(g)?h.source=Object.assign(Object.assign({},s),{cell:g.id}):h.source=s}if(r!=null||i!=null){let g=h.source;if(r!=null){const m=p(r)?r:r.id;g?g.cell=m:g=h.source={cell:m}}i!=null&&g&&(g.port=i)}else o!=null&&(h.source=M.create(o).toJSON());if(a!=null)if(ge.isCell(a))h.target={cell:a.id};else if(p(a))h.target={cell:a};else if(M.isPoint(a))h.target=a.toJSON();else if(Array.isArray(a))h.target={x:a[0],y:a[1]};else{const g=a.cell;ge.isCell(g)?h.target=Object.assign(Object.assign({},a),{cell:g.id}):h.target=a}if(c!=null||u!=null){let g=h.target;if(c!=null){const m=p(c)?c:c.id;g?g.cell=m:g=h.target={cell:m}}u!=null&&g&&(g.port=u)}else d!=null&&(h.target=M.create(d).toJSON());return super.preprocess(h,t)}setup(){super.setup(),this.on("change:labels",e=>this.onLabelsChanged(e)),this.on("change:vertices",e=>this.onVertexsChanged(e))}isEdge(){return!0}disconnect(e={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},e),this}get source(){return this.getSource()}set source(e){this.setSource(e)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(e,t,s={}){return this.setTerminal("source",e,t,s)}get target(){return this.getTarget()}set target(e){this.setTarget(e)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(e,t,s={}){return this.setTerminal("target",e,t,s)}getTerminal(e){return Object.assign({},this.store.get(e))}setTerminal(e,t,s,r={}){if(ge.isCell(t))return this.store.set(e,Ye({},s,{cell:t.id}),r),this;const i=t;return M.isPoint(t)||i.x!=null&&i.y!=null?(this.store.set(e,Ye({},s,{x:i.x,y:i.y}),r),this):(this.store.set(e,ke(t),r),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(e){const t=this[e];if(M.isPointLike(t))return M.create(t);const s=this.getTerminalCell(e);return s?s.getConnectionPoint(this,e):new M}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(e){if(this.model){const t=e==="source"?this.getSourceCellId():this.getTargetCellId();if(t)return this.model.getCell(t)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(e){let t=this;const s={};for(;t&&t.isEdge();){if(s[t.id])return null;s[t.id]=!0,t=t.getTerminalCell(e)}return t&&t.isNode()?t:null}get router(){return this.getRouter()}set router(e){e==null?this.removeRouter():this.setRouter(e)}getRouter(){return this.store.get("router")}setRouter(e,t,s){return typeof e=="object"?this.store.set("router",e,t):this.store.set("router",{name:e,args:t},s),this}removeRouter(e={}){return this.store.remove("router",e),this}get connector(){return this.getConnector()}set connector(e){e==null?this.removeConnector():this.setConnector(e)}getConnector(){return this.store.get("connector")}setConnector(e,t,s){return typeof e=="object"?this.store.set("connector",e,t):this.store.set("connector",{name:e,args:t},s),this}removeConnector(e={}){return this.store.remove("connector",e)}getDefaultLabel(){const e=this.constructor,t=this.store.get("defaultLabel")||e.defaultLabel||{};return ke(t)}get labels(){return this.getLabels()}set labels(e){this.setLabels(e)}getLabels(){return[...this.store.get("labels",[])].map(e=>this.parseLabel(e))}setLabels(e,t={}){return this.store.set("labels",Array.isArray(e)?e:[e],t),this}insertLabel(e,t,s={}){const r=this.getLabels(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,this.parseLabel(e)),this.setLabels(r,s)}appendLabel(e,t={}){return this.insertLabel(e,-1,t)}getLabelAt(e){const t=this.getLabels();return e!=null&&Number.isFinite(e)?this.parseLabel(t[e]):null}setLabelAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getLabels();r[e]=this.parseLabel(t),this.setLabels(r,s)}return this}removeLabelAt(e,t={}){const s=this.getLabels(),r=e!=null&&Number.isFinite(e)?e:-1,i=s.splice(r,1);return this.setLabels(s,t),i.length?i[0]:null}parseLabel(e){return typeof e=="string"?this.constructor.parseStringLabel(e):e}onLabelsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>i===o||Pn(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>i===o||Pn(i,o))?null:i):e?[...e]:[];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(e){this.setVertices(e)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(e,t={}){const s=Array.isArray(e)?e:[e];return this.store.set("vertices",s.map(r=>M.toJSON(r)),t),this}insertVertex(e,t,s={}){const r=this.getVertices(),i=r.length;let o=t!=null&&Number.isFinite(t)?t:i;return o<0&&(o=i+o+1),r.splice(o,0,M.toJSON(e)),this.setVertices(r,s)}appendVertex(e,t={}){return this.insertVertex(e,-1,t)}getVertexAt(e){return e!=null&&Number.isFinite(e)?this.getVertices()[e]:null}setVertexAt(e,t,s={}){if(e!=null&&Number.isFinite(e)){const r=this.getVertices();r[e]=t,this.setVertices(r,s)}return this}removeVertexAt(e,t={}){const s=this.getVertices(),r=e!=null&&Number.isFinite(e)?e:-1;return s.splice(r,1),this.setVertices(s,t)}onVertexsChanged({previous:e,current:t}){const s=e&&t?t.filter(i=>e.find(o=>M.equals(i,o))?null:i):t?[...t]:[],r=e&&t?e.filter(i=>t.find(o=>M.equals(i,o))?null:i):e?[...e]:[];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")||De.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}translate(e,t,s={}){return s.translateBy=s.translateBy||this.id,s.tx=e,s.ty=t,this.applyToPoints(r=>({x:(r.x||0)+e,y:(r.y||0)+t}),s)}scale(e,t,s,r={}){return this.applyToPoints(i=>M.create(i).scale(e,t,s).toJSON(),r)}applyToPoints(e,t={}){const s={},r=this.getSource(),i=this.getTarget();M.isPointLike(r)&&(s.source=e(r)),M.isPointLike(i)&&(s.target=e(i));const o=this.getVertices();return o.length>0&&(s.vertices=o.map(e)),this.store.set(s,t),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const e=[this.getSourcePoint(),...this.getVertices().map(t=>M.create(t)),this.getTargetPoint()];return new Fe(e)}updateParent(e){let t=null;const s=this.getSourceCell(),r=this.getTargetCell(),i=this.getParent();return s&&r&&(s===r||s.isDescendantOf(r)?t=r:r.isDescendantOf(s)?t=s:t=ge.getCommonAncestor(s,r)),i&&t&&t.id!==i.id&&i.unembed(this,e),t&&(!i||i.id!==t.id)&&t.embed(this,e),t}hasLoop(e={}){const t=this.getSource(),s=this.getTarget(),r=t.cell,i=s.cell;if(!r||!i)return!1;let o=r===i;if(!o&&e.deep&&this._model){const a=this.getSourceCell(),c=this.getTargetCell();a&&c&&(o=a.isAncestorOf(c,e)||c.isAncestorOf(a,e))}return o}getFragmentAncestor(){const e=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>t!=null);return this.getCommonAncestor(...e)}isFragmentDescendantOf(e){const t=this.getFragmentAncestor();return!!t&&(t.id===e.id||t.isDescendantOf(e))}};$e.defaults={},function(n){function e(t,s){const r=t,i=s;return r.cell===i.cell?r.port===i.port||r.port==null&&i.port==null:!1}n.equalTerminals=e}($e||($e={})),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 e(t){return{attrs:{label:{text:t}}}}n.parseStringLabel=e}($e||($e={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e}($e||($e={})),function(n){n.registry=Ue.create({type:"edge",process(e,t){if(li.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if(typeof t=="function")return t.config({shape:e}),t;let s=n;const{inherit:r="edge"}=t,i=El(t,["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=e);const o=s.define.call(s,i);return o.config({shape:e}),o}}),li.setEdgeRegistry(n.registry)}($e||($e={})),function(n){let e=0;function t(i){return i?ju(i):(e+=1,`CustomEdge${e}`)}function s(i){const{constructorName:o,overwrite:a}=i,c=El(i,["constructorName","overwrite"]),u=Lu(t(o||c.shape),this);return u.config(c),c.shape&&n.registry.register(c.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}($e||($e={})),function(n){const e="basic.edge";n.config({shape:e,propHooks(t){const{label:s,vertices:r}=t,i=El(t,["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=>M.create(o).toJSON())),i}}),n.registry.register(e,n)}($e||($e={}));var FB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Ol extends Ve{constructor(e,t={}){super(),this.length=0,this.comparator=t.comparator||"zIndex",this.clean(),e&&this.reset(e,{silent:!0})}toJSON(){return this.cells.map(e=>e.toJSON())}add(e,t,s){let r,i;typeof t=="number"?(r=t,i=Object.assign({merge:!1},s)):(r=this.length,i=Object.assign({merge:!1},t)),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);const o=Array.isArray(e)?e:[e],a=this.comparator&&typeof t!="number"&&i.sort!==!1,c=this.comparator||null;let u=!1;const d=[],f=[];return o.forEach(h=>{const p=this.get(h);p?i.merge&&!h.isSameStore(p)&&(p.setProp(h.getProp(),s),f.push(p),a&&!u&&(c==null||typeof c=="function"?u=p.hasChanged():typeof c=="string"?u=p.hasChanged(c):u=c.some(g=>p.hasChanged(g)))):(d.push(h),this.reference(h))}),d.length&&(a&&(u=!0),this.cells.splice(r,0,...d),this.length=this.cells.length),u&&this.sort({silent:!0}),i.silent||(d.forEach((h,p)=>{const g={cell:h,index:r+p,options:i};this.trigger("added",g),i.dryrun||h.notify("added",Object.assign({},g))}),u&&this.trigger("sorted"),(d.length||f.length)&&this.trigger("updated",{added:d,merged:f,removed:[],options:i})),this}remove(e,t={}){const s=Array.isArray(e)?e:[e],r=this.removeCells(s,t);return!t.silent&&r.length>0&&this.trigger("updated",{options:t,removed:r,added:[],merged:[]}),Array.isArray(e)?r:r[0]}removeCells(e,t){const s=[];for(let r=0;r<e.length;r+=1){const i=this.get(e[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),t.dryrun||i.remove(),t.silent||(this.trigger("removed",{cell:i,index:o,options:t}),t.dryrun||i.notify("removed",{cell:i,index:o,options:t}))}return s}reset(e,t={}){const s=this.cells.slice();if(s.forEach(r=>this.unreference(r)),this.clean(),this.add(e,Object.assign({silent:!0},t)),!t.silent){const r=this.cells.slice();this.trigger("reseted",{options:t,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:t,added:i,removed:o,merged:[]})}return this}push(e,t){return this.add(e,this.length,t)}pop(e){const t=this.at(this.length-1);return this.remove(t,e)}unshift(e,t){return this.add(e,0,t)}shift(e){const t=this.at(0);return this.remove(t,e)}get(e){if(e==null)return null;const t=typeof e=="string"||typeof e=="number"?e:e.id;return this.map[t]||null}has(e){return this.get(e)!=null}at(e){return e<0&&(e+=this.length),this.cells[e]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(e){return this.cells.indexOf(e)}toArray(){return this.cells.slice()}sort(e={}){return this.comparator!=null&&(this.cells=Lc(this.cells,this.comparator),e.silent||this.trigger("sorted")),this}clone(){const e=this.constructor;return new e(this.cells.slice(),{comparator:this.comparator})}reference(e){this.map[e.id]=e,e.on("*",this.notifyCellEvent,this)}unreference(e){e.off("*",this.notifyCellEvent,this),delete this.map[e.id]}notifyCellEvent(e,t){const s=t.cell;this.trigger(`cell:${e}`,t),s&&(s.isNode()?this.trigger(`node:${e}`,Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.trigger(`edge:${e}`,Object.assign(Object.assign({},t),{edge:s})))}clean(){this.length=0,this.cells=[],this.map={}}dispose(){this.reset([])}}FB([Ol.dispose()],Ol.prototype,"dispose",null);var UB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class nt extends Ve{get[Symbol.toStringTag](){return nt.toStringTag}constructor(e=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Ol(e),this.setup()}notify(e,t){this.trigger(e,t);const s=this.graph;return s&&(e==="sorted"||e==="reseted"||e==="updated"?s.trigger(`model:${e}`,t):s.trigger(e,t)),this}setup(){const e=this.collection;e.on("sorted",()=>this.notify("sorted",null)),e.on("updated",t=>this.notify("updated",t)),e.on("cell:change:zIndex",()=>this.sortOnChangeZ()),e.on("added",({cell:t})=>{this.onCellAdded(t)}),e.on("removed",t=>{const s=t.cell;this.onCellRemoved(s,t.options),this.notify("cell:removed",t),s.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:s})):s.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:s}))}),e.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),e.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),e.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(e){const t=e.id;e.isEdge()?(e.updateParent(),this.edges[t]=!0,this.onEdgeTerminalChanged(e,"source"),this.onEdgeTerminalChanged(e,"target")):this.nodes[t]=!0}onCellRemoved(e,t){const s=e.id;if(e.isEdge()){delete this.edges[s];const r=e.getSource(),i=e.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];t.clear||(t.disconnectEdges?this.disconnectConnectedEdges(e,t):this.removeConnectedEdges(e,t)),e.model===this&&(e.model=null)}onReset(e){this.nodes={},this.edges={},this.outgoings={},this.incomings={},e.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(e,t){const s=t==="source"?this.outgoings:this.incomings,r=e.previous(t);if(r&&r.cell){const o=ge.isCell(r.cell)?r.cell.id:r.cell,a=s[o],c=a?a.indexOf(e.id):-1;c>=0&&(a.splice(c,1),a.length===0&&delete s[o])}const i=e.getTerminal(t);if(i&&i.cell){const o=ge.isCell(i.cell)?i.cell.id:i.cell,a=s[o]||[];a.indexOf(e.id)===-1&&a.push(e.id),s[o]=a}}prepareCell(e,t){return!e.model&&(!t||!t.dryrun)&&(e.model=this),e.zIndex==null&&e.setZIndex(this.getMaxZIndex()+1,{silent:!0}),e}resetCells(e,t={}){return e.map(s=>this.prepareCell(s,Object.assign(Object.assign({},t),{dryrun:!0}))),this.collection.reset(e,t),e.map(s=>this.prepareCell(s,{options:t})),this}clear(e={}){const t=this.getCells();if(t.length===0)return this;const s=Object.assign(Object.assign({},e),{clear:!0});return this.batchUpdate("clear",()=>{const r=t.sort((i,o)=>{const a=i.isEdge()?1:2,c=o.isEdge()?1:2;return a-c});for(;r.length>0;){const i=r.shift();i&&i.remove(s)}},s),this}addNode(e,t={}){const s=Ge.isNode(e)?e:this.createNode(e);return this.addCell(s,t),s}updateNode(e,t={}){const s=this.createNode(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}createNode(e){return Ge.create(e)}addEdge(e,t={}){const s=$e.isEdge(e)?e:this.createEdge(e);return this.addCell(s,t),s}createEdge(e){return $e.create(e)}updateEdge(e,t={}){const s=this.createEdge(e),r=s.getProp();return s.dispose(),this.updateCell(r,t)}addCell(e,t={}){return Array.isArray(e)?this.addCells(e,t):(!this.collection.has(e)&&!this.addings.has(e)&&(this.addings.set(e,!0),this.collection.add(this.prepareCell(e,t),t),e.eachChild(s=>this.addCell(s,t)),this.addings.delete(e)),this)}addCells(e,t={}){const s=e.length;if(s===0)return this;const r=Object.assign(Object.assign({},t),{position:s-1,maxPosition:s-1});return this.startBatch("add",Object.assign(Object.assign({},r),{cells:e})),e.forEach(i=>{this.addCell(i,r),r.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},r),{cells:e})),this}updateCell(e,t={}){const s=e.id&&this.getCell(e.id);return s?this.batchUpdate("update",()=>(Object.entries(e).forEach(([r,i])=>s.setProp(r,i,t)),!0),e):!1}removeCell(e,t={}){const s=typeof e=="string"?this.getCell(e):e;return s&&this.has(s)?this.collection.remove(s,t):null}updateCellId(e,t){if(e.id===t)return;this.startBatch("update",{id:t}),e.prop("id",t);const s=e.clone({keepId:!0});return this.addCell(s),this.getConnectedEdges(e).forEach(i=>{const o=i.getSourceCell(),a=i.getTargetCell();o===e&&i.setSource(Object.assign(Object.assign({},i.getSource()),{cell:t})),a===e&&i.setTarget(Object.assign(Object.assign({},i.getTarget()),{cell:t}))}),this.removeCell(e),this.stopBatch("update",{id:t}),s}removeCells(e,t={}){return e.length?this.batchUpdate("remove",()=>e.map(s=>this.removeCell(s,t))):[]}removeConnectedEdges(e,t={}){const s=this.getConnectedEdges(e);return s.forEach(r=>{r.remove(t)}),s}disconnectConnectedEdges(e,t={}){const s=typeof e=="string"?e:e.id;this.getConnectedEdges(e).forEach(r=>{const i=r.getSourceCellId(),o=r.getTargetCellId();i===s&&r.setSource({x:0,y:0},t),o===s&&r.setTarget({x:0,y:0},t)})}has(e){return this.collection.has(e)}total(){return this.collection.length}indexOf(e){return this.collection.indexOf(e)}getCell(e){return this.collection.get(e)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const e=this.collection.first();return e&&e.getZIndex()||0}getMaxZIndex(){const e=this.collection.last();return e&&e.getZIndex()||0}getCellsFromCache(e){return e?Object.keys(e).map(t=>this.getCell(t)).filter(t=>t!=null):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(e){const t=typeof e=="string"?e:e.id,s=this.outgoings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getIncomingEdges(e){const t=typeof e=="string"?e:e.id,s=this.incomings[t];return s?s.map(r=>this.getCell(r)).filter(r=>r&&r.isEdge()):null}getConnectedEdges(e,t={}){const s=[],r=typeof e=="string"?this.getCell(e):e;if(r==null)return s;const i={},o=t.indirect;let a=t.incoming,c=t.outgoing;a==null&&c==null&&(a=c=!0);const u=(d,f)=>{const h=f?this.getOutgoingEdges(d):this.getIncomingEdges(d);if(h!=null&&h.forEach(p=>{i[p.id]||(s.push(p),i[p.id]=!0,o&&(a&&u(p,!1),c&&u(p,!0)))}),o&&d.isEdge()){const p=f?d.getTargetCell():d.getSourceCell();p&&p.isEdge()&&(i[p.id]||(s.push(p),u(p,f)))}};if(c&&u(r,!0),a&&u(r,!1),t.deep){const d=r.getDescendants({deep:!0}),f={};d.forEach(p=>{p.isNode()&&(f[p.id]=!0)});const h=(p,g)=>{const m=g?this.getOutgoingEdges(p.id):this.getIncomingEdges(p.id);m!=null&&m.forEach(y=>{if(!i[y.id]){const b=y.getSourceCell(),w=y.getTargetCell();if(!t.enclosed&&b&&f[b.id]&&w&&f[w.id])return;s.push(y),i[y.id]=!0}})};d.forEach(p=>{p.isEdge()||(c&&h(p,!0),a&&h(p,!1))})}return s}isBoundary(e,t){const s=typeof e=="string"?this.getCell(e):e,r=t?this.getIncomingEdges(s):this.getOutgoingEdges(s);return r==null||r.length===0}getBoundaryNodes(e){const t=[];return Object.keys(this.nodes).forEach(s=>{if(this.isBoundary(s,e)){const r=this.getCell(s);r&&t.push(r)}}),t}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(e){return this.isBoundary(e,!0)}isLeaf(e){return this.isBoundary(e,!1)}getNeighbors(e,t={}){let s=t.incoming,r=t.outgoing;s==null&&r==null&&(s=r=!0);const o=this.getConnectedEdges(e,t).reduce((a,c)=>{const u=c.hasLoop(t),d=c.getSourceCell(),f=c.getTargetCell();return s&&d&&d.isNode()&&!a[d.id]&&(u||d!==e&&(!t.deep||!d.isDescendantOf(e)))&&(a[d.id]=d),r&&f&&f.isNode()&&!a[f.id]&&(u||f!==e&&(!t.deep||!f.isDescendantOf(e)))&&(a[f.id]=f),a},{});if(e.isEdge()){if(s){const a=e.getSourceCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}if(r){const a=e.getTargetCell();a&&a.isNode()&&!o[a.id]&&(o[a.id]=a)}}return Object.keys(o).map(a=>o[a])}isNeighbor(e,t,s={}){let r=s.incoming,i=s.outgoing;return r==null&&i==null&&(r=i=!0),this.getConnectedEdges(e,s).some(o=>{const a=o.getSourceCell(),c=o.getTargetCell();return!!(r&&a&&a.id===t.id||i&&c&&c.id===t.id)})}getSuccessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{outgoing:!0})),s}isSuccessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{outgoing:!0})),r}getPredecessors(e,t={}){const s=[];return this.search(e,(r,i)=>{r!==e&&this.matchDistance(i,t.distance)&&s.push(r)},Object.assign(Object.assign({},t),{incoming:!0})),s}isPredecessor(e,t,s={}){let r=!1;return this.search(e,(i,o)=>{if(i===t&&i!==e&&this.matchDistance(o,s.distance))return r=!0,!1},Object.assign(Object.assign({},s),{incoming:!0})),r}matchDistance(e,t){return t==null?!0:typeof t=="function"?t(e):Array.isArray(t)&&t.includes(e)?!0:e===t}getCommonAncestor(...e){const t=[];return e.forEach(s=>{s&&(Array.isArray(s)?t.push(...s):t.push(s))}),ge.getCommonAncestor(...t)}getSubGraph(e,t={}){const s=[],r={},i=[],o=[],a=c=>{r[c.id]||(s.push(c),r[c.id]=c,c.isEdge()&&o.push(c),c.isNode()&&i.push(c))};return e.forEach(c=>{a(c),t.deep&&c.getDescendants({deep:!0}).forEach(d=>a(d))}),o.forEach(c=>{const u=c.getSourceCell(),d=c.getTargetCell();u&&!r[u.id]&&(s.push(u),r[u.id]=u,u.isNode()&&i.push(u)),d&&!r[d.id]&&(s.push(d),r[d.id]=d,d.isNode()&&i.push(d))}),i.forEach(c=>{this.getConnectedEdges(c,t).forEach(d=>{const f=d.getSourceCell(),h=d.getTargetCell();!r[d.id]&&f&&r[f.id]&&h&&r[h.id]&&(s.push(d),r[d.id]=d)})}),s}cloneSubGraph(e,t={}){const s=this.getSubGraph(e,t);return this.cloneCells(s)}cloneCells(e){return ge.cloneCells(e)}getNodesFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t||0}:e;return this.getNodes().filter(r=>r.getBBox().containsPoint(s))}getNodesInArea(e,t,s,r,i){const o=typeof e=="number"?new G(e,t,s,r):G.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getNodes().filter(u=>{const d=u.getBBox();return c?o.containsRect(d):o.isIntersectWithRect(d)})}getEdgesInArea(e,t,s,r,i){const o=typeof e=="number"?new G(e,t,s,r):G.create(e),a=typeof e=="number"?i:t,c=a&&a.strict;return this.getEdges().filter(u=>{const d=u.getBBox();return d.width===0?d.inflate(1,0):d.height===0&&d.inflate(0,1),c?o.containsRect(d):o.isIntersectWithRect(d)})}getNodesUnderNode(e,t={}){const s=e.getBBox();return(t.by==null||t.by==="bbox"?this.getNodesInArea(s):this.getNodesFromPoint(s[t.by])).filter(i=>e.id!==i.id&&!i.isDescendantOf(e))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(e,t={}){return ge.getCellsBBox(e,t)}search(e,t,s={}){s.breadthFirst?this.breadthFirstSearch(e,t,s):this.depthFirstSearch(e,t,s)}breadthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.shift();if(a==null||i[a.id]||(i[a.id]=!0,se(t,this,a,o[a.id])===!1))continue;this.getNeighbors(a,s).forEach(u=>{o[u.id]=o[a.id]+1,r.push(u)})}}depthFirstSearch(e,t,s={}){const r=[],i={},o={};for(r.push(e),o[e.id]=0;r.length>0;){const a=r.pop();if(a==null||i[a.id]||(i[a.id]=!0,se(t,this,a,o[a.id])===!1))continue;const c=this.getNeighbors(a,s),u=r.length;c.forEach(d=>{o[d.id]=o[a.id]+1,r.splice(u,0,d)})}}getShortestPath(e,t,s={}){const r={};this.getEdges().forEach(u=>{const d=u.getSourceCellId(),f=u.getTargetCellId();d&&f&&(r[d]||(r[d]=[]),r[f]||(r[f]=[]),r[d].push(f),s.directed||r[f].push(d))});const i=typeof e=="string"?e:e.id,o=rd.run(r,i,s.weight),a=[];let c=typeof t=="string"?t:t.id;for(o[c]&&a.push(c);c=o[c];)a.unshift(c);return a}translate(e,t,s){return this.getCells().filter(r=>!r.hasParent()).forEach(r=>r.translate(e,t,s)),this}resize(e,t,s){return this.resizeCells(e,t,this.getCells(),s)}resizeCells(e,t,s,r={}){const i=this.getCellsBBox(s);if(i){const o=Math.max(e/i.width,0),a=Math.max(t/i.height,0),c=i.getOrigin();s.forEach(u=>u.scale(o,a,c,r))}return this}toJSON(e={}){return nt.toJSON(this.getCells(),e)}parseJSON(e){return nt.fromJSON(e)}fromJSON(e,t={}){const s=this.parseJSON(e);return this.resetCells(s,t),this}startBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)+1,this.notify("batch:start",{name:e,data:t}),this}stopBatch(e,t={}){return this.batches[e]=(this.batches[e]||0)-1,this.notify("batch:stop",{name:e,data:t}),this}batchUpdate(e,t,s={}){this.startBatch(e,s);const r=t();return this.stopBatch(e,s),r}hasActiveBatch(e=Object.keys(this.batches)){return(Array.isArray(e)?e:[e]).some(s=>this.batches[s]>0)}dispose(){this.collection.dispose()}}UB([nt.dispose()],nt.prototype,"dispose",null),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;return(s==null||s===n.toStringTag)&&typeof r.addNode=="function"&&typeof r.addEdge=="function"&&r.collection!=null}n.isModel=e}(nt||(nt={})),function(n){function e(s,r={}){return{cells:s.map(i=>i.toJSON(r))}}n.toJSON=e;function t(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(Ge.registry.exist(o))return Ge.create(i);if($e.registry.exist(o))return $e.create(i)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}n.fromJSON=t}(nt||(nt={}));var HB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};let ks=class extends Ge{get label(){return this.getLabel()}set label(e){this.setLabel(e)}getLabel(){return this.getAttrByPath("text/text")}setLabel(e,t){return e==null?this.removeLabel():this.setAttrByPath("text/text",e,t),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(e){const{label:t}=e,s=HB(e,["label"]);return t&&Ur(s,"attrs/text/text",t),s},visible:!0})})(ks||(ks={}));var GB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};function WB(n,e="body"){return[{tagName:n,selector:e},{tagName:"text",selector:"label"}]}function YB(n="xlink:href"){return t=>{const{imageUrl:s,imageWidth:r,imageHeight:i}=t,o=GB(t,["imageUrl","imageWidth","imageHeight"]);if(s!=null||r!=null||i!=null){const a=()=>{if(o.attrs){const c=o.attrs.image;s!=null&&(c[n]=s),r!=null&&(c.width=r),i!=null&&(c.height=i),o.attrs.image=c}};o.attrs?(o.attrs.image==null&&(o.attrs.image={}),a()):(o.attrs={image:{}},a())}return o}}function ci(n,e,t={}){const s={constructorName:n,markup:WB(n,t.selector),attrs:{[n]:Object.assign({},ks.bodyAttr)}};return(t.parent||ks).define(Ye(s,e,{shape:n}))}ci("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}});const qB=$e.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"}}});ci("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var XB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ui extends ks{get points(){return this.getPoints()}set points(e){this.setPoints(e)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(e,t){return e==null?this.removePoints():this.setAttrByPath("body/refPoints",ui.pointsToString(e),t),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(n){function e(t){return typeof t=="string"?t:t.map(s=>Array.isArray(s)?s.join(","):M.isPointLike(s)?`${s.x}, ${s.y}`:"").join(" ")}n.pointsToString=e,n.config({propHooks(t){const{points:s}=t,r=XB(t,["points"]);if(s){const i=e(s);i&&Ur(r,"attrs/body/refPoints",i)}return r}})})(ui||(ui={})),ci("polygon",{},{parent:ui}),ci("polyline",{},{parent:ui});var JB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};ks.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:e}=n,t=JB(n,["path"]);return e&&Ur(t,"attrs/body/refD",e),t}});var KB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};ks.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},bs.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:it.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({},ks.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(n){const{text:e}=n,t=KB(n,["text"]);return e&&Ur(t,"attrs/label/text",e),t},attrHooks:{text:{set(n,{cell:e,view:t,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%"},c=Object.assign({textVerticalAnchor:"middle"},o),u=kn.presets.textWrap;return se(u.set,this,a,{cell:e,view:t,elem:r,refBBox:s,attrs:c}),{fill:o.color||null}}},position(n,{refBBox:e,elem:t}){if(t instanceof SVGElement)return e.getCenter()}}}}),ci("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:YB()},{selector:"image"}),ci("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});class wn extends He{constructor(){super(...arguments),this.portsCache={}}get[Symbol.toStringTag](){return wn.toStringTag}getContainerClassName(){const e=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||e.push(this.prefixClassName("node-immovable")),e.join(" ")}updateClassName(e){const t=e.target;if(t.hasAttribute("magnet")){const s=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?Ie(t,s):ee(t,s)}else{const s=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(s):this.addClass(s)}}isNodeView(){return!0}confirmUpdate(e,t={}){let s=e;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")===e?this.renderTools():this.updateTools(t)})),s}update(e){this.cleanCache(),this.removePorts();const t=this.cell,s=t.getSize(),r=t.getAttrs();this.updateAttrs(this.container,r,{attrs:e===r?null:e,rootBBox:new G(0,0,s.width,s.height),selectors:this.selectors}),this.renderPorts()}renderMarkup(){const e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid node markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.appendChild(t.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 e=this.cell.getPosition();return`translate(${e.x},${e.y})`}getRotationString(){const e=this.cell.getAngle();if(e){const t=this.cell.getSize();return`rotate(${e},${t.width/2},${t.height/2})`}}updateTransform(){let e=this.getTranslationString();const t=this.getRotationString();t&&(e+=` ${t}`),this.container.setAttribute("transform",e)}findPortElem(e,t){const s=e?this.portsCache[e]:null;if(!s)return null;const r=s.portContentElement,i=s.portContentSelectors||{};return this.findOne(t,r,i)}cleanPortsCache(){this.portsCache={}}removePorts(){Object.values(this.portsCache).forEach(e=>{Yt(e.portElement)})}renderPorts(){const e=this.container,t=[];e.childNodes.forEach(o=>{t.push(o)});const s=this.cell.getParsedPorts(),r=Mp(s,"zIndex"),i="auto";r[i]&&r[i].forEach(o=>{const a=this.getPortElement(o);e.append(a),t.push(a)}),Object.keys(r).forEach(o=>{if(o!==i){const a=parseInt(o,10);this.appendPorts(r[o],a,t)}}),this.updatePorts()}appendPorts(e,t,s){const r=e.map(i=>this.getPortElement(i));s[t]||t<0?qu(s[Math.max(t,0)],r):Lt(this.container,r)}getPortElement(e){const t=this.portsCache[e.id];return t?t.portElement:this.createPortElement(e)}createPortElement(e){let t=De.renderMarkup(this.cell.getPortContainerMarkup());const s=t.elem;if(s==null)throw new Error("Invalid port container markup.");t=De.renderMarkup(this.getPortMarkup(e));const r=t.elem,i=t.selectors;if(r==null)throw new Error("Invalid port markup.");this.setAttrs({port:e.id,"port-group":e.group},r);let o="x6-port";e.group&&(o+=` x6-port-${e.group}`),ee(s,o),ee(s,"x6-port"),ee(r,"x6-port-body"),s.appendChild(r);let a=i,c,u;if(this.existPortLabel(e)){if(t=De.renderMarkup(this.getPortLabelMarkup(e.label)),c=t.elem,u=t.selectors,c==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)}ee(c,"x6-port-label"),s.appendChild(c)}return this.portsCache[e.id]={portElement:s,portSelectors:a,portLabelElement:c,portLabelSelectors:u,portContentElement:r,portContentSelectors:i},this.graph.options.onPortRendered&&this.graph.options.onPortRendered({port:e,node:this.cell,container:s,selectors:a,labelContainer:c,labelSelectors:u,contentContainer:r,contentSelectors:i}),s}updatePorts(){const e=this.cell.getParsedGroups(),t=Object.keys(e);t.length===0?this.updatePortGroup():t.forEach(s=>this.updatePortGroup(s))}updatePortGroup(e){const t=G.fromSize(this.cell.getSize()),s=this.cell.getPortsLayoutByGroup(e,t);for(let r=0,i=s.length;r<i;r+=1){const o=s[r],a=o.portId,c=this.portsCache[a]||{},u=o.portLayout;if(this.applyPortTransform(c.portElement,u),o.portAttrs!=null){const f={selectors:c.portSelectors||{}};o.portSize&&(f.rootBBox=G.fromSize(o.portSize)),this.updateAttrs(c.portElement,o.portAttrs,f)}const d=o.labelLayout;if(d&&c.portLabelElement&&(this.applyPortTransform(c.portLabelElement,d,-(u.angle||0)),d.attrs)){const f={selectors:c.portLabelSelectors||{}};o.labelSize&&(f.rootBBox=G.fromSize(o.labelSize)),this.updateAttrs(c.portLabelElement,d.attrs,f)}}}applyPortTransform(e,t,s=0){const r=t.angle,i=t.position,o=ot().rotate(s).translate(i.x||0,i.y||0).rotate(r||0);Yr(e,o,{absolute:!0})}getPortMarkup(e){return e.markup||this.cell.portMarkup}getPortLabelMarkup(e){return e.markup||this.cell.portLabelMarkup}existPortLabel(e){return e.attrs&&e.attrs.text}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,node:i,cell:o}:{e,x:t,y:s,view:r,node:i,cell:o}}getPortEventArgs(e,t,s){const r=this,i=r.cell,o=i;return s?{e,x:s.x,y:s.y,view:r,node:i,cell:o,port:t}:{e,view:r,node:i,cell:o,port:t}}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("node:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("node:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("node:mouseup",this.getEventArgs(e,t,s))}notifyPortEvent(e,t,s){const r=this.findAttr("port",t.target);if(r){const i=t.type;e==="node:port:mouseenter"?t.type="mouseenter":e==="node:port:mouseleave"&&(t.type="mouseleave"),this.notify(e,this.getPortEventArgs(t,r,s)),t.type=i}}onClick(e,t,s){super.onClick(e,t,s),this.notify("node:click",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:click",e,{x:t,y:s})}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("node:dblclick",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:dblclick",e,{x:t,y:s})}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("node:contextmenu",this.getEventArgs(e,t,s)),this.notifyPortEvent("node:port:contextmenu",e,{x:t,y:s})}onMouseDown(e,t,s){this.isPropagationStopped(e)||(this.notifyMouseDown(e,t,s),this.notifyPortEvent("node:port:mousedown",e,{x:t,y:s}),this.startNodeDragging(e,t,s))}onMouseMove(e,t,s){const r=this.getEventData(e),i=r.action;if(i==="magnet")this.dragMagnet(e,t,s);else{if(i==="move"){const a=r.targetView||this;a.dragNode(e,t,s),a.notify("node:moving",{e,x:t,y:s,view:a,cell:a.cell,node:a.cell})}this.notifyMouseMove(e,t,s),this.notifyPortEvent("node:port:mousemove",e,{x:t,y:s})}this.setEventData(e,r)}onMouseUp(e,t,s){const r=this.getEventData(e),i=r.action;i==="magnet"?this.stopMagnetDragging(e,t,s):(this.notifyMouseUp(e,t,s),this.notifyPortEvent("node:port:mouseup",e,{x:t,y:s}),i==="move"&&(r.targetView||this).stopNodeDragging(e,t,s));const o=r.targetMagnet;o&&this.onMagnetClick(e,o,t,s),this.checkMouseleave(e)}onMouseOver(e){super.onMouseOver(e),this.notify("node:mouseover",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseenter",e),this.notifyPortEvent("node:port:mouseover",e)}onMouseOut(e){super.onMouseOut(e),this.notify("node:mouseout",this.getEventArgs(e)),this.notifyPortEvent("node:port:mouseleave",e),this.notifyPortEvent("node:port:mouseout",e)}onMouseEnter(e){this.updateClassName(e),super.onMouseEnter(e),this.notify("node:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("node:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("node:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onMagnetClick(e,t,s,r){const i=this.graph;i.view.getMouseMovedCount(e)>i.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetDblClick(e,t,s,r){this.notify("node:magnet:dblclick",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetContextMenu(e,t,s,r){this.notify("node:magnet:contextmenu",Object.assign({magnet:t},this.getEventArgs(e,s,r)))}onMagnetMouseDown(e,t,s,r){this.startMagnetDragging(e,s,r)}onCustomEvent(e,t,s,r){this.notify("node:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}prepareEmbedding(e){const t=this.graph,r=this.getEventData(e).cell||this.cell,i=t.findViewByCell(r),o=t.snapToGrid(e.clientX,e.clientY);this.notify("node:embed",{e,node:r,view:i,cell:r,x:o.x,y:o.y,currentParent:r.getParent()})}processEmbedding(e,t){const s=t.cell||this.cell,r=t.graph||this.graph,i=r.options.embedding,o=i.findParent;let a=typeof o=="function"?se(o,r,{view:this,node:this.cell}).filter(h=>ge.isCell(h)&&this.cell.id!==h.id&&!h.isDescendantOf(this.cell)):r.model.getNodesUnderNode(s,{by:o});if(i.frontOnly&&a.length>0){const h=Mp(a,"zIndex"),p=_P(Object.keys(h).map(g=>parseInt(g,10)));p&&(a=h[p])}a=a.filter(h=>h.visible);let c=null;const u=t.candidateEmbedView,d=i.validate;for(let h=a.length-1;h>=0;h-=1){const p=a[h];if(u&&u.cell.id===p.id){c=u;break}else{const g=p.findView(r);if(d&&se(d,r,{child:this.cell,parent:g.cell,childView:this,parentView:g})){c=g;break}}}this.clearEmbedding(t),c&&c.highlight(null,{type:"embedding"}),t.candidateEmbedView=c;const f=r.snapToGrid(e.clientX,e.clientY);this.notify("node:embedding",{e,cell:s,node:s,view:r.findViewByCell(s),x:f.x,y:f.y,currentParent:s.getParent(),candidateParent:c?c.cell:null})}clearEmbedding(e){const t=e.candidateEmbedView;t&&(t.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null)}finalizeEmbedding(e,t){this.graph.startBatch("embedding");const s=t.cell||this.cell,r=t.graph||this.graph,i=r.findViewByCell(s),o=s.getParent(),a=t.candidateEmbedView;if(a?(a.unhighlight(null,{type:"embedding"}),t.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(c=>{c.updateParent({ui:!0})}),i&&a){const c=r.snapToGrid(e.clientX,e.clientY);i.notify("node:embedded",{e,cell:s,x:c.x,y:c.y,node:s,view:r.findViewByCell(s),previousParent:o,currentParent:s.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let e=this.cell,t=this;for(;t&&!e.isEdge();){if(!e.hasParent()||t.can("stopDelegateOnDragging"))return t;e=e.getParent(),t=this.graph.findViewByCell(e)}return null}validateMagnet(e,t,s){if(t.getAttribute("magnet")!=="passive"){const r=this.graph.options.connecting.validateMagnet;return r?se(r,this.graph,{e:s,magnet:t,view:e,cell:e.cell}):!0}return!1}startMagnetDragging(e,t,s){if(!this.can("magnetConnectable"))return;e.stopPropagation();const r=e.currentTarget,i=this.graph;this.setEventData(e,{targetMagnet:r}),this.validateMagnet(this,r,e)?(i.options.magnetThreshold<=0&&this.startConnectting(e,r,t,s),this.setEventData(e,{action:"magnet"}),this.stopPropagation(e)):this.onMouseDown(e,t,s),i.view.delegateDragEvents(e,this)}startConnectting(e,t,s,r){this.graph.model.startBatch("add-edge");const i=this.createEdgeFromMagnet(t,s,r);i.setEventData(e,i.prepareArrowheadDragging("target",{x:s,y:r,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(e,{edgeView:i}),i.notifyMouseDown(e,s,r)}getDefaultEdge(e,t){let s;const r=this.graph.options.connecting.createEdge;return r&&(s=se(r,this.graph,{sourceMagnet:t,sourceView:e,sourceCell:e.cell})),s}createEdgeFromMagnet(e,t,s){const r=this.graph,i=r.model,o=this.getDefaultEdge(this,e);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(e,t,s,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:t,y:s})),o.addTo(i,{async:!1,ui:!0}),o.findView(r)}dragMagnet(e,t,s){const r=this.getEventData(e),i=r.edgeView;if(i)i.onMouseMove(e,t,s),this.autoScrollGraph(e.clientX,e.clientY);else{const o=this.graph,a=o.options.magnetThreshold,c=this.getEventTarget(e),u=r.targetMagnet;if(a==="onleave"){if(u===c||u.contains(c))return}else if(o.view.getMouseMovedCount(e)<=a)return;this.startConnectting(e,u,t,s)}}stopMagnetDragging(e,t,s){const i=this.eventData(e).edgeView;i&&(i.onMouseUp(e,t,s),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(e,t,s){this.notify("node:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(e,t,s,r,i){let o=[i];const a=this.graph.getPlugin("selection");if(a&&a.isSelectionMovable()){const c=a.getSelectedCells();c.includes(i)&&(o=c.filter(u=>u.isNode()))}o.forEach(c=>{this.notify(e,{e:t,x:s,y:r,cell:c,node:c,view:c.findView(this.graph)})})}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?se(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}startNodeDragging(e,t,s){const r=this.getDelegatedView();if(r==null||!r.can("nodeMovable"))return this.notifyUnhandledMouseDown(e,t,s);this.setEventData(e,{targetView:r,action:"move"});const i=M.create(r.cell.getPosition());r.setEventData(e,{moving:!1,offset:i.diff(t,s),restrict:this.getRestrictArea(r)})}dragNode(e,t,s){const r=this.cell,i=this.graph,o=i.getGridSize(),a=this.getEventData(e),c=a.offset,u=a.restrict;a.moving||(a.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",e,t,s,this.cell)),this.autoScrollGraph(e.clientX,e.clientY);const d=Se.snapToGrid(t+c.x,o),f=Se.snapToGrid(s+c.y,o);r.setPosition(d,f,{restrict:u,deep:!0,ui:!0}),i.options.embedding.enabled&&(a.embedding||(this.prepareEmbedding(e),a.embedding=!0),this.processEmbedding(e,a))}stopNodeDragging(e,t,s){const r=this.getEventData(e);r.embedding&&this.finalizeEmbedding(e,r),r.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",e,t,s,this.cell)),r.moving=!1,r.embedding=!1}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");s&&s.autoScroll(e,t)}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e})(wn||(wn={})),wn.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"]}}),wn.registry.register("node",wn,!0);var ZB=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class ts extends He{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.labelDestroyFn={}}get[Symbol.toStringTag](){return ts.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const e=this.sourceView;if(!e){const s=this.cell.getSource();return new G(s.x,s.y)}const t=this.sourceMagnet;return e.isEdgeElement(t)?new G(this.sourceAnchor.x,this.sourceAnchor.y):e.getBBoxOfElement(t||e.container)}get targetBBox(){const e=this.targetView;if(!e){const s=this.cell.getTarget();return new G(s.x,s.y)}const t=this.targetMagnet;return e.isEdgeElement(t)?new G(this.targetAnchor.x,this.targetAnchor.y):e.getBBoxOfElement(t||e.container)}isEdgeView(){return!0}confirmUpdate(e,t={}){let s=e;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(t)),s=this.handleAction(s,"labels",()=>this.onLabelsChange(t)),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 e=this.cell.markup;if(e){if(typeof e=="string")throw new TypeError("Not support string markup.");return this.renderJSONMarkup(e)}throw new TypeError("Invalid edge markup.")}renderJSONMarkup(e){const t=this.parseJSONMarkup(e,this.container);this.selectors=t.selectors,this.container.append(t.fragment)}customizeLabels(){if(this.labelContainer){const e=this.cell,t=e.labels;for(let s=0,r=t.length;s<r;s+=1){const i=t[s],o=this.labelCache[s],a=this.labelSelectors[s],c=this.graph.options.onEdgeLabelRendered;if(c){const u=c({edge:e,label:i,container:o,selectors:a});u&&(this.labelDestroyFn[s]=u)}}}}destroyCustomizeLabels(){const e=this.cell.labels;if(this.labelCache&&this.labelSelectors&&this.labelDestroyFn)for(let t=0,s=e.length;t<s;t+=1){const r=this.labelDestroyFn[t],i=this.labelCache[t],o=this.labelSelectors[t];r&&i&&o&&r({edge:this.cell,label:e[t],container:i,selectors:o})}this.labelDestroyFn={}}renderLabels(){const e=this.cell,t=e.getLabels(),s=t.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=yn("g"),this.addClass(this.prefixClassName("edge-labels"),r),this.labelContainer=r);for(let i=0,o=t.length;i<o;i+=1){const a=t[i],c=this.normalizeLabelMarkup(this.parseLabelMarkup(a.markup));let u,d;if(c)u=c.node,d=c.selectors;else{const h=e.getDefaultLabel(),p=this.normalizeLabelMarkup(this.parseLabelMarkup(h.markup));u=p.node,d=p.selectors}u.setAttribute("data-index",`${i}`),r.appendChild(u);const f=this.rootSelector;if(d[f])throw new Error("Ambiguous label root selector.");d[f]=u,this.labelCache[i]=u,this.labelSelectors[i]=d}return r.parentNode==null&&this.container.appendChild(r),this.updateLabels(),this.customizeLabels(),this}onLabelsChange(e={}){this.destroyCustomizeLabels(),this.shouldRerenderLabels(e)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(e={}){const t=this.cell.previous("labels");if(t==null)return!0;if("propertyPathArray"in e&&"propertyValue"in e){const s=e.propertyPathArray||[],r=s.length;if(r>1){const i=s[1];if(t[i]){if(r===2)return typeof e.propertyValue=="object"&&ga(e.propertyValue,"markup");if(s[2]!=="markup")return!1}}}return!0}parseLabelMarkup(e){return e?typeof e=="string"?this.parseLabelStringMarkup(e):this.parseJSONMarkup(e):null}parseLabelStringMarkup(e){const t=oe.createVectors(e),s=document.createDocumentFragment();for(let r=0,i=t.length;r<i;r+=1){const o=t[r].node;s.appendChild(o)}return{fragment:s,selectors:{}}}normalizeLabelMarkup(e){if(e==null)return;const t=e.fragment;if(!(t instanceof DocumentFragment)||!t.hasChildNodes())throw new Error("Invalid label markup.");let s;const r=t.childNodes;return r.length>1||r[0].nodeName.toUpperCase()!=="G"?s=oe.create("g").append(t):s=oe.create(r[0]),s.addClass(this.prefixClassName("edge-label")),{node:s.node,selectors:e.selectors}}updateLabels(){if(this.labelContainer){const e=this.cell,t=e.labels,s=this.can("edgeLabelMovable"),r=e.getDefaultLabel();for(let i=0,o=t.length;i<o;i+=1){const a=this.labelCache[i],c=this.labelSelectors[i];a.setAttribute("cursor",s?"move":"default");const u=t[i],d=Ye({},r.attrs,u.attrs);this.updateAttrs(a,d,{selectors:c,rootBBox:u.size?G.fromSize(u.size):void 0})}}}renderTools(){const e=this.cell.getTools();return this.addTools(e),this}update(e={}){this.cleanCache(),this.updateConnection(e);const t=this.cell.getAttrs(),s=ZB(t,["text"]);return s!=null&&this.updateAttrs(this.container,s,{selectors:this.selectors}),this.updateLabelPositions(),this.updateTools(e),this}removeRedundantLinearVertices(e={}){const t=this.cell,s=t.getVertices(),r=[this.sourceAnchor,...s,this.targetAnchor],i=r.length,o=new Fe(r);o.simplify({threshold:.01});const a=o.points.map(u=>u.toJSON()),c=a.length;return i===c?0:(t.setVertices(a.slice(1,c-1),e),i-c)}getTerminalView(e){switch(e){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalAnchor(e){switch(e){case"source":return M.create(this.sourceAnchor);case"target":return M.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalConnectionPoint(e){switch(e){case"source":return M.create(this.sourcePoint);case"target":return M.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${e}'`)}}getTerminalMagnet(e,t={}){switch(e){case"source":{if(t.raw)return this.sourceMagnet;const s=this.sourceView;return s?this.sourceMagnet||s.container:null}case"target":{if(t.raw)return this.targetMagnet;const s=this.targetView;return s?this.targetMagnet||s.container:null}default:throw new Error(`Unknown terminal type '${e}'`)}}updateConnection(e={}){const t=this.cell;if(e.translateBy&&t.isFragmentDescendantOf(e.translateBy)){const s=e.tx||0,r=e.ty||0;this.routePoints=new Fe(this.routePoints).translate(s,r).points,this.translateConnectionPoints(s,r),this.path.translate(s,r)}else{const s=t.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(e){const t=this.cell,s=t.source,r=t.target,i=e[0],o=e[e.length-1];return r.priority&&!s.priority?this.findAnchorsOrdered("target",o,"source",i):this.findAnchorsOrdered("source",i,"target",o)}findAnchorsOrdered(e,t,s,r){let i,o;const a=this.cell,c=a[e],u=a[s],d=this.getTerminalView(e),f=this.getTerminalView(s),h=this.getTerminalMagnet(e),p=this.getTerminalMagnet(s);if(d){let g;t?g=M.create(t):f?g=p:g=M.create(u),i=this.getAnchor(c.anchor,d,h,g,e)}else i=M.create(c);if(f){const g=M.create(r||i);o=this.getAnchor(u.anchor,f,p,g,s)}else o=M.isPointLike(u)?M.create(u):new M;return{[e]:i,[s]:o}}getAnchor(e,t,s,r,i){const o=t.isEdgeElement(s),a=this.graph.options.connecting;let c=typeof e=="string"?{name:e}:e;if(!c){const f=o?(i==="source"?a.sourceEdgeAnchor:a.targetEdgeAnchor)||a.edgeAnchor:(i==="source"?a.sourceAnchor:a.targetAnchor)||a.anchor;c=typeof f=="string"?{name:f}:f}if(!c)throw new Error("Anchor should be specified.");let u;const d=c.name;if(o){const f=ii.registry.get(d);if(typeof f!="function")return ii.registry.onNotFound(d);u=se(f,this,t,s,r,c.args||{},i)}else{const f=ri.registry.get(d);if(typeof f!="function")return ri.registry.onNotFound(d);u=se(f,this,t,s,r,c.args||{},i)}return u?u.round(this.POINT_ROUNDING):new M}findRoutePoints(e=[]){const t=this.graph.options.connecting.router||Ts.presets.normal,s=this.cell.getRouter()||t;let r;if(typeof s=="function")r=se(s,this,e,{},this);else{const i=typeof s=="string"?s:s.name,o=typeof s=="string"?{}:s.args||{},a=i?Ts.registry.get(i):Ts.presets.normal;if(typeof a!="function")return Ts.registry.onNotFound(i);r=se(a,this,e,o,this)}return r==null?e.map(i=>M.create(i)):r.map(i=>M.create(i))}findConnectionPoints(e,t,s){const r=this.cell,i=this.graph.options.connecting,o=r.getSource(),a=r.getTarget(),c=this.sourceView,u=this.targetView,d=e[0],f=e[e.length-1];let h;if(c&&!c.isEdgeElement(this.sourceMagnet)){const g=this.sourceMagnet||c.container,m=d||s,y=new K(m,t),b=o.connectionPoint||i.sourceConnectionPoint||i.connectionPoint;h=this.getConnectionPoint(b,c,g,y,"source")}else h=t;let p;if(u&&!u.isEdgeElement(this.targetMagnet)){const g=this.targetMagnet||u.container,m=a.connectionPoint||i.targetConnectionPoint||i.connectionPoint,y=f||t,b=new K(y,s);p=this.getConnectionPoint(m,u,g,b,"target")}else p=s;return{source:h,target:p}}getConnectionPoint(e,t,s,r,i){const o=r.end;if(e==null)return o;const a=typeof e=="string"?e:e.name,c=typeof e=="string"?{}:e.args,u=oi.registry.get(a);if(typeof u!="function")return oi.registry.onNotFound(a);const d=se(u,this,r,t,s,c||{},i);return d?d.round(this.POINT_ROUNDING):o}findMarkerPoints(e,t,s){const r=f=>{const h=this.cell.getAttrs(),p=Object.keys(h);for(let g=0,m=p.length;g<m;g+=1){const y=h[p[g]];if(y[`${f}Marker`]||y[`${f}-marker`]){const b=y.strokeWidth||y["stroke-width"];if(b)return parseFloat(b);break}}return null},i=e[0],o=e[e.length-1];let a,c;const u=r("source");u&&(a=t.clone().move(i||s,-u));const d=r("target");return d&&(c=s.clone().move(o||t,-d)),this.sourceMarkerPoint=a||t.clone(),this.targetMarkerPoint=c||s.clone(),{source:a,target:c}}findPath(e,t,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=ar.registry.get(i);if(typeof u!="function")return ar.registry.onNotFound(i);a=u}else a=ar.presets.normal;const c=se(a,this,t,s,e,Object.assign(Object.assign({},o),{raw:!0}),this);return typeof c=="string"?re.parse(c):c}translateConnectionPoints(e,t){this.sourcePoint.translate(e,t),this.targetPoint.translate(e,t),this.sourceAnchor.translate(e,t),this.targetAnchor.translate(e,t),this.sourceMarkerPoint.translate(e,t),this.targetMarkerPoint.translate(e,t)}updateLabelPositions(){if(this.labelContainer==null)return this;if(!this.path)return this;const t=this.cell,s=t.getLabels();if(s.length===0)return this;const r=t.getDefaultLabel(),i=this.normalizeLabelPosition(r.position);for(let o=0,a=s.length;o<a;o+=1){const c=s[o],u=this.labelCache[o];if(!u)continue;const d=this.normalizeLabelPosition(c.position),f=Ye({},i,d),h=this.getLabelTransformationMatrix(f);u.setAttribute("transform",Wr(h))}return this}updateTerminalProperties(e){const t=this.cell,s=this.graph,r=t[e],i=r&&r.cell,o=`${e}View`;if(!i)return this[o]=null,this.updateTerminalMagnet(e),!0;const a=s.getCellById(i);if(!a)throw new Error(`Edge's ${e} node with id "${i}" not exists`);const c=a.findView(s);return c?(this[o]=c,this.updateTerminalMagnet(e),!0):!1}updateTerminalMagnet(e){const t=`${e}Magnet`,s=this.getTerminalView(e);if(s){let r=s.getMagnetFromEdgeTerminal(this.cell[e]);r===s.container&&(r=null),this[t]=r}else this[t]=null}getLabelPositionAngle(e){const t=this.cell.getLabelAt(e);return t&&t.position&&typeof t.position=="object"&&t.position.angle||0}getLabelPositionArgs(e){const t=this.cell.getLabelAt(e);if(t&&t.position&&typeof t.position=="object")return t.position.options}getDefaultLabelPositionArgs(){const e=this.cell.getDefaultLabel();if(e&&e.position&&typeof e.position=="object")return e.position.options}mergeLabelPositionArgs(e,t){return e===null?null:e===void 0?t===null?null:t:Ye({},t,e)}getConnection(){return this.path!=null?this.path.clone():null}getConnectionPathData(){if(this.path==null)return"";const e=this.cache.pathCache;return ga(e,"data")||(e.data=this.path.serialize()),e.data||""}getConnectionSubdivisions(){if(this.path==null)return null;const e=this.cache.pathCache;return ga(e,"segmentSubdivisions")||(e.segmentSubdivisions=this.path.getSegmentSubdivisions()),e.segmentSubdivisions}getConnectionLength(){if(this.path==null)return 0;const e=this.cache.pathCache;return ga(e,"length")||(e.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),e.length}getPointAtLength(e){return this.path==null?null:this.path.pointAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(e){return this.path==null?null:(Kn(e)&&(e=parseFloat(e)/100),this.path.pointAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(e){return this.path==null?null:this.path.tangentAtLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(e){return this.path==null?null:this.path.tangentAt(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(e){return this.path==null?null:this.path.closestPoint(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(e){return this.path==null?null:this.path.closestPointLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(e){return this.path==null?null:this.path.closestPointNormalizedLength(e,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(e,t,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 c=a&&a.absoluteOffset,u=!(a&&a.absoluteDistance),d=a&&a.absoluteDistance&&a.reverseDistance,f=this.path,h={segmentSubdivisions:this.getConnectionSubdivisions()},p=new M(e,t),g=f.closestPointT(p,h),m=this.getConnectionLength()||0;let y=f.lengthAtT(g,h);u&&(y=m>0?y/m:0),d&&(y=-1*(m-y)||1),i.distance=y;let b;c||(b=f.tangentAtT(g));let w;if(b)w=b.pointOffset(p);else{const x=f.pointAtT(g),S=p.diff(x);w={x:S.x,y:S.y}}return i.offset=w,i.angle=o,i}normalizeLabelPosition(e){return typeof e=="number"?{distance:e}:e}getLabelTransformationMatrix(e){const t=this.normalizeLabelPosition(e),s=t.options||{},r=t.angle||0,i=t.distance,o=i>0&&i<=1;let a=0;const c={x:0,y:0},u=t.offset;u&&(typeof u=="number"?a=u:(u.x!=null&&(c.x=u.x),u.y!=null&&(c.y=u.y)));const d=c.x!==0||c.y!==0||a===0,f=s.keepGradient,h=s.ensureLegibility,p=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},m=o?i*this.getConnectionLength():i,y=p.tangentAtLength(m,g);let b,w=r;if(y){if(d)b=y.start,b.translate(c);else{const x=y.clone();x.rotate(-90,y.start),x.setLength(a),b=x.end}f&&(w=y.angle()+r,h&&(w=ye.normalize((w+90)%180-90)))}else b=p.start,d&&b.translate(c);return ot().translate(b.x,b.y).rotate(w)}getVertexIndex(e,t){const r=this.cell.getVertices(),i=this.getClosestPointLength(new M(e,t));let o=0;if(i!=null)for(const a=r.length;o<a;o+=1){const c=r[o],u=this.getClosestPointLength(c);if(u!=null&&i<u)break}return o}getEventArgs(e,t,s){const r=this,i=r.cell,o=i;return t==null||s==null?{e,view:r,edge:i,cell:o}:{e,x:t,y:s,view:r,edge:i,cell:o}}notifyUnhandledMouseDown(e,t,s){this.notify("edge:unhandled:mousedown",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(e,t,s){super.onMouseDown(e,t,s),this.notify("edge:mousedown",this.getEventArgs(e,t,s))}notifyMouseMove(e,t,s){super.onMouseMove(e,t,s),this.notify("edge:mousemove",this.getEventArgs(e,t,s))}notifyMouseUp(e,t,s){super.onMouseUp(e,t,s),this.notify("edge:mouseup",this.getEventArgs(e,t,s))}onClick(e,t,s){super.onClick(e,t,s),this.notify("edge:click",this.getEventArgs(e,t,s))}onDblClick(e,t,s){super.onDblClick(e,t,s),this.notify("edge:dblclick",this.getEventArgs(e,t,s))}onContextMenu(e,t,s){super.onContextMenu(e,t,s),this.notify("edge:contextmenu",this.getEventArgs(e,t,s))}onMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startEdgeDragging(e,t,s)}onMouseMove(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.dragLabel(e,t,s);break}case"drag-arrowhead":{this.dragArrowhead(e,t,s);break}case"drag-edge":{this.dragEdge(e,t,s);break}}return this.notifyMouseMove(e,t,s),r}onMouseUp(e,t,s){const r=this.getEventData(e);switch(r.action){case"drag-label":{this.stopLabelDragging(e,t,s);break}case"drag-arrowhead":{this.stopArrowheadDragging(e,t,s);break}case"drag-edge":{this.stopEdgeDragging(e,t,s);break}}return this.notifyMouseUp(e,t,s),this.checkMouseleave(e),r}onMouseOver(e){super.onMouseOver(e),this.notify("edge:mouseover",this.getEventArgs(e))}onMouseOut(e){super.onMouseOut(e),this.notify("edge:mouseout",this.getEventArgs(e))}onMouseEnter(e){super.onMouseEnter(e),this.notify("edge:mouseenter",this.getEventArgs(e))}onMouseLeave(e){super.onMouseLeave(e),this.notify("edge:mouseleave",this.getEventArgs(e))}onMouseWheel(e,t,s,r){super.onMouseWheel(e,t,s,r),this.notify("edge:mousewheel",Object.assign({delta:r},this.getEventArgs(e,t,s)))}onCustomEvent(e,t,s,r){if(Cy(e.target,"edge-tool",this.container)){if(e.stopPropagation(),this.can("useEdgeTools")){if(t==="edge:remove"){this.cell.remove({ui:!0});return}this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r)))}this.notifyMouseDown(e,s,r)}else this.notify("edge:customevent",Object.assign({name:t},this.getEventArgs(e,s,r))),super.onCustomEvent(e,t,s,r)}onLabelMouseDown(e,t,s){this.notifyMouseDown(e,t,s),this.startLabelDragging(e,t,s),this.getEventData(e).stopPropagation&&e.stopPropagation()}startEdgeDragging(e,t,s){if(!this.can("edgeMovable")){this.notifyUnhandledMouseDown(e,t,s);return}this.setEventData(e,{x:t,y:s,moving:!1,action:"drag-edge"})}dragEdge(e,t,s){const r=this.getEventData(e);r.moving||(r.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(t-r.x,s-r.y,{ui:!0}),this.setEventData(e,{x:t,y:s}),this.notify("edge:moving",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(e,t,s){const r=this.getEventData(e);r.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e,x:t,y:s,view:this,cell:this.cell,edge:this.cell})),r.moving=!1}prepareArrowheadDragging(e,t){const s=this.getTerminalMagnet(e),r={action:"drag-arrowhead",x:t.x,y:t.y,isNewEdge:t.isNewEdge===!0,terminalType:e,initialMagnet:s,initialTerminal:Pc(this.cell[e]),fallbackAction:t.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(e),options:t.options};return this.beforeArrowheadDragging(r),r}createValidateConnectionArgs(e){const t=[];t[4]=e,t[5]=this;let s,r=0,i=0;e==="source"?(r=2,s="target"):(i=2,s="source");const o=this.cell[s],a=o.cell;if(a){let c;const u=t[r]=this.graph.findViewByCell(a);u&&(c=u.getMagnetFromEdgeTerminal(o),c===u.container&&(c=void 0)),t[r+1]=c}return(c,u)=>(t[i]=c,t[i+1]=c.container===u?void 0:u,t)}beforeArrowheadDragging(e){e.zIndex=this.cell.zIndex,this.cell.toFront();const t=this.container.style;e.pointerEvents=t.pointerEvents,t.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(e)}afterArrowheadDragging(e){e.zIndex!=null&&(this.cell.setZIndex(e.zIndex,{ui:!0}),e.zIndex=null);const t=this.container;t.style.pointerEvents=e.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(e)}validateConnection(e,t,s,r,i,o,a){const c=this.graph.options.connecting,u=c.allowLoop,d=c.allowNode,f=c.allowEdge,h=c.allowPort,p=c.allowMulti,g=c.validateConnection,m=o?o.cell:null,y=i==="target"?s:e,b=i==="target"?r:t;let w=!0;const x=S=>{const v=i==="source"?a?a.port:null:m?m.getSourcePortId():null,E=i==="target"?a?a.port:null:m?m.getTargetPortId():null;return se(S,this.graph,{edge:m,edgeView:o,sourceView:e,targetView:s,sourcePort:v,targetPort:E,sourceMagnet:t,targetMagnet:r,sourceCell:e?e.cell:null,targetCell:s?s.cell:null,type:i})};if(u!=null&&(typeof u=="boolean"?!u&&e===s&&(w=!1):w=x(u)),w&&h!=null&&(typeof h=="boolean"?!h&&b&&(w=!1):w=x(h)),w&&f!=null&&(typeof f=="boolean"?!f&&ts.isEdgeView(y)&&(w=!1):w=x(f)),w&&d!=null&&b==null&&(typeof d=="boolean"?!d&&wn.isNodeView(y)&&(w=!1):w=x(d)),w&&p!=null&&o){const S=o.cell,v=i==="source"?a:S.getSource(),E=i==="target"?a:S.getTarget(),C=a?this.graph.getCellById(a.cell):null;if(v&&E&&v.cell&&E.cell&&C)if(typeof p=="function")w=x(p);else{const O=this.graph.model.getConnectedEdges(C,{outgoing:i==="source",incoming:i==="target"});O.length&&(p==="withPort"?O.some(k=>{const _=k.getSource(),V=k.getTarget();return _&&V&&_.cell===v.cell&&V.cell===E.cell&&_.port!=null&&_.port===v.port&&V.port!=null&&V.port===E.port})&&(w=!1):p||O.some(k=>{const _=k.getSource(),V=k.getTarget();return _&&V&&_.cell===v.cell&&V.cell===E.cell})&&(w=!1))}}return w&&g!=null&&(w=x(g)),w}allowConnectToBlank(e){const t=this.graph,r=t.options.connecting.allowBlank;if(typeof r!="function")return!!r;const i=t.findViewByCell(e),o=e.getSourceCell(),a=e.getTargetCell(),c=t.findViewByCell(o),u=t.findViewByCell(a);return se(r,t,{edge:e,edgeView:i,sourceCell:o,targetCell:a,sourceView:c,targetView:u,sourcePort:e.getSourcePortId(),targetPort:e.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(e,t,s){const r=this.graph;if(!this.allowConnectToBlank(e)){const o=e.getSourceCellId(),a=e.getTargetCellId();if(!(o&&a))return!1}const i=r.options.connecting.validateEdge;return i?se(i,r,{edge:e,type:t,previous:s}):!0}arrowheadDragging(e,t,s,r){r.x=t,r.y=s,r.currentTarget!==e&&(r.currentMagnet&&r.currentView&&r.currentView.unhighlight(r.currentMagnet,{type:"magnetAdsorbed"}),r.currentView=this.graph.findViewByElem(e),r.currentView?(r.currentMagnet=r.currentView.findMagnet(e),r.currentMagnet&&this.validateConnection(...r.getValidateConnectionArgs(r.currentView,r.currentMagnet),r.currentView.getEdgeTerminal(r.currentMagnet,t,s,this.cell,r.terminalType))?r.currentView.highlight(r.currentMagnet,{type:"magnetAdsorbed"}):r.currentMagnet=null):r.currentMagnet=null),r.currentTarget=e,this.cell.prop(r.terminalType,{x:t,y:s},Object.assign(Object.assign({},r.options),{ui:!0}))}arrowheadDragged(e,t,s){const r=e.currentView,i=e.currentMagnet;if(!i||!r)return;r.unhighlight(i,{type:"magnetAdsorbed"});const o=e.terminalType,a=r.getEdgeTerminal(i,t,s,this.cell,o);this.cell.setTerminal(o,a,{ui:!0})}snapArrowhead(e,t,s){const r=this.graph,{snap:i,allowEdge:o}=r.options.connecting,a=typeof i=="object"&&i.radius||50,c=typeof i=="object"&&i.anchor||"center",u=r.renderer.findViewsInArea({x:e-a,y:t-a,width:2*a,height:2*a},{nodeOnly:!0});if(o){const S=r.renderer.findEdgeViewsFromPoint({x:e,y:t},a).filter(v=>v!==this);u.push(...S)}const d=s.closestView||null,f=s.closestMagnet||null;s.closestView=null,s.closestMagnet=null;let h,p=Number.MAX_SAFE_INTEGER;const g=new M(e,t);u.forEach(S=>{if(S.container.getAttribute("magnet")!=="false"){if(S.isNodeView())h=c==="center"?S.cell.getBBox().getCenter().distance(g):S.cell.getBBox().getNearestPointToPoint(g).distance(g);else if(S.isEdgeView()){const v=S.getClosestPoint(g);v?h=v.distance(g):h=Number.MAX_SAFE_INTEGER}h<a&&h<p&&(f===S.container||this.validateConnection(...s.getValidateConnectionArgs(S,null),S.getEdgeTerminal(S.container,e,t,this.cell,s.terminalType)))&&(p=h,s.closestView=S,s.closestMagnet=S.container)}S.container.querySelectorAll("[magnet]").forEach(v=>{if(v.getAttribute("magnet")!=="false"){const E=S.getBBoxOfElement(v);h=g.distance(E.getCenter()),h<a&&h<p&&(f===v||this.validateConnection(...s.getValidateConnectionArgs(S,v),S.getEdgeTerminal(v,e,t,this.cell,s.terminalType)))&&(p=h,s.closestView=S,s.closestMagnet=v)}})});let m;const y=s.terminalType,b=s.closestView,w=s.closestMagnet,x=f!==w;if(d&&x&&d.unhighlight(f,{type:"magnetAdsorbed"}),b){if(!x)return;b.highlight(w,{type:"magnetAdsorbed"}),m=b.getEdgeTerminal(w,e,t,this.cell,y)}else m={x:e,y:t};this.cell.setTerminal(y,m,{},Object.assign(Object.assign({},s.options),{ui:!0}))}snapArrowheadEnd(e){const t=e.closestView,s=e.closestMagnet;t&&s&&(t.unhighlight(s,{type:"magnetAdsorbed"}),e.currentMagnet=t.findMagnet(s)),e.closestView=null,e.closestMagnet=null}finishEmbedding(e){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(e.zIndex=null)}fallbackConnection(e){switch(e.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(e.terminalType,e.initialTerminal,{ui:!0});break}}notifyConnectionEvent(e,t){const s=e.terminalType,r=e.initialTerminal,i=this.cell[s];if(i&&!$e.equalTerminals(r,i)){const a=this.graph,c=r,u=c.cell?a.getCellById(c.cell):null,d=c.port,f=u?a.findViewByCell(u):null,h=u||e.isNewEdge?null:M.create(r).toJSON(),p=i,g=p.cell?a.getCellById(p.cell):null,m=p.port,y=g?a.findViewByCell(g):null,b=g?null:M.create(i).toJSON();this.notify("edge:connected",{e:t,previousCell:u,previousPort:d,previousView:f,previousPoint:h,currentCell:g,currentView:y,currentPort:m,currentPoint:b,previousMagnet:e.initialMagnet,currentMagnet:e.currentMagnet,edge:this.cell,view:this,type:s,isNew:e.isNewEdge})}}highlightAvailableMagnets(e){const t=this.graph,s=t.model.getCells();e.marked={};for(let r=0,i=s.length;r<i;r+=1){const o=t.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 c=a.filter(u=>this.validateConnection(...e.getValidateConnectionArgs(o,u),o.getEdgeTerminal(u,e.x,e.y,this.cell,e.terminalType)));if(c.length>0){for(let u=0,d=c.length;u<d;u+=1)o.highlight(c[u],{type:"magnetAvailable"});o.highlight(null,{type:"nodeAvailable"}),e.marked[o.cell.id]=c}}}unhighlightAvailableMagnets(e){const t=e.marked||{};Object.keys(t).forEach(s=>{const r=this.graph.findViewByCell(s);r&&(t[s].forEach(o=>{r.unhighlight(o,{type:"magnetAvailable"})}),r.unhighlight(null,{type:"nodeAvailable"}))}),e.marked=null}startArrowheadDragging(e,t,s){if(!this.can("arrowheadMovable")){this.notifyUnhandledMouseDown(e,t,s);return}const i=e.target.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(i,{x:t,y:s});this.setEventData(e,o)}dragArrowhead(e,t,s){const r=this.getEventData(e);this.graph.options.connecting.snap?this.snapArrowhead(t,s,r):this.arrowheadDragging(this.getEventTarget(e),t,s,r)}stopArrowheadDragging(e,t,s){const r=this.graph,i=this.getEventData(e);r.options.connecting.snap?this.snapArrowheadEnd(i):this.arrowheadDragged(i,t,s),this.validateEdge(this.cell,i.terminalType,i.initialTerminal)?(this.finishEmbedding(i),this.notifyConnectionEvent(i,e)):this.fallbackConnection(i),this.afterArrowheadDragging(i)}startLabelDragging(e,t,s){if(this.can("edgeLabelMovable")){const r=e.currentTarget,i=parseInt(r.getAttribute("data-index"),10),o=this.getLabelPositionAngle(i),a=this.getLabelPositionArgs(i),c=this.getDefaultLabelPositionArgs(),u=this.mergeLabelPositionArgs(a,c);this.setEventData(e,{index:i,positionAngle:o,positionArgs:u,stopPropagation:!0,action:"drag-label"})}else this.setEventData(e,{stopPropagation:!0});this.graph.view.delegateDragEvents(e,this)}dragLabel(e,t,s){const r=this.getEventData(e),i=this.cell.getLabelAt(r.index),o=Ye({},i,{position:this.getLabelPosition(t,s,r.positionAngle,r.positionArgs)});this.cell.setLabelAt(r.index,o)}stopLabelDragging(e,t,s){}}(function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag],r=t;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=e})(ts||(ts={})),ts.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"]}}),ts.registry.register("edge",ts,!0);var QB=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Vn extends be{get disposeContainer(){return!1}get options(){return this.graph.options}constructor(e){super(),this.graph=e;const{selectors:t,fragment:s}=De.parseJSONMarkup(Vn.markup);this.background=t.background,this.grid=t.grid,this.svg=t.svg,this.defs=t.defs,this.viewport=t.viewport,this.primer=t.primer,this.stage=t.stage,this.decorator=t.decorator,this.overlay=t.overlay,this.container=this.options.container,this.restore=Vn.snapshoot(this.container),ee(this.container,this.prefixClassName("graph")),Lt(this.container,s),this.delegateEvents()}delegateEvents(){const e=this.constructor;return super.delegateEvents(e.events),this}guard(e,t){return e.type==="mousedown"&&e.button===2||this.options.guard&&this.options.guard(e,t)?!0:e.data&&e.data.guarded!==void 0?e.data.guarded:!(t&&t.cell&&ge.isCell(t.cell)||this.svg===e.target||this.container===e.target||this.svg.contains(e.target))}findView(e){return this.graph.findViewByElem(e)}onDblClick(e){this.options.preventDefaultDblClick&&e.preventDefault();const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onDblClick(t,r.x,r.y):this.graph.trigger("blank:dblclick",{e:t,x:r.x,y:r.y})}onClick(e){if(this.getMouseMovedCount(e)<=this.options.clickThreshold){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onClick(t,r.x,r.y):this.graph.trigger("blank:click",{e:t,x:r.x,y:r.y})}}isPreventDefaultContextMenu(e){let t=this.options.preventDefaultContextMenu;return typeof t=="function"&&(t=se(t,this.graph,{view:e})),t}onContextMenu(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.isPreventDefaultContextMenu(s)&&e.preventDefault(),this.guard(t,s))return;const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onContextMenu(t,r.x,r.y):this.graph.trigger("blank:contextmenu",{e:t,x:r.x,y:r.y})}delegateDragEvents(e,t){e.data==null&&(e.data={}),this.setEventData(e,{currentView:t||null,mouseMovedCount:0,startPosition:{x:e.clientX,y:e.clientY}});const s=this.constructor;this.delegateDocumentEvents(s.documentEvents,e.data),this.undelegateEvents()}getMouseMovedCount(e){return this.getEventData(e).mouseMovedCount||0}onMouseDown(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;this.options.preventDefaultMouseDown&&e.preventDefault();const r=this.graph.snapToGrid(t.clientX,t.clientY);s?s.onMouseDown(t,r.x,r.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(t.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:t,x:r.x,y:r.y})),this.delegateDragEvents(t,s)}onMouseMove(e){const t=this.getEventData(e),s=t.startPosition;if(s&&s.x===e.clientX&&s.y===e.clientY||(t.mouseMovedCount==null&&(t.mouseMovedCount=0),t.mouseMovedCount+=1,t.mouseMovedCount<=this.options.moveThreshold))return;const i=this.normalizeEvent(e),o=this.graph.snapToGrid(i.clientX,i.clientY),a=t.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,t)}onMouseUp(e){this.undelegateDocumentEvents();const t=this.normalizeEvent(e),s=this.graph.snapToGrid(t.clientX,t.clientY),i=this.getEventData(e).currentView;if(i?i.onMouseUp(t,s.x,s.y):this.graph.trigger("blank:mouseup",{e:t,x:s.x,y:s.y}),!e.isPropagationStopped()){const o=new Tn(e,{type:"click",data:e.data});this.onClick(o)}e.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOver(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseover",{e:t})}}onMouseOut(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(!this.guard(t,s))if(s)s.onMouseOut(t);else{if(this.container===t.target)return;this.graph.trigger("blank:mouseout",{e:t})}}onMouseEnter(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseEnter(t)}else{if(r)return;this.graph.trigger("graph:mouseenter",{e:t})}}onMouseLeave(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=this.graph.findViewByElem(t.relatedTarget);if(s){if(r===s)return;s.onMouseLeave(t)}else{if(r)return;this.graph.trigger("graph:mouseleave",{e:t})}}onMouseWheel(e){const t=this.normalizeEvent(e),s=this.findView(t.target);if(this.guard(t,s))return;const r=t.originalEvent,i=this.graph.snapToGrid(r.clientX,r.clientY),o=Math.max(-1,Math.min(1,r.wheelDelta||-r.detail));s?s.onMouseWheel(t,i.x,i.y,o):this.graph.trigger("blank:mousewheel",{e:t,delta:o,x:i.x,y:i.y})}onCustomEvent(e){const t=e.currentTarget,s=t.getAttribute("event")||t.getAttribute("data-event");if(s){const r=this.findView(t);if(r){const i=this.normalizeEvent(e);if(this.guard(i,r))return;const o=this.graph.snapToGrid(i.clientX,i.clientY);r.onCustomEvent(i,s,o.x,o.y)}}}handleMagnetEvent(e,t){const s=e.currentTarget,r=s.getAttribute("magnet");if(r&&r.toLowerCase()!=="false"){const i=this.findView(s);if(i){const o=this.normalizeEvent(e);if(this.guard(o,i))return;const a=this.graph.snapToGrid(o.clientX,o.clientY);se(t,this.graph,i,o,s,a.x,a.y)}}}onMagnetMouseDown(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetMouseDown(s,r,i,o)})}onMagnetDblClick(e){this.handleMagnetEvent(e,(t,s,r,i,o)=>{t.onMagnetDblClick(s,r,i,o)})}onMagnetContextMenu(e){const t=this.findView(e.target);this.isPreventDefaultContextMenu(t)&&e.preventDefault(),this.handleMagnetEvent(e,(s,r,i,o,a)=>{s.onMagnetContextMenu(r,i,o,a)})}onLabelMouseDown(e){const t=e.currentTarget,s=this.findView(t);if(s){const r=this.normalizeEvent(e);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=()=>{}}}QB([be.dispose()],Vn.prototype,"dispose",null),function(n){const e=`${Jt.prefixCls}-graph`;n.markup=[{ns:it.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:it.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:it.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":it.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}];function t(s){const r=s.cloneNode();return s.childNodes.forEach(i=>r.appendChild(i)),()=>{for(eo(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=t}(Vn||(Vn={})),function(n){const e=Jt.prefixCls;n.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},n.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(Vn||(Vn={}));const e3=`.x6-graph {
124
124
  position: relative;
125
125
  overflow: hidden;
126
126
  outline: none;
@@ -279,7 +279,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
279
279
  border: 1px solid #275fc5;
280
280
  border-radius: 2px;
281
281
  }
282
- `;class lt extends wt{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var t3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class yd extends lt{init(){qr("core",e3)}dispose(){Xr("core")}}t3([yd.dispose()],yd.prototype,"dispose",null);var n3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},xo;(function(n){function e(t){const{grid:s,panning:r,mousewheel:i,embedding:o}=t,a=n3(t,["grid","panning","mousewheel","embedding"]),c=t.container;if(c!=null)a.width==null&&(a.width=c.clientWidth),a.height==null&&(a.height=c.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=Ye({},n.defaults,a),d={size:10,visible:!1};return typeof s=="number"?u.grid={size:s,visible:!1}:typeof s=="boolean"?u.grid=Object.assign(Object.assign({},d),{visible:s}):u.grid=Object.assign(Object.assign({},d),s),["panning","mousewheel","embedding"].forEach(h=>{const p=t[h];typeof p=="boolean"?u[h].enabled=p:u[h]=Object.assign(Object.assign({},u[h]),p)}),u}n.get=e})(xo||(xo={})),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:Jt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Jt.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:e,sourceView:t,targetView:s}){return(e==="target"?s:t)!=null},createEdge(){return new qB}},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}}(xo||(xo={}));var s3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},r3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class bd extends lt{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(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const s=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(e)?e:[e];this.patterns.forEach((c,u)=>{const d=`pattern_${u}`,f=s.a||1,h=s.d||1,{update:p,markup:g}=c,m=r3(c,["update","markup"]),y=Object.assign(Object.assign(Object.assign({},m),i[u]),{sx:f,sy:h,ox:s.e||0,oy:s.f||0,width:t*f,height:t*h});r.has(d)||r.add(d,oe.create("pattern",{id:d,patternUnits:"userSpaceOnUse"},oe.createVectors(g)).node);const b=r.get(d);typeof p=="function"&&p(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),pe(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 Ss),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Ss.presets.dot),e.args)];const s=Ss.registry.get(t);if(s){let r=e.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 Ss.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}s3([lt.dispose()],bd.prototype,"dispose",null);class qb extends lt{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 e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),ot(this.viewportMatrix)}setMatrix(e){const t=ot(e),s=Wr(t);this.viewport.setAttribute("transform",s),this.viewportMatrix=t,this.viewportTransformString=s}resize(e,t){let s=e===void 0?this.options.width:e,r=t===void 0?this.options.height:t;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 e=this.options.width,t=this.options.height;return Rc(e)||(e=this.container.clientWidth),Rc(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return hR(this.getMatrix())}scale(e,t=e,s=0,r=0){if(e=this.clampScale(e),t=this.clampScale(t),s||r){const o=this.getTranslation(),a=o.tx-s*(e-1),c=o.ty-r*(t-1);(a!==o.tx||c!==o.ty)&&this.translate(a,c)}const i=this.getMatrix();return i.a=e,i.d=t,this.setMatrix(i),this.graph.trigger("scale",{sx:e,sy:t,ox:s,oy:r}),this}clampScale(e){const t=this.graph.options.scaling;return Ct(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let s=e,r=e;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,c=o.height/2;if(t.absolute||(s+=i.sx,r+=i.sy),t.scaleGrid&&(s=Math.round(s/t.scaleGrid)*t.scaleGrid,r=Math.round(r/t.scaleGrid)*t.scaleGrid),t.maxScale&&(s=Math.min(t.maxScale,s),r=Math.min(t.maxScale,r)),t.minScale&&(s=Math.max(t.minScale,s),r=Math.max(t.minScale,r)),t.center&&(a=t.center.x,c=t.center.y),s=this.clampScale(s),r=this.clampScale(r),a||c){const u=this.getTranslation(),d=a-(a-u.tx)*(s/i.sx),f=c-(c-u.ty)*(r/i.sy);(d!==u.tx||f!==u.ty)&&this.translate(d,f)}return this.scale(s,r),this}getRotation(){return fR(this.getMatrix())}rotate(e,t,s){if(t==null||s==null){const i=Ee.getBBox(this.stage);t=i.width/2,s=i.height/2}const r=this.getMatrix().translate(t,s).rotate(e).translate(-t,-s);return this.setMatrix(r),this}getTranslation(){return pR(this.getMatrix())}translate(e,t){const s=this.getMatrix();s.e=e||0,s.f=t||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(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,s,r){if(typeof e=="object"){const x=e;e=x.gridWidth||1,t=x.gridHeight||1,s=x.padding||0,r=x}else e=e||1,t=t||1,s=s||0,r==null&&(r={});const i=ys(s),o=r.border||0,a=r.contentArea?G.create(r.contentArea):this.getContentArea(r);o>0&&a.inflate(o);const c=this.getScale(),u=this.getTranslation(),d=c.sx,f=c.sy;a.x*=d,a.y*=f,a.width*=d,a.height*=f;let h=Math.max(Math.ceil((a.width+a.x)/e),1)*e,p=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,m=0;(r.allowNewOrigin==="negative"&&a.x<0||r.allowNewOrigin==="positive"&&a.x>=0||r.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=i.left,h+=g),(r.allowNewOrigin==="negative"&&a.y<0||r.allowNewOrigin==="positive"&&a.y>=0||r.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/t)*t,m+=i.top,p+=m),h+=i.right,p+=i.bottom,h=Math.max(h,r.minWidth||0),p=Math.max(p,r.minHeight||0),h=Math.min(h,r.maxWidth||Number.MAX_SAFE_INTEGER),p=Math.min(p,r.maxHeight||Number.MAX_SAFE_INTEGER);const y=this.getComputedSize(),b=h!==y.width||p!==y.height;return(g!==u.tx||m!==u.ty)&&this.translate(g,m),b&&this.resize(h,p),new G(-g/d,-m/f,h/d,p/f)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let s,r;if(e.contentArea){const b=e.contentArea;s=this.graph.localToGraph(b),r=M.create(b)}else s=this.getContentBBox(e),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=ys(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,c=e.minScaleX||o,u=e.maxScaleX||a,d=e.minScaleY||o,f=e.maxScaleY||a;let h;if(e.viewportArea)h=e.viewportArea;else{const b=this.getComputedSize(),w=this.getTranslation();h={x:w.tx,y:w.ty,width:b.width,height:b.height}}h=G.create(h).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const p=this.getScale();let g=h.width/s.width*p.sx,m=h.height/s.height*p.sy;e.preserveAspectRatio!==!1&&(g=m=Math.min(g,m));const y=e.scaleGrid;if(y&&(g=y*Math.floor(g/y),m=y*Math.floor(m/y)),g=Ct(g,c,u),m=Ct(m,d,f),this.scale(g,m),t){const b=this.options,w=h.x-r.x*g-b.x,x=h.y-r.y*m-b.y;this.translate(w,x)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new G:Ee.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=G.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const s=G.create(e),r=this.graph;t.contentArea=s,t.viewportArea==null&&(t.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const i=s.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const s=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=s.width/2,a=s.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*r.sx,t=a-t*r.sy,(i.tx!==e||i.ty!==t)&&this.translate(e,t)}centerContent(e){const s=this.graph.getContentArea(e).getCenter();this.centerPoint(s.x,s.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,s){const r=this.getComputedSize();t=gn(t,Math.max(0,r.width)),t<0&&(t=r.width+t),s=gn(s,Math.max(0,r.height)),s<0&&(s=r.height+s);const i=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,c=s-e.y*o.sy;(i.tx!==a||i.ty!==c)&&this.translate(a,c)}positionRect(e,t){const s=G.create(e);switch(t){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(e,t){const s=e.getBBox();return this.positionRect(s,t)}positionContent(e,t){const s=this.graph.getContentArea(t);return this.positionRect(s,e)}}var i3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class wd extends lt{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(e={}){let t=e.size||"auto auto",s=e.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 t=="object"&&(t=G.fromSize(t).scale(r.sx,r.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=s}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const s=this.optionsCache;if(s&&s.image!==t.image)return;let r;const i=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const c=uo.registry.get(a);if(typeof c=="function"){const d=t.quality||1;e.width*=d,e.height*=d;const f=c(e,t);if(!(f instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=f.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=f.width/e.width,o.height*=f.height/e.height):o===void 0&&(t.size={width:f.width/d,height:f.height/d})}else r=e.src,o===void 0&&(t.size={width:e.width,height:e.height});s!=null&&typeof t.size=="object"&&t.image===s.image&&t.repeat===s.repeat&&t.quality===s.quality&&(s.size=Pc(t.size));const u=this.elem.style;u.backgroundImage=`url(${r})`,u.backgroundRepeat=a,u.opacity=i==null||i>=1?"":`${i}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Pc(t);const s=document.createElement("img");s.onload=()=>this.drawBackgroundImage(s,e),s.setAttribute("crossorigin","anonymous"),s.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}i3([lt.dispose()],wd.prototype,"dispose",null);var o3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class xd extends lt{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),dt.on(this.graph.container,"mousedown",this.onRightMouseDown),dt.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new zy(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),dt.off(this.graph.container,"mousedown",this.onRightMouseDown),dt.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&vs.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),dt.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)}),dt.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),s=t.clientX-this.clientX,r=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(s,r)}stopPanning(e){this.panning=!1,this.updateClassName(),dt.off(document.body,".panning"),dt.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),s=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(ee(e,t),Ie(e,s)):(Ie(e,t),ee(e,s)):(Ie(e,t),Ie(e,s))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.getPlugin("selection"),s=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!s)&&this.startPanning(e)}onRightMouseDown(e){const t=this.widgetOptions.eventTypes;t!=null&&t.includes("rightMouseDown")&&e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,s){this.graph.translateBy(-t,-s)}onSpaceKeyDown(e){e.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(e){e.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(e){const t=this.widgetOptions.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&((t=this.widgetOptions.eventTypes)===null||t===void 0?void 0:t.includes("mouseWheel"))}autoPanning(e,t){const r=this.graph.getGraphArea();let i=0,o=0;e<=r.left+10&&(i=-10),t<=r.top+10&&(o=-10),e>=r.right-10&&(i=10),t>=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()}}o3([lt.dispose()],xd.prototype,"dispose",null);var a3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class vd extends lt{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 zy(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&vs.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&vs.isMatch(e,this.widgetOptions.modifiers)){const s=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.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,c=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=Ct(o,a,c),o!==i)if(this.widgetOptions.zoomAtMousePosition){const d=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:d.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}a3([wt.dispose()],vd.prototype,"dispose",null);var l3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Xb extends lt{init(){this.resetRenderArea=XP(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 e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}l3([lt.dispose()],Xb.prototype,"dispose",null);class c3{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&ns.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}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 e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,s=this.queue.length,r=s-1;const i=e.priority;for(;t<=r;){const o=(r-t>>1)+t;i<=this.queue[o].priority?t=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 ns;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(ns||(ns={}));var u3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class st extends wt{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new c3,this.graph=e,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:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(s=>s.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const s=this.views[e.id];s&&this.requestViewUpdate(s.view,st.FLAG_INSERT,t,ns.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,s={},r=ns.Update,i=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=s,(e.hasAction(t,["translate","resize","rotate"])||s.async===!1)&&(r=ns.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(e,t,s);const d=s.queue;if(d){const f=d.indexOf(e.cell.id);f>=0&&d.splice(f,1),d.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(d=>{this.requestViewUpdate(d.view,d.flag,s,r,!1)}),i&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===st.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((s,r)=>s.isNode()&&r.isEdge()?-1:0),e.forEach(s=>{const r=s.id,i=this.views;let o=0,a=i[r];if(a)o=st.FLAG_INSERT;else{const c=this.createCellView(s);c&&(c.graph=this.graph,o=st.FLAG_INSERT|c.getBootstrapFlag(),a={view:c,flag:o,options:t,state:st.ViewState.CREATED},this.views[r]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,s={}){const r=e.cell,i=r.id,o=this.views[i];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,s),o.flag=a):o.state===st.ViewState.MOUNTED?(a=this.updateView(e,t,s),o.flag=a):o.state=st.ViewState.WAITING,a&&r.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:ns.RenderEdge,cb:()=>{this.updateView(e,t,s)}})}removeViews(e){e.forEach(t=>{const s=t.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(e=>{if(e&&e.state===st.ViewState.WAITING){const{view:t,flag:s,options:r}=e;this.requestViewUpdate(t,s,r,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,s={}){if(e==null)return 0;if(He.isCellView(e)){if(t&st.FLAG_REMOVE)return this.removeView(e.cell),0;t&st.FLAG_INSERT&&(this.insertView(e),t^=st.FLAG_INSERT)}return t?e.confirmUpdate(t,s):0}insertView(e){const t=this.views[e.cell.id];if(t){const s=e.cell.getZIndex(),r=this.addZPivot(s);this.container.insertBefore(e.container,r),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=st.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,s=this.willRemoveViews[t.id];s&&e&&(s.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const s=this.model.getConnectedEdges(e);for(let i=0,o=s.length;i<o;i+=1){const a=s[i];if(t){const c=a.getSourceCell(),u=a.getTargetCell();if(c&&!c.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const r=this.views[e.id];r&&Je(r.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let s=t[e];if(s)return s;s=t[e]=document.createComment(`z-index:${e+1}`);let r=-1/0;for(const o in t){const a=+o;a<e&&a>r&&(r=a,e-1)}const i=this.container;if(r!==-1/0){const o=t[r];i.insertBefore(s,o.nextSibling)}else i.insertBefore(s,i.firstChild);return s}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},s=this.graph.options.createCellView;if(s){const i=se(s,this.graph,e);if(i)return new i(e,t);if(i===null)return null}const r=e.view;if(r!=null&&typeof r=="string"){const i=He.registry.get(r);return i?new i(e,t):He.registry.onNotFound(r)}return e.isNode()?new wn(e,t):e.isEdge()?new ts(e,t):null}getEffectedEdges(e){const t=[],s=e.cell,r=this.model.getConnectedEdges(s);for(let i=0,o=r.length;i<o;i+=1){const a=r[i],c=this.views[a.id];if(!c)continue;const u=c.view;if(!this.isViewMounted(u))continue;const d=["update"];a.getTargetCell()===s&&d.push("target"),a.getSourceCell()===s&&d.push("source"),t.push({id:a.id,view:u,flag:u.getFlag(d)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,s=t.getSourceCell(),r=t.getTargetCell();if(this.renderArea&&s&&r)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?ns.RenderNode:ns.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}u3([wt.dispose()],st.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(st||(st={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(st||(st={}));var d3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Cd extends lt{constructor(){super(...arguments),this.schedule=new st(this.graph)}requestViewUpdate(e,t,s={}){this.schedule.requestViewUpdate(e,t,s)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,s=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[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(e){if(e==null)return null;const t=ge.isCell(e)?e.id:e,s=this.schedule.views;return s[t]?s[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>s!=null?Ee.getBBox(s.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(s=>this.findViewByCell(s)).filter(s=>{if(s!=null){const r=s.getClosestPoint(e);if(r)return r.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const s=G.create(e);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(t.nodeOnly&&!r.isNodeView())return!1;const i=Ee.getBBox(r.container,{target:this.view.stage});return i.width===0?i.inflate(1,0):i.height===0&&i.inflate(0,1),t.strict?s.containsRect(i):s.isIntersectWithRect(i)}return!1})}dispose(){this.schedule.dispose()}}d3([lt.dispose()],Cd.prototype,"dispose",null);var Jb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Kb extends lt{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const s=e.name;if(t||(t=`filter-${s}-${this.cid}-${$u(JSON.stringify(e))}`),!this.isDefined(t)){const r=Zr.registry.get(s);if(r==null)return Zr.registry.onNotFound(s);const i=r(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});oe.create(De.sanitize(i),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const s=e.type;if(t||(t=`gradient-${s}-${this.cid}-${$u(JSON.stringify(e))}`),!this.isDefined(t)){const i=e.stops.map(c=>{const u=c.opacity!=null&&Number.isFinite(c.opacity)?c.opacity:1;return`<stop offset="${c.offset}" stop-color="${c.color}" stop-opacity="${u}"/>`}),o=`<${s}>${i.join("")}</${s}>`,a=Object.assign({id:t},e.attrs);oe.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:s,refY:r,markerUnits:i,markerOrient:o,tagName:a,children:c}=e,u=Jb(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=t;if(d||(d=`marker-${this.cid}-${$u(JSON.stringify(e))}`),!this.isDefined(d)){a!=="path"&&delete u.d;const f=oe.create("marker",{refX:s,refY:r,id:d,overflow:"visible",orient:o??"auto",markerUnits:i||"userSpaceOnUse"},c?c.map(h=>{var{tagName:p}=h,g=Jb(h,["tagName"]);return oe.create(`${p}`||"path",to(Object.assign(Object.assign({},u),g)))}):[oe.create(a||"path",to(u))]);this.defs.appendChild(f.node)}return d}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Zb extends lt{getClientMatrix(){return ot(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new M(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.graph.matrix())}localToClientPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.getClientMatrix())}localToPageRect(e,t,s,r){return(typeof e=="number"?this.localToGraphRect(e,t,s,r):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const r=M.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var h3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Ml extends lt{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:e,magnet:t,options:s={}}){const r=this.resolveHighlighter(s);if(!r)return;const i=this.getHighlighterId(t,r);if(!this.highlights[i]){const o=r.highlighter;o.highlight(e,t,Object.assign({},r.args)),this.highlights[i]={cellView:e,magnet:t,highlighter:o,args:r.args}}}onCellUnhighlight({magnet:e,options:t={}}){const s=this.resolveHighlighter(t);if(!s)return;const r=this.getHighlighterId(e,s);this.unhighlight(r)}resolveHighlighter(e){const t=this.options;let s=e.highlighter;if(s==null){const a=e.type;s=a&&t.highlighting[a]||t.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(e,t){return Hu(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}h3([Ml.dispose()],Ml.prototype,"dispose",null);var f3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Qb extends lt{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&il.bind(t,()=>{const s=t.offsetWidth,r=t.offsetHeight;this.resize(s,r)})}}resize(e,t){const s=this.getScroller();s?s.resize(e,t):this.graph.transform.resize(e,t)}dispose(){il.clear(this.graph.container)}}f3([lt.dispose()],Qb.prototype,"dispose",null);var p3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class $ extends Ve{get container(){return this.options.container}get[Symbol.toStringTag](){return $.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=xo.get(e),this.css=new yd(this),this.view=new Vn(this),this.defs=new Kb(this),this.coord=new Zb(this),this.transform=new qb(this),this.highlight=new Ml(this),this.grid=new bd(this),this.background=new wd(this),this.options.model?this.model=this.options.model:(this.model=new nt,this.model.graph=this),this.renderer=new Cd(this),this.panning=new xd(this),this.mousewheel=new vd(this),this.virtualRender=new Xb(this),this.size=new Qb(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(s=>Ge.isNode(s)?s:this.createNode(s)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(s=>$e.isEdge(s)?s:this.createEdge(s)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,s={}){return this.model.isNeighbor(e,t,s)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,s={}){return this.model.isSuccessor(e,t,s)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,s={}){return this.model.isPredecessor(e,t,s)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,s,r,i){return this.model.getNodesInArea(e,t,s,r,i)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,s={}){return this.model.search(e,t,s),this}getShortestPath(e,t,s={}){return this.model.getShortestPath(e,t,s)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,s){const r=typeof e=="string"?e:"update",i=typeof e=="string"?t:e,o=typeof t=="function"?s:t;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return ge.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return G.isRectangleLike(e)?this.findViewsInArea(e):M.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(s)}findViewsInArea(e,t,s,r,i){const o=typeof e=="number"?{x:e,y:t,width:s,height:r}:e,a=typeof e=="number"?i:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e>"u"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const s=this.getPlugin("scroller");return s?s.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,s=0,r=0){return typeof e>"u"?this.transform.getScale():(this.transform.scale(e,t,s,r),this)}zoom(e,t){const s=this.getPlugin("scroller");if(s){if(typeof e>"u")return s.zoom();s.zoom(e,t)}else{if(typeof e>"u")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const s=this.getPlugin("scroller");return s?s.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const s=this.getPlugin("scroller");return s?s.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,s){return typeof e>"u"?this.transform.getRotation():(this.transform.rotate(e,t,s),this)}translate(e,t){return typeof e>"u"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const s=this.translate(),r=s.tx+e,i=s.ty+t;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,s,r){return this.transform.fitToContent(e,t,s,r)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,s){const r=this.getPlugin("scroller");return r?r.centerPoint(e,t,s):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const s=this.getPlugin("scroller");return s?s.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,s,r={}){const i=this.getPlugin("scroller");return i?i.positionPoint(e,t,s,r):this.transform.positionPoint(e,t,s),this}positionRect(e,t,s){const r=this.getPlugin("scroller");return r?r.positionRect(e,t,s):this.transform.positionRect(e,t),this}positionCell(e,t,s){const r=this.getPlugin("scroller");return r?r.positionCell(e,t,s):this.transform.positionCell(e,t),this}positionContent(e,t){const s=this.getPlugin("scroller");return s?s.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,s,r){return G.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.pageToLocalRect(e,t,s,r):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,s,r){return G.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToPageRect(e,t,s,r):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,s,r){return G.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToLocalRect(e,t,s,r):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,s,r){return G.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToClientRect(e,t,s,r):this.coord.localToClientPoint(e,t)}localToGraph(e,t,s,r){return G.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToGraphRect(e,t,s,r):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,s,r){return G.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.graphToLocalRect(e,t,s,r):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,s,r){return G.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToGraphRect(e,t,s,r):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const s=this.getPlugin("scroller");return s!=null&&(this.options.background==null||!t)?s.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):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(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.enable)===null||i===void 0||i.call(r)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.disable)===null||i===void 0||i.call(r)}),this}isPluginEnabled(e){var t;const s=this.getPlugin(e);return(t=s==null?void 0:s.isEnabled)===null||t===void 0?void 0:t.call(s)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{r.dispose(),this.installedPlugins.delete(r)}),this}dispose(e=!0){e&&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(t=>{t.dispose()})}}p3([Ve.dispose()],$.prototype,"dispose",null),function(n){n.View=Vn,n.Renderer=Cd,n.MouseWheel=vd,n.DefsManager=Kb,n.GridManager=bd,n.CoordManager=Zb,n.TransformManager=qb,n.HighlightManager=Ml,n.BackgroundManager=wd,n.PanningManager=xd}($||($={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag];return s==null||s===n.toStringTag}n.isGraph=e}($||($={})),function(n){function e(t,s){const r=t instanceof HTMLElement?new n({container:t}):new n(t);return s!=null&&r.fromJSON(s),r}n.render=e}($||($={})),function(n){n.registerNode=Ge.registry.register,n.registerEdge=$e.registry.register,n.registerView=He.registry.register,n.registerAttr=kn.registry.register,n.registerGrid=Ss.registry.register,n.registerFilter=Zr.registry.register,n.registerNodeTool=ni.registry.register,n.registerEdgeTool=si.registry.register,n.registerBackground=uo.registry.register,n.registerHighlighter=Qn.registry.register,n.registerPortLayout=or.registry.register,n.registerPortLabelLayout=ei.registry.register,n.registerMarker=Ms.registry.register,n.registerRouter=Ts.registry.register,n.registerConnector=ar.registry.register,n.registerAnchor=ri.registry.register,n.registerEdgeAnchor=ii.registry.register,n.registerConnectionPoint=oi.registry.register}($||($={})),function(n){n.unregisterNode=Ge.registry.unregister,n.unregisterEdge=$e.registry.unregister,n.unregisterView=He.registry.unregister,n.unregisterAttr=kn.registry.unregister,n.unregisterGrid=Ss.registry.unregister,n.unregisterFilter=Zr.registry.unregister,n.unregisterNodeTool=ni.registry.unregister,n.unregisterEdgeTool=si.registry.unregister,n.unregisterBackground=uo.registry.unregister,n.unregisterHighlighter=Qn.registry.unregister,n.unregisterPortLayout=or.registry.unregister,n.unregisterPortLabelLayout=ei.registry.unregister,n.unregisterMarker=Ms.registry.unregister,n.unregisterRouter=Ts.registry.unregister,n.unregisterConnector=ar.registry.unregister,n.unregisterAnchor=ri.registry.unregister,n.unregisterEdgeAnchor=ii.registry.unregister,n.unregisterConnectionPoint=oi.registry.unregister}($||($={}));var g3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},m3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class di extends Ge{}(function(n){class e extends wn{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,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const s=this.selectors&&this.selectors.foContent;if(s){eo(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:Lt(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}g3([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),wn.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(di||(di={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},De.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ge.registry.register("html",n,!0)}(di||(di={})),function(n){n.shapeMaps={};function e(t){const{shape:s,html:r,effect:i,inherit:o}=t,a=m3(t,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},$.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(di||(di={}));var y3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class e0 extends be{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(e,t,s){super(),this.node=t,this.graph=s,this.options=Object.assign(Object.assign({},rt.defaultOptions),e),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 e=document.createElement("div");pe(e,"draggable","false");const t=e.cloneNode(!0);ee(t,this.rotateClassName);const s=rt.POSITIONS.map(r=>{const i=e.cloneNode(!0);return ee(i,this.resizeClassName),pe(i,"data-position",r),i});this.empty(),Lt(this.container,[...s,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(rt.NODE_CLS),ee(this.container,this.containerClassName),mn(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),mn(this.container,"no-resize",!this.options.resizable),mn(this.container,"no-rotate",!this.options.rotatable),this.options.className&&ee(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const s=ye.normalize(this.node.getAngle()),r=s!==0?`rotate(${s}deg)`:"";return Je(this.container,{transform:r,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(rt.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=ye.normalize(this.node.getAngle()),t=Math.floor(e*(rt.DIRECTIONS.length/360));if(t!==this.prevShift){const s=rt.DIRECTIONS.slice(t).concat(rt.DIRECTIONS.slice(0,t)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{Ie(o,rt.DIRECTIONS.map(c=>r(c)).join(" ")),ee(o,r(s[a]))}),this.prevShift=t}}getTrueDirection(e){const t=ye.normalize(this.node.getAngle());let s=rt.POSITIONS.indexOf(e);return s+=Math.floor(t*(rt.POSITIONS.length/360)),s%=rt.POSITIONS.length,rt.POSITIONS[s]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=pe(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const s=this.getTrueDirection(t);let r=0,i=0;t.split("-").forEach(u=>{r={left:-1,right:1}[u]||r,i={top:-1,bottom:1}[u]||i});const o=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],c=ye.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:o,trueDirection:s,relativeDirection:t,angle:c,resizeX:r,resizeY:i,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY);this.setEventData(e,{center:t,action:"rotating",angle:ye.normalize(this.node.getAngle()),start:M.create(r).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let s=this.getEventData(e);if(s.action){const r=this.normalizeEvent(e);let i=r.clientX,o=r.clientY;const a=this.graph.getPlugin("scroller"),c=this.options.restrictedResizing;if(c===!0||typeof c=="number"){const p=c===!0?0:c,g=a?Math.max(p,8):p,m=this.graph.container.getBoundingClientRect();i=Ct(i,m.left+g,m.right-g),o=Ct(o,m.top+g,m.bottom-g)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const u=this.graph.snapToGrid(i,o),d=this.graph.getGridSize(),f=this.node,h=this.options;if(s.action==="resizing"){s=s,s.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),s.resized=!0);const p=f.getBBox(),g=M.create(u).rotate(s.angle,p.getCenter()).diff(p[s.selector]);let m=s.resizeX?g.x*s.resizeX:p.width,y=s.resizeY?g.y*s.resizeY:p.height;const b=m,w=y;if(m=Se.snapToGrid(m,d),y=Se.snapToGrid(y,d),m=Math.max(m,h.minWidth||d),y=Math.max(y,h.minHeight||d),m=Math.min(m,h.maxWidth||1/0),y=Math.min(y,h.maxHeight||1/0),h.preserveAspectRatio){const v=p.width*y/p.height,C=p.height*m/p.width;m<v?y=C:m=v}const x=s.relativeDirection;if(h.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 C=v;this.stopHandle();const E=this.container.querySelector(`.${this.resizeClassName}[data-position="${C}"]`);this.startHandle(E),this.prepareResizing(e,C),this.onMouseMove(e)}if(p.width!==m||p.height!==y){const v={ui:!0,direction:s.direction,relativeDirection:s.relativeDirection,trueDirection:s.trueDirection,minWidth:h.minWidth,minHeight:h.minHeight,maxWidth:h.maxWidth,maxHeight:h.maxHeight,preserveAspectRatio:h.preserveAspectRatio===!0};f.resize(m,y,v),this.notify("node:resizing",e,t)}}else if(s.action==="rotating"){s=s,s.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),s.rotated=!0);const p=f.getAngle(),g=s.start-M.create(u).theta(s.center);let m=s.angle+g;h.rotateGrid&&(m=Se.snapToGrid(m,h.rotateGrid)),m=ye.normalize(m),p!==m&&(f.rotate(m,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch(t.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,ee(this.container,`${this.containerClassName}-active`),e){ee(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const s=rt.DIRECTIONS[rt.POSITIONS.indexOf(t)];ee(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(Ie(this.container,`${this.containerClassName}-active`),this.handle){Ie(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=rt.DIRECTIONS[rt.POSITIONS.indexOf(e)];Ie(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(rt.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),s=this.getEventData(e);t&&(t.removeClass(`node-${s.action}`),s.action==="resizing"&&s.resized?this.notify("node:resized",e,t):s.action==="rotating"&&s.rotated&&this.notify("node:rotated",e,t))}notify(e,t,s,r={}){if(s){const i=s.graph,o=i.view.normalizeEvent(t),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(e,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()}}y3([be.dispose()],e0.prototype,"dispose",null);var rt;(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}})(rt||(rt={}));const b3=`.x6-widget-transform {
282
+ `;class lt extends wt{get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}constructor(e){super(),this.graph=e,this.init()}init(){}}var t3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class yd extends lt{init(){qr("core",e3)}dispose(){Xr("core")}}t3([yd.dispose()],yd.prototype,"dispose",null);var n3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t},xo;(function(n){function e(t){const{grid:s,panning:r,mousewheel:i,embedding:o}=t,a=n3(t,["grid","panning","mousewheel","embedding"]),c=t.container;if(c!=null)a.width==null&&(a.width=c.clientWidth),a.height==null&&(a.height=c.clientHeight);else throw new Error("Ensure the container of the graph is specified and valid");const u=Ye({},n.defaults,a),d={size:10,visible:!1};return typeof s=="number"?u.grid={size:s,visible:!1}:typeof s=="boolean"?u.grid=Object.assign(Object.assign({},d),{visible:s}):u.grid=Object.assign(Object.assign({},d),s),["panning","mousewheel","embedding"].forEach(h=>{const p=t[h];typeof p=="boolean"?u[h].enabled=p:u[h]=Object.assign(Object.assign({},u[h]),p)}),u}n.get=e})(xo||(xo={})),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:Jt.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Jt.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:e,sourceView:t,targetView:s}){return(e==="target"?s:t)!=null},createEdge(){return new qB}},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}}(xo||(xo={}));var s3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},r3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class bd extends lt{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(e){this.grid.visible!==e&&(this.grid.visible=e,this.update())}getGridSize(){return this.grid.size}setGridSize(e){this.grid.size=Math.max(e,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(e){this.clear(),this.instance=null,Object.assign(this.grid,e),this.patterns=this.resolveGrid(e),this.update()}update(e={}){const t=this.grid.size;if(t<=1||!this.grid.visible)return this.clear();const s=this.graph.matrix(),r=this.getInstance(),i=Array.isArray(e)?e:[e];this.patterns.forEach((c,u)=>{const d=`pattern_${u}`,f=s.a||1,h=s.d||1,{update:p,markup:g}=c,m=r3(c,["update","markup"]),y=Object.assign(Object.assign(Object.assign({},m),i[u]),{sx:f,sy:h,ox:s.e||0,oy:s.f||0,width:t*f,height:t*h});r.has(d)||r.add(d,oe.create("pattern",{id:d,patternUnits:"userSpaceOnUse"},oe.createVectors(g)).node);const b=r.get(d);typeof p=="function"&&p(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),pe(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 Ss),this.instance}resolveGrid(e){if(!e)return[];const t=e.type;if(t==null)return[Object.assign(Object.assign({},Ss.presets.dot),e.args)];const s=Ss.registry.get(t);if(s){let r=e.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 Ss.registry.onNotFound(t)}dispose(){this.stopListening(),this.clear()}}s3([lt.dispose()],bd.prototype,"dispose",null);class Xb extends lt{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 e=this.viewport.getAttribute("transform");return e!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=e),ot(this.viewportMatrix)}setMatrix(e){const t=ot(e),s=Wr(t);this.viewport.setAttribute("transform",s),this.viewportMatrix=t,this.viewportTransformString=s}resize(e,t){let s=e===void 0?this.options.width:e,r=t===void 0?this.options.height:t;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 e=this.options.width,t=this.options.height;return Rc(e)||(e=this.container.clientWidth),Rc(t)||(t=this.container.clientHeight),{width:e,height:t}}getScale(){return hR(this.getMatrix())}scale(e,t=e,s=0,r=0){if(e=this.clampScale(e),t=this.clampScale(t),s||r){const o=this.getTranslation(),a=o.tx-s*(e-1),c=o.ty-r*(t-1);(a!==o.tx||c!==o.ty)&&this.translate(a,c)}const i=this.getMatrix();return i.a=e,i.d=t,this.setMatrix(i),this.graph.trigger("scale",{sx:e,sy:t,ox:s,oy:r}),this}clampScale(e){const t=this.graph.options.scaling;return Ct(e,t.min||.01,t.max||16)}getZoom(){return this.getScale().sx}zoom(e,t){t=t||{};let s=e,r=e;const i=this.getScale(),o=this.getComputedSize();let a=o.width/2,c=o.height/2;if(t.absolute||(s+=i.sx,r+=i.sy),t.scaleGrid&&(s=Math.round(s/t.scaleGrid)*t.scaleGrid,r=Math.round(r/t.scaleGrid)*t.scaleGrid),t.maxScale&&(s=Math.min(t.maxScale,s),r=Math.min(t.maxScale,r)),t.minScale&&(s=Math.max(t.minScale,s),r=Math.max(t.minScale,r)),t.center&&(a=t.center.x,c=t.center.y),s=this.clampScale(s),r=this.clampScale(r),a||c){const u=this.getTranslation(),d=a-(a-u.tx)*(s/i.sx),f=c-(c-u.ty)*(r/i.sy);(d!==u.tx||f!==u.ty)&&this.translate(d,f)}return this.scale(s,r),this}getRotation(){return fR(this.getMatrix())}rotate(e,t,s){if(t==null||s==null){const i=Ee.getBBox(this.stage);t=i.width/2,s=i.height/2}const r=this.getMatrix().translate(t,s).rotate(e).translate(-t,-s);return this.setMatrix(r),this}getTranslation(){return pR(this.getMatrix())}translate(e,t){const s=this.getMatrix();s.e=e||0,s.f=t||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(e,t){return this.translate(e||0,t||0)}fitToContent(e,t,s,r){if(typeof e=="object"){const x=e;e=x.gridWidth||1,t=x.gridHeight||1,s=x.padding||0,r=x}else e=e||1,t=t||1,s=s||0,r==null&&(r={});const i=ys(s),o=r.border||0,a=r.contentArea?G.create(r.contentArea):this.getContentArea(r);o>0&&a.inflate(o);const c=this.getScale(),u=this.getTranslation(),d=c.sx,f=c.sy;a.x*=d,a.y*=f,a.width*=d,a.height*=f;let h=Math.max(Math.ceil((a.width+a.x)/e),1)*e,p=Math.max(Math.ceil((a.height+a.y)/t),1)*t,g=0,m=0;(r.allowNewOrigin==="negative"&&a.x<0||r.allowNewOrigin==="positive"&&a.x>=0||r.allowNewOrigin==="any")&&(g=Math.ceil(-a.x/e)*e,g+=i.left,h+=g),(r.allowNewOrigin==="negative"&&a.y<0||r.allowNewOrigin==="positive"&&a.y>=0||r.allowNewOrigin==="any")&&(m=Math.ceil(-a.y/t)*t,m+=i.top,p+=m),h+=i.right,p+=i.bottom,h=Math.max(h,r.minWidth||0),p=Math.max(p,r.minHeight||0),h=Math.min(h,r.maxWidth||Number.MAX_SAFE_INTEGER),p=Math.min(p,r.maxHeight||Number.MAX_SAFE_INTEGER);const y=this.getComputedSize(),b=h!==y.width||p!==y.height;return(g!==u.tx||m!==u.ty)&&this.translate(g,m),b&&this.resize(h,p),new G(-g/d,-m/f,h/d,p/f)}scaleContentToFit(e={}){this.scaleContentToFitImpl(e)}scaleContentToFitImpl(e={},t=!0){let s,r;if(e.contentArea){const b=e.contentArea;s=this.graph.localToGraph(b),r=M.create(b)}else s=this.getContentBBox(e),r=this.graph.graphToLocal(s);if(!s.width||!s.height)return;const i=ys(e.padding),o=e.minScale||0,a=e.maxScale||Number.MAX_SAFE_INTEGER,c=e.minScaleX||o,u=e.maxScaleX||a,d=e.minScaleY||o,f=e.maxScaleY||a;let h;if(e.viewportArea)h=e.viewportArea;else{const b=this.getComputedSize(),w=this.getTranslation();h={x:w.tx,y:w.ty,width:b.width,height:b.height}}h=G.create(h).moveAndExpand({x:i.left,y:i.top,width:-i.left-i.right,height:-i.top-i.bottom});const p=this.getScale();let g=h.width/s.width*p.sx,m=h.height/s.height*p.sy;e.preserveAspectRatio!==!1&&(g=m=Math.min(g,m));const y=e.scaleGrid;if(y&&(g=y*Math.floor(g/y),m=y*Math.floor(m/y)),g=Ct(g,c,u),m=Ct(m,d,f),this.scale(g,m),t){const b=this.options,w=h.x-r.x*g-b.x,x=h.y-r.y*m-b.y;this.translate(w,x)}}getContentArea(e={}){return e.useCellGeometry!==!1?this.model.getAllCellsBBox()||new G:Ee.getBBox(this.stage)}getContentBBox(e={}){return this.graph.localToGraph(this.getContentArea(e))}getGraphArea(){const e=G.fromSize(this.getComputedSize());return this.graph.graphToLocal(e)}zoomToRect(e,t={}){const s=G.create(e),r=this.graph;t.contentArea=s,t.viewportArea==null&&(t.viewportArea={x:r.options.x,y:r.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(t,!1);const i=s.getCenter();return this.centerPoint(i.x,i.y),this}zoomToFit(e={}){return this.zoomToRect(this.getContentArea(e),e)}centerPoint(e,t){const s=this.getComputedSize(),r=this.getScale(),i=this.getTranslation(),o=s.width/2,a=s.height/2;e=typeof e=="number"?e:o,t=typeof t=="number"?t:a,e=o-e*r.sx,t=a-t*r.sy,(i.tx!==e||i.ty!==t)&&this.translate(e,t)}centerContent(e){const s=this.graph.getContentArea(e).getCenter();this.centerPoint(s.x,s.y)}centerCell(e){return this.positionCell(e,"center")}positionPoint(e,t,s){const r=this.getComputedSize();t=gn(t,Math.max(0,r.width)),t<0&&(t=r.width+t),s=gn(s,Math.max(0,r.height)),s<0&&(s=r.height+s);const i=this.getTranslation(),o=this.getScale(),a=t-e.x*o.sx,c=s-e.y*o.sy;(i.tx!==a||i.ty!==c)&&this.translate(a,c)}positionRect(e,t){const s=G.create(e);switch(t){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(e,t){const s=e.getBBox();return this.positionRect(s,t)}positionContent(e,t){const s=this.graph.getContentArea(t);return this.positionRect(s,e)}}var i3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class wd extends lt{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(e={}){let t=e.size||"auto auto",s=e.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 t=="object"&&(t=G.fromSize(t).scale(r.sx,r.sy),t=`${t.width}px ${t.height}px`),this.elem.style.backgroundSize=t,this.elem.style.backgroundPosition=s}drawBackgroundImage(e,t={}){if(!(e instanceof HTMLImageElement)){this.elem.style.backgroundImage="";return}const s=this.optionsCache;if(s&&s.image!==t.image)return;let r;const i=t.opacity,o=t.size;let a=t.repeat||"no-repeat";const c=uo.registry.get(a);if(typeof c=="function"){const d=t.quality||1;e.width*=d,e.height*=d;const f=c(e,t);if(!(f instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");r=f.toDataURL("image/png"),t.repeat&&a!==t.repeat?a=t.repeat:a="repeat",typeof o=="object"?(o.width*=f.width/e.width,o.height*=f.height/e.height):o===void 0&&(t.size={width:f.width/d,height:f.height/d})}else r=e.src,o===void 0&&(t.size={width:e.width,height:e.height});s!=null&&typeof t.size=="object"&&t.image===s.image&&t.repeat===s.repeat&&t.quality===s.quality&&(s.size=Pc(t.size));const u=this.elem.style;u.backgroundImage=`url(${r})`,u.backgroundRepeat=a,u.opacity=i==null||i>=1?"":`${i}`,this.updateBackgroundImage(t)}updateBackgroundColor(e){this.elem.style.backgroundColor=e||""}updateBackgroundOptions(e){this.graph.options.background=e}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(e){const t=e||{};if(this.updateBackgroundOptions(e),this.updateBackgroundColor(t.color),t.image){this.optionsCache=Pc(t);const s=document.createElement("img");s.onload=()=>this.drawBackgroundImage(s,e),s.setAttribute("crossorigin","anonymous"),s.src=t.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}i3([lt.dispose()],wd.prototype,"dispose",null);var o3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class xd extends lt{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),dt.on(this.graph.container,"mousedown",this.onRightMouseDown),dt.on(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle=new Fy(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),dt.off(this.graph.container,"mousedown",this.onRightMouseDown),dt.off(document.body,{keydown:this.onSpaceKeyDown,keyup:this.onSpaceKeyUp}),this.mousewheelHandle&&this.mousewheelHandle.disable()}allowPanning(e,t){return e.spaceKey=this.isSpaceKeyPressed,this.pannable&&vs.isMatch(e,this.widgetOptions.modifiers,t)}startPanning(e){const t=this.view.normalizeEvent(e);this.clientX=t.clientX,this.clientY=t.clientY,this.panning=!0,this.updateClassName(),dt.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)}),dt.on(window,"mouseup.panning",this.stopPanning.bind(this))}pan(e){const t=this.view.normalizeEvent(e),s=t.clientX-this.clientX,r=t.clientY-this.clientY;this.clientX=t.clientX,this.clientY=t.clientY,this.graph.translateBy(s,r)}stopPanning(e){this.panning=!1,this.updateClassName(),dt.off(document.body,".panning"),dt.off(window,".panning")}updateClassName(){const e=this.view.container,t=this.view.prefixClassName("graph-panning"),s=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(ee(e,t),Ie(e,s)):(Ie(e,t),ee(e,s)):(Ie(e,t),Ie(e,s))}onMouseDown({e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.getPlugin("selection"),s=t&&t.allowRubberband(e,!0);(this.allowPanning(e,!0)||this.allowPanning(e)&&!s)&&this.startPanning(e)}onRightMouseDown(e){const t=this.widgetOptions.eventTypes;t!=null&&t.includes("rightMouseDown")&&e.button===2&&this.allowPanning(e,!0)&&this.startPanning(e)}onMouseWheel(e,t,s){this.graph.translateBy(-t,-s)}onSpaceKeyDown(e){e.which===32&&(this.isSpaceKeyPressed=!0)}onSpaceKeyUp(e){e.which===32&&(this.isSpaceKeyPressed=!1)}allowBlankMouseDown(e){const t=this.widgetOptions.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}allowMouseWheel(e){var t;return this.pannable&&!e.ctrlKey&&((t=this.widgetOptions.eventTypes)===null||t===void 0?void 0:t.includes("mouseWheel"))}autoPanning(e,t){const r=this.graph.getGraphArea();let i=0,o=0;e<=r.left+10&&(i=-10),t<=r.top+10&&(o=-10),e>=r.right-10&&(i=10),t>=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()}}o3([lt.dispose()],xd.prototype,"dispose",null);var a3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class vd extends lt{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 Fy(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.widgetOptions.enabled&&this.enable(!0)}get disabled(){return this.widgetOptions.enabled!==!0}enable(e){(this.disabled||e)&&(this.widgetOptions.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.widgetOptions.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(e){const t=this.widgetOptions.guard;return(t==null||t(e))&&vs.isMatch(e,this.widgetOptions.modifiers)}onMouseWheel(e){const t=this.widgetOptions.guard;if((t==null||t(e))&&vs.isMatch(e,this.widgetOptions.modifiers)){const s=this.widgetOptions.factor||1.2;this.currentScale==null&&(this.startPos={x:e.clientX,y:e.clientY},this.currentScale=this.graph.transform.getScale().sx),e.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,c=this.widgetOptions.maxScale||Number.MAX_SAFE_INTEGER;if(o=Ct(o,a,c),o!==i)if(this.widgetOptions.zoomAtMousePosition){const d=!!this.graph.getPlugin("scroller")?this.graph.clientToLocal(this.startPos):this.graph.clientToGraph(this.startPos);this.graph.zoom(o,{absolute:!0,center:d.clone()})}else this.graph.zoom(o,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}a3([wt.dispose()],vd.prototype,"dispose",null);var l3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Jb extends lt{init(){this.resetRenderArea=XP(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 e=this.graph.getGraphArea();this.graph.renderer.setRenderArea(e)}}dispose(){this.stopListening()}}l3([lt.dispose()],Jb.prototype,"dispose",null);class c3{constructor(){this.isFlushing=!1,this.isFlushPending=!1,this.scheduleId=0,this.queue=[],this.frameInterval=33,this.initialTime=Date.now()}queueJob(e){if(e.priority&ns.PRIOR)e.cb();else{const t=this.findInsertionIndex(e);t>=0&&this.queue.splice(t,0,e)}}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 e=this.getCurrentTime();let t;for(;(t=this.queue.shift())&&(t.cb(),!(this.getCurrentTime()-e>=this.frameInterval)););this.isFlushing=!1,this.queue.length&&this.queueFlush()}flushJobsSync(){this.isFlushPending=!1,this.isFlushing=!0;let e;for(;e=this.queue.shift();)try{e.cb()}catch(t){console.log(t)}this.isFlushing=!1}findInsertionIndex(e){let t=0,s=this.queue.length,r=s-1;const i=e.priority;for(;t<=r;){const o=(r-t>>1)+t;i<=this.queue[o].priority?t=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 ns;(function(n){n[n.Update=2]="Update",n[n.RenderEdge=4]="RenderEdge",n[n.RenderNode=8]="RenderNode",n[n.PRIOR=1048576]="PRIOR"})(ns||(ns={}));var u3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class st extends wt{get model(){return this.graph.model}get container(){return this.graph.view.stage}constructor(e){super(),this.views={},this.willRemoveViews={},this.queue=new c3,this.graph=e,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:e}){this.queue.clearJobs(),this.removeZPivots(),this.resetViews();const t=this.model.getCells();this.renderViews(t,Object.assign(Object.assign({},e),{queue:t.map(s=>s.id)}))}onCellAdded({cell:e,options:t}){this.renderViews([e],t)}onCellRemoved({cell:e}){this.removeViews([e])}onCellZIndexChanged({cell:e,options:t}){const s=this.views[e.id];s&&this.requestViewUpdate(s.view,st.FLAG_INSERT,t,ns.Update,!0)}onCellVisibleChanged({cell:e,current:t}){this.toggleVisible(e,!!t)}requestViewUpdate(e,t,s={},r=ns.Update,i=!0){const o=e.cell.id,a=this.views[o];if(!a)return;a.flag=t,a.options=s,(e.hasAction(t,["translate","resize","rotate"])||s.async===!1)&&(r=ns.PRIOR,i=!1),this.queue.queueJob({id:o,priority:r,cb:()=>{this.renderViewInArea(e,t,s);const d=s.queue;if(d){const f=d.indexOf(e.cell.id);f>=0&&d.splice(f,1),d.length===0&&this.graph.trigger("render:done")}}}),this.getEffectedEdges(e).forEach(d=>{this.requestViewUpdate(d.view,d.flag,s,r,!1)}),i&&this.flush()}setRenderArea(e){this.renderArea=e,this.flushWaitingViews()}isViewMounted(e){if(e==null)return!1;const t=this.views[e.cell.id];return t?t.state===st.ViewState.MOUNTED:!1}renderViews(e,t={}){e.sort((s,r)=>s.isNode()&&r.isEdge()?-1:0),e.forEach(s=>{const r=s.id,i=this.views;let o=0,a=i[r];if(a)o=st.FLAG_INSERT;else{const c=this.createCellView(s);c&&(c.graph=this.graph,o=st.FLAG_INSERT|c.getBootstrapFlag(),a={view:c,flag:o,options:t,state:st.ViewState.CREATED},this.views[r]=a)}a&&this.requestViewUpdate(a.view,o,t,this.getRenderPriority(a.view),!1)}),this.flush()}renderViewInArea(e,t,s={}){const r=e.cell,i=r.id,o=this.views[i];if(!o)return;let a=0;this.isUpdatable(e)?(a=this.updateView(e,t,s),o.flag=a):o.state===st.ViewState.MOUNTED?(a=this.updateView(e,t,s),o.flag=a):o.state=st.ViewState.WAITING,a&&r.isEdge()&&!(a&e.getFlag(["source","target"]))&&this.queue.queueJob({id:i,priority:ns.RenderEdge,cb:()=>{this.updateView(e,t,s)}})}removeViews(e){e.forEach(t=>{const s=t.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(e=>{if(e&&e.state===st.ViewState.WAITING){const{view:t,flag:s,options:r}=e;this.requestViewUpdate(t,s,r,this.getRenderPriority(t),!1)}}),this.flush()}updateView(e,t,s={}){if(e==null)return 0;if(He.isCellView(e)){if(t&st.FLAG_REMOVE)return this.removeView(e.cell),0;t&st.FLAG_INSERT&&(this.insertView(e),t^=st.FLAG_INSERT)}return t?e.confirmUpdate(t,s):0}insertView(e){const t=this.views[e.cell.id];if(t){const s=e.cell.getZIndex(),r=this.addZPivot(s);this.container.insertBefore(e.container,r),e.cell.isVisible()||this.toggleVisible(e.cell,!1),t.state=st.ViewState.MOUNTED,this.graph.trigger("view:mounted",{view:e})}}resetViews(){this.willRemoveViews=Object.assign(Object.assign({},this.views),this.willRemoveViews),Object.values(this.willRemoveViews).forEach(e=>{e&&this.removeView(e.view)}),this.views={},this.willRemoveViews={}}removeView(e){const t=e.cell,s=this.willRemoveViews[t.id];s&&e&&(s.view.remove(),delete this.willRemoveViews[t.id],this.graph.trigger("view:unmounted",{view:e}))}toggleVisible(e,t){const s=this.model.getConnectedEdges(e);for(let i=0,o=s.length;i<o;i+=1){const a=s[i];if(t){const c=a.getSourceCell(),u=a.getTargetCell();if(c&&!c.isVisible()||u&&!u.isVisible())continue;this.toggleVisible(a,!0)}else this.toggleVisible(a,!1)}const r=this.views[e.id];r&&Je(r.view.container,{display:t?"unset":"none"})}addZPivot(e=0){this.zPivots==null&&(this.zPivots={});const t=this.zPivots;let s=t[e];if(s)return s;s=t[e]=document.createComment(`z-index:${e+1}`);let r=-1/0;for(const o in t){const a=+o;a<e&&a>r&&(r=a,e-1)}const i=this.container;if(r!==-1/0){const o=t[r];i.insertBefore(s,o.nextSibling)}else i.insertBefore(s,i.firstChild);return s}removeZPivots(){this.zPivots&&Object.values(this.zPivots).forEach(e=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}createCellView(e){const t={graph:this.graph},s=this.graph.options.createCellView;if(s){const i=se(s,this.graph,e);if(i)return new i(e,t);if(i===null)return null}const r=e.view;if(r!=null&&typeof r=="string"){const i=He.registry.get(r);return i?new i(e,t):He.registry.onNotFound(r)}return e.isNode()?new wn(e,t):e.isEdge()?new ts(e,t):null}getEffectedEdges(e){const t=[],s=e.cell,r=this.model.getConnectedEdges(s);for(let i=0,o=r.length;i<o;i+=1){const a=r[i],c=this.views[a.id];if(!c)continue;const u=c.view;if(!this.isViewMounted(u))continue;const d=["update"];a.getTargetCell()===s&&d.push("target"),a.getSourceCell()===s&&d.push("source"),t.push({id:a.id,view:u,flag:u.getFlag(d)})}return t}isUpdatable(e){if(e.isNodeView())return this.renderArea?this.renderArea.isIntersectWithRect(e.cell.getBBox()):!0;if(e.isEdgeView()){const t=e.cell,s=t.getSourceCell(),r=t.getTargetCell();if(this.renderArea&&s&&r)return this.renderArea.isIntersectWithRect(s.getBBox())||this.renderArea.isIntersectWithRect(r.getBBox())}return!0}getRenderPriority(e){return e.cell.isNode()?ns.RenderNode:ns.RenderEdge}dispose(){this.stopListening(),Object.keys(this.views).forEach(e=>{this.views[e].view.dispose()}),this.views={}}}u3([wt.dispose()],st.prototype,"dispose",null),function(n){n.FLAG_INSERT=1<<30,n.FLAG_REMOVE=1<<29,n.FLAG_RENDER=(1<<26)-1}(st||(st={})),function(n){(function(e){e[e.CREATED=0]="CREATED",e[e.MOUNTED=1]="MOUNTED",e[e.WAITING=2]="WAITING"})(n.ViewState||(n.ViewState={}))}(st||(st={}));var d3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Cd extends lt{constructor(){super(...arguments),this.schedule=new st(this.graph)}requestViewUpdate(e,t,s={}){this.schedule.requestViewUpdate(e,t,s)}isViewMounted(e){return this.schedule.isViewMounted(e)}setRenderArea(e){this.schedule.setRenderArea(e)}findViewByElem(e){if(e==null)return null;const t=this.options.container,s=typeof e=="string"?t.querySelector(e):e instanceof Element?e:e[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(e){if(e==null)return null;const t=ge.isCell(e)?e.id:e,s=this.schedule.views;return s[t]?s[t].view:null}findViewsFromPoint(e){const t={x:e.x,y:e.y};return this.model.getCells().map(s=>this.findViewByCell(s)).filter(s=>s!=null?Ee.getBBox(s.container,{target:this.view.stage}).containsPoint(t):!1)}findEdgeViewsFromPoint(e,t=5){return this.model.getEdges().map(s=>this.findViewByCell(s)).filter(s=>{if(s!=null){const r=s.getClosestPoint(e);if(r)return r.distance(e)<=t}return!1})}findViewsInArea(e,t={}){const s=G.create(e);return this.model.getCells().map(r=>this.findViewByCell(r)).filter(r=>{if(r){if(t.nodeOnly&&!r.isNodeView())return!1;const i=Ee.getBBox(r.container,{target:this.view.stage});return i.width===0?i.inflate(1,0):i.height===0&&i.inflate(0,1),t.strict?s.containsRect(i):s.isIntersectWithRect(i)}return!1})}dispose(){this.schedule.dispose()}}d3([lt.dispose()],Cd.prototype,"dispose",null);var Kb=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class Zb extends lt{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(e){return this.svg.getElementById(e)!=null}filter(e){let t=e.id;const s=e.name;if(t||(t=`filter-${s}-${this.cid}-${$u(JSON.stringify(e))}`),!this.isDefined(t)){const r=Zr.registry.get(s);if(r==null)return Zr.registry.onNotFound(s);const i=r(e.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},e.attrs),{id:t});oe.create(De.sanitize(i),o).appendTo(this.defs)}return t}gradient(e){let t=e.id;const s=e.type;if(t||(t=`gradient-${s}-${this.cid}-${$u(JSON.stringify(e))}`),!this.isDefined(t)){const i=e.stops.map(c=>{const u=c.opacity!=null&&Number.isFinite(c.opacity)?c.opacity:1;return`<stop offset="${c.offset}" stop-color="${c.color}" stop-opacity="${u}"/>`}),o=`<${s}>${i.join("")}</${s}>`,a=Object.assign({id:t},e.attrs);oe.create(o,a).appendTo(this.defs)}return t}marker(e){const{id:t,refX:s,refY:r,markerUnits:i,markerOrient:o,tagName:a,children:c}=e,u=Kb(e,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let d=t;if(d||(d=`marker-${this.cid}-${$u(JSON.stringify(e))}`),!this.isDefined(d)){a!=="path"&&delete u.d;const f=oe.create("marker",{refX:s,refY:r,id:d,overflow:"visible",orient:o??"auto",markerUnits:i||"userSpaceOnUse"},c?c.map(h=>{var{tagName:p}=h,g=Kb(h,["tagName"]);return oe.create(`${p}`||"path",to(Object.assign(Object.assign({},u),g)))}):[oe.create(a||"path",to(u))]);this.defs.appendChild(f.node)}return d}remove(e){const t=this.svg.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}}class Qb extends lt{getClientMatrix(){return ot(this.view.stage.getScreenCTM())}getClientOffset(){const e=this.view.svg.getBoundingClientRect();return new M(e.left,e.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(e,t){return(typeof e=="number"?this.clientToLocalPoint(e,t):this.clientToLocalPoint(e.x,e.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.graph.matrix())}localToClientPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.getClientMatrix())}localToPagePoint(e,t){return(typeof e=="number"?this.localToGraphPoint(e,t):this.localToGraphPoint(e)).translate(this.getPageOffset())}localToGraphRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix())}localToClientRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.getClientMatrix())}localToPageRect(e,t,s,r){return(typeof e=="number"?this.localToGraphRect(e,t,s,r):this.localToGraphRect(e)).translate(this.getPageOffset())}graphToLocalPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.graph.matrix().inverse())}clientToLocalPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.getClientMatrix().inverse())}clientToGraphPoint(e,t){const s=M.create(e,t);return Ee.transformPoint(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(e,t){const r=M.create(e,t).diff(this.getPageOffset());return this.graphToLocalPoint(r)}graphToLocalRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix().inverse())}clientToLocalRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.getClientMatrix().inverse())}clientToGraphRect(e,t,s,r){const i=G.create(e,t,s,r);return Ee.transformRectangle(i,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(e,t,s,r){const i=G.create(e,t,s,r),o=this.getPageOffset();return i.x-=o.x,i.y-=o.y,this.graphToLocalRect(i)}}var h3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Ml extends lt{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:e,magnet:t,options:s={}}){const r=this.resolveHighlighter(s);if(!r)return;const i=this.getHighlighterId(t,r);if(!this.highlights[i]){const o=r.highlighter;o.highlight(e,t,Object.assign({},r.args)),this.highlights[i]={cellView:e,magnet:t,highlighter:o,args:r.args}}}onCellUnhighlight({magnet:e,options:t={}}){const s=this.resolveHighlighter(t);if(!s)return;const r=this.getHighlighterId(e,s);this.unhighlight(r)}resolveHighlighter(e){const t=this.options;let s=e.highlighter;if(s==null){const a=e.type;s=a&&t.highlighting[a]||t.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(e,t){return Hu(e),t.name+e.id+JSON.stringify(t.args)}unhighlight(e){const t=this.highlights[e];t&&(t.highlighter.unhighlight(t.cellView,t.magnet,t.args),delete this.highlights[e])}dispose(){Object.keys(this.highlights).forEach(e=>this.unhighlight(e)),this.stopListening()}}h3([Ml.dispose()],Ml.prototype,"dispose",null);var f3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class e0 extends lt{getScroller(){const e=this.graph.getPlugin("scroller");return e&&e.options.enabled?e:null}getContainer(){const e=this.getScroller();return e?e.container.parentElement:this.graph.container.parentElement}getSensorTarget(){const e=this.options.autoResize;if(e)return typeof e=="boolean"?this.getContainer():e}init(){if(this.options.autoResize){const t=this.getSensorTarget();t&&il.bind(t,()=>{const s=t.offsetWidth,r=t.offsetHeight;this.resize(s,r)})}}resize(e,t){const s=this.getScroller();s?s.resize(e,t):this.graph.transform.resize(e,t)}dispose(){il.clear(this.graph.container)}}f3([lt.dispose()],e0.prototype,"dispose",null);var p3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class $ extends Ve{get container(){return this.options.container}get[Symbol.toStringTag](){return $.toStringTag}constructor(e){super(),this.installedPlugins=new Set,this.options=xo.get(e),this.css=new yd(this),this.view=new Vn(this),this.defs=new Zb(this),this.coord=new Qb(this),this.transform=new Xb(this),this.highlight=new Ml(this),this.grid=new bd(this),this.background=new wd(this),this.options.model?this.model=this.options.model:(this.model=new nt,this.model.graph=this),this.renderer=new Cd(this),this.panning=new xd(this),this.mousewheel=new vd(this),this.virtualRender=new Jb(this),this.size=new e0(this)}isNode(e){return e.isNode()}isEdge(e){return e.isEdge()}resetCells(e,t={}){return this.model.resetCells(e,t),this}clearCells(e={}){return this.model.clear(e),this}toJSON(e={}){return this.model.toJSON(e)}parseJSON(e){return this.model.parseJSON(e)}fromJSON(e,t={}){return this.model.fromJSON(e,t),this}getCellById(e){return this.model.getCell(e)}addNode(e,t={}){return this.model.addNode(e,t)}addNodes(e,t={}){return this.addCell(e.map(s=>Ge.isNode(s)?s:this.createNode(s)),t)}createNode(e){return this.model.createNode(e)}removeNode(e,t={}){return this.model.removeCell(e,t)}addEdge(e,t={}){return this.model.addEdge(e,t)}addEdges(e,t={}){return this.addCell(e.map(s=>$e.isEdge(s)?s:this.createEdge(s)),t)}removeEdge(e,t={}){return this.model.removeCell(e,t)}createEdge(e){return this.model.createEdge(e)}addCell(e,t={}){return this.model.addCell(e,t),this}removeCell(e,t={}){return this.model.removeCell(e,t)}removeCells(e,t={}){return this.model.removeCells(e,t)}removeConnectedEdges(e,t={}){return this.model.removeConnectedEdges(e,t)}disconnectConnectedEdges(e,t={}){return this.model.disconnectConnectedEdges(e,t),this}hasCell(e){return this.model.has(e)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(e){return this.model.getOutgoingEdges(e)}getIncomingEdges(e){return this.model.getIncomingEdges(e)}getConnectedEdges(e,t={}){return this.model.getConnectedEdges(e,t)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(e){return this.model.isRoot(e)}isLeafNode(e){return this.model.isLeaf(e)}getNeighbors(e,t={}){return this.model.getNeighbors(e,t)}isNeighbor(e,t,s={}){return this.model.isNeighbor(e,t,s)}getSuccessors(e,t={}){return this.model.getSuccessors(e,t)}isSuccessor(e,t,s={}){return this.model.isSuccessor(e,t,s)}getPredecessors(e,t={}){return this.model.getPredecessors(e,t)}isPredecessor(e,t,s={}){return this.model.isPredecessor(e,t,s)}getCommonAncestor(...e){return this.model.getCommonAncestor(...e)}getSubGraph(e,t={}){return this.model.getSubGraph(e,t)}cloneSubGraph(e,t={}){return this.model.cloneSubGraph(e,t)}cloneCells(e){return this.model.cloneCells(e)}getNodesFromPoint(e,t){return this.model.getNodesFromPoint(e,t)}getNodesInArea(e,t,s,r,i){return this.model.getNodesInArea(e,t,s,r,i)}getNodesUnderNode(e,t={}){return this.model.getNodesUnderNode(e,t)}searchCell(e,t,s={}){return this.model.search(e,t,s),this}getShortestPath(e,t,s={}){return this.model.getShortestPath(e,t,s)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(e,t={}){return this.model.getCellsBBox(e,t)}startBatch(e,t={}){this.model.startBatch(e,t)}stopBatch(e,t={}){this.model.stopBatch(e,t)}batchUpdate(e,t,s){const r=typeof e=="string"?e:"update",i=typeof e=="string"?t:e,o=typeof t=="function"?s:t;this.startBatch(r,o);const a=i();return this.stopBatch(r,o),a}updateCellId(e,t){return this.model.updateCellId(e,t)}findView(e){return ge.isCell(e)?this.findViewByCell(e):this.findViewByElem(e)}findViews(e){return G.isRectangleLike(e)?this.findViewsInArea(e):M.isPointLike(e)?this.findViewsFromPoint(e):[]}findViewByCell(e){return this.renderer.findViewByCell(e)}findViewByElem(e){return this.renderer.findViewByElem(e)}findViewsFromPoint(e,t){const s=typeof e=="number"?{x:e,y:t}:e;return this.renderer.findViewsFromPoint(s)}findViewsInArea(e,t,s,r,i){const o=typeof e=="number"?{x:e,y:t,width:s,height:r}:e,a=typeof e=="number"?i:t;return this.renderer.findViewsInArea(o,a)}matrix(e){return typeof e>"u"?this.transform.getMatrix():(this.transform.setMatrix(e),this)}resize(e,t){const s=this.getPlugin("scroller");return s?s.resize(e,t):this.transform.resize(e,t),this}scale(e,t=e,s=0,r=0){return typeof e>"u"?this.transform.getScale():(this.transform.scale(e,t,s,r),this)}zoom(e,t){const s=this.getPlugin("scroller");if(s){if(typeof e>"u")return s.zoom();s.zoom(e,t)}else{if(typeof e>"u")return this.transform.getZoom();this.transform.zoom(e,t)}return this}zoomTo(e,t={}){const s=this.getPlugin("scroller");return s?s.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})):this.transform.zoom(e,Object.assign(Object.assign({},t),{absolute:!0})),this}zoomToRect(e,t={}){const s=this.getPlugin("scroller");return s?s.zoomToRect(e,t):this.transform.zoomToRect(e,t),this}zoomToFit(e={}){const t=this.getPlugin("scroller");return t?t.zoomToFit(e):this.transform.zoomToFit(e),this}rotate(e,t,s){return typeof e>"u"?this.transform.getRotation():(this.transform.rotate(e,t,s),this)}translate(e,t){return typeof e>"u"?this.transform.getTranslation():(this.transform.translate(e,t),this)}translateBy(e,t){const s=this.translate(),r=s.tx+e,i=s.ty+t;return this.translate(r,i)}getGraphArea(){return this.transform.getGraphArea()}getContentArea(e={}){return this.transform.getContentArea(e)}getContentBBox(e={}){return this.transform.getContentBBox(e)}fitToContent(e,t,s,r){return this.transform.fitToContent(e,t,s,r)}scaleContentToFit(e={}){return this.transform.scaleContentToFit(e),this}center(e){return this.centerPoint(e)}centerPoint(e,t,s){const r=this.getPlugin("scroller");return r?r.centerPoint(e,t,s):this.transform.centerPoint(e,t),this}centerContent(e){const t=this.getPlugin("scroller");return t?t.centerContent(e):this.transform.centerContent(e),this}centerCell(e,t){const s=this.getPlugin("scroller");return s?s.centerCell(e,t):this.transform.centerCell(e),this}positionPoint(e,t,s,r={}){const i=this.getPlugin("scroller");return i?i.positionPoint(e,t,s,r):this.transform.positionPoint(e,t,s),this}positionRect(e,t,s){const r=this.getPlugin("scroller");return r?r.positionRect(e,t,s):this.transform.positionRect(e,t),this}positionCell(e,t,s){const r=this.getPlugin("scroller");return r?r.positionCell(e,t,s):this.transform.positionCell(e,t),this}positionContent(e,t){const s=this.getPlugin("scroller");return s?s.positionContent(e,t):this.transform.positionContent(e,t),this}snapToGrid(e,t){return this.coord.snapToGrid(e,t)}pageToLocal(e,t,s,r){return G.isRectangleLike(e)?this.coord.pageToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.pageToLocalRect(e,t,s,r):this.coord.pageToLocalPoint(e,t)}localToPage(e,t,s,r){return G.isRectangleLike(e)?this.coord.localToPageRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToPageRect(e,t,s,r):this.coord.localToPagePoint(e,t)}clientToLocal(e,t,s,r){return G.isRectangleLike(e)?this.coord.clientToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToLocalRect(e,t,s,r):this.coord.clientToLocalPoint(e,t)}localToClient(e,t,s,r){return G.isRectangleLike(e)?this.coord.localToClientRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToClientRect(e,t,s,r):this.coord.localToClientPoint(e,t)}localToGraph(e,t,s,r){return G.isRectangleLike(e)?this.coord.localToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.localToGraphRect(e,t,s,r):this.coord.localToGraphPoint(e,t)}graphToLocal(e,t,s,r){return G.isRectangleLike(e)?this.coord.graphToLocalRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.graphToLocalRect(e,t,s,r):this.coord.graphToLocalPoint(e,t)}clientToGraph(e,t,s,r){return G.isRectangleLike(e)?this.coord.clientToGraphRect(e):typeof e=="number"&&typeof t=="number"&&typeof s=="number"&&typeof r=="number"?this.coord.clientToGraphRect(e,t,s,r):this.coord.clientToGraphPoint(e,t)}defineFilter(e){return this.defs.filter(e)}defineGradient(e){return this.defs.gradient(e)}defineMarker(e){return this.defs.marker(e)}getGridSize(){return this.grid.getGridSize()}setGridSize(e){return this.grid.setGridSize(e),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(e){return this.grid.draw(e),this}updateBackground(){return this.background.update(),this}drawBackground(e,t){const s=this.getPlugin("scroller");return s!=null&&(this.options.background==null||!t)?s.drawBackground(e,t):this.background.draw(e),this}clearBackground(e){const t=this.getPlugin("scroller");return t!=null&&(this.options.background==null||!e)?t.clearBackground(e):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(e){return e==null?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():e?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const e=this.getPlugin("scroller");return e?e.isPannable():this.panning.pannable}enablePanning(){const e=this.getPlugin("scroller");return e?e.enablePanning():this.panning.enablePanning(),this}disablePanning(){const e=this.getPlugin("scroller");return e?e.disablePanning():this.panning.disablePanning(),this}togglePanning(e){return e==null?this.isPannable()?this.disablePanning():this.enablePanning():e!==this.isPannable()&&(e?this.enablePanning():this.disablePanning()),this}use(e,...t){return this.installedPlugins.has(e)||(this.installedPlugins.add(e),e.init(this,...t)),this}getPlugin(e){return Array.from(this.installedPlugins).find(t=>t.name===e)}getPlugins(e){return Array.from(this.installedPlugins).filter(t=>e.includes(t.name))}enablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.enable)===null||i===void 0||i.call(r)}),this}disablePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{var i;(i=r==null?void 0:r.disable)===null||i===void 0||i.call(r)}),this}isPluginEnabled(e){var t;const s=this.getPlugin(e);return(t=s==null?void 0:s.isEnabled)===null||t===void 0?void 0:t.call(s)}disposePlugins(e){let t=e;Array.isArray(t)||(t=[t]);const s=this.getPlugins(t);return s==null||s.forEach(r=>{r.dispose(),this.installedPlugins.delete(r)}),this}dispose(e=!0){e&&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(t=>{t.dispose()})}}p3([Ve.dispose()],$.prototype,"dispose",null),function(n){n.View=Vn,n.Renderer=Cd,n.MouseWheel=vd,n.DefsManager=Zb,n.GridManager=bd,n.CoordManager=Qb,n.TransformManager=Xb,n.HighlightManager=Ml,n.BackgroundManager=wd,n.PanningManager=xd}($||($={})),function(n){n.toStringTag=`X6.${n.name}`;function e(t){if(t==null)return!1;if(t instanceof n)return!0;const s=t[Symbol.toStringTag];return s==null||s===n.toStringTag}n.isGraph=e}($||($={})),function(n){function e(t,s){const r=t instanceof HTMLElement?new n({container:t}):new n(t);return s!=null&&r.fromJSON(s),r}n.render=e}($||($={})),function(n){n.registerNode=Ge.registry.register,n.registerEdge=$e.registry.register,n.registerView=He.registry.register,n.registerAttr=kn.registry.register,n.registerGrid=Ss.registry.register,n.registerFilter=Zr.registry.register,n.registerNodeTool=ni.registry.register,n.registerEdgeTool=si.registry.register,n.registerBackground=uo.registry.register,n.registerHighlighter=Qn.registry.register,n.registerPortLayout=or.registry.register,n.registerPortLabelLayout=ei.registry.register,n.registerMarker=Ms.registry.register,n.registerRouter=Ts.registry.register,n.registerConnector=ar.registry.register,n.registerAnchor=ri.registry.register,n.registerEdgeAnchor=ii.registry.register,n.registerConnectionPoint=oi.registry.register}($||($={})),function(n){n.unregisterNode=Ge.registry.unregister,n.unregisterEdge=$e.registry.unregister,n.unregisterView=He.registry.unregister,n.unregisterAttr=kn.registry.unregister,n.unregisterGrid=Ss.registry.unregister,n.unregisterFilter=Zr.registry.unregister,n.unregisterNodeTool=ni.registry.unregister,n.unregisterEdgeTool=si.registry.unregister,n.unregisterBackground=uo.registry.unregister,n.unregisterHighlighter=Qn.registry.unregister,n.unregisterPortLayout=or.registry.unregister,n.unregisterPortLabelLayout=ei.registry.unregister,n.unregisterMarker=Ms.registry.unregister,n.unregisterRouter=Ts.registry.unregister,n.unregisterConnector=ar.registry.unregister,n.unregisterAnchor=ri.registry.unregister,n.unregisterEdgeAnchor=ii.registry.unregister,n.unregisterConnectionPoint=oi.registry.unregister}($||($={}));var g3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},m3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class di extends Ge{}(function(n){class e extends wn{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,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const s=this.selectors&&this.selectors.foContent;if(s){eo(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:Lt(s,i))}}dispose(){this.cell.off("change:*",this.onCellChangeAny,this)}}g3([e.dispose()],e.prototype,"dispose",null),n.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),wn.registry.register("html-view",t,!0)}(e=n.View||(n.View={}))})(di||(di={})),function(n){n.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},De.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Ge.registry.register("html",n,!0)}(di||(di={})),function(n){n.shapeMaps={};function e(t){const{shape:s,html:r,effect:i,inherit:o}=t,a=m3(t,["shape","html","effect","inherit"]);if(!s)throw new Error("should specify shape in config");n.shapeMaps[s]={html:r,effect:i},$.registerNode(s,Object.assign({inherit:o||"html"},a),!0)}n.register=e}(di||(di={}));var y3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class t0 extends be{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(e,t,s){super(),this.node=t,this.graph=s,this.options=Object.assign(Object.assign({},rt.defaultOptions),e),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 e=document.createElement("div");pe(e,"draggable","false");const t=e.cloneNode(!0);ee(t,this.rotateClassName);const s=rt.POSITIONS.map(r=>{const i=e.cloneNode(!0);return ee(i,this.resizeClassName),pe(i,"data-position",r),i});this.empty(),Lt(this.container,[...s,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(rt.NODE_CLS),ee(this.container,this.containerClassName),mn(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),mn(this.container,"no-resize",!this.options.resizable),mn(this.container,"no-rotate",!this.options.rotatable),this.options.className&&ee(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const s=ye.normalize(this.node.getAngle()),r=s!==0?`rotate(${s}deg)`:"";return Je(this.container,{transform:r,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(rt.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=ye.normalize(this.node.getAngle()),t=Math.floor(e*(rt.DIRECTIONS.length/360));if(t!==this.prevShift){const s=rt.DIRECTIONS.slice(t).concat(rt.DIRECTIONS.slice(0,t)),r=o=>`${this.containerClassName}-cursor-${o}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((o,a)=>{Ie(o,rt.DIRECTIONS.map(c=>r(c)).join(" ")),ee(o,r(s[a]))}),this.prevShift=t}}getTrueDirection(e){const t=ye.normalize(this.node.getAngle());let s=rt.POSITIONS.indexOf(e);return s+=Math.floor(t*(rt.POSITIONS.length/360)),s%=rt.POSITIONS.length,rt.POSITIONS[s]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=pe(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const s=this.getTrueDirection(t);let r=0,i=0;t.split("-").forEach(u=>{r={left:-1,right:1}[u]||r,i={top:-1,bottom:1}[u]||i});const o=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],c=ye.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:o,trueDirection:s,relativeDirection:t,angle:c,resizeX:r,resizeY:i,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),s=this.normalizeEvent(e),r=this.graph.snapToGrid(s.clientX,s.clientY);this.setEventData(e,{center:t,action:"rotating",angle:ye.normalize(this.node.getAngle()),start:M.create(r).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let s=this.getEventData(e);if(s.action){const r=this.normalizeEvent(e);let i=r.clientX,o=r.clientY;const a=this.graph.getPlugin("scroller"),c=this.options.restrictedResizing;if(c===!0||typeof c=="number"){const p=c===!0?0:c,g=a?Math.max(p,8):p,m=this.graph.container.getBoundingClientRect();i=Ct(i,m.left+g,m.right-g),o=Ct(o,m.top+g,m.bottom-g)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(i,o);const u=this.graph.snapToGrid(i,o),d=this.graph.getGridSize(),f=this.node,h=this.options;if(s.action==="resizing"){s=s,s.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),s.resized=!0);const p=f.getBBox(),g=M.create(u).rotate(s.angle,p.getCenter()).diff(p[s.selector]);let m=s.resizeX?g.x*s.resizeX:p.width,y=s.resizeY?g.y*s.resizeY:p.height;const b=m,w=y;if(m=Se.snapToGrid(m,d),y=Se.snapToGrid(y,d),m=Math.max(m,h.minWidth||d),y=Math.max(y,h.minHeight||d),m=Math.min(m,h.maxWidth||1/0),y=Math.min(y,h.maxHeight||1/0),h.preserveAspectRatio){const S=p.width*y/p.height,v=p.height*m/p.width;m<S?y=v:m=S}const x=s.relativeDirection;if(h.allowReverse&&(b<=-m||w<=-y)){let S;x==="left"?b<=-m&&(S="right"):x==="right"?b<=-m&&(S="left"):x==="top"?w<=-y&&(S="bottom"):x==="bottom"?w<=-y&&(S="top"):x==="top-left"?b<=-m&&w<=-y?S="bottom-right":b<=-m?S="top-right":w<=-y&&(S="bottom-left"):x==="top-right"?b<=-m&&w<=-y?S="bottom-left":b<=-m?S="top-left":w<=-y&&(S="bottom-right"):x==="bottom-left"?b<=-m&&w<=-y?S="top-right":b<=-m?S="bottom-right":w<=-y&&(S="top-left"):x==="bottom-right"&&(b<=-m&&w<=-y?S="top-left":b<=-m?S="bottom-left":w<=-y&&(S="top-right"));const v=S;this.stopHandle();const E=this.container.querySelector(`.${this.resizeClassName}[data-position="${v}"]`);this.startHandle(E),this.prepareResizing(e,v),this.onMouseMove(e)}if(p.width!==m||p.height!==y){const S={ui:!0,direction:s.direction,relativeDirection:s.relativeDirection,trueDirection:s.trueDirection,minWidth:h.minWidth,minHeight:h.minHeight,maxWidth:h.maxWidth,maxHeight:h.maxHeight,preserveAspectRatio:h.preserveAspectRatio===!0};f.resize(m,y,S),this.notify("node:resizing",e,t)}}else if(s.action==="rotating"){s=s,s.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),s.rotated=!0);const p=f.getAngle(),g=s.start-M.create(u).theta(s.center);let m=s.angle+g;h.rotateGrid&&(m=Se.snapToGrid(m,h.rotateGrid)),m=ye.normalize(m),p!==m&&(f.rotate(m,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch(t.action==="resizing"?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,ee(this.container,`${this.containerClassName}-active`),e){ee(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const s=rt.DIRECTIONS[rt.POSITIONS.indexOf(t)];ee(this.container,`${this.containerClassName}-cursor-${s}`)}}}stopHandle(){if(Ie(this.container,`${this.containerClassName}-active`),this.handle){Ie(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=rt.DIRECTIONS[rt.POSITIONS.indexOf(e)];Ie(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(rt.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),s=this.getEventData(e);t&&(t.removeClass(`node-${s.action}`),s.action==="resizing"&&s.resized?this.notify("node:resized",e,t):s.action==="rotating"&&s.rotated&&this.notify("node:rotated",e,t))}notify(e,t,s,r={}){if(s){const i=s.graph,o=i.view.normalizeEvent(t),a=i.snapToGrid(o.clientX,o.clientY);this.trigger(e,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()}}y3([be.dispose()],t0.prototype,"dispose",null);var rt;(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}})(rt||(rt={}));const b3=`.x6-widget-transform {
283
283
  position: absolute;
284
284
  box-sizing: content-box !important;
285
285
  margin: -5px 0 0 -5px;
@@ -405,7 +405,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
405
405
  display: block;
406
406
  background-color: #808080;
407
407
  }
408
- `;$.prototype.createTransformWidget=function(n){const e=this.getPlugin("transform");return e&&e.createWidget(n),this},$.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var w3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class lr extends Ve{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,qr(this.name,b3)}init(e){this.graph=e,!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(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(s,r)=>{this.trigger(s,r),this.graph.trigger(s,r)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new e0(t,e,this.graph):null}getTransformOptions(e){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 t=lr.parseOptionGroup(this.graph,e,this.options.resizing),s=lr.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof t.orthogonal=="boolean"?t.orthogonal:!0,restrictedResizing:!!t.restrict,autoScrollOnResizing:typeof t.autoScroll=="boolean"?t.autoScroll:!0,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:typeof t.allowReverse=="boolean"?t.allowReverse:!0,rotatable:!!s.enabled,rotateGrid:s.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Xr(this.name)}}w3([Ve.dispose()],lr.prototype,"dispose",null),function(n){function e(t,s,r){const i={};return Object.keys(r||{}).forEach(o=>{const a=r[o];i[o]=typeof a=="function"?a.call(t,s):a}),i}n.parseOptionGroup=e}(lr||(lr={}));var t0={exports:{}};(function(n){(function(e,t,s){if(!e)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"},c,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function d(S,O,A){if(S.addEventListener){S.addEventListener(O,A,!1);return}S.attachEvent("on"+O,A)}function f(S){if(S.type=="keypress"){var O=String.fromCharCode(S.which);return S.shiftKey||(O=O.toLowerCase()),O}return r[S.which]?r[S.which]:i[S.which]?i[S.which]:String.fromCharCode(S.which).toLowerCase()}function h(S,O){return S.sort().join(",")===O.sort().join(",")}function p(S){var O=[];return S.shiftKey&&O.push("shift"),S.altKey&&O.push("alt"),S.ctrlKey&&O.push("ctrl"),S.metaKey&&O.push("meta"),O}function g(S){if(S.preventDefault){S.preventDefault();return}S.returnValue=!1}function m(S){if(S.stopPropagation){S.stopPropagation();return}S.cancelBubble=!0}function y(S){return S=="shift"||S=="ctrl"||S=="alt"||S=="meta"}function b(){if(!c){c={};for(var S in r)S>95&&S<112||r.hasOwnProperty(S)&&(c[r[S]]=S)}return c}function w(S,O,A){return A||(A=b()[S]?"keydown":"keypress"),A=="keypress"&&O.length&&(A="keydown"),A}function x(S){return S==="+"?["+"]:(S=S.replace(/\+{2}/g,"+plus"),S.split("+"))}function v(S,O){var A,k,_,V=[];for(A=x(S),_=0;_<A.length;++_)k=A[_],a[k]&&(k=a[k]),O&&O!="keypress"&&o[k]&&(k=o[k],V.push("shift")),y(k)&&V.push(k);return O=w(k,V,O),{key:k,modifiers:V,action:O}}function C(S,O){return S===null||S===t?!1:S===O?!0:C(S.parentNode,O)}function E(S){var O=this;if(S=S||t,!(O instanceof E))return new E(S);O.target=S,O._callbacks={},O._directMap={};var A={},k,_=!1,V=!1,L=!1;function B(z){z=z||{};var I=!1,U;for(U in A){if(z[U]){I=!0;continue}A[U]=0}I||(L=!1)}function N(z,I,U,F,D,q){var J,ae,Z=[],fe=U.type;if(!O._callbacks[z])return[];for(fe=="keyup"&&y(z)&&(I=[z]),J=0;J<O._callbacks[z].length;++J)if(ae=O._callbacks[z][J],!(!F&&ae.seq&&A[ae.seq]!=ae.level)&&fe==ae.action&&(fe=="keypress"&&!U.metaKey&&!U.ctrlKey||h(I,ae.modifiers))){var Ze=!F&&ae.combo==D,yt=F&&ae.seq==F&&ae.level==q;(Ze||yt)&&O._callbacks[z].splice(J,1),Z.push(ae)}return Z}function P(z,I,U,F){O.stopCallback(I,I.target||I.srcElement,U,F)||z(I,U)===!1&&(g(I),m(I))}O._handleKey=function(z,I,U){var F=N(z,I,U),D,q={},J=0,ae=!1;for(D=0;D<F.length;++D)F[D].seq&&(J=Math.max(J,F[D].level));for(D=0;D<F.length;++D){if(F[D].seq){if(F[D].level!=J)continue;ae=!0,q[F[D].seq]=1,P(F[D].callback,U,F[D].combo,F[D].seq);continue}ae||P(F[D].callback,U,F[D].combo)}var Z=U.type=="keypress"&&V;U.type==L&&!y(z)&&!Z&&B(q),V=ae&&U.type=="keydown"};function T(z){typeof z.which!="number"&&(z.which=z.keyCode);var I=f(z);if(I){if(z.type=="keyup"&&_===I){_=!1;return}O.handleKey(I,p(z),z)}}function j(){clearTimeout(k),k=setTimeout(B,1e3)}function Y(z,I,U,F){A[z]=0;function D(fe){return function(){L=fe,++A[z],j()}}function q(fe){P(U,fe,z),F!=="keyup"&&(_=f(fe)),setTimeout(B,10)}for(var J=0;J<I.length;++J){var ae=J+1===I.length,Z=ae?q:D(F||v(I[J+1]).action);te(I[J],Z,F,z,J)}}function te(z,I,U,F,D){O._directMap[z+":"+U]=I,z=z.replace(/\s+/g," ");var q=z.split(" "),J;if(q.length>1){Y(z,q,I,U);return}J=v(z,U),O._callbacks[J.key]=O._callbacks[J.key]||[],N(J.key,J.modifiers,{type:J.action},F,z,D),O._callbacks[J.key][F?"unshift":"push"]({callback:I,modifiers:J.modifiers,action:J.action,seq:F,level:D,combo:z})}O._bindMultiple=function(z,I,U){for(var F=0;F<z.length;++F)te(z[F],I,U)},d(S,"keypress",T),d(S,"keydown",T),d(S,"keyup",T)}E.prototype.bind=function(S,O,A){var k=this;return S=S instanceof Array?S:[S],k._bindMultiple.call(k,S,O,A),k},E.prototype.unbind=function(S,O){var A=this;return A.bind.call(A,S,function(){},O)},E.prototype.trigger=function(S,O){var A=this;return A._directMap[S+":"+O]&&A._directMap[S+":"+O]({},S),A},E.prototype.reset=function(){var S=this;return S._callbacks={},S._directMap={},S},E.prototype.stopCallback=function(S,O){var A=this;if((" "+O.className+" ").indexOf(" mousetrap ")>-1||C(O,A.target))return!1;if("composedPath"in S&&typeof S.composedPath=="function"){var k=S.composedPath()[0];k!==S.target&&(O=k)}return O.tagName=="INPUT"||O.tagName=="SELECT"||O.tagName=="TEXTAREA"||O.isContentEditable},E.prototype.handleKey=function(){var S=this;return S._handleKey.apply(S,arguments)},E.addKeycodes=function(S){for(var O in S)S.hasOwnProperty(O)&&(r[O]=S[O]);c=null},E.init=function(){var S=E(t);for(var O in S)O.charAt(0)!=="_"&&(E[O]=function(A){return function(){return S[A].apply(S,arguments)}}(O))},E.init(),e.Mousetrap=E,n.exports&&(n.exports=E)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(t0);var x3=t0.exports;const v3=rk(x3);var C3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class hi extends wt{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.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=hi.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(e,t,s){this.mousetrap.bind(this.getKeys(e),t,s)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(t=>this.formatkey(t))}formatkey(e){const t=e.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?se(s,this.graph,t):t}isGraphEvent(e){const t=e.target,s=e.currentTarget;return t?t===this.target||s===this.target||t===document.body?!0:Yu(this.container,t):!1}isInputEvent(e){var t;const s=e.target,r=(t=s==null?void 0:s.tagName)===null||t===void 0?void 0:t.toLowerCase();let i=["input","textarea"].includes(r);return pe(s,"contenteditable")==="true"&&(i=!0),i}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),s=this.isInputEvent(e);if(t){if(s&&(e.key==="Backspace"||e.key==="Delete"))return!1;if(this.options.guard)return se(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}C3([wt.dispose()],hi.prototype,"dispose",null),function(n){function e(t){const s=new v3(t.target),r=s.stopCallback;return s.stopCallback=(i,o,a)=>t.isEnabledForEvent(i)?r?r.call(s,i,o,a):!1:!0,s}n.createMousetrap=e}(hi||(hi={})),$.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},$.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},$.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},$.prototype.toggleKeyboard=function(n){const e=this.getPlugin("keyboard");return e&&e.toggleEnabled(n),this},$.prototype.bindKey=function(n,e,t){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,e,t),this},$.prototype.unbindKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.unbindKey(n,e),this},$.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},$.prototype.triggerKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.trigger(n,e),this};var S3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class n0 extends wt{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new hi(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,s){return this.keyboardImpl.on(e,t,s),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}S3([wt.dispose()],n0.prototype,"dispose",null);var E3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},O3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class s0 extends be{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(e){super();const{graph:t}=e,s=O3(e,["graph"]);this.graph=t,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(e){this.options.filter=e}render(){const e=this.containerWrapper=new oe("svg"),t=this.horizontal=new oe("line"),s=this.vertical=new oe("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),s.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),s.setAttribute("display","none"),e.append([t,s]),this.options.className&&e.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:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:s}){const r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){const i=e.cell.getPosition();this.offset={x:t-i.x,y:s-i.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?se(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const s=this.graph.renderer.findViewByCell(e);if(s&&s.cell.isNode()){const r=e.getBBox(),i=r.bbox(e.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),c=ye.normalize(e.getAngle()),u=this.options.tolerance||0;let d,f,h,p,g,m;const y={vertical:0,horizontal:0},b=t.direction,w=t.trueDirection,x=t.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(V=>{if(this.isIgnored(e,V))return!1;const L=V.getBBox().bbox(V.getAngle()),B=L.getTopLeft(),N=L.getBottomRight(),P={vertical:[B.x,N.x],horizontal:[B.y,N.y]},T={};return Object.keys(P).forEach(j=>{const Y=j,te=P[Y].map(z=>({position:z,distance:Math.abs(z-y[Y])})).filter(z=>z.distance<=u);T[Y]=Lc(te,z=>z.distance)}),d==null&&T.vertical.length>0&&(d=T.vertical[0].position,f=Math.min(i.y,L.y),h=Math.max(a.y,N.y)-f),p==null&&T.horizontal.length>0&&(p=T.horizontal[0].position,g=Math.min(i.x,L.x),m=Math.max(a.x,N.x)-g),d!=null&&p!=null}),this.hide();let v=0,C=0;(p!=null||d!=null)&&(d!=null&&(v=w.indexOf("right")!==-1?d-a.x:o.x-d),p!=null&&(C=w.indexOf("bottom")!==-1?p-a.y:o.y-p));let E=0,S=0;if(c%90===0)c===90||c===270?(E=C,S=v):(E=v,S=C);else{const V=c>=0&&c<90?1:c>=90&&c<180?4:c>=180&&c<270?3:2;p!=null&&d!=null&&(v<C?(C=0,p=void 0):(v=0,d=void 0));const L=ye.toRad(c%90);v&&(E=V===3?v/Math.cos(L):v/Math.sin(L)),C&&(S=V===3?C/Math.cos(L):C/Math.sin(L));const B=V===1||V===3;switch(x){case"top":case"bottom":S=C?C/(B?Math.cos(L):Math.sin(L)):v/(B?Math.sin(L):Math.cos(L));break;case"left":case"right":E=v?v/(B?Math.cos(L):Math.sin(L)):C/(B?Math.sin(L):Math.cos(L));break}}switch(x){case"top":case"bottom":E=0;break;case"left":case"right":S=0;break}const O=this.graph.getGridSize();let A=Math.max(r.width+E,O),k=Math.max(r.height+S,O);t.minWidth&&t.minWidth>O&&(A=Math.max(A,t.minWidth)),t.minHeight&&t.minHeight>O&&(k=Math.max(k,t.minHeight)),t.maxWidth&&(A=Math.min(A,t.maxWidth)),t.maxHeight&&(k=Math.min(k,t.maxHeight)),t.preserveAspectRatio&&(S<E?k=A*(r.height/r.width):A=k*(r.width/r.height)),(A!==r.width||k!==r.height)&&(e.resize(A,k,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),h&&(h+=k-r.height),m&&(m+=A-r.width));const _=e.getBBox().bbox(c);d&&Math.abs(_.x-d)>1&&Math.abs(_.width+_.x-d)>1&&(d=void 0),p&&Math.abs(_.y-p)>1&&Math.abs(_.height+_.y-p)>1&&(p=void 0),this.update({verticalLeft:d,verticalTop:f,verticalHeight:h,horizontalTop:p,horizontalLeft:g,horizontalWidth:m})}}}snapOnMoving({view:e,e:t,x:s,y:r}){const i=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),c=o.getPosition(),u=new G(s-this.offset.x,r-this.offset.y,a.width,a.height),d=o.getAngle(),f=u.getCenter(),h=u.bbox(d),p=h.getTopLeft(),g=h.getBottomRight(),m=this.options.tolerance||0;let y,b,w,x,v,C,E=0,S=0;if(this.model.getNodes().some(O=>{if(this.isIgnored(o,O))return!1;const A=O.getBBox().bbox(O.getAngle()),k=A.getCenter(),_=A.getTopLeft(),V=A.getBottomRight();return y==null&&(Math.abs(k.x-f.x)<m?(y=k.x,E=.5):Math.abs(_.x-p.x)<m?(y=_.x,E=0):Math.abs(_.x-g.x)<m?(y=_.x,E=1):Math.abs(V.x-g.x)<m?(y=V.x,E=1):Math.abs(V.x-p.x)<m&&(y=V.x),y!=null&&(b=Math.min(h.y,A.y),w=Math.max(g.y,V.y)-b)),x==null&&(Math.abs(k.y-f.y)<m?(x=k.y,S=.5):Math.abs(_.y-p.y)<m?x=_.y:Math.abs(_.y-g.y)<m?(x=_.y,S=1):Math.abs(V.y-g.y)<m?(x=V.y,S=1):Math.abs(V.y-p.y)<m&&(x=V.y),x!=null&&(v=Math.min(h.x,A.x),C=Math.max(g.x,V.x)-v)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(h.y=x-S*h.height),y!=null&&(h.x=y-E*h.width);const O=h.getCenter(),A=O.x-u.width/2,k=O.y-u.height/2,_=A-c.x,V=k-c.y;(_!==0||V!==0)&&(o.translate(_,V,{snapped:!0,restrict:this.getRestrictArea(i)}),C&&(C+=_),w&&(w+=V)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:v,horizontalWidth:C})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(s=>typeof s=="string"?e.shape===s:e.id===s.id):typeof t=="function"?se(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new M(e.horizontalLeft,e.horizontalTop)),s=this.graph.localToGraph(new M(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${s.x}`:"100%",y2:`${s.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new M(e.verticalLeft,e.verticalTop)),s=this.graph.localToGraph(new M(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.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 e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}E3([be.dispose()],s0.prototype,"dispose",null);const M3=`.x6-widget-snapline {
408
+ `;$.prototype.createTransformWidget=function(n){const e=this.getPlugin("transform");return e&&e.createWidget(n),this},$.prototype.clearTransformWidgets=function(){const n=this.getPlugin("transform");return n&&n.clearWidgets(),this};var w3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class lr extends Ve{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,qr(this.name,b3)}init(e){this.graph=e,!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(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(s,r)=>{this.trigger(s,r),this.graph.trigger(s,r)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new t0(t,e,this.graph):null}getTransformOptions(e){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 t=lr.parseOptionGroup(this.graph,e,this.options.resizing),s=lr.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:typeof t.orthogonal=="boolean"?t.orthogonal:!0,restrictedResizing:!!t.restrict,autoScrollOnResizing:typeof t.autoScroll=="boolean"?t.autoScroll:!0,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:typeof t.allowReverse=="boolean"?t.allowReverse:!0,rotatable:!!s.enabled,rotateGrid:s.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),Xr(this.name)}}w3([Ve.dispose()],lr.prototype,"dispose",null),function(n){function e(t,s,r){const i={};return Object.keys(r||{}).forEach(o=>{const a=r[o];i[o]=typeof a=="function"?a.call(t,s):a}),i}n.parseOptionGroup=e}(lr||(lr={}));var n0={exports:{}};(function(n){(function(e,t,s){if(!e)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"},c,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function d(C,O,A){if(C.addEventListener){C.addEventListener(O,A,!1);return}C.attachEvent("on"+O,A)}function f(C){if(C.type=="keypress"){var O=String.fromCharCode(C.which);return C.shiftKey||(O=O.toLowerCase()),O}return r[C.which]?r[C.which]:i[C.which]?i[C.which]:String.fromCharCode(C.which).toLowerCase()}function h(C,O){return C.sort().join(",")===O.sort().join(",")}function p(C){var O=[];return C.shiftKey&&O.push("shift"),C.altKey&&O.push("alt"),C.ctrlKey&&O.push("ctrl"),C.metaKey&&O.push("meta"),O}function g(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(!c){c={};for(var C in r)C>95&&C<112||r.hasOwnProperty(C)&&(c[r[C]]=C)}return c}function w(C,O,A){return A||(A=b()[C]?"keydown":"keypress"),A=="keypress"&&O.length&&(A="keydown"),A}function x(C){return C==="+"?["+"]:(C=C.replace(/\+{2}/g,"+plus"),C.split("+"))}function S(C,O){var A,k,_,V=[];for(A=x(C),_=0;_<A.length;++_)k=A[_],a[k]&&(k=a[k]),O&&O!="keypress"&&o[k]&&(k=o[k],V.push("shift")),y(k)&&V.push(k);return O=w(k,V,O),{key:k,modifiers:V,action:O}}function v(C,O){return C===null||C===t?!1:C===O?!0:v(C.parentNode,O)}function E(C){var O=this;if(C=C||t,!(O instanceof E))return new E(C);O.target=C,O._callbacks={},O._directMap={};var A={},k,_=!1,V=!1,L=!1;function B(z){z=z||{};var I=!1,U;for(U in A){if(z[U]){I=!0;continue}A[U]=0}I||(L=!1)}function N(z,I,U,F,D,q){var J,ae,Z=[],fe=U.type;if(!O._callbacks[z])return[];for(fe=="keyup"&&y(z)&&(I=[z]),J=0;J<O._callbacks[z].length;++J)if(ae=O._callbacks[z][J],!(!F&&ae.seq&&A[ae.seq]!=ae.level)&&fe==ae.action&&(fe=="keypress"&&!U.metaKey&&!U.ctrlKey||h(I,ae.modifiers))){var Ze=!F&&ae.combo==D,yt=F&&ae.seq==F&&ae.level==q;(Ze||yt)&&O._callbacks[z].splice(J,1),Z.push(ae)}return Z}function P(z,I,U,F){O.stopCallback(I,I.target||I.srcElement,U,F)||z(I,U)===!1&&(g(I),m(I))}O._handleKey=function(z,I,U){var F=N(z,I,U),D,q={},J=0,ae=!1;for(D=0;D<F.length;++D)F[D].seq&&(J=Math.max(J,F[D].level));for(D=0;D<F.length;++D){if(F[D].seq){if(F[D].level!=J)continue;ae=!0,q[F[D].seq]=1,P(F[D].callback,U,F[D].combo,F[D].seq);continue}ae||P(F[D].callback,U,F[D].combo)}var Z=U.type=="keypress"&&V;U.type==L&&!y(z)&&!Z&&B(q),V=ae&&U.type=="keydown"};function T(z){typeof z.which!="number"&&(z.which=z.keyCode);var I=f(z);if(I){if(z.type=="keyup"&&_===I){_=!1;return}O.handleKey(I,p(z),z)}}function j(){clearTimeout(k),k=setTimeout(B,1e3)}function Y(z,I,U,F){A[z]=0;function D(fe){return function(){L=fe,++A[z],j()}}function q(fe){P(U,fe,z),F!=="keyup"&&(_=f(fe)),setTimeout(B,10)}for(var J=0;J<I.length;++J){var ae=J+1===I.length,Z=ae?q:D(F||S(I[J+1]).action);te(I[J],Z,F,z,J)}}function te(z,I,U,F,D){O._directMap[z+":"+U]=I,z=z.replace(/\s+/g," ");var q=z.split(" "),J;if(q.length>1){Y(z,q,I,U);return}J=S(z,U),O._callbacks[J.key]=O._callbacks[J.key]||[],N(J.key,J.modifiers,{type:J.action},F,z,D),O._callbacks[J.key][F?"unshift":"push"]({callback:I,modifiers:J.modifiers,action:J.action,seq:F,level:D,combo:z})}O._bindMultiple=function(z,I,U){for(var F=0;F<z.length;++F)te(z[F],I,U)},d(C,"keypress",T),d(C,"keydown",T),d(C,"keyup",T)}E.prototype.bind=function(C,O,A){var k=this;return C=C instanceof Array?C:[C],k._bindMultiple.call(k,C,O,A),k},E.prototype.unbind=function(C,O){var A=this;return A.bind.call(A,C,function(){},O)},E.prototype.trigger=function(C,O){var A=this;return A._directMap[C+":"+O]&&A._directMap[C+":"+O]({},C),A},E.prototype.reset=function(){var C=this;return C._callbacks={},C._directMap={},C},E.prototype.stopCallback=function(C,O){var A=this;if((" "+O.className+" ").indexOf(" mousetrap ")>-1||v(O,A.target))return!1;if("composedPath"in C&&typeof C.composedPath=="function"){var k=C.composedPath()[0];k!==C.target&&(O=k)}return O.tagName=="INPUT"||O.tagName=="SELECT"||O.tagName=="TEXTAREA"||O.isContentEditable},E.prototype.handleKey=function(){var C=this;return C._handleKey.apply(C,arguments)},E.addKeycodes=function(C){for(var O in C)C.hasOwnProperty(O)&&(r[O]=C[O]);c=null},E.init=function(){var C=E(t);for(var O in C)O.charAt(0)!=="_"&&(E[O]=function(A){return function(){return C[A].apply(C,arguments)}}(O))},E.init(),e.Mousetrap=E,n.exports&&(n.exports=E)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(n0);var x3=n0.exports;const v3=rk(x3);var C3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class hi extends wt{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.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=hi.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(e,t,s){this.mousetrap.bind(this.getKeys(e),t,s)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(t=>this.formatkey(t))}formatkey(e){const t=e.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?se(s,this.graph,t):t}isGraphEvent(e){const t=e.target,s=e.currentTarget;return t?t===this.target||s===this.target||t===document.body?!0:Yu(this.container,t):!1}isInputEvent(e){var t;const s=e.target,r=(t=s==null?void 0:s.tagName)===null||t===void 0?void 0:t.toLowerCase();let i=["input","textarea"].includes(r);return pe(s,"contenteditable")==="true"&&(i=!0),i}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),s=this.isInputEvent(e);if(t){if(s&&(e.key==="Backspace"||e.key==="Delete"))return!1;if(this.options.guard)return se(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}C3([wt.dispose()],hi.prototype,"dispose",null),function(n){function e(t){const s=new v3(t.target),r=s.stopCallback;return s.stopCallback=(i,o,a)=>t.isEnabledForEvent(i)?r?r.call(s,i,o,a):!1:!0,s}n.createMousetrap=e}(hi||(hi={})),$.prototype.isKeyboardEnabled=function(){const n=this.getPlugin("keyboard");return n?n.isEnabled():!1},$.prototype.enableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.enable(),this},$.prototype.disableKeyboard=function(){const n=this.getPlugin("keyboard");return n&&n.disable(),this},$.prototype.toggleKeyboard=function(n){const e=this.getPlugin("keyboard");return e&&e.toggleEnabled(n),this},$.prototype.bindKey=function(n,e,t){const s=this.getPlugin("keyboard");return s&&s.bindKey(n,e,t),this},$.prototype.unbindKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.unbindKey(n,e),this},$.prototype.clearKeys=function(){const n=this.getPlugin("keyboard");return n&&n.clear(),this},$.prototype.triggerKey=function(n,e){const t=this.getPlugin("keyboard");return t&&t.trigger(n,e),this};var S3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class s0 extends wt{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new hi(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,s){return this.keyboardImpl.on(e,t,s),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}S3([wt.dispose()],s0.prototype,"dispose",null);var E3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},O3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class r0 extends be{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(e){super();const{graph:t}=e,s=O3(e,["graph"]);this.graph=t,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(e){this.options.filter=e}render(){const e=this.containerWrapper=new oe("svg"),t=this.horizontal=new oe("line"),s=this.vertical=new oe("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),s.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),s.setAttribute("display","none"),e.append([t,s]),this.options.className&&e.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:e,data:t}){e==="resize"&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:s}){const r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){const i=e.cell.getPosition();this.offset={x:t-i.x,y:s-i.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,s=typeof t=="function"?se(t,this.graph,e):t;return typeof s=="number"?this.graph.transform.getGraphArea().inflate(s):s===!0?this.graph.transform.getGraphArea():s||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const s=this.graph.renderer.findViewByCell(e);if(s&&s.cell.isNode()){const r=e.getBBox(),i=r.bbox(e.getAngle()),o=i.getTopLeft(),a=i.getBottomRight(),c=ye.normalize(e.getAngle()),u=this.options.tolerance||0;let d,f,h,p,g,m;const y={vertical:0,horizontal:0},b=t.direction,w=t.trueDirection,x=t.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(V=>{if(this.isIgnored(e,V))return!1;const L=V.getBBox().bbox(V.getAngle()),B=L.getTopLeft(),N=L.getBottomRight(),P={vertical:[B.x,N.x],horizontal:[B.y,N.y]},T={};return Object.keys(P).forEach(j=>{const Y=j,te=P[Y].map(z=>({position:z,distance:Math.abs(z-y[Y])})).filter(z=>z.distance<=u);T[Y]=Lc(te,z=>z.distance)}),d==null&&T.vertical.length>0&&(d=T.vertical[0].position,f=Math.min(i.y,L.y),h=Math.max(a.y,N.y)-f),p==null&&T.horizontal.length>0&&(p=T.horizontal[0].position,g=Math.min(i.x,L.x),m=Math.max(a.x,N.x)-g),d!=null&&p!=null}),this.hide();let S=0,v=0;(p!=null||d!=null)&&(d!=null&&(S=w.indexOf("right")!==-1?d-a.x:o.x-d),p!=null&&(v=w.indexOf("bottom")!==-1?p-a.y:o.y-p));let E=0,C=0;if(c%90===0)c===90||c===270?(E=v,C=S):(E=S,C=v);else{const V=c>=0&&c<90?1:c>=90&&c<180?4:c>=180&&c<270?3:2;p!=null&&d!=null&&(S<v?(v=0,p=void 0):(S=0,d=void 0));const L=ye.toRad(c%90);S&&(E=V===3?S/Math.cos(L):S/Math.sin(L)),v&&(C=V===3?v/Math.cos(L):v/Math.sin(L));const B=V===1||V===3;switch(x){case"top":case"bottom":C=v?v/(B?Math.cos(L):Math.sin(L)):S/(B?Math.sin(L):Math.cos(L));break;case"left":case"right":E=S?S/(B?Math.cos(L):Math.sin(L)):v/(B?Math.sin(L):Math.cos(L));break}}switch(x){case"top":case"bottom":E=0;break;case"left":case"right":C=0;break}const O=this.graph.getGridSize();let A=Math.max(r.width+E,O),k=Math.max(r.height+C,O);t.minWidth&&t.minWidth>O&&(A=Math.max(A,t.minWidth)),t.minHeight&&t.minHeight>O&&(k=Math.max(k,t.minHeight)),t.maxWidth&&(A=Math.min(A,t.maxWidth)),t.maxHeight&&(k=Math.min(k,t.maxHeight)),t.preserveAspectRatio&&(C<E?k=A*(r.height/r.width):A=k*(r.width/r.height)),(A!==r.width||k!==r.height)&&(e.resize(A,k,{direction:b,relativeDirection:x,trueDirection:w,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(s)}),h&&(h+=k-r.height),m&&(m+=A-r.width));const _=e.getBBox().bbox(c);d&&Math.abs(_.x-d)>1&&Math.abs(_.width+_.x-d)>1&&(d=void 0),p&&Math.abs(_.y-p)>1&&Math.abs(_.height+_.y-p)>1&&(p=void 0),this.update({verticalLeft:d,verticalTop:f,verticalHeight:h,horizontalTop:p,horizontalLeft:g,horizontalWidth:m})}}}snapOnMoving({view:e,e:t,x:s,y:r}){const i=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(i))return;const o=i.cell,a=o.getSize(),c=o.getPosition(),u=new G(s-this.offset.x,r-this.offset.y,a.width,a.height),d=o.getAngle(),f=u.getCenter(),h=u.bbox(d),p=h.getTopLeft(),g=h.getBottomRight(),m=this.options.tolerance||0;let y,b,w,x,S,v,E=0,C=0;if(this.model.getNodes().some(O=>{if(this.isIgnored(o,O))return!1;const A=O.getBBox().bbox(O.getAngle()),k=A.getCenter(),_=A.getTopLeft(),V=A.getBottomRight();return y==null&&(Math.abs(k.x-f.x)<m?(y=k.x,E=.5):Math.abs(_.x-p.x)<m?(y=_.x,E=0):Math.abs(_.x-g.x)<m?(y=_.x,E=1):Math.abs(V.x-g.x)<m?(y=V.x,E=1):Math.abs(V.x-p.x)<m&&(y=V.x),y!=null&&(b=Math.min(h.y,A.y),w=Math.max(g.y,V.y)-b)),x==null&&(Math.abs(k.y-f.y)<m?(x=k.y,C=.5):Math.abs(_.y-p.y)<m?x=_.y:Math.abs(_.y-g.y)<m?(x=_.y,C=1):Math.abs(V.y-g.y)<m?(x=V.y,C=1):Math.abs(V.y-p.y)<m&&(x=V.y),x!=null&&(S=Math.min(h.x,A.x),v=Math.max(g.x,V.x)-S)),y!=null&&x!=null}),this.hide(),x!=null||y!=null){x!=null&&(h.y=x-C*h.height),y!=null&&(h.x=y-E*h.width);const O=h.getCenter(),A=O.x-u.width/2,k=O.y-u.height/2,_=A-c.x,V=k-c.y;(_!==0||V!==0)&&(o.translate(_,V,{snapped:!0,restrict:this.getRestrictArea(i)}),v&&(v+=_),w&&(w+=V)),this.update({verticalLeft:y,verticalTop:b,verticalHeight:w,horizontalTop:x,horizontalLeft:S,horizontalWidth:v})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(s=>typeof s=="string"?e.shape===s:e.id===s.id):typeof t=="function"?se(t,this.graph,e):!0}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new M(e.horizontalLeft,e.horizontalTop)),s=this.graph.localToGraph(new M(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${s.x}`:"100%",y2:`${s.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new M(e.verticalLeft,e.verticalTop)),s=this.graph.localToGraph(new M(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.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 e=this.options.clean,t=typeof e=="number"?e:e!==!1?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{this.container.parentNode!==null&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}E3([be.dispose()],r0.prototype,"dispose",null);const M3=`.x6-widget-snapline {
409
409
  position: absolute;
410
410
  top: 0;
411
411
  right: 0;
@@ -418,7 +418,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
418
418
  stroke: #2ecc71;
419
419
  stroke-width: 1px;
420
420
  }
421
- `;$.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},$.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},$.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},$.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},$.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},$.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},$.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},$.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},$.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},$.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},$.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},$.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},$.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},$.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},$.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},$.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var P3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class r0 extends wt{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),qr(this.name,M3)}init(e){this.snaplineImpl=new s0(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),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(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?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(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),Xr(this.name)}}P3([wt.dispose()],r0.prototype,"dispose",null);class N3{constructor(){this.cells=[]}copy(e,t,s={}){this.options=Object.assign({},s);const i=(nt.isModel(t)?t:t.model).cloneSubGraph(e,s);this.cells=Lc(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(e,t,s={}){this.copy(e,t,s),($.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(i=>i.remove())})}paste(e,t={}){const s=Object.assign(Object.assign({},this.options),t),{offset:r,edgeProps:i,nodeProps:o}=s;let a=20,c=20;r&&(a=typeof r=="number"?r:r.dx,c=typeof r=="number"?r:r.dy),this.deserialize(s);const u=this.cells;u.forEach(f=>{f.model=null,f.removeProp("zIndex"),(a||c)&&f.translate(a,c),o&&f.isNode()&&f.prop(o),i&&f.isEdge()&&f.prop(i)});const d=$.isGraph(e)?e.model:e;return d.batchUpdate("paste",()=>{d.addCells(this.cells)}),this.copy(u,e,t),u}serialize(e){e.useLocalStorage!==!1&&vo.save(this.cells)}deserialize(e){if(e.useLocalStorage){const t=vo.fetch();t&&(this.cells=t)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],vo.clean()}}var vo;(function(n){const e=`${Jt.prefixCls}.clipboard.cells`;function t(i){if(window.localStorage){const o=i.map(a=>a.toJSON());localStorage.setItem(e,JSON.stringify(o))}}n.save=t;function s(){if(window.localStorage){const i=localStorage.getItem(e),o=i?JSON.parse(i):[];if(o)return nt.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(e)}n.clean=r})(vo||(vo={})),$.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},$.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},$.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},$.prototype.toggleClipboard=function(n){const e=this.getPlugin("clipboard");return e&&e.toggleEnabled(n),this},$.prototype.isClipboardEmpty=function(n){const e=this.getPlugin("clipboard");return e?e.isEmpty(n):!0},$.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},$.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},$.prototype.copy=function(n,e){const t=this.getPlugin("clipboard");return t&&t.copy(n,e),this},$.prototype.cut=function(n,e){const t=this.getPlugin("clipboard");return t&&t.cut(n,e),this},$.prototype.paste=function(n,e){const t=this.getPlugin("clipboard");return t?t.paste(n,e):[]};var A3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},_3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class i0 extends Ve{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new N3,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return(!this.disabled||e)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options;return _3(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}A3([Ve.dispose()],i0.prototype,"dispose",null),$.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},$.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},$.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},$.prototype.toggleHistory=function(n){const e=this.getPlugin("history");return e&&e.toggleEnabled(n),this},$.prototype.undo=function(n){const e=this.getPlugin("history");return e&&e.undo(n),this},$.prototype.redo=function(n){const e=this.getPlugin("history");return e&&e.redo(n),this},$.prototype.undoAndCancel=function(n){const e=this.getPlugin("history");return e&&e.cancel(n),this},$.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},$.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},$.prototype.cleanHistory=function(n){const e=this.getPlugin("history");return e&&e.clean(n),this},$.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},$.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},$.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},$.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var o0=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class fi extends Ve{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Le.getOptions(e),this.validator=new fi.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,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(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}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(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return this.options.enabled!==!0}validate(e,...t){return this.validator.validate(e,...t),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((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:e?e.batch:!1,data:{}}}revertCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},t),Ic(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},t),Ic(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,o)}this.freezed=!1}executeCommand(e,t,s){const r=this.model,i=r.getCell(e.data.id),o=e.event;if(Le.isAddEvent(o)&&t||Le.isRemoveEvent(o)&&!t)i&&i.remove(s);else if(Le.isAddEvent(o)&&!t||Le.isRemoveEvent(o)&&t){const a=e.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(Le.isChangeEvent(o)){const a=e.data,c=a.key;if(c&&i){const u=t?a.prev[c]:a.next[c];a.key==="attrs"&&this.ensureUndefinedAttrs(u,t?a.next[c]:a.prev[c])&&(s.dirty=!0),i.prop(c,u,s)}}else{const a=this.options.executeCommand;a&&se(a,this,e,t,s)}}addCommand(e,t){if(this.freezed||this.disabled)return;const s=t,r=s.options||{};if(r.dryrun||Le.isAddEvent(e)&&this.options.ignoreAdd||Le.isRemoveEvent(e)&&this.options.ignoreRemove||Le.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&se(i,this,e,t)===!1)return;e==="cell:change:*"&&(e=`cell:change:${s.key}`);const o=s.cell,a=nt.isModel(o);let c;if(this.batchCommands){c=this.batchCommands[Math.max(this.lastBatchIndex,0)];const d=a&&!c.modelChange||c.data.id!==o.id,f=c.event!==e;if(this.lastBatchIndex>=0&&(d||f)){const h=this.batchCommands.findIndex(p=>(a&&p.modelChange||p.data.id===o.id)&&p.event===e);h<0||Le.isAddEvent(e)||Le.isRemoveEvent(e)?c=this.createCommand({batch:!0}):(c=this.batchCommands[h],this.batchCommands.splice(h,1)),this.batchCommands.push(c),this.lastBatchIndex=this.batchCommands.length-1}}else c=this.createCommand({batch:!1});if(Le.isAddEvent(e)||Le.isRemoveEvent(e)){const d=c.data;return c.event=e,c.options=r,d.id=o.id,d.props=ke(o.toJSON()),o.isEdge()?d.edge=!0:o.isNode()&&(d.node=!0),this.push(c,r)}if(Le.isChangeEvent(e)){const d=t.key,f=c.data;return(!c.batch||!c.event)&&(c.event=e,c.options=r,f.key=d,f.prev==null&&(f.prev={}),f.prev[d]=ke(o.previous(d)),a?c.modelChange=!0:f.id=o.id),f.next==null&&(f.next={}),f.next[d]=ke(o.prop(d)),this.push(c,r)}const u=this.options.afterAddCommand;u&&se(u,this,e,t,c),this.push(c,r)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const s=[];for(;t.length>0;){const r=t.shift(),i=r.event,o=r.data.id;if(i!=null&&(o!=null||r.modelChange)){if(Le.isAddEvent(i)){const a=t.findIndex(c=>Le.isRemoveEvent(c.event)&&c.data.id===o);if(a>=0){t=t.filter((c,u)=>a<u||c.data.id!==o);continue}}else if(Le.isRemoveEvent(i)){const a=t.findIndex(c=>Le.isAddEvent(c.event)&&c.data.id===o);if(a>=0){t.splice(a,1);continue}}else if(Le.isChangeEvent(i)){const a=r.data;if(Pn(a.prev,a.next))continue}s.push(r)}}return s}notify(e,t,s){const r=t==null?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:r,options:s}),this.graph.trigger(`history:${e}`,{cmds:r,options:s}),this.emit("change",{cmds:r,options:s}),this.graph.trigger("history:change",{cmds:r,options:s})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],s=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const r=new Set(t.map(o=>o.event));if(r.size!==2||!r.has("cell:change:parent")||!r.has("cell:change:children")||!t.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"||!(!((e=i.options)===null||e===void 0)&&e.ui)||(s.push(...t),this.undoStack.pop())}undoStackPush(e){if(this.stackSize===0){this.undoStack.push(e);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let s=!1;return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(r=>{e[r]===void 0&&t[r]!==void 0?(e[r]=void 0,s=!0):typeof e[r]=="object"&&typeof t[r]=="object"&&(s=this.ensureUndefinedAttrs(e[r],t[r]))}),s}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}o0([Ve.dispose()],fi.prototype,"dispose",null),function(n){class e extends Ve{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 c=u=>{const d=o[a];a+=1;try{if(d)d(u,s,c);else{i=u;return}}catch(f){c(f)}};c(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)}}o0([Ve.dispose()],e.prototype,"dispose",null),n.Validator=e}(fi||(fi={}));var Le;(function(n){function e(o){return o==="cell:added"}n.isAddEvent=e;function t(o){return o==="cell:removed"}n.isRemoveEvent=t;function s(o){return o!=null&&o.startsWith("cell:change:")}n.isChangeEvent=s;function r(o){const a=["cell:added","cell:removed","cell:change:*"],c=["batch:start","batch:stop"],u=o.eventNames?o.eventNames.filter(d=>!(n.isChangeEvent(d)||a.includes(d)||c.includes(d))):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 c=0,u=o.length;c<u;c+=1){const d=o[c];let f=null;if(n.isAddEvent(d.event)){const h=d.data.id;for(let p=0;p<c;p+=1)if(o[p].data.id===h){f=p;break}}f!==null?a.splice(f,0,d):a.push(d)}return a}n.sortBatchCommands=i})(Le||(Le={}));var T3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class a0 extends be{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Pt.classNames.box)}get $boxes(){return LD(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Ol([],{comparator:Pt.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:s,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a,snapped:c}=t,u=(s!==!0||r&&this.getPointerEventsValue(r)==="none")&&!this.translating&&!o,d=i&&a&&e.id===a;if(u&&(d||c)){this.translating=!0;const f=e.position(),h=e.previous("position"),p=f.x-h.x,g=f.y-h.y;(p!==0||g!==0)&&this.translateSelectedNodes(p,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const s=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(s,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const u=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(u,Object.assign(Object.assign({},t),{ui:!0})),this}const s=this.cells,r=this.filter(Array.isArray(e)?e:[e]),i={},o={};s.forEach(u=>i[u.id]=u),r.forEach(u=>o[u.id]=u);const a=[],c=[];return r.forEach(u=>{i[u.id]||a.push(u)}),s.forEach(u=>{o[u.id]||c.push(u)}),c.length&&this.unselect(c,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),c.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,s;const r=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&r.contains(e.target))t=e.offsetX,s=e.offsetY;else{const i=sd(r),o=r.scrollLeft,a=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,s=e.clientY-i.top+window.pageYOffset+a}Je(this.container,{top:s,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:s,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Pt.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(s=>Array.isArray(t)?t.some(r=>typeof r=="string"?s.shape===r:s.id===r.id):typeof t=="function"?se(t,this.graph,s):!0)}stopSelecting(e){const t=this.graph,s=this.getEventData(e);switch(s.action){case"selecting":{let i=bR(this.container),o=wR(this.container);const a=sd(this.container),c=t.pageToLocal(a.left,a.top),u=t.transform.getScale();i/=u.sx,o/=u.sy;const d=new G(c.x,c.y,i,o),f=this.getCellViewsInArea(d).map(h=>h.cell);this.reset(f,{batch:!0}),this.hideRubberband();break}case"translating":{const i=t.snapToGrid(e.clientX,e.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",e,i.x,i.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const s=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:s});const r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(Pt.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?se(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let s=e.x-t.clientX,r=e.y-t.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=ge.getCellsBBox(o,{deep:!0})||G.create(),c=i.x-a.x,u=i.y-a.y,d=i.x+i.width-(a.x+a.width),f=i.y+i.height-(a.y+a.height);if(s<c&&(s=c),r<u&&(r=u),d<s&&(s=d),f<r&&(r=f),!this.options.following){const h=e.x-t.originX,p=e.y-t.originY;s=h<=c||h>=d?0:s,r=p<=u||p>=f?0:r}}return{dx:s,dy:r}}updateElementPosition(e,t,s){const r=Je(e,"left"),i=Je(e,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;Je(e,"left",o+t),Je(e,"top",a+s)}updateSelectedNodesPosition(e){const{dx:t,dy:s}=e;if(t||s)if(this.translateSelectedNodes(t,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],t*r.sx,s*r.sy);this.updateElementPosition(this.selectionContainer,t*r.sx,s*r.sy)}}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");return s?s.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),s=this.getEventData(t);switch(s.action){case"selecting":{const i=s;i.moving!==!0&&(xs(this.container,this.graph.container),this.showRubberband(),i.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);i.scrollerX+=o,i.scrollerY+=a;const c=t.clientX-i.clientX+i.scrollerX,u=t.clientY-i.clientY+i.scrollerY,d=parseInt(Je(this.container,"left")||"0",10),f=parseInt(Je(this.container,"top")||"0",10);Je(this.container,{left:c<0?i.offsetX+c:d,top:u<0?i.offsetY+u:f,width:Math.abs(c),height:Math.abs(u)});break}case"translating":{const i=this.graph.snapToGrid(t.clientX,t.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",e,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,s,r){const i={},o=[];if(s&&(i[s.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0})}),r&&r.translateBy){const a=this.graph.getCellById(r.translateBy);a&&(i[a.id]=!0,a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!i[a.id]){const c=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});a.translate(e,t,c),this.graph.model.getConnectedEdges(a).forEach(u=>{i[u.id]||(u.translate(e,t,c),i[u.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,s={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),r}notifyBoxEvent(e,t,s,r){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:s,y:r,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(Yt(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),Yt(this.$boxes),this.boxCount=0}hide(){Ie(this.container,this.prefixClassName(Pt.classNames.rubberband)),Ie(this.container,this.prefixClassName(Pt.classNames.selected))}showRubberband(){ee(this.container,this.prefixClassName(Pt.classNames.rubberband))}hideRubberband(){Ie(this.container,this.prefixClassName(Pt.classNames.rubberband))}showSelected(){Xu(this.container,"style"),ee(this.container,this.prefixClassName(Pt.classNames.selected))}createContainer(){this.container=document.createElement("div"),ee(this.container,this.prefixClassName(Pt.classNames.root)),this.options.className&&ee(this.container,this.options.className),this.selectionContainer=document.createElement("div"),ee(this.selectionContainer,this.prefixClassName(Pt.classNames.inner)),this.selectionContent=document.createElement("div"),ee(this.selectionContent,this.prefixClassName(Pt.classNames.content)),Lt(this.selectionContainer,this.selectionContent),pe(this.selectionContainer,"data-selection-length",this.collection.length),Cy(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={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});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),Je(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),pe(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=se(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?xs(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(e){return typeof e=="string"?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const s=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;ee(i,r),ee(i,`${r}-${e.isNode()?"node":"edge"}`),pe(i,"data-cell-id",e.id),Je(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),xs(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 e=0,t=this.$boxes,s=t.length;e<s;e+=1){const r=t[e],i=pe(r,"data-cell-id");Yt(r),this.boxCount-=1;const o=this.collection.get(i);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const s=this.collection.get(t);if(s)return this.graph.renderer.findViewByCell(s)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(s=>{this.listenCellRemoveEvent(s),this.createSelectionBox(s)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:s}){e.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})}),t.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:e,removed:t,options:s,selected:this.cells.filter(i=>!!this.graph.getCellById(i.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}T3([be.dispose()],a0.prototype,"dispose",null);var Pt;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(s){return s.getAncestors().length}n.depthComparator=t})(Pt||(Pt={}));const k3=`.x6-widget-selection {
421
+ `;$.prototype.isSnaplineEnabled=function(){const n=this.getPlugin("snapline");return n?n.isEnabled():!1},$.prototype.enableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enable(),this},$.prototype.disableSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disable(),this},$.prototype.toggleSnapline=function(){const n=this.getPlugin("snapline");return n&&n.toggleEnabled(),this},$.prototype.hideSnapline=function(){const n=this.getPlugin("snapline");return n&&n.hide(),this},$.prototype.setSnaplineFilter=function(n){const e=this.getPlugin("snapline");return e&&e.setFilter(n),this},$.prototype.isSnaplineOnResizingEnabled=function(){const n=this.getPlugin("snapline");return n?n.isOnResizingEnabled():!1},$.prototype.enableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.enableOnResizing(),this},$.prototype.disableSnaplineOnResizing=function(){const n=this.getPlugin("snapline");return n&&n.disableOnResizing(),this},$.prototype.toggleSnaplineOnResizing=function(n){const e=this.getPlugin("snapline");return e&&e.toggleOnResizing(n),this},$.prototype.isSharpSnapline=function(){const n=this.getPlugin("snapline");return n?n.isSharp():!1},$.prototype.enableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.enableSharp(),this},$.prototype.disableSharpSnapline=function(){const n=this.getPlugin("snapline");return n&&n.disableSharp(),this},$.prototype.toggleSharpSnapline=function(n){const e=this.getPlugin("snapline");return e&&e.toggleSharp(n),this},$.prototype.getSnaplineTolerance=function(){const n=this.getPlugin("snapline");if(n)return n.getTolerance()},$.prototype.setSnaplineTolerance=function(n){const e=this.getPlugin("snapline");return e&&e.setTolerance(n),this};var P3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class i0 extends wt{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),qr(this.name,M3)}init(e){this.snaplineImpl=new r0(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(e!=null)e!==this.isEnabled()&&(e?this.enable():this.disable());else return this.isEnabled()?this.disable():this.enable(),this}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),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(e){return e!=null?e!==this.isOnResizingEnabled()&&(e?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(e){return e!=null?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),Xr(this.name)}}P3([wt.dispose()],i0.prototype,"dispose",null);class N3{constructor(){this.cells=[]}copy(e,t,s={}){this.options=Object.assign({},s);const i=(nt.isModel(t)?t:t.model).cloneSubGraph(e,s);this.cells=Lc(Object.keys(i).map(o=>i[o]),o=>o.isEdge()?2:1),this.serialize(s)}cut(e,t,s={}){this.copy(e,t,s),($.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(i=>i.remove())})}paste(e,t={}){const s=Object.assign(Object.assign({},this.options),t),{offset:r,edgeProps:i,nodeProps:o}=s;let a=20,c=20;r&&(a=typeof r=="number"?r:r.dx,c=typeof r=="number"?r:r.dy),this.deserialize(s);const u=this.cells;u.forEach(f=>{f.model=null,f.removeProp("zIndex"),(a||c)&&f.translate(a,c),o&&f.isNode()&&f.prop(o),i&&f.isEdge()&&f.prop(i)});const d=$.isGraph(e)?e.model:e;return d.batchUpdate("paste",()=>{d.addCells(this.cells)}),this.copy(u,e,t),u}serialize(e){e.useLocalStorage!==!1&&vo.save(this.cells)}deserialize(e){if(e.useLocalStorage){const t=vo.fetch();t&&(this.cells=t)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],vo.clean()}}var vo;(function(n){const e=`${Jt.prefixCls}.clipboard.cells`;function t(i){if(window.localStorage){const o=i.map(a=>a.toJSON());localStorage.setItem(e,JSON.stringify(o))}}n.save=t;function s(){if(window.localStorage){const i=localStorage.getItem(e),o=i?JSON.parse(i):[];if(o)return nt.fromJSON(o)}}n.fetch=s;function r(){window.localStorage&&localStorage.removeItem(e)}n.clean=r})(vo||(vo={})),$.prototype.isClipboardEnabled=function(){const n=this.getPlugin("clipboard");return n?n.isEnabled():!1},$.prototype.enableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.enable(),this},$.prototype.disableClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.disable(),this},$.prototype.toggleClipboard=function(n){const e=this.getPlugin("clipboard");return e&&e.toggleEnabled(n),this},$.prototype.isClipboardEmpty=function(n){const e=this.getPlugin("clipboard");return e?e.isEmpty(n):!0},$.prototype.getCellsInClipboard=function(){const n=this.getPlugin("clipboard");return n?n.getCellsInClipboard():[]},$.prototype.cleanClipboard=function(){const n=this.getPlugin("clipboard");return n&&n.clean(),this},$.prototype.copy=function(n,e){const t=this.getPlugin("clipboard");return t&&t.copy(n,e),this},$.prototype.cut=function(n,e){const t=this.getPlugin("clipboard");return t&&t.cut(n,e),this},$.prototype.paste=function(n,e){const t=this.getPlugin("clipboard");return t?t.paste(n,e):[]};var A3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i},_3=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};class o0 extends Ve{get disabled(){return this.options.enabled!==!0}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new N3,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return(!this.disabled||e)&&(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options;return _3(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}A3([Ve.dispose()],o0.prototype,"dispose",null),$.prototype.isHistoryEnabled=function(){const n=this.getPlugin("history");return n?n.isEnabled():!1},$.prototype.enableHistory=function(){const n=this.getPlugin("history");return n&&n.enable(),this},$.prototype.disableHistory=function(){const n=this.getPlugin("history");return n&&n.disable(),this},$.prototype.toggleHistory=function(n){const e=this.getPlugin("history");return e&&e.toggleEnabled(n),this},$.prototype.undo=function(n){const e=this.getPlugin("history");return e&&e.undo(n),this},$.prototype.redo=function(n){const e=this.getPlugin("history");return e&&e.redo(n),this},$.prototype.undoAndCancel=function(n){const e=this.getPlugin("history");return e&&e.cancel(n),this},$.prototype.canUndo=function(){const n=this.getPlugin("history");return n?n.canUndo():!1},$.prototype.canRedo=function(){const n=this.getPlugin("history");return n?n.canRedo():!1},$.prototype.cleanHistory=function(n){const e=this.getPlugin("history");return e&&e.clean(n),this},$.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},$.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},$.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},$.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var a0=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class fi extends Ve{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Le.getOptions(e),this.validator=new fi.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,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(e){return e!=null?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}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(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return this.options.enabled!==!0}validate(e,...t){return this.validator.validate(e,...t),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((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:e?e.batch:!1,data:{}}}revertCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=s.length-1;r>=0;r-=1){const i=s[r],o=Object.assign(Object.assign({},t),Ic(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const s=Array.isArray(e)?Le.sortBatchCommands(e):[e];for(let r=0;r<s.length;r+=1){const i=s[r],o=Object.assign(Object.assign({},t),Ic(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,o)}this.freezed=!1}executeCommand(e,t,s){const r=this.model,i=r.getCell(e.data.id),o=e.event;if(Le.isAddEvent(o)&&t||Le.isRemoveEvent(o)&&!t)i&&i.remove(s);else if(Le.isAddEvent(o)&&!t||Le.isRemoveEvent(o)&&t){const a=e.data;a.node?r.addNode(a.props,s):a.edge&&r.addEdge(a.props,s)}else if(Le.isChangeEvent(o)){const a=e.data,c=a.key;if(c&&i){const u=t?a.prev[c]:a.next[c];a.key==="attrs"&&this.ensureUndefinedAttrs(u,t?a.next[c]:a.prev[c])&&(s.dirty=!0),i.prop(c,u,s)}}else{const a=this.options.executeCommand;a&&se(a,this,e,t,s)}}addCommand(e,t){if(this.freezed||this.disabled)return;const s=t,r=s.options||{};if(r.dryrun||Le.isAddEvent(e)&&this.options.ignoreAdd||Le.isRemoveEvent(e)&&this.options.ignoreRemove||Le.isChangeEvent(e)&&this.options.ignoreChange)return;const i=this.options.beforeAddCommand;if(i!=null&&se(i,this,e,t)===!1)return;e==="cell:change:*"&&(e=`cell:change:${s.key}`);const o=s.cell,a=nt.isModel(o);let c;if(this.batchCommands){c=this.batchCommands[Math.max(this.lastBatchIndex,0)];const d=a&&!c.modelChange||c.data.id!==o.id,f=c.event!==e;if(this.lastBatchIndex>=0&&(d||f)){const h=this.batchCommands.findIndex(p=>(a&&p.modelChange||p.data.id===o.id)&&p.event===e);h<0||Le.isAddEvent(e)||Le.isRemoveEvent(e)?c=this.createCommand({batch:!0}):(c=this.batchCommands[h],this.batchCommands.splice(h,1)),this.batchCommands.push(c),this.lastBatchIndex=this.batchCommands.length-1}}else c=this.createCommand({batch:!1});if(Le.isAddEvent(e)||Le.isRemoveEvent(e)){const d=c.data;return c.event=e,c.options=r,d.id=o.id,d.props=ke(o.toJSON()),o.isEdge()?d.edge=!0:o.isNode()&&(d.node=!0),this.push(c,r)}if(Le.isChangeEvent(e)){const d=t.key,f=c.data;return(!c.batch||!c.event)&&(c.event=e,c.options=r,f.key=d,f.prev==null&&(f.prev={}),f.prev[d]=ke(o.previous(d)),a?c.modelChange=!0:f.id=o.id),f.next==null&&(f.next={}),f.next[d]=ke(o.prop(d)),this.push(c,r)}const u=this.options.afterAddCommand;u&&se(u,this,e,t,c),this.push(c,r)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const s=[];for(;t.length>0;){const r=t.shift(),i=r.event,o=r.data.id;if(i!=null&&(o!=null||r.modelChange)){if(Le.isAddEvent(i)){const a=t.findIndex(c=>Le.isRemoveEvent(c.event)&&c.data.id===o);if(a>=0){t=t.filter((c,u)=>a<u||c.data.id!==o);continue}}else if(Le.isRemoveEvent(i)){const a=t.findIndex(c=>Le.isAddEvent(c.event)&&c.data.id===o);if(a>=0){t.splice(a,1);continue}}else if(Le.isChangeEvent(i)){const a=r.data;if(Pn(a.prev,a.next))continue}s.push(r)}}return s}notify(e,t,s){const r=t==null?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:r,options:s}),this.graph.trigger(`history:${e}`,{cmds:r,options:s}),this.emit("change",{cmds:r,options:s}),this.graph.trigger("history:change",{cmds:r,options:s})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],s=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const r=new Set(t.map(o=>o.event));if(r.size!==2||!r.has("cell:change:parent")||!r.has("cell:change:children")||!t.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"||!(!((e=i.options)===null||e===void 0)&&e.ui)||(s.push(...t),this.undoStack.pop())}undoStackPush(e){if(this.stackSize===0){this.undoStack.push(e);return}this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let s=!1;return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(r=>{e[r]===void 0&&t[r]!==void 0?(e[r]=void 0,s=!0):typeof e[r]=="object"&&typeof t[r]=="object"&&(s=this.ensureUndefinedAttrs(e[r],t[r]))}),s}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}a0([Ve.dispose()],fi.prototype,"dispose",null),function(n){class e extends Ve{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 c=u=>{const d=o[a];a+=1;try{if(d)d(u,s,c);else{i=u;return}}catch(f){c(f)}};c(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)}}a0([Ve.dispose()],e.prototype,"dispose",null),n.Validator=e}(fi||(fi={}));var Le;(function(n){function e(o){return o==="cell:added"}n.isAddEvent=e;function t(o){return o==="cell:removed"}n.isRemoveEvent=t;function s(o){return o!=null&&o.startsWith("cell:change:")}n.isChangeEvent=s;function r(o){const a=["cell:added","cell:removed","cell:change:*"],c=["batch:start","batch:stop"],u=o.eventNames?o.eventNames.filter(d=>!(n.isChangeEvent(d)||a.includes(d)||c.includes(d))):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 c=0,u=o.length;c<u;c+=1){const d=o[c];let f=null;if(n.isAddEvent(d.event)){const h=d.data.id;for(let p=0;p<c;p+=1)if(o[p].data.id===h){f=p;break}}f!==null?a.splice(f,0,d):a.push(d)}return a}n.sortBatchCommands=i})(Le||(Le={}));var T3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class l0 extends be{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Pt.classNames.box)}get $boxes(){return LD(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Ol([],{comparator:Pt.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:s,pointerEvents:r}=this.options,{ui:i,selection:o,translateBy:a,snapped:c}=t,u=(s!==!0||r&&this.getPointerEventsValue(r)==="none")&&!this.translating&&!o,d=i&&a&&e.id===a;if(u&&(d||c)){this.translating=!0;const f=e.position(),h=e.previous("position"),p=f.x-h.x,g=f.y-h.y;(p!==0||g!==0)&&this.translateSelectedNodes(p,g,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const s=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(s,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const u=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(u,Object.assign(Object.assign({},t),{ui:!0})),this}const s=this.cells,r=this.filter(Array.isArray(e)?e:[e]),i={},o={};s.forEach(u=>i[u.id]=u),r.forEach(u=>o[u.id]=u);const a=[],c=[];return r.forEach(u=>{i[u.id]||a.push(u)}),s.forEach(u=>{o[u.id]||c.push(u)}),c.length&&this.unselect(c,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),c.length===0&&a.length===0&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(e.batch===!1?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){e=this.normalizeEvent(e),this.clean();let t,s;const r=this.graph.container;if(e.offsetX!=null&&e.offsetY!=null&&r.contains(e.target))t=e.offsetX,s=e.offsetY;else{const i=sd(r),o=r.scrollLeft,a=r.scrollTop;t=e.clientX-i.left+window.pageXOffset+o,s=e.clientY-i.top+window.pageYOffset+a}Je(this.container,{top:s,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:s,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Pt.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(s=>Array.isArray(t)?t.some(r=>typeof r=="string"?s.shape===r:s.id===r.id):typeof t=="function"?se(t,this.graph,s):!0)}stopSelecting(e){const t=this.graph,s=this.getEventData(e);switch(s.action){case"selecting":{let i=bR(this.container),o=wR(this.container);const a=sd(this.container),c=t.pageToLocal(a.left,a.top),u=t.transform.getScale();i/=u.sx,o/=u.sy;const d=new G(c.x,c.y,i,o),f=this.getCellViewsInArea(d).map(h=>h.cell);this.reset(f,{batch:!0}),this.hideRubberband();break}case"translating":{const i=t.snapToGrid(e.clientX,e.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",e,i.x,i.y);break}default:{this.clean();break}}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const s=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:s});const r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(Pt.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t=typeof e=="function"?se(e,this.graph,null):e;return typeof t=="number"?this.graph.transform.getGraphArea().inflate(t):t===!0?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let s=e.x-t.clientX,r=e.y-t.clientY;const i=this.getRestrictArea();if(i){const o=this.collection.toArray(),a=ge.getCellsBBox(o,{deep:!0})||G.create(),c=i.x-a.x,u=i.y-a.y,d=i.x+i.width-(a.x+a.width),f=i.y+i.height-(a.y+a.height);if(s<c&&(s=c),r<u&&(r=u),d<s&&(s=d),f<r&&(r=f),!this.options.following){const h=e.x-t.originX,p=e.y-t.originY;s=h<=c||h>=d?0:s,r=p<=u||p>=f?0:r}}return{dx:s,dy:r}}updateElementPosition(e,t,s){const r=Je(e,"left"),i=Je(e,"top"),o=r?parseFloat(r):0,a=i?parseFloat(i):0;Je(e,"left",o+t),Je(e,"top",a+s)}updateSelectedNodesPosition(e){const{dx:t,dy:s}=e;if(t||s)if(this.translateSelectedNodes(t,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],t*r.sx,s*r.sy);this.updateElementPosition(this.selectionContainer,t*r.sx,s*r.sy)}}autoScrollGraph(e,t){const s=this.graph.getPlugin("scroller");return s?s.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),s=this.getEventData(t);switch(s.action){case"selecting":{const i=s;i.moving!==!0&&(xs(this.container,this.graph.container),this.showRubberband(),i.moving=!0);const{scrollerX:o,scrollerY:a}=this.autoScrollGraph(t.clientX,t.clientY);i.scrollerX+=o,i.scrollerY+=a;const c=t.clientX-i.clientX+i.scrollerX,u=t.clientY-i.clientY+i.scrollerY,d=parseInt(Je(this.container,"left")||"0",10),f=parseInt(Je(this.container,"top")||"0",10);Je(this.container,{left:c<0?i.offsetX+c:d,top:u<0?i.offsetY+u:f,width:Math.abs(c),height:Math.abs(u)});break}case"translating":{const i=this.graph.snapToGrid(t.clientX,t.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",e,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,s,r){const i={},o=[];if(s&&(i[s.id]=!0),this.collection.toArray().forEach(a=>{a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0})}),r&&r.translateBy){const a=this.graph.getCellById(r.translateBy);a&&(i[a.id]=!0,a.getDescendants({deep:!0}).forEach(c=>{i[c.id]=!0}),o.push(a))}this.collection.toArray().forEach(a=>{if(!i[a.id]){const c=Object.assign(Object.assign({},r),{selection:this.cid,exclude:o});a.translate(e,t,c),this.graph.model.getConnectedEdges(a).forEach(u=>{i[u.id]||(u.translate(e,t,c),i[u.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,s={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,s).map(i=>t.renderer.findViewByCell(i)).filter(i=>i!=null))),r}notifyBoxEvent(e,t,s,r){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:s,y:r,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName(`${e.isNode()?"node":"edge"}-selected`)}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(Yt(this.container.querySelector(`[data-cell-id="${e.id}"]`)),this.$boxes.length===0&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),Yt(this.$boxes),this.boxCount=0}hide(){Ie(this.container,this.prefixClassName(Pt.classNames.rubberband)),Ie(this.container,this.prefixClassName(Pt.classNames.selected))}showRubberband(){ee(this.container,this.prefixClassName(Pt.classNames.rubberband))}hideRubberband(){Ie(this.container,this.prefixClassName(Pt.classNames.rubberband))}showSelected(){Xu(this.container,"style"),ee(this.container,this.prefixClassName(Pt.classNames.selected))}createContainer(){this.container=document.createElement("div"),ee(this.container,this.prefixClassName(Pt.classNames.root)),this.options.className&&ee(this.container,this.options.className),this.selectionContainer=document.createElement("div"),ee(this.selectionContainer,this.prefixClassName(Pt.classNames.inner)),this.selectionContent=document.createElement("div"),ee(this.selectionContent,this.prefixClassName(Pt.classNames.content)),Lt(this.selectionContainer,this.selectionContent),pe(this.selectionContainer,"data-selection-length",this.collection.length),Sy(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={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});e.x=Math.min(e.x,a.x),e.y=Math.min(e.y,a.y),t.x=Math.max(t.x,a.x+a.width),t.y=Math.max(t.y,a.y+a.height)}}),Je(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),pe(this.selectionContainer,"data-selection-length",this.collection.length);const r=this.options.content;if(r)if(typeof r=="function"){const i=se(r,this.graph,this,this.selectionContent);i&&(this.selectionContent.innerHTML=i)}else this.selectionContent.innerHTML=r;this.collection.length>0&&!this.container.parentNode?xs(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&this.options.showNodeSelectionBox===!0||e.isEdge()&&this.options.showEdgeSelectionBox===!0}getPointerEventsValue(e){return typeof e=="string"?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const s=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,i=document.createElement("div"),o=this.options.pointerEvents;ee(i,r),ee(i,`${r}-${e.isNode()?"node":"edge"}`),pe(i,"data-cell-id",e.id),Je(i,{position:"absolute",left:s.x,top:s.y,width:s.width,height:s.height,pointerEvents:o?this.getPointerEventsValue(o):"auto"}),xs(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 e=0,t=this.$boxes,s=t.length;e<s;e+=1){const r=t[e],i=pe(r,"data-cell-id");Yt(r),this.boxCount-=1;const o=this.collection.get(i);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const s=this.collection.get(t);if(s)return this.graph.renderer.findViewByCell(s)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(s=>{this.listenCellRemoveEvent(s),this.createSelectionBox(s)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:s}){e.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})}),t.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:e,removed:t,options:s,selected:this.cells.filter(i=>!!this.graph.getCellById(i.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}T3([be.dispose()],l0.prototype,"dispose",null);var Pt;(function(n){const e="widget-selection";n.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},n.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"};function t(s){return s.getAncestors().length}n.depthComparator=t})(Pt||(Pt={}));const k3=`.x6-widget-selection {
422
422
  position: absolute;
423
423
  top: 0;
424
424
  left: 0;
@@ -483,8 +483,8 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
483
483
  font-size: 10px;
484
484
  background-color: #6a6b8a;
485
485
  }
486
- `;$.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},$.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},$.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},$.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},$.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},$.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},$.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},$.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},$.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},$.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},$.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},$.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},$.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},$.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},$.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},$.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},$.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},$.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},$.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},$.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},$.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},$.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},$.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},$.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},$.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},$.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},$.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},$.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},$.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},$.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},$.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t&&t.unselect(n,e),this};var V3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class pi extends Ve{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(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},pi.defaultOptions),e),qr(this.name,k3)}init(e){this.graph=e,this.selectionImpl=new a0(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?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(e){return e!=null?e!==this.isMultipleSelection()&&(e?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(e){return e!=null?e!==this.isSelectionMovable()&&(e?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(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?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(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const s=this.getCells(e);return s.length&&(this.isMultiple()?this.selectionImpl.select(s,t):this.reset(s.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}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}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),s=this.graph.getPlugin("scroller"),r=s&&s.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&vs.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&vs.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const s=this.options;let r=this.disabled;!r&&this.movedMap.has(t)&&(r=s.selectCellOnMoved===!1,r||(r=s.selectNodeOnMoved===!1&&t.isNode()),r||(r=s.selectEdgeOnMoved===!1&&t.isEdge())),r||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Xr(this.name)}}V3([Ve.dispose()],pi.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"]}}(pi||(pi={}));const Sd="line",Ed="pipe",Od="arrow",D3=[{label:"直线",value:Sd},{label:"管道",value:Ed},{label:"箭头",value:Od}],Pl=[{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"}],gi="stop",l0=[{label:"停止",value:gi},{label:"正向",value:"forward-pipe"},{label:"反向",value:"reverse-pipe"}],cr="flashing",mi="arrowForward",Md="arrowBackward",R3=[{label:"正向",value:mi},{label:"反向",value:Md}],I3=()=>new lr({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),L3=()=>new n0,B3=()=>new r0,j3=()=>new i0({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),$3=["tools","ports"],z3=()=>new fi({beforeAddCommand:(n,e)=>{if($3.includes(e.key))return!1}}),F3=()=>new pi({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),U3=n=>{const e=n.getSelectedCells();e.length&&n.removeCells(e)},H3=n=>{const e=n.getSelectedCells();e.length&&n.copy(e)},G3=n=>{if(!n.isClipboardEmpty()){const e=n.paste({offset:32});n.cleanSelection(),n.select(e)}},W3=n=>{n.canUndo()&&n.undo()},Y3=n=>{n.canRedo()&&n.redo()},q3=n=>{n.addTools([{name:"vertices",args:{snapRadius:3,attrs:{r:3,fill:"#239edd",cursor:"move","stroke-width":2},modifiers:["shift"]}},{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"}}}])},c0=()=>{var n,e;return(n=tt.attrs)!=null&&n.pipe?"pipe":(e=tt.attrs)!=null&&e.arrow?"arrow":"line"},u0=n=>n!=="none"?n+" 30s infinite linear":"",Pd=()=>Math.random(),d0="--",Nd=/\$\{([^}]+)\}/g,X3={min:0,max:0,direction:gi},Ad=n=>Jn.defaults.baseURL+n.replace("/cny",""),J3={min:0,max:0,animation:cr,direction:mi,display:"block"},K3={class:"control"},Z3={class:"row-column"},Q3={class:"row-column"},h0=It(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var te,z,I,U;const e=n,t=l.ref((te=e.payload.attrs.label)!=null&&te.textAnchor?"0":"1"),s=l.ref([]),r=l.ref([]),i=async()=>{s.value=await Tu(e.itemId)},o=l.ref();let a=l.reactive({});const c=()=>{a=s.value.find(F=>F.deviceCode===o.value),a&&u()},u=async()=>{r.value=await ku(a.deviceCode)},d=F=>F.replace(Nd,d0),f=F=>{Vk.confirm(`是否确定要添加${a.deviceName}-${F.name}?
487
- 添加后为:--${F.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const D=F.unit??"",q=e.payload.data.content;console.log(V.value),V.value?e.payload.data.content=h.value=q.slice(0,V.value)+"${"+a.deviceName+"."+F.name+"}"+D+q.slice(V.value):e.payload.data.content=h.value=q+"${"+a.deviceName+"."+F.name+"}"+D;const J=q.match(Nd),ae=(J==null?void 0:J.length)||0;e.payload.data.fields.push({index:ae,deviceName:a.deviceName,deviceCode:a.deviceCode,field:F.dataField,fieldName:F.name}),e.payload.label=d(e.payload.data.content),console.log(e.payload.data.content,e.payload.data.fields)})},h=l.ref(e.payload.data.content||null),p=l.ref(e.payload.attrs.body.fill||null),g=l.ref(e.payload.attrs.body.stroke||null),m=l.ref(e.payload.attrs.body.strokeWidth||null),y=l.ref(e.payload.attrs.body.rx||null),b=l.ref(e.payload.attrs.body.ry||null),w=l.ref(e.payload.attrs.text.fill||null),x=l.ref(e.payload.attrs.text.fontSize||null),v=l.ref(((z=e.payload.attrs.label)==null?void 0:z.textAnchor)||null),C=l.ref(((I=e.payload.attrs.label)==null?void 0:I.x)||null),E=l.ref(((U=e.payload.attrs.label)==null?void 0:U.y)||null),S=()=>{e.payload.attr("body/fill",p.value),e.payload.attr("body/stroke",g.value),e.payload.attr("body/strokeWidth",m.value),e.payload.attr("body/rx",y.value),e.payload.attr("body/ry",b.value),e.payload.attr("text/fill",w.value),e.payload.attr("text/fontSize",x.value),e.payload.attr("label/textAnchor",v.value),e.payload.attr("label/x",C.value),e.payload.attr("label/y",E.value)},O=l.ref(null),A=/[\$\{|\}]/g,k=F=>{A.test(F)&&(h.value=h.value.slice(0,-1));const D=e.payload.data.content;if(F.length<D.length){const{deleted:q,start:J,end:ae}=_(D,F);if(q==="}"){const Z=D.lastIndexOf("${",J),fe=D.substring(Z,J)+"}";h.value=D.replace(fe,"");const Ze=fe.replace(/[${}]/g,"");e.payload.data.fields=e.payload.data.fields.filter(yt=>yt.deviceName+"."+yt.fieldName!==Ze)}}e.payload.data.content=h.value,e.payload.label=d(h.value),console.log(e.payload.data.content,e.payload.data.fields)},_=(F,D)=>{let q=0,J=0;for(;q<F.length&&J<D.length&&F[q]===D[J];)q++,J++;if(J===D.length&&q<F.length)return{deleted:F.slice(q),start:q,end:F.length};let ae=F.length-1,Z=D.length-1;for(;ae>q&&Z>J&&F[ae]===D[Z];)ae--,Z--;return{deleted:F.slice(q,ae),start:q,end:ae}},V=l.ref(null),L=()=>{var D;const F=(D=O.value)==null?void 0:D.$refs.textarea;V.value=F.selectionStart},B=l.ref([]),N=()=>{B.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(F=>({id:F.id,attrs:F.attrs,args:{x:Number(F.args.x.replace("%","")),y:Number(F.args.y.replace("%",""))}}))))},P=()=>{const F=Vu;F.attrs.text.text=`${e.payload.getPorts().length+1}`,F.args.x="50%",F.args.y="50%",e.payload.addPorts([{group:"ports",...F}]),N()},T=()=>{Fr("#drawing-board",!0)},j=(F,D,q)=>{e.payload.portProp(F,"args/"+D,q+"%"),N()},Y=F=>{e.payload.removePort(F),N()};return l.onMounted(()=>{N(),i(),l.nextTick(()=>{document.addEventListener("selectionchange",()=>{var Z;if(!O.value)return!1;const F=(Z=O.value)==null?void 0:Z.$refs.textarea,D=F.selectionStart,q=h.value,J=/\$\{.*?\}/g;let ae;for(;(ae=J.exec(q))!==null;){const fe=ae.index,Ze=J.lastIndex;if(D>fe&&D<Ze)return console.log("光标位于字段:",ae[0]),F.setSelectionRange(Ze,Ze),!0}return console.log("光标不在任何字段内"),!1})})}),(F,D)=>{const q=l.resolveComponent("el-input"),J=l.resolveComponent("el-alert"),ae=l.resolveComponent("el-option"),Z=l.resolveComponent("el-select"),fe=l.resolveComponent("el-table-column"),Ze=l.resolveComponent("el-table"),yt=l.resolveComponent("el-collapse-item"),Me=l.resolveComponent("el-col"),ne=l.resolveComponent("el-color-picker"),xt=l.resolveComponent("el-row"),Zt=l.resolveComponent("el-input-number"),Ds=l.resolveComponent("el-button"),ur=l.resolveComponent("el-slider"),So=l.resolveComponent("el-icon"),xn=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",K3,[l.createVNode(xn,{modelValue:t.value,"onUpdate:modelValue":D[12]||(D[12]=le=>t.value=le),accordion:""},{default:l.withCtx(()=>[n.payload.data.type==="text"?(l.openBlock(),l.createBlock(yt,{key:0,title:"文本内容",name:"0"},{default:l.withCtx(()=>[l.createVNode(q,{ref_key:"inputRef",ref:O,type:"textarea",modelValue:h.value,"onUpdate:modelValue":D[0]||(D[0]=le=>h.value=le),onInput:k,onBlur:L,rows:10},null,8,["modelValue"]),l.createVNode(J,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),l.createVNode(Z,{modelValue:o.value,"onUpdate:modelValue":D[1]||(D[1]=le=>o.value=le),placeholder:"请选择设备",onChange:c,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,le=>(l.openBlock(),l.createBlock(ae,{key:le.deviceCode,label:le.deviceName,value:le.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(Ze,{data:r.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:f},{default:l.withCtx(()=>[l.createVNode(fe,{type:"index",label:"序号",width:"50",align:"center"}),l.createVNode(fe,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),l.createVNode(fe,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),l.createVNode(fe,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(yt,{title:"图形设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Z3,[l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[13]||(D[13]=[l.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:p.value,"onUpdate:modelValue":D[2]||(D[2]=le=>p.value=le),"show-alpha":!0,size:"small",onChange:S},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[14]||(D[14]=[l.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:g.value,"onUpdate:modelValue":D[3]||(D[3]=le=>g.value=le),"show-alpha":!0,size:"small",onChange:S},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[15]||(D[15]=[l.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:m.value,"onUpdate:modelValue":D[4]||(D[4]=le=>m.value=le),size:"small","controls-position":"right",onChange:S,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[16]||(D[16]=[l.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:y.value,"onUpdate:modelValue":D[5]||(D[5]=le=>y.value=le),size:"small","controls-position":"right",onChange:S,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[17]||(D[17]=[l.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:b.value,"onUpdate:modelValue":D[6]||(D[6]=le=>b.value=le),size:"small","controls-position":"right",onChange:S,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(l.openBlock(),l.createBlock(yt,{key:1,title:"文字设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Q3,[l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[18]||(D[18]=[l.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:w.value,"onUpdate:modelValue":D[7]||(D[7]=le=>w.value=le),"show-alpha":!0,size:"small",onChange:S},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[19]||(D[19]=[l.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:x.value,"onUpdate:modelValue":D[8]||(D[8]=le=>x.value=le),size:"small","controls-position":"right",onChange:S,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[20]||(D[20]=[l.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:v.value,"onUpdate:modelValue":D[9]||(D[9]=le=>v.value=le),size:"small",onChange:S},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(["start","middle","end"],le=>l.createVNode(ae,{key:le,label:le,value:le},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[21]||(D[21]=[l.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:C.value,"onUpdate:modelValue":D[10]||(D[10]=le=>C.value=le),size:"small","controls-position":"right",onChange:S,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[22]||(D[22]=[l.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:E.value,"onUpdate:modelValue":D[11]||(D[11]=le=>E.value=le),size:"small","controls-position":"right",onChange:S,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(yt,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(Ds,{type:"primary",onClick:P,size:"small"},{default:l.withCtx(()=>D[23]||(D[23]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(Ds,{type:"primary",onClick:T,size:"small"},{default:l.withCtx(()=>D[24]||(D[24]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(Ze,{data:B.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(fe,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:le})=>[l.createTextVNode(l.toDisplayString(le.attrs.text.text),1)]),_:1}),l.createVNode(fe,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(ur,{modelValue:le.args.x,"onUpdate:modelValue":At=>le.args.x=At,min:0,max:100,step:1,onInput:At=>j(le.id,"x",At)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(fe,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(ur,{modelValue:le.args.y,"onUpdate:modelValue":At=>le.args.y=At,min:0,max:100,step:1,onInput:At=>j(le.id,"y",At)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(fe,{label:"操作",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(Ds,{type:"danger",size:"small",onClick:At=>Y(le.id)},{default:l.withCtx(()=>[l.createVNode(So,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Jm))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-3e26b862"]]),ej={class:"container"},tj={class:"row-column"},nj={class:"row-column"},sj={class:"row-column"},rj=It({__name:"default-line",props:{payload:Object},setup(n){var c,u,d,f;const e=n,t=l.ref("0"),s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.line.strokeWidth),i=l.reactive({name:((c=e.payload.attrs.line.sourceMarker)==null?void 0:c.name)??null,args:((u=e.payload.attrs.line.sourceMarker)==null?void 0:u.args)??{}}),o=l.reactive({name:((d=e.payload.attrs.line.targetMarker)==null?void 0:d.name)??null,args:((f=e.payload.attrs.line.targetMarker)==null?void 0:f.args)??{}}),a=()=>{e.payload.attr("line/stroke",s.value),e.payload.attr("line/strokeWidth",r.value),e.payload.attr("line/sourceMarker/name",i.name),e.payload.attr("line/sourceMarker/args",i.args),e.payload.attr("line/targetMarker/name",o.name),e.payload.attr("line/targetMarker/args",o.args),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs};return(h,p)=>{const g=l.resolveComponent("el-col"),m=l.resolveComponent("el-color-picker"),y=l.resolveComponent("el-row"),b=l.resolveComponent("el-input-number"),w=l.resolveComponent("el-collapse-item"),x=l.resolveComponent("el-option"),v=l.resolveComponent("el-select"),C=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",ej,[l.createVNode(C,{modelValue:t.value,"onUpdate:modelValue":p[10]||(p[10]=E=>t.value=E),accordion:""},{default:l.withCtx(()=>[l.createVNode(w,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",tj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[11]||(p[11]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=E=>s.value=E),"show-alpha":!0,size:"small",onChange:a},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[12]||(p[12]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:r.value,"onUpdate:modelValue":p[1]||(p[1]=E=>r.value=E),size:"small","controls-position":"right",onChange:a,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(w,{title:"箭头1设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",nj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[13]||(p[13]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(v,{modelValue:i.name,"onUpdate:modelValue":p[2]||(p[2]=E=>i.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),E=>(l.openBlock(),l.createBlock(x,{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[14]||(p[14]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.width,"onUpdate:modelValue":p[3]||(p[3]=E=>i.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[15]||(p[15]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.height,"onUpdate:modelValue":p[4]||(p[4]=E=>i.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[16]||(p[16]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.offset,"onUpdate:modelValue":p[5]||(p[5]=E=>i.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(w,{title:"箭头2设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",sj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[17]||(p[17]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(v,{modelValue:o.name,"onUpdate:modelValue":p[6]||(p[6]=E=>o.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),E=>(l.openBlock(),l.createBlock(x,{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[18]||(p[18]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.width,"onUpdate:modelValue":p[7]||(p[7]=E=>o.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[19]||(p[19]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.height,"onUpdate:modelValue":p[8]||(p[8]=E=>o.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[20]||(p[20]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.offset,"onUpdate:modelValue":p[9]||(p[9]=E=>o.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-060936eb"]]),ij={class:"form-container"},oj={class:"footer",style:{"margin-top":"10px"}},f0=It({__name:"condition",props:{payload:{type:Array},type:{type:String}},emits:["close"],setup(n,{emit:e}){const t=n,s=l.ref(t.payload),r=()=>{s.value.push(JSON.parse(JSON.stringify(t.type==="pipe"?X3:J3)))},i=u=>{s.value.splice(u,1)},o=e,a=()=>{o("close",s.value)},c=()=>{o("close",!1)};return(u,d)=>{const f=l.resolveComponent("el-button"),h=l.resolveComponent("el-input-number"),p=l.resolveComponent("el-table-column"),g=l.resolveComponent("el-option"),m=l.resolveComponent("el-select"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",ij,[l.createVNode(f,{type:"primary",size:"small",onClick:r,style:{"margin-bottom":"10px"}},{default:l.withCtx(()=>d[0]||(d[0]=[l.createTextVNode("添加条件")])),_:1}),l.createVNode(b,{data:s.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(p,{prop:"min",label:"最小值",width:"150",align:"center"},{default:l.withCtx(w=>[l.createVNode(h,{modelValue:w.row.min,"onUpdate:modelValue":x=>w.row.min=x,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(p,{prop:"max",label:"最大值",width:"150",align:"center"},{default:l.withCtx(w=>[l.createVNode(h,{modelValue:w.row.max,"onUpdate:modelValue":x=>w.row.max=x,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),n.type==="pipe"?(l.openBlock(),l.createBlock(p,{key:0,prop:"direction",label:"流向",align:"center"},{default:l.withCtx(w=>[l.createVNode(m,{modelValue:w.row.direction,"onUpdate:modelValue":x=>w.row.direction=x,size:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(l0),x=>(l.openBlock(),l.createBlock(g,{key:x.value,label:x.label,value:x.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:1,prop:"direction",label:"方向",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.direction,"onUpdate:modelValue":x=>w.row.direction=x,"active-value":l.unref(mi),"active-text":"正向","inactive-value":l.unref(Md),"inactive-text":"反向",size:"small"},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:2,prop:"direction",label:"动作",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.animation,"onUpdate:modelValue":x=>w.row.animation=x,"active-value":l.unref(cr),"active-text":"闪烁","inactive-value":l.unref(gi),"inactive-text":"静止",size:"small"},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:3,prop:"display",label:"显示",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.display,"onUpdate:modelValue":x=>w.row.display=x,"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(p,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(f,{type:"danger",size:"small",onClick:x=>i(w.$index)},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createElementVNode("div",oj,[l.createVNode(f,{type:"primary",onClick:a},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("保存")])),_:1}),l.createVNode(f,{onClick:c},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("取消")])),_:1})])])}}},[["__scopeId","data-v-93fe286b"]]),aj={class:"container"},lj={class:"row-column"},cj={class:"row-column"},uj={class:"row-column"},dj={class:"row-column"},hj=It({__name:"pipe-line",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var A,k,_,V,L,B,N,P,T,j,Y,te;const e=n,t=l.ref("0"),s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.pipe.stroke),i=l.ref(e.payload.attrs.line.strokeWidth),o=l.ref(e.payload.attrs.pipe.strokeDasharray),a=l.ref(((k=(A=e.payload.attrs.pipe)==null?void 0:A.style)==null?void 0:k.animation.split(" ")[0])??gi),c=l.reactive({name:((_=e.payload.attrs.pipe.sourceMarker)==null?void 0:_.name)??null,args:((V=e.payload.attrs.pipe.sourceMarker)==null?void 0:V.args)??{}}),u=l.reactive({name:((L=e.payload.attrs.pipe.targetMarker)==null?void 0:L.name)??null,args:((B=e.payload.attrs.pipe.targetMarker)==null?void 0:B.args)??{}}),d=()=>{e.payload.attr("line/stroke",s.value),e.payload.attr("pipe/stroke",r.value),e.payload.attr("line/strokeWidth",i.value),e.payload.attr("pipe/strokeWidth",i.value),e.payload.attr("pipe/strokeDasharray",o.value),e.payload.attr("pipe/sourceMarker/name",c.name),e.payload.attr("pipe/sourceMarker/args",c.args),e.payload.attr("pipe/targetMarker/name",u.name),e.payload.attr("pipe/targetMarker/args",u.args),e.payload.attr("pipe/style/animation",u0(a.value)),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs,console.log("线-基础配置",tt),console.log("线-当前配置",e.payload)},f=l.ref(e.payload.data.isCondition??!1),h=()=>{e.payload.data.isCondition=f.value},p=l.reactive({show:!1,payload:null}),g=()=>{p.show=!0,p.payload=e.payload.data.condition??[]},m=z=>{p.show=!1,p.payload=null,z&&(e.payload.data.condition=z),console.log("条件线",e.payload.data)},y=l.ref([]),b=l.ref(((T=(P=(N=e.payload.data)==null?void 0:N.fields)==null?void 0:P[0])==null?void 0:T.deviceCode)??""),w=l.ref(((te=(Y=(j=e.payload.data)==null?void 0:j.fields)==null?void 0:Y[0])==null?void 0:te.field)??""),x=async()=>{y.value=await Tu(e.itemId),b.value&&C()};let v=l.reactive({});const C=()=>{v=y.value.find(z=>z.deviceCode===b.value),v?(S(),e.payload.data.fields=[{index:0,deviceName:v.deviceName,deviceCode:v.deviceCode,field:w.value??""}],w.value=e.payload.data.fields[0].field):(w.value="",e.payload.data.fields=[]),console.log("管道配置",e.payload)},E=l.ref([]),S=async()=>{E.value=await ku(v.deviceCode)},O=()=>{e.payload.data.fields=[{index:0,deviceName:v.deviceName,deviceCode:v.deviceCode,field:w.value??""}],console.log("管道配置",e.payload)};return l.onMounted(()=>{x()}),(z,I)=>{const U=l.resolveComponent("el-col"),F=l.resolveComponent("el-color-picker"),D=l.resolveComponent("el-row"),q=l.resolveComponent("el-input-number"),J=l.resolveComponent("el-collapse-item"),ae=l.resolveComponent("el-option"),Z=l.resolveComponent("el-select"),fe=l.resolveComponent("el-switch"),Ze=l.resolveComponent("el-button"),yt=l.resolveComponent("el-collapse"),Me=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",aj,[l.createVNode(yt,{modelValue:t.value,"onUpdate:modelValue":I[16]||(I[16]=ne=>t.value=ne),accordion:""},{default:l.withCtx(()=>[l.createVNode(J,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",lj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[18]||(I[18]=[l.createElementVNode("div",{class:"row-label"},"颜色1",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=ne=>s.value=ne),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[19]||(I[19]=[l.createElementVNode("div",{class:"row-label"},"颜色2",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":I[1]||(I[1]=ne=>r.value=ne),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[20]||(I[20]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:i.value,"onUpdate:modelValue":I[2]||(I[2]=ne=>i.value=ne),size:"small","controls-position":"right",onChange:d,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(J,{title:"管道设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",cj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[21]||(I[21]=[l.createElementVNode("div",{class:"row-label"},"管道间隔",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:o.value,"onUpdate:modelValue":I[3]||(I[3]=ne=>o.value=ne),size:"small","controls-position":"right",onChange:d,min:5,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[22]||(I[22]=[l.createElementVNode("div",{class:"row-label"},"默认流动方向",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:a.value,"onUpdate:modelValue":I[4]||(I[4]=ne=>a.value=ne),placeholder:"请选择管道方向",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(l0),ne=>(l.openBlock(),l.createBlock(ae,{key:ne.value,label:ne.label,value:ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[23]||(I[23]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:b.value,"onUpdate:modelValue":I[5]||(I[5]=ne=>b.value=ne),placeholder:"请选择设备",onChange:C,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value,ne=>(l.openBlock(),l.createBlock(ae,{key:ne.deviceCode,label:ne.deviceName,value:ne.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(Z,{modelValue:w.value,"onUpdate:modelValue":I[6]||(I[6]=ne=>w.value=ne),placeholder:"请选择字段",onChange:O,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E.value,ne=>(l.openBlock(),l.createBlock(ae,{key:ne.dataField,label:ne.name,value:ne.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[24]||(I[24]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(fe,{modelValue:f.value,"onUpdate:modelValue":I[7]||(I[7]=ne=>f.value=ne),"active-value":!0,"inactive-value":!1,size:"small",onChange:h},null,8,["modelValue"]),l.createVNode(Ze,{type:"primary",size:"small",onClick:g,style:{"margin-left":"10px"}},{default:l.withCtx(()=>I[25]||(I[25]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1}),l.createVNode(J,{title:"箭头1设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",uj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[26]||(I[26]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:c.name,"onUpdate:modelValue":I[8]||(I[8]=ne=>c.name=ne),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),ne=>(l.openBlock(),l.createBlock(ae,{key:ne.value,label:ne.label,value:ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[27]||(I[27]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.args.width,"onUpdate:modelValue":I[9]||(I[9]=ne=>c.args.width=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[28]||(I[28]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.args.height,"onUpdate:modelValue":I[10]||(I[10]=ne=>c.args.height=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[29]||(I[29]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.args.offset,"onUpdate:modelValue":I[11]||(I[11]=ne=>c.args.offset=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(J,{title:"箭头2设置",name:"3"},{default:l.withCtx(()=>[l.createElementVNode("div",dj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[30]||(I[30]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:u.name,"onUpdate:modelValue":I[12]||(I[12]=ne=>u.name=ne),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),ne=>(l.openBlock(),l.createBlock(ae,{key:ne.value,label:ne.label,value:ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[31]||(I[31]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.args.width,"onUpdate:modelValue":I[13]||(I[13]=ne=>u.args.width=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[32]||(I[32]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.args.height,"onUpdate:modelValue":I[14]||(I[14]=ne=>u.args.height=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[33]||(I[33]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.args.offset,"onUpdate:modelValue":I[15]||(I[15]=ne=>u.args.offset=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(Me,{modelValue:p.show,"onUpdate:modelValue":I[17]||(I[17]=ne=>p.show=ne),width:"500px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[p.show?(l.openBlock(),l.createBlock(f0,{key:0,payload:p.payload,type:"pipe",onClose:m},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-c0d777a1"]]),fj={class:"container"},pj={class:"row-column"},gj={class:"row-column"},mj={class:"row-column"},yj=It({__name:"arrow-line",props:{payload:{type:Object,itemId:{type:String,default:""}}},setup(n){var k,_,V,L,B,N;const e=n,t=l.ref("0");console.log(e.payload);const s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.line.strokeWidth),i=e.payload.markup.length-1,o=l.ref(e.payload.markup.length-1),a=l.ref(e.payload.attrs.arrow.fill),c=l.ref(e.payload.attrs.arrow.d===Ka?mi:Md),u=l.ref(e.payload.attrs.arrow.style.animation.split(" ")[0]===cr?cr:gi),d=l.ref(e.payload.attrs.arrow.display),f=()=>{if(e.payload.attr("line/stroke",s.value),e.payload.attr("line/strokeWidth",r.value),e.payload.attr("arrow/fill",a.value),e.payload.attr("arrow/stroke",a.value),o.value!==i){e.payload.markup=e.payload.markup.slice(0,1);for(let P=0;P<o.value;P++)e.payload.markup.push({tagName:"path",groupSelector:"arrow",selector:"arrow"+(P+1)}),e.payload.attr("arrow"+(P+1),{atConnectionRatio:1/(o.value+1)*(P+1)})}e.payload.attr("arrow/d",c.value===mi?Ka:qm),e.payload.attr("arrow/style/animation",u.value===cr?"flashing 2s infinite linear":""),e.payload.attr("arrow/display",d.value),console.log(e.payload.markup),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs},h=l.ref([]),p=l.ref(((V=(_=(k=e.payload.data)==null?void 0:k.fields)==null?void 0:_[0])==null?void 0:V.deviceCode)??""),g=l.ref(((N=(B=(L=e.payload.data)==null?void 0:L.fields)==null?void 0:B[0])==null?void 0:N.field)??""),m=async()=>{h.value=await Tu(e.itemId),p.value&&b()};let y=l.reactive({});const b=()=>{y=h.value.find(P=>P.deviceCode===p.value),y?(x(),e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],g.value=e.payload.data.fields[0].field):(g.value="",e.payload.data.fields=[]),console.log("箭头线-配置",e.payload)},w=l.ref([]),x=async()=>{w.value=await ku(y.deviceCode)},v=()=>{e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],console.log("箭头线-配置",e.payload)},C=l.ref(e.payload.data.isCondition??!1),E=()=>{e.payload.data.isCondition=C.value},S=l.reactive({show:!1,payload:null}),O=()=>{S.show=!0,S.payload=e.payload.data.condition??[]},A=P=>{S.show=!1,S.payload=null,P&&(e.payload.data.condition=P),console.log("条件线",e.payload.data)};return l.onMounted(()=>{m()}),(P,T)=>{const j=l.resolveComponent("el-col"),Y=l.resolveComponent("el-color-picker"),te=l.resolveComponent("el-row"),z=l.resolveComponent("el-input-number"),I=l.resolveComponent("el-collapse-item"),U=l.resolveComponent("el-option"),F=l.resolveComponent("el-select"),D=l.resolveComponent("el-switch"),q=l.resolveComponent("el-button"),J=l.resolveComponent("el-collapse"),ae=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",fj,[l.createVNode(J,{modelValue:t.value,"onUpdate:modelValue":T[10]||(T[10]=Z=>t.value=Z),accordion:""},{default:l.withCtx(()=>[l.createVNode(I,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",pj,[l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[12]||(T[12]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Y,{modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=Z=>s.value=Z),"show-alpha":!0,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[13]||(T[13]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(z,{modelValue:r.value,"onUpdate:modelValue":T[1]||(T[1]=Z=>r.value=Z),size:"small","controls-position":"right",onChange:f,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(I,{title:"箭头设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",gj,[l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[14]||(T[14]=[l.createElementVNode("div",{class:"row-label"},"箭头数量",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(z,{modelValue:o.value,"onUpdate:modelValue":T[2]||(T[2]=Z=>o.value=Z),size:"small","controls-position":"right",onChange:f,min:1,max:20,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[15]||(T[15]=[l.createElementVNode("div",{class:"row-label"},"箭头颜色",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Y,{modelValue:a.value,"onUpdate:modelValue":T[3]||(T[3]=Z=>a.value=Z),"show-alpha":!0,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[16]||(T[16]=[l.createElementVNode("div",{class:"row-label"},"默认箭头方向",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:c.value,"onUpdate:modelValue":T[4]||(T[4]=Z=>c.value=Z),size:"small",onChange:f},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(R3),Z=>(l.openBlock(),l.createBlock(U,{key:Z.value,label:Z.label,value:Z.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[17]||(T[17]=[l.createElementVNode("div",{class:"row-label"},"默认箭头动作",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:u.value,"onUpdate:modelValue":T[5]||(T[5]=Z=>u.value=Z),"active-value":l.unref(cr),"active-text":"闪烁","inactive-value":l.unref(gi),"inactive-text":"静止",size:"small",onChange:f},null,8,["modelValue","active-value","inactive-value"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[18]||(T[18]=[l.createElementVNode("div",{class:"row-label"},"默认箭头显示",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:d.value,"onUpdate:modelValue":T[6]||(T[6]=Z=>d.value=Z),"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(I,{title:"动态设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",mj,[l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[19]||(T[19]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:p.value,"onUpdate:modelValue":T[7]||(T[7]=Z=>p.value=Z),placeholder:"请选择设备",onChange:b,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,Z=>(l.openBlock(),l.createBlock(U,{key:Z.deviceCode,label:Z.deviceName,value:Z.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(F,{modelValue:g.value,"onUpdate:modelValue":T[8]||(T[8]=Z=>g.value=Z),placeholder:"请选择字段",onChange:v,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,Z=>(l.openBlock(),l.createBlock(U,{key:Z.dataField,label:Z.name,value:Z.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[20]||(T[20]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:C.value,"onUpdate:modelValue":T[9]||(T[9]=Z=>C.value=Z),"active-value":!0,"inactive-value":!1,size:"small",onChange:E},null,8,["modelValue"]),l.createVNode(q,{type:"primary",size:"small",onClick:O,style:{"margin-left":"10px"}},{default:l.withCtx(()=>T[21]||(T[21]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(ae,{modelValue:S.show,"onUpdate:modelValue":T[11]||(T[11]=Z=>S.show=Z),width:"900px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[S.show?(l.openBlock(),l.createBlock(f0,{key:0,payload:S.payload,type:"arrow",onClose:A},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-f33df45a"]]),bj={class:"container"},wj={class:"row-column",style:{padding:"5px 1px 10px"}},p0=It({__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){const e=n,t=l.ref(e.payload.data.type),s=()=>{e.payload.data.type=t.value,t.value===Sd&&(tt.attrs=Ja.attrs,tt.markup=Ja.markup),t.value===Ed&&(tt.attrs=Ym.attrs,tt.markup=Ym.markup),t.value===Od&&(tt.attrs=Xm.attrs,tt.markup=Xm.markup),e.payload.attrs=null,e.payload.attr(tt.attrs),e.payload.markup=tt.markup,i()},r=l.shallowRef(null),i=()=>{r.value=null,t.value===Sd&&(r.value=rj),t.value===Ed&&(r.value=hj),t.value===Od&&(r.value=yj)};return l.onMounted(()=>{i()}),(o,a)=>{const c=l.resolveComponent("el-col"),u=l.resolveComponent("el-option"),d=l.resolveComponent("el-select"),f=l.resolveComponent("el-row");return l.openBlock(),l.createElementBlock("div",bj,[l.createElementVNode("div",wj,[l.createVNode(f,{gutter:20},{default:l.withCtx(()=>[l.createVNode(c,{span:12},{default:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("div",{class:"row-label"},"线段类型",-1)])),_:1}),l.createVNode(c,{span:12},{default:l.withCtx(()=>[l.createVNode(d,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=h=>t.value=h),placeholder:"请选择线段类型",clearable:"",size:"small",onChange:s},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(D3),h=>(l.openBlock(),l.createBlock(u,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.value),{payload:n.payload,itemId:n.itemId},null,8,["payload","itemId"]))])}}},[["__scopeId","data-v-b641f8fe"]]),xj={class:"form-container"},vj=It({__name:"Shortcuts",setup(n){const e=l.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(t,s)=>{const r=l.resolveComponent("el-table-column"),i=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",xj,[l.createVNode(i,{data:e.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(r,{prop:"name",label:"名称"}),l.createVNode(r,{prop:"windowsKey",label:"windows"}),l.createVNode(r,{prop:"macKey",label:"mac"})]),_:1},8,["data"])])}}},[["__scopeId","data-v-99982d47"]]),Cj=`.x6-widget-dnd {
486
+ `;$.prototype.isSelectionEnabled=function(){const n=this.getPlugin("selection");return n?n.isEnabled():!1},$.prototype.enableSelection=function(){const n=this.getPlugin("selection");return n&&n.enable(),this},$.prototype.disableSelection=function(){const n=this.getPlugin("selection");return n&&n.disable(),this},$.prototype.toggleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleEnabled(n),this},$.prototype.isMultipleSelection=function(){const n=this.getPlugin("selection");return n?n.isMultipleSelection():!1},$.prototype.enableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.enableMultipleSelection(),this},$.prototype.disableMultipleSelection=function(){const n=this.getPlugin("selection");return n&&n.disableMultipleSelection(),this},$.prototype.toggleMultipleSelection=function(n){const e=this.getPlugin("selection");return e&&e.toggleMultipleSelection(n),this},$.prototype.isSelectionMovable=function(){const n=this.getPlugin("selection");return n?n.isSelectionMovable():!1},$.prototype.enableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.enableSelectionMovable(),this},$.prototype.disableSelectionMovable=function(){const n=this.getPlugin("selection");return n&&n.disableSelectionMovable(),this},$.prototype.toggleSelectionMovable=function(n){const e=this.getPlugin("selection");return e&&e.toggleSelectionMovable(n),this},$.prototype.isRubberbandEnabled=function(){const n=this.getPlugin("selection");return n?n.isRubberbandEnabled():!1},$.prototype.enableRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableRubberband(),this},$.prototype.disableRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableRubberband(),this},$.prototype.toggleRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleRubberband(n),this},$.prototype.isStrictRubberband=function(){const n=this.getPlugin("selection");return n?n.isStrictRubberband():!1},$.prototype.enableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.enableStrictRubberband(),this},$.prototype.disableStrictRubberband=function(){const n=this.getPlugin("selection");return n&&n.disableStrictRubberband(),this},$.prototype.toggleStrictRubberband=function(n){const e=this.getPlugin("selection");return e&&e.toggleStrictRubberband(n),this},$.prototype.setRubberbandModifiers=function(n){const e=this.getPlugin("selection");return e&&e.setRubberbandModifiers(n),this},$.prototype.setSelectionFilter=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionFilter(n),this},$.prototype.setSelectionDisplayContent=function(n){const e=this.getPlugin("selection");return e&&e.setSelectionDisplayContent(n),this},$.prototype.isSelectionEmpty=function(){const n=this.getPlugin("selection");return n?n.isEmpty():!0},$.prototype.cleanSelection=function(n){const e=this.getPlugin("selection");return e&&e.clean(n),this},$.prototype.resetSelection=function(n,e){const t=this.getPlugin("selection");return t&&t.reset(n,e),this},$.prototype.getSelectedCells=function(){const n=this.getPlugin("selection");return n?n.getSelectedCells():[]},$.prototype.getSelectedCellCount=function(){const n=this.getPlugin("selection");return n?n.getSelectedCellCount():0},$.prototype.isSelected=function(n){const e=this.getPlugin("selection");return e?e.isSelected(n):!1},$.prototype.select=function(n,e){const t=this.getPlugin("selection");return t&&t.select(n,e),this},$.prototype.unselect=function(n,e){const t=this.getPlugin("selection");return t&&t.unselect(n,e),this};var V3=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class pi extends Ve{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(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},pi.defaultOptions),e),qr(this.name,k3)}init(e){this.graph=e,this.selectionImpl=new l0(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return e!=null?e!==this.isEnabled()&&(e?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(e){return e!=null?e!==this.isMultipleSelection()&&(e?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(e){return e!=null?e!==this.isSelectionMovable()&&(e?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(e){return e!=null?e!==this.isRubberbandEnabled()&&(e?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(e){return e!=null?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const s=this.getCells(e);return s.length&&(this.isMultiple()?this.selectionImpl.select(s,t):this.reset(s.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}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}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),s=this.graph.getPlugin("scroller"),r=s&&s.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(t==null?void 0:t.includes("leftMouseDown"))&&e.button===0||(t==null?void 0:t.includes("mouseWheelDown"))&&e.button===1}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&vs.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&vs.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e,cell:t}){const s=this.options;let r=this.disabled;!r&&this.movedMap.has(t)&&(r=s.selectCellOnMoved===!1,r||(r=s.selectNodeOnMoved===!1&&t.isNode()),r||(r=s.selectEdgeOnMoved===!1&&t.isEdge())),r||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(t=>typeof t=="string"?this.graph.getCellById(t):t).filter(t=>t!=null)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return this.options.multiple!==!1}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),Xr(this.name)}}V3([Ve.dispose()],pi.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"]}}(pi||(pi={}));const Sd="line",Ed="pipe",Od="arrow",D3=[{label:"直线",value:Sd},{label:"管道",value:Ed},{label:"箭头",value:Od}],Pl=[{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"}],gi="stop",c0=[{label:"停止",value:gi},{label:"正向",value:"forward-pipe"},{label:"反向",value:"reverse-pipe"}],cr="flashing",mi="arrowForward",Md="arrowBackward",R3=[{label:"正向",value:mi},{label:"反向",value:Md}],I3=()=>new lr({resizing:{enabled:!0,preserveAspectRatio:!1},rotating:!0}),L3=()=>new s0,B3=()=>new i0,j3=()=>new o0({format(n){return n.replace(/\s/g,"").replace("cmd","command")}}),$3=["tools","ports"],z3=()=>new fi({beforeAddCommand:(n,e)=>{if($3.includes(e.key))return!1}}),F3=()=>new pi({enabled:!0,multiple:!0,rubberband:!0,modifiers:["alt"],showNodeSelectionBox:!0}),U3=n=>{const e=n.getSelectedCells();e.length&&n.removeCells(e)},H3=n=>{const e=n.getSelectedCells();e.length&&n.copy(e)},G3=n=>{if(!n.isClipboardEmpty()){const e=n.paste({offset:32});n.cleanSelection(),n.select(e)}},W3=n=>{n.canUndo()&&n.undo()},Y3=n=>{n.canRedo()&&n.redo()},q3=n=>{n.addTools([{name:"vertices",args:{snapRadius:3,attrs:{r:3,fill:"#239edd",cursor:"move","stroke-width":2},modifiers:["shift"]}},{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"}}}])},u0=()=>{var n,e;return(n=tt.attrs)!=null&&n.pipe?"pipe":(e=tt.attrs)!=null&&e.arrow?"arrow":"line"},Pd=n=>n!=="none"?n+" 30s infinite linear":"",Nd=()=>Math.random(),d0="--",Ad=/\$\{([^}]+)\}/g,X3={min:0,max:0,direction:gi},_d=n=>Jn.defaults.baseURL+n.replace("/cny",""),J3={min:0,max:0,animation:cr,direction:mi,display:"block"},K3={class:"control"},Z3={class:"row-column"},Q3={class:"row-column"},h0=It(Object.assign({name:"text-control"},{__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var te,z,I,U;const e=n,t=l.ref((te=e.payload.attrs.label)!=null&&te.textAnchor?"0":"1"),s=l.ref([]),r=l.ref([]),i=async()=>{s.value=await Tu(e.itemId)},o=l.ref();let a=l.reactive({});const c=()=>{a=s.value.find(F=>F.deviceCode===o.value),a&&u()},u=async()=>{r.value=await ku(a.deviceCode)},d=F=>F.replace(Ad,d0),f=F=>{Vk.confirm(`是否确定要添加${a.deviceName}-${F.name}?
487
+ 添加后为:--${F.unit??""}`,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{const D=F.unit??"",q=e.payload.data.content;console.log(V.value),V.value?e.payload.data.content=h.value=q.slice(0,V.value)+"${"+a.deviceName+"."+F.name+"}"+D+q.slice(V.value):e.payload.data.content=h.value=q+"${"+a.deviceName+"."+F.name+"}"+D;const J=q.match(Ad),ae=(J==null?void 0:J.length)||0;e.payload.data.fields.push({index:ae,deviceName:a.deviceName,deviceCode:a.deviceCode,field:F.dataField,fieldName:F.name}),e.payload.label=d(e.payload.data.content),console.log(e.payload.data.content,e.payload.data.fields)})},h=l.ref(e.payload.data.content||null),p=l.ref(e.payload.attrs.body.fill||null),g=l.ref(e.payload.attrs.body.stroke||null),m=l.ref(e.payload.attrs.body.strokeWidth||null),y=l.ref(e.payload.attrs.body.rx||null),b=l.ref(e.payload.attrs.body.ry||null),w=l.ref(e.payload.attrs.text.fill||null),x=l.ref(e.payload.attrs.text.fontSize||null),S=l.ref(((z=e.payload.attrs.label)==null?void 0:z.textAnchor)||null),v=l.ref(((I=e.payload.attrs.label)==null?void 0:I.x)||null),E=l.ref(((U=e.payload.attrs.label)==null?void 0:U.y)||null),C=()=>{e.payload.attr("body/fill",p.value),e.payload.attr("body/stroke",g.value),e.payload.attr("body/strokeWidth",m.value),e.payload.attr("body/rx",y.value),e.payload.attr("body/ry",b.value),e.payload.attr("text/fill",w.value),e.payload.attr("text/fontSize",x.value),e.payload.attr("label/textAnchor",S.value),e.payload.attr("label/x",v.value),e.payload.attr("label/y",E.value)},O=l.ref(null),A=/[\$\{|\}]/g,k=F=>{A.test(F)&&(h.value=h.value.slice(0,-1));const D=e.payload.data.content;if(F.length<D.length){const{deleted:q,start:J,end:ae}=_(D,F);if(q==="}"){const Z=D.lastIndexOf("${",J),fe=D.substring(Z,J)+"}";h.value=D.replace(fe,"");const Ze=fe.replace(/[${}]/g,"");e.payload.data.fields=e.payload.data.fields.filter(yt=>yt.deviceName+"."+yt.fieldName!==Ze)}}e.payload.data.content=h.value,e.payload.label=d(h.value),console.log(e.payload.data.content,e.payload.data.fields)},_=(F,D)=>{let q=0,J=0;for(;q<F.length&&J<D.length&&F[q]===D[J];)q++,J++;if(J===D.length&&q<F.length)return{deleted:F.slice(q),start:q,end:F.length};let ae=F.length-1,Z=D.length-1;for(;ae>q&&Z>J&&F[ae]===D[Z];)ae--,Z--;return{deleted:F.slice(q,ae),start:q,end:ae}},V=l.ref(null),L=()=>{var D;const F=(D=O.value)==null?void 0:D.$refs.textarea;V.value=F.selectionStart},B=l.ref([]),N=()=>{B.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(F=>({id:F.id,attrs:F.attrs,args:{x:Number(F.args.x.replace("%","")),y:Number(F.args.y.replace("%",""))}}))))},P=()=>{const F=Vu;F.attrs.text.text=`${e.payload.getPorts().length+1}`,F.args.x="50%",F.args.y="50%",e.payload.addPorts([{group:"ports",...F}]),N()},T=()=>{Fr("#drawing-board",!0)},j=(F,D,q)=>{e.payload.portProp(F,"args/"+D,q+"%"),N()},Y=F=>{e.payload.removePort(F),N()};return l.onMounted(()=>{N(),i(),l.nextTick(()=>{document.addEventListener("selectionchange",()=>{var Z;if(!O.value)return!1;const F=(Z=O.value)==null?void 0:Z.$refs.textarea,D=F.selectionStart,q=h.value,J=/\$\{.*?\}/g;let ae;for(;(ae=J.exec(q))!==null;){const fe=ae.index,Ze=J.lastIndex;if(D>fe&&D<Ze)return console.log("光标位于字段:",ae[0]),F.setSelectionRange(Ze,Ze),!0}return console.log("光标不在任何字段内"),!1})})}),(F,D)=>{const q=l.resolveComponent("el-input"),J=l.resolveComponent("el-alert"),ae=l.resolveComponent("el-option"),Z=l.resolveComponent("el-select"),fe=l.resolveComponent("el-table-column"),Ze=l.resolveComponent("el-table"),yt=l.resolveComponent("el-collapse-item"),Me=l.resolveComponent("el-col"),ne=l.resolveComponent("el-color-picker"),xt=l.resolveComponent("el-row"),Zt=l.resolveComponent("el-input-number"),Ds=l.resolveComponent("el-button"),ur=l.resolveComponent("el-slider"),So=l.resolveComponent("el-icon"),xn=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",K3,[l.createVNode(xn,{modelValue:t.value,"onUpdate:modelValue":D[12]||(D[12]=le=>t.value=le),accordion:""},{default:l.withCtx(()=>[n.payload.data.type==="text"?(l.openBlock(),l.createBlock(yt,{key:0,title:"文本内容",name:"0"},{default:l.withCtx(()=>[l.createVNode(q,{ref_key:"inputRef",ref:O,type:"textarea",modelValue:h.value,"onUpdate:modelValue":D[0]||(D[0]=le=>h.value=le),onInput:k,onBlur:L,rows:10},null,8,["modelValue"]),l.createVNode(J,{type:"info",title:"提示",description:"请先选择设备,再选择字段,最后点击确定按钮,即可绑定设备数据。绑定完成后会由 $<> 进行包裹!",style:{"margin-top":"20px"}}),l.createVNode(Z,{modelValue:o.value,"onUpdate:modelValue":D[1]||(D[1]=le=>o.value=le),placeholder:"请选择设备",onChange:c,filterable:"",clearable:"",style:{"margin-top":"20px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.value,le=>(l.openBlock(),l.createBlock(ae,{key:le.deviceCode,label:le.deviceName,value:le.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(Ze,{data:r.value,border:"",style:{"margin-top":"20px"},size:"small",height:"500",onRowClick:f},{default:l.withCtx(()=>[l.createVNode(fe,{type:"index",label:"序号",width:"50",align:"center"}),l.createVNode(fe,{prop:"name",label:"字段名称","show-overflow-tooltip":""}),l.createVNode(fe,{prop:"dataField",label:"字段编码","show-overflow-tooltip":""}),l.createVNode(fe,{prop:"unit",label:"单位",width:"50"})]),_:1},8,["data"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(yt,{title:"图形设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",Z3,[l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[13]||(D[13]=[l.createElementVNode("div",{class:"row-label"},"背景颜色",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:p.value,"onUpdate:modelValue":D[2]||(D[2]=le=>p.value=le),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[14]||(D[14]=[l.createElementVNode("div",{class:"row-label"},"边框颜色",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:g.value,"onUpdate:modelValue":D[3]||(D[3]=le=>g.value=le),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[15]||(D[15]=[l.createElementVNode("div",{class:"row-label"},"边框宽度",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:m.value,"onUpdate:modelValue":D[4]||(D[4]=le=>m.value=le),size:"small","controls-position":"right",onChange:C,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[16]||(D[16]=[l.createElementVNode("div",{class:"row-label"},"背景圆角rx",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:y.value,"onUpdate:modelValue":D[5]||(D[5]=le=>y.value=le),size:"small","controls-position":"right",onChange:C,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[17]||(D[17]=[l.createElementVNode("div",{class:"row-label"},"背景圆角ry",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:b.value,"onUpdate:modelValue":D[6]||(D[6]=le=>b.value=le),size:"small","controls-position":"right",onChange:C,min:0,max:50,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),n.payload.data.type==="text"?(l.openBlock(),l.createBlock(yt,{key:1,title:"文字设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",Q3,[l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[18]||(D[18]=[l.createElementVNode("div",{class:"row-label"},"字体颜色",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(ne,{modelValue:w.value,"onUpdate:modelValue":D[7]||(D[7]=le=>w.value=le),"show-alpha":!0,size:"small",onChange:C},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[19]||(D[19]=[l.createElementVNode("div",{class:"row-label"},"字体大小",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:x.value,"onUpdate:modelValue":D[8]||(D[8]=le=>x.value=le),size:"small","controls-position":"right",onChange:C,min:12,max:48,step:2},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[20]||(D[20]=[l.createElementVNode("div",{class:"row-label"},"对齐方式",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:S.value,"onUpdate:modelValue":D[9]||(D[9]=le=>S.value=le),size:"small",onChange:C},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(["start","middle","end"],le=>l.createVNode(ae,{key:le,label:le,value:le},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[21]||(D[21]=[l.createElementVNode("div",{class:"row-label"},"x轴偏移",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:v.value,"onUpdate:modelValue":D[10]||(D[10]=le=>v.value=le),size:"small","controls-position":"right",onChange:C,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(xt,{gutter:20},{default:l.withCtx(()=>[l.createVNode(Me,{span:12},{default:l.withCtx(()=>D[22]||(D[22]=[l.createElementVNode("div",{class:"row-label"},"y轴偏移",-1)])),_:1}),l.createVNode(Me,{span:12},{default:l.withCtx(()=>[l.createVNode(Zt,{modelValue:E.value,"onUpdate:modelValue":D[11]||(D[11]=le=>E.value=le),size:"small","controls-position":"right",onChange:C,min:0,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})):l.createCommentVNode("",!0),l.createVNode(yt,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(Ds,{type:"primary",onClick:P,size:"small"},{default:l.withCtx(()=>D[23]||(D[23]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(Ds,{type:"primary",onClick:T,size:"small"},{default:l.withCtx(()=>D[24]||(D[24]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(Ze,{data:B.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(fe,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:le})=>[l.createTextVNode(l.toDisplayString(le.attrs.text.text),1)]),_:1}),l.createVNode(fe,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(ur,{modelValue:le.args.x,"onUpdate:modelValue":At=>le.args.x=At,min:0,max:100,step:1,onInput:At=>j(le.id,"x",At)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(fe,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(ur,{modelValue:le.args.y,"onUpdate:modelValue":At=>le.args.y=At,min:0,max:100,step:1,onInput:At=>j(le.id,"y",At)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(fe,{label:"操作",align:"center"},{default:l.withCtx(({row:le})=>[l.createVNode(Ds,{type:"danger",size:"small",onClick:At=>Y(le.id)},{default:l.withCtx(()=>[l.createVNode(So,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Km))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-3e26b862"]]),ej={class:"container"},tj={class:"row-column"},nj={class:"row-column"},sj={class:"row-column"},rj=It({__name:"default-line",props:{payload:Object},setup(n){var c,u,d,f;const e=n,t=l.ref("0"),s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.line.strokeWidth),i=l.reactive({name:((c=e.payload.attrs.line.sourceMarker)==null?void 0:c.name)??null,args:((u=e.payload.attrs.line.sourceMarker)==null?void 0:u.args)??{}}),o=l.reactive({name:((d=e.payload.attrs.line.targetMarker)==null?void 0:d.name)??null,args:((f=e.payload.attrs.line.targetMarker)==null?void 0:f.args)??{}}),a=()=>{e.payload.attr("line/stroke",s.value),e.payload.attr("line/strokeWidth",r.value),e.payload.attr("line/sourceMarker/name",i.name),e.payload.attr("line/sourceMarker/args",i.args),e.payload.attr("line/targetMarker/name",o.name),e.payload.attr("line/targetMarker/args",o.args),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs};return(h,p)=>{const g=l.resolveComponent("el-col"),m=l.resolveComponent("el-color-picker"),y=l.resolveComponent("el-row"),b=l.resolveComponent("el-input-number"),w=l.resolveComponent("el-collapse-item"),x=l.resolveComponent("el-option"),S=l.resolveComponent("el-select"),v=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",ej,[l.createVNode(v,{modelValue:t.value,"onUpdate:modelValue":p[10]||(p[10]=E=>t.value=E),accordion:""},{default:l.withCtx(()=>[l.createVNode(w,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",tj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[11]||(p[11]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=E=>s.value=E),"show-alpha":!0,size:"small",onChange:a},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[12]||(p[12]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:r.value,"onUpdate:modelValue":p[1]||(p[1]=E=>r.value=E),size:"small","controls-position":"right",onChange:a,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(w,{title:"箭头1设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",nj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[13]||(p[13]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(S,{modelValue:i.name,"onUpdate:modelValue":p[2]||(p[2]=E=>i.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),E=>(l.openBlock(),l.createBlock(x,{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[14]||(p[14]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.width,"onUpdate:modelValue":p[3]||(p[3]=E=>i.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[15]||(p[15]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.height,"onUpdate:modelValue":p[4]||(p[4]=E=>i.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[16]||(p[16]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:i.args.offset,"onUpdate:modelValue":p[5]||(p[5]=E=>i.args.offset=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(w,{title:"箭头2设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",sj,[l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[17]||(p[17]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(S,{modelValue:o.name,"onUpdate:modelValue":p[6]||(p[6]=E=>o.name=E),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:a},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),E=>(l.openBlock(),l.createBlock(x,{key:E.value,label:E.label,value:E.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[18]||(p[18]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.width,"onUpdate:modelValue":p[7]||(p[7]=E=>o.args.width=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[19]||(p[19]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.height,"onUpdate:modelValue":p[8]||(p[8]=E=>o.args.height=E),size:"small","controls-position":"right",onChange:a,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(y,{gutter:20},{default:l.withCtx(()=>[l.createVNode(g,{span:12},{default:l.withCtx(()=>p[20]||(p[20]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(g,{span:12},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:o.args.offset,"onUpdate:modelValue":p[9]||(p[9]=E=>o.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-060936eb"]]),ij={class:"form-container"},oj={class:"footer",style:{"margin-top":"10px"}},f0=It({__name:"condition",props:{payload:{type:Array},type:{type:String}},emits:["close"],setup(n,{emit:e}){const t=n,s=l.ref(t.payload),r=()=>{s.value.push(JSON.parse(JSON.stringify(t.type==="pipe"?X3:J3)))},i=u=>{s.value.splice(u,1)},o=e,a=()=>{o("close",s.value)},c=()=>{o("close",!1)};return(u,d)=>{const f=l.resolveComponent("el-button"),h=l.resolveComponent("el-input-number"),p=l.resolveComponent("el-table-column"),g=l.resolveComponent("el-option"),m=l.resolveComponent("el-select"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",ij,[l.createVNode(f,{type:"primary",size:"small",onClick:r,style:{"margin-bottom":"10px"}},{default:l.withCtx(()=>d[0]||(d[0]=[l.createTextVNode("添加条件")])),_:1}),l.createVNode(b,{data:s.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(p,{prop:"min",label:"最小值",width:"150",align:"center"},{default:l.withCtx(w=>[l.createVNode(h,{modelValue:w.row.min,"onUpdate:modelValue":x=>w.row.min=x,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l.createVNode(p,{prop:"max",label:"最大值",width:"150",align:"center"},{default:l.withCtx(w=>[l.createVNode(h,{modelValue:w.row.max,"onUpdate:modelValue":x=>w.row.max=x,size:"small","controls-position":"right"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),n.type==="pipe"?(l.openBlock(),l.createBlock(p,{key:0,prop:"direction",label:"流向",align:"center"},{default:l.withCtx(w=>[l.createVNode(m,{modelValue:w.row.direction,"onUpdate:modelValue":x=>w.row.direction=x,size:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(c0),x=>(l.openBlock(),l.createBlock(g,{key:x.value,label:x.label,value:x.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:1,prop:"direction",label:"方向",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.direction,"onUpdate:modelValue":x=>w.row.direction=x,"active-value":l.unref(mi),"active-text":"正向","inactive-value":l.unref(Md),"inactive-text":"反向",size:"small"},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:2,prop:"direction",label:"动作",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.animation,"onUpdate:modelValue":x=>w.row.animation=x,"active-value":l.unref(cr),"active-text":"闪烁","inactive-value":l.unref(gi),"inactive-text":"静止",size:"small"},null,8,["modelValue","onUpdate:modelValue","active-value","inactive-value"])]),_:1})):l.createCommentVNode("",!0),n.type==="arrow"?(l.openBlock(),l.createBlock(p,{key:3,prop:"display",label:"显示",align:"center"},{default:l.withCtx(w=>[l.createVNode(y,{modelValue:w.row.display,"onUpdate:modelValue":x=>w.row.display=x,"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small"},null,8,["modelValue","onUpdate:modelValue"])]),_:1})):l.createCommentVNode("",!0),l.createVNode(p,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(f,{type:"danger",size:"small",onClick:x=>i(w.$index)},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createElementVNode("div",oj,[l.createVNode(f,{type:"primary",onClick:a},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("保存")])),_:1}),l.createVNode(f,{onClick:c},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("取消")])),_:1})])])}}},[["__scopeId","data-v-93fe286b"]]),aj={class:"container"},lj={class:"row-column"},cj={class:"row-column"},uj={class:"row-column"},dj={class:"row-column"},hj=It({__name:"pipe-line",props:{payload:Object,itemId:{type:String,default:""}},setup(n){var A,k,_,V,L,B,N,P,T,j,Y,te;const e=n,t=l.ref("0"),s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.pipe.stroke),i=l.ref(e.payload.attrs.line.strokeWidth),o=l.ref(e.payload.attrs.pipe.strokeDasharray),a=l.ref(((k=(A=e.payload.attrs.pipe)==null?void 0:A.style)==null?void 0:k.animation.split(" ")[0])??gi),c=l.reactive({name:((_=e.payload.attrs.pipe.sourceMarker)==null?void 0:_.name)??null,args:((V=e.payload.attrs.pipe.sourceMarker)==null?void 0:V.args)??{}}),u=l.reactive({name:((L=e.payload.attrs.pipe.targetMarker)==null?void 0:L.name)??null,args:((B=e.payload.attrs.pipe.targetMarker)==null?void 0:B.args)??{}}),d=()=>{e.payload.attr("line/stroke",s.value),e.payload.attr("pipe/stroke",r.value),e.payload.attr("line/strokeWidth",i.value),e.payload.attr("pipe/strokeWidth",i.value),e.payload.attr("pipe/strokeDasharray",o.value),e.payload.attr("pipe/sourceMarker/name",c.name),e.payload.attr("pipe/sourceMarker/args",c.args),e.payload.attr("pipe/targetMarker/name",u.name),e.payload.attr("pipe/targetMarker/args",u.args),e.payload.attr("pipe/style/animation",Pd(a.value)),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs,console.log("线-基础配置",tt),console.log("线-当前配置",e.payload)},f=l.ref(e.payload.data.isCondition??!1),h=()=>{e.payload.data.isCondition=f.value},p=l.reactive({show:!1,payload:null}),g=()=>{p.show=!0,p.payload=e.payload.data.condition??[]},m=z=>{p.show=!1,p.payload=null,z&&(e.payload.data.condition=z),console.log("条件线",e.payload.data)},y=l.ref([]),b=l.ref(((T=(P=(N=e.payload.data)==null?void 0:N.fields)==null?void 0:P[0])==null?void 0:T.deviceCode)??""),w=l.ref(((te=(Y=(j=e.payload.data)==null?void 0:j.fields)==null?void 0:Y[0])==null?void 0:te.field)??""),x=async()=>{y.value=await Tu(e.itemId),b.value&&v()};let S=l.reactive({});const v=()=>{S=y.value.find(z=>z.deviceCode===b.value),S?(C(),e.payload.data.fields=[{index:0,deviceName:S.deviceName,deviceCode:S.deviceCode,field:w.value??""}],w.value=e.payload.data.fields[0].field):(w.value="",e.payload.data.fields=[]),console.log("管道配置",e.payload)},E=l.ref([]),C=async()=>{E.value=await ku(S.deviceCode)},O=()=>{e.payload.data.fields=[{index:0,deviceName:S.deviceName,deviceCode:S.deviceCode,field:w.value??""}],console.log("管道配置",e.payload)};return l.onMounted(()=>{x()}),(z,I)=>{const U=l.resolveComponent("el-col"),F=l.resolveComponent("el-color-picker"),D=l.resolveComponent("el-row"),q=l.resolveComponent("el-input-number"),J=l.resolveComponent("el-collapse-item"),ae=l.resolveComponent("el-option"),Z=l.resolveComponent("el-select"),fe=l.resolveComponent("el-switch"),Ze=l.resolveComponent("el-button"),yt=l.resolveComponent("el-collapse"),Me=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",aj,[l.createVNode(yt,{modelValue:t.value,"onUpdate:modelValue":I[16]||(I[16]=ne=>t.value=ne),accordion:""},{default:l.withCtx(()=>[l.createVNode(J,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",lj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[18]||(I[18]=[l.createElementVNode("div",{class:"row-label"},"颜色1",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":I[0]||(I[0]=ne=>s.value=ne),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[19]||(I[19]=[l.createElementVNode("div",{class:"row-label"},"颜色2",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":I[1]||(I[1]=ne=>r.value=ne),"show-alpha":!0,size:"small",onChange:d},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[20]||(I[20]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:i.value,"onUpdate:modelValue":I[2]||(I[2]=ne=>i.value=ne),size:"small","controls-position":"right",onChange:d,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(J,{title:"管道设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",cj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[21]||(I[21]=[l.createElementVNode("div",{class:"row-label"},"管道间隔",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:o.value,"onUpdate:modelValue":I[3]||(I[3]=ne=>o.value=ne),size:"small","controls-position":"right",onChange:d,min:5,max:100,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[22]||(I[22]=[l.createElementVNode("div",{class:"row-label"},"默认流动方向",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:a.value,"onUpdate:modelValue":I[4]||(I[4]=ne=>a.value=ne),placeholder:"请选择管道方向",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(c0),ne=>(l.openBlock(),l.createBlock(ae,{key:ne.value,label:ne.label,value:ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[23]||(I[23]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:b.value,"onUpdate:modelValue":I[5]||(I[5]=ne=>b.value=ne),placeholder:"请选择设备",onChange:v,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value,ne=>(l.openBlock(),l.createBlock(ae,{key:ne.deviceCode,label:ne.deviceName,value:ne.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(Z,{modelValue:w.value,"onUpdate:modelValue":I[6]||(I[6]=ne=>w.value=ne),placeholder:"请选择字段",onChange:O,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(E.value,ne=>(l.openBlock(),l.createBlock(ae,{key:ne.dataField,label:ne.name,value:ne.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[24]||(I[24]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(fe,{modelValue:f.value,"onUpdate:modelValue":I[7]||(I[7]=ne=>f.value=ne),"active-value":!0,"inactive-value":!1,size:"small",onChange:h},null,8,["modelValue"]),l.createVNode(Ze,{type:"primary",size:"small",onClick:g,style:{"margin-left":"10px"}},{default:l.withCtx(()=>I[25]||(I[25]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1}),l.createVNode(J,{title:"箭头1设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",uj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[26]||(I[26]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:c.name,"onUpdate:modelValue":I[8]||(I[8]=ne=>c.name=ne),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),ne=>(l.openBlock(),l.createBlock(ae,{key:ne.value,label:ne.label,value:ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[27]||(I[27]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.args.width,"onUpdate:modelValue":I[9]||(I[9]=ne=>c.args.width=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[28]||(I[28]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.args.height,"onUpdate:modelValue":I[10]||(I[10]=ne=>c.args.height=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[29]||(I[29]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:c.args.offset,"onUpdate:modelValue":I[11]||(I[11]=ne=>c.args.offset=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(J,{title:"箭头2设置",name:"3"},{default:l.withCtx(()=>[l.createElementVNode("div",dj,[l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[30]||(I[30]=[l.createElementVNode("div",{class:"row-label"},"类型",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(Z,{modelValue:u.name,"onUpdate:modelValue":I[12]||(I[12]=ne=>u.name=ne),placeholder:"请选择箭头类型",clearable:"",size:"small",onChange:d},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(Pl),ne=>(l.openBlock(),l.createBlock(ae,{key:ne.value,label:ne.label,value:ne.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[31]||(I[31]=[l.createElementVNode("div",{class:"row-label"},"宽",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.args.width,"onUpdate:modelValue":I[13]||(I[13]=ne=>u.args.width=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[32]||(I[32]=[l.createElementVNode("div",{class:"row-label"},"高",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.args.height,"onUpdate:modelValue":I[14]||(I[14]=ne=>u.args.height=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(D,{gutter:20},{default:l.withCtx(()=>[l.createVNode(U,{span:12},{default:l.withCtx(()=>I[33]||(I[33]=[l.createElementVNode("div",{class:"row-label"},"偏移",-1)])),_:1}),l.createVNode(U,{span:12},{default:l.withCtx(()=>[l.createVNode(q,{modelValue:u.args.offset,"onUpdate:modelValue":I[15]||(I[15]=ne=>u.args.offset=ne),size:"small","controls-position":"right",onChange:d,min:0,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(Me,{modelValue:p.show,"onUpdate:modelValue":I[17]||(I[17]=ne=>p.show=ne),width:"500px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[p.show?(l.openBlock(),l.createBlock(f0,{key:0,payload:p.payload,type:"pipe",onClose:m},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-c0d777a1"]]),fj={class:"container"},pj={class:"row-column"},gj={class:"row-column"},mj={class:"row-column"},yj=It({__name:"arrow-line",props:{payload:{type:Object,itemId:{type:String,default:""}}},setup(n){var k,_,V,L,B,N;const e=n,t=l.ref("0");console.log(e.payload);const s=l.ref(e.payload.attrs.line.stroke),r=l.ref(e.payload.attrs.line.strokeWidth),i=e.payload.markup.length-1,o=l.ref(e.payload.markup.length-1),a=l.ref(e.payload.attrs.arrow.fill),c=l.ref(e.payload.attrs.arrow.d===Ka?mi:Md),u=l.ref(e.payload.attrs.arrow.style.animation.split(" ")[0]===cr?cr:gi),d=l.ref(e.payload.attrs.arrow.display),f=()=>{if(e.payload.attr("line/stroke",s.value),e.payload.attr("line/strokeWidth",r.value),e.payload.attr("arrow/fill",a.value),e.payload.attr("arrow/stroke",a.value),o.value!==i){e.payload.markup=e.payload.markup.slice(0,1);for(let P=0;P<o.value;P++)e.payload.markup.push({tagName:"path",groupSelector:"arrow",selector:"arrow"+(P+1)}),e.payload.attr("arrow"+(P+1),{atConnectionRatio:1/(o.value+1)*(P+1)})}e.payload.attr("arrow/d",c.value===mi?Ka:Xm),e.payload.attr("arrow/style/animation",u.value===cr?"flashing 2s infinite linear":""),e.payload.attr("arrow/display",d.value),console.log(e.payload.markup),tt.markup=e.payload.markup,tt.attrs=e.payload.attrs},h=l.ref([]),p=l.ref(((V=(_=(k=e.payload.data)==null?void 0:k.fields)==null?void 0:_[0])==null?void 0:V.deviceCode)??""),g=l.ref(((N=(B=(L=e.payload.data)==null?void 0:L.fields)==null?void 0:B[0])==null?void 0:N.field)??""),m=async()=>{h.value=await Tu(e.itemId),p.value&&b()};let y=l.reactive({});const b=()=>{y=h.value.find(P=>P.deviceCode===p.value),y?(x(),e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],g.value=e.payload.data.fields[0].field):(g.value="",e.payload.data.fields=[]),console.log("箭头线-配置",e.payload)},w=l.ref([]),x=async()=>{w.value=await ku(y.deviceCode)},S=()=>{e.payload.data.fields=[{index:0,deviceName:y.deviceName,deviceCode:y.deviceCode,field:g.value??""}],console.log("箭头线-配置",e.payload)},v=l.ref(e.payload.data.isCondition??!1),E=()=>{e.payload.data.isCondition=v.value},C=l.reactive({show:!1,payload:null}),O=()=>{C.show=!0,C.payload=e.payload.data.condition??[]},A=P=>{C.show=!1,C.payload=null,P&&(e.payload.data.condition=P),console.log("条件线",e.payload.data)};return l.onMounted(()=>{m()}),(P,T)=>{const j=l.resolveComponent("el-col"),Y=l.resolveComponent("el-color-picker"),te=l.resolveComponent("el-row"),z=l.resolveComponent("el-input-number"),I=l.resolveComponent("el-collapse-item"),U=l.resolveComponent("el-option"),F=l.resolveComponent("el-select"),D=l.resolveComponent("el-switch"),q=l.resolveComponent("el-button"),J=l.resolveComponent("el-collapse"),ae=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",fj,[l.createVNode(J,{modelValue:t.value,"onUpdate:modelValue":T[10]||(T[10]=Z=>t.value=Z),accordion:""},{default:l.withCtx(()=>[l.createVNode(I,{title:"线段设置",name:"0"},{default:l.withCtx(()=>[l.createElementVNode("div",pj,[l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[12]||(T[12]=[l.createElementVNode("div",{class:"row-label"},"颜色",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Y,{modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=Z=>s.value=Z),"show-alpha":!0,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[13]||(T[13]=[l.createElementVNode("div",{class:"row-label"},"粗细",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(z,{modelValue:r.value,"onUpdate:modelValue":T[1]||(T[1]=Z=>r.value=Z),size:"small","controls-position":"right",onChange:f,min:1,max:10,step:1},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(I,{title:"箭头设置",name:"1"},{default:l.withCtx(()=>[l.createElementVNode("div",gj,[l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[14]||(T[14]=[l.createElementVNode("div",{class:"row-label"},"箭头数量",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(z,{modelValue:o.value,"onUpdate:modelValue":T[2]||(T[2]=Z=>o.value=Z),size:"small","controls-position":"right",onChange:f,min:1,max:20,step:1},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[15]||(T[15]=[l.createElementVNode("div",{class:"row-label"},"箭头颜色",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(Y,{modelValue:a.value,"onUpdate:modelValue":T[3]||(T[3]=Z=>a.value=Z),"show-alpha":!0,size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[16]||(T[16]=[l.createElementVNode("div",{class:"row-label"},"默认箭头方向",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:c.value,"onUpdate:modelValue":T[4]||(T[4]=Z=>c.value=Z),size:"small",onChange:f},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(R3),Z=>(l.openBlock(),l.createBlock(U,{key:Z.value,label:Z.label,value:Z.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[17]||(T[17]=[l.createElementVNode("div",{class:"row-label"},"默认箭头动作",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:u.value,"onUpdate:modelValue":T[5]||(T[5]=Z=>u.value=Z),"active-value":l.unref(cr),"active-text":"闪烁","inactive-value":l.unref(gi),"inactive-text":"静止",size:"small",onChange:f},null,8,["modelValue","active-value","inactive-value"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[18]||(T[18]=[l.createElementVNode("div",{class:"row-label"},"默认箭头显示",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:d.value,"onUpdate:modelValue":T[6]||(T[6]=Z=>d.value=Z),"active-value":"block","active-text":"显示","inactive-value":"none","inactive-text":"隐藏",size:"small",onChange:f},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1}),l.createVNode(I,{title:"动态设置",name:"2"},{default:l.withCtx(()=>[l.createElementVNode("div",mj,[l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[19]||(T[19]=[l.createElementVNode("div",{class:"row-label"},"参数设置",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(F,{modelValue:p.value,"onUpdate:modelValue":T[7]||(T[7]=Z=>p.value=Z),placeholder:"请选择设备",onChange:b,size:"small",filterable:"",clearable:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,Z=>(l.openBlock(),l.createBlock(U,{key:Z.deviceCode,label:Z.deviceName,value:Z.deviceCode},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createVNode(F,{modelValue:g.value,"onUpdate:modelValue":T[8]||(T[8]=Z=>g.value=Z),placeholder:"请选择字段",onChange:S,size:"small",filterable:"",clearable:"",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(w.value,Z=>(l.openBlock(),l.createBlock(U,{key:Z.dataField,label:Z.name,value:Z.dataField},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l.createVNode(te,{gutter:20},{default:l.withCtx(()=>[l.createVNode(j,{span:12},{default:l.withCtx(()=>T[20]||(T[20]=[l.createElementVNode("div",{class:"row-label"},"条件配置",-1)])),_:1}),l.createVNode(j,{span:12},{default:l.withCtx(()=>[l.createVNode(D,{modelValue:v.value,"onUpdate:modelValue":T[9]||(T[9]=Z=>v.value=Z),"active-value":!0,"inactive-value":!1,size:"small",onChange:E},null,8,["modelValue"]),l.createVNode(q,{type:"primary",size:"small",onClick:O,style:{"margin-left":"10px"}},{default:l.withCtx(()=>T[21]||(T[21]=[l.createTextVNode(" 配置 ")])),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"]),l.createVNode(ae,{modelValue:C.show,"onUpdate:modelValue":T[11]||(T[11]=Z=>C.show=Z),width:"900px",title:"条件配置","show-close":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[C.show?(l.openBlock(),l.createBlock(f0,{key:0,payload:C.payload,type:"arrow",onClose:A},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-f33df45a"]]),bj={class:"container"},wj={class:"row-column",style:{padding:"5px 1px 10px"}},p0=It({__name:"index",props:{payload:Object,itemId:{type:String,default:""}},setup(n){const e=n,t=l.ref(e.payload.data.type),s=()=>{e.payload.data.type=t.value,t.value===Sd&&(tt.attrs=Ja.attrs,tt.markup=Ja.markup),t.value===Ed&&(tt.attrs=qm.attrs,tt.markup=qm.markup),t.value===Od&&(tt.attrs=Jm.attrs,tt.markup=Jm.markup),e.payload.attrs=null,e.payload.attr(tt.attrs),e.payload.markup=tt.markup,i()},r=l.shallowRef(null),i=()=>{r.value=null,t.value===Sd&&(r.value=rj),t.value===Ed&&(r.value=hj),t.value===Od&&(r.value=yj)};return l.onMounted(()=>{i()}),(o,a)=>{const c=l.resolveComponent("el-col"),u=l.resolveComponent("el-option"),d=l.resolveComponent("el-select"),f=l.resolveComponent("el-row");return l.openBlock(),l.createElementBlock("div",bj,[l.createElementVNode("div",wj,[l.createVNode(f,{gutter:20},{default:l.withCtx(()=>[l.createVNode(c,{span:12},{default:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("div",{class:"row-label"},"线段类型",-1)])),_:1}),l.createVNode(c,{span:12},{default:l.withCtx(()=>[l.createVNode(d,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=h=>t.value=h),placeholder:"请选择线段类型",clearable:"",size:"small",onChange:s},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(D3),h=>(l.openBlock(),l.createBlock(u,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.value),{payload:n.payload,itemId:n.itemId},null,8,["payload","itemId"]))])}}},[["__scopeId","data-v-b641f8fe"]]),xj={class:"form-container"},vj=It({__name:"Shortcuts",setup(n){const e=l.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(t,s)=>{const r=l.resolveComponent("el-table-column"),i=l.resolveComponent("el-table");return l.openBlock(),l.createElementBlock("div",xj,[l.createVNode(i,{data:e.value,size:"small",border:""},{default:l.withCtx(()=>[l.createVNode(r,{prop:"name",label:"名称"}),l.createVNode(r,{prop:"windowsKey",label:"windows"}),l.createVNode(r,{prop:"macKey",label:"mac"})]),_:1},8,["data"])])}}},[["__scopeId","data-v-99982d47"]]),Cj=`.x6-widget-dnd {
488
488
  position: absolute;
489
489
  top: -10000px;
490
490
  left: -10000px;
@@ -504,7 +504,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
504
504
  background: transparent;
505
505
  box-shadow: none;
506
506
  }
507
- `;var Sj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Vs extends be{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(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},Vs.defaults),e),this.init()}init(){qr(this.name,Cj),this.container=document.createElement("div"),ee(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new $(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Lt(this.container,this.draggingGraph.container)}start(e,t){const s=t;s.preventDefault(),this.targetModel.startBatch("dnd"),ee(this.container,"dragging"),xs(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,s.clientX,s.clientY);const r=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:e,cell:e,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Vs.documentEvents,s.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,s){const r=this.draggingGraph,i=r.model,o=this.options.getDragNode(e,{sourceNode:e,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 d=this.targetGraph.transform.getScale();r.scale(d.sx,d.sy),a*=Math.max(d.sx,d.sy)}else r.scale(1,1);this.clearDragging(),i.resetCells([o]);const c=r.findViewByCell(o);c.undelegateEvents(),c.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const u=c.getBBox();this.geometryBBox=c.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(u.getTopLeft()),this.draggingNode=o,this.draggingView=c,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,s)}updateGraphPosition(e,t){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,c={left:e-i.x-o.width/2-a+r,top:t-i.y-o.height/2-a+s};return this.draggingGraph&&Je(this.container,{left:`${c.left}px`,top:`${c.top}px`}),c}updateNodePosition(e,t){const s=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return s.x-=r.width/2,s.y-=r.height/2,this.draggingNode.position(s.x,s.y),s}snap({cell:e,current:t,options:s}){const r=e;if(s.snapped){const i=this.draggingBBox;r.position(i.x+s.tx,i.y+s.ty,{silent:!0}),this.draggingView.translate(),r.position(t.x,t.y,{silent:!0}),this.snapOffset={x:s.tx,y:s.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const s=this.normalizeEvent(e),r=s.clientX,i=s.clientY;this.updateGraphPosition(r,i);const o=this.updateNodePosition(r,i),a=this.targetGraph.options.embedding.enabled,c=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(a){t.setEventData(s,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const u=t.getEventData(s);c?t.processEmbedding(s,u):t.clearEmbedding(u),this.candidateEmbedView=u.candidateEmbedView}this.isSnaplineEnabled()&&(c?this.snapline.snapOnMoving({e:s,view:t,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const s=this.normalizeEvent(e),r=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,c=i.y;o&&(a+=o.x,c+=o.y),t.position(a,c,{silent:!0});const u=this.drop(t,{x:s.clientX,y:s.clientY}),d=f=>{f?(this.onDropped(t),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")};Du(u)?(this.undelegateDocumentEvents(),u.then(d)):d(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(e){this.draggingNode===e&&(this.clearDragging(),Ie(this.container,"dragging"),Yt(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,s=null;const r=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(s=this.getDropArea(this.options.dndContainer));const o=s&&s.containsPoint(e);if(i)if(i.options.autoResize)t=this.getDropArea(i.container);else{const a=this.getDropArea(i.container);t=this.getDropArea(r.container).intersectsWithRect(a)}else t=this.getDropArea(r.container);return!o&&t&&t.containsPoint(e)}getDropArea(e){const t=sd(e),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return G.create({x:t.left+parseInt(Je(e,"border-left-width"),10)-r,y:t.top+parseInt(Je(e,"border-top-width"),10)-s,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const s=this.targetGraph,r=s.model,i=s.clientToLocal(t),o=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:o,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),c=a.getBBox();i.x+=c.x-c.width/2,i.y+=c.y-c.height/2;const u=this.snapOffset?1:s.getGridSize();a.position(Se.snapToGrid(i.x,u),Se.snapToGrid(i.y,u)),a.removeZIndex();const d=this.options.validateNode,f=d?d(a,{sourceNode:o,draggingNode:e,droppingNode:a,targetGraph:s,draggingGraph:this.draggingGraph}):!0;return typeof f=="boolean"?f?(r.addCell(a,{stencil:this.cid}),a):null:CD(f).then(h=>h?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Xr(this.name)}}Sj([be.dispose()],Vs.prototype,"dispose",null),function(n){n.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},n.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(Vs||(Vs={}));function Ej(n,e={}){const t=nt.isModel(n)?n:new nt().resetCells(n,{sort:!1,dryrun:!0}),s=t.getNodes(),r=e.columns||1,i=Math.ceil(s.length/r),o=e.dx||0,a=e.dy||0,c=e.center!==!1,u=e.resizeToFit===!0,d=e.marginX||0,f=e.marginY||0,h=[];let p=e.columnWidth;if(p==="compact")for(let w=0;w<r;w+=1){const x=Dn.getNodesInColumn(s,w,r);h.push(Dn.getMaxDim(x,"width")+o)}else{(p==null||p==="auto")&&(p=Dn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)h.push(p)}const g=Dn.accumulate(h,d),m=[];let y=e.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Dn.getNodesInRow(s,w,r);m.push(Dn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Dn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Dn.accumulate(m,f);t.startBatch("layout"),s.forEach((w,x)=>{const v=x%r,C=Math.floor(x/r),E=h[v],S=m[C];let O=0,A=0,k=w.getSize();if(u){let _=E-2*o,V=S-2*a;const L=k.height*(k.width?_/k.width:1),B=k.width*(k.height?V/k.height:1);S<L?_=B:V=L,k={width:_,height:V},w.setSize(k,e)}c&&(O=(E-k.width)/2,A=(S-k.height)/2),w.position(g[v]+o+O,b[C]+a+A,e)}),t.stopBatch("layout")}var Dn;(function(n){function e(i,o){return i.reduce((a,c)=>Math.max(c==null?void 0:c.getSize()[o],a),0)}n.getMaxDim=e;function t(i,o,a){const c=[];for(let u=a*o,d=u+a;u<d;u+=1)i[u]&&c.push(i[u]);return c}n.getNodesInRow=t;function s(i,o,a){const c=[];for(let u=o,d=i.length;u<d;u+=a)i[u]&&c.push(i[u]);return c}n.getNodesInColumn=s;function r(i,o){return i.reduce((a,c,u)=>(a.push(a[u]+c),a),[o||0])}n.accumulate=r})(Dn||(Dn={}));const Oj=`.x6-widget-dnd {
507
+ `;var Sj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class Vs extends be{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(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},Vs.defaults),e),this.init()}init(){qr(this.name,Cj),this.container=document.createElement("div"),ee(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new $(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),Lt(this.container,this.draggingGraph.container)}start(e,t){const s=t;s.preventDefault(),this.targetModel.startBatch("dnd"),ee(this.container,"dragging"),xs(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,s.clientX,s.clientY);const r=this.updateNodePosition(s.clientX,s.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:s,node:e,cell:e,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Vs.documentEvents,s.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,s){const r=this.draggingGraph,i=r.model,o=this.options.getDragNode(e,{sourceNode:e,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 d=this.targetGraph.transform.getScale();r.scale(d.sx,d.sy),a*=Math.max(d.sx,d.sy)}else r.scale(1,1);this.clearDragging(),i.resetCells([o]);const c=r.findViewByCell(o);c.undelegateEvents(),c.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const u=c.getBBox();this.geometryBBox=c.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(u.getTopLeft()),this.draggingNode=o,this.draggingView=c,this.draggingBBox=o.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,s)}updateGraphPosition(e,t){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,c={left:e-i.x-o.width/2-a+r,top:t-i.y-o.height/2-a+s};return this.draggingGraph&&Je(this.container,{left:`${c.left}px`,top:`${c.top}px`}),c}updateNodePosition(e,t){const s=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return s.x-=r.width/2,s.y-=r.height/2,this.draggingNode.position(s.x,s.y),s}snap({cell:e,current:t,options:s}){const r=e;if(s.snapped){const i=this.draggingBBox;r.position(i.x+s.tx,i.y+s.ty,{silent:!0}),this.draggingView.translate(),r.position(t.x,t.y,{silent:!0}),this.snapOffset={x:s.tx,y:s.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const s=this.normalizeEvent(e),r=s.clientX,i=s.clientY;this.updateGraphPosition(r,i);const o=this.updateNodePosition(r,i),a=this.targetGraph.options.embedding.enabled,c=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:i});if(a){t.setEventData(s,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const u=t.getEventData(s);c?t.processEmbedding(s,u):t.clearEmbedding(u),this.candidateEmbedView=u.candidateEmbedView}this.isSnaplineEnabled()&&(c?this.snapline.snapOnMoving({e:s,view:t,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const s=this.normalizeEvent(e),r=this.draggingView,i=this.draggingBBox,o=this.snapOffset;let a=i.x,c=i.y;o&&(a+=o.x,c+=o.y),t.position(a,c,{silent:!0});const u=this.drop(t,{x:s.clientX,y:s.clientY}),d=f=>{f?(this.onDropped(t),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")};Du(u)?(this.undelegateDocumentEvents(),u.then(d)):d(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(e){this.draggingNode===e&&(this.clearDragging(),Ie(this.container,"dragging"),Yt(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,s=null;const r=this.targetGraph,i=this.targetScroller;this.options.dndContainer&&(s=this.getDropArea(this.options.dndContainer));const o=s&&s.containsPoint(e);if(i)if(i.options.autoResize)t=this.getDropArea(i.container);else{const a=this.getDropArea(i.container);t=this.getDropArea(r.container).intersectsWithRect(a)}else t=this.getDropArea(r.container);return!o&&t&&t.containsPoint(e)}getDropArea(e){const t=sd(e),s=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return G.create({x:t.left+parseInt(Je(e,"border-left-width"),10)-r,y:t.top+parseInt(Je(e,"border-top-width"),10)-s,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const s=this.targetGraph,r=s.model,i=s.clientToLocal(t),o=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:o,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),c=a.getBBox();i.x+=c.x-c.width/2,i.y+=c.y-c.height/2;const u=this.snapOffset?1:s.getGridSize();a.position(Se.snapToGrid(i.x,u),Se.snapToGrid(i.y,u)),a.removeZIndex();const d=this.options.validateNode,f=d?d(a,{sourceNode:o,draggingNode:e,droppingNode:a,targetGraph:s,draggingGraph:this.draggingGraph}):!0;return typeof f=="boolean"?f?(r.addCell(a,{stencil:this.cid}),a):null:CD(f).then(h=>h?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),Xr(this.name)}}Sj([be.dispose()],Vs.prototype,"dispose",null),function(n){n.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},n.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(Vs||(Vs={}));function Ej(n,e={}){const t=nt.isModel(n)?n:new nt().resetCells(n,{sort:!1,dryrun:!0}),s=t.getNodes(),r=e.columns||1,i=Math.ceil(s.length/r),o=e.dx||0,a=e.dy||0,c=e.center!==!1,u=e.resizeToFit===!0,d=e.marginX||0,f=e.marginY||0,h=[];let p=e.columnWidth;if(p==="compact")for(let w=0;w<r;w+=1){const x=Dn.getNodesInColumn(s,w,r);h.push(Dn.getMaxDim(x,"width")+o)}else{(p==null||p==="auto")&&(p=Dn.getMaxDim(s,"width")+o);for(let w=0;w<r;w+=1)h.push(p)}const g=Dn.accumulate(h,d),m=[];let y=e.rowHeight;if(y==="compact")for(let w=0;w<i;w+=1){const x=Dn.getNodesInRow(s,w,r);m.push(Dn.getMaxDim(x,"height")+a)}else{(y==null||y==="auto")&&(y=Dn.getMaxDim(s,"height")+a);for(let w=0;w<i;w+=1)m.push(y)}const b=Dn.accumulate(m,f);t.startBatch("layout"),s.forEach((w,x)=>{const S=x%r,v=Math.floor(x/r),E=h[S],C=m[v];let O=0,A=0,k=w.getSize();if(u){let _=E-2*o,V=C-2*a;const L=k.height*(k.width?_/k.width:1),B=k.width*(k.height?V/k.height:1);C<L?_=B:V=L,k={width:_,height:V},w.setSize(k,e)}c&&(O=(E-k.width)/2,A=(C-k.height)/2),w.position(g[S]+o+O,b[v]+a+A,e)}),t.stopBatch("layout")}var Dn;(function(n){function e(i,o){return i.reduce((a,c)=>Math.max(c==null?void 0:c.getSize()[o],a),0)}n.getMaxDim=e;function t(i,o,a){const c=[];for(let u=a*o,d=u+a;u<d;u+=1)i[u]&&c.push(i[u]);return c}n.getNodesInRow=t;function s(i,o,a){const c=[];for(let u=o,d=i.length;u<d;u+=a)i[u]&&c.push(i[u]);return c}n.getNodesInColumn=s;function r(i,o){return i.reduce((a,c,u)=>(a.push(a[u]+c),a),[o||0])}n.accumulate=r})(Dn||(Dn={}));const Oj=`.x6-widget-dnd {
508
508
  position: absolute;
509
509
  top: -10000px;
510
510
  left: -10000px;
@@ -739,4 +739,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
739
739
  font-size: 12px;
740
740
  background: 0 0;
741
741
  }
742
- `;var Mj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class yi extends be{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(e={}){super(),this.name="stencil",qr(this.name,Oj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},yi.defaultOptions),e),this.init()}init(){this.dnd=new Vs(this.options),this.onSearch=vp(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(e,t){return Array.isArray(e)?this.loadGroup(e,t):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s)}),this}unload(e,t){return Array.isArray(e)?this.loadGroup(e,t,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s,!0)}),this}toggleGroup(e){return this.isGroupCollapsed(e)?this.expandGroup(e):this.collapseGroup(e),this}collapseGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&!this.isGroupCollapsed(e)&&(this.trigger("group:collapse",{name:e}),ee(t,"collapsed"))}return this}expandGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&this.isGroupCollapsed(e)&&(this.trigger("group:expand",{name:e}),Ie(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return _n(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&_n(t,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(e=>this.collapseGroup(e)),this}expandGroups(){return Object.keys(this.groups).forEach(e=>this.expandGroup(e)),this}resizeGroup(e,t){const s=this.graphs[e];return s&&s.resize(t.width,t.height),this}addGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups?this.options.groups.push(...t):this.options.groups=t,t.forEach(s=>this.initGroup(s))}removeGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!t.includes(s.name)),t.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];Yt(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),ee(this.container,this.prefixClassName(Nt.base)),pe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),ee(this.content,this.prefixClassName(Nt.content)),xs(this.content,this.container)}initSearch(){this.options.search&&(ee(this.container,"searchable"),Lt(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");ee(s,this.prefixClassName(Nt.group)),pe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&ee(s,"collapsable"),mn(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");ee(r,this.prefixClassName(Nt.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");ee(i,this.prefixClassName(Nt.groupContent));const o=e.graphOptions,a=new $(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new nt,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),Lt(i,a.container),Lt(s,[r,i]),xs(s,this.content),this.groups[e.name]=s,this.graphs[e.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(e=>{this.initGroup(e)});else{const e=this.options.stencilGraphOptions||{},t=new $(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new nt,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));Lt(this.content,t.container),this.graphs[Co.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(ee(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?ee(this.container,"collapsed"):Ie(this.container,"collapsed")):Ie(this.container,"collapsable")}setTitle(){const e=document.createElement("div");ee(e,this.prefixClassName(Nt.title)),e.innerHTML=this.options.title,xs(e,this.container)}renderSearch(){const e=document.createElement("div");ee(e,this.prefixClassName(Nt.search));const t=document.createElement("input");return pe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),ee(t,this.prefixClassName(Nt.searchText)),Lt(e,t),e}startListening(){const e=this.prefixClassName(Nt.title),t=this.prefixClassName(Nt.searchText),s=this.prefixClassName(Nt.groupTitle);this.delegateEvents({[`click .${e}`]:"onTitleClick",[`touchstart .${e}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${t}`]:"onSearch",[`focusin .${t}`]:"onSearchFocusIn",[`focusout .${t}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(e){e.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(e){e.off("cell:mousedown",this.onDragStart,this)}loadGroup(e,t,s){const r=this.getModel(t);if(r){const c=e.map(u=>Ge.isNode(u)?u:Ge.create(u));s===!0?r.removeCells(c):r.resetCells(c)}const i=this.getGroup(t);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&se(a,this,r,i),!o){const c=this.getGraph(t);c.fitToContent({minWidth:c.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(e){const{e:t,node:s}=e,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,t)}filter(e,t){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===Co.defaultGroupName?null:i,c=o.model.getNodes().filter(h=>{let p=!1;typeof t=="function"?p=se(t,this,h,e,a,this):typeof t=="boolean"?p=t:p=this.isCellMatched(h,e,t,e.toLowerCase()!==e);const g=o.renderer.findViewByCell(h);return g&&mn(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,f=new nt;return f.resetCells(c),d.layout&&se(d.layout,this,f,this.getGroup(i)),this.groups[i]&&mn(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);mn(this.container,"not-found",!s)}isCellMatched(e,t,s,r){return t&&s?Object.keys(s).some(i=>{if(i==="*"||e.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(c=>{let u=e.getPropByPath(c);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(t)>=0):!1})}return!1}):!0}onSearch(e){this.filter(e.target.value,this.options.search)}onSearchFocusIn(){ee(this.container,"is-focused")}onSearchFocusOut(){Ie(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(mn(this.container,"collapsed"),_n(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Nt.group)}`);t&&this.toggleGroup(pe(t,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||_n(o,"collapsed")});mn(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||Co.defaultGroupName]}getGroup(e){const t=this.options.groups;return e!=null&&t&&t.length?t.find(s=>s.name===e):null}getGroupByNode(e){const t=this.options.groups;return t?t.find(s=>{const r=this.getModel(s.name);return r?r.has(e.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(e=>{const t=this.graphs[e];this.unregisterGraphEvents(t),t.dispose()}),Object.keys(this.groups).forEach(e=>{const t=this.groups[e];Yt(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Xr(this.name)}}Mj([be.dispose()],yi.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(e,t){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};Ej(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},Vs.defaults)}(yi||(yi={}));var Nt;(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`})(Nt||(Nt={}));var Co;(function(n){n.defaultGroupName="__default__"})(Co||(Co={})),$.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},$.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},$.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},$.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},$.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},$.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var Pj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class g0 extends Ve{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{er.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{er.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{er.downloadDataUri(er.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=oe.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=t.preserveDimensions;if(c){const f=typeof c=="boolean"?a:c;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"),t.copyStyles!==!1){const f=s.ownerDocument,h=Array.from(s.querySelectorAll("*")),p=Array.from(i.querySelectorAll("*")),g=f.styleSheets.length,m=[];for(let w=g-1;w>=0;w-=1)m[w]=f.styleSheets[w],f.styleSheets[w].disabled=!0;const y={};h.forEach((w,x)=>{const v=window.getComputedStyle(w,null),C={};Object.keys(v).forEach(E=>{C[E]=v.getPropertyValue(E)}),y[x]=C}),g!==f.styleSheets.length&&m.forEach((w,x)=>{f.styleSheets[x]=w});for(let w=0;w<g;w+=1)f.styleSheets[w].disabled=!1;const b={};h.forEach((w,x)=>{const v=window.getComputedStyle(w,null),C=y[x],E={};Object.keys(v).forEach(S=>{!Rc(S)&&v.getPropertyValue(S)!==C[S]&&(E[S]=v.getPropertyValue(S))}),b[x]=E}),p.forEach((w,x)=>{Je(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const f=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(oe.create("style",{type:"text/css"},[f]))}const d=()=>{const f=t.beforeSerialize;if(typeof f=="function"){const p=se(f,this.graph,i);p instanceof SVGSVGElement&&(i=p)}const h=new XMLSerializer().serializeToString(i).replace(/&nbsp;/g," ");this.notify("after:export",t),e(h)};if(t.serializeImages){const f=r.find("image").map(h=>new Promise(p=>{const g=h.attr("xlink:href")||h.attr("href");er.imageToDataUri(g,(m,y)=>{!m&&y&&h.attr("xlink:href",y),p()})}));Promise.all(f).then(d)}else d()}toDataURL(e,t){let s=t.viewBox||this.graph.getContentBBox();const r=ys(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const i=new G(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const d=s.width+r.left+r.right,f=s.height+r.top+r.bottom;i.scale(d/t.width,f/t.height)}s=G.create(s).moveAndExpand(i);const o=typeof t.width=="number"&&typeof t.height=="number"?{width:t.width,height:t.height}:s;let a=t.ratio?parseFloat(t.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const c={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const d=document.createElement("canvas"),f=d.getContext("2d");d.width=c.width,d.height=c.height;const h=c.width-1,p=c.height-1;f.fillStyle="rgb(1,1,1)",f.fillRect(h,p,1,1);const g=f.getImageData(h,p,1,1).data;if(g[0]!==1||g[1]!==1||g[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=c.width,d.height=c.height;const f=d.getContext("2d");f.fillStyle=t.backgroundColor||"white",f.fillRect(0,0,c.width,c.height);try{f.drawImage(u,0,0,c.width,c.height);const h=d.toDataURL(t.type,t.quality);e(h)}catch{}},this.toSVG(d=>{u.src=`data:image/svg+xml,${encodeURIComponent(d)}`},Object.assign(Object.assign({},t),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},c)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}Pj([Ve.dispose()],g0.prototype,"dispose",null);const Nj={class:"control-box"},Aj=It({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref("3"),s=l.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(e.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=Vu;u.attrs.text.text=`${e.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",e.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{Fr("#drawing-board",!0)},a=(u,d,f)=>{e.payload.portProp(u,"args/"+d,f+"%"),r()},c=u=>{e.payload.removePort(u),r()};return l.onMounted(()=>{r()}),(u,d)=>{const f=l.resolveComponent("el-button"),h=l.resolveComponent("el-table-column"),p=l.resolveComponent("el-slider"),g=l.resolveComponent("el-icon"),m=l.resolveComponent("el-table"),y=l.resolveComponent("el-collapse-item"),b=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Nj,[l.createVNode(b,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=w=>t.value=w),accordion:""},{default:l.withCtx(()=>[l.createVNode(y,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(f,{type:"primary",onClick:i,size:"small"},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(f,{type:"primary",onClick:o,size:"small"},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(h,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:w})=>[l.createTextVNode(l.toDisplayString(w.attrs.text.text),1)]),_:1}),l.createVNode(h,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{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}),l.createVNode(h,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{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}),l.createVNode(h,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(f,{type:"danger",size:"small",onClick:x=>c(w.id)},{default:l.withCtx(()=>[l.createVNode(g,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Jm))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),m0=[{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"}}],y0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},_j={style:{width:"100%",height:"100%",position:"relative"}},Tj={key:0,class:"spinner"},_d=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 e=n,t=l.ref(),s=()=>{window.__x6_instances__=[];const C=document.getElementById("preview-container");t.value=new $({container:C,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}}),window.__x6_instances__.push(C),t.value.on("blank:dblclick",()=>{h()}),t.value.on("render:done",()=>{Fr("#preview-container",!1),w()})},r=async()=>{let C,E,S;if(e.id){const O=await Wm(e.id);C=(O==null?void 0:O.background)||qa,E=(O==null?void 0:O.grid)||Xa,S=(O==null?void 0:O.data)||{cells:[]}}else C=e.background,E={},S=e.data;t.value.drawBackground(C),t.value.drawGrid(E),t.value.fromJSON(S),d()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=l.ref(!1),u=l.ref(!1),d=()=>{o.value=t.value.getCells().filter(C=>{var E,S,O;return((E=C==null?void 0:C.data)==null?void 0:E.type)==="text"||((S=C==null?void 0:C.data)==null?void 0:S.type)==="pipe"||((O=C==null?void 0:C.data)==null?void 0:O.type)==="arrow"}),o.value.forEach(C=>{var E,S;(S=(E=C==null?void 0:C.data)==null?void 0:E.fields)!=null&&S.length&&a.value.push({id:C==null?void 0:C.id,fields:C==null?void 0:C.data.fields})}),h()},f=l.ref(!0),h=async()=>{if(u.value=!0,!a.value.length){u.value=!1;return}if(!f.value){qe.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),f.value=!1,console.log("字段数据",a.value),await p(a.value),!c.value&&(i.value=setTimeout(()=>{h()},1e4))},p=async(C,E=0)=>{let S=5;if(!c.value)if(C.length>E*S){const O=C.slice(E*S,E*S+S);console.log("批次:",E,"数据:",O),E++,g(await oD(O)),await p(C,E)}else u.value=!1,f.value=!0},g=C=>{C==null||C.forEach(E=>{var O,A,k;const S=t.value.getCellById(E.id);S.data.type==="text"&&(S.label=m(S.data.content,E.fields)),S.data.type==="pipe"&&(console.log("管道详情",S,(O=E.fields)==null?void 0:O[0].value),y(S,(A=E.fields)==null?void 0:A[0].value)),S.data.type==="arrow"&&b(S,(k=E.fields)==null?void 0:k[0].value)})},m=(C,E)=>{let S=0;return C.replace(Nd,()=>{const O=E.find(A=>A.index===S);return S++,O?O.value:d0})},y=(C,E)=>{if(!C.data.isCondition)return!1;for(let S=0;S<C.data.condition.length;S++)if(Number(E)>C.data.condition[S].min&&Number(E)<=C.data.condition[S].max)return C.attr("line2/style/animation",u0(C.data.condition[S].direction)),!1},b=(C,E)=>{if(console.log(C,E),!C.data.isCondition)return!1;for(let S=0;S<C.data.condition.length;S++)if(Number(E)>C.data.condition[S].min&&Number(E)<=C.data.condition[S].max)return C.attr("arrow/style/animation",C.data.condition[S].animation===cr?"flashing 2s infinite linear":""),C.attr("arrow/d",C.data.condition[S].direction===mi?Ka:qm),C.attr("arrow/display",C.data.condition[S].display),!1},w=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},x=l.shallowRef(),v=()=>{new ResizeObserver(()=>{w()}).observe(x.value)};return l.onMounted(()=>{c.value=!1,s(),r(),v()}),l.onUnmounted(()=>{c.value=!0,clearInterval(i.value)}),(C,E)=>(l.openBlock(),l.createElementBlock("div",_j,[l.createElementVNode("div",{id:"preview-container",ref_key:"previewRef",ref:x,onDblclick:w},null,544),u.value?(l.openBlock(),l.createElementBlock("div",Tj,E[0]||(E[0]=[l.createElementVNode("div",{class:"spinner1"},null,-1)]))):l.createCommentVNode("",!0)]))}}),kj={class:"form-container"},Vj={class:"footer"},Dj=It({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=n,s=e,r=l.reactive({groupName:"",sort:1,isShow:1}),i=l.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=l.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?Ya("/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(qe.success("保存成功"),s("close",!0)):qe.error((d==null?void 0:d.msg)||"保存失败")}):Ya("/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(qe.success("保存成功"),s("close",!0)):qe.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},c=()=>{s("close",!1)};return l.onMounted(()=>{var u;(u=t.payload)!=null&&u.id&&(r.id=t.payload.id,r.groupName=t.payload.groupName,r.sort=t.payload.sort,r.isShow=t.payload.isShow)}),(u,d)=>{const f=l.resolveComponent("el-input"),h=l.resolveComponent("el-form-item"),p=l.resolveComponent("el-input-number"),g=l.resolveComponent("el-switch"),m=l.resolveComponent("el-button"),y=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",kj,[l.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(h,{label:"分组名称",prop:"groupName"},{default:l.withCtx(()=>[l.createVNode(f,{modelValue:r.groupName,"onUpdate:modelValue":d[0]||(d[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),l.createVNode(h,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:r.sort,"onUpdate:modelValue":d[1]||(d[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(h,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(g,{modelValue:r.isShow,"onUpdate:modelValue":d[2]||(d[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createElementVNode("div",Vj,[l.createVNode(m,{type:"primary",onClick:a},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(m,{onClick:c},{default:l.withCtx(()=>d[4]||(d[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-807a2ed3"]]),Rj={class:"form-container"},Ij={class:"footer"},Lj=It({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=e,s=n,r=l.shallowRef(null),i=l.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=l.ref(""),c=f=>{if(f.raw.type.indexOf("image")===-1){qe.error("请上传图片格式的文件");return}const h=new FormData;h.append("file",f.raw),iD("/file/fileUpload",h).then(p=>{p!=null&&p.isOk?xe.isSunOs?(a.value=p==null?void 0:p.data,i.imageUrl=p==null?void 0:p.data):(a.value=Jn.defaults.baseURL+"/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):qe.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(f=>{if(f)Ya("/custom/savePicture",i).then(h=>{h!=null&&h.isOk?(qe.success("保存成功"),t("close",!0)):qe.error((h==null?void 0:h.msg)||"保存失败")});else return!1})},d=()=>{t("close",!1)};return l.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=xe.isSunOs?s.payload.imageUrl:Ad(s.payload.imageUrl),a.value=i.imageUrl),i.groupId=s.payload.groupId}),(f,h)=>{const p=l.resolveComponent("el-input"),g=l.resolveComponent("el-form-item"),m=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-image"),w=l.resolveComponent("el-icon"),x=l.resolveComponent("el-upload"),v=l.resolveComponent("el-button"),C=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Rj,[l.createVNode(C,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(g,{label:"图片名称",prop:"imageName"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:i.imageName,"onUpdate:modelValue":h[0]||(h[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":h[1]||(h[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":h[2]||(h[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"上传",prop:"image"},{default:l.withCtx(()=>[l.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":c,"auto-upload":!1},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(l.openBlock(),l.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:l.withCtx(()=>[l.createVNode(l.unref(bD))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",Ij,[l.createVNode(v,{type:"primary",onClick:u},{default:l.withCtx(()=>h[3]||(h[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(v,{onClick:d},{default:l.withCtx(()=>h[4]||(h[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-8f1bae4f"]]),Bj={class:"form-container"},jj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},$j=["src"],zj=It({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Qs("/custom/groupList").then(h=>{e.items=h.data})},s=l.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=h=>{s.show=!0,s.title="编辑图片分组",s.payload={id:h.id,groupName:h.groupName,sort:h.sort,isShow:h.isShow}},o=h=>{(xe.isSunOs?Qs:Gm)("/custom/removeGroup/"+h).then(g=>{g.code===200?(qe.success("删除成功"),t()):qe.error(g.msg||"删除失败")})},a=l.reactive({show:!1,title:"新增图片",payload:null}),c=h=>{a.show=!0,a.title="新增图片",a.payload={groupId:h}},u=h=>{a.show=!0,a.title="编辑图片",a.payload={id:h.id,groupId:h.groupId,imageName:h.imageName,sort:h.sort,isShow:h.isShow,imageUrl:h.imageUrl}},d=h=>{(xe.isSunOs?Qs:Gm)("/custom/removePicture/"+h).then(g=>{g.code===200?(qe.success("删除成功"),t()):qe.error(g.msg||"删除失败")})},f=h=>{s.show=!1,a.show=!1,h&&t()};return l.onMounted(()=>{t()}),(h,p)=>{const g=l.resolveComponent("el-button"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-table"),b=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Bj,[l.createVNode(g,{type:"primary",onClick:r,size:"small"},{default:l.withCtx(()=>p[2]||(p[2]=[l.createTextVNode("新增图片分组")])),_:1}),l.createVNode(y,{data:e.items,border:"",height:"500"},{default:l.withCtx(()=>[l.createVNode(m,{type:"expand"},{default:l.withCtx(w=>[l.createElementVNode("div",jj,[l.createVNode(g,{type:"primary",size:"small",onClick:x=>c(w.row.id)},{default:l.withCtx(()=>p[3]||(p[3]=[l.createTextVNode("新增图片")])),_:2},1032,["onClick"]),l.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:l.withCtx(()=>[l.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),l.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:l.withCtx(x=>[l.createElementVNode("img",{src:l.unref(xe.isSunOs)?x.row.imageUrl:l.unref(Ad)(x.row.imageUrl),alt:"",style:{width:"64px",height:"64px"}},null,8,$j)]),_:1}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(x=>[l.createTextVNode(l.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑 ")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:v=>d(x.row.id)},{default:l.withCtx(()=>p[5]||(p[5]=[l.createTextVNode("删除 ")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),l.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(w=>[l.createTextVNode(l.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(g,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:l.withCtx(()=>p[6]||(p[6]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:l.withCtx(()=>p[7]||(p[7]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":p[0]||(p[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[s.show?(l.openBlock(),l.createBlock(Dj,{key:0,payload:s.payload,onClose:f},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),l.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":p[1]||(p[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[a.show?(l.openBlock(),l.createBlock(Lj,{key:0,payload:a.payload,onClose:f},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-721437e3"]]),Fj={class:"page-container"},Uj={class:"tool-bar"},Hj={class:"action"},Gj={class:"el-dropdown-link"},Wj={class:"action",style:{"margin-right":"50px"}},Yj={class:"board"},qj={class:"drawing-board-box"},Xj={id:"controls"},Jj={key:0,class:"controls-label"},Kj={style:{width:"100%",height:"100%",background:"black"}},b0=It(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""},itemId:{type:String,default:""}},emits:["getJson"],setup(n,{emit:e}){const t=n,s=l.ref(),r=l.reactive({label:"",component:l.shallowRef(null)}),i=l.ref(null),o=l.ref(null),a=()=>{window.__x6_instances__=[];const L=document.getElementById("drawing-board");s.value=new $({container:L,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",...tt,data:{type:c0()},zIndex:0})}}}),window.__x6_instances__.push(s.value),s.value.use(I3()),s.value.use(L3()),s.value.use(B3()),s.value.use(j3()),s.value.use(z3()),s.value.use(F3()),s.value.bindKey(["delete","backspace"],()=>{U3(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{H3(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{G3(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{W3(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Y3(s.value)});let B=null;s.value.on("edge:click",({cell:N})=>{o.value=N,r.component=p0,r.label="线段属性",i.value=Pd()}),s.value.on("edge:mouseenter",({cell:N})=>{clearTimeout(B),N.toFront(),q3(N)}),s.value.on("edge:mouseleave",({cell:N})=>{B=setTimeout(()=>{N.toBack(),N.removeTools()},300)}),s.value.on("node:mouseenter",()=>{Fr("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Fr("#drawing-board",!1)}),s.value.use(new g0),s.value.on("blank:click",({e:N,x:P,y:T})=>{o.value=s,r.component=dD,r.label="画布属性",i.value=Pd()}),s.value.on("cell:click",({cell:N})=>{var P,T;if(o.value=N,i.value=Pd(),((P=N.data)==null?void 0:P.type)==="text"){r.component=h0,r.label="文本属性";return}if(((T=N.data)==null?void 0:T.type)==="base-shape"){r.component=h0,r.label="基础图形属性";return}if((N==null?void 0:N.shape)==="edge"){r.component=p0,r.label="连线属性";return}if((N==null?void 0:N.shape)==="image"){r.component=Aj,r.label="图片属性";return}r.component=null,r.label=null}),s.value.on("render:done",()=>{Fr("#drawing-board",!1),g()})},c=l.ref(),u=()=>{c.value=new yi({target:s.value,...aD,groups:[{name:"基础组件",graphPadding:30}],search(N,P){var T;return((T=N.label)==null?void 0:T.indexOf(P))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:N=>{const P=N.clone({keepId:!0});return P.label!=="文本"&&(P.label=""),P}});const L=s.value.createNode({...lD}),B=m0.map(N=>(N.ports=y0,s.value.createNode(N)));c.value.load([L,...B],"基础组件"),Qs("/custom/groupList").then(N=>{const P=(N==null?void 0:N.data)||[];P==null||P.forEach(T=>{c.value.addGroup({name:T==null?void 0:T.groupName,graphPadding:30});const j=T==null?void 0:T.pictureList.map(Y=>{const te={shape:"image",imageUrl:xe.isSunOs?Y==null?void 0:Y.imageUrl:Ad(Y==null?void 0:Y.imageUrl),ports:y0,width:64,height:64,label:Y.imageName};return s.value.createNode(te)});c.value.load(j,T==null?void 0:T.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{const N=c.value.container,P=N.querySelectorAll(".x6-node"),T=m0.length;N.addEventListener("mouseenter",j,!0),N.addEventListener("mouseleave",Y,!0),P.forEach((te,z)=>{const I=z>T,U=te.querySelector("text");I&&U&&(Object.assign(U.style,{display:"none",fontSize:"12px",fill:"#ffffff"}),U.setAttribute("x","0%"),U.setAttribute("y","40"),te.style.position="relative",te.style.cursor="pointer")});function j(te){const z=te.target.closest(".x6-node");if(z){const I=Array.from(P).indexOf(z),U=z.querySelector("text");I>T&&U&&(U.style.display="block")}}function Y(te){const z=te.target.closest(".x6-node");if(z){const I=Array.from(P).indexOf(z),U=z.querySelector("text");I>T&&U&&(U.style.display="none")}}return()=>{N.removeEventListener("mouseenter",j,!0),N.removeEventListener("mouseleave",Y,!0)}},200)})},d=L=>{switch(L){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),qe.warning("关闭对齐线")):(s.value.enableSnapline(),qe.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),qe.warning("关闭框选")):(s.value.enableSelection(),qe.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},f=l.ref(!1),h=l.ref(null),p=()=>{f.value=!0;const L=new Date;s.value.startBatch(L),s.value.disablePanning(),s.value.once("blank:mousedown",({e:B,x:N,y:P})=>{f.value&&(h.value=s.value.addEdge({source:{x:N,y:P},target:{x:N,y:P},...tt,data:{type:c0(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:B,x:N,y:P})=>{f.value&&h.value.setTarget({x:N,y:P})}),s.value.on("blank:mouseup",({e:B,x:N,y:P})=>{f.value=!1,s.value.enablePanning(),s.value.stopBatch(L)})},g=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=l.reactive({show:!1}),y=()=>{m.show=!0},b=l.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(qa),s.value.drawGrid(Xa),qe.success("清空成功")},v=()=>{const L=X().format("YYYYMMDDHHmmss");s.value.exportPNG(L,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},C=e,E=l.reactive({show:!1,background:null,grid:null,data:null}),S=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},O=()=>{E.show=!1},A=()=>{C("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},k=async()=>{if(!t.id){s.value.drawBackground(qa),s.value.drawGrid(Xa),s.value.fromJSON({cells:[]});return}const L=await Wm(t.id);s.value.drawBackground((L==null?void 0:L.background)||qa),s.value.drawGrid((L==null?void 0:L.grid)||Xa),s.value.fromJSON((L==null?void 0:L.data)||{cells:[]})},_=l.shallowRef(null),V=()=>{new ResizeObserver(()=>{g()}).observe(_.value)};return l.onMounted(()=>{a(),u(),k(),V()}),(L,B)=>{const N=l.resolveComponent("el-icon"),P=l.resolveComponent("el-button"),T=l.resolveComponent("el-dropdown-item"),j=l.resolveComponent("el-dropdown-menu"),Y=l.resolveComponent("el-dropdown"),te=l.resolveComponent("el-scrollbar"),z=l.resolveComponent("el-dialog"),I=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",Fj,[l.createElementVNode("div",Uj,[l.createElementVNode("div",Hj,[l.createVNode(Y,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(T,{command:"snapLine"},{default:l.withCtx(()=>B[4]||(B[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(T,{command:"select"},{default:l.withCtx(()=>B[5]||(B[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(T,{command:"drawLine"},{default:l.withCtx(()=>B[6]||(B[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(T,{command:"adaptive"},{default:l.withCtx(()=>B[7]||(B[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(T,{command:"shortcuts"},{default:l.withCtx(()=>B[8]||(B[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(T,{command:"image"},{default:l.withCtx(()=>B[9]||(B[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(T,{command:"clear"},{default:l.withCtx(()=>B[10]||(B[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(T,{command:"export"},{default:l.withCtx(()=>B[11]||(B[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",Gj,[l.createVNode(P,{size:"small",text:""},{default:l.withCtx(()=>[B[3]||(B[3]=l.createTextVNode("工具 ")),l.createVNode(N,null,{default:l.withCtx(()=>[l.createVNode(l.unref(fD))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",Wj,[l.createVNode(l.unref(Jg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(P,{size:"small",icon:l.unref(xD),onClick:S},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Jg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(P,{size:"small",icon:l.unref(mD),onClick:A},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",Yj,[B[12]||(B[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",qj,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:_},null,512)]),l.createElementVNode("div",Xj,[r.label?(l.openBlock(),l.createElementBlock("div",Jj,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(te,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value,itemId:t.itemId},null,8,["graph","payload","itemId"]))]),_:1})])]),l.createVNode(z,{modelValue:m.show,"onUpdate:modelValue":B[0]||(B[0]=U=>m.show=U),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(vj)]),_:1},8,["modelValue"]),l.createVNode(z,{modelValue:b.show,"onUpdate:modelValue":B[1]||(B[1]=U=>b.show=U),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[b.show?(l.openBlock(),l.createBlock(zj,{key:0})):l.createCommentVNode("",!0)]),_:1},8,["modelValue"]),l.createVNode(I,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":B[2]||(B[2]=U=>E.show=U),onClose:O,title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",Kj,[E.show?(l.openBlock(),l.createBlock(_d,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-5dc3c2c6"]]),Zj=[b0,_d],w0=n=>{Zj.forEach(e=>{n.component(e.name,e)})};typeof window<"u"&&window.Vue&&w0(window.Vue),xe.isSunOs=!1;const Qj=n=>{xe.isSunOs=n},e$={install:w0};xe.WiringDiagramEditor=b0,xe.WiringDiagramPreview=_d,xe.default=e$,xe.setBaseURL=sD,xe.setIsSunOs=Qj,xe.setToken=rD,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
742
+ `;var Mj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class yi extends be{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(e={}){super(),this.name="stencil",qr(this.name,Oj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},yi.defaultOptions),e),this.init()}init(){this.dnd=new Vs(this.options),this.onSearch=Cp(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(e,t){return Array.isArray(e)?this.loadGroup(e,t):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s)}),this}unload(e,t){return Array.isArray(e)?this.loadGroup(e,t,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s,!0)}),this}toggleGroup(e){return this.isGroupCollapsed(e)?this.expandGroup(e):this.collapseGroup(e),this}collapseGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&!this.isGroupCollapsed(e)&&(this.trigger("group:collapse",{name:e}),ee(t,"collapsed"))}return this}expandGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&this.isGroupCollapsed(e)&&(this.trigger("group:expand",{name:e}),Ie(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return _n(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&_n(t,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(e=>this.collapseGroup(e)),this}expandGroups(){return Object.keys(this.groups).forEach(e=>this.expandGroup(e)),this}resizeGroup(e,t){const s=this.graphs[e];return s&&s.resize(t.width,t.height),this}addGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups?this.options.groups.push(...t):this.options.groups=t,t.forEach(s=>this.initGroup(s))}removeGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!t.includes(s.name)),t.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];Yt(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),ee(this.container,this.prefixClassName(Nt.base)),pe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),ee(this.content,this.prefixClassName(Nt.content)),xs(this.content,this.container)}initSearch(){this.options.search&&(ee(this.container,"searchable"),Lt(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");ee(s,this.prefixClassName(Nt.group)),pe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&ee(s,"collapsable"),mn(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");ee(r,this.prefixClassName(Nt.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");ee(i,this.prefixClassName(Nt.groupContent));const o=e.graphOptions,a=new $(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new nt,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),Lt(i,a.container),Lt(s,[r,i]),xs(s,this.content),this.groups[e.name]=s,this.graphs[e.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(e=>{this.initGroup(e)});else{const e=this.options.stencilGraphOptions||{},t=new $(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new nt,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));Lt(this.content,t.container),this.graphs[Co.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(ee(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?ee(this.container,"collapsed"):Ie(this.container,"collapsed")):Ie(this.container,"collapsable")}setTitle(){const e=document.createElement("div");ee(e,this.prefixClassName(Nt.title)),e.innerHTML=this.options.title,xs(e,this.container)}renderSearch(){const e=document.createElement("div");ee(e,this.prefixClassName(Nt.search));const t=document.createElement("input");return pe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),ee(t,this.prefixClassName(Nt.searchText)),Lt(e,t),e}startListening(){const e=this.prefixClassName(Nt.title),t=this.prefixClassName(Nt.searchText),s=this.prefixClassName(Nt.groupTitle);this.delegateEvents({[`click .${e}`]:"onTitleClick",[`touchstart .${e}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${t}`]:"onSearch",[`focusin .${t}`]:"onSearchFocusIn",[`focusout .${t}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(e){e.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(e){e.off("cell:mousedown",this.onDragStart,this)}loadGroup(e,t,s){const r=this.getModel(t);if(r){const c=e.map(u=>Ge.isNode(u)?u:Ge.create(u));s===!0?r.removeCells(c):r.resetCells(c)}const i=this.getGroup(t);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&se(a,this,r,i),!o){const c=this.getGraph(t);c.fitToContent({minWidth:c.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(e){const{e:t,node:s}=e,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,t)}filter(e,t){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===Co.defaultGroupName?null:i,c=o.model.getNodes().filter(h=>{let p=!1;typeof t=="function"?p=se(t,this,h,e,a,this):typeof t=="boolean"?p=t:p=this.isCellMatched(h,e,t,e.toLowerCase()!==e);const g=o.renderer.findViewByCell(h);return g&&mn(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,f=new nt;return f.resetCells(c),d.layout&&se(d.layout,this,f,this.getGroup(i)),this.groups[i]&&mn(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);mn(this.container,"not-found",!s)}isCellMatched(e,t,s,r){return t&&s?Object.keys(s).some(i=>{if(i==="*"||e.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(c=>{let u=e.getPropByPath(c);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(t)>=0):!1})}return!1}):!0}onSearch(e){this.filter(e.target.value,this.options.search)}onSearchFocusIn(){ee(this.container,"is-focused")}onSearchFocusOut(){Ie(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(mn(this.container,"collapsed"),_n(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Nt.group)}`);t&&this.toggleGroup(pe(t,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||_n(o,"collapsed")});mn(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||Co.defaultGroupName]}getGroup(e){const t=this.options.groups;return e!=null&&t&&t.length?t.find(s=>s.name===e):null}getGroupByNode(e){const t=this.options.groups;return t?t.find(s=>{const r=this.getModel(s.name);return r?r.has(e.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(e=>{const t=this.graphs[e];this.unregisterGraphEvents(t),t.dispose()}),Object.keys(this.groups).forEach(e=>{const t=this.groups[e];Yt(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Xr(this.name)}}Mj([be.dispose()],yi.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(e,t){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};Ej(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},Vs.defaults)}(yi||(yi={}));var Nt;(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`})(Nt||(Nt={}));var Co;(function(n){n.defaultGroupName="__default__"})(Co||(Co={})),$.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},$.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},$.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},$.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},$.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},$.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var Pj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class g0 extends Ve{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{er.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{er.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{er.downloadDataUri(er.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=oe.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=t.preserveDimensions;if(c){const f=typeof c=="boolean"?a:c;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"),t.copyStyles!==!1){const f=s.ownerDocument,h=Array.from(s.querySelectorAll("*")),p=Array.from(i.querySelectorAll("*")),g=f.styleSheets.length,m=[];for(let w=g-1;w>=0;w-=1)m[w]=f.styleSheets[w],f.styleSheets[w].disabled=!0;const y={};h.forEach((w,x)=>{const S=window.getComputedStyle(w,null),v={};Object.keys(S).forEach(E=>{v[E]=S.getPropertyValue(E)}),y[x]=v}),g!==f.styleSheets.length&&m.forEach((w,x)=>{f.styleSheets[x]=w});for(let w=0;w<g;w+=1)f.styleSheets[w].disabled=!1;const b={};h.forEach((w,x)=>{const S=window.getComputedStyle(w,null),v=y[x],E={};Object.keys(S).forEach(C=>{!Rc(C)&&S.getPropertyValue(C)!==v[C]&&(E[C]=S.getPropertyValue(C))}),b[x]=E}),p.forEach((w,x)=>{Je(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const f=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(oe.create("style",{type:"text/css"},[f]))}const d=()=>{const f=t.beforeSerialize;if(typeof f=="function"){const p=se(f,this.graph,i);p instanceof SVGSVGElement&&(i=p)}const h=new XMLSerializer().serializeToString(i).replace(/&nbsp;/g," ");this.notify("after:export",t),e(h)};if(t.serializeImages){const f=r.find("image").map(h=>new Promise(p=>{const g=h.attr("xlink:href")||h.attr("href");er.imageToDataUri(g,(m,y)=>{!m&&y&&h.attr("xlink:href",y),p()})}));Promise.all(f).then(d)}else d()}toDataURL(e,t){let s=t.viewBox||this.graph.getContentBBox();const r=ys(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const i=new G(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const d=s.width+r.left+r.right,f=s.height+r.top+r.bottom;i.scale(d/t.width,f/t.height)}s=G.create(s).moveAndExpand(i);const o=typeof t.width=="number"&&typeof t.height=="number"?{width:t.width,height:t.height}:s;let a=t.ratio?parseFloat(t.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const c={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const d=document.createElement("canvas"),f=d.getContext("2d");d.width=c.width,d.height=c.height;const h=c.width-1,p=c.height-1;f.fillStyle="rgb(1,1,1)",f.fillRect(h,p,1,1);const g=f.getImageData(h,p,1,1).data;if(g[0]!==1||g[1]!==1||g[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=c.width,d.height=c.height;const f=d.getContext("2d");f.fillStyle=t.backgroundColor||"white",f.fillRect(0,0,c.width,c.height);try{f.drawImage(u,0,0,c.width,c.height);const h=d.toDataURL(t.type,t.quality);e(h)}catch{}},this.toSVG(d=>{u.src=`data:image/svg+xml,${encodeURIComponent(d)}`},Object.assign(Object.assign({},t),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},c)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}Pj([Ve.dispose()],g0.prototype,"dispose",null);const Nj={class:"control-box"},Aj=It({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref("3"),s=l.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(e.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=Vu;u.attrs.text.text=`${e.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",e.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{Fr("#drawing-board",!0)},a=(u,d,f)=>{e.payload.portProp(u,"args/"+d,f+"%"),r()},c=u=>{e.payload.removePort(u),r()};return l.onMounted(()=>{r()}),(u,d)=>{const f=l.resolveComponent("el-button"),h=l.resolveComponent("el-table-column"),p=l.resolveComponent("el-slider"),g=l.resolveComponent("el-icon"),m=l.resolveComponent("el-table"),y=l.resolveComponent("el-collapse-item"),b=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Nj,[l.createVNode(b,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=w=>t.value=w),accordion:""},{default:l.withCtx(()=>[l.createVNode(y,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(f,{type:"primary",onClick:i,size:"small"},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(f,{type:"primary",onClick:o,size:"small"},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(h,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:w})=>[l.createTextVNode(l.toDisplayString(w.attrs.text.text),1)]),_:1}),l.createVNode(h,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{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}),l.createVNode(h,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{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}),l.createVNode(h,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(f,{type:"danger",size:"small",onClick:x=>c(w.id)},{default:l.withCtx(()=>[l.createVNode(g,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Km))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),m0=[{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"}}],y0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},_j={style:{width:"100%",height:"100%",position:"relative"}},Tj={key:0,class:"spinner"},Td=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 e=n,t=l.ref(),s=()=>{window.__x6_instances__=[];const v=document.getElementById("preview-container");t.value=new $({container:v,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}}),window.__x6_instances__.push(v),t.value.on("blank:dblclick",()=>{h()}),t.value.on("render:done",()=>{Fr("#preview-container",!1),w()})},r=async()=>{let v,E,C;if(e.id){const O=await Ym(e.id);v=(O==null?void 0:O.background)||qa,E=(O==null?void 0:O.grid)||Xa,C=(O==null?void 0:O.data)||{cells:[]}}else v=e.background,E={},C=e.data;t.value.drawBackground(v),t.value.drawGrid(E),t.value.fromJSON(C),d()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=l.ref(!1),u=l.ref(!1),d=()=>{o.value=t.value.getCells().filter(v=>{var E,C,O;return((E=v==null?void 0:v.data)==null?void 0:E.type)==="text"||((C=v==null?void 0:v.data)==null?void 0:C.type)==="pipe"||((O=v==null?void 0:v.data)==null?void 0:O.type)==="arrow"}),o.value.forEach(v=>{var E,C;(C=(E=v==null?void 0:v.data)==null?void 0:E.fields)!=null&&C.length&&a.value.push({id:v==null?void 0:v.id,fields:v==null?void 0:v.data.fields})}),h()},f=l.ref(!0),h=async()=>{if(u.value=!0,!a.value.length){u.value=!1;return}if(!f.value){qe.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),f.value=!1,console.log("字段数据",a.value),await p(a.value),!c.value&&(i.value=setTimeout(()=>{h()},1e4))},p=async(v,E=0)=>{let C=5;if(!c.value)if(v.length>E*C){const O=v.slice(E*C,E*C+C);console.log("批次:",E,"数据:",O),E++,g(await oD(O)),await p(v,E)}else u.value=!1,f.value=!0},g=v=>{v==null||v.forEach(E=>{var O,A,k;const C=t.value.getCellById(E.id);C.data.type==="text"&&(C.label=m(C.data.content,E.fields)),C.data.type==="pipe"&&(console.log("管道详情",C,(O=E.fields)==null?void 0:O[0].value),y(C,(A=E.fields)==null?void 0:A[0].value)),C.data.type==="arrow"&&b(C,(k=E.fields)==null?void 0:k[0].value)})},m=(v,E)=>{let C=0;return v.replace(Ad,()=>{const O=E.find(A=>A.index===C);return C++,O?O.value:d0})},y=(v,E)=>{if(!v.data.isCondition)return!1;console.log("进入设置管道阶段start:",v),console.log("管道条件判断设置:",v.data.condition);for(let C=0;C<v.data.condition.length;C++){if(console.log("┌──────单个设置管道阶段start:───────┐"),console.log("条件:",v.data.condition[C]),console.log("判断条件是否通过:",Number(E)>v.data.condition[C].min&&Number(E)<=v.data.condition[C].max),Number(E)>v.data.condition[C].min&&Number(E)<=v.data.condition[C].max)return console.log("管道条件判断设置的动画:",Pd(v.data.condition[C].direction)),v.attr("pipe/style/animation",Pd(v.data.condition[C].direction)),console.log("设置过后的属性:",v),console.log("└────────单个条件结束判断────────┘"),!1;console.log("└─────────单个条件结束判断───────┘")}},b=(v,E)=>{if(console.log(v,E),!v.data.isCondition)return!1;for(let C=0;C<v.data.condition.length;C++)if(Number(E)>v.data.condition[C].min&&Number(E)<=v.data.condition[C].max)return v.attr("arrow/style/animation",v.data.condition[C].animation===cr?"flashing 2s infinite linear":""),v.attr("arrow/d",v.data.condition[C].direction===mi?Ka:Xm),v.attr("arrow/display",v.data.condition[C].display),!1},w=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},x=l.shallowRef(),S=()=>{new ResizeObserver(()=>{w()}).observe(x.value)};return l.onMounted(()=>{c.value=!1,s(),r(),S()}),l.onUnmounted(()=>{c.value=!0,clearInterval(i.value)}),(v,E)=>(l.openBlock(),l.createElementBlock("div",_j,[l.createElementVNode("div",{id:"preview-container",ref_key:"previewRef",ref:x,onDblclick:w},null,544),u.value?(l.openBlock(),l.createElementBlock("div",Tj,E[0]||(E[0]=[l.createElementVNode("div",{class:"spinner1"},null,-1)]))):l.createCommentVNode("",!0)]))}}),kj={class:"form-container"},Vj={class:"footer"},Dj=It({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=n,s=e,r=l.reactive({groupName:"",sort:1,isShow:1}),i=l.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=l.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?Ya("/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(qe.success("保存成功"),s("close",!0)):qe.error((d==null?void 0:d.msg)||"保存失败")}):Ya("/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(qe.success("保存成功"),s("close",!0)):qe.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},c=()=>{s("close",!1)};return l.onMounted(()=>{var u;(u=t.payload)!=null&&u.id&&(r.id=t.payload.id,r.groupName=t.payload.groupName,r.sort=t.payload.sort,r.isShow=t.payload.isShow)}),(u,d)=>{const f=l.resolveComponent("el-input"),h=l.resolveComponent("el-form-item"),p=l.resolveComponent("el-input-number"),g=l.resolveComponent("el-switch"),m=l.resolveComponent("el-button"),y=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",kj,[l.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(h,{label:"分组名称",prop:"groupName"},{default:l.withCtx(()=>[l.createVNode(f,{modelValue:r.groupName,"onUpdate:modelValue":d[0]||(d[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),l.createVNode(h,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:r.sort,"onUpdate:modelValue":d[1]||(d[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(h,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(g,{modelValue:r.isShow,"onUpdate:modelValue":d[2]||(d[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createElementVNode("div",Vj,[l.createVNode(m,{type:"primary",onClick:a},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(m,{onClick:c},{default:l.withCtx(()=>d[4]||(d[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-807a2ed3"]]),Rj={class:"form-container"},Ij={class:"footer"},Lj=It({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=e,s=n,r=l.shallowRef(null),i=l.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=l.ref(""),c=f=>{if(f.raw.type.indexOf("image")===-1){qe.error("请上传图片格式的文件");return}const h=new FormData;h.append("file",f.raw),iD("/file/fileUpload",h).then(p=>{p!=null&&p.isOk?xe.isSunOs?(a.value=p==null?void 0:p.data,i.imageUrl=p==null?void 0:p.data):(a.value=Jn.defaults.baseURL+"/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):qe.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(f=>{if(f)Ya("/custom/savePicture",i).then(h=>{h!=null&&h.isOk?(qe.success("保存成功"),t("close",!0)):qe.error((h==null?void 0:h.msg)||"保存失败")});else return!1})},d=()=>{t("close",!1)};return l.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=xe.isSunOs?s.payload.imageUrl:_d(s.payload.imageUrl),a.value=i.imageUrl),i.groupId=s.payload.groupId}),(f,h)=>{const p=l.resolveComponent("el-input"),g=l.resolveComponent("el-form-item"),m=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-image"),w=l.resolveComponent("el-icon"),x=l.resolveComponent("el-upload"),S=l.resolveComponent("el-button"),v=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Rj,[l.createVNode(v,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(g,{label:"图片名称",prop:"imageName"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:i.imageName,"onUpdate:modelValue":h[0]||(h[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":h[1]||(h[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":h[2]||(h[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"上传",prop:"image"},{default:l.withCtx(()=>[l.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":c,"auto-upload":!1},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(l.openBlock(),l.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:l.withCtx(()=>[l.createVNode(l.unref(bD))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",Ij,[l.createVNode(S,{type:"primary",onClick:u},{default:l.withCtx(()=>h[3]||(h[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(S,{onClick:d},{default:l.withCtx(()=>h[4]||(h[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-8f1bae4f"]]),Bj={class:"form-container"},jj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},$j=["src"],zj=It({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Qs("/custom/groupList").then(h=>{e.items=h.data})},s=l.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=h=>{s.show=!0,s.title="编辑图片分组",s.payload={id:h.id,groupName:h.groupName,sort:h.sort,isShow:h.isShow}},o=h=>{(xe.isSunOs?Qs:Wm)("/custom/removeGroup/"+h).then(g=>{g.code===200?(qe.success("删除成功"),t()):qe.error(g.msg||"删除失败")})},a=l.reactive({show:!1,title:"新增图片",payload:null}),c=h=>{a.show=!0,a.title="新增图片",a.payload={groupId:h}},u=h=>{a.show=!0,a.title="编辑图片",a.payload={id:h.id,groupId:h.groupId,imageName:h.imageName,sort:h.sort,isShow:h.isShow,imageUrl:h.imageUrl}},d=h=>{(xe.isSunOs?Qs:Wm)("/custom/removePicture/"+h).then(g=>{g.code===200?(qe.success("删除成功"),t()):qe.error(g.msg||"删除失败")})},f=h=>{s.show=!1,a.show=!1,h&&t()};return l.onMounted(()=>{t()}),(h,p)=>{const g=l.resolveComponent("el-button"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-table"),b=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Bj,[l.createVNode(g,{type:"primary",onClick:r,size:"small"},{default:l.withCtx(()=>p[2]||(p[2]=[l.createTextVNode("新增图片分组")])),_:1}),l.createVNode(y,{data:e.items,border:"",height:"500"},{default:l.withCtx(()=>[l.createVNode(m,{type:"expand"},{default:l.withCtx(w=>[l.createElementVNode("div",jj,[l.createVNode(g,{type:"primary",size:"small",onClick:x=>c(w.row.id)},{default:l.withCtx(()=>p[3]||(p[3]=[l.createTextVNode("新增图片")])),_:2},1032,["onClick"]),l.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:l.withCtx(()=>[l.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),l.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:l.withCtx(x=>[l.createElementVNode("img",{src:l.unref(xe.isSunOs)?x.row.imageUrl:l.unref(_d)(x.row.imageUrl),alt:"",style:{width:"64px",height:"64px"}},null,8,$j)]),_:1}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(x=>[l.createTextVNode(l.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{type:"primary",size:"small",onClick:S=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑 ")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:S=>d(x.row.id)},{default:l.withCtx(()=>p[5]||(p[5]=[l.createTextVNode("删除 ")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),l.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(w=>[l.createTextVNode(l.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(g,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:l.withCtx(()=>p[6]||(p[6]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:l.withCtx(()=>p[7]||(p[7]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":p[0]||(p[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[s.show?(l.openBlock(),l.createBlock(Dj,{key:0,payload:s.payload,onClose:f},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),l.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":p[1]||(p[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[a.show?(l.openBlock(),l.createBlock(Lj,{key:0,payload:a.payload,onClose:f},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-721437e3"]]),Fj={class:"page-container"},Uj={class:"tool-bar"},Hj={class:"action"},Gj={class:"el-dropdown-link"},Wj={class:"action",style:{"margin-right":"50px"}},Yj={class:"board"},qj={class:"drawing-board-box"},Xj={id:"controls"},Jj={key:0,class:"controls-label"},Kj={style:{width:"100%",height:"100%",background:"black"}},b0=It(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""},itemId:{type:String,default:""}},emits:["getJson"],setup(n,{emit:e}){const t=n,s=l.ref(),r=l.reactive({label:"",component:l.shallowRef(null)}),i=l.ref(null),o=l.ref(null),a=()=>{window.__x6_instances__=[];const L=document.getElementById("drawing-board");s.value=new $({container:L,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",...tt,data:{type:u0()},zIndex:0})}}}),window.__x6_instances__.push(s.value),s.value.use(I3()),s.value.use(L3()),s.value.use(B3()),s.value.use(j3()),s.value.use(z3()),s.value.use(F3()),s.value.bindKey(["delete","backspace"],()=>{U3(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{H3(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{G3(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{W3(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Y3(s.value)});let B=null;s.value.on("edge:click",({cell:N})=>{o.value=N,r.component=p0,r.label="线段属性",i.value=Nd()}),s.value.on("edge:mouseenter",({cell:N})=>{clearTimeout(B),N.toFront(),q3(N)}),s.value.on("edge:mouseleave",({cell:N})=>{B=setTimeout(()=>{N.toBack(),N.removeTools()},300)}),s.value.on("node:mouseenter",()=>{Fr("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{Fr("#drawing-board",!1)}),s.value.use(new g0),s.value.on("blank:click",({e:N,x:P,y:T})=>{o.value=s,r.component=dD,r.label="画布属性",i.value=Nd()}),s.value.on("cell:click",({cell:N})=>{var P,T;if(o.value=N,i.value=Nd(),((P=N.data)==null?void 0:P.type)==="text"){r.component=h0,r.label="文本属性";return}if(((T=N.data)==null?void 0:T.type)==="base-shape"){r.component=h0,r.label="基础图形属性";return}if((N==null?void 0:N.shape)==="edge"){r.component=p0,r.label="连线属性";return}if((N==null?void 0:N.shape)==="image"){r.component=Aj,r.label="图片属性";return}r.component=null,r.label=null}),s.value.on("render:done",()=>{Fr("#drawing-board",!1),g()})},c=l.ref(),u=()=>{c.value=new yi({target:s.value,...aD,groups:[{name:"基础组件",graphPadding:30}],search(N,P){var T;return((T=N.label)==null?void 0:T.indexOf(P))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:N=>{const P=N.clone({keepId:!0});return P.label!=="文本"&&(P.label=""),P}});const L=s.value.createNode({...lD}),B=m0.map(N=>(N.ports=y0,s.value.createNode(N)));c.value.load([L,...B],"基础组件"),Qs("/custom/groupList").then(N=>{const P=(N==null?void 0:N.data)||[];P==null||P.forEach(T=>{c.value.addGroup({name:T==null?void 0:T.groupName,graphPadding:30});const j=T==null?void 0:T.pictureList.map(Y=>{const te={shape:"image",imageUrl:xe.isSunOs?Y==null?void 0:Y.imageUrl:_d(Y==null?void 0:Y.imageUrl),ports:y0,width:64,height:64,label:Y.imageName};return s.value.createNode(te)});c.value.load(j,T==null?void 0:T.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{const N=c.value.container,P=N.querySelectorAll(".x6-node"),T=m0.length;N.addEventListener("mouseenter",j,!0),N.addEventListener("mouseleave",Y,!0),P.forEach((te,z)=>{const I=z>T,U=te.querySelector("text");I&&U&&(Object.assign(U.style,{display:"none",fontSize:"12px",fill:"#ffffff"}),U.setAttribute("x","0%"),U.setAttribute("y","40"),te.style.position="relative",te.style.cursor="pointer")});function j(te){const z=te.target.closest(".x6-node");if(z){const I=Array.from(P).indexOf(z),U=z.querySelector("text");I>T&&U&&(U.style.display="block")}}function Y(te){const z=te.target.closest(".x6-node");if(z){const I=Array.from(P).indexOf(z),U=z.querySelector("text");I>T&&U&&(U.style.display="none")}}return()=>{N.removeEventListener("mouseenter",j,!0),N.removeEventListener("mouseleave",Y,!0)}},200)})},d=L=>{switch(L){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),qe.warning("关闭对齐线")):(s.value.enableSnapline(),qe.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),qe.warning("关闭框选")):(s.value.enableSelection(),qe.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":S();break}},f=l.ref(!1),h=l.ref(null),p=()=>{f.value=!0;const L=new Date;s.value.startBatch(L),s.value.disablePanning(),s.value.once("blank:mousedown",({e:B,x:N,y:P})=>{f.value&&(h.value=s.value.addEdge({source:{x:N,y:P},target:{x:N,y:P},...tt,data:{type:u0(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:B,x:N,y:P})=>{f.value&&h.value.setTarget({x:N,y:P})}),s.value.on("blank:mouseup",({e:B,x:N,y:P})=>{f.value=!1,s.value.enablePanning(),s.value.stopBatch(L)})},g=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=l.reactive({show:!1}),y=()=>{m.show=!0},b=l.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(qa),s.value.drawGrid(Xa),qe.success("清空成功")},S=()=>{const L=X().format("YYYYMMDDHHmmss");s.value.exportPNG(L,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},v=e,E=l.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},O=()=>{E.show=!1},A=()=>{v("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},k=async()=>{if(!t.id){s.value.drawBackground(qa),s.value.drawGrid(Xa),s.value.fromJSON({cells:[]});return}const L=await Ym(t.id);s.value.drawBackground((L==null?void 0:L.background)||qa),s.value.drawGrid((L==null?void 0:L.grid)||Xa),s.value.fromJSON((L==null?void 0:L.data)||{cells:[]})},_=l.shallowRef(null),V=()=>{new ResizeObserver(()=>{g()}).observe(_.value)};return l.onMounted(()=>{a(),u(),k(),V()}),(L,B)=>{const N=l.resolveComponent("el-icon"),P=l.resolveComponent("el-button"),T=l.resolveComponent("el-dropdown-item"),j=l.resolveComponent("el-dropdown-menu"),Y=l.resolveComponent("el-dropdown"),te=l.resolveComponent("el-scrollbar"),z=l.resolveComponent("el-dialog"),I=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",Fj,[l.createElementVNode("div",Uj,[l.createElementVNode("div",Hj,[l.createVNode(Y,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(T,{command:"snapLine"},{default:l.withCtx(()=>B[4]||(B[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(T,{command:"select"},{default:l.withCtx(()=>B[5]||(B[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(T,{command:"drawLine"},{default:l.withCtx(()=>B[6]||(B[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(T,{command:"adaptive"},{default:l.withCtx(()=>B[7]||(B[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(T,{command:"shortcuts"},{default:l.withCtx(()=>B[8]||(B[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(T,{command:"image"},{default:l.withCtx(()=>B[9]||(B[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(T,{command:"clear"},{default:l.withCtx(()=>B[10]||(B[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(T,{command:"export"},{default:l.withCtx(()=>B[11]||(B[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",Gj,[l.createVNode(P,{size:"small",text:""},{default:l.withCtx(()=>[B[3]||(B[3]=l.createTextVNode("工具 ")),l.createVNode(N,null,{default:l.withCtx(()=>[l.createVNode(l.unref(fD))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",Wj,[l.createVNode(l.unref(Kg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(P,{size:"small",icon:l.unref(xD),onClick:C},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Kg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(P,{size:"small",icon:l.unref(mD),onClick:A},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",Yj,[B[12]||(B[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",qj,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:_},null,512)]),l.createElementVNode("div",Xj,[r.label?(l.openBlock(),l.createElementBlock("div",Jj,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(te,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value,itemId:t.itemId},null,8,["graph","payload","itemId"]))]),_:1})])]),l.createVNode(z,{modelValue:m.show,"onUpdate:modelValue":B[0]||(B[0]=U=>m.show=U),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(vj)]),_:1},8,["modelValue"]),l.createVNode(z,{modelValue:b.show,"onUpdate:modelValue":B[1]||(B[1]=U=>b.show=U),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[b.show?(l.openBlock(),l.createBlock(zj,{key:0})):l.createCommentVNode("",!0)]),_:1},8,["modelValue"]),l.createVNode(I,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":B[2]||(B[2]=U=>E.show=U),onClose:O,title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",Kj,[E.show?(l.openBlock(),l.createBlock(Td,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-5dc3c2c6"]]),Zj=[b0,Td],w0=n=>{Zj.forEach(e=>{n.component(e.name,e)})};typeof window<"u"&&window.Vue&&w0(window.Vue),xe.isSunOs=!1;const Qj=n=>{xe.isSunOs=n},e$={install:w0};xe.WiringDiagramEditor=b0,xe.WiringDiagramPreview=Td,xe.default=e$,xe.setBaseURL=sD,xe.setIsSunOs=Qj,xe.setToken=rD,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});