251 lines
1.9 MiB
251 lines
1.9 MiB
var h$=Object.defineProperty;var v$=(t,e,n)=>e in t?h$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var hl=(t,e,n)=>v$(t,typeof e!="symbol"?e+"":e,n);import{dr as km,eP as ed,dn as zo,eQ as BN,db as tg,eR as z_,eS as lp,eT as ng,eU as Qy,eV as Ku,ef as qd,dc as qa,eW as g$,dd as Kd,ea as gj,eX as m$,eY as H_,eZ as Qu,e6 as S1,e8 as k2,dk as rg,au as Zd,e_ as og,e$ as ig,eg as Km,f0 as P2,di as Yo,f1 as A1,dM as M1,ee as sp,dS as Ri,f2 as Pm,dj as kh,f3 as Zm,f4 as X_,dR as Jd,dh as Es,df as _i,f5 as y$,f6 as mj,eE as ec,ed as Ll,f7 as _$,f8 as b$,f9 as Jm,fa as T1,fb as yj,dL as ag,fc as _j,bL as tc,dg as Y_,at as Ph,dQ as w_,dO as Hv,e9 as w$,ec as $N,eb as E$,as as bj,fd as wj,fe as x$,dm as C1,de as O$,ei as uw,ff as S$,fg as Ej,fh as xj,fi as A$,fj as Oj,fk as M$,dp as T$,fl as C$,fm as N$,fn as k$,fo as cw,fp as P$,el as R$,fq as Sj,dN as Aj,eh as R2,fr as Mj,fs as D2,ft as D$,dl as q_,fu as Tj,fv as j$,fw as Cj,fx as Nj,fy as L$,fz as I$,fA as F$,em as E_,eC as B$,fB as $$,fC as U$,aw as V$,fD as W$,fE as G$,fF as j2,fG as z$,fH as kj,fI as H$,fJ as X$,ai as Y$,eF as to,fK as q$,ax as dw,fL as uA,fM as K$,fN as Z$,fO as ws,fP as J$,fQ as Q$,av as Xv,fR as e9,eG as Yv,fS as t9,eD as Vv,fT as Pj,fU as n9,fV as r9,fW as o9,ay as gr,aB as Ge,aV as K_,aD as te,aE as Te,aW as cn,aX as Ir,aH as k,aI as ee,aY as No,aF as bt,aG as j,b2 as Wn,c$ as cA,bX as yh,dw as UN,aJ as _e,bY as L2,aK as ft,b1 as In,aS as mn,cf as fp,fX as gl,aQ as ja,aA as Rj,aO as fr,aP as Dj,b6 as yo,b8 as Ql,bc as jj,ch as Oh,cq as fw,fY as pw,bW as u0,aT as oi,aN as nc,aZ as Me,b7 as Rm,ce as Gs,cF as Lj,cj as x_,c1 as Xi,aC as Pt,c0 as I2,aM as kr,fZ as O_,ci as bs,d5 as Z_,bB as Dm,aU as Rh,f_ as i9,f$ as a9,g0 as Ij,g1 as Fj,g2 as l9,g3 as s9,g4 as u9,g5 as c9,g6 as d9,g7 as Go,du as F2,dv as f9,cu as dA,bD as up,dJ as p9,b3 as Sh,g8 as yu,cJ as h9,g9 as VN,ga as Lv,gb as v9,gc as B2,gd as $2,ge as g9,gf as m9,b4 as U2,bZ as fA,az as y9,er as WN,cY as _9,bG as Qf,bH as Vs,bI as Bc,bK as Yl,bJ as ch}from"./admin-Bt7XKYkd.js";import{t as GN,a as zN,g as b9,i as Qd,n as w9,c as V2,l as c0,d as E9}from"./data-Gh_yWxYC.js";import{_ as pp}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-DBg0al-H.js";import{G as W2,d as x9,e as O9,f as S9,_ as Bj,c as $j,b as A9,a as M9}from"./ToolDialog.vue_vue_type_style_index_0_lang-Bz-q5VO6.js";import{d as Uj,c as lg,v as J_,e as T9,g as Vj,f as C9,a as ri,r as Wj}from"./reduce-BDzbQi8C.js";import{c as N9,a as k9,b as P9,e as Gj,f as Ah,m as R9,d as D9,h as hw}from"./min-DHG3ECLG.js";import{c as G2,b as N1,i as z2,p as zj,n as H2,a as j9,d as X2,e as L9,f as I9,g as F9,h as B9,u as $9,j as U9,k as V9,l as Hj,m as W9,r as G9,o as z9,q as H9,s as X9,t as Xo}from"./uniqBy-BGukZP_i.js";import{d as Xj,e as Y9,g as q9,h as K9,i as Z9,z as J9,s as Q9,m as e7,a as t7,b as n7,f as r7,c as o7,r as i7,u as a7}from"./zipObject-CL6jmQn8.js";import{l as Yj,_ as qj}from"./vue-draggable-plus-CPHJ-lGv.js";import{_ as l7}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-B1P5HULT.js";import{_ as Bn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const Kj=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Kge}},Symbol.toStringTag,{value:"Module"}));var s7=NaN;function HN(t){return typeof t=="number"?t:km(t)?s7:+t}function k1(t,e){return function(n,o){var r;if(n===void 0&&o===void 0)return e;if(n!==void 0&&(r=n),o!==void 0){if(r===void 0)return o;typeof n=="string"||typeof o=="string"?(n=ed(n),o=ed(o)):(n=HN(n),o=HN(o)),r=t(n,o)}return r}}var u7=k1(function(t,e){return t+e},0),c7="Expected a function";function d7(t,e){if(typeof e!="function")throw new TypeError(c7);return t=zo(t),function(){if(--t<1)return e.apply(this,arguments)}}var vw=BN&&new BN,Zj=vw?function(t,e){return vw.set(t,e),t}:tg;function S_(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=z_(t.prototype),o=t.apply(n,e);return lp(o)?o:n}}var f7=1;function p7(t,e,n){var o=e&f7,r=S_(t);function i(){var a=this&&this!==ng&&this instanceof i?r:t;return a.apply(o?n:this,arguments)}return i}var h7=Math.max;function Jj(t,e,n,o){for(var r=-1,i=t.length,a=n.length,s=-1,l=e.length,f=h7(i-a,0),h=Array(l+f),v=!o;++s<l;)h[s]=e[s];for(;++r<a;)(v||r<i)&&(h[n[r]]=t[r]);for(;f--;)h[s++]=t[r++];return h}var v7=Math.max;function Qj(t,e,n,o){for(var r=-1,i=t.length,a=-1,s=n.length,l=-1,f=e.length,h=v7(i-s,0),v=Array(h+f),_=!o;++r<h;)v[r]=t[r];for(var E=r;++l<f;)v[E+l]=e[l];for(;++a<s;)(_||r<i)&&(v[E+n[a]]=t[r++]);return v}function g7(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}function P1(){}var m7=4294967295;function $o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m7,this.__views__=[]}$o.prototype=z_(P1.prototype);$o.prototype.constructor=$o;var Y2=vw?function(t){return vw.get(t)}:Qy,Om={},y7=Object.prototype,_7=y7.hasOwnProperty;function H0(t){for(var e=t.name+"",n=Om[e],o=_7.call(Om,e)?n.length:0;o--;){var r=n[o],i=r.func;if(i==null||i==t)return r.name}return e}function rc(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}rc.prototype=z_(P1.prototype);rc.prototype.constructor=rc;function eL(t){if(t instanceof $o)return t.clone();var e=new rc(t.__wrapped__,t.__chain__);return e.__actions__=Ku(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var b7=Object.prototype,w7=b7.hasOwnProperty;function me(t){if(qd(t)&&!qa(t)&&!(t instanceof $o)){if(t instanceof rc)return t;if(w7.call(t,"__wrapped__"))return eL(t)}return new rc(t)}me.prototype=P1.prototype;me.prototype.constructor=me;function pA(t){var e=H0(t),n=me[e];if(typeof n!="function"||!(e in $o.prototype))return!1;if(t===n)return!0;var o=Y2(n);return!!o&&t===o[0]}var tL=g$(Zj),E7=/\{\n\/\* \[wrapped with (.+)\] \*/,x7=/,? & /;function O7(t){var e=t.match(E7);return e?e[1].split(x7):[]}var S7=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function A7(t,e){var n=e.length;if(!n)return t;var o=n-1;return e[o]=(n>1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(S7,`{
|
||
/* [wrapped with `+e+`] */
|
||
`)}var M7=1,T7=2,C7=8,N7=16,k7=32,P7=64,R7=128,D7=256,j7=512,L7=[["ary",R7],["bind",M7],["bindKey",T7],["curry",C7],["curryRight",N7],["flip",j7],["partial",k7],["partialRight",P7],["rearg",D7]];function I7(t,e){return Kd(L7,function(n){var o="_."+n[0];e&n[1]&&!gj(t,o)&&t.push(o)}),t.sort()}function nL(t,e,n){var o=e+"";return m$(t,A7(o,I7(O7(o),n)))}var F7=4,B7=8,XN=32,YN=64;function rL(t,e,n,o,r,i,a,s,l,f){var h=e&B7,v=h?a:void 0,_=h?void 0:a,E=h?i:void 0,O=h?void 0:i;e|=h?XN:YN,e&=~(h?YN:XN),e&F7||(e&=-4);var w=[t,e,r,E,v,O,_,s,l,f],S=n.apply(void 0,w);return pA(t)&&tL(S,w),S.placeholder=o,nL(S,t,e)}function Qm(t){var e=t;return e.placeholder}var $7=Math.min;function U7(t,e){for(var n=t.length,o=$7(e.length,n),r=Ku(t);o--;){var i=e[o];t[o]=H_(i,n)?r[i]:void 0}return t}var qN="__lodash_placeholder__";function Mh(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n];(a===e||a===qN)&&(t[n]=qN,i[r++]=n)}return i}var V7=1,W7=2,G7=8,z7=16,H7=128,X7=512;function R1(t,e,n,o,r,i,a,s,l,f){var h=e&H7,v=e&V7,_=e&W7,E=e&(G7|z7),O=e&X7,w=_?void 0:S_(t);function S(){for(var M=arguments.length,T=Array(M),B=M;B--;)T[B]=arguments[B];if(E)var R=Qm(S),P=g7(T,R);if(o&&(T=Jj(T,o,r,E)),i&&(T=Qj(T,i,a,E)),M-=P,E&&M<f){var $=Mh(T,R);return rL(t,e,R1,S.placeholder,n,T,$,s,l,f-M)}var I=v?n:this,F=_?I[t]:t;return M=T.length,s?T=U7(T,s):O&&M>1&&T.reverse(),h&&l<M&&(T.length=l),this&&this!==ng&&this instanceof S&&(F=w||S_(F)),F.apply(I,T)}return S}function Y7(t,e,n){var o=S_(t);function r(){for(var i=arguments.length,a=Array(i),s=i,l=Qm(r);s--;)a[s]=arguments[s];var f=i<3&&a[0]!==l&&a[i-1]!==l?[]:Mh(a,l);if(i-=f.length,i<n)return rL(t,e,R1,r.placeholder,void 0,a,f,void 0,void 0,n-i);var h=this&&this!==ng&&this instanceof r?o:t;return Qu(h,this,a)}return r}var q7=1;function K7(t,e,n,o){var r=e&q7,i=S_(t);function a(){for(var s=-1,l=arguments.length,f=-1,h=o.length,v=Array(h+l),_=this&&this!==ng&&this instanceof a?i:t;++f<h;)v[f]=o[f];for(;l--;)v[f++]=arguments[++s];return Qu(_,r?n:this,v)}return a}var KN="__lodash_placeholder__",YO=1,Z7=2,J7=4,ZN=8,jy=128,JN=256,Q7=Math.min;function eU(t,e){var n=t[1],o=e[1],r=n|o,i=r<(YO|Z7|jy),a=o==jy&&n==ZN||o==jy&&n==JN&&t[7].length<=e[8]||o==(jy|JN)&&e[7].length<=e[8]&&n==ZN;if(!(i||a))return t;o&YO&&(t[2]=e[2],r|=n&YO?0:J7);var s=e[3];if(s){var l=t[3];t[3]=l?Jj(l,s,e[4]):s,t[4]=l?Mh(t[3],KN):e[4]}return s=e[5],s&&(l=t[5],t[5]=l?Qj(l,s,e[6]):s,t[6]=l?Mh(t[5],KN):e[6]),s=e[7],s&&(t[7]=s),o&jy&&(t[8]=t[8]==null?e[8]:Q7(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=r,t}var tU="Expected a function",QN=1,nU=2,ek=8,tk=16,nk=32,rU=64,rk=Math.max;function hp(t,e,n,o,r,i,a,s){var l=e&nU;if(!l&&typeof t!="function")throw new TypeError(tU);var f=o?o.length:0;if(f||(e&=-97,o=r=void 0),a=a===void 0?a:rk(zo(a),0),s=s===void 0?s:zo(s),f-=r?r.length:0,e&rU){var h=o,v=r;o=r=void 0}var _=l?void 0:Y2(t),E=[t,e,n,o,r,h,v,i,a,s];if(_&&eU(E,_),t=E[0],e=E[1],n=E[2],o=E[3],r=E[4],s=E[9]=E[9]===void 0?l?0:t.length:rk(E[9]-f,0),!s&&e&(ek|tk)&&(e&=-25),!e||e==QN)var O=p7(t,e,n);else e==ek||e==tk?O=Y7(t,e,s):(e==nk||e==(QN|nk))&&!r.length?O=K7(t,e,n,o):O=R1.apply(void 0,E);var w=_?Zj:tL;return nL(w(O,E),t,e)}var oU=128;function oL(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,hp(t,oU,void 0,void 0,void 0,void 0,e)}var iU=S1(function(t,e){k2(e,rg(e),t)}),hA=S1(function(t,e,n,o){k2(e,rg(e),t,o)}),aU=S1(function(t,e,n,o){k2(e,Zd(e),t,o)});function q2(t,e){for(var n=-1,o=e.length,r=Array(o),i=t==null;++n<o;)r[n]=i?void 0:og(t,e[n]);return r}var lU=ig(q2),sU="[object DOMException]",uU="[object Error]";function K2(t){if(!qd(t))return!1;var e=Km(t);return e==uU||e==sU||typeof t.message=="string"&&typeof t.name=="string"&&!P2(t)}var iL=Yo(function(t,e){try{return Qu(t,void 0,e)}catch(n){return K2(n)?n:new Error(n)}}),cU="Expected a function";function aL(t,e){var n;if(typeof e!="function")throw new TypeError(cU);return t=zo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var dU=1,fU=32,D1=Yo(function(t,e,n){var o=dU;if(n.length){var r=Mh(n,Qm(D1));o|=fU}return hp(t,o,e,n,r)});D1.placeholder={};var pU=ig(function(t,e){return Kd(e,function(n){n=A1(n),M1(t,n,D1(t[n],t))}),t}),hU=1,vU=2,gU=32,Z2=Yo(function(t,e,n){var o=hU|vU;if(n.length){var r=Mh(n,Qm(Z2));o|=gU}return hp(e,o,t,n,r)});Z2.placeholder={};function Dh(t,e,n){var o=t.length;return n=n===void 0?o:n,!e&&n>=o?t:sp(t,e,n)}var mU="\\ud800-\\udfff",yU="\\u0300-\\u036f",_U="\\ufe20-\\ufe2f",bU="\\u20d0-\\u20ff",wU=yU+_U+bU,EU="\\ufe0e\\ufe0f",xU="\\u200d",OU=RegExp("["+xU+mU+wU+EU+"]");function ey(t){return OU.test(t)}function SU(t){return t.split("")}var lL="\\ud800-\\udfff",AU="\\u0300-\\u036f",MU="\\ufe20-\\ufe2f",TU="\\u20d0-\\u20ff",CU=AU+MU+TU,NU="\\ufe0e\\ufe0f",kU="["+lL+"]",vA="["+CU+"]",gA="\\ud83c[\\udffb-\\udfff]",PU="(?:"+vA+"|"+gA+")",sL="[^"+lL+"]",uL="(?:\\ud83c[\\udde6-\\uddff]){2}",cL="[\\ud800-\\udbff][\\udc00-\\udfff]",RU="\\u200d",dL=PU+"?",fL="["+NU+"]?",DU="(?:"+RU+"(?:"+[sL,uL,cL].join("|")+")"+fL+dL+")*",jU=fL+dL+DU,LU="(?:"+[sL+vA+"?",vA,uL,cL,kU].join("|")+")",IU=RegExp(gA+"(?="+gA+")|"+LU+jU,"g");function FU(t){return t.match(IU)||[]}function td(t){return ey(t)?FU(t):SU(t)}function pL(t){return function(e){e=Ri(e);var n=ey(e)?td(e):void 0,o=n?n[0]:e.charAt(0),r=n?Dh(n,1).join(""):e.slice(1);return o[t]()+r}}var J2=pL("toUpperCase");function hL(t){return J2(Ri(t).toLowerCase())}function Q2(t){return function(e){return t==null?void 0:t[e]}}var BU={À:"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"},$U=Q2(BU),UU=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,VU="\\u0300-\\u036f",WU="\\ufe20-\\ufe2f",GU="\\u20d0-\\u20ff",zU=VU+WU+GU,HU="["+zU+"]",XU=RegExp(HU,"g");function vL(t){return t=Ri(t),t&&t.replace(UU,$U).replace(XU,"")}var YU=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function qU(t){return t.match(YU)||[]}var KU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZU(t){return KU.test(t)}var gL="\\ud800-\\udfff",JU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",eV="\\u20d0-\\u20ff",tV=JU+QU+eV,mL="\\u2700-\\u27bf",yL="a-z\\xdf-\\xf6\\xf8-\\xff",nV="\\xac\\xb1\\xd7\\xf7",rV="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",oV="\\u2000-\\u206f",iV=" \\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",_L="A-Z\\xc0-\\xd6\\xd8-\\xde",aV="\\ufe0e\\ufe0f",bL=nV+rV+oV+iV,wL="['’]",ok="["+bL+"]",lV="["+tV+"]",EL="\\d+",sV="["+mL+"]",xL="["+yL+"]",OL="[^"+gL+bL+EL+mL+yL+_L+"]",uV="\\ud83c[\\udffb-\\udfff]",cV="(?:"+lV+"|"+uV+")",dV="[^"+gL+"]",SL="(?:\\ud83c[\\udde6-\\uddff]){2}",AL="[\\ud800-\\udbff][\\udc00-\\udfff]",fm="["+_L+"]",fV="\\u200d",ik="(?:"+xL+"|"+OL+")",pV="(?:"+fm+"|"+OL+")",ak="(?:"+wL+"(?:d|ll|m|re|s|t|ve))?",lk="(?:"+wL+"(?:D|LL|M|RE|S|T|VE))?",ML=cV+"?",TL="["+aV+"]?",hV="(?:"+fV+"(?:"+[dV,SL,AL].join("|")+")"+TL+ML+")*",vV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mV=TL+ML+hV,yV="(?:"+[sV,SL,AL].join("|")+")"+mV,_V=RegExp([fm+"?"+xL+"+"+ak+"(?="+[ok,fm,"$"].join("|")+")",pV+"+"+lk+"(?="+[ok,fm+ik,"$"].join("|")+")",fm+"?"+ik+"+"+ak,fm+"+"+lk,gV,vV,EL,yV].join("|"),"g");function bV(t){return t.match(_V)||[]}function CL(t,e,n){return t=Ri(t),e=n?void 0:e,e===void 0?ZU(t)?bV(t):qU(t):t.match(e)||[]}var wV="['’]",EV=RegExp(wV,"g");function ty(t){return function(e){return Uj(CL(vL(e).replace(EV,"")),t,"")}}var xV=ty(function(t,e,n){return e=e.toLowerCase(),t+(n?hL(e):e)}),OV=ng.isFinite,SV=Math.min;function eM(t){var e=Math[t];return function(n,o){if(n=Pm(n),o=o==null?0:SV(zo(o),292),o&&OV(n)){var r=(Ri(n)+"e").split("e"),i=e(r[0]+"e"+(+r[1]+o));return r=(Ri(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-o))}return e(n)}}var AV=eM("ceil");function NL(t){var e=me(t);return e.__chain__=!0,e}var MV=Math.ceil,TV=Math.max;function CV(t,e,n){(n?kh(t,e,n):e===void 0)?e=1:e=TV(zo(e),0);var o=t==null?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,a=Array(MV(o/e));r<o;)a[i++]=sp(t,r,r+=e);return a}var NV=1,kV=4;function PV(t,e){return e=typeof e=="function"?e:void 0,Zm(t,NV|kV,e)}var RV=4;function DV(t,e){return e=typeof e=="function"?e:void 0,Zm(t,RV,e)}function jV(){return new rc(this.value(),this.__chain__)}function LV(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return X_(qa(n)?Ku(n):[n],Jd(e,1))}var IV="Expected a function";function FV(t){var e=t==null?0:t.length,n=_i;return t=e?Es(t,function(o){if(typeof o[1]!="function")throw new TypeError(IV);return[n(o[0]),o[1]]}):[],Yo(function(o){for(var r=-1;++r<e;){var i=t[r];if(Qu(i[0],this,o))return Qu(i[1],this,o)}})}function kL(t,e,n){var o=n.length;if(t==null)return!o;for(t=Object(t);o--;){var r=n[o],i=e[r],a=t[r];if(a===void 0&&!(r in t)||!i(a))return!1}return!0}function BV(t){var e=Zd(t);return function(n){return kL(n,t,e)}}var $V=1;function UV(t){return BV(Zm(t,$V))}function VV(t,e){return e==null||kL(t,e,Zd(e))}var WV=Object.prototype,GV=WV.hasOwnProperty,zV=G2(function(t,e,n){GV.call(t,n)?++t[n]:M1(t,n,1)});function HV(t,e){var n=z_(t);return e==null?n:y$(n,e)}var XV=8;function tM(t,e,n){e=n?void 0:e;var o=hp(t,XV,void 0,void 0,void 0,void 0,void 0,e);return o.placeholder=tM.placeholder,o}tM.placeholder={};var YV=16;function nM(t,e,n){e=n?void 0:e;var o=hp(t,YV,void 0,void 0,void 0,void 0,void 0,e);return o.placeholder=nM.placeholder,o}nM.placeholder={};function qV(t,e){return t==null||t!==t?e:t}function PL(t,e,n,o,r,i){return lp(t)&&lp(e)&&(i.set(e,t),mj(t,e,void 0,PL,i),i.delete(e)),t}var RL=S1(function(t,e,n,o){mj(t,e,n,o)}),KV=Yo(function(t){return t.push(void 0,PL),Qu(RL,void 0,t)}),ZV="Expected a function";function DL(t,e,n){if(typeof t!="function")throw new TypeError(ZV);return setTimeout(function(){t.apply(void 0,n)},e)}var JV=Yo(function(t,e){return DL(t,1,e)}),QV=Yo(function(t,e,n){return DL(t,Pm(e)||0,n)}),eW=Yo(function(t,e){var n=ec(e);return Ll(n)&&(n=void 0),Ll(t)?N1(t,Jd(e,1,Ll,!0),_i(n)):[]}),tW=Yo(function(t,e){var n=ec(e);return Ll(n)&&(n=void 0),Ll(t)?N1(t,Jd(e,1,Ll,!0),void 0,n):[]}),nW=k1(function(t,e){return t/e},1);function j1(t,e,n,o){for(var r=t.length,i=o?r:-1;(o?i--:++i<r)&&e(t[i],i,t););return n?sp(t,o?0:i,o?i+1:r):sp(t,o?i+1:0,o?r:i)}function rW(t,e){return t&&t.length?j1(t,_i(e),!0,!0):[]}function oW(t,e){return t&&t.length?j1(t,_i(e),!0):[]}function iW(t,e){for(var n=t==null?0:t.length;n--&&e(t[n],n,t)!==!1;);return t}var jL=_$(!0);function rM(t,e){return t&&jL(t,e,Zd)}var LL=b$(rM,!0);function aW(t,e){var n=qa(t)?iW:LL;return n(t,lg(e))}function lW(t,e,n){t=Ri(t),e=ed(e);var o=t.length;n=n===void 0?o:Jm(zo(n),0,o);var r=n;return n-=e.length,n>=0&&t.slice(n,r)==e}function sW(t,e){return Es(e,function(n){return[n,t[n]]})}function uW(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=[o,o]}),n}var cW="[object Map]",dW="[object Set]";function IL(t){return function(e){var n=T1(e);return n==cW?yj(e):n==dW?uW(e):sW(e,t(e))}}var vp=IL(Zd),fW=IL(rg),pW={"&":"&","<":"<",">":">",'"':""","'":"'"},hW=Q2(pW),FL=/[&<>"']/g,vW=RegExp(FL.source);function BL(t){return t=Ri(t),t&&vW.test(t)?t.replace(FL,hW):t}var $L=/[\\^$.*+?()[\]{}|]/g,gW=RegExp($L.source);function mW(t){return t=Ri(t),t&&gW.test(t)?t.replace($L,"\\$&"):t}var yW=4294967295;function UL(t){return t?Jm(zo(t),0,yW):0}function _W(t,e,n,o){var r=t.length;for(n=zo(n),n<0&&(n=-n>r?0:r+n),o=o===void 0||o>r?r:zo(o),o<0&&(o+=r),o=n>o?0:UL(o);n<o;)t[n++]=e;return t}function bW(t,e,n,o){var r=t==null?0:t.length;return r?(n&&typeof n!="number"&&kh(t,e,n)&&(n=0,o=r),_W(t,e,n,o)):[]}function VL(t,e,n){var o;return n(t,function(r,i,a){if(e(r,i,a))return o=i,!1}),o}function wW(t,e){return VL(t,_i(e),ag)}var EW=N9(_j);function xW(t,e){return VL(t,_i(e),rM)}var OW=1/0;function SW(t,e){return Jd(tc(t,e),OW)}function AW(t,e,n){return n=n===void 0?1:zo(n),Jd(tc(t,e),n)}function MW(t,e){var n=t==null?0:t.length;return n?(e=e===void 0?1:zo(e),Jd(t,e)):[]}var TW=512;function CW(t){return hp(t,TW)}var NW=eM("floor"),kW="Expected a function",PW=8,RW=32,DW=128,jW=256;function WL(t){return ig(function(e){var n=e.length,o=n,r=rc.prototype.thru;for(t&&e.reverse();o--;){var i=e[o];if(typeof i!="function")throw new TypeError(kW);if(r&&!a&&H0(i)=="wrapper")var a=new rc([],!0)}for(o=a?o:n;++o<n;){i=e[o];var s=H0(i),l=s=="wrapper"?Y2(i):void 0;l&&pA(l[0])&&l[1]==(DW|PW|RW|jW)&&!l[4].length&&l[9]==1?a=a[H0(l[0])].apply(a,l[3]):a=i.length==1&&pA(i)?a[s]():a.thru(i)}return function(){var f=arguments,h=f[0];if(a&&f.length==1&&qa(h))return a.plant(h).value();for(var v=0,_=n?e[v].apply(this,f):h;++v<n;)_=e[v].call(this,_);return _}})}var LW=WL(),IW=WL(!0);function FW(t,e){return t==null?t:jL(t,lg(e),rg)}function BW(t,e){return t&&rM(t,lg(e))}function L1(t,e){return Y_(e,function(n){return Ph(t[n])})}function $W(t){return t==null?[]:L1(t,Zd(t))}function UW(t){return t==null?[]:L1(t,rg(t))}function I1(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Pm(e),n=Pm(n)),t(e,n)}}var VW=I1(Xj),WW=I1(function(t,e){return t>=e}),GW=Math.max,zW=Math.min;function HW(t,e,n){return t>=zW(e,n)&&t<GW(e,n)}function XW(t,e,n){return e=w_(e),n===void 0?(n=e,e=0):n=w_(n),t=Pm(t),HW(t,e,n)}function YW(t){var e=t==null?0:t.length;return e?sp(t,0,-1):[]}var qW=Math.min;function oM(t,e,n){for(var o=n?E$:gj,r=t[0].length,i=t.length,a=i,s=Array(i),l=1/0,f=[];a--;){var h=t[a];a&&e&&(h=Es(h,Hv(e))),l=qW(h.length,l),s[a]=!n&&(e||r>=120&&h.length>=120)?new w$(a&&h):void 0}h=t[0];var v=-1,_=s[0];e:for(;++v<r&&f.length<l;){var E=h[v],O=e?e(E):E;if(E=n||E!==0?E:0,!(_?$N(_,O):o(f,O,n))){for(a=i;--a;){var w=s[a];if(!(w?$N(w,O):o(t[a],O,n)))continue e}_&&_.push(O),f.push(E)}}return f}function iM(t){return Ll(t)?t:[]}var KW=Yo(function(t){var e=Es(t,iM);return e.length&&e[0]===t[0]?oM(e):[]}),ZW=Yo(function(t){var e=ec(t),n=Es(t,iM);return e===ec(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?oM(n,_i(e)):[]}),JW=Yo(function(t){var e=ec(t),n=Es(t,iM);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?oM(n,void 0,e):[]});function QW(t,e,n,o){return ag(t,function(r,i,a){e(o,n(r),i,a)}),o}function GL(t,e){return function(n,o){return QW(n,t,e(o),{})}}var eG=Object.prototype,tG=eG.toString,nG=GL(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=tG.call(e)),t[e]=n},bj(tg)),zL=Object.prototype,rG=zL.hasOwnProperty,oG=zL.toString,iG=GL(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=oG.call(e)),rG.call(t,e)?t[e].push(n):t[e]=[n]},_i);function Q_(t,e,n){e=wj(e,t),t=x$(t,e);var o=t==null?t:t[A1(ec(e))];return o==null?void 0:Qu(o,t,n)}var aG=Yo(Q_),lG=Yo(function(t,e,n){var o=-1,r=typeof e=="function",i=C1(t)?Array(t.length):[];return O$(t,function(a){i[++o]=r?Qu(e,a,n):Q_(a,e,n)}),i}),sG="[object ArrayBuffer]";function uG(t){return qd(t)&&Km(t)==sG}var sk=uw&&uw.isArrayBuffer,cG=sk?Hv(sk):uG,dG="[object Boolean]";function gw(t){return t===!0||t===!1||qd(t)&&Km(t)==dG}var fG="[object Date]";function pG(t){return qd(t)&&Km(t)==fG}var uk=uw&&uw.isDate,hG=uk?Hv(uk):pG;function vG(t){return qd(t)&&t.nodeType===1&&!P2(t)}function gG(t,e,n){n=typeof n=="function"?n:void 0;var o=n?n(t,e):void 0;return o===void 0?S$(t,e,void 0,n):!!o}var mG=ng.isFinite;function yG(t){return typeof t=="number"&&mG(t)}function HL(t){return typeof t=="number"&&t==zo(t)}function _G(t,e){return t===e||Ej(t,e,xj(e))}function bG(t,e,n){return n=typeof n=="function"?n:void 0,Ej(t,e,xj(e),n)}var wG="[object Number]";function XL(t){return typeof t=="number"||qd(t)&&Km(t)==wG}function EG(t){return XL(t)&&t!=+t}var xG=A$?Ph:Oj,OG="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function SG(t){if(xG(t))throw new Error(OG);return M$(t)}var ck=9007199254740991;function AG(t){return HL(t)&&t>=-ck&&t<=ck}var MG="[object WeakMap]";function TG(t){return qd(t)&&T1(t)==MG}var CG="[object WeakSet]";function NG(t){return qd(t)&&Km(t)==CG}var kG=1;function PG(t){return _i(typeof t=="function"?t:Zm(t,kG))}var RG=Array.prototype,DG=RG.join;function jG(t,e){return t==null?"":DG.call(t,e)}var LG=ty(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),IG=G2(function(t,e,n){M1(t,n,e)});function FG(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}var BG=Math.max,$G=Math.min;function UG(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=o;return n!==void 0&&(r=zo(n),r=r<0?BG(o+r,0):$G(r,o-1)),e===e?FG(t,e,r):T$(t,C$,r,!0)}var VG=ty(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),WG=pL("toLowerCase"),GG=I1(k9),zG=I1(function(t,e){return t<=e});function YL(t,e){var n={};return e=_i(e),ag(t,function(o,r,i){M1(n,e(o,r,i),o)}),n}var HG=1;function XG(t){return N$(Zm(t,HG))}var YG=1;function qG(t,e){return k$(t,Zm(e,YG))}function KG(t,e){return t&&t.length?P9(t,_i(e),Xj):void 0}function aM(t,e){for(var n,o=-1,r=t.length;++o<r;){var i=e(t[o]);i!==void 0&&(n=n===void 0?i:n+i)}return n}var ZG=NaN;function qL(t,e){var n=t==null?0:t.length;return n?aM(t,e)/n:ZG}function JG(t){return qL(t,tg)}function QG(t,e){return qL(t,_i(e))}var ez=Yo(function(t,e){return function(n){return Q_(n,t,e)}}),tz=Yo(function(t,e){return function(n){return Q_(t,n,e)}});function nz(t,e,n){var o=Zd(e),r=L1(e,o),i=!(lp(n)&&"chain"in n)||!!n.chain,a=Ph(t);return Kd(r,function(s){var l=e[s];t[s]=l,a&&(t.prototype[s]=function(){var f=this.__chain__;if(i||f){var h=t(this.__wrapped__),v=h.__actions__=Ku(this.__actions__);return v.push({func:l,args:arguments,thisArg:t}),h.__chain__=f,h}return l.apply(t,X_([this.value()],arguments))})}),t}var rz=k1(function(t,e){return t*e},1);function oz(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var iz="[object Map]",az="[object Set]",qO=cw?cw.iterator:void 0;function KL(t){if(!t)return[];if(C1(t))return z2(t)?td(t):Ku(t);if(qO&&t[qO])return oz(t[qO]());var e=T1(t),n=e==iz?yj:e==az?P$:J_;return n(t)}function lz(){this.__values__===void 0&&(this.__values__=KL(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function ZL(t,e){var n=t.length;if(n)return e+=e<0?n:0,H_(e,n)?t[e]:void 0}function sz(t,e){return t&&t.length?ZL(t,zo(e)):void 0}function uz(t){return t=zo(t),Yo(function(e){return ZL(e,t)})}function cz(t,e){return zj(t,H2(_i(e)))}function dz(t){return aL(2,t)}function fz(t,e,n,o){return t==null?[]:(qa(e)||(e=e==null?[]:[e]),n=o?void 0:n,qa(n)||(n=n==null?[]:[n]),Y9(t,e,n))}function lM(t){return ig(function(e){return e=Es(e,Hv(_i)),Yo(function(n){var o=this;return t(e,function(r){return Qu(r,o,n)})})})}var pz=lM(Es),hz=Yo,vz=Math.min,gz=hz(function(t,e){e=e.length==1&&qa(e[0])?Es(e[0],Hv(_i)):Es(Jd(e,1),Hv(_i));var n=e.length;return Yo(function(o){for(var r=-1,i=vz(o.length,n);++r<i;)o[r]=e[r].call(this,o[r]);return Qu(t,this,o)})}),mz=lM(j9),yz=lM(R$),_z=9007199254740991,bz=Math.floor;function mA(t,e){var n="";if(!t||e<1||e>_z)return n;do e%2&&(n+=t),e=bz(e/2),e&&(t+=t);while(e);return n}var wz=Sj("length"),JL="\\ud800-\\udfff",Ez="\\u0300-\\u036f",xz="\\ufe20-\\ufe2f",Oz="\\u20d0-\\u20ff",Sz=Ez+xz+Oz,Az="\\ufe0e\\ufe0f",Mz="["+JL+"]",yA="["+Sz+"]",_A="\\ud83c[\\udffb-\\udfff]",Tz="(?:"+yA+"|"+_A+")",QL="[^"+JL+"]",e3="(?:\\ud83c[\\udde6-\\uddff]){2}",t3="[\\ud800-\\udbff][\\udc00-\\udfff]",Cz="\\u200d",n3=Tz+"?",r3="["+Az+"]?",Nz="(?:"+Cz+"(?:"+[QL,e3,t3].join("|")+")"+r3+n3+")*",kz=r3+n3+Nz,Pz="(?:"+[QL+yA+"?",yA,e3,t3,Mz].join("|")+")",dk=RegExp(_A+"(?="+_A+")|"+Pz+kz,"g");function Rz(t){for(var e=dk.lastIndex=0;dk.test(t);)++e;return e}function ny(t){return ey(t)?Rz(t):wz(t)}var Dz=Math.ceil;function mw(t,e){e=e===void 0?" ":ed(e);var n=e.length;if(n<2)return n?mA(e,t):e;var o=mA(e,Dz(t/ny(e)));return ey(e)?Dh(td(o),0,t).join(""):o.slice(0,t)}var jz=Math.ceil,Lz=Math.floor;function Iz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;if(!e||o>=e)return t;var r=(e-o)/2;return mw(Lz(r),n)+t+mw(jz(r),n)}function Fz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;return e&&o<e?t+mw(e-o,n):t}function Bz(t,e,n){t=Ri(t),e=zo(e);var o=e?ny(t):0;return e&&o<e?mw(e-o,n)+t:t}var $z=/^\s+/,Uz=ng.parseInt;function Vz(t,e,n){return n||e==null?e=0:e&&(e=+e),Uz(Ri(t).replace($z,""),e||0)}var Wz=32,F1=Yo(function(t,e){var n=Mh(e,Qm(F1));return hp(t,Wz,void 0,e,n)});F1.placeholder={};var Gz=64,sM=Yo(function(t,e){var n=Mh(e,Qm(sM));return hp(t,Gz,void 0,e,n)});sM.placeholder={};var zz=G2(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});function Hz(t){for(var e,n=this;n instanceof P1;){var o=eL(n);o.__index__=0,o.__values__=void 0,e?r.__wrapped__=o:e=o;var r=o;n=n.__wrapped__}return r.__wrapped__=t,e}function Xz(t){return function(e){return t==null?void 0:Aj(t,e)}}function Yz(t,e,n,o){for(var r=n-1,i=t.length;++r<i;)if(o(t[r],e))return r;return-1}var qz=Array.prototype,fk=qz.splice;function uM(t,e,n,o){var r=o?Yz:R2,i=-1,a=e.length,s=t;for(t===e&&(e=Ku(e)),n&&(s=Es(t,Hv(n)));++i<a;)for(var l=0,f=e[i],h=n?n(f):f;(l=r(s,h,l,o))>-1;)s!==t&&fk.call(s,l,1),fk.call(t,l,1);return t}function o3(t,e){return t&&t.length&&e&&e.length?uM(t,e):t}var Kz=Yo(o3);function Zz(t,e,n){return t&&t.length&&e&&e.length?uM(t,e,_i(n)):t}function Jz(t,e,n){return t&&t.length&&e&&e.length?uM(t,e,void 0,n):t}var Qz=Array.prototype,eH=Qz.splice;function i3(t,e){for(var n=t?e.length:0,o=n-1;n--;){var r=e[n];if(n==o||r!==i){var i=r;H_(r)?eH.call(t,r,1):Mj(t,r)}}return t}var tH=ig(function(t,e){var n=t==null?0:t.length,o=q2(t,e);return i3(t,Es(e,function(r){return H_(r,n)?+r:r}).sort(q9)),o}),nH=Math.floor,rH=Math.random;function cM(t,e){return t+nH(rH()*(e-t+1))}var oH=parseFloat,iH=Math.min,aH=Math.random;function lH(t,e,n){if(n&&typeof n!="boolean"&&kh(t,e,n)&&(e=n=void 0),n===void 0&&(typeof e=="boolean"?(n=e,e=void 0):typeof t=="boolean"&&(n=t,t=void 0)),t===void 0&&e===void 0?(t=0,e=1):(t=w_(t),e===void 0?(e=t,t=0):e=w_(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var r=aH();return iH(t+r*(e-t+oH("1e-"+((r+"").length-1))),e)}return cM(t,e)}var sH=K9(!0),uH=256,cH=ig(function(t,e){return hp(t,uH,void 0,void 0,void 0,e)});function dH(t,e,n,o){var r=t==null?0:t.length;for(o&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function fH(t,e,n){var o=qa(t)?dH:T9,r=arguments.length<3;return o(t,_i(e),n,r,LL)}function pH(t,e){var n=[];if(!(t&&t.length))return n;var o=-1,r=[],i=t.length;for(e=_i(e);++o<i;){var a=t[o];e(a,o,t)&&(n.push(a),r.push(o))}return i3(t,r),n}function hH(t,e,n){return(n?kh(t,e,n):e===void 0)?e=1:e=zo(e),mA(Ri(t),e)}function vH(){var t=arguments,e=Ri(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var gH="Expected a function";function mH(t,e){if(typeof t!="function")throw new TypeError(gH);return e=e===void 0?e:zo(e),Yo(t,e)}function yH(t,e,n){e=wj(e,t);var o=-1,r=e.length;for(r||(r=1,t=void 0);++o<r;){var i=t==null?void 0:t[A1(e[o])];i===void 0&&(o=r,i=n),t=Ph(i)?i.call(t):i}return t}var _H=Array.prototype,bH=_H.reverse;function bA(t){return t==null?t:bH.call(t)}var wH=eM("round");function a3(t){var e=t.length;return e?t[cM(0,e-1)]:void 0}function EH(t){return a3(J_(t))}function xH(t){var e=qa(t)?a3:EH;return e(t)}function B1(t,e){var n=-1,o=t.length,r=o-1;for(e=e===void 0?o:e;++n<e;){var i=cM(n,r),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function OH(t,e){return B1(Ku(t),Jm(e,0,t.length))}function SH(t,e){var n=J_(t);return B1(n,Jm(e,0,n.length))}function AH(t,e,n){(n?kh(t,e,n):e===void 0)?e=1:e=zo(e);var o=qa(t)?OH:SH;return o(t,e)}function MH(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:D2(t,e,n,o)}function TH(t){return B1(Ku(t))}function CH(t){return B1(J_(t))}function NH(t){var e=qa(t)?TH:CH;return e(t)}var kH="[object Map]",PH="[object Set]";function RH(t){if(t==null)return 0;if(C1(t))return z2(t)?ny(t):t.length;var e=T1(t);return e==kH||e==PH?t.size:D$(t).length}function DH(t,e,n){var o=t==null?0:t.length;return o?(n&&typeof n!="number"&&kh(t,e,n)?(e=0,n=o):(e=e==null?0:zo(e),n=n===void 0?o:zo(n)),sp(t,e,n)):[]}var jH=ty(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),LH=4294967295,IH=LH-1,FH=Math.floor,BH=Math.min;function dM(t,e,n,o){var r=0,i=t==null?0:t.length;if(i===0)return 0;e=n(e);for(var a=e!==e,s=e===null,l=km(e),f=e===void 0;r<i;){var h=FH((r+i)/2),v=n(t[h]),_=v!==void 0,E=v===null,O=v===v,w=km(v);if(a)var S=o||O;else f?S=O&&(o||_):s?S=O&&_&&(o||!E):l?S=O&&_&&!E&&(o||!w):E||w?S=!1:S=o?v<=e:v<e;S?r=h+1:i=h}return BH(i,IH)}var $H=4294967295,UH=$H>>>1;function $1(t,e,n){var o=0,r=t==null?o:t.length;if(typeof e=="number"&&e===e&&r<=UH){for(;o<r;){var i=o+r>>>1,a=t[i];a!==null&&!km(a)&&(n?a<=e:a<e)?o=i+1:r=i}return r}return dM(t,e,tg,n)}function VH(t,e){return $1(t,e)}function WH(t,e,n){return dM(t,e,_i(n))}function GH(t,e){var n=t==null?0:t.length;if(n){var o=$1(t,e);if(o<n&&q_(t[o],e))return o}return-1}function zH(t,e){return $1(t,e,!0)}function HH(t,e,n){return dM(t,e,_i(n),!0)}function XH(t,e){var n=t==null?0:t.length;if(n){var o=$1(t,e,!0)-1;if(q_(t[o],e))return o}return-1}function l3(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n],s=e?e(a):a;if(!n||!q_(s,l)){var l=s;i[r++]=a===0?0:a}}return i}function YH(t){return t&&t.length?l3(t):[]}function qH(t,e){return t&&t.length?l3(t,_i(e)):[]}var KH=4294967295;function ZH(t,e,n){return n&&typeof n!="number"&&kh(t,e,n)&&(e=n=void 0),n=n===void 0?KH:n>>>0,n?(t=Ri(t),t&&(typeof e=="string"||e!=null&&!X2(e))&&(e=ed(e),!e&&ey(t))?Dh(td(t),0,n):t.split(e,n)):[]}var JH="Expected a function",QH=Math.max;function eX(t,e){if(typeof t!="function")throw new TypeError(JH);return e=e==null?0:QH(zo(e),0),Yo(function(n){var o=n[e],r=Dh(n,0,e);return o&&X_(r,o),Qu(t,this,r)})}var tX=ty(function(t,e,n){return t+(n?" ":"")+J2(e)});function nX(t,e,n){return t=Ri(t),n=n==null?0:Jm(zo(n),0,t.length),e=ed(e),t.slice(n,n+e.length)==e}function rX(){return{}}function oX(){return""}function iX(){return!0}var aX=k1(function(t,e){return t-e},0);function lX(t){return t&&t.length?aM(t,tg):0}function sX(t,e){return t&&t.length?aM(t,_i(e)):0}function uX(t){var e=t==null?0:t.length;return e?sp(t,1,e):[]}function cX(t,e,n){return t&&t.length?(e=n||e===void 0?1:zo(e),sp(t,0,e<0?0:e)):[]}function dX(t,e,n){var o=t==null?0:t.length;return o?(e=n||e===void 0?1:zo(e),e=o-e,sp(t,e<0?0:e,o)):[]}function fX(t,e){return t&&t.length?j1(t,_i(e),!1,!0):[]}function pX(t,e){return t&&t.length?j1(t,_i(e)):[]}function hX(t,e){return e(t),t}var s3=Object.prototype,vX=s3.hasOwnProperty;function pk(t,e,n,o){return t===void 0||q_(t,s3[n])&&!vX.call(o,n)?e:t}var gX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function mX(t){return"\\"+gX[t]}var u3=/<%=([\s\S]+?)%>/g,yX=/<%-([\s\S]+?)%>/g,_X=/<%([\s\S]+?)%>/g,wA={escape:yX,evaluate:_X,interpolate:u3,variable:"",imports:{_:{escape:BL}}},bX="Invalid `variable` option passed into `_.template`",wX=/\b__p \+= '';/g,EX=/\b(__p \+=) '' \+/g,xX=/(__e\(.*?\)|\b__t\)) \+\n'';/g,OX=/[()=,{}\[\]\/\s]/,SX=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,d0=/($^)/,AX=/['\n\r\u2028\u2029\\]/g,MX=Object.prototype,hk=MX.hasOwnProperty;function TX(t,e,n){var o=wA.imports._.templateSettings||wA;n&&kh(t,e,n)&&(e=void 0),t=Ri(t),e=hA({},e,o,pk);var r=hA({},e.imports,o.imports,pk),i=Zd(r),a=Vj(r,i),s,l,f=0,h=e.interpolate||d0,v="__p += '",_=RegExp((e.escape||d0).source+"|"+h.source+"|"+(h===u3?SX:d0).source+"|"+(e.evaluate||d0).source+"|$","g"),E=hk.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
|
||
`:"";t.replace(_,function(S,M,T,B,R,P){return T||(T=B),v+=t.slice(f,P).replace(AX,mX),M&&(s=!0,v+=`' +
|
||
__e(`+M+`) +
|
||
'`),R&&(l=!0,v+=`';
|
||
`+R+`;
|
||
__p += '`),T&&(v+=`' +
|
||
((__t = (`+T+`)) == null ? '' : __t) +
|
||
'`),f=P+S.length,S}),v+=`';
|
||
`;var O=hk.call(e,"variable")&&e.variable;if(!O)v=`with (obj) {
|
||
`+v+`
|
||
}
|
||
`;else if(OX.test(O))throw new Error(bX);v=(l?v.replace(wX,""):v).replace(EX,"$1").replace(xX,"$1;"),v="function("+(O||"obj")+`) {
|
||
`+(O?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+v+`return __p
|
||
}`;var w=iL(function(){return Function(i,E+"return "+v).apply(void 0,a)});if(w.source=v,K2(w))throw w;return w}function U1(t,e){return e(t)}var CX=9007199254740991,KO=4294967295,NX=Math.min;function kX(t,e){if(t=zo(t),t<1||t>CX)return[];var n=KO,o=NX(t,KO);e=lg(e),t-=KO;for(var r=Tj(o,e);++n<t;)e(n);return r}function PX(){return this}function c3(t,e){var n=t;return n instanceof $o&&(n=n.value()),Uj(e,function(o,r){return r.func.apply(r.thisArg,X_([o],r.args))},n)}function RX(){return c3(this.__wrapped__,this.__actions__)}function DX(t){return Ri(t).toLowerCase()}function jX(t){return qa(t)?Es(t,A1):km(t)?[t]:Ku(j$(Ri(t)))}var vk=9007199254740991;function LX(t){return t?Jm(zo(t),-vk,vk):t===0?t:0}function IX(t){return Ri(t).toUpperCase()}function FX(t,e,n){var o=qa(t),r=o||Cj(t)||Nj(t);if(e=_i(e),n==null){var i=t&&t.constructor;r?n=o?new i:[]:lp(t)?n=Ph(i)?z_(L$(t)):{}:n={}}return(r?Kd:ag)(t,function(a,s,l){return e(n,a,s,l)}),n}function d3(t,e){for(var n=t.length;n--&&R2(e,t[n],0)>-1;);return n}function f3(t,e){for(var n=-1,o=t.length;++n<o&&R2(e,t[n],0)>-1;);return n}function BX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return I$(t);if(!t||!(e=ed(e)))return t;var o=td(t),r=td(e),i=f3(o,r),a=d3(o,r)+1;return Dh(o,i,a).join("")}function $X(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.slice(0,F$(t)+1);if(!t||!(e=ed(e)))return t;var o=td(t),r=d3(o,td(e))+1;return Dh(o,0,r).join("")}var UX=/^\s+/;function VX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return t.replace(UX,"");if(!t||!(e=ed(e)))return t;var o=td(t),r=f3(o,td(e));return Dh(o,r).join("")}var WX=30,GX="...",zX=/\w*$/;function HX(t,e){var n=WX,o=GX;if(lp(e)){var r="separator"in e?e.separator:r;n="length"in e?zo(e.length):n,o="omission"in e?ed(e.omission):o}t=Ri(t);var i=t.length;if(ey(t)){var a=td(t);i=a.length}if(n>=i)return t;var s=n-ny(o);if(s<1)return o;var l=a?Dh(a,0,s).join(""):t.slice(0,s);if(r===void 0)return l+o;if(a&&(s+=l.length-s),X2(r)){if(t.slice(s).search(r)){var f,h=l;for(r.global||(r=RegExp(r.source,Ri(zX.exec(r))+"g")),r.lastIndex=0;f=r.exec(h);)var v=f.index;l=l.slice(0,v===void 0?s:v)}}else if(t.indexOf(ed(r),s)!=s){var _=l.lastIndexOf(r);_>-1&&(l=l.slice(0,_))}return l+o}function XX(t){return oL(t,1)}var YX={"&":"&","<":"<",">":">",""":'"',"'":"'"},qX=Q2(YX),p3=/&(?:amp|lt|gt|quot|#39);/g,KX=RegExp(p3.source);function ZX(t){return t=Ri(t),t&&KX.test(t)?t.replace(p3,qX):t}var JX=Yo(function(t){var e=ec(t);return Ll(e)&&(e=void 0),E_(Jd(t,1,Ll,!0),_i(e))}),QX=Yo(function(t){var e=ec(t);return e=typeof e=="function"?e:void 0,E_(Jd(t,1,Ll,!0),void 0,e)});function eY(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?E_(t,void 0,e):[]}function tY(t,e){return t==null?!0:Mj(t,e)}var nY=Math.max;function fM(t){if(!(t&&t.length))return[];var e=0;return t=Y_(t,function(n){if(Ll(n))return e=nY(n.length,e),!0}),Tj(e,function(n){return Es(t,Sj(n))})}function h3(t,e){if(!(t&&t.length))return[];var n=fM(t);return e==null?n:Es(n,function(o){return Qu(e,void 0,o)})}function v3(t,e,n,o){return D2(t,e,n(Aj(t,e)),o)}function rY(t,e,n){return t==null?t:v3(t,e,lg(n))}function oY(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:v3(t,e,lg(n),o)}var iY=ty(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function aY(t){return t==null?[]:Vj(t,rg(t))}var lY=Yo(function(t,e){return Ll(t)?N1(t,e):[]});function sY(t,e){return F1(lg(e),t)}var uY=ig(function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(i){return q2(i,t)};return e>1||this.__actions__.length||!(o instanceof $o)||!H_(n)?this.thru(r):(o=o.slice(n,+n+(e?1:0)),o.__actions__.push({func:U1,args:[r],thisArg:void 0}),new rc(o,this.__chain__).thru(function(i){return e&&!i.length&&i.push(void 0),i}))});function cY(){return NL(this)}function dY(){var t=this.__wrapped__;if(t instanceof $o){var e=t;return this.__actions__.length&&(e=new $o(this)),e=e.reverse(),e.__actions__.push({func:U1,args:[bA],thisArg:void 0}),new rc(e,this.__chain__)}return this.thru(bA)}function pM(t,e,n){var o=t.length;if(o<2)return o?E_(t[0]):[];for(var r=-1,i=Array(o);++r<o;)for(var a=t[r],s=-1;++s<o;)s!=r&&(i[r]=N1(i[r]||a,t[s],e,n));return E_(Jd(i,1),e,n)}var fY=Yo(function(t){return pM(Y_(t,Ll))}),pY=Yo(function(t){var e=ec(t);return Ll(e)&&(e=void 0),pM(Y_(t,Ll),_i(e))}),hY=Yo(function(t){var e=ec(t);return e=typeof e=="function"?e:void 0,pM(Y_(t,Ll),void 0,e)}),vY=Yo(fM);function gY(t,e){return Z9(t||[],e||[],D2)}var mY=Yo(function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,h3(t,n)});const mr={chunk:CV,compact:L9,concat:LV,difference:I9,differenceBy:eW,differenceWith:tW,drop:F9,dropRight:B9,dropRightWhile:rW,dropWhile:oW,fill:bW,findIndex:Gj,findLastIndex:_j,flatten:B$,flattenDeep:$$,flattenDepth:MW,fromPairs:U$,head:V9,indexOf:Hj,initial:YW,intersection:KW,intersectionBy:ZW,intersectionWith:JW,join:jG,lastIndexOf:UG,nth:sz,pull:Kz,pullAll:o3,pullAllBy:Zz,pullAllWith:Jz,pullAt:tH,remove:pH,reverse:bA,slice:DH,sortedIndex:VH,sortedIndexBy:WH,sortedIndexOf:GH,sortedLastIndex:zH,sortedLastIndexBy:HH,sortedLastIndexOf:XH,sortedUniq:YH,sortedUniqBy:qH,tail:uX,take:cX,takeRight:dX,takeRightWhile:fX,takeWhile:pX,union:V$,unionBy:JX,unionWith:QX,uniq:$9,uniqBy:U9,uniqWith:eY,unzip:fM,unzipWith:h3,without:lY,xor:fY,xorBy:pY,xorWith:hY,zip:vY,zipObject:J9,zipObjectDeep:gY,zipWith:mY},Di={countBy:zV,every:z9,filter:C9,find:Ah,findLast:EW,flatMap:W$,flatMapDeep:SW,flatMapDepth:AW,forEach:ri,forEachRight:aW,groupBy:W9,includes:H9,invokeMap:lG,keyBy:IG,map:tc,orderBy:fz,partition:zz,reduce:Wj,reduceRight:fH,reject:G9,sample:xH,sampleSize:AH,shuffle:NH,size:RH,some:X9,sortBy:Q9},yY={now:G$},Ta={after:d7,ary:oL,before:aL,bind:D1,bindKey:Z2,curry:tM,curryRight:nM,debounce:j2,defer:JV,delay:QV,flip:CW,memoize:z$,once:dz,overArgs:gz,partial:F1,partialRight:sM,rearg:cH,rest:mH,spread:eX,throttle:kj,unary:XX,wrap:sY},Vr={castArray:H$,clone:Y$,cloneDeep:to,cloneDeepWith:PV,cloneWith:DV,conformsTo:VV,eq:q_,gt:VW,gte:WW,isArguments:q$,isArrayBuffer:cG,isArrayLike:C1,isArrayLikeObject:Ll,isBoolean:gw,isBuffer:Cj,isDate:hG,isElement:vG,isEmpty:dw,isEqual:uA,isEqualWith:gG,isError:K2,isFinite:yG,isFunction:Ph,isInteger:HL,isLength:K$,isMap:Z$,isMatch:_G,isMatchWith:bG,isNaN:EG,isNative:SG,isNil:ws,isNull:J$,isNumber:XL,isObjectLike:qd,isPlainObject:P2,isRegExp:X2,isSafeInteger:AG,isSet:Q$,isString:z2,isSymbol:km,isTypedArray:Nj,isUndefined:Xv,isWeakMap:TG,isWeakSet:NG,lt:GG,lte:zG,toArray:KL,toFinite:w_,toLength:UL,toNumber:Pm,toPlainObject:X$,toSafeInteger:LX,toString:Ri},Ss={add:u7,ceil:AV,divide:nW,floor:NW,max:e7,maxBy:KG,mean:JG,meanBy:QG,min:R9,minBy:t7,multiply:rz,round:wH,subtract:aX,sum:lX,sumBy:sX},hM={clamp:e9,inRange:XW,random:lH},io={assign:Xo,assignIn:iU,assignInWith:hA,assignWith:aU,at:lU,create:HV,defaults:D9,defaultsDeep:KV,findKey:wW,findLastKey:xW,forIn:r7,forInRight:FW,forOwn:o7,forOwnRight:BW,functions:$W,functionsIn:UW,get:og,has:hw,hasIn:n9,invert:nG,invertBy:iG,invoke:aG,keysIn:rg,mapKeys:YL,mapValues:n7,merge:Yv,mergeWith:RL,omit:t9,omitBy:cz,pick:Vv,pickBy:zj,result:yH,set:Pj,setWith:MH,toPairs:vp,toPairsIn:fW,transform:FX,unset:tY,update:rY,updateWith:oY,values:J_,valuesIn:aY},ef={at:uY,chain:NL,commit:jV,next:lz,plant:Hz,reverse:dY,tap:hX,toIterator:PX,value:RX,wrapperChain:cY},pi={camelCase:xV,capitalize:hL,deburr:vL,endsWith:lW,escape:BL,escapeRegExp:mW,kebabCase:LG,lowerCase:VG,lowerFirst:WG,pad:Iz,padEnd:Fz,padStart:Bz,parseInt:Vz,repeat:hH,replace:vH,snakeCase:jH,split:ZH,startCase:tX,startsWith:nX,template:TX,templateSettings:wA,toLower:DX,toUpper:IX,trim:BX,trimEnd:$X,trimStart:VX,truncate:HX,unescape:ZX,upperCase:iY,upperFirst:J2,words:CL},bi={attempt:iL,bindAll:pU,cond:FV,conforms:UV,constant:bj,defaultTo:qV,flow:LW,flowRight:IW,iteratee:PG,matches:XG,matchesProperty:qG,method:ez,methodOf:tz,noop:Qy,nthArg:uz,over:pz,overEvery:mz,overSome:yz,property:r9,propertyOf:Xz,range:i7,rangeRight:sH,stubArray:o9,stubFalse:Oj,stubObject:rX,stubString:oX,stubTrue:iX,times:kX,toPath:jX,uniqueId:a7};function _Y(){var t=new $o(this.__wrapped__);return t.__actions__=Ku(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ku(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ku(this.__views__),t}function bY(){if(this.__filtered__){var t=new $o(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var wY=Math.max,EY=Math.min;function xY(t,e,n){for(var o=-1,r=n.length;++o<r;){var i=n[o],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=EY(e,t+a);break;case"takeRight":t=wY(t,e-a);break}}return{start:t,end:e}}var OY=1,SY=2,AY=Math.min;function MY(){var t=this.__wrapped__.value(),e=this.__dir__,n=qa(t),o=e<0,r=n?t.length:0,i=xY(0,r,this.__views__),a=i.start,s=i.end,l=s-a,f=o?s:a-1,h=this.__iteratees__,v=h.length,_=0,E=AY(l,this.__takeCount__);if(!n||!o&&r==l&&E==l)return c3(t,this.__actions__);var O=[];e:for(;l--&&_<E;){f+=e;for(var w=-1,S=t[f];++w<v;){var M=h[w],T=M.iteratee,B=M.type,R=T(S);if(B==SY)S=R;else if(!R){if(B==OY)continue e;break e}}O[_++]=S}return O}/**
|
||
* @license
|
||
* Lodash (Custom Build) <https://lodash.com/>
|
||
* Build: `lodash modularize exports="es" -o ./`
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/var TY="4.17.23",CY=2,NY=1,kY=3,g3=4294967295,PY=Array.prototype,RY=Object.prototype,m3=RY.hasOwnProperty,gk=cw?cw.iterator:void 0,DY=Math.max,mk=Math.min,vM=(function(t){return function(e,n,o){if(o==null){var r=lp(n),i=r&&Zd(n),a=i&&i.length&&L1(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}})(nz);me.after=Ta.after;me.ary=Ta.ary;me.assign=io.assign;me.assignIn=io.assignIn;me.assignInWith=io.assignInWith;me.assignWith=io.assignWith;me.at=io.at;me.before=Ta.before;me.bind=Ta.bind;me.bindAll=bi.bindAll;me.bindKey=Ta.bindKey;me.castArray=Vr.castArray;me.chain=ef.chain;me.chunk=mr.chunk;me.compact=mr.compact;me.concat=mr.concat;me.cond=bi.cond;me.conforms=bi.conforms;me.constant=bi.constant;me.countBy=Di.countBy;me.create=io.create;me.curry=Ta.curry;me.curryRight=Ta.curryRight;me.debounce=Ta.debounce;me.defaults=io.defaults;me.defaultsDeep=io.defaultsDeep;me.defer=Ta.defer;me.delay=Ta.delay;me.difference=mr.difference;me.differenceBy=mr.differenceBy;me.differenceWith=mr.differenceWith;me.drop=mr.drop;me.dropRight=mr.dropRight;me.dropRightWhile=mr.dropRightWhile;me.dropWhile=mr.dropWhile;me.fill=mr.fill;me.filter=Di.filter;me.flatMap=Di.flatMap;me.flatMapDeep=Di.flatMapDeep;me.flatMapDepth=Di.flatMapDepth;me.flatten=mr.flatten;me.flattenDeep=mr.flattenDeep;me.flattenDepth=mr.flattenDepth;me.flip=Ta.flip;me.flow=bi.flow;me.flowRight=bi.flowRight;me.fromPairs=mr.fromPairs;me.functions=io.functions;me.functionsIn=io.functionsIn;me.groupBy=Di.groupBy;me.initial=mr.initial;me.intersection=mr.intersection;me.intersectionBy=mr.intersectionBy;me.intersectionWith=mr.intersectionWith;me.invert=io.invert;me.invertBy=io.invertBy;me.invokeMap=Di.invokeMap;me.iteratee=bi.iteratee;me.keyBy=Di.keyBy;me.keys=Zd;me.keysIn=io.keysIn;me.map=Di.map;me.mapKeys=io.mapKeys;me.mapValues=io.mapValues;me.matches=bi.matches;me.matchesProperty=bi.matchesProperty;me.memoize=Ta.memoize;me.merge=io.merge;me.mergeWith=io.mergeWith;me.method=bi.method;me.methodOf=bi.methodOf;me.mixin=vM;me.negate=H2;me.nthArg=bi.nthArg;me.omit=io.omit;me.omitBy=io.omitBy;me.once=Ta.once;me.orderBy=Di.orderBy;me.over=bi.over;me.overArgs=Ta.overArgs;me.overEvery=bi.overEvery;me.overSome=bi.overSome;me.partial=Ta.partial;me.partialRight=Ta.partialRight;me.partition=Di.partition;me.pick=io.pick;me.pickBy=io.pickBy;me.property=bi.property;me.propertyOf=bi.propertyOf;me.pull=mr.pull;me.pullAll=mr.pullAll;me.pullAllBy=mr.pullAllBy;me.pullAllWith=mr.pullAllWith;me.pullAt=mr.pullAt;me.range=bi.range;me.rangeRight=bi.rangeRight;me.rearg=Ta.rearg;me.reject=Di.reject;me.remove=mr.remove;me.rest=Ta.rest;me.reverse=mr.reverse;me.sampleSize=Di.sampleSize;me.set=io.set;me.setWith=io.setWith;me.shuffle=Di.shuffle;me.slice=mr.slice;me.sortBy=Di.sortBy;me.sortedUniq=mr.sortedUniq;me.sortedUniqBy=mr.sortedUniqBy;me.split=pi.split;me.spread=Ta.spread;me.tail=mr.tail;me.take=mr.take;me.takeRight=mr.takeRight;me.takeRightWhile=mr.takeRightWhile;me.takeWhile=mr.takeWhile;me.tap=ef.tap;me.throttle=Ta.throttle;me.thru=U1;me.toArray=Vr.toArray;me.toPairs=io.toPairs;me.toPairsIn=io.toPairsIn;me.toPath=bi.toPath;me.toPlainObject=Vr.toPlainObject;me.transform=io.transform;me.unary=Ta.unary;me.union=mr.union;me.unionBy=mr.unionBy;me.unionWith=mr.unionWith;me.uniq=mr.uniq;me.uniqBy=mr.uniqBy;me.uniqWith=mr.uniqWith;me.unset=io.unset;me.unzip=mr.unzip;me.unzipWith=mr.unzipWith;me.update=io.update;me.updateWith=io.updateWith;me.values=io.values;me.valuesIn=io.valuesIn;me.without=mr.without;me.words=pi.words;me.wrap=Ta.wrap;me.xor=mr.xor;me.xorBy=mr.xorBy;me.xorWith=mr.xorWith;me.zip=mr.zip;me.zipObject=mr.zipObject;me.zipObjectDeep=mr.zipObjectDeep;me.zipWith=mr.zipWith;me.entries=io.toPairs;me.entriesIn=io.toPairsIn;me.extend=io.assignIn;me.extendWith=io.assignInWith;vM(me,me);me.add=Ss.add;me.attempt=bi.attempt;me.camelCase=pi.camelCase;me.capitalize=pi.capitalize;me.ceil=Ss.ceil;me.clamp=hM.clamp;me.clone=Vr.clone;me.cloneDeep=Vr.cloneDeep;me.cloneDeepWith=Vr.cloneDeepWith;me.cloneWith=Vr.cloneWith;me.conformsTo=Vr.conformsTo;me.deburr=pi.deburr;me.defaultTo=bi.defaultTo;me.divide=Ss.divide;me.endsWith=pi.endsWith;me.eq=Vr.eq;me.escape=pi.escape;me.escapeRegExp=pi.escapeRegExp;me.every=Di.every;me.find=Di.find;me.findIndex=mr.findIndex;me.findKey=io.findKey;me.findLast=Di.findLast;me.findLastIndex=mr.findLastIndex;me.findLastKey=io.findLastKey;me.floor=Ss.floor;me.forEach=Di.forEach;me.forEachRight=Di.forEachRight;me.forIn=io.forIn;me.forInRight=io.forInRight;me.forOwn=io.forOwn;me.forOwnRight=io.forOwnRight;me.get=io.get;me.gt=Vr.gt;me.gte=Vr.gte;me.has=io.has;me.hasIn=io.hasIn;me.head=mr.head;me.identity=tg;me.includes=Di.includes;me.indexOf=mr.indexOf;me.inRange=hM.inRange;me.invoke=io.invoke;me.isArguments=Vr.isArguments;me.isArray=qa;me.isArrayBuffer=Vr.isArrayBuffer;me.isArrayLike=Vr.isArrayLike;me.isArrayLikeObject=Vr.isArrayLikeObject;me.isBoolean=Vr.isBoolean;me.isBuffer=Vr.isBuffer;me.isDate=Vr.isDate;me.isElement=Vr.isElement;me.isEmpty=Vr.isEmpty;me.isEqual=Vr.isEqual;me.isEqualWith=Vr.isEqualWith;me.isError=Vr.isError;me.isFinite=Vr.isFinite;me.isFunction=Vr.isFunction;me.isInteger=Vr.isInteger;me.isLength=Vr.isLength;me.isMap=Vr.isMap;me.isMatch=Vr.isMatch;me.isMatchWith=Vr.isMatchWith;me.isNaN=Vr.isNaN;me.isNative=Vr.isNative;me.isNil=Vr.isNil;me.isNull=Vr.isNull;me.isNumber=Vr.isNumber;me.isObject=lp;me.isObjectLike=Vr.isObjectLike;me.isPlainObject=Vr.isPlainObject;me.isRegExp=Vr.isRegExp;me.isSafeInteger=Vr.isSafeInteger;me.isSet=Vr.isSet;me.isString=Vr.isString;me.isSymbol=Vr.isSymbol;me.isTypedArray=Vr.isTypedArray;me.isUndefined=Vr.isUndefined;me.isWeakMap=Vr.isWeakMap;me.isWeakSet=Vr.isWeakSet;me.join=mr.join;me.kebabCase=pi.kebabCase;me.last=ec;me.lastIndexOf=mr.lastIndexOf;me.lowerCase=pi.lowerCase;me.lowerFirst=pi.lowerFirst;me.lt=Vr.lt;me.lte=Vr.lte;me.max=Ss.max;me.maxBy=Ss.maxBy;me.mean=Ss.mean;me.meanBy=Ss.meanBy;me.min=Ss.min;me.minBy=Ss.minBy;me.stubArray=bi.stubArray;me.stubFalse=bi.stubFalse;me.stubObject=bi.stubObject;me.stubString=bi.stubString;me.stubTrue=bi.stubTrue;me.multiply=Ss.multiply;me.nth=mr.nth;me.noop=bi.noop;me.now=yY.now;me.pad=pi.pad;me.padEnd=pi.padEnd;me.padStart=pi.padStart;me.parseInt=pi.parseInt;me.random=hM.random;me.reduce=Di.reduce;me.reduceRight=Di.reduceRight;me.repeat=pi.repeat;me.replace=pi.replace;me.result=io.result;me.round=Ss.round;me.sample=Di.sample;me.size=Di.size;me.snakeCase=pi.snakeCase;me.some=Di.some;me.sortedIndex=mr.sortedIndex;me.sortedIndexBy=mr.sortedIndexBy;me.sortedIndexOf=mr.sortedIndexOf;me.sortedLastIndex=mr.sortedLastIndex;me.sortedLastIndexBy=mr.sortedLastIndexBy;me.sortedLastIndexOf=mr.sortedLastIndexOf;me.startCase=pi.startCase;me.startsWith=pi.startsWith;me.subtract=Ss.subtract;me.sum=Ss.sum;me.sumBy=Ss.sumBy;me.template=pi.template;me.times=bi.times;me.toFinite=Vr.toFinite;me.toInteger=zo;me.toLength=Vr.toLength;me.toLower=pi.toLower;me.toNumber=Vr.toNumber;me.toSafeInteger=Vr.toSafeInteger;me.toString=Vr.toString;me.toUpper=pi.toUpper;me.trim=pi.trim;me.trimEnd=pi.trimEnd;me.trimStart=pi.trimStart;me.truncate=pi.truncate;me.unescape=pi.unescape;me.uniqueId=bi.uniqueId;me.upperCase=pi.upperCase;me.upperFirst=pi.upperFirst;me.each=Di.forEach;me.eachRight=Di.forEachRight;me.first=mr.head;vM(me,(function(){var t={};return ag(me,function(e,n){m3.call(me.prototype,n)||(t[n]=e)}),t})(),{chain:!1});me.VERSION=TY;(me.templateSettings=pi.templateSettings).imports._=me;Kd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){me[t].placeholder=me});Kd(["drop","take"],function(t,e){$o.prototype[t]=function(n){n=n===void 0?1:DY(zo(n),0);var o=this.__filtered__&&!e?new $o(this):this.clone();return o.__filtered__?o.__takeCount__=mk(n,o.__takeCount__):o.__views__.push({size:mk(n,g3),type:t+(o.__dir__<0?"Right":"")}),o},$o.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}});Kd(["filter","map","takeWhile"],function(t,e){var n=e+1,o=n==NY||n==kY;$o.prototype[t]=function(r){var i=this.clone();return i.__iteratees__.push({iteratee:_i(r),type:n}),i.__filtered__=i.__filtered__||o,i}});Kd(["head","last"],function(t,e){var n="take"+(e?"Right":"");$o.prototype[t]=function(){return this[n](1).value()[0]}});Kd(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");$o.prototype[t]=function(){return this.__filtered__?new $o(this):this[n](1)}});$o.prototype.compact=function(){return this.filter(tg)};$o.prototype.find=function(t){return this.filter(t).head()};$o.prototype.findLast=function(t){return this.reverse().find(t)};$o.prototype.invokeMap=Yo(function(t,e){return typeof t=="function"?new $o(this):this.map(function(n){return Q_(n,t,e)})});$o.prototype.reject=function(t){return this.filter(H2(_i(t)))};$o.prototype.slice=function(t,e){t=zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new $o(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=zo(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)};$o.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};$o.prototype.toArray=function(){return this.take(g3)};ag($o.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=me[o?"take"+(e=="last"?"Right":""):e],i=o||/^find/.test(e);r&&(me.prototype[e]=function(){var a=this.__wrapped__,s=o?[1]:arguments,l=a instanceof $o,f=s[0],h=l||qa(a),v=function(M){var T=r.apply(me,X_([M],s));return o&&_?T[0]:T};h&&n&&typeof f=="function"&&f.length!=1&&(l=h=!1);var _=this.__chain__,E=!!this.__actions__.length,O=i&&!_,w=l&&!E;if(!i&&h){a=w?a:new $o(this);var S=t.apply(a,s);return S.__actions__.push({func:U1,args:[v],thisArg:void 0}),new rc(S,_)}return O&&w?t.apply(this,s):(S=this.thru(v),O?o?S.value()[0]:S.value():S)})});Kd(["pop","push","shift","sort","splice","unshift"],function(t){var e=PY[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);me.prototype[t]=function(){var r=arguments;if(o&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],r)}return this[n](function(a){return e.apply(qa(a)?a:[],r)})}});ag($o.prototype,function(t,e){var n=me[e];if(n){var o=n.name+"";m3.call(Om,o)||(Om[o]=[]),Om[o].push({name:e,func:n})}});Om[R1(void 0,CY).name]=[{name:"wrapper",func:void 0}];$o.prototype.clone=_Y;$o.prototype.reverse=bY;$o.prototype.value=MY;me.prototype.at=ef.at;me.prototype.chain=ef.wrapperChain;me.prototype.commit=ef.commit;me.prototype.next=ef.next;me.prototype.plant=ef.plant;me.prototype.reverse=ef.reverse;me.prototype.toJSON=me.prototype.valueOf=me.prototype.value=ef.value;me.prototype.first=me.prototype.head;gk&&(me.prototype[gk]=ef.toIterator);const jY="data:image/svg+xml,%3csvg%20width='27'%20height='20'%20viewBox='0%200%2027%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.6667%203.33329H3.66667V16.6666H23.6667V3.33329ZM3.66667%201.66663C2.74619%201.66663%202%202.41282%202%203.33329V16.6666C2%2017.5871%202.74619%2018.3333%203.66667%2018.3333H23.6667C24.5871%2018.3333%2025.3333%2017.5871%2025.3333%2016.6666V3.33329C25.3333%202.41282%2024.5871%201.66663%2023.6667%201.66663H3.66667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2196%206.91331H18.2767L19.4%209.89549L20.4758%206.91331L22.5375%206.83044L19.4%2014.8138L17.3565%2014.8966L18.437%2012.3756L16.2196%206.91331Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.1034%207.06327C13.1302%207.04839%2013.1574%207.03404%2013.1848%207.02023C13.5166%206.84295%2013.8759%206.77344%2014.2468%206.77344C14.9611%206.77344%2015.5729%206.97047%2015.9992%207.43635C16.419%207.89521%2016.5934%208.54454%2016.5934%209.3101V12.9168H14.7001V9.4001C14.7001%209.01738%2014.6103%208.80651%2014.5052%208.69229C14.4059%208.58445%2014.2319%208.49677%2013.9067%208.49677C13.7078%208.49677%2013.5468%208.55932%2013.4114%208.69473C13.2534%208.85274%2013.1382%209.08146%2013.1034%209.41091V12.9168H11.2101V6.91344H13.1034V7.06327Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.01665%2012.6833V12.9168H10.83V9.2001C10.83%208.50266%2010.6523%207.90623%2010.247%207.47482L10.2458%207.47354C9.77726%206.97898%209.08554%206.77344%208.26332%206.77344C7.58671%206.77344%206.97894%206.88784%206.50606%207.18452C5.95355%207.51308%205.61381%208.04132%205.48446%208.69979L5.39493%209.15558L6.60828%209.25958C6.45695%209.32645%206.3157%209.40545%206.18578%209.49774C5.6067%209.89006%205.31665%2010.4724%205.31665%2011.1801C5.31665%2011.727%205.52656%2012.1949%205.95194%2012.5464C6.34831%2012.8992%206.87585%2013.0568%207.48332%2013.0568C7.99851%2013.0568%208.45994%2012.9557%208.86073%2012.7671L8.86966%2012.7628C8.91982%2012.7377%208.96882%2012.7112%209.01665%2012.6833ZM7.33362%209.04021C7.60234%208.98907%207.88998%208.96154%208.19236%208.95358L8.93243%208.93444C8.90662%208.77431%208.84911%208.68249%208.7882%208.62627C8.69958%208.54447%208.527%208.46677%208.19332%208.46677C7.90772%208.46677%207.72064%208.51963%207.60769%208.58739L7.60328%208.59004C7.46993%208.66783%207.38847%208.77506%207.35134%208.95452L7.33362%209.04021ZM8.93782%2010.5386L8.28478%2010.5566L8.28191%2010.5567C7.83203%2010.566%207.5658%2010.6502%207.4222%2010.7499C7.3054%2010.831%207.23998%2010.9409%207.23998%2011.1401C7.23998%2011.2037%207.25413%2011.2438%207.32642%2011.2991L7.3313%2011.3029L7.33606%2011.3067C7.40443%2011.3623%207.52395%2011.4134%207.72332%2011.4134C8.07815%2011.4134%208.36218%2011.3062%208.60462%2011.1017C8.80129%2010.9357%208.90794%2010.7499%208.93782%2010.5386Z'%20fill='%23646A73'/%3e%3c/svg%3e",LY="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.6667%203.33329H3.33335V16.6666H16.6667V3.33329ZM3.33335%201.66663C2.41288%201.66663%201.66669%202.41282%201.66669%203.33329V16.6666C1.66669%2017.5871%202.41288%2018.3333%203.33335%2018.3333H16.6667C17.5872%2018.3333%2018.3334%2017.5871%2018.3334%2016.6666V3.33329C18.3334%202.41282%2017.5872%201.66663%2016.6667%201.66663H3.33335Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.33%205.83667H15.2233V13.95H13.33V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.83%205.83667H12.7233V13.95H10.83V5.83667Z'%20fill='%23646A73'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.51665%2013.7165V13.95H10.33V10.2333C10.33%209.53587%2010.1523%208.93943%209.747%208.50803L9.7458%208.50675C9.27726%208.01218%208.58554%207.80664%207.76332%207.80664C7.08671%207.80664%206.47894%207.92104%206.00606%208.21772C5.45355%208.54628%205.11381%209.07452%204.98446%209.733L4.89493%2010.1888L6.10828%2010.2928C5.95695%2010.3597%205.8157%2010.4386%205.68578%2010.5309C5.1067%2010.9233%204.81665%2011.5057%204.81665%2012.2133C4.81665%2012.7602%205.02656%2013.2281%205.45194%2013.5796C5.84831%2013.9324%206.37585%2014.09%206.98332%2014.09C7.49851%2014.09%207.95994%2013.9889%208.36073%2013.8003L8.36966%2013.796C8.41982%2013.7709%208.46882%2013.7444%208.51665%2013.7165ZM6.83361%2010.0734C7.10234%2010.0223%207.38998%209.99474%207.69236%209.98678L8.43243%209.96764C8.40662%209.80751%208.3491%209.71569%208.2882%209.65948C8.19958%209.57767%208.027%209.49997%207.69332%209.49997C7.40772%209.49997%207.22064%209.55283%207.10769%209.6206L7.10328%209.62324C6.96993%209.70103%206.88847%209.80826%206.85134%209.98773L6.83361%2010.0734ZM8.43782%2011.5718L7.78478%2011.5898L7.78191%2011.5899C7.33203%2011.5992%207.0658%2011.6834%206.9222%2011.7831C6.8054%2011.8642%206.73998%2011.9741%206.73998%2012.1733C6.73998%2012.2369%206.75413%2012.277%206.82642%2012.3323L6.8313%2012.3361L6.83606%2012.3399C6.90443%2012.3955%207.02395%2012.4466%207.22332%2012.4466C7.57815%2012.4466%207.86218%2012.3394%208.10462%2012.1349C8.30129%2011.9689%208.40794%2011.7831%208.43782%2011.5718Z'%20fill='%23646A73'/%3e%3c/svg%3e",IY={class:"list flex-wrap"},FY=["onClick","onMousedown"],BY=["src"],$Y=["title"],UY={class:"flex-between"},VY={class:"flex align-center"},WY=["src"],GY=["title"],zY={key:0,class:"status-tag",style:{"margin-left":"auto"}},HY=gr({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=t,o=e,r=Ge(""),i=Ge([]);function a(s,l){return l.length?s.filter(f=>f.name.toLowerCase().includes(l.toLowerCase())):s}return K_([()=>r.value,()=>n.list],()=>{i.value=a(n.list,r.value)}),(s,l)=>{const f=te("el-input"),h=te("el-avatar"),v=te("el-tag"),_=te("el-text"),E=te("el-popover"),O=te("el-empty");return Te(),cn(Ir,null,[k(f,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=w=>r.value=w),modelModifiers:{trim:!0},placeholder:s.$t("common.search"),"prefix-icon":"Search",clearable:"",style:{padding:"12px 12px 0 12px"}},null,8,["modelValue","placeholder"]),ee("div",IY,[i.value.length?(Te(!0),cn(Ir,{key:0},No(i.value,w=>(Te(),bt(E,{key:w.id,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:mn(S=>o("clickNodes",w),["stop"]),onMousedown:mn(S=>o("onmousedown",w),["stop"])},[Wn(cA)(w==null?void 0:w.icon)?(Te(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(yh)(w==null?void 0:w.icon,Wn(yh)("./favicon.ico")),alt:""},null,8,BY)]),_:2},1024)):(Te(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...l[1]||(l[1]=[ee("img",{src:UN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"ml-8 ellipsis",title:w.name},_e(w.name),9,$Y)],40,FY)]),default:j(()=>[ee("div",UY,[ee("div",VY,[Wn(cA)(w==null?void 0:w.icon)?(Te(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(yh)(w==null?void 0:w.icon,Wn(yh)("./favicon.ico")),alt:""},null,8,WY)]),_:2},1024)):(Te(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...l[2]||(l[2]=[ee("img",{src:UN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"font-medium ml-8 break-all",title:w.name},_e(w.name),9,GY)]),w.type?(Te(),cn("div",zY,[Wn(L2)(w.type)?(Te(),bt(v,{key:0,class:"warning-tag"},{default:j(()=>[ft(_e(s.$t("views.application.workflow")),1)]),_:1})):(Te(),bt(v,{key:1,class:"blue-tag"},{default:j(()=>[ft(_e(s.$t("views.application.simple")),1)]),_:1}))])):In("",!0)]),k(_,{type:"info",size:"small",class:"mt-4"},{default:j(()=>[ft(_e(w.desc),1)]),_:2},1024)]),_:2},1024))),128)):(Te(),bt(O,{key:1,description:s.$t("common.noData")},null,8,["description"]))])],64)}}}),yk=fp(HY,[["__scopeId","data-v-deb1c287"]]),XY={style:{display:"flex",width:"100%","justify-content":"center"},class:"mb-12 mt-12"},YY={key:0},qY={class:"flex-wrap",style:{gap:"12px",padding:"12px"}},KY=["onClick","onMousedown"],ZY={class:"lighter"},JY={class:"flex align-center mb-8"},QY={class:"lighter color-text-primary"},eq={key:1,class:"ml-16 mt-8"},tq=gr({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=gl("workflowMode"),o=ja(),{user:r,folder:i}=Rj(),a=b9(n||nc.Application),s=Ge(""),l=t,f=e,h=fr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),v=fr(()=>Dj.tool[h.value]),_=Ge(!1),E=Ge("base"),O=fr(()=>{if(!s.value)return a||[];const X=s.value.toLowerCase();return(a||[]).reduce((Y,W)=>{const Q=W.list.filter(J=>J.label.toLowerCase().includes(X));return Q.length&&Y.push({...W,list:Q}),Y},[])});function w(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=l.workflowRef)==null||Q.addNode(X),f("clickNodes",X)}function S(X,Y,W){var Q;Y&&(X.properties.stepName=Y.name,W=="tool"&&(X.properties.node_data={...Y,tool_lib_id:Y.id,input_field_list:Y.input_field_list.map(J=>({...J,value:J.source=="reference"?[]:""}))}),W=="application"&&(L2(Y.type)?(Y.work_flow.nodes[0].properties.node_data.file_upload_setting,X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id}):X.properties.node_data={name:Y.name,icon:Y.icon,application_id:Y.id})),(Q=l.workflowRef)==null||Q.onmousedown(X),f("onmousedown",X)}const M=Ge([]),T=Ge([]);async function B(){var Y;const X=await i.asyncGetFolder(u0.TOOL,{},_);M.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})}async function R(){var Y,W,Q,J;const X=await oi({type:"tool",isShared:((Y=i.currentFolder)==null?void 0:Y.id)==="share",systemType:"workspace"}).getToolList({folder_id:((W=i.currentFolder)==null?void 0:W.id)||r.getWorkspaceId(),tool_type:"CUSTOM"});T.value=((Q=X.data)==null?void 0:Q.tools)||X.data||[],T.value=(J=T.value)==null?void 0:J.filter(ie=>ie.is_active)}const P=Ge([]),$=Ge([]);function I(){i.asyncGetFolder(u0.APPLICATION,{},_).then(X=>{var Y;P.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})})}async function F(){var Y;const X=await oi({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((Y=i.currentFolder)==null?void 0:Y.id)||r.getWorkspaceId()});$.value=X.data.filter(W=>W.resource_type==="application"&&W.id!==l.id&&W.is_publish)}function U(X){i.setCurrentFolder(X),E.value==="tool"?R():F()}async function z(X){console.log(X),X==="tool"?(await B(),R()):X==="application"&&(I(),F())}return yo(()=>{}),(X,Y)=>{const W=te("search"),Q=te("el-icon"),J=te("el-input"),ie=te("el-text"),Se=te("el-popover"),Ae=te("el-scrollbar"),Pe=te("el-tab-pane"),De=te("folder-tree"),He=te("LayoutContainer"),Ye=te("el-tabs");return Ql((Te(),cn("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:jj({width:E.value==="base"?"400px":"640px"})},[k(Ye,{modelValue:E.value,"onUpdate:modelValue":Y[5]||(Y[5]=Be=>E.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:j(()=>[Ql(ee("div",XY,[k(J,{modelValue:s.value,"onUpdate:modelValue":Y[0]||(Y[0]=Be=>s.value=Be),class:"mr-12 ml-12",placeholder:X.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:j(()=>[k(Q,{class:"el-input__icon"},{default:j(()=>[k(W)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Oh,E.value==="base"]]),k(Pe,{label:X.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:j(()=>[k(Ae,{height:"400"},{default:j(()=>[O.value.length>0?(Te(),cn("div",YY,[(Te(!0),cn(Ir,null,No(O.value,(Be,Je)=>(Te(),cn(Ir,{key:Je},[k(ie,{type:"info",size:"small",class:"color-secondary ml-12"},{default:j(()=>[ft(_e(Be.label),1)]),_:2},1024),ee("div",qY,[(Te(!0),cn(Ir,null,No(Be.list,(mt,le)=>(Te(),bt(Se,{key:le,placement:"right",width:280,"show-after":500},{reference:j(()=>[ee("div",{class:"list-item flex align-center border border-r-6 p-8-12 cursor",style:{width:"calc(50% - 6px)"},onClick:mn(Ze=>w(mt),["stop"]),onMousedown:mn(Ze=>S(mt),["stop"])},[(Te(),bt(fw(Wn(pw)(`${mt.type}-icon`)),{class:"mr-8",size:20})),ee("div",ZY,_e(mt.label),1)],40,KY)]),default:j(()=>[ee("div",JY,[(Te(),bt(fw(Wn(pw)(`${mt.type}-icon`)),{class:"mr-8",size:32})),ee("div",QY,_e(mt.label),1)]),k(ie,{type:"info",size:"small",class:"color-secondary lighter"},{default:j(()=>[ft(_e(mt.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(Te(),cn("div",eq,[k(ie,{type:"info"},{default:j(()=>[ft(_e(X.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),k(Pe,{label:X.$t("views.tool.title"),name:"tool"},{default:j(()=>[k(He,null,{left:j(()=>{var Be;return[k(De,{source:Wn(u0).TOOL,data:M.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:U,shareTitle:X.$t("views.shared.shared_tool"),showShared:v.value.is_share(),canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey","shareTitle","showShared"])]}),default:j(()=>[k(Ae,{height:"450"},{default:j(()=>[k(yk,{list:T.value,onClickNodes:Y[1]||(Y[1]=Be=>w(Wn(GN),Be,"tool")),onOnmousedown:Y[2]||(Y[2]=Be=>S(Wn(GN),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),k(Pe,{label:X.$t("views.application.title"),name:"application"},{default:j(()=>[k(He,null,{left:j(()=>{var Be;return[k(De,{source:Wn(u0).APPLICATION,data:P.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:U,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:j(()=>[k(Ae,{height:"450"},{default:j(()=>[k(yk,{list:$.value,onClickNodes:Y[3]||(Y[3]=Be=>w(Wn(zN),Be,"application")),onOnmousedown:Y[4]||(Y[4]=Be=>S(Wn(zN),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Oh,t.show]])}}}),y3=fp(tq,[["__scopeId","data-v-a8dfaa84"]]),nq={class:"flex-between"},rq={class:"ellipsis-1 break-all"},oq={key:0,src:jY,alt:""},iq={key:1,src:LY,alt:""},aq={style:{width:"280px"},class:"p-12-16"},lq={class:"mt-8 lighter"},sq={class:"title-decoration-1 mb-8 mt-8"},uq=["onMouseenter"],cq={class:"break-all"},dq={class:"dialog-footer"},fq=gr({__name:"NodeContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",nc.Application);const e=ja(),{params:{id:n}}=e,o=Ge({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=Ge(!1),i=Ge(),a=Ge(),s=Ge(!1),l=Ge({title:""}),f=fr({set:z=>{Me.set(P.nodeModel.properties,"condition",z)},get:()=>P.nodeModel.properties.condition?P.nodeModel.properties.condition:(Me.set(P.nodeModel.properties,"condition","AND"),!0)}),h=fr({set:z=>{Me.set(P.nodeModel.properties,"showNode",z)},get:()=>P.nodeModel.properties.showNode!==void 0?P.nodeModel.properties.showNode:(Me.set(P.nodeModel.properties,"showNode",!0),!0)}),v=z=>{z.ctrlKey||z.metaKey||z.stopPropagation()},_=fr(()=>P.nodeModel.properties.status?P.nodeModel.properties.status:200);function E(){l.value.title=P.nodeModel.properties.stepName,s.value=!0}const O=async z=>{z&&await z.validate(X=>{var Y;X&&((Y=P.nodeModel.graphModel.nodes.filter(W=>W.id!==P.nodeModel.id))!=null&&Y.some(W=>W.properties.stepName===l.value.title)?Xi(Pt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(P.nodeModel.properties,"stepName",l.value.title),s.value=!1,z.resetFields()))})},w=z=>{z!=null&&z.shiftKey||P.nodeModel.graphModel.clearSelectElements(),Me.set(P.nodeModel,"isSelected",!P.nodeModel.isSelected),Me.set(P.nodeModel,"isHovered",!P.nodeModel.isSelected),P.nodeModel.graphModel.toFront(P.nodeModel.id)},S=Ge(null),M=()=>{P.nodeModel.graphModel.clearSelectElements();const z=P.nodeModel.graphModel.cloneNode(P.nodeModel.id);Me.set(z,"isSelected",!0),Me.set(z,"isHovered",!0),P.nodeModel.graphModel.toFront(z.id)},T=()=>{I2(Pt("common.tip"),Pt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:Pt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{P.nodeModel.type===kr.LoopNode&&P.nodeModel.graphModel.getNodeOutgoingNode(P.nodeModel.id).forEach(X=>{X.type==="loop-body-node"&&P.nodeModel.graphModel.deleteNode(X.id)}),P.nodeModel.graphModel.deleteNode(P.nodeModel.id)}),P.nodeModel.graphModel.eventCenter.emit("delete_node")},B=z=>{z.height&&(P.nodeModel.virtual||(o.value.stepContainerHeight=z.height,P.nodeModel.setHeight(o.value.stepContainerHeight)))};function R(z){var W,Q,J;const X=z.properties.width?z.properties.width:214,Y=P.nodeModel.graphModel.addNode({type:z.type,properties:z.properties,x:((W=i.value)==null?void 0:W.x)+X/2+200,y:((Q=i.value)==null?void 0:Q.y)-z.height});P.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:P.nodeModel.id,sourceAnchorId:(J=i.value)==null?void 0:J.id,targetNodeId:Y.id,targetAnchorId:Y.id+"_left"}),U()}const P=t,$=fr(()=>{var z;return P.nodeModel.properties.config.fields?(z=P.nodeModel.properties.config.fields)==null?void 0:z.map(Y=>({label:Y.label,value:Y.value,globeLabel:`{{${P.nodeModel.properties.stepName}.${Y.value}}}`,globeValue:`{{context['${P.nodeModel.id}'].${Y.value}}}`})):[]});function I(z){return![kr.Start,kr.Base,kr.LoopStartNode.toString()].includes(z)}const F=z=>{r.value=!0,i.value=z},U=()=>{r.value=!1,i.value=void 0};return yo(()=>{Me.set(P.nodeModel,"openNodeMenu",z=>{r.value?U():F(z)})}),(z,X)=>{var se;const Y=te("ArrowDownBold"),W=te("el-icon"),Q=te("el-button"),J=te("el-option"),ie=te("el-select"),Se=te("el-dropdown"),Ae=te("AppIcon"),Pe=te("el-dropdown-item"),De=te("el-dropdown-menu"),He=te("el-alert"),Ye=te("el-tooltip"),Be=te("el-collapse-transition"),Je=te("el-input"),mt=te("el-form-item"),le=te("el-form"),Ze=te("el-dialog"),pe=Rm("resize");return Te(),cn("div",{onMousedown:w,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gs(["step-container app-card p-16",{isSelected:P.nodeModel.isSelected,error:_.value!==200}]),style:{overflow:"visible"}},[Ql((Te(),cn("div",null,[ee("div",nq,[ee("div",{class:"flex align-center",onDragstart:X[0]||(X[0]=mn(()=>{},["prevent"])),onDrag:X[1]||(X[1]=mn(()=>{},["prevent"])),onDragover:X[2]||(X[2]=mn(()=>{},["prevent"])),onDragend:X[3]||(X[3]=mn(()=>{},["prevent"])),style:{width:"69%"}},[(Te(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(se=t.nodeModel)==null?void 0:se.properties.node_data},null,8,["item"])),ee("h4",rq,_e(t.nodeModel.properties.stepName),1)],32),ee("div",{onMousemove:X[6]||(X[6]=mn(()=>{},["stop"])),onMousedown:X[7]||(X[7]=mn(()=>{},["stop"])),onKeydown:X[8]||(X[8]=mn(()=>{},["stop"])),onClick:X[9]||(X[9]=mn(()=>{},["stop"]))},[k(Q,{text:"",onClick:X[4]||(X[4]=we=>h.value=!h.value)},{default:j(()=>[k(W,{class:Gs(["arrow-icon color-secondary",h.value?"rotate-180":""])},{default:j(()=>[k(Y)]),_:1},8,["class"])]),_:1}),I(t.nodeModel.type)?(Te(),bt(Se,{key:0,teleported:!1,trigger:"click",placement:"bottom-start"},{dropdown:j(()=>[ee("div",aq,[ee("h5",null,_e(z.$t("views.applicationWorkflow.condition.title")),1),ee("p",lq,[ee("span",null,_e(z.$t("views.applicationWorkflow.condition.front")),1),k(ie,{modelValue:f.value,"onUpdate:modelValue":X[5]||(X[5]=we=>f.value=we),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(J,{label:z.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(J,{label:z.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(z.$t("views.applicationWorkflow.condition.text")),1)])])]),default:j(()=>[k(Q,{text:""},{default:j(()=>[f.value==="OR"?(Te(),cn("img",oq)):In("",!0),f.value==="AND"?(Te(),cn("img",iq)):In("",!0)]),_:1})]),_:1})):In("",!0),I(t.nodeModel.type)?(Te(),bt(Se,{key:1,teleported:!1,trigger:"click"},{dropdown:j(()=>[k(De,{style:{"min-width":"80px"}},{default:j(()=>[k(Pe,{onClick:E,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.rename")),1)]),_:1}),k(Pe,{onClick:M,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.copy")),1)]),_:1}),k(Pe,{onClick:T,class:"border-t p-8"},{default:j(()=>[ft(_e(z.$t("common.delete")),1)]),_:1})]),_:1})]),default:j(()=>[k(Q,{text:""},{default:j(()=>[k(Ae,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):In("",!0)],32)]),k(Be,null,{default:j(()=>[Ql(ee("div",{onMousedown:X[11]||(X[11]=mn(()=>{},["stop"])),onKeydown:X[12]||(X[12]=mn(()=>{},["stop"])),onClick:X[13]||(X[13]=mn(()=>{},["stop"])),class:"mt-16"},[_.value!=200?(Te(),bt(He,{key:0,class:"mb-16",title:P.nodeModel.type==="application-node"?z.$t("views.applicationWorkflow.tip.applicationNodeError"):z.$t("views.applicationWorkflow.tip.toolNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):In("",!0),Lj(z.$slots,"default",{},void 0,!0),$.value.length>0?(Te(),cn(Ir,{key:1},[ee("h5",sq,_e(z.$t("common.param.outputParam")),1),(Te(!0),cn(Ir,null,No($.value,(we,$e)=>(Te(),cn("div",{key:$e,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:rt=>S.value=$e,onMouseleave:X[10]||(X[10]=rt=>S.value=null)},[ee("span",cq,_e(we.label)+" "+_e("{"+we.value+"}"),1),S.value===$e?(Te(),bt(Ye,{key:0,effect:"dark",content:z.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(Q,{link:"",onClick:rt=>Wn(x_)(we.globeLabel),style:{padding:"0"}},{default:j(()=>[k(Ae,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):In("",!0)],40,uq))),128))],64)):In("",!0)],544),[[Oh,h.value]])]),_:3})])),[[pe,B]])],2),k(Be,null,{default:j(()=>[r.value?(Te(),bt(y3,{key:0,onMousemove:X[14]||(X[14]=mn(()=>{},["stop"])),onMousedown:X[15]||(X[15]=mn(()=>{},["stop"])),onClick:X[16]||(X[16]=mn(()=>{},["stop"])),onWheel:v,show:r.value,id:Wn(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:R},null,8,["show","id"])):In("",!0)]),_:1}),k(Ze,{title:z.$t("views.applicationWorkflow.nodeName"),modelValue:s.value,"onUpdate:modelValue":X[21]||(X[21]=we=>s.value=we),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:X[22]||(X[22]=mn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",dq,[k(Q,{onClick:X[19]||(X[19]=mn(we=>s.value=!1,["prevent"]))},{default:j(()=>[ft(_e(z.$t("common.cancel")),1)]),_:1}),k(Q,{type:"primary",onClick:X[20]||(X[20]=we=>O(a.value))},{default:j(()=>[ft(_e(z.$t("common.save")),1)]),_:1})])]),default:j(()=>[k(le,{"label-position":"top",ref_key:"titleFormRef",ref:a,model:l.value},{default:j(()=>[k(mt,{prop:"title",rules:[{required:!0,message:z.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[k(Je,{modelValue:l.value.title,"onUpdate:modelValue":X[17]||(X[17]=we=>l.value.title=we),onBlur:X[18]||(X[18]=we=>l.value.title=l.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),hi=fp(fq,[["__scopeId","data-v-4532ca06"]]),pq={class:"title-decoration-1 mb-8"},hq={class:"flex-between w-full"},vq={class:"flex-between"},gq={class:"flex align-center"},mq={class:"flex align-center"},yq={class:"mr-4"},_q={class:"flex-between"},bq={class:"flex-between mb-16"},wq={key:0,class:"w-full mb-16"},Eq={key:0,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},xq={class:"flex align-center",style:{"line-height":"20px"}},Oq=["src"],Sq=["title"],Aq={key:1,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},Mq={class:"flex align-center",style:{"line-height":"20px"}},Tq={class:"ellipsis"},Cq={class:"flex-between mb-16"},Nq={class:"lighter"},kq={key:2,class:"w-full mb-16"},Pq={class:"flex align-center",style:{"line-height":"20px"}},Rq=["src"],Dq=["title"],jq={class:"flex-between"},Lq={class:"mr-4"},Iq={class:"flex"},Fq={class:"flex-between w-full"},Bq={class:"flex align-center"},$q={class:"mr-4"},Uq=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Be=>Be.ctrlKey===!0?(Be.preventDefault(),!0):(Be.stopPropagation(),!0);function a(Be){Me.set(_.nodeModel.properties.node_data,"system",Be)}function s(Be){Me.set(_.nodeModel.properties.node_data,"prompt",Be)}const l=Be=>{var Je;Be?(Je=w.value)==null||Je.reset_default(Be,o):U({})},h={model_id:"",system:"",prompt:`${Pt("views.applicationWorkflow.nodes.aiChatNode.defaultPrompt")}:
|
||
{{${Pt("views.applicationWorkflow.nodes.searchKnowledgeNode.label")}.data}}
|
||
${Pt("views.problem.title")}:
|
||
{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:1,is_result:!0,temperature:null,max_tokens:null,dialogue_type:"WORKFLOW",model_setting:{reasoning_content_start:"<think>",reasoning_content_end:"</think>",reasoning_content_enable:!1}},v=fr({get:()=>_.nodeModel.properties.node_data?(_.nodeModel.properties.node_data.model_setting||Me.set(_.nodeModel.properties.node_data,"model_setting",{reasoning_content_start:"<think>",reasoning_content_end:"</think>",reasoning_content_enable:!1}),_.nodeModel.properties.node_data):(Me.set(_.nodeModel.properties,"node_data",h),_.nodeModel.properties.node_data),set:Be=>{Me.set(_.nodeModel.properties,"node_data",Be)}}),_=t,E=Ge(),O=Ge(null),w=Ge(),S=Ge(),M=()=>{var Be;return(Be=E.value)==null?void 0:Be.validate().catch(Je=>Promise.reject({node:_.nodeModel,errMessage:Je}))},T=e();function B(){var Je;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(Be).then(mt=>{O.value=Me.groupBy(mt==null?void 0:mt.data,"provider")})}const R=Be=>{var Je;Be&&((Je=w.value)==null||Je.open(Be,o,v.value.model_params_setting))},P=Ge(),$=Be=>{var Je;Be&&((Je=P.value)==null||Je.open(Be,o))},I=Be=>{Me.set(_.nodeModel.properties.node_data,"system",Be)},F=()=>{var Be;(Be=S.value)==null||Be.open(v.value.model_setting)};function U(Be){Me.set(_.nodeModel.properties.node_data,"model_params_setting",Be)}function z(Be){let Je=Me.cloneDeep(_.nodeModel.properties.node_data.model_setting);Je={...Je,...Be},Me.set(_.nodeModel.properties.node_data,"model_setting",Je)}const X=Ge();function Y(){const Be={mcp_servers:v.value.mcp_servers,mcp_tool_ids:v.value.mcp_tool_ids,mcp_source:v.value.mcp_source};X.value.open(Be,He.value)}function W(Be){Me.set(_.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),Me.set(_.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),Me.set(_.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const Q=Ge();function J(){Q.value.open(v.value.tool_ids)}function ie(Be){Me.set(_.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function Se(Be){const Je=_.nodeModel.properties.node_data.tool_ids.filter(mt=>mt!==Be);Me.set(_.nodeModel.properties.node_data,"tool_ids",Je)}function Ae(Be){const Je=_.nodeModel.properties.node_data.mcp_tool_ids.filter(mt=>mt!==Be);Me.set(_.nodeModel.properties.node_data,"mcp_tool_ids",Je)}const Pe=Ge([]);function De(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(mt=>{Pe.value=[...mt.data.shared_tools,...mt.data.tools].filter(le=>le.is_active)})}const He=Ge([]);function Ye(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(Je=T.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(mt=>{He.value=[...mt.data.shared_tools,...mt.data.tools].filter(le=>le.is_active)})}return yo(()=>{var Be,Je,mt,le;B(),typeof((Be=_.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&Qd(_.nodeModel)&&Me.set(_.nodeModel.properties.node_data,"is_result",!0),Me.set(_.nodeModel,"validate",M),v.value.dialogue_type||(v.value.dialogue_type="WORKFLOW"),(Je=_.nodeModel.properties.node_data)!=null&&Je.mcp_tool_id&&(Me.set(_.nodeModel.properties.node_data,"mcp_tool_ids",[(mt=_.nodeModel.properties.node_data)==null?void 0:mt.mcp_tool_id]),Me.set(_.nodeModel.properties.node_data,"mcp_tool_id",void 0)),((le=_.nodeModel.properties.node_data)==null?void 0:le.mcp_output_enable)===void 0&&Me.set(_.nodeModel.properties.node_data,"mcp_output_enable",!0),De(),Ye()}),(Be,Je)=>{const mt=te("AppIcon"),le=te("el-button"),Ze=te("ModelSelect"),pe=te("el-form-item"),se=te("el-tooltip"),we=te("MdEditorMagnify"),$e=te("el-option"),rt=te("el-select"),pt=te("el-input-number"),Lt=te("el-switch"),Jt=te("el-avatar"),en=te("ToolIcon"),zt=te("Close"),it=te("el-icon"),ae=te("el-form"),re=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",pq,_e(Be.$t("views.applicationWorkflow.nodeSetting")),1),k(re,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(ae,{onSubmit:Je[16]||(Je[16]=mn(()=>{},["prevent"])),model:v.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:E,"hide-required-asterisk":""},{default:j(()=>{var je,vt;return[k(pe,{label:Be.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:Be.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hq,[ee("div",null,[ee("span",null,[ft(_e(Be.$t("views.application.form.aiModel.label")),1),Je[17]||(Je[17]=ee("span",{class:"color-danger"},"*",-1))])]),k(le,{disabled:!v.value.model_id,type:"primary",link:"",onClick:Je[0]||(Je[0]=q=>R(v.value.model_id)),onRefreshForm:U},{default:j(()=>[k(mt,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Ze,{onChange:l,onWheel:i,teleported:!1,modelValue:v.value.model_id,"onUpdate:modelValue":Je[1]||(Je[1]=q=>v.value.model_id=q),placeholder:Be.$t("views.application.form.aiModel.placeholder"),options:O.value,onSubmitModel:B,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(pe,null,{label:j(()=>[ee("div",vq,[ee("div",gq,[ee("span",null,_e(Be.$t("views.application.form.roleSettings.label")),1),k(se,{effect:"dark",content:Be.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(mt,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(le,{type:"primary",link:"",onClick:Je[2]||(Je[2]=q=>$(v.value.model_id)),disabled:!v.value.model_id},{default:j(()=>[k(mt,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(we,{title:Be.$t("views.application.form.roleSettings.label"),modelValue:v.value.system,"onUpdate:modelValue":Je[3]||(Je[3]=q=>v.value.system=q),style:{height:"100px"},onSubmitDialog:a,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(pe,{label:Be.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:Be.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",mq,[ee("div",yq,[ee("span",null,[ft(_e(Be.$t("views.application.form.prompt.label")),1),Je[18]||(Je[18]=ee("span",{class:"color-danger"},"*",-1))])]),k(se,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(mt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(we,{onWheel:i,title:Be.$t("views.application.form.prompt.label"),modelValue:v.value.prompt,"onUpdate:modelValue":Je[4]||(Je[4]=q=>v.value.prompt=q),style:{height:"150px"},onSubmitDialog:s,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(pe,{label:Be.$t("views.application.form.historyRecord.label")},{label:j(()=>[ee("div",_q,[ee("div",null,_e(Be.$t("views.application.form.historyRecord.label")),1),k(rt,{modelValue:v.value.dialogue_type,"onUpdate:modelValue":Je[5]||(Je[5]=q=>v.value.dialogue_type=q),type:"small",style:{width:"100px"}},{default:j(()=>[k($e,{label:Be.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k($e,{label:Be.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(pt,{modelValue:v.value.dialogue_number,"onUpdate:modelValue":Je[6]||(Je[6]=q=>v.value.dialogue_number=q),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),ee("div",bq,[Je[19]||(Je[19]=ee("div",{class:"lighter"},"MCP",-1)),ee("div",null,[v.value.mcp_enable?(Te(),bt(le,{key:0,type:"primary",class:"mr-4",link:"",onClick:Y,onRefreshForm:U},{default:j(()=>[k(mt,{iconName:"app-setting"})]),_:1})):In("",!0),k(Lt,{size:"small",modelValue:v.value.mcp_enable,"onUpdate:modelValue":Je[7]||(Je[7]=q=>v.value.mcp_enable=q)},null,8,["modelValue"])])]),((je=v.value.mcp_tool_ids)==null?void 0:je.length)>0?(Te(),cn("div",wq,[(Te(!0),cn(Ir,null,No(v.value.mcp_tool_ids,(q,kt)=>{var Rt,Gt,Pn;return Te(),cn(Ir,{key:kt},[Wn(bs)(He.value,q,"id")?(Te(),cn("div",Eq,[ee("div",xq,[(Rt=Wn(bs)(He.value,q,"id"))!=null&&Rt.icon?(Te(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(yh)((qt=Wn(bs)(He.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Oq)]}),_:2},1024)):(Te(),bt(en,{key:1,type:"MCP",class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bs)(He.value,q,"id"))==null?void 0:Gt.name},_e(((Pn=Wn(bs)(He.value,q,"id"))==null?void 0:Pn.name)||Be.$t("common.custom")+" MCP"),9,Sq)]),k(le,{text:"",onClick:qt=>Ae(q)},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1},8,["onClick"])])):In("",!0)],64)}),128))])):In("",!0),v.value.mcp_servers&&v.value.mcp_servers.length>0?(Te(),cn("div",Aq,[ee("div",Mq,[k(en,{type:"MCP",class:"mr-8",size:20}),ee("div",Tq,_e(Be.$t("common.custom")+" MCP"),1)]),k(le,{text:"",onClick:Je[8]||(Je[8]=q=>v.value.mcp_servers="")},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):In("",!0),ee("div",Cq,[ee("div",Nq,_e(Be.$t("views.tool.title")),1),ee("div",null,[v.value.tool_enable?(Te(),bt(le,{key:0,type:"primary",class:"mr-4",link:"",onClick:J,onRefreshForm:U},{default:j(()=>[k(mt,{iconName:"app-setting"})]),_:1})):In("",!0),k(Lt,{size:"small",modelValue:v.value.tool_enable,"onUpdate:modelValue":Je[9]||(Je[9]=q=>v.value.tool_enable=q)},null,8,["modelValue"])])]),((vt=v.value.tool_ids)==null?void 0:vt.length)>0?(Te(),cn("div",kq,[(Te(!0),cn(Ir,null,No(v.value.tool_ids,(q,kt)=>{var Rt,Gt,Pn;return Te(),cn("div",{key:kt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Pq,[(Rt=Wn(bs)(Pe.value,q,"id"))!=null&&Rt.icon?(Te(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(yh)((qt=Wn(bs)(Pe.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Rq)]}),_:2},1024)):(Te(),bt(en,{key:1,class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bs)(Pe.value,q,"id"))==null?void 0:Gt.name},_e((Pn=Wn(bs)(Pe.value,q,"id"))==null?void 0:Pn.name),9,Dq)]),k(le,{text:"",onClick:qt=>Se(q)},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1},8,["onClick"])])}),128))])):In("",!0),v.value.mcp_enable||v.value.tool_enable?(Te(),bt(pe,{key:3,onClick:Je[11]||(Je[11]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",jq,[ee("span",Lq,_e(Be.$t("views.application.form.mcp_output_enable")),1),ee("div",Iq,[k(Lt,{class:"ml-8",size:"small",modelValue:v.value.mcp_output_enable,"onUpdate:modelValue":Je[10]||(Je[10]=q=>v.value.mcp_output_enable=q)},null,8,["modelValue"])])])]),_:1})):In("",!0),k(pe,{onClick:Je[13]||(Je[13]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Fq,[ee("div",null,[ee("span",null,_e(Be.$t("views.application.form.reasoningContent.label")),1)]),ee("div",null,[v.value.model_setting.reasoning_content_enable?(Te(),bt(le,{key:0,type:"primary",link:"",onClick:F,onRefreshForm:U,class:"mr-4"},{default:j(()=>[k(mt,{iconName:"app-setting"})]),_:1})):In("",!0),k(Lt,{size:"small",modelValue:v.value.model_setting.reasoning_content_enable,"onUpdate:modelValue":Je[12]||(Je[12]=q=>v.value.model_setting.reasoning_content_enable=q)},null,8,["modelValue"])])])]),_:1}),k(pe,{onClick:Je[15]||(Je[15]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Bq,[ee("div",$q,[ee("span",null,_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(se,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(mt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Lt,{size:"small",modelValue:v.value.is_result,"onUpdate:modelValue":Je[14]||(Je[14]=q=>v.value.is_result=q)},null,8,["modelValue"])]),_:1})]}),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:w,onRefresh:U},null,512),k(W2,{onReplace:I,ref_key:"GeneratePromptDialogRef",ref:P},null,512),k(x9,{ref_key:"ReasoningParamSettingDialogRef",ref:S,onRefresh:z},null,512),k(O9,{ref_key:"mcpServersDialogRef",ref:X,onRefresh:W},null,512),k(S9,{ref_key:"toolDialogRef",ref:Q,onRefresh:ie},null,512)]),_:1},8,["nodeModel"])}}});var _k={width:40,height:40},bk={width:40,height:40},wk={width:40,height:40},Ek={width:100,height:80},xk={width:100,height:80},V1,xo,_3,Iv,Ok,b3,w3,E3,gM,EA,xA,yw={},_w=[],Vq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eb=Array.isArray;function op(t,e){for(var n in e)t[n]=e[n];return t}function mM(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Lr(t,e,n){var o,r,i,a={};for(i in e)i=="key"?o=e[i]:i=="ref"?r=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?V1.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)a[i]===void 0&&(a[i]=t.defaultProps[i]);return X0(t,a,o,r,null)}function X0(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++_3,__i:-1,__u:0};return r==null&&xo.vnode!=null&&xo.vnode(i),i}function W1(){return{current:null}}function jm(t){return t.children}function ko(t,e){this.props=t,this.context=e}function Lm(t,e){if(e==null)return t.__?Lm(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Lm(t):null}function Wq(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],r=[],i=op({},e);i.__v=e.__v+1,xo.vnode&&xo.vnode(i),yM(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,n??Lm(e),!!(32&e.__u),r),i.__v=e.__v,i.__.__k[i.__i]=i,A3(o,i,r),e.__e=e.__=null,i.__e!=n&&x3(i)}}function x3(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),x3(t)}function Sk(t){(!t.__d&&(t.__d=!0)&&Iv.push(t)&&!bw.__r++||Ok!=xo.debounceRendering)&&((Ok=xo.debounceRendering)||b3)(bw)}function bw(){for(var t,e=1;Iv.length;)Iv.length>e&&Iv.sort(w3),t=Iv.shift(),e=Iv.length,Wq(t);bw.__r=0}function O3(t,e,n,o,r,i,a,s,l,f,h){var v,_,E,O,w,S,M,T=o&&o.__k||_w,B=e.length;for(l=Gq(n,e,T,l,B),v=0;v<B;v++)(E=n.__k[v])!=null&&(_=E.__i!=-1&&T[E.__i]||yw,E.__i=v,S=yM(t,E,_,r,i,a,s,l,f,h),O=E.__e,E.ref&&_.ref!=E.ref&&(_.ref&&_M(_.ref,null,E),h.push(E.ref,E.__c||O,E)),w==null&&O!=null&&(w=O),(M=!!(4&E.__u))||_.__k===E.__k?l=S3(E,l,t,M):typeof E.type=="function"&&S!==void 0?l=S:O&&(l=O.nextSibling),E.__u&=-7);return n.__e=w,l}function Gq(t,e,n,o,r){var i,a,s,l,f,h=n.length,v=h,_=0;for(t.__k=new Array(r),i=0;i<r;i++)(a=e[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=t.__k[i]=X0(null,a,null,null,null):eb(a)?a=t.__k[i]=X0(jm,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=t.__k[i]=X0(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[i]=a,l=i+_,a.__=t,a.__b=t.__b+1,s=null,(f=a.__i=zq(a,n,l,v))!=-1&&(v--,(s=n[f])&&(s.__u|=2)),s==null||s.__v==null?(f==-1&&(r>h?_--:r<h&&_++),typeof a.type!="function"&&(a.__u|=4)):f!=l&&(f==l-1?_--:f==l+1?_++:(f>l?_--:_++,a.__u|=4))):t.__k[i]=null;if(v)for(i=0;i<h;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Lm(s)),T3(s,s));return o}function S3(t,e,n,o){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=S3(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=Lm(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ww(t,e){return e=e||[],t==null||typeof t=="boolean"||(eb(t)?t.some(function(n){ww(n,e)}):e.push(t)),e}function zq(t,e,n,o){var r,i,a,s=t.key,l=t.type,f=e[n],h=f!=null&&(2&f.__u)==0;if(f===null&&s==null||h&&s==f.key&&l==f.type)return n;if(o>(h?1:0)){for(r=n-1,i=n+1;r>=0||i<e.length;)if((f=e[a=r>=0?r--:i++])!=null&&(2&f.__u)==0&&s==f.key&&l==f.type)return a}return-1}function Ak(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Vq.test(e)?n:n+"px"}function f0(t,e,n,o,r){var i,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||Ak(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||Ak(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(E3,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=gM,t.addEventListener(e,i?xA:EA,i)):t.removeEventListener(e,i?xA:EA,i);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Mk(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=gM++;else if(e.t<n.u)return;return n(xo.event?xo.event(e):e)}}}function yM(t,e,n,o,r,i,a,s,l,f){var h,v,_,E,O,w,S,M,T,B,R,P,$,I,F,U=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(h=xo.__b)&&h(e);e:if(typeof U=="function")try{if(M=e.props,T="prototype"in U&&U.prototype.render,B=(h=U.contextType)&&o[h.__c],R=h?B?B.props.value:h.__:o,n.__c?S=(v=e.__c=n.__c).__=v.__E:(T?e.__c=v=new U(M,R):(e.__c=v=new ko(M,R),v.constructor=U,v.render=Xq),B&&B.sub(v),v.state||(v.state={}),v.__n=o,_=v.__d=!0,v.__h=[],v._sb=[]),T&&v.__s==null&&(v.__s=v.state),T&&U.getDerivedStateFromProps!=null&&(v.__s==v.state&&(v.__s=op({},v.__s)),op(v.__s,U.getDerivedStateFromProps(M,v.__s))),E=v.props,O=v.state,v.__v=e,_)T&&U.getDerivedStateFromProps==null&&v.componentWillMount!=null&&v.componentWillMount(),T&&v.componentDidMount!=null&&v.__h.push(v.componentDidMount);else{if(T&&U.getDerivedStateFromProps==null&&M!==E&&v.componentWillReceiveProps!=null&&v.componentWillReceiveProps(M,R),e.__v==n.__v||!v.__e&&v.shouldComponentUpdate!=null&&v.shouldComponentUpdate(M,v.__s,R)===!1){e.__v!=n.__v&&(v.props=M,v.state=v.__s,v.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(z){z&&(z.__=e)}),_w.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break e}v.componentWillUpdate!=null&&v.componentWillUpdate(M,v.__s,R),T&&v.componentDidUpdate!=null&&v.__h.push(function(){v.componentDidUpdate(E,O,w)})}if(v.context=R,v.props=M,v.__P=t,v.__e=!1,P=xo.__r,$=0,T)v.state=v.__s,v.__d=!1,P&&P(e),h=v.render(v.props,v.state,v.context),_w.push.apply(v.__h,v._sb),v._sb=[];else do v.__d=!1,P&&P(e),h=v.render(v.props,v.state,v.context),v.state=v.__s;while(v.__d&&++$<25);v.state=v.__s,v.getChildContext!=null&&(o=op(op({},o),v.getChildContext())),T&&!_&&v.getSnapshotBeforeUpdate!=null&&(w=v.getSnapshotBeforeUpdate(E,O)),I=h!=null&&h.type===jm&&h.key==null?M3(h.props.children):h,s=O3(t,eb(I)?I:[I],e,n,o,r,i,a,s,l,f),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),S&&(v.__E=v.__=null)}catch(z){if(e.__v=null,l||i!=null)if(z.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else{for(F=i.length;F--;)mM(i[F]);OA(e)}else e.__e=n.__e,e.__k=n.__k,z.then||OA(e);xo.__e(z,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=Hq(n.__e,e,n,o,r,i,a,l,f);return(h=xo.diffed)&&h(e),128&e.__u?void 0:s}function OA(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(OA))}function A3(t,e,n){for(var o=0;o<n.length;o++)_M(n[o],n[++o],n[++o]);xo.__c&&xo.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(i){i.call(r)})}catch(i){xo.__e(i,r.__v)}})}function M3(t){return typeof t!="object"||t==null||t.__b>0?t:eb(t)?t.map(M3):op({},t)}function Hq(t,e,n,o,r,i,a,s,l){var f,h,v,_,E,O,w,S=n.props||yw,M=e.props,T=e.type;if(T=="svg"?r="http://www.w3.org/2000/svg":T=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((E=i[f])&&"setAttribute"in E==!!T&&(T?E.localName==T:E.nodeType==3)){t=E,i[f]=null;break}}if(t==null){if(T==null)return document.createTextNode(M);t=document.createElementNS(r,T,M.is&&M),s&&(xo.__m&&xo.__m(e,i),s=!1),i=null}if(T==null)S===M||s&&t.data==M||(t.data=M);else{if(i=i&&V1.call(t.childNodes),!s&&i!=null)for(S={},f=0;f<t.attributes.length;f++)S[(E=t.attributes[f]).name]=E.value;for(f in S)E=S[f],f=="dangerouslySetInnerHTML"?v=E:f=="children"||f in M||f=="value"&&"defaultValue"in M||f=="checked"&&"defaultChecked"in M||f0(t,f,null,E,r);for(f in M)E=M[f],f=="children"?_=E:f=="dangerouslySetInnerHTML"?h=E:f=="value"?O=E:f=="checked"?w=E:s&&typeof E!="function"||S[f]===E||f0(t,f,E,S[f],r);if(h)s||v&&(h.__html==v.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(v&&(t.innerHTML=""),O3(e.type=="template"?t.content:t,eb(_)?_:[_],e,n,o,T=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&Lm(n,0),s,l),i!=null)for(f=i.length;f--;)mM(i[f]);s||(f="value",T=="progress"&&O==null?t.removeAttribute("value"):O!=null&&(O!==t[f]||T=="progress"&&!O||T=="option"&&O!=S[f])&&f0(t,f,O,S[f],r),f="checked",w!=null&&w!=t[f]&&f0(t,f,w,S[f],r))}return t}function _M(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){xo.__e(r,n)}}function T3(t,e,n){var o,r;if(xo.unmount&&xo.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||_M(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){xo.__e(i,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&T3(o[r],e,n||typeof t.type!="function");n||mM(t.__e),t.__c=t.__=t.__e=void 0}function Xq(t,e,n){return this.constructor(t,n)}function Yq(t,e,n){var o,r,i,a;e==document&&(e=document.documentElement),xo.__&&xo.__(t,e),r=(o=!1)?null:e.__k,i=[],a=[],yM(e,t=e.__k=Lr(jm,null,[t]),r||yw,yw,e.namespaceURI,r?null:e.firstChild?V1.call(e.childNodes):null,i,r?r.__e:e.firstChild,o,a),A3(i,t,a)}V1=_w.slice,xo={__e:function(t,e,n,o){for(var r,i,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(t)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),a=r.__d),a)return r.__E=r}catch(s){t=s}throw t}},_3=0,ko.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=op({},this.state),typeof t=="function"&&(t=t(op({},n),this.props)),t&&op(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Sk(this))},ko.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sk(this))},ko.prototype.render=jm,Iv=[],b3=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,w3=function(t,e){return t.__v.__b-e.__v.__b},bw.__r=0,E3=/(PointerCapture)$|Capture$/i,gM=0,EA=Mk(!1),xA=Mk(!0);var qq="An invariant failed, however the error is obfuscated because this is a production build.",Ew=[];Object.freeze(Ew);var bM={};Object.freeze(bM);function Hs(){return++_r.mobxGuid}function Qo(t){throw Wv(!1,t),"X"}function Wv(t,e){if(!t)throw new Error("[mobx] "+(e||qq))}function C3(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var p0=function(){};function Kq(t){var e=[];return t.forEach(function(n){e.indexOf(n)===-1&&e.push(n)}),e}function wM(t){return t!==null&&typeof t=="object"}function ry(t){if(t===null||typeof t!="object")return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Zq(t){if(iy(t)||Ys(t))return t;if(Array.isArray(t))return new Map(t);if(ry(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return Qo("Cannot convert to map from '"+t+"'")}function oy(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Jq(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Qq(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||n.configurable!==!1&&n.writable!==!1}function jh(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(o){return wM(o)&&o[n]===!0}}function iy(t){return t instanceof Map}function tb(t){return t instanceof Set}function N3(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach(function(o){Object.getOwnPropertyDescriptor(t,o).enumerable&&e.add(o)}),Array.from(e)}function _h(t){return t&&t.toString?t.toString():new String(t).toString()}function k3(t){return t===null?null:typeof t=="object"?""+t:t}var eK=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,eo=Symbol("mobx administration"),ay=(function(){function t(e){e===void 0&&(e="Atom@"+Hs()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ii.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.reportObserved=function(){return V3(this)},t.prototype.reportChanged=function(){Kc(),EK(this),Zc()},t.prototype.toString=function(){return this.name},t})(),EM=jh("Atom",ay);function xM(t,e,n){e===void 0&&(e=p0),n===void 0&&(n=p0);var o=new ay(t);return e!==p0&&jK(o,e),n!==p0&&Y3(o,n),o}function tK(t,e){return oI(t,e)}function nK(t,e){return Object.is(t,e)}var Im={structural:tK,default:nK};/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var SA=function(t,e){return SA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)o.hasOwnProperty(r)&&(n[r]=o[r])},SA(t,e)};function rK(t,e){SA(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var xw=function(){return xw=Object.assign||function(e){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xw.apply(this,arguments)};function Vd(t){var e=typeof Symbol=="function"&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function _m(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function OM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_m(arguments[e]));return t}var Ow=Symbol("mobx did run lazy initializers"),Gy=Symbol("mobx pending decorators"),oK={},iK={};function aK(t,e){var n=e?oK:iK;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return qv(this),this[t]},set:function(o){qv(this),this[t]=o}})}function qv(t){var e,n;if(t[Ow]!==!0){var o=t[Gy];if(o){oy(t,Ow,!0);var r=OM(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=Vd(r),a=i.next();!a.done;a=i.next()){var s=a.value,l=o[s];l.propertyCreator(t,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function P3(t,e){return function(){var o,r=function(a,s,l,f){if(f===!0)return e(a,s,l,a,o),null;if(!Object.prototype.hasOwnProperty.call(a,Gy)){var h=a[Gy];oy(a,Gy,xw({},h))}return a[Gy][s]={prop:s,propertyCreator:e,descriptor:l,decoratorTarget:a,decoratorArguments:o},aK(s,t)};return lK(arguments)?(o=Ew,r.apply(null,arguments)):(o=Array.prototype.slice.call(arguments),r)}}function lK(t){return(t.length===2||t.length===3)&&(typeof t[1]=="string"||typeof t[1]=="symbol")||t.length===4&&t[3]===!0}function nb(t,e,n){return Um(t)?t:Array.isArray(t)?Ut.array(t,{name:n}):ry(t)?Ut.object(t,void 0,{name:n}):iy(t)?Ut.map(t,{name:n}):tb(t)?Ut.set(t,{name:n}):t}function sK(t,e,n){return t==null||rd(t)||tf(t)||Ys(t)||oc(t)?t:Array.isArray(t)?Ut.array(t,{name:n,deep:!1}):ry(t)?Ut.object(t,void 0,{name:n,deep:!1}):iy(t)?Ut.map(t,{name:n,deep:!1}):tb(t)?Ut.set(t,{name:n,deep:!1}):Qo(!1)}function G1(t){return t}function uK(t,e,n){return oI(t,e)?e:t}function z1(t){Wv(t);var e=P3(!0,function(o,r,i,a,s){var l=i?i.initializer?i.initializer.call(o):i.value:void 0;CM(o).addObservableProp(r,l,t)}),n=e;return n.enhancer=t,n}var R3={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(R3);function pm(t){return t==null?R3:typeof t=="string"?{name:t,deep:!0,proxy:!0}:t}var SM=z1(nb),cK=z1(sK),D3=z1(G1),dK=z1(uK);function h0(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?G1:nb}function fK(t,e,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return SM.apply(null,arguments);if(Um(t))return t;var o=ry(t)?Ut.object(t,e,n):Array.isArray(t)?Ut.array(t,e):iy(t)?Ut.map(t,e):tb(t)?Ut.set(t,e):t;if(o!==t)return o;Qo(!1)}var Tk={box:function(t,e){arguments.length>2&&Ly("box");var n=pm(e);return new zv(t,h0(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ly("array");var n=pm(e);return KK(t,h0(n),n.name)},map:function(t,e){arguments.length>2&&Ly("map");var n=pm(e);return new TM(t,h0(n),n.name)},set:function(t,e){arguments.length>2&&Ly("set");var n=pm(e);return new nI(t,h0(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ly("object");var o=pm(n);if(o.proxy===!1)return kA({},t,e,o);var r=K3(o),i=kA({},void 0,void 0,o),a=XK(i);return Z3(a,t,e,r),a},ref:D3,shallow:cK,deep:SM,struct:dK},Ut=fK;Object.keys(Tk).forEach(function(t){return Ut[t]=Tk[t]});function Ly(t){Qo("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var Sw=P3(!1,function(t,e,n,o,r){var i=n.get,a=n.set,s=r[0]||{};CM(t).addComputedProp(t,e,xw({get:i,set:a,context:t},s))}),pK=Sw({equals:Im.structural}),Ai=function(e,n,o){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Sw.apply(null,arguments);var r=typeof n=="object"?n:{};return r.get=e,r.set=typeof n=="function"?n:r.set,r.name=r.name||e.name||"",new Bm(r)};Ai.struct=pK;var ii;(function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"})(ii||(ii={}));var Wd;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Wd||(Wd={}));var Aw=(function(){function t(e){this.cause=e}return t})();function zy(t){return t instanceof Aw}function AA(t){switch(t.dependenciesState){case ii.UP_TO_DATE:return!1;case ii.NOT_TRACKING:case ii.STALE:return!0;case ii.POSSIBLY_STALE:{for(var e=AM(!0),n=ly(),o=t.observing,r=o.length,i=0;i<r;i++){var a=o[i];if($m(a)){if(_r.disableErrorBoundaries)a.get();else try{a.get()}catch{return Eh(n),e_(e),!0}if(t.dependenciesState===ii.STALE)return Eh(n),e_(e),!0}}return I3(t),Eh(n),e_(e),!1}}}function Fm(t){var e=t.observers.size>0;_r.computationDepth>0&&e&&Qo(!1),!_r.allowStateChanges&&(e||_r.enforceActions==="strict")&&Qo(!1)}function j3(t,e,n){var o=AM(!0);I3(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++_r.runId;var r=_r.trackingDerivation;_r.trackingDerivation=t;var i;if(_r.disableErrorBoundaries===!0)i=e.call(n);else try{i=e.call(n)}catch(a){i=new Aw(a)}return _r.trackingDerivation=r,hK(t),e_(o),i}function hK(t){for(var e=t.observing,n=t.observing=t.newObserving,o=ii.UP_TO_DATE,r=0,i=t.unboundDepsCount,a=0;a<i;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,r!==a&&(n[r]=s),r++),s.dependenciesState>o&&(o=s.dependenciesState)}for(n.length=r,t.newObserving=null,i=e.length;i--;){var s=e[i];s.diffValue===0&&$3(s,t),s.diffValue=0}for(;r--;){var s=n[r];s.diffValue===1&&(s.diffValue=0,wK(s,t))}o!==ii.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}function MA(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)$3(e[n],t);t.dependenciesState=ii.NOT_TRACKING}function L3(t){var e=ly();try{return t()}finally{Eh(e)}}function ly(){var t=_r.trackingDerivation;return _r.trackingDerivation=null,t}function Eh(t){_r.trackingDerivation=t}function AM(t){var e=_r.allowStateReads;return _r.allowStateReads=t,e}function e_(t){_r.allowStateReads=t}function I3(t){if(t.dependenciesState!==ii.UP_TO_DATE){t.dependenciesState=ii.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=ii.UP_TO_DATE}}var Mw=0,vK=1,Ck=Object.getOwnPropertyDescriptor(function(){},"name");Ck&&Ck.configurable;function Gv(t,e,n){var o=function(){return F3(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function F3(t,e,n,o){var r=gK();try{return e.apply(n,o)}catch(i){throw r.error=i,i}finally{mK(r)}}function gK(t,e,n){var o=Zu(),r=0,i=ly();Kc();var a=H1(!0),s=AM(!0),l={prevDerivation:i,prevAllowStateChanges:a,prevAllowStateReads:s,notifySpy:o,startTime:r,actionId:vK++,parentActionId:Mw};return Mw=l.actionId,l}function mK(t){Mw!==t.actionId&&Qo("invalid action stack. did you forget to finish an action?"),Mw=t.parentActionId,t.error!==void 0&&(_r.suppressReactionErrors=!0),X1(t.prevAllowStateChanges),e_(t.prevAllowStateReads),Zc(),Eh(t.prevDerivation),_r.suppressReactionErrors=!1}function H1(t){var e=_r.allowStateChanges;return _r.allowStateChanges=t,e}function X1(t){_r.allowStateChanges=t}var zv=(function(t){rK(e,t);function e(n,o,r,i,a){r===void 0&&(r="ObservableValue@"+Hs()),a===void 0&&(a=Im.default);var s=t.call(this,r)||this;return s.enhancer=o,s.name=r,s.equals=a,s.hasUnreportedChange=!1,s.value=o(n,void 0,r),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){this.value,n=this.prepareNewValue(n),n!==_r.UNCHANGED&&this.setNewValue(n)},e.prototype.prepareNewValue=function(n){if(Fm(this),Gd(this)){var o=zd(this,{object:this,type:"update",newValue:n});if(!o)return _r.UNCHANGED;n=o.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?_r.UNCHANGED:n},e.prototype.setNewValue=function(n){var o=this.value;this.value=n,this.reportChanged(),Jc(this)&&Qc(this,{type:"update",object:this,newValue:n,oldValue:o})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return rb(this,n)},e.prototype.observe=function(n,o){return o&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),ob(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return k3(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(ay),yK=jh("ObservableValue",zv),Bm=(function(){function t(e){this.dependenciesState=ii.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ii.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Hs(),this.value=new Aw(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Wd.NONE,Wv(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+Hs(),e.set&&(this.setter=Gv(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Im.structural:Im.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){OK(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},t.prototype.get=function(){this.isComputing&&Qo("Cycle detected in computation "+this.name+": "+this.derivation),_r.inBatch===0&&this.observers.size===0&&!this.keepAlive?AA(this)&&(this.warnAboutUntrackedRead(),Kc(),this.value=this.computeValue(!1),Zc()):(V3(this),AA(this)&&this.trackAndCompute()&&xK(this));var e=this.value;if(zy(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(zy(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Wv(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Wv(!1,!1)},t.prototype.trackAndCompute=function(){var e=this.value,n=this.dependenciesState===ii.NOT_TRACKING,o=this.computeValue(!0),r=n||zy(e)||zy(o)||!this.equals(e,o);return r&&(this.value=o),r},t.prototype.computeValue=function(e){this.isComputing=!0,_r.computationDepth++;var n;if(e)n=j3(this,this.derivation,this.scope);else if(_r.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(o){n=new Aw(o)}return _r.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(MA(this),this.value=void 0)},t.prototype.observe=function(e,n){var o=this,r=!0,i=void 0;return PK(function(){var a=o.get();if(!r||n){var s=ly();e({type:"update",object:o,newValue:a,oldValue:i}),Eh(s)}r=!1,i=a})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return k3(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(),$m=jh("ComputedValue",Bm),Y0=(function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t})(),_K={};function TA(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_K}var q0=!0,B3=!1,_r=(function(){var t=TA();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(q0=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Y0().version&&(q0=!1),q0?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Y0):(setTimeout(function(){B3||Qo("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Y0)})();function bK(){(_r.pendingReactions.length||_r.inBatch||_r.isRunningReactions)&&Qo("isolateGlobalState should be called before MobX is running any reactions"),B3=!0,q0&&(--TA().__mobxInstanceCount===0&&(TA().__mobxGlobals=void 0),_r=new Y0)}function CA(){return _r}function wK(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function $3(t,e){t.observers.delete(e),t.observers.size===0&&U3(t)}function U3(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,_r.pendingUnobservations.push(t))}function Kc(){_r.inBatch++}function Zc(){if(--_r.inBatch===0){z3();for(var t=_r.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Bm&&n.suspend())}_r.pendingUnobservations=[]}}function V3(t){var e=_r.trackingDerivation;return e!==null?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(t.observers.size===0&&_r.inBatch>0&&U3(t),!1)}function EK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.isTracing!==Wd.NONE&&W3(e,t),e.onBecomeStale()),e.dependenciesState=ii.STALE}))}function xK(t){t.lowestObserverState!==ii.STALE&&(t.lowestObserverState=ii.STALE,t.observers.forEach(function(e){e.dependenciesState===ii.POSSIBLY_STALE?e.dependenciesState=ii.STALE:e.dependenciesState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.UP_TO_DATE)}))}function OK(t){t.lowestObserverState===ii.UP_TO_DATE&&(t.lowestObserverState=ii.POSSIBLY_STALE,t.observers.forEach(function(e){e.dependenciesState===ii.UP_TO_DATE&&(e.dependenciesState=ii.POSSIBLY_STALE,e.isTracing!==Wd.NONE&&W3(e,t),e.onBecomeStale())}))}function W3(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Wd.BREAK){var n=[];G3(IK(t),n,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+t.name+`'
|
||
|
||
You are entering this break point because derivation '`+t.name+"' is being traced and '"+e.name+`' is now forcing it to update.
|
||
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
||
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
||
|
||
`+(t instanceof Bm?t.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+n.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function G3(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(o){return G3(o,e,n+1)})}var A_=(function(){function t(e,n,o,r){e===void 0&&(e="Reaction@"+Hs()),r===void 0&&(r=!1),this.name=e,this.onInvalidate=n,this.errorHandler=o,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=ii.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Hs(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Wd.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,_r.pendingReactions.push(this),z3())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Kc(),this._isScheduled=!1,AA(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Zu()}catch(e){this.reportExceptionInDerivation(e)}}Zc()}},t.prototype.track=function(e){if(!this.isDisposed){Kc(),this._isRunning=!0;var n=j3(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&MA(this),zy(n)&&this.reportExceptionInDerivation(n.cause),Zc()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(_r.disableErrorBoundaries)throw e;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";_r.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(o,e),_r.globalReactionErrorHandlers.forEach(function(r){return r(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Kc(),MA(this),Zc()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[eo]=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),GK(this,e)},t})(),Nk=100,NA=function(t){return t()};function z3(){_r.inBatch>0||_r.isRunningReactions||NA(SK)}function SK(){_r.isRunningReactions=!0;for(var t=_r.pendingReactions,e=0;t.length>0;){++e===Nk&&(console.error("Reaction doesn't converge to a stable state after "+Nk+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),o=0,r=n.length;o<r;o++)n[o].runReaction()}_r.isRunningReactions=!1}var Tw=jh("Reaction",A_);function AK(t){var e=NA;NA=function(n){return t(function(){return e(n)})}}function Zu(){return!1}function MK(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function TK(){Qo(!1)}function kk(t){return function(e,n,o){if(o){if(o.value)return{value:Gv(t,o.value),enumerable:!1,configurable:!0,writable:!0};var r=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Gv(t,r.call(this))}}}return CK(t).apply(this,arguments)}}function CK(t){return function(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(r){oy(this,n,Bt(t,r))}})}}function NK(t,e,n,o){return o===!0?(ZO(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ZO(this,e,n.value||n.initializer.call(this)),this[e]},set:TK}:{enumerable:!1,configurable:!0,set:function(r){ZO(this,e,r)},get:function(){}}}var Bt=function(e,n,o,r){if(arguments.length===1&&typeof e=="function")return Gv(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof n=="function")return Gv(e,n);if(arguments.length===1&&typeof e=="string")return kk(e);if(r===!0)oy(e,n,Gv(e.name||n,o.value,this));else return kk(n).apply(null,arguments)};Bt.bound=NK;function kK(t,e){var n=typeof t=="string"?t:t.name||"<unnamed action>",o=typeof t=="function"?t:e;return F3(n,o,this,void 0)}function ZO(t,e,n){oy(t,e,Gv(e,n.bind(t)))}function PK(t,e){e===void 0&&(e=bM);var n=e&&e.name||t.name||"Autorun@"+Hs(),o=!e.scheduler&&!e.delay,r;if(o)r=new A_(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var i=H3(e),a=!1;r=new A_(n,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(s)}))},e.onError,e.requiresObservable)}function s(){t(r)}return r.schedule(),r.getDisposer()}var RK=function(t){return t()};function H3(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:RK}function X3(t,e,n){n===void 0&&(n=bM);var o=n.name||"Reaction@"+Hs(),r=Bt(o,n.onError?DK(n.onError,e):e),i=!n.scheduler&&!n.delay,a=H3(n),s=!0,l=!1,f,h=n.compareStructural?Im.structural:n.equals||Im.default,v=new A_(o,function(){s||i?_():l||(l=!0,a(_))},n.onError,n.requiresObservable);function _(){if(l=!1,!v.isDisposed){var E=!1;v.track(function(){var O=t(v);E=s||!h(f,O),f=O}),s&&n.fireImmediately&&r(f,v),!s&&E===!0&&r(f,v),s&&(s=!1)}}return v.schedule(),v.getDisposer()}function DK(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function jK(t,e,n){return q3("onBecomeObserved",t,e)}function Y3(t,e,n){return q3("onBecomeUnobserved",t,e)}function q3(t,e,n,o){var r=Th(e),i=n,a=t+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var s=r[t];return typeof s!="function"?Qo(!1):function(){var l=r[a];l&&(l.delete(i),l.size===0&&delete r[a])}}function LK(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,r=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(bK(),e!==void 0){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:Qo("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}_r.enforceActions=l,_r.allowStateChanges=!(l===!0||l==="strict")}n!==void 0&&(_r.computedRequiresReaction=!!n),a!==void 0&&(_r.reactionRequiresObservable=!!a),s!==void 0&&(_r.observableRequiresReaction=!!s,_r.allowStateReads=!_r.observableRequiresReaction),o!==void 0&&(_r.computedConfigurable=!!o),r!==void 0&&(r===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),_r.disableErrorBoundaries=!!r),i&&AK(i)}function kA(t,e,n,o){o=pm(o);var r=K3(o);return qv(t),CM(t,o.name,r.enhancer),e&&Z3(t,e,n,r),t}function K3(t){return t.defaultDecorator||(t.deep===!1?D3:SM)}function Z3(t,e,n,o){var r,i,a,s,l;Kc();try{var a=eK(e);try{for(var f=Vd(a),h=f.next();!h.done;h=f.next()){var l=h.value,v=Object.getOwnPropertyDescriptor(e,l),_=n&&l in n?n[l]:v.get?Sw:o,E=_(t,l,v,!0);E&&Object.defineProperty(t,l,E)}}catch(w){r={error:w}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}finally{Zc()}}function IK(t,e){return J3(Th(t,e))}function J3(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=Kq(t.observing).map(J3)),e}function Q3(t,e){if(t==null)return!1;if(e!==void 0){if(rd(t)===!1||!t[eo].values.has(e))return!1;var n=Th(t,e);return $m(n)}return $m(t)}function FK(t){return arguments.length>1?Qo(!1):Q3(t)}function Pk(t,e){return typeof e!="string"?Qo(!1):Q3(t,e)}function BK(t,e){return t==null?!1:rd(t)||!!t[eo]||EM(t)||Tw(t)||$m(t)}function Um(t){return arguments.length!==1&&Qo(!1),BK(t)}function Vm(t){return rd(t)?t[eo].getKeys():Ys(t)||oc(t)?Array.from(t.keys()):tf(t)?t.map(function(e,n){return n}):Qo(!1)}function $K(t){return rd(t)?Vm(t).map(function(e){return t[e]}):Ys(t)?Vm(t).map(function(e){return t.get(e)}):oc(t)?Array.from(t.values()):tf(t)?t.slice():Qo(!1)}function UK(t){return rd(t)?Vm(t).map(function(e){return[e,t[e]]}):Ys(t)?Vm(t).map(function(e){return[e,t.get(e)]}):oc(t)?Array.from(t.entries()):tf(t)?t.map(function(e,n){return[n,e]}):Qo(!1)}function MM(t,e,n){if(arguments.length===2&&!oc(t)){Kc();var o=e;try{for(var r in o)MM(t,r,o[r])}finally{Zc()}return}if(rd(t)){var i=t[eo],a=i.values.get(e);a?i.write(e,n):i.addObservableProp(e,n,i.defaultEnhancer)}else if(Ys(t))t.set(e,n);else if(oc(t))t.add(e);else if(tf(t))typeof e!="number"&&(e=parseInt(e,10)),Wv(e>=0,"Not a valid index: '"+e+"'"),Kc(),e>=t.length&&(t.length=e+1),t[e]=n,Zc();else return Qo(!1)}function eI(t,e,n,o){return VK(t,e,n)}function VK(t,e,n){return Y1(t).observe(e,n)}var WK={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function tm(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function fh(t,e,n){if(!e.recurseEverything&&!Um(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yK(t))return fh(t.get(),e,n);Um(t)&&Vm(t);var o=e.detectCycles===!0;if(o&&t!==null&&n.has(t))return n.get(t);if(tf(t)||Array.isArray(t)){var r=tm(n,t,[],e),i=t.map(function(E){return fh(E,e,n)});r.length=i.length;for(var a=0,s=i.length;a<s;a++)r[a]=i[a];return r}if(oc(t)||Object.getPrototypeOf(t)===Set.prototype)if(e.exportMapsAsObjects===!1){var l=tm(n,t,new Set,e);return t.forEach(function(E){l.add(fh(E,e,n))}),l}else{var f=tm(n,t,[],e);return t.forEach(function(E){f.push(fh(E,e,n))}),f}if(Ys(t)||Object.getPrototypeOf(t)===Map.prototype)if(e.exportMapsAsObjects===!1){var h=tm(n,t,new Map,e);return t.forEach(function(E,O){h.set(O,fh(E,e,n))}),h}else{var v=tm(n,t,{},e);return t.forEach(function(E,O){v[O]=fh(E,e,n)}),v}var _=tm(n,t,{},e);return N3(t).forEach(function(E){_[E]=fh(t[E],e,n)}),_}function Hc(t,e){typeof e=="boolean"&&(e={detectCycles:e}),e||(e=WK),e.detectCycles=e.detectCycles===void 0?e.recurseEverything===!0:e.detectCycles===!0;var n;return e.detectCycles&&(n=new Map),fh(t,e,n)}function GK(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;typeof t[t.length-1]=="boolean"&&(n=t.pop());var o=zK(t);if(!o)return Qo(!1);o.isTracing===Wd.NONE&&console.log("[mobx.trace] '"+o.name+"' tracing enabled"),o.isTracing=n?Wd.BREAK:Wd.LOG}function zK(t){switch(t.length){case 0:return _r.trackingDerivation;case 1:return Th(t[0]);case 2:return Th(t[0],t[1])}}function Yc(t,e){e===void 0&&(e=void 0),Kc();try{return t.apply(e)}finally{Zc()}}function v0(t){return t[eo]}function g0(t){return typeof t=="string"||typeof t=="number"||typeof t=="symbol"}var HK={has:function(t,e){if(e===eo||e==="constructor"||e===Ow)return!0;var n=v0(t);return g0(e)?n.has(e):e in t},get:function(t,e){if(e===eo||e==="constructor"||e===Ow)return t[e];var n=v0(t),o=n.values.get(e);if(o instanceof ay){var r=o.get();return r===void 0&&n.has(e),r}return g0(e)&&n.has(e),t[e]},set:function(t,e,n){return g0(e)?(MM(t,e,n),!0):!1},deleteProperty:function(t,e){if(!g0(e))return!1;var n=v0(t);return n.remove(e),!0},ownKeys:function(t){var e=v0(t);return e.keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return Qo("Dynamic observable objects cannot be frozen"),!1}};function XK(t){var e=new Proxy(t,HK);return t[eo].proxy=e,e}function Gd(t){return t.interceptors!==void 0&&t.interceptors.length>0}function rb(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),C3(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function zd(t,e){var n=ly();try{for(var o=OM(t.interceptors||[]),r=0,i=o.length;r<i&&(e=o[r](e),Wv(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);r++);return e}finally{Eh(n)}}function Jc(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function ob(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),C3(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function Qc(t,e){var n=ly(),o=t.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r<i;r++)o[r](e);Eh(n)}}var YK=1e4,qK={get:function(t,e){return e===eo?t[eo]:e==="length"?t[eo].getArrayLength():typeof e=="number"?rp.get.call(t,e):typeof e=="string"&&!isNaN(e)?rp.get.call(t,parseInt(e)):rp.hasOwnProperty(e)?rp[e]:t[e]},set:function(t,e,n){return e==="length"&&t[eo].setArrayLength(n),typeof e=="number"&&rp.set.call(t,e,n),typeof e=="symbol"||isNaN(e)?t[e]=n:rp.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return Qo("Observable arrays cannot be frozen"),!1}};function KK(t,e,n,o){n===void 0&&(n="ObservableArray@"+Hs()),o===void 0&&(o=!1);var r=new tI(n,e,o);Jq(r.values,eo,r);var i=new Proxy(r.values,qK);if(r.proxy=i,t&&t.length){var a=H1(!0);r.spliceWithArray(0,0,t),X1(a)}return i}var tI=(function(){function t(e,n,o){this.owned=o,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new ay(e||"ObservableArray@"+Hs()),this.enhancer=function(r,i){return n(r,i,e+"[..]")}}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),ob(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var o=new Array(e-n),r=0;r<e-n;r++)o[r]=void 0;this.spliceWithArray(n,0,o)}else this.spliceWithArray(e,n-e)},t.prototype.updateArrayLength=function(e,n){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=n},t.prototype.spliceWithArray=function(e,n,o){var r=this;Fm(this.atom);var i=this.values.length;if(e===void 0?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),arguments.length===1?n=i-e:n==null?n=0:n=Math.max(0,Math.min(n,i-e)),o===void 0&&(o=Ew),Gd(this)){var a=zd(this,{object:this.proxy,type:"splice",index:e,removedCount:n,added:o});if(!a)return Ew;n=a.removedCount,o=a.added}o=o.length===0?o:o.map(function(l){return r.enhancer(l,void 0)});var s=this.spliceItemsIntoValues(e,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice(e,o,s),this.dehanceValues(s)},t.prototype.spliceItemsIntoValues=function(e,n,o){var r;if(o.length<YK)return(r=this.values).splice.apply(r,OM([e,n],o));var i=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(o,this.values.slice(e+n)),i},t.prototype.notifyArrayChildUpdate=function(e,n,o){var r=!this.owned&&Zu(),i=Jc(this),a=i||r?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:o}:null;this.atom.reportChanged(),i&&Qc(this,a)},t.prototype.notifyArraySplice=function(e,n,o){var r=!this.owned&&Zu(),i=Jc(this),a=i||r?{object:this.proxy,type:"splice",index:e,removed:o,added:n,removedCount:o.length,addedCount:n.length}:null;this.atom.reportChanged(),i&&Qc(this,a)},t})(),rp={intercept:function(t){return this[eo].intercept(t)},observe:function(t,e){e===void 0&&(e=!1);var n=this[eo];return n.observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[eo];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=this[eo];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray(t);case 2:return r.spliceWithArray(t,e)}return r.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){var o=this[eo];return o.spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[eo];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[eo].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[eo];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[eo],n=e.dehanceValues(e.values).indexOf(t);return n>-1?(this.splice(n,1),!0):!1},get:function(t){var e=this[eo];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[eo],o=n.values;if(t<o.length){Fm(n.atom);var r=o[t];if(Gd(n)){var i=zd(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}e=n.enhancer(e,r);var a=e!==r;a&&(o[t]=e,n.notifyArrayChildUpdate(t,e,r))}else if(t===o.length)n.spliceWithArray(t,0,[e]);else throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+o.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(t){typeof Array.prototype[t]=="function"&&(rp[t]=function(){var e=this[eo];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})});["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(t){typeof Array.prototype[t]=="function"&&(rp[t]=function(e,n){var o=this,r=this[eo];r.atom.reportObserved();var i=r.dehanceValues(r.values);return i[t](function(a,s){return e.call(n,a,s,o)},n)})});["reduce","reduceRight"].forEach(function(t){rp[t]=function(){var e=this,n=this[eo];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(r,i,a){return i=n.dehanceValue(i),o(r,i,a,e)},n.values[t].apply(n.values,arguments)}});var ZK=jh("ObservableArrayAdministration",tI);function tf(t){return wM(t)&&ZK(t[eo])}var Rk,JK={},TM=(function(){function t(e,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableMap@"+Hs()),this.enhancer=n,this.name=o,this[Rk]=JK,this._keysAtom=xM(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return t.prototype._has=function(e){return this._data.has(e)},t.prototype.has=function(e){var n=this;if(!_r.trackingDerivation)return this._has(e);var o=this._hasMap.get(e);if(!o){var r=o=new zv(this._has(e),G1,this.name+"."+_h(e)+"?",!1);this._hasMap.set(e,r),Y3(r,function(){return n._hasMap.delete(e)})}return o.get()},t.prototype.set=function(e,n){var o=this._has(e);if(Gd(this)){var r=zd(this,{type:o?"update":"add",object:this,newValue:n,name:e});if(!r)return this;n=r.newValue}return o?this._updateValue(e,n):this._addValue(e,n),this},t.prototype.delete=function(e){var n=this;if(Fm(this._keysAtom),Gd(this)){var o=zd(this,{type:"delete",object:this,name:e});if(!o)return!1}if(this._has(e)){var r=Zu(),i=Jc(this),o=i||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return Yc(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(e,!1);var s=n._data.get(e);s.setNewValue(void 0),n._data.delete(e)}),i&&Qc(this,o),!0}return!1},t.prototype._updateHasMapEntry=function(e,n){var o=this._hasMap.get(e);o&&o.setNewValue(n)},t.prototype._updateValue=function(e,n){var o=this._data.get(e);if(n=o.prepareNewValue(n),n!==_r.UNCHANGED){var r=Zu(),i=Jc(this),a=i||r?{type:"update",object:this,oldValue:o.value,name:e,newValue:n}:null;o.setNewValue(n),i&&Qc(this,a)}},t.prototype._addValue=function(e,n){var o=this;Fm(this._keysAtom),Yc(function(){var s=new zv(n,o.enhancer,o.name+"."+_h(e),!1);o._data.set(e,s),n=s.value,o._updateHasMapEntry(e,!0),o._keysAtom.reportChanged()});var r=Zu(),i=Jc(this),a=i||r?{type:"add",object:this,name:e,newValue:n}:null;i&&Qc(this,a)},t.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var e=this,n=this.keys();return Cw({next:function(){var o=n.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:e.get(i)}}})},t.prototype.entries=function(){var e=this,n=this.keys();return Cw({next:function(){var o=n.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:[i,e.get(i)]}}})},t.prototype[Rk=eo,Symbol.iterator]=function(){return this.entries()},t.prototype.forEach=function(e,n){var o,r;try{for(var i=Vd(this),a=i.next();!a.done;a=i.next()){var s=_m(a.value,2),l=s[0],f=s[1];e.call(n,f,l,this)}}catch(h){o={error:h}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},t.prototype.merge=function(e){var n=this;return Ys(e)&&(e=e.toJS()),Yc(function(){var o=H1(!0);try{ry(e)?N3(e).forEach(function(r){return n.set(r,e[r])}):Array.isArray(e)?e.forEach(function(r){var i=_m(r,2),a=i[0],s=i[1];return n.set(a,s)}):iy(e)?(e.constructor!==Map&&Qo("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach(function(r,i){return n.set(i,r)})):e!=null&&Qo("Cannot initialize map from "+e)}finally{X1(o)}}),this},t.prototype.clear=function(){var e=this;Yc(function(){L3(function(){var n,o;try{for(var r=Vd(e.keys()),i=r.next();!i.done;i=r.next()){var a=i.value;e.delete(a)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}})})},t.prototype.replace=function(e){var n=this;return Yc(function(){var o,r,i,a,s=Zq(e),l=new Map,f=!1;try{for(var h=Vd(n._data.keys()),v=h.next();!v.done;v=h.next()){var _=v.value;if(!s.has(_)){var E=n.delete(_);if(E)f=!0;else{var O=n._data.get(_);l.set(_,O)}}}}catch(F){o={error:F}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}try{for(var w=Vd(s.entries()),S=w.next();!S.done;S=w.next()){var M=_m(S.value,2),_=M[0],O=M[1],T=n._data.has(_);if(n.set(_,O),n._data.has(_)){var B=n._data.get(_);l.set(_,B),T||(f=!0)}}}catch(F){i={error:F}}finally{try{S&&!S.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}if(!f)if(n._data.size!==l.size)n._keysAtom.reportChanged();else for(var R=n._data.keys(),P=l.keys(),$=R.next(),I=P.next();!$.done;){if($.value!==I.value){n._keysAtom.reportChanged();break}$=R.next(),I=P.next()}n._data=l}),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var e,n,o={};try{for(var r=Vd(this),i=r.next();!i.done;i=r.next()){var a=_m(i.value,2),s=a[0],l=a[1];o[typeof s=="symbol"?s:_h(s)]=l}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map(function(n){return _h(n)+": "+(""+e.get(n))}).join(", ")+" }]"},t.prototype.observe=function(e,n){return ob(this,e)},t.prototype.intercept=function(e){return rb(this,e)},t})(),Ys=jh("ObservableMap",TM),Dk,QK={},nI=(function(){function t(e,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableSet@"+Hs()),this.name=o,this[Dk]=QK,this._data=new Set,this._atom=xM(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(r,i){return n(r,i,o)},e&&this.replace(e)}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.clear=function(){var e=this;Yc(function(){L3(function(){var n,o;try{for(var r=Vd(e._data.values()),i=r.next();!i.done;i=r.next()){var a=i.value;e.delete(a)}}catch(s){n={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}})})},t.prototype.forEach=function(e,n){var o,r;try{for(var i=Vd(this),a=i.next();!a.done;a=i.next()){var s=a.value;e.call(n,s,s,this)}}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(e){var n=this;if(Fm(this._atom),Gd(this)){var o=zd(this,{type:"add",object:this,newValue:e});if(!o)return this}if(!this.has(e)){Yc(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var r=Zu(),i=Jc(this),o=i||r?{type:"add",object:this,newValue:e}:null;i&&Qc(this,o)}return this},t.prototype.delete=function(e){var n=this;if(Gd(this)){var o=zd(this,{type:"delete",object:this,oldValue:e});if(!o)return!1}if(this.has(e)){var r=Zu(),i=Jc(this),o=i||r?{type:"delete",object:this,oldValue:e}:null;return Yc(function(){n._atom.reportChanged(),n._data.delete(e)}),i&&Qc(this,o),!0}return!1},t.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},t.prototype.entries=function(){var e=0,n=Array.from(this.keys()),o=Array.from(this.values());return Cw({next:function(){var r=e;return e+=1,r<o.length?{value:[n[r],o[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var e=this,n=0,o=Array.from(this._data.values());return Cw({next:function(){return n<o.length?{value:e.dehanceValue(o[n++]),done:!1}:{done:!0}}})},t.prototype.replace=function(e){var n=this;return oc(e)&&(e=e.toJS()),Yc(function(){var o=H1(!0);try{Array.isArray(e)?(n.clear(),e.forEach(function(r){return n.add(r)})):tb(e)?(n.clear(),e.forEach(function(r){return n.add(r)})):e!=null&&Qo("Cannot initialize set from "+e)}finally{X1(o)}}),this},t.prototype.observe=function(e,n){return ob(this,e)},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[Dk=eo,Symbol.iterator]=function(){return this.values()},t})(),oc=jh("ObservableSet",nI),rI=(function(){function t(e,n,o,r){n===void 0&&(n=new Map),this.target=e,this.values=n,this.name=o,this.defaultEnhancer=r,this.keysAtom=new ay(o+".keys")}return t.prototype.read=function(e){return this.values.get(e).get()},t.prototype.write=function(e,n){var o=this.target,r=this.values.get(e);if(r instanceof Bm){r.set(n);return}if(Gd(this)){var i=zd(this,{type:"update",object:this.proxy||o,name:e,newValue:n});if(!i)return;n=i.newValue}if(n=r.prepareNewValue(n),n!==_r.UNCHANGED){var a=Jc(this),s=Zu(),i=a||s?{type:"update",object:this.proxy||o,oldValue:r.value,name:e,newValue:n}:null;r.setNewValue(n),a&&Qc(this,i)}},t.prototype.has=function(e){var n=this.pendingKeys||(this.pendingKeys=new Map),o=n.get(e);if(o)return o.get();var r=!!this.values.get(e);return o=new zv(r,G1,this.name+"."+_h(e)+"?",!1),n.set(e,o),o.get()},t.prototype.addObservableProp=function(e,n,o){o===void 0&&(o=this.defaultEnhancer);var r=this.target;if(Gd(this)){var i=zd(this,{object:this.proxy||r,name:e,type:"add",newValue:n});if(!i)return;n=i.newValue}var a=new zv(n,o,this.name+"."+_h(e),!1);this.values.set(e,a),n=a.value,Object.defineProperty(r,e,eZ(e)),this.notifyPropertyAddition(e,n)},t.prototype.addComputedProp=function(e,n,o){var r=this.target;o.name=o.name||this.name+"."+_h(n),this.values.set(n,new Bm(o)),(e===r||Qq(e,n))&&Object.defineProperty(e,n,tZ(n))},t.prototype.remove=function(e){if(this.values.has(e)){var n=this.target;if(Gd(this)){var o=zd(this,{object:this.proxy||n,name:e,type:"remove"});if(!o)return}try{Kc();var r=Jc(this),i=Zu(),a=this.values.get(e),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var l=this.pendingKeys.get(e);l&&l.set(!1)}delete this.target[e];var o=r||i?{type:"remove",object:this.proxy||n,oldValue:s,name:e}:null;r&&Qc(this,o)}finally{Zc()}}},t.prototype.illegalAccess=function(e,n){console.warn("Property '"+n+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(e,n){return ob(this,e)},t.prototype.intercept=function(e){return rb(this,e)},t.prototype.notifyPropertyAddition=function(e,n){var o=Jc(this),r=Zu(),i=o||r?{type:"add",object:this.proxy||this.target,name:e,newValue:n}:null;if(o&&Qc(this,i),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var e,n;this.keysAtom.reportObserved();var o=[];try{for(var r=Vd(this.values),i=r.next();!i.done;i=r.next()){var a=_m(i.value,2),s=a[0],l=a[1];l instanceof zv&&o.push(s)}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o},t})();function CM(t,e,n){if(e===void 0&&(e=""),n===void 0&&(n=nb),Object.prototype.hasOwnProperty.call(t,eo))return t[eo];ry(t)||(e=(t.constructor.name||"ObservableObject")+"@"+Hs()),e||(e="ObservableObject@"+Hs());var o=new rI(t,new Map,_h(e),n);return oy(t,eo,o),o}var jk=Object.create(null),Lk=Object.create(null);function eZ(t){return jk[t]||(jk[t]={configurable:!0,enumerable:!0,get:function(){return this[eo].read(t)},set:function(e){this[eo].write(t,e)}})}function Ik(t){var e=t[eo];return e||(qv(t),t[eo])}function tZ(t){return Lk[t]||(Lk[t]={configurable:_r.computedConfigurable,enumerable:!1,get:function(){return Ik(this).read(t)},set:function(e){Ik(this).write(t,e)}})}var nZ=jh("ObservableObjectAdministration",rI);function rd(t){return wM(t)?(qv(t),nZ(t[eo])):!1}function Th(t,e){if(typeof t=="object"&&t!==null){if(tf(t))return e!==void 0&&Qo(!1),t[eo].atom;if(oc(t))return t[eo];if(Ys(t)){var n=t;if(e===void 0)return n._keysAtom;var o=n._data.get(e)||n._hasMap.get(e);return o||Qo(!1),o}if(qv(t),e&&!t[eo]&&t[e],rd(t)){if(!e)return Qo(!1);var o=t[eo].values.get(e);return o||Qo(!1),o}if(EM(t)||$m(t)||Tw(t))return t}else if(typeof t=="function"&&Tw(t[eo]))return t[eo];return Qo(!1)}function Y1(t,e){if(t||Qo("Expecting some object"),e!==void 0)return Y1(Th(t,e));if(EM(t)||$m(t)||Tw(t)||Ys(t)||oc(t))return t;if(qv(t),t[eo])return t[eo];Qo(!1)}function rZ(t,e){var n;return e!==void 0?n=Th(t,e):rd(t)||Ys(t)||oc(t)?n=Y1(t):n=Th(t),n.name}var Fk=Object.prototype.toString;function oI(t,e,n){return n===void 0&&(n=-1),PA(t,e,n)}function PA(t,e,n,o,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var i=typeof t;if(i!=="function"&&i!=="object"&&typeof e!="object")return!1;var a=Fk.call(t);if(a!==Fk.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Bk(t),e=Bk(e);var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var l=t.constructor,f=e.constructor;if(l!==f&&!(typeof l=="function"&&l instanceof l&&typeof f=="function"&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),o=o||[],r=r||[];for(var h=o.length;h--;)if(o[h]===t)return r[h]===e;if(o.push(t),r.push(e),s){if(h=t.length,h!==e.length)return!1;for(;h--;)if(!PA(t[h],e[h],n-1,o,r))return!1}else{var v=Object.keys(t),_=void 0;if(h=v.length,Object.keys(e).length!==h)return!1;for(;h--;)if(_=v[h],!(oZ(e,_)&&PA(t[_],e[_],n-1,o,r)))return!1}return o.pop(),r.pop(),!0}function Bk(t){return tf(t)?t.slice():iy(t)||Ys(t)||tb(t)||oc(t)?Array.from(t.entries()):t}function oZ(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Cw(t){return t[Symbol.iterator]=iZ,t}function iZ(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:MK,extras:{getDebugName:rZ},$mobx:eo});function aZ(t){return!(t.prototype&&t.prototype.render)&&!ko.isPrototypeOf(t)}function iI(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.prefix,o=n===void 0?"":n,r=e.suffix,i=r===void 0?"":r,a=t.displayName||t.name||t.constructor&&t.constructor.name||"<component>";return o+a+i}var $k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aI=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},lI=(function(){function t(e,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}})(),sI=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},uI=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Uk=console;function lZ(t){var e=CA().allowStateChanges;return CA().allowStateChanges=t,e}function sZ(t){CA().allowStateChanges=t}function uZ(t,e,n,o,r){var i=lZ(t),a=void 0;try{a=e(n,o,r)}finally{sZ(i)}return a}function Vk(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=t[e],r=cI[e],i=o?n===!0?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;t[e]=i}function Wk(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":$k(t))!=="object"||(typeof e>"u"?"undefined":$k(e))!=="object")return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(e[o]!==t[o])return!0;return!1}var cI={componentWillMount:function(){var e=this,n=iI(this),o=!1,r=!1;function i(v){var _=this[v],E=xM("reactive "+v);Object.defineProperty(this,v,{configurable:!0,enumerable:!0,get:function(){return E.reportObserved(),_},set:function(w){!r&&Wk(_,w)?(_=w,o=!0,E.reportChanged(),o=!1):_=w}})}i.call(this,"props"),i.call(this,"state");var a=this.render.bind(this),s=null,l=!1,f=function(){return s=new A_(n+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var _=!0;try{r=!0,o||ko.prototype.forceUpdate.call(e),_=!1}finally{r=!1,_&&s.dispose()}}}),s.reactComponent=e,h.$mobx=s,e.render=h,h(e.props,e.state,e.context)},h=function(_,E,O){l=!1;var w=void 0,S=void 0;if(s.track(function(){try{S=uZ(!1,a,_,E,O)}catch(M){w=M}}),w)throw w;return S};this.render=f},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,n){return this.state!==n?!0:Wk(this.props,e)}};function NM(t){if(arguments.length>1&&Uk.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),t.isMobxInjector===!0&&Uk.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),aZ(t)){var e,n;return NM((n=e=(function(r){sI(i,r);function i(){return aI(this,i),uI(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return lI(i,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),i})(ko),e.displayName=iI(t),n))}if(!t)throw new Error("Please pass a valid component to 'observer'");var o=t.prototype||t;return cZ(o),t.isMobXReactObserver=!0,t}function cZ(t){Vk(t,"componentWillMount",!0),Vk(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=cI.shouldComponentUpdate)}var dZ=NM(function(t){var e=t.children;return e[0]()});dZ.displayName="Observer";var fZ=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pZ(t,e){return e={exports:{}},t(e,e.exports),e.exports}pZ(function(t,e){(function(n,o){t.exports=o()})(fZ,(function(){var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,f=l&&l(Object);return function h(v,_,E){if(typeof _!="string"){if(f){var O=l(_);O&&O!==f&&h(v,O,E)}var w=i(_);a&&(w=w.concat(a(_)));for(var S=0;S<w.length;++S){var M=w[S];if(!n[M]&&!o[M]&&(!E||!E[M])){var T=s(_,M);try{r(v,M,T)}catch{}}}return v}return v}}))});var Gk={children:!0,key:!0,ref:!0},zk=console;(function(t){sI(e,t);function e(){return aI(this,e),uI(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return lI(e,[{key:"render",value:function(o){var r=o.children;return r.length>1?Lr("div",null," ",r," "):r[0]}},{key:"getChildContext",value:function(){var o={},r=this.context.mobxStores;if(r)for(var i in r)o[i]=r[i];for(var a in this.props)!Gk[a]&&a!=="suppressChangedStoreWarning"&&(o[a]=this.props[a]);return{mobxStores:o}}},{key:"componentWillReceiveProps",value:function(o){if(Object.keys(o).length!==Object.keys(this.props).length&&zk.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!o.suppressChangedStoreWarning)for(var r in o)!Gk[r]&&this.props[r]!==o[r]&&zk.warn("MobX Provider: Provided store '"+r+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e})(ko);if(!ko)throw new Error("mobx-preact requires Preact to be available");var $d,JO,Hk,dI=[],jl=xo,Xk=jl.__b,Yk=jl.__r,qk=jl.diffed,Kk=jl.__c,Zk=jl.unmount,Jk=jl.__;function hZ(){for(var t;t=dI.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(K0),e.__h.some(RA),e.__h=[]}catch(n){e.__h=[],jl.__e(n,t.__v)}}}jl.__b=function(t){$d=null,Xk&&Xk(t)},jl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Jk&&Jk(t,e)},jl.__r=function(t){Yk&&Yk(t);var e=($d=t.__c).__H;e&&(JO===$d?(e.__h=[],$d.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(K0),e.__h.some(RA),e.__h=[])),JO=$d},jl.diffed=function(t){qk&&qk(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(dI.push(e)!==1&&Hk===jl.requestAnimationFrame||((Hk=jl.requestAnimationFrame)||vZ)(hZ)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),JO=$d=null},jl.__c=function(t,e){e.some(function(n){try{n.__h.some(K0),n.__h=n.__h.filter(function(o){return!o.__||RA(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],jl.__e(o,n.__v)}}),Kk&&Kk(t,e)},jl.unmount=function(t){Zk&&Zk(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(o){try{K0(o)}catch(r){e=r}}),n.__H=void 0,e&&jl.__e(e,n.__v))};var Qk=typeof requestAnimationFrame=="function";function vZ(t){var e,n=function(){clearTimeout(o),Qk&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);Qk&&(e=requestAnimationFrame(n))}function K0(t){var e=$d,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),$d=e}function RA(t){var e=$d;t.__c=t.__(),$d=e}function gZ(t,e){for(var n in e)t[n]=e[n];return t}function eP(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return!0;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return!0;return!1}function tP(t,e){this.props=t,this.context=e}(tP.prototype=new ko).isPureReactComponent=!0,tP.prototype.shouldComponentUpdate=function(t,e){return eP(this.props,t)||eP(this.state,e)};var nP=xo.__b;xo.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),nP&&nP(t)};var mZ=xo.__e;xo.__e=function(t,e,n,o){if(t.then){for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}mZ(t,e,n,o)};var rP=xo.unmount;function fI(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=gZ({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return fI(o,e,n)})),t}function pI(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return pI(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function QO(){this.__u=0,this.o=null,this.__b=null}function hI(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function m0(){this.i=null,this.l=null}xo.unmount=function(t){var e=t.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),rP&&rP(t)},(QO.prototype=new ko).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=hI(o.__v),i=!1,a=function(){i||o.__z||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var s=n.__P;n.__P=null;var l=function(){if(!--o.__u){if(o.state.__a){var f=o.state.__a;o.__v.__k[0]=pI(f,f.__c.__P,f.__c.__O)}var h;for(o.setState({__a:o.__b=null});h=o.o.pop();)h.__P=s,h.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},QO.prototype.componentWillUnmount=function(){this.o=[]},QO.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=fI(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&Lr(jm,null,t.fallback);return r&&(r.__u&=-33),[Lr(jm,null,e.__a?null:t.children),r]};var oP=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};(m0.prototype=new ko).__a=function(t){var e=this,n=hI(e.__v),o=e.l.get(t);return o[0]++,function(r){var i=function(){e.props.revealOrder?(o.push(r),oP(e,t,o)):r()};n?n(i):i()}},m0.prototype.render=function(t){this.i=null,this.l=new Map;var e=ww(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},m0.prototype.componentDidUpdate=m0.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){oP(t,n,e)})};var yZ=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,_Z=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,bZ=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,wZ=/[A-Z0-9]/g,EZ=typeof document<"u",xZ=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function iP(t,e,n){return e.__k==null&&(e.textContent=""),Yq(t,e),typeof n=="function"&&n(),t?t.__c:null}ko.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(ko.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var aP=xo.event;function OZ(){}function SZ(){return this.cancelBubble}function AZ(){return this.defaultPrevented}xo.event=function(t){return aP&&(t=aP(t)),t.persist=OZ,t.isPropagationStopped=SZ,t.isDefaultPrevented=AZ,t.nativeEvent=t};var MZ={enumerable:!1,configurable:!0,get:function(){return this.class}},lP=xo.vnode;xo.vnode=function(t){typeof t.type=="string"&&(function(e){var n=e.props,o=e.type,r={},i=o.indexOf("-")===-1;for(var a in n){var s=n[a];if(!(a==="value"&&"defaultValue"in n&&s==null||EZ&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||xZ(n.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":bZ.test(a)&&(a=l):l=a="oninput":i&&_Z.test(a)?a=a.replace(wZ,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&r[a=l]&&(a="oninputCapture"),r[a]=s}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=ww(n.children).forEach(function(f){f.props.selected=r.value.indexOf(f.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=ww(n.children).forEach(function(f){f.props.selected=r.multiple?r.defaultValue.indexOf(f.props.value)!=-1:r.defaultValue==f.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",MZ)):n.className&&(r.class=r.className=n.className),e.props=r})(t),t.$$typeof=yZ,lP&&lP(t)};var sP=xo.__r;xo.__r=function(t){sP&&sP(t),t.__c};var uP=xo.diffed;xo.diffed=function(t){uP&&uP(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value)};var TZ=0;function $t(t,e,n,o,r,i){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var f={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--TZ,__i:-1,__u:0,__source:r,__self:i};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return xo.vnode&&xo.vnode(f),f}var CZ=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},M_;(function(t){function e(n){var o=CZ(n,[]),r=n.container;if(!r)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Xo({},t.defaults,o)}t.get=e})(M_||(M_={}));(function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}})(M_||(M_={}));var cP={node:!1,edge:!1},NZ={node:!0,edge:!0},kZ=function(t){return!t||typeof t=="boolean"?t===!0?to(NZ):to(cP):Yv(to(cP),t)},PZ=function(){return og(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function Jl(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}var y0=200,RZ=9999,DZ=10,Wo;(function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Wo||(Wo={}));var da;(function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"})(da||(da={}));var bo;(function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"})(bo||(bo={}));var hr;(function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_FOCUS="node:focus",t.NODE_BLUR="node:blur",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_FOCUS="edge:focus",t.EDGE_BLUR="edge:blur",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_CLICK="anchor:click",t.ANCHOR_MOUSEDOWN="anchor:mousedown",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated",t.EDIT_CONFIG_CHANGED="editConfig:changed"})(hr||(hr={}));var vl;(function(t){t[t.STATIC=-1]="STATIC",t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE",t[t.EDGE_TOP=2]="EDGE_TOP"})(vl||(vl={}));var ni;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(ni||(ni={}));var Ju;(function(t){t.TEXT="text",t.LABEL="label"})(Ju||(Ju={}));var jZ=0,ac=(function(){function t(e){var n=e.onDragStart,o=n===void 0?Qy:n,r=e.onDragging,i=r===void 0?Qy:r,a=e.onDragEnd,s=a===void 0?Qy:a,l=e.eventType,f=l===void 0?"":l,h=e.eventCenter,v=e.step,_=v===void 0?1:v,E=e.isStopPropagation,O=E===void 0?!0:E,w=e.model,S=e.data,M=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(T){var B,R,P=window==null?void 0:window.document;if(T.button===jZ){M.isStopPropagation&&T.stopPropagation(),M.isStartDragging=!0,M.startX=T.clientX,M.startY=T.clientY,P.addEventListener("mousemove",M.handleMouseMove,!1),P.addEventListener("mouseup",M.handleMouseUp,!1);var $=(B=M.model)===null||B===void 0?void 0:B.getData();(R=M.eventCenter)===null||R===void 0||R.emit(hr["".concat(M.eventType,"_MOUSEDOWN")],{e:T,data:M.data||$}),M.startTime=new Date().getTime()}},this.handleMouseMove=function(T){var B,R;if(M.isStopPropagation&&T.stopPropagation(),!!M.isStartDragging&&(M.sumDeltaX+=T.clientX-M.startX,M.sumDeltaY+=T.clientY-M.startY,M.startX=T.clientX,M.startY=T.clientY,M.step<=1||Math.abs(M.sumDeltaX)>M.step||Math.abs(M.sumDeltaY)>M.step)){var P=M.sumDeltaX%M.step,$=M.sumDeltaY%M.step,I=M.sumDeltaX-P,F=M.sumDeltaY-$;M.sumDeltaX=P,M.sumDeltaY=$;var U=(B=M.model)===null||B===void 0?void 0:B.getData();M.isDragging||((R=M.eventCenter)===null||R===void 0||R.emit(hr["".concat(M.eventType,"_DRAGSTART")],{e:T,data:M.data||U}),M.onDragStart({event:T})),M.isDragging=!0,Promise.resolve().then(function(){var z,X;M.onDragging({deltaX:I,deltaY:F,event:T}),(z=M.eventCenter)===null||z===void 0||z.emit(hr["".concat(M.eventType,"_MOUSEMOVE")],{deltaX:I,deltaY:F,e:T,data:M.data||U}),(X=M.eventCenter)===null||X===void 0||X.emit(hr["".concat(M.eventType,"_DRAG")],{e:T,data:M.data||U})})}},this.handleMouseUp=function(T){var B=window.document;M.isStartDragging=!1,M.isStopPropagation&&T.stopPropagation(),Promise.resolve().then(function(){var R,P,$;B.removeEventListener("mousemove",M.handleMouseMove,!1),B.removeEventListener("mouseup",M.handleMouseUp,!1);var I=(R=M.model)===null||R===void 0?void 0:R.getData();(P=M.eventCenter)===null||P===void 0||P.emit(hr["".concat(M.eventType,"_MOUSEUP")],{e:T,data:M.data||I}),M.isDragging&&(M.isDragging=!1,M.onDragEnd({event:T}),($=M.eventCenter)===null||$===void 0||$.emit(hr["".concat(M.eventType,"_DROP")],{e:T,data:M.data||I}))})},this.cancelDrag=function(){var T=window==null?void 0:window.document;T.removeEventListener("mousemove",M.handleMouseMove,!1),T.removeEventListener("mouseup",M.handleMouseUp,!1),M.onDragEnd({event:void 0}),M.isDragging=!1},this.destroy=function(){M.isStartDragging&&M.cancelDrag()},this.onDragStart=o,this.onDragging=i,this.onDragEnd=s,this.step=_,this.isStopPropagation=O,this.eventType=f,this.eventCenter=h,this.model=w,this.data=S}return t.prototype.setStep=function(e){this.step=e},t.prototype.setModel=function(e){this.model=e},t})(),LZ=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{x:e-o/2,y:n-r/2,x1:e+o/2,y1:n+r/2}},IZ=function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}},FZ=function(t){var e=t.points,n=Kv(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},BZ=function(t){var e=t.path,n=kM(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},$Z=function(t){if(t.modelType===bo.LINE_EDGE)return IZ(t);if(t.modelType===bo.POLYLINE_EDGE)return FZ(t);if(t.modelType===bo.BEZIER_EDGE)return BZ(t)},UZ=function(t,e,n,o){var r=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(r===0)return!1;var i=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/r,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/r;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0?{x:i,y:a}:!1},T_=function(t,e,n){var o=t.x,r=t.y,i=e.x,a=e.y,s=n.x,l=n.y,f=(l-a)/(s-i),h=a-f*i;return(o>=i&&o<=s||o<=i&&o>=s)&&(r>=a&&r<=l||r<=a&&r>=l)&&Math.abs(r-f*o-h)<Number.EPSILON},C_=function(t){var e=t.start,n=t.end,o=t.offset,r=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),l=Math.atan(o/r),f=Math.sqrt(r*r+o*o);return i==="start"?n.x>=e.x?(a.leftX=e.x+f*Math.sin(s+l),a.leftY=e.y-f*Math.cos(s+l),a.rightX=e.x-f*Math.sin(s-l),a.rightY=e.y+f*Math.cos(s-l)):(a.leftX=e.x-f*Math.sin(s+l),a.leftY=e.y+f*Math.cos(s+l),a.rightX=e.x+f*Math.sin(s-l),a.rightY=e.y-f*Math.cos(s-l)):i==="end"&&(n.x>=e.x?(a.leftX=n.x+f*Math.sin(s-l),a.leftY=n.y-f*Math.cos(s-l),a.rightX=n.x-f*Math.sin(s+l),a.rightY=n.y+f*Math.cos(s+l)):(a.leftX=n.x-f*Math.sin(s-l),a.leftY=n.y+f*Math.cos(s-l),a.rightX=n.x+f*Math.sin(s+l),a.rightY=n.y-f*Math.cos(s+l))),a},bm=function(){return bm=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},bm.apply(this,arguments)},Yu=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},bh=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},VZ=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},DA=function(t){var e=[],n={};return t.forEach(function(o){var r="".concat(o.x,"-").concat(o.y);o.id=r,n[r]=o}),Object.keys(n).forEach(function(o){e.push(n[o])}),e},Nw=function(t,e){return t.width===0&&t.height===0?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},WZ=function(t,e){var n=Math.abs(t.x-e.centerX),o=Math.abs(t.y-e.centerY);return n/e.width>o/e.height?ni.HORIZONTAL:ni.VERTICAL},kw=function(t,e,n){var o=WZ(n,e);return o===ni.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},dP=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),r=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+r)/2,y:(o+i)/2,centerX:(n+r)/2,centerY:(o+i)/2,minX:n,minY:o,maxX:r,maxY:i,height:i-o,width:r-n}},N_=function(t,e){t===void 0&&(t=[]);var n=[],o=[];t.forEach(function(h){n.push(h.x),o.push(h.y)});var r=Math.min.apply(Math,bh([],Yu(n),!1)),i=Math.max.apply(Math,bh([],Yu(n),!1)),a=Math.min.apply(Math,bh([],Yu(o),!1)),s=Math.max.apply(Math,bh([],Yu(o),!1)),l=i-r,f=s-a;return e&&(l+=e,f+=e),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:f,width:l}},Pw=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:r},{x:e,y:r}]},_0=function(t,e){var n=t.x,o=t.y;return n<e.minX||n>e.maxX||o<e.minY||o>e.maxY},GZ=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},zZ=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},HZ=function(t,e){return bh(bh([],Yu(GZ(t,e.x)),!1),Yu(zZ(t,e.y)),!1)},jA=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},XZ=function(t,e){var n=-2,o=0;return e.forEach(function(r){r&&(t.x===r.x&&(o+=n),t.y===r.y&&(o+=n))}),o},fP=function(t,e,n,o,r){return jA(t,e)+jA(t,n)+XZ(t,[e,n,o,r])},vI=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&vI(t,e,n,n[o],r+1)},YZ=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},Hy=function(t,e,n,o){var r=e.x-t.x,i=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*s),f=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+r*s);return l>=0&&l<=1&&f>=0&&f<=1},pP=function(t,e,n){if(n.width===0&&n.height===0)return!1;var o=Yu(Pw(n),4),r=o[0],i=o[1],a=o[2],s=o[3];return Hy(t,e,r,i)||Hy(t,e,r,s)||Hy(t,e,i,a)||Hy(t,e,a,s)},qZ=function(t,e,n,o){var r=[];return t.forEach(function(i){i!==e&&(i.x===e.x||i.y===e.y)&&!pP(i,e,n)&&!pP(i,e,o)&&r.push(i)}),DA(r)},KZ=function(t,e,n,o,r,i,a){var s=[],l=[e],f={},h={},v={};e.id&&(h[e.id]=0,v[e.id]=fP(e,n,e));var _={};t.forEach(function(w){w.id&&(_[w.id]=w)});for(var E=function(){var w,S=1/0;if(l.forEach(function(T){T.id&&v[T.id]<S&&(S=v[T.id],w=T)}),w===n&&n.id){var M=[];return vI(M,_,f,n.id),{value:M}}if(!w)return{value:[e,n]};YZ(l,w),s.push(w),qZ(t,w,o,r).forEach(function(T){var B;if(s.indexOf(T)===-1&&(l.indexOf(T)===-1&&l.push(T),w!=null&&w.id&&(T!=null&&T.id))){var R=((B=h[w.id])!==null&&B!==void 0?B:0)+jA(w,T);if(h[T.id]&&R>=h[T.id])return;f[T.id]=w.id,h[T.id]=R,v[T.id]=h[T.id]+fP(T,n,e,i,a)}})};l.length;){var O=E();if(typeof O=="object")return O.value}return[e,n]},hP=function(t){return mu(t)},gI=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],o=t[e],r=t[e+1];n.x===o.x&&o.x===r.x||n.y===o.y&&o.y===r.y?t.splice(e,1):e++}return t},vP=function(t,e,n,o,r){var i=hP(n),a=hP(o),s=Nw(i,r),l=Nw(a,r),f=kw(s,i,t),h=kw(l,a,e);if(VZ(s,l)){var v=JZ(t,e,f,h);return bh(bh([t,f],Yu(v),!1),[h,e],!1)}var _=N_([f,h]),E=dP(s,_),O=dP(l,_),w=[];w=w.concat(Pw(E)),w=w.concat(Pw(O));var S={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[_,E,O].forEach(function(T){w=w.concat(HZ(T,S).filter(function(B){return _0(B,s)&&_0(B,l)}))}),[{x:f.x,y:h.y},{x:h.x,y:f.y}].forEach(function(T){_0(T,s)&&_0(T,l)&&w.push(T)}),w.unshift(f),w.push(h),w=DA(w);var M=KZ(w,f,h,i,a,t,e);return M.unshift(t),M.push(e),M.length>2&&(M=gI(M)),DA(M)},ZZ=function(t){if(t.length===1){var e=Yu(t,1),n=e[0];return[n,n]}else{for(var o=t[0],r=t[1],i=qc(o.x,o.y,r.x,r.y),a=1;a<t.length-1;a++){var s=t[a],l=t[a+1],f=qc(s.x,s.y,l.x,l.y);f>i&&(i=f,o=s,r=l)}return[o,r]}},gP=function(t,e,n){var o=ip(t,n),r=ip(e,n);return o&&r},mP=function(t,e,n){var o=ip(t,n),r=ip(e,n),i=o&&r,a=o||r;return!i&&a},yP=function(t,e,n){for(var o=void 0,r=mu(n),i=Pw(r),a=0;a<i.length;a++){var s=Hy(t,e,i[a],i[(a+1)%i.length]);s&&(o=[i[a],i[(a+1)%i.length]])}if(o)return UZ(t,e,o[0],o[1])},Rw=function(t,e){var n=void 0;return t.x===e.x?n=ni.VERTICAL:t.y===e.y&&(n=ni.HORIZONTAL),n},Kv=function(t){var e=t.split(" "),n=[];return e&&e.forEach(function(o){var r=Yu(o.split(","),2),i=r[0],a=r[1];n.push({x:Number(i),y:Number(a)})}),n},JZ=function(t,e,n,o){var r=[],i=Rw(t,n),a=Rw(e,o);if(i===a)t.y===n.y?(r.push({x:n.x,y:(n.y+o.y)/2}),r.push({x:o.x,y:(n.y+o.y)/2})):(r.push({x:(n.x+o.x)/2,y:n.y}),r.push({x:(n.x+o.x)/2,y:o.y}));else{var s={x:n.x,y:o.y},l=T_(s,t,n),f=T_(s,e,o);if(l||f)s={x:o.x,y:n.y};else{var h=_P(s,t,n),v=_P(s,e,o);h&&v&&(s={x:o.x,y:n.y})}r.push(s)}return r},_P=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},mI=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:o>=1&&o<=126||o>=65376&&o<=65439?e+=1:e+=2}return e},QZ=function(t){var e=t.start,n=t.end,o;if(e.x===n.x&&e.y===n.y)o="";else{var r={start:e,end:n,offset:10,verticalLength:5},i=C_(bm(bm({},r),{type:"start"})),a=C_(bm(bm({},r),{type:"end"}));o="M".concat(i.leftX," ").concat(i.leftY,`
|
||
L`).concat(i.rightX," ").concat(i.rightY,`
|
||
L`).concat(a.rightX," ").concat(a.rightY,`
|
||
L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},bP=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=mu(o),s=mu(r),l=Nw(a,i),f=Nw(s,i),h=kw(l,a,e),v=kw(f,s,n);return{sNext:h,ePre:v}},kM=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(","),n=b0(e[0]),o=b0(e[1]),r=b0(e[2]),i=b0(e[3]);return[n,o,r,i]},b0=function(t){var e=Yu(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],o=e[1];return{x:+n,y:+o}},wP=function(t,e){var n=Yu(t,4),o=n[0],r=n[1],i=n[2],a=n[3],s=WJ(o,r,i,a,e);return[s,t[3]]},yI=function(t,e){for(var n=t.x,o=t.y,r=Kv(e),i=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<r.length;l++)s.push({start:r[l],end:r[(l+1)%r.length]});if(s.forEach(function(_){var E=_.start,O=_.end;if(E.x===O.x){var w={x:E.x,y:o},S=T_(w,E,O);if(S){var M=Math.abs(E.x-n);M<i&&(i=M,a=w)}}else if(E.y===O.y){var w={x:n,y:E.y},S=T_(w,E,O);if(S){var M=Math.abs(E.y-o);M<i&&(i=M,a=w)}}}),!a){var f=s[0],h=f.start,v=f.end;a={x:h.x+(v.x-h.x)/2,y:h.y+(v.y-h.y)/2}}return a},eJ=function(t){return Vv(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},EP=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function tJ(t,e){return typeof e!="function"?function(n,o,r){return Object.assign({type:t.edgeType},r)}:function(n,o,r){var i=e(n,o,r);return i?typeof i=="string"?Object.assign({},r,{type:i}):Object.assign({type:i},r):{type:t.edgeType}}}var nJ=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return ri(e,function(i){var a=mI(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},nm=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},w0=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};function Wm(t,e,n){return n&&e*Math.round(t/e)||t}function rJ(t,e,n){if(!t)return[];var o=Math.min.apply(Math,w0([],nm(t.map(function(w){return w[0]})),!1)),r=Math.max.apply(Math,w0([],nm(t.map(function(w){return w[0]})),!1)),i=Math.min.apply(Math,w0([],nm(t.map(function(w){return w[1]})),!1)),a=Math.max.apply(Math,w0([],nm(t.map(function(w){return w[1]})),!1)),s=-o,l=-i,f=t.map(function(w){var S=nm(w,2),M=S[0],T=S[1];return[M+s,T+l]}),h=r-o,v=a-i,_=e?e/h:1,E=n?n/v:1,O=Math.min(_,E);return f.map(function(w){var S=nm(w,2),M=S[0],T=S[1];return[M*O,T*O]})}var eS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tS=function(t,e,n){var o=eS(t,2),r=o[0],i=o[1],a=eS(e,2),s=a[0],l=a[1],f=eS(n,2),h=f[0],v=f[1];return r>s&&r<h&&i>l&&i<v},_I=function(t,e){var n=e.multipleSelectKey,o=!1;switch(n){case"meta":o=t.metaKey;break;case"alt":o=t.altKey;break;case"shift":o=t.shiftKey;break;case"ctrl":o=t.ctrlKey;break;default:o=!1;break}return o},PM=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();function xP(t,e){return t instanceof Il&&e instanceof Il}var bI=(function(t){PM(e,t);function e(n,o,r){var i=t.call(this,3)||this;return i[0]=n,i[1]=o,i[2]=r,i.x=n,i.y=o,i.z=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.add=function(n){if(xP(this,n))return new Il(this.x+n.x,this.y+n.y);var o=this.z+n.z;return new LA((this.x+n.x)/o,(this.y+n.y)/o)},e.prototype.subtract=function(n){if(xP(this,n))return new Il(this.x-n.x,this.y-n.y);var o=this.z-n.z;return o===0?new Il(this.x-n.x,this.y-n.y):new LA((this.x-n.x)/o,(this.y-n.y)/o)},e})(Array),Il=(function(t){PM(e,t);function e(n,o,r){var i=t.call(this,n,o,r??0)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(n){var o=this;return n.reduce(function(r,i,a){return r+i*o[a]})},e.prototype.cross=function(n){return new e(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var n=this.getLength();return new e(this.x/n,this.y/n)},e.prototype.crossZ=function(n){return this.x*n.y-this.y*n.x},e.prototype.angle=function(n){var o=this.crossZ(n),r=Math.acos(this.normalize().dot(n.normalize()));return o>=0?r:-r},e})(bI),LA=(function(t){PM(e,t);function e(n,o){var r=t.call(this,n,o,1)||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.toString=function(){return"Point"},e})(bI),q1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),rm=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},nS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},ib=(function(t){q1(e,t);function e(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.call(this,n.length)||this;return r.fill(new Array(3)),n.forEach(function(i,a){r[a]=i}),r.columns=n[0].length,r.rows=n.length,Object.setPrototypeOf(r,e.prototype),r}return e.prototype.getRow=function(n){return this[n]},e.prototype.getColumn=function(n){return nS([],rm(this.map(function(o){return o[n]})),!1)},e.prototype.transpose=function(){for(var n=[],o=0;o<this.columns;o++)n.push(this.getColumn(o));return new(e.bind.apply(e,nS([void 0],rm(n),!1)))},e.prototype.cross=function(n){var o=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===n.rows)for(var r=0;r<this.rows;r++)for(var i=this.getRow(r),a=function(l){var f=n.getColumn(l);o[r][l]=i.reduce(function(h,v,_){return h+v*f[_]},0)},s=0;s<n.columns;s++)a(s);return new(e.bind.apply(e,nS([void 0],rm(o),!1)))},e.prototype.to2D=function(){return this.map(function(n){return[n[0],n[1]]})},e.prototype.toPoints=function(){return this.map(function(n){return new LA(n[0],n[1])})},e.prototype.toString=function(){var n=rm(this[0],2),o=n[0],r=n[1],i=rm(this[1],2),a=i[0],s=i[1],l=rm(this[2],2),f=l[0],h=l[1];return"matrix(".concat(o," ").concat(r," ").concat(a," ").concat(s," ").concat(f," ").concat(h,")")},e.prototype.translate=function(n,o){return this.cross(new Dw(n,o))},e.prototype.rotate=function(n){return this.cross(new oJ(n))},e.prototype.scale=function(n,o){return this.cross(new iJ(n,o))},e})(Array),oJ=(function(t){q1(e,t);function e(n){var o=t.call(this,new Il(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Il(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Il(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.inverse=function(){return this.transpose()},e})(ib),iJ=(function(t){q1(e,t);function e(n,o){var r=t.call(this,new Il(n,0,0),new Il(0,o,0),new Il(0,0,1))||this;return r.sx=n,r.sy=o,Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e})(ib),Dw=(function(t){q1(e,t);function e(n,o){var r=t.call(this,new Il(1,0,0),new Il(0,1,0),new Il(n,o,1))||this;return r.tx=n,r.ty=o,Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e})(ib);LK({});var jw=function(){return jw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},jw.apply(this,arguments)},aJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},IA=function(t){var e=t.anchors;return e},Lw=function(t,e){for(var n=e.nodes,o,r=n.length-1;r>=0;r--){var i=n[r],a=uJ(t,i);if(a){var s=i.getTargetAnchor(t);if(s){var l={node:i,anchorIndex:s.index,anchor:s.anchor};(!o||lJ(i,o.node,e))&&(o=l)}}}return o},lJ=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},sJ=function(t,e){for(var n=IA(e),o,r=Number.MAX_SAFE_INTEGER,i=0;i<n.length;i++){var a=qc(t.x,t.y,n[i].x,n[i].y);a<r&&(r=a,o={index:i,anchor:jw(jw({},n[i]),{x:n[i].x,y:n[i].y,id:n[i].id})})}return o},qc=function(t,e,n,o){return Math.hypot(t-n,e-o)},ip=function(t,e,n){n===void 0&&(n=0);var o=!1,r=mu(e),i=aJ(new ib([t.x,t.y,1]).translate(-e.x,-e.y).rotate(-e.rotate).translate(e.x,e.y)[0],2),a=i[0],s=i[1],l={x:a,y:s};return l.x>=r.minX-n&&l.x<=r.maxX+n&&l.y>=r.minY-n&&l.y<=r.maxY+n&&(o=!0),o},uJ=function(t,e){return ip(t,e,5)},mu=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}},cJ=function(t){var e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.radius;return[{x:n-r/2+a,y:o-i/2+a,r:a},{x:n+r/2-a,y:o-i/2+a,r:a},{x:n-r/2+a,y:o+i/2-a,r:a},{x:n+r/2-a,y:o+i/2-a,r:a}]},OP=function(t,e,n){var o=cJ(n),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var s=qc(t.x,t.y,a.x,a.y);s<i&&(i=s,r=a)}),FA(t,e,r)},FA=function(t,e,n){var o,r=n.x,i=n.y,a=n.r;if(e===ni.HORIZONTAL){var s=r-Math.sqrt(a*a-(t.y-i)*(t.y-i)),l=r+Math.sqrt(a*a-(t.y-i)*(t.y-i)),f=Math.abs(s-t.x)<Math.abs(l-t.x)?s:l;o={x:f,y:t.y}}else if(e===ni.VERTICAL){var h=i-Math.sqrt(a*a-(t.x-r)*(t.x-r)),v=i+Math.sqrt(a*a-(t.x-r)*(t.x-r)),_=Math.abs(h-t.y)<Math.abs(v-t.y)?h:v;o={x:t.x,y:_}}return o},SP=function(t,e){var n=e,o=!1,r=n.x,i=n.y,a=n.width,s=n.height,l=n.radius,f={minX:r-a/2+l,maxX:r+a/2-l,minY:i-s/2+l,maxY:i+s/2-l};return t.y===i+s/2||t.y===i-s/2?o=t.x>f.minX&&t.x<f.maxX:(t.x===r+a/2||t.x===r-a/2)&&(o=t.y>f.minY&&t.y<f.maxY),o},AP=function(t,e,n){var o,r=n,i=r.x,a=r.y,s=r.rx,l=r.ry;if(e===ni.HORIZONTAL){var f=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),h=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),v=Math.abs(f-t.x)<Math.abs(h-t.x)?f:h;o={x:v,y:t.y}}else if(e===ni.VERTICAL){var _=a-Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),E=a+Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),O=Math.abs(_-t.y)<Math.abs(E-t.y)?_:E;o={x:t.x,y:O}}return o},E0=function(t,e,n){for(var o=n.pointsPosition,r=Number.MAX_SAFE_INTEGER,i,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach(function(l){var f=l.start,h=l.end,v=f,_=h;f.x>h.x&&(v=h,_=f);var E={x:t.x,y:t.y};if(v.x===_.x&&e===ni.HORIZONTAL&&(E={x:v.x,y:t.y}),v.y===_.y&&e===ni.VERTICAL&&(E={x:t.x,y:v.y}),v.x!==_.x&&v.y!==_.y){var O=(_.y-v.y)/(_.x-v.x),w=(v.x*_.y-_.x*v.y)/(v.x-_.x);e===ni.HORIZONTAL?E={x:(t.y-w)/O,y:t.y}:e===ni.VERTICAL&&(E={x:t.x,y:O*t.x+w})}var S=T_(E,f,h);if(S){var M=qc(E.x,E.y,t.x,t.y);M<r&&(r=M,i=E)}}),i},dJ=function(t){var e=Vv(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},MP=function(t,e,n,o){var r=t.x,i=t.y;return e.x>t.x?r=t.x+n/2:e.x<t.x&&(r=t.x-n/2),e.y>t.y?i=t.y+o/2:e.y<t.y&&(i=t.y-o/2),{x:r,y:i}},wI=function(t){var e=t.rows,n=t.style,o=t.rowsLength,r=t.className,i=document.createElement("div");i.className=r,i.style.fontSize="".concat(n.fontSize),i.style.width="".concat(n.width),i.style.lineHeight="".concat(n.lineHeight),i.style.padding="".concat(n.padding),n.fontFamily&&(i.style.fontFamily="".concat(n.fontFamily)),o>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,i.appendChild(l)}):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},TP=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach(function(i){var a=mI(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},Iw=function(t){return typeof t!="object"?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let x0;const fJ=new Uint8Array(16);function pJ(){if(!x0&&(x0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!x0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return x0(fJ)}const Rl=[];for(let t=0;t<256;++t)Rl.push((t+256).toString(16).slice(1));function hJ(t,e=0){return Rl[t[e+0]]+Rl[t[e+1]]+Rl[t[e+2]]+Rl[t[e+3]]+"-"+Rl[t[e+4]]+Rl[t[e+5]]+"-"+Rl[t[e+6]]+Rl[t[e+7]]+"-"+Rl[t[e+8]]+Rl[t[e+9]]+"-"+Rl[t[e+10]]+Rl[t[e+11]]+Rl[t[e+12]]+Rl[t[e+13]]+Rl[t[e+14]]+Rl[t[e+15]]}const vJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),CP={randomUUID:vJ};function gJ(t,e,n){if(CP.randomUUID&&!t)return CP.randomUUID();t=t||{};const o=t.random||(t.rng||pJ)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,hJ(o)}var xh=function(){return gJ()},t_=new Map,EI=function(t){var e=xh();function n(){t();var r=t_.get(e);if(r){var i=window.requestAnimationFrame(n);t_.set(e,i)}}var o=window.requestAnimationFrame(n);return t_.set(e,o),e},Fw=function(t){var e=t_.get(t);e&&(window.cancelAnimationFrame(e),t_.delete(t))},k_=function(){return k_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},k_.apply(this,arguments)},mJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function xI(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.value,a=t.fontSize,s=a===void 0?12:a,l=t.fill,f=l===void 0?"currentColor":l,h=t.overflowMode,v=h===void 0?"default":h,_=t.textWidth,E=_===void 0?void 0:_,O=t.model,w={x:n,y:r,fill:f,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(ri(vp(t),function(P){var $=mJ(P,2),I=$[0],F=$[1];typeof F!="object"&&(w[I]=F)}),i){var S=String(i).split(/[\r\n]/g),M=S.length;if(v!=="default"){var T=O.BaseType,B=O.modelType;if(T===da.NODE&&B!==bo.TEXT_NODE||T===da.EDGE&&E)return yJ(t)}if(M>1){var R=S.map(function(P,$){var I=s+2,F=($-(M-1)/2)*I;return $t("tspan",{className:"lf-text-tspan",x:n,y:r+F,children:P})});return $t("text",k_({},w,{children:R}))}return $t("text",k_({},w,{children:i}))}return null}function yJ(t){var e=t.x,n=t.y,o=t.value,r=t.model,i=t.textWidth,a=t.fontSize,s=a===void 0?12:a,l=t.lineHeight,f=t.fontFamily,h=f===void 0?"":f,v=t.wrapPadding,_=v===void 0?"0, 0":v,E=t.overflowMode,O=r.width,w=r.height,S=r.textHeight,M=i||O,T=String(o).split(/[\r\n]/g),B=T.length,R=wI({rows:T,style:{fontSize:"".concat(s,"px"),width:"".concat(M,"px"),fontFamily:h,lineHeight:l,padding:_},rowsLength:B,className:"lf-get-text-height"}),P=w>R?w:R;S&&(P=S);var $=E==="ellipsis";return $&&(P=s+2),$t("g",{children:$t("foreignObject",{width:M,height:P,x:e-M/2,y:n-P/2,style:{overflow:"visible",textAlign:"left"},children:$t("div",{className:"lf-node-text-auto-wrap",style:{minHeight:P,width:M,padding:_},children:$t("div",{className:$?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:$?T.join(""):"",style:k_({},t),children:T.map(function(I){return $t("div",{className:"lf-node-text--auto-wrap-inner",children:I})})})})})})}var BA=function(){return BA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},BA.apply(this,arguments)},_J=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Gm(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return ri(vp(t),function(n){var o=_J(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("line",BA({},e))}var $A=function(){return $A=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},$A.apply(this,arguments)},bJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function qu(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,s=t.radius,l=s===void 0?0:s,f=e-o/2,h=n-r/2,v={};return v["stroke-width"]=a,ri(vp(t),function(_){var E=bJ(_,2),O=E[0],w=E[1];typeof w!="object"&&(v[O]=w)}),i?v.className="lf-basic-shape ".concat(i):v.className="lf-basic-shape",l&&(v.rx=l,v.ry=l),v.x=f,v.y=h,$t("rect",$A({},v))}var UA=function(){return UA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},UA.apply(this,arguments)},wJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function P_(t){var e={d:""};return ri(vp(t),function(n){var o=wJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("path",UA({},e))}var VA=function(){return VA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},VA.apply(this,arguments)},EJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function zm(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.r,a=i===void 0?4:i,s=t.className,l={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(vp(t),function(f){var h=EJ(f,2),v=h[0],_=h[1];typeof _!="object"&&(l[v]=_)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",$t("circle",VA({},l))}var WA=function(){return WA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},WA.apply(this,arguments)},xJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function OJ(t){var e=t.x,n=e===void 0?0:e,o=t.y,r=o===void 0?0:o,i=t.rx,a=i===void 0?4:i,s=t.ry,l=s===void 0?4:s,f=t.className,h={cx:n,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(vp(t),function(v){var _=xJ(v,2),E=_[0],O=_[1];typeof O!="object"&&(h[E]=O)}),f?h.className="lf-basic-shape ".concat(f):h.className="lf-basic-shape",$t("ellipse",WA({},h))}var Bw=function(){return Bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Bw.apply(this,arguments)},SJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function AJ(t,e){var n=t.map(function(T){return{x:T[0],y:T[1]}}),o=n.length;if(o<3)return"";for(var r=Math.abs(e),i="",a=0;a<o;a++){var s=n[(a-1+o)%o],l=n[a],f=n[(a+1)%o],h={x:l.x-s.x,y:l.y-s.y},v={x:f.x-l.x,y:f.y-l.y},_=Math.hypot(h.x,h.y),E=Math.hypot(v.x,v.y),O={x:h.x/_,y:h.y/_},w={x:v.x/E,y:v.y/E},S={x:l.x-O.x*r,y:l.y-O.y*r},M={x:l.x+w.x*r,y:l.y+w.y*r};a===0?i+="M ".concat(S.x," ").concat(S.y," "):i+="L ".concat(S.x," ").concat(S.y," "),i+="Q ".concat(l.x," ").concat(l.y," ").concat(M.x," ").concat(M.y," ")}return i+="Z",i}function RM(t){var e=t.points,n=e===void 0?[]:e,o=t.className,r=t.radius,i={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(ri(vp(t),function(s){var l=SJ(s,2),f=l[0],h=l[1];typeof h!="object"&&(i[f]=h)}),o?i.classNmae="lf-basic-shape ".concat(o):i.className="lf-basic-shape",r){var a=AJ(n,r);return i.d=a,$t("path",Bw({},i))}else return i.points=n.map(function(s){return s.join(",")}).join(" "),$t("polygon",Bw({},i))}var GA=function(){return GA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},GA.apply(this,arguments)},MJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function TJ(t){var e=t.className,n={points:"",fill:"none"};return ri(vp(t),function(o){var r=MJ(o,2),i=r[0],a=r[1];(i==="style"||typeof a!="object")&&(n[i]=a)}),e&&(n.className="".concat(e)),$t("polyline",GA({},n))}var OI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),R_=function(){return R_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},R_.apply(this,arguments)},CJ=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},NJ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ho;(function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(Ho||(Ho={}));var kJ=(function(t){OI(e,t);function e(n){var o=t.call(this)||this;o.isShiftPressed=!1,o.bindKeyboardEvents=function(){document.addEventListener("keydown",o.handleKeyDown),document.addEventListener("keyup",o.handleKeyUp)},o.handleKeyDown=function(s){s.key==="Shift"&&(o.isShiftPressed=!0)},o.handleKeyUp=function(s){s.key==="Shift"&&(o.isShiftPressed=!1)},o.updateEdgePointByAnchors=function(){var s=o.nodeModel,l=s.id,f=s.anchors,h=o.graphModel.getNodeEdges(l);ri(h,function(v){if(v.sourceNodeId===l){var _=Ah(f,function(E){return E.id===v.sourceAnchorId});_&&v.updateStartPoint({x:_.x,y:_.y})}else if(v.targetNodeId===l){var _=Ah(f,function(O){return O.id===v.targetAnchorId});_&&v.updateEndPoint({x:_.x,y:_.y})}})},o.triggerResizeEvent=function(s,l,f,h,v,_){o.graphModel.eventCenter.emit(hr.NODE_RESIZE,{preData:s,data:l,deltaX:f,deltaY:h,index:v,model:_})},o.recalcResizeInfo=function(s,l,f,h,v){f===void 0&&(f=1),h===void 0&&(h=!1),v===void 0&&(v=!1);var _=to(l),E=_.deltaX,O=_.deltaY,w=_.width,S=_.height,M=_.PCTResizeInfo;if(M){var T=4,B=0,R=0;switch(s){case Ho.LEFT_TOP:R=(E*-1-O)/T;break;case Ho.RIGHT_TOP:R=(E-O)/T;break;case Ho.RIGHT_BOTTOM:R=(E+O)/T;break;case Ho.LEFT_BOTTOM:R=(E*-1+O)/T;break}R!==0&&(B=Math.round(R/M.ResizeBasis.basisHeight*1e5)/1e3),M.ResizePCT.widthPCT=Math.max(Math.min(M.ResizePCT.widthPCT+B,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit),M.ResizePCT.heightPCT=Math.max(Math.min(M.ResizePCT.heightPCT+B,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit);var P=Math.round(M.ResizePCT.widthPCT*M.ResizeBasis.basisWidth/100),$=Math.round(M.ResizePCT.heightPCT*M.ResizeBasis.basisHeight/100);switch(s){case Ho.LEFT_TOP:E=w-P,O=S-$;break;case Ho.RIGHT_TOP:E=P-w,O=S-$;break;case Ho.RIGHT_BOTTOM:E=P-w,O=$-S;break;case Ho.LEFT_BOTTOM:E=w-P,O=$-S;break}return _}switch(s){case Ho.LEFT_TOP:_.width=h?w:w-E*f,_.height=v?S:S-O*f;break;case Ho.RIGHT_TOP:_.width=h?w:w+E*f,_.height=v?S:S-O*f;break;case Ho.RIGHT_BOTTOM:_.width=h?w:w+E*f,_.height=v?S:S+O*f;break;case Ho.LEFT_BOTTOM:_.width=h?w:w-E*f,_.height=v?S:S+O*f;break}return _},o.resizeNode=function(s){var l=s.deltaX,f=s.deltaY,h=o.index,v=o.props,_=v.model,E=v.graphModel,O=v.x,w=v.y;SI({x:O,y:w,deltaX:l,deltaY:f,index:h,nodeModel:_,graphModel:E,forceProportional:o.isShiftPressed,cancelCallback:function(){o.dragHandler.cancelDrag()}})},o.onDragStart=function(){o.graphModel.selectNodeById(o.nodeModel.id)},o.onDragging=function(s){var l=s.deltaX,f=s.deltaY,h=o.graphModel.transformModel,v=NJ(h.fixDeltaXY(l,f),2),_=v[0],E=v[1];o.resizeNode({deltaX:_,deltaY:E})},o.onDragEnd=function(){var s=o.nodeModel.x,l=o.nodeModel.y;o.nodeModel.moveTo(s,l),o.updateEdgePointByAnchors()};var r=n.index,i=n.model,a=n.graphModel;return o.index=r,o.nodeModel=i,o.graphModel=a,o.dragHandler=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:a.gridSize}),o.bindKeyboardEvents(),o}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.direction,a=n.model,s=a.getResizeControlStyle(),l=s.width,f=s.height,h=CJ(s,["width","height"]);return $t("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[$t(qu,R_({className:"lf-resize-control-content",x:o,y:r,width:l??7,height:f??7},h)),$t(qu,{className:"lf-resize-control-content",x:o,y:r,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e})(ko),PJ=(function(t){OI(e,t);function e(){return t.call(this)||this}return e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=mu(o),a=i.minX,s=i.minY,l=i.maxX,f=i.maxY,h=[{index:Ho.LEFT_TOP,direction:"nw",x:a,y:s},{index:Ho.RIGHT_TOP,direction:"ne",x:l,y:s},{index:Ho.RIGHT_BOTTOM,direction:"se",x:l,y:f},{index:Ho.LEFT_BOTTOM,direction:"sw",x:a,y:f}];return tc(h,function(v){return $t(kJ,R_({},v,{model:o,graphModel:r}))})},e.prototype.getResizeOutline=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getResizeOutlineStyle();return $t(qu,R_({},s,{x:o,y:r,width:i,height:a}))},e.prototype.render=function(){return $t("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e})(ko);function RJ(t,e){var n=t.x,o=t.y,r=e.x,i=e.y,a={x:n+(r-n)/2,y:o+(i-o)/2};return a}function Xy(t,e,n){var o=DJ(n),r=t.x-e.x,i=t.y-e.y,a=r*Math.cos(o)-i*Math.sin(o)+e.x,s=r*Math.sin(o)+i*Math.cos(o)+e.y;return{x:a,y:s}}function DJ(t){return t*Math.PI/180}function jJ(t){return t/Math.PI*180}function LJ(t,e,n,o,r,i,a,s){r===void 0&&(r=!1),i===void 0&&(i=!1);var l={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},f=RJ(l,e),h=Xy(e,f,-o),v=Xy(l,f,-o);if(r){var _=Math.abs(h.x-v.x),E=_-a;f.x>h.x?f.x=f.x+E/2:f.x=f.x-E/2}if(i){var O=Math.abs(h.y-v.y),w=O-s;f.y>h.y?f.y=f.y+w/2:f.y=f.y-w/2}if(r||i){var S=Xy(v,f,o),M=S.x-l.x,T=S.y-l.y;f.x=f.x-M,f.y=f.y-T,v=Xy(l,f,-o),h={x:f.x-(v.x-f.x),y:f.y-(v.y-f.y)}}var B=Math.abs(h.x-v.x),R=Math.abs(h.y-v.y);return r&&(B=a),i&&(R=s),{width:B,height:R,center:f}}function IJ(t,e,n,o,r,i,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var f=e.deltaX,h=e.deltaY,v=e.width,_=e.height,E=jJ(n),O={x:o,y:r},w={x:i,y:a},S=Xy(O,w,E),M={x:S.x+f,y:S.y+h},T=LJ(S,M,w,E,s,l,v,_),B=T.width,R=T.height,P=T.center;return e.width=B*t,e.height=R*t,e.deltaX=(P.x-w.x)*2,e.deltaY=(P.y-w.y)*2,e}var FJ=function(t,e,n,o,r,i,a,s,l,f,h){n===void 0&&(n=1),o===void 0&&(o=!1),r===void 0&&(r=!1),i===void 0&&(i=0),h===void 0&&(h=!1);var v=to(e),_=v.deltaX,E=v.deltaY,O=v.width,w=v.height,S=v.PCTResizeInfo;if(S){var M=4,T=0,B=0;switch(t){case Ho.LEFT_TOP:B=(_*-1-E)/M;break;case Ho.RIGHT_TOP:B=(_-E)/M;break;case Ho.RIGHT_BOTTOM:B=(_+E)/M;break;case Ho.LEFT_BOTTOM:B=(_*-1+E)/M;break}B!==0&&(T=Math.round(B/S.ResizeBasis.basisHeight*1e5)/1e3),S.ResizePCT.widthPCT=Math.max(Math.min(S.ResizePCT.widthPCT+T,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit),S.ResizePCT.heightPCT=Math.max(Math.min(S.ResizePCT.heightPCT+T,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit);var R=Math.round(S.ResizePCT.widthPCT*S.ResizeBasis.basisWidth/100),P=Math.round(S.ResizePCT.heightPCT*S.ResizeBasis.basisHeight/100);switch(t){case Ho.LEFT_TOP:_=O-R,E=w-P;break;case Ho.RIGHT_TOP:_=R-O,E=w-P;break;case Ho.RIGHT_BOTTOM:_=R-O,E=P-w;break;case Ho.LEFT_BOTTOM:_=O-R,E=P-w;break}return v}if(i%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return IJ(n,v,i,a,s,l,f,o,r);if(h){var $=O/w,I=0,F=O,U=w;switch(t){case Ho.LEFT_TOP:I=Math.abs(_)>Math.abs(E)?-_:-E,$>=1?(F=O+I,U=F/$):(U=w+I,F=U*$),v.width=F,v.height=U,v.deltaX=O-F,v.deltaY=w-U;break;case Ho.RIGHT_TOP:I=Math.abs(_)>Math.abs(E)?_:-E,$>=1?(F=O+I,U=F/$):(U=w-I,F=U*$),v.width=F,v.height=U,v.deltaX=F-O,v.deltaY=w-U;break;case Ho.RIGHT_BOTTOM:I=Math.abs(_)>Math.abs(E)?_:E,$>=1?(F=O+I,U=F/$):(U=w+I,F=U*$),v.width=F,v.height=U,v.deltaX=F-O,v.deltaY=U-w;break;case Ho.LEFT_BOTTOM:I=Math.abs(_)>Math.abs(E)?-_:E,$>=1?(F=O-I,U=F/$):(U=w+I,F=U*$),v.width=F,v.height=U,v.deltaX=O-F,v.deltaY=U-w;break}return v}switch(t){case Ho.LEFT_TOP:v.width=o?O:O-_*n,v.height=r?w:w-E*n;break;case Ho.RIGHT_TOP:v.width=o?O:O+_*n,v.height=r?w:w-E*n;break;case Ho.RIGHT_BOTTOM:v.width=o?O:O+_*n,v.height=r?w:w+E*n;break;case Ho.LEFT_BOTTOM:v.width=o?O:O-_*n,v.height=r?w:w+E*n;break}return v},BJ=function(t,e){var n=t.id,o=t.anchors,r=e.getNodeEdges(n);ri(r,function(i){if(i.sourceNodeId===n){var a=Ah(o,function(s){return s.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===n){var a=Ah(o,function(l){return l.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},$J=function(t,e,n,o,r,i,a){a.eventCenter.emit(hr.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:r,model:i})},SI=function(t){var e=t.x,n=t.y,o=t.deltaX,r=t.deltaY,i=t.index,a=t.nodeModel,s=t.graphModel,l=t.cancelCallback,f=t.forceProportional,h=f===void 0?!1:f,v=a.r,_=a.rx,E=a.ry,O=a.width,w=a.height,S=a.PCTResizeInfo,M=a.minWidth,T=a.minHeight,B=a.maxWidth,R=a.maxHeight,P=a.rotate,$=a.x,I=a.y,F=M===B,U=T===R,z={width:v||_||O,height:v||E||w,deltaX:o,deltaY:r,PCTResizeInfo:S},X=v||_&&E?1/2:1,Y=e,W=n,Q=FJ(i,z,X,F,U,P,Y,W,$,I,h);if(Q.width<M||Q.width>B||Q.height<T||Q.height>R){l==null||l();return}(P%(2*Math.PI)==0||S||Y===void 0||W===void 0)&&(Q.deltaX=F?0:Q.deltaX,Q.deltaY=U?0:Q.deltaY);var J=a.getData(),ie=a.resize(Q);J.x===ie.x&&J.y===ie.y||(BJ(a,s),$J(J,ie,o,r,i,a,s))},UJ=100,VJ={x:1,y:0};function WJ(t,e,n,o,r){for(var i=function(E){if(E<0||E>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-E,3)+3*e.x*E*Math.pow(1-E,2)+3*n.x*Math.pow(E,2)*(1-E)+o.x*Math.pow(E,3),y:t.y*Math.pow(1-E,3)+3*e.y*E*Math.pow(1-E,2)+3*n.y*Math.pow(E,2)*(1-E)+o.y*Math.pow(E,3)}},a=0,s=2,l=o.x,f=o.y,h=o;a<r&&s<50;){h=i(1-s/UJ);var v=h.x,_=h.y;a=qc(l,f,v,_),s++}return h}function GJ(t,e){return t.x*e.y-t.y*e.x}function zJ(t,e){var n=[t.x,t.y,t.z],o=[e.x,e.y,e.z];return o.reduce(function(r,i,a){return r+i*n[a]})}function HJ(t,e){var n=GJ(t,e),o=Math.acos(zJ(NP(t),NP(e)));return n>=0?o:-o}function NP(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function XJ(t){return HJ(VJ,t)}function YJ(t){return t*(180/Math.PI)}var AI={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},qJ={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},KJ={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},ZJ={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},D_={colorful:ZJ,dark:KJ,radius:qJ,default:AI},JJ={background:"#23272e"},QJ={background:"#fefeff"},zA={background:"#ffffff"},j_={colorful:QJ,dark:JJ,radius:zA,default:zA},eQ={color:"#66676a",thickness:1},tQ={color:"#dadada",thickness:1},HA={color:"#acacac",thickness:1},L_={colorful:tQ,dark:eQ,radius:HA,default:HA},MI=function(t,e){var n=to(AI);return e&&(n=Yv(n,D_[e])),t&&(n=Yv(n,t)),n},nQ=function(t,e){if(D_[t]){console.warn("theme mode ".concat(t," already exists"));return}D_[t]=e,j_[t]=e.background||zA,L_[t]=e.grid||HA},rQ=function(t){delete D_[t],delete j_[t],delete L_[t]},oQ=function(){var t={colorful:{},dark:{},radius:{},default:{}};Xo(D_,t),Xo(j_,t),Xo(L_,t)},iQ=MI,aQ=1e3,lQ=999,I_=function(){return++aQ},sQ=function(){return--lQ},Da=function(){return Da=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Da.apply(this,arguments)},Pr=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},K1=(function(){function t(e,n){var o;this.BaseType=da.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Ju.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=Wo.DEFAULT,this.modelType=bo.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initEdgeData(e),this.setAttributes()}return t.prototype.initEdgeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||xh()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Xo(this,eJ(e));var s=this.graphModel,l=s.overlapMode,f=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||I_()),this.setAnchors(),this.initPoints(),this.formatText(e),f.on("overlap:change",function(h){var v=h.overlapMode;n.updateZIndexByOverlap(v,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return Da(Da({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return Da({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return to(e)},t.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return to(e)},t.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),n=this.getEdgeAnimationStyle(),o=this.graphModel.theme.arrow,r=this.isAnimation?n.stroke:e.stroke;return Da(Da(Da({},e),{fill:r,stroke:r}),o)},t.prototype.getOutlineStyle=function(){var e=this.graphModel,n=e.theme.outline;return to(n)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var e,n;return(n=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||n===void 0?void 0:n.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(e,n,o){var r,i,a=IA(e);if(o){if(r=Ah(a,function(s){return s.id===o}),r)return r;console.warn("未在节点上找到指定的起点锚点".concat(o,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=EP(s,n);(i===void 0||l<i)&&(i=l,r=s)}),r},t.prototype.getEndAnchor=function(e,n){var o=this,r,i,a=IA(e);if(n){if(r=Ah(a,function(s){return s.id===n}),r)return r;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(o.startPoint){var l=EP(s,o.startPoint);(i===void 0||l<i)&&(i=l,r=s)}}),r},t.prototype.getProperties=function(){return Hc(this.properties)},t.prototype.getData=function(){var e=this.properties;Um(e)&&(e=Hc(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:Xo({},this.startPoint),endPoint:Xo({},this.endPoint)};[vl.INCREASE,vl.STATIC].includes(this.graphModel.overlapMode)&&(n.zIndex=this.zIndex);var o=this.text,r=o.x,i=o.y,a=o.value;return a&&(n.text={x:r,y:i,value:a}),n},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(e,n){MM(this.properties,e,Jl(n)),this.setAttributes()},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setProperties=function(e){this.properties=Da(Da({},Hc(this.properties)),Jl(e)),this.setAttributes()},t.prototype.changeEdgeId=function(e){var n=this.arrowConfig,o=n.markerEnd,r=n.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),o&&o==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},t.prototype.setStyle=function(e,n){var o;this.style=Da(Da({},this.style),(o={},o[e]=Jl(n),o))},t.prototype.setStyles=function(e){this.style=Da(Da({},this.style),Jl(e))},t.prototype.updateStyles=function(e){this.style=Da({},Jl(e))},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,o,r,i=this.graphModel.editConfigModel,a=i.edgeTextDraggable,s=i.edgeTextEdit,l=this.textPosition,f=l.x,h=l.y,v=e.text,_={value:"",x:f,y:h,draggable:a,editable:s};v&&(typeof v=="string"?_=Da(Da({},_),{value:v}):(_=Da(Da({},_),{x:(n=v.x)!==null&&n!==void 0?n:f,y:(o=v.y)!==null&&o!==void 0?o:h,value:(r=v.value)!==null&&r!==void 0?r:""}),Xv(v.draggable)||(_.draggable=v.draggable),Xv(v.editable)||(_.editable=v.editable))),this.text=_},t.prototype.resetTextPosition=function(){var e=this.textPosition,n=e.x,o=e.y;this.text.x=n,this.text.y=o},t.prototype.moveText=function(e,n){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+e,y:i+n}},t.prototype.setText=function(e){e&&Xo(this.text,e)},t.prototype.updateText=function(e){this.text=Da(Da({},Hc(this.text)),{value:e})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateStartPoint=function(e){this.startPoint=e},t.prototype.moveStartPoint=function(e,n){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=n)},t.prototype.updateEndPoint=function(e){this.endPoint=e},t.prototype.moveEndPoint=function(e,n){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=n)},t.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(e){Xo(this,e)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var n=e.startPoint,o=e.endPoint;this.updateStartPoint({x:n.x,y:n.y}),this.updateEndPoint({x:o.x,y:o.y})},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case vl.DEFAULT:this.zIndex=0;break;case vl.EDGE_TOP:this.zIndex=1;break;case vl.INCREASE:this.zIndex=n;break}},t.BaseType=da.EDGE,Pr([Ut],t.prototype,"type",void 0),Pr([Ut],t.prototype,"sourceNodeId",void 0),Pr([Ut],t.prototype,"targetNodeId",void 0),Pr([Ut],t.prototype,"startPoint",void 0),Pr([Ut],t.prototype,"endPoint",void 0),Pr([Ut],t.prototype,"textMode",void 0),Pr([Ut],t.prototype,"text",void 0),Pr([Ut],t.prototype,"properties",void 0),Pr([Ut],t.prototype,"points",void 0),Pr([Ut],t.prototype,"pointsList",void 0),Pr([Ut],t.prototype,"isSelected",void 0),Pr([Ut],t.prototype,"isHovered",void 0),Pr([Ut],t.prototype,"isHitable",void 0),Pr([Ut],t.prototype,"isHittable",void 0),Pr([Ut],t.prototype,"draggable",void 0),Pr([Ut],t.prototype,"visible",void 0),Pr([Ut],t.prototype,"isAnimation",void 0),Pr([Ut],t.prototype,"isShowAdjustPoint",void 0),Pr([Ut],t.prototype,"zIndex",void 0),Pr([Ut],t.prototype,"state",void 0),Pr([Ut],t.prototype,"style",void 0),Pr([Ut],t.prototype,"arrowConfig",void 0),Pr([Ai],t.prototype,"sourceNode",null),Pr([Ai],t.prototype,"targetNode",null),Pr([Ai],t.prototype,"textPosition",null),Pr([Bt],t.prototype,"setProperty",null),Pr([Bt],t.prototype,"deleteProperty",null),Pr([Bt],t.prototype,"setProperties",null),Pr([Bt],t.prototype,"changeEdgeId",null),Pr([Bt],t.prototype,"setStyle",null),Pr([Bt],t.prototype,"setStyles",null),Pr([Bt],t.prototype,"updateStyles",null),Pr([Bt],t.prototype,"setTextMode",null),Pr([Bt],t.prototype,"formatText",null),Pr([Bt],t.prototype,"resetTextPosition",null),Pr([Bt],t.prototype,"moveText",null),Pr([Bt],t.prototype,"setText",null),Pr([Bt],t.prototype,"updateText",null),Pr([Bt],t.prototype,"setAnchors",null),Pr([Bt],t.prototype,"setSelected",null),Pr([Bt],t.prototype,"setHovered",null),Pr([Bt],t.prototype,"setHitable",null),Pr([Bt],t.prototype,"setHittable",null),Pr([Bt],t.prototype,"openEdgeAnimation",null),Pr([Bt],t.prototype,"closeEdgeAnimation",null),Pr([Bt],t.prototype,"setElementState",null),Pr([Bt],t.prototype,"updateStartPoint",null),Pr([Bt],t.prototype,"moveStartPoint",null),Pr([Bt],t.prototype,"updateEndPoint",null),Pr([Bt],t.prototype,"moveEndPoint",null),Pr([Bt],t.prototype,"setZIndex",null),Pr([Bt],t.prototype,"initPoints",null),Pr([Bt],t.prototype,"updateAttributes",null),Pr([Bt],t.prototype,"getAdjustStart",null),Pr([Bt],t.prototype,"getAdjustEnd",null),Pr([Bt],t.prototype,"updateAfterAdjustStartAndEnd",null),Pr([Bt],t.prototype,"updateZIndexByOverlap",null),t})(),uQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Fv=function(){return Fv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Fv.apply(this,arguments)},Uu=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},rS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},kP=(function(t){uQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.BEZIER_EDGE,r.path="",r.initEdgeData(n),r.setAttributes(),r}return e.prototype.initEdgeData=function(n){this.offset=og(n,"properties.offset",100),t.prototype.initEdgeData.call(this,n)},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.bezier,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Fv(Fv(Fv({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var n=0,o=0;return this.pointsList.forEach(function(r){var i=r.x,a=r.y;n+=i,o+=a}),{x:n/this.pointsList.length,y:o/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var n=t.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Fv(Fv({},n),{pointsList:o})},e.prototype.getControls=function(){var n=this.startPoint,o=this.endPoint,r=bP({start:n,end:o,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return r},e.prototype.getPath=function(n){var o=rS(n,4),r=o[0],i=o[1],a=o[2],s=o[3];return"M ".concat(r.x," ").concat(r.y,`
|
||
C `).concat(i.x," ").concat(i.y,`,
|
||
`).concat(a.x," ").concat(a.y,`,
|
||
`).concat(s.x," ").concat(s.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=this.getControls(),o=n.sNext,r=n.ePre;this.updatePath(o,r)},e.prototype.updatePath=function(n,o){n=to(n),o=to(o);var r={x:this.startPoint.x,y:this.startPoint.y},i={x:this.endPoint.x,y:this.endPoint.y};if(!n||!o){var a=this.getControls();n=a.sNext,o=a.ePre}this.pointsList=[r,n,o,i],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];i.x+=n,i.y+=o,this.updatePath(i,a)},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o;var r=rS(this.pointsList,3),i=r[1],a=r[2];a.x+=n,a.y+=o,this.updatePath(i,a)},e.prototype.updateAdjustAnchor=function(n,o){var r;o==="sNext"?this.pointsList[1]=n:o==="ePre"&&(this.pointsList[2]=n),this.path=this.getPath(this.pointsList),!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode,s=bP({start:o,end:r,sourceNode:i,targetNode:a,offset:this.offset}),l=s.sNext,f=s.ePre;this.pointsList=[o,l,f,r],this.initPoints()},Uu([Ut],e.prototype,"offset",void 0),Uu([Ut],e.prototype,"path",void 0),Uu([Bt],e.prototype,"initPoints",null),Uu([Bt],e.prototype,"updatePoints",null),Uu([Bt],e.prototype,"updateStartPoint",null),Uu([Bt],e.prototype,"updateEndPoint",null),Uu([Bt],e.prototype,"moveStartPoint",null),Uu([Bt],e.prototype,"moveEndPoint",null),Uu([Bt],e.prototype,"updateAdjustAnchor",null),Uu([Bt],e.prototype,"getAdjustStart",null),Uu([Bt],e.prototype,"getAdjustEnd",null),Uu([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(K1),cQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),n_=function(){return n_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},n_.apply(this,arguments)},PP=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},dQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},RP=(function(t){cQ(e,t);function e(){var n=t.apply(this,dQ([],PP(arguments),!1))||this;return n.modelType=bo.LINE_EDGE,n}return e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.line,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return n_(n_(n_({},o),to(n)),to(i))},e.prototype.initEdgeData=function(n){t.prototype.initEdgeData.call(this,n),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(n){var o=PP(n,2),r=o[0],i=o[1];return"".concat(r.x,",").concat(r.y," ").concat(i.x,",").concat(i.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e})(K1),fQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),r_=function(){return r_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},r_.apply(this,arguments)},kl=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},DP=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},F_=(function(t){fQ(e,t);function e(){var n=t.apply(this,pQ([],DP(arguments),!1))||this;return n.modelType=bo.POLYLINE_EDGE,n.draggingPointList=[],n}return e.prototype.initEdgeData=function(n){var o=og(n,"properties.offset");if(this.offset=typeof o=="number"?o:this.getDefaultOffset(),n.pointsList){var r=this.orthogonalizePath(n.pointsList);n.pointsList=r,this.pointsList=r}t.prototype.initEdgeData.call(this,n)},e.prototype.setAttributes=function(){var n=this.properties.offset;n&&n!==this.offset&&(this.offset=n,this.updatePoints())},e.prototype.orthogonalizePath=function(n){if(!Array.isArray(n)||n.length<2)return n;var o=function(R,P){var $=R[R.length-1];(!$||$.x!==P.x||$.y!==P.y)&&R.push({x:P.x,y:P.y})},r=function(R,P){return R.x===P.x||R.y===P.y},i=function(R,P){return Math.abs(R.x-P.x)+Math.abs(R.y-P.y)},a=[];o(a,n[0]);for(var s,l=0;l<n.length-1;l++){var f=a[a.length-1],h=n[l+1];if(!(!f||!h)){if(r(f,h)){o(a,h),s=f.x===h.x?ni.VERTICAL:ni.HORIZONTAL;continue}var v={x:h.x,y:f.y},_={x:f.x,y:h.y},E=s===ni.VERTICAL?_:s===ni.HORIZONTAL||i(f,v)<=i(f,_)?v:_;(E.x!==f.x||E.y!==f.y)&&o(a,E),o(a,h);var O=a[a.length-2],w=a[a.length-1];s=O&&w?O.x===w.x?ni.VERTICAL:ni.HORIZONTAL:s}}for(var S=[],l=0;l<a.length;l++){var M=a[l-1],T=a[l],h=a[l+1];M&&T&&h&&(M.x===T.x&&T.x===h.x||M.y===T.y&&T.y===h.y)||o(S,T)}S.length>=2&&(S[0]={x:n[0].x,y:n[0].y},S[S.length-1]={x:n[n.length-1].x,y:n[n.length-1].y});var B=S.length<2||S.every(function(R,P,$){return P===0?!0:r($[P-1],$[P])});return B?S:[{x:n[0].x,y:n[0].y},{x:n[n.length-1].x,y:n[n.length-1].y}]},e.prototype.getDefaultOffset=function(){var n=this.getArrowStyle(),o=typeof n.offset=="number"?n.offset:0;return o+5},e.prototype.getEdgeStyle=function(){var n=this.graphModel.theme.polyline,o=t.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return r_(r_(r_({},o),to(n)),to(i))},e.prototype.getTextPosition=function(){var n,o=(n=this.text)===null||n===void 0?void 0:n.value;if(this.dbClickPosition&&!o){var r=this.dbClickPosition,i=r.x,a=r.y;return{x:i,y:a}}var s=Kv(this.points),l=DP(ZZ(s),2),f=l[0],h=l[1];return{x:(f.x+h.x)/2,y:(f.y+h.y)/2}},e.prototype.getAfterAnchor=function(n,o,r){var i,a;return r.forEach(function(s){var l;n===ni.HORIZONTAL?l=Math.abs(o.y-s.y):n===ni.VERTICAL&&(l=Math.abs(o.x-s.x)),(!a||a>l)&&(a=l,i=s)}),i},e.prototype.getCrossPoint=function(n,o,r){var i;return n===ni.HORIZONTAL?i={x:r.x,y:o.y}:n===ni.VERTICAL&&(i={x:o.x,y:r.y}),i},e.prototype.removeCrossPoints=function(n,o,r){var i=r.map(function(M){return M});if(n===1){var a=i[n],s=i[o],l=i[n-1],f=gP(l,a,this.sourceNode);if(f){var h=mP(a,s,this.sourceNode);if(h){var v=yP(a,s,this.sourceNode);v&&(i[n]=v,i.splice(n-1,1),n--,o--)}}else{var _=this.sourceNode.anchors;_.forEach(function(M){if(M.x===l.x&&M.x===a.x||M.y===l.y&&M.y===a.y){var T=qc(M.x,M.y,a.x,a.y),B=qc(l.x,l.y,a.x,a.y);T<B&&(i[n-1]=M)}})}}if(o===r.length-2){var E=i[n],O=i[o],w=i[o+1],S=gP(O,w,this.targetNode);if(S){var h=mP(E,O,this.targetNode);if(h){var v=yP(E,O,this.targetNode);v&&(i[o]=v,i.splice(o+1,1))}}else{var _=this.targetNode.anchors;_.forEach(function(T){if(T.x===w.x&&T.x===O.x||T.y===w.y&&T.y===O.y){var B=qc(T.x,T.y,O.x,O.y),R=qc(w.x,w.y,O.x,O.y);B<R&&(i[o+1]=T)}})}}return i},e.prototype.getDraggingPoints=function(n,o,r,i,a){var s=a.map(function(h){return h}),l=this.getAfterAnchor(n,r,i),f=this.getCrossPoint(n,r,l);return o==="start"?(s.unshift(f),s.unshift(l)):(s.push(f),s.push(l)),s},e.prototype.updateCrossPoints=function(n){var o=n.map(function(T){return T}),r=n[0],i=n[1],a=n[o.length-2],s=n[o.length-1],l=this,f=l.sourceNode,h=l.targetNode,v=f.modelType,_=h.modelType,E=Rw(r,i),O=o[0];switch(v){case bo.RECT_NODE:if(f.radius!==0){var w=SP(r,f);w||(O=OP(r,E,f))}break;case bo.CIRCLE_NODE:O=FA(r,E,f);break;case bo.ELLIPSE_NODE:O=AP(r,E,f);break;case bo.DIAMOND_NODE:O=E0(r,E,f);break;case bo.POLYGON_NODE:O=E0(r,E,f);break}O&&(o[0]=O);var S=Rw(a,s),M=o[o.length-1];switch(_){case bo.RECT_NODE:if(h.radius!==0){var w=SP(s,h);w||(M=OP(s,S,h))}break;case bo.CIRCLE_NODE:M=FA(s,S,h);break;case bo.ELLIPSE_NODE:M=AP(s,S,h);break;case bo.DIAMOND_NODE:M=E0(s,S,h);break;case bo.POLYGON_NODE:M=E0(s,S,h);break}return M&&(o[o.length-1]=M),o},e.prototype.updatePath=function(n){this.pointsList=this.orthogonalizePath(n),this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var n=t.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Object.assign({},n,{pointsList:o})},e.prototype.getPath=function(n){return n.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var n=vP({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=this.orthogonalizePath(n),this.points=this.pointsList.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},e.prototype.updateStartPoint=function(n){this.startPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveStartPoint=function(n,o){this.startPoint.x+=n,this.startPoint.y+=o,this.updatePoints()},e.prototype.updateEndPoint=function(n){this.endPoint=Object.assign({},n),this.updatePoints()},e.prototype.moveEndPoint=function(n,o){this.endPoint.x+=n,this.endPoint.y+=o,this.updatePoints()},e.prototype.updatePointsList=function(n,o){this.pointsList.forEach(function(a){a.x+=n,a.y+=o});var r=this.pointsList[0];this.startPoint=Object.assign({},r);var i=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},i),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(n){return n})},e.prototype.dragAppendSimple=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,s=n.startIndex,l=n.endIndex,f=n.direction,h=this.pointsList,v=h;return f===ni.HORIZONTAL?(h[s]={x:i.x,y:i.y+o.y},h[l]={x:a.x,y:a.y+o.y},v=this.pointsList.map(function(_){return _})):f===ni.VERTICAL&&(h[s]={x:i.x+o.x,y:i.y},h[l]={x:a.x+o.x,y:a.y},v=this.pointsList.map(function(_){return _})),this.updatePointsAfterDrag(v),this.draggingPointList=v,!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[s]),end:Xo({},h[l]),startIndex:s,endIndex:l,direction:f}},e.prototype.dragAppend=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,s=n.startIndex,l=n.endIndex,f=n.direction,h=this.pointsList;if(f===ni.HORIZONTAL){h[s]={x:i.x,y:i.y+o.y},h[l]={x:a.x,y:a.y+o.y};var v=this.pointsList.map(function(S){return S});if(s!==0&&l!==this.pointsList.length-1&&(v=this.removeCrossPoints(s,l,v)),s===0){var _={x:i.x,y:i.y+o.y},E=ip(_,this.sourceNode);if(!E){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",_,O,v)}}if(l===this.pointsList.length-1){var w={x:a.x,y:a.y+o.y},E=ip(w,this.targetNode);if(!E){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",w,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}else if(f===ni.VERTICAL){h[s]={x:i.x+o.x,y:i.y},h[l]={x:a.x+o.x,y:a.y};var v=this.pointsList.map(function(M){return M});if(s!==0&&l!==this.pointsList.length-1&&(v=this.removeCrossPoints(s,l,v)),s===0){var _={x:i.x+o.x,y:i.y},E=ip(_,this.sourceNode);if(!E){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",_,O,v)}}if(l===this.pointsList.length-1){var w={x:a.x+o.x,y:a.y},E=ip(w,this.targetNode);if(!E){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",w,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}return!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Xo({},this.text,this.textPosition)),{start:Xo({},h[s]),end:Xo({},h[l]),startIndex:s,endIndex:l,direction:f}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=gI(Kv(this.points));this.pointsList=n.map(function(i){return i}),this.draggingPointList=[];var o=n[0];this.startPoint=Xo({},o);var r=n[n.length-1];this.endPoint=Xo({},r)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(n){var o=this.updateCrossPoints(n);this.points=o.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var n=this.pointsList;return n[n.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(n){var o=n.startPoint,r=n.endPoint,i=n.sourceNode,a=n.targetNode;this.pointsList=this.orthogonalizePath(vP({x:o.x,y:o.y},{x:r.x,y:r.y},i,a,this.offset||0)),this.initPoints()},kl([Ut],e.prototype,"offset",void 0),kl([Ut],e.prototype,"dbClickPosition",void 0),kl([Bt],e.prototype,"initPoints",null),kl([Bt],e.prototype,"updatePoints",null),kl([Bt],e.prototype,"updateStartPoint",null),kl([Bt],e.prototype,"moveStartPoint",null),kl([Bt],e.prototype,"updateEndPoint",null),kl([Bt],e.prototype,"moveEndPoint",null),kl([Bt],e.prototype,"updatePointsList",null),kl([Bt],e.prototype,"dragAppendStart",null),kl([Bt],e.prototype,"dragAppendSimple",null),kl([Bt],e.prototype,"dragAppend",null),kl([Bt],e.prototype,"dragAppendEnd",null),kl([Bt],e.prototype,"updatePointsAfterDrag",null),kl([Bt],e.prototype,"getAdjustStart",null),kl([Bt],e.prototype,"getAdjustEnd",null),kl([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(K1),il=function(){return il=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},il.apply(this,arguments)},Hr=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},jP=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lh=(function(){function t(e,n){var o;this.BaseType=da.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Ju.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=Wo.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=bo.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=(o=e.properties)!==null&&o!==void 0?o:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var n=this,o=n.x,r=o===void 0?0:o,i=n.y,a=i===void 0?0:i;this.transform=new Dw(-r,-a).rotate(e).translate(r,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(e){var n=this;if(e.properties||(e.properties={}),!e.id){var o=this.graphModel.idGenerator,r=o&&o(e.type),i=this.createId();e.id=i||r||xh()}this.formatText(e),Xo(this,dJ(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||I_()),l.on("overlap:change",function(f){var h=f.overlapMode;n.updateZIndexByOverlap(h,n.zIndex||I_())})},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(e){this.textMode=e},t.prototype.formatText=function(e){var n,o,r,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,s=i.nodeTextEdit,l=e.x,f=e.y,h=e.text,v={value:"",x:l,y:f,draggable:a,editable:s};h&&(typeof h=="string"?v.value=h:(v=il(il({},v),{x:(n=h.x)!==null&&n!==void 0?n:l,y:(o=h.y)!==null&&o!==void 0?o:f,value:(r=h.value)!==null&&r!==void 0?r:""}),Xv(h.draggable)||(v.draggable=h.draggable),Xv(h.editable)||(v.editable=h.editable))),e.text=v},t.prototype.resize=function(e){var n=e.width,o=e.height,r=e.deltaX,i=e.deltaY,a=this.isAllowResizeNode(r,i,n,o);return a?(this.move(r/2,i/2),this.width=n,this.height=o,this.setProperties({width:n,height:o}),this.getData()):this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var e=this.text,n=e.x,o=e.y,r=e.value,i=this.properties;Um(i)&&(i=Hc(i)),ws(i.width)&&(i.width=this.width),ws(i.height)&&(i.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),[vl.INCREASE,vl.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),r&&(a.text={x:n,y:o,value:r}),a},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return Hc(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return il(il({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,n=this.properties.textStyle,o=n===void 0?{}:n;return il(il({},to(e)),to(o))},t.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return to(e)},t.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return to(e)},t.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline;return to(e)},t.prototype.getAnchorStyle=function(e){var n=this.graphModel.theme.anchor;return to(n)},t.prototype.getAnchorLineStyle=function(e){var n=this.graphModel.theme.anchorLine;return to(n)},t.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return to(e)},t.prototype.isAllowConnectedAsSource=function(e,n,o,r){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var f=i[l];if(!f.validate.call(this,this,e,n,o,r)){a=!1,s=f.message;break}}return{isAllPass:a,msg:s}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(e,n,o,r){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var f=i[l];if(!f.validate.call(this,e,this,n,o,r)){a=!1,s=f.message;break}}return{isAllPass:a,msg:s}},t.prototype.isAllowMoveNode=function(e,n){var o,r,i=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=jP(s),f=l.next();!f.done;f=l.next()){var h=f.value,v=h(this,e,n);if(!v)return!1;if(typeof v=="object"){var _=v;if(!_.x&&!_.y)return!1;i=i&&_.x,a=a&&_.y}}}catch(E){o={error:E}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return{x:i,y:a}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var e=this,n=e.anchorsOffset,o=e.id,r=e.x,i=e.y;return n&&n.length>0?n.map(function(a,s){return a.length?(a=a,{id:"".concat(o,"_").concat(s),x:r+a[0],y:i+a[1]}):(a=a,il(il({},a),{x:r+a.x,y:i+a.y,id:a.id||"".concat(o,"_").concat(s)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return sJ(e,this)},t.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),n=this,o=n.x,r=n.y,i=n.rotate;return e.forEach(function(a){var s=a.x,l=a.y,f=hQ(new ib([s,l,1]).translate(-o,-r).rotate(i).translate(o,r)[0],2),h=f[0],v=f[1];a.x=h,a.y=v}),e},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(e){if(!ws(e))for(var n=0;n<this.anchors.length;n++){var o=this.anchors[n];if(o.id===e)return o}},t.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},t.prototype.isAllowMoveByXORY=function(e,n,o){var r,i;if(o)r=!0,i=!0;else{var a=this.isAllowMoveNode(e,n);typeof a=="boolean"?(r=a,i=a):(r=a.x,i=a.y)}return{isAllowMoveX:r,isAllowMoveY:i}},t.prototype.move=function(e,n,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(e,n,o),i=r.isAllowMoveX,a=r.isAllowMoveY;return i&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+n,this.text&&this.moveText(0,n)),(i||a)&&(this.rotate=this._rotate),i||a},t.prototype.getMoveDistance=function(e,n,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(e,n,o),i=r.isAllowMoveX,a=r.isAllowMoveY,s=0,l=0;return i&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),l=n),this.transform=new Dw(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},t.prototype.moveTo=function(e,n,o){o===void 0&&(o=!1);var r=e-this.x,i=n-this.y;return!o&&!this.isAllowMoveNode(r,i)?!1:(this.text&&this.moveText(r,i),this.x=e,this.y=n,!0)},t.prototype.moveText=function(e,n){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+e,y:i+n}},t.prototype.updateText=function(e){this.text=il(il({},Hc(this.text)),{value:e})},t.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},t.prototype.isAllowResizeNode=function(e,n,o,r){var i,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=jP(s),f=l.next();!f.done;f=l.next()){var h=f.value,v=h(this,e,n,o,r);if(!v)return!1}}catch(_){i={error:_}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!0},t.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},t.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},t.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},t.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},t.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},t.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},t.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},t.prototype.setElementState=function(e,n){this.state=e,this.additionStateData=n},t.prototype.updateProperties=function(e,n){var o=Hc(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(hr.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:o,properties:e})},t.prototype.setProperty=function(e,n){var o=Hc(this.properties),r=to(o);Pj(r,e,Jl(n)),this.updateProperties(r,[e])},t.prototype.setProperties=function(e){var n=Hc(this.properties),o=il(il({},n),Jl(e)),r=[];YL(e,function(i,a){(hw(n,a)&&n[a]!==i||!hw(n,a))&&r.push(a)}),this.updateProperties(o,r)},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setStyle=function(e,n){var o;this.style=il(il({},this.style),(o={},o[e]=Jl(n),o))},t.prototype.setStyles=function(e){this.style=il(il({},this.style),Jl(e))},t.prototype.updateStyles=function(e){this.style=il({},Jl(e))},t.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},t.prototype.updateAttributes=function(e){Xo(this,e)},t.prototype.updateZIndexByOverlap=function(e,n){switch(e){case vl.DEFAULT:this.zIndex=1;break;case vl.EDGE_TOP:this.zIndex=0;break;case vl.INCREASE:this.zIndex=n;break}},t.BaseType=da.NODE,Hr([Ut],t.prototype,"type",void 0),Hr([Ut],t.prototype,"x",void 0),Hr([Ut],t.prototype,"y",void 0),Hr([Ut],t.prototype,"textMode",void 0),Hr([Ut],t.prototype,"text",void 0),Hr([Ut],t.prototype,"properties",void 0),Hr([Ut],t.prototype,"_width",void 0),Hr([Ut],t.prototype,"_height",void 0),Hr([Ut],t.prototype,"anchorsOffset",void 0),Hr([Ut],t.prototype,"isSelected",void 0),Hr([Ut],t.prototype,"isHovered",void 0),Hr([Ut],t.prototype,"isShowAnchor",void 0),Hr([Ut],t.prototype,"isDragging",void 0),Hr([Ut],t.prototype,"isHitable",void 0),Hr([Ut],t.prototype,"isHittable",void 0),Hr([Ut],t.prototype,"draggable",void 0),Hr([Ut],t.prototype,"visible",void 0),Hr([Ut],t.prototype,"rotatable",void 0),Hr([Ut],t.prototype,"resizable",void 0),Hr([Ut],t.prototype,"zIndex",void 0),Hr([Ut],t.prototype,"state",void 0),Hr([Ut],t.prototype,"autoToFront",void 0),Hr([Ut],t.prototype,"style",void 0),Hr([Ut],t.prototype,"transform",void 0),Hr([Ut],t.prototype,"_rotate",void 0),Hr([Ai],t.prototype,"incoming",null),Hr([Ai],t.prototype,"outgoing",null),Hr([Bt],t.prototype,"setTextMode",null),Hr([Bt],t.prototype,"addNodeMoveRules",null),Hr([Bt],t.prototype,"move",null),Hr([Bt],t.prototype,"getMoveDistance",null),Hr([Bt],t.prototype,"moveTo",null),Hr([Bt],t.prototype,"moveText",null),Hr([Bt],t.prototype,"updateText",null),Hr([Bt],t.prototype,"addNodeResizeRules",null),Hr([Bt],t.prototype,"setSelected",null),Hr([Bt],t.prototype,"setHovered",null),Hr([Bt],t.prototype,"setIsShowAnchor",null),Hr([Bt],t.prototype,"setRotatable",null),Hr([Bt],t.prototype,"setResizable",null),Hr([Bt],t.prototype,"setHitable",null),Hr([Bt],t.prototype,"setHittable",null),Hr([Bt],t.prototype,"setElementState",null),Hr([Bt],t.prototype,"setProperty",null),Hr([Bt],t.prototype,"setProperties",null),Hr([Bt],t.prototype,"deleteProperty",null),Hr([Bt],t.prototype,"setStyle",null),Hr([Bt],t.prototype,"setStyles",null),Hr([Bt],t.prototype,"updateStyles",null),Hr([Bt],t.prototype,"setZIndex",null),Hr([Bt],t.prototype,"updateAttributes",null),Hr([Bt],t.prototype,"updateZIndexByOverlap",null),t})(),vQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),o_=function(){return o_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o_.apply(this,arguments)},oS=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},$w=(function(t){vQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.CIRCLE_NODE,r.r=50,r.initNodeData(n),r.setAttributes(),r}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties.r;n&&(this.r=n)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.circle,r=this.properties.style,i=r===void 0?{}:r;return o_(o_(o_({},n),to(o)),to(i))},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.r;return[{x:o,y:r-i,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+i,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.deltaX,i=n.deltaY;return this.move(r/2,i/2),this.r=o,this.setProperties({r:o}),this.getData()},oS([Ut],e.prototype,"r",void 0),oS([Ai],e.prototype,"width",null),oS([Ai],e.prototype,"height",null),e})(Lh),gQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),i_=function(){return i_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},i_.apply(this,arguments)},om=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},O0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},XA=(function(t){gQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.DIAMOND_NODE,r.rx=30,r.ry=50,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.diamond,r=this.properties.style,i=r===void 0?{}:r;return i_(i_(i_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"points",{get:function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[[o,r-a],[o+i,r],[o,r+a],[o-i,r]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return tc(this.points,function(n){var o=O0(n,2),r=o[0],i=o[1];return{x:r,y:i}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,1),a=i[0];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return ri(this.points,function(r){var i=O0(r,2),a=i[1];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this;return tc(this.points,function(o,r){var i=O0(o,2),a=i[0],s=i[1];return{x:a,y:s,id:"".concat(n.id,"_").concat(r)}})},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},om([Ut],e.prototype,"rx",void 0),om([Ut],e.prototype,"ry",void 0),om([Ai],e.prototype,"points",null),om([Ai],e.prototype,"pointsPosition",null),om([Ai],e.prototype,"width",null),om([Ai],e.prototype,"height",null),e})(Lh),mQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),a_=function(){return a_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},a_.apply(this,arguments)},S0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},YA=(function(t){mQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.ELLIPSE_NODE,r.rx=30,r.ry=45,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.rx,r=n.ry;o&&(this.rx=o),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.ellipse,r=this.properties.style,i=r===void 0?{}:r;return a_(a_(a_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.rx,a=n.ry;return[{x:o,y:r-a,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(n){var o=n.width,r=n.height,i=n.deltaX,a=n.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},S0([Ut],e.prototype,"rx",void 0),S0([Ut],e.prototype,"ry",void 0),S0([Ai],e.prototype,"width",null),S0([Ai],e.prototype,"height",null),e})(Lh),yQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l_=function(){return l_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},l_.apply(this,arguments)},A0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},M0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Uw=(function(t){yQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.POLYGON_NODE,r.points=[[50,0],[100,50],[50,100],[0,50]],r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.points,r=n.width,i=n.height,a=o||this.points;this.points=rJ(a,r,i)},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.polygon,r=this.properties.style,i=r===void 0?{}:r;return l_(l_(l_({},n),to(o)),to(i))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return this.points.map(function(s){return{x:s[0]+o-i/2,y:s[1]+r-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,1),a=i[0];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=M0(r,2),a=i[1];a<n&&(n=a),a>o&&(o=a)}),o-n},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var n=this,o=this,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points;return l.map(function(f,h){var v=M0(f,2),_=v[0],E=v[1];return{x:r+_-a/2,y:i+E-s/2,id:"".concat(n.id,"_").concat(h)}})},e.prototype.resize=function(n){var o=this,r=n.width,i=n.height,a=n.deltaX,s=n.deltaY;this.move(a/2,s/2);var l=tc(this.points,function(f){var h=M0(f,2),v=h[0],_=h[1];return[v*r/o.width,_*i/o.height]});return this.points=l,this.properties.points=l,this.getData()},A0([Ut],e.prototype,"points",void 0),A0([Ai],e.prototype,"pointsPosition",null),A0([Ai],e.prototype,"width",null),A0([Ai],e.prototype,"height",null),e})(Lh),_Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s_=function(){return s_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s_.apply(this,arguments)},bQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Hm=(function(t){_Q(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.RECT_NODE,r.radius=0,r.initNodeData(n),r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height,i=n.radius,a=this.getNodeStyle().radius;ws(o)||(this.width=o),ws(r)||(this.height=r),ws(i)||(this.radius=i),ws(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this),o=this.graphModel.theme.rect,r=this.properties.style,i=r===void 0?{}:r;return s_(s_(s_({},n),to(o)),to(i))},bQ([Ut],e.prototype,"radius",void 0),e})(Lh),wQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u_=function(){return u_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},u_.apply(this,arguments)},LP=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},EQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},xQ=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},IP=(function(t){wQ(e,t);function e(){var n=t.apply(this,xQ([],EQ(arguments),!1))||this;return n.modelType=bo.TEXT_NODE,n}return e.prototype.getTextStyle=function(){var n=t.prototype.getTextStyle.call(this),o=this.graphModel.theme.text,r=this.properties.textStyle;return u_(u_(u_({},n),to(o)),to(r))},Object.defineProperty(e.prototype,"width",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=TP({rows:n,fontSize:o,rowsLength:n.length}).width;return r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var n=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=TP({rows:n,fontSize:o,rowsLength:n.length}).height;return r},enumerable:!1,configurable:!0}),LP([Ai],e.prototype,"width",null),LP([Ai],e.prototype,"height",null),e})(Lh),OQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),qA=(function(t){OQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=bo.HTML_NODE,r.setAttributes(),r}return e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var n=this.properties,o=n.width,r=n.height;o&&(this.width=o),r&&(this.height=r)},e.prototype.getDefaultAnchor=function(){var n=this,o=n.x,r=n.y,i=n.width,a=n.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},e})(Lh),Jo=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},SQ={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},T0=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],AQ=(function(){function t(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=Ju.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Ju.TEXT,this.edgeTextMode=Ju.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Xo(this,this.computeConfig(e))}return t.prototype.updateEditConfig=function(e){var n=this.computeConfig(e);Xo(this,n)},t.prototype.computeConfig=function(e){var n=e.isSilentMode,o=e.textDraggable,r=e.textMode,i=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(n===!1&&Xo(s,this.stagedConfig),n===!0&&n!==this.isSilentMode){var l=Vv(SQ,T0);this.stagedConfig=Vv(this,T0),Xo(s,l)}Xv(i)||Xo(s,{nodeTextEdit:i,edgeTextEdit:i}),Xv(o)||Xo(s,{nodeTextDraggable:o,edgeTextDraggable:o}),r&&Xo(s,{nodeTextMode:r,edgeTextMode:r}),gw(a)&&Xo(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var f=Vv(e,T0);return Xo(s,f)},t.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},t.prototype.getConfig=function(){return Vv(this,T0)},Jo([Ut],t.prototype,"isSilentMode",void 0),Jo([Ut],t.prototype,"stopZoomGraph",void 0),Jo([Ut],t.prototype,"stopMoveGraph",void 0),Jo([Ut],t.prototype,"stopScrollGraph",void 0),Jo([Ut],t.prototype,"snapGrid",void 0),Jo([Ut],t.prototype,"textMode",void 0),Jo([Ut],t.prototype,"textEdit",void 0),Jo([Ut],t.prototype,"textDraggable",void 0),Jo([Ut],t.prototype,"nodeTextEdit",void 0),Jo([Ut],t.prototype,"nodeTextDraggable",void 0),Jo([Ut],t.prototype,"nodeTextMultiple",void 0),Jo([Ut],t.prototype,"nodeTextVertical",void 0),Jo([Ut],t.prototype,"nodeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextMode",void 0),Jo([Ut],t.prototype,"edgeTextEdit",void 0),Jo([Ut],t.prototype,"edgeTextDraggable",void 0),Jo([Ut],t.prototype,"edgeTextMultiple",void 0),Jo([Ut],t.prototype,"edgeTextVertical",void 0),Jo([Ut],t.prototype,"hideAnchors",void 0),Jo([Ut],t.prototype,"allowRotate",void 0),Jo([Ut],t.prototype,"allowResize",void 0),Jo([Ut],t.prototype,"hoverOutline",void 0),Jo([Ut],t.prototype,"nodeSelectedOutline",void 0),Jo([Ut],t.prototype,"adjustNodePosition",void 0),Jo([Ut],t.prototype,"autoExpand",void 0),Jo([Ut],t.prototype,"adjustEdge",void 0),Jo([Ut],t.prototype,"adjustEdgeMiddle",void 0),Jo([Ut],t.prototype,"adjustEdgeStartAndEnd",void 0),Jo([Ut],t.prototype,"adjustEdgeStart",void 0),Jo([Ut],t.prototype,"adjustEdgeEnd",void 0),Jo([Ut],t.prototype,"edgeSelectedOutline",void 0),Jo([Bt],t.prototype,"updateEditConfig",null),Jo([Bt],t.prototype,"updateTextMode",null),t})(),MQ="*",TQ=(function(){function t(){this._events={}}return t.prototype.on=function(e,n,o){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r._events[i]||(r._events[i]=[]),r._events[i].push({callback:n,once:!!o})})},t.prototype.once=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){r=r.trim(),o.on(r,n,!0)})},t.prototype.emit=function(e,n){var o=this;e==null||e.split(",").forEach(function(r){var i=o._events[r]||[],a=o._events[MQ]||[],s=function(l){for(var f=l.length,h=0;h<f;h++)if(l[h]){var v=l[h],_=v.callback,E=v.once;E&&(l.splice(h,1),l.length===0&&delete o._events[r],f--,h--),_.apply(o,[n])}};s(i),s(a)})},t.prototype.off=function(e,n){var o=this;e||(this._events={}),e.split(",").forEach(function(r){if(!n)delete o._events[r];else{for(var i=o._events[r]||[],a=i.length,s=0;s<a;s++)i[s].callback===n&&(i.splice(s,1),a--,s--);i.length===0&&delete o._events[r]}})},t.prototype.getEvents=function(){return this._events},t.prototype.destroy=function(){this._events={}},t})(),CQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KA=function(){return KA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},KA.apply(this,arguments)},NQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},kQ=(function(t){CQ(e,t);function e(n){var o=t.call(this)||this;o.stepScrollX=0,o.stepScrollY=0,o.onDragging=function(s){var l=s.deltaX,f=s.deltaY;o.setState({isDragging:!0});var h=o.props.graphModel,v=h.transformModel,_=h.editConfigModel;_.stopMoveGraph!==!0&&v.translate(l,f)},o.onDragEnd=function(){o.setState({isDragging:!1})},o.zoomHandler=function(s){var l=o.props,f=l.graphModel,h=f.editConfigModel,v=f.transformModel,_=f.gridSize,E=l.graphModel,O=s.deltaX,w=s.deltaY,S=h.stopScrollGraph,M=h.stopZoomGraph;if(!S&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),o.stepScrollX+=O,o.stepScrollY+=w,Math.abs(o.stepScrollX)>=_){var T=o.stepScrollX%_,B=o.stepScrollX-T;v.translate(-B*v.SCALE_X,0),o.stepScrollX=T}if(Math.abs(o.stepScrollY)>=_){var R=o.stepScrollY%_,P=o.stepScrollY-R;v.translate(0,-P*v.SCALE_Y),o.stepScrollY=R}return}if(!M){s.preventDefault();var $=E.getPointByClient({x:s.clientX,y:s.clientY}),I=$.canvasOverlayPosition,F=I.x,U=I.y;v.zoom(s.deltaY<0,[F,U])}},o.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var f=o.props.graphModel,h=f.selectElements;if(h.size>0&&f.clearSelectElements(),o.state.isDragging)return;f.eventCenter.emit(hr.BLANK_CLICK,{e:s})}},o.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var f=o.props.graphModel,h=f.getPointByClient({x:s.clientX,y:s.clientY});f.eventCenter.emit(hr.BLANK_CONTEXTMENU,{e:s,position:h})}},o.mouseDownHandler=function(s){var l=o.props.graphModel,f=l.eventCenter,h=l.editConfigModel,v=l.transformModel.SCALE_X,_=l.gridSize,E=h.adjustEdge,O=h.adjustNodePosition,w=h.stopMoveGraph,S=s.target,M=!E&&!O;(S.getAttribute("name")==="canvas-overlay"||M)&&(w!==!0?(o.stepDrag.setStep(_*v),o.stepDrag.handleMouseDown(s)):f.emit(hr.BLANK_MOUSEDOWN,{e:s}),o.clickHandler(s))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ac({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),o.state={isDragging:!1},o}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props,i=r.children,a=r.dnd,s=this.state.isDragging;return $t("svg",KA({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:$t("g",{transform:o,children:i})}))},e=NQ([xs],e),e})(ko),TI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),B_=function(){return B_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},B_.apply(this,arguments)},PQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},RQ=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},FP=(function(t){TI(e,t);function e(){var n=t.call(this)||this;return n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,s=i.bezierModel,l=i.type,f=a.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,h=f.x,v=f.y;s.updateAdjustAnchor({x:h,y:v},l),a.eventCenter.emit(hr.EDGE_ADJUST,{data:s.getData()})},n.onDragEnd=function(){var o=n.props.bezierModel;o.isDragging=!1},n.dragHandler=new ac({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.render=function(){var n=this,o=this.props.position,r=o.x,i=o.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return $t(zm,B_({className:"lf-bezier-adjust-anchor",x:r,y:i},s,{onMouseDown:function(l){n.dragHandler.handleMouseDown(l)}}))},e})(ko),DQ=(function(t){TI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(n,o){var r=n.path,i=n.id,a=kM(r),s=RQ(a,4),l=s[0],f=s[1],h=s[2],v=s[3],_=n.getEdgeStyle().adjustLine,E=[];return E.push($t(Gm,B_({x1:l.x,y1:l.y,x2:f.x,y2:f.y},_))),E.push($t(FP,{position:f,bezierModel:n,graphModel:o,type:"sNext"},"".concat(i,"_ePre"))),E.push($t(Gm,B_({x1:v.x,y1:v.y,x2:h.x,y2:h.y},_))),E.push($t(FP,{position:h,bezierModel:n,graphModel:o,type:"ePre"},"".concat(i,"_sNext"))),E},e.prototype.selectedBezierEdge=function(){for(var n=this.props.graphModel,o=n.edges,r=[],i=0;i<o.length;i++){var a=o[i];a.isSelected&&a.modelType===bo.BEZIER_EDGE&&a.draggable&&r.push(this.getBezierAdjust(a,n))}return r},e.prototype.render=function(){return $t("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=PQ([xs],e),e})(ko),jQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),LQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},IQ=(function(t){jQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.background;return $t("div",{className:"lf-background",children:$t("div",{style:lp(n)?n:{},className:"lf-background-area"})})},e=LQ([xs],e),e})(ko),FQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),BQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Sm=(function(t){FQ(e,t);function e(n){var o=t.call(this,n)||this;return o.id=xh(),o.gridOptions=o.props.graphModel.grid,o}return e.prototype.renderDot=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,s=o??{},l=s.color,f=s.thickness,h=f===void 0?2:f,v=Math.min(Math.max(2,h),i/4),_=a?1:0;return $t("g",{fill:l,opacity:_,children:[$t("circle",{cx:0,cy:0,r:v/2}),$t("circle",{cx:0,cy:i,r:v/2}),$t("circle",{cx:i,cy:0,r:v/2}),$t("circle",{cx:i,cy:i,r:v/2})]})},e.prototype.renderMesh=function(){var n=this.gridOptions,o=n.config,r=n.size,i=r===void 0?1:r,a=n.visible,s=o??{},l=s.color,f=s.thickness,h=f===void 0?1:f,v=Math.min(Math.max(1,h),i/2),_="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),E=a?1:0;return $t("path",{d:_,stroke:l,strokeWidth:v/2,opacity:E,fill:"transparent"})},e.prototype.render=function(){var n=this.props.graphModel,o=n.transformModel,r=n.grid;this.gridOptions=r;var i=this.gridOptions,a=i.type,s=i.size,l=s===void 0?1:s,f=o.SCALE_X,h=o.SKEW_Y,v=o.SKEW_X,_=o.SCALE_Y,E=o.TRANSLATE_X,O=o.TRANSLATE_Y,w=[f,h,v,_,E,O].join(","),S="matrix(".concat(w,")");return $t("div",{className:"lf-grid",children:$t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[$t("defs",{children:$t("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:S,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),$t("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=BQ([xs],e),e})(ko);(function(t){t.defaultProps={size:DZ,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function e(n){var o=to(t.defaultProps);return typeof n=="number"?Xo(o,{size:n}):typeof n=="boolean"?Xo(o,{visible:n}):Xo(o,n)}t.getGridOptions=e})(Sm||(Sm={}));var $Q=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),UQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},VQ=(function(t){$Q(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.graphModel.transformModel,o=n.getTransformStyle().transform,r=this.props.children;return $t("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:$t("g",{transform:o,children:r})})},e=UQ([xs],e),e})(ko),WQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),ph=function(){return ph=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},ph.apply(this,arguments)},GQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},zQ=(function(t){WQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getNodesOutline=function(){var n=this.props.graphModel,o=n.nodes,r=n.editConfigModel,i=r.hoverOutline,a=r.nodeSelectedOutline,s=[];return o.forEach(function(l){if(l.isHovered||l.isSelected){var f=l.isHovered,h=l.isSelected,v=l.x,_=l.y,E=l.width,O=l.height;if(a&&h||i&&f){var w=l.getOutlineStyle()||{},S={};if(Object.keys(w).forEach(function(T){T!=="hover"&&(S[T]=w[T])}),f){var M=w.hover;S=ph(ph({},S),M)}s.push($t(qu,ph({transform:l.transform,className:"lf-outline-node",x:v,y:_,width:E+10,height:O+10},S)))}}}),s},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,o=n.edges,r=n.editConfigModel,i=r.edgeSelectedOutline,a=r.hoverOutline,s=[],l=0;l<o.length;l++){var f=o[l];(i&&f.isSelected||a&&f.isHovered)&&(f.modelType===bo.LINE_EDGE?s.push(this.getLineOutline(f)):f.modelType===bo.POLYLINE_EDGE?s.push(this.getPolylineOutline(f)):f.modelType===bo.BEZIER_EDGE&&s.push(this.getBezierOutline(f)))}return s},e.prototype.getLineOutline=function(n){var o=n.startPoint,r=n.endPoint,i=(o.x+r.x)/2,a=(o.y+r.y)/2,s=Math.abs(o.x-r.x)+10,l=Math.abs(o.y-r.y)+10,f=n.getOutlineStyle();return $t(qu,ph({className:"lf-outline-edge",x:i,y:a,width:s,height:l},f))},e.prototype.getPolylineOutline=function(n){var o=n.points,r=Kv(o),i=N_(r,8),a=i.x,s=i.y,l=i.width,f=i.height,h=n.getOutlineStyle();return $t(qu,ph({className:"lf-outline",x:a,y:s,width:l,height:f},h))},e.prototype.getBezierOutline=function(n){var o=n.path,r=kM(o),i=N_(r,8),a=i.x,s=i.y,l=i.width,f=i.height,h=n.getOutlineStyle();return $t(qu,ph({className:"lf-outline",x:a,y:s,width:l,height:f},h))},e.prototype.render=function(){return $t("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=GQ([xs],e),e})(ko),HQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),hh=function(){return hh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},hh.apply(this,arguments)},XQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},YQ=(function(t){HQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var n=this.props.snaplineModel,o=n??{},r=o.position,i=o.isShowHorizontal,a=o.isShowVertical,s=n==null?void 0:n.getStyle(),l=r??{},f=l.x,h=f===void 0?0:f,v=l.y,_=v===void 0?0:v,E=hh(hh({x1:-1e5,y1:_,x2:1e5,y2:_},s),{stroke:i?s==null?void 0:s.stroke:"none"}),O=hh(hh({x1:h,y1:-1e5,x2:h,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return $t("g",{className:"lf-snapline",children:[$t(Gm,hh({},E)),$t(Gm,hh({},O))]})},e=XQ([xs],e),e})(ko),qQ=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),KQ=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ZQ=(function(t){qQ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var n=this.props,o=n.tool,r=n.graphModel,i=r.textEditElement,a=o.getTools(),s=a.map(function(l){return Lr(l,{textEditElement:i,graphModel:r,lf:o.instance})});return o.components=s,s},e.prototype.triggerToolRender=function(){var n=this.props,o=n.tool,r=n.graphModel,i=document.querySelector("#ToolOverlay_".concat(r.flowId)),a=o.getInstance();a.components.forEach(function(s){return s(a,i)}),a.components=[]},e.prototype.render=function(){var n=this.props.graphModel;return $t("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(n.flowId),children:this.getTools()})},e=KQ([xs],e),e})(ko),$c=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},im=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},JQ={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},QQ=(function(){function t(e,n){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=e;var o=n.stopMoveGraph,r=o===void 0?!1:o;this.updateTranslateLimits(r)}return t.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},t.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},t.prototype.HtmlPointToCanvasPoint=function(e){var n=im(e,2),o=n[0],r=n[1];return[(o-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(e){var n=im(e,2),o=n[0],r=n[1];return[o*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(e,n,o){var r=im(e,2),i=r[0],a=r[1];return[i+n/this.SCALE_X,a+o/this.SCALE_Y]},t.prototype.fixDeltaXY=function(e,n){return[e/this.SCALE_X,n/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},t.prototype.zoom=function(e,n){e===void 0&&(e=!1);var o=this.SCALE_X,r=this.SCALE_Y;return typeof e=="number"?(o=e,r=e):e?(o+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(o-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),o<this.MINI_SCALE_SIZE||o>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(n&&(this.TRANSLATE_X-=(o-this.SCALE_X)*n[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*n[1]),this.SCALE_X=o,this.SCALE_Y=r,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},t.prototype.emitGraphTransform=function(e){this.eventCenter.emit(hr.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(e,n){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+n<=this.translateLimitMaxY&&this.TRANSLATE_Y+n>=this.translateLimitMinY&&(this.TRANSLATE_Y+=n),this.emitGraphTransform("translate")},t.prototype.focusOn=function(e,n,o,r){var i=im(this.CanvasPointToHtmlPoint([e,n]),2),a=i[0],s=i[1],l=im([o/2-a,r/2-s],2),f=l[0],h=l[1];this.TRANSLATE_X+=f,this.TRANSLATE_Y+=h,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=im(Array.isArray(e)&&e.length===4?e:JQ[e.toString()],4),this.translateLimitMinX=n[0],this.translateLimitMinY=n[1],this.translateLimitMaxX=n[2],this.translateLimitMaxY=n[3]},$c([Ut],t.prototype,"SCALE_X",void 0),$c([Ut],t.prototype,"SKEW_Y",void 0),$c([Ut],t.prototype,"SKEW_X",void 0),$c([Ut],t.prototype,"SCALE_Y",void 0),$c([Ut],t.prototype,"TRANSLATE_X",void 0),$c([Ut],t.prototype,"TRANSLATE_Y",void 0),$c([Ut],t.prototype,"ZOOM_SIZE",void 0),$c([Bt],t.prototype,"zoom",null),$c([Bt],t.prototype,"resetZoom",null),$c([Bt],t.prototype,"translate",null),$c([Bt],t.prototype,"focusOn",null),t})(),eee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),iS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tee=(function(t){eee(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.parentTransform=o.parentTransform,r}return e.prototype.setParentTransform=function(n){this.parentTransform=n},e.prototype.getCumulativeScale=function(){var n=this.SCALE_X,o=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale();n*=r.scaleX,o*=r.scaleY}else n*=this.parentTransform.SCALE_X,o*=this.parentTransform.SCALE_Y;return{scaleX:n,scaleY:o}},e.prototype.getCumulativeTranslate=function(){var n=this.TRANSLATE_X,o=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var r=this.parentTransform.getCumulativeScale(),i=r.scaleX,a=r.scaleY;n=i*n,o=a*o}return{translateX:n,translateY:o}},e.prototype.HtmlPointToCanvasPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[(r-h)/s,(i-v)/l]},e.prototype.CanvasPointToHtmlPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[r*s+h,i*l+v]},e.prototype.moveCanvasPointByHtml=function(n,o,r){var i=iS(n,2),a=i[0],s=i[1],l=this.getCumulativeScale(),f=l.scaleX,h=l.scaleY;return[a+o/f,s+r/h]},e.prototype.fixDeltaXY=function(n,o){var r=this.getCumulativeScale(),i=r.scaleX,a=r.scaleY;return[n/i,o/a]},e})(QQ),Kl=function(){return Kl=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Kl.apply(this,arguments)},dr=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},nee=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ol=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},hu=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},ree=(function(){function t(e){var n=this,o,r;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=vl.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var i=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,f=e.grid,h=e.idGenerator,v=e.edgeGenerator,_=e.animation,E=e.customTrajectory;this.rootEl=i,this.partial=!!a,this.background=l,typeof f=="object"&&e.snapGrid&&(this.gridSize=f.size||1),this.customStyles=e.style||{},this.grid=Sm.getGridOptions(f??!1),this.theme=MI(e.style,e.themeMode),this.theme.grid=to(this.grid),this.theme.background=to(this.background),this.edgeType=e.edgeType||"polyline",this.animation=kZ(_),this.overlapMode=e.overlapMode||vl.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(o=e.width)!==null&&o!==void 0?o:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ws(e.width),this.height=(r=e.height)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ws(e.height);var O=new ResizeObserver(j2((function(w){var S,M;try{for(var T=nee(w),B=T.next();!B.done;B=T.next()){var R=B.value;if(R.target===n.rootEl){var P=document.body.contains(n.rootEl);if(!P)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:R.contentRect})}}}catch($){S={error:$}}finally{try{B&&!B.done&&(M=T.return)&&M.call(T)}finally{if(S)throw S.error}}}),16));O.observe(this.rootEl),this.waitCleanEffects.push(function(){O.disconnect()}),this.eventCenter=new TQ,this.editConfigModel=new AQ(e),this.transformModel=new tee(this.eventCenter,e),this.flowId=xh(),this.idGenerator=h,this.edgeGenerator=tJ(this,v),this.customTrajectory=E}return Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,n,o){return e[n.id]={index:o,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,n,o){return e[n.id]={index:o,model:n},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return hu(hu([],ol(this.nodes),!1),ol(this.edges),!1).reduce(function(e,n){return e[n.id]=n,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var e=function(l){return hu([],ol(l),!1).sort(function(f,h){return f.zIndex-h.zIndex})},n=e(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1)),o=[],r=[-y0,-y0],i=[this.width+y0,this.height+y0],a=0;a<n.length;a++){var s=n[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,r,i,!1,!1))&&o.push(s)}return o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(o){return o.state===Wo.TEXT_EDIT}),n=this.edges.find(function(o){return o.state===Wo.TEXT_EDIT});return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(n){n.isSelected&&e.set(n.id,n)}),this.edges.forEach(function(n){n.isSelected&&e.set(n.id,n)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(n){n.isSelected&&e.push(n)}),e},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(e,n,o,r,i){var a=this;o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1);var s=[];return ri(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1),function(l){var f=a.isElementInArea(l,e,n,o,r);(!i||l.visible)&&f&&s.push(l)}),s},t.prototype.getModel=function(e){return this.modelMap.get(e)},t.prototype.getNodeModelById=function(e){var n;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(n=this.nodesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getPointByClient=function(e){var n=e.x,o=e.y,r=this.rootEl.getBoundingClientRect(),i={x:n-r.left,y:o-r.top},a=ol(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2),s=a[0],l=a[1],f={x:s,y:l};return{domOverlayPosition:i,canvasOverlayPosition:f}},t.prototype.isElementInArea=function(e,n,o,r,i){var a;if(r===void 0&&(r=!0),i===void 0&&(i=!0),e.BaseType===da.NODE){e=e;for(var s=mu(e),l=s.minX,f=s.minY,h=s.maxX,v=s.maxY,_=[{x:l,y:f},{x:h,y:f},{x:h,y:v},{x:l,y:v}],E=i,O=0;O<_.length;O++){var w=_[O],S=w.x,M=w.y;if(a=ol(this.transformModel.CanvasPointToHtmlPoint([S,M]),2),S=a[0],M=a[1],tS([S,M],n,o)!==i){E=!i;break}}return E}if(e.BaseType===da.EDGE){e=e;var T=e.startPoint,B=e.endPoint,R=this.transformModel.CanvasPointToHtmlPoint([T.x,T.y]),P=this.transformModel.CanvasPointToHtmlPoint([B.x,B.y]),$=tS(R,n,o),I=tS(P,n,o);return r?$&&I:$||I}return!1},t.prototype.graphDataToModel=function(e){var n=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=tc(e.nodes,function(r){var i=n.getModelAfterSnapToGrid(r);return n.elementsModelMap.set(i.id,i),n.nodeModelMap.set(i.id,i),i}):this.nodes=[],e.edges){var o=this.edgeType;this.edges=tc(e.edges,function(r){var i,a=n.getModel((i=r.type)!==null&&i!==void 0?i:o);if(!a)throw new Error("找不到".concat(r.type,"对应的边。"));var s=new a(r,n);return n.edgeModelMap.set(s.id,s),n.elementsModelMap.set(s.id,s),s})}else this.edges=[]},t.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(o){var r=o.getData();r&&!o.virtual&&e.push(r)});var n=[];return this.nodes.forEach(function(o){var r=o.getData();r&&!o.virtual&&n.push(r)}),{nodes:n,edges:e}},t.prototype.modelToHistoryData=function(){for(var e=!1,n=[],o=0;o<this.nodes.length;o++){var r=this.nodes[o];if(r.isDragging){e=!0;break}else n.push(r.getHistoryData())}if(e)return!1;for(var i=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){i=!0;break}l.virtual||a.push(l.getHistoryData())}return i?!1:{nodes:n,edges:a}},t.prototype.getEdgeModelById=function(e){var n;return(n=this.edgesMap[e])===null||n===void 0?void 0:n.model},t.prototype.getElement=function(e){return this.modelsMap[e]},t.prototype.getNodeEdges=function(e){for(var n=[],o=0;o<this.edges.length;o++){var r=this.edges[o],i=r.sourceNodeId===e,a=r.targetNodeId===e;(i||a)&&n.push(r)}return n},t.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var n=this.selectElements,o={nodes:[],edges:[]};return n.forEach(function(r){if(r.BaseType===da.NODE&&o.nodes.push(r.getData()),r.BaseType===da.EDGE){var i=r.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(e||a)&&o.edges.push(i)}}),o},t.prototype.updateAttributes=function(e,n){var o=this.getElement(e);o==null||o.updateAttributes(n)},t.prototype.changeNodeId=function(e,n){return n||(n=xh()),this.nodesMap[n]?(console.warn("当前流程图已存在节点".concat(n,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(o){o.sourceNodeId===e&&(o.sourceNodeId=n),o.targetNodeId===e&&(o.targetNodeId=n)}),this.nodesMap[e].model.id=n,this.nodesMap[n]=this.nodesMap[e],n):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},t.prototype.changeEdgeId=function(e,n){return n||(n=xh()),this.edgesMap[n]?(console.warn("当前流程图已存在边: ".concat(n,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(o){o.id===e&&o.changeEdgeId(n)}),n):(console.warn("当前流程图找不到边: ".concat(n,", 修改失败")),"")},t.prototype.getTextModel=function(e){var n=this.editConfigModel,o=n.textMode,r=n.nodeTextMode,i=n.edgeTextMode;if(e.BaseType===da.NODE)return e.textMode||r||o||Ju.TEXT;if(e.BaseType===da.EDGE)return e.textMode||i||o||Ju.TEXT},t.prototype.setOverlapMode=function(e){this.overlapMode=e,this.eventCenter.emit("overlap:change",{overlapMode:e})},t.prototype.setTextMode=function(e,n){this.editConfigModel.updateEditConfig({textMode:e})},t.prototype.setFakeNode=function(e){this.fakeNode=e},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(e,n){return this.modelMap.set(e,n)},t.prototype.toFront=function(e){var n,o,r,i=((n=this.nodesMap[e])===null||n===void 0?void 0:n.model)||((o=this.edgesMap[e])===null||o===void 0?void 0:o.model);if(i){if(this.overlapMode===vl.STATIC)return;if(this.overlapMode===vl.INCREASE){this.setElementZIndex(e,"top");return}(r=this.topElement)===null||r===void 0||r.setZIndex(),i.setZIndex(RZ),this.topElement=i}},t.prototype.setElementZIndex=function(e,n){var o,r,i=((o=this.nodesMap[e])===null||o===void 0?void 0:o.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);if(i){var a=void 0;typeof n=="number"?a=n:(n==="top"&&(a=I_()),n==="bottom"&&(a=sQ())),i.setZIndex(a)}},t.prototype.deleteNode=function(e){var n=this.nodesMap[e].model,o=n.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(hr.NODE_DELETE,{data:o,model:n})},t.prototype.addNode=function(e,n,o){n===void 0&&(n=hr.NODE_ADD);var r=Jl(e),i=r.id;i&&this.nodesMap[i]&&delete r.id;var a=this.getModelAfterSnapToGrid(r);this.nodes.push(a);var s=a.getData(),l={data:s};return o&&(l.e=o),this.eventCenter.emit(n,l),a},t.prototype.getModelAfterSnapToGrid=function(e){var n=this.getModel(e.type),o=this.editConfigModel.snapGrid;if(!n)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var r=e.x,i=e.y;r&&i&&(e.x=Wm(r,this.gridSize,o),e.y=Wm(i,this.gridSize,o),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-r,e.text.y+=e.y-i));var a=new n(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},t.prototype.cloneNode=function(e){var n=this.getNodeModelById(e),o=n==null?void 0:n.getData();if(o){o.x+=30,o.y+=30,o.id="",typeof o.text=="object"&&o.text!==null&&(o.text.x+=30,o.text.y+=30);var r=this.addNode(o);return r.setSelected(!0),n==null||n.setSelected(!1),r.getData()}},t.prototype.moveNode=function(e,n,o,r){var i;r===void 0&&(r=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;i=ol(s.getMoveDistance(n,o,r),2),n=i[0],o=i[1],this.moveEdge(e,n,o)},t.prototype.moveNode2Coordinate=function(e,n,o,r){r===void 0&&(r=!1);var i=this.nodesMap[e];if(!i){console.warn("不存在id为".concat(e,"的节点"));return}var a=i.model,s=a.x,l=a.y,f=n-s,h=o-l;this.moveNode(e,f,h,r)},t.prototype.editText=function(e){this.setElementStateById(e,Wo.TEXT_EDIT)},t.prototype.addEdge=function(e){var n=Jl(e),o=n.type;o||(o=this.edgeType),n.id&&this.edgesMap[n.id]&&(delete n.id,delete n.sourceAnchorId,delete n.targetAnchorId);var r=this.getModel(o);if(!r)throw new Error("找不到".concat(o,"对应的边,请确认是否已注册此类型边。"));var i=new r(Kl(Kl({},n),{type:o}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var a=i.getData();return this.edges.push(i),this.eventCenter.emit(hr.EDGE_ADD,{data:a}),i},t.prototype.moveEdge=function(e,n,o){for(var r=0;r<this.edges.length;r++){var i=this.edges[r],a=i.textPosition,s=a.x,l=a.y,f=this.edges[r].sourceNodeId===e,h=this.edges[r].targetNodeId===e;f&&i.moveStartPoint(n,o),h&&i.moveEndPoint(n,o),(f||h)&&this.handleEdgeTextMove(i,s,l)}},t.prototype.handleEdgeTextMove=function(e,n,o){var r;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===bo.POLYLINE_EDGE&&(!((r=e.text)===null||r===void 0)&&r.value)){var i=e.text,a=yI(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}var s=e.textPosition,l=s.x,f=s.y;e.moveText(l-n,f-o)},t.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var o=0;o<this.edges.length;o++)if(this.edges[o].sourceNodeId===e&&this.edges[o].targetNodeId===n){var r=this.edges[o].getData();this.edges.splice(o,1),o--,this.eventCenter.emit(hr.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeById=function(e){var n=this.edgesMap[e];if(n){var o=this.edgesMap[e].index,r=this.edgesMap[e].model.getData();this.edges.splice(o,1),this.eventCenter.emit(hr.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(hr.EDGE_DELETE,{data:o})}},t.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(hr.EDGE_DELETE,{data:o})}},t.prototype.setElementStateById=function(e,n,o){this.nodes.forEach(function(r){r.id===e?r.setElementState(n,o):r.setElementState(Wo.DEFAULT)}),this.edges.forEach(function(r){r.id===e?r.setElementState(n,o):r.setElementState(Wo.DEFAULT)})},t.prototype.updateText=function(e,n){var o=Ah(hu(hu([],ol(this.nodes),!1),ol(this.edges),!1),function(r){return r.id===e});o==null||o.updateText(n)},t.prototype.selectNodeById=function(e,n){var o;n===void 0&&(n=!1),n||this.clearSelectElements();var r=(o=this.nodesMap[e])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},t.prototype.selectEdgeById=function(e,n){var o;n===void 0&&(n=!1),n||this.clearSelectElements();var r=(o=this.edgesMap[e])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},t.prototype.selectElementById=function(e,n){n===void 0&&(n=!1),n||this.clearSelectElements();var o=this.getElement(e);o==null||o.setSelected(!0)},t.prototype.deselectElementById=function(e){var n=this.getElement(e);n&&n.setSelected(!1)},t.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(n){n==null||n.setSelected(!1)}),this.selectElements.clear(),[vl.DEFAULT,vl.EDGE_TOP].includes(this.overlapMode)&&((e=this.topElement)===null||e===void 0||e.setZIndex())},t.prototype.moveNodes=function(e,n,o,r){var i,a,s,l=this;r===void 0&&(r=!1);for(var f=e.reduce(function(B,R){var P,$=(P=l.nodesMap[R])===null||P===void 0?void 0:P.model;return $&&(B[R]=$.getMoveDistance(n,o,r)),B},{}),h=0;h<this.edges.length;h++){var v=this.edges[h],_=v.textPosition,E=_.x,O=_.y,w=f[v.sourceNodeId],S=f[v.targetNodeId],M=void 0,T=void 0;w&&S&&v.modelType===bo.POLYLINE_EDGE?(i=ol(w,2),M=i[0],T=i[1],v.updatePointsList(M,T)):(w&&(a=ol(w,2),M=a[0],T=a[1],v.moveStartPoint(M,T)),S&&(s=ol(S,2),M=s[0],T=s[1],v.moveEndPoint(M,T))),(w||S)&&this.handleEdgeTextMove(v,E,O)}},t.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},t.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},t.prototype.setDefaultEdgeType=function(e){this.edgeType=e},t.prototype.changeNodeType=function(e,n){var o=this.getNodeModelById(e);if(!o){console.warn("找不到id为".concat(e,"的节点"));return}var r=o.getData();r.type=n;var i=this.getModel(n);if(!i)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));var a=new i(r,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var f=MP(a,l.startPoint,a.width,a.height);l.updateStartPoint(f)}if(l.targetNodeId===e){var f=MP(a,l.endPoint,a.width,a.height);l.updateEndPoint(f)}})},t.prototype.changeEdgeType=function(e,n){var o=this.getEdgeModelById(e);if(!o){console.warn("找不到id为".concat(e,"的边"));return}if(o.type!==n){var r=o.getData();r.type=n;var i=this.getModel(n);if(!i)throw new Error("找不到".concat(n,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var a=new i(r,this);this.edges.splice(this.edgesMap[e].index,1,a)}},t.prototype.getNodeIncomingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.targetNodeId===e&&n.push(o)}),n},t.prototype.getNodeOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.sourceNodeId===e&&n.push(o)}),n},t.prototype.getAnchorIncomingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.targetAnchorId===e&&n.push(o)}),n},t.prototype.getAnchorOutgoingEdge=function(e){var n=[];return this.edges.forEach(function(o){o.sourceAnchorId===e&&n.push(o)}),n},t.prototype.getNodeIncomingNode=function(e){var n=this,o=[];return this.edges.forEach(function(r){var i;r.targetNodeId===e&&o.push((i=n.nodesMap[r.sourceNodeId])===null||i===void 0?void 0:i.model)}),o},t.prototype.getNodeOutgoingNode=function(e){var n=this,o=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&o.push(n.nodesMap[r.targetNodeId].model)}),o},t.prototype.setTheme=function(e,n){var o;if(n&&(j_[n]&&this.updateBackgroundOptions(Kl(Kl({},typeof this.background=="object"?this.background:{}),j_[n])),L_[n]&&this.updateGridOptions(Sm.getGridOptions(Kl(Kl({},this.grid),L_[n])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var r=Sm.getGridOptions((o=e.grid)!==null&&o!==void 0?o:!1);this.updateGridOptions(r)}this.theme=iQ(Kl(Kl({},this.customStyles),e),n),this.customStyles=Kl(Kl({},this.customStyles),e)},t.prototype.getTheme=function(){var e=this,n=e.background,o=e.grid,r=Kl(Kl({},to(this.theme)),{background:n,grid:o});return r},t.prototype.updateGridOptions=function(e){Yv(this.grid,e)},t.prototype.updateGridSize=function(e){this.gridSize=e},t.prototype.updateBackgroundOptions=function(e){gw(e)||gw(this.background)?this.background=e:this.background=Kl(Kl({},this.background),e)},t.prototype.resize=function(e,n){if(this.rootEl){var o=document.body.contains(this.rootEl);if(o){var r=this.rootEl.offsetParent!==null;if(r)try{this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=ws(e),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=ws(n),r&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(i){console.warn("获取画布宽高时发生错误:",i)}}}},t.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},t.prototype.getVirtualRectSize=function(){var e=this.nodes,n=[],o=[];e.forEach(function(_){var E=_.x,O=_.y,w=_.width,S=_.height,M=_.getNodeStyle().strokeWidth,T=M===void 0?0:M,B=E+w/2+T,R=E-w/2-T,P=O+S/2+T,$=O-S/2-T;n=n.concat([B,R].filter(function(I){return!Number.isNaN(I)})),o=o.concat([P,$].filter(function(I){return!Number.isNaN(I)}))});var r=Math.min.apply(Math,hu([],ol(n),!1)),i=Math.max.apply(Math,hu([],ol(n),!1)),a=Math.min.apply(Math,hu([],ol(o),!1)),s=Math.max.apply(Math,hu([],ol(o),!1)),l=i-r||0,f=s-a||0,h=r+l/2,v=a+f/2;return{width:l,height:f,x:h,y:v}},t.prototype.translateCenter=function(){var e=this,n=e.nodes,o=e.width,r=e.height,i=e.rootEl,a=e.transformModel;if(n.length){var s=o||i.clientWidth,l=r||i.clientHeight,f=this.getVirtualRectSize(),h=f.x,v=f.y;a.focusOn(h,v,s,l)}},t.prototype.fitView=function(e,n){e===void 0&&(e=20),n===void 0&&(n=20);var o=this,r=o.nodes,i=o.width,a=o.height,s=o.rootEl,l=o.transformModel;if(r.length){var f=i||s.clientWidth,h=a||s.clientHeight,v=this.getVirtualRectSize(),_=v.width,E=v.height,O=v.x,w=v.y,S=(_+n)/f,M=(E+e)/h,T=1/Math.max(S,M),B=[f/2,h/2];l.zoom(T,B),l.focusOn(O,w,f,h)}},t.prototype.openEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(e){var n=this.getEdgeModelById(e);n==null||n.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(e){this.partial=e},t.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},dr([Ut],t.prototype,"width",void 0),dr([Ut],t.prototype,"height",void 0),dr([Ut],t.prototype,"theme",void 0),dr([Ut],t.prototype,"grid",void 0),dr([Ut],t.prototype,"edgeType",void 0),dr([Ut],t.prototype,"nodes",void 0),dr([Ut],t.prototype,"edges",void 0),dr([Ut],t.prototype,"fakeNode",void 0),dr([Ut],t.prototype,"overlapMode",void 0),dr([Ut],t.prototype,"background",void 0),dr([Ut],t.prototype,"gridSize",void 0),dr([Ut],t.prototype,"transformModel",void 0),dr([Ut],t.prototype,"editConfigModel",void 0),dr([Ut],t.prototype,"partial",void 0),dr([Ai],t.prototype,"nodesMap",null),dr([Ai],t.prototype,"edgesMap",null),dr([Ai],t.prototype,"modelsMap",null),dr([Ai],t.prototype,"sortElements",null),dr([Ai],t.prototype,"textEditElement",null),dr([Ai],t.prototype,"selectElements",null),dr([Ai],t.prototype,"selectNodes",null),dr([Bt],t.prototype,"setOverlapMode",null),dr([Bt],t.prototype,"setTextMode",null),dr([Bt],t.prototype,"setFakeNode",null),dr([Bt],t.prototype,"removeFakeNode",null),dr([Bt],t.prototype,"setModel",null),dr([Bt],t.prototype,"toFront",null),dr([Bt],t.prototype,"setElementZIndex",null),dr([Bt],t.prototype,"deleteNode",null),dr([Bt],t.prototype,"addNode",null),dr([Bt],t.prototype,"cloneNode",null),dr([Bt],t.prototype,"moveNode",null),dr([Bt],t.prototype,"moveNode2Coordinate",null),dr([Bt],t.prototype,"editText",null),dr([Bt],t.prototype,"addEdge",null),dr([Bt],t.prototype,"moveEdge",null),dr([Bt],t.prototype,"deleteEdgeBySourceAndTarget",null),dr([Bt],t.prototype,"deleteEdgeById",null),dr([Bt],t.prototype,"deleteEdgeBySource",null),dr([Bt],t.prototype,"deleteEdgeByTarget",null),dr([Bt],t.prototype,"setElementStateById",null),dr([Bt],t.prototype,"updateText",null),dr([Bt],t.prototype,"selectNodeById",null),dr([Bt],t.prototype,"selectEdgeById",null),dr([Bt],t.prototype,"selectElementById",null),dr([Bt],t.prototype,"deselectElementById",null),dr([Bt],t.prototype,"clearSelectElements",null),dr([Bt],t.prototype,"moveNodes",null),dr([Bt],t.prototype,"setDefaultEdgeType",null),dr([Bt],t.prototype,"changeNodeType",null),dr([Bt],t.prototype,"changeEdgeType",null),dr([Bt],t.prototype,"getNodeIncomingEdge",null),dr([Bt],t.prototype,"getNodeOutgoingEdge",null),dr([Bt],t.prototype,"getAnchorIncomingEdge",null),dr([Bt],t.prototype,"getAnchorOutgoingEdge",null),dr([Bt],t.prototype,"getNodeIncomingNode",null),dr([Bt],t.prototype,"getNodeOutgoingNode",null),dr([Bt],t.prototype,"setTheme",null),dr([Bt],t.prototype,"getTheme",null),dr([Bt],t.prototype,"resize",null),dr([Bt],t.prototype,"clearData",null),dr([Bt],t.prototype,"translateCenter",null),dr([Bt],t.prototype,"fitView",null),dr([Bt],t.prototype,"openEdgeAnimation",null),dr([Bt],t.prototype,"closeEdgeAnimation",null),dr([Bt],t.prototype,"setPartial",null),t})(),Bv=function(){return Bv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Bv.apply(this,arguments)},Iy=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},oee=(function(){function t(e,n){n===void 0&&(n=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=n}return t.prototype.getStyle=function(){return Bv({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(e,n){for(var o=e.x,r=e.y,i=!1,a=!1,s=0;s<n.length;s++){var l=n[s];if(l.id!==e.id&&(Uc(o,l.x,this.epsilon)&&(i=!0),Uc(r,l.y,this.epsilon)&&(a=!0),i&&a))break}return{isShowVertical:i,isShowHorizontal:a,position:{x:o,y:r}}},t.prototype.getHorizontalSnapline=function(e,n){var o=!1,r=0,i=e.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=mu(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=mu(l))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==e.id){var v=mu(h);if(Uc(v.minY,a==null?void 0:a.minY,this.epsilon)||Uc(v.maxY,a==null?void 0:a.minY,this.epsilon)){o=!0,r=a.minY;break}if(Uc(v.minY,a==null?void 0:a.maxY,this.epsilon)||Uc(v.maxY,a==null?void 0:a.maxY,this.epsilon)){o=!0,r=a.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:Bv(Bv({},this.position),{y:r})}},t.prototype.getVerticalSnapline=function(e,n){var o=!1,r=0,i=e.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=mu(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=mu(l))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==e.id){var v=mu(h);if(Uc(v.minX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Uc(v.minX,a==null?void 0:a.minX,this.epsilon)||Uc(v.maxX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Uc(v.minX,a==null?void 0:a.maxX,this.epsilon)||Uc(v.maxX,a==null?void 0:a.maxX,this.epsilon)){o=!0,r=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:Bv(Bv({},this.position),{x:r})}},t.prototype.getSnapLinePosition=function(e,n){var o=this.getCenterSnapLine(e,n),r=o.isShowHorizontal,i=o.isShowVertical;if(!r){var a=this.getHorizontalSnapline(e,n);a.isShowHorizontal&&(o.isShowHorizontal=a.isShowHorizontal,o.position.y=a.position.y)}if(!i){var s=this.getVerticalSnapline(e,n);s.isShowVertical&&(o.isShowVertical=s.isShowVertical,o.position.x=s.position.x)}return o},t.prototype.setSnaplineInfo=function(e){var n=e.isShowHorizontal,o=e.isShowVertical,r=e.position;this.position=r,this.isShowHorizontal=n,this.isShowVertical=o},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(e){var n=this.graphModel.nodes,o=this.getSnapLinePosition(e,n);this.setSnaplineInfo(o)},Iy([Ut],t.prototype,"isShowHorizontal",void 0),Iy([Ut],t.prototype,"isShowVertical",void 0),Iy([Ut],t.prototype,"position",void 0),Iy([Bt],t.prototype,"clearSnapline",null),Iy([Bt],t.prototype,"setNodeSnapLine",null),t})();function Uc(t,e,n){return Math.abs(t-e)<=n}var iee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),aee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},see=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},uee=(function(t){iee(e,t);function e(){var n=t.apply(this,see([],lee(arguments),!1))||this;return n.handleResize=function(){var o=n.props,r=o.graphModel,i=o.options,a=r.width,s=r.height,l=r.isContainerWidth,f=r.isContainerHeight,h=a,v=s,_=!1;l&&(h=void 0,_=!0),f&&(v=void 0,_=!0),_&&r.resize(h,v),i.width=a,i.height=s},n.throttleResize=kj(n.handleResize,200),n}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(hr.GRAPH_UPDATED,{data:n})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(n,o,r){r===void 0&&(r="canvas-overlay");var i=this.props.getView,a=i(n.type);return a?$t(a,{model:n,graphModel:o,overlay:r},n.id):null},e.prototype.render=function(){var n=this,o=this.props,r=o.graphModel,i=o.tool,a=o.options,s=o.dnd,l=o.snaplineModel,f={};a.width&&(f.width="".concat(r.width,"px")),a.height&&(f.height="".concat(r.height,"px"));var h=r.fakeNode,v=r.editConfigModel,_=r.background,E=v.adjustEdge;return $t("div",{className:"lf-graph","flow-id":r.flowId,style:f,children:[$t(kQ,{graphModel:r,dnd:s,children:[$t("g",{className:"lf-base",children:tc(r.sortElements,function(O){return n.getComponent(O,r)})}),h?this.getComponent(h,r):""]}),$t(VQ,{graphModel:r,children:[$t(zQ,{graphModel:r}),E?$t(DQ,{graphModel:r}):"",a.snapline!==!1?$t(YQ,{snaplineModel:l}):""]}),$t(ZQ,{graphModel:r,tool:i}),_&&$t(IQ,{background:_}),$t(Sm,{graphModel:r})]})},e=aee([xs],e),e})(ko),cee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Bd=function(){return Bd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Bd.apply(this,arguments)},dee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fee=(function(t){cee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(o){var r=o.event,i=n.props,a=i.anchorData,s=i.nodeModel,l=i.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(hr.ANCHOR_DRAGSTART,{data:a,e:r,nodeModel:s}),n.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},n.onDragging=function(o){var r=o.event,i=n.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,f=a.transformModel,h=a.eventCenter,v=a.width,_=a.height,E=a.editConfigModel,O=E.autoExpand,w=E.stopMoveGraph;if(r){var S=r.clientX,M=r.clientY,T=a.getPointByClient({x:S,y:M}),B=T.domOverlayPosition,R=B.x,P=B.y,$=T.canvasOverlayPosition,I=$.x,F=$.y;n.t&&Fw(n.t);var U=[],z=10;R<10?U=[z,0]:R+10>v?U=[-z,0]:P<10?U=[0,z]:P+10>_&&(U=[0,-z]),n.setState({endX:I,endY:F,dragging:!0}),n.moveAnchorEnd(I,F),U.length>0&&!w&&O&&(n.t=EI(function(){var X=dee(U,2),Y=X[0],W=X[1];f.translate(Y,W);var Q=n.state,J=Q.endX,ie=Q.endY;n.setState({endX:J-Y,endY:ie-W}),n.moveAnchorEnd(J-Y,ie-W)})),h.emit(hr.ANCHOR_DRAG,{data:l,e:r,nodeModel:s})}},n.onDragEnd=function(o){var r=o.event;n.t&&Fw(n.t);var i=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var a=n.props,s=a.graphModel,l=a.nodeModel,f=a.anchorData;s.eventCenter.emit(hr.ANCHOR_DRAGEND,{data:f,e:r,nodeModel:l,edgeModel:i??void 0})},n.checkEnd=function(o){var r,i=n.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,f=l.x,h=l.y,v=l.id,_=n.state,E=_.endX,O=_.endY,w=_.dragging,S=Lw({x:E,y:O},a);if(n.preTargetNode&&n.preTargetNode.state!==Wo.DEFAULT&&n.preTargetNode.setElementState(Wo.DEFAULT),!!w&&S&&S.node){var M=S.node,T=S.anchor.id,B="".concat(s.id,"_").concat(M.id,"_").concat(T,"_").concat(v),R=n.sourceRuleResults.get(B)||{},P=R.isAllPass,$=R.msg,I=n.targetRuleResults.get(B)||{},F=I.isAllPass,U=I.msg;if(P&&F){M.setElementState(Wo.DEFAULT);var z=a.getNodeModelById(S.node.id),X=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,s.getData(),z==null?void 0:z.getData()),Y=a.addEdge(Bd(Bd({},X),{sourceNodeId:s.id,sourceAnchorId:v,startPoint:{x:f,y:h},targetNodeId:S.node.id,targetAnchorId:S.anchor.id,endPoint:{x:S.anchor.x,y:S.anchor.y}})),W=n.props.anchorData;return a.eventCenter.emit(hr.ANCHOR_DROP,{data:W,e:o,nodeModel:s,edgeModel:Y}),Y}var Q=M.getData();return a.eventCenter.emit(hr.CONNECTION_NOT_ALLOWED,{data:Q,msg:U||$||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new ac({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return e.prototype.getAnchorShape=function(){var n=this.props,o=n.anchorData,r=n.style,i=n.node,a=i.getAnchorShape(o);if(a)return a;var s=o.x,l=o.y,f=Bd(Bd({},r),r==null?void 0:r.hover);return $t("g",{children:[$t(zm,Bd({className:"lf-node-anchor-hover"},f,{x:s,y:l})),$t(zm,Bd({className:"lf-node-anchor"},r,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var n=this.props.graphModel.customTrajectory;return n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var n=this.props,o=n.graphModel,r=o.getAnchorIncomingEdge,i=o.getAnchorOutgoingEdge,a=n.anchorData.id;return{incomingEdgeList:r(a),outgoingEdgeList:i(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(n,o){var r,i,a=this.props,s=a.graphModel,l=a.nodeModel,f=a.anchorData,h=Lw({x:n,y:o},s);if(h){var v=h.node,_=h.anchor.id;if(this.preTargetNode&&this.preTargetNode!==h.node&&this.preTargetNode.setElementState(Wo.DEFAULT),f.id===_)return;this.preTargetNode=v;var E="".concat(l.id,"_").concat(v.id,"_").concat(_,"_").concat(f.id);if(!this.targetRuleResults.has(E)){var O=h.anchor,w=l.isAllowConnectedAsSource(v,f,O),S=v.isAllowConnectedAsTarget(l,f,O);this.sourceRuleResults.set(E,Iw(w)),this.targetRuleResults.set(E,Iw(S))}var M=((r=this.sourceRuleResults.get(E))!==null&&r!==void 0?r:{}).isAllPass,T=((i=this.targetRuleResults.get(E))!==null&&i!==void 0?i:{}).isAllPass;M&&T?v.setElementState(Wo.ALLOW_CONNECT):v.setElementState(Wo.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Wo.DEFAULT&&this.preTargetNode.setElementState(Wo.DEFAULT)},e.prototype.isShowLine=function(){var n=this.state,o=n.startX,r=n.startY,i=n.endX,a=n.endY,s=qc(o,r,i,a);return s>10},e.prototype.render=function(){var n=this,o=this.state,r=o.startX,i=o.startY,a=o.endX,s=o.endY,l=this.props,f=l.anchorData,h=l.edgeStyle,v=l.nodeModel,_=l.graphModel,E=f.edgeAddable;return $t("g",{className:"lf-anchor",children:[$t("g",{onClick:function(O){O.stopPropagation(),_.eventCenter.emit(hr.ANCHOR_CLICK,{data:f,e:O,nodeModel:v})},onMouseDown:function(O){_.eventCenter.emit(hr.ANCHOR_MOUSEDOWN,{data:f,e:O,nodeModel:v}),E!==!1&&n.dragHandler.handleMouseDown(O)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Bd({sourcePoint:{x:r,y:i},targetPoint:{x:a,y:s}},h)):$t(Gm,Bd({x1:r,y1:i,x2:a,y2:s},h,{"pointer-events":"none"})))]})},e})(ko),pee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),ZA=function(){return ZA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},ZA.apply(this,arguments)},hee=(function(t){pee(e,t);function e(n){var o=t.call(this,n)||this;return o.style={},o.onDragging=function(r){var i,a=r.event,s=o.props,l=s.graphModel,f=s.nodeModel,h=s.eventCenter,v=l.selectNodes,_=f.x,E=f.y,O=a.clientX,w=a.clientY,S=l.getPointByClient({x:O,y:w}).canvasOverlayPosition,M=S.x,T=S.y,B=new Il(M-_,T-E),R=((i=o.normal)===null||i===void 0?void 0:i.angle(B))-o.defaultAngle,P=new Dw(-_,-E).rotate(R).translate(_,E).toString();f.transform=P,f.rotate=R;var $=tc(v,function(F){return F.id});$.indexOf(f.id)===-1&&($=[f.id]);var I=Wj($,function(F,U){var z=l.getNodeModelById(U);return F[U]=z==null?void 0:z.getMoveDistance(0,0,!1),F},{});$.forEach(function(F){var U=l.getNodeEdges(F);U.forEach(function(z){if(I[z.sourceNodeId]){var X=l.getNodeModelById(z.sourceNodeId),Y=X.anchors.find(function(W){return W.id===z.sourceAnchorId});z.updateStartPoint(Y)}if(I[z.targetNodeId]){var X=l.getNodeModelById(z.targetNodeId),Y=X.anchors.find(function(J){return J.id===z.targetAnchorId});z.updateEndPoint(Y)}})}),h.emit(hr.NODE_ROTATE,{e:a,model:f,data:f.getData()})},o.style=n.style,o.stepperDrag=new ac({onDragging:o.onDragging}),o}return e.prototype.render=function(){var n=this,o=this.props.nodeModel,r=o.x,i=o.y,a=o.width,s=o.height,l=r+a/2+20,f=i-s/2-20;return this.normal=new Il(1,0),this.defaultAngle=this.normal.angle(new Il(l-r,f-i)),o.defaultAngle=this.defaultAngle,$t("g",{className:"lf-rotate-control",children:$t("g",{onMouseDown:function(h){n.stepperDrag.handleMouseDown(h)},children:$t(zm,ZA({},this.style,{cx:l,cy:f}))})})},e})(ko),aS={exports:{}};/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/var BP;function vee(){return BP||(BP=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)e.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(aS)),aS.exports}var gee=vee();const JA=Z_(gee);var mee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),QA=function(){return QA=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},QA.apply(this,arguments)},yee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},CI=(function(t){mee(e,t);function e(n){var o=t.call(this)||this;o.mouseDownHandler=function(i){var a=o.props,s=a.draggable,l=a.model,f=a.graphModel,h=f.editConfigModel.nodeTextDraggable;(s??h)&&(i.stopPropagation(),o.stepperDrag.model=l,o.stepperDrag.handleMouseDown(i))},o.onDragging=function(i){var a=i.deltaX,s=i.deltaY,l=o.props,f=l.model,h=l.graphModel.transformModel;if(a||s){var v=yee(h.fixDeltaXY(a,s),2),_=v[0],E=v[1];f.moveText(_,E)}},o.dbClickHandler=function(){var i=o.props,a=i.editable,s=i.graphModel.eventCenter,l=i.model;a&&l.setElementState(Wo.TEXT_EDIT),s.emit(hr.TEXT_DBCLICK,{data:l.text,model:l})};var r=n.draggable;return o.stepperDrag=new ac({onDragging:o.onDragging,step:1,eventType:"TEXT",isStopPropagation:r}),o}return e.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=o.text,s=a.value,l=a.x,f=a.y,h=a.editable,v=a.draggable,_={x:l,y:f,className:"",value:s},E=o.getTextStyle(),O=i.nodeTextDraggable||v;return $t(xI,QA({},_,E,{className:JA({"lf-element-text":h,"lf-text-draggable":!h&&O,"lf-text-disabled":!h&&!O}),model:o}))},e.prototype.render=function(){var n=this.props.model.text;if(n)return $t("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e})(ko),_ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Wc=function(){return Wc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Wc.apply(this,arguments)},C0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},bee=(function(t){_ee(e,t);function e(n){var o=t.call(this,n)||this;return o.setHoverOn=function(){o.setState({isHovered:!0})},o.setHoverOff=function(){o.setState({isHovered:!1})},o.state={isHovered:!1},o}return e.prototype.getBackground=function(){var n=this.state.isHovered,o=this.props.model,r=o.text,i=o.getTextStyle(),a=i.background||{};if(n&&i.hover&&i.hover.background&&(a=Wc(Wc({},a),i.hover.background)),r!=null&&r.value&&(a==null?void 0:a.fill)!=="transparent"){var s=i.fontSize,l=i.textWidth,f=i.lineHeight,h=i.overflowMode,v=a.wrapPadding,_=r==null?void 0:r.value.split(/[\r\n]/g),E=_.length,O=r.x,w=r.y,S={};if(h==="autoWrap"&&l){var M=wI({rows:_,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:f,padding:v},rowsLength:E,className:"lf-get-text-height"});S=Wc(Wc({},a),{x:O,y:w,width:l,height:M})}else{var T=nJ({rows:_,rowsLength:E,fontSize:s}),B=T.width,R=T.height;if(h==="ellipsis"&&(B=l,R=s+2),typeof a.wrapPadding=="string"){var P=a.wrapPadding.split(",").filter(function(Pe){return Pe.trim()}).map(function(Pe){return parseFloat(Pe.trim())});if(P.length>0&&P.length<=4){if(P.length===1){var $=C0(P,1),I=$[0];P=[I,I,I,I]}else if(P.length===2){var F=C0(P,2),U=F[0],z=F[1];P=[U,z,U,z]}else if(P.length===3){var X=C0(P,3),Y=X[0],z=X[1],W=X[2];P=[Y,z,W,z]}var Q=C0(P,4),J=Q[0],ie=Q[1],Se=Q[2],Ae=Q[3];B+=ie+Ae,R+=J+Se,O=O+(ie-Ae)/2,w=w+(Se-J)/2}}S=Wc(Wc({},a),{x:O-1,y:w-1,width:B,height:R})}return $t(qu,Wc({},S))}return null},e.prototype.getShape=function(){var n=this.props.model,o=n.text,r=o.x,i=o.y,a=o.value;if(!a)return null;var s=n.getTextStyle(),l=Wc({x:r,y:i,value:a,model:n,className:"lf-element-text"},s);return $t("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),$t(xI,Wc({},l))]})},e})(CI),wee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Vw=function(){return Vw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Vw.apply(this,arguments)},Eee=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},N0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ih=(function(t){wee(e,t);function e(n){var o=t.call(this)||this;o.onDragStart=function(l){var f=l.event,h=o.props,v=h.model,_=h.graphModel;if(f){var E=_.getPointByClient({x:f.clientX,y:f.clientY}).canvasOverlayPosition,O=E.x,w=E.y;o.moveOffset={dx:v.x-O,dy:v.y-w}}},o.onDragging=function(l){var f,h,v,_,E=l.event,O=o.props,w=O.model,S=O.graphModel,M=S.editConfigModel,T=M.stopMoveGraph,B=M.autoExpand,R=M.snapGrid,P=S.transformModel,$=S.selectNodes,I=S.width,F=S.height,U=S.gridSize;w.isDragging=!0;var z=E,X=z.clientX,Y=z.clientY,W=o.mouseDownPosition,Q=W.x,J=W.y;(X-Q>U||Y-J>U)&&(w.isDragging=!0);var ie=S.getPointByClient({x:X,y:Y}).canvasOverlayPosition,Se=ie.x,Ae=ie.y,Pe=N0(P.CanvasPointToHtmlPoint([Se,Ae]),2),De=Pe[0],He=Pe[1];if(Se=Se+((h=(f=o.moveOffset)===null||f===void 0?void 0:f.dx)!==null&&h!==void 0?h:0),Ae=Ae+((_=(v=o.moveOffset)===null||v===void 0?void 0:v.dy)!==null&&_!==void 0?_:0),Se=Wm(Se,U,R),Ae=Wm(Ae,U,R),!I||!F){S.moveNode2Coordinate(w.id,Se,Ae);return}var Ye=De<0||He<0||De>I||He>F;if(!(B&&!T&&Ye)){var Be=N0(P.CanvasPointToHtmlPoint([Se-w.width/2,Ae-w.height/2]),2),Je=Be[0],mt=Be[1],le=N0(P.CanvasPointToHtmlPoint([Se+w.width/2,Ae+w.height/2]),2),Ze=le[0],pe=le[1],se=Math.max(U,20),we=[];Je<0?we=[se,0]:Ze>S.width?we=[-se,0]:mt<0?we=[0,se]:pe>S.height&&(we=[0,-se]),o.t&&Fw(o.t);var $e=$.map(function(rt){return rt.id});$e.indexOf(w.id)===-1&&($e=[w.id]),we.length>0&&!T&&B?o.t=EI(function(){var rt=N0(we,2),pt=rt[0],Lt=rt[1];P.translate(pt??0,Lt??0);var Jt=-(pt??0)/P.SCALE_X,en=-(Lt??0)/P.SCALE_X;S.moveNodes($e,Jt,en)}):S.moveNodes($e,Se-w.x,Ae-w.y)}},o.onDragEnd=function(){o.t&&Fw(o.t);var l=o.props.model;l.isDragging=!1},o.onMouseOut=function(l){PZ()&&o.setHoverOff(l)},o.handleMouseUp=function(){var l=o.props.model;o.mouseUpDrag=l.isDragging},o.handleClick=function(l){var f=o.mouseUpDrag===!1,h=new Date().getTime();if(o.startTime){var v=h-o.startTime,_=o.props,E=_.model,O=_.graphModel;if(!(!f&&v>300)){f||(o.onDragEnd(),o.handleMouseUp());var w=E.getData(),S=O.getPointByClient({x:l.clientX,y:l.clientY}),M={data:w,e:l,position:S,isSelected:!1,isMultiple:!1},T=l.button===2,B=l.detail===2;if(!T){var R=O.editConfigModel,P=_I(l,R);if(M.isMultiple=P,E.isSelected&&!B&&P?(M.isSelected=!1,E.setSelected(!1)):(O.selectNodeById(E.id,P),M.isSelected=!0,R.isSilentMode||o.toFront()),B)R.nodeTextEdit&&E.text.editable&&R.textMode===Ju.TEXT&&(E.setSelected(!1),O.setElementStateById(E.id,Wo.TEXT_EDIT)),O.eventCenter.emit(hr.NODE_DBCLICK,M);else{O.eventCenter.emit(hr.ELEMENT_CLICK,M),O.eventCenter.emit(hr.NODE_CLICK,M);var $=l.currentTarget,I=!ws(window)&&Ph(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(F){return setTimeout(F,0)};I(function(){$.focus()})}}}}},o.handleContextMenu=function(l){l.preventDefault();var f=o.props,h=f.model,v=f.graphModel,_=v.editConfigModel,E=h.getData(),O=v.getPointByClient({x:l.clientX,y:l.clientY});v.setElementStateById(h.id,Wo.SHOW_MENU,O.domOverlayPosition),h.isSelected||v.selectNodeById(h.id),v.eventCenter.emit(hr.NODE_CONTEXTMENU,{data:E,e:l,position:O}),_.isSilentMode||o.toFront()},o.handleMouseDown=function(l){var f=o.props,h=f.model,v=f.graphModel;o.mouseDownPosition={x:l.clientX,y:l.clientY},o.startTime=new Date().getTime();var _=v.editConfigModel;_.adjustNodePosition&&h.draggable&&o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.handleFocus=function(){var l=o.props,f=l.model,h=l.graphModel;h.eventCenter.emit(hr.NODE_FOCUS,{data:f.getData()})},o.handleBlur=function(){if(o.props){var l=o.props,f=l.model,h=l.graphModel;h.eventCenter.emit(hr.NODE_BLUR,{data:f.getData()})}},o.setHoverOn=function(l){var f=o.props,h=f.model,v=f.graphModel;if(!h.isHovered){var _=h.getData();h.setHovered(!0),v.eventCenter.emit(hr.NODE_MOUSEENTER,{data:_,e:l})}},o.setHoverOff=function(l){var f=o.props,h=f.model,v=f.graphModel,_=h.getData();h.isHovered&&(h.setHovered(!1),v.eventCenter.emit(hr.NODE_MOUSELEAVE,{data:_,e:l}))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter,s=n.model;return o.stepDrag=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),o.modelDisposer=X3(function(){return o.props},function(l){l&&l.model&&o.stepDrag.setModel(l.model)}),o}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(n){return null},e.prototype.getAnchors=function(){var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.isSelected,s=r.isHitable,l=r.isDragging,f=r.isShowAnchor;return s&&(a||f)&&!l?tc(r.anchors,function(h,v){var _=r.getAnchorLineStyle(h),E=r.getAnchorStyle(h);return $t(fee,{anchorData:h,node:n,style:E,edgeStyle:_,anchorIndex:v,nodeModel:r,graphModel:i,setHoverOff:n.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowRotate,l=o.isSelected,f=o.isHitable,h=o.rotatable,v=o.isHovered,_=s&&h,E=o.getRotateControlStyle();if(!a&&f&&(l||v)&&_)return $t(hee,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:E})},e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowResize,l=o.isSelected,f=o.isHitable,h=o.resizable,v=o.isHovered,_=s&&h,E=o.getResizeControlStyle();return!a&&f&&(l||v)&&_?$t(PJ,{style:E,model:o,graphModel:r}):null},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==Ju.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var s=!1;return a.nodeTextDraggable&&r.text.draggable&&(s=!0),$t(CI,{editable:a.nodeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},e.prototype.getStateClassName=function(){var n=this.props.model,o=n.state,r=n.isDragging,i=n.isSelected,a="lf-node";switch(o){case Wo.ALLOW_CONNECT:a+=" lf-node-allow";break;case Wo.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return r&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var n=this.props,o=n.model,r=n.graphModel;o.autoToFront&&r.toFront(o.id)},e.prototype.render=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.hideAnchors,s=i.adjustNodePosition,l=i.allowRotate,f=i.allowResize,h=r.gridSize,v=r.transformModel.SCALE_X,_=o.isHitable,E=o.draggable,O=o.transform,w=o.getOuterGAttributes(),S=w.className,M=S===void 0?"":S,T=Eee(w,["className"]),B=$t("g",{className:"lf-node-content",children:[$t("g",{transform:O,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),f&&this.getResizeControl()]}),!a&&this.getAnchors()]}),R;return _?(s&&E&&this.stepDrag.setStep(h*v),R=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},T,{children:B}))):R=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M)},T,{children:B})),R},e.isObserved=!1,e})(ko),xee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),e2=function(){return e2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e2.apply(this,arguments)},Zv=(function(t){xee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t(qu,e2({},o,{x:n.x,y:n.y,width:n.width,height:n.height,radius:n.radius}))},e})(Ih),Oee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),t2=function(){return t2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},t2.apply(this,arguments)},Ww=(function(t){Oee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.r,a=n.getNodeStyle();return $t(zm,t2({},a,{x:o,y:r,r:i}))},e})(Ih),See=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Gw=function(){return Gw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Gw.apply(this,arguments)},zw=(function(t){See(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,f=n.getNodeStyle(),h={transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")};return $t("g",Gw({},h,{children:$t(RM,Gw({},f,{points:l,x:r,y:i}))}))},e})(Ih),Aee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),n2=function(){return n2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},n2.apply(this,arguments)},r2=(function(t){Aee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t("g",{children:$t(RM,n2({},o,{points:n.points,x:n.x,y:n.y}))})},e})(Ih),Mee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),o2=function(){return o2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},o2.apply(this,arguments)},i2=(function(t){Mee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle();return $t(OJ,o2({},o,{x:n.x,y:n.y,rx:n.rx,ry:n.ry}))},e})(Ih),Tee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c_=function(){return c_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c_.apply(this,arguments)},$P=(function(t){Tee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getBackground=function(){var n=this.props.model,o=n.getTextStyle(),r=n.width,i=n.height,a=n.x,s=n.y,l=c_(c_({},o.background),{x:a,y:s,width:r,height:i});return $t(qu,c_({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return $t("g",{children:this.getBackground()})},e})(Ih),Cee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),a2=function(){return a2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},a2.apply(this,arguments)},Nee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},kee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},l2=(function(t){Cee(e,t);function e(){var n=t.apply(this,kee([],Nee(arguments),!1))||this;return n.ref=W1(),n}return Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(n){n.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(n){this.setHtml(n)},e.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.height,a=n.width,s=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),$t("foreignObject",a2({},s,{x:o-a/2,y:r-i/2,width:a,height:i,ref:this.ref}))},e})(Ih),Pee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Gc=function(){return Gc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Gc.apply(this,arguments)},Ree=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},Dee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ud;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Ud||(Ud={}));var UP=(function(t){Pee(e,t);function e(n){var o=t.call(this)||this;o.handleMouseDown=function(l){o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.onDragStart=function(){var l=o.props,f=l.x,h=l.y,v=l.edgeModel,_=v.startPoint,E=v.endPoint,O=v.pointsList;o.oldEdge={startPoint:_,endPoint:E,pointsList:O},o.setState({endX:f,endY:h,dragging:!0})},o.onDragging=function(l){var f=l.deltaX,h=l.deltaY,v=o.state,_=v.endX,E=v.endY,O=o.props,w=O.graphModel,S=O.type,M=w.transformModel,T=w.editConfigModel,B=Dee(M.moveCanvasPointByHtml([_,E],f,h),2),R=B[0],P=B[1];o.setState({endX:R,endY:P,dragging:!0});var $=o.props.edgeModel,I=Lw({x:_,y:E},w);if(I&&I.node&&o.isAllowAdjust(I).pass){var F=$.startPoint,U=$.endPoint,z=$.sourceNode,X=$.targetNode,Y=S===Ud.SOURCE?{startPoint:{x:I.anchor.x,y:I.anchor.y},endPoint:{x:U.x,y:U.y},sourceNode:I.node,targetNode:X}:{startPoint:{x:F.x,y:F.y},endPoint:{x:I.anchor.x,y:I.anchor.y},sourceNode:z,targetNode:I.node};$.updateAfterAdjustStartAndEnd(Y)}else S===Ud.SOURCE?$.updateStartPoint({x:R,y:P}):$.updateEndPoint({x:R,y:P});$.text.value&&T.adjustEdge&&$.setText(Object.assign({},$.text,$.textPosition))},o.onDragEnd=function(l){var f,h,v,_=l.event;try{o.setState({dragging:!1});var E=o.props,O=E.graphModel,w=E.edgeModel,S=E.type,M=o.state,T=M.endX,B=M.endY,R=M.dragging,P=Lw({x:T,y:B},O);if(!R)return;var $=!1,I=void 0;if(P&&P.node){var F=o.isAllowAdjust(P),U=F.pass,z=F.msg,X=F.newTargetNode;if(U){var Y=w.getData(),W=Y.text,Q=Y.sourceAnchorId,J=Q===void 0?"":Q,ie=Y.targetAnchorId,Se=ie===void 0?"":ie,Ae=Ree(Y,["text","sourceAnchorId","targetAnchorId"]);if(I=Gc(Gc({sourceAnchorId:J,targetAnchorId:Se},Ae),{text:(W==null?void 0:W.value)||""}),S===Ud.SOURCE){var Pe=O.getNodeModelById(P.node.id),De=O.getNodeModelById(w.targetNodeId),He=(f=O.edgeGenerator)===null||f===void 0?void 0:f.call(O,Pe==null?void 0:Pe.getData(),De==null?void 0:De.getData(),I);I=Gc(Gc({},He),{sourceNodeId:P.node.id,sourceAnchorId:P.anchor.id,startPoint:{x:P.anchor.x,y:P.anchor.y},targetNodeId:w.targetNodeId,endPoint:Gc({},w.endPoint)}),w.sourceNodeId===P.node.id&&w.sourceAnchorId===P.anchor.id&&($=!0)}else if(S===Ud.TARGET){var Pe=O.getNodeModelById(w.sourceNodeId),De=O.getNodeModelById(P.node.id),He=(h=O.edgeGenerator)===null||h===void 0?void 0:h.call(O,Pe==null?void 0:Pe.getData(),De==null?void 0:De.getData(),I);I=Gc(Gc({},He),{sourceNodeId:w.sourceNodeId,startPoint:Gc({},w.startPoint),targetNodeId:P.node.id,targetAnchorId:P.anchor.id,endPoint:{x:P.anchor.x,y:P.anchor.y}}),w.targetNodeId===P.node.id&&w.targetAnchorId===P.anchor.id&&($=!0)}}else{$=!0;var Ye=X.getData();O.eventCenter.emit(hr.CONNECTION_NOT_ALLOWED,{data:Ye,msg:z})}}else $=!0;if($)o.recoveryEdge();else{var Be=w.getData();O.deleteEdgeById(w.id);var Je=O.addEdge(Gc({},I));O.eventCenter.emit(hr.EDGE_EXCHANGE_NODE,{data:{newEdge:Je.getData(),oldEdge:Be}})}(v=o.preTargetNode)===null||v===void 0||v.setElementState(Wo.DEFAULT)}finally{var O=o.props.graphModel;O.eventCenter.emit(hr.ADJUST_POINT_DRAGEND,{e:_,data:o.stepDragData})}},o.recoveryEdge=function(){var l=o.props.edgeModel,f=o.oldEdge,h=f.startPoint,v=f.endPoint,_=f.pointsList;l.updateStartPoint(h),l.updateEndPoint(v),l.modelType!==bo.LINE_EDGE&&(l.pointsList=_??[],l.initPoints())},o.getAdjustPointStyle=function(){var l=o.props.graphModel.theme,f=l.edgeAdjust;return f},o.state={dragging:!1,endX:0,endY:0},o.targetRuleResults=new Map,o.sourceRuleResults=new Map;var r=n.type,i=n.edgeModel,a=n.graphModel,s=a.eventCenter;return o.stepDragData={type:r,edgeData:i.getData()},o.stepDrag=new ac({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:o.stepDragData}),o}return e.prototype.isAllowAdjust=function(n){var o=this.props,r=o.edgeModel,i=r.id,a=r.sourceNode,s=r.targetNode,l=r.sourceAnchorId,f=r.targetAnchorId,h=o.type,v,_,E,O;if(h===Ud.SOURCE?(v=n.node,_=s,E=n.anchor,O=s.getAnchorInfo(f)):(v=a,_=n.node,O=n.anchor,E=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(Wo.DEFAULT),this.preTargetNode=n.node,O.id===E.id)return{pass:!1,msg:"",newTargetNode:_};var w="".concat(v.id,"_").concat(_.id,"_").concat(E.id,"_").concat(O.id);if(!this.targetRuleResults.has(w)){var S=v.isAllowConnectedAsSource(_,E,O,i),M=_.isAllowConnectedAsTarget(v,E,O,i);this.sourceRuleResults.set(w,Iw(S)),this.targetRuleResults.set(w,Iw(M))}var T=this.sourceRuleResults.get(w),B=T.isAllPass,R=T.msg,P=this.targetRuleResults.get(w),$=P.isAllPass,I=P.msg,F=B&&$?Wo.ALLOW_CONNECT:Wo.NOT_ALLOW_CONNECT;return h===Ud.SOURCE?v.setElementState(F):_.setElementState(F),{pass:B&&$,msg:I||R,newTargetNode:_}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.getAdjustPointShape,a=n.edgeModel,s=this.state.dragging;return $t("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":i(o,r,a)})},e})(ko),jee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s2=function(){return s2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s2.apply(this,arguments)};(function(t){jee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var n=this.props,o=n.arrowInfo,r=n.style,i=o.start,a=o.end,s={start:i,end:a,offset:r.offset,verticalLength:r.verticalLength,type:"end"},l=C_(s),f=l.leftX,h=l.leftY,v=l.rightX,_=l.rightY;return s2({d:"M".concat(f," ").concat(h," L").concat(a.x," ").concat(a.y," L").concat(v," ").concat(_," z")},r)},e.prototype.getShape=function(){var n=this.getArrowAttributes(),o=n.d,r=n.strokeWidth,i=n.stroke,a=n.fill;return $t(P_,{d:o,fill:a,strokeWidth:r,stroke:i})},e.prototype.render=function(){return $t("g",{className:"lf-arrow",children:this.getShape()})},e})(ko);var Lee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),d_=function(){return d_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},d_.apply(this,arguments)},Iee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Z1=(function(t){Lee(e,t);function e(){var n=t.call(this)||this;return n.textRef=W1(),n.handleHover=function(o,r){var i=n.props,a=i.model,s=i.graphModel.eventCenter;a.setHovered(o);var l=o?hr.EDGE_MOUSEENTER:hr.EDGE_MOUSELEAVE,f=a.getData();s.emit(l,{data:f,e:r})},n.setHoverOn=function(o){var r=n.props.model.isHovered;r||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,o))},n.setHoverOff=function(o){var r=n.props.model.isHovered;r&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,o))},n.handleContextMenu=function(o){o.preventDefault(),n.contextMenuTime=new Date().getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,i=r.model,a=r.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:o.clientX,y:o.clientY});a.setElementStateById(i.id,Wo.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||n.toFront(),i.isSelected||a.selectEdgeById(i.id);var f=i==null?void 0:i.getData();a.eventCenter.emit(hr.EDGE_CONTEXTMENU,{data:f,e:o,position:l})},n.handleMouseDown=function(o){o.stopPropagation(),n.startTime=new Date().getTime()},n.handleMouseUp=function(){var o=n.props.model;n.mouseUpDrag=o.isDragging},n.handleClick=function(o){if(n.startTime&&!n.mouseUpDrag){var r=o.button===2;if(!r){var i=o.detail===2,a=n.props,s=a.model,l=a.graphModel,f=s==null?void 0:s.getData(),h=l.getPointByClient({x:o.clientX,y:o.clientY});if(i){var v=l.editConfigModel,_=l.textEditElement,E=s.id,O=s.text,w=s.modelType;if(_&&_.id===E&&l.setElementStateById(E,Wo.DEFAULT),v.edgeTextEdit&&O.editable&&(s.setSelected(!1),l.setElementStateById(E,Wo.TEXT_EDIT)),w===bo.POLYLINE_EDGE){var S=s,M=l.getPointByClient({x:o.x,y:o.y}).canvasOverlayPosition,T=M.x,B=M.y;S.dbClickPosition=yI({x:T,y:B},S.points)}l.eventCenter.emit(hr.EDGE_DBCLICK,{data:f,e:o,position:h})}else{l.eventCenter.emit(hr.ELEMENT_CLICK,{data:f,e:o,position:h}),l.eventCenter.emit(hr.EDGE_CLICK,{data:f,e:o,position:h});var R=o.currentTarget,P=!ws(window)&&Ph(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(I){return setTimeout(I,0)};P(function(){R.focus()})}var $=l.editConfigModel;l.selectEdgeById(s.id,_I(o,$)),$.isSilentMode||n.toFront()}}},n.handleFocus=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(hr.EDGE_FOCUS,{data:r.getData()})},n.handleBlur=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(hr.EDGE_BLUR,{data:r.getData()})},n}return e.prototype.getShape=function(){return $t("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var n,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==Ju.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var s=!1;return a.edgeTextDraggable&&r.text.draggable&&(s=!0),$t(bee,{ref:this.textRef,editable:a.edgeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:s})}return null},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isSelected,a=this.state.hover;return{start:o,end:r,hover:a,isSelected:i}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint;return[o,r]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var n=this.props.model,o=n.id,r=n.getArrowStyle(),i=r.refY,a=i===void 0?0:i,s=r.refX,l=s===void 0?2:s,f=Iee(this.getLastTwoPoints(),2),h=f[0],v=f[1],_="auto";if(h&&v){var E=v.x-h.x,O=v.y-h.y;if(E!==0||O!==0){var w=YJ(XJ({x:E,y:O}));Number.isFinite(w)&&!Number.isNaN(w)&&(_=w)}}return $t("g",{children:$t("defs",{children:[$t("marker",{id:"marker-start-".concat(o),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),$t("marker",{id:"marker-end-".concat(o),refX:l,refY:a,overflow:"visible",orient:_,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,o){var r=o.stroke,i=o.fill,a=i===void 0?r:i,s=o.strokeWidth,l=o.offset,f=l===void 0?10:l,h=o.verticalLength,v=o.strokeLinecap,_=o.strokeLinejoin,E=o.transform,O="";switch(n){case"solid":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(3*f/4,",-").concat(h," Z");break;case"hollow":O="M".concat(-f/4,",0 L").concat(3*f/4,",").concat(h," L").concat(-f/4,",0 L").concat(3*f/4,",-").concat(h," L").concat(-f/4,",0 Z");break;case"diamond":O="M".concat(-f/2,",0 L0,").concat(h," L").concat(f/2,",0 L0,-").concat(h," L").concat(-f/2,",0 Z");break;case"circle":O="M".concat(-f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(f/2,",0 A").concat(f/4,",").concat(f/4," 0 1,0 ").concat(-f/2,",0 Z");break;default:O="";break}return $t("path",{d:O,stroke:r,fill:a,strokeWidth:s,strokeLinecap:v,strokeLinejoin:_,transform:E})},e.prototype.getStartArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.startArrowType,f=l===void 0?"none":l,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:h,strokeLinejoin:v})},e.prototype.getEndArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.endArrowType,f=l===void 0?"solid":l,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:h,strokeLinejoin:v,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,o,r){var i=r.getAdjustPointStyle();return $t(zm,d_({className:"lf-edge-adjust-point"},i,{x:n,y:o}))},e.prototype.getAdjustPoints=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.adjustEdgeStartAndEnd,s=i.adjustEdgeStart,l=i.adjustEdgeEnd,f=o.getAdjustStart(),h=o.getAdjustEnd();return $t("g",{children:[a&&s&&$t(UP,d_({type:Ud.SOURCE},f,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r})),a&&l&&$t(UP,d_({type:Ud.TARGET},h,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return $t("g",{})},e.prototype.getAppend=function(){return $t("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var n=this.props,o=n.graphModel,r=n.model;o.toFront(r.id)},e.prototype.render=function(){var n=this.props.model,o=n.isSelected,r=n.isHitable,i=n.isShowAdjustPoint;return $t("g",{children:[$t("g",{className:["lf-edge",!r&&"pointer-none",o&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),i&&o?this.getAdjustPoints():""]})},e.isObserved=!1,e})(ko),Fee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u2=function(){return u2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},u2.apply(this,arguments)},Bee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},VP=(function(t){Fee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.getEdgeStyle(),r=n,i=r.path,a=r.isAnimation,s=r.arrowConfig,l=n.getEdgeAnimationStyle(),f=l.strokeDasharray,h=l.stroke,v=l.strokeDashoffset,_=l.animationName,E=l.animationDuration,O=l.animationIterationCount,w=l.animationTimingFunction,S=l.animationDirection;return $t(P_,u2({d:i},o,s,a?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:_,animationDuration:E,animationIterationCount:O,animationTimingFunction:w,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return $t(P_,{d:n,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var n=this.props.model,o=this.state.hover,r=n.isSelected,i=n.getArrowStyle().offset,a=n.pointsList.map(function(v){return{x:v.x,y:v.y}}),s=Bee(wP(a,i),2),l=s[0],f=s[1],h={start:l,end:f,hover:o,isSelected:r};return h},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.getArrowStyle().offset,r=n.pointsList.map(function(i){return{x:i.x,y:i.y}});return wP(r,o)},e})(Z1),$ee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c2=function(){return c2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c2.apply(this,arguments)},WP=(function(t){$ee(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i=n.isAnimation,a=n.arrowConfig,s=n.getEdgeStyle(),l=n.getEdgeAnimationStyle(),f=l.strokeDasharray,h=l.stroke,v=l.strokeDashoffset,_=l.animationName,E=l.animationDuration,O=l.animationIterationCount,w=l.animationTimingFunction,S=l.animationDirection;return $t(Gm,c2({},s,{x1:o.x,y1:o.y,x2:r.x,y2:r.y},a,i?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:_,animationDuration:E,animationIterationCount:O,animationTimingFunction:w,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model,o=n.startPoint,r=n.endPoint,i={start:o,end:r},a=QZ(i),s=a.d,l=a.strokeWidth,f=a.fill,h=a.strokeDasharray,v=a.stroke;return $t(P_,{d:s,fill:f,strokeWidth:l,stroke:v,strokeDasharray:h})},e})(Z1),Uee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),$v=function(){return $v=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},$v.apply(this,arguments)},Vee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$_=(function(t){Uee(e,t);function e(){var n=t.call(this)||this;return n.onDragStart=function(){var o=n.props.model;o.dragAppendStart(),n.isShowAdjustPointTemp=o.isShowAdjustPoint,o.isShowAdjustPoint=!1},n.onDragging=function(o){var r=o.deltaX,i=o.deltaY,a=n.props,s=a.model,l=a.graphModel;n.isDragging=!0;var f=l.transformModel,h=l.editConfigModel,v=Vee(f.fixDeltaXY(r,i),2),_=v[0],E=v[1],O=s,w=h.adjustEdgeMiddle;w?n.appendInfo=O.dragAppendSimple(n.appendInfo,{x:_,y:E}):n.appendInfo=O.dragAppend(n.appendInfo,{x:_,y:E})},n.onDragEnd=function(){var o,r=n.props,i=r.model,a=r.graphModel.eventCenter,s=i;s.dragAppendEnd(),n.isDragging=!1,s.isShowAdjustPoint=(o=n.isShowAdjustPointTemp)!==null&&o!==void 0?o:!1,n.appendInfo=void 0,a.emit(hr.EDGE_ADJUST,{data:s.getData()})},n.beforeDragStart=function(o,r){r.draggable&&n.drag.handleMouseDown(o),n.appendInfo=r},n.drag=new ac({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return e.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),l=s.strokeDasharray,f=s.stroke,h=s.strokeDashoffset,v=s.animationName,_=s.animationDuration,E=s.animationIterationCount,O=s.animationTimingFunction,w=s.animationDirection;return $t(TJ,$v({points:o},a,i,r?{strokeDasharray:l,stroke:f,style:{strokeDashoffset:h,animationName:v,animationDuration:_,animationIterationCount:E,animationTimingFunction:O,animationDirection:w}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.points,r=n.isSelected,i=this.state.hover,a=Kv(o),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:i,isSelected:r}},e.prototype.getLastTwoPoints=function(){var n=this.props.model,o=n.points,r=Kv(o),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),[i,a]},e.prototype.getAppendAttributes=function(n){var o=n.start,r=n.end,i;if(o.x===r.x&&o.y===r.y)i="";else{var a={start:o,end:r,offset:10,verticalLength:5},s=C_($v($v({},a),{type:"start"})),l=C_($v($v({},a),{type:"end"}));i="M".concat(s.leftX," ").concat(s.leftY,`
|
||
L`).concat(s.rightX," ").concat(s.rightY,`
|
||
L`).concat(l.rightX," ").concat(l.rightY,`
|
||
L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:i,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(n){var o=this.getAppendAttributes(n),r=o.d,i=o.strokeWidth,a=o.fill,s=o.strokeDasharray,l=o.stroke;return $t(P_,{d:r,fill:a,strokeWidth:i,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.pointsList,s=r.draggable,l=[],f=a.length,h=function(E){var O="lf-polyline-append",w={start:{x:a[E].x,y:a[E].y},end:{x:a[E+1].x,y:a[E+1].y},startIndex:E,endIndex:E+1,direction:ni.HORIZONTAL,draggable:!0},S=$t("g",{className:O,children:v.getAppendShape(w)}),M=i.editConfigModel,T=M.adjustEdge,B=M.adjustEdgeMiddle;if(T&&s){var R=w.startIndex,P=w.endIndex,$=B&&(R===0||P===f-1);w.draggable=!$,w.start.x===w.end.x?(w.draggable&&(O+="-ew-resize"),w.direction=ni.VERTICAL):w.start.y===w.end.y&&(w.draggable&&(O+="-ns-resize"),w.direction=ni.HORIZONTAL),S=$t("g",{className:v.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(I){return n.beforeDragStart(I,w)},children:$t("g",{className:O,children:v.getAppendShape(w)})})}l.push(S)},v=this,_=0;_<f-1;_++)h(_);return $t("g",{children:l})},e})(Z1),wm=function(){return wm=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},wm.apply(this,arguments)},Wee=(function(){function t(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(r){!n.nodeConfig||n.fakeNode||(n.fakeNode=n.lf.createFakeNode(wm(wm({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY}))))},this.onDragOver=function(r){if(n.lf.graphModel.eventCenter.emit(hr.BLANK_CANVAS_MOUSEMOVE,{e:r}),r.preventDefault(),n.fakeNode){var i=n.clientToLocalPoint({x:r.clientX,y:r.clientY}),a=i.x,s=i.y;n.fakeNode.moveTo(a,s);var l=n.fakeNode.getData();n.lf.setNodeSnapLine(l),n.lf.graphModel.eventCenter.emit(hr.NODE_DND_DRAG,{data:l,e:r})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(r){!n.lf.graphModel||!r||!n.nodeConfig||(n.lf.addNode(wm(wm({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY})),hr.NODE_DND_ADD,r),r.preventDefault(),r.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var o=e.lf;this.lf=o}return t.prototype.clientToLocalPoint=function(e){var n=e.x,o=e.y,r=og(this.lf.options,["grid","size"]),i=this.lf.graphModel.getPointByClient({x:n,y:o}),a=i.canvasOverlayPosition,s=a.x,l=a.y,f=this.lf.graphModel.editConfigModel.snapGrid;return{x:Wm(s,r,f),y:Wm(l,r,f)}},t.prototype.startDrag=function(e){var n=this.lf.graphModel.editConfigModel;n!=null&&n.isSilentMode||(this.nodeConfig=e,window.document.addEventListener("mouseup",this.stopDrag))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t})();function Gee(t,e){t.on("node:mousemove",function(n){var o=n.data;e.setNodeSnapLine(o)}),t.on("node:mouseup",function(){e.clearSnapline()})}var zee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),np=function(){return np=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},np.apply(this,arguments)},Hee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Xee=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Yee=(function(t){zee(e,t);function e(n){var o=t.call(this,n)||this;return o.ref=W1(),o.__prevText={type:"",text:"",id:""},o.keyupHandler=function(r){var i=o.props.graphModel.textEditElement;r.key==="Enter"&&r.altKey&&(i==null||i.setElementState(Wo.DEFAULT))},o.inputHandler=function(r){var i=r.target.innerText,a=o.props.graphModel.textEditElement;a&&(o.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},o.keydownHandler=function(r){r.stopPropagation()},o.state={style:{left:0,top:0}},o}return e.getDerivedStateFromProps=function(n){var o,r=n.textEditElement,i=n.graphModel,a=i.transformModel,s=i.theme,l=s.inputText,f;if(r){if(!(!((o=r.text)===null||o===void 0)&&o.value)&&r.BaseType===da.EDGE){var h=r.text,v=r.textPosition,_=v.x,E=v.y;h.x=_,h.y=E,r.setText(h)}var O={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===da.EDGE){var w=s.edgeText,S=w.overflowMode,M=w.lineHeight,T=w.wrapPadding,B=w.textWidth;B&&S==="autoWrap"&&(f=np(np({},O),{width:B,minWidth:B,lineHeight:M,padding:T}))}else if(r.BaseType===da.NODE){var R=s.nodeText,S=R.overflowMode,M=R.lineHeight,T=R.wrapPadding,B=R.textWidth,P=r.width,$=r.modelType,I=r.textWidth,F=I||B||P;($!==bo.TEXT_NODE&&S==="autoWrap"||$===bo.TEXT_NODE&&B)&&(f=np(np({},O),{width:F,minWidth:F,lineHeight:M,padding:T}))}var U=r.text,z=U.x,X=U.y,Y=Xee(a.CanvasPointToHtmlPoint([z,X]),2),W=Y[0],Q=Y[1];return{style:np(np({left:W,top:Q},f),l)}}return null},e.prototype.componentDidUpdate=function(){var n=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var o=this.__prevText,r=o.text,i=o.id;n.updateText(i,r),n.eventCenter.emit(hr.TEXT_UPDATE,{data:np({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(n){if(window.getSelection!==void 0&&document.createRange!==void 0){var o=document.createRange();o.selectNodeContents(n),o.collapse(!1);var r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(o)}},e.prototype.render=function(){var n,o=this.props.graphModel.textEditElement,r=this.state.style;return o?$t("div",{contentEditable:!0,className:"lf-text-input",style:r,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(n=o.text)===null||n===void 0?void 0:n.value},o.id):null},e.toolName="text-edit-tool",e=Hee([xs],e),e})(ko),qee=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kee=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lS=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Zee=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Jee=(function(t){qee(e,t);function e(n){var o=t.call(this,n)||this;o.handleMouseDown=function(s){var l=o.props,f=l.graphModel.gridSize,h=l.lf,v=h.getTransform().SCALE_X;o.stepDrag.setStep(f*v),o.stepDrag.handleMouseDown(s)},o.handleWheelEvent=function(s){var l,f;s.preventDefault();var h=s.deltaX,v=s.deltaY,_=s.clientX,E=s.clientY,O=s.ctrlKey,w=new WheelEvent("wheel",{deltaX:h,deltaY:v,clientX:_,clientY:E,ctrlKey:O});(f=(l=o.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||f===void 0||f.dispatchEvent(w)},o.onDragging=function(s){var l=s.deltaX,f=s.deltaY,h=o.props,v=h.graphModel,_=h.lf,E=_.getTransform(),O=E.SCALE_X,w=E.SCALE_Y,S=v.getSelectElements(!0);v.moveNodes(S.nodes.map(function(M){return M.id}),l/O,f/w)},o.handleContextMenu=function(s){s.preventDefault();var l=o.props,f=l.graphModel,h=l.graphModel,v=h.eventCenter,_=h.selectElements,E=f.getPointByClient({x:s.clientX,y:s.clientY}),O={nodes:[],edges:[]},w=Zee([],lS(_.values()),!1);w.forEach(function(S){S.BaseType===da.NODE&&O.nodes.push(S.getData()),S.BaseType===da.EDGE&&O.edges.push(S.getData())}),v.emit(hr.SELECTION_CONTEXTMENU,{data:O,e:s,position:E})};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ac({onDragging:o.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),o}return e.prototype.render=function(){var n,o,r=this.props.graphModel,i=r.selectElements,a=r.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,f=s.SCALE_Y;if(!(i.size<=1)){var h=Number.MAX_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER;i.forEach(function(w){var S;w.BaseType===da.NODE&&(S=LZ(w)),w.BaseType===da.EDGE&&(S=$Z(w)),S!==void 0&&(h=Math.min(h,S.x),v=Math.min(v,S.y),_=Math.max(_,S.x1),E=Math.max(E,S.y1))}),n=lS(a.CanvasPointToHtmlPoint([h,v]),2),h=n[0],v=n[1],o=lS(a.CanvasPointToHtmlPoint([_,E]),2),_=o[0],E=o[1];var O={left:"".concat(h-20*l/2,"px"),top:"".concat(v-20*f/2,"px"),width:"".concat(_-h+20*l,"px"),height:"".concat(E-v+20*f,"px"),"border-width":"".concat(2*l,"px")};return $t("div",{className:"lf-multiple-select",style:O,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=Kee([xs],e),e})(ko),sS=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},Qee=[Yee,Jee],ete=(function(){function t(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,ri(Qee,function(i){n.isDisabled(i.toolName)||n.registerTool(i.toolName,i)});var o=e.graphModel,r=o.eventCenter;r.on("".concat(hr.GRAPH_TRANSFORM,",").concat(hr.NODE_CLICK,",").concat(hr.BLANK_CLICK," "),function(){var i,a=o.textEditElement,s=o.editConfigModel,l=s.edgeTextEdit,f=s.nodeTextEdit;(l||f)&&a&&((i=o.textEditElement)===null||i===void 0||i.setElementState(Wo.DEFAULT))})}return t.prototype.isDisabled=function(e){var n;return((n=this.instance.options.disabledTools)===null||n===void 0?void 0:n.indexOf(e))!==-1},t.prototype.registerTool=function(e,n){this.toolMap.set(e,n)},t.prototype.disableTool=function(e){var n=this.toolMap.get(e);if(n)return this.disabledToolMap.set(e,n),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(n," 的工具"))},t.prototype.enableTool=function(e){var n=this.disabledToolMap.get(e);if(n)return this.toolMap.set(e,n),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(n," 的工具"))},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},sS([Ut],t.prototype,"toolMap",void 0),sS([Bt],t.prototype,"disableTool",null),sS([Bt],t.prototype,"enableTool",null),t})();function tte(t){throw new Error("[mobx-utils] "+t)}function Hw(t,e){e===void 0&&(e="Illegal state"),t||tte(e)}var NI=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(NI(Object.getPrototypeOf(t))||[])},nte=function(t){var e=NI(t),n=e.filter(function(o,r){return e.indexOf(o)===r});return n},rte=function(t){return nte(t).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},kI="pending",Xw="fulfilled",DM="rejected";function ote(t){switch(this.state){case kI:return t.pending&&t.pending(this.value);case DM:return t.rejected&&t.rejected(this.value);case Xw:return t.fulfilled?t.fulfilled(this.value):this.value}}function GP(t,e){if(Hw(arguments.length<=2,"fromPromise expects up to two arguments"),Hw(typeof t=="function"||typeof t=="object"&&t&&typeof t.then=="function","Please pass a promise or function to fromPromise"),t.isPromiseBasedObservable===!0)return t;typeof t=="function"&&(t=new Promise(t));var n=t;t.then(Bt("observableFromPromise-resolve",function(r){n.value=r,n.state=Xw}),Bt("observableFromPromise-reject",function(r){n.value=r,n.state=DM})),n.isPromiseBasedObservable=!0,n.case=ote;var o=e&&e.state===Xw?e.value:void 0;return kA(n,{value:o,state:kI},{},{deep:!1}),n}(function(t){t.reject=Bt("fromPromise.reject",function(n){var o=t(Promise.reject(n));return o.state=DM,o.value=n,o});function e(n){n===void 0&&(n=void 0);var o=t(Promise.resolve(n));return o.state=Xw,o.value=n,o}t.resolve=Bt("fromPromise.resolve",e)})(GP||(GP={}));var k0=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i};(function(){function t(e,n){var o=this;kK(function(){o.current=n,o.subscription=e.subscribe(o)})}return t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(e){this.current=e},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(e){this.current=e,this.dispose()},k0([Ut.ref],t.prototype,"current",void 0),k0([Bt.bound],t.prototype,"next",null),k0([Bt.bound],t.prototype,"complete",null),k0([Bt.bound],t.prototype,"error",null),t})();var Yw=function(){return Yw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Yw.apply(this,arguments)},Fy=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},ite=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function t(e){var n=this;this.model=e,this.localValues=Ut.map({}),this.localComputedValues=Ut.map({}),this.isPropertyDirty=function(o){return n.localValues.has(o)},Hw(rd(e),"createViewModel expects an observable object"),rte(e).forEach(function(o){if(!(o===eo||o==="__mobxDidRunLazyInitializers")){if(Hw(ite.indexOf(o)===-1,"The propertyname "+o+" is reserved and cannot be used with viewModels"),Pk(e,o)){var r=Y1(e,o).derivation;n.localComputedValues.set(o,Ai(r.bind(n)))}var i=Object.getOwnPropertyDescriptor(e,o),a=i?{enumerable:i.enumerable}:{};Object.defineProperty(n,o,Yw(Yw({},a),{configurable:!0,get:function(){return Pk(e,o)?n.localComputedValues.get(o).get():n.isPropertyDirty(o)?n.localValues.get(o):n.model[o]},set:Bt(function(s){s!==n.model[o]?n.localValues.set(o,s):n.localValues.delete(o)})}))}})}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var e=this;Vm(this.localValues).forEach(function(n){var o=e.localValues.get(n),r=e.model[n];tf(r)?r.replace(o):Ys(r)?(r.clear(),r.merge(o)):FK(o)||(e.model[n]=o)}),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(e){this.localValues.delete(e)},Fy([Ai],t.prototype,"isDirty",null),Fy([Ai],t.prototype,"changedValues",null),Fy([Bt.bound],t.prototype,"submit",null),Fy([Bt.bound],t.prototype,"reset",null),Fy([Bt.bound],t.prototype,"resetProperty",null),t})();function uS(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function cS(t){return rd(t)||tf(t)||Ys(t)}function ate(t,e){var n=new WeakMap;function o(s){var l=n.get(s.object);r(s,l),e(s,uS(l),t)}function r(s,l){switch(s.type){case"add":i(s.newValue,l,s.name);break;case"update":a(s.oldValue),i(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(v,_){return i(v,l,""+(s.index+_))});for(var f=s.index+s.addedCount;f<s.object.length;f++)if(cS(s.object[f])){var h=n.get(s.object[f]);h&&(h.path=""+f)}break}}function i(s,l,f){if(cS(s)){var h=n.get(s);if(h){if(h.parent!==l||h.path!==f)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+uS(l)+"/"+f+"',")+(" but it already exists at '"+uS(h.parent)+"/"+h.path+"'"))}else{var v={parent:l,path:f,dispose:eI(s,o)};n.set(s,v),UK(s).forEach(function(_){var E=_[0],O=_[1];return i(O,v,E)})}}}function a(s){if(cS(s)){var l=n.get(s);if(!l)return;n.delete(s),l.dispose(),$K(s).forEach(a)}}return i(t,void 0,""),function(){a(t)}}var lte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i])},t(e,n)};return function(e,n){t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){lte(e,t);function e(n,o,r){var i=r===void 0?{}:r,a=i.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=i.keyToName,f=l===void 0?function(_){return""+_}:l,h=t.call(this)||this;h._keyToName=f,h._groupBy=o,h._ogmInfoKey=Symbol("ogmInfo"+s),h._base=n;for(var v=0;v<n.length;v++)h._addItem(n[v]);return h._disposeBaseObserver=eI(h._base,function(_){if(_.type==="splice")Yc(function(){for(var E=0,O=_.removed;E<O.length;E++){var w=O[E];h._removeItem(w)}for(var S=0,M=_.added;S<M.length;S++){var T=M[S];h._addItem(T)}});else if(_.type==="update")Yc(function(){h._removeItem(_.oldValue),h._addItem(_.newValue)});else throw new Error("illegal state")}),h}return e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(n){throw new Error("not supported")},e.prototype.set=function(n,o){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var n=0;n<this._base.length;n++){var o=this._base[n],r=o[this._ogmInfoKey];r.reaction(),delete o[this._ogmInfoKey]}},e.prototype._getGroupArr=function(n){var o=t.prototype.get.call(this,n);return o===void 0&&(o=Ut([],{name:"GroupArray["+this._keyToName(n)+"]",deep:!1}),t.prototype.set.call(this,n,o)),o},e.prototype._removeFromGroupArr=function(n,o){var r=t.prototype.get.call(this,n);r.length===1?t.prototype.delete.call(this,n):(o===r.length-1||(r[o]=r[r.length-1],r[o][this._ogmInfoKey].groupArrIndex=o),r.length--)},e.prototype._addItem=function(n){var o=this,r=this._groupBy(n),i=this._getGroupArr(r),a={groupByValue:r,groupArrIndex:i.length,reaction:X3(function(){return o._groupBy(n)},function(s,l){var f=n[o._ogmInfoKey];o._removeFromGroupArr(f.groupByValue,f.groupArrIndex);var h=o._getGroupArr(s),v=h.length;h.push(n),f.groupByValue=s,f.groupArrIndex=v})};Object.defineProperty(n,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),i.push(n)},e.prototype._removeItem=function(n){var o=n[this._ogmInfoKey];this._removeFromGroupArr(o.groupByValue,o.groupArrIndex),o.reaction(),delete n[this._ogmInfoKey]},e})(TM);Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var d2=function(){return d2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},d2.apply(this,arguments)},ste=(function(){function t(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return t.prototype.add=function(e){uA(ec(this.undos),e)||(this.undos.push(e),uA(this.curData,e)||(this.redos=[]),this.eventCenter.emit(hr.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var n=this.undos.pop();return this.curData=to(n),n}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=to(e),e}},t.prototype.watch=function(e){var n=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=ate(e,j2(function(){var o=e.modelToHistoryData();o&&n.add(d2({},o))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t})(),dS={exports:{}},zP;function ute(){return zP||(zP=1,(function(t){(function(e,n,o){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:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,f=1;f<20;++f)r[111+f]="f"+f;for(f=0;f<=9;++f)r[f+96]=f.toString();function h(I,F,U){if(I.addEventListener){I.addEventListener(F,U,!1);return}I.attachEvent("on"+F,U)}function v(I){if(I.type=="keypress"){var F=String.fromCharCode(I.which);return I.shiftKey||(F=F.toLowerCase()),F}return r[I.which]?r[I.which]:i[I.which]?i[I.which]:String.fromCharCode(I.which).toLowerCase()}function _(I,F){return I.sort().join(",")===F.sort().join(",")}function E(I){var F=[];return I.shiftKey&&F.push("shift"),I.altKey&&F.push("alt"),I.ctrlKey&&F.push("ctrl"),I.metaKey&&F.push("meta"),F}function O(I){if(I.preventDefault){I.preventDefault();return}I.returnValue=!1}function w(I){if(I.stopPropagation){I.stopPropagation();return}I.cancelBubble=!0}function S(I){return I=="shift"||I=="ctrl"||I=="alt"||I=="meta"}function M(){if(!l){l={};for(var I in r)I>95&&I<112||r.hasOwnProperty(I)&&(l[r[I]]=I)}return l}function T(I,F,U){return U||(U=M()[I]?"keydown":"keypress"),U=="keypress"&&F.length&&(U="keydown"),U}function B(I){return I==="+"?["+"]:(I=I.replace(/\+{2}/g,"+plus"),I.split("+"))}function R(I,F){var U,z,X,Y=[];for(U=B(I),X=0;X<U.length;++X)z=U[X],s[z]&&(z=s[z]),F&&F!="keypress"&&a[z]&&(z=a[z],Y.push("shift")),S(z)&&Y.push(z);return F=T(z,Y,F),{key:z,modifiers:Y,action:F}}function P(I,F){return I===null||I===n?!1:I===F?!0:P(I.parentNode,F)}function $(I){var F=this;if(I=I||n,!(F instanceof $))return new $(I);F.target=I,F._callbacks={},F._directMap={};var U={},z,X=!1,Y=!1,W=!1;function Q(He){He=He||{};var Ye=!1,Be;for(Be in U){if(He[Be]){Ye=!0;continue}U[Be]=0}Ye||(W=!1)}function J(He,Ye,Be,Je,mt,le){var Ze,pe,se=[],we=Be.type;if(!F._callbacks[He])return[];for(we=="keyup"&&S(He)&&(Ye=[He]),Ze=0;Ze<F._callbacks[He].length;++Ze)if(pe=F._callbacks[He][Ze],!(!Je&&pe.seq&&U[pe.seq]!=pe.level)&&we==pe.action&&(we=="keypress"&&!Be.metaKey&&!Be.ctrlKey||_(Ye,pe.modifiers))){var $e=!Je&&pe.combo==mt,rt=Je&&pe.seq==Je&&pe.level==le;($e||rt)&&F._callbacks[He].splice(Ze,1),se.push(pe)}return se}function ie(He,Ye,Be,Je){F.stopCallback(Ye,Ye.target||Ye.srcElement,Be,Je)||He(Ye,Be)===!1&&(O(Ye),w(Ye))}F._handleKey=function(He,Ye,Be){var Je=J(He,Ye,Be),mt,le={},Ze=0,pe=!1;for(mt=0;mt<Je.length;++mt)Je[mt].seq&&(Ze=Math.max(Ze,Je[mt].level));for(mt=0;mt<Je.length;++mt){if(Je[mt].seq){if(Je[mt].level!=Ze)continue;pe=!0,le[Je[mt].seq]=1,ie(Je[mt].callback,Be,Je[mt].combo,Je[mt].seq);continue}pe||ie(Je[mt].callback,Be,Je[mt].combo)}var se=Be.type=="keypress"&&Y;Be.type==W&&!S(He)&&!se&&Q(le),Y=pe&&Be.type=="keydown"};function Se(He){typeof He.which!="number"&&(He.which=He.keyCode);var Ye=v(He);if(Ye){if(He.type=="keyup"&&X===Ye){X=!1;return}F.handleKey(Ye,E(He),He)}}function Ae(){clearTimeout(z),z=setTimeout(Q,1e3)}function Pe(He,Ye,Be,Je){U[He]=0;function mt(we){return function(){W=we,++U[He],Ae()}}function le(we){ie(Be,we,He),Je!=="keyup"&&(X=v(we)),setTimeout(Q,10)}for(var Ze=0;Ze<Ye.length;++Ze){var pe=Ze+1===Ye.length,se=pe?le:mt(Je||R(Ye[Ze+1]).action);De(Ye[Ze],se,Je,He,Ze)}}function De(He,Ye,Be,Je,mt){F._directMap[He+":"+Be]=Ye,He=He.replace(/\s+/g," ");var le=He.split(" "),Ze;if(le.length>1){Pe(He,le,Ye,Be);return}Ze=R(He,Be),F._callbacks[Ze.key]=F._callbacks[Ze.key]||[],J(Ze.key,Ze.modifiers,{type:Ze.action},Je,He,mt),F._callbacks[Ze.key][Je?"unshift":"push"]({callback:Ye,modifiers:Ze.modifiers,action:Ze.action,seq:Je,level:mt,combo:He})}F._bindMultiple=function(He,Ye,Be){for(var Je=0;Je<He.length;++Je)De(He[Je],Ye,Be)},h(I,"keypress",Se),h(I,"keydown",Se),h(I,"keyup",Se)}$.prototype.bind=function(I,F,U){var z=this;return I=I instanceof Array?I:[I],z._bindMultiple.call(z,I,F,U),z},$.prototype.unbind=function(I,F){var U=this;return U.bind.call(U,I,function(){},F)},$.prototype.trigger=function(I,F){var U=this;return U._directMap[I+":"+F]&&U._directMap[I+":"+F]({},I),U},$.prototype.reset=function(){var I=this;return I._callbacks={},I._directMap={},I},$.prototype.stopCallback=function(I,F){var U=this;if((" "+F.className+" ").indexOf(" mousetrap ")>-1||P(F,U.target))return!1;if("composedPath"in I&&typeof I.composedPath=="function"){var z=I.composedPath()[0];z!==I.target&&(F=z)}return F.tagName=="INPUT"||F.tagName=="SELECT"||F.tagName=="TEXTAREA"||F.isContentEditable},$.prototype.handleKey=function(){var I=this;return I._handleKey.apply(I,arguments)},$.addKeycodes=function(I){for(var F in I)I.hasOwnProperty(F)&&(r[F]=I[F]);l=null},$.init=function(){var I=$(n);for(var F in I)F.charAt(0)!=="_"&&($[F]=(function(U){return function(){return I[U].apply(I,arguments)}})(F))},$.init(),e.Mousetrap=$,t.exports&&(t.exports=$)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(dS)),dS.exports}var cte=ute();const dte=Z_(cte);var Rd=null;function HP(t,e){var n,o;return t.x+=e,t.y+=e,dw(t.text)||(t.text.x+=e,t.text.y+=e),dw((n=t.properties)===null||n===void 0?void 0:n._label)||(o=t.properties)===null||o===void 0||o._label.forEach(function(r){r.x+=e,r.y+=e}),t}function XP(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(function(n){n.x+=e,n.y+=e}),dw(t.text)||(t.text.x+=e,t.text.y+=e),t}var am=40,P0=40;function fte(t,e){var n=t.keyboard,o=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(P0=am,!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=t.options.guards,i=e.getSelectElements(!1),a=r&&r.beforeClone?r.beforeClone(i):!0;return!a||i.nodes.length===0&&i.edges.length===0?(Rd=null,!0):(Rd=i,Rd.nodes.forEach(function(s){return HP(s,am)}),Rd.edges.forEach(function(s){return XP(s,am)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(Rd&&(Rd.nodes||Rd.edges)){t.clearSelectElements();var r=t.addElements(Rd,P0);if(!r)return!0;r.nodes.forEach(function(i){return t.selectElementById(i.id,!0)}),r.edges.forEach(function(i){return t.selectElementById(i.id,!0)}),Rd.nodes.forEach(function(i){return HP(i,am)}),Rd.edges.forEach(function(i){return XP(i,am)}),P0=P0+am}return!1}),n.on(["cmd + z","ctrl + z"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.undo(),!1)}),n.on(["cmd + y","ctrl + y"],function(){return!(o!=null&&o.enabled)||e.textEditElement?!0:(t.redo(),!1)}),n.on(["backspace"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;var r=e.getSelectElements(!0);return t.clearSelectElements(),r.edges.forEach(function(i){return i.id&&t.deleteEdge(i.id)}),r.nodes.forEach(function(i){return i.id&&t.deleteNode(i.id)}),!1})}var pte=(function(){function t(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var n=e.lf;this.target=n.container,this.mousetrap=new dte(this.target),e.keyboard.enabled&&!n.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var e=this,n,o=((n=this.options.keyboard)!==null&&n!==void 0?n:{}).shortcuts;if(o)if(qa(o))o.forEach(function(s){var l=s.keys,f=s.callback,h=s.action;return e.on(l,f,h)});else{var r=o.keys,i=o.callback,a=o.action;this.on(r,i,a)}},t.prototype.on=function(e,n,o){this.mousetrap.bind(this.getKeys(e),n,o)},Object.defineProperty(t.prototype,"disabled",{get:function(){var e,n;return((n=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||n===void 0?void 0:n.enabled)!==!0},enumerable:!1,configurable:!0}),t.prototype.off=function(e,n){this.mousetrap.unbind(this.getKeys(e),n)},t.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.destroy=function(){this.mousetrap.reset()},t.prototype.getKeys=function(e){var n=this;return(Array.isArray(e)?e:[e]).map(function(o){return n.formatKey(o)})},t.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t})(),vh=function(){return vh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},vh.apply(this,arguments)},R0=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fS=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},pS=Symbol("plugin registered by Logicflow.use"),YP=(function(){function t(e){var n=this,o;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(f,h){return n.viewMap.set(f,h)},this.getView=function(f){return n.viewMap.get(f)};var r=M_.get(e),i=r.container,a=r.width,s=r.height;this.options=r,this.container=this.initContainer(i,a,s),this.graphModel=new ree(vh(vh({},r),{container:this.container})),this.plugins=(o=r.plugins)!==null&&o!==void 0?o:[];var l=this.graphModel.eventCenter;this.tool=new ete(this),this.dnd=new Wee({lf:this}),this.history=new ste(l),this.keyboard=new pte({lf:this,keyboard:r.keyboard}),r.snapline!==!1&&(this.snaplineModel=new oee(this.graphModel,r.snaplineEpsilon),Gee(l,this.snaplineModel)),r.isSilentMode||(fte(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(r.disabledPlugins)}return t.prototype.initContainer=function(e,n,o){var r=document.createElement("div");return r.style.position="relative",r.style.width=n?"".concat(n,"px"):"100%",r.style.height=o?"".concat(o,"px"):"100%",e.innerHTML="",e.appendChild(r),r},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(e,n,o){if(o===void 0&&(o=!0),typeof e!="string"){this.registerElement(e);return}var r={BaseEdge:Z1,BaseEdgeModel:K1,BaseNode:Ih,BaseNodeModel:Lh,RectNode:Zv,RectNodeModel:Hm,CircleNode:Ww,CircleNodeModel:$w,PolygonNode:zw,PolygonNodeModel:Uw,TextNode:$P,TextNodeModel:IP,LineEdge:WP,LineEdgeModel:RP,DiamondNode:r2,DiamondNodeModel:XA,PolylineEdge:$_,PolylineEdgeModel:F_,BezierEdge:VP,BezierEdgeModel:kP,EllipseNode:i2,EllipseNodeModel:YA,HtmlNode:l2,HtmlNodeModel:qA,h:Lr,type:e};if(this.viewMap.forEach(function(f){var h=f.extendKey;h&&(r[h]=f)}),this.graphModel.modelMap.forEach(function(f){var h=f.extendKey;h&&(r[h]=f)}),n){var i=n(r),a=i.view,s=i.model,l=a;o&&!l.isObserved&&(l.isObserved=!0,l=xs(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},t.prototype.registerElement=function(e){var n=e.view;e.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=xs(n)),this.setView(e.type,n),this.graphModel.setModel(e.type,e.model)},t.prototype.batchRegister=function(e){var n=this;e===void 0&&(e=[]),ri(e,function(o){n.registerElement(o)})},t.prototype.defaultRegister=function(){var e=[{type:"rect",view:Zv,model:Hm},{type:"circle",view:Ww,model:$w},{type:"polygon",view:zw,model:Uw},{type:"text",view:$P,model:IP},{type:"ellipse",view:i2,model:YA},{type:"diamond",view:r2,model:XA},{type:"html",view:l2,model:qA},{type:"line",view:WP,model:RP},{type:"polyline",view:$_,model:F_},{type:"bezier",view:VP,model:kP}];this.batchRegister(e)},t.prototype.addNode=function(e,n,o){return n===void 0&&(n=hr.NODE_ADD),this.graphModel.addNode(e,n,o)},t.prototype.deleteNode=function(e){var n=this.graphModel.getNodeModelById(e);if(!n)return!1;var o=n.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteNode(e),i},t.prototype.cloneNode=function(e){var n=this.graphModel.getNodeModelById(e),o=n==null?void 0:n.getData();if(o){var r=this.options.guards,i=r!=null&&r.beforeClone?r.beforeClone(o):!0;if(i)return this.graphModel.cloneNode(e)}},t.prototype.changeNodeId=function(e,n){return this.graphModel.changeNodeId(e,n)},t.prototype.changeNodeType=function(e,n){this.graphModel.changeNodeType(e,n)},t.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},t.prototype.getNodeDataById=function(e){var n=this.getNodeModelById(e);return n==null?void 0:n.getData()},t.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},t.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},t.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},t.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},t.prototype.createFakeNode=function(e){var n=this.graphModel.modelMap.get(e.type);if(!n)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var o=new n(vh(vh({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(o),o},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(e){var n;(n=this.snaplineModel)===null||n===void 0||n.setNodeSnapLine(e)},t.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},t.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},t.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},t.prototype.getEdgeDataById=function(e){var n=this.getEdgeModelById(e);return n==null?void 0:n.getData()},t.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},t.prototype.getEdgeModels=function(e){var n=e.sourceNodeId,o=e.targetNodeId,r=[],i=this.graphModel.edges;return n&&o?ri(i,function(a){a.sourceNodeId===n&&a.targetNodeId===o&&r.push(a)}):n?ri(i,function(a){a.sourceNodeId===n&&r.push(a)}):o&&ri(i,function(a){a.targetNodeId===o&&r.push(a)}),r},t.prototype.changeEdgeId=function(e,n){return this.graphModel.changeEdgeId(e,n)},t.prototype.changeEdgeType=function(e,n){this.graphModel.changeEdgeType(e,n)},t.prototype.deleteEdge=function(e){var n=this.graphModel.getEdgeModelById(e);if(!n)return!1;var o=n.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteEdgeById(e),i},t.prototype.deleteEdgeByNodeId=function(e){var n=e.sourceNodeId,o=e.targetNodeId;n&&o?this.graphModel.deleteEdgeBySourceAndTarget(n,o):n?this.graphModel.deleteEdgeBySource(n):o&&this.graphModel.deleteEdgeByTarget(o)},t.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},t.prototype.addElements=function(e,n){var o=this,r=e.nodes,i=e.edges;n===void 0&&(n=40),console.log("distance",n);var a={},s={nodes:[],edges:[]};return ri(r,function(l){var f=l.id,h=o.addNode(l);f&&(a[f]=h.id),s.nodes.push(h)}),ri(i,function(l){var f=l.sourceNodeId,h=l.targetNodeId;a[f]&&(f=a[f]),a[h]&&(h=a[h]);var v=o.graphModel.addEdge(vh(vh({},l),{sourceNodeId:f,targetNodeId:h}));s.edges.push(v)}),s},t.prototype.selectElementById=function(e,n,o){n===void 0&&(n=!1),o===void 0&&(o=!0),this.graphModel.selectElementById(e,n),!n&&o&&this.graphModel.toFront(e)},t.prototype.deselectElementById=function(e){this.graphModel.deselectElementById(e)},t.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(e){return this.graphModel.getElement(e)},t.prototype.getDataById=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getData()},t.prototype.deleteElement=function(e){var n,o,r,i=this.getModelById(e);if(!i)return!1;var a=(n={},n[da.NODE]=this.deleteNode,n[da.EDGE]=this.deleteEdge,n);return(r=(o=a[i.BaseType])===null||o===void 0?void 0:o.call(this,e))!==null&&r!==void 0?r:!1},t.prototype.setElementZIndex=function(e,n){return this.graphModel.setElementZIndex(e,n)},t.prototype.getAreaElement=function(e,n,o,r,i){return o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1),this.graphModel.getAreaElement(e,n,o,r,i).map(function(a){return a.getData()})},t.prototype.setProperties=function(e,n){var o;(o=this.graphModel.getElement(e))===null||o===void 0||o.setProperties(Jl(n))},t.prototype.getProperties=function(e){var n;return(n=this.graphModel.getElement(e))===null||n===void 0?void 0:n.getProperties()},t.prototype.deleteProperty=function(e,n){var o;(o=this.graphModel.getElement(e))===null||o===void 0||o.deleteProperty(n)},t.prototype.updateAttributes=function(e,n){this.graphModel.updateAttributes(e,n)},t.prototype.editText=function(e){this.graphModel.editText(e)},t.prototype.updateText=function(e,n){this.graphModel.updateText(e,n)},t.prototype.updateEditConfig=function(e){var n=this.graphModel,o=n.editConfigModel,r=n.transformModel,i=o.snapGrid;if(o.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&r.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!ws(e==null?void 0:e.snapGrid)&&e.snapGrid!==i){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}this.emit(hr.EDIT_CONFIG_CHANGED,{data:o.getConfig()})},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(e,n){this.graphModel.setTheme(e,n)},t.prototype.getTheme=function(){return this.graphModel.getTheme()},t.prototype.focusByElement=function(e){var n=void 0,o=this.getNodeModelById(e);if(o){var r=o.getData(),i=r.x,a=r.y;n={x:i,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,i=l.x,a=l.y;n={x:i,y:a}}n&&this.focusByCoordinate(n)},t.prototype.focusByCoordinate=function(e){var n=this.graphModel,o=n.transformModel,r=n.width,i=n.height,a=e.x,s=e.y;o.focusOn(a,s,r,i)},t.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var n=e.id,o=e.coordinate;n&&this.focusByElement(n),o&&this.focusByCoordinate(o)}},t.prototype.resize=function(e,n){this.graphModel.resize(e,n),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(e){this.graphModel.toFront(e)},t.prototype.getPointByClient=function(e,n){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof n=="number")return this.graphModel.getPointByClient({x:e,y:n})},t.prototype.getGraphData=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,fS([o],R0(e),!1)):o},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},t.prototype.setOverlapMode=function(e){this.graphModel.setOverlapMode(e)},t.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(Jl(e)),this.options.history!==!1&&this.history.watch(this.graphModel),iP($t(uee,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(hr.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(e){var n=to(e);this.adapterIn&&(n=this.adapterIn(n)),this.renderRawData(n)},t.prototype.undo=function(){if(this.history.undoAble()){var e=Jl(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.redo=function(){if(this.history.redoAble()){var e=Jl(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.zoom=function(e,n){var o=this.graphModel.transformModel;return o.zoom(e,n)},t.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},t.prototype.setZoomMiniSize=function(e){var n=this.graphModel.transformModel;n.setZoomMiniSize(e)},t.prototype.setZoomMaxSize=function(e){var n=this.graphModel.transformModel;n.setZoomMaxSize(e)},t.prototype.getTransform=function(){var e=this.graphModel.transformModel,n=e.SCALE_X,o=e.SCALE_Y,r=e.TRANSLATE_X,i=e.TRANSLATE_Y;return{SCALE_X:n,SCALE_Y:o,TRANSLATE_X:r,TRANSLATE_Y:i}},t.prototype.translate=function(e,n){var o=this.graphModel.transformModel;o.translate(e,n)},t.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,n=e.TRANSLATE_X,o=e.TRANSLATE_Y;this.translate(-n,-o)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(e,n){n===void 0&&(n=e),this.graphModel.fitView(e,n)},t.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},t.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},t.prototype.on=function(e,n){this.graphModel.eventCenter.on(e,n)},t.prototype.off=function(e,n){this.graphModel.eventCenter.off(e,n)},t.prototype.once=function(e,n){this.graphModel.eventCenter.once(e,n)},t.prototype.emit=function(e,n){this.graphModel.eventCenter.emit(e,n)},t.use=function(e,n){var o,r=e.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,(o={},o[pS]=pS,o.extension=e,o.props=n,o))},t.addThemeMode=function(e,n){nQ(e,n)},t.removeThemeMode=function(e){rQ(e)},t.clearThemeMode=function(){oQ()},t.prototype.installPlugins=function(e){var n=this;e===void 0&&(e=[]);var o=Array.from(t.extensions,function(i){var a=R0(i,2),s=a[1];return s}),r=fS(fS([],R0(this.plugins),!1),R0(o),!1);ri(r,function(i){var a,s;pS in i?(a=i.extension,s=i.props):a=i;var l=a==null?void 0:a.pluginName;Hj(e,l)===-1&&n.installPlugin(a,s)})},t.prototype.installPlugin=function(e,n){var o,r;if("pluginName"in e&&"install"in e){var i=e.pluginName,a=e.install,s=e.render;i&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[i]=e);return}var l=e,f=l.pluginName,h=new l({lf:this,LogicFlow:t,props:n,options:(r=(o=this.options.pluginsOptions)===null||o===void 0?void 0:o[f])!==null&&r!==void 0?r:{}});h.render&&this.components.push(h.render.bind(h)),this.extension[f]=h},t.prototype.destroy=function(){var e;this.clearData(),iP(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var n in this.extension){var o=this.extension[n];"destroy"in o&&((e=o.destroy)===null||e===void 0||e.call(o))}},t.extensions=new Map,t})();(function(t){t.toStringTag="LF.".concat(t.name)})(YP||(YP={}));function xs(t){return NM(t)}var hte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,o=e==="x"?n:n&3|8;return o.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),vte=(globalThis==null?void 0:globalThis._ids)||new hte;function sy(){return vte.next()}var PI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){PI(e,t);function e(n,o){return n.id||(n.id="Event_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,o)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(o),n},e.extendKey="StartEventModel",e})($w);(function(t){PI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e})(Ww);var RI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),qw=function(){return qw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},qw.apply(this,arguments)};(function(t){RI(e,t);function e(n,o){return n.id||(n.id="Event_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),t.call(this,n,o)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var n=t.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(){return!1}};return n.push(o),n},e.extendKey="EndEventModel",e})($w);(function(t){RI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=t.prototype.getShape.call(this);return Lr("g",{},l,Lr("circle",qw(qw({},o),{cx:i,cy:a,r:s-5})))},e.extendKey="EndEventView",e})(Ww);var DI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){DI(e,t);function e(n,o){return n.id||(n.id="Flow_".concat(sy())),t.call(this,n,o)||this}return e.extendKey="SequenceFlowModel",e})(F_);(function(t){DI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e})($_);var jI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f_=function(){return f_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},f_.apply(this,arguments)};(function(t){jI(e,t);function e(n,o){var r=this;return n.id||(n.id="Gateway_".concat(sy())),n.text||(n.text=""),n.text&&typeof n.text=="string"&&(n.text={value:n.text,x:n.x,y:n.y+40}),r=t.call(this,n,o)||this,r.points=[[25,0],[50,25],[25,50],[0,25]],r}return e.extendKey="ExclusiveGatewayModel",e})(Uw);(function(t){jI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getShape=function(){var n=this.props.model,o=n,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,f=n.getNodeStyle();return Lr("g",{transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")},Lr("polygon",f_(f_({},f),{x:r,y:i,points:l})),Lr("path",f_({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},f)))},e.extendKey="ExclusiveGatewayNode",e})(zw);var LI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),f2=function(){return f2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},f2.apply(this,arguments)};(function(t){LI(e,t);function e(n,o){return n.id||(n.id="Activity_".concat(sy())),t.call(this,n,o)||this}return e.extendKey="ServiceTaskModel",e})(Hm);(function(t){LI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getNodeStyle();return Lr("svg",{x:o-i/2+5,y:r-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Lr("path",{fill:s.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Lr("g",{},[Lr("rect",f2({x:o-i/2,y:r-a/2,rx:s,ry:s,width:i,height:a},l)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e})(Zv);var II=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Kw=function(){return Kw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Kw.apply(this,arguments)};(function(t){II(e,t);function e(n,o){return n.id||(n.id="Activity_".concat(sy())),t.call(this,n,o)||this}return e.extendKey="UserTaskModel",e})(Hm);(function(t){II(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getNodeStyle();return Lr("svg",{x:o-i/2+5,y:r-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Lr("path",{fill:s.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.radius,l=n.getNodeStyle();return Lr("g",{},[Lr("rect",Kw(Kw({},l),{x:o-i/2,y:r-a/2,rx:s,ry:s,width:i,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e})(Zv);var gte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var n=Math.random()*16|0,o=e==="x"?n:n&3|8;return o.toString(16)})},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),mte=(globalThis==null?void 0:globalThis._ids)||new gte;function qP(){return mte.next()}function FI(t){return Object.prototype.toString.call(t)}function yte(t){return" ".repeat(t)}function Zw(t){var e=t;return FI(t)==="[object Object]"?(e={},Object.keys(t).forEach(function(n){var o=n;n.charAt(0)==="-"&&(o=n.substring(1)),e[o]=Zw(t[n])})):Array.isArray(t)&&(e=[],t.forEach(function(n,o){e[o]=Zw(n)})),e}function Jw(t){return t==null?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function _te(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(Zw(t)).replace(/"/g,"'")}return Jw(String(e))}var Tv=`
|
||
`;function Z0(t,e,n){var o=yte(n);if(t!==0&&t!==!1&&!t)return Tv+o+"<".concat(e," />");var r="";if(e==="#text")return Tv+o+Jw(String(t));if(e==="#cdata-section")return Tv+o+"<![CDATA["+t+"]]>";if(e==="#comment")return Tv+o+"<!--"+t+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+_te(t)+'"';if(Array.isArray(t))t.forEach(function(l){r+=Z0(l,e,n+1)});else if(FI(t)==="[object Object]"){var i=Object.keys(t),a="",s="";r+=(n===0?"":Tv+o)+"<"+e,i.forEach(function(l){l.charAt(0)==="-"?a+=Z0(t[l],l,n+1):s+=Z0(t[l],l,n+1)}),r+=a+(s!==""?">".concat(s).concat(Tv+o,"</").concat(e,">"):" />")}else r+=Tv+o+"<".concat(e,">").concat(Jw(String(t)),"</").concat(e,">");return r}function bte(t){var e="";for(var n in t)e+=Z0(t[n],n,0);return e}var As=function(){};As.ObjTree=function(){return this};As.ObjTree.VERSION="0.23";As.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;As.ObjTree.prototype.attr_prefix="-";As.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)};As.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,s=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),s&&s(h)}}else o.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(l=f.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)};As.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!=11){var o={};o[t.nodeName]=n,n=o}return n}};As.ObjTree.prototype.parseElement=function(t){if(t.nodeType!=7){if(t.nodeType==3||t.nodeType==4||t.nodeType==8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,o={};if(t.attributes&&t.attributes.length){n={};for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r].nodeName;if(typeof i=="string"){var a=t.attributes[r].nodeValue;try{a=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[r].nodeValue}a&&(i=this.attr_prefix+i,typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r<t.childNodes.length&&s;r++){var l=t.childNodes[r].nodeType;l==3||l==4||l==8||(s=!1)}if(s){n||(n="");for(var r=0;r<t.childNodes.length;r++)n+=t.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<t.childNodes.length;r++){var i=t.childNodes[r].nodeName;if(typeof i=="string"){var a=this.parseElement(t.childNodes[r]);a&&(typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};As.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n==1&&(t[e]=[]),t[e][t[e].length]=o):n==1?t[e]=o:n==2?t[e]=[t[e],o]:t[e][t[e].length]=o};As.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};As.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];r.charAt(0)!=this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<"+r+" />":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<"+t+a+`>
|
||
`+s+"</"+t+`>
|
||
`:s="<"+t+a+">"+s+"</"+t+`>
|
||
`:s="<"+t+a+` />
|
||
`),s};As.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];typeof r>"u"||r==null?n[n.length]="<"+t+" />":typeof r=="object"&&r.constructor==Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};As.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+`>
|
||
`};As.ObjTree.prototype.xml_escape=Jw;var wte=function(t){return new As.ObjTree().parseXML(t)},Ete=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p2=function(){return p2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},p2.apply(this,arguments)},J1=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xd;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"})(Xd||(Xd={}));var BI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],KP=["properties","startPoint","endPoint","pointsList"],$I=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function ZP(t){var e=t?KP.concat(t):KP;return function(n){function o(r){var i={};return typeof r=="string"?r:Array.isArray(r)?r.map(function(a){return o(a)}):(Object.entries(r).forEach(function(a){var s=J1(a,2),l=s[0],f=s[1];typeof f!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?i[l]=f:i["-".concat(l)]=f:e.includes(l)?i["-".concat(l)]=o(f):i[l]=o(f)}),i)}return o(n)}}function Qw(t){var e={};return Object.entries(t).forEach(function(n){var o=J1(n,2),r=o[0],i=o[1];r.indexOf("-")===0?e[r.substring(1)]=Zw(i):typeof i=="string"?e[r]=i:Object.prototype.toString.call(i)==="[object Object]"?e[r]=Qw(i):Array.isArray(i)?e[r]=i.map(function(a){return Qw(a)}):e[r]=i}),e}function xte(t,e,n){var o=new Map;e.nodes.forEach(function(i){var a,s={"-id":i.id};if(!((a=i.text)===null||a===void 0)&&a.value&&(s["-name"]=i.text.value),i.properties){var l=ZP(n)(i.properties);Object.assign(s,l)}o.set(i.id,s),t[i.type]?Array.isArray(t[i.type])?t[i.type].push(s):t[i.type]=[t[i.type],s]:t[i.type]=s});var r=e.edges.map(function(i){var a,s,l=o.get(i.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(i.id):l["bpmn:incoming"]=[l["bpmn:incoming"],i.id]:l["bpmn:incoming"]=i.id;var f={"-id":i.id,"-sourceRef":i.sourceNodeId,"-targetRef":i.targetNodeId};if(!((a=i.text)===null||a===void 0)&&a.value&&(f["-name"]=(s=i.text)===null||s===void 0?void 0:s.value),i.properties){var h=ZP(n)(i.properties);Object.assign(f,h)}return f});e.edges.forEach(function(i){var a=o.get(i.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(i.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],i.id]:a["bpmn:outgoing"]=i.id}),t[Xd.FLOW]=r}function Ote(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var o,r=n.id,i=n.pointsList.map(function(s){var l=s.x,f=s.y;return{"-x":l,"-y":f}}),a={"-id":"".concat(r,"_di"),"-bpmnElement":r,"di:waypoint":i};return!((o=n.text)===null||o===void 0)&&o.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var o,r=n.id,i=100,a=80,s=n.x,l=n.y,f=Fh.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),s-=i/2,l-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":s,"-y":l,"-width":i,"-height":a}};return!((o=n.text)===null||o===void 0)&&o.value&&(h["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),h})}function Ste(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var r=o["bpmn:process"],i=o["bpmndi:BPMNDiagram"],a=i==null?void 0:i["bpmndi:BPMNPlane"];if(!r||!a)return{nodes:e,edges:n};Object.keys(r).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=r[s];if(s===Xd.FLOW){var f=a["bpmndi:BPMNEdge"],h=(Array.isArray(f),f);n=Mte(l,h)}else{var v=a["bpmndi:BPMNShape"],_=(Array.isArray(v),v);e=e.concat(Ate(l,_,s))}}})}return{nodes:e,edges:n}}function Ate(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=e;var l=JP(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=JP(r,n,t);o.push(i)}return o}function JP(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=$I(n["-name"]),a=Fh.shapeConfigMap.get(e);a&&(o+=a.width/2,r+=a.height/2);var s;Object.entries(n).forEach(function(v){var _=J1(v,2),E=_[0],O=_[1];BI.indexOf(E)===-1&&(s||(s={}),s[E]=O)}),s&&(s=Qw(s));var l;if(i&&(l={x:o,y:r,value:i},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var f=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(f["-x"])+Number(f["-width"])/2,l.y=Number(f["-y"])+Number(f["-height"])/2}var h={id:t["-bpmnElement"],type:e,x:o,y:r,properties:s};return l&&(h.text=l),h}function Mte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(QP(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(QP(o,t))}return n}function QP(t,e){var n,o=e["-name"]?$I("".concat(e["-name"])):"";if(o){var r=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(r=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var i=0;if(o.split(`
|
||
`).forEach(function(E){i<E.length&&(i=E.length)}),r)n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7};else{var a=t["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,f=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,h=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;n={value:o,x:f,y:h}}}var v;Object.entries(e).forEach(function(E){var O=J1(E,2),w=O[0],S=O[1];BI.indexOf(w)===-1&&(v||(v={}),v[w]=S)}),v&&(v=Qw(v));var _={id:e["-id"],type:Xd.FLOW,pointsList:t["di:waypoint"].map(function(E){return{x:Number(E["-x"]),y:Number(E["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:v};return n&&(_.text=n),_}var Fh=(function(){function t(e){var n=e.lf,o=this;this.adapterOut=function(r,i){var a=p2({},o.processAttributes);xte(a,r,i);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};Ote(s,r);var l=o.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var f={"bpmn:definitions":l};return f},this.adapterIn=function(r){if(r)return Ste(r)},n.adapterIn=function(r){return o.adapterIn(r)},n.adapterOut=function(r,i){return o.adapterOut(r,i)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(qP())},this.definitionAttributes={"-id":"Definitions_".concat(qP()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t})();Fh.shapeConfigMap.set(Xd.START,{width:_k.width,height:_k.height});Fh.shapeConfigMap.set(Xd.END,{width:bk.width,height:bk.height});Fh.shapeConfigMap.set(Xd.GATEWAY,{width:wk.width,height:wk.height});Fh.shapeConfigMap.set(Xd.SYSTEM,{width:Ek.width,height:Ek.height});Fh.shapeConfigMap.set(Xd.USER,{width:xk.width,height:xk.height});(function(t){Ete(e,t);function e(n){var o=t.call(this,n)||this;o.adapterXmlIn=function(i){var a=typeof i=="string"?o.sanitizeNameAttributes(i):i,s=wte(a);return o.adapterIn(s)},o.adapterXmlOut=function(i,a){var s=o.adapterOut(i,a);return bte(s)};var r=n.lf;return r.adapterIn=o.adapterXmlIn,r.adapterOut=o.adapterXmlOut,o}return e.prototype.sanitizeNameAttributes=function(n){return n.replace(/name="([^"]*)"/g,function(o,r){var i=r.replace(/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">");return'name="'.concat(i,'"')})},e.pluginName="bpmnXmlAdapter",e})(Fh);var Tte=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var o=Math.random()*16|0,r=n==="x"?o:o&3|8;return r.toString(16)});return e},t.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},t})(),Cte=(globalThis==null?void 0:globalThis._ids)||new Tte;function Nte(){return Cte.next()}Lr("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),Lr("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),Lr("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});Lr("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"});Lr("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"});var kte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Uv=function(){return Uv=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Uv.apply(this,arguments)},Pte=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Rte=ac,Dte=(function(t){kte(e,t);function e(n){var o=t.call(this)||this;return o.updatePosition=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.x,f=s.y;o.nodeModel.x=l+i/2,o.nodeModel.y=f+a/2,o.nodeModel.moveText(i/2,a/2)},o.getResize=function(r){var i=r.index,a=r.deltaX,s=r.deltaY,l=r.width,f=r.height,h=r.PCTResizeInfo,v=r.pct,_=v===void 0?1:v,E=r.freezeWidth,O=E===void 0?!1:E,w=r.freezeHeight,S=w===void 0?!1:w,M={width:l,height:f,deltaX:a,deltaY:s};if(h){var T=4,B=0,R=0;switch(i){case 0:R=(a*-1-s)/T;break;case 1:R=(a-s)/T;break;case 2:R=(a+s)/T;break;case 3:R=(a*-1+s)/T;break}R!==0&&(B=Math.round(R/h.ResizeBasis.basisHeight*1e5)/1e3),h.ResizePCT.widthPCT=Math.max(Math.min(h.ResizePCT.widthPCT+B,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit),h.ResizePCT.heightPCT=Math.max(Math.min(h.ResizePCT.heightPCT+B,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit);var P=Math.round(h.ResizePCT.widthPCT*h.ResizeBasis.basisWidth/100),$=Math.round(h.ResizePCT.heightPCT*h.ResizeBasis.basisHeight/100);switch(i){case 0:a=l-P,s=f-$;break;case 1:a=P-l,s=f-$;break;case 2:a=P-l,s=$-f;break;case 3:a=l-P,s=$-f;break}return M.width=P,M.height=$,M.deltaX=a/_,M.deltaY=s/_,M}switch(i){case 0:M.width=O?l:l-a*_,M.height=S?f:f-s*_;break;case 1:M.width=O?l:l+a*_,M.height=S?f:f-s*_;break;case 2:M.width=O?l:l+a*_,M.height=S?f:f+s*_;break;case 3:M.width=O?l:l-a*_,M.height=S?f:f+s*_;break}return M},o.updateEdgePointByAnchors=function(){var r=o.nodeModel,i=r.id,a=r.anchors,s=o.getNodeEdges(i);s.sourceEdges.forEach(function(l){var f=a.find(function(h){return h.id===l.sourceAnchorId});f&&l.updateStartPoint({x:f.x,y:f.y})}),s.targetEdges.forEach(function(l){var f=a.find(function(h){return h.id===l.targetAnchorId});f&&l.updateEndPoint({x:f.x,y:f.y})})},o.updateRect=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.x,f=s.y,h=s.width,v=s.height,_=s.radius,E=s.PCTResizeInfo,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,B=o.index,R=w===M,P=S===T,$=o.getResize({index:B,deltaX:i,deltaY:a,width:h,height:v,PCTResizeInfo:E,pct:1,freezeWidth:R,freezeHeight:P});if($.width<w||$.width>M||$.height<S||$.height>T){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:R?0:$.deltaX,deltaY:P?0:$.deltaY}),o.nodeModel.width=$.width,o.nodeModel.height=$.height,o.nodeModel.setProperties({nodeSize:{width:$.width,height:$.height}});var I={x:l,y:f,width:h,height:v,radius:_},F={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:_};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:I,afterNode:F})},o.updateEllipse=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.rx,f=s.ry,h=s.x,v=s.y,_=s.PCTResizeInfo,E=o.index,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,B=w===M,R=S===T,P=l,$=f,I=o.getResize({index:E,deltaX:i,deltaY:a,width:P,height:$,PCTResizeInfo:_,pct:1/2,freezeWidth:B,freezeHeight:R});if(I.width<w/2||I.width>M/2||I.height<S/2||I.height>T/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:B?0:I.deltaX,deltaY:R?0:I.deltaY}),o.nodeModel.rx=I.width,o.nodeModel.ry=I.height,o.nodeModel.setProperties({nodeSize:{rx:I.width,ry:I.height}});var F={x:h,y:v},U={rx:I.width,ry:I.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:Uv(Uv({},F),{rx:l,ry:f}),afterNode:U})},o.updateDiamond=function(r){var i=r.deltaX,a=r.deltaY,s=o.nodeModel,l=s.rx,f=s.ry,h=s.x,v=s.y,_=s.PCTResizeInfo,E=o.index,O=o.nodeModel,w=O.minWidth,S=O.minHeight,M=O.maxWidth,T=O.maxHeight,B=w===M,R=S===T,P=l,$=f,I=o.getResize({index:E,deltaX:i,deltaY:a,width:P,height:$,PCTResizeInfo:_,pct:1/2,freezeWidth:B,freezeHeight:R});if(I.width<w/2||I.width>M/2||I.height<S/2||I.height>T/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:B?0:I.deltaX,deltaY:R?0:I.deltaY}),o.nodeModel.rx=I.width,o.nodeModel.ry=I.height,o.nodeModel.setProperties({nodeSize:{rx:I.width,ry:I.height}});var F={x:h,y:v,rx:l,ry:f},U={rx:I.width,ry:I.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:F,afterNode:U})},o.eventEmit=function(r){var i=r.deltaX,a=r.deltaY,s=r.beforeNode,l=r.afterNode,f=o.nodeModel,h=f.id,v=f.modelType,_=f.type,E=Uv({id:h,modelType:v,type:_},s),O=Uv({id:h,modelType:v,type:_},l);o.graphModel.eventCenter.emit("node:resize",{preData:E,data:O,deltaX:i,deltaY:a,index:o.index,model:o.nodeModel})},o.onDragging=function(r){var i,a=r.deltaX,s=r.deltaY,l=o.graphModel.transformModel,f=o.nodeModel.modelType;i=Pte(l.fixDeltaXY(a,s),2),a=i[0],s=i[1],f===bo.RECT_NODE||f===bo.HTML_NODE?o.updateRect({deltaX:a,deltaY:s}):f===bo.ELLIPSE_NODE?o.updateEllipse({deltaX:a,deltaY:s}):f===bo.DIAMOND_NODE&&o.updateDiamond({deltaX:a,deltaY:s})},o.onDragEnd=function(){var r=o.graphModel.gridSize,i=r===void 0?1:r,a=i*Math.round(o.nodeModel.x/i),s=i*Math.round(o.nodeModel.y/i);o.nodeModel.moveTo(a,s),o.updateEdgePointByAnchors()},o.index=n.index,o.nodeModel=n.model,o.graphModel=n.graphModel,o.dragHandler=new Rte({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:1}),o}return e.prototype.getNodeEdges=function(n){for(var o=this.graphModel,r=o.edges,i=[],a=[],s=0;s<r.length;s++){var l=r[s];l.sourceNodeId===n?i.push(l):r[s].targetNodeId===n&&a.push(l)}return{sourceEdges:i,targetEdges:a}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.index,a=n.model,s=a.getControlPointStyle();return $t("g",{className:"lf-resize-control-".concat(i),children:$t(qu,Uv({className:"lf-node-control",x:o,y:r},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},e})(ko),jte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),e1=function(){return e1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},e1.apply(this,arguments)},Q1=(function(t){jte(e,t);function e(){var n=t.call(this)||this;return n.state={},n}return e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=o.x,a=o.y,s=o.width,l=o.height,f={minX:i-s/2,minY:a-l/2,maxX:i+s/2,maxY:a+l/2},h=f.minX,v=f.minY,_=f.maxX,E=f.maxY,O=[{x:h,y:v},{x:_,y:v},{x:_,y:E},{x:h,y:E}];return O.map(function(w,S){return $t(Dte,e1({index:S},w,{model:o,graphModel:r}))})},e.prototype.getGroupSolid=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.getResizeOutlineStyle();return $t(qu,e1({},s,{x:o,y:r,width:i,height:a}))},e.prototype.render=function(){return $t("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e})(ko),UI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})();(function(t){UI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},i={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(YA);(function(t){UI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,o=n.model,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o.isSelected&&!r?this.getControlGroup():""]})},e})(i2);var VI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h2=function(){return h2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},h2.apply(this,arguments)};(function(t){VI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.rx,basisHeight:this.ry},i={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(XA);(function(t){VI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){var n=this.props.model,o=n.points,r=n.getNodeStyle();return $t("g",{children:$t(RM,h2({},r,{points:o}))})},e.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},e})(r2);var WI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Lte=(function(t){WI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.width,basisHeight:this.height},i={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(qA),Ite=(function(t){WI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},e})(l2),GI={view:Ite,model:Lte},zI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Fte=(function(t){zI(e,t);function e(n,o){var r=t.call(this,n,o)||this,i=n.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return e.prototype.initNodeData=function(n){t.prototype.initNodeData.call(this,n),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var n=t.prototype.getOutlineStyle.call(this),o=this.graphModel.editConfigModel.isSilentMode;return o||(n.stroke="none",n.hover&&(n.hover.stroke="none")),n},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(n){if(n===void 0&&(n=!0),n){var o={widthPCT:100,heightPCT:100},r={basisWidth:this.width,basisHeight:this.height},i={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:o,ResizeBasis:r,ScaleLimit:i}}else delete this.PCTResizeInfo},e})(Hm),Bte=(function(t){zI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props,o=n.model,r=n.graphModel;return $t(Q1,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var n=this.props,o=n.model.isSelected,r=n.graphModel.editConfigModel.isSilentMode;return $t("g",{children:[this.getResizeShape(),o&&!r?this.getControlGroup():""]})},e})(Zv),HI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),t1=function(){return t1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},t1.apply(this,arguments)},Cv=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nv=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},eR=500,tR=300,$te=-1e4;(function(t){HI(e,t);function e(){var n=t.apply(this,Nv([],Cv(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=eR,n.unfoldedHeight=tR,n.childrenLastFoldStatus={},n}return e.prototype.initNodeData=function(n){var o=this;t.prototype.initNodeData.call(this,n);var r=[];qa(n.children)&&(r=n.children),this.children=new Set(r),this.width=eR,this.height=tR,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=$te,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){o.isFolded&&o.foldGroup(o.isFolded)})},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.foldGroup=function(n){var o=this;if(n!==this.isFolded){this.setProperty("isFolded",n),this.isFolded=n,n?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var r=Nv(Nv([],Cv(this.incoming.edges),!1),Cv(this.outgoing.edges),!1);this.children.forEach(function(i){var a=o.graphModel.getElement(i);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var l=o.childrenLastFoldStatus[i];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}o.childrenLastFoldStatus[i]=!!s,a.visible=!n;var f=a.incoming.edges,h=a.outgoing.edges;r=Nv(Nv(Nv([],Cv(r),!1),Cv(f),!1),Cv(h),!1)}}),this.foldEdge(n,r)}},e.prototype.getAnchorStyle=function(n){var o=t.prototype.getAnchorStyle.call(this,n);return o.stroke="transparent",o.fill="transparent",o.hover.fill="transparent",o.hover.stroke="transparent",o},e.prototype.foldEdge=function(n,o){var r=this;o.forEach(function(i,a){var s=i.id,l=i.sourceNodeId,f=i.targetNodeId,h=i.startPoint,v=i.endPoint,_=i.type,E=i.text,O=i.getProperties(),w={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:f,startPoint:h,endPoint:v,type:_,properties:O,text:E==null?void 0:E.value};i.virtual&&r.graphModel.deleteEdgeById(i.id);var S=r.graphModel.group.getNodeGroup(f);S||(S=r.graphModel.getNodeModelById(f));var M=r.graphModel.group.getNodeGroup(l);M||(M=r.graphModel.getNodeModelById(l)),n&&i.visible!==!1&&(r.children.has(l)||r.id===l?(w.startPoint=void 0,w.sourceNodeId=r.id):(w.endPoint=void 0,w.targetNodeId=r.id),(S.id!==r.id||M.id!==r.id)&&r.createVirtualEdge(w),i.visible=!1),!n&&i.visible===!1&&(S&&S.isGroup&&S.isFolded?(w.targetNodeId=S.id,w.endPoint=void 0,r.createVirtualEdge(w)):M&&M.isGroup&&M.isFolded?(w.sourceNodeId=M.id,w.startPoint=void 0,r.createVirtualEdge(w)):i.visible=!0)})},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var o=this.graphModel.addEdge(n);o.virtual=!0,o.text.editable=!1,o.isFoldedEdge=!0},e.prototype.isInRange=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return o>=this.x-this.width/2&&i<=this.x+this.width/2&&r>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var o=n.minX,r=n.minY,i=n.maxX,a=n.maxY;return{x:o>=this.x-this.width/2&&i<=this.x+this.width/2,y:r>=this.y-this.height/2&&a<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(n){this.setProperty("groupAddable",n)},e.prototype.addChild=function(n){this.children.add(n),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(n){this.children.delete(n),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var n=this,o=t.prototype.getData.call(this);o.children=[],this.children.forEach(function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&o.children.push(i)});var r=o.properties;return r==null||delete r.groupAddable,r==null||delete r.isFolded,o},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=Nv([],Cv(this.children),!1),n.isGroup=!0;var o=n.properties;return o==null||delete o.groupAddable,o!=null&&o.isFolded&&(n.x=n.x+this.unfoldedWidth/2-this.foldedWidth/2,n.y=n.y+this.unfoldedHeight/2-this.foldedHeight/2),n},e.prototype.isAllowAppendIn=function(n){return console.info("_nodeData",n),!0},e.prototype.toBack=function(){this.zIndex--},e})(Fte);(function(t){HI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,o=n.resizable,r=n.properties;return o&&!r.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,s=n.radius,l=n.properties,f=n.getAddableOutlineStyle;if(!l.groupAddable)return null;var h=this.props.model.getNodeStyle().strokeWidth,v=h===void 0?0:h,_=f(),E=o+v+8,O=r+v+8;return Lr("rect",t1(t1({},_),{width:E,height:O,x:i-E/2,y:a-O/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var n=this.props.model,o=n.x-n.width/2+5,r=n.y-n.height/2+5;if(!n.foldable)return null;var i=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," M").concat(o+7,",").concat(r+2," ").concat(o+7,",").concat(r+10):"M ".concat(o+3,",").concat(r+6," ").concat(o+11,",").concat(r+6," ")});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n.x-n.width/2+5,y:n.y-n.height/2+5,onClick:function(){n.foldGroup(!n.properties.isFolded)}}),i])},e.prototype.getResizeShape=function(){return Lr("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(Bte);var nR=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),p_=function(){return p_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},p_.apply(this,arguments)};function Ute(t){var e=(function(o){nR(r,o);function r(i,a){i.id||(i.id="Flow_".concat(Nte()));var s=p_(p_(p_({},{}),i.properties),{isDefaultFlow:!1});return i.properties=s,o.call(this,i,a)||this}return r.extendKey="SequenceFlowModel",r})(F_),n=(function(o){nR(r,o);function r(){return o!==null&&o.apply(this,arguments)||this}return r.prototype.getStartArrow=function(){var i=this.props.model,a=i.properties.isDefaultFlow;return a?Lr("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):Lr("path",{d:""})},r.extendKey="SequenceFlowEdge",r})($_);return{type:"bpmn:sequenceFlow",view:n,model:e}}Ute();var rR={width:40,height:40},oR={width:40,height:40},iR={width:100,height:80},n1={width:100,height:80},aR={width:100,height:80},lR={width:100,height:80},sR={width:100,height:80},uR={width:100,height:80},cR={width:100,height:80},dR={width:100,height:80};function XI(t){return Object.prototype.toString.call(t)}function fR(t){return" ".repeat(t)}function r1(t){return XI(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var o=n;return n.charAt(0)==="-"&&(o=n.substring(1)),e[o]=r1(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return r1(e)}):t}function o1(t){return t==null?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vte(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(r1(t)).replace(/"/g,"'")}return o1(String(e))}var pR=`
|
||
`;function J0(t,e,n){var o=fR(n),r="",i=pR+o;if(e==="-json")return"";if(e==="#text")return i+o1(String(t));if(e==="#cdata-section")return"".concat(i,"<![CDATA[").concat(t,"]]>");if(e==="#comment")return"".concat(i,"<!--").concat(t,"-->");if(t!==0&&t!==!1&&!t)return"".concat(i,"<").concat(e," />");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(Vte(t),'"');if(Array.isArray(t))r+=t.map(function(f){return J0(f,e,n+1)}).join("");else if(XI(t)==="[object Object]"){var a=Object.keys(t),s="",l=t["-json"]?pR+fR(n+1)+t["-json"]:"";r+="".concat(n===0?"":i,"<").concat(e),a.forEach(function(f){f.charAt(0)==="-"?s+=J0(t[f],f,n+1):l+=J0(t[f],f,n+1)}),r+=s+(l!==""?">".concat(l).concat(i,"</").concat(e,">"):" />")}else r+="".concat(i,"<").concat(e,">").concat(o1(String(t)),"</").concat(e,">");return r}function Wte(t){var e="";for(var n in t)e+=J0(t[n],n,0);return e}var Ms=function(){};Ms.ObjTree=function(){return this};Ms.ObjTree.VERSION="0.23";Ms.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
||
`;Ms.ObjTree.prototype.attr_prefix="-";Ms.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var r=this.parseDOM(e);return r}};Ms.ObjTree.prototype.parseHTTP=function(t,e,n){var o={};for(var r in e)o[r]=e[r];if(o.method||(typeof o.postBody>"u"&&typeof o.postbody>"u"&&typeof o.parameters>"u"?o.method="get":o.method="post"),n){o.asynchronous=!0;var i=this,a=n,s=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),s&&s(h)}}else o.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(l=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(l=f.transport)}if(n)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)};Ms.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),t.nodeType!==11){var o={};o[t.nodeName]=n,n=o}return n}};Ms.ObjTree.prototype.parseElement=function(t){if(t.nodeType!==7){if(t.nodeType===3||t.nodeType===4||t.nodeType===8){var e=t.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:t.nodeValue}var n=null,o={};if(t.attributes&&t.attributes.length){n={};for(var r=0;r<t.attributes.length;r++){var i=t.attributes[r].nodeName;if(typeof i=="string"){var a=t.attributes[r].nodeValue;try{a=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch{a=t.attributes[r].nodeValue}a!=null&&(i=this.attr_prefix+i,typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(t.childNodes&&t.childNodes.length){var s=!0;n&&(s=!1);for(var r=0;r<t.childNodes.length&&s;r++){var l=t.childNodes[r].nodeType;l===3||l===4||l===8||(s=!1)}if(s){n||(n="");for(var r=0;r<t.childNodes.length;r++)n+=t.childNodes[r].nodeValue}else{n||(n={});for(var r=0;r<t.childNodes.length;r++){var i=t.childNodes[r].nodeName;if(typeof i=="string"){var a=this.parseElement(t.childNodes[r]);a&&(typeof o[i]>"u"&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}else n===null&&(n={});return n}};Ms.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(n===1&&(t[e]=[]),t[e][t[e].length]=o):n===1?t[e]=o:n===2?t[e]=[t[e],o]:t[e][t[e].length]=o};Ms.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Ms.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(hw(e,r)){var i=e[r];r.charAt(0)!==this.attr_prefix?typeof i>"u"||i==null?n[n.length]="<".concat(r," />"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(r,i):typeof i=="object"?n[n.length]=this.hash_to_xml(r,i):n[n.length]=this.scalar_to_xml(r,i):o[o.length]=" ".concat(r.substring(1),'="').concat(this.xml_escape(i),'"')}var a=o.join(""),s=n.join("");return typeof t>"u"||t==null||(n.length>0?s.match(/\n/)?s="<".concat(t).concat(a,`>
|
||
`).concat(s,"</").concat(t,`>
|
||
`):s="<".concat(t).concat(a,">").concat(s,"</").concat(t,`>
|
||
`):s="<".concat(t).concat(a,` />
|
||
`)),s};Ms.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];typeof r>"u"||r==null?n[n.length]="<".concat(t," />"):typeof r=="object"&&r.constructor===Array?n[n.length]=this.array_to_xml(t,r):typeof r=="object"?n[n.length]=this.hash_to_xml(t,r):n[n.length]=this.scalar_to_xml(t,r)}return n.join("")};Ms.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,`>
|
||
`)};Ms.ObjTree.prototype.xml_escape=o1;var Gte=function(t){return new Ms.ObjTree().parseXML(t)},zte=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),v2=function(){return v2=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},v2.apply(this,arguments)},hR=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n},jM=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zl=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Xc=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Os;(function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"})(Os||(Os={}));var YI=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],Hte=["properties","startPoint","endPoint","pointsList"],i1={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},qI=function(t,e){var n=Object.keys(e||{});return n.forEach(function(o){if(t[o]){var r=e[o],i=r.in,a=r.out;i&&(t[o].in=i),a&&(t[o].out=a)}else t[o]=e[o]}),t},Xu={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Xu[o.definitionType])===null||e===void 0?void 0:e.out)===null||n===void 0?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,o=e.condition;return o?n==="cdata"?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,r=e.definitionId,i=function(){return"<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(r,'"').concat(n&&o?">".concat(i(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,o,r,i,a=t,s=e["-id"],l="",f="";try{for(var h=jM(Object.keys(e)),v=h.next();!v.done;v=h.next()){var _=v.value;_.includes("bpmn:")&&(r=Zl(_.split(":"),2),l=r[1],f=(i=e[_])===null||i===void 0?void 0:i["#text"])}}catch(E){n={error:E}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":f}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",r="";return e["#cdata-section"]?(r="cdata",o=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(r="normal",o=e["#text"]),{"-condition":o,"-expressionType":r}}}};function Xte(t){var e=t??{},n=e.retainedAttrsFields,o=e.excludeFields,r=e.transformer,i=new Set(Xc(Xc([],Zl(Hte),!1),Zl(n||[]),!1)),a={in:new Set(Xc(Xc([],Zl(i1.in),!1),Zl((o==null?void 0:o.in)||[]),!1)),out:new Set(Xc(Xc([],Zl(i1.out),!1),Zl((o==null?void 0:o.out)||[]),!1))};return Xu=qI(Xu,r),function(s){var l=s.nodes,f=s.edges;function h(v,_){var E,O;if((v==null?void 0:v.flag)!==1){var w;if((w=Xu[v.type])&&w.out){var S=w.out(v),M=Object.keys(S);M.length>0&&M.forEach(function(U){v[U]=S[U]})}v!=null&&v.children&&(v.children=v.children.map(function(U){var z=l.find(function(X){return X.id===U})||f.find(function(X){return X.id===U});return z||{}}));var T={};if(typeof v=="string")return v;if(Array.isArray(v))return v.map(function(U){return h(U,"")}).filter(function(U){return U!=null});try{for(var B=jM(Object.entries(v)),R=B.next();!R.done;R=B.next()){var P=Zl(R.value,2),$=P[0],I=P[1];if((I==null?void 0:I.flag)===1)return;var F=[_,$].filter(function(U){return U}).join(".");a.out.has(F)||(typeof I!="object"?$.indexOf("-")===0||["#text","#cdata-section","#comment"].includes($)?T[$]=I:T["-".concat($)]=I:i.has(F)?T["-".concat($)]=h(I,F):T[$]=h(I,F))}}catch(U){E={error:U}}finally{try{R&&!R.done&&(O=B.return)&&O.call(B)}finally{if(E)throw E.error}}return T}}return h(s,"")}}function a1(t){var e,n,o={};try{for(var r=jM(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=Zl(i.value,2),s=a[0],l=a[1];s.indexOf("-")===0?o[s.substring(1)]=r1(l):typeof l=="string"?o[s]=l:Object.prototype.toString.call(l)==="[object Object]"?o[s]=a1(l):Array.isArray(l)?o[s]=l.map(function(f){return a1(f)}):o[s]=l}}catch(f){e={error:f}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}function Yte(t,e,n){var o,r=new Map,i=Xte(n)(e);i.nodes.forEach(function(s){var l=s["-id"],f=s["-type"],h=s.text,v=s.children,_=hR(s,["-id","-type","text","children"]),E={"-id":l};h!=null&&h["-value"]&&(E["-name"]=h["-value"]),_["-json"]&&(E["-json"]=_["-json"]),_["-properties"]&&Object.assign(E,_["-properties"]),v&&(E.children=v),t[f]||(t[f]=[]),t[f].push(E),r.set(l,E)});var a=i.edges.map(function(s){var l=s["-id"],f=s["-sourceNodeId"],h=s["-targetNodeId"],v=s.text,_=hR(s,["-id","-sourceNodeId","-targetNodeId","text"]),E=r.get(h);E["bpmn:incoming"]||(E["bpmn:incoming"]=[]),E["bpmn:incoming"].push(l);var O={"-id":l,"-sourceRef":f,"-targetRef":h};return v!=null&&v["-value"]&&(O["-name"]=v["-value"]),_["-json"]&&(O["-json"]=_["-json"]),_["-properties"]&&Object.assign(O,_["-properties"]),O});return e.edges.forEach(function(s){var l=s.sourceNodeId,f=s.id,h=r.get(l);h["bpmn:outgoing"]||(h["bpmn:outgoing"]=[]),h["bpmn:outgoing"].push(f)}),(o=t["bpmn:subProcess"])===null||o===void 0||o.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},f=[];s.children.forEach(function(w){var S,M=r.get(w["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(B){M[B]&&M[B].forEach(function(R){l[B].add(R)})});var T=(S=t[w["-type"]])===null||S===void 0?void 0:S.findIndex(function(B){return B["-id"]===w["-id"]});T>=0&&t[w["-type"]].splice(T,1),r.delete(w["-id"]),s[w["-type"]]||(s[w["-type"]]=[]),s[w["-type"]].push(M)});var h=l["bpmn:incoming"],v=l["bpmn:outgoing"];v.forEach(function(w){h.has(w)&&f.push(w)});for(var _=function(w){var S=a.findIndex(function(M){return M["-id"]===f[w]});S>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[S]),a.splice(S,1)):w++,E=w},E,O=0;O<f.length;)_(O),O=E;delete s.children}),t[Os.FLOW]=a,t}function qte(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var o,r=n.id,i=n.pointsList.map(function(s){var l=s.x,f=s.y;return{"-x":l,"-y":f}}),a={"-id":"".concat(r,"_di"),"-bpmnElement":r,"di:waypoint":i};return!((o=n.text)===null||o===void 0)&&o.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),a}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var o,r=n.id,i=100,a=80,s=n.x,l=n.y,f=qs.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),s-=i/2,l-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":s,"-y":l,"-width":i,"-height":a}};return!((o=n.text)===null||o===void 0)&&o.value&&(h["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":n.text.x-n.text.value.length*10/2,"-y":n.text.y-7,"-width":n.text.value.length*10,"-height":14}}),h})}var Kte=["bpmn:incoming","bpmn:outgoing"];function Zte(t,e){var n=[],o=[],r=new Map,i=e??{},a=i.transformer,s=i.excludeFields,l={in:new Set(Xc(Xc([],Zl(i1.in),!1),Zl((s==null?void 0:s.in)||[]),!1)),out:new Set(Xc(Xc([],Zl(i1.out),!1),Zl((s==null?void 0:s.out)||[]),!1))};Xu=qI(Xu,a);var f=t["bpmn:definitions"];if(f){var h=f["bpmn:process"];(function(_,E){E.forEach(function(O){try{Object.keys(_).forEach(function(w){try{O(w)}catch(S){console.error(S)}})}catch(w){console.error(w)}})})(h,[function(_){function E(w){w["-children"]||(w["-children"]=[]),Object.keys(w).forEach(function(S){var M;S.indexOf("bpmn:")===0&&!Kte.includes(S)&&(h[S]||(h[S]=[]),!Array.isArray(h[S])&&(h[S]=[h[S]]),Array.isArray(w[S])?(M=h[S]).push.apply(M,Xc([],Zl(w[S]),!1)):h[S].push(w[S]),Array.isArray(w[S])?w[S].forEach(function(T){!S.includes("Flow")&&w["-children"].push(T["-id"])}):!S.includes("Flow")&&w["-children"].push(w[S]["-id"]),delete w[S])})}if(_==="bpmn:subProcess"){var O=h[_];Array.isArray(O)?O.forEach(function(w){_==="bpmn:subProcess"&&E(w)}):E(O)}},function(_){var E=function(w){Object.keys(w).forEach(function(S){var M,T;if(S.includes("bpmn:")){var B={};Xu[S]&&Xu[S].in?(B=(T=(M=Xu[S]).in)===null||T===void 0?void 0:T.call(M,S,me.cloneDeep(w[S])),delete w[S]):O(w[S]);var R=void 0;(R=Reflect.ownKeys(B)).length>0&&R.forEach(function(P){Reflect.set(w,P,B[P])})}})};function O(w){r.set(w["-id"],w),Array.isArray(w)?w.forEach(function(S){O(S)}):typeof w=="object"&&E(w)}O(h[_])},function(_){if(_.indexOf("bpmn:")===0){var E=h[_];if(_==="bpmn:sequenceFlow"){var O=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=Qte(E,O)}else{var w=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(_==="bpmn:boundaryEvent"){var S=h[_],M=function(T){var B=T["-attachedToRef"],R=r.get(B);R["-boundaryEvents"]||(R["-boundaryEvents"]=[]),R["-boundaryEvents"].push(T["-id"])};Array.isArray(S)?S.forEach(function(T){M(T)}):M(S)}n=n.concat(Jte(E,w,_))}}}])}var v=function(_,E,O){Object.keys(_).forEach(function(w){var S=O?"".concat(O,".").concat(w):w;E.has(S)?delete _[w]:typeof _[w]=="object"&&v(_[w],E,S)})};return n.forEach(function(_){var E,O;if(!((E=e==null?void 0:e.mapping)===null||E===void 0)&&E.in){var w=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=_.type;w[S]&&(_.type=w[S])}v(_,l.in,"")}),o.forEach(function(_){var E,O;if(!((E=e==null?void 0:e.mapping)===null||E===void 0)&&E.in){var w=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=_.type;w[S]&&(_.type=w[S])}v(_,l.in,"")}),{nodes:n,edges:o}}function Jte(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):s=e;var l=vR(s,n,a);o.push(l)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=vR(r,n,t);o.push(i)}return o}function vR(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=qs.shapeConfigMap.get(e);s&&(o+=s.width/2,r+=s.height/2);var l={};Object.entries(n).forEach(function(_){var E=Zl(_,2),O=E[0],w=E[1];YI.includes(O)||(l[O]=w)}),l=a1(l);var f;if(a&&(f={x:o,y:r,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var h=t["bpmndi:BPMNLabel"]["dc:Bounds"];f.x=Number(h["-x"])+Number(h["-width"])/2,f.y=Number(h["-y"])+Number(h["-height"])/2}var v={id:t["-bpmnElement"],type:e,x:o,y:r,properties:l};return i&&(v.children=i),f&&(v.text=f),v}function Qte(t,e){var n=[];if(Array.isArray(t))t.forEach(function(r){var i;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===r["-id"]}):i=e,n.push(gR(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(gR(o,t))}return n}function gR(t,e){var n,o=e["-name"]?"".concat(e["-name"]):"";if(o){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split(`
|
||
`).forEach(function(f){i<f.length&&(i=f.length)}),n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7}}var a={};Object.entries(e).forEach(function(f){var h=Zl(f,2),v=h[0],_=h[1];YI.includes(v)||(a[v]=_)}),a=a1(a);var s=t["di:waypoint"].map(function(f){return{x:Number(f["-x"]),y:Number(f["-y"])}}),l={id:e["-id"],type:Os.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var qs=(function(){function t(e){var n=e.lf,o=this;this.adapterOut=function(r,i){var a,s,l=v2({},o.processAttributes);Yte(l,r,i);var f={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};qte(f,r);var h=o.definitionAttributes;h["bpmn:process"]=l,h["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":f};var v={"bpmn:definitions":h};if(!((a=i==null?void 0:i.mapping)===null||a===void 0)&&a.out){var _=(s=i==null?void 0:i.mapping)===null||s===void 0?void 0:s.out,E=function(O){Array.isArray(O)&&O.forEach(function(w){return E(w)}),typeof O=="object"&&Object.keys(O).forEach(function(w){var S;(S=_[w])?(O[S]=me.cloneDeep(O[w]),delete O[w],E(O[S])):E(O[w])})};E(v)}return v},this.adapterIn=function(r,i){if(r)return Zte(r,i)},n.adapterIn=this.adapterIn,n.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t})();qs.shapeConfigMap.set(Os.START,{width:rR.width,height:rR.height});qs.shapeConfigMap.set(Os.END,{width:oR.width,height:oR.height});qs.shapeConfigMap.set(Os.INTERMEDIATE_CATCH,{width:n1.width,height:n1.height});qs.shapeConfigMap.set(Os.INTERMEDIATE_THROW,{width:n1.width,height:n1.height});qs.shapeConfigMap.set(Os.BOUNDARY,{width:iR.width,height:iR.height});qs.shapeConfigMap.set(Os.PARALLEL_GATEWAY,{width:aR.width,height:aR.height});qs.shapeConfigMap.set(Os.INCLUSIVE_GATEWAY,{width:lR.width,height:lR.height});qs.shapeConfigMap.set(Os.EXCLUSIVE_GATEWAY,{width:sR.width,height:sR.height});qs.shapeConfigMap.set(Os.SYSTEM,{width:uR.width,height:uR.height});qs.shapeConfigMap.set(Os.USER,{width:cR.width,height:cR.height});qs.shapeConfigMap.set(Os.SUBPROCESS,{width:dR.width,height:dR.height});(function(t){zte(e,t);function e(n){var o=t.call(this,n)||this;o.adapterXmlIn=function(a){var s=Gte(a);return o.adapterIn(s,o.props)},o.adapterXmlOut=function(a){var s=o.adapterOut(a,o.props);return Wte(s)};var r=n.lf,i=n.props;return r.adapterIn=o.adapterXmlIn,r.adapterOut=o.adapterXmlOut,o.props=i,o}return e.pluginName="BPMNAdapter",e})(qs);function ene(t,e,n){var o=e.x,r=e.y,i=t.x,a=t.y,s=i-o,l=a-r,f=s*Math.cos(n)-l*Math.sin(n),h=s*Math.sin(n)+l*Math.cos(n),v=f+o,_=h+r;return{x:v,y:_}}var tne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),l1=function(){return l1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},l1.apply(this,arguments)},nne=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},rne=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};(function(t){tne(e,t);function e(){var n=t.apply(this,rne([],nne(arguments),!1))||this;return n.childrenPositionMap=new Map,n.onNodeRotate=function(o){var r=o.model,i=n.props,a=i.model,s=i.graphModel,l=a.transformWithContainer,f=a.isRestrict,h=n.childrenPositionMap;if(!(!l||f)&&r.id===a.id){var v={x:a.x,y:a.y};ri(Array.from(a.children),function(_){var E=s.getNodeModelById(_);if(E){var O={x:E.x,y:E.y};h.has(E.id)?O=h.get(E.id):h.set(E.id,O);var w=r.rotate*(180/Math.PI);w<0&&(w+=360);var S=w*(Math.PI/180),M=ene(O,v,S);E.moveTo(M.x,M.y),E.rotate=r.rotate}})}},n.onNodeResize=function(o){var r=o.deltaX,i=o.deltaY,a=o.index,s=o.model,l=o.preData,f=n.props,h=f.model,v=f.graphModel,_=h.transformWithContainer,E=h.isRestrict;if(!(!_||E)&&s.id===h.id){var O=l.properties,w=O||{},S=w.width,M=w.height;ri(Array.from(h.children),function(T){var B=v.getNodeModelById(T);if(B){var R=B.width/S*r,P=B.height/M*i;SI({deltaX:R,deltaY:P,index:a,nodeModel:B,graphModel:v,cancelCallback:function(){}})}})}},n.onNodeMouseMove=function(){},n.graphRendered=function(){var o=n.props.model;o.isCollapsed&&o.toggleCollapse(!0)},n}return e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var n=this.props.graphModel.eventCenter;n.on("node:rotate",this.onNodeRotate),n.on("node:resize",this.onNodeResize),n.on("node:mousemove",this.onNodeMouseMove),n.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var n=this.props.graphModel.eventCenter;n.off("node:rotate",this.onNodeRotate),n.off("node:resize",this.onNodeResize),n.off("node:mousemove",this.onNodeMouseMove),n.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(n,o){var r=this,i=[];return n.isGroup&&ri(Array.from(n.children),function(a){i.push(a);var s=o.getNodeModelById(a);s!=null&&s.isGroup&&(i=i.concat(r.getNodesInGroup(s,o)))}),i},e.prototype.getResizeControl=function(){var n=this.props.model,o=n.resizable,r=n.isCollapsed,i=o&&!r;return i?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var n=this.props.model,o=n.width,r=n.height,i=n.x,a=n.y,s=n.radius,l=n.groupAddable;if(!l)return null;var f=n.getNodeStyle().strokeWidth,h=f===void 0?0:f,v=n.getAddableOutlineStyle(),_=o+h+8,E=r+h+8;return Lr("rect",l1(l1({},v),{width:_,height:E,x:i-_/2,y:a-E/2,rx:s,ry:s}))},e.prototype.getCollapseIcon=function(n,o){return"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," M").concat(n+7,",").concat(o+2," ").concat(n+7,",").concat(o+10)},e.prototype.getExpandIcon=function(n,o){return"M ".concat(n+3,",").concat(o+6," ").concat(n+11,",").concat(o+6," ")},e.prototype.getOperateIcon=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=o-i/2+10,l=r-a/2+10;if(!n.collapsible)return null;var f=n!=null&&n.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),h=Lr("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:f});return Lr("g",{},[Lr("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){n.toggleCollapse(!n.isCollapsed)}}),h])},e.prototype.getShape=function(){return Lr("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e})(Zv);var one=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),s1=function(){return s1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},s1.apply(this,arguments)},hS=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},lm=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},By=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},ine=400,ane=230,lne=80,sne=60,une=-1e4;(function(t){one(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.isGroup=!0,r.isRestrict=!1,r.autoResize=!1,r.collapsible=!0,r.isCollapsed=!1,r.groupAddable=!1,r.transformWithContainer=!1,r.childrenLastCollapseStateDict=new Map,r.childrenLastCollapseStateDict=new Map,r.initNodeData(n),r.setAttributes(),r}return e.prototype.initNodeData=function(n){var o;t.prototype.initNodeData.call(this,n);var r=(o=n.properties)!==null&&o!==void 0?o:{},i=r.children,a=r.width,s=r.height,l=r.collapsedWidth,f=r.collapsedHeight,h=r.collapsible,v=r.isCollapsed,_=r.zIndex,E=r.isRestrict,O=r.autoResize,w=r.autoToFront,S=r.transformWithContainer;this.children=i?new Set(i):new Set,this.zIndex=_??une,this.isCollapsed=v??!1,this.setProperties({isCollapsed:v??!1});var M=a??ine,T=s??ane;this.width=M,this.height=T,this.expandWidth=M,this.expandHeight=T,this.collapsedWidth=l??lne,this.collapsedHeight=f??sne,this.isRestrict=E??!1,this.transformWithContainer=S??!1,this.autoResize=O??!1,this.collapsible=h??!0,this.autoToFront=w??!1,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this)},e.prototype.getData=function(){var n=this,o=t.prototype.getData.call(this),r=[];return ri(Array.from(this.children),function(i){var a=n.graphModel.getNodeModelById(i);a&&!a.virtual&&r.push(i)}),o.children=r,o.properties&&(o.properties.children=r,o.properties.isCollapsed=this.isCollapsed),o},e.prototype.getNodesInGroup=function(n){var o=[];return n.isGroup&&ri(Array.from(n.children),function(r){o.push(r)}),o},e.prototype.getMoveDistance=function(n,o,r){r===void 0&&(r=!1);var i=lm(t.prototype.getMoveDistance.call(this,n,o,r),2),a=i[0],s=i[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,n,o,r),[a,s]},e.prototype.getHistoryData=function(){var n=t.prototype.getHistoryData.call(this);n.children=Array.from(this.children),n.isGroup=!0;var o=this,r=o.x,i=o.y,a=o.collapsedWidth,s=o.collapsedHeight,l=o.expandWidth,f=o.expandHeight,h=o.isCollapsed;return h&&(n.x=r+l/2-a/2,n.y=i+f/2-s/2,n.text&&(n.text.x=n.text.x+l/2-a/2,n.text.y=n.text.y+f/2-s/2)),n},e.prototype.toggleCollapse=function(n){var o=this,r=this.graphModel,i=!!n;this.isCollapsed=i,this.setProperties({isCollapsed:i}),r.eventCenter.emit("dynamicGroup:collapse",{collapse:i,nodeModel:this}),i?this.collapse():this.expand();var a=By(By([],lm(this.incoming.edges),!1),lm(this.outgoing.edges),!1),s=Array.from(this.children);ri(s,function(l){var f,h,v=o.graphModel.elementsModelMap.get(l);if(v){var _=v.isCollapsed;if(v.isGroup){var E=v;if(E.isCollapsed||E.toggleCollapse(n),!n){var O=(f=o.childrenLastCollapseStateDict)===null||f===void 0?void 0:f.get(l);O!==void 0&&O!==v.isCollapsed&&E.toggleCollapse(O)}}if((h=o.childrenLastCollapseStateDict)===null||h===void 0||h.set(l,!!_),v.visible=!n,v.BaseType===da.NODE){var w=v.incoming.edges,S=v.outgoing.edges;a=By(By(By([],lm(a),!1),lm(w),!1),lm(S),!1)}}}),this.collapseEdge(i,a)},e.prototype.collapse=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.width,s=n.height,l=n.collapsedWidth,f=n.collapsedHeight;this.x=o-a/2+l/2,this.y=r-s/2+f/2,this.text.x=i.x-a/2+l/2,this.text.y=i.y-s/2+f/2,this.expandWidth=a,this.expandHeight=s,this.width=l,this.height=f},e.prototype.expand=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.expandWidth,s=n.expandHeight,l=n.collapsedWidth,f=n.collapsedHeight;this.width=a,this.height=s,this.x=o+this.width/2-l/2,this.y=r+this.height/2-f/2,this.text.x=i.x+this.width/2-l/2,this.text.y=i.y+this.height/2-f/2},e.prototype.createVirtualEdge=function(n){n.pointsList=void 0;var o=this.graphModel.addEdge(n);o.virtual=!0,o.text.editable=!1,o.isCollapsedEdge=!0},e.prototype.collapseEdge=function(n,o){var r=this,i=this.graphModel;ri(o,function(a,s){var l,f=a.getData(),h=f.targetNodeId,v=f.sourceNodeId,_=s1(s1({},f),{id:"".concat(f.id,"__").concat(s),text:(l=f.text)===null||l===void 0?void 0:l.value});a.virtual&&i.deleteEdgeById(a.id);var E=i.dynamicGroup.getGroupByNodeId(h);E||(E=i.getNodeModelById(h));var O=i.dynamicGroup.getGroupByNodeId(v);O||(O=i.getNodeModelById(v)),n&&a.visible&&(r.children.has(v)||r.id===v?(_.startPoint=void 0,_.sourceNodeId=r.id):(_.endPoint=void 0,_.targetNodeId=r.id),(E.id!==r.id||O.id!==r.id)&&r.createVirtualEdge(_),a.visible=!1),!n&&!a.visible&&(E&&E.isGroup&&E.isCollapsed?(_.targetNodeId=E.id,_.endPoint=void 0,r.createVirtualEdge(_)):O&&O.isGroup&&O.isCollapsed?(_.sourceNodeId=O.id,_.startPoint=void 0,r.createVirtualEdge(_)):a.visible=!0)})},e.prototype.isAllowAppendIn=function(n){return!0},e.prototype.setAllowAppendChild=function(n){this.groupAddable=n},e.prototype.addChild=function(n){this.children.add(n);var o=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:o,childId:n})},e.prototype.removeChild=function(n){this.children.delete(n);var o=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:o})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var n=t.prototype.getResizeOutlineStyle.call(this);return n.stroke="none",n},e.prototype.getAnchorStyle=function(){var n=t.prototype.getAnchorStyle.call(this);return n.stroke="transparent",n.fill="transparent",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},hS([Ut],e.prototype,"isCollapsed",void 0),hS([Ut],e.prototype,"groupAddable",void 0),hS([Ut],e.prototype,"transformWithContainer",void 0),e})(Hm);var mR;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(mR||(mR={}));var cne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),h_=function(){return h_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},h_.apply(this,arguments)},dne=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},fne=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pne=(function(t){cne(e,t);function e(n){var o=t.call(this,n)||this;o.textRef=W1(),o.setHoverOn=function(){var l=o.props.element;l.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),l.setHovered(!0))},o.setHoverOff=function(){var l=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),l.setHovered(!1))},o.handleMouseDown=function(l){var f,h=o.props,v=h.label,_=h.graphModel,E=_.editConfigModel.nodeTextDraggable;((f=v.draggable)!==null&&f!==void 0?f:E)&&!o.state.isDragging&&!o.state.isEditing&&o.stepDrag.handleMouseDown(l)},o.handleMouseUp=function(l){o.state.isDragging&&o.stepDrag.handleMouseUp(l)},o.handleDragging=function(l){var f=l.deltaX,h=l.deltaY;o.state.isDragging||o.setState({isDragging:!0});var v=o.props,_=v.label,E=v.graphModel,O=E.transformModel,w=fne(O.fixDeltaXY(f,h),2),S=w[0],M=w[1];o.setElementModelLabelInfo({x:_.x+S,y:_.y+M}),E.eventCenter.emit("label:drag",{data:_.getData(),model:_})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleClick=function(l){var f=o.props,h=f.label,v=f.element,_=f.graphModel;v.setSelected(!o.state.isSelected),o.setState({isSelected:!o.state.isSelected}),o.setElementModelLabelInfo({isSelected:!0}),_.eventCenter.emit("label:click",{data:h.getData(),e:l,model:v})},o.handleDbClick=function(l){var f=o.props,h=f.label,v=f.element,_=f.graphModel;if(_.eventCenter.emit("label:dblclick",{data:h.getData(),e:l,model:v}),!h.editable){v.setSelected(!0);return}if(v.setSelected(),v.setElementState(Wo.TEXT_EDIT),o.setState({isEditing:!0}),o.textRef.current){o.textRef.current.contentEditable="true",o.textRef.current.focus();var E=document.createRange(),O=window.getSelection();E.selectNodeContents(o.textRef.current),E.collapse(!1),O==null||O.removeAllRanges(),O==null||O.addRange(E)}},o.handleBlur=function(l){var f=o.props,h=f.label,v=f.element,_=f.graphModel.eventCenter;_.emit("label:blur",{e:l,model:v,data:h.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1,isSelected:!1})},o.handleInput=function(l){var f=o.props,h=f.label,v=f.graphModel;v.eventCenter.emit("label:input",{e:l,data:h.getData()})},o.reCalcLabelSize=function(){};var r=n.label,i=n.graphModel,a=i.gridSize,s=i.eventCenter;return o.stepDrag=new ac({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:r,eventCenter:s}),o.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},o}return e.prototype.setElementModelLabelInfo=function(n){var o=this.props,r=o.label,i=o.element,a=o.graphModel,s=i.properties._label,l=s,f=Gj(l,function(_){return _.id===r.id}),h=l[f];l[f]=h_(h_({},h),n);var v=a.getElement(i.id);v==null||v.setProperty("_label",l)},e.prototype.componentDidMount=function(){var n=this,o=this.props,r=o.label,i=o.element,a=o.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,f,h,v,_=s.data;if(((_==null?void 0:_.type)!=="label"||_.type==="label"&&_.id!==r.id||n.state.isSelected)&&n.setState({isSelected:!1}),((_==null?void 0:_.type)!=="label"||_.type=="label"&&_.id!==r.id)&&n.state.isEditing){n.setState({isEditing:!1});var E=(f=(l=n.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&f!==void 0?f:"",O=(v=(h=n.textRef.current)===null||h===void 0?void 0:h.innerHTML)!==null&&v!==void 0?v:"";n.setElementModelLabelInfo({value:E,content:O,isSelected:!1}),i.setElementState(Wo.DEFAULT)}((_==null?void 0:_.type)!=="label"||_.type=="label"&&_.id!==r.id)&&n.textRef.current&&(n.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var n=this.props.graphModel;n.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var n,o=this.props,r=o.label,i=o.element,a=o.graphModel,s=this.state,l=s.isDragging,f=s.isHovered,h=s.isSelected,v=s.isEditing,_=a.transformModel,E=_.getTransformStyle().transform,O=r.id,w=r.x,S=r.y,M=r.zIndex,T=r.vertical,B=r.style,R=r.rotate,P=r.content,$=r.labelWidth,I=r.textOverflowMode,F=$??(i.BaseType==="node"?i.width-20:80),U={left:"".concat(w-F/2,"px"),top:"".concat(S-10,"px"),width:"".concat(F,"px"),height:"20px",zIndex:M??1,transform:R?"".concat(E," rotate(").concat(R,"deg)"):"".concat(E," rotate(").concat(T?-.25:0,"turn)")};return $t("div",{id:"element-container-".concat(O),className:JA("lf-label-editor-container"),style:U,onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:$t("div",{ref:this.textRef,id:"editor-container-".concat(O),className:JA("lf-label-editor",(n={"lf-label-editor-dragging":l,"lf-label-editor-editing":v,"lf-label-editor-hover":!v&&(f||h)},n["lf-label-editor-".concat(I)]=!v,n)),onInput:this.handleInput,style:h_({maxWidth:"".concat(F,"px"),boxSizing:"border-box",display:"inline-block",background:v||i.BaseType==="edge"?"#fff":"transparent"},B),dangerouslySetInnerHTML:{__html:P}})})},e=dne([xs],e),e})(ko),Vu=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},hne=xh,vne=(function(){function t(e,n,o){var r;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=n,this.graphModel=o,this.id=(r=e.id)!==null&&r!==void 0?r:hne(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){Xo(this,e)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:Hc(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},Vu([Ut],t.prototype,"x",void 0),Vu([Ut],t.prototype,"y",void 0),Vu([Ut],t.prototype,"content",void 0),Vu([Ut],t.prototype,"value",void 0),Vu([Ut],t.prototype,"rotate",void 0),Vu([Ut],t.prototype,"style",void 0),Vu([Ut],t.prototype,"zIndex",void 0),Vu([Ut],t.prototype,"vertical",void 0),Vu([Ut],t.prototype,"editable",void 0),Vu([Ut],t.prototype,"draggable",void 0),Vu([Ut],t.prototype,"labelWidth",void 0),Vu([Ut],t.prototype,"textOverflowMode",void 0),t})(),Q0={exports:{}},vS=Q0.exports,yR;function gne(){return yR||(yR=1,(function(t){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(e){if("Element"in e){var n="classList",o="prototype",r=e.Element[o],i=Object,a=String[o].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[o].indexOf||function(O){for(var w=0,S=this.length;w<S;w++)if(w in this&&this[w]===O)return w;return-1},l=function(O,w){this.name=O,this.code=DOMException[O],this.message=w},f=function(O,w){if(w==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(w))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(O,w)},h=function(O){for(var w=a.call(O.getAttribute("class")||""),S=w?w.split(/\s+/):[],M=0,T=S.length;M<T;M++)this.push(S[M]);this._updateClassName=function(){O.setAttribute("class",this.toString())}},v=h[o]=[],_=function(){return new h(this)};if(l[o]=Error[o],v.item=function(O){return this[O]||null},v.contains=function(O){return O+="",f(this,O)!==-1},v.add=function(){var O=arguments,w=0,S=O.length,M,T=!1;do M=O[w]+"",f(this,M)===-1&&(this.push(M),T=!0);while(++w<S);T&&this._updateClassName()},v.remove=function(){var O=arguments,w=0,S=O.length,M,T=!1,B;do for(M=O[w]+"",B=f(this,M);B!==-1;)this.splice(B,1),T=!0,B=f(this,M);while(++w<S);T&&this._updateClassName()},v.toggle=function(O,w){O+="";var S=this.contains(O),M=S?w!==!0&&"remove":w!==!1&&"add";return M&&this[M](O),w===!0||w===!1?w:!S},v.toString=function(){return this.join(" ")},i.defineProperty){var E={get:_,enumerable:!0,configurable:!0};try{i.defineProperty(r,n,E)}catch(O){O.number===-2146823252&&(E.enumerable=!1,i.defineProperty(r,n,E))}}else i[o].__defineGetter__&&r.__defineGetter__(n,_)}})(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch{}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||(function(r){var i=function(I){return Object.prototype.toString.call(I).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(F,U,z){this.data=F,this.size=F.length,this.type=U,this.encoding=z},l=a.prototype,f=s.prototype,h=r.FileReaderSync,v=function(I){this.code=this[this.name=I]},_="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),E=_.length,O=r.URL||r.webkitURL||r,w=O.createObjectURL,S=O.revokeObjectURL,M=O,T=r.btoa,B=r.atob,R=r.ArrayBuffer,P=r.Uint8Array,$=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=f.fake=!0;E--;)v.prototype[_[E]]=E+1;return O.createObjectURL||(M=r.URL=function(I){var F=document.createElementNS("http://www.w3.org/1999/xhtml","a"),U;return F.href=I,"origin"in F||(F.protocol.toLowerCase()==="data:"?F.origin=null:(U=I.match($),F.origin=U&&U[1])),F}),M.createObjectURL=function(I){var F=I.type,U;if(F===null&&(F="application/octet-stream"),I instanceof s)return U="data:"+F,I.encoding==="base64"?U+";base64,"+I.data:I.encoding==="URI"?U+","+decodeURIComponent(I.data):T?U+";base64,"+T(I.data):U+","+encodeURIComponent(I.data);if(w)return w.call(O,I)},M.revokeObjectURL=function(I){I.substring(0,5)!=="data:"&&S&&S.call(O,I)},l.append=function(I){var F=this.data;if(P&&(I instanceof R||I instanceof P)){for(var U="",z=new P(I),X=0,Y=z.length;X<Y;X++)U+=String.fromCharCode(z[X]);F.push(U)}else if(i(I)==="Blob"||i(I)==="File")if(h){var W=new h;F.push(W.readAsBinaryString(I))}else throw new v("NOT_READABLE_ERR");else I instanceof s?I.encoding==="base64"&&B?F.push(B(I.data)):I.encoding==="URI"?F.push(decodeURIComponent(I.data)):I.encoding==="raw"&&F.push(I.data):(typeof I!="string"&&(I+=""),F.push(unescape(encodeURIComponent(I))))},l.getBlob=function(I){return arguments.length||(I=null),new s(this.data.join(""),I,"raw")},l.toString=function(){return"[object BlobBuilder]"},f.slice=function(I,F,U){var z=arguments.length;return z<3&&(U=null),new s(this.data.slice(I,z>1?F:this.data.length),U,this.encoding)},f.toString=function(){return"[object Blob]"},f.close=function(){this.size=0,delete this.data},a})(e);e.Blob=function(r,i){var a=i&&i.type||"",s=new n;if(r)for(var l=0,f=r.length;l<f;l++)Uint8Array&&r[l]instanceof Uint8Array?s.append(r[l].buffer):s.append(r[l]);var h=s.getBlob(a);return!h.slice&&h.webkitSlice&&(h.slice=h.webkitSlice),h};var o=Object.getPrototypeOf||function(r){return r.__proto__};e.Blob.prototype=o(new e.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||vS.content||vS),(function(e,n){var o=typeof process<"u"&&process&&process.versions&&process.versions.electron;o?e.MediumEditor=n:t.exports=n})(vS,(function(){function e(n,o){return this.init(n,o)}return e.extensions={},(function(n){function o(l,f){var h,v=Array.prototype.slice.call(arguments,2);f=f||{};for(var _=0;_<v.length;_++){var E=v[_];if(E)for(h in E)E.hasOwnProperty(h)&&typeof E[h]<"u"&&(l||f.hasOwnProperty(h)===!1)&&(f[h]=E[h])}return f}var r=!1;try{var i=document.createElement("div"),a=document.createTextNode(" ");i.appendChild(a),r=i.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:n.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,f){var h=s.getKeyCode(l);return Array.isArray(f)===!1?h===f:f.indexOf(h)!==-1},getKeyCode:function(l){var f=l.which;return f===null&&(f=l.charCode!==null?l.charCode:l.keyCode),f},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var f=[!0].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},defaults:function(){var f=[!1].concat(Array.prototype.slice.call(arguments));return o.apply(this,f)},createLink:function(l,f,h,v){var _=l.createElement("a");return s.moveTextRangeIntoElement(f[0],f[f.length-1],_),_.setAttribute("href",h),v&&(v==="_blank"&&_.setAttribute("rel","noopener noreferrer"),_.setAttribute("target",v)),_},findOrCreateMatchingTextNodes:function(l,f,h){for(var v=l.createTreeWalker(f,NodeFilter.SHOW_ALL,null,!1),_=[],E=0,O=!1,w=null,S=null;(w=v.nextNode())!==null;)if(!(w.nodeType>3))if(w.nodeType===3){if(!O&&h.start<E+w.nodeValue.length&&(O=!0,S=s.splitStartNodeIfNeeded(w,h.start,E)),O&&s.splitEndNodeIfNeeded(w,S,h.end,E),O&&E===h.end)break;if(O&&E>h.end+1)throw new Error("PerformLinking overshot the target!");O&&_.push(S||w),E+=w.nodeValue.length,S!==null&&(E+=S.nodeValue.length,v.nextNode()),S=null}else w.tagName.toLowerCase()==="img"&&(!O&&h.start<=E&&(O=!0),O&&_.push(w));return _},splitStartNodeIfNeeded:function(l,f,h){return f!==h?l.splitText(f-h):null},splitEndNodeIfNeeded:function(l,f,h,v){var _,E;_=v+l.nodeValue.length+(f?f.nodeValue.length:0)-1,E=h-v-(f?l.nodeValue.length:0),_>=h&&v!==_&&E!==0&&(f||l).splitText(E)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var f=[],h=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(h).length===0)return[l];for(var v=0;v<l.childNodes.length;v++){var _=l.childNodes[v];if(_.nodeType===3)f.push(_);else if(_.nodeType===1){var E=_.querySelectorAll(h);E.length===0?f.push(_):f=f.concat(e.util.splitByBlockElements(_))}}return f},findAdjacentTextNodeWithContent:function(f,h,v){var _=!1,E,O=v.createNodeIterator(f,NodeFilter.SHOW_TEXT,null,!1);for(E=O.nextNode();E;){if(E===h)_=!0;else if(_&&E.nodeType===3&&E.nodeValue&&E.nodeValue.trim().length>0)break;E=O.nextNode()}return E},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var f=l.previousSibling;!f&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,f=l.previousSibling;return f},isDescendant:function(f,h,v){if(!f||!h)return!1;if(f===h)return!!v;if(f.nodeType!==1)return!1;if(r||h.nodeType!==3)return f.contains(h);for(var _=h.parentNode;_!==null;){if(_===f)return!0;_=_.parentNode}return!1},isElement:function(f){return!!(f&&f.nodeType===1)},throttle:function(l,f){var h=50,v,_,E,O=null,w=0,S=function(){w=Date.now(),O=null,E=l.apply(v,_),O||(v=_=null)};return!f&&f!==0&&(f=h),function(){var M=Date.now(),T=f-(M-w);return v=this,_=arguments,T<=0||T>f?(O&&(clearTimeout(O),O=null),w=M,E=l.apply(v,_),O||(v=_=null)):O||(O=setTimeout(S,T)),E}},traverseUp:function(l,f){if(!l)return!1;do{if(l.nodeType===1){if(f(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(l,f){var h,v,_,E,O,w,S,M=!1,T=["insertHTML",!1,f];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,T)}catch{}if(h=l.getSelection(),h.rangeCount){if(v=h.getRangeAt(0),S=v.commonAncestorContainer,s.isMediumEditorElement(S)&&!S.firstChild)v.selectNode(S.appendChild(l.createTextNode("")));else if(S.nodeType===3&&v.startOffset===0&&v.endOffset===S.nodeValue.length||S.nodeType!==3&&S.innerHTML===v.toString()){for(;!s.isMediumEditorElement(S)&&S.parentNode&&S.parentNode.childNodes.length===1&&!s.isMediumEditorElement(S.parentNode);)S=S.parentNode;v.selectNode(S)}for(v.deleteContents(),_=l.createElement("div"),_.innerHTML=f,E=l.createDocumentFragment();_.firstChild;)O=_.firstChild,w=E.appendChild(O);v.insertNode(E),w&&(v=v.cloneRange(),v.setStartAfter(w),v.collapse(!0),e.selection.selectRange(l,v)),M=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(T,M),M},execFormatBlock:function(l,f){var h=s.getTopBlockContainer(e.selection.getSelectionStart(l)),v;if(f==="blockquote"){if(h&&(v=Array.prototype.slice.call(h.childNodes),v.some(function(_){return s.isBlockContainer(_)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,f)}if(h&&f===h.nodeName.toLowerCase()&&(f="p"),s.isIE&&(f="<"+f+">"),h&&h.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&f==="<p>")return l.execCommand("outdent",!1,f);if((s.isFF||s.isEdge)&&f==="p")return v=Array.prototype.slice.call(h.childNodes),v.some(function(_){return!s.isBlockContainer(_)})&&l.execCommand("formatBlock",!1,f),l.execCommand("outdent",!1,f)}return l.execCommand("formatBlock",!1,f)},setTargetBlank:function(l,f){var h,v=f||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),h=0;h<l.length;h+=1)(v===!1||v===l[h].attributes.href.value)&&(l[h].target="_blank",l[h].rel="noopener noreferrer")},removeTargetBlank:function(l,f){var h;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),h=0;h<l.length;h+=1)f===l[h].attributes.href.value&&(l[h].removeAttribute("target"),l[h].removeAttribute("rel"))},addClassToAnchors:function(l,f){var h=f.split(" "),v,_;if(l.nodeName.toLowerCase()==="a")for(_=0;_<h.length;_+=1)l.classList.add(h[_]);else{var E=l.getElementsByTagName("a");if(E.length===0){var O=s.getClosestTag(l,"a");l=O?[O]:[]}else l=E;for(v=0;v<l.length;v+=1)for(_=0;_<h.length;_+=1)l[v].classList.add(h[_])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var f=l.parentNode,h=f.nodeName.toLowerCase();h==="li"||!s.isBlockContainer(f)&&h!=="div";){if(h==="li")return!0;if(f=f.parentNode,f)h=f.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,f){if(f.nodeName.toLowerCase()==="li"){var h=f.parentElement;h.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(h.parentElement,l),e.selection.moveCursor(l,f.firstChild,f.firstChild.textContent.length))}},splitOffDOMTree:function(l,f,h){for(var v=f,_=null,E=!h;v!==l;){var O=v.parentNode,w=O.cloneNode(!1),S=E?v:O.firstChild,M;for(_&&(E?w.appendChild(_):M=_),_=w;S;){var T=S.nextSibling;S===v?(S.hasChildNodes()?S=S.cloneNode(!1):S.parentNode.removeChild(S),S.textContent&&_.appendChild(S),S=E?T:null):(S.parentNode.removeChild(S),(S.hasChildNodes()||S.textContent)&&_.appendChild(S),S=T)}M&&_.appendChild(M),v=O}return _},moveTextRangeIntoElement:function(l,f,h){if(!l||!f)return!1;var v=s.findCommonRoot(l,f);if(!v)return!1;if(f===l){var _=l.parentNode,E=l.nextSibling;return _.removeChild(l),h.appendChild(l),E?_.insertBefore(h,E):_.appendChild(h),h.hasChildNodes()}for(var O=[],w,S,M,T=0;T<v.childNodes.length;T++)if(M=v.childNodes[T],!w)s.isDescendant(M,l,!0)&&(w=M);else if(s.isDescendant(M,f,!0)){S=M;break}else O.push(M);var B=S.nextSibling,R=v.ownerDocument.createDocumentFragment();return w===l?(w.parentNode.removeChild(w),R.appendChild(w)):R.appendChild(s.splitOffDOMTree(w,l)),O.forEach(function(P){P.parentNode.removeChild(P),R.appendChild(P)}),S===f?(S.parentNode.removeChild(S),R.appendChild(S)):R.appendChild(s.splitOffDOMTree(S,f,!0)),h.appendChild(R),S.parentNode===v?v.insertBefore(h,S):B?v.insertBefore(h,B):v.appendChild(h),h.hasChildNodes()},depthOfNode:function(l){for(var f=0,h=l;h.parentNode!==null;)h=h.parentNode,f++;return f},findCommonRoot:function(l,f){for(var h=s.depthOfNode(l),v=s.depthOfNode(f),_=l,E=f;h!==v;)h>v?(_=_.parentNode,h-=1):(E=E.parentNode,v-=1);for(;_!==E;)_=_.parentNode,E=E.parentNode;return _},isElementAtBeginningOfBlock:function(l){for(var f,h;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(h=l;h=h.previousSibling;)if(f=h.nodeType===3?h.nodeValue:h.textContent,f.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(f){return s.isMediumEditorElement(f)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(f){return s.isBlockContainer(f)||s.isMediumEditorElement(f)})},getTopBlockContainer:function(l){var f=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(h){return s.isBlockContainer(h)&&(f=h),!f&&s.isMediumEditorElement(h)?(f=h,!0):!1}),f},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(h){return s.emptyElementNames.indexOf(h.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var f=l.querySelector("th, td");f&&(l=f)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var f=0;f<l.childNodes.length;f++){var h=s._getFirstTextNode(l.childNodes[f]);if(h!==null)return h}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(l,f,h){var v=l+" is deprecated, please use "+f+" instead.";h&&(v+=" Will be removed in "+h),s.warn(v)},deprecatedMethod:function(l,f,h,v){s.deprecated(l,f,v),typeof this[f]=="function"&&this[f].apply(this,h)},cleanupAttrs:function(l,f){f.forEach(function(h){l.removeAttribute(h)})},cleanupTags:function(l,f){f.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,f){f.indexOf(l.nodeName.toLowerCase())!==-1&&e.util.unwrap(l,document)},getClosestTag:function(l,f){return s.traverseUp(l,function(h){return h.nodeName.toLowerCase()===f.toLowerCase()})},unwrap:function(l,f){for(var h=f.createDocumentFragment(),v=Array.prototype.slice.call(l.childNodes),_=0;_<v.length;_++)h.appendChild(v[_]);h.childNodes.length?l.parentNode.replaceChild(h,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};e.util=s})(window),(function(){var n=function(o){e.util.extend(this,o)};n.extend=function(o){var r=this,i;o&&o.hasOwnProperty("constructor")?i=o.constructor:i=function(){return r.apply(this,arguments)},e.util.extend(i,r);var a=function(){this.constructor=i};return a.prototype=r.prototype,i.prototype=new a,o&&e.util.extend(i.prototype,o),i},n.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(o){return this.base.options[o]}},["execAction","on","off","subscribe","trigger"].forEach(function(o){n.prototype[o]=function(){return this.base[o].apply(this.base,arguments)}}),e.Extension=n})(),(function(){function n(r){return e.util.isBlockContainer(r)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var o={findMatchingSelectionParent:function(r,i){var a=i.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,e.util.traverseUp(l,r))},getSelectionElement:function(r){return this.findMatchingSelectionParent(function(i){return e.util.isMediumEditorElement(i)},r)},exportSelection:function(r,i){if(!r)return null;var a=null,s=i.getSelection();if(s.rangeCount>0){var l=s.getRangeAt(0),f=l.cloneRange(),h;f.selectNodeContents(r),f.setEnd(l.startContainer,l.startOffset),h=f.toString().length,a={start:h,end:h+l.toString().length},this.doesRangeStartWithImages(l,i)&&(a.startsWithImage=!0);var v=this.getTrailingImageCount(r,a,l.endContainer,l.endOffset);if(v&&(a.trailingImageCount=v),h!==0){var _=this.getIndexRelativeToAdjacentEmptyBlocks(i,r,l.startContainer,l.startOffset);_!==-1&&(a.emptyBlocksIndex=_)}}return a},importSelection:function(r,i,a,s){if(!(!r||!i)){var l=a.createRange();l.setStart(i,0),l.collapse(!0);var f=i,h=[],v=0,_=!1,E=!1,O=0,w=!1,S,M=!1,T=null;for((s||r.startsWithImage||typeof r.emptyBlocksIndex<"u")&&(M=!0);!w&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!E)S=v+f.length,!_&&r.start>=v&&r.start<=S&&(M||r.start<S?(l.setStart(f,r.start-v),_=!0):T=f),_&&r.end>=v&&r.end<=S&&(r.trailingImageCount?E=!0:(l.setEnd(f,r.end-v),w=!0)),v=S;else{if(r.trailingImageCount&&E&&(f.nodeName.toLowerCase()==="img"&&O++,O===r.trailingImageCount)){for(var B=0;f.parentNode.childNodes[B]!==f;)B++;l.setEnd(f.parentNode,B+1),w=!0}if(!w&&f.nodeType===1)for(var R=f.childNodes.length-1;R>=0;)h.push(f.childNodes[R]),R-=1}w||(f=h.pop())}!_&&T&&(l.setStart(T,T.length),l.setEnd(T,T.length)),typeof r.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,i,r.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(r,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(r,i){var a=function(v){return v.nodeName.toLowerCase()==="a"};if(r.start===r.end&&i.startContainer.nodeType===3&&i.startOffset===i.startContainer.nodeValue.length&&e.util.traverseUp(i.startContainer,a)){for(var s=i.startContainer,l=i.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var f=null,h=0;f===null&&h<l.parentNode.childNodes.length;h++)l.parentNode.childNodes[h]===l&&(f=h);i.setStart(l.parentNode,f+1),i.collapse(!0)}}return i},importSelectionMoveCursorPastBlocks:function(r,i,a,s){var l=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),f=s.startContainer,h,v,_=0;for(a=a||1,f.nodeType===3&&e.util.isBlockContainer(f.previousSibling)?h=f.previousSibling:h=e.util.getClosestBlockContainer(f);l.nextNode();)if(!v)h===l.currentNode&&(v=l.currentNode);else if(v=l.currentNode,_++,_===a||v.textContent.length>0)break;return v||(v=h),s.setStart(e.util.getFirstSelectableLeafNode(v),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(r,i,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var f=e.util.findPreviousSibling(l);if(f){if(f.nodeValue)return-1}else return-1}for(var h=e.util.getClosestBlockContainer(a),v=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),_=0;v.nextNode();){var E=v.currentNode.textContent==="";if((E||_>0)&&(_+=1),v.currentNode===h)return _;E||(_=0)}return _},doesRangeStartWithImages:function(r,i){if(r.startOffset!==0||r.startContainer.nodeType!==1)return!1;if(r.startContainer.nodeName.toLowerCase()==="img")return!0;var a=r.startContainer.querySelector("img");if(!a)return!1;for(var s=i.createTreeWalker(r.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(r,i,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var f=r,h=[],v=0,_=!1,E=!1,O=!1,w,S=0;!O&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!E)S=0,w=v+f.length,!_&&i.start>=v&&i.start<=w&&(_=!0),_&&i.end>=v&&i.end<=w&&(E=!0),v=w;else if(f.nodeName.toLowerCase()==="img"&&S++,f===l)O=!0;else if(f.nodeType===1)for(var M=f.childNodes.length-1;M>=0;)h.push(f.childNodes[M]),M-=1;O||(f=h.pop())}return S},selectionContainsContent:function(r){var i=r.getSelection();if(!i||i.isCollapsed||!i.rangeCount)return!1;if(i.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(i.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(r){var i,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(i=!0),s.nodeName!=="#text"&&l==="false"},r);return!i&&a},getSelectionHtml:function(i){var a,s="",l=i.getSelection(),f,h;if(l.rangeCount){for(h=i.createElement("div"),a=0,f=l.rangeCount;a<f;a+=1)h.appendChild(l.getRangeAt(a).cloneContents());s=h.innerHTML}return s},getCaretOffsets:function(i,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(i),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(i),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(r){var i=r.startContainer;return i===r.endContainer&&i.hasChildNodes()&&r.endOffset===r.startOffset+1},getSelectedParentElement:function(r){return r?this.rangeSelectsSingleNode(r)&&r.startContainer.childNodes[r.startOffset].nodeType!==3?r.startContainer.childNodes[r.startOffset]:r.startContainer.nodeType===3?r.startContainer.parentNode:r.startContainer:null},getSelectedElements:function(r){var i=r.getSelection(),a,s,l;if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(a=i.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(f){return typeof i.containsNode=="function"?i.containsNode(f,!0):!0})},selectNode:function(r,i){var a=i.createRange();a.selectNodeContents(r),this.selectRange(i,a)},select:function(r,i,a,s,l){var f=r.createRange();return f.setStart(i,a),s?f.setEnd(s,l):f.collapse(!0),this.selectRange(r,f),f},clearSelection:function(r,i){i?r.getSelection().collapseToStart():r.getSelection().collapseToEnd()},moveCursor:function(r,i,a){this.select(r,i,a)},getSelectionRange:function(r){var i=r.getSelection();return i.rangeCount===0?null:i.getRangeAt(0)},selectRange:function(r,i){var a=r.getSelection();a.removeAllRanges(),a.addRange(i)},getSelectionStart:function(r){var i=r.getSelection().anchorNode,a=i&&i.nodeType===3?i.parentNode:i;return a}};e.selection=o})(),(function(){function n(r,i){return r?r.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return e.util.isDescendant(l,i,!0)})):!1}):!1}var o=function(r){this.base=r,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};o.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(r,i,a,s){var l=this.base.options.contentWindow,f=this.base.options.ownerDocument;r=e.util.isElement(r)||[l,f].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(h){h.addEventListener(i,a,s),this.events.push([h,i,a,s])}).bind(this))},detachDOMEvent:function(r,i,a,s){var l,f,h=this.base.options.contentWindow,v=this.base.options.ownerDocument;r&&(r=e.util.isElement(r)||[h,v].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(_){l=this.indexOfListener(_,i,a,s),l!==-1&&(f=this.events.splice(l,1)[0],f[0].removeEventListener(f[1],f[2],f[3]))}).bind(this)))},indexOfListener:function(r,i,a,s){var l,f,h;for(l=0,f=this.events.length;l<f;l=l+1)if(h=this.events[l],h[0]===r&&h[1]===i&&h[2]===a&&h[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var r=this.events.pop();r;)r[0].removeEventListener(r[1],r[2],r[3]),r=this.events.pop()},detachAllEventsFromElement:function(r){for(var i=this.events.filter(function(f){return f&&f[0].getAttribute&&f[0].getAttribute("medium-editor-index")===r.getAttribute("medium-editor-index")}),a=0,s=i.length;a<s;a++){var l=i[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(r){this.listeners.editableInput&&(this.contentCache[r.getAttribute("medium-editor-index")]=r.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(i){this.attachDOMEvent(r,i.name,i.handler.bind(this))},this)},enableCustomEvent:function(r){this.disabledEvents[r]!==void 0&&delete this.disabledEvents[r]},disableCustomEvent:function(r){this.disabledEvents[r]=!0},attachCustomEvent:function(r,i){this.setupListener(r),this.customEvents[r]||(this.customEvents[r]=[]),this.customEvents[r].push(i)},detachCustomEvent:function(r,i){var a=this.indexOfCustomListener(r,i);a!==-1&&this.customEvents[r].splice(a,1)},indexOfCustomListener:function(r,i){return!this.customEvents[r]||!this.customEvents[r].length?-1:this.customEvents[r].indexOf(i)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(r,i,a){this.customEvents[r]&&!this.disabledEvents[r]&&this.customEvents[r].forEach(function(s){s(i,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(r){r.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(r){this.handleDocumentExecCommand(r)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var r=this.options.ownerDocument;if(!(!this.execCommandListener||!r.execCommand.listeners)){var i=r.execCommand.listeners.indexOf(this.execCommandListener);i!==-1&&r.execCommand.listeners.splice(i,1),r.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var r=this.options.ownerDocument;if(!r.execCommand.listeners){var i=function(s,l){r.execCommand.listeners&&r.execCommand.listeners.forEach(function(f){f({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=r.execCommand.orig.apply(this,arguments);if(!r.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return i(l,s),s};a.orig=r.execCommand,a.listeners=[],a.callListeners=i,r.execCommand=a}},unwrapExecCommand:function(){var r=this.options.ownerDocument;r.execCommand.orig&&(r.execCommand=r.execCommand.orig)},setupListener:function(r){if(!this.listeners[r]){switch(r){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(i){this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[r]=!0}},attachToEachElement:function(r,i){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,r,i.bind(this))},this),this.eventsCache.push({name:r,handler:i})},cleanupElement:function(r){var i=r.getAttribute("medium-editor-index");i&&(this.detachAllEventsFromElement(r),this.contentCache&&delete this.contentCache[i])},focusElement:function(r){r.focus(),this.updateFocus(r,{target:r,type:"focus"})},updateFocus:function(r,i){var a=this.base.getFocusedElement(),s;a&&i.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(f){return!s&&e.util.isDescendant(f,r,!0)&&(s=f),!!s},this);var l=!e.util.isDescendant(a,r,!0)&&!n(this.base.extensions,r);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",i,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",i,s))),l&&this.triggerCustomEvent("externalInteraction",i)},updateInput:function(r,i){if(this.contentCache){var a=r.getAttribute("medium-editor-index"),s=r.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",i,r),this.contentCache[a]=s}},handleDocumentSelectionChange:function(r){if(r.currentTarget&&r.currentTarget.activeElement){var i=r.currentTarget.activeElement,a;this.base.elements.some(function(s){return e.util.isDescendant(s,i,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:i,currentTarget:a})}},handleDocumentExecCommand:function(){var r=this.base.getFocusedElement();r&&this.updateInput(r,{target:r,currentTarget:r})},handleBodyClick:function(r){this.updateFocus(r.target,r)},handleBodyFocus:function(r){this.updateFocus(r.target,r)},handleBodyMousedown:function(r){this.lastMousedownTarget=r.target},handleInput:function(r){this.updateInput(r.currentTarget,r)},handleClick:function(r){this.triggerCustomEvent("editableClick",r,r.currentTarget)},handleBlur:function(r){this.triggerCustomEvent("editableBlur",r,r.currentTarget)},handleKeypress:function(r){if(this.triggerCustomEvent("editableKeypress",r,r.currentTarget),this.keypressUpdateInput){var i={target:r.target,currentTarget:r.currentTarget};setTimeout((function(){this.updateInput(i.currentTarget,i)}).bind(this),0)}},handleKeyup:function(r){this.triggerCustomEvent("editableKeyup",r,r.currentTarget)},handleMouseover:function(r){this.triggerCustomEvent("editableMouseover",r,r.currentTarget)},handleDragging:function(r){this.triggerCustomEvent("editableDrag",r,r.currentTarget)},handleDrop:function(r){this.triggerCustomEvent("editableDrop",r,r.currentTarget)},handlePaste:function(r){this.triggerCustomEvent("editablePaste",r,r.currentTarget)},handleKeydown:function(r){if(this.triggerCustomEvent("editableKeydown",r,r.currentTarget),e.util.isKey(r,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",r,r.currentTarget);if(e.util.isKey(r,e.util.keyCode.ENTER)||r.ctrlKey&&e.util.isKey(r,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",r,r.currentTarget);if(e.util.isKey(r,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",r,r.currentTarget);if(e.util.isKey(r,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",r,r.currentTarget)}},e.Events=o})(),(function(){var n=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(o){n.isBuiltInButton(o)?e.Extension.call(this,this.defaults[o]):e.Extension.call(this,o)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var o=this.document.createElement("button"),r=this.contentDefault,i=this.getAria(),a=this.getEditorOption("buttonLabels");return o.classList.add("medium-editor-action"),o.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){o.classList.add(s)}),o.setAttribute("data-action",this.getAction()),i&&(o.setAttribute("title",i),o.setAttribute("aria-label",i)),this.attrs&&Object.keys(this.attrs).forEach(function(s){o.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(r=this.contentFA),o.innerHTML=r,o},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=this.getAction();r&&this.execAction(r)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var o=null;return this.useQueryState&&(o=this.base.queryCommandState(this.getAction())),o},isAlreadyApplied:function(o){var r=!1,i=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(i&&i.length>0&&(r=i.indexOf(o.nodeName.toLowerCase())!==-1),!r&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(o,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(r=s.indexOf(l)!==-1,(r||this.style.prop!=="text-decoration")&&(this.knownState=r))},this)),r)}});n.isBuiltInButton=function(o){return typeof o=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(o)},e.extensions.button=n})(),(function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}})(),(function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var o=this.base.getExtensionByName("toolbar");o&&o.hideToolbarDefaultActions()},setToolbarPosition:function(){var o=this.base.getExtensionByName("toolbar");o&&o.setToolbarPosition()}});e.extensions.form=n})(),(function(){var n=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(o){o.preventDefault(),o.stopPropagation();var r=e.selection.getSelectionRange(this.document);return r.startContainer.nodeName.toLowerCase()==="a"||r.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(r),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(o){e.util.isKey(o,e.util.keyCode.K)&&e.util.isMetaCtrlKey(o)&&!o.shiftKey&&this.handleClick(o)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var o=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return o.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),o.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&o.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&o.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),o.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(o){var r=this.getInput(),i=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(o=o||{value:""},typeof o=="string"&&(o={value:o}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),r.value=o.value,r.focus(),i&&(i.checked=o.target==="_blank"),a){var s=o.buttonClass?o.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var o=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox(),i={value:this.getInput().value.trim()};return this.linkValidation&&(i.value=this.checkLinkFormat(i.value)),i.target="_self",o&&o.checked&&(i.target="_blank"),r&&r.checked&&(i.buttonClass=this.customClassOption),i},doFormSave:function(){var o=this.getFormOpts();this.completeFormSave(o)},completeFormSave:function(o){this.base.restoreSelection(),this.execAction(this.action,o),this.base.checkSelection()},ensureEncodedUri:function(o){return o===decodeURI(o)?encodeURI(o):o},ensureEncodedUriComponent:function(o){return o===decodeURIComponent(o)?encodeURIComponent(o):o},ensureEncodedParam:function(o){var r=o.split("="),i=r[0],a=r[1];return i+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(o){return o.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(o){var r=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,i=r.test(o),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=o.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),f=l[1],h=l[2],v=l[3];if(s.test(o))return"tel:"+o;if(!i){var _=f.split("/")[0];(_.match(/.+(\.|:).+/)||_==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(f)+(h===void 0?"":"?"+this.ensureEncodedQuery(h))+(v===void 0?"":"#"+v)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(o){var r=o.querySelector(".medium-editor-toolbar-close"),i=o.querySelector(".medium-editor-toolbar-save"),a=o.querySelector(".medium-editor-toolbar-input");this.on(o,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(r,"click",this.handleCloseClick.bind(this)),this.on(i,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var o=this.document,r=o.createElement("div");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),r.innerHTML=this.getTemplate(),this.attachFormEvents(r),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(o){if(o.keyCode===e.util.keyCode.ENTER){o.preventDefault(),this.doFormSave();return}o.keyCode===e.util.keyCode.ESCAPE&&(o.preventDefault(),this.doFormCancel())},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.anchor=n})(),(function(){var n=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var o=this.document.createElement("div");return o.id="medium-editor-anchor-preview-"+this.getEditorId(),o.className="medium-editor-anchor-preview",o.innerHTML=this.getTemplate(),this.on(o,"click",this.handleClick.bind(this)),o},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(o){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||o.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=o.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=o.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=o,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(o){o=o||this.activeAnchor;var r=this.window.innerWidth,i=this.anchorPreview.offsetHeight,a=o.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,f=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,v={},_,E,O,w,S;_=this.anchorPreview.offsetWidth/2;var M=this.base.getExtensionByName("toolbar");M&&(s=M.diffLeft,l=M.diffTop),E=s-_,h?(w=f.getBoundingClientRect(),["top","left"].forEach(function(T){v[T]=a[T]-w[T]}),v.width=a.width,v.height=a.height,a=v,r=w.width,S=f.scrollTop):S=this.window.pageYOffset,O=a.left+a.width/2,S+=i+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(S)+"px",this.anchorPreview.style.right="initial",O<_?(this.anchorPreview.style.left=E+_+"px",this.anchorPreview.style.right="initial"):r-O<_?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=E+O+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(o){var r=this.base.getExtensionByName("anchor"),i=this.activeAnchor;r&&i&&(o.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(i){var a={value:i.attributes.href.value,target:i.getAttribute("target"),buttonClass:i.getAttribute("class")};r.showForm(a),i=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(o){var r=e.util.getClosestTag(o.target,"a");if(r!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(r.outerHTML)||/href=["']#\S+["']/.test(r.outerHTML)))return!0;var i=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&i&&i.isDisplayed&&i.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==r&&this.detachPreviewHandlers(),this.anchorToPreview=r,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(o){(!o.relatedTarget||!/anchor-preview/.test(o.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var o=new Date().getTime()-this.lastOver;o>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=n})(),(function(){var n,o,r,i,a;n=[" "," ",`
|
||
`,"\r"," "," "," "," "," ","\u2028","\u2029"],o="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",r="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+o+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+o+"))",i=new RegExp("^("+o+")$","i"),a=new RegExp(r,"gi");function s(f){return!e.util.getClosestTag(f,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var f=0,h=0;h<this.window._mediumEditors.length;h++){var v=this.window._mediumEditors[h];v!==null&&v.getExtensionByName("autoLink")!==void 0&&f++}return f===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(f,h){this.performLinking(h)},onKeypress:function(f){this.disableEventHandling||e.util.isKey(f,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var h=this.base.exportSelection();this.performLinking(f.target)&&this.base.importSelection(h,!0)}catch(v){window.console&&window.console.error("Failed to perform linking",v),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(f){var h=e.util.splitByBlockElements(f),v=!1;h.length===0&&(h=[f]);for(var _=0;_<h.length;_++)v=this.removeObsoleteAutoLinkSpans(h[_])||v,v=this.performLinkingWithinElement(h[_])||v;return this.base.events.updateInput(f,{target:f,currentTarget:f}),v},removeObsoleteAutoLinkSpans:function(f){if(!f||f.nodeType===3)return!1;for(var h=f.querySelectorAll('span[data-auto-link="true"]'),v=!1,_=0;_<h.length;_++){var E=h[_].textContent;if(E.indexOf("://")===-1&&(E=e.util.ensureUrlHasProtocol(E)),h[_].getAttribute("data-href")!==E&&s(h[_])){v=!0;var O=E.replace(/\s+$/,"");if(h[_].getAttribute("data-href")===O){var w=E.length-O.length,S=e.util.splitOffDOMTree(h[_],this.splitTextBeforeEnd(h[_],w));h[_].parentNode.insertBefore(S,h[_].nextSibling)}else e.util.unwrap(h[_],this.document)}}return v},splitTextBeforeEnd:function(f,h){for(var v=this.document.createTreeWalker(f,NodeFilter.SHOW_TEXT,null,!1),_=!0;_;)_=v.lastChild()!==null;for(var E,O,w;h>0&&w!==null;)E=v.currentNode,O=E.nodeValue,O.length>h?(w=E.splitText(O.length-h),h=0):(w=v.previousNode(),h-=O.length);return w},performLinkingWithinElement:function(f){for(var h=this.findLinkableText(f),v=!1,_=0;_<h.length;_++){var E=e.util.findOrCreateMatchingTextNodes(this.document,f,h[_]);this.shouldNotLink(E)||this.createAutoLink(E,h[_].href)}return v},shouldNotLink:function(f){for(var h=!1,v=0;v<f.length&&h===!1;v++)h=!!e.util.traverseUp(f[v],function(_){return _.nodeName.toLowerCase()==="a"||_.getAttribute&&_.getAttribute("data-auto-link")==="true"});return h},findLinkableText:function(f){for(var h=f.textContent,v=null,_=[];(v=a.exec(h))!==null;){var E=!0,O=v.index+v[0].length;E=(v.index===0||n.indexOf(h[v.index-1])!==-1)&&(O===h.length||n.indexOf(h[O])!==-1),E=E&&(v[0].indexOf("/")!==-1||i.test(v[0].split(".").pop().split("?").shift())),E&&_.push({href:v[0],start:v.index,end:O})}return _},createAutoLink:function(f,h){h=e.util.ensureUrlHasProtocol(h);var v=e.util.createLink(this.document,f,h,this.getEditorOption("targetBlank")?"_blank":null),_=this.document.createElement("span");for(_.setAttribute("data-auto-link","true"),_.setAttribute("data-href",h),v.insertBefore(_,v.firstChild);v.childNodes.length>1;)_.appendChild(v.childNodes[1])}});e.extensions.autoLink=l})(),(function(){var n="medium-editor-dragover";function o(i){var a=e.util.getContainerEditorElement(i),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));s.forEach(function(l){l.classList.remove(n)})}var r=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(i){i.preventDefault(),i.dataTransfer.dropEffect="copy";var a=i.target.classList?i.target:i.target.parentElement;o(a),i.type==="dragover"&&a.classList.add(n)},handleDrop:function(i){i.preventDefault(),i.stopPropagation(),this.base.selectElement(i.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),i.dataTransfer.files&&Array.prototype.slice.call(i.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),o(i.target)},isAllowedFile:function(i){return this.allowedTypes.some(function(a){return!!i.type.match(a)})},insertImageFile:function(i){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(i),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=r})(),(function(){var n=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(o){var r=o.key.charCodeAt(0);this.keys[r]||(this.keys[r]=[]),this.keys[r].push(o)},this)},handleKeydown:function(o){var r=e.util.getKeyCode(o);if(this.keys[r]){var i=e.util.isMetaCtrlKey(o),a=!!o.shiftKey,s=!!o.altKey;this.keys[r].forEach(function(l){l.meta===i&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(o.preventDefault(),o.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontName")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(o){var r=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("select"),a=o.createElement("a"),s=o.createElement("a"),l;r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this));for(var f=0;f<this.fonts.length;f++)l=o.createElement("option"),l.innerHTML=this.fonts[f],l.value=this.fonts[f],i.appendChild(l);return i.className="medium-editor-toolbar-select",r.appendChild(i),this.on(i,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",r.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("face")&&o.removeAttribute("face")})},handleFontChange:function(){var o=this.getSelect().value;o===""?this.clearFontName():this.execAction("fontName",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n})(),(function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(o){if(o.preventDefault(),o.stopPropagation(),!this.isDisplayed()){var r=this.document.queryCommandValue("fontSize")+"";this.showForm(r)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(o){var r=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),r.value=o||"",r.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var o=this.document,r=o.createElement("div"),i=o.createElement("input"),a=o.createElement("a"),s=o.createElement("a");return r.className="medium-editor-toolbar-form",r.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(r,"click",this.handleFormClick.bind(this)),i.setAttribute("type","range"),i.setAttribute("min","1"),i.setAttribute("max","7"),i.className="medium-editor-toolbar-input",r.appendChild(i),this.on(i,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",r.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",r.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),r},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(o){o.nodeName.toLowerCase()==="font"&&o.hasAttribute("size")&&o.removeAttribute("size")})},handleSliderChange:function(){var o=this.getInput().value;o==="4"?this.clearFontSize():this.execAction("fontSize",{value:o})},handleFormClick:function(o){o.stopPropagation()},handleSaveClick:function(o){o.preventDefault(),this.doFormSave()},handleCloseClick:function(o){o.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",o=null,r=null,i=function(f){f.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function s(f,h,v){var _=f.clipboardData||h.clipboardData||v.dataTransfer,E={};if(!_)return E;if(_.getData){var O=_.getData("Text");O&&O.length>0&&(E["text/plain"]=O)}if(_.types)for(var w=0;w<_.types.length;w++){var S=_.types[w];E[S]=_.getData(S)}return E}var l=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(f){this.on(f,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(f,h){this.on(h,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(f,h){if(!f.defaultPrevented){var v=s(f,this.window,this.document),_=v["text/html"],E=v["text/plain"];this.window.clipboardData&&f.clipboardData===void 0&&!_&&(_=E),(_||E)&&(f.preventDefault(),this.doPaste(_,E,h))}},doPaste:function(f,h,v){var _,E="",O;if(this.cleanPastedHTML&&f)return this.cleanPaste(f);if(h){if(this.getEditorOption("disableReturn")||v&&v.getAttribute("data-disable-return"))E=e.util.htmlEntities(h);else if(_=h.split(/[\r\n]+/g),_.length>1)for(O=0;O<_.length;O+=1)_[O]!==""&&(E+="<p>"+e.util.htmlEntities(_[O])+"</p>");else E=e.util.htmlEntities(_[0]);e.util.insertHTMLCommand(this.document,E)}},handlePasteBinPaste:function(f){if(f.defaultPrevented){this.removePasteBin();return}var h=s(f,this.window,this.document),v=h["text/html"],_=h["text/plain"],E=r;if(!this.cleanPastedHTML||v){f.preventDefault(),this.removePasteBin(),this.doPaste(v,_,E),this.trigger("editablePaste",{currentTarget:E,target:E},E);return}setTimeout((function(){this.cleanPastedHTML&&(v=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(v,_,E),this.trigger("editablePaste",{currentTarget:E,target:E},E)}).bind(this),0)},handleKeydown:function(f,h){e.util.isKey(f,e.util.keyCode.V)&&e.util.isMetaCtrlKey(f)&&(f.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(h))},createPasteBin:function(f){var h,v=e.selection.getSelectionRange(this.document),_=this.window.pageYOffset;r=f,v&&(h=v.getClientRects(),h.length?_+=h[0].top:v.startContainer.getBoundingClientRect!==void 0?_+=v.startContainer.getBoundingClientRect().top:_+=v.getBoundingClientRect().top),o=v;var E=this.document.createElement("div");E.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),E.setAttribute("style","border: 1px red solid; position: absolute; top: "+_+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),E.setAttribute("contentEditable",!0),E.innerHTML=n,this.document.body.appendChild(E),this.on(E,"focus",i),this.on(E,"focusin",i),this.on(E,"focusout",i),E.focus(),e.selection.selectNode(E,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(E,"paste",this.boundHandlePaste)},removePasteBin:function(){o!==null&&(e.selection.selectRange(this.document,o),o=null),r!==null&&(r=null);var f=this.getPasteBin();f&&f&&(this.off(f,"focus",i),this.off(f,"focusin",i),this.off(f,"focusout",i),this.off(f,"paste",this.boundHandlePaste),f.parentElement.removeChild(f))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var f=this.getPasteBin();if(!f||f.firstChild&&f.firstChild.id==="mcepastebin")return!1;var h=f.innerHTML;return!h||h===n?!1:h},cleanPaste:function(f){var h,v,_,E,O=/<p|<br|<div/.test(f),w=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(h=0;h<w.length;h+=1)f=f.replace(w[h][0],w[h][1]);if(!O)return this.pasteHTML(f);for(_=this.document.createElement("div"),_.innerHTML="<p>"+f.split("<br><br>").join("</p><p>")+"</p>",v=_.querySelectorAll("a,p,div,br"),h=0;h<v.length;h+=1)switch(E=v[h],E.innerHTML=E.innerHTML.replace(/\n/gi," "),E.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(E);break;case"br":this.filterLineBreak(E);break}this.pasteHTML(_.innerHTML)},pasteHTML:function(f,h){h=e.util.defaults({},h,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var v,_,E,O,w=this.document.createDocumentFragment();for(w.appendChild(this.document.createElement("body")),O=w.querySelector("body"),O.innerHTML=f,this.cleanupSpans(O),v=O.querySelectorAll("*"),E=0;E<v.length;E+=1)_=v[E],_.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(_),e.util.cleanupAttrs(_,h.cleanAttrs),e.util.cleanupTags(_,h.cleanTags),e.util.unwrapTags(_,h.unwrapTags);e.util.insertHTMLCommand(this.document,O.innerHTML.replace(/ /g," "))},isCommonBlock:function(f){return f&&(f.nodeName.toLowerCase()==="p"||f.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(f){/^\s*$/.test(f.textContent)&&f.parentNode&&f.parentNode.removeChild(f)},filterLineBreak:function(f){this.isCommonBlock(f.previousElementSibling)?this.removeWithParent(f):this.isCommonBlock(f.parentNode)&&(f.parentNode.firstChild===f||f.parentNode.lastChild===f)?this.removeWithParent(f):f.parentNode&&f.parentNode.childElementCount===1&&f.parentNode.textContent===""&&this.removeWithParent(f)},removeWithParent:function(f){f&&f.parentNode&&(f.parentNode.parentNode&&f.parentNode.childElementCount===1?f.parentNode.parentNode.removeChild(f.parentNode):f.parentNode.removeChild(f))},cleanupSpans:function(f){var h,v,_,E=f.querySelectorAll(".replace-with"),O=function(w){return w&&w.nodeName!=="#text"&&w.getAttribute("contenteditable")==="false"};for(h=0;h<E.length;h+=1)v=E[h],_=this.document.createElement(v.classList.contains("bold")?"b":"i"),v.classList.contains("bold")&&v.classList.contains("italic")?_.innerHTML="<i>"+v.innerHTML+"</i>":_.innerHTML=v.innerHTML,v.parentNode.replaceChild(_,v);for(E=f.querySelectorAll("span"),h=0;h<E.length;h+=1){if(v=E[h],e.util.traverseUp(v,O))return!1;e.util.unwrap(v,this.document)}}});e.extensions.paste=l})(),(function(){var n=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(o,r){this.initElement(r)},initElement:function(o){o.getAttribute("data-placeholder")||o.setAttribute("data-placeholder",this.text),this.updatePlaceholder(o)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(o,r){this.cleanupElement(r)},cleanupElement:function(o){o.getAttribute("data-placeholder")===this.text&&o.removeAttribute("data-placeholder")},showPlaceholder:function(o){o&&(e.util.isFF&&o.childNodes.length===0?(o.classList.add("medium-editor-placeholder-relative"),o.classList.remove("medium-editor-placeholder")):(o.classList.add("medium-editor-placeholder"),o.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(o){o&&(o.classList.remove("medium-editor-placeholder"),o.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(o,r){if(o.querySelector("img, blockquote, ul, ol, table")||o.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(o);r||this.showPlaceholder(o)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(o,r){var i=this.hideOnClick&&r===this.base.getFocusedElement();this.updatePlaceholder(r,i)},handleFocus:function(o,r){this.hidePlaceholder(r)},handleBlur:function(o,r){this.updatePlaceholder(r)}});e.extensions.placeholder=n})(),(function(){var n=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(o,r){return this.base.extensions.forEach(function(i){if(i!==this)return o.apply(r||this,arguments)},this)},createToolbar:function(){var o=this.document.createElement("div");return o.id="medium-editor-toolbar-"+this.getEditorId(),o.className="medium-editor-toolbar",this.static?o.className+=" static-toolbar":this.relativeContainer?o.className+=" medium-editor-relative-toolbar":o.className+=" medium-editor-stalker-toolbar",o.appendChild(this.createToolbarButtons()),this.forEachExtension(function(r){r.hasForm&&o.appendChild(r.getForm())}),this.attachEventHandlers(),o},createToolbarButtons:function(){var o=this.document.createElement("ul"),r,i,a,s,l,f;return o.id="medium-editor-toolbar-actions"+this.getEditorId(),o.className="medium-editor-toolbar-actions",o.style.display="block",this.buttons.forEach(function(h){typeof h=="string"?(l=h,f=null):(l=h.name,f=h),s=this.base.addBuiltInExtension(l,f),s&&typeof s.getButton=="function"&&(i=s.getButton(this.base),r=this.document.createElement("li"),e.util.isElement(i)?r.appendChild(i):r.innerHTML=i,o.appendChild(r))},this),a=o.querySelectorAll("button"),a.length>0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),o},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(o){if(o&&o.target&&e.util.isDescendant(this.getToolbarElement(),o.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(o){o.hasForm&&o.isDisplayed()&&o.hideForm()})},multipleBlockElementsSelected:function(){var o=/<[^\/>][^>]*><\/[^>]+>/gim,r=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),i=e.selection.getSelectionHtml(this.document).replace(o,""),a=i.match(r);return!!a&&a.length>1},modifySelection:function(){var o=this.window.getSelection(),r=o.getRangeAt(0);if(this.standardizeSelectionStart&&r.startContainer.nodeValue&&r.startOffset===r.startContainer.nodeValue.length){var i=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),r.startContainer,this.document);if(i){for(var a=0;i.nodeValue.substr(a,1).trim().length===0;)a=a+1;r=e.selection.select(this.document,i,a,r.endContainer,r.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var o=e.selection.getSelectionElement(this.window);if(!o||this.getEditorElements().indexOf(o)===-1||o.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(o){typeof o.isActive=="function"&&typeof o.setInactive=="function"&&o.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var o=[],r=null,i=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(i&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(r=l.queryCommandState(),r!==null)){r&&typeof l.setActive=="function"&&l.setActive();return}o.push(l)}),a=e.selection.getSelectedParentElement(i),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(o.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var o=this.base.getFocusedElement(),r=this.window.getSelection();if(!o)return this;(this.static||!r.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(o):this.positionToolbar(r)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(o){this.getToolbarElement().style.left="0";var r=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,i=this.window.innerWidth,a=this.getToolbarElement(),s=o.getBoundingClientRect(),l=s.top+r,f=s.left+s.width/2,h=a.offsetHeight,v=a.offsetWidth,_=v/2,E;switch(this.sticky?r>l+o.offsetHeight-h-this.stickyTopOffset?(a.style.top=l+o.offsetHeight-h+"px",a.classList.remove("medium-editor-sticky-toolbar")):r>l-h-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-h+"px"):a.style.top=l-h+"px",this.align){case"left":E=s.left;break;case"right":E=s.right-v;break;case"center":E=f-_;break}E<0?E=0:E+v>i&&(E=i-Math.ceil(v)-1),a.style.left=E+"px"},positionToolbar:function(o){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var r=o.getRangeAt(0),i=r.getBoundingClientRect();(!i||i.height===0&&i.width===0&&r.startContainer===r.endContainer)&&(r.startContainer.nodeType===1&&r.startContainer.querySelector("img")?i=r.startContainer.querySelector("img").getBoundingClientRect():i=r.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,f=s.offsetWidth,h=f/2,v=50,_=this.diffLeft-h,E=this.getEditorOption("elementsContainer"),O=["absolute","fixed"].indexOf(window.getComputedStyle(E).getPropertyValue("position"))>-1,w={},S={},M,T;O?(T=E.getBoundingClientRect(),["top","left"].forEach(function(B){S[B]=i[B]-T[B]}),S.width=i.width,S.height=i.height,i=S,a=T.width,w.top=E.scrollTop):w.top=this.window.pageYOffset,M=i.left+i.width/2,w.top+=i.top-l,i.top<v?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),w.top+=v+i.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),w.top+=this.diffTop),M<h?(w.left=_+h,w.right="initial"):a-M<h?(w.left="auto",w.right=0):(w.left=_+M,w.right="initial"),["top","left","right"].forEach(function(B){s.style[B]=w[B]+(isNaN(w[B])?"":"px")})}});e.extensions.toolbar=n})(),(function(){var n=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){var r="medium-editor-dragover";o.preventDefault(),o.dataTransfer.dropEffect="copy",o.type==="dragover"?o.target.classList.add(r):o.type==="dragleave"&&o.target.classList.remove(r)},handleDrop:function(o){var r="medium-editor-dragover",i;o.preventDefault(),o.stopPropagation(),o.dataTransfer.files&&(i=Array.prototype.slice.call(o.dataTransfer.files,0),i.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),s.onload=(function(){var f=this.document.getElementById(l);f&&(f.removeAttribute("id"),f.removeAttribute("class"),f.src=s.result)}).bind(this)}}).bind(this))),o.target.classList.remove(r)}});e.extensions.imageDragging=n})(),(function(){function n(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q.textContent,ie=e.selection.getCaretOffsets(Q);(J[ie.left-1]===void 0||J[ie.left-1].trim()===""||J[ie.left]!==void 0&&J[ie.left].trim()==="")&&W.preventDefault()}function o(W,Q){if(this.options.disableReturn||Q.getAttribute("data-disable-return"))W.preventDefault();else if(this.options.disableDoubleReturn||Q.getAttribute("data-disable-double-return")){var J=e.selection.getSelectionStart(this.options.ownerDocument);(J&&J.textContent.trim()===""&&J.nodeName.toLowerCase()!=="li"||J.previousElementSibling&&J.previousElementSibling.nodeName.toLowerCase()!=="br"&&J.previousElementSibling.textContent.trim()==="")&&W.preventDefault()}}function r(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J=Q&&Q.nodeName.toLowerCase();J==="pre"&&(W.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(Q)&&(W.preventDefault(),W.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(W){var Q,J=e.selection.getSelectionStart(this.options.ownerDocument),ie=J.nodeName.toLowerCase(),Se=/^(\s+|<br\/?>)?$/i,Ae=/h\d/i;e.util.isKey(W,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&J.previousElementSibling&&Ae.test(ie)&&e.selection.getCaretOffsets(J).left===0?e.util.isKey(W,e.util.keyCode.BACKSPACE)&&Se.test(J.previousElementSibling.innerHTML)?(J.previousElementSibling.parentNode.removeChild(J.previousElementSibling),W.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(W,e.util.keyCode.ENTER)&&(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.previousElementSibling.parentNode.insertBefore(Q,J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.DELETE)&&J.nextElementSibling&&J.previousElementSibling&&!Ae.test(ie)&&Se.test(J.innerHTML)&&Ae.test(J.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,J.nextElementSibling),J.previousElementSibling.parentNode.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&ie==="li"&&Se.test(J.innerHTML)&&!J.previousElementSibling&&!J.parentElement.previousElementSibling&&J.nextElementSibling&&J.nextElementSibling.nodeName.toLowerCase()==="li"?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.parentElement.parentElement.insertBefore(Q,J.parentElement),e.selection.moveCursor(this.options.ownerDocument,Q),J.parentElement.removeChild(J),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).left===0?(W.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(W,e.util.keyCode.ENTER)&&e.util.getClosestTag(J,"blockquote")!==!1&&e.selection.getCaretOffsets(J).right===0?(Q=this.options.ownerDocument.createElement("p"),Q.innerHTML="<br>",J.parentElement.insertBefore(Q,J.nextSibling),e.selection.moveCursor(this.options.ownerDocument,Q),W.preventDefault()):e.util.isKey(W,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(J.parentElement)&&!J.previousElementSibling&&J.nextElementSibling&&Se.test(J.innerHTML)&&(W.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,J.nextSibling),J.parentElement.removeChild(J))}function a(W){var Q=e.selection.getSelectionStart(this.options.ownerDocument),J;Q&&(e.util.isMediumEditorElement(Q)&&Q.children.length===0&&!e.util.isBlockContainer(Q)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(W,e.util.keyCode.ENTER)&&!e.util.isListItem(Q)&&!e.util.isBlockContainer(Q)&&(J=Q.nodeName.toLowerCase(),J==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!W.shiftKey&&!W.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(W,Q){var J=Q.parentNode.querySelector('textarea[medium-editor-textarea-id="'+Q.getAttribute("medium-editor-textarea-id")+'"]');J&&(J.value=Q.innerHTML.trim())}function l(W){W._mediumEditors||(W._mediumEditors=[null]),this.id||(this.id=W._mediumEditors.length),W._mediumEditors[this.id]=this}function f(W){!W._mediumEditors||!W._mediumEditors[this.id]||(W._mediumEditors[this.id]=null)}function h(W,Q,J){var ie=[];if(W||(W=[]),typeof W=="string"&&(W=Q.querySelectorAll(W)),e.util.isElement(W)&&(W=[W]),J)for(var Se=0;Se<W.length;Se++){var Ae=W[Se];e.util.isElement(Ae)&&!Ae.getAttribute("data-medium-editor-element")&&!Ae.getAttribute("medium-editor-textarea-id")&&ie.push(Ae)}else ie=Array.prototype.slice.apply(W);return ie}function v(W){var Q=W.parentNode.querySelector('textarea[medium-editor-textarea-id="'+W.getAttribute("medium-editor-textarea-id")+'"]');Q&&(Q.classList.remove("medium-editor-hidden"),Q.removeAttribute("medium-editor-textarea-id")),W.parentNode&&W.parentNode.removeChild(W)}function _(W,Q){return Object.keys(Q).forEach(function(J){W[J]===void 0&&(W[J]=Q[J])}),W}function E(W,Q,J){var ie={window:J.options.contentWindow,document:J.options.ownerDocument,base:J};return W=_(W,ie),typeof W.init=="function"&&W.init(),W.name||(W.name=Q),W}function O(){return this.elements.every(function(W){return!!W.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function w(){return O.call(this)?this.options.anchorPreview!==!1:!1}function S(){return this.options.placeholder!==!1}function M(){return this.options.autoLink!==!1}function T(){return this.options.imageDragging!==!1}function B(){return this.options.keyboardCommands!==!1}function R(){return!this.options.extensions.imageDragging}function P(W){for(var Q=this.options.ownerDocument.createElement("div"),J=Date.now(),ie="medium-editor-"+J,Se=W.attributes;this.options.ownerDocument.getElementById(ie);)J++,ie="medium-editor-"+J;Q.className=W.className,Q.id=ie,Q.innerHTML=W.value,W.setAttribute("medium-editor-textarea-id",ie);for(var Ae=0,Pe=Se.length;Ae<Pe;Ae++)Q.hasAttribute(Se[Ae].nodeName)||Q.setAttribute(Se[Ae].nodeName,Se[Ae].value);return W.form&&this.on(W.form,"reset",(function(De){De.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(ie))}).bind(this)),W.classList.add("medium-editor-hidden"),W.parentNode.insertBefore(Q,W),Q}function $(W,Q){if(!W.getAttribute("data-medium-editor-element")){W.nodeName.toLowerCase()==="textarea"&&(W=P.call(this,W),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!W.getAttribute("data-disable-editing")&&(W.setAttribute("contentEditable",!0),W.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(W.getAttribute("data-disable-return")||W.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=o.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!W.getAttribute("data-disable-return")&&this.on(W,"keyup",a.bind(this));var J=e.util.guid();W.setAttribute("data-medium-editor-element",!0),W.classList.add("medium-editor-element"),W.setAttribute("role","textbox"),W.setAttribute("aria-multiline",!0),W.setAttribute("data-medium-editor-editor-index",Q),W.setAttribute("medium-editor-index",J),Y[J]=W.innerHTML,this.events.attachAllEventsToElement(W)}return W}function I(){this.subscribe("editableKeydownTab",r.bind(this)),this.subscribe("editableKeydownDelete",i.bind(this)),this.subscribe("editableKeydownEnter",i.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",n.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=o.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function F(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(Se){Se!=="toolbar"&&this.options.extensions[Se]&&this.extensions.push(E(this.options.extensions[Se],Se,this))},this),R.call(this)){var W=this.options.fileDragging;W||(W={},T.call(this)||(W.allowedTypes=[])),this.addBuiltInExtension("fileDragging",W)}var Q={paste:!0,"anchor-preview":w.call(this),autoLink:M.call(this),keyboardCommands:B.call(this),placeholder:S.call(this)};Object.keys(Q).forEach(function(Se){Q[Se]&&this.addBuiltInExtension(Se)},this);var J=this.options.extensions.toolbar;if(!J&&O.call(this)){var ie=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});J=new e.extensions.toolbar(ie)}J&&this.extensions.push(E(J,"toolbar",this))}function U(W,Q){var J=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return Q&&J.forEach(function(ie){Q.hasOwnProperty(ie[0])&&Q[ie[0]]!==void 0&&e.util.deprecated(ie[0],ie[1],"v6.0.0")}),e.util.defaults({},Q,W)}function z(W,Q){var J=/^append-(.+)$/gi,ie=/justify([A-Za-z]*)$/g,Se,Ae;if(Se=J.exec(W),Se)return e.util.execFormatBlock(this.options.ownerDocument,Se[1]);if(W==="fontSize")return Q.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),Ae=Q.value||Q.size,this.options.ownerDocument.execCommand("fontSize",!1,Ae);if(W==="fontName")return Q.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),Ae=Q.value||Q.name,this.options.ownerDocument.execCommand("fontName",!1,Ae);if(W==="createLink")return this.createLink(Q);if(W==="image"){var Pe=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Pe)}if(W==="html"){var De=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,De)}if(ie.exec(W)){var He=this.options.ownerDocument.execCommand(W,!1,null),Ye=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return Ye&&X.call(this,e.util.getTopBlockContainer(Ye)),He}return Ae=Q&&Q.value,this.options.ownerDocument.execCommand(W,!1,Ae)}function X(W){if(W){var Q,J=Array.prototype.slice.call(W.childNodes).filter(function(ie){var Se=ie.nodeName.toLowerCase()==="div";return Se&&!Q&&(Q=ie.style.textAlign),Se});J.length&&(this.saveSelection(),J.forEach(function(ie){if(ie.style.textAlign===Q){var Se=ie.lastChild;if(Se){e.util.unwrap(ie,this.options.ownerDocument);var Ae=this.options.ownerDocument.createElement("BR");Se.parentNode.insertBefore(Ae,Se.nextSibling)}}},this),W.style.textAlign=Q,this.restoreSelection())}}var Y={};e.prototype={init:function(W,Q){return this.options=U.call(this,this.defaults,Q),this.origElements=W,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,F.call(this),I.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(W){typeof W.destroy=="function"&&W.destroy()},this),this.events.destroy(),this.elements.forEach(function(W){this.options.spellcheck&&(W.innerHTML=W.innerHTML),W.removeAttribute("contentEditable"),W.removeAttribute("spellcheck"),W.removeAttribute("data-medium-editor-element"),W.classList.remove("medium-editor-element"),W.removeAttribute("role"),W.removeAttribute("aria-multiline"),W.removeAttribute("medium-editor-index"),W.removeAttribute("data-medium-editor-editor-index"),W.getAttribute("medium-editor-textarea-id")&&v(W)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,f.call(this,this.options.contentWindow))},on:function(W,Q,J,ie){return this.events.attachDOMEvent(W,Q,J,ie),this},off:function(W,Q,J,ie){return this.events.detachDOMEvent(W,Q,J,ie),this},subscribe:function(W,Q){return this.events.attachCustomEvent(W,Q),this},unsubscribe:function(W,Q){return this.events.detachCustomEvent(W,Q),this},trigger:function(W,Q,J){return this.events.triggerCustomEvent(W,Q,J),this},delay:function(W){var Q=this;return setTimeout(function(){Q.isActive&&W()},this.options.delay)},serialize:function(){var W,Q,J={},ie=this.elements.length;for(W=0;W<ie;W+=1)Q=this.elements[W].id!==""?this.elements[W].id:"element-"+W,J[Q]={value:this.elements[W].innerHTML.trim()};return J},getExtensionByName:function(W){var Q;return this.extensions&&this.extensions.length&&this.extensions.some(function(J){return J.name===W?(Q=J,!0):!1}),Q},addBuiltInExtension:function(W,Q){var J=this.getExtensionByName(W),ie;if(J)return J;switch(W){case"anchor":ie=e.util.extend({},this.options.anchor,Q),J=new e.extensions.anchor(ie);break;case"anchor-preview":J=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":J=new e.extensions.autoLink;break;case"fileDragging":J=new e.extensions.fileDragging(Q);break;case"fontname":J=new e.extensions.fontName(this.options.fontName);break;case"fontsize":J=new e.extensions.fontSize(Q);break;case"keyboardCommands":J=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":J=new e.extensions.paste(this.options.paste);break;case"placeholder":J=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(W)&&(Q?(ie=e.util.defaults({},Q,e.extensions.button.prototype.defaults[W]),J=new e.extensions.button(ie)):J=new e.extensions.button(W))}return J&&this.extensions.push(E(J,W,this)),J},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var W=this.getExtensionByName("toolbar");return W&&W.checkState(),this},queryCommandState:function(W){var Q=/^full-(.+)$/gi,J,ie=null;J=Q.exec(W),J&&(W=J[1]);try{ie=this.options.ownerDocument.queryCommandState(W)}catch{ie=null}return ie},execAction:function(W,Q){var J=/^full-(.+)$/gi,ie,Se;return ie=J.exec(W),ie?(this.saveSelection(),this.selectAllContents(),Se=z.call(this,ie[1],Q),this.restoreSelection()):Se=z.call(this,W,Q),(W==="insertunorderedlist"||W==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),Se},getSelectedParentElement:function(W){return W===void 0&&(W=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(W)},selectAllContents:function(){var W=e.selection.getSelectionElement(this.options.contentWindow);if(W){for(;W.children.length===1;)W=W.children[0];this.selectElement(W)}},selectElement:function(W){e.selection.selectNode(W,this.options.ownerDocument);var Q=e.selection.getSelectionElement(this.options.contentWindow);Q&&this.events.focusElement(Q)},getFocusedElement:function(){var W;return this.elements.some(function(Q){return!W&&Q.getAttribute("data-medium-focused")&&(W=Q),!!W},this),W},exportSelection:function(){var W=e.selection.getSelectionElement(this.options.contentWindow),Q=this.elements.indexOf(W),J=null;return Q>=0&&(J=e.selection.exportSelection(W,this.options.ownerDocument)),J!==null&&Q!==0&&(J.editableElementIndex=Q),J},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(W,Q){if(W){var J=this.elements[W.editableElementIndex||0];e.selection.importSelection(W,J,this.options.ownerDocument,Q)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(W){var Q=e.selection.getSelectionElement(this.options.contentWindow),J={},ie;if(this.elements.indexOf(Q)!==-1){try{if(this.events.disableCustomEvent("editableInput"),W.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),ie=W.url||W.value,ie&&ie.trim().length>0){var Se=this.options.contentWindow.getSelection();if(Se){var Ae=Se.getRangeAt(0),Pe=Ae.commonAncestorContainer,De,He,Ye,Be;if(Ae.endContainer.nodeType===3&&Ae.startContainer.nodeType!==3&&Ae.startOffset===0&&Ae.startContainer.firstChild===Ae.endContainer&&(Pe=Ae.endContainer),He=e.util.getClosestBlockContainer(Ae.startContainer),Ye=e.util.getClosestBlockContainer(Ae.endContainer),Pe.nodeType!==3&&Pe.textContent.length!==0&&He===Ye){var Je=He||Q,mt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),De=this.exportSelection(),mt.appendChild(Je.cloneNode(!0)),Q===Je?e.selection.select(this.options.ownerDocument,Je.firstChild,0,Je.lastChild,Je.lastChild.nodeType===3?Je.lastChild.nodeValue.length:Je.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,Je,0,Je,Je.childNodes.length);var le=this.exportSelection();Be=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,mt,{start:De.start-le.start,end:De.end-le.start,editableElementIndex:De.editableElementIndex}),Be.length===0&&(mt=this.options.ownerDocument.createDocumentFragment(),mt.appendChild(Pe.cloneNode(!0)),Be=[mt.firstChild.firstChild,mt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Be,ie.trim());var Ze=(mt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,mt.firstChild.innerHTML.replace(/^\s+/,"")),De.start-=Ze,De.end-=Ze,this.importSelection(De)}else this.options.ownerDocument.execCommand("createLink",!1,ie);this.options.targetBlank||W.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),ie),W.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),W.buttonClass)}}if(this.options.targetBlank||W.target==="_blank"||W.buttonClass){J=this.options.ownerDocument.createEvent("HTMLEvents"),J.initEvent("input",!0,!0,this.options.contentWindow);for(var pe=0,se=this.elements.length;pe<se;pe+=1)this.elements[pe].dispatchEvent(J)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",J,Q)}},cleanPaste:function(W){this.getExtensionByName("paste").cleanPaste(W)},pasteHTML:function(W,Q){this.getExtensionByName("paste").pasteHTML(W,Q)},setContent:function(W,Q){if(Q=Q||0,this.elements[Q]){var J=this.elements[Q];J.innerHTML=W,this.checkContentChanged(J)}},getContent:function(W){return W=W||0,this.elements[W]?this.elements[W].innerHTML.trim():null},checkContentChanged:function(W){W=W||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(W,{target:W,currentTarget:W})},resetContent:function(W){if(W){var Q=this.elements.indexOf(W);Q!==-1&&this.setContent(Y[W.getAttribute("medium-editor-index")],Q);return}this.elements.forEach(function(J,ie){this.setContent(Y[J.getAttribute("medium-editor-index")],ie)},this)},addElements:function(W){var Q=h(W,this.options.ownerDocument,!0);if(Q.length===0)return!1;Q.forEach(function(J){J=$.call(this,J,this.id),this.elements.push(J),this.trigger("addElement",{target:J,currentTarget:J},J)},this)},removeElements:function(W){var Q=h(W,this.options.ownerDocument),J=Q.map(function(ie){return ie.getAttribute("medium-editor-textarea-id")&&ie.parentNode?ie.parentNode.querySelector('div[medium-editor-textarea-id="'+ie.getAttribute("medium-editor-textarea-id")+'"]'):ie});this.elements=this.elements.filter(function(ie){return J.indexOf(ie)!==-1?(this.events.cleanupElement(ie),ie.getAttribute("medium-editor-textarea-id")&&v(ie),this.trigger("removeElement",{target:ie,currentTarget:ie},ie),!1):!0},this)}},e.getEditorFromElement=function(W){var Q=W.getAttribute("data-medium-editor-editor-index"),J=W&&W.ownerDocument&&(W.ownerDocument.defaultView||W.ownerDocument.parentWindow);return J&&J._mediumEditors&&J._mediumEditors[Q]?J._mediumEditors[Q]:null}})(),(function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}})(),e.parseVersionString=function(n){var o=n.split("-"),r=o[0].split("."),i=o.length>1?o[1]:"";return{major:parseInt(r[0],10),minor:parseInt(r[1],10),revision:parseInt(r[2],10),preRelease:i,toString:function(){return[r[0],r[1],r[2]].join(".")+(i?"-"+i:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Q0)),Q0.exports}var mne=gne();const D0=Z_(mne);/*!
|
||
* vanilla-picker v2.12.3
|
||
* https://vanilla-picker.js.org
|
||
*
|
||
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
||
* Released under the ISC license.
|
||
*/var LM=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},IM=(function(){function t(e,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}})(),j0=(function(){function t(e,n){var o=[],r=!0,i=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(o.push(l.value),!(n&&o.length===n));r=!0);}catch(f){i=!0,a=f}finally{try{!r&&s.return&&s.return()}finally{if(i)throw a}}return o}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();String.prototype.startsWith=String.prototype.startsWith||function(t){return this.indexOf(t)===0};String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var yne={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function _R(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var _ne=(function(){function t(e,n,o,r){LM(this,t);var i=this;function a(l){if(l.startsWith("hsl")){var f=l.match(/([\-\d\.e]+)/g).map(Number),h=j0(f,4),v=h[0],_=h[1],E=h[2],O=h[3];O===void 0&&(O=1),v/=360,_/=100,E/=100,i.hsla=[v,_,E,O]}else if(l.startsWith("rgb")){var w=l.match(/([\-\d\.e]+)/g).map(Number),S=j0(w,4),M=S[0],T=S[1],B=S[2],R=S[3];R===void 0&&(R=1),i.rgba=[M,T,B,R]}else l.startsWith("#")?i.rgba=t.hexToRgb(l):i.rgba=t.nameToRgb(l)||t.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(o===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,n,o,r===void 0?1:r]}return IM(t,[{key:"printRGB",value:function(n){var o=n?this.rgba:this.rgba.slice(0,3),r=o.map(function(i,a){return _R(i,a===3?3:0)});return n?"rgba("+r+")":"rgb("+r+")"}},{key:"printHSL",value:function(n){var o=[360,100,100,1],r=["","%","%",""],i=n?this.hsla:this.hsla.slice(0,3),a=i.map(function(s,l){return _R(s*o[l],l===3?3:1)+r[l]});return n?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(n){var o=this.hex;return n?o:o.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(n){n.length===3&&(n[3]=1),this._rgba=n,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(n){n.length===3&&(n[3]=1),this._hsla=n,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var n=this.rgba,o=n.map(function(r,i){return i<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+o.map(function(r){return r.padStart(2,"0")}).join("")},set:function(n){this.rgba=t.hexToRgb(n)}}],[{key:"hexToRgb",value:function(n){var o=(n.startsWith("#")?n.slice(1):n).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!o.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+n);var r=o.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(i){return parseInt(i,16)});return r[3]=r[3]/255,r}},{key:"nameToRgb",value:function(n){var o=n.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=yne[o];return r===void 0?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],s=o[3];r/=255,i/=255,a/=255;var l=Math.max(r,i,a),f=Math.min(r,i,a),h=void 0,v=void 0,_=(l+f)/2;if(l===f)h=v=0;else{var E=l-f;switch(v=_>.5?E/(2-l-f):E/(l+f),l){case r:h=(i-a)/E+(i<a?6:0);break;case i:h=(a-r)/E+2;break;case a:h=(r-i)/E+4;break}h/=6}return[h,v,_,s]}},{key:"hslToRgb",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],s=o[3],l=void 0,f=void 0,h=void 0;if(i===0)l=f=h=a;else{var v=function(S,M,T){return T<0&&(T+=1),T>1&&(T-=1),T<.16666666666666666?S+(M-S)*6*T:T<.5?M:T<.6666666666666666?S+(M-S)*(.6666666666666666-T)*6:S},_=a<.5?a*(1+i):a+i-a*i,E=2*a-_;l=v(E,_,r+1/3),f=v(E,_,r),h=v(E,_,r-1/3)}var O=[l*255,f*255,h*255].map(Math.round);return O[3]=s,O}}]),t})(),bne=(function(){function t(){LM(this,t),this._events=[]}return IM(t,[{key:"add",value:function(n,o,r){n.addEventListener(o,r,!1),this._events.push({target:n,type:o,handler:r})}},{key:"remove",value:function(n,o,r){this._events=this._events.filter(function(i){var a=!0;return n&&n!==i.target&&(a=!1),o&&o!==i.type&&(a=!1),r&&r!==i.handler&&(a=!1),a&&t._doRemove(i.target,i.type,i.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(n){return t._doRemove(n.target,n.type,n.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(n,o,r){n.removeEventListener(o,r,!1)}}]),t})();function wne(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function gS(t,e,n){var o=!1;function r(l,f,h){return Math.max(f,Math.min(l,h))}function i(l,f,h){if(h&&(o=!0),!!o){l.preventDefault();var v=e.getBoundingClientRect(),_=v.width,E=v.height,O=f.clientX,w=f.clientY,S=r(O-v.left,0,_),M=r(w-v.top,0,E);n(S/_,M/E)}}function a(l,f){var h=l.buttons===void 0?l.which:l.buttons;h===1?i(l,l,f):o=!1}function s(l,f){l.touches.length===1?i(l,l.touches[0],f):o=!1}t.add(e,"mousedown",function(l){a(l,!0)}),t.add(e,"touchstart",function(l){s(l,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",function(l){o=!1}),t.add(e,"touchend",function(l){o=!1}),t.add(e,"touchcancel",function(l){o=!1})}var Ene=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
||
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,xne=360,KI="keydown",L0="mousedown",mS="focusin";function Dd(t,e){return(e||document).querySelector(t)}function One(t){t.preventDefault(),t.stopPropagation()}function yS(t,e,n,o,r){t.add(e,KI,function(i){n.indexOf(i.key)>=0&&o(i)})}var ZI=(function(){function t(e){LM(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new bne,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return IM(t,[{key:"setOptions",value:function(n){var o=this;if(!n)return;var r=this.settings;function i(f,h,v){for(var _ in f)h[_]=f[_]}if(n instanceof HTMLElement)r.parent=n;else{r.parent&&n.parent&&r.parent!==n.parent&&(this._events.remove(r.parent),this._popupInited=!1),i(n,r),n.onChange&&(this.onChange=n.onChange),n.onDone&&(this.onDone=n.onDone),n.onOpen&&(this.onOpen=n.onOpen),n.onClose&&(this.onClose=n.onClose);var a=n.color||n.colour;a&&this._setColor(a)}var s=r.parent;if(s&&r.popup&&!this._popupInited){var l=function(h){return o.openHandler(h)};this._events.add(s,"click",l),yS(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else n.parent&&!r.popup&&this.show()}},{key:"openHandler",value:function(n){if(this.show()){n&&n.preventDefault(),this.settings.parent.style.pointerEvents="none";var o=n&&n.type===KI?this._domEdit:this.domElement;setTimeout(function(){return o.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(n){var o=n&&n.type,r=!1;if(!n)r=!0;else if(o===L0||o===mS){var i=(this.__containedEvent||0)+100;n.timeStamp>i&&(r=!0)}else One(n),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",o!==L0&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(n,o){this.closeHandler(),this.setOptions(n),o&&this.openHandler()}},{key:"setColor",value:function(n,o){this._setColor(n,{silent:o})}},{key:"_setColor",value:function(n,o){if(typeof n=="string"&&(n=n.trim()),!!n){o=o||{};var r=void 0;try{r=new _ne(n)}catch(a){if(o.failSilently)return;throw a}if(!this.settings.alpha){var i=r.hsla;i[3]=1,r.hsla=i}this.colour=this.color=r,this._setHSLA(null,null,null,null,o)}}},{key:"setColour",value:function(n,o){this.setColor(n,o)}},{key:"show",value:function(){var n=this.settings.parent;if(!n)return!1;if(this.domElement){var o=this._toggleDOM(!0);return this._setPosition(),o}var r=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',i=wne(r);return this.domElement=i,this._domH=Dd(".picker_hue",i),this._domSL=Dd(".picker_sl",i),this._domA=Dd(".picker_alpha",i),this._domEdit=Dd(".picker_editor input",i),this._domSample=Dd(".picker_sample",i),this._domOkay=Dd(".picker_done button",i),this._domCancel=Dd(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup(function(){return i.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var n=this,o=this,r=this.domElement,i=this._events;function a(f,h,v){i.add(f,h,v)}a(r,"click",function(f){return f.preventDefault()}),gS(i,this._domH,function(f,h){return o._setHSLA(f)}),gS(i,this._domSL,function(f,h){return o._setHSLA(null,f,1-h)}),this.settings.alpha&&gS(i,this._domA,function(f,h){return o._setHSLA(null,null,null,1-h)});var s=this._domEdit;a(s,"input",function(f){o._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(f){var h=this;h.selectionStart===h.selectionEnd&&h.select()}),this._ifPopup(function(){var f=function(_){return n.closeHandler(_)};a(window,L0,f),a(window,mS,f),yS(i,r,["Esc","Escape"],f);var h=function(_){n.__containedEvent=_.timeStamp};a(r,L0,h),a(r,mS,h),a(n._domCancel,"click",f)});var l=function(h){n._ifPopup(function(){return n.closeHandler(h)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",l),yS(i,r,["Enter"],l)}},{key:"_setPosition",value:function(){var n=this.settings.parent,o=this.domElement;n!==o.parentNode&&n.appendChild(o),this._ifPopup(function(r){getComputedStyle(n).position==="static"&&(n.style.position="relative");var i=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===i?o.classList.add(a):o.classList.remove(a)}),o.classList.add(i)})}},{key:"_setHSLA",value:function(n,o,r,i,a){a=a||{};var s=this.colour,l=s.hsla;[n,o,r,i].forEach(function(f,h){(f||f===0)&&(l[h]=f)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(n){if(!this.domElement)return;n=n||{};var o=this.colour,r=o.hsla,i="hsl("+r[0]*xne+", 100%, 50%)",a=o.hslString,s=o.hslaString,l=this._domH,f=this._domSL,h=this._domA,v=Dd(".picker_selector",l),_=Dd(".picker_selector",f),E=Dd(".picker_selector",h);function O($,I,F){I.style.left=F*100+"%"}function w($,I,F){I.style.top=F*100+"%"}O(l,v,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,O(f,_,r[1]),w(f,_,1-r[2]),f.style.color=a,w(h,E,1-r[3]);var S=a,M=S.replace("hsl","hsla").replace(")",", 0)"),T="linear-gradient("+[S,M]+")";if(this._domA.style.background=T+", "+Ene,!n.fromEditor){var B=this.settings.editorFormat,R=this.settings.alpha,P=void 0;switch(B){case"rgb":P=o.printRGB(R);break;case"hsl":P=o.printHSL(R);break;default:P=o.printHex(R)}this._domEdit.value=P}this._domSample.style.color=s}},{key:"_ifPopup",value:function(n,o){this.settings.parent&&this.settings.popup?n&&n(this.settings.popup):o&&o()}},{key:"_toggleDOM",value:function(n){var o=this.domElement;if(!o)return!1;var r=n?"":"none",i=o.style.display!==r;return i&&(o.style.display=r),i}}]),t})();{var _S=document.createElement("style");_S.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(_S),ZI.StyleElement=_S}var bS={exports:{}},bR;function JI(){return bR||(bR=1,(function(t,e){(function(n,o){t.exports=n()})(function(){var n="object",o="function",r="undefined",i=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function f(le,Ze){var pe=typeof le[Ze];return pe==o||!!(pe==n&&le[Ze])||pe=="unknown"}function h(le,Ze){return!!(typeof le[Ze]==n&&le[Ze])}function v(le,Ze){return typeof le[Ze]!=r}function _(le){return function(Ze,pe){for(var se=pe.length;se--;)if(!le(Ze,pe[se]))return!1;return!0}}var E=_(f),O=_(h),w=_(v);function S(le){return le&&E(le,l)&&w(le,s)}function M(le){return h(le,"body")?le.body:le.getElementsByTagName("body")[0]}var T=[].forEach?function(le,Ze){le.forEach(Ze)}:function(le,Ze){for(var pe=0,se=le.length;pe<se;++pe)Ze(le[pe],pe)},B={},R=typeof window!=r&&typeof document!=r,P={isHostMethod:f,isHostObject:h,isHostProperty:v,areHostMethods:E,areHostObjects:O,areHostProperties:w,isTextRange:S,getBody:M,forEach:T},$={version:"1.3.2",initialized:!1,isBrowser:R,supported:!0,util:P,features:{},modules:B,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==r?!0:rangyAutoInitialize}};function I(le){typeof console!=r&&f(console,"log")&&console.log(le)}function F(le,Ze){R&&Ze?alert(le):I(le)}function U(le){$.initialized=!0,$.supported=!1,F("Rangy is not supported in this environment. Reason: "+le,$.config.alertOnFail)}$.fail=U;function z(le){F("Rangy warning: "+le,$.config.alertOnWarn)}$.warn=z;var X;({}).hasOwnProperty?(P.extend=X=function(le,Ze,pe){var se,we;for(var $e in Ze)$e==="__proto__"||$e==="constructor"||$e==="prototype"||Ze.hasOwnProperty($e)&&(se=le[$e],we=Ze[$e],pe&&se!==null&&typeof se=="object"&&we!==null&&typeof we=="object"&&X(se,we,!0),le[$e]=we);return Ze.hasOwnProperty("toString")&&(le.toString=Ze.toString),le},P.createOptions=function(le,Ze){var pe={};return X(pe,Ze),le&&X(pe,le),pe}):U("hasOwnProperty not supported"),R||U("Rangy can only run in a browser"),(function(){var le;if(R){var Ze=document.createElement("div");Ze.appendChild(document.createElement("span"));var pe=[].slice;try{pe.call(Ze.childNodes,0)[0].nodeType==1&&(le=function(se){return pe.call(se,0)})}catch{}}le||(le=function(se){for(var we=[],$e=0,rt=se.length;$e<rt;++$e)we[$e]=se[$e];return we}),P.toArray=le})();var Y;R&&(f(document,"addEventListener")?Y=function(le,Ze,pe){le.addEventListener(Ze,pe,!1)}:f(document,"attachEvent")?Y=function(le,Ze,pe){le.attachEvent("on"+Ze,pe)}:U("Document does not have required addEventListener or attachEvent method"),P.addListener=Y);var W=[];function Q(le){return le.message||le.description||String(le)}function J(){if(!(!R||$.initialized)){var le,Ze=!1,pe=!1;f(document,"createRange")&&(le=document.createRange(),E(le,a)&&w(le,i)&&(Ze=!0));var se=M(document);if(!se||se.nodeName.toLowerCase()!="body"){U("No body element found");return}if(se&&f(se,"createTextRange")&&(le=se.createTextRange(),S(le)&&(pe=!0)),!Ze&&!pe){U("Neither Range nor TextRange are available");return}$.initialized=!0,$.features={implementsDomRange:Ze,implementsTextRange:pe};var we,$e;for(var rt in B)(we=B[rt])instanceof De&&we.init(we,$);for(var pt=0,Lt=W.length;pt<Lt;++pt)try{W[pt]($)}catch(Jt){$e="Rangy init listener threw an exception. Continuing. Detail: "+Q(Jt),I($e)}}}function ie(le,Ze,pe){pe&&(le+=" in module "+pe.name),$.warn("DEPRECATED: "+le+" is deprecated. Please use "+Ze+" instead.")}function Se(le,Ze,pe,se){le[Ze]=function(){return ie(Ze,pe,se),le[pe].apply(le,P.toArray(arguments))}}P.deprecationNotice=ie,P.createAliasForDeprecatedMethod=Se,$.init=J,$.addInitListener=function(le){$.initialized?le($):W.push(le)};var Ae=[];$.addShimListener=function(le){Ae.push(le)};function Pe(le){le=le||window,J();for(var Ze=0,pe=Ae.length;Ze<pe;++Ze)Ae[Ze](le)}R&&($.shim=$.createMissingNativeApi=Pe,Se($,"createMissingNativeApi","shim"));function De(le,Ze,pe){this.name=le,this.dependencies=Ze,this.initialized=!1,this.supported=!1,this.initializer=pe}De.prototype={init:function(){for(var le=this.dependencies||[],Ze=0,pe=le.length,se,we;Ze<pe;++Ze){if(we=le[Ze],se=B[we],!se||!(se instanceof De))throw new Error("required module '"+we+"' not found");if(se.init(),!se.supported)throw new Error("required module '"+we+"' not supported")}this.initializer(this)},fail:function(le){throw this.initialized=!0,this.supported=!1,new Error(le)},warn:function(le){$.warn("Module "+this.name+": "+le)},deprecationNotice:function(le,Ze){$.warn("DEPRECATED: "+le+" in module "+this.name+" is deprecated. Please use "+Ze+" instead")},createError:function(le){return new Error("Error in Rangy "+this.name+" module: "+le)}};function He(le,Ze,pe){var se=new De(le,Ze,function(we){if(!we.initialized){we.initialized=!0;try{pe($,we),we.supported=!0}catch(rt){var $e="Module '"+le+"' failed to load: "+Q(rt);I($e),rt.stack&&I(rt.stack)}}});return B[le]=se,se}$.createModule=function(le){var Ze,pe;arguments.length==2?(Ze=arguments[1],pe=[]):(Ze=arguments[2],pe=arguments[1]);var se=He(le,pe,Ze);$.initialized&&$.supported&&se.init()},$.createCoreModule=function(le,Ze,pe){He(le,Ze,pe)};function Ye(){}$.RangePrototype=Ye,$.rangePrototype=new Ye;function Be(){}$.selectionPrototype=new Be,$.createCoreModule("DomUtil",[],function(le,Ze){var pe="undefined",se=le.util,we=se.getBody;se.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||Ze.fail("document missing a Node creation method"),se.isHostMethod(document,"getElementsByTagName")||Ze.fail("document missing getElementsByTagName method");var $e=document.createElement("div");se.areHostMethods($e,["insertBefore","appendChild","cloneNode"])||Ze.fail("Incomplete Element implementation"),se.isHostProperty($e,"innerHTML")||Ze.fail("Element is missing innerHTML property");var rt=document.createTextNode("test");se.areHostMethods(rt,["splitText","deleteData","insertData","appendData","cloneNode"])||Ze.fail("Incomplete Text Node implementation");var pt=function(ut,gn){for(var Fn=ut.length;Fn--;)if(ut[Fn]===gn)return!0;return!1};function Lt(ut){var gn;return typeof ut.namespaceURI==pe||(gn=ut.namespaceURI)===null||gn=="http://www.w3.org/1999/xhtml"}function Jt(ut){var gn=ut.parentNode;return gn.nodeType==1?gn:null}function en(ut){for(var gn=0;ut=ut.previousSibling;)++gn;return gn}function zt(ut){switch(ut.nodeType){case 7:case 10:return 0;case 3:case 8:return ut.length;default:return ut.childNodes.length}}function it(ut,gn){var Fn=[],sr;for(sr=ut;sr;sr=sr.parentNode)Fn.push(sr);for(sr=gn;sr;sr=sr.parentNode)if(pt(Fn,sr))return sr;return null}function ae(ut,gn,Fn){for(var sr=Fn?gn:gn.parentNode;sr;){if(sr===ut)return!0;sr=sr.parentNode}return!1}function re(ut,gn){return ae(ut,gn,!0)}function je(ut,gn,Fn){for(var sr,wo=Fn?ut:ut.parentNode;wo;){if(sr=wo.parentNode,sr===gn)return wo;wo=sr}return null}function vt(ut){var gn=ut.nodeType;return gn==3||gn==4||gn==8}function q(ut){if(!ut)return!1;var gn=ut.nodeType;return gn==3||gn==8}function kt(ut,gn){var Fn=gn.nextSibling,sr=gn.parentNode;return Fn?sr.insertBefore(ut,Fn):sr.appendChild(ut),ut}function Rt(ut,gn,Fn){var sr=ut.cloneNode(!1);if(sr.deleteData(0,gn),ut.deleteData(gn,ut.length-gn),kt(sr,ut),Fn)for(var wo=0,oo;oo=Fn[wo++];)oo.node==ut&&oo.offset>gn?(oo.node=sr,oo.offset-=gn):oo.node==ut.parentNode&&oo.offset>en(ut)&&++oo.offset;return sr}function Gt(ut){if(ut.nodeType==9)return ut;if(typeof ut.ownerDocument!=pe)return ut.ownerDocument;if(typeof ut.document!=pe)return ut.document;if(ut.parentNode)return Gt(ut.parentNode);throw Ze.createError("getDocument: no document found for node")}function Pn(ut){var gn=Gt(ut);if(typeof gn.defaultView!=pe)return gn.defaultView;if(typeof gn.parentWindow!=pe)return gn.parentWindow;throw Ze.createError("Cannot get a window object for node")}function qt(ut){if(typeof ut.contentDocument!=pe)return ut.contentDocument;if(typeof ut.contentWindow!=pe)return ut.contentWindow.document;throw Ze.createError("getIframeDocument: No Document object found for iframe element")}function On(ut){if(typeof ut.contentWindow!=pe)return ut.contentWindow;if(typeof ut.contentDocument!=pe)return ut.contentDocument.defaultView;throw Ze.createError("getIframeWindow: No Window object found for iframe element")}function ke(ut){return ut&&se.isHostMethod(ut,"setTimeout")&&se.isHostObject(ut,"document")}function Ke(ut,gn,Fn){var sr;if(ut?se.isHostProperty(ut,"nodeType")?sr=ut.nodeType==1&&ut.tagName.toLowerCase()=="iframe"?qt(ut):Gt(ut):ke(ut)&&(sr=ut.document):sr=document,!sr)throw gn.createError(Fn+"(): Parameter must be a Window object or DOM node");return sr}function Le(ut){for(var gn;gn=ut.parentNode;)ut=gn;return ut}function dt(ut,gn,Fn,sr){var wo,oo,ta,Ca,Yi;if(ut==Fn)return gn===sr?0:gn<sr?-1:1;if(wo=je(Fn,ut,!0))return gn<=en(wo)?-1:1;if(wo=je(ut,Fn,!0))return en(wo)<sr?-1:1;if(oo=it(ut,Fn),!oo)throw new Error("comparePoints error: nodes have no common ancestor");if(ta=ut===oo?oo:je(ut,oo,!0),Ca=Fn===oo?oo:je(Fn,oo,!0),ta===Ca)throw Ze.createError("comparePoints got to case 4 and childA and childB are the same!");for(Yi=oo.firstChild;Yi;){if(Yi===ta)return-1;if(Yi===Ca)return 1;Yi=Yi.nextSibling}}var At=!1;function Tt(ut){var gn;try{return gn=ut.parentNode,!1}catch{return!0}}(function(){var ut=document.createElement("b");ut.innerHTML="1";var gn=ut.firstChild;ut.innerHTML="<br />",At=Tt(gn),le.features.crashyTextNodes=At})();function En(ut){if(!ut)return"[No node]";if(At&&Tt(ut))return"[Broken node]";if(vt(ut))return'"'+ut.data+'"';if(ut.nodeType==1){var gn=ut.id?' id="'+ut.id+'"':"";return"<"+ut.nodeName+gn+">[index:"+en(ut)+",length:"+ut.childNodes.length+"]["+(ut.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return ut.nodeName}function Zn(ut){for(var gn=Gt(ut).createDocumentFragment(),Fn;Fn=ut.firstChild;)gn.appendChild(Fn);return gn}var ao;typeof window.getComputedStyle!=pe?ao=function(ut,gn){return Pn(ut).getComputedStyle(ut,null)[gn]}:typeof document.documentElement.currentStyle!=pe?ao=function(ut,gn){return ut.currentStyle?ut.currentStyle[gn]:""}:Ze.fail("No means of obtaining computed style properties found");function Lo(ut,gn,Fn){var sr=we(ut),wo=ut.createElement("div");wo.contentEditable=""+!!Fn,gn&&(wo.innerHTML=gn);var oo=sr.firstChild;return oo?sr.insertBefore(wo,oo):sr.appendChild(wo),wo}function _o(ut){return ut.parentNode.removeChild(ut)}function ho(ut){this.root=ut,this._next=ut}ho.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var ut=this._current=this._next,gn,Fn;if(this._current)if(gn=ut.firstChild,gn)this._next=gn;else{for(Fn=null;ut!==this.root&&!(Fn=ut.nextSibling);)ut=ut.parentNode;this._next=Fn}return this._current},detach:function(){this._current=this._next=this.root=null}};function Nn(ut){return new ho(ut)}function qn(ut,gn){this.node=ut,this.offset=gn}qn.prototype={equals:function(ut){return!!ut&&this.node===ut.node&&this.offset==ut.offset},inspect:function(){return"[DomPosition("+En(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function rr(ut){this.code=this[ut],this.codeName=ut,this.message="DOMException: "+this.codeName}rr.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},rr.prototype.toString=function(){return this.message},le.dom={arrayContains:pt,isHtmlNamespace:Lt,parentElement:Jt,getNodeIndex:en,getNodeLength:zt,getCommonAncestor:it,isAncestorOf:ae,isOrIsAncestorOf:re,getClosestAncestorIn:je,isCharacterDataNode:vt,isTextOrCommentNode:q,insertAfter:kt,splitDataNode:Rt,getDocument:Gt,getWindow:Pn,getIframeWindow:On,getIframeDocument:qt,getBody:we,isWindow:ke,getContentDocument:Ke,getRootContainer:Le,comparePoints:dt,isBrokenNode:Tt,inspectNode:En,getComputedStyleProperty:ao,createTestElement:Lo,removeNode:_o,fragmentFromNodeChildren:Zn,createIterator:Nn,DomPosition:qn},le.DOMException=rr}),$.createCoreModule("DomRange",["DomUtil"],function(le,Ze){var pe=le.dom,se=le.util,we=pe.DomPosition,$e=le.DOMException,rt=pe.isCharacterDataNode,pt=pe.getNodeIndex,Lt=pe.isOrIsAncestorOf,Jt=pe.getDocument,en=pe.comparePoints,zt=pe.splitDataNode,it=pe.getClosestAncestorIn,ae=pe.getNodeLength,re=pe.arrayContains,je=pe.getRootContainer,vt=le.features.crashyTextNodes,q=pe.removeNode;function kt(ye,ht){return ye.nodeType!=3&&(Lt(ye,ht.startContainer)||Lt(ye,ht.endContainer))}function Rt(ye){return ye.document||Jt(ye.startContainer)}function Gt(ye){return je(ye.startContainer)}function Pn(ye){return new we(ye.parentNode,pt(ye))}function qt(ye){return new we(ye.parentNode,pt(ye)+1)}function On(ye,ht,pn){var Rn=ye.nodeType==11?ye.firstChild:ye;return rt(ht)?pn==ht.length?pe.insertAfter(ye,ht):ht.parentNode.insertBefore(ye,pn==0?ht:zt(ht,pn)):pn>=ht.childNodes.length?ht.appendChild(ye):ht.insertBefore(ye,ht.childNodes[pn]),Rn}function ke(ye,ht,pn){if(Sn(ye),Sn(ht),Rt(ht)!=Rt(ye))throw new $e("WRONG_DOCUMENT_ERR");var Rn=en(ye.startContainer,ye.startOffset,ht.endContainer,ht.endOffset),Cn=en(ye.endContainer,ye.endOffset,ht.startContainer,ht.startOffset);return pn?Rn<=0&&Cn>=0:Rn<0&&Cn>0}function Ke(ye){for(var ht,pn,Rn=Rt(ye.range).createDocumentFragment(),Cn;pn=ye.next();){if(ht=ye.isPartiallySelectedSubtree(),pn=pn.cloneNode(!ht),ht&&(Cn=ye.getSubtreeIterator(),pn.appendChild(Ke(Cn)),Cn.detach()),pn.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");Rn.appendChild(pn)}return Rn}function Le(ye,ht,pn){var Rn,Cn;pn=pn||{stop:!1};for(var nr,Mn;nr=ye.next();)if(ye.isPartiallySelectedSubtree()){if(ht(nr)===!1){pn.stop=!0;return}else if(Mn=ye.getSubtreeIterator(),Le(Mn,ht,pn),Mn.detach(),pn.stop)return}else for(Rn=pe.createIterator(nr);Cn=Rn.next();)if(ht(Cn)===!1){pn.stop=!0;return}}function dt(ye){for(var ht;ye.next();)ye.isPartiallySelectedSubtree()?(ht=ye.getSubtreeIterator(),dt(ht),ht.detach()):ye.remove()}function At(ye){for(var ht,pn=Rt(ye.range).createDocumentFragment(),Rn;ht=ye.next();){if(ye.isPartiallySelectedSubtree()?(ht=ht.cloneNode(!1),Rn=ye.getSubtreeIterator(),ht.appendChild(At(Rn)),Rn.detach()):ye.remove(),ht.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");pn.appendChild(ht)}return pn}function Tt(ye,ht,pn){var Rn=!!(ht&&ht.length),Cn,nr=!!pn;Rn&&(Cn=new RegExp("^("+ht.join("|")+")$"));var Mn=[];return Le(new Zn(ye,!1),function(or){if(!(Rn&&!Cn.test(or.nodeType))&&!(nr&&!pn(or))){var lr=ye.startContainer;if(!(or==lr&&rt(lr)&&ye.startOffset==lr.length)){var qr=ye.endContainer;or==qr&&rt(qr)&&ye.endOffset==0||Mn.push(or)}}}),Mn}function En(ye){var ht=typeof ye.getName>"u"?"Range":ye.getName();return"["+ht+"("+pe.inspectNode(ye.startContainer)+":"+ye.startOffset+", "+pe.inspectNode(ye.endContainer)+":"+ye.endOffset+")]"}function Zn(ye,ht){if(this.range=ye,this.clonePartiallySelectedTextNodes=ht,!ye.collapsed){this.sc=ye.startContainer,this.so=ye.startOffset,this.ec=ye.endContainer,this.eo=ye.endOffset;var pn=ye.commonAncestorContainer;this.sc===this.ec&&rt(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===pn&&!rt(this.sc)?this.sc.childNodes[this.so]:it(this.sc,pn,!0),this._last=this.ec===pn&&!rt(this.ec)?this.ec.childNodes[this.eo-1]:it(this.ec,pn,!0))}}Zn.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var ye=this._current=this._next;return ye&&(this._next=ye!==this._last?ye.nextSibling:null,rt(ye)&&this.clonePartiallySelectedTextNodes&&(ye===this.ec&&(ye=ye.cloneNode(!0)).deleteData(this.eo,ye.length-this.eo),this._current===this.sc&&(ye=ye.cloneNode(!0)).deleteData(0,this.so))),ye},remove:function(){var ye=this._current,ht,pn;rt(ye)&&(ye===this.sc||ye===this.ec)?(ht=ye===this.sc?this.so:0,pn=ye===this.ec?this.eo:ye.length,ht!=pn&&ye.deleteData(ht,pn-ht)):ye.parentNode&&q(ye)},isPartiallySelectedSubtree:function(){var ye=this._current;return kt(ye,this.range)},getSubtreeIterator:function(){var ye;if(this.isSingleCharacterDataNode)ye=this.range.cloneRange(),ye.collapse(!1);else{ye=new si(Rt(this.range));var ht=this._current,pn=ht,Rn=0,Cn=ht,nr=ae(ht);Lt(ht,this.sc)&&(pn=this.sc,Rn=this.so),Lt(ht,this.ec)&&(Cn=this.ec,nr=this.eo),so(ye,pn,Rn,Cn,nr)}return new Zn(ye,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var ao=[1,3,4,5,7,8,10],Lo=[2,9,11],_o=[5,6,10,12],ho=[1,3,4,5,7,8,10,11],Nn=[1,3,4,5,7,8];function qn(ye){return function(ht,pn){for(var Rn,Cn=pn?ht:ht.parentNode;Cn;){if(Rn=Cn.nodeType,re(ye,Rn))return Cn;Cn=Cn.parentNode}return null}}var rr=qn([9,11]),ut=qn(_o),gn=qn([6,10,12]),Fn=qn([1]);function sr(ye,ht){if(gn(ye,ht))throw new $e("INVALID_NODE_TYPE_ERR")}function wo(ye,ht){if(!re(ht,ye.nodeType))throw new $e("INVALID_NODE_TYPE_ERR")}function oo(ye,ht){if(ht<0||ht>(rt(ye)?ye.length:ye.childNodes.length))throw new $e("INDEX_SIZE_ERR")}function ta(ye,ht){if(rr(ye,!0)!==rr(ht,!0))throw new $e("WRONG_DOCUMENT_ERR")}function Ca(ye){if(ut(ye,!0))throw new $e("NO_MODIFICATION_ALLOWED_ERR")}function Yi(ye,ht){if(!ye)throw new $e(ht)}function fa(ye,ht){return ht<=(rt(ye)?ye.length:ye.childNodes.length)}function Ka(ye){return!!ye.startContainer&&!!ye.endContainer&&!(vt&&(pe.isBrokenNode(ye.startContainer)||pe.isBrokenNode(ye.endContainer)))&&je(ye.startContainer)==je(ye.endContainer)&&fa(ye.startContainer,ye.startOffset)&&fa(ye.endContainer,ye.endOffset)}function Sn(ye){if(!Ka(ye))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+ye.inspect()+")")}var Ts=document.createElement("style"),Oo=!1;try{Ts.innerHTML="<b>x</b>",Oo=Ts.firstChild.nodeType==3}catch{}le.features.htmlParsingConforms=Oo;var es=Oo?function(ye){var ht=this.startContainer,pn=Jt(ht);if(!ht)throw new $e("INVALID_STATE_ERR");var Rn=null;return ht.nodeType==1?Rn=ht:rt(ht)&&(Rn=pe.parentElement(ht)),Rn===null||Rn.nodeName=="HTML"&&pe.isHtmlNamespace(Jt(Rn).documentElement)&&pe.isHtmlNamespace(Rn)?Rn=pn.createElement("body"):Rn=Rn.cloneNode(!1),Rn.innerHTML=ye,pe.fragmentFromNodeChildren(Rn)}:function(ye){var ht=Rt(this),pn=ht.createElement("body");return pn.innerHTML=ye,pe.fragmentFromNodeChildren(pn)};function Ui(ye,ht){Sn(ye);var pn=ye.startContainer,Rn=ye.startOffset,Cn=ye.endContainer,nr=ye.endOffset,Mn=pn===Cn;rt(Cn)&&nr>0&&nr<Cn.length&&zt(Cn,nr,ht),rt(pn)&&Rn>0&&Rn<pn.length&&(pn=zt(pn,Rn,ht),Mn?(nr-=Rn,Cn=pn):Cn==pn.parentNode&&nr>=pt(pn)&&nr++,Rn=0),ye.setStartAndEnd(pn,Rn,Cn,nr)}function yr(ye){Sn(ye);var ht=ye.commonAncestorContainer.parentNode.cloneNode(!1);return ht.appendChild(ye.cloneContents()),ht.innerHTML}var ml=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],pa=0,qi=1,Na=2,al=3,yl=0,Cs=1,_l=2,ts=3;se.extend(le.rangePrototype,{compareBoundaryPoints:function(ye,ht){Sn(this),ta(this.startContainer,ht.startContainer);var pn,Rn,Cn,nr,Mn=ye==al||ye==pa?"start":"end",or=ye==qi||ye==pa?"start":"end";return pn=this[Mn+"Container"],Rn=this[Mn+"Offset"],Cn=ht[or+"Container"],nr=ht[or+"Offset"],en(pn,Rn,Cn,nr)},insertNode:function(ye){if(Sn(this),wo(ye,ho),Ca(this.startContainer),Lt(ye,this.startContainer))throw new $e("HIERARCHY_REQUEST_ERR");var ht=On(ye,this.startContainer,this.startOffset);this.setStartBefore(ht)},cloneContents:function(){Sn(this);var ye,ht;if(this.collapsed)return Rt(this).createDocumentFragment();if(this.startContainer===this.endContainer&&rt(this.startContainer))return ye=this.startContainer.cloneNode(!0),ye.data=ye.data.slice(this.startOffset,this.endOffset),ht=Rt(this).createDocumentFragment(),ht.appendChild(ye),ht;var pn=new Zn(this,!0);return ye=Ke(pn),pn.detach(),ye},canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var ye=new Zn(this,!0),ht=ye._first&&kt(ye._first,this)||ye._last&&kt(ye._last,this);return ye.detach(),!ht},surroundContents:function(ye){if(wo(ye,Nn),!this.canSurroundContents())throw new $e("INVALID_STATE_ERR");var ht=this.extractContents();if(ye.hasChildNodes())for(;ye.lastChild;)ye.removeChild(ye.lastChild);On(ye,this.startContainer,this.startOffset),ye.appendChild(ht),this.selectNode(ye)},cloneRange:function(){Sn(this);for(var ye=new si(Rt(this)),ht=ml.length,pn;ht--;)pn=ml[ht],ye[pn]=this[pn];return ye},toString:function(){Sn(this);var ye=this.startContainer;if(ye===this.endContainer&&rt(ye))return ye.nodeType==3||ye.nodeType==4?ye.data.slice(this.startOffset,this.endOffset):"";var ht=[],pn=new Zn(this,!0);return Le(pn,function(Rn){(Rn.nodeType==3||Rn.nodeType==4)&&ht.push(Rn.data)}),pn.detach(),ht.join("")},compareNode:function(ye){Sn(this);var ht=ye.parentNode,pn=pt(ye);if(!ht)throw new $e("NOT_FOUND_ERR");var Rn=this.comparePoint(ht,pn),Cn=this.comparePoint(ht,pn+1);return Rn<0?Cn>0?_l:yl:Cn>0?Cs:ts},comparePoint:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)<0?-1:en(ye,ht,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:es,toHtml:function(){return yr(this)},intersectsNode:function(ye,ht){if(Sn(this),je(ye)!=Gt(this))return!1;var pn=ye.parentNode,Rn=pt(ye);if(!pn)return!0;var Cn=en(pn,Rn,this.endContainer,this.endOffset),nr=en(pn,Rn+1,this.startContainer,this.startOffset);return ht?Cn<=0&&nr>=0:Cn<0&&nr>0},isPointInRange:function(ye,ht){return Sn(this),Yi(ye,"HIERARCHY_REQUEST_ERR"),ta(ye,this.startContainer),en(ye,ht,this.startContainer,this.startOffset)>=0&&en(ye,ht,this.endContainer,this.endOffset)<=0},intersectsRange:function(ye){return ke(this,ye,!1)},intersectsOrTouchesRange:function(ye){return ke(this,ye,!0)},intersection:function(ye){if(this.intersectsRange(ye)){var ht=en(this.startContainer,this.startOffset,ye.startContainer,ye.startOffset),pn=en(this.endContainer,this.endOffset,ye.endContainer,ye.endOffset),Rn=this.cloneRange();return ht==-1&&Rn.setStart(ye.startContainer,ye.startOffset),pn==1&&Rn.setEnd(ye.endContainer,ye.endOffset),Rn}return null},union:function(ye){if(this.intersectsOrTouchesRange(ye)){var ht=this.cloneRange();return en(ye.startContainer,ye.startOffset,this.startContainer,this.startOffset)==-1&&ht.setStart(ye.startContainer,ye.startOffset),en(ye.endContainer,ye.endOffset,this.endContainer,this.endOffset)==1&&ht.setEnd(ye.endContainer,ye.endOffset),ht}else throw new $e("Ranges do not intersect")},containsNode:function(ye,ht){return ht?this.intersectsNode(ye,!1):this.compareNode(ye)==ts},containsNodeContents:function(ye){return this.comparePoint(ye,0)>=0&&this.comparePoint(ye,ae(ye))<=0},containsRange:function(ye){var ht=this.intersection(ye);return ht!==null&&ye.equals(ht)},containsNodeText:function(ye){var ht=this.cloneRange();ht.selectNode(ye);var pn=ht.getNodes([3]);if(pn.length>0){ht.setStart(pn[0],0);var Rn=pn.pop();return ht.setEnd(Rn,Rn.length),this.containsRange(ht)}else return this.containsNodeContents(ye)},getNodes:function(ye,ht){return Sn(this),Tt(this,ye,ht)},getDocument:function(){return Rt(this)},collapseBefore:function(ye){this.setEndBefore(ye),this.collapse(!1)},collapseAfter:function(ye){this.setStartAfter(ye),this.collapse(!0)},getBookmark:function(ye){var ht=Rt(this),pn=le.createRange(ht);ye=ye||pe.getBody(ht),pn.selectNodeContents(ye);var Rn=this.intersection(pn),Cn=0,nr=0;return Rn&&(pn.setEnd(Rn.startContainer,Rn.startOffset),Cn=pn.toString().length,nr=Cn+Rn.toString().length),{start:Cn,end:nr,containerNode:ye}},moveToBookmark:function(ye){var ht=ye.containerNode,pn=0;this.setStart(ht,0),this.collapse(!0);for(var Rn=[ht],Cn,nr=!1,Mn=!1,or,lr,qr;!Mn&&(Cn=Rn.pop());)if(Cn.nodeType==3)or=pn+Cn.length,!nr&&ye.start>=pn&&ye.start<=or&&(this.setStart(Cn,ye.start-pn),nr=!0),nr&&ye.end>=pn&&ye.end<=or&&(this.setEnd(Cn,ye.end-pn),Mn=!0),pn=or;else for(qr=Cn.childNodes,lr=qr.length;lr--;)Rn.push(qr[lr])},getName:function(){return"DomRange"},equals:function(ye){return si.rangesEqual(this,ye)},isValid:function(){return Ka(this)},inspect:function(){return En(this)},detach:function(){}});function ve(ye){ye.START_TO_START=pa,ye.START_TO_END=qi,ye.END_TO_END=Na,ye.END_TO_START=al,ye.NODE_BEFORE=yl,ye.NODE_AFTER=Cs,ye.NODE_BEFORE_AND_AFTER=_l,ye.NODE_INSIDE=ts}function gt(ye){ve(ye),ve(ye.prototype)}function dn(ye,ht){return function(){Sn(this);var pn=this.startContainer,Rn=this.startOffset,Cn=this.commonAncestorContainer,nr=new Zn(this,!0),Mn,or;pn!==Cn&&(Mn=it(pn,Cn,!0),or=qt(Mn),pn=or.node,Rn=or.offset),Le(nr,Ca),nr.reset();var lr=ye(nr);return nr.detach(),ht(this,pn,Rn,pn,Rn),lr}}function Kn(ye,ht){function pn(Mn,or){return function(lr){wo(lr,ao),wo(je(lr),Lo);var qr=(Mn?Pn:qt)(lr);(or?Rn:Cn)(this,qr.node,qr.offset)}}function Rn(Mn,or,lr){var qr=Mn.endContainer,na=Mn.endOffset;(or!==Mn.startContainer||lr!==Mn.startOffset)&&((je(or)!=je(qr)||en(or,lr,qr,na)==1)&&(qr=or,na=lr),ht(Mn,or,lr,qr,na))}function Cn(Mn,or,lr){var qr=Mn.startContainer,na=Mn.startOffset;(or!==Mn.endContainer||lr!==Mn.endOffset)&&((je(or)!=je(qr)||en(or,lr,qr,na)==-1)&&(qr=or,na=lr),ht(Mn,qr,na,or,lr))}var nr=function(){};nr.prototype=le.rangePrototype,ye.prototype=new nr,se.extend(ye.prototype,{setStart:function(Mn,or){sr(Mn,!0),oo(Mn,or),Rn(this,Mn,or)},setEnd:function(Mn,or){sr(Mn,!0),oo(Mn,or),Cn(this,Mn,or)},setStartAndEnd:function(){var Mn=arguments,or=Mn[0],lr=Mn[1],qr=or,na=lr;switch(Mn.length){case 3:na=Mn[2];break;case 4:qr=Mn[2],na=Mn[3];break}sr(or,!0),oo(or,lr),sr(qr,!0),oo(qr,na),ht(this,or,lr,qr,na)},setBoundary:function(Mn,or,lr){this["set"+(lr?"Start":"End")](Mn,or)},setStartBefore:pn(!0,!0),setStartAfter:pn(!1,!0),setEndBefore:pn(!0,!1),setEndAfter:pn(!1,!1),collapse:function(Mn){Sn(this),Mn?ht(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):ht(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(Mn){sr(Mn,!0),ht(this,Mn,0,Mn,ae(Mn))},selectNode:function(Mn){sr(Mn,!1),wo(Mn,ao);var or=Pn(Mn),lr=qt(Mn);ht(this,or.node,or.offset,lr.node,lr.offset)},extractContents:dn(At,ht),deleteContents:dn(dt,ht),canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var Mn=new Zn(this,!0),or=Mn._first&&kt(Mn._first,this)||Mn._last&&kt(Mn._last,this);return Mn.detach(),!or},splitBoundaries:function(){Ui(this)},splitBoundariesPreservingPositions:function(Mn){Ui(this,Mn)},normalizeBoundaries:function(){Sn(this);var Mn=this.startContainer,or=this.startOffset,lr=this.endContainer,qr=this.endOffset,na=function(Ro){var La=Ro.nextSibling;La&&La.nodeType==Ro.nodeType&&(lr=Ro,qr=Ro.length,Ro.appendData(La.data),q(La))},vi=function(Ro){var La=Ro.previousSibling;if(La&&La.nodeType==Ro.nodeType){Mn=Ro;var id=Ro.length;if(or=La.length,Ro.insertData(0,La.data),q(La),Mn==lr)qr+=or,lr=Mn;else if(lr==Ro.parentNode){var _u=pt(Ro);qr==_u?(lr=Ro,qr=id):qr>_u&&qr--}}},bl=!0,Vi;if(rt(lr))qr==lr.length?na(lr):qr==0&&(Vi=lr.previousSibling,Vi&&Vi.nodeType==lr.nodeType&&(qr=Vi.length,Mn==lr&&(bl=!1),Vi.appendData(lr.data),q(lr),lr=Vi));else{if(qr>0){var Ns=lr.childNodes[qr-1];Ns&&rt(Ns)&&na(Ns)}bl=!this.collapsed}if(bl){if(rt(Mn))or==0?vi(Mn):or==Mn.length&&(Vi=Mn.nextSibling,Vi&&Vi.nodeType==Mn.nodeType&&(lr==Vi&&(lr=Mn,qr+=Mn.length),Mn.appendData(Vi.data),q(Vi)));else if(or<Mn.childNodes.length){var Fl=Mn.childNodes[or];Fl&&rt(Fl)&&vi(Fl)}}else Mn=lr,or=qr;ht(this,Mn,or,lr,qr)},collapseToPoint:function(Mn,or){sr(Mn,!0),oo(Mn,or),this.setStartAndEnd(Mn,or)},parentElement:function(){Sn(this);var Mn=this.commonAncestorContainer;return Mn?Fn(this.commonAncestorContainer,!0):null}}),gt(ye)}function br(ye){ye.collapsed=ye.startContainer===ye.endContainer&&ye.startOffset===ye.endOffset,ye.commonAncestorContainer=ye.collapsed?ye.startContainer:pe.getCommonAncestor(ye.startContainer,ye.endContainer)}function so(ye,ht,pn,Rn,Cn){ye.startContainer=ht,ye.startOffset=pn,ye.endContainer=Rn,ye.endOffset=Cn,ye.document=pe.getDocument(ht),br(ye)}function si(ye){so(this,ye,0,ye,0)}Kn(si,so),se.extend(si,{rangeProperties:ml,RangeIterator:Zn,copyComparisonConstants:gt,createPrototypeRange:Kn,inspect:En,toHtml:yr,getRangeDocument:Rt,rangesEqual:function(ye,ht){return ye.startContainer===ht.startContainer&&ye.startOffset===ht.startOffset&&ye.endContainer===ht.endContainer&&ye.endOffset===ht.endOffset}}),le.DomRange=si}),$.createCoreModule("WrappedRange",["DomRange"],function(le,Ze){var pe,se,we=le.dom,$e=le.util,rt=we.DomPosition,pt=le.DomRange,Lt=we.getBody,Jt=we.getContentDocument,en=we.isCharacterDataNode;if(le.features.implementsDomRange&&(function(){var q,kt=pt.rangeProperties;function Rt(At){for(var Tt=kt.length,En;Tt--;)En=kt[Tt],At[En]=At.nativeRange[En];At.collapsed=At.startContainer===At.endContainer&&At.startOffset===At.endOffset}function Gt(At,Tt,En,Zn,ao){var Lo=At.startContainer!==Tt||At.startOffset!=En,_o=At.endContainer!==Zn||At.endOffset!=ao,ho=!At.equals(At.nativeRange);(Lo||_o||ho)&&(At.setEnd(Zn,ao),At.setStart(Tt,En))}var Pn;pe=function(At){if(!At)throw Ze.createError("WrappedRange: Range must be specified");this.nativeRange=At,Rt(this)},pt.createPrototypeRange(pe,Gt),q=pe.prototype,q.selectNode=function(At){this.nativeRange.selectNode(At),Rt(this)},q.cloneContents=function(){return this.nativeRange.cloneContents()},q.surroundContents=function(At){this.nativeRange.surroundContents(At),Rt(this)},q.collapse=function(At){this.nativeRange.collapse(At),Rt(this)},q.cloneRange=function(){return new pe(this.nativeRange.cloneRange())},q.refresh=function(){Rt(this)},q.toString=function(){return this.nativeRange.toString()};var qt=document.createTextNode("test");Lt(document).appendChild(qt);var On=document.createRange();On.setStart(qt,0),On.setEnd(qt,0);try{On.setStart(qt,1),q.setStart=function(At,Tt){this.nativeRange.setStart(At,Tt),Rt(this)},q.setEnd=function(At,Tt){this.nativeRange.setEnd(At,Tt),Rt(this)},Pn=function(At){return function(Tt){this.nativeRange[At](Tt),Rt(this)}}}catch{q.setStart=function(Tt,En){try{this.nativeRange.setStart(Tt,En)}catch{this.nativeRange.setEnd(Tt,En),this.nativeRange.setStart(Tt,En)}Rt(this)},q.setEnd=function(Tt,En){try{this.nativeRange.setEnd(Tt,En)}catch{this.nativeRange.setStart(Tt,En),this.nativeRange.setEnd(Tt,En)}Rt(this)},Pn=function(Tt,En){return function(Zn){try{this.nativeRange[Tt](Zn)}catch{this.nativeRange[En](Zn),this.nativeRange[Tt](Zn)}Rt(this)}}}q.setStartBefore=Pn("setStartBefore","setEndBefore"),q.setStartAfter=Pn("setStartAfter","setEndAfter"),q.setEndBefore=Pn("setEndBefore","setStartBefore"),q.setEndAfter=Pn("setEndAfter","setStartAfter"),q.selectNodeContents=function(At){this.setStartAndEnd(At,0,we.getNodeLength(At))},On.selectNodeContents(qt),On.setEnd(qt,3);var ke=document.createRange();ke.selectNodeContents(qt),ke.setEnd(qt,4),ke.setStart(qt,2),On.compareBoundaryPoints(On.START_TO_END,ke)==-1&&On.compareBoundaryPoints(On.END_TO_START,ke)==1?q.compareBoundaryPoints=function(At,Tt){return Tt=Tt.nativeRange||Tt,At==Tt.START_TO_END?At=Tt.END_TO_START:At==Tt.END_TO_START&&(At=Tt.START_TO_END),this.nativeRange.compareBoundaryPoints(At,Tt)}:q.compareBoundaryPoints=function(At,Tt){return this.nativeRange.compareBoundaryPoints(At,Tt.nativeRange||Tt)};var Ke=document.createElement("div");Ke.innerHTML="123";var Le=Ke.firstChild,dt=Lt(document);dt.appendChild(Ke),On.setStart(Le,1),On.setEnd(Le,2),On.deleteContents(),Le.data=="13"&&(q.deleteContents=function(){this.nativeRange.deleteContents(),Rt(this)},q.extractContents=function(){var At=this.nativeRange.extractContents();return Rt(this),At}),dt.removeChild(Ke),dt=null,$e.isHostMethod(On,"createContextualFragment")&&(q.createContextualFragment=function(At){return this.nativeRange.createContextualFragment(At)}),Lt(document).removeChild(qt),q.getName=function(){return"WrappedRange"},le.WrappedRange=pe,le.createNativeRange=function(At){return At=Jt(At,Ze,"createNativeRange"),At.createRange()}})(),le.features.implementsTextRange){var zt=function(q){var kt=q.parentElement(),Rt=q.duplicate();Rt.collapse(!0);var Gt=Rt.parentElement();Rt=q.duplicate(),Rt.collapse(!1);var Pn=Rt.parentElement(),qt=Gt==Pn?Gt:we.getCommonAncestor(Gt,Pn);return qt==kt?qt:we.getCommonAncestor(kt,qt)},it=function(q){return q.compareEndPoints("StartToEnd",q)==0},ae=function(q,kt,Rt,Gt,Pn){var qt=q.duplicate();qt.collapse(Rt);var On=qt.parentElement();if(we.isOrIsAncestorOf(kt,On)||(On=kt),!On.canHaveHTML){var ke=new rt(On.parentNode,we.getNodeIndex(On));return{boundaryPosition:ke,nodeInfo:{nodeIndex:ke.offset,containerElement:ke.node}}}var Ke=we.getDocument(On).createElement("span");Ke.parentNode&&we.removeNode(Ke);for(var Le,dt=Rt?"StartToStart":"StartToEnd",At,Tt,En,Zn,ao=Pn&&Pn.containerElement==On?Pn.nodeIndex:0,Lo=On.childNodes.length,_o=Lo,ho=_o;ho==Lo?On.appendChild(Ke):On.insertBefore(Ke,On.childNodes[ho]),qt.moveToElementText(Ke),Le=qt.compareEndPoints(dt,q),!(Le==0||ao==_o);){if(Le==-1){if(_o==ao+1)break;ao=ho}else _o=_o==ao+1?ao:ho;ho=Math.floor((ao+_o)/2),On.removeChild(Ke)}if(Zn=Ke.nextSibling,Le==-1&&Zn&&en(Zn)){qt.setEndPoint(Rt?"EndToStart":"EndToEnd",q);var Nn;if(/[\r\n]/.test(Zn.data)){var qn=qt.duplicate(),rr=qn.text.replace(/\r\n/g,"\r").length;for(Nn=qn.moveStart("character",rr);(Le=qn.compareEndPoints("StartToEnd",qn))==-1;)Nn++,qn.moveStart("character",1)}else Nn=qt.text.length;En=new rt(Zn,Nn)}else At=(Gt||!Rt)&&Ke.previousSibling,Tt=(Gt||Rt)&&Ke.nextSibling,Tt&&en(Tt)?En=new rt(Tt,0):At&&en(At)?En=new rt(At,At.data.length):En=new rt(On,we.getNodeIndex(Ke));return we.removeNode(Ke),{boundaryPosition:En,nodeInfo:{nodeIndex:ho,containerElement:On}}},re=function(q,kt){var Rt,Gt,Pn=q.offset,qt=we.getDocument(q.node),On,ke,Ke=Lt(qt).createTextRange(),Le=en(q.node);return Le?(Rt=q.node,Gt=Rt.parentNode):(ke=q.node.childNodes,Rt=Pn<ke.length?ke[Pn]:null,Gt=q.node),On=qt.createElement("span"),On.innerHTML="&#feff;",Rt?Gt.insertBefore(On,Rt):Gt.appendChild(On),Ke.moveToElementText(On),Ke.collapse(!kt),Gt.removeChild(On),Le&&Ke[kt?"moveStart":"moveEnd"]("character",Pn),Ke};se=function(q){this.textRange=q,this.refresh()},se.prototype=new pt(document),se.prototype.refresh=function(){var q,kt,Rt,Gt=zt(this.textRange);it(this.textRange)?kt=q=ae(this.textRange,Gt,!0,!0).boundaryPosition:(Rt=ae(this.textRange,Gt,!0,!1),q=Rt.boundaryPosition,kt=ae(this.textRange,Gt,!1,!1,Rt.nodeInfo).boundaryPosition),this.setStart(q.node,q.offset),this.setEnd(kt.node,kt.offset)},se.prototype.getName=function(){return"WrappedTextRange"},pt.copyComparisonConstants(se);var je=function(q){if(q.collapsed)return re(new rt(q.startContainer,q.startOffset),!0);var kt=re(new rt(q.startContainer,q.startOffset),!0),Rt=re(new rt(q.endContainer,q.endOffset),!1),Gt=Lt(pt.getRangeDocument(q)).createTextRange();return Gt.setEndPoint("StartToStart",kt),Gt.setEndPoint("EndToEnd",Rt),Gt};if(se.rangeToTextRange=je,se.prototype.toTextRange=function(){return je(this)},le.WrappedTextRange=se,!le.features.implementsDomRange||le.config.preferTextRange){var vt=(function(q){return q("return this;")()})(Function);typeof vt.Range>"u"&&(vt.Range=se),le.createNativeRange=function(q){return q=Jt(q,Ze,"createNativeRange"),Lt(q).createTextRange()},le.WrappedRange=se}}le.createRange=function(q){return q=Jt(q,Ze,"createRange"),new le.WrappedRange(le.createNativeRange(q))},le.createRangyRange=function(q){return q=Jt(q,Ze,"createRangyRange"),new pt(q)},$e.createAliasForDeprecatedMethod(le,"createIframeRange","createRange"),$e.createAliasForDeprecatedMethod(le,"createIframeRangyRange","createRangyRange"),le.addShimListener(function(q){var kt=q.document;typeof kt.createRange>"u"&&(kt.createRange=function(){return le.createRange(kt)}),kt=q=null})}),$.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(le,Ze){le.config.checkSelectionRanges=!0;var pe="boolean",se="number",we=le.dom,$e=le.util,rt=$e.isHostMethod,pt=le.DomRange,Lt=le.WrappedRange,Jt=le.DOMException,en=we.DomPosition,zt,it,ae=le.features,re="Control",je=we.getDocument,vt=we.getBody,q=pt.rangesEqual;function kt(ve){return typeof ve=="string"?/^backward(s)?$/i.test(ve):!!ve}function Rt(ve,gt){if(ve){if(we.isWindow(ve))return ve;if(ve instanceof Sn)return ve.win;var dn=we.getContentDocument(ve,Ze,gt);return we.getWindow(dn)}else return window}function Gt(ve){return Rt(ve,"getWinSelection").getSelection()}function Pn(ve){return Rt(ve,"getDocSelection").document.selection}function qt(ve){var gt=!1;return ve.anchorNode&&(gt=we.comparePoints(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset)==1),gt}var On=rt(window,"getSelection"),ke=$e.isHostObject(document,"selection");ae.implementsWinGetSelection=On,ae.implementsDocSelection=ke;var Ke=ke&&(!On||le.config.preferTextRange);if(Ke)zt=Pn,le.isSelectionValid=function(ve){var gt=Rt(ve,"isSelectionValid").document,dn=gt.selection;return dn.type!="None"||je(dn.createRange().parentElement())==gt};else if(On)zt=Gt,le.isSelectionValid=function(){return!0};else return Ze.fail("Neither document.selection or window.getSelection() detected."),!1;le.getNativeSelection=zt;var Le=zt();if(!Le)return Ze.fail("Native selection was null (possibly issue 138?)"),!1;var dt=le.createNativeRange(document),At=vt(document),Tt=$e.areHostProperties(Le,["anchorNode","focusNode","anchorOffset","focusOffset"]);ae.selectionHasAnchorAndFocus=Tt;var En=rt(Le,"extend");ae.selectionHasExtend=En;var Zn=rt(Le,"setBaseAndExtent");ae.selectionHasSetBaseAndExtent=Zn;var ao=typeof Le.rangeCount==se;ae.selectionHasRangeCount=ao;var Lo=!1,_o=!0,ho=En?function(ve,gt){var dn=pt.getRangeDocument(gt),Kn=le.createRange(dn);Kn.collapseToPoint(gt.endContainer,gt.endOffset),ve.addRange(sr(Kn)),ve.extend(gt.startContainer,gt.startOffset)}:null;$e.areHostMethods(Le,["addRange","getRangeAt","removeAllRanges"])&&typeof Le.rangeCount==se&&ae.implementsDomRange&&(function(){var ve=window.getSelection();if(ve){for(var gt=ve.rangeCount,dn=gt>1,Kn=[],br=qt(ve),so=0;so<gt;++so)Kn[so]=ve.getRangeAt(so);var si=we.createTestElement(document,"",!1),ye=si.appendChild(document.createTextNode(" ")),ht=document.createRange();if(ht.setStart(ye,1),ht.collapse(!0),ve.removeAllRanges(),ve.addRange(ht),_o=ve.rangeCount==1,ve.removeAllRanges(),!dn){var pn=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(pn&&parseInt(pn[1])>=36)Lo=!1;else{var Rn=ht.cloneRange();ht.setStart(ye,0),Rn.setEnd(ye,3),Rn.setStart(ye,2),ve.addRange(ht),ve.addRange(Rn),Lo=ve.rangeCount==2}}for(we.removeNode(si),ve.removeAllRanges(),so=0;so<gt;++so)so==0&&br?ho?ho(ve,Kn[so]):(le.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),ve.addRange(Kn[so])):ve.addRange(Kn[so])}})(),ae.selectionSupportsMultipleRanges=Lo,ae.collapsedNonEditableSelectionsSupported=_o;var Nn=!1,qn;At&&rt(At,"createControlRange")&&(qn=At.createControlRange(),$e.areHostProperties(qn,["item","add"])&&(Nn=!0)),ae.implementsControlRange=Nn,Tt?it=function(ve){return ve.anchorNode===ve.focusNode&&ve.anchorOffset===ve.focusOffset}:it=function(ve){return ve.rangeCount?ve.getRangeAt(ve.rangeCount-1).collapsed:!1};function rr(ve,gt,dn){var Kn=dn?"end":"start",br=dn?"start":"end";ve.anchorNode=gt[Kn+"Container"],ve.anchorOffset=gt[Kn+"Offset"],ve.focusNode=gt[br+"Container"],ve.focusOffset=gt[br+"Offset"]}function ut(ve){var gt=ve.nativeSelection;ve.anchorNode=gt.anchorNode,ve.anchorOffset=gt.anchorOffset,ve.focusNode=gt.focusNode,ve.focusOffset=gt.focusOffset}function gn(ve){ve.anchorNode=ve.focusNode=null,ve.anchorOffset=ve.focusOffset=0,ve.rangeCount=0,ve.isCollapsed=!0,ve._ranges.length=0,Fn(ve)}function Fn(ve){ve.type=ve.rangeCount==0?"None":it(ve)?"Caret":"Range"}function sr(ve){var gt;return ve instanceof pt?(gt=le.createNativeRange(ve.getDocument()),gt.setEnd(ve.endContainer,ve.endOffset),gt.setStart(ve.startContainer,ve.startOffset)):ve instanceof Lt?gt=ve.nativeRange:ae.implementsDomRange&&ve instanceof we.getWindow(ve.startContainer).Range&&(gt=ve),gt}function wo(ve){if(!ve.length||ve[0].nodeType!=1)return!1;for(var gt=1,dn=ve.length;gt<dn;++gt)if(!we.isAncestorOf(ve[0],ve[gt]))return!1;return!0}function oo(ve){var gt=ve.getNodes();if(!wo(gt))throw Ze.createError("getSingleElementFromRange: range "+ve.inspect()+" did not consist of a single element");return gt[0]}function ta(ve){return!!ve&&typeof ve.text<"u"}function Ca(ve,gt){var dn=new Lt(gt);ve._ranges=[dn],rr(ve,dn,!1),ve.rangeCount=1,ve.isCollapsed=dn.collapsed,Fn(ve)}function Yi(ve){if(ve._ranges.length=0,ve.docSelection.type=="None")gn(ve);else{var gt=ve.docSelection.createRange();if(ta(gt))Ca(ve,gt);else{ve.rangeCount=gt.length;for(var dn,Kn=je(gt.item(0)),br=0;br<ve.rangeCount;++br)dn=le.createRange(Kn),dn.selectNode(gt.item(br)),ve._ranges.push(dn);ve.isCollapsed=ve.rangeCount==1&&ve._ranges[0].collapsed,rr(ve,ve._ranges[ve.rangeCount-1],!1),Fn(ve)}}}function fa(ve,gt){for(var dn=ve.docSelection.createRange(),Kn=oo(gt),br=je(dn.item(0)),so=vt(br).createControlRange(),si=0,ye=dn.length;si<ye;++si)so.add(dn.item(si));try{so.add(Kn)}catch{throw Ze.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}so.select(),Yi(ve)}var Ka;rt(Le,"getRangeAt")?Ka=function(ve,gt){try{return ve.getRangeAt(gt)}catch{return null}}:Tt&&(Ka=function(ve){var gt=je(ve.anchorNode),dn=le.createRange(gt);return dn.setStartAndEnd(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset),dn.collapsed!==this.isCollapsed&&dn.setStartAndEnd(ve.focusNode,ve.focusOffset,ve.anchorNode,ve.anchorOffset),dn});function Sn(ve,gt,dn){this.nativeSelection=ve,this.docSelection=gt,this._ranges=[],this.win=dn,this.refresh()}Sn.prototype=le.selectionPrototype;function Ts(ve){ve.win=ve.anchorNode=ve.focusNode=ve._ranges=null,ve.rangeCount=ve.anchorOffset=ve.focusOffset=0,ve.detached=!0,Fn(ve)}var Oo=[];function es(ve,gt){for(var dn=Oo.length,Kn,br;dn--;)if(Kn=Oo[dn],br=Kn.selection,gt=="deleteAll")Ts(br);else if(Kn.win==ve)return gt=="delete"?(Oo.splice(dn,1),!0):br;return gt=="deleteAll"&&(Oo.length=0),null}var Ui=function(ve){if(ve&&ve instanceof Sn)return ve.refresh(),ve;ve=Rt(ve,"getNativeSelection");var gt=es(ve),dn=zt(ve),Kn=ke?Pn(ve):null;return gt?(gt.nativeSelection=dn,gt.docSelection=Kn,gt.refresh()):(gt=new Sn(dn,Kn,ve),Oo.push({win:ve,selection:gt})),gt};le.getSelection=Ui,$e.createAliasForDeprecatedMethod(le,"getIframeSelection","getSelection");var yr=Sn.prototype;function ml(ve,gt){for(var dn=je(gt[0].startContainer),Kn=vt(dn).createControlRange(),br=0,so,si=gt.length;br<si;++br){so=oo(gt[br]);try{Kn.add(so)}catch{throw Ze.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}Kn.select(),Yi(ve)}if(!Ke&&Tt&&$e.areHostMethods(Le,["removeAllRanges","addRange"])){yr.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),gn(this)};var pa=function(ve,gt){ho(ve.nativeSelection,gt),ve.refresh()};ao?yr.addRange=function(ve,gt){if(Nn&&ke&&this.docSelection.type==re)fa(this,ve);else if(kt(gt)&&En)pa(this,ve);else{var dn;Lo?dn=this.rangeCount:(this.removeAllRanges(),dn=0);var Kn=sr(ve).cloneRange();try{this.nativeSelection.addRange(Kn)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==dn+1){if(le.config.checkSelectionRanges){var br=Ka(this.nativeSelection,this.rangeCount-1);br&&!q(br,ve)&&(ve=new Lt(br))}this._ranges[this.rangeCount-1]=ve,rr(this,ve,al(this.nativeSelection)),this.isCollapsed=it(this),Fn(this)}else this.refresh()}}:yr.addRange=function(ve,gt){kt(gt)&&En?pa(this,ve):(this.nativeSelection.addRange(sr(ve)),this.refresh())},yr.setRanges=function(ve){if(Nn&&ke&&ve.length>1)ml(this,ve);else{this.removeAllRanges();for(var gt=0,dn=ve.length;gt<dn;++gt)this.addRange(ve[gt])}}}else if(rt(Le,"empty")&&rt(dt,"select")&&Nn&&Ke)yr.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var ve;if(this.anchorNode)ve=je(this.anchorNode);else if(this.docSelection.type==re){var gt=this.docSelection.createRange();gt.length&&(ve=je(gt.item(0)))}if(ve){var dn=vt(ve).createTextRange();dn.select(),this.docSelection.empty()}}}catch{}gn(this)},yr.addRange=function(ve){this.docSelection.type==re?fa(this,ve):(le.WrappedTextRange.rangeToTextRange(ve).select(),this._ranges[0]=ve,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,rr(this,ve,!1),Fn(this))},yr.setRanges=function(ve){this.removeAllRanges();var gt=ve.length;gt>1?ml(this,ve):gt&&this.addRange(ve[0])};else return Ze.fail("No means of selecting a Range or TextRange was found"),!1;yr.getRangeAt=function(ve){if(ve<0||ve>=this.rangeCount)throw new Jt("INDEX_SIZE_ERR");return this._ranges[ve].cloneRange()};var qi;if(Ke)qi=function(ve){var gt;le.isSelectionValid(ve.win)?gt=ve.docSelection.createRange():(gt=vt(ve.win.document).createTextRange(),gt.collapse(!0)),ve.docSelection.type==re?Yi(ve):ta(gt)?Ca(ve,gt):gn(ve)};else if(rt(Le,"getRangeAt")&&typeof Le.rangeCount==se)qi=function(ve){if(Nn&&ke&&ve.docSelection.type==re)Yi(ve);else if(ve._ranges.length=ve.rangeCount=ve.nativeSelection.rangeCount,ve.rangeCount){for(var gt=0,dn=ve.rangeCount;gt<dn;++gt)ve._ranges[gt]=new le.WrappedRange(ve.nativeSelection.getRangeAt(gt));rr(ve,ve._ranges[ve.rangeCount-1],al(ve.nativeSelection)),ve.isCollapsed=it(ve),Fn(ve)}else gn(ve)};else if(Tt&&typeof Le.isCollapsed==pe&&typeof dt.collapsed==pe&&ae.implementsDomRange)qi=function(ve){var gt,dn=ve.nativeSelection;dn.anchorNode?(gt=Ka(dn,0),ve._ranges=[gt],ve.rangeCount=1,ut(ve),ve.isCollapsed=it(ve),Fn(ve)):gn(ve)};else return Ze.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;yr.refresh=function(ve){var gt=ve?this._ranges.slice(0):null,dn=this.anchorNode,Kn=this.anchorOffset;if(qi(this),ve){var br=gt.length;if(br!=this._ranges.length||this.anchorNode!=dn||this.anchorOffset!=Kn)return!0;for(;br--;)if(!q(gt[br],this._ranges[br]))return!0;return!1}};var Na=function(ve,gt){var dn=ve.getAllRanges();ve.removeAllRanges();for(var Kn=0,br=dn.length;Kn<br;++Kn)q(gt,dn[Kn])||ve.addRange(dn[Kn]);ve.rangeCount||gn(ve)};Nn&&ke?yr.removeRange=function(ve){if(this.docSelection.type==re){for(var gt=this.docSelection.createRange(),dn=oo(ve),Kn=je(gt.item(0)),br=vt(Kn).createControlRange(),so,si=!1,ye=0,ht=gt.length;ye<ht;++ye)so=gt.item(ye),so!==dn||si?br.add(gt.item(ye)):si=!0;br.select(),Yi(this)}else Na(this,ve)}:yr.removeRange=function(ve){Na(this,ve)};var al;!Ke&&Tt&&ae.implementsDomRange?(al=qt,yr.isBackward=function(){return al(this)}):al=yr.isBackward=function(){return!1},yr.isBackwards=yr.isBackward,yr.toString=function(){for(var ve=[],gt=0,dn=this.rangeCount;gt<dn;++gt)ve[gt]=""+this._ranges[gt];return ve.join("")};function yl(ve,gt){if(ve.win.document!=je(gt))throw new Jt("WRONG_DOCUMENT_ERR")}function Cs(ve,gt){if(gt<0||gt>(we.isCharacterDataNode(ve)?ve.length:ve.childNodes.length))throw new Jt("INDEX_SIZE_ERR")}yr.collapse=function(ve,gt){yl(this,ve);var dn=le.createRange(ve);dn.collapseToPoint(ve,gt),this.setSingleRange(dn),this.isCollapsed=!0},yr.collapseToStart=function(){if(this.rangeCount){var ve=this._ranges[0];this.collapse(ve.startContainer,ve.startOffset)}else throw new Jt("INVALID_STATE_ERR")},yr.collapseToEnd=function(){if(this.rangeCount){var ve=this._ranges[this.rangeCount-1];this.collapse(ve.endContainer,ve.endOffset)}else throw new Jt("INVALID_STATE_ERR")},yr.selectAllChildren=function(ve){yl(this,ve);var gt=le.createRange(ve);gt.selectNodeContents(ve),this.setSingleRange(gt)},Zn?yr.setBaseAndExtent=function(ve,gt,dn,Kn){this.nativeSelection.setBaseAndExtent(ve,gt,dn,Kn),this.refresh()}:En&&(yr.setBaseAndExtent=function(ve,gt,dn,Kn){Cs(ve,gt),Cs(dn,Kn),yl(this,ve),yl(this,dn);var br=le.createRange(node),so=we.comparePoints(ve,gt,dn,Kn)==-1;so?br.setStartAndEnd(dn,Kn,ve,gt):br.setStartAndEnd(ve,gt,dn,Kn),this.setSingleRange(br,so)}),yr.deleteFromDocument=function(){if(Nn&&ke&&this.docSelection.type==re){for(var ve=this.docSelection.createRange(),gt;ve.length;)gt=ve.item(0),ve.remove(gt),we.removeNode(gt);this.refresh()}else if(this.rangeCount){var dn=this.getAllRanges();if(dn.length){this.removeAllRanges();for(var Kn=0,br=dn.length;Kn<br;++Kn)dn[Kn].deleteContents();this.addRange(dn[br-1])}}},yr.eachRange=function(ve,gt){for(var dn=0,Kn=this._ranges.length;dn<Kn;++dn)if(ve(this.getRangeAt(dn)))return gt},yr.getAllRanges=function(){var ve=[];return this.eachRange(function(gt){ve.push(gt)}),ve},yr.setSingleRange=function(ve,gt){this.removeAllRanges(),this.addRange(ve,gt)},yr.callMethodOnEachRange=function(ve,gt){var dn=[];return this.eachRange(function(Kn){dn.push(Kn[ve].apply(Kn,gt||[]))}),dn};function _l(ve){return function(gt,dn){var Kn;this.rangeCount?(Kn=this.getRangeAt(0),Kn["set"+(ve?"Start":"End")](gt,dn)):(Kn=le.createRange(this.win.document),Kn.setStartAndEnd(gt,dn)),this.setSingleRange(Kn,this.isBackward())}}yr.setStart=_l(!0),yr.setEnd=_l(!1),le.rangePrototype.select=function(ve){Ui(this.getDocument()).setSingleRange(this,ve)},yr.changeEachRange=function(ve){var gt=[],dn=this.isBackward();this.eachRange(function(Kn){ve(Kn),gt.push(Kn)}),this.removeAllRanges(),dn&>.length==1?this.addRange(gt[0],"backward"):this.setRanges(gt)},yr.containsNode=function(ve,gt){return this.eachRange(function(dn){return dn.containsNode(ve,gt)},!0)||!1},yr.getBookmark=function(ve){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[ve])}},yr.moveToBookmark=function(ve){for(var gt=[],dn=0,Kn,br;Kn=ve.rangeBookmarks[dn++];)br=le.createRange(this.win),br.moveToBookmark(Kn),gt.push(br);ve.backward?this.setSingleRange(gt[0],"backward"):this.setRanges(gt)},yr.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},yr.restoreRanges=function(ve){this.removeAllRanges();for(var gt=0,dn;dn=ve.ranges[gt];++gt)this.addRange(dn,ve.backward&>==0)},yr.toHtml=function(){var ve=[];return this.eachRange(function(gt){ve.push(pt.toHtml(gt))}),ve.join("")},ae.implementsTextRange&&(yr.getNativeTextRange=function(){var ve;if(ve=this.docSelection){var gt=ve.createRange();if(ta(gt))return gt;throw Ze.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return le.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw Ze.createError("getNativeTextRange: selection contains no range")}});function ts(ve){var gt=[],dn=new en(ve.anchorNode,ve.anchorOffset),Kn=new en(ve.focusNode,ve.focusOffset),br=typeof ve.getName=="function"?ve.getName():"Selection";if(typeof ve.rangeCount<"u")for(var so=0,si=ve.rangeCount;so<si;++so)gt[so]=pt.inspect(ve.getRangeAt(so));return"["+br+"(Ranges: "+gt.join(", ")+")(anchor: "+dn.inspect()+", focus: "+Kn.inspect()+"]"}yr.getName=function(){return"WrappedSelection"},yr.inspect=function(){return ts(this)},yr.detach=function(){es(this.win,"delete"),Ts(this)},Sn.detachAll=function(){es(null,"deleteAll")},Sn.inspect=ts,Sn.isDirectionBackward=kt,le.Selection=Sn,le.selectionPrototype=yr,le.addShimListener(function(ve){typeof ve.getSelection>"u"&&(ve.getSelection=function(){return Ui(ve)}),ve=null})});var Je=!1,mt=function(le){Je||(Je=!0,!$.initialized&&$.config.autoInitialize&&J())};return R&&(document.readyState=="complete"?mt():(f(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",mt,!1),Y(window,"load",mt))),$})})(bS)),bS.exports}var Sne=JI();const wR=Z_(Sne);var wS={exports:{}},ER;function Ane(){return ER||(ER=1,(function(t,e){(function(n,o){t.exports=n(JI())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(o,r){var i=o.dom,a=i.DomPosition,s=i.arrayContains,l=o.util,f=l.forEach,h="span",v=l.isHostMethod(document,"createElementNS");function _(ae,re){for(var je in ae)if(ae.hasOwnProperty(je)&&re(je,ae[je])===!1)return!1;return!0}function E(ae){return ae.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function O(ae,re){return!!ae&&new RegExp("(?:^|\\s)"+re+"(?:\\s|$)").test(ae)}function w(ae,re){if(typeof ae.classList=="object")return ae.classList.contains(re);var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");return O(vt,re)}function S(ae,re){if(typeof ae.classList=="object")ae.classList.add(re);else{var je=typeof ae.className=="string",vt=je?ae.className:ae.getAttribute("class");vt?O(vt,re)||(vt+=" "+re):vt=re,je?ae.className=vt:ae.setAttribute("class",vt)}}var M=(function(){function ae(re,je,vt){return je&&vt?" ":""}return function(re,je){if(typeof re.classList=="object")re.classList.remove(je);else{var vt=typeof re.className=="string",q=vt?re.className:re.getAttribute("class");q=q.replace(new RegExp("(^|\\s)"+je+"(\\s|$)"),ae),vt?re.className=q:re.setAttribute("class",q)}}})();function T(ae){var re=typeof ae.className=="string";return re?ae.className:ae.getAttribute("class")}function B(ae){return ae&&ae.split(/\s+/).sort().join(" ")}function R(ae){return B(T(ae))}function P(ae,re){return R(ae)==R(re)}function $(ae,re){for(var je=re.split(/\s+/),vt=0,q=je.length;vt<q;++vt)if(!w(ae,E(je[vt])))return!1;return!0}function I(ae){var re=ae.parentNode;return re&&re.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(re.nodeName)}function F(ae,re,je,vt,q){var kt=ae.node,Rt=ae.offset,Gt=kt,Pn=Rt;kt==vt&&Rt>q&&++Pn,kt==re&&(Rt==je||Rt==je+1)&&(Gt=vt,Pn+=q-je),kt==re&&Rt>je+1&&--Pn,ae.node=Gt,ae.offset=Pn}function U(ae,re,je){ae.node==re&&ae.offset>je&&--ae.offset}function z(ae,re,je,vt){je==-1&&(je=re.childNodes.length);var q=ae.parentNode,kt=i.getNodeIndex(ae);f(vt,function(Rt){F(Rt,q,kt,re,je)}),re.childNodes.length==je?re.appendChild(ae):re.insertBefore(ae,re.childNodes[je])}function X(ae,re){var je=ae.parentNode,vt=i.getNodeIndex(ae);f(re,function(q){U(q,je,vt)}),i.removeNode(ae)}function Y(ae,re,je,vt,q){for(var kt,Rt=[];kt=ae.firstChild;)z(kt,re,je++,q),Rt.push(kt);return X(ae,q),Rt}function W(ae,re){return Y(ae,ae.parentNode,i.getNodeIndex(ae),!0,re)}function Q(ae,re){var je=ae.cloneRange();je.selectNodeContents(re);var vt=je.intersection(ae),q=vt?vt.toString():"";return q!=""}function J(ae){for(var re=ae.getNodes([3]),je=0,vt;(vt=re[je])&&!Q(ae,vt);)++je;for(var q=re.length-1;(vt=re[q])&&!Q(ae,vt);)--q;return re.slice(je,q+1)}function ie(ae,re){if(ae.attributes.length!=re.attributes.length)return!1;for(var je=0,vt=ae.attributes.length,q,kt,Rt;je<vt;++je)if(q=ae.attributes[je],Rt=q.name,Rt!="class"&&(kt=re.attributes.getNamedItem(Rt),q===null!=(kt===null)||q.specified!=kt.specified||q.specified&&q.nodeValue!==kt.nodeValue))return!1;return!0}function Se(ae,re){for(var je=0,vt=ae.attributes.length,q;je<vt;++je)if(q=ae.attributes[je].name,!(re&&s(re,q))&&ae.attributes[je].specified&&q!="class")return!0;return!1}var Ae=i.getComputedStyleProperty,Pe=(function(){var ae=document.createElement("div");return typeof ae.isContentEditable=="boolean"?function(re){return re&&re.nodeType==1&&re.isContentEditable}:function(re){return!re||re.nodeType!=1||re.contentEditable=="false"?!1:re.contentEditable=="true"||Pe(re.parentNode)}})();function De(ae){var re;return ae&&ae.nodeType==1&&((re=ae.parentNode)&&re.nodeType==9&&re.designMode=="on"||Pe(ae)&&!Pe(ae.parentNode))}function He(ae){return(Pe(ae)||ae.nodeType!=1&&Pe(ae.parentNode))&&!De(ae)}var Ye=/^inline(-block|-table)?$/i;function Be(ae){return ae&&ae.nodeType==1&&!Ye.test(Ae(ae,"display"))}var Je=/[^\r\n\t\f \u200B]/;function mt(ae){if(ae.data.length==0)return!0;if(Je.test(ae.data))return!1;var re=Ae(ae.parentNode,"whiteSpace");switch(re){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(ae.data))return!1}return Be(ae.previousSibling)||Be(ae.nextSibling)}function le(ae){var re=[],je,vt;for(je=0;vt=ae[je++];)re.push(new a(vt.startContainer,vt.startOffset),new a(vt.endContainer,vt.endOffset));return re}function Ze(ae,re){for(var je=0,vt,q,kt,Rt=ae.length;je<Rt;++je)vt=ae[je],q=re[je*2],kt=re[je*2+1],vt.setStartAndEnd(q.node,q.offset,kt.node,kt.offset)}function pe(ae,re){return i.isCharacterDataNode(ae)?re==0?!!ae.previousSibling:re==ae.length?!!ae.nextSibling:!0:re>0&&re<ae.childNodes.length}function se(ae,re,je,vt){var q,kt,Rt=je==0;if(i.isAncestorOf(re,ae))return ae;if(i.isCharacterDataNode(re)){var Gt=i.getNodeIndex(re);if(je==0)je=Gt;else if(je==re.length)je=Gt+1;else throw r.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+je+" in "+re.data);re=re.parentNode}if(pe(re,je)){q=re.cloneNode(!1),kt=re.parentNode,q.id&&q.removeAttribute("id");for(var Pn,qt=0;Pn=re.childNodes[je];)z(Pn,q,qt++,vt);return z(q,kt,i.getNodeIndex(re)+1,vt),re==ae?q:se(ae,kt,i.getNodeIndex(q),vt)}else if(ae!=re){q=re.parentNode;var On=i.getNodeIndex(re);return Rt||On++,se(ae,q,On,vt)}return ae}function we(ae,re){return ae.namespaceURI==re.namespaceURI&&ae.tagName.toLowerCase()==re.tagName.toLowerCase()&&P(ae,re)&&ie(ae,re)&&Ae(ae,"display")=="inline"&&Ae(re,"display")=="inline"}function $e(ae){var re=ae?"nextSibling":"previousSibling";return function(je,vt){var q=je.parentNode,kt=je[re];if(kt){if(kt&&kt.nodeType==3)return kt}else if(vt&&(kt=q[re],kt&&kt.nodeType==1&&we(q,kt))){var Rt=kt[ae?"firstChild":"lastChild"];if(Rt&&Rt.nodeType==3)return Rt}return null}}var rt=$e(!1),pt=$e(!0);function Lt(ae){this.isElementMerge=ae.nodeType==1,this.textNodes=[];var re=this.isElementMerge?ae.lastChild:ae;re&&(this.textNodes[0]=re)}Lt.prototype={doMerge:function(ae){var re=this.textNodes,je=re[0];if(re.length>1){var vt=i.getNodeIndex(je),q=[],kt=0,Rt;f(re,function(Gt,Pn){Rt=Gt.parentNode,Pn>0&&(Rt.removeChild(Gt),Rt.hasChildNodes()||i.removeNode(Rt),ae&&f(ae,function(qt){qt.node==Gt&&(qt.node=je,qt.offset+=kt),qt.node==Rt&&qt.offset>vt&&(--qt.offset,qt.offset==vt+1&&Pn<re.length-1&&(qt.node=je,qt.offset=kt))})),q[Pn]=Gt.data,kt+=Gt.data.length}),je.data=q.join("")}return je.data},getLength:function(){for(var ae=this.textNodes.length,re=0;ae--;)re+=this.textNodes[ae].length;return re},toString:function(){var ae=[];return f(this.textNodes,function(re,je){ae[je]="'"+re.data+"'"}),"[Merge("+ae.join(",")+")]"}};var Jt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],en={};function zt(ae,re,je){var vt,q,kt,Rt,Gt=this;Gt.cssClass=Gt.className=ae;var Pn=null,qt={};if(typeof re=="object"&&re!==null){for(typeof re.elementTagName<"u"&&(re.elementTagName=re.elementTagName.toLowerCase()),je=re.tagNames,Pn=re.elementProperties,qt=re.elementAttributes,q=0;Rt=Jt[q++];)re.hasOwnProperty(Rt)&&(Gt[Rt]=re[Rt]);vt=re.normalize}else vt=re;Gt.normalize=typeof vt>"u"?!0:vt,Gt.attrExceptions=[];var On=document.createElement(Gt.elementTagName);Gt.elementProperties=Gt.copyPropertiesToElement(Pn,On,!0),_(qt,function(Ke,Le){Gt.attrExceptions.push(Ke),qt[Ke]=""+Le}),Gt.elementAttributes=qt,Gt.elementSortedClassName=Gt.elementProperties.hasOwnProperty("className")?B(Gt.elementProperties.className+" "+ae):ae,Gt.applyToAnyTagName=!1;var ke=typeof je;if(ke=="string")je=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames=E(je.toLowerCase()).split(/\s*,\s*/);else if(ke=="object"&&typeof je.length=="number")for(Gt.tagNames=[],q=0,kt=je.length;q<kt;++q)je[q]=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames.push(je[q].toLowerCase());else Gt.tagNames=[Gt.elementTagName]}zt.prototype={elementTagName:h,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(ae,re,je){var vt,q,kt={},Rt,Gt,Pn,qt;for(var On in ae)if(ae.hasOwnProperty(On))if(Gt=ae[On],Pn=re[On],On=="className")S(re,Gt),S(re,this.className),re[On]=B(re[On]),je&&(kt[On]=Gt);else if(On=="style"){q=Pn,je&&(kt[On]=Rt={});for(vt in ae[On])ae[On].hasOwnProperty(vt)&&(q[vt]=Gt[vt],je&&(Rt[vt]=q[vt]));this.attrExceptions.push(On)}else re[On]=Gt,je&&(kt[On]=re[On],qt=en.hasOwnProperty(On)?en[On]:On,this.attrExceptions.push(qt));return je?kt:""},copyAttributesToElement:function(ae,re){for(var je in ae)ae.hasOwnProperty(je)&&!/^class(?:Name)?$/i.test(je)&&re.setAttribute(je,ae[je])},appliesToElement:function(ae){return s(this.tagNames,ae.tagName.toLowerCase())},getEmptyElements:function(ae){var re=this;return ae.getNodes([1],function(je){return re.appliesToElement(je)&&!je.hasChildNodes()})},hasClass:function(ae){return ae.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(ae))&&w(ae,this.className)},getSelfOrAncestorWithClass:function(ae){for(;ae;){if(this.hasClass(ae))return ae;ae=ae.parentNode}return null},isModifiable:function(ae){return!this.applyToEditableOnly||He(ae)},isIgnorableWhiteSpaceNode:function(ae){return this.ignoreWhiteSpace&&ae&&ae.nodeType==3&&mt(ae)},postApply:function(ae,re,je,vt){var q=ae[0],kt=ae[ae.length-1],Rt=[],Gt,Pn=q,qt=kt,On=0,ke=kt.length,Ke;f(ae,function(Tt){Ke=rt(Tt,!vt),Ke?(Gt||(Gt=new Lt(Ke),Rt.push(Gt)),Gt.textNodes.push(Tt),Tt===q&&(Pn=Gt.textNodes[0],On=Pn.length),Tt===kt&&(qt=Gt.textNodes[0],ke=Gt.getLength())):Gt=null});var Le=pt(kt,!vt);if(Le&&(Gt||(Gt=new Lt(kt),Rt.push(Gt)),Gt.textNodes.push(Le)),Rt.length){for(var dt=0,At=Rt.length;dt<At;++dt)Rt[dt].doMerge(je);re.setStartAndEnd(Pn,On,qt,ke)}},createContainer:function(ae){var re=i.getDocument(ae),je=v&&!i.isHtmlNamespace(ae)&&ae.namespaceURI?re.createElementNS(ae.namespaceURI,this.elementTagName):re.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,je,!1),this.copyAttributesToElement(this.elementAttributes,je),S(je,this.className),this.onElementCreate&&this.onElementCreate(je,this),je},elementHasProperties:function(ae,re){var je=this;return _(re,function(vt,q){if(vt=="className")return $(ae,q);if(typeof q=="object"){if(!je.elementHasProperties(ae[vt],q))return!1}else if(ae[vt]!==q)return!1})},elementHasAttributes:function(ae,re){return _(re,function(je,vt){if(ae.getAttribute(je)!==vt)return!1})},applyToTextNode:function(ae,re){if(I(ae)){var je=ae.parentNode;if(je.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(je)&&this.elementHasProperties(je,this.elementProperties)&&this.elementHasAttributes(je,this.elementAttributes))S(je,this.className);else{var vt=ae.parentNode,q=this.createContainer(vt);vt.insertBefore(q,ae),q.appendChild(ae)}}},isRemovable:function(ae){return ae.tagName.toLowerCase()==this.elementTagName&&R(ae)==this.elementSortedClassName&&this.elementHasProperties(ae,this.elementProperties)&&!Se(ae,this.attrExceptions)&&this.elementHasAttributes(ae,this.elementAttributes)&&this.isModifiable(ae)},isEmptyContainer:function(ae){var re=ae.childNodes.length;return ae.nodeType==1&&this.isRemovable(ae)&&(re==0||re==1&&this.isEmptyContainer(ae.firstChild))},removeEmptyContainers:function(ae){var re=this,je=ae.getNodes([1],function(kt){return re.isEmptyContainer(kt)}),vt=[ae],q=le(vt);f(je,function(kt){X(kt,q)}),Ze(vt,q)},undoToTextNode:function(ae,re,je,vt){if(!re.containsNode(je)){var q=re.cloneRange();q.selectNode(je),q.isPointInRange(re.endContainer,re.endOffset)&&(se(je,re.endContainer,re.endOffset,vt),re.setEndAfter(je)),q.isPointInRange(re.startContainer,re.startOffset)&&(je=se(je,re.startContainer,re.startOffset,vt))}this.isRemovable(je)?W(je,vt):M(je,this.className)},splitAncestorWithClass:function(ae,re,je){var vt=this.getSelfOrAncestorWithClass(ae);vt&&se(vt,ae,re,je)},undoToAncestor:function(ae,re){this.isRemovable(ae)?W(ae,re):M(ae,this.className)},applyToRange:function(ae,re){var je=this;re=re||[];var vt=le(re||[]);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae);var q=J(ae);if(q.length){f(q,function(Gt){!je.isIgnorableWhiteSpaceNode(Gt)&&!je.getSelfOrAncestorWithClass(Gt)&&je.isModifiable(Gt)&&je.applyToTextNode(Gt,vt)});var kt=q[q.length-1];ae.setStartAndEnd(q[0],0,kt,kt.length),je.normalize&&je.postApply(q,ae,vt,!1),Ze(re,vt)}var Rt=je.getEmptyElements(ae);f(Rt,function(Gt){S(Gt,je.className)})},applyToRanges:function(ae){for(var re=ae.length;re--;)this.applyToRange(ae[re],ae);return ae},applyToSelection:function(ae){var re=o.getSelection(ae);re.setRanges(this.applyToRanges(re.getAllRanges()))},undoToRange:function(ae,re){var je=this;re=re||[];var vt=le(re);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae,vt);var q=J(ae),kt,Rt,Gt=q[q.length-1];if(q.length){je.splitAncestorWithClass(ae.endContainer,ae.endOffset,vt),je.splitAncestorWithClass(ae.startContainer,ae.startOffset,vt);for(var Pn=0,qt=q.length;Pn<qt;++Pn)kt=q[Pn],Rt=je.getSelfOrAncestorWithClass(kt),Rt&&je.isModifiable(kt)&&je.undoToAncestor(Rt,vt);ae.setStartAndEnd(q[0],0,Gt,Gt.length),je.normalize&&je.postApply(q,ae,vt,!0),Ze(re,vt)}var On=je.getEmptyElements(ae);f(On,function(ke){M(ke,je.className)})},undoToRanges:function(ae){for(var re=ae.length;re--;)this.undoToRange(ae[re],ae);return ae},undoToSelection:function(ae){var re=o.getSelection(ae),je=o.getSelection(ae).getAllRanges();this.undoToRanges(je),re.setRanges(je)},isAppliedToRange:function(ae){if(ae.collapsed||ae.toString()=="")return!!this.getSelfOrAncestorWithClass(ae.commonAncestorContainer);var re=ae.getNodes([3]);if(re.length){for(var je=0,vt;vt=re[je++];)if(!this.isIgnorableWhiteSpaceNode(vt)&&Q(ae,vt)&&this.isModifiable(vt)&&!this.getSelfOrAncestorWithClass(vt))return!1}return!0},isAppliedToRanges:function(ae){var re=ae.length;if(re==0)return!1;for(;re--;)if(!this.isAppliedToRange(ae[re]))return!1;return!0},isAppliedToSelection:function(ae){var re=o.getSelection(ae);return this.isAppliedToRanges(re.getAllRanges())},toggleRange:function(ae){this.isAppliedToRange(ae)?this.undoToRange(ae):this.applyToRange(ae)},toggleSelection:function(ae){this.isAppliedToSelection(ae)?this.undoToSelection(ae):this.applyToSelection(ae)},getElementsWithClassIntersectingRange:function(ae){var re=[],je=this;return ae.getNodes([3],function(vt){var q=je.getSelfOrAncestorWithClass(vt);q&&!s(re,q)&&re.push(q)}),re},detach:function(){}};function it(ae,re,je){return new zt(ae,re,je)}zt.util={hasClass:w,addClass:S,removeClass:M,getClass:T,hasSameClasses:P,hasAllClasses:$,replaceWithOwnChildren:W,elementsHaveSameNonClassAttributes:ie,elementHasNonClassAttributes:Se,splitNodeAt:se,isEditableElement:Pe,isEditingHost:De,isEditable:He},o.CssClassApplier=o.ClassApplier=zt,o.createClassApplier=it,l.createAliasForDeprecatedMethod(o,"createCssClassApplier","createClassApplier",r)}),n})})(wS)),wS.exports}Ane();var xR={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function OR(t){var e,n,o=((e=t==null?void 0:t.extensions)===null||e===void 0?void 0:e.button)||((n=t==null?void 0:t.extensions)===null||n===void 0?void 0:n.button),r=(t==null?void 0:t.Extension)||(t==null?void 0:t.Extension),i=o||r;return i?i.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{wR.init()}catch{console.error("rangy.init failed")}try{(l=(s=o==null?void 0:o.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new ZI({parent:this.button||void 0,color:"#000",onDone:function(f){var h,v,_,E,O;try{a.coloredText&&(!((v=(h=a.coloredText).isAppliedToSelection)===null||v===void 0)&&v.call(h))&&a.coloredText.undoToSelection(),a.coloredText=wR.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:f.hex}},normalize:!0}),a.coloredText.toggleSelection(),(E=(_=a.base)===null||_===void 0?void 0:_.checkContentChanged)===null||E===void 0||E.call(_),(O=a.setInactive)===null||O===void 0||O.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),(function(){function a(){}return a})())}var Mne=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Tne=function(t,e,n,o){var r=arguments.length,i=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(r<3?a(i):r>3?a(e,n,i):a(e,n))||i);return r>3&&i&&Object.defineProperty(e,n,i),i},SR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},AR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};(function(t){Mne(e,t);function e(n){var o=t.call(this,n)||this;o.labelMap=new Map;var r=n.lf,i=n.graphModel;return o.lf=r,o.graphModel=i,o.state={tick:0},o}return e.prototype.componentDidMount=function(){var n=this,o=this.props.graphModel;this.editor=new D0(".lf-label-editor",Yv(xR,{autoLink:!0,extensions:{colorPicker:new(OR(D0))}})),o.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),o.eventCenter.on("node:properties-change,node:properties-delete",function(){n.setState({tick:n.state.tick+1})})},e.prototype.componentDidUpdate=function(){var n;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new D0(".lf-label-editor",Yv(xR,{autoLink:!0,extensions:{colorPicker:new(OR(D0))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,o=this.props,r=o.lf.extension,i=o.graphModel,a=AR(AR([],SR(i.nodes),!1),SR(i.edges),!1),s=r.label;if(s){var l=[];return ri(a,function(f){var h,v,_=f.getData(),E=(v=(h=_.properties)===null||h===void 0?void 0:h._label)!==null&&v!==void 0?v:[];ri(E,function(O){var w=n.labelMap,S=new vne(O,f,i);w.set(S.id,S),l.push($t(pne,{label:S,element:f,graphModel:i},S.id))})}),l}return null},e.prototype.render=function(){return $t("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=Tne([xs],e),e})(ko);var MR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},TR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},Cne=(function(){function t(e){var n=e.lf,o=e.options,r=this,i;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;r.handleMouseDown(s)},this.draw=function(a){var s=r.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,f=s.y;if(r.endPoint={x:l,y:f},r.startPoint){var h=r.startPoint,v=h.x,_=h.y,E=v,O=_,w=l-v,S=f-_;l<v&&(E=l,w=v-l),f<_&&(O=f,S=_-f),r.wrapper&&(r.wrapper.style.left="".concat(E,"px"),r.wrapper.style.top="".concat(O,"px"),r.wrapper.style.width="".concat(w,"px"),r.wrapper.style.height="".concat(S,"px"))}},this.drawOff=function(a){if(r.lf.updateEditConfig({stopMoveGraph:r.originalStopMoveGraph}),r.originStatusSaved=!1,r.mouseDownInfo){var s=r.mouseDownInfo,l=s.x,f=s.y,h=s.time,v=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-f)<5&&Date.now()-h<200;if(v){r.lf.clearSelectElements(),r.cleanupSelectionState();return}}var _=to(r.startPoint),E=to(r.endPoint);if(document.removeEventListener("mousemove",r.draw),r.exclusiveMode||document.removeEventListener("mouseup",r.drawOff),_&&E){var l=_.x,f=_.y,O=E.x,w=E.y,S=[Math.min(l,O),Math.min(f,w)],M=[Math.max(l,O),Math.max(f,w)];if(r.lf.emit("selection:selected-area",{topLeft:S,bottomRight:M}),Math.abs(O-l)<10&&Math.abs(w-f)<10){r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0);return}var T=r.lf.graphModel.getAreaElement(S,M,r.isWholeEdge,r.isWholeNode,!0),B=r.lf.graphModel,R=B.dynamicGroup,P=B.group,$=[],I=r.lf.getSelectElements(),F=new Set(TR(TR([],MR(I.nodes.map(function(X){return X.id})),!1),MR(I.edges.map(function(X){return X.id})),!1));T.forEach(function(X){if(P){var Y=P.getNodeGroup(X.id);if(T.includes(Y))return}if(R){var Y=R.getGroupByNodeId(X.id);if(T.includes(Y))return}if(r.exclusiveMode&&F.has(X.id)){r.lf.deselectElementById(X.id);return}r.lf.selectElementById(X.id,!0),$.push(X)}),r.startPoint=void 0,r.endPoint=void 0,$.length>0&&r.lf.emit("selection:drop",{e:a}),r.lf.emit("selection:selected",{elements:$,leftTopPoint:S,rightBottomPoint:M})}r.wrapper&&(r.wrapper.oncontextmenu=null,r.container&&r.wrapper.parentNode===r.container&&r.container.removeChild(r.wrapper),r.wrapper=void 0)},this.lf=n,this.exclusiveMode=(i=o==null?void 0:o.exclusiveMode)!==null&&i!==void 0?i:!1,n.openSelectionSelect=function(){r.openSelectionSelect()},n.closeSelectionSelect=function(){r.closeSelectionSelect()},n.setSelectionSelectMode=function(a){r.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return t.prototype.render=function(e,n){this.container=n},t.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("mousemove",this.draw),document.removeEventListener("mouseup",this.drawOff)},t.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},t.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.addEventListener("mousedown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},t.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("mousedown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},t.prototype.handleMouseDown=function(e){var n;if(!(!this.container||this.disabled)){var o=e.button===2;if(!o){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var r=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,i=r.x,a=r.y;this.startPoint={x:i,y:a},this.endPoint={x:i,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(f){f.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(s),this.wrapper=s,document.addEventListener("mousemove",this.draw),document.addEventListener("mouseup",this.drawOff)}}},t.prototype.setSelectionSense=function(e,n){e===void 0&&(e=!0),n===void 0&&(n=!0),this.isWholeEdge=e,this.isWholeNode=n},t.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},t.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=to(this.endPoint),n=new MouseEvent("mouseup",{clientX:e.x,clientY:e.y});this.drawOff(n)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t})();var QI=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),Em=function(){return Em=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},Em.apply(this,arguments)},v_=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Nne={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function kne(t){for(var e=t,n=1;n<e.length-1;){var o=v_(e[n-1],2),r=o[0],i=o[1],a=v_(e[n],2),s=a[0],l=a[1],f=v_(e[n+1],2),h=f[0],v=f[1];r===s&&s===h||i===l&&l===v?e.splice(n,1):n++}return e}function Pne(t,e,n,o){var r=[t[0],t[1]],i=[t[0],t[1]];switch(n){case"tl":return e==="tr"?(r[1]+=o,i[0]+=o):e==="lb"&&(r[0]+=o,i[1]+=o),[r,i];case"tr":return e==="tl"?(r[1]+=o,i[0]-=o):e==="rb"&&(r[0]-=o,i[1]+=o),[r,i];case"bl":return e==="br"?(r[1]-=o,i[0]+=o):e==="lt"&&(r[0]+=o,i[1]-=o),[r,i];case"br":return e==="bl"?(r[1]-=o,i[0]-=o):e==="rt"&&(r[0]-=o,i[1]-=o),[r,i];default:return[]}}function Rne(t,e,n,o){var r,i=1,a=function(S,M){var T=M[0]-S[0],B=M[1]-S[1],R=Math.abs(T),P=Math.abs(B);return P<=i&&R>i?T<0?"l":"r":R<=i&&P>i?B<0?"t":"b":R<=i&&P<=i?"":R<P?T<0?"l":"r":B<0?"t":"b"},s=a(t,e),l=a(e,n),f=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,o)||1/5*o,h="".concat(s).concat(l),v=Nne[h]||"-",_="";if(v==="-")_+="L ".concat(e[0]," ").concat(e[1]);else{var E=v_(Pne(e,h,v,f),2),O=E[0],w=E[1];O&&w&&(_+="L ".concat(O[0]," ").concat(O[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(w[0]," ").concat(w[1]),r=v_(w,2),e[0]=r[0],e[1]=r[1])}return _}function Dne(t,e){var n=0,o="";if(t.length===2)o+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(o+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){var r=t[n-1],i=t[n],a=t[n+++1];o+=Rne(r,i,a,e)}o+="L ".concat(t[n][0]," ").concat(t[n][1])}return o}(function(t){QI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getEdge=function(){var n=this.props.model,o=n.points,r=n.isAnimation,i=n.arrowConfig,a=n.radius,s=a===void 0?5:a,l=n.getEdgeStyle(),f=n.getEdgeAnimationStyle(),h=kne(o.split(" ").map(function(E){return E.split(",").map(function(O){return+O})})),v=Dne(h,s),_=Em(Em(Em({style:r?f:{}},l),i),{fill:"none"});return Lr("path",Em({d:v},_))},e})($_);(function(t){QI(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(F_);var e8=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),u1=function(){return u1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},u1.apply(this,arguments)},CR=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var o=n.call(t),r,i=[],a;try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},NR=function(t,e,n){if(n||arguments.length===2)for(var o=0,r=e.length,i;o<r;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))},jne=(function(t){e8(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.id,r=n.x,i=n.y,a=n.width,s=n.height,l=n.properties,f=this.props.model.getNodeStyle();return Lr("svg",{x:r-a/2,y:i-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?Lr("text",{x:0,y:-5,fontSize:"16px",fill:f.stroke},l.labelText):"",l.disabledDelete?"":Lr("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:f.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,o)},"x")])},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.id,l=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",u1(u1({},l),{x:o-i/2,y:r-a/2,width:i,height:a,id:s})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var o=this.props.graphModel;o.deleteNode(n)},e})(zw),Lne=(function(t){e8(e,t);function e(){var n=t.apply(this,NR([],CR(arguments),!1))||this;return n.d=10,n.isResize=!1,n}return e.prototype.initNodeData=function(n){n.text={value:"",x:n.x,y:n.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,n),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var n=this,o;this.points=[],((o=this.properties)===null||o===void 0?void 0:o.node_selection_ids).length>1&&setTimeout(function(){var r;n.updatePointsByNodes(((r=n.properties)===null||r===void 0?void 0:r.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var n=t.prototype.getNodeStyle.call(this);return n.stroke=this.properties.strokeColor||"#008000",n.strokeDasharray="10 5",n},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(n){this.points=n},e.prototype.updateCoordinate=function(n){var o=n.x,r=n.y;this.x=o,this.y=r},e.prototype.updatePointsByNodes=function(n){var o=this,r=[],i=1/0,a=1/0,s=-1/0,l=-1/0;n.forEach(function(f){var h=o.graphModel.getNodeModelById(f);if(h){var v=h.width,_=h.height,E=h.x,O=h.y;i=Math.min(i,E-v/2-o.d),a=Math.min(a,O-_/2-o.d),s=Math.max(s,E+v/2+o.d),l=Math.max(l,O+_/2+o.d)}}),r.push([i,a],[s,a],[s,l],[i,l]),![i,a,s,l].some(function(f){return Math.abs(f)===1/0})&&(this.updatePoints(r),this.updateCoordinate({x:(s+i)/2,y:(l+a)/2}))},e.prototype.resize=function(n){var o;this.isResize=!0;for(var r=n.width,i=n.height,a={x:r/this.width,y:i/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],f=new Set;s.length;){var h=s.shift(),v=(o=this.graphModel.nodesMap[h])===null||o===void 0?void 0:o.model;if(v){if(!ew(v)){l.push(v);continue}f.has(v.id)||(f.add(v.id),s.push.apply(s,NR([],CR(v.properties.node_selection_ids||[]),!1)))}}var _={x:this.x-this.width/2,y:this.y-this.height/2},E=t.prototype.resize.call(this,n),O={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(w){w.width=w.width*a.x,w.height=w.height*a.y;var S=(w.x-_.x)*a.x+O.x-w.x,M=(w.y-_.y)*a.y+O.y-w.y;w.move(S,M,!0)}),this.isResize=!1,E},e})(Uw),g2="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:g2,view:jne,model:Lne})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var e,n=this.getNodeSelection();n&&(this.lf.setProperties(n.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(n.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var e=this,n=this.selectNodesIds,o=this.lf.getGraphRawData(),r=n.filter(function(i){return i!==e.currentClickNode.id});return o.nodes.find(function(i){if(i.type==="node-selection"){var a=og(i,"properties.node_selection_ids",[]);return r.every(function(s){return a.includes(s)})}return!1})},t.prototype.onNodeChange=function(e,n){var o=e.graphModel.nodes.filter(function(r){if(!ew(r))return!1;var i=r.properties.node_selection_ids||[];return i.includes(n.id)});Promise.resolve().then(function(){o.forEach(function(r){r.updatePointsByNodes(r.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(o){var r;if(!(!o.e.shiftKey||o.data.type===g2)){n.currentClickNode=o.data;var i=!1;n.selectNodesIds.includes(o.data.id)&&((r=n.lf.getNodeModelById(o.data.id))===null||r===void 0||r.setSelected(!1),i=!0);var a=e.getSelectElements(!0).nodes;n.selectNodes=a,n.selectNodes.length===1?i?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(o,r,i){if(n.onNodeChange(e,o),ew(o)&&!o.isResize){var a=o.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,r,i,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(o){return ew(o)||n.onNodeChange(e,o),!0})},t.pluginName="node-selection",t})();var ew=function(t){return!!(t&&t.type===g2)},Ine=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function o(){this.constructor=e}e.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}})(),c1=function(){return c1=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c1.apply(this,arguments)};(function(t){Ine(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=n.properties;return Lr("text",{x:o-i/2+5,y:r-a/2+16,fontSize:12,fill:"blue"},s.moreText)},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,s=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",c1(c1({},s),{fill:"#FFFFFF",x:o-i/2,y:r-a/2})),this.getLabelShape()])},e})(Zv);var I0={exports:{}},kR;function Fne(){return kR||(kR=1,(function(t,e){(function(n,o){t.exports=o()})(window,(function(){return(function(n){var o={};function r(i){if(o[i])return o[i].exports;var a=o[i]={i,l:!1,exports:{}};return n[i].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=n,r.c=o,r.d=function(i,a,s){r.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:s})},r.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},r.t=function(i,a){if(1&a&&(i=r(i)),8&a||4&a&&typeof i=="object"&&i&&i.__esModule)return i;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var l in i)r.d(s,l,(function(f){return i[f]}).bind(null,l));return s},r.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(a,"a",a),a},r.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},r.p="",r(r.s=222)})([function(n,o,r){r.d(o,"a",(function(){return P})),r.d(o,"b",(function(){return R})),r.d(o,"c",(function(){return le})),r.d(o,"d",(function(){return Ze})),r.d(o,"e",(function(){return M})),r.d(o,"f",(function(){return B})),r.d(o,"g",(function(){return M})),r.d(o,"h",(function(){return mt})),r.d(o,"i",(function(){return a})),r.d(o,"j",(function(){return Je})),r.d(o,"k",(function(){return Y}));var i,a,s,l,f,h,v,_={},E=[],O=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function w(pe,se){for(var we in se)pe[we]=se[we];return pe}function S(pe){var se=pe.parentNode;se&&se.removeChild(pe)}function M(pe,se,we){var $e,rt,pt,Lt={};for(pt in se)pt=="key"?$e=se[pt]:pt=="ref"?rt=se[pt]:Lt[pt]=se[pt];if(arguments.length>2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),typeof pe=="function"&&pe.defaultProps!=null)for(pt in pe.defaultProps)Lt[pt]===void 0&&(Lt[pt]=pe.defaultProps[pt]);return T(pe,Lt,$e,rt,null)}function T(pe,se,we,$e,rt){var pt={type:pe,props:se,key:we,ref:$e,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:rt??++s};return rt==null&&a.vnode!=null&&a.vnode(pt),pt}function B(){return{current:null}}function R(pe){return pe.children}function P(pe,se){this.props=pe,this.context=se}function $(pe,se){if(se==null)return pe.__?$(pe.__,pe.__.__k.indexOf(pe)+1):null;for(var we;se<pe.__k.length;se++)if((we=pe.__k[se])!=null&&we.__e!=null)return we.__e;return typeof pe.type=="function"?$(pe):null}function I(pe){var se,we;if((pe=pe.__)!=null&&pe.__c!=null){for(pe.__e=pe.__c.base=null,se=0;se<pe.__k.length;se++)if((we=pe.__k[se])!=null&&we.__e!=null){pe.__e=pe.__c.base=we.__e;break}return I(pe)}}function F(pe){(!pe.__d&&(pe.__d=!0)&&l.push(pe)&&!U.__r++||h!==a.debounceRendering)&&((h=a.debounceRendering)||f)(U)}function U(){for(var pe;U.__r=l.length;)pe=l.sort((function(se,we){return se.__v.__b-we.__v.__b})),l=[],pe.some((function(se){var we,$e,rt,pt,Lt,Jt;se.__d&&(Lt=(pt=(we=se).__v).__e,(Jt=we.__P)&&($e=[],(rt=w({},pt)).__v=pt.__v+1,Ae(Jt,pt,rt,we.__n,Jt.ownerSVGElement!==void 0,pt.__h!=null?[Lt]:null,$e,Lt??$(pt),pt.__h),Pe($e,pt),pt.__e!=Lt&&I(pt)))}))}function z(pe,se,we,$e,rt,pt,Lt,Jt,en,zt){var it,ae,re,je,vt,q,kt,Rt=$e&&$e.__k||E,Gt=Rt.length;for(we.__k=[],it=0;it<se.length;it++)if((je=we.__k[it]=(je=se[it])==null||typeof je=="boolean"?null:typeof je=="string"||typeof je=="number"||typeof je=="bigint"?T(null,je,null,null,je):Array.isArray(je)?T(R,{children:je},null,null,null):je.__b>0?T(je.type,je.props,je.key,null,je.__v):je)!=null){if(je.__=we,je.__b=we.__b+1,(re=Rt[it])===null||re&&je.key==re.key&&je.type===re.type)Rt[it]=void 0;else for(ae=0;ae<Gt;ae++){if((re=Rt[ae])&&je.key==re.key&&je.type===re.type){Rt[ae]=void 0;break}re=null}Ae(pe,je,re=re||_,rt,pt,Lt,Jt,en,zt),vt=je.__e,(ae=je.ref)&&re.ref!=ae&&(kt||(kt=[]),re.ref&&kt.push(re.ref,null,je),kt.push(ae,je.__c||vt,je)),vt!=null?(q==null&&(q=vt),typeof je.type=="function"&&je.__k===re.__k?je.__d=en=X(je,en,pe):en=W(pe,je,re,Rt,vt,en),typeof we.type=="function"&&(we.__d=en)):en&&re.__e==en&&en.parentNode!=pe&&(en=$(re))}for(we.__e=q,it=Gt;it--;)Rt[it]!=null&&(typeof we.type=="function"&&Rt[it].__e!=null&&Rt[it].__e==we.__d&&(we.__d=$($e,it+1)),Ye(Rt[it],Rt[it]));if(kt)for(it=0;it<kt.length;it++)He(kt[it],kt[++it],kt[++it])}function X(pe,se,we){for(var $e,rt=pe.__k,pt=0;rt&&pt<rt.length;pt++)($e=rt[pt])&&($e.__=pe,se=typeof $e.type=="function"?X($e,se,we):W(we,$e,$e,rt,$e.__e,se));return se}function Y(pe,se){return se=se||[],pe==null||typeof pe=="boolean"||(Array.isArray(pe)?pe.some((function(we){Y(we,se)})):se.push(pe)),se}function W(pe,se,we,$e,rt,pt){var Lt,Jt,en;if(se.__d!==void 0)Lt=se.__d,se.__d=void 0;else if(we==null||rt!=pt||rt.parentNode==null)e:if(pt==null||pt.parentNode!==pe)pe.appendChild(rt),Lt=null;else{for(Jt=pt,en=0;(Jt=Jt.nextSibling)&&en<$e.length;en+=2)if(Jt==rt)break e;pe.insertBefore(rt,pt),Lt=pt}return Lt!==void 0?Lt:rt.nextSibling}function Q(pe,se,we){se[0]==="-"?pe.setProperty(se,we):pe[se]=we==null?"":typeof we!="number"||O.test(se)?we:we+"px"}function J(pe,se,we,$e,rt){var pt;e:if(se==="style")if(typeof we=="string")pe.style.cssText=we;else{if(typeof $e=="string"&&(pe.style.cssText=$e=""),$e)for(se in $e)we&&se in we||Q(pe.style,se,"");if(we)for(se in we)$e&&we[se]===$e[se]||Q(pe.style,se,we[se])}else if(se[0]==="o"&&se[1]==="n")pt=se!==(se=se.replace(/Capture$/,"")),se=se.toLowerCase()in pe?se.toLowerCase().slice(2):se.slice(2),pe.l||(pe.l={}),pe.l[se+pt]=we,we?$e||pe.addEventListener(se,pt?Se:ie,pt):pe.removeEventListener(se,pt?Se:ie,pt);else if(se!=="dangerouslySetInnerHTML"){if(rt)se=se.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(se!=="href"&&se!=="list"&&se!=="form"&&se!=="tabIndex"&&se!=="download"&&se in pe)try{pe[se]=we??"";break e}catch{}typeof we=="function"||(we!=null&&(we!==!1||se[0]==="a"&&se[1]==="r")?pe.setAttribute(se,we):pe.removeAttribute(se))}}function ie(pe){this.l[pe.type+!1](a.event?a.event(pe):pe)}function Se(pe){this.l[pe.type+!0](a.event?a.event(pe):pe)}function Ae(pe,se,we,$e,rt,pt,Lt,Jt,en){var zt,it,ae,re,je,vt,q,kt,Rt,Gt,Pn,qt=se.type;if(se.constructor!==void 0)return null;we.__h!=null&&(en=we.__h,Jt=se.__e=we.__e,se.__h=null,pt=[Jt]),(zt=a.__b)&&zt(se);try{e:if(typeof qt=="function"){if(kt=se.props,Rt=(zt=qt.contextType)&&$e[zt.__c],Gt=zt?Rt?Rt.props.value:zt.__:$e,we.__c?q=(it=se.__c=we.__c).__=it.__E:("prototype"in qt&&qt.prototype.render?se.__c=it=new qt(kt,Gt):(se.__c=it=new P(kt,Gt),it.constructor=qt,it.render=Be),Rt&&Rt.sub(it),it.props=kt,it.state||(it.state={}),it.context=Gt,it.__n=$e,ae=it.__d=!0,it.__h=[]),it.__s==null&&(it.__s=it.state),qt.getDerivedStateFromProps!=null&&(it.__s==it.state&&(it.__s=w({},it.__s)),w(it.__s,qt.getDerivedStateFromProps(kt,it.__s))),re=it.props,je=it.state,ae)qt.getDerivedStateFromProps==null&&it.componentWillMount!=null&&it.componentWillMount(),it.componentDidMount!=null&&it.__h.push(it.componentDidMount);else{if(qt.getDerivedStateFromProps==null&&kt!==re&&it.componentWillReceiveProps!=null&&it.componentWillReceiveProps(kt,Gt),!it.__e&&it.shouldComponentUpdate!=null&&it.shouldComponentUpdate(kt,it.__s,Gt)===!1||se.__v===we.__v){it.props=kt,it.state=it.__s,se.__v!==we.__v&&(it.__d=!1),it.__v=se,se.__e=we.__e,se.__k=we.__k,se.__k.forEach((function(On){On&&(On.__=se)})),it.__h.length&&Lt.push(it);break e}it.componentWillUpdate!=null&&it.componentWillUpdate(kt,it.__s,Gt),it.componentDidUpdate!=null&&it.__h.push((function(){it.componentDidUpdate(re,je,vt)}))}it.context=Gt,it.props=kt,it.state=it.__s,(zt=a.__r)&&zt(se),it.__d=!1,it.__v=se,it.__P=pe,zt=it.render(it.props,it.state,it.context),it.state=it.__s,it.getChildContext!=null&&($e=w(w({},$e),it.getChildContext())),ae||it.getSnapshotBeforeUpdate==null||(vt=it.getSnapshotBeforeUpdate(re,je)),Pn=zt!=null&&zt.type===R&&zt.key==null?zt.props.children:zt,z(pe,Array.isArray(Pn)?Pn:[Pn],se,we,$e,rt,pt,Lt,Jt,en),it.base=se.__e,se.__h=null,it.__h.length&&Lt.push(it),q&&(it.__E=it.__=null),it.__e=!1}else pt==null&&se.__v===we.__v?(se.__k=we.__k,se.__e=we.__e):se.__e=De(we.__e,se,we,$e,rt,pt,Lt,en);(zt=a.diffed)&&zt(se)}catch(On){se.__v=null,(en||pt!=null)&&(se.__e=Jt,se.__h=!!en,pt[pt.indexOf(Jt)]=null),a.__e(On,se,we)}}function Pe(pe,se){a.__c&&a.__c(se,pe),pe.some((function(we){try{pe=we.__h,we.__h=[],pe.some((function($e){$e.call(we)}))}catch($e){a.__e($e,we.__v)}}))}function De(pe,se,we,$e,rt,pt,Lt,Jt){var en,zt,it,ae=we.props,re=se.props,je=se.type,vt=0;if(je==="svg"&&(rt=!0),pt!=null){for(;vt<pt.length;vt++)if((en=pt[vt])&&"setAttribute"in en==!!je&&(je?en.localName===je:en.nodeType===3)){pe=en,pt[vt]=null;break}}if(pe==null){if(je===null)return document.createTextNode(re);pe=rt?document.createElementNS("http://www.w3.org/2000/svg",je):document.createElement(je,re.is&&re),pt=null,Jt=!1}if(je===null)ae===re||Jt&&pe.data===re||(pe.data=re);else{if(pt=pt&&i.call(pe.childNodes),zt=(ae=we.props||_).dangerouslySetInnerHTML,it=re.dangerouslySetInnerHTML,!Jt){if(pt!=null)for(ae={},vt=0;vt<pe.attributes.length;vt++)ae[pe.attributes[vt].name]=pe.attributes[vt].value;(it||zt)&&(it&&(zt&&it.__html==zt.__html||it.__html===pe.innerHTML)||(pe.innerHTML=it&&it.__html||""))}if((function(q,kt,Rt,Gt,Pn){var qt;for(qt in Rt)qt==="children"||qt==="key"||qt in kt||J(q,qt,null,Rt[qt],Gt);for(qt in kt)Pn&&typeof kt[qt]!="function"||qt==="children"||qt==="key"||qt==="value"||qt==="checked"||Rt[qt]===kt[qt]||J(q,qt,kt[qt],Rt[qt],Gt)})(pe,re,ae,rt,Jt),it)se.__k=[];else if(vt=se.props.children,z(pe,Array.isArray(vt)?vt:[vt],se,we,$e,rt&&je!=="foreignObject",pt,Lt,pt?pt[0]:we.__k&&$(we,0),Jt),pt!=null)for(vt=pt.length;vt--;)pt[vt]!=null&&S(pt[vt]);Jt||("value"in re&&(vt=re.value)!==void 0&&(vt!==ae.value||vt!==pe.value||je==="progress"&&!vt)&&J(pe,"value",vt,ae.value,!1),"checked"in re&&(vt=re.checked)!==void 0&&vt!==pe.checked&&J(pe,"checked",vt,ae.checked,!1))}return pe}function He(pe,se,we){try{typeof pe=="function"?pe(se):pe.current=se}catch($e){a.__e($e,we)}}function Ye(pe,se,we){var $e,rt;if(a.unmount&&a.unmount(pe),($e=pe.ref)&&($e.current&&$e.current!==pe.__e||He($e,null,se)),($e=pe.__c)!=null){if($e.componentWillUnmount)try{$e.componentWillUnmount()}catch(pt){a.__e(pt,se)}$e.base=$e.__P=null}if($e=pe.__k)for(rt=0;rt<$e.length;rt++)$e[rt]&&Ye($e[rt],se,typeof pe.type!="function");we||pe.__e==null||S(pe.__e),pe.__e=pe.__d=void 0}function Be(pe,se,we){return this.constructor(pe,we)}function Je(pe,se,we){var $e,rt,pt;a.__&&a.__(pe,se),rt=($e=typeof we=="function")?null:we&&we.__k||se.__k,pt=[],Ae(se,pe=(!$e&&we||se).__k=M(R,null,[pe]),rt||_,_,se.ownerSVGElement!==void 0,!$e&&we?[we]:rt?null:se.firstChild?i.call(se.childNodes):null,pt,!$e&&we?we:rt?rt.__e:se.firstChild,$e),Pe(pt,pe)}function mt(pe,se){Je(pe,se,mt)}function le(pe,se,we){var $e,rt,pt,Lt=w({},pe.props);for(pt in se)pt=="key"?$e=se[pt]:pt=="ref"?rt=se[pt]:Lt[pt]=se[pt];return arguments.length>2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),T(pe.type,Lt,$e||pe.key,rt||pe.ref,null)}function Ze(pe,se){var we={__c:se="__cC"+v++,__:pe,Consumer:function($e,rt){return $e.children(rt)},Provider:function($e){var rt,pt;return this.getChildContext||(rt=[],(pt={})[se]=this,this.getChildContext=function(){return pt},this.shouldComponentUpdate=function(Lt){this.props.value!==Lt.value&&rt.some(F)},this.sub=function(Lt){rt.push(Lt);var Jt=Lt.componentWillUnmount;Lt.componentWillUnmount=function(){rt.splice(rt.indexOf(Lt),1),Jt&&Jt.call(Lt)}}),$e.children}};return we.Provider.__=we.Consumer.contextType=we}i=E.slice,a={__e:function(pe,se){for(var we,$e,rt;se=se.__;)if((we=se.__c)&&!we.__)try{if(($e=we.constructor)&&$e.getDerivedStateFromError!=null&&(we.setState($e.getDerivedStateFromError(pe)),rt=we.__d),we.componentDidCatch!=null&&(we.componentDidCatch(pe),rt=we.__d),rt)return we.__E=we}catch(pt){pe=pt}throw pe}},s=0,P.prototype.setState=function(pe,se){var we;we=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof pe=="function"&&(pe=pe(w({},we),this.props)),pe&&w(we,pe),pe!=null&&this.__v&&(se&&this.__h.push(se),F(this))},P.prototype.forceUpdate=function(pe){this.__v&&(this.__e=!0,pe&&this.__h.push(pe),F(this))},P.prototype.render=R,l=[],f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,U.__r=0,v=0},function(n,o,r){(function(i,a){r.d(o,"a",(function(){return F})),r.d(o,"b",(function(){return lf})),r.d(o,"c",(function(){return Na})),r.d(o,"d",(function(){return rr})),r.d(o,"e",(function(){return Tt})),r.d(o,"f",(function(){return At})),r.d(o,"g",(function(){return qn})),r.d(o,"h",(function(){return ka})),r.d(o,"i",(function(){return Pn})),r.d(o,"j",(function(){return Nn})),r.d(o,"k",(function(){return br})),r.d(o,"l",(function(){return ht})),r.d(o,"m",(function(){return q})),r.d(o,"n",(function(){return or})),r.d(o,"o",(function(){return X})),r.d(o,"p",(function(){return Uh})),r.d(o,"q",(function(){return lr})),r.d(o,"r",(function(){return Fl})),r.d(o,"s",(function(){return sl})),r.d(o,"t",(function(){return vi})),r.d(o,"u",(function(){return si})),r.d(o,"v",(function(){return id})),r.d(o,"w",(function(){return _u})),r.d(o,"x",(function(){return ra})),r.d(o,"y",(function(){return xl})),r.d(o,"z",(function(){return Wi})),r.d(o,"A",(function(){return ia})),r.d(o,"B",(function(){return wl})),r.d(o,"C",(function(){return zt})),r.d(o,"D",(function(){return _p})),r.d(o,"E",(function(){return nr})),r.d(o,"F",(function(){return Cn})),r.d(o,"G",(function(){return so})),r.d(o,"H",(function(){return ve})),r.d(o,"I",(function(){return rf})),r.d(o,"J",(function(){return oa})),r.d(o,"K",(function(){return Ke})),r.d(o,"L",(function(){return qo})),r.d(o,"M",(function(){return ad}));var s=[];Object.freeze(s);var l={};function f(){return++Sn.mobxGuid}function h(D){throw v(!1,D),"X"}function v(D,L){if(!D)throw new Error("[mobx] "+(L||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(l);function _(D){var L=!1;return function(){if(!L)return L=!0,D.apply(this,arguments)}}var E=function(){};function O(D){return D!==null&&typeof D=="object"}function w(D){if(D===null||typeof D!="object")return!1;var L=Object.getPrototypeOf(D);return L===Object.prototype||L===null}function S(D,L,Z){Object.defineProperty(D,L,{enumerable:!1,writable:!0,configurable:!0,value:Z})}function M(D,L){var Z="isMobX"+D;return L.prototype[Z]=!0,function(fe){return O(fe)&&fe[Z]===!0}}function T(D){return D instanceof Map}function B(D){return D instanceof Set}function R(D){var L=new Set;for(var Z in D)L.add(Z);return Object.getOwnPropertySymbols(D).forEach((function(fe){Object.getOwnPropertyDescriptor(D,fe).enumerable&&L.add(fe)})),Array.from(L)}function P(D){return D&&D.toString?D.toString():new String(D).toString()}function $(D){return D===null?null:typeof D=="object"?""+D:D}var I=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:Object.getOwnPropertyNames,F=Symbol("mobx administration"),U=(function(){function D(L){L===void 0&&(L="Atom@"+f()),this.name=L,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ae.NOT_TRACKING}return D.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},D.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},D.prototype.reportObserved=function(){return ml(this)},D.prototype.reportChanged=function(){Ui(),(function(L){L.lowestObserverState!==ae.STALE&&(L.lowestObserverState=ae.STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale()),Z.dependenciesState=ae.STALE})))})(this),yr()},D.prototype.toString=function(){return this.name},D})(),z=M("Atom",U);function X(D,L,Z){L===void 0&&(L=E),Z===void 0&&(Z=E);var fe,Re=new U(D);return L!==E&&Mn("onBecomeObserved",Re,L,fe),Z!==E&&nr(Re,Z),Re}var Y={structural:function(D,L){return un(D,L)},default:function(D,L){return Object.is(D,L)}},W=function(D,L){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,fe){Z.__proto__=fe}||function(Z,fe){for(var Re in fe)fe.hasOwnProperty(Re)&&(Z[Re]=fe[Re])},W(D,L)};/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var Q=function(){return Q=Object.assign||function(D){for(var L,Z=1,fe=arguments.length;Z<fe;Z++)for(var Re in L=arguments[Z])Object.prototype.hasOwnProperty.call(L,Re)&&(D[Re]=L[Re]);return D},Q.apply(this,arguments)};function J(D){var L=typeof Symbol=="function"&&D[Symbol.iterator],Z=0;return L?L.call(D):{next:function(){return D&&Z>=D.length&&(D=void 0),{value:D&&D[Z++],done:!D}}}}function ie(D,L){var Z=typeof Symbol=="function"&&D[Symbol.iterator];if(!Z)return D;var fe,Re,lt=Z.call(D),It=[];try{for(;(L===void 0||L-- >0)&&!(fe=lt.next()).done;)It.push(fe.value)}catch(bn){Re={error:bn}}finally{try{fe&&!fe.done&&(Z=lt.return)&&Z.call(lt)}finally{if(Re)throw Re.error}}return It}function Se(){for(var D=[],L=0;L<arguments.length;L++)D=D.concat(ie(arguments[L]));return D}var Ae=Symbol("mobx did run lazy initializers"),Pe=Symbol("mobx pending decorators"),De={},He={};function Ye(D,L){var Z=L?De:He;return Z[D]||(Z[D]={configurable:!0,enumerable:L,get:function(){return Be(this),this[D]},set:function(fe){Be(this),this[D]=fe}})}function Be(D){var L,Z;if(D[Ae]!==!0){var fe=D[Pe];if(fe){S(D,Ae,!0);var Re=Se(Object.getOwnPropertySymbols(fe),Object.keys(fe));try{for(var lt=J(Re),It=lt.next();!It.done;It=lt.next()){var bn=fe[It.value];bn.propertyCreator(D,bn.prop,bn.descriptor,bn.decoratorTarget,bn.decoratorArguments)}}catch(Jn){L={error:Jn}}finally{try{It&&!It.done&&(Z=lt.return)&&Z.call(lt)}finally{if(L)throw L.error}}}}}function Je(D,L){return function(){var Z,fe=function(Re,lt,It,bn){if(bn===!0)return L(Re,lt,It,Re,Z),null;if(!Object.prototype.hasOwnProperty.call(Re,Pe)){var Jn=Re[Pe];S(Re,Pe,Q({},Jn))}return Re[Pe][lt]={prop:lt,propertyCreator:L,descriptor:It,decoratorTarget:Re,decoratorArguments:Z},Ye(lt,D)};return mt(arguments)?(Z=s,fe.apply(null,arguments)):(Z=Array.prototype.slice.call(arguments),fe)}}function mt(D){return(D.length===2||D.length===3)&&(typeof D[1]=="string"||typeof D[1]=="symbol")||D.length===4&&D[3]===!0}function le(D,L,Z){return ra(D)?D:Array.isArray(D)?zt.array(D,{name:Z}):w(D)?zt.object(D,void 0,{name:Z}):T(D)?zt.map(D,{name:Z}):B(D)?zt.set(D,{name:Z}):D}function Ze(D){return D}function pe(D){v(D);var L=Je(!0,(function(fe,Re,lt,It,bn){var Jn=lt?lt.initializer?lt.initializer.call(fe):lt.value:void 0;ll(fe).addObservableProp(Re,Jn,D)})),Z=(i!==void 0&&i.env,L);return Z.enhancer=D,Z}var se={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function we(D){return D==null?se:typeof D=="string"?{name:D,deep:!0,proxy:!0}:D}Object.freeze(se);var $e=pe(le),rt=pe((function(D,L,Z){return D==null||ia(D)||xl(D)||Wi(D)||Ki(D)?D:Array.isArray(D)?zt.array(D,{name:Z,deep:!1}):w(D)?zt.object(D,void 0,{name:Z,deep:!1}):T(D)?zt.map(D,{name:Z,deep:!1}):B(D)?zt.set(D,{name:Z,deep:!1}):h(!1)})),pt=pe(Ze),Lt=pe((function(D,L,Z){return un(D,L)?L:D}));function Jt(D){return D.defaultDecorator?D.defaultDecorator.enhancer:D.deep===!1?Ze:le}var en={box:function(D,L){arguments.length>2&&it("box");var Z=we(L);return new Fn(D,Jt(Z),Z.name,!0,Z.equals)},array:function(D,L){arguments.length>2&&it("array");var Z=we(L);return Ks(D,Jt(Z),Z.name)},map:function(D,L){arguments.length>2&&it("map");var Z=we(L);return new lf(D,Jt(Z),Z.name)},set:function(D,L){arguments.length>2&&it("set");var Z=we(L);return new os(D,Jt(Z),Z.name)},object:function(D,L,Z){typeof arguments[1]=="string"&&it("object");var fe=we(Z);if(fe.proxy===!1)return lr({},D,L,fe);var Re=qr(fe),lt=lr({},void 0,void 0,fe),It=bu(lt);return na(It,D,L,Re),It},ref:pt,shallow:rt,deep:$e,struct:Lt},zt=function(D,L,Z){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return $e.apply(null,arguments);if(ra(D))return D;var fe=w(D)?zt.object(D,L,Z):Array.isArray(D)?zt.array(D,L):T(D)?zt.map(D,L):B(D)?zt.set(D,L):D;if(fe!==D)return fe;h(!1)};function it(D){h("Expected one or two arguments to observable."+D+". Did you accidentally try to use observable."+D+" as decorator?")}Object.keys(en).forEach((function(D){return zt[D]=en[D]}));var ae,re,je=Je(!1,(function(D,L,Z,fe,Re){var lt=Z.get,It=Z.set,bn=Re[0]||{};ll(D).addComputedProp(D,L,Q({get:lt,set:It,context:D},bn))})),vt=je({equals:Y.structural}),q=function(D,L,Z){if(typeof L=="string"||D!==null&&typeof D=="object"&&arguments.length===1)return je.apply(null,arguments);var fe=typeof L=="object"?L:{};return fe.get=D,fe.set=typeof L=="function"?L:fe.set,fe.name=fe.name||D.name||"",new wo(fe)};q.struct=vt,(function(D){D[D.NOT_TRACKING=-1]="NOT_TRACKING",D[D.UP_TO_DATE=0]="UP_TO_DATE",D[D.POSSIBLY_STALE=1]="POSSIBLY_STALE",D[D.STALE=2]="STALE"})(ae||(ae={})),(function(D){D[D.NONE=0]="NONE",D[D.LOG=1]="LOG",D[D.BREAK=2]="BREAK"})(re||(re={}));var kt=function(D){this.cause=D};function Rt(D){return D instanceof kt}function Gt(D){switch(D.dependenciesState){case ae.UP_TO_DATE:return!1;case ae.NOT_TRACKING:case ae.STALE:return!0;case ae.POSSIBLY_STALE:for(var L=At(!0),Z=Le(),fe=D.observing,Re=fe.length,lt=0;lt<Re;lt++){var It=fe[lt];if(oo(It)){if(Sn.disableErrorBoundaries)It.get();else try{It.get()}catch{return dt(Z),Tt(L),!0}if(D.dependenciesState===ae.STALE)return dt(Z),Tt(L),!0}}return En(D),dt(Z),Tt(L),!1}}function Pn(){return Sn.trackingDerivation!==null}function qt(D){var L=D.observers.size>0;Sn.computationDepth>0&&L&&h(!1),Sn.allowStateChanges||!L&&Sn.enforceActions!=="strict"||h(!1)}function On(D,L,Z){var fe=At(!0);En(D),D.newObserving=new Array(D.observing.length+100),D.unboundDepsCount=0,D.runId=++Sn.runId;var Re,lt=Sn.trackingDerivation;if(Sn.trackingDerivation=D,Sn.disableErrorBoundaries===!0)Re=L.call(Z);else try{Re=L.call(Z)}catch(It){Re=new kt(It)}return Sn.trackingDerivation=lt,(function(It){for(var bn=It.observing,Jn=It.observing=It.newObserving,no=ae.UP_TO_DATE,$n=0,Do=It.unboundDepsCount,Kr=0;Kr<Do;Kr++)(So=Jn[Kr]).diffValue===0&&(So.diffValue=1,$n!==Kr&&(Jn[$n]=So),$n++),So.dependenciesState>no&&(no=So.dependenciesState);for(Jn.length=$n,It.newObserving=null,Do=bn.length;Do--;)(So=bn[Do]).diffValue===0&&Oo(So,It),So.diffValue=0;for(;$n--;){var So;(So=Jn[$n]).diffValue===1&&(So.diffValue=0,Ts(So,It))}no!==ae.UP_TO_DATE&&(It.dependenciesState=no,It.onBecomeStale())})(D),Tt(fe),Re}function ke(D){var L=D.observing;D.observing=[];for(var Z=L.length;Z--;)Oo(L[Z],D);D.dependenciesState=ae.NOT_TRACKING}function Ke(D){var L=Le();try{return D()}finally{dt(L)}}function Le(){var D=Sn.trackingDerivation;return Sn.trackingDerivation=null,D}function dt(D){Sn.trackingDerivation=D}function At(D){var L=Sn.allowStateReads;return Sn.allowStateReads=D,L}function Tt(D){Sn.allowStateReads=D}function En(D){if(D.dependenciesState!==ae.UP_TO_DATE){D.dependenciesState=ae.UP_TO_DATE;for(var L=D.observing,Z=L.length;Z--;)L[Z].lowestObserverState=ae.UP_TO_DATE}}var Zn=0,ao=1,Lo=Object.getOwnPropertyDescriptor((function(){}),"name");Lo&&Lo.configurable;function _o(D,L,Z){var fe=function(){return ho(D,L,Z||this,arguments)};return fe.isMobxAction=!0,fe}function ho(D,L,Z,fe){var Re=Nn();try{return L.apply(Z,fe)}catch(lt){throw Re.error=lt,lt}finally{qn(Re)}}function Nn(D,L,Z){var fe=0,Re=Le();Ui();var lt={prevDerivation:Re,prevAllowStateChanges:ut(!0),prevAllowStateReads:At(!0),notifySpy:!1,startTime:fe,actionId:ao++,parentActionId:Zn};return Zn=lt.actionId,lt}function qn(D){Zn!==D.actionId&&h("invalid action stack. did you forget to finish an action?"),Zn=D.parentActionId,D.error!==void 0&&(Sn.suppressReactionErrors=!0),gn(D.prevAllowStateChanges),Tt(D.prevAllowStateReads),yr(),dt(D.prevDerivation),D.notifySpy,Sn.suppressReactionErrors=!1}function rr(D,L){var Z,fe=ut(D);try{Z=L()}finally{gn(fe)}return Z}function ut(D){var L=Sn.allowStateChanges;return Sn.allowStateChanges=D,L}function gn(D){Sn.allowStateChanges=D}var Fn=(function(D){function L(Z,fe,Re,lt,It){Re===void 0&&(Re="ObservableValue@"+f()),It===void 0&&(It=Y.default);var bn=D.call(this,Re)||this;return bn.enhancer=fe,bn.name=Re,bn.equals=It,bn.hasUnreportedChange=!1,bn.value=fe(Z,void 0,Re),bn}return(function(Z,fe){function Re(){this.constructor=Z}W(Z,fe),Z.prototype=fe===null?Object.create(fe):(Re.prototype=fe.prototype,new Re)})(L,D),L.prototype.dehanceValue=function(Z){return this.dehancer!==void 0?this.dehancer(Z):Z},L.prototype.set=function(Z){this.value,(Z=this.prepareNewValue(Z))!==Sn.UNCHANGED&&this.setNewValue(Z)},L.prototype.prepareNewValue=function(Z){if(qt(this),Ja(this)){var fe=vo(this,{object:this,type:"update",newValue:Z});if(!fe)return Sn.UNCHANGED;Z=fe.newValue}return Z=this.enhancer(Z,this.value,this.name),this.equals(this.value,Z)?Sn.UNCHANGED:Z},L.prototype.setNewValue=function(Z){var fe=this.value;this.value=Z,this.reportChanged(),Ua(this)&&ha(this,{type:"update",object:this,newValue:Z,oldValue:fe})},L.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},L.prototype.intercept=function(Z){return El(this,Z)},L.prototype.observe=function(Z,fe){return fe&&Z({object:this,type:"update",newValue:this.value,oldValue:void 0}),Bl(this,Z)},L.prototype.toJSON=function(){return this.get()},L.prototype.toString=function(){return this.name+"["+this.value+"]"},L.prototype.valueOf=function(){return $(this.get())},L.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},L})(U),sr=M("ObservableValue",Fn),wo=(function(){function D(L){this.dependenciesState=ae.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=ae.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+f(),this.value=new kt(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=re.NONE,v(L.get,"missing option for computed: get"),this.derivation=L.get,this.name=L.name||"ComputedValue@"+f(),L.set&&(this.setter=_o(this.name+"-setter",L.set)),this.equals=L.equals||(L.compareStructural||L.struct?Y.structural:Y.default),this.scope=L.context,this.requiresReaction=!!L.requiresReaction,this.keepAlive=!!L.keepAlive}return D.prototype.onBecomeStale=function(){(function(L){L.lowestObserverState===ae.UP_TO_DATE&&(L.lowestObserverState=ae.POSSIBLY_STALE,L.observers.forEach((function(Z){Z.dependenciesState===ae.UP_TO_DATE&&(Z.dependenciesState=ae.POSSIBLY_STALE,Z.isTracing!==re.NONE&&pa(Z,L),Z.onBecomeStale())})))})(this)},D.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},D.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},D.prototype.get=function(){this.isComputing&&h("Cycle detected in computation "+this.name+": "+this.derivation),Sn.inBatch!==0||this.observers.size!==0||this.keepAlive?(ml(this),Gt(this)&&this.trackAndCompute()&&(function(Z){Z.lowestObserverState!==ae.STALE&&(Z.lowestObserverState=ae.STALE,Z.observers.forEach((function(fe){fe.dependenciesState===ae.POSSIBLY_STALE?fe.dependenciesState=ae.STALE:fe.dependenciesState===ae.UP_TO_DATE&&(Z.lowestObserverState=ae.UP_TO_DATE)})))})(this)):Gt(this)&&(this.warnAboutUntrackedRead(),Ui(),this.value=this.computeValue(!1),yr());var L=this.value;if(Rt(L))throw L.cause;return L},D.prototype.peek=function(){var L=this.computeValue(!1);if(Rt(L))throw L.cause;return L},D.prototype.set=function(L){if(this.setter){v(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,L)}finally{this.isRunningSetter=!1}}else v(!1,!1)},D.prototype.trackAndCompute=function(){var L=this.value,Z=this.dependenciesState===ae.NOT_TRACKING,fe=this.computeValue(!0),Re=Z||Rt(L)||Rt(fe)||!this.equals(L,fe);return Re&&(this.value=fe),Re},D.prototype.computeValue=function(L){var Z;if(this.isComputing=!0,Sn.computationDepth++,L)Z=On(this,this.derivation,this.scope);else if(Sn.disableErrorBoundaries===!0)Z=this.derivation.call(this.scope);else try{Z=this.derivation.call(this.scope)}catch(fe){Z=new kt(fe)}return Sn.computationDepth--,this.isComputing=!1,Z},D.prototype.suspend=function(){this.keepAlive||(ke(this),this.value=void 0)},D.prototype.observe=function(L,Z){var fe=this,Re=!0,lt=void 0;return ht((function(){var It=fe.get();if(!Re||Z){var bn=Le();L({type:"update",object:fe,newValue:It,oldValue:lt}),dt(bn)}Re=!1,lt=It}))},D.prototype.warnAboutUntrackedRead=function(){},D.prototype.toJSON=function(){return this.get()},D.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},D.prototype.valueOf=function(){return $(this.get())},D.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},D})(),oo=M("ComputedValue",wo),ta=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Ca={};function Yi(){return typeof window<"u"?window:a!==void 0?a:typeof self<"u"?self:Ca}var fa=!0,Ka=!1,Sn=(function(){var D=Yi();return D.__mobxInstanceCount>0&&!D.__mobxGlobals&&(fa=!1),D.__mobxGlobals&&D.__mobxGlobals.version!==new ta().version&&(fa=!1),fa?D.__mobxGlobals?(D.__mobxInstanceCount+=1,D.__mobxGlobals.UNCHANGED||(D.__mobxGlobals.UNCHANGED={}),D.__mobxGlobals):(D.__mobxInstanceCount=1,D.__mobxGlobals=new ta):(setTimeout((function(){Ka||h("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new ta)})();function Ts(D,L){D.observers.add(L),D.lowestObserverState>L.dependenciesState&&(D.lowestObserverState=L.dependenciesState)}function Oo(D,L){D.observers.delete(L),D.observers.size===0&&es(D)}function es(D){D.isPendingUnobservation===!1&&(D.isPendingUnobservation=!0,Sn.pendingUnobservations.push(D))}function Ui(){Sn.inBatch++}function yr(){if(--Sn.inBatch==0){yl();for(var D=Sn.pendingUnobservations,L=0;L<D.length;L++){var Z=D[L];Z.isPendingUnobservation=!1,Z.observers.size===0&&(Z.isBeingObserved&&(Z.isBeingObserved=!1,Z.onBecomeUnobserved()),Z instanceof wo&&Z.suspend())}Sn.pendingUnobservations=[]}}function ml(D){var L=Sn.trackingDerivation;return L!==null?(L.runId!==D.lastAccessedBy&&(D.lastAccessedBy=L.runId,L.newObserving[L.unboundDepsCount++]=D,D.isBeingObserved||(D.isBeingObserved=!0,D.onBecomeObserved())),!0):(D.observers.size===0&&Sn.inBatch>0&&es(D),!1)}function pa(D,L){if(D.isTracing===re.BREAK){var Z=[];qi(vi(D),Z,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+D.name+`'
|
||
|
||
You are entering this break point because derivation '`+D.name+"' is being traced and '"+L.name+`' is now forcing it to update.
|
||
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
||
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
||
|
||
`+(D instanceof wo?D.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+Z.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function qi(D,L,Z){L.length>=1e3?L.push("(and many more)"):(L.push(""+new Array(Z).join(" ")+D.name),D.dependencies&&D.dependencies.forEach((function(fe){return qi(fe,L,Z+1)})))}var Na=(function(){function D(L,Z,fe,Re){L===void 0&&(L="Reaction@"+f()),Re===void 0&&(Re=!1),this.name=L,this.onInvalidate=Z,this.errorHandler=fe,this.requiresObservable=Re,this.observing=[],this.newObserving=[],this.dependenciesState=ae.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+f(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=re.NONE}return D.prototype.onBecomeStale=function(){this.schedule()},D.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Sn.pendingReactions.push(this),yl())},D.prototype.isScheduled=function(){return this._isScheduled},D.prototype.runReaction=function(){if(!this.isDisposed){if(Ui(),this._isScheduled=!1,Gt(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(L){this.reportExceptionInDerivation(L)}}yr()}},D.prototype.track=function(L){if(!this.isDisposed){Ui(),this._isRunning=!0;var Z=On(this,L,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ke(this),Rt(Z)&&this.reportExceptionInDerivation(Z.cause),yr()}},D.prototype.reportExceptionInDerivation=function(L){var Z=this;if(this.errorHandler)this.errorHandler(L,this);else{if(Sn.disableErrorBoundaries)throw L;Sn.suppressReactionErrors,Sn.globalReactionErrorHandlers.forEach((function(fe){return fe(L,Z)}))}},D.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ui(),ke(this),yr()))},D.prototype.getDisposer=function(){var L=this.dispose.bind(this);return L[F]=this,L},D.prototype.toString=function(){return"Reaction["+this.name+"]"},D.prototype.trace=function(L){L===void 0&&(L=!1),(function(){for(var Z=[],fe=0;fe<arguments.length;fe++)Z[fe]=arguments[fe];var Re=!1;typeof Z[Z.length-1]=="boolean"&&(Re=Z.pop());var lt=Mo(Z);if(!lt)return h(!1);lt.isTracing,re.NONE,lt.isTracing=Re?re.BREAK:re.LOG})(this,L)},D})(),al=function(D){return D()};function yl(){Sn.inBatch>0||Sn.isRunningReactions||al(Cs)}function Cs(){Sn.isRunningReactions=!0;for(var D=Sn.pendingReactions,L=0;D.length>0;){++L==100&&D.splice(0);for(var Z=D.splice(0),fe=0,Re=Z.length;fe<Re;fe++)Z[fe].runReaction()}Sn.isRunningReactions=!1}var _l=M("Reaction",Na);function ts(D){var L=al;al=function(Z){return D((function(){return L(Z)}))}}function ve(D){return function(){}}function gt(){h(!1)}function dn(D){return function(L,Z,fe){if(fe){if(fe.value)return{value:_o(D,fe.value),enumerable:!1,configurable:!0,writable:!0};var Re=fe.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return _o(D,Re.call(this))}}}return Kn(D).apply(this,arguments)}}function Kn(D){return function(L,Z,fe){Object.defineProperty(L,Z,{configurable:!0,enumerable:!1,get:function(){},set:function(Re){S(this,Z,br(D,Re))}})}}var br=function(D,L,Z,fe){return arguments.length===1&&typeof D=="function"?_o(D.name||"<unnamed action>",D):arguments.length===2&&typeof L=="function"?_o(D,L):arguments.length===1&&typeof D=="string"?dn(D):fe!==!0?dn(L).apply(null,arguments):void S(D,L,_o(D.name||L,Z.value,this))};function so(D,L){return ho(typeof D=="string"?D:D.name||"<unnamed action>",typeof D=="function"?D:L,this,void 0)}function si(D){return typeof D=="function"&&D.isMobxAction===!0}function ye(D,L,Z){S(D,L,_o(L,Z.bind(D)))}function ht(D,L){L===void 0&&(L=l);var Z,fe=L&&L.name||D.name||"Autorun@"+f();if(!L.scheduler&&!L.delay)Z=new Na(fe,(function(){this.track(It)}),L.onError,L.requiresObservable);else{var Re=Rn(L),lt=!1;Z=new Na(fe,(function(){lt||(lt=!0,Re((function(){lt=!1,Z.isDisposed||Z.track(It)})))}),L.onError,L.requiresObservable)}function It(){D(Z)}return Z.schedule(),Z.getDisposer()}br.bound=function(D,L,Z,fe){return fe===!0?(ye(D,L,Z.value),null):Z?{configurable:!0,enumerable:!1,get:function(){return ye(this,L,Z.value||Z.initializer.call(this)),this[L]},set:gt}:{enumerable:!1,configurable:!0,set:function(Re){ye(this,L,Re)},get:function(){}}};var pn=function(D){return D()};function Rn(D){return D.scheduler?D.scheduler:D.delay?function(L){return setTimeout(L,D.delay)}:pn}function Cn(D,L,Z){Z===void 0&&(Z=l);var fe,Re,lt,It=Z.name||"Reaction@"+f(),bn=br(It,Z.onError?(fe=Z.onError,Re=L,function(){try{return Re.apply(this,arguments)}catch(wi){fe.call(this,wi)}}):L),Jn=!Z.scheduler&&!Z.delay,no=Rn(Z),$n=!0,Do=!1,Kr=Z.compareStructural?Y.structural:Z.equals||Y.default,So=new Na(It,(function(){$n||Jn?ul():Do||(Do=!0,no(ul))}),Z.onError,Z.requiresObservable);function ul(){if(Do=!1,!So.isDisposed){var wi=!1;So.track((function(){var el=D(So);wi=$n||!Kr(lt,el),lt=el})),$n&&Z.fireImmediately&&bn(lt,So),$n||wi!==!0||bn(lt,So),$n&&($n=!1)}}return So.schedule(),So.getDisposer()}function nr(D,L,Z){return Mn("onBecomeUnobserved",D,L,Z)}function Mn(D,L,Z,fe){var Re=typeof fe=="function"?sl(L,Z):sl(L),lt=typeof fe=="function"?fe:Z,It=D+"Listeners";return Re[It]?Re[It].add(lt):Re[It]=new Set([lt]),typeof Re[D]!="function"?h(!1):function(){var bn=Re[It];bn&&(bn.delete(lt),bn.size===0&&delete Re[It])}}function or(D){var L=D.enforceActions,Z=D.computedRequiresReaction,fe=D.computedConfigurable,Re=D.disableErrorBoundaries,lt=D.reactionScheduler,It=D.reactionRequiresObservable,bn=D.observableRequiresReaction;if(D.isolateGlobalState===!0&&((Sn.pendingReactions.length||Sn.inBatch||Sn.isRunningReactions)&&h("isolateGlobalState should be called before MobX is running any reactions"),Ka=!0,fa&&(--Yi().__mobxInstanceCount==0&&(Yi().__mobxGlobals=void 0),Sn=new ta)),L!==void 0){var Jn=void 0;switch(L){case!0:case"observed":Jn=!0;break;case!1:case"never":Jn=!1;break;case"strict":case"always":Jn="strict";break;default:h("Invalid value for 'enforceActions': '"+L+"', expected 'never', 'always' or 'observed'")}Sn.enforceActions=Jn,Sn.allowStateChanges=Jn!==!0&&Jn!=="strict"}Z!==void 0&&(Sn.computedRequiresReaction=!!Z),It!==void 0&&(Sn.reactionRequiresObservable=!!It),bn!==void 0&&(Sn.observableRequiresReaction=!!bn,Sn.allowStateReads=!Sn.observableRequiresReaction),fe!==void 0&&(Sn.computedConfigurable=!!fe),Re!==void 0&&(Sn.disableErrorBoundaries=!!Re),lt&&ts(lt)}function lr(D,L,Z,fe){var Re=qr(fe=we(fe));return Be(D),ll(D,fe.name,Re.enhancer),L&&na(D,L,Z,Re),D}function qr(D){return D.defaultDecorator||(D.deep===!1?pt:$e)}function na(D,L,Z,fe){var Re,lt;Ui();try{var It=I(L);try{for(var bn=J(It),Jn=bn.next();!Jn.done;Jn=bn.next()){var no=Jn.value,$n=Object.getOwnPropertyDescriptor(L,no),Do=(Z&&no in Z?Z[no]:$n.get?je:fe)(D,no,$n,!0);Do&&Object.defineProperty(D,no,Do)}}catch(Kr){Re={error:Kr}}finally{try{Jn&&!Jn.done&&(lt=bn.return)&<.call(bn)}finally{if(Re)throw Re.error}}}finally{yr()}}function vi(D,L){return bl(sl(D,L))}function bl(D){var L,Z,fe={name:D.name};return D.observing&&D.observing.length>0&&(fe.dependencies=(L=D.observing,Z=[],L.forEach((function(Re){Z.indexOf(Re)===-1&&Z.push(Re)})),Z).map(bl)),fe}var Vi=0;function Ns(){this.message="FLOW_CANCELLED"}function Fl(D){arguments.length!==1&&h("Flow expects 1 argument and cannot be used as decorator");var L=D.name||"<unnamed flow>";return function(){var Z,fe=this,Re=arguments,lt=++Vi,It=br(L+" - runid: "+lt+" - init",D).apply(fe,Re),bn=void 0,Jn=new Promise((function(no,$n){var Do=0;function Kr(wi){var el;bn=void 0;try{el=br(L+" - runid: "+lt+" - yield "+Do++,It.next).call(It,wi)}catch(ks){return $n(ks)}ul(el)}function So(wi){var el;bn=void 0;try{el=br(L+" - runid: "+lt+" - yield "+Do++,It.throw).call(It,wi)}catch(ks){return $n(ks)}ul(el)}function ul(wi){if(!wi||typeof wi.then!="function")return wi.done?no(wi.value):(bn=Promise.resolve(wi.value)).then(Kr,So);wi.then(ul,$n)}Z=$n,Kr(void 0)}));return Jn.cancel=br(L+" - runid: "+lt+" - cancel",(function(){try{bn&&Ro(bn);var no=It.return(void 0),$n=Promise.resolve(no.value);$n.then(E,E),Ro($n),Z(new Ns)}catch(Do){Z(Do)}})),Jn}}function Ro(D){typeof D.cancel=="function"&&D.cancel()}function La(D,L){if(D==null)return!1;if(L!==void 0){if(ia(D)===!1||!D[F].values.has(L))return!1;var Z=sl(D,L);return oo(Z)}return oo(D)}function id(D){return arguments.length>1?h(!1):La(D)}function _u(D,L){return typeof L!="string"?h(!1):La(D,L)}function Ia(D,L){return D!=null&&(L!==void 0?!!ia(D)&&D[F].values.has(L):ia(D)||!!D[F]||z(D)||_l(D)||oo(D))}function ra(D){return arguments.length!==1&&h(!1),Ia(D)}function wl(D){return ia(D)?D[F].getKeys():Wi(D)||Ki(D)?Array.from(D.keys()):xl(D)?D.map((function(L,Z){return Z})):h(!1)}function qo(D){return ia(D)?wl(D).map((function(L){return D[L]})):Wi(D)?wl(D).map((function(L){return D.get(L)})):Ki(D)?Array.from(D.values()):xl(D)?D.slice():h(!1)}function Uh(D){return ia(D)?wl(D).map((function(L){return[L,D[L]]})):Wi(D)?wl(D).map((function(L){return[L,D.get(L)]})):Ki(D)?Array.from(D.entries()):xl(D)?D.map((function(L,Z){return[Z,L]})):h(!1)}function Fa(D,L,Z){if(arguments.length!==2||Ki(D))if(ia(D)){var fe=D[F],Re=fe.values.get(L);Re?fe.write(L,Z):fe.addObservableProp(L,Z,fe.defaultEnhancer)}else if(Wi(D))D.set(L,Z);else if(Ki(D))D.add(L);else{if(!xl(D))return h(!1);typeof L!="number"&&(L=parseInt(L,10)),v(L>=0,"Not a valid index: '"+L+"'"),Ui(),L>=D.length&&(D.length=L+1),D[L]=Z,yr()}else{Ui();var lt=L;try{for(var It in lt)Fa(D,It,lt[It])}finally{yr()}}}function _p(D,L,Z,fe){return typeof Z=="function"?(function(Re,lt,It,bn){return ka(Re,lt).observe(It,bn)})(D,L,Z,fe):(function(Re,lt,It){return ka(Re).observe(lt,It)})(D,L,Z)}Ns.prototype=Object.create(Error.prototype);var bp={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ba(D,L,Z,fe){return fe.detectCycles&&D.set(L,Z),Z}function Za(D,L,Z){if(!L.recurseEverything&&!ra(D)||typeof D!="object")return D;if(D===null)return null;if(D instanceof Date)return D;if(sr(D))return Za(D.get(),L,Z);if(ra(D)&&wl(D),L.detectCycles===!0&&D!==null&&Z.has(D))return Z.get(D);if(xl(D)||Array.isArray(D)){var fe=Ba(Z,D,[],L),Re=D.map((function(Kr){return Za(Kr,L,Z)}));fe.length=Re.length;for(var lt=0,It=Re.length;lt<It;lt++)fe[lt]=Re[lt];return fe}if(Ki(D)||Object.getPrototypeOf(D)===Set.prototype){if(L.exportMapsAsObjects===!1){var bn=Ba(Z,D,new Set,L);return D.forEach((function(Kr){bn.add(Za(Kr,L,Z))})),bn}var Jn=Ba(Z,D,[],L);return D.forEach((function(Kr){Jn.push(Za(Kr,L,Z))})),Jn}if(Wi(D)||Object.getPrototypeOf(D)===Map.prototype){if(L.exportMapsAsObjects===!1){var no=Ba(Z,D,new Map,L);return D.forEach((function(Kr,So){no.set(So,Za(Kr,L,Z))})),no}var $n=Ba(Z,D,{},L);return D.forEach((function(Kr,So){$n[So]=Za(Kr,L,Z)})),$n}var Do=Ba(Z,D,{},L);return R(D).forEach((function(Kr){Do[Kr]=Za(D[Kr],L,Z)})),Do}function rf(D,L){var Z;return typeof L=="boolean"&&(L={detectCycles:L}),L||(L=bp),L.detectCycles=L.detectCycles===void 0?L.recurseEverything===!0:L.detectCycles===!0,L.detectCycles&&(Z=new Map),Za(D,L,Z)}function Mo(D){switch(D.length){case 0:return Sn.trackingDerivation;case 1:return sl(D[0]);case 2:return sl(D[0],D[1])}}function oa(D,L){L===void 0&&(L=void 0),Ui();try{return D.apply(L)}finally{yr()}}function ad(D,L,Z){return arguments.length===1||L&&typeof L=="object"?of(D,L):wp(D,L,Z||{})}function wp(D,L,Z){var fe;typeof Z.timeout=="number"&&(fe=setTimeout((function(){if(!lt[F].isDisposed){lt();var It=new Error("WHEN_TIMEOUT");if(!Z.onError)throw It;Z.onError(It)}}),Z.timeout)),Z.name=Z.name||"When@"+f();var Re=_o(Z.name+"-effect",L),lt=ht((function(It){D()&&(It.dispose(),fe&&clearTimeout(fe),Re())}),Z);return lt}function of(D,L){var Z,fe=new Promise((function(Re,lt){var It=wp(D,Re,Q(Q({},L),{onError:lt}));Z=function(){It(),lt("WHEN_CANCELLED")}}));return fe.cancel=Z,fe}function ld(D){return D[F]}function ns(D){return typeof D=="string"||typeof D=="number"||typeof D=="symbol"}var $a={has:function(D,L){if(L===F||L==="constructor"||L===Ae)return!0;var Z=ld(D);return ns(L)?Z.has(L):L in D},get:function(D,L){if(L===F||L==="constructor"||L===Ae)return D[L];var Z=ld(D),fe=Z.values.get(L);if(fe instanceof U){var Re=fe.get();return Re===void 0&&Z.has(L),Re}return ns(L)&&Z.has(L),D[L]},set:function(D,L,Z){return!!ns(L)&&(Fa(D,L,Z),!0)},deleteProperty:function(D,L){return!!ns(L)&&(ld(D).remove(L),!0)},ownKeys:function(D){return ld(D).keysAtom.reportObserved(),Reflect.ownKeys(D)},preventExtensions:function(D){return h("Dynamic observable objects cannot be frozen"),!1}};function bu(D){var L=new Proxy(D,$a);return D[F].proxy=L,L}function Ja(D){return D.interceptors!==void 0&&D.interceptors.length>0}function El(D,L){var Z=D.interceptors||(D.interceptors=[]);return Z.push(L),_((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function vo(D,L){var Z=Le();try{for(var fe=Se(D.interceptors||[]),Re=0,lt=fe.length;Re<lt&&(v(!(L=fe[Re](L))||L.type,"Intercept handlers should return nothing or a change object"),L);Re++);return L}finally{dt(Z)}}function Ua(D){return D.changeListeners!==void 0&&D.changeListeners.length>0}function Bl(D,L){var Z=D.changeListeners||(D.changeListeners=[]);return Z.push(L),_((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function ha(D,L){var Z=Le(),fe=D.changeListeners;if(fe){for(var Re=0,lt=(fe=fe.slice()).length;Re<lt;Re++)fe[Re](L);dt(Z)}}var wu={get:function(D,L){return L===F?D[F]:L==="length"?D[F].getArrayLength():typeof L=="number"?ui.get.call(D,L):typeof L!="string"||isNaN(L)?ui.hasOwnProperty(L)?ui[L]:D[L]:ui.get.call(D,parseInt(L))},set:function(D,L,Z){return L==="length"&&D[F].setArrayLength(Z),typeof L=="number"&&ui.set.call(D,L,Z),typeof L=="symbol"||isNaN(L)?D[L]=Z:ui.set.call(D,parseInt(L),Z),!0},preventExtensions:function(D){return h("Observable arrays cannot be frozen"),!1}};function Ks(D,L,Z,fe){Z===void 0&&(Z="ObservableArray@"+f()),fe===void 0&&(fe=!1);var Re,lt,It,bn=new $l(Z,L,fe);Re=bn.values,lt=F,It=bn,Object.defineProperty(Re,lt,{enumerable:!1,writable:!1,configurable:!0,value:It});var Jn=new Proxy(bn.values,wu);if(bn.proxy=Jn,D&&D.length){var no=ut(!0);bn.spliceWithArray(0,0,D),gn(no)}return Jn}var $l=(function(){function D(L,Z,fe){this.owned=fe,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new U(L||"ObservableArray@"+f()),this.enhancer=function(Re,lt){return Z(Re,lt,L+"[..]")}}return D.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},D.prototype.dehanceValues=function(L){return this.dehancer!==void 0&&L.length>0?L.map(this.dehancer):L},D.prototype.intercept=function(L){return El(this,L)},D.prototype.observe=function(L,Z){return Z===void 0&&(Z=!1),Z&&L({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Bl(this,L)},D.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},D.prototype.setArrayLength=function(L){if(typeof L!="number"||L<0)throw new Error("[mobx.array] Out of range: "+L);var Z=this.values.length;if(L!==Z)if(L>Z){for(var fe=new Array(L-Z),Re=0;Re<L-Z;Re++)fe[Re]=void 0;this.spliceWithArray(Z,0,fe)}else this.spliceWithArray(L,Z-L)},D.prototype.updateArrayLength=function(L,Z){if(L!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=Z},D.prototype.spliceWithArray=function(L,Z,fe){var Re=this;qt(this.atom);var lt=this.values.length;if(L===void 0?L=0:L>lt?L=lt:L<0&&(L=Math.max(0,lt+L)),Z=arguments.length===1?lt-L:Z==null?0:Math.max(0,Math.min(Z,lt-L)),fe===void 0&&(fe=s),Ja(this)){var It=vo(this,{object:this.proxy,type:"splice",index:L,removedCount:Z,added:fe});if(!It)return s;Z=It.removedCount,fe=It.added}fe=fe.length===0?fe:fe.map((function(Jn){return Re.enhancer(Jn,void 0)}));var bn=this.spliceItemsIntoValues(L,Z,fe);return Z===0&&fe.length===0||this.notifyArraySplice(L,fe,bn),this.dehanceValues(bn)},D.prototype.spliceItemsIntoValues=function(L,Z,fe){var Re;if(fe.length<1e4)return(Re=this.values).splice.apply(Re,Se([L,Z],fe));var lt=this.values.slice(L,L+Z);return this.values=this.values.slice(0,L).concat(fe,this.values.slice(L+Z)),lt},D.prototype.notifyArrayChildUpdate=function(L,Z,fe){var Re=!this.owned&&!1,lt=Ua(this),It=lt||Re?{object:this.proxy,type:"update",index:L,newValue:Z,oldValue:fe}:null;this.atom.reportChanged(),lt&&ha(this,It)},D.prototype.notifyArraySplice=function(L,Z,fe){var Re=!this.owned&&!1,lt=Ua(this),It=lt||Re?{object:this.proxy,type:"splice",index:L,removed:fe,added:Z,removedCount:fe.length,addedCount:Z.length}:null;this.atom.reportChanged(),lt&&ha(this,It)},D})(),ui={intercept:function(D){return this[F].intercept(D)},observe:function(D,L){return L===void 0&&(L=!1),this[F].observe(D,L)},clear:function(){return this.splice(0)},replace:function(D){var L=this[F];return L.spliceWithArray(0,L.values.length,D)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(D,L){for(var Z=[],fe=2;fe<arguments.length;fe++)Z[fe-2]=arguments[fe];var Re=this[F];switch(arguments.length){case 0:return[];case 1:return Re.spliceWithArray(D);case 2:return Re.spliceWithArray(D,L)}return Re.spliceWithArray(D,L,Z)},spliceWithArray:function(D,L,Z){return this[F].spliceWithArray(D,L,Z)},push:function(){for(var D=[],L=0;L<arguments.length;L++)D[L]=arguments[L];var Z=this[F];return Z.spliceWithArray(Z.values.length,0,D),Z.values.length},pop:function(){return this.splice(Math.max(this[F].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var D=[],L=0;L<arguments.length;L++)D[L]=arguments[L];var Z=this[F];return Z.spliceWithArray(0,0,D),Z.values.length},reverse:function(){var D=this.slice();return D.reverse.apply(D,arguments)},sort:function(D){var L=this.slice();return L.sort.apply(L,arguments)},remove:function(D){var L=this[F],Z=L.dehanceValues(L.values).indexOf(D);return Z>-1&&(this.splice(Z,1),!0)},get:function(D){var L=this[F];if(L&&D<L.values.length)return L.atom.reportObserved(),L.dehanceValue(L.values[D])},set:function(D,L){var Z=this[F],fe=Z.values;if(D<fe.length){qt(Z.atom);var Re=fe[D];if(Ja(Z)){var lt=vo(Z,{type:"update",object:Z.proxy,index:D,newValue:L});if(!lt)return;L=lt.newValue}(L=Z.enhancer(L,Re))!==Re&&(fe[D]=L,Z.notifyArrayChildUpdate(D,L,Re))}else{if(D!==fe.length)throw new Error("[mobx.array] Index out of bounds, "+D+" is larger than "+fe.length);Z.spliceWithArray(D,0,[L])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(D){typeof Array.prototype[D]=="function"&&(ui[D]=function(){var L=this[F];L.atom.reportObserved();var Z=L.dehanceValues(L.values);return Z[D].apply(Z,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(D){typeof Array.prototype[D]=="function"&&(ui[D]=function(L,Z){var fe=this,Re=this[F];return Re.atom.reportObserved(),Re.dehanceValues(Re.values)[D]((function(lt,It){return L.call(Z,lt,It,fe)}),Z)})})),["reduce","reduceRight"].forEach((function(D){ui[D]=function(){var L=this,Z=this[F];Z.atom.reportObserved();var fe=arguments[0];return arguments[0]=function(Re,lt,It){return lt=Z.dehanceValue(lt),fe(Re,lt,It,L)},Z.values[D].apply(Z.values,arguments)}}));var lc,rs=M("ObservableArrayAdministration",$l);function xl(D){return O(D)&&rs(D[F])}var af,Vh={},lf=(function(){function D(L,Z,fe){if(Z===void 0&&(Z=le),fe===void 0&&(fe="ObservableMap@"+f()),this.enhancer=Z,this.name=fe,this[lc]=Vh,this._keysAtom=X(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(L)}return D.prototype._has=function(L){return this._data.has(L)},D.prototype.has=function(L){var Z=this;if(!Sn.trackingDerivation)return this._has(L);var fe=this._hasMap.get(L);if(!fe){var Re=fe=new Fn(this._has(L),Ze,this.name+"."+P(L)+"?",!1);this._hasMap.set(L,Re),nr(Re,(function(){return Z._hasMap.delete(L)}))}return fe.get()},D.prototype.set=function(L,Z){var fe=this._has(L);if(Ja(this)){var Re=vo(this,{type:fe?"update":"add",object:this,newValue:Z,name:L});if(!Re)return this;Z=Re.newValue}return fe?this._updateValue(L,Z):this._addValue(L,Z),this},D.prototype.delete=function(L){var Z=this;if(qt(this._keysAtom),Ja(this)&&!(Re=vo(this,{type:"delete",object:this,name:L})))return!1;if(this._has(L)){var fe=Ua(this),Re=fe?{type:"delete",object:this,oldValue:this._data.get(L).value,name:L}:null;return oa((function(){Z._keysAtom.reportChanged(),Z._updateHasMapEntry(L,!1),Z._data.get(L).setNewValue(void 0),Z._data.delete(L)})),fe&&ha(this,Re),!0}return!1},D.prototype._updateHasMapEntry=function(L,Z){var fe=this._hasMap.get(L);fe&&fe.setNewValue(Z)},D.prototype._updateValue=function(L,Z){var fe=this._data.get(L);if((Z=fe.prepareNewValue(Z))!==Sn.UNCHANGED){var Re=Ua(this),lt=Re?{type:"update",object:this,oldValue:fe.value,name:L,newValue:Z}:null;fe.setNewValue(Z),Re&&ha(this,lt)}},D.prototype._addValue=function(L,Z){var fe=this;qt(this._keysAtom),oa((function(){var It=new Fn(Z,fe.enhancer,fe.name+"."+P(L),!1);fe._data.set(L,It),Z=It.value,fe._updateHasMapEntry(L,!0),fe._keysAtom.reportChanged()}));var Re=Ua(this),lt=Re?{type:"add",object:this,name:L,newValue:Z}:null;Re&&ha(this,lt)},D.prototype.get=function(L){return this.has(L)?this.dehanceValue(this._data.get(L).get()):this.dehanceValue(void 0)},D.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},D.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},D.prototype.values=function(){var L=this,Z=this.keys();return go({next:function(){var fe=Z.next(),Re=fe.done,lt=fe.value;return{done:Re,value:Re?void 0:L.get(lt)}}})},D.prototype.entries=function(){var L=this,Z=this.keys();return go({next:function(){var fe=Z.next(),Re=fe.done,lt=fe.value;return{done:Re,value:Re?void 0:[lt,L.get(lt)]}}})},D.prototype[lc=F,Symbol.iterator]=function(){return this.entries()},D.prototype.forEach=function(L,Z){var fe,Re;try{for(var lt=J(this),It=lt.next();!It.done;It=lt.next()){var bn=ie(It.value,2),Jn=bn[0],no=bn[1];L.call(Z,no,Jn,this)}}catch($n){fe={error:$n}}finally{try{It&&!It.done&&(Re=lt.return)&&Re.call(lt)}finally{if(fe)throw fe.error}}},D.prototype.merge=function(L){var Z=this;return Wi(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{w(L)?R(L).forEach((function(Re){return Z.set(Re,L[Re])})):Array.isArray(L)?L.forEach((function(Re){var lt=ie(Re,2),It=lt[0],bn=lt[1];return Z.set(It,bn)})):T(L)?(L.constructor!==Map&&h("Cannot initialize from classes that inherit from Map: "+L.constructor.name),L.forEach((function(Re,lt){return Z.set(lt,Re)}))):L!=null&&h("Cannot initialize map from "+L)}finally{gn(fe)}})),this},D.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L.keys()),lt=Re.next();!lt.done;lt=Re.next()){var It=lt.value;L.delete(It)}}catch(bn){Z={error:bn}}finally{try{lt&&!lt.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},D.prototype.replace=function(L){var Z=this;return oa((function(){var fe,Re,lt,It,bn=(function(Zi){if(T(Zi)||Wi(Zi))return Zi;if(Array.isArray(Zi))return new Map(Zi);if(w(Zi)){var Js=new Map;for(var Rs in Zi)Js.set(Rs,Zi[Rs]);return Js}return h("Cannot convert to map from '"+Zi+"'")})(L),Jn=new Map,no=!1;try{for(var $n=J(Z._data.keys()),Do=$n.next();!Do.done;Do=$n.next()){var Kr=Do.value;if(!bn.has(Kr))if(Z.delete(Kr))no=!0;else{var So=Z._data.get(Kr);Jn.set(Kr,So)}}}catch(Zi){fe={error:Zi}}finally{try{Do&&!Do.done&&(Re=$n.return)&&Re.call($n)}finally{if(fe)throw fe.error}}try{for(var ul=J(bn.entries()),wi=ul.next();!wi.done;wi=ul.next()){var el=ie(wi.value,2),ks=(Kr=el[0],So=el[1],Z._data.has(Kr));if(Z.set(Kr,So),Z._data.has(Kr)){var Ps=Z._data.get(Kr);Jn.set(Kr,Ps),ks||(no=!0)}}}catch(Zi){lt={error:Zi}}finally{try{wi&&!wi.done&&(It=ul.return)&&It.call(ul)}finally{if(lt)throw lt.error}}if(!no)if(Z._data.size!==Jn.size)Z._keysAtom.reportChanged();else for(var Zs=Z._data.keys(),Eu=Jn.keys(),is=Zs.next(),xu=Eu.next();!is.done;){if(is.value!==xu.value){Z._keysAtom.reportChanged();break}is=Zs.next(),xu=Eu.next()}Z._data=Jn})),this},Object.defineProperty(D.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),D.prototype.toPOJO=function(){var L,Z,fe={};try{for(var Re=J(this),lt=Re.next();!lt.done;lt=Re.next()){var It=ie(lt.value,2),bn=It[0],Jn=It[1];fe[typeof bn=="symbol"?bn:P(bn)]=Jn}}catch(no){L={error:no}}finally{try{lt&&!lt.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},D.prototype.toJS=function(){return new Map(this)},D.prototype.toJSON=function(){return this.toPOJO()},D.prototype.toString=function(){var L=this;return this.name+"[{ "+Array.from(this.keys()).map((function(Z){return P(Z)+": "+L.get(Z)})).join(", ")+" }]"},D.prototype.observe=function(L,Z){return Bl(this,L)},D.prototype.intercept=function(L){return El(this,L)},D})(),Wi=M("ObservableMap",lf),sc={},os=(function(){function D(L,Z,fe){if(Z===void 0&&(Z=le),fe===void 0&&(fe="ObservableSet@"+f()),this.name=fe,this[af]=sc,this._data=new Set,this._atom=X(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(Re,lt){return Z(Re,lt,fe)},L&&this.replace(L)}return D.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},D.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L._data.values()),lt=Re.next();!lt.done;lt=Re.next()){var It=lt.value;L.delete(It)}}catch(bn){Z={error:bn}}finally{try{lt&&!lt.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},D.prototype.forEach=function(L,Z){var fe,Re;try{for(var lt=J(this),It=lt.next();!It.done;It=lt.next()){var bn=It.value;L.call(Z,bn,bn,this)}}catch(Jn){fe={error:Jn}}finally{try{It&&!It.done&&(Re=lt.return)&&Re.call(lt)}finally{if(fe)throw fe.error}}},Object.defineProperty(D.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),D.prototype.add=function(L){var Z=this;if(qt(this._atom),Ja(this)&&!(Re=vo(this,{type:"add",object:this,newValue:L})))return this;if(!this.has(L)){oa((function(){Z._data.add(Z.enhancer(L,void 0)),Z._atom.reportChanged()}));var fe=Ua(this),Re=fe?{type:"add",object:this,newValue:L}:null;fe&&ha(this,Re)}return this},D.prototype.delete=function(L){var Z=this;if(Ja(this)&&!(Re=vo(this,{type:"delete",object:this,oldValue:L})))return!1;if(this.has(L)){var fe=Ua(this),Re=fe?{type:"delete",object:this,oldValue:L}:null;return oa((function(){Z._atom.reportChanged(),Z._data.delete(L)})),fe&&ha(this,Re),!0}return!1},D.prototype.has=function(L){return this._atom.reportObserved(),this._data.has(this.dehanceValue(L))},D.prototype.entries=function(){var L=0,Z=Array.from(this.keys()),fe=Array.from(this.values());return go({next:function(){var Re=L;return L+=1,Re<fe.length?{value:[Z[Re],fe[Re]],done:!1}:{done:!0}}})},D.prototype.keys=function(){return this.values()},D.prototype.values=function(){this._atom.reportObserved();var L=this,Z=0,fe=Array.from(this._data.values());return go({next:function(){return Z<fe.length?{value:L.dehanceValue(fe[Z++]),done:!1}:{done:!0}}})},D.prototype.replace=function(L){var Z=this;return Ki(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{Array.isArray(L)||B(L)?(Z.clear(),L.forEach((function(Re){return Z.add(Re)}))):L!=null&&h("Cannot initialize set from "+L)}finally{gn(fe)}})),this},D.prototype.observe=function(L,Z){return Bl(this,L)},D.prototype.intercept=function(L){return El(this,L)},D.prototype.toJS=function(){return new Set(this)},D.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},D.prototype[af=F,Symbol.iterator]=function(){return this.values()},D})(),Ki=M("ObservableSet",os),sf=(function(){function D(L,Z,fe,Re){Z===void 0&&(Z=new Map),this.target=L,this.values=Z,this.name=fe,this.defaultEnhancer=Re,this.keysAtom=new U(fe+".keys")}return D.prototype.read=function(L){return this.values.get(L).get()},D.prototype.write=function(L,Z){var fe=this.target,Re=this.values.get(L);if(Re instanceof wo)Re.set(Z);else{if(Ja(this)){if(!(It=vo(this,{type:"update",object:this.proxy||fe,name:L,newValue:Z})))return;Z=It.newValue}if((Z=Re.prepareNewValue(Z))!==Sn.UNCHANGED){var lt=Ua(this),It=lt?{type:"update",object:this.proxy||fe,oldValue:Re.value,name:L,newValue:Z}:null;Re.setNewValue(Z),lt&&ha(this,It)}}},D.prototype.has=function(L){var Z=this.pendingKeys||(this.pendingKeys=new Map),fe=Z.get(L);if(fe)return fe.get();var Re=!!this.values.get(L);return fe=new Fn(Re,Ze,this.name+"."+P(L)+"?",!1),Z.set(L,fe),fe.get()},D.prototype.addObservableProp=function(L,Z,fe){fe===void 0&&(fe=this.defaultEnhancer);var Re=this.target;if(Ja(this)){var lt=vo(this,{object:this.proxy||Re,name:L,type:"add",newValue:Z});if(!lt)return;Z=lt.newValue}var It=new Fn(Z,fe,this.name+"."+P(L),!1);this.values.set(L,It),Z=It.value,Object.defineProperty(Re,L,(function(bn){return Ol[bn]||(Ol[bn]={configurable:!0,enumerable:!0,get:function(){return this[F].read(bn)},set:function(Jn){this[F].write(bn,Jn)}})})(L)),this.notifyPropertyAddition(L,Z)},D.prototype.addComputedProp=function(L,Z,fe){var Re,lt,It,bn=this.target;fe.name=fe.name||this.name+"."+P(Z),this.values.set(Z,new wo(fe)),(L===bn||(Re=L,lt=Z,!(It=Object.getOwnPropertyDescriptor(Re,lt))||It.configurable!==!1&&It.writable!==!1))&&Object.defineProperty(L,Z,(function(Jn){return sd[Jn]||(sd[Jn]={configurable:Sn.computedConfigurable,enumerable:!1,get:function(){return Va(this).read(Jn)},set:function(no){Va(this).write(Jn,no)}})})(Z))},D.prototype.remove=function(L){if(this.values.has(L)){var Z=this.target;if(Ja(this)&&!(Jn=vo(this,{object:this.proxy||Z,name:L,type:"remove"})))return;try{Ui();var fe=Ua(this),Re=!1,lt=this.values.get(L),It=lt&<.get();if(lt&<.set(void 0),this.keysAtom.reportChanged(),this.values.delete(L),this.pendingKeys){var bn=this.pendingKeys.get(L);bn&&bn.set(!1)}delete this.target[L];var Jn=fe?{type:"remove",object:this.proxy||Z,oldValue:It,name:L}:null;fe&&ha(this,Jn)}finally{yr()}}},D.prototype.illegalAccess=function(L,Z){},D.prototype.observe=function(L,Z){return Bl(this,L)},D.prototype.intercept=function(L){return El(this,L)},D.prototype.notifyPropertyAddition=function(L,Z){var fe=Ua(this),Re=fe?{type:"add",object:this.proxy||this.target,name:L,newValue:Z}:null;if(fe&&ha(this,Re),this.pendingKeys){var lt=this.pendingKeys.get(L);lt&<.set(!0)}this.keysAtom.reportChanged()},D.prototype.getKeys=function(){var L,Z;this.keysAtom.reportObserved();var fe=[];try{for(var Re=J(this.values),lt=Re.next();!lt.done;lt=Re.next()){var It=ie(lt.value,2),bn=It[0];It[1]instanceof Fn&&fe.push(bn)}}catch(Jn){L={error:Jn}}finally{try{lt&&!lt.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},D})();function ll(D,L,Z){if(L===void 0&&(L=""),Z===void 0&&(Z=le),Object.prototype.hasOwnProperty.call(D,F))return D[F];w(D)||(L=(D.constructor.name||"ObservableObject")+"@"+f()),L||(L="ObservableObject@"+f());var fe=new sf(D,new Map,P(L),Z);return S(D,F,fe),fe}var Ol=Object.create(null),sd=Object.create(null);function Va(D){var L=D[F];return L||(Be(D),D[F])}var Qa=M("ObservableObjectAdministration",sf);function ia(D){return!!O(D)&&(Be(D),Qa(D[F]))}function sl(D,L){if(typeof D=="object"&&D!==null){if(xl(D))return L!==void 0&&h(!1),D[F].atom;if(Ki(D))return D[F];if(Wi(D)){var Z=D;return L===void 0?Z._keysAtom:((fe=Z._data.get(L)||Z._hasMap.get(L))||h(!1),fe)}var fe;if(Be(D),L&&!D[F]&&D[L],ia(D))return L?((fe=D[F].values.get(L))||h(!1),fe):h(!1);if(z(D)||oo(D)||_l(D))return D}else if(typeof D=="function"&&_l(D[F]))return D[F];return h(!1)}function ka(D,L){return D||h("Expecting some object"),L!==void 0?ka(sl(D,L)):z(D)||oo(D)||_l(D)||Wi(D)||Ki(D)?D:(Be(D),D[F]?D[F]:void h(!1))}var Ct=Object.prototype.toString;function un(D,L,Z){return Z===void 0&&(Z=-1),fn(D,L,Z)}function fn(D,L,Z,fe,Re){if(D===L)return D!==0||1/D==1/L;if(D==null||L==null)return!1;if(D!=D)return L!=L;var lt=typeof D;if(lt!=="function"&<!=="object"&&typeof L!="object")return!1;var It=Ct.call(D);if(It!==Ct.call(L))return!1;switch(It){case"[object RegExp]":case"[object String]":return""+D==""+L;case"[object Number]":return+D!=+D?+L!=+L:+D==0?1/+D==1/L:+D==+L;case"[object Date]":case"[object Boolean]":return+D==+L;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(D)===Symbol.valueOf.call(L);case"[object Map]":case"[object Set]":Z>=0&&Z++}D=Gn(D),L=Gn(L);var bn=It==="[object Array]";if(!bn){if(typeof D!="object"||typeof L!="object")return!1;var Jn=D.constructor,no=L.constructor;if(Jn!==no&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof no=="function"&&no instanceof no)&&"constructor"in D&&"constructor"in L)return!1}if(Z===0)return!1;Z<0&&(Z=-1),Re=Re||[];for(var $n=(fe=fe||[]).length;$n--;)if(fe[$n]===D)return Re[$n]===L;if(fe.push(D),Re.push(L),bn){if(($n=D.length)!==L.length)return!1;for(;$n--;)if(!fn(D[$n],L[$n],Z-1,fe,Re))return!1}else{var Do=Object.keys(D),Kr=void 0;if($n=Do.length,Object.keys(L).length!==$n)return!1;for(;$n--;)if(!Wr(L,Kr=Do[$n])||!fn(D[Kr],L[Kr],Z-1,fe,Re))return!1}return fe.pop(),Re.pop(),!0}function Gn(D){return xl(D)?D.slice():T(D)||Wi(D)||B(D)||Ki(D)?Array.from(D.entries()):D}function Wr(D,L){return Object.prototype.hasOwnProperty.call(D,L)}function go(D){return D[Symbol.iterator]=ci,D}function ci(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ve,extras:{getDebugName:function(D,L){return(L!==void 0?sl(D,L):ia(D)||Wi(D)||Ki(D)?ka(D):sl(D)).name}},$mobx:F})}).call(this,r(163),r(68))},function(n,o,r){var i=r(113),a=r(42),s=r(179);i||a(Object.prototype,"toString",s,{unsafe:!0})},function(n,o,r){var i=r(41),a=r(100),s=r(80),l=r(58),f=r(116),h="Array Iterator",v=l.set,_=l.getterFor(h);n.exports=f(Array,"Array",(function(E,O){v(this,{type:h,target:i(E),index:0,kind:O})}),(function(){var E=_(this),O=E.target,w=E.kind,S=E.index++;return!O||S>=O.length?(E.target=void 0,{value:void 0,done:!0}):w=="keys"?{value:S,done:!1}:w=="values"?{value:O[S],done:!1}:{value:[S,O[S]],done:!1}}),"values"),s.Arguments=s.Array,a("keys"),a("values"),a("entries")},function(n,o,r){var i=r(16),a=r(7),s=r(46),l=r(76),f=r(34),h=r(15),v=r(71),_=r(36),E=r(108),O=r(18),w=r(35),S=r(96),M=r(30),T=r(33),B=r(54),R=r(87),P=r(32),$=r(40),I=r(41),F=r(86),U=r(39),z=r(69),X=r(60),Y=r(77),W=r(74),Q=r(139),J=r(112),ie=r(50),Se=r(38),Ae=r(84),Pe=r(98),De=r(42),He=r(89),Ye=r(93),Be=r(72),Je=r(90),mt=r(28),le=r(140),Ze=r(141),pe=r(78),se=r(58),we=r(79).forEach,$e=Ye("hidden"),rt="Symbol",pt=mt("toPrimitive"),Lt=se.set,Jt=se.getterFor(rt),en=Object.prototype,zt=a.Symbol,it=zt&&zt.prototype,ae=a.TypeError,re=a.QObject,je=s("JSON","stringify"),vt=ie.f,q=Se.f,kt=Q.f,Rt=Ae.f,Gt=h([].push),Pn=He("symbols"),qt=He("op-symbols"),On=He("string-to-symbol-registry"),ke=He("symbol-to-string-registry"),Ke=He("wks"),Le=!re||!re.prototype||!re.prototype.findChild,dt=_&&O((function(){return X(q({},"a",{get:function(){return q(this,"a",{value:7}).a}})).a!=7}))?function(Nn,qn,rr){var ut=vt(en,qn);ut&&delete en[qn],q(Nn,qn,rr),ut&&Nn!==en&&q(en,qn,ut)}:q,At=function(Nn,qn){var rr=Pn[Nn]=X(it);return Lt(rr,{type:rt,tag:Nn,description:qn}),_||(rr.description=qn),rr},Tt=function(Nn,qn,rr){Nn===en&&Tt(qt,qn,rr),P(Nn);var ut=F(qn);return P(rr),w(Pn,ut)?(rr.enumerable?(w(Nn,$e)&&Nn[$e][ut]&&(Nn[$e][ut]=!1),rr=X(rr,{enumerable:z(0,!1)})):(w(Nn,$e)||q(Nn,$e,z(1,{})),Nn[$e][ut]=!0),dt(Nn,ut,rr)):q(Nn,ut,rr)},En=function(Nn,qn){P(Nn);var rr=I(qn),ut=Y(rr).concat(_o(rr));return we(ut,(function(gn){_&&!f(Zn,rr,gn)||Tt(Nn,gn,rr[gn])})),Nn},Zn=function(Nn){var qn=F(Nn),rr=f(Rt,this,qn);return!(this===en&&w(Pn,qn)&&!w(qt,qn))&&(!(rr||!w(this,qn)||!w(Pn,qn)||w(this,$e)&&this[$e][qn])||rr)},ao=function(Nn,qn){var rr=I(Nn),ut=F(qn);if(rr!==en||!w(Pn,ut)||w(qt,ut)){var gn=vt(rr,ut);return!gn||!w(Pn,ut)||w(rr,$e)&&rr[$e][ut]||(gn.enumerable=!0),gn}},Lo=function(Nn){var qn=kt(I(Nn)),rr=[];return we(qn,(function(ut){w(Pn,ut)||w(Be,ut)||Gt(rr,ut)})),rr},_o=function(Nn){var qn=Nn===en,rr=kt(qn?qt:I(Nn)),ut=[];return we(rr,(function(gn){!w(Pn,gn)||qn&&!w(en,gn)||Gt(ut,Pn[gn])})),ut};if(E||(zt=function(){if(B(it,this))throw ae("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?U(arguments[0]):void 0,qn=Je(Nn),rr=function(ut){this===en&&f(rr,qt,ut),w(this,$e)&&w(this[$e],qn)&&(this[$e][qn]=!1),dt(this,qn,z(1,ut))};return _&&Le&&dt(en,qn,{configurable:!0,set:rr}),At(qn,Nn)},De(it=zt.prototype,"toString",(function(){return Jt(this).tag})),De(zt,"withoutSetter",(function(Nn){return At(Je(Nn),Nn)})),Ae.f=Zn,Se.f=Tt,ie.f=ao,W.f=Q.f=Lo,J.f=_o,le.f=function(Nn){return At(mt(Nn),Nn)},_&&(q(it,"description",{configurable:!0,get:function(){return Jt(this).description}}),v||De(en,"propertyIsEnumerable",Zn,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!E,sham:!E},{Symbol:zt}),we(Y(Ke),(function(Nn){Ze(Nn)})),i({target:rt,stat:!0,forced:!E},{for:function(Nn){var qn=U(Nn);if(w(On,qn))return On[qn];var rr=zt(qn);return On[qn]=rr,ke[rr]=qn,rr},keyFor:function(Nn){if(!R(Nn))throw ae(Nn+" is not a symbol");if(w(ke,Nn))return ke[Nn]},useSetter:function(){Le=!0},useSimple:function(){Le=!1}}),i({target:"Object",stat:!0,forced:!E,sham:!_},{create:function(Nn,qn){return qn===void 0?X(Nn):En(X(Nn),qn)},defineProperty:Tt,defineProperties:En,getOwnPropertyDescriptor:ao}),i({target:"Object",stat:!0,forced:!E},{getOwnPropertyNames:Lo,getOwnPropertySymbols:_o}),i({target:"Object",stat:!0,forced:O((function(){J.f(1)}))},{getOwnPropertySymbols:function(Nn){return J.f($(Nn))}}),je&&i({target:"JSON",stat:!0,forced:!E||O((function(){var Nn=zt();return je([Nn])!="[null]"||je({a:Nn})!="{}"||je(Object(Nn))!="{}"}))},{stringify:function(Nn,qn,rr){var ut=Pe(arguments),gn=qn;if((T(qn)||Nn!==void 0)&&!R(Nn))return S(qn)||(qn=function(Fn,sr){if(M(gn)&&(sr=f(gn,this,Fn,sr)),!R(sr))return sr}),ut[1]=qn,l(je,null,ut)}}),!it[pt]){var ho=it.valueOf;De(it,pt,(function(Nn){return f(ho,this)}))}pe(zt,rt),Be[$e]=!0},function(n,o,r){var i=r(7),a=r(152),s=r(153),l=r(3),f=r(57),h=r(28),v=h("iterator"),_=h("toStringTag"),E=l.values,O=function(S,M){if(S){if(S[v]!==E)try{f(S,v,E)}catch{S[v]=E}if(S[_]||f(S,_,M),a[M]){for(var T in l)if(S[T]!==l[T])try{f(S,T,l[T])}catch{S[T]=l[T]}}}};for(var w in a)O(i[w]&&i[w].prototype,w);O(s,"DOMTokenList")},function(n,o,r){var i=r(151).charAt,a=r(39),s=r(58),l=r(116),f="String Iterator",h=s.set,v=s.getterFor(f);l(String,"String",(function(_){h(this,{type:f,string:a(_),index:0})}),(function(){var _,E=v(this),O=E.string,w=E.index;return w>=O.length?{value:void 0,done:!0}:(_=i(O,w),E.index+=_.length,{value:_,done:!1})}))},function(n,o,r){(function(i){var a=function(s){return s&&s.Math==Math&&s};n.exports=a(typeof globalThis=="object"&&globalThis)||a(typeof window=="object"&&window)||a(typeof self=="object"&&self)||a(typeof i=="object"&&i)||(function(){return this})()||Function("return this")()}).call(this,r(68))},function(n,o,r){var i=r(16),a=r(36),s=r(7),l=r(15),f=r(35),h=r(30),v=r(54),_=r(39),E=r(38).f,O=r(134),w=s.Symbol,S=w&&w.prototype;if(a&&h(w)&&(!("description"in S)||w().description!==void 0)){var M={},T=function(){var U=arguments.length<1||arguments[0]===void 0?void 0:_(arguments[0]),z=v(S,this)?new w(U):U===void 0?w():w(U);return U===""&&(M[z]=!0),z};O(T,w),T.prototype=S,S.constructor=T;var B=String(w("test"))=="Symbol(test)",R=l(S.toString),P=l(S.valueOf),$=/^Symbol\((.*)\)[^)]+$/,I=l("".replace),F=l("".slice);E(S,"description",{configurable:!0,get:function(){var U=P(this),z=R(U);if(f(M,U))return"";var X=B?F(z,7,-1):I(z,$,"$1");return X===""?void 0:X}}),i({global:!0,forced:!0},{Symbol:T})}},function(n,o,r){r(141)("iterator")},function(n,o,r){r.d(o,"a",(function(){return l.a})),r.d(o,"c",(function(){return l.e})),r.d(o,"h",(function(){return $})),r.d(o,"i",(function(){return B})),r.d(o,"j",(function(){return M})),r.d(o,"b",(function(){return ie})),r.d(o,"e",(function(){return De})),r.d(o,"f",(function(){return Se})),r.d(o,"g",(function(){return Pn}));var i,a,s,l=r(0),f=0,h=[],v=l.i.__b,_=l.i.__r,E=l.i.diffed,O=l.i.__c,w=l.i.unmount;function S(ke,Ke){l.i.__h&&l.i.__h(a,ke,f||Ke),f=0;var Le=a.__H||(a.__H={__:[],__h:[]});return ke>=Le.__.length&&Le.__.push({}),Le.__[ke]}function M(ke){return f=1,T(W,ke)}function T(ke,Ke,Le){var dt=S(i++,2);return dt.t=ke,dt.__c||(dt.__=[Le?Le(Ke):W(void 0,Ke),function(At){var Tt=dt.t(dt.__[0],At);dt.__[0]!==Tt&&(dt.__=[Tt,dt.__[1]],dt.__c.setState({}))}],dt.__c=a),dt.__}function B(ke,Ke){var Le=S(i++,3);!l.i.__s&&Y(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__H.__h.push(Le))}function R(ke,Ke){var Le=S(i++,4);!l.i.__s&&Y(Le.__H,Ke)&&(Le.__=ke,Le.__H=Ke,a.__h.push(Le))}function P(ke,Ke){var Le=S(i++,7);return Y(Le.__H,Ke)&&(Le.__=ke(),Le.__H=Ke,Le.__h=ke),Le.__}function $(ke,Ke){return f=8,P((function(){return ke}),Ke)}function I(){var ke;for(h.sort((function(Ke,Le){return Ke.__v.__b-Le.__v.__b}));ke=h.pop();)if(ke.__P)try{ke.__H.__h.forEach(z),ke.__H.__h.forEach(X),ke.__H.__h=[]}catch(Ke){ke.__H.__h=[],l.i.__e(Ke,ke.__v)}}l.i.__b=function(ke){a=null,v&&v(ke)},l.i.__r=function(ke){_&&_(ke),i=0;var Ke=(a=ke.__c).__H;Ke&&(Ke.__h.forEach(z),Ke.__h.forEach(X),Ke.__h=[])},l.i.diffed=function(ke){E&&E(ke);var Ke=ke.__c;Ke&&Ke.__H&&Ke.__H.__h.length&&(h.push(Ke)!==1&&s===l.i.requestAnimationFrame||((s=l.i.requestAnimationFrame)||U)(I)),a=null},l.i.__c=function(ke,Ke){Ke.some((function(Le){try{Le.__h.forEach(z),Le.__h=Le.__h.filter((function(dt){return!dt.__||X(dt)}))}catch(dt){Ke.some((function(At){At.__h&&(At.__h=[])})),Ke=[],l.i.__e(dt,Le.__v)}})),O&&O(ke,Ke)},l.i.unmount=function(ke){w&&w(ke);var Ke,Le=ke.__c;Le&&Le.__H&&(Le.__H.__.forEach((function(dt){try{z(dt)}catch(At){Ke=At}})),Ke&&l.i.__e(Ke,Le.__v))};var F=typeof requestAnimationFrame=="function";function U(ke){var Ke,Le=function(){clearTimeout(dt),F&&cancelAnimationFrame(Ke),setTimeout(ke)},dt=setTimeout(Le,100);F&&(Ke=requestAnimationFrame(Le))}function z(ke){var Ke=a,Le=ke.__c;typeof Le=="function"&&(ke.__c=void 0,Le()),a=Ke}function X(ke){var Ke=a;ke.__c=ke.__(),a=Ke}function Y(ke,Ke){return!ke||ke.length!==Ke.length||Ke.some((function(Le,dt){return Le!==ke[dt]}))}function W(ke,Ke){return typeof Ke=="function"?Ke(ke):Ke}function Q(ke,Ke){for(var Le in Ke)ke[Le]=Ke[Le];return ke}function J(ke,Ke){for(var Le in ke)if(Le!=="__source"&&!(Le in Ke))return!0;for(var dt in Ke)if(dt!=="__source"&&ke[dt]!==Ke[dt])return!0;return!1}function ie(ke){this.props=ke}function Se(ke,Ke){function Le(At){var Tt=this.props.ref,En=Tt==At.ref;return!En&&Tt&&(Tt.call?Tt(null):Tt.current=null),Ke?!Ke(this.props,At)||!En:J(this.props,At)}function dt(At){return this.shouldComponentUpdate=Le,Object(l.e)(ke,At)}return dt.displayName="Memo("+(ke.displayName||ke.name)+")",dt.prototype.isReactComponent=!0,dt.__f=!0,dt}(ie.prototype=new l.a).isPureReactComponent=!0,ie.prototype.shouldComponentUpdate=function(ke,Ke){return J(this.props,ke)||J(this.state,Ke)};var Ae=l.i.__b;l.i.__b=function(ke){ke.type&&ke.type.__f&&ke.ref&&(ke.props.ref=ke.ref,ke.ref=null),Ae&&Ae(ke)};var Pe=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function De(ke){function Ke(Le,dt){var At=Q({},Le);return delete At.ref,ke(At,!(dt=Le.ref||dt)||typeof dt=="object"&&!("current"in dt)?null:dt)}return Ke.$$typeof=Pe,Ke.render=Ke,Ke.prototype.isReactComponent=Ke.__f=!0,Ke.displayName="ForwardRef("+(ke.displayName||ke.name)+")",Ke}var He=function(ke,Ke){return ke==null?null:Object(l.k)(Object(l.k)(ke).map(Ke))},Ye={map:He,forEach:He,count:function(ke){return ke?Object(l.k)(ke).length:0},only:function(ke){var Ke=Object(l.k)(ke);if(Ke.length!==1)throw"Children.only";return Ke[0]},toArray:l.k},Be=l.i.__e;l.i.__e=function(ke,Ke,Le){if(ke.then){for(var dt,At=Ke;At=At.__;)if((dt=At.__c)&&dt.__c)return Ke.__e==null&&(Ke.__e=Le.__e,Ke.__k=Le.__k),dt.__c(ke,Ke)}Be(ke,Ke,Le)};var Je=l.i.unmount;function mt(ke,Ke,Le){return ke&&(ke.__c&&ke.__c.__H&&(ke.__c.__H.__.forEach((function(dt){typeof dt.__c=="function"&&dt.__c()})),ke.__c.__H=null),(ke=Q({},ke)).__c!=null&&(ke.__c.__P===Le&&(ke.__c.__P=Ke),ke.__c=null),ke.__k=ke.__k&&ke.__k.map((function(dt){return mt(dt,Ke,Le)}))),ke}function le(ke,Ke,Le){return ke&&(ke.__v=null,ke.__k=ke.__k&&ke.__k.map((function(dt){return le(dt,Ke,Le)})),ke.__c&&ke.__c.__P===Ke&&(ke.__e&&Le.insertBefore(ke.__e,ke.__d),ke.__c.__e=!0,ke.__c.__P=Le)),ke}function Ze(){this.__u=0,this.t=null,this.__b=null}function pe(ke){var Ke=ke.__.__c;return Ke&&Ke.__e&&Ke.__e(ke)}function se(){this.u=null,this.o=null}l.i.unmount=function(ke){var Ke=ke.__c;Ke&&Ke.__R&&Ke.__R(),Ke&&ke.__h===!0&&(ke.type=null),Je&&Je(ke)},(Ze.prototype=new l.a).__c=function(ke,Ke){var Le=Ke.__c,dt=this;dt.t==null&&(dt.t=[]),dt.t.push(Le);var At=pe(dt.__v),Tt=!1,En=function(){Tt||(Tt=!0,Le.__R=null,At?At(Zn):Zn())};Le.__R=En;var Zn=function(){if(!--dt.__u){if(dt.state.__e){var Lo=dt.state.__e;dt.__v.__k[0]=le(Lo,Lo.__c.__P,Lo.__c.__O)}var _o;for(dt.setState({__e:dt.__b=null});_o=dt.t.pop();)_o.forceUpdate()}},ao=Ke.__h===!0;dt.__u++||ao||dt.setState({__e:dt.__b=dt.__v.__k[0]}),ke.then(En,En)},Ze.prototype.componentWillUnmount=function(){this.t=[]},Ze.prototype.render=function(ke,Ke){if(this.__b){if(this.__v.__k){var Le=document.createElement("div"),dt=this.__v.__k[0].__c;this.__v.__k[0]=mt(this.__b,Le,dt.__O=dt.__P)}this.__b=null}var At=Ke.__e&&Object(l.e)(l.b,null,ke.fallback);return At&&(At.__h=null),[Object(l.e)(l.b,null,Ke.__e?null:ke.children),At]};var we=function(ke,Ke,Le){if(++Le[1]===Le[0]&&ke.o.delete(Ke),ke.props.revealOrder&&(ke.props.revealOrder[0]!=="t"||!ke.o.size))for(Le=ke.u;Le;){for(;Le.length>3;)Le.pop()();if(Le[1]<Le[0])break;ke.u=Le=Le[2]}};function $e(ke){return this.getChildContext=function(){return ke.context},ke.children}function rt(ke){var Ke=this,Le=ke.i;Ke.componentWillUnmount=function(){Object(l.j)(null,Ke.l),Ke.l=null,Ke.i=null},Ke.i&&Ke.i!==Le&&Ke.componentWillUnmount(),ke.__v?(Ke.l||(Ke.i=Le,Ke.l={nodeType:1,parentNode:Le,childNodes:[],appendChild:function(dt){this.childNodes.push(dt),Ke.i.appendChild(dt)},insertBefore:function(dt,At){this.childNodes.push(dt),Ke.i.appendChild(dt)},removeChild:function(dt){this.childNodes.splice(this.childNodes.indexOf(dt)>>>1,1),Ke.i.removeChild(dt)}}),Object(l.j)(Object(l.e)($e,{context:Ke.context},ke.__v),Ke.l)):Ke.l&&Ke.componentWillUnmount()}(se.prototype=new l.a).__e=function(ke){var Ke=this,Le=pe(Ke.__v),dt=Ke.o.get(ke);return dt[0]++,function(At){var Tt=function(){Ke.props.revealOrder?(dt.push(At),we(Ke,ke,dt)):At()};Le?Le(Tt):Tt()}},se.prototype.render=function(ke){this.u=null,this.o=new Map;var Ke=Object(l.k)(ke.children);ke.revealOrder&&ke.revealOrder[0]==="b"&&Ke.reverse();for(var Le=Ke.length;Le--;)this.o.set(Ke[Le],this.u=[1,0,this.u]);return ke.children},se.prototype.componentDidUpdate=se.prototype.componentDidMount=function(){var ke=this;this.o.forEach((function(Ke,Le){we(ke,Le,Ke)}))};var pt=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Lt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Jt=typeof document<"u",en=function(ke){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(ke)};l.a.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(ke){Object.defineProperty(l.a.prototype,ke,{configurable:!0,get:function(){return this["UNSAFE_"+ke]},set:function(Ke){Object.defineProperty(this,ke,{configurable:!0,writable:!0,value:Ke})}})}));var zt=l.i.event;function it(){}function ae(){return this.cancelBubble}function re(){return this.defaultPrevented}l.i.event=function(ke){return zt&&(ke=zt(ke)),ke.persist=it,ke.isPropagationStopped=ae,ke.isDefaultPrevented=re,ke.nativeEvent=ke};var je,vt={configurable:!0,get:function(){return this.class}},q=l.i.vnode;l.i.vnode=function(ke){var Ke=ke.type,Le=ke.props,dt=Le;if(typeof Ke=="string"){var At=Ke.indexOf("-")===-1;for(var Tt in dt={},Le){var En=Le[Tt];Jt&&Tt==="children"&&Ke==="noscript"||Tt==="value"&&"defaultValue"in Le&&En==null||(Tt==="defaultValue"&&"value"in Le&&Le.value==null?Tt="value":Tt==="download"&&En===!0?En="":/ondoubleclick/i.test(Tt)?Tt="ondblclick":/^onchange(textarea|input)/i.test(Tt+Ke)&&!en(Le.type)?Tt="oninput":/^onfocus$/i.test(Tt)?Tt="onfocusin":/^onblur$/i.test(Tt)?Tt="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(Tt)?Tt=Tt.toLowerCase():At&&Lt.test(Tt)?Tt=Tt.replace(/[A-Z0-9]/,"-$&").toLowerCase():En===null&&(En=void 0),dt[Tt]=En)}Ke=="select"&&dt.multiple&&Array.isArray(dt.value)&&(dt.value=Object(l.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.value.indexOf(Zn.props.value)!=-1}))),Ke=="select"&&dt.defaultValue!=null&&(dt.value=Object(l.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.multiple?dt.defaultValue.indexOf(Zn.props.value)!=-1:dt.defaultValue==Zn.props.value}))),ke.props=dt,Le.class!=Le.className&&(vt.enumerable="className"in Le,Le.className!=null&&(dt.class=Le.className),Object.defineProperty(dt,"className",vt))}ke.$$typeof=pt,q&&q(ke)};var kt=l.i.__r;l.i.__r=function(ke){kt&&kt(ke),je=ke.__c};var Rt={ReactCurrentDispatcher:{current:{readContext:function(ke){return je.__n[ke.__c].props.value}}}};function Gt(ke){return!!ke&&ke.$$typeof===pt}var Pn=function(ke,Ke){return ke(Ke)},qt=l.b,On={useState:M,useReducer:T,useEffect:B,useLayoutEffect:R,useRef:function(ke){return f=5,P((function(){return{current:ke}}),[])},useImperativeHandle:function(ke,Ke,Le){f=6,R((function(){typeof ke=="function"?ke(Ke()):ke&&(ke.current=Ke())}),Le==null?Le:Le.concat(ke))},useMemo:P,useCallback:$,useContext:function(ke){var Ke=a.context[ke.__c],Le=S(i++,9);return Le.c=ke,Ke?(Le.__==null&&(Le.__=!0,Ke.sub(a)),Ke.props.value):ke.__},useDebugValue:function(ke,Ke){l.i.useDebugValue&&l.i.useDebugValue(Ke?Ke(ke):ke)},version:"17.0.2",Children:Ye,render:function(ke,Ke,Le){return Ke.__k==null&&(Ke.textContent=""),Object(l.j)(ke,Ke),typeof Le=="function"&&Le(),ke?ke.__c:null},hydrate:function(ke,Ke,Le){return Object(l.h)(ke,Ke),typeof Le=="function"&&Le(),ke?ke.__c:null},unmountComponentAtNode:function(ke){return!!ke.__k&&(Object(l.j)(null,ke),!0)},createPortal:function(ke,Ke){return Object(l.e)(rt,{__v:ke,i:Ke})},createElement:l.e,createContext:l.d,createFactory:function(ke){return l.e.bind(null,ke)},cloneElement:function(ke){return Gt(ke)?l.c.apply(null,arguments):ke},createRef:l.f,Fragment:l.b,isValidElement:Gt,findDOMNode:function(ke){return ke&&(ke.base||ke.nodeType===1&&ke)||null},Component:l.a,PureComponent:ie,memo:Se,forwardRef:De,flushSync:function(ke,Ke){return ke(Ke)},unstable_batchedUpdates:Pn,StrictMode:qt,Suspense:Ze,SuspenseList:se,lazy:function(ke){var Ke,Le,dt;function At(Tt){if(Ke||(Ke=ke()).then((function(En){Le=En.default||En}),(function(En){dt=En})),dt)throw dt;if(!Le)throw Ke;return Object(l.e)(Le,Tt)}return At.displayName="Lazy",At.__f=!0,At},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Rt};o.d=On},function(n,o,r){var i=r(7),a=r(152),s=r(153),l=r(187),f=r(57),h=function(_){if(_&&_.forEach!==l)try{f(_,"forEach",l)}catch{_.forEach=l}};for(var v in a)a[v]&&h(i[v]&&i[v].prototype);h(s)},function(n,o,r){r(16)({target:"Object",stat:!0},{setPrototypeOf:r(102)})},function(n,o,r){var i=r(16),a=r(18),s=r(40),l=r(101),f=r(143);i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!f},{getPrototypeOf:function(h){return l(s(h))}})},function(n,o,r){var i=r(16),a=r(46),s=r(76),l=r(203),f=r(165),h=r(32),v=r(33),_=r(60),E=r(18),O=a("Reflect","construct"),w=Object.prototype,S=[].push,M=E((function(){function R(){}return!(O((function(){}),[],R)instanceof R)})),T=!E((function(){O((function(){}))})),B=M||T;i({target:"Reflect",stat:!0,forced:B,sham:B},{construct:function(R,P){f(R),h(P);var $=arguments.length<3?R:f(arguments[2]);if(T&&!M)return O(R,P,$);if(R==$){switch(P.length){case 0:return new R;case 1:return new R(P[0]);case 2:return new R(P[0],P[1]);case 3:return new R(P[0],P[1],P[2]);case 4:return new R(P[0],P[1],P[2],P[3])}var I=[null];return s(S,I,P),new(s(l,R,I))}var F=$.prototype,U=_(v(F)?F:w),z=s(R,U,P);return v(z)?z:U}})},function(n,o){var r=Function.prototype,i=r.bind,a=r.call,s=i&&i.bind(a);n.exports=i?function(l){return l&&s(a,l)}:function(l){return l&&function(){return a.apply(l,arguments)}}},function(n,o,r){var i=r(7),a=r(50).f,s=r(57),l=r(42),f=r(110),h=r(134),v=r(95);n.exports=function(_,E){var O,w,S,M,T,B=_.target,R=_.global,P=_.stat;if(O=R?i:P?i[B]||f(B,{}):(i[B]||{}).prototype)for(w in E){if(M=E[w],S=_.noTargetGet?(T=a(O,w))&&T.value:O[w],!v(R?w:B+(P?".":"#")+w,_.forced)&&S!==void 0){if(typeof M==typeof S)continue;h(M,S)}(_.sham||S&&S.sham)&&s(M,"sham",!0),l(O,w,M,_)}}},function(n,o,r){var i=r(16),a=r(7),s=r(96),l=r(99),f=r(33),h=r(75),v=r(45),_=r(41),E=r(63),O=r(28),w=r(81),S=r(98),M=w("slice"),T=O("species"),B=a.Array,R=Math.max;i({target:"Array",proto:!0,forced:!M},{slice:function(P,$){var I,F,U,z=_(this),X=v(z),Y=h(P,X),W=h($===void 0?X:$,X);if(s(z)&&(I=z.constructor,(l(I)&&(I===B||s(I.prototype))||f(I)&&(I=I[T])===null)&&(I=void 0),I===B||I===void 0))return S(z,Y,W);for(F=new(I===void 0?B:I)(R(W-Y,0)),U=0;Y<W;Y++,U++)Y in z&&E(F,U,z[Y]);return F.length=U,F}})},function(n,o){n.exports=function(r){try{return!!r()}catch{return!0}}},function(n,o,r){var i=r(16),a=r(103);i({target:"RegExp",proto:!0,forced:/./.exec!==a},{exec:a})},function(n,o,r){var i=r(16),a=r(40),s=r(77);i({target:"Object",stat:!0,forced:r(18)((function(){s(1)}))},{keys:function(l){return s(a(l))}})},function(n,o,r){var i=r(36),a=r(73).EXISTS,s=r(15),l=r(38).f,f=Function.prototype,h=s(f.toString),v=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,_=s(v.exec);i&&!a&&l(f,"name",{configurable:!0,get:function(){try{return _(v,h(this))[1]}catch{return""}}})},function(n,o,r){var i=r(16),a=r(18),s=r(41),l=r(50).f,f=r(36),h=a((function(){l(1)}));i({target:"Object",stat:!0,forced:!f||h,sham:!f},{getOwnPropertyDescriptor:function(v,_){return l(s(v),_)}})},function(n,o,r){var i=r(16),a=r(188);i({target:"Array",stat:!0,forced:!r(120)((function(s){Array.from(s)}))},{from:a})},function(n,o,r){var i=r(16),a=r(79).filter;i({target:"Array",proto:!0,forced:!r(81)("filter")},{filter:function(s){return a(this,s,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(16),a=r(36),s=r(135),l=r(41),f=r(50),h=r(63);i({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(v){for(var _,E,O=l(v),w=f.f,S=s(O),M={},T=0;S.length>T;)(E=w(O,_=S[T++]))!==void 0&&h(M,_,E);return M}})},,function(n,o,r){var i=r(16),a=r(7),s=r(18),l=r(96),f=r(33),h=r(40),v=r(45),_=r(63),E=r(115),O=r(81),w=r(28),S=r(70),M=w("isConcatSpreadable"),T=9007199254740991,B="Maximum allowed index exceeded",R=a.TypeError,P=S>=51||!s((function(){var F=[];return F[M]=!1,F.concat()[0]!==F})),$=O("concat"),I=function(F){if(!f(F))return!1;var U=F[M];return U!==void 0?!!U:l(F)};i({target:"Array",proto:!0,forced:!P||!$},{concat:function(F){var U,z,X,Y,W,Q=h(this),J=E(Q,0),ie=0;for(U=-1,X=arguments.length;U<X;U++)if(I(W=U===-1?Q:arguments[U])){if(ie+(Y=v(W))>T)throw R(B);for(z=0;z<Y;z++,ie++)z in W&&_(J,ie,W[z])}else{if(ie>=T)throw R(B);_(J,ie++,W)}return J.length=ie,J}})},function(n,o,r){var i=r(7),a=r(89),s=r(35),l=r(90),f=r(108),h=r(132),v=a("wks"),_=i.Symbol,E=_&&_.for,O=h?_:_&&_.withoutSetter||l;n.exports=function(w){if(!s(v,w)||!f&&typeof v[w]!="string"){var S="Symbol."+w;f&&s(_,w)?v[w]=_[w]:v[w]=h&&E?E(S):O(S)}return v[w]}},function(n,o,r){var i=r(16),a=r(202);i({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},function(n,o){n.exports=function(r){return typeof r=="function"}},function(n,o,r){var i=r(106),a=typeof self=="object"&&self&&self.Object===Object&&self,s=i.a||a||Function("return this")();o.a=s},function(n,o,r){var i=r(7),a=r(33),s=i.String,l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not an object")}},function(n,o,r){var i=r(30);n.exports=function(a){return typeof a=="object"?a!==null:i(a)}},function(n,o){var r=Function.prototype.call;n.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(n,o,r){var i=r(15),a=r(40),s=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(l,f){return s(a(l),f)}},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}))},function(n,o,r){var i=r(16),a=r(79).map;i({target:"Array",proto:!0,forced:!r(81)("map")},{map:function(s){return a(this,s,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(7),a=r(36),s=r(133),l=r(32),f=r(86),h=i.TypeError,v=Object.defineProperty;o.f=a?v:function(_,E,O){if(l(_),E=f(E),l(O),s)try{return v(_,E,O)}catch{}if("get"in O||"set"in O)throw h("Accessors not supported");return"value"in O&&(_[E]=O.value),_}},function(n,o,r){var i=r(7),a=r(97),s=i.String;n.exports=function(l){if(a(l)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return s(l)}},function(n,o,r){var i=r(7),a=r(44),s=i.Object;n.exports=function(l){return s(a(l))}},function(n,o,r){var i=r(85),a=r(44);n.exports=function(s){return i(a(s))}},function(n,o,r){var i=r(7),a=r(30),s=r(35),l=r(57),f=r(110),h=r(92),v=r(58),_=r(73).CONFIGURABLE,E=v.get,O=v.enforce,w=String(String).split("String");(n.exports=function(S,M,T,B){var R,P=!!B&&!!B.unsafe,$=!!B&&!!B.enumerable,I=!!B&&!!B.noTargetGet,F=B&&B.name!==void 0?B.name:M;a(T)&&(String(F).slice(0,7)==="Symbol("&&(F="["+String(F).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!s(T,"name")||_&&T.name!==F)&&l(T,"name",F),(R=O(T)).source||(R.source=w.join(typeof F=="string"?F:""))),S!==i?(P?!I&&S[M]&&($=!0):delete S[M],$?S[M]=T:l(S,M,T)):$?S[M]=T:f(M,T)})(Function.prototype,"toString",(function(){return a(this)&&E(this).source||h(this)}))},function(n,o,r){(function(i){r.d(o,"d",(function(){return l})),r.d(o,"c",(function(){return f})),r.d(o,"b",(function(){return h})),r.d(o,"a",(function(){return _}));var a=r(10),s=function(E,O){var w=typeof Symbol=="function"&&E[Symbol.iterator];if(!w)return E;var S,M,T=w.call(E),B=[];try{for(;(O===void 0||O-- >0)&&!(S=T.next()).done;)B.push(S.value)}catch(R){M={error:R}}finally{try{S&&!S.done&&(w=T.return)&&w.call(T)}finally{if(M)throw M.error}}return B};function l(){var E=s(Object(a.j)(0),2)[1];return Object(a.h)((function(){E((function(O){return O+1}))}),[])}function f(E){if(!E||typeof E!="object")return!1;var O=Object.getPrototypeOf(E);return!O||O===Object.prototype}function h(E){return typeof Symbol=="function"?Symbol.for(E):"__$mobx-react "+E+"__"}var v={};function _(){return typeof window<"u"?window:i!==void 0?i:typeof self<"u"?self:v}}).call(this,r(68))},function(n,o,r){var i=r(7).TypeError;n.exports=function(a){if(a==null)throw i("Can't call method on "+a);return a}},function(n,o,r){var i=r(94);n.exports=function(a){return i(a.length)}},function(n,o,r){var i=r(7),a=r(30),s=function(l){return a(l)?l:void 0};n.exports=function(l,f){return arguments.length<2?s(i[l]):i[l]&&i[l][f]}},function(n,o,r){var i=r(16),a=r(34),s=r(33),l=r(32),f=r(204),h=r(50),v=r(101);i({target:"Reflect",stat:!0},{get:function _(E,O){var w,S,M=arguments.length<3?E:arguments[2];return l(E)===M?E[O]:(w=h.f(E,O))?f(w)?w.value:w.get===void 0?void 0:a(w.get,M):s(S=v(E))?_(S,O,M):void 0}})},function(n,o,r){(function(i){var a=r(31),s=r(171),l=e&&!e.nodeType&&e,f=l&&typeof i=="object"&&i&&!i.nodeType&&i,h=f&&f.exports===l?a.a.Buffer:void 0,v=(h?h.isBuffer:void 0)||s.a;o.a=v}).call(this,r(122)(n))},function(n,o,r){(function(i){var a=r(106),s=e&&!e.nodeType&&e,l=s&&typeof i=="object"&&i&&!i.nodeType&&i,f=l&&l.exports===s&&a.a.process,h=(function(){try{var v=l&&l.require&&l.require("util").types;return v||f&&f.binding&&f.binding("util")}catch{}})();o.a=h}).call(this,r(122)(n))},function(n,o,r){var i=r(36),a=r(34),s=r(84),l=r(69),f=r(41),h=r(86),v=r(35),_=r(133),E=Object.getOwnPropertyDescriptor;o.f=i?E:function(O,w){if(O=f(O),w=h(w),_)try{return E(O,w)}catch{}if(v(O,w))return l(!a(s.f,O,w),O[w])}},function(n,o,r){var i=r(15),a=i({}.toString),s=i("".slice);n.exports=function(l){return s(a(l),8,-1)}},function(n,o,r){r(182)("Map",(function(i){return function(){return i(this,arguments.length?arguments[0]:void 0)}}),r(186))},function(n,o,r){var i=r(16),a=r(220).entries;i({target:"Object",stat:!0},{entries:function(s){return a(s)}})},function(n,o,r){var i=r(15);n.exports=i({}.isPrototypeOf)},function(n,o,r){var i=r(46);n.exports=i("navigator","userAgent")||""},function(n,o,r){var i=r(7),a=r(30),s=r(88),l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not a function")}},function(n,o,r){var i=r(36),a=r(38),s=r(69);n.exports=i?function(l,f,h){return a.f(l,f,s(1,h))}:function(l,f,h){return l[f]=h,l}},function(n,o,r){var i,a,s,l=r(175),f=r(7),h=r(15),v=r(33),_=r(57),E=r(35),O=r(109),w=r(93),S=r(72),M="Object already initialized",T=f.TypeError,B=f.WeakMap;if(l||O.state){var R=O.state||(O.state=new B),P=h(R.get),$=h(R.has),I=h(R.set);i=function(U,z){if($(R,U))throw new T(M);return z.facade=U,I(R,U,z),z},a=function(U){return P(R,U)||{}},s=function(U){return $(R,U)}}else{var F=w("state");S[F]=!0,i=function(U,z){if(E(U,F))throw new T(M);return z.facade=U,_(U,F,z),z},a=function(U){return E(U,F)?U[F]:{}},s=function(U){return E(U,F)}}n.exports={set:i,get:a,has:s,enforce:function(U){return s(U)?a(U):i(U,{})},getterFor:function(U){return function(z){var X;if(!v(z)||(X=a(z)).type!==U)throw T("Incompatible receiver, "+U+" required");return X}}}},function(n,o){var r=Math.ceil,i=Math.floor;n.exports=function(a){var s=+a;return s!=s||s===0?0:(s>0?i:r)(s)}},function(n,o,r){var i,a=r(32),s=r(176),l=r(111),f=r(72),h=r(138),v=r(91),_=r(93),E=_("IE_PROTO"),O=function(){},w=function(T){return"<script>"+T+"<\/script>"},S=function(T){T.write(w("")),T.close();var B=T.parentWindow.Object;return T=null,B},M=function(){try{i=new ActiveXObject("htmlfile")}catch{}var T,B;M=typeof document<"u"?document.domain&&i?S(i):((B=v("iframe")).style.display="none",h.appendChild(B),B.src="javascript:",(T=B.contentWindow.document).open(),T.write(w("document.F=Object")),T.close(),T.F):S(i);for(var R=l.length;R--;)delete M.prototype[l[R]];return M()};f[E]=!0,n.exports=Object.create||function(T,B){var R;return T!==null?(O.prototype=a(T),R=new O,O.prototype=null,R[E]=T):R=M(),B===void 0?R:s(R,B)}},function(n,o,r){var i=r(36),a=r(7),s=r(15),l=r(95),f=r(42),h=r(35),v=r(148),_=r(54),E=r(87),O=r(131),w=r(18),S=r(74).f,M=r(50).f,T=r(38).f,B=r(160),R=r(161).trim,P="Number",$=a.Number,I=$.prototype,F=a.TypeError,U=s("".slice),z=s("".charCodeAt),X=function(Se){var Ae=O(Se,"number");return typeof Ae=="bigint"?Ae:Y(Ae)},Y=function(Se){var Ae,Pe,De,He,Ye,Be,Je,mt,le=O(Se,"number");if(E(le))throw F("Cannot convert a Symbol value to a number");if(typeof le=="string"&&le.length>2){if(le=R(le),(Ae=z(le,0))===43||Ae===45){if((Pe=z(le,2))===88||Pe===120)return NaN}else if(Ae===48){switch(z(le,1)){case 66:case 98:De=2,He=49;break;case 79:case 111:De=8,He=55;break;default:return+le}for(Be=(Ye=U(le,2)).length,Je=0;Je<Be;Je++)if((mt=z(Ye,Je))<48||mt>He)return NaN;return parseInt(Ye,De)}}return+le};if(l(P,!$(" 0o1")||!$("0b1")||$("+0x1"))){for(var W,Q=function(Se){var Ae=arguments.length<1?0:$(X(Se)),Pe=this;return _(I,Pe)&&w((function(){B(Pe)}))?v(Object(Ae),Pe,Q):Ae},J=i?S($):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),ie=0;J.length>ie;ie++)h($,W=J[ie])&&!h(Q,W)&&T(Q,W,M($,W));Q.prototype=I,I.constructor=Q,f(a,P,Q)}},function(n,o,r){var i=r(56);n.exports=function(a,s){var l=a[s];return l==null?void 0:i(l)}},function(n,o,r){var i=r(86),a=r(38),s=r(69);n.exports=function(l,f,h){var v=i(f);v in l?a.f(l,v,s(0,h)):l[v]=h}},function(n,o,r){var i=r(15),a=r(56),s=i(i.bind);n.exports=function(l,f){return a(l),f===void 0?l:s?s(l,f):function(){return l.apply(f,arguments)}}},function(n,o,r){var i=r(16),a=r(15),s=r(85),l=r(41),f=r(121),h=a([].join),v=s!=Object,_=f("join",",");i({target:"Array",proto:!0,forced:v||!_},{join:function(E){return h(l(this),E===void 0?",":E)}})},function(n,o,r){var i=r(15),a=r(73).PROPER,s=r(42),l=r(32),f=r(54),h=r(39),v=r(18),_=r(154),E="toString",O=RegExp.prototype,w=O.toString,S=i(_),M=v((function(){return w.call({source:"a",flags:"b"})!="/a/b"})),T=a&&w.name!=E;(M||T)&&s(RegExp.prototype,E,(function(){var B=l(this),R=h(B.source),P=B.flags;return"/"+R+"/"+h(P===void 0&&f(O,B)&&!("flags"in O)?S(B):P)}),{unsafe:!0})},function(n,o,r){var i=r(16),a=r(217),s=r(100);i({target:"Array",proto:!0},{fill:a}),s("fill")},function(n,o){var r;r=(function(){return this})();try{r=r||new Function("return this")()}catch{typeof window=="object"&&(r=window)}n.exports=r},function(n,o){n.exports=function(r,i){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:i}}},function(n,o,r){var i,a,s=r(7),l=r(55),f=s.process,h=s.Deno,v=f&&f.versions||h&&h.version,_=v&&v.v8;_&&(a=(i=_.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!a&&l&&(!(i=l.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=l.match(/Chrome\/(\d+)/))&&(a=+i[1]),n.exports=a},function(n,o){n.exports=!1},function(n,o){n.exports={}},function(n,o,r){var i=r(36),a=r(35),s=Function.prototype,l=i&&Object.getOwnPropertyDescriptor,f=a(s,"name"),h=f&&(function(){}).name==="something",v=f&&(!i||i&&l(s,"name").configurable);n.exports={EXISTS:f,PROPER:h,CONFIGURABLE:v}},function(n,o,r){var i=r(136),a=r(111).concat("length","prototype");o.f=Object.getOwnPropertyNames||function(s){return i(s,a)}},function(n,o,r){var i=r(59),a=Math.max,s=Math.min;n.exports=function(l,f){var h=i(l);return h<0?a(h+f,0):s(h,f)}},function(n,o){var r=Function.prototype,i=r.apply,a=r.bind,s=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(a?s.bind(i):function(){return s.apply(i,arguments)})},function(n,o,r){var i=r(136),a=r(111);n.exports=Object.keys||function(s){return i(s,a)}},function(n,o,r){var i=r(38).f,a=r(35),s=r(28)("toStringTag");n.exports=function(l,f,h){l&&!a(l=h?l:l.prototype,s)&&i(l,s,{configurable:!0,value:f})}},function(n,o,r){var i=r(64),a=r(15),s=r(85),l=r(40),f=r(45),h=r(115),v=a([].push),_=function(E){var O=E==1,w=E==2,S=E==3,M=E==4,T=E==6,B=E==7,R=E==5||T;return function(P,$,I,F){for(var U,z,X=l(P),Y=s(X),W=i($,I),Q=f(Y),J=0,ie=F||h,Se=O?ie(P,Q):w||B?ie(P,0):void 0;Q>J;J++)if((R||J in Y)&&(z=W(U=Y[J],J,X),E))if(O)Se[J]=z;else if(z)switch(E){case 3:return!0;case 5:return U;case 6:return J;case 2:v(Se,U)}else switch(E){case 4:return!1;case 7:v(Se,U)}return T?-1:S||M?M:Se}};n.exports={forEach:_(0),map:_(1),filter:_(2),some:_(3),every:_(4),find:_(5),findIndex:_(6),filterReject:_(7)}},function(n,o){n.exports={}},function(n,o,r){var i=r(18),a=r(28),s=r(70),l=a("species");n.exports=function(f){return s>=51||!i((function(){var h=[];return(h.constructor={})[l]=function(){return{foo:1}},h[f](Boolean).foo!==1}))}},function(n,o,r){var i=r(76),a=r(34),s=r(15),l=r(123),f=r(159),h=r(32),v=r(44),_=r(164),E=r(124),O=r(94),w=r(39),S=r(62),M=r(114),T=r(125),B=r(103),R=r(155),P=r(18),$=R.UNSUPPORTED_Y,I=4294967295,F=Math.min,U=[].push,z=s(/./.exec),X=s(U),Y=s("".slice),W=!P((function(){var Q=/(?:)/,J=Q.exec;Q.exec=function(){return J.apply(this,arguments)};var ie="ab".split(Q);return ie.length!==2||ie[0]!=="a"||ie[1]!=="b"}));l("split",(function(Q,J,ie){var Se;return Se="abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?function(Ae,Pe){var De=w(v(this)),He=Pe===void 0?I:Pe>>>0;if(He===0)return[];if(Ae===void 0)return[De];if(!f(Ae))return a(J,De,Ae,He);for(var Ye,Be,Je,mt=[],le=(Ae.ignoreCase?"i":"")+(Ae.multiline?"m":"")+(Ae.unicode?"u":"")+(Ae.sticky?"y":""),Ze=0,pe=new RegExp(Ae.source,le+"g");(Ye=a(B,pe,De))&&!((Be=pe.lastIndex)>Ze&&(X(mt,Y(De,Ze,Ye.index)),Ye.length>1&&Ye.index<De.length&&i(U,mt,M(Ye,1)),Je=Ye[0].length,Ze=Be,mt.length>=He));)pe.lastIndex===Ye.index&&pe.lastIndex++;return Ze===De.length?!Je&&z(pe,"")||X(mt,""):X(mt,Y(De,Ze)),mt.length>He?M(mt,0,He):mt}:"0".split(void 0,0).length?function(Ae,Pe){return Ae===void 0&&Pe===0?[]:a(J,this,Ae,Pe)}:J,[function(Ae,Pe){var De=v(this),He=Ae==null?void 0:S(Ae,Q);return He?a(He,Ae,De,Pe):a(Se,w(De),Ae,Pe)},function(Ae,Pe){var De=h(this),He=w(Ae),Ye=ie(Se,De,He,Pe,Se!==J);if(Ye.done)return Ye.value;var Be=_(De,RegExp),Je=De.unicode,mt=(De.ignoreCase?"i":"")+(De.multiline?"m":"")+(De.unicode?"u":"")+($?"g":"y"),le=new Be($?"^(?:"+De.source+")":De,mt),Ze=Pe===void 0?I:Pe>>>0;if(Ze===0)return[];if(He.length===0)return T(le,He)===null?[He]:[];for(var pe=0,se=0,we=[];se<He.length;){le.lastIndex=$?0:se;var $e,rt=T(le,$?Y(He,se):He);if(rt===null||($e=F(O(le.lastIndex+($?se:0)),He.length))===pe)se=E(He,se,Je);else{if(X(we,Y(He,pe,se)),we.length===Ze)return we;for(var pt=1;pt<=rt.length-1;pt++)if(X(we,rt[pt]),we.length===Ze)return we;se=pe=$e}}return X(we,Y(He,pe)),we}]}),!W,$)},function(n,o,r){r(16)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(n,o,r){var i={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,s=a&&!i.call({1:2},1);o.f=s?function(l){var f=a(this,l);return!!f&&f.enumerable}:i},function(n,o,r){var i=r(7),a=r(15),s=r(18),l=r(51),f=i.Object,h=a("".split);n.exports=s((function(){return!f("z").propertyIsEnumerable(0)}))?function(v){return l(v)=="String"?h(v,""):f(v)}:f},function(n,o,r){var i=r(131),a=r(87);n.exports=function(s){var l=i(s,"string");return a(l)?l:l+""}},function(n,o,r){var i=r(7),a=r(46),s=r(30),l=r(54),f=r(132),h=i.Object;n.exports=f?function(v){return typeof v=="symbol"}:function(v){var _=a("Symbol");return s(_)&&l(_.prototype,h(v))}},function(n,o,r){var i=r(7).String;n.exports=function(a){try{return i(a)}catch{return"Object"}}},function(n,o,r){var i=r(71),a=r(109);(n.exports=function(s,l){return a[s]||(a[s]=l!==void 0?l:{})})("versions",[]).push({version:"3.19.3",mode:i?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(n,o,r){var i=r(15),a=0,s=Math.random(),l=i(1 .toString);n.exports=function(f){return"Symbol("+(f===void 0?"":f)+")_"+l(++a+s,36)}},function(n,o,r){var i=r(7),a=r(33),s=i.document,l=a(s)&&a(s.createElement);n.exports=function(f){return l?s.createElement(f):{}}},function(n,o,r){var i=r(15),a=r(30),s=r(109),l=i(Function.toString);a(s.inspectSource)||(s.inspectSource=function(f){return l(f)}),n.exports=s.inspectSource},function(n,o,r){var i=r(89),a=r(90),s=i("keys");n.exports=function(l){return s[l]||(s[l]=a(l))}},function(n,o,r){var i=r(59),a=Math.min;n.exports=function(s){return s>0?a(i(s),9007199254740991):0}},function(n,o,r){var i=r(18),a=r(30),s=/#|\.prototype\./,l=function(E,O){var w=h[f(E)];return w==_||w!=v&&(a(O)?i(O):!!O)},f=l.normalize=function(E){return String(E).replace(s,".").toLowerCase()},h=l.data={},v=l.NATIVE="N",_=l.POLYFILL="P";n.exports=l},function(n,o,r){var i=r(51);n.exports=Array.isArray||function(a){return i(a)=="Array"}},function(n,o,r){var i=r(7),a=r(113),s=r(30),l=r(51),f=r(28)("toStringTag"),h=i.Object,v=l((function(){return arguments})())=="Arguments";n.exports=a?l:function(_){var E,O,w;return _===void 0?"Undefined":_===null?"Null":typeof(O=(function(S,M){try{return S[M]}catch{}})(E=h(_),f))=="string"?O:v?l(E):(w=l(E))=="Object"&&s(E.callee)?"Arguments":w}},function(n,o,r){var i=r(15);n.exports=i([].slice)},function(n,o,r){var i=r(15),a=r(18),s=r(30),l=r(97),f=r(46),h=r(92),v=function(){},_=[],E=f("Reflect","construct"),O=/^\s*(?:class|function)\b/,w=i(O.exec),S=!O.exec(v),M=function(T){if(!s(T))return!1;try{return E(v,_,T),!0}catch{return!1}};n.exports=!E||a((function(){var T;return M(M.call)||!M(Object)||!M((function(){T=!0}))||T}))?function(T){if(!s(T))return!1;switch(l(T)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return S||!!w(O,h(T))}:M},function(n,o,r){var i=r(28),a=r(60),s=r(38),l=i("unscopables"),f=Array.prototype;f[l]==null&&s.f(f,l,{configurable:!0,value:a(null)}),n.exports=function(h){f[l][h]=!0}},function(n,o,r){var i=r(7),a=r(35),s=r(30),l=r(40),f=r(93),h=r(143),v=f("IE_PROTO"),_=i.Object,E=_.prototype;n.exports=h?_.getPrototypeOf:function(O){var w=l(O);if(a(w,v))return w[v];var S=w.constructor;return s(S)&&w instanceof S?S.prototype:w instanceof _?E:null}},function(n,o,r){var i=r(15),a=r(32),s=r(181);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var l,f=!1,h={};try{(l=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(h,[]),f=h instanceof Array}catch{}return function(v,_){return a(v),s(_),f?l(v,_):v.__proto__=_,v}})():void 0)},function(n,o,r){var i,a,s=r(34),l=r(15),f=r(39),h=r(154),v=r(155),_=r(89),E=r(60),O=r(58).get,w=r(190),S=r(191),M=_("native-string-replace",String.prototype.replace),T=RegExp.prototype.exec,B=T,R=l("".charAt),P=l("".indexOf),$=l("".replace),I=l("".slice),F=(a=/b*/g,s(T,i=/a/,"a"),s(T,a,"a"),i.lastIndex!==0||a.lastIndex!==0),U=v.BROKEN_CARET,z=/()??/.exec("")[1]!==void 0;(F||z||U||w||S)&&(B=function(X){var Y,W,Q,J,ie,Se,Ae,Pe=this,De=O(Pe),He=f(X),Ye=De.raw;if(Ye)return Ye.lastIndex=Pe.lastIndex,Y=s(B,Ye,He),Pe.lastIndex=Ye.lastIndex,Y;var Be=De.groups,Je=U&&Pe.sticky,mt=s(h,Pe),le=Pe.source,Ze=0,pe=He;if(Je&&(mt=$(mt,"y",""),P(mt,"g")===-1&&(mt+="g"),pe=I(He,Pe.lastIndex),Pe.lastIndex>0&&(!Pe.multiline||Pe.multiline&&R(He,Pe.lastIndex-1)!==`
|
||
`)&&(le="(?: "+le+")",pe=" "+pe,Ze++),W=new RegExp("^(?:"+le+")",mt)),z&&(W=new RegExp("^"+le+"$(?!\\s)",mt)),F&&(Q=Pe.lastIndex),J=s(T,Je?W:Pe,pe),Je?J?(J.input=I(J.input,Ze),J[0]=I(J[0],Ze),J.index=Pe.lastIndex,Pe.lastIndex+=J[0].length):Pe.lastIndex=0:F&&J&&(Pe.lastIndex=Pe.global?J.index+J[0].length:Q),z&&J&&J.length>1&&s(M,J[0],W,(function(){for(ie=1;ie<arguments.length-2;ie++)arguments[ie]===void 0&&(J[ie]=void 0)})),J&&Be)for(J.groups=Se=E(null),ie=0;ie<Be.length;ie++)Se[(Ae=Be[ie])[0]]=J[Ae[1]];return J}),n.exports=B},function(n,o,r){var i=r(16),a=r(7),s=r(75),l=r(59),f=r(45),h=r(40),v=r(115),_=r(63),E=r(81)("splice"),O=a.TypeError,w=Math.max,S=Math.min,M=9007199254740991,T="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!E},{splice:function(B,R){var P,$,I,F,U,z,X=h(this),Y=f(X),W=s(B,Y),Q=arguments.length;if(Q===0?P=$=0:Q===1?(P=0,$=Y-W):(P=Q-2,$=S(w(l(R),0),Y-W)),Y+P-$>M)throw O(T);for(I=v(X,$),F=0;F<$;F++)(U=W+F)in X&&_(I,F,X[U]);if(I.length=$,P<$){for(F=W;F<Y-$;F++)z=F+P,(U=F+$)in X?X[z]=X[U]:delete X[z];for(F=Y;F>Y-$+P;F--)delete X[F-1]}else if(P>$)for(F=Y-$;F>W;F--)z=F+P-1,(U=F+$-1)in X?X[z]=X[U]:delete X[z];for(F=0;F<P;F++)X[F+W]=arguments[F+2];return X.length=Y-$+P,I}})},function(n,o,r){var i=r(16),a=r(205);i({target:"String",proto:!0,forced:r(206)("anchor")},{anchor:function(s){return a(this,"a","name",s)}})},function(n,o,r){(function(i){var a=typeof i=="object"&&i&&i.Object===Object&&i;o.a=a}).call(this,r(68))},function(n,o,r){(function(i){var a=r(31),s=e&&!e.nodeType&&e,l=s&&typeof i=="object"&&i&&!i.nodeType&&i,f=l&&l.exports===s?a.a.Buffer:void 0,h=f?f.allocUnsafe:void 0;o.a=function(v,_){if(_)return v.slice();var E=v.length,O=h?h(E):new v.constructor(E);return v.copy(O),O}}).call(this,r(122)(n))},function(n,o,r){var i=r(70),a=r(18);n.exports=!!Object.getOwnPropertySymbols&&!a((function(){var s=Symbol();return!String(s)||!(Object(s)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},function(n,o,r){var i=r(7),a=r(110),s="__core-js_shared__",l=i[s]||a(s,{});n.exports=l},function(n,o,r){var i=r(7),a=Object.defineProperty;n.exports=function(s,l){try{a(i,s,{value:l,configurable:!0,writable:!0})}catch{i[s]=l}return l}},function(n,o){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(n,o){o.f=Object.getOwnPropertySymbols},function(n,o,r){var i={};i[r(28)("toStringTag")]="z",n.exports=String(i)==="[object z]"},function(n,o,r){var i=r(7),a=r(75),s=r(45),l=r(63),f=i.Array,h=Math.max;n.exports=function(v,_,E){for(var O=s(v),w=a(_,O),S=a(E===void 0?O:E,O),M=f(h(S-w,0)),T=0;w<S;w++,T++)l(M,T,v[w]);return M.length=T,M}},function(n,o,r){var i=r(178);n.exports=function(a,s){return new(i(a))(s===0?0:s)}},function(n,o,r){var i=r(16),a=r(34),s=r(71),l=r(73),f=r(30),h=r(180),v=r(101),_=r(102),E=r(78),O=r(57),w=r(42),S=r(28),M=r(80),T=r(142),B=l.PROPER,R=l.CONFIGURABLE,P=T.IteratorPrototype,$=T.BUGGY_SAFARI_ITERATORS,I=S("iterator"),F="keys",U="values",z="entries",X=function(){return this};n.exports=function(Y,W,Q,J,ie,Se,Ae){h(Q,W,J);var Pe,De,He,Ye=function(se){if(se===ie&&Ze)return Ze;if(!$&&se in mt)return mt[se];switch(se){case F:case U:case z:return function(){return new Q(this,se)}}return function(){return new Q(this)}},Be=W+" Iterator",Je=!1,mt=Y.prototype,le=mt[I]||mt["@@iterator"]||ie&&mt[ie],Ze=!$&&le||Ye(ie),pe=W=="Array"&&mt.entries||le;if(pe&&(Pe=v(pe.call(new Y)))!==Object.prototype&&Pe.next&&(s||v(Pe)===P||(_?_(Pe,P):f(Pe[I])||w(Pe,I,X)),E(Pe,Be,!0,!0),s&&(M[Be]=X)),B&&ie==U&&le&&le.name!==U&&(!s&&R?O(mt,"name",U):(Je=!0,Ze=function(){return a(le,this)})),ie)if(De={values:Ye(U),keys:Se?Ze:Ye(F),entries:Ye(z)},Ae)for(He in De)($||Je||!(He in mt))&&w(mt,He,De[He]);else i({target:W,proto:!0,forced:$||Je},De);return s&&!Ae||mt[I]===Ze||w(mt,I,Ze,{name:ie}),M[W]=Ze,De}},function(n,o,r){var i=r(7),a=r(64),s=r(34),l=r(32),f=r(88),h=r(145),v=r(45),_=r(54),E=r(146),O=r(118),w=r(147),S=i.TypeError,M=function(B,R){this.stopped=B,this.result=R},T=M.prototype;n.exports=function(B,R,P){var $,I,F,U,z,X,Y,W=P&&P.that,Q=!(!P||!P.AS_ENTRIES),J=!(!P||!P.IS_ITERATOR),ie=!(!P||!P.INTERRUPTED),Se=a(R,W),Ae=function(De){return $&&w($,"normal",De),new M(!0,De)},Pe=function(De){return Q?(l(De),ie?Se(De[0],De[1],Ae):Se(De[0],De[1])):ie?Se(De,Ae):Se(De)};if(J)$=B;else{if(!(I=O(B)))throw S(f(B)+" is not iterable");if(h(I)){for(F=0,U=v(B);U>F;F++)if((z=Pe(B[F]))&&_(T,z))return z;return new M(!1)}$=E(B,I)}for(X=$.next;!(Y=s(X,$)).done;){try{z=Pe(Y.value)}catch(De){w($,"throw",De)}if(typeof z=="object"&&z&&_(T,z))return z}return new M(!1)}},function(n,o,r){var i=r(97),a=r(62),s=r(80),l=r(28)("iterator");n.exports=function(f){if(f!=null)return a(f,l)||a(f,"@@iterator")||s[i(f)]}},function(n,o,r){var i=r(7),a=r(54),s=i.TypeError;n.exports=function(l,f){if(a(f,l))return l;throw s("Incorrect invocation")}},function(n,o,r){var i=r(28)("iterator"),a=!1;try{var s=0,l={next:function(){return{done:!!s++}},return:function(){a=!0}};l[i]=function(){return this},Array.from(l,(function(){throw 2}))}catch{}n.exports=function(f,h){if(!h&&!a)return!1;var v=!1;try{var _={};_[i]=function(){return{next:function(){return{done:v=!0}}}},f(_)}catch{}return v}},function(n,o,r){var i=r(18);n.exports=function(a,s){var l=[][a];return!!l&&i((function(){l.call(null,s||function(){throw 1},1)}))}},function(n,o){n.exports=function(r){if(!r.webpackPolyfill){var i=Object.create(r);i.children||(i.children=[]),Object.defineProperty(i,"loaded",{enumerable:!0,get:function(){return i.l}}),Object.defineProperty(i,"id",{enumerable:!0,get:function(){return i.i}}),Object.defineProperty(i,"exports",{enumerable:!0}),i.webpackPolyfill=1}return i}},function(n,o,r){r(19);var i=r(15),a=r(42),s=r(103),l=r(18),f=r(28),h=r(57),v=f("species"),_=RegExp.prototype;n.exports=function(E,O,w,S){var M=f(E),T=!l((function(){var $={};return $[M]=function(){return 7},""[E]($)!=7})),B=T&&!l((function(){var $=!1,I=/a/;return E==="split"&&((I={}).constructor={},I.constructor[v]=function(){return I},I.flags="",I[M]=/./[M]),I.exec=function(){return $=!0,null},I[M](""),!$}));if(!T||!B||w){var R=i(/./[M]),P=O(M,""[E],(function($,I,F,U,z){var X=i($),Y=I.exec;return Y===s||Y===_.exec?T&&!z?{done:!0,value:R(I,F,U)}:{done:!0,value:X(F,I,U)}:{done:!1}}));a(String.prototype,E,P[0]),a(_,M,P[1])}S&&h(_[M],"sham",!0)}},function(n,o,r){var i=r(151).charAt;n.exports=function(a,s,l){return s+(l?i(a,s).length:1)}},function(n,o,r){var i=r(7),a=r(34),s=r(32),l=r(30),f=r(51),h=r(103),v=i.TypeError;n.exports=function(_,E){var O=_.exec;if(l(O)){var w=a(O,_,E);return w!==null&&s(w),w}if(f(_)==="RegExp")return a(h,_,E);throw v("RegExp#exec called on incompatible receiver")}},function(n,o,r){var i=r(76),a=r(34),s=r(15),l=r(123),f=r(18),h=r(32),v=r(30),_=r(59),E=r(94),O=r(39),w=r(44),S=r(124),M=r(62),T=r(201),B=r(125),R=r(28)("replace"),P=Math.max,$=Math.min,I=s([].concat),F=s([].push),U=s("".indexOf),z=s("".slice),X="a".replace(/./,"$0")==="$0",Y=!!/./[R]&&/./[R]("a","$0")==="";l("replace",(function(W,Q,J){var ie=Y?"$":"$0";return[function(Se,Ae){var Pe=w(this),De=Se==null?void 0:M(Se,R);return De?a(De,Se,Pe,Ae):a(Q,O(Pe),Se,Ae)},function(Se,Ae){var Pe=h(this),De=O(Se);if(typeof Ae=="string"&&U(Ae,ie)===-1&&U(Ae,"$<")===-1){var He=J(Q,Pe,De,Ae);if(He.done)return He.value}var Ye=v(Ae);Ye||(Ae=O(Ae));var Be=Pe.global;if(Be){var Je=Pe.unicode;Pe.lastIndex=0}for(var mt=[];;){var le=B(Pe,De);if(le===null||(F(mt,le),!Be))break;O(le[0])===""&&(Pe.lastIndex=S(De,E(Pe.lastIndex),Je))}for(var Ze,pe="",se=0,we=0;we<mt.length;we++){for(var $e=O((le=mt[we])[0]),rt=P($(_(le.index),De.length),0),pt=[],Lt=1;Lt<le.length;Lt++)F(pt,(Ze=le[Lt])===void 0?Ze:String(Ze));var Jt=le.groups;if(Ye){var en=I([$e],pt,rt,De);Jt!==void 0&&F(en,Jt);var zt=O(i(Ae,void 0,en))}else zt=T($e,De,rt,pt,Jt,Ae);rt>=se&&(pe+=z(De,se,rt)+zt,se=rt+$e.length)}return pe+z(De,se)}]}),!!f((function(){var W=/./;return W.exec=function(){var Q=[];return Q.groups={a:"7"},Q},"".replace(W,"$<a>")!=="7"}))||!X||Y)},function(n,o,r){var i=r(16),a=Math.hypot,s=Math.abs,l=Math.sqrt;i({target:"Math",stat:!0,forced:!!a&&a(1/0,NaN)!==1/0},{hypot:function(f,h){for(var v,_,E=0,O=0,w=arguments.length,S=0;O<w;)S<(v=s(arguments[O++]))?(E=E*(_=S/v)*_+1,S=v):E+=v>0?(_=v/S)*_:v;return S===1/0?1/0:S*l(E)}})},function(n,o,r){var i=r(51),a=r(7);n.exports=i(a.process)=="process"},function(n,o,r){r(16)({target:"Number",stat:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(n,o,r){(function(i,a){var s;/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/(function(){var l,f="Expected a function",h="__lodash_hash_undefined__",v="__lodash_placeholder__",_=16,E=32,O=64,w=128,S=256,M=1/0,T=9007199254740991,B=NaN,R=4294967295,P=[["ary",w],["bind",1],["bindKey",2],["curry",8],["curryRight",_],["flip",512],["partial",E],["partialRight",O],["rearg",S]],$="[object Arguments]",I="[object Array]",F="[object Boolean]",U="[object Date]",z="[object Error]",X="[object Function]",Y="[object GeneratorFunction]",W="[object Map]",Q="[object Number]",J="[object Object]",ie="[object Promise]",Se="[object RegExp]",Ae="[object Set]",Pe="[object String]",De="[object Symbol]",He="[object WeakMap]",Ye="[object ArrayBuffer]",Be="[object DataView]",Je="[object Float32Array]",mt="[object Float64Array]",le="[object Int8Array]",Ze="[object Int16Array]",pe="[object Int32Array]",se="[object Uint8Array]",we="[object Uint8ClampedArray]",$e="[object Uint16Array]",rt="[object Uint32Array]",pt=/\b__p \+= '';/g,Lt=/\b(__p \+=) '' \+/g,Jt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,en=/&(?:amp|lt|gt|quot|#39);/g,zt=/[&<>"']/g,it=RegExp(en.source),ae=RegExp(zt.source),re=/<%-([\s\S]+?)%>/g,je=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kt=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gt=/[\\^$.*+?()[\]{}|]/g,Pn=RegExp(Gt.source),qt=/^\s+/,On=/\s/,ke=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ke=/\{\n\/\* \[wrapped with (.+)\] \*/,Le=/,? & /,dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,At=/[()=,{}\[\]\/\s]/,Tt=/\\(\\)?/g,En=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zn=/\w*$/,ao=/^[-+]0x[0-9a-f]+$/i,Lo=/^0b[01]+$/i,_o=/^\[object .+?Constructor\]$/,ho=/^0o[0-7]+$/i,Nn=/^(?:0|[1-9]\d*)$/,qn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rr=/($^)/,ut=/['\n\r\u2028\u2029\\]/g,gn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Fn="\\u2700-\\u27bf",sr="a-z\\xdf-\\xf6\\xf8-\\xff",wo="A-Z\\xc0-\\xd6\\xd8-\\xde",oo="\\ufe0e\\ufe0f",ta="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Ca="['’]",Yi="[\\ud800-\\udfff]",fa="["+ta+"]",Ka="["+gn+"]",Sn="\\d+",Ts="[\\u2700-\\u27bf]",Oo="["+sr+"]",es="[^\\ud800-\\udfff"+ta+Sn+Fn+sr+wo+"]",Ui="\\ud83c[\\udffb-\\udfff]",yr="[^\\ud800-\\udfff]",ml="(?:\\ud83c[\\udde6-\\uddff]){2}",pa="[\\ud800-\\udbff][\\udc00-\\udfff]",qi="["+wo+"]",Na="(?:"+Oo+"|"+es+")",al="(?:"+qi+"|"+es+")",yl="(?:['’](?:d|ll|m|re|s|t|ve))?",Cs="(?:['’](?:D|LL|M|RE|S|T|VE))?",_l="(?:"+Ka+"|"+Ui+")?",ts="[\\ufe0e\\ufe0f]?",ve=ts+_l+("(?:\\u200d(?:"+[yr,ml,pa].join("|")+")"+ts+_l+")*"),gt="(?:"+[Ts,ml,pa].join("|")+")"+ve,dn="(?:"+[yr+Ka+"?",Ka,ml,pa,Yi].join("|")+")",Kn=RegExp(Ca,"g"),br=RegExp(Ka,"g"),so=RegExp(Ui+"(?="+Ui+")|"+dn+ve,"g"),si=RegExp([qi+"?"+Oo+"+"+yl+"(?="+[fa,qi,"$"].join("|")+")",al+"+"+Cs+"(?="+[fa,qi+Na,"$"].join("|")+")",qi+"?"+Na+"+"+yl,qi+"+"+Cs,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sn,gt].join("|"),"g"),ye=RegExp("[\\u200d\\ud800-\\udfff"+gn+oo+"]"),ht=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,pn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rn=-1,Cn={};Cn[Je]=Cn[mt]=Cn[le]=Cn[Ze]=Cn[pe]=Cn[se]=Cn[we]=Cn[$e]=Cn[rt]=!0,Cn[$]=Cn[I]=Cn[Ye]=Cn[F]=Cn[Be]=Cn[U]=Cn[z]=Cn[X]=Cn[W]=Cn[Q]=Cn[J]=Cn[Se]=Cn[Ae]=Cn[Pe]=Cn[He]=!1;var nr={};nr[$]=nr[I]=nr[Ye]=nr[Be]=nr[F]=nr[U]=nr[Je]=nr[mt]=nr[le]=nr[Ze]=nr[pe]=nr[W]=nr[Q]=nr[J]=nr[Se]=nr[Ae]=nr[Pe]=nr[De]=nr[se]=nr[we]=nr[$e]=nr[rt]=!0,nr[z]=nr[X]=nr[He]=!1;var Mn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},or=parseFloat,lr=parseInt,qr=typeof i=="object"&&i&&i.Object===Object&&i,na=typeof self=="object"&&self&&self.Object===Object&&self,vi=qr||na||Function("return this")(),bl=o&&!o.nodeType&&o,Vi=bl&&typeof a=="object"&&a&&!a.nodeType&&a,Ns=Vi&&Vi.exports===bl,Fl=Ns&&qr.process,Ro=(function(){try{var Ct=Vi&&Vi.require&&Vi.require("util").types;return Ct||Fl&&Fl.binding&&Fl.binding("util")}catch{}})(),La=Ro&&Ro.isArrayBuffer,id=Ro&&Ro.isDate,_u=Ro&&Ro.isMap,Ia=Ro&&Ro.isRegExp,ra=Ro&&Ro.isSet,wl=Ro&&Ro.isTypedArray;function qo(Ct,un,fn){switch(fn.length){case 0:return Ct.call(un);case 1:return Ct.call(un,fn[0]);case 2:return Ct.call(un,fn[0],fn[1]);case 3:return Ct.call(un,fn[0],fn[1],fn[2])}return Ct.apply(un,fn)}function Uh(Ct,un,fn,Gn){for(var Wr=-1,go=Ct==null?0:Ct.length;++Wr<go;){var ci=Ct[Wr];un(Gn,ci,fn(ci),Ct)}return Gn}function Fa(Ct,un){for(var fn=-1,Gn=Ct==null?0:Ct.length;++fn<Gn&&un(Ct[fn],fn,Ct)!==!1;);return Ct}function _p(Ct,un){for(var fn=Ct==null?0:Ct.length;fn--&&un(Ct[fn],fn,Ct)!==!1;);return Ct}function bp(Ct,un){for(var fn=-1,Gn=Ct==null?0:Ct.length;++fn<Gn;)if(!un(Ct[fn],fn,Ct))return!1;return!0}function Ba(Ct,un){for(var fn=-1,Gn=Ct==null?0:Ct.length,Wr=0,go=[];++fn<Gn;){var ci=Ct[fn];un(ci,fn,Ct)&&(go[Wr++]=ci)}return go}function Za(Ct,un){return!!(Ct!=null&&Ct.length)&&bu(Ct,un,0)>-1}function rf(Ct,un,fn){for(var Gn=-1,Wr=Ct==null?0:Ct.length;++Gn<Wr;)if(fn(un,Ct[Gn]))return!0;return!1}function Mo(Ct,un){for(var fn=-1,Gn=Ct==null?0:Ct.length,Wr=Array(Gn);++fn<Gn;)Wr[fn]=un(Ct[fn],fn,Ct);return Wr}function oa(Ct,un){for(var fn=-1,Gn=un.length,Wr=Ct.length;++fn<Gn;)Ct[Wr+fn]=un[fn];return Ct}function ad(Ct,un,fn,Gn){var Wr=-1,go=Ct==null?0:Ct.length;for(Gn&&go&&(fn=Ct[++Wr]);++Wr<go;)fn=un(fn,Ct[Wr],Wr,Ct);return fn}function wp(Ct,un,fn,Gn){var Wr=Ct==null?0:Ct.length;for(Gn&&Wr&&(fn=Ct[--Wr]);Wr--;)fn=un(fn,Ct[Wr],Wr,Ct);return fn}function of(Ct,un){for(var fn=-1,Gn=Ct==null?0:Ct.length;++fn<Gn;)if(un(Ct[fn],fn,Ct))return!0;return!1}var ld=Ua("length");function ns(Ct,un,fn){var Gn;return fn(Ct,(function(Wr,go,ci){if(un(Wr,go,ci))return Gn=go,!1})),Gn}function $a(Ct,un,fn,Gn){for(var Wr=Ct.length,go=fn+(Gn?1:-1);Gn?go--:++go<Wr;)if(un(Ct[go],go,Ct))return go;return-1}function bu(Ct,un,fn){return un==un?(function(Gn,Wr,go){for(var ci=go-1,D=Gn.length;++ci<D;)if(Gn[ci]===Wr)return ci;return-1})(Ct,un,fn):$a(Ct,El,fn)}function Ja(Ct,un,fn,Gn){for(var Wr=fn-1,go=Ct.length;++Wr<go;)if(Gn(Ct[Wr],un))return Wr;return-1}function El(Ct){return Ct!=Ct}function vo(Ct,un){var fn=Ct==null?0:Ct.length;return fn?wu(Ct,un)/fn:B}function Ua(Ct){return function(un){return un==null?l:un[Ct]}}function Bl(Ct){return function(un){return Ct==null?l:Ct[un]}}function ha(Ct,un,fn,Gn,Wr){return Wr(Ct,(function(go,ci,D){fn=Gn?(Gn=!1,go):un(fn,go,ci,D)})),fn}function wu(Ct,un){for(var fn,Gn=-1,Wr=Ct.length;++Gn<Wr;){var go=un(Ct[Gn]);go!==l&&(fn=fn===l?go:fn+go)}return fn}function Ks(Ct,un){for(var fn=-1,Gn=Array(Ct);++fn<Ct;)Gn[fn]=un(fn);return Gn}function $l(Ct){return Ct&&Ct.slice(0,ia(Ct)+1).replace(qt,"")}function ui(Ct){return function(un){return Ct(un)}}function lc(Ct,un){return Mo(un,(function(fn){return Ct[fn]}))}function rs(Ct,un){return Ct.has(un)}function xl(Ct,un){for(var fn=-1,Gn=Ct.length;++fn<Gn&&bu(un,Ct[fn],0)>-1;);return fn}function af(Ct,un){for(var fn=Ct.length;fn--&&bu(un,Ct[fn],0)>-1;);return fn}function Vh(Ct,un){for(var fn=Ct.length,Gn=0;fn--;)Ct[fn]===un&&++Gn;return Gn}var lf=Bl({À:"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"}),Wi=Bl({"&":"&","<":"<",">":">",'"':""","'":"'"});function sc(Ct){return"\\"+Mn[Ct]}function os(Ct){return ye.test(Ct)}function Ki(Ct){var un=-1,fn=Array(Ct.size);return Ct.forEach((function(Gn,Wr){fn[++un]=[Wr,Gn]})),fn}function sf(Ct,un){return function(fn){return Ct(un(fn))}}function ll(Ct,un){for(var fn=-1,Gn=Ct.length,Wr=0,go=[];++fn<Gn;){var ci=Ct[fn];ci!==un&&ci!==v||(Ct[fn]=v,go[Wr++]=fn)}return go}function Ol(Ct){var un=-1,fn=Array(Ct.size);return Ct.forEach((function(Gn){fn[++un]=Gn})),fn}function sd(Ct){var un=-1,fn=Array(Ct.size);return Ct.forEach((function(Gn){fn[++un]=[Gn,Gn]})),fn}function Va(Ct){return os(Ct)?(function(un){for(var fn=so.lastIndex=0;so.test(un);)++fn;return fn})(Ct):ld(Ct)}function Qa(Ct){return os(Ct)?(function(un){return un.match(so)||[]})(Ct):(function(un){return un.split("")})(Ct)}function ia(Ct){for(var un=Ct.length;un--&&On.test(Ct.charAt(un)););return un}var sl=Bl({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ka=(function Ct(un){var fn,Gn=(un=un==null?vi:ka.defaults(vi.Object(),un,ka.pick(vi,pn))).Array,Wr=un.Date,go=un.Error,ci=un.Function,D=un.Math,L=un.Object,Z=un.RegExp,fe=un.String,Re=un.TypeError,lt=Gn.prototype,It=ci.prototype,bn=L.prototype,Jn=un["__core-js_shared__"],no=It.toString,$n=bn.hasOwnProperty,Do=0,Kr=(fn=/[^.]+$/.exec(Jn&&Jn.keys&&Jn.keys.IE_PROTO||""))?"Symbol(src)_1."+fn:"",So=bn.toString,ul=no.call(L),wi=vi._,el=Z("^"+no.call($n).replace(Gt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ks=Ns?un.Buffer:l,Ps=un.Symbol,Zs=un.Uint8Array,Eu=ks?ks.allocUnsafe:l,is=sf(L.getPrototypeOf,L),xu=L.create,Zi=bn.propertyIsEnumerable,Js=lt.splice,Rs=Ps?Ps.isConcatSpreadable:l,as=Ps?Ps.iterator:l,ls=Ps?Ps.toStringTag:l,uc=(function(){try{var m=hs(L,"defineProperty");return m({},"",{}),m}catch{}})(),fg=un.clearTimeout!==vi.clearTimeout&&un.clearTimeout,pg=Wr&&Wr.now!==vi.Date.now&&Wr.now,Wh=un.setTimeout!==vi.setTimeout&&un.setTimeout,uf=D.ceil,cc=D.floor,Ep=L.getOwnPropertySymbols,hg=ks?ks.isBuffer:l,dc=un.isFinite,cf=lt.join,xp=sf(L.keys,L),ji=D.max,Wa=D.min,Op=Wr.now,Sp=un.parseInt,ud=D.random,dy=lt.reverse,cd=hs(un,"DataView"),dd=hs(un,"Map"),df=hs(un,"Promise"),fc=hs(un,"Set"),Ou=hs(un,"WeakMap"),fd=hs(L,"create"),ff=Ou&&new Ou,Su={},fy=Ru(cd),pf=Ru(dd),py=Ru(df),hy=Ru(fc),vg=Ru(Ou),Ap=Ps?Ps.prototype:l,Pa=Ap?Ap.valueOf:l,gg=Ap?Ap.toString:l;function he(m){if(Bi(m)&&!Jr(m)&&!(m instanceof mo)){if(m instanceof Ul)return m;if($n.call(m,"__wrapped__"))return qp(m)}return new Ul(m)}var pc=(function(){function m(){}return function(x){if(!Ni(x))return{};if(xu)return xu(x);m.prototype=x;var C=new m;return m.prototype=l,C}})();function Qs(){}function Ul(m,x){this.__wrapped__=m,this.__actions__=[],this.__chain__=!!x,this.__index__=0,this.__values__=l}function mo(m){this.__wrapped__=m,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=R,this.__views__=[]}function ba(m){var x=-1,C=m==null?0:m.length;for(this.clear();++x<C;){var G=m[x];this.set(G[0],G[1])}}function To(m){var x=-1,C=m==null?0:m.length;for(this.clear();++x<C;){var G=m[x];this.set(G[0],G[1])}}function ss(m){var x=-1,C=m==null?0:m.length;for(this.clear();++x<C;){var G=m[x];this.set(G[0],G[1])}}function eu(m){var x=-1,C=m==null?0:m.length;for(this.__data__=new ss;++x<C;)this.add(m[x])}function Sl(m){var x=this.__data__=new To(m);this.size=x.size}function Mp(m,x){var C=Jr(m),G=!C&&Nc(m),ne=!C&&!G&&nl(m),ce=!C&&!G&&!ne&&yt(m),Oe=C||G||ne||ce,Fe=Oe?Ks(m.length,fe):[],et=Fe.length;for(var jt in m)!x&&!$n.call(m,jt)||Oe&&(jt=="length"||ne&&(jt=="offset"||jt=="parent")||ce&&(jt=="buffer"||jt=="byteLength"||jt=="byteOffset")||Ra(jt,et))||Fe.push(jt);return Fe}function Tp(m){var x=m.length;return x?m[ev(0,x-1)]:l}function Gh(m,x){return Bs(va(m),Au(x,0,m.length))}function mg(m){return Bs(va(m))}function tu(m,x,C){(C!==l&&!zl(m[x],C)||C===l&&!(x in m))&&us(m,x,C)}function Li(m,x,C){var G=m[x];$n.call(m,x)&&zl(G,C)&&(C!==l||x in m)||us(m,x,C)}function pd(m,x){for(var C=m.length;C--;)if(zl(m[C][0],x))return C;return-1}function zh(m,x,C,G){return gi(m,(function(ne,ce,Oe){x(G,ne,C(ne),Oe)})),G}function nu(m,x){return m&&ds(x,on(x),m)}function us(m,x,C){x=="__proto__"&&uc?uc(m,x,{configurable:!0,enumerable:!0,value:C,writable:!0}):m[x]=C}function hf(m,x){for(var C=-1,G=x.length,ne=Gn(G),ce=m==null;++C<G;)ne[C]=ce?l:_n(m,x[C]);return ne}function Au(m,x,C){return m==m&&(C!==l&&(m=m<=C?m:C),x!==l&&(m=m>=x?m:x)),m}function Al(m,x,C,G,ne,ce){var Oe,Fe=1&x,et=2&x,jt=4&x;if(C&&(Oe=ne?C(m,G,ne,ce):C(m)),Oe!==l)return Oe;if(!Ni(m))return m;var Vt=Jr(m);if(Vt){if(Oe=(function(an){var Tn=an.length,Br=new an.constructor(Tn);return Tn&&typeof an[0]=="string"&&$n.call(an,"index")&&(Br.index=an.index,Br.input=an.input),Br})(m),!Fe)return va(m,Oe)}else{var yn=Ti(m),Yn=yn==X||yn==Y;if(nl(m))return Sg(m,Fe);if(yn==J||yn==$||Yn&&!ne){if(Oe=et||Yn?{}:tl(m),!Fe)return et?(function(an,Tn){return ds(an,Ec(an),Tn)})(m,(function(an,Tn){return an&&ds(Tn,Zt(Tn),an)})(Oe,m)):(function(an,Tn){return ds(an,aa(an),Tn)})(m,nu(Oe,m))}else{if(!nr[yn])return ne?m:{};Oe=(function(an,Tn,Br){var ir=an.constructor;switch(Tn){case Ye:return gc(an);case F:case U:return new ir(+an);case Be:return(function(Yr,Ao){var Mr=Ao?gc(Yr.buffer):Yr.buffer;return new Yr.constructor(Mr,Yr.byteOffset,Yr.byteLength)})(an,Br);case Je:case mt:case le:case Ze:case pe:case se:case we:case $e:case rt:return Ag(an,Br);case W:return new ir;case Q:case Pe:return new ir(an);case Se:return(function(Yr){var Ao=new Yr.constructor(Yr.source,Zn.exec(Yr));return Ao.lastIndex=Yr.lastIndex,Ao})(an);case Ae:return new ir;case De:return at=an,Pa?L(Pa.call(at)):{}}var at})(m,yn,Fe)}}ce||(ce=new Sl);var Qn=ce.get(m);if(Qn)return Qn;ce.set(m,Oe),Ie(m)?m.forEach((function(an){Oe.add(Al(an,x,C,an,m,ce))})):eh(m)&&m.forEach((function(an,Tn){Oe.set(Tn,Al(an,x,C,Tn,m,ce))}));var Sr=Vt?l:(jt?et?Gp:xf:et?Zt:on)(m);return Fa(Sr||m,(function(an,Tn){Sr&&(an=m[Tn=an]),Li(Oe,Tn,Al(an,x,C,Tn,m,ce))})),Oe}function Hh(m,x,C){var G=C.length;if(m==null)return!G;for(m=L(m);G--;){var ne=C[G],ce=x[ne],Oe=m[ne];if(Oe===l&&!(ne in m)||!ce(Oe))return!1}return!0}function Xh(m,x,C){if(typeof m!="function")throw new Re(f);return Sc((function(){m.apply(l,C)}),x)}function cs(m,x,C,G){var ne=-1,ce=Za,Oe=!0,Fe=m.length,et=[],jt=x.length;if(!Fe)return et;C&&(x=Mo(x,ui(C))),G?(ce=rf,Oe=!1):x.length>=200&&(ce=rs,Oe=!1,x=new eu(x));e:for(;++ne<Fe;){var Vt=m[ne],yn=C==null?Vt:C(Vt);if(Vt=G||Vt!==0?Vt:0,Oe&&yn==yn){for(var Yn=jt;Yn--;)if(x[Yn]===yn)continue e;et.push(Vt)}else ce(x,yn,G)||et.push(Vt)}return et}he.templateSettings={escape:re,evaluate:je,interpolate:vt,variable:"",imports:{_:he}},he.prototype=Qs.prototype,he.prototype.constructor=he,Ul.prototype=pc(Qs.prototype),Ul.prototype.constructor=Ul,mo.prototype=pc(Qs.prototype),mo.prototype.constructor=mo,ba.prototype.clear=function(){this.__data__=fd?fd(null):{},this.size=0},ba.prototype.delete=function(m){var x=this.has(m)&&delete this.__data__[m];return this.size-=x?1:0,x},ba.prototype.get=function(m){var x=this.__data__;if(fd){var C=x[m];return C===h?l:C}return $n.call(x,m)?x[m]:l},ba.prototype.has=function(m){var x=this.__data__;return fd?x[m]!==l:$n.call(x,m)},ba.prototype.set=function(m,x){var C=this.__data__;return this.size+=this.has(m)?0:1,C[m]=fd&&x===l?h:x,this},To.prototype.clear=function(){this.__data__=[],this.size=0},To.prototype.delete=function(m){var x=this.__data__,C=pd(x,m);return!(C<0)&&(C==x.length-1?x.pop():Js.call(x,C,1),--this.size,!0)},To.prototype.get=function(m){var x=this.__data__,C=pd(x,m);return C<0?l:x[C][1]},To.prototype.has=function(m){return pd(this.__data__,m)>-1},To.prototype.set=function(m,x){var C=this.__data__,G=pd(C,m);return G<0?(++this.size,C.push([m,x])):C[G][1]=x,this},ss.prototype.clear=function(){this.size=0,this.__data__={hash:new ba,map:new(dd||To),string:new ba}},ss.prototype.delete=function(m){var x=wd(this,m).delete(m);return this.size-=x?1:0,x},ss.prototype.get=function(m){return wd(this,m).get(m)},ss.prototype.has=function(m){return wd(this,m).has(m)},ss.prototype.set=function(m,x){var C=wd(this,m),G=C.size;return C.set(m,x),this.size+=C.size==G?0:1,this},eu.prototype.add=eu.prototype.push=function(m){return this.__data__.set(m,h),this},eu.prototype.has=function(m){return this.__data__.has(m)},Sl.prototype.clear=function(){this.__data__=new To,this.size=0},Sl.prototype.delete=function(m){var x=this.__data__,C=x.delete(m);return this.size=x.size,C},Sl.prototype.get=function(m){return this.__data__.get(m)},Sl.prototype.has=function(m){return this.__data__.has(m)},Sl.prototype.set=function(m,x){var C=this.__data__;if(C instanceof To){var G=C.__data__;if(!dd||G.length<199)return G.push([m,x]),this.size=++C.size,this;C=this.__data__=new ss(G)}return C.set(m,x),this.size=C.size,this};var gi=_c(ur),yg=_c(ti,!0);function Yh(m,x){var C=!0;return gi(m,(function(G,ne,ce){return C=!!x(G,ne,ce)})),C}function Ii(m,x,C){for(var G=-1,ne=m.length;++G<ne;){var ce=m[G],Oe=x(ce);if(Oe!=null&&(Fe===l?Oe==Oe&&!Dt(Oe):C(Oe,Fe)))var Fe=Oe,et=ce}return et}function Io(m,x){var C=[];return gi(m,(function(G,ne,ce){x(G,ne,ce)&&C.push(G)})),C}function Ji(m,x,C,G,ne){var ce=-1,Oe=m.length;for(C||(C=Sf),ne||(ne=[]);++ce<Oe;){var Fe=m[ce];x>0&&C(Fe)?x>1?Ji(Fe,x-1,C,G,ne):oa(ne,Fe):G||(ne[ne.length]=Fe)}return ne}var lo=bc(),ei=bc(!0);function ur(m,x){return m&&lo(m,x,on)}function ti(m,x){return m&&ei(m,x,on)}function vf(m,x){return Ba(x,(function(C){return Cl(m[C])}))}function Ds(m,x){for(var C=0,G=(x=jo(x,m)).length;m!=null&&C<G;)m=m[vs(x[C++])];return C&&C==G?m:l}function Cp(m,x,C){var G=x(m);return Jr(m)?G:oa(G,C(m))}function Ei(m){return m==null?m===l?"[object Undefined]":"[object Null]":ls&&ls in L(m)?(function(x){var C=$n.call(x,ls),G=x[ls];try{x[ls]=l;var ne=!0}catch{}var ce=So.call(x);return ne&&(C?x[ls]=G:delete x[ls]),ce})(m):(function(x){return So.call(x)})(m)}function Mi(m,x){return m>x}function qh(m,x){return m!=null&&$n.call(m,x)}function Kh(m,x){return m!=null&&x in L(m)}function gf(m,x,C){for(var G=C?rf:Za,ne=m[0].length,ce=m.length,Oe=ce,Fe=Gn(ce),et=1/0,jt=[];Oe--;){var Vt=m[Oe];Oe&&x&&(Vt=Mo(Vt,ui(x))),et=Wa(Vt.length,et),Fe[Oe]=!C&&(x||ne>=120&&Vt.length>=120)?new eu(Oe&&Vt):l}Vt=m[0];var yn=-1,Yn=Fe[0];e:for(;++yn<ne&&jt.length<et;){var Qn=Vt[yn],Sr=x?x(Qn):Qn;if(Qn=C||Qn!==0?Qn:0,!(Yn?rs(Yn,Sr):G(jt,Sr,C))){for(Oe=ce;--Oe;){var an=Fe[Oe];if(!(an?rs(an,Sr):G(m[Oe],Sr,C)))continue e}Yn&&Yn.push(Sr),jt.push(Qn)}}return jt}function Ga(m,x,C){var G=(m=Pu(m,x=jo(x,m)))==null?m:m[vs(mi(x))];return G==null?l:qo(G,m,C)}function Np(m){return Bi(m)&&Ei(m)==$}function hd(m,x,C,G,ne){return m===x||(m==null||x==null||!Bi(m)&&!Bi(x)?m!=m&&x!=x:(function(ce,Oe,Fe,et,jt,Vt){var yn=Jr(ce),Yn=Jr(Oe),Qn=yn?I:Ti(ce),Sr=Yn?I:Ti(Oe),an=(Qn=Qn==$?J:Qn)==J,Tn=(Sr=Sr==$?J:Sr)==J,Br=Qn==Sr;if(Br&&nl(ce)){if(!nl(Oe))return!1;yn=!0,an=!1}if(Br&&!an)return Vt||(Vt=new Sl),yn||yt(ce)?bd(ce,Oe,Fe,et,jt,Vt):(function(Mr,Ur,xa,Hl,uu,Oa,Iu){switch(xa){case Be:if(Mr.byteLength!=Ur.byteLength||Mr.byteOffset!=Ur.byteOffset)return!1;Mr=Mr.buffer,Ur=Ur.buffer;case Ye:return!(Mr.byteLength!=Ur.byteLength||!Oa(new Zs(Mr),new Zs(Ur)));case F:case U:case Q:return zl(+Mr,+Ur);case z:return Mr.name==Ur.name&&Mr.message==Ur.message;case Se:case Pe:return Mr==Ur+"";case W:var Pc=Ki;case Ae:var th=1&Hl;if(Pc||(Pc=Ol),Mr.size!=Ur.size&&!th)return!1;var yv=Iu.get(Mr);if(yv)return yv==Ur;Hl|=2,Iu.set(Mr,Ur);var Fu=bd(Pc(Mr),Pc(Ur),Hl,uu,Oa,Iu);return Iu.delete(Mr),Fu;case De:if(Pa)return Pa.call(Mr)==Pa.call(Ur)}return!1})(ce,Oe,Qn,Fe,et,jt,Vt);if(!(1&Fe)){var ir=an&&$n.call(ce,"__wrapped__"),at=Tn&&$n.call(Oe,"__wrapped__");if(ir||at){var Yr=ir?ce.value():ce,Ao=at?Oe.value():Oe;return Vt||(Vt=new Sl),jt(Yr,Ao,Fe,et,Vt)}}return Br?(Vt||(Vt=new Sl),(function(Mr,Ur,xa,Hl,uu,Oa){var Iu=1&xa,Pc=xf(Mr),th=Pc.length,yv=xf(Ur).length;if(th!=yv&&!Iu)return!1;for(var Fu=th;Fu--;){var Sd=Pc[Fu];if(!(Iu?Sd in Ur:$n.call(Ur,Sd)))return!1}var wy=Oa.get(Mr),nh=Oa.get(Ur);if(wy&&nh)return wy==Ur&&nh==Mr;var _v=!0;Oa.set(Mr,Ur),Oa.set(Ur,Mr);for(var Ey=Iu;++Fu<th;){var bv=Mr[Sd=Pc[Fu]],Vf=Ur[Sd];if(Hl)var Wf=Iu?Hl(Vf,bv,Sd,Ur,Mr,Oa):Hl(bv,Vf,Sd,Mr,Ur,Oa);if(!(Wf===l?bv===Vf||uu(bv,Vf,xa,Hl,Oa):Wf)){_v=!1;break}Ey||(Ey=Sd=="constructor")}if(_v&&!Ey){var Rc=Mr.constructor,wv=Ur.constructor;Rc==wv||!("constructor"in Mr)||!("constructor"in Ur)||typeof Rc=="function"&&Rc instanceof Rc&&typeof wv=="function"&&wv instanceof wv||(_v=!1)}return Oa.delete(Mr),Oa.delete(Ur),_v})(ce,Oe,Fe,et,jt,Vt)):!1})(m,x,C,G,hd,ne))}function Vl(m,x,C,G){var ne=C.length,ce=ne,Oe=!G;if(m==null)return!ce;for(m=L(m);ne--;){var Fe=C[ne];if(Oe&&Fe[2]?Fe[1]!==m[Fe[0]]:!(Fe[0]in m))return!1}for(;++ne<ce;){var et=(Fe=C[ne])[0],jt=m[et],Vt=Fe[1];if(Oe&&Fe[2]){if(jt===l&&!(et in m))return!1}else{var yn=new Sl;if(G)var Yn=G(jt,Vt,et,m,x,yn);if(!(Yn===l?hd(Vt,jt,3,G,yn):Yn))return!1}}return!0}function Mu(m){return!(!Ni(m)||(x=m,Kr&&Kr in x))&&(Cl(m)?el:_o).test(Ru(m));var x}function ru(m){return typeof m=="function"?m:m==null?Nr:typeof m=="object"?Jr(m)?Jh(m[0],m[1]):Zh(m):xe(m)}function Wl(m){if(!Qt(m))return xp(m);var x=[];for(var C in L(m))$n.call(m,C)&&C!="constructor"&&x.push(C);return x}function _g(m){if(!Ni(m))return(function(ne){var ce=[];if(ne!=null)for(var Oe in L(ne))ce.push(Oe);return ce})(m);var x=Qt(m),C=[];for(var G in m)(G!="constructor"||!x&&$n.call(m,G))&&C.push(G);return C}function js(m,x){return m<x}function Ml(m,x){var C=-1,G=fl(m)?Gn(m.length):[];return gi(m,(function(ne,ce,Oe){G[++C]=x(ne,ce,Oe)})),G}function Zh(m){var x=Of(m);return x.length==1&&x[0][2]?Af(x[0][0],x[0][1]):function(C){return C===m||Vl(C,m,x)}}function Jh(m,x){return Is(m)&&xc(x)?Af(vs(m),x):function(C){var G=_n(C,m);return G===l&&G===x?Yt(C,m):hd(x,G,3)}}function kp(m,x,C,G,ne){m!==x&&lo(x,(function(ce,Oe){if(ne||(ne=new Sl),Ni(ce))(function(et,jt,Vt,yn,Yn,Qn,Sr){var an=Xp(et,Vt),Tn=Xp(jt,Vt),Br=Sr.get(Tn);if(Br)return void tu(et,Vt,Br);var ir=Qn?Qn(an,Tn,Vt+"",et,jt,Sr):l,at=ir===l;if(at){var Yr=Jr(Tn),Ao=!Yr&&nl(Tn),Mr=!Yr&&!Ao&&yt(Tn);ir=Tn,Yr||Ao||Mr?Jr(an)?ir=an:Oi(an)?ir=va(an):Ao?(at=!1,ir=Sg(Tn,!0)):Mr?(at=!1,ir=Ag(Tn,!0)):ir=[]:K(Tn)||Nc(Tn)?(ir=an,Nc(an)?ir=rn(an):Ni(an)&&!Cl(an)||(ir=tl(Tn))):at=!1}at&&(Sr.set(Tn,ir),Yn(ir,Tn,yn,Qn,Sr),Sr.delete(Tn)),tu(et,Vt,ir)})(m,x,Oe,C,kp,G,ne);else{var Fe=G?G(Xp(m,Oe),ce,Oe+"",m,x,ne):l;Fe===l&&(Fe=ce),tu(m,Oe,Fe)}}),Zt)}function bg(m,x){var C=m.length;if(C)return Ra(x+=x<0?C:0,C)?m[x]:l}function wg(m,x,C){x=x.length?Mo(x,(function(ce){return Jr(ce)?function(Oe){return Ds(Oe,ce.length===1?ce[0]:ce)}:ce})):[Nr];var G=-1;x=Mo(x,ui(Rr()));var ne=Ml(m,(function(ce,Oe,Fe){var et=Mo(x,(function(jt){return jt(ce)}));return{criteria:et,index:++G,value:ce}}));return(function(ce,Oe){var Fe=ce.length;for(ce.sort(Oe);Fe--;)ce[Fe]=ce[Fe].value;return ce})(ne,(function(ce,Oe){return(function(Fe,et,jt){for(var Vt=-1,yn=Fe.criteria,Yn=et.criteria,Qn=yn.length,Sr=jt.length;++Vt<Qn;){var an=vd(yn[Vt],Yn[Vt]);if(an)return Vt>=Sr?an:an*(jt[Vt]=="desc"?-1:1)}return Fe.index-et.index})(ce,Oe,C)}))}function Eg(m,x,C){for(var G=-1,ne=x.length,ce={};++G<ne;){var Oe=x[G],Fe=Ds(m,Oe);C(Fe,Oe)&&hc(ce,jo(Oe,m),Fe)}return ce}function Pp(m,x,C,G){var ne=G?Ja:bu,ce=-1,Oe=x.length,Fe=m;for(m===x&&(x=va(x)),C&&(Fe=Mo(m,ui(C)));++ce<Oe;)for(var et=0,jt=x[ce],Vt=C?C(jt):jt;(et=ne(Fe,Vt,et,G))>-1;)Fe!==m&&Js.call(Fe,et,1),Js.call(m,et,1);return m}function Qh(m,x){for(var C=m?x.length:0,G=C-1;C--;){var ne=x[C];if(C==G||ne!==ce){var ce=ne;Ra(ne)?Js.call(m,ne,1):Dp(m,ne)}}return m}function ev(m,x){return m+cc(ud()*(x-m+1))}function mf(m,x){var C="";if(!m||x<1||x>T)return C;do x%2&&(C+=m),(x=cc(x/2))&&(m+=m);while(x);return C}function uo(m,x){return Tf(Mf(m,x,Nr),m+"")}function vy(m){return Tp(Qr(m))}function tv(m,x){var C=Qr(m);return Bs(C,Au(x,0,C.length))}function hc(m,x,C,G){if(!Ni(m))return m;for(var ne=-1,ce=(x=jo(x,m)).length,Oe=ce-1,Fe=m;Fe!=null&&++ne<ce;){var et=vs(x[ne]),jt=C;if(et==="__proto__"||et==="constructor"||et==="prototype")return m;if(ne!=Oe){var Vt=Fe[et];(jt=G?G(Vt,et,Fe):l)===l&&(jt=Ni(Vt)?Vt:Ra(x[ne+1])?[]:{})}Li(Fe,et,jt),Fe=Fe[et]}return m}var yf=ff?function(m,x){return ff.set(m,x),m}:Nr,gy=uc?function(m,x){return uc(m,"toString",{configurable:!0,enumerable:!1,value:co(x),writable:!0})}:Nr;function xg(m){return Bs(Qr(m))}function Tl(m,x,C){var G=-1,ne=m.length;x<0&&(x=-x>ne?0:ne+x),(C=C>ne?ne:C)<0&&(C+=ne),ne=x>C?0:C-x>>>0,x>>>=0;for(var ce=Gn(ne);++G<ne;)ce[G]=m[G+x];return ce}function my(m,x){var C;return gi(m,(function(G,ne,ce){return!(C=x(G,ne,ce))})),!!C}function _f(m,x,C){var G=0,ne=m==null?G:m.length;if(typeof x=="number"&&x==x&&ne<=2147483647){for(;G<ne;){var ce=G+ne>>>1,Oe=m[ce];Oe!==null&&!Dt(Oe)&&(C?Oe<=x:Oe<x)?G=ce+1:ne=ce}return ne}return Rp(m,x,Nr,C)}function Rp(m,x,C,G){var ne=0,ce=m==null?0:m.length;if(ce===0)return 0;for(var Oe=(x=C(x))!=x,Fe=x===null,et=Dt(x),jt=x===l;ne<ce;){var Vt=cc((ne+ce)/2),yn=C(m[Vt]),Yn=yn!==l,Qn=yn===null,Sr=yn==yn,an=Dt(yn);if(Oe)var Tn=G||Sr;else Tn=jt?Sr&&(G||Yn):Fe?Sr&&Yn&&(G||!Qn):et?Sr&&Yn&&!Qn&&(G||!an):!Qn&&!an&&(G?yn<=x:yn<x);Tn?ne=Vt+1:ce=Vt}return Wa(ce,4294967294)}function nv(m,x){for(var C=-1,G=m.length,ne=0,ce=[];++C<G;){var Oe=m[C],Fe=x?x(Oe):Oe;if(!C||!zl(Fe,et)){var et=Fe;ce[ne++]=Oe===0?0:Oe}}return ce}function Og(m){return typeof m=="number"?m:Dt(m)?B:+m}function cl(m){if(typeof m=="string")return m;if(Jr(m))return Mo(m,cl)+"";if(Dt(m))return gg?gg.call(m):"";var x=m+"";return x=="0"&&1/m==-1/0?"-0":x}function Tu(m,x,C){var G=-1,ne=Za,ce=m.length,Oe=!0,Fe=[],et=Fe;if(C)Oe=!1,ne=rf;else if(ce>=200){var jt=x?null:Tg(m);if(jt)return Ol(jt);Oe=!1,ne=rs,et=new eu}else et=x?[]:Fe;e:for(;++G<ce;){var Vt=m[G],yn=x?x(Vt):Vt;if(Vt=C||Vt!==0?Vt:0,Oe&&yn==yn){for(var Yn=et.length;Yn--;)if(et[Yn]===yn)continue e;x&&et.push(yn),Fe.push(Vt)}else ne(et,yn,C)||(et!==Fe&&et.push(yn),Fe.push(Vt))}return Fe}function Dp(m,x){return(m=Pu(m,x=jo(x,m)))==null||delete m[vs(mi(x))]}function vc(m,x,C,G){return hc(m,x,C(Ds(m,x)),G)}function jp(m,x,C,G){for(var ne=m.length,ce=G?ne:-1;(G?ce--:++ce<ne)&&x(m[ce],ce,m););return C?Tl(m,G?0:ce,G?ce+1:ne):Tl(m,G?ce+1:0,G?ne:ce)}function rv(m,x){var C=m;return C instanceof mo&&(C=C.value()),ad(x,(function(G,ne){return ne.func.apply(ne.thisArg,oa([G],ne.args))}),C)}function Lp(m,x,C){var G=m.length;if(G<2)return G?Tu(m[0]):[];for(var ne=-1,ce=Gn(G);++ne<G;)for(var Oe=m[ne],Fe=-1;++Fe<G;)Fe!=ne&&(ce[ne]=cs(ce[ne]||Oe,m[Fe],x,C));return Tu(Ji(ce,1),x,C)}function bf(m,x,C){for(var G=-1,ne=m.length,ce=x.length,Oe={};++G<ne;){var Fe=G<ce?x[G]:l;C(Oe,m[G],Fe)}return Oe}function Ip(m){return Oi(m)?m:[]}function Fp(m){return typeof m=="function"?m:Nr}function jo(m,x){return Jr(m)?m:Is(m,x)?[m]:dv(Wt(m))}var yy=uo;function Uo(m,x,C){var G=m.length;return C=C===l?G:C,!x&&C>=G?m:Tl(m,x,C)}var Bp=fg||function(m){return vi.clearTimeout(m)};function Sg(m,x){if(x)return m.slice();var C=m.length,G=Eu?Eu(C):new m.constructor(C);return m.copy(G),G}function gc(m){var x=new m.constructor(m.byteLength);return new Zs(x).set(new Zs(m)),x}function Ag(m,x){var C=x?gc(m.buffer):m.buffer;return new m.constructor(C,m.byteOffset,m.length)}function vd(m,x){if(m!==x){var C=m!==l,G=m===null,ne=m==m,ce=Dt(m),Oe=x!==l,Fe=x===null,et=x==x,jt=Dt(x);if(!Fe&&!jt&&!ce&&m>x||ce&&Oe&&et&&!Fe&&!jt||G&&Oe&&et||!C&&et||!ne)return 1;if(!G&&!ce&&!jt&&m<x||jt&&C&&ne&&!G&&!ce||Fe&&C&&ne||!Oe&&ne||!et)return-1}return 0}function Mg(m,x,C,G){for(var ne=-1,ce=m.length,Oe=C.length,Fe=-1,et=x.length,jt=ji(ce-Oe,0),Vt=Gn(et+jt),yn=!G;++Fe<et;)Vt[Fe]=x[Fe];for(;++ne<Oe;)(yn||ne<ce)&&(Vt[C[ne]]=m[ne]);for(;jt--;)Vt[Fe++]=m[ne++];return Vt}function mc(m,x,C,G){for(var ne=-1,ce=m.length,Oe=-1,Fe=C.length,et=-1,jt=x.length,Vt=ji(ce-Fe,0),yn=Gn(Vt+jt),Yn=!G;++ne<Vt;)yn[ne]=m[ne];for(var Qn=ne;++et<jt;)yn[Qn+et]=x[et];for(;++Oe<Fe;)(Yn||ne<ce)&&(yn[Qn+C[Oe]]=m[ne++]);return yn}function va(m,x){var C=-1,G=m.length;for(x||(x=Gn(G));++C<G;)x[C]=m[C];return x}function ds(m,x,C,G){var ne=!C;C||(C={});for(var ce=-1,Oe=x.length;++ce<Oe;){var Fe=x[ce],et=G?G(C[Fe],m[Fe],Fe,C,m):l;et===l&&(et=m[Fe]),ne?us(C,Fe,et):Li(C,Fe,et)}return C}function ou(m,x){return function(C,G){var ne=Jr(C)?Uh:zh,ce=x?x():{};return ne(C,m,Rr(G,2),ce)}}function yc(m){return uo((function(x,C){var G=-1,ne=C.length,ce=ne>1?C[ne-1]:l,Oe=ne>2?C[2]:l;for(ce=m.length>3&&typeof ce=="function"?(ne--,ce):l,Oe&&Fi(C[0],C[1],Oe)&&(ce=ne<3?l:ce,ne=1),x=L(x);++G<ne;){var Fe=C[G];Fe&&m(x,Fe,G,ce)}return x}))}function _c(m,x){return function(C,G){if(C==null)return C;if(!fl(C))return m(C,G);for(var ne=C.length,ce=x?ne:-1,Oe=L(C);(x?ce--:++ce<ne)&&G(Oe[ce],ce,Oe)!==!1;);return C}}function bc(m){return function(x,C,G){for(var ne=-1,ce=L(x),Oe=G(x),Fe=Oe.length;Fe--;){var et=Oe[m?Fe:++ne];if(C(ce[et],et,ce)===!1)break}return x}}function $p(m){return function(x){var C=os(x=Wt(x))?Qa(x):l,G=C?C[0]:x.charAt(0),ne=C?Uo(C,1).join(""):x.slice(1);return G[m]()+ne}}function iu(m){return function(x){return ad(di(jr(x).replace(Kn,"")),m,"")}}function wc(m){return function(){var x=arguments;switch(x.length){case 0:return new m;case 1:return new m(x[0]);case 2:return new m(x[0],x[1]);case 3:return new m(x[0],x[1],x[2]);case 4:return new m(x[0],x[1],x[2],x[3]);case 5:return new m(x[0],x[1],x[2],x[3],x[4]);case 6:return new m(x[0],x[1],x[2],x[3],x[4],x[5]);case 7:return new m(x[0],x[1],x[2],x[3],x[4],x[5],x[6])}var C=pc(m.prototype),G=m.apply(C,x);return Ni(G)?G:C}}function Up(m){return function(x,C,G){var ne=L(x);if(!fl(x)){var ce=Rr(C,3);x=on(x),C=function(Fe){return ce(ne[Fe],Fe,ne)}}var Oe=m(x,C,G);return Oe>-1?ne[ce?x[Oe]:Oe]:l}}function fs(m){return Ls((function(x){var C=x.length,G=C,ne=Ul.prototype.thru;for(m&&x.reverse();G--;){var ce=x[G];if(typeof ce!="function")throw new Re(f);if(ne&&!Oe&&Cu(ce)=="wrapper")var Oe=new Ul([],!0)}for(G=Oe?G:C;++G<C;){var Fe=Cu(ce=x[G]),et=Fe=="wrapper"?zp(ce):l;Oe=et&&Fs(et[0])&&et[1]==424&&!et[4].length&&et[9]==1?Oe[Cu(et[0])].apply(Oe,et[3]):ce.length==1&&Fs(ce)?Oe[Fe]():Oe.thru(ce)}return function(){var jt=arguments,Vt=jt[0];if(Oe&&jt.length==1&&Jr(Vt))return Oe.plant(Vt).value();for(var yn=0,Yn=C?x[yn].apply(this,jt):Vt;++yn<C;)Yn=x[yn].call(this,Yn);return Yn}}))}function wf(m,x,C,G,ne,ce,Oe,Fe,et,jt){var Vt=x&w,yn=1&x,Yn=2&x,Qn=24&x,Sr=512&x,an=Yn?l:wc(m);return function Tn(){for(var Br=arguments.length,ir=Gn(Br),at=Br;at--;)ir[at]=arguments[at];if(Qn)var Yr=Nu(Tn),Ao=Vh(ir,Yr);if(G&&(ir=Mg(ir,G,ne,Qn)),ce&&(ir=mc(ir,ce,Oe,Qn)),Br-=Ao,Qn&&Br<jt){var Mr=ll(ir,Yr);return ov(m,x,wf,Tn.placeholder,C,ir,Mr,Fe,et,jt-Br)}var Ur=yn?C:this,xa=Yn?Ur[m]:m;return Br=ir.length,Fe?ir=Oc(ir,Fe):Sr&&Br>1&&ir.reverse(),Vt&&et<Br&&(ir.length=et),this&&this!==vi&&this instanceof Tn&&(xa=an||wc(xa)),xa.apply(Ur,ir)}}function Ef(m,x){return function(C,G){return(function(ne,ce,Oe,Fe){return ur(ne,(function(et,jt,Vt){ce(Fe,Oe(et),jt,Vt)})),Fe})(C,m,x(G),{})}}function gd(m,x){return function(C,G){var ne;if(C===l&&G===l)return x;if(C!==l&&(ne=C),G!==l){if(ne===l)return G;typeof C=="string"||typeof G=="string"?(C=cl(C),G=cl(G)):(C=Og(C),G=Og(G)),ne=m(C,G)}return ne}}function md(m){return Ls((function(x){return x=Mo(x,ui(Rr())),uo((function(C){var G=this;return m(x,(function(ne){return qo(ne,G,C)}))}))}))}function yd(m,x){var C=(x=x===l?" ":cl(x)).length;if(C<2)return C?mf(x,m):x;var G=mf(x,uf(m/Va(x)));return os(x)?Uo(Qa(G),0,m).join(""):G.slice(0,m)}function Vp(m){return function(x,C,G){return G&&typeof G!="number"&&Fi(x,C,G)&&(C=G=l),x=nn(x),C===l?(C=x,x=0):C=nn(C),(function(ne,ce,Oe,Fe){for(var et=-1,jt=ji(uf((ce-ne)/(Oe||1)),0),Vt=Gn(jt);jt--;)Vt[Fe?jt:++et]=ne,ne+=Oe;return Vt})(x,C,G=G===l?x<C?1:-1:nn(G),m)}}function _d(m){return function(x,C){return typeof x=="string"&&typeof C=="string"||(x=hn(x),C=hn(C)),m(x,C)}}function ov(m,x,C,G,ne,ce,Oe,Fe,et,jt){var Vt=8&x;x|=Vt?E:O,4&(x&=~(Vt?O:E))||(x&=-4);var yn=[m,x,ne,Vt?ce:l,Vt?Oe:l,Vt?l:ce,Vt?l:Oe,Fe,et,jt],Yn=C.apply(l,yn);return Fs(m)&&uv(Yn,yn),Yn.placeholder=G,Yp(Yn,m,x)}function Wp(m){var x=D[m];return function(C,G){if(C=hn(C),(G=G==null?0:Wa(Mt(G),292))&&dc(C)){var ne=(Wt(C)+"e").split("e");return+((ne=(Wt(x(ne[0]+"e"+(+ne[1]+G)))+"e").split("e"))[0]+"e"+(+ne[1]-G))}return x(C)}}var Tg=fc&&1/Ol(new fc([,-0]))[1]==M?function(m){return new fc(m)}:Et;function iv(m){return function(x){var C=Ti(x);return C==W?Ki(x):C==Ae?sd(x):(function(G,ne){return Mo(ne,(function(ce){return[ce,G[ce]]}))})(x,m(x))}}function ps(m,x,C,G,ne,ce,Oe,Fe){var et=2&x;if(!et&&typeof m!="function")throw new Re(f);var jt=G?G.length:0;if(jt||(x&=-97,G=ne=l),Oe=Oe===l?Oe:ji(Mt(Oe),0),Fe=Fe===l?Fe:Mt(Fe),jt-=ne?ne.length:0,x&O){var Vt=G,yn=ne;G=ne=l}var Yn=et?l:zp(m),Qn=[m,x,C,G,ne,Vt,yn,ce,Oe,Fe];if(Yn&&(function(an,Tn){var Br=an[1],ir=Tn[1],at=Br|ir,Yr=at<131,Ao=ir==w&&Br==8||ir==w&&Br==S&&an[7].length<=Tn[8]||ir==384&&Tn[7].length<=Tn[8]&&Br==8;if(!Yr&&!Ao)return an;1&ir&&(an[2]=Tn[2],at|=1&Br?0:4);var Mr=Tn[3];if(Mr){var Ur=an[3];an[3]=Ur?Mg(Ur,Mr,Tn[4]):Mr,an[4]=Ur?ll(an[3],v):Tn[4]}(Mr=Tn[5])&&(Ur=an[5],an[5]=Ur?mc(Ur,Mr,Tn[6]):Mr,an[6]=Ur?ll(an[5],v):Tn[6]),(Mr=Tn[7])&&(an[7]=Mr),ir&w&&(an[8]=an[8]==null?Tn[8]:Wa(an[8],Tn[8])),an[9]==null&&(an[9]=Tn[9]),an[0]=Tn[0],an[1]=at})(Qn,Yn),m=Qn[0],x=Qn[1],C=Qn[2],G=Qn[3],ne=Qn[4],!(Fe=Qn[9]=Qn[9]===l?et?0:m.length:ji(Qn[9]-jt,0))&&24&x&&(x&=-25),x&&x!=1)Sr=x==8||x==_?(function(an,Tn,Br){var ir=wc(an);return function at(){for(var Yr=arguments.length,Ao=Gn(Yr),Mr=Yr,Ur=Nu(at);Mr--;)Ao[Mr]=arguments[Mr];var xa=Yr<3&&Ao[0]!==Ur&&Ao[Yr-1]!==Ur?[]:ll(Ao,Ur);return(Yr-=xa.length)<Br?ov(an,Tn,wf,at.placeholder,l,Ao,xa,l,l,Br-Yr):qo(this&&this!==vi&&this instanceof at?ir:an,this,Ao)}})(m,x,Fe):x!=E&&x!=33||ne.length?wf.apply(l,Qn):(function(an,Tn,Br,ir){var at=1&Tn,Yr=wc(an);return function Ao(){for(var Mr=-1,Ur=arguments.length,xa=-1,Hl=ir.length,uu=Gn(Hl+Ur),Oa=this&&this!==vi&&this instanceof Ao?Yr:an;++xa<Hl;)uu[xa]=ir[xa];for(;Ur--;)uu[xa++]=arguments[++Mr];return qo(Oa,at?Br:this,uu)}})(m,x,C,G);else var Sr=(function(an,Tn,Br){var ir=1&Tn,at=wc(an);return function Yr(){return(this&&this!==vi&&this instanceof Yr?at:an).apply(ir?Br:this,arguments)}})(m,x,C);return Yp((Yn?yf:uv)(Sr,Qn),m,x)}function av(m,x,C,G){return m===l||zl(m,bn[C])&&!$n.call(G,C)?x:m}function lv(m,x,C,G,ne,ce){return Ni(m)&&Ni(x)&&(ce.set(x,m),kp(m,x,l,lv,ce),ce.delete(x)),m}function sv(m){return K(m)?l:m}function bd(m,x,C,G,ne,ce){var Oe=1&C,Fe=m.length,et=x.length;if(Fe!=et&&!(Oe&&et>Fe))return!1;var jt=ce.get(m),Vt=ce.get(x);if(jt&&Vt)return jt==x&&Vt==m;var yn=-1,Yn=!0,Qn=2&C?new eu:l;for(ce.set(m,x),ce.set(x,m);++yn<Fe;){var Sr=m[yn],an=x[yn];if(G)var Tn=Oe?G(an,Sr,yn,x,m,ce):G(Sr,an,yn,m,x,ce);if(Tn!==l){if(Tn)continue;Yn=!1;break}if(Qn){if(!of(x,(function(Br,ir){if(!rs(Qn,ir)&&(Sr===Br||ne(Sr,Br,C,G,ce)))return Qn.push(ir)}))){Yn=!1;break}}else if(Sr!==an&&!ne(Sr,an,C,G,ce)){Yn=!1;break}}return ce.delete(m),ce.delete(x),Yn}function Ls(m){return Tf(Mf(m,l,Cf),m+"")}function xf(m){return Cp(m,on,aa)}function Gp(m){return Cp(m,Zt,Ec)}var zp=ff?function(m){return ff.get(m)}:Et;function Cu(m){for(var x=m.name+"",C=Su[x],G=$n.call(Su,x)?C.length:0;G--;){var ne=C[G],ce=ne.func;if(ce==null||ce==m)return ne.name}return x}function Nu(m){return($n.call(he,"placeholder")?he:m).placeholder}function Rr(){var m=he.iteratee||fi;return m=m===fi?ru:m,arguments.length?m(arguments[0],arguments[1]):m}function wd(m,x){var C,G,ne=m.__data__;return((G=typeof(C=x))=="string"||G=="number"||G=="symbol"||G=="boolean"?C!=="__proto__":C===null)?ne[typeof x=="string"?"string":"hash"]:ne.map}function Of(m){for(var x=on(m),C=x.length;C--;){var G=x[C],ne=m[G];x[C]=[G,ne,xc(ne)]}return x}function hs(m,x){var C=(function(G,ne){return G==null?l:G[ne]})(m,x);return Mu(C)?C:l}var aa=Ep?function(m){return m==null?[]:(m=L(m),Ba(Ep(m),(function(x){return Zi.call(m,x)})))}:tt,Ec=Ep?function(m){for(var x=[];m;)oa(x,aa(m)),m=is(m);return x}:tt,Ti=Ei;function ku(m,x,C){for(var G=-1,ne=(x=jo(x,m)).length,ce=!1;++G<ne;){var Oe=vs(x[G]);if(!(ce=m!=null&&C(m,Oe)))break;m=m[Oe]}return ce||++G!=ne?ce:!!(ne=m==null?0:m.length)&&Uf(ne)&&Ra(Oe,ne)&&(Jr(m)||Nc(m))}function tl(m){return typeof m.constructor!="function"||Qt(m)?{}:pc(is(m))}function Sf(m){return Jr(m)||Nc(m)||!!(Rs&&m&&m[Rs])}function Ra(m,x){var C=typeof m;return!!(x=x??T)&&(C=="number"||C!="symbol"&&Nn.test(m))&&m>-1&&m%1==0&&m<x}function Fi(m,x,C){if(!Ni(C))return!1;var G=typeof x;return!!(G=="number"?fl(C)&&Ra(x,C.length):G=="string"&&x in C)&&zl(C[x],m)}function Is(m,x){if(Jr(m))return!1;var C=typeof m;return!(C!="number"&&C!="symbol"&&C!="boolean"&&m!=null&&!Dt(m))||kt.test(m)||!q.test(m)||x!=null&&m in L(x)}function Fs(m){var x=Cu(m),C=he[x];if(typeof C!="function"||!(x in mo.prototype))return!1;if(m===C)return!0;var G=zp(C);return!!G&&m===G[0]}(cd&&Ti(new cd(new ArrayBuffer(1)))!=Be||dd&&Ti(new dd)!=W||df&&Ti(df.resolve())!=ie||fc&&Ti(new fc)!=Ae||Ou&&Ti(new Ou)!=He)&&(Ti=function(m){var x=Ei(m),C=x==J?m.constructor:l,G=C?Ru(C):"";if(G)switch(G){case fy:return Be;case pf:return W;case py:return ie;case hy:return Ae;case vg:return He}return x});var Hp=Jn?Cl:ct;function Qt(m){var x=m&&m.constructor;return m===(typeof x=="function"&&x.prototype||bn)}function xc(m){return m==m&&!Ni(m)}function Af(m,x){return function(C){return C!=null&&C[m]===x&&(x!==l||m in L(C))}}function Mf(m,x,C){return x=ji(x===l?m.length-1:x,0),function(){for(var G=arguments,ne=-1,ce=ji(G.length-x,0),Oe=Gn(ce);++ne<ce;)Oe[ne]=G[x+ne];ne=-1;for(var Fe=Gn(x+1);++ne<x;)Fe[ne]=G[ne];return Fe[x]=C(Oe),qo(m,this,Fe)}}function Pu(m,x){return x.length<2?m:Ds(m,Tl(x,0,-1))}function Oc(m,x){for(var C=m.length,G=Wa(x.length,C),ne=va(m);G--;){var ce=x[G];m[G]=Ra(ce,C)?ne[ce]:l}return m}function Xp(m,x){if((x!=="constructor"||typeof m[x]!="function")&&x!="__proto__")return m[x]}var uv=cv(yf),Sc=Wh||function(m,x){return vi.setTimeout(m,x)},Tf=cv(gy);function Yp(m,x,C){var G=x+"";return Tf(m,(function(ne,ce){var Oe=ce.length;if(!Oe)return ne;var Fe=Oe-1;return ce[Fe]=(Oe>1?"& ":"")+ce[Fe],ce=ce.join(Oe>2?", ":" "),ne.replace(ke,`{
|
||
/* [wrapped with `+ce+`] */
|
||
`)})(G,(function(ne,ce){return Fa(P,(function(Oe){var Fe="_."+Oe[0];ce&Oe[1]&&!Za(ne,Fe)&&ne.push(Fe)})),ne.sort()})((function(ne){var ce=ne.match(Ke);return ce?ce[1].split(Le):[]})(G),C)))}function cv(m){var x=0,C=0;return function(){var G=Op(),ne=16-(G-C);if(C=G,ne>0){if(++x>=800)return arguments[0]}else x=0;return m.apply(l,arguments)}}function Bs(m,x){var C=-1,G=m.length,ne=G-1;for(x=x===l?G:x;++C<x;){var ce=ev(C,ne),Oe=m[ce];m[ce]=m[C],m[C]=Oe}return m.length=x,m}var dv=(function(m){var x=su(m,(function(G){return C.size===500&&C.clear(),G})),C=x.cache;return x})((function(m){var x=[];return m.charCodeAt(0)===46&&x.push(""),m.replace(Rt,(function(C,G,ne,ce){x.push(ne?ce.replace(Tt,"$1"):G||C)})),x}));function vs(m){if(typeof m=="string"||Dt(m))return m;var x=m+"";return x=="0"&&1/m==-1/0?"-0":x}function Ru(m){if(m!=null){try{return no.call(m)}catch{}try{return m+""}catch{}}return""}function qp(m){if(m instanceof mo)return m.clone();var x=new Ul(m.__wrapped__,m.__chain__);return x.__actions__=va(m.__actions__),x.__index__=m.__index__,x.__values__=m.__values__,x}var Cg=uo((function(m,x){return Oi(m)?cs(m,Ji(x,1,Oi,!0)):[]})),Ng=uo((function(m,x){var C=mi(x);return Oi(C)&&(C=l),Oi(m)?cs(m,Ji(x,1,Oi,!0),Rr(C,2)):[]})),kg=uo((function(m,x){var C=mi(x);return Oi(C)&&(C=l),Oi(m)?cs(m,Ji(x,1,Oi,!0),l,C):[]}));function fv(m,x,C){var G=m==null?0:m.length;if(!G)return-1;var ne=C==null?0:Mt(C);return ne<0&&(ne=ji(G+ne,0)),$a(m,Rr(x,3),ne)}function Kp(m,x,C){var G=m==null?0:m.length;if(!G)return-1;var ne=G-1;return C!==l&&(ne=Mt(C),ne=C<0?ji(G+ne,0):Wa(ne,G-1)),$a(m,Rr(x,3),ne,!0)}function Cf(m){return m!=null&&m.length?Ji(m,1):[]}function Pg(m){return m&&m.length?m[0]:l}var gs=uo((function(m){var x=Mo(m,Ip);return x.length&&x[0]===m[0]?gf(x):[]})),Du=uo((function(m){var x=mi(m),C=Mo(m,Ip);return x===mi(C)?x=l:C.pop(),C.length&&C[0]===m[0]?gf(C,Rr(x,2)):[]})),_y=uo((function(m){var x=mi(m),C=Mo(m,Ip);return(x=typeof x=="function"?x:l)&&C.pop(),C.length&&C[0]===m[0]?gf(C,l,x):[]}));function mi(m){var x=m==null?0:m.length;return x?m[x-1]:l}var Nf=uo(Ac);function Ac(m,x){return m&&m.length&&x&&x.length?Pp(m,x):m}var kf=Ls((function(m,x){var C=m==null?0:m.length,G=hf(m,x);return Qh(m,Mo(x,(function(ne){return Ra(ne,C)?+ne:ne})).sort(vd)),G}));function Ed(m){return m==null?m:dy.call(m)}var Pf=uo((function(m){return Tu(Ji(m,1,Oi,!0))})),Rf=uo((function(m){var x=mi(m);return Oi(x)&&(x=l),Tu(Ji(m,1,Oi,!0),Rr(x,2))})),Df=uo((function(m){var x=mi(m);return x=typeof x=="function"?x:l,Tu(Ji(m,1,Oi,!0),l,x)}));function Mc(m){if(!m||!m.length)return[];var x=0;return m=Ba(m,(function(C){if(Oi(C))return x=ji(C.length,x),!0})),Ks(x,(function(C){return Mo(m,Ua(C))}))}function au(m,x){if(!m||!m.length)return[];var C=Mc(m);return x==null?C:Mo(C,(function(G){return qo(x,l,G)}))}var ga=uo((function(m,x){return Oi(m)?cs(m,x):[]})),Zp=uo((function(m){return Lp(Ba(m,Oi))})),jf=uo((function(m){var x=mi(m);return Oi(x)&&(x=l),Lp(Ba(m,Oi),Rr(x,2))})),Tc=uo((function(m){var x=mi(m);return x=typeof x=="function"?x:l,Lp(Ba(m,Oi),l,x)})),xd=uo(Mc),wa=uo((function(m){var x=m.length,C=x>1?m[x-1]:l;return C=typeof C=="function"?(m.pop(),C):l,au(m,C)}));function xi(m){var x=he(m);return x.__chain__=!0,x}function Lf(m,x){return x(m)}var za=Ls((function(m){var x=m.length,C=x?m[0]:0,G=this.__wrapped__,ne=function(ce){return hf(ce,m)};return!(x>1||this.__actions__.length)&&G instanceof mo&&Ra(C)?((G=G.slice(C,+C+(x?1:0))).__actions__.push({func:Lf,args:[ne],thisArg:l}),new Ul(G,this.__chain__).thru((function(ce){return x&&!ce.length&&ce.push(l),ce}))):this.thru(ne)})),wr=ou((function(m,x,C){$n.call(m,C)?++m[C]:us(m,C,1)})),Jp=Up(fv),If=Up(Kp);function Qp(m,x){return(Jr(m)?Fa:gi)(m,Rr(x,3))}function pv(m,x){return(Jr(m)?_p:yg)(m,Rr(x,3))}var Rg=ou((function(m,x,C){$n.call(m,C)?m[C].push(x):us(m,C,[x])})),ju=uo((function(m,x,C){var G=-1,ne=typeof x=="function",ce=fl(m)?Gn(m.length):[];return gi(m,(function(Oe){ce[++G]=ne?qo(x,Oe,C):Ga(Oe,x,C)})),ce})),Dg=ou((function(m,x,C){us(m,C,x)}));function Cc(m,x){return(Jr(m)?Mo:Ml)(m,Rr(x,3))}var jg=ou((function(m,x,C){m[C?0:1].push(x)}),(function(){return[[],[]]})),hv=uo((function(m,x){if(m==null)return[];var C=x.length;return C>1&&Fi(m,x[0],x[1])?x=[]:C>2&&Fi(x[0],x[1],x[2])&&(x=[x[0]]),wg(m,Ji(x,1),[])})),Ff=pg||function(){return vi.Date.now()};function Lg(m,x,C){return x=C?l:x,x=m&&x==null?m.length:x,ps(m,w,l,l,l,l,x)}function Gl(m,x){var C;if(typeof x!="function")throw new Re(f);return m=Mt(m),function(){return--m>0&&(C=x.apply(this,arguments)),m<=1&&(x=l),C}}var lu=uo((function(m,x,C){var G=1;if(C.length){var ne=ll(C,Nu(lu));G|=E}return ps(m,G,x,C,ne)})),Lu=uo((function(m,x,C){var G=3;if(C.length){var ne=ll(C,Nu(Lu));G|=E}return ps(x,G,m,C,ne)}));function Er(m,x,C){var G,ne,ce,Oe,Fe,et,jt=0,Vt=!1,yn=!1,Yn=!0;if(typeof m!="function")throw new Re(f);function Qn(at){var Yr=G,Ao=ne;return G=ne=l,jt=at,Oe=m.apply(Ao,Yr)}function Sr(at){return jt=at,Fe=Sc(Tn,x),Vt?Qn(at):Oe}function an(at){var Yr=at-et;return et===l||Yr>=x||Yr<0||yn&&at-jt>=ce}function Tn(){var at=Ff();if(an(at))return Br(at);Fe=Sc(Tn,(function(Yr){var Ao=x-(Yr-et);return yn?Wa(Ao,ce-(Yr-jt)):Ao})(at))}function Br(at){return Fe=l,Yn&&G?Qn(at):(G=ne=l,Oe)}function ir(){var at=Ff(),Yr=an(at);if(G=arguments,ne=this,et=at,Yr){if(Fe===l)return Sr(et);if(yn)return Bp(Fe),Fe=Sc(Tn,x),Qn(et)}return Fe===l&&(Fe=Sc(Tn,x)),Oe}return x=hn(x)||0,Ni(C)&&(Vt=!!C.leading,ce=(yn="maxWait"in C)?ji(hn(C.maxWait)||0,x):ce,Yn="trailing"in C?!!C.trailing:Yn),ir.cancel=function(){Fe!==l&&Bp(Fe),jt=0,G=et=ne=Fe=l},ir.flush=function(){return Fe===l?Oe:Br(Ff())},ir}var vv=uo((function(m,x){return Xh(m,1,x)})),Od=uo((function(m,x,C){return Xh(m,hn(x)||0,C)}));function su(m,x){if(typeof m!="function"||x!=null&&typeof x!="function")throw new Re(f);var C=function(){var G=arguments,ne=x?x.apply(this,G):G[0],ce=C.cache;if(ce.has(ne))return ce.get(ne);var Oe=m.apply(this,G);return C.cache=ce.set(ne,Oe)||ce,Oe};return C.cache=new(su.Cache||ss),C}function Bf(m){if(typeof m!="function")throw new Re(f);return function(){var x=arguments;switch(x.length){case 0:return!m.call(this);case 1:return!m.call(this,x[0]);case 2:return!m.call(this,x[0],x[1]);case 3:return!m.call(this,x[0],x[1],x[2])}return!m.apply(this,x)}}su.Cache=ss;var Ha=yy((function(m,x){var C=(x=x.length==1&&Jr(x[0])?Mo(x[0],ui(Rr())):Mo(Ji(x,1),ui(Rr()))).length;return uo((function(G){for(var ne=-1,ce=Wa(G.length,C);++ne<ce;)G[ne]=x[ne].call(this,G[ne]);return qo(m,this,G)}))})),ms=uo((function(m,x){var C=ll(x,Nu(ms));return ps(m,E,l,x,C)})),Ci=uo((function(m,x){var C=ll(x,Nu(Ci));return ps(m,O,l,x,C)})),dl=Ls((function(m,x){return ps(m,S,l,l,l,x)}));function zl(m,x){return m===x||m!=m&&x!=x}var by=_d(Mi),$f=_d((function(m,x){return m>=x})),Nc=Np((function(){return arguments})())?Np:function(m){return Bi(m)&&$n.call(m,"callee")&&!Zi.call(m,"callee")},Jr=Gn.isArray,Ig=La?ui(La):function(m){return Bi(m)&&Ei(m)==Ye};function fl(m){return m!=null&&Uf(m.length)&&!Cl(m)}function Oi(m){return Bi(m)&&fl(m)}var nl=hg||ct,gv=id?ui(id):function(m){return Bi(m)&&Ei(m)==U};function Ea(m){if(!Bi(m))return!1;var x=Ei(m);return x==z||x=="[object DOMException]"||typeof m.message=="string"&&typeof m.name=="string"&&!K(m)}function Cl(m){if(!Ni(m))return!1;var x=Ei(m);return x==X||x==Y||x=="[object AsyncFunction]"||x=="[object Proxy]"}function kc(m){return typeof m=="number"&&m==Mt(m)}function Uf(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=T}function Ni(m){var x=typeof m;return m!=null&&(x=="object"||x=="function")}function Bi(m){return m!=null&&typeof m=="object"}var eh=_u?ui(_u):function(m){return Bi(m)&&Ti(m)==W};function mv(m){return typeof m=="number"||Bi(m)&&Ei(m)==Q}function K(m){if(!Bi(m)||Ei(m)!=J)return!1;var x=is(m);if(x===null)return!0;var C=$n.call(x,"constructor")&&x.constructor;return typeof C=="function"&&C instanceof C&&no.call(C)==ul}var ge=Ia?ui(Ia):function(m){return Bi(m)&&Ei(m)==Se},Ie=ra?ui(ra):function(m){return Bi(m)&&Ti(m)==Ae};function wt(m){return typeof m=="string"||!Jr(m)&&Bi(m)&&Ei(m)==Pe}function Dt(m){return typeof m=="symbol"||Bi(m)&&Ei(m)==De}var yt=wl?ui(wl):function(m){return Bi(m)&&Uf(m.length)&&!!Cn[Ei(m)]},Nt=_d(js),tn=_d((function(m,x){return m<=x}));function sn(m){if(!m)return[];if(fl(m))return wt(m)?Qa(m):va(m);if(as&&m[as])return(function(C){for(var G,ne=[];!(G=C.next()).done;)ne.push(G.value);return ne})(m[as]());var x=Ti(m);return(x==W?Ki:x==Ae?Ol:Qr)(m)}function nn(m){return m?(m=hn(m))===M||m===-1/0?17976931348623157e292*(m<0?-1:1):m==m?m:0:m===0?m:0}function Mt(m){var x=nn(m),C=x%1;return x==x?C?x-C:x:0}function wn(m){return m?Au(Mt(m),0,R):0}function hn(m){if(typeof m=="number")return m;if(Dt(m))return B;if(Ni(m)){var x=typeof m.valueOf=="function"?m.valueOf():m;m=Ni(x)?x+"":x}if(typeof m!="string")return m===0?m:+m;m=$l(m);var C=Lo.test(m);return C||ho.test(m)?lr(m.slice(2),C?2:8):ao.test(m)?B:+m}function rn(m){return ds(m,Zt(m))}function Wt(m){return m==null?"":cl(m)}var st=yc((function(m,x){if(Qt(x)||fl(x))ds(x,on(x),m);else for(var C in x)$n.call(x,C)&&Li(m,C,x[C])})),St=yc((function(m,x){ds(x,Zt(x),m)})),ln=yc((function(m,x,C,G){ds(x,Zt(x),m,G)})),An=yc((function(m,x,C,G){ds(x,on(x),m,G)})),Xt=Ls(hf),kn=uo((function(m,x){m=L(m);var C=-1,G=x.length,ne=G>2?x[2]:l;for(ne&&Fi(x[0],x[1],ne)&&(G=1);++C<G;)for(var ce=x[C],Oe=Zt(ce),Fe=-1,et=Oe.length;++Fe<et;){var jt=Oe[Fe],Vt=m[jt];(Vt===l||zl(Vt,bn[jt])&&!$n.call(m,jt))&&(m[jt]=ce[jt])}return m})),Kt=uo((function(m){return m.push(l,lv),qo(pr,l,m)}));function _n(m,x,C){var G=m==null?l:Ds(m,x);return G===l?C:G}function Yt(m,x){return m!=null&&ku(m,x,Kh)}var xn=Ef((function(m,x,C){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),m[x]=C}),co(Nr)),ar=Ef((function(m,x,C){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),$n.call(m,x)?m[x].push(C):m[x]=[C]}),Rr),xr=uo(Ga);function on(m){return fl(m)?Mp(m):Wl(m)}function Zt(m){return fl(m)?Mp(m,!0):_g(m)}var Ht=yc((function(m,x,C){kp(m,x,C)})),pr=yc((function(m,x,C,G){kp(m,x,C,G)})),Dr=Ls((function(m,x){var C={};if(m==null)return C;var G=!1;x=Mo(x,(function(ce){return ce=jo(ce,m),G||(G=ce.length>1),ce})),ds(m,Gp(m),C),G&&(C=Al(C,7,sv));for(var ne=x.length;ne--;)Dp(C,x[ne]);return C})),Un=Ls((function(m,x){return m==null?{}:(function(C,G){return Eg(C,G,(function(ne,ce){return Yt(C,ce)}))})(m,x)}));function $r(m,x){if(m==null)return{};var C=Mo(Gp(m),(function(G){return[G]}));return x=Rr(x),Eg(m,C,(function(G,ne){return x(G,ne[0])}))}var Or=iv(on),Fr=iv(Zt);function Qr(m){return m==null?[]:lc(m,on(m))}var ki=iu((function(m,x,C){return x=x.toLowerCase(),m+(C?Si(x):x)}));function Si(m){return zi(Wt(m).toLowerCase())}function jr(m){return(m=Wt(m))&&m.replace(qn,lf).replace(br,"")}var Gi=iu((function(m,x,C){return m+(C?"-":"")+x.toLowerCase()})),Ko=iu((function(m,x,C){return m+(C?" ":"")+x.toLowerCase()})),Pi=$p("toLowerCase"),$i=iu((function(m,x,C){return m+(C?"_":"")+x.toLowerCase()})),Qi=iu((function(m,x,C){return m+(C?" ":"")+zi(x)})),la=iu((function(m,x,C){return m+(C?" ":"")+x.toUpperCase()})),zi=$p("toUpperCase");function di(m,x,C){return m=Wt(m),(x=C?l:x)===l?(function(G){return ht.test(G)})(m)?(function(G){return G.match(si)||[]})(m):(function(G){return G.match(dt)||[]})(m):m.match(x)||[]}var Cr=uo((function(m,x){try{return qo(m,l,x)}catch(C){return Ea(C)?C:new go(C)}})),sa=Ls((function(m,x){return Fa(x,(function(C){C=vs(C),us(m,C,lu(m[C],m))})),m}));function co(m){return function(){return m}}var cr=fs(),Xr=fs(!0);function Nr(m){return m}function fi(m){return ru(typeof m=="function"?m:Al(m,1))}var $s=uo((function(m,x){return function(C){return Ga(C,m,x)}})),yi=uo((function(m,x){return function(C){return Ga(m,C,x)}}));function Ce(m,x,C){var G=on(x),ne=vf(x,G);C!=null||Ni(x)&&(ne.length||!G.length)||(C=x,x=m,m=this,ne=vf(x,on(x)));var ce=!(Ni(C)&&"chain"in C&&!C.chain),Oe=Cl(m);return Fa(ne,(function(Fe){var et=x[Fe];m[Fe]=et,Oe&&(m.prototype[Fe]=function(){var jt=this.__chain__;if(ce||jt){var Vt=m(this.__wrapped__),yn=Vt.__actions__=va(this.__actions__);return yn.push({func:et,args:arguments,thisArg:m}),Vt.__chain__=jt,Vt}return et.apply(m,oa([this.value()],arguments))})})),m}function Et(){}var _t=md(Mo),Ln=md(bp),Gr=md(of);function xe(m){return Is(m)?Ua(vs(m)):(function(x){return function(C){return Ds(C,x)}})(m)}var de=Vp(),We=Vp(!0);function tt(){return[]}function ct(){return!1}var Xe=gd((function(m,x){return m+x}),0),ze=Wp("ceil"),Qe=gd((function(m,x){return m/x}),1),Ee=Wp("floor"),Ue,be=gd((function(m,x){return m*x}),1),nt=Wp("round"),ot=gd((function(m,x){return m-x}),0);return he.after=function(m,x){if(typeof x!="function")throw new Re(f);return m=Mt(m),function(){if(--m<1)return x.apply(this,arguments)}},he.ary=Lg,he.assign=st,he.assignIn=St,he.assignInWith=ln,he.assignWith=An,he.at=Xt,he.before=Gl,he.bind=lu,he.bindAll=sa,he.bindKey=Lu,he.castArray=function(){if(!arguments.length)return[];var m=arguments[0];return Jr(m)?m:[m]},he.chain=xi,he.chunk=function(m,x,C){x=(C?Fi(m,x,C):x===l)?1:ji(Mt(x),0);var G=m==null?0:m.length;if(!G||x<1)return[];for(var ne=0,ce=0,Oe=Gn(uf(G/x));ne<G;)Oe[ce++]=Tl(m,ne,ne+=x);return Oe},he.compact=function(m){for(var x=-1,C=m==null?0:m.length,G=0,ne=[];++x<C;){var ce=m[x];ce&&(ne[G++]=ce)}return ne},he.concat=function(){var m=arguments.length;if(!m)return[];for(var x=Gn(m-1),C=arguments[0],G=m;G--;)x[G-1]=arguments[G];return oa(Jr(C)?va(C):[C],Ji(x,1))},he.cond=function(m){var x=m==null?0:m.length,C=Rr();return m=x?Mo(m,(function(G){if(typeof G[1]!="function")throw new Re(f);return[C(G[0]),G[1]]})):[],uo((function(G){for(var ne=-1;++ne<x;){var ce=m[ne];if(qo(ce[0],this,G))return qo(ce[1],this,G)}}))},he.conforms=function(m){return(function(x){var C=on(x);return function(G){return Hh(G,x,C)}})(Al(m,1))},he.constant=co,he.countBy=wr,he.create=function(m,x){var C=pc(m);return x==null?C:nu(C,x)},he.curry=function m(x,C,G){var ne=ps(x,8,l,l,l,l,l,C=G?l:C);return ne.placeholder=m.placeholder,ne},he.curryRight=function m(x,C,G){var ne=ps(x,_,l,l,l,l,l,C=G?l:C);return ne.placeholder=m.placeholder,ne},he.debounce=Er,he.defaults=kn,he.defaultsDeep=Kt,he.defer=vv,he.delay=Od,he.difference=Cg,he.differenceBy=Ng,he.differenceWith=kg,he.drop=function(m,x,C){var G=m==null?0:m.length;return G?Tl(m,(x=C||x===l?1:Mt(x))<0?0:x,G):[]},he.dropRight=function(m,x,C){var G=m==null?0:m.length;return G?Tl(m,0,(x=G-(x=C||x===l?1:Mt(x)))<0?0:x):[]},he.dropRightWhile=function(m,x){return m&&m.length?jp(m,Rr(x,3),!0,!0):[]},he.dropWhile=function(m,x){return m&&m.length?jp(m,Rr(x,3),!0):[]},he.fill=function(m,x,C,G){var ne=m==null?0:m.length;return ne?(C&&typeof C!="number"&&Fi(m,x,C)&&(C=0,G=ne),(function(ce,Oe,Fe,et){var jt=ce.length;for((Fe=Mt(Fe))<0&&(Fe=-Fe>jt?0:jt+Fe),(et=et===l||et>jt?jt:Mt(et))<0&&(et+=jt),et=Fe>et?0:wn(et);Fe<et;)ce[Fe++]=Oe;return ce})(m,x,C,G)):[]},he.filter=function(m,x){return(Jr(m)?Ba:Io)(m,Rr(x,3))},he.flatMap=function(m,x){return Ji(Cc(m,x),1)},he.flatMapDeep=function(m,x){return Ji(Cc(m,x),M)},he.flatMapDepth=function(m,x,C){return C=C===l?1:Mt(C),Ji(Cc(m,x),C)},he.flatten=Cf,he.flattenDeep=function(m){return m!=null&&m.length?Ji(m,M):[]},he.flattenDepth=function(m,x){return m!=null&&m.length?Ji(m,x=x===l?1:Mt(x)):[]},he.flip=function(m){return ps(m,512)},he.flow=cr,he.flowRight=Xr,he.fromPairs=function(m){for(var x=-1,C=m==null?0:m.length,G={};++x<C;){var ne=m[x];G[ne[0]]=ne[1]}return G},he.functions=function(m){return m==null?[]:vf(m,on(m))},he.functionsIn=function(m){return m==null?[]:vf(m,Zt(m))},he.groupBy=Rg,he.initial=function(m){return m!=null&&m.length?Tl(m,0,-1):[]},he.intersection=gs,he.intersectionBy=Du,he.intersectionWith=_y,he.invert=xn,he.invertBy=ar,he.invokeMap=ju,he.iteratee=fi,he.keyBy=Dg,he.keys=on,he.keysIn=Zt,he.map=Cc,he.mapKeys=function(m,x){var C={};return x=Rr(x,3),ur(m,(function(G,ne,ce){us(C,x(G,ne,ce),G)})),C},he.mapValues=function(m,x){var C={};return x=Rr(x,3),ur(m,(function(G,ne,ce){us(C,ne,x(G,ne,ce))})),C},he.matches=function(m){return Zh(Al(m,1))},he.matchesProperty=function(m,x){return Jh(m,Al(x,1))},he.memoize=su,he.merge=Ht,he.mergeWith=pr,he.method=$s,he.methodOf=yi,he.mixin=Ce,he.negate=Bf,he.nthArg=function(m){return m=Mt(m),uo((function(x){return bg(x,m)}))},he.omit=Dr,he.omitBy=function(m,x){return $r(m,Bf(Rr(x)))},he.once=function(m){return Gl(2,m)},he.orderBy=function(m,x,C,G){return m==null?[]:(Jr(x)||(x=x==null?[]:[x]),Jr(C=G?l:C)||(C=C==null?[]:[C]),wg(m,x,C))},he.over=_t,he.overArgs=Ha,he.overEvery=Ln,he.overSome=Gr,he.partial=ms,he.partialRight=Ci,he.partition=jg,he.pick=Un,he.pickBy=$r,he.property=xe,he.propertyOf=function(m){return function(x){return m==null?l:Ds(m,x)}},he.pull=Nf,he.pullAll=Ac,he.pullAllBy=function(m,x,C){return m&&m.length&&x&&x.length?Pp(m,x,Rr(C,2)):m},he.pullAllWith=function(m,x,C){return m&&m.length&&x&&x.length?Pp(m,x,l,C):m},he.pullAt=kf,he.range=de,he.rangeRight=We,he.rearg=dl,he.reject=function(m,x){return(Jr(m)?Ba:Io)(m,Bf(Rr(x,3)))},he.remove=function(m,x){var C=[];if(!m||!m.length)return C;var G=-1,ne=[],ce=m.length;for(x=Rr(x,3);++G<ce;){var Oe=m[G];x(Oe,G,m)&&(C.push(Oe),ne.push(G))}return Qh(m,ne),C},he.rest=function(m,x){if(typeof m!="function")throw new Re(f);return uo(m,x=x===l?x:Mt(x))},he.reverse=Ed,he.sampleSize=function(m,x,C){return x=(C?Fi(m,x,C):x===l)?1:Mt(x),(Jr(m)?Gh:tv)(m,x)},he.set=function(m,x,C){return m==null?m:hc(m,x,C)},he.setWith=function(m,x,C,G){return G=typeof G=="function"?G:l,m==null?m:hc(m,x,C,G)},he.shuffle=function(m){return(Jr(m)?mg:xg)(m)},he.slice=function(m,x,C){var G=m==null?0:m.length;return G?(C&&typeof C!="number"&&Fi(m,x,C)?(x=0,C=G):(x=x==null?0:Mt(x),C=C===l?G:Mt(C)),Tl(m,x,C)):[]},he.sortBy=hv,he.sortedUniq=function(m){return m&&m.length?nv(m):[]},he.sortedUniqBy=function(m,x){return m&&m.length?nv(m,Rr(x,2)):[]},he.split=function(m,x,C){return C&&typeof C!="number"&&Fi(m,x,C)&&(x=C=l),(C=C===l?R:C>>>0)?(m=Wt(m))&&(typeof x=="string"||x!=null&&!ge(x))&&!(x=cl(x))&&os(m)?Uo(Qa(m),0,C):m.split(x,C):[]},he.spread=function(m,x){if(typeof m!="function")throw new Re(f);return x=x==null?0:ji(Mt(x),0),uo((function(C){var G=C[x],ne=Uo(C,0,x);return G&&oa(ne,G),qo(m,this,ne)}))},he.tail=function(m){var x=m==null?0:m.length;return x?Tl(m,1,x):[]},he.take=function(m,x,C){return m&&m.length?Tl(m,0,(x=C||x===l?1:Mt(x))<0?0:x):[]},he.takeRight=function(m,x,C){var G=m==null?0:m.length;return G?Tl(m,(x=G-(x=C||x===l?1:Mt(x)))<0?0:x,G):[]},he.takeRightWhile=function(m,x){return m&&m.length?jp(m,Rr(x,3),!1,!0):[]},he.takeWhile=function(m,x){return m&&m.length?jp(m,Rr(x,3)):[]},he.tap=function(m,x){return x(m),m},he.throttle=function(m,x,C){var G=!0,ne=!0;if(typeof m!="function")throw new Re(f);return Ni(C)&&(G="leading"in C?!!C.leading:G,ne="trailing"in C?!!C.trailing:ne),Er(m,x,{leading:G,maxWait:x,trailing:ne})},he.thru=Lf,he.toArray=sn,he.toPairs=Or,he.toPairsIn=Fr,he.toPath=function(m){return Jr(m)?Mo(m,vs):Dt(m)?[m]:va(dv(Wt(m)))},he.toPlainObject=rn,he.transform=function(m,x,C){var G=Jr(m),ne=G||nl(m)||yt(m);if(x=Rr(x,4),C==null){var ce=m&&m.constructor;C=ne?G?new ce:[]:Ni(m)&&Cl(ce)?pc(is(m)):{}}return(ne?Fa:ur)(m,(function(Oe,Fe,et){return x(C,Oe,Fe,et)})),C},he.unary=function(m){return Lg(m,1)},he.union=Pf,he.unionBy=Rf,he.unionWith=Df,he.uniq=function(m){return m&&m.length?Tu(m):[]},he.uniqBy=function(m,x){return m&&m.length?Tu(m,Rr(x,2)):[]},he.uniqWith=function(m,x){return x=typeof x=="function"?x:l,m&&m.length?Tu(m,l,x):[]},he.unset=function(m,x){return m==null||Dp(m,x)},he.unzip=Mc,he.unzipWith=au,he.update=function(m,x,C){return m==null?m:vc(m,x,Fp(C))},he.updateWith=function(m,x,C,G){return G=typeof G=="function"?G:l,m==null?m:vc(m,x,Fp(C),G)},he.values=Qr,he.valuesIn=function(m){return m==null?[]:lc(m,Zt(m))},he.without=ga,he.words=di,he.wrap=function(m,x){return ms(Fp(x),m)},he.xor=Zp,he.xorBy=jf,he.xorWith=Tc,he.zip=xd,he.zipObject=function(m,x){return bf(m||[],x||[],Li)},he.zipObjectDeep=function(m,x){return bf(m||[],x||[],hc)},he.zipWith=wa,he.entries=Or,he.entriesIn=Fr,he.extend=St,he.extendWith=ln,Ce(he,he),he.add=Xe,he.attempt=Cr,he.camelCase=ki,he.capitalize=Si,he.ceil=ze,he.clamp=function(m,x,C){return C===l&&(C=x,x=l),C!==l&&(C=(C=hn(C))==C?C:0),x!==l&&(x=(x=hn(x))==x?x:0),Au(hn(m),x,C)},he.clone=function(m){return Al(m,4)},he.cloneDeep=function(m){return Al(m,5)},he.cloneDeepWith=function(m,x){return Al(m,5,x=typeof x=="function"?x:l)},he.cloneWith=function(m,x){return Al(m,4,x=typeof x=="function"?x:l)},he.conformsTo=function(m,x){return x==null||Hh(m,x,on(x))},he.deburr=jr,he.defaultTo=function(m,x){return m==null||m!=m?x:m},he.divide=Qe,he.endsWith=function(m,x,C){m=Wt(m),x=cl(x);var G=m.length,ne=C=C===l?G:Au(Mt(C),0,G);return(C-=x.length)>=0&&m.slice(C,ne)==x},he.eq=zl,he.escape=function(m){return(m=Wt(m))&&ae.test(m)?m.replace(zt,Wi):m},he.escapeRegExp=function(m){return(m=Wt(m))&&Pn.test(m)?m.replace(Gt,"\\$&"):m},he.every=function(m,x,C){var G=Jr(m)?bp:Yh;return C&&Fi(m,x,C)&&(x=l),G(m,Rr(x,3))},he.find=Jp,he.findIndex=fv,he.findKey=function(m,x){return ns(m,Rr(x,3),ur)},he.findLast=If,he.findLastIndex=Kp,he.findLastKey=function(m,x){return ns(m,Rr(x,3),ti)},he.floor=Ee,he.forEach=Qp,he.forEachRight=pv,he.forIn=function(m,x){return m==null?m:lo(m,Rr(x,3),Zt)},he.forInRight=function(m,x){return m==null?m:ei(m,Rr(x,3),Zt)},he.forOwn=function(m,x){return m&&ur(m,Rr(x,3))},he.forOwnRight=function(m,x){return m&&ti(m,Rr(x,3))},he.get=_n,he.gt=by,he.gte=$f,he.has=function(m,x){return m!=null&&ku(m,x,qh)},he.hasIn=Yt,he.head=Pg,he.identity=Nr,he.includes=function(m,x,C,G){m=fl(m)?m:Qr(m),C=C&&!G?Mt(C):0;var ne=m.length;return C<0&&(C=ji(ne+C,0)),wt(m)?C<=ne&&m.indexOf(x,C)>-1:!!ne&&bu(m,x,C)>-1},he.indexOf=function(m,x,C){var G=m==null?0:m.length;if(!G)return-1;var ne=C==null?0:Mt(C);return ne<0&&(ne=ji(G+ne,0)),bu(m,x,ne)},he.inRange=function(m,x,C){return x=nn(x),C===l?(C=x,x=0):C=nn(C),(function(G,ne,ce){return G>=Wa(ne,ce)&&G<ji(ne,ce)})(m=hn(m),x,C)},he.invoke=xr,he.isArguments=Nc,he.isArray=Jr,he.isArrayBuffer=Ig,he.isArrayLike=fl,he.isArrayLikeObject=Oi,he.isBoolean=function(m){return m===!0||m===!1||Bi(m)&&Ei(m)==F},he.isBuffer=nl,he.isDate=gv,he.isElement=function(m){return Bi(m)&&m.nodeType===1&&!K(m)},he.isEmpty=function(m){if(m==null)return!0;if(fl(m)&&(Jr(m)||typeof m=="string"||typeof m.splice=="function"||nl(m)||yt(m)||Nc(m)))return!m.length;var x=Ti(m);if(x==W||x==Ae)return!m.size;if(Qt(m))return!Wl(m).length;for(var C in m)if($n.call(m,C))return!1;return!0},he.isEqual=function(m,x){return hd(m,x)},he.isEqualWith=function(m,x,C){var G=(C=typeof C=="function"?C:l)?C(m,x):l;return G===l?hd(m,x,l,C):!!G},he.isError=Ea,he.isFinite=function(m){return typeof m=="number"&&dc(m)},he.isFunction=Cl,he.isInteger=kc,he.isLength=Uf,he.isMap=eh,he.isMatch=function(m,x){return m===x||Vl(m,x,Of(x))},he.isMatchWith=function(m,x,C){return C=typeof C=="function"?C:l,Vl(m,x,Of(x),C)},he.isNaN=function(m){return mv(m)&&m!=+m},he.isNative=function(m){if(Hp(m))throw new go("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mu(m)},he.isNil=function(m){return m==null},he.isNull=function(m){return m===null},he.isNumber=mv,he.isObject=Ni,he.isObjectLike=Bi,he.isPlainObject=K,he.isRegExp=ge,he.isSafeInteger=function(m){return kc(m)&&m>=-9007199254740991&&m<=T},he.isSet=Ie,he.isString=wt,he.isSymbol=Dt,he.isTypedArray=yt,he.isUndefined=function(m){return m===l},he.isWeakMap=function(m){return Bi(m)&&Ti(m)==He},he.isWeakSet=function(m){return Bi(m)&&Ei(m)=="[object WeakSet]"},he.join=function(m,x){return m==null?"":cf.call(m,x)},he.kebabCase=Gi,he.last=mi,he.lastIndexOf=function(m,x,C){var G=m==null?0:m.length;if(!G)return-1;var ne=G;return C!==l&&(ne=(ne=Mt(C))<0?ji(G+ne,0):Wa(ne,G-1)),x==x?(function(ce,Oe,Fe){for(var et=Fe+1;et--;)if(ce[et]===Oe)return et;return et})(m,x,ne):$a(m,El,ne,!0)},he.lowerCase=Ko,he.lowerFirst=Pi,he.lt=Nt,he.lte=tn,he.max=function(m){return m&&m.length?Ii(m,Nr,Mi):l},he.maxBy=function(m,x){return m&&m.length?Ii(m,Rr(x,2),Mi):l},he.mean=function(m){return vo(m,Nr)},he.meanBy=function(m,x){return vo(m,Rr(x,2))},he.min=function(m){return m&&m.length?Ii(m,Nr,js):l},he.minBy=function(m,x){return m&&m.length?Ii(m,Rr(x,2),js):l},he.stubArray=tt,he.stubFalse=ct,he.stubObject=function(){return{}},he.stubString=function(){return""},he.stubTrue=function(){return!0},he.multiply=be,he.nth=function(m,x){return m&&m.length?bg(m,Mt(x)):l},he.noConflict=function(){return vi._===this&&(vi._=wi),this},he.noop=Et,he.now=Ff,he.pad=function(m,x,C){m=Wt(m);var G=(x=Mt(x))?Va(m):0;if(!x||G>=x)return m;var ne=(x-G)/2;return yd(cc(ne),C)+m+yd(uf(ne),C)},he.padEnd=function(m,x,C){m=Wt(m);var G=(x=Mt(x))?Va(m):0;return x&&G<x?m+yd(x-G,C):m},he.padStart=function(m,x,C){m=Wt(m);var G=(x=Mt(x))?Va(m):0;return x&&G<x?yd(x-G,C)+m:m},he.parseInt=function(m,x,C){return C||x==null?x=0:x&&(x=+x),Sp(Wt(m).replace(qt,""),x||0)},he.random=function(m,x,C){if(C&&typeof C!="boolean"&&Fi(m,x,C)&&(x=C=l),C===l&&(typeof x=="boolean"?(C=x,x=l):typeof m=="boolean"&&(C=m,m=l)),m===l&&x===l?(m=0,x=1):(m=nn(m),x===l?(x=m,m=0):x=nn(x)),m>x){var G=m;m=x,x=G}if(C||m%1||x%1){var ne=ud();return Wa(m+ne*(x-m+or("1e-"+((ne+"").length-1))),x)}return ev(m,x)},he.reduce=function(m,x,C){var G=Jr(m)?ad:ha,ne=arguments.length<3;return G(m,Rr(x,4),C,ne,gi)},he.reduceRight=function(m,x,C){var G=Jr(m)?wp:ha,ne=arguments.length<3;return G(m,Rr(x,4),C,ne,yg)},he.repeat=function(m,x,C){return x=(C?Fi(m,x,C):x===l)?1:Mt(x),mf(Wt(m),x)},he.replace=function(){var m=arguments,x=Wt(m[0]);return m.length<3?x:x.replace(m[1],m[2])},he.result=function(m,x,C){var G=-1,ne=(x=jo(x,m)).length;for(ne||(ne=1,m=l);++G<ne;){var ce=m==null?l:m[vs(x[G])];ce===l&&(G=ne,ce=C),m=Cl(ce)?ce.call(m):ce}return m},he.round=nt,he.runInContext=Ct,he.sample=function(m){return(Jr(m)?Tp:vy)(m)},he.size=function(m){if(m==null)return 0;if(fl(m))return wt(m)?Va(m):m.length;var x=Ti(m);return x==W||x==Ae?m.size:Wl(m).length},he.snakeCase=$i,he.some=function(m,x,C){var G=Jr(m)?of:my;return C&&Fi(m,x,C)&&(x=l),G(m,Rr(x,3))},he.sortedIndex=function(m,x){return _f(m,x)},he.sortedIndexBy=function(m,x,C){return Rp(m,x,Rr(C,2))},he.sortedIndexOf=function(m,x){var C=m==null?0:m.length;if(C){var G=_f(m,x);if(G<C&&zl(m[G],x))return G}return-1},he.sortedLastIndex=function(m,x){return _f(m,x,!0)},he.sortedLastIndexBy=function(m,x,C){return Rp(m,x,Rr(C,2),!0)},he.sortedLastIndexOf=function(m,x){if(m!=null&&m.length){var C=_f(m,x,!0)-1;if(zl(m[C],x))return C}return-1},he.startCase=Qi,he.startsWith=function(m,x,C){return m=Wt(m),C=C==null?0:Au(Mt(C),0,m.length),x=cl(x),m.slice(C,C+x.length)==x},he.subtract=ot,he.sum=function(m){return m&&m.length?wu(m,Nr):0},he.sumBy=function(m,x){return m&&m.length?wu(m,Rr(x,2)):0},he.template=function(m,x,C){var G=he.templateSettings;C&&Fi(m,x,C)&&(x=l),m=Wt(m),x=ln({},x,G,av);var ne,ce,Oe=ln({},x.imports,G.imports,av),Fe=on(Oe),et=lc(Oe,Fe),jt=0,Vt=x.interpolate||rr,yn="__p += '",Yn=Z((x.escape||rr).source+"|"+Vt.source+"|"+(Vt===vt?En:rr).source+"|"+(x.evaluate||rr).source+"|$","g"),Qn="//# sourceURL="+($n.call(x,"sourceURL")?(x.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rn+"]")+`
|
||
`;m.replace(Yn,(function(Tn,Br,ir,at,Yr,Ao){return ir||(ir=at),yn+=m.slice(jt,Ao).replace(ut,sc),Br&&(ne=!0,yn+=`' +
|
||
__e(`+Br+`) +
|
||
'`),Yr&&(ce=!0,yn+=`';
|
||
`+Yr+`;
|
||
__p += '`),ir&&(yn+=`' +
|
||
((__t = (`+ir+`)) == null ? '' : __t) +
|
||
'`),jt=Ao+Tn.length,Tn})),yn+=`';
|
||
`;var Sr=$n.call(x,"variable")&&x.variable;if(Sr){if(At.test(Sr))throw new go("Invalid `variable` option passed into `_.template`")}else yn=`with (obj) {
|
||
`+yn+`
|
||
}
|
||
`;yn=(ce?yn.replace(pt,""):yn).replace(Lt,"$1").replace(Jt,"$1;"),yn="function("+(Sr||"obj")+`) {
|
||
`+(Sr?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+yn+`return __p
|
||
}`;var an=Cr((function(){return ci(Fe,Qn+"return "+yn).apply(l,et)}));if(an.source=yn,Ea(an))throw an;return an},he.times=function(m,x){if((m=Mt(m))<1||m>T)return[];var C=R,G=Wa(m,R);x=Rr(x),m-=R;for(var ne=Ks(G,x);++C<m;)x(C);return ne},he.toFinite=nn,he.toInteger=Mt,he.toLength=wn,he.toLower=function(m){return Wt(m).toLowerCase()},he.toNumber=hn,he.toSafeInteger=function(m){return m?Au(Mt(m),-9007199254740991,T):m===0?m:0},he.toString=Wt,he.toUpper=function(m){return Wt(m).toUpperCase()},he.trim=function(m,x,C){if((m=Wt(m))&&(C||x===l))return $l(m);if(!m||!(x=cl(x)))return m;var G=Qa(m),ne=Qa(x);return Uo(G,xl(G,ne),af(G,ne)+1).join("")},he.trimEnd=function(m,x,C){if((m=Wt(m))&&(C||x===l))return m.slice(0,ia(m)+1);if(!m||!(x=cl(x)))return m;var G=Qa(m);return Uo(G,0,af(G,Qa(x))+1).join("")},he.trimStart=function(m,x,C){if((m=Wt(m))&&(C||x===l))return m.replace(qt,"");if(!m||!(x=cl(x)))return m;var G=Qa(m);return Uo(G,xl(G,Qa(x))).join("")},he.truncate=function(m,x){var C=30,G="...";if(Ni(x)){var ne="separator"in x?x.separator:ne;C="length"in x?Mt(x.length):C,G="omission"in x?cl(x.omission):G}var ce=(m=Wt(m)).length;if(os(m)){var Oe=Qa(m);ce=Oe.length}if(C>=ce)return m;var Fe=C-Va(G);if(Fe<1)return G;var et=Oe?Uo(Oe,0,Fe).join(""):m.slice(0,Fe);if(ne===l)return et+G;if(Oe&&(Fe+=et.length-Fe),ge(ne)){if(m.slice(Fe).search(ne)){var jt,Vt=et;for(ne.global||(ne=Z(ne.source,Wt(Zn.exec(ne))+"g")),ne.lastIndex=0;jt=ne.exec(Vt);)var yn=jt.index;et=et.slice(0,yn===l?Fe:yn)}}else if(m.indexOf(cl(ne),Fe)!=Fe){var Yn=et.lastIndexOf(ne);Yn>-1&&(et=et.slice(0,Yn))}return et+G},he.unescape=function(m){return(m=Wt(m))&&it.test(m)?m.replace(en,sl):m},he.uniqueId=function(m){var x=++Do;return Wt(m)+x},he.upperCase=la,he.upperFirst=zi,he.each=Qp,he.eachRight=pv,he.first=Pg,Ce(he,(Ue={},ur(he,(function(m,x){$n.call(he.prototype,x)||(Ue[x]=m)})),Ue),{chain:!1}),he.VERSION="4.17.21",Fa(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(m){he[m].placeholder=he})),Fa(["drop","take"],(function(m,x){mo.prototype[m]=function(C){C=C===l?1:ji(Mt(C),0);var G=this.__filtered__&&!x?new mo(this):this.clone();return G.__filtered__?G.__takeCount__=Wa(C,G.__takeCount__):G.__views__.push({size:Wa(C,R),type:m+(G.__dir__<0?"Right":"")}),G},mo.prototype[m+"Right"]=function(C){return this.reverse()[m](C).reverse()}})),Fa(["filter","map","takeWhile"],(function(m,x){var C=x+1,G=C==1||C==3;mo.prototype[m]=function(ne){var ce=this.clone();return ce.__iteratees__.push({iteratee:Rr(ne,3),type:C}),ce.__filtered__=ce.__filtered__||G,ce}})),Fa(["head","last"],(function(m,x){var C="take"+(x?"Right":"");mo.prototype[m]=function(){return this[C](1).value()[0]}})),Fa(["initial","tail"],(function(m,x){var C="drop"+(x?"":"Right");mo.prototype[m]=function(){return this.__filtered__?new mo(this):this[C](1)}})),mo.prototype.compact=function(){return this.filter(Nr)},mo.prototype.find=function(m){return this.filter(m).head()},mo.prototype.findLast=function(m){return this.reverse().find(m)},mo.prototype.invokeMap=uo((function(m,x){return typeof m=="function"?new mo(this):this.map((function(C){return Ga(C,m,x)}))})),mo.prototype.reject=function(m){return this.filter(Bf(Rr(m)))},mo.prototype.slice=function(m,x){m=Mt(m);var C=this;return C.__filtered__&&(m>0||x<0)?new mo(C):(m<0?C=C.takeRight(-m):m&&(C=C.drop(m)),x!==l&&(C=(x=Mt(x))<0?C.dropRight(-x):C.take(x-m)),C)},mo.prototype.takeRightWhile=function(m){return this.reverse().takeWhile(m).reverse()},mo.prototype.toArray=function(){return this.take(R)},ur(mo.prototype,(function(m,x){var C=/^(?:filter|find|map|reject)|While$/.test(x),G=/^(?:head|last)$/.test(x),ne=he[G?"take"+(x=="last"?"Right":""):x],ce=G||/^find/.test(x);ne&&(he.prototype[x]=function(){var Oe=this.__wrapped__,Fe=G?[1]:arguments,et=Oe instanceof mo,jt=Fe[0],Vt=et||Jr(Oe),yn=function(Br){var ir=ne.apply(he,oa([Br],Fe));return G&&Yn?ir[0]:ir};Vt&&C&&typeof jt=="function"&&jt.length!=1&&(et=Vt=!1);var Yn=this.__chain__,Qn=!!this.__actions__.length,Sr=ce&&!Yn,an=et&&!Qn;if(!ce&&Vt){Oe=an?Oe:new mo(this);var Tn=m.apply(Oe,Fe);return Tn.__actions__.push({func:Lf,args:[yn],thisArg:l}),new Ul(Tn,Yn)}return Sr&&an?m.apply(this,Fe):(Tn=this.thru(yn),Sr?G?Tn.value()[0]:Tn.value():Tn)})})),Fa(["pop","push","shift","sort","splice","unshift"],(function(m){var x=lt[m],C=/^(?:push|sort|unshift)$/.test(m)?"tap":"thru",G=/^(?:pop|shift)$/.test(m);he.prototype[m]=function(){var ne=arguments;if(G&&!this.__chain__){var ce=this.value();return x.apply(Jr(ce)?ce:[],ne)}return this[C]((function(Oe){return x.apply(Jr(Oe)?Oe:[],ne)}))}})),ur(mo.prototype,(function(m,x){var C=he[x];if(C){var G=C.name+"";$n.call(Su,G)||(Su[G]=[]),Su[G].push({name:x,func:C})}})),Su[wf(l,2).name]=[{name:"wrapper",func:l}],mo.prototype.clone=function(){var m=new mo(this.__wrapped__);return m.__actions__=va(this.__actions__),m.__dir__=this.__dir__,m.__filtered__=this.__filtered__,m.__iteratees__=va(this.__iteratees__),m.__takeCount__=this.__takeCount__,m.__views__=va(this.__views__),m},mo.prototype.reverse=function(){if(this.__filtered__){var m=new mo(this);m.__dir__=-1,m.__filtered__=!0}else(m=this.clone()).__dir__*=-1;return m},mo.prototype.value=function(){var m=this.__wrapped__.value(),x=this.__dir__,C=Jr(m),G=x<0,ne=C?m.length:0,ce=(function(Ao,Mr,Ur){for(var xa=-1,Hl=Ur.length;++xa<Hl;){var uu=Ur[xa],Oa=uu.size;switch(uu.type){case"drop":Ao+=Oa;break;case"dropRight":Mr-=Oa;break;case"take":Mr=Wa(Mr,Ao+Oa);break;case"takeRight":Ao=ji(Ao,Mr-Oa)}}return{start:Ao,end:Mr}})(0,ne,this.__views__),Oe=ce.start,Fe=ce.end,et=Fe-Oe,jt=G?Fe:Oe-1,Vt=this.__iteratees__,yn=Vt.length,Yn=0,Qn=Wa(et,this.__takeCount__);if(!C||!G&&ne==et&&Qn==et)return rv(m,this.__actions__);var Sr=[];e:for(;et--&&Yn<Qn;){for(var an=-1,Tn=m[jt+=x];++an<yn;){var Br=Vt[an],ir=Br.iteratee,at=Br.type,Yr=ir(Tn);if(at==2)Tn=Yr;else if(!Yr){if(at==1)continue e;break e}}Sr[Yn++]=Tn}return Sr},he.prototype.at=za,he.prototype.chain=function(){return xi(this)},he.prototype.commit=function(){return new Ul(this.value(),this.__chain__)},he.prototype.next=function(){this.__values__===l&&(this.__values__=sn(this.value()));var m=this.__index__>=this.__values__.length;return{done:m,value:m?l:this.__values__[this.__index__++]}},he.prototype.plant=function(m){for(var x,C=this;C instanceof Qs;){var G=qp(C);G.__index__=0,G.__values__=l,x?ne.__wrapped__=G:x=G;var ne=G;C=C.__wrapped__}return ne.__wrapped__=m,x},he.prototype.reverse=function(){var m=this.__wrapped__;if(m instanceof mo){var x=m;return this.__actions__.length&&(x=new mo(this)),(x=x.reverse()).__actions__.push({func:Lf,args:[Ed],thisArg:l}),new Ul(x,this.__chain__)}return this.thru(Ed)},he.prototype.toJSON=he.prototype.valueOf=he.prototype.value=function(){return rv(this.__wrapped__,this.__actions__)},he.prototype.first=he.prototype.head,as&&(he.prototype[as]=function(){return this}),he})();vi._=ka,(s=(function(){return ka}).call(o,r,o,a))===l||(a.exports=s)}).call(this)}).call(this,r(68),r(221)(n))},function(n,o,r){var i=r(7),a=r(34),s=r(33),l=r(87),f=r(62),h=r(174),v=r(28),_=i.TypeError,E=v("toPrimitive");n.exports=function(O,w){if(!s(O)||l(O))return O;var S,M=f(O,E);if(M){if(w===void 0&&(w="default"),S=a(M,O,w),!s(S)||l(S))return S;throw _("Can't convert object to primitive value")}return w===void 0&&(w="number"),h(O,w)}},function(n,o,r){var i=r(108);n.exports=i&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},function(n,o,r){var i=r(36),a=r(18),s=r(91);n.exports=!i&&!a((function(){return Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a!=7}))},function(n,o,r){var i=r(35),a=r(135),s=r(50),l=r(38);n.exports=function(f,h){for(var v=a(h),_=l.f,E=s.f,O=0;O<v.length;O++){var w=v[O];i(f,w)||_(f,w,E(h,w))}}},function(n,o,r){var i=r(46),a=r(15),s=r(74),l=r(112),f=r(32),h=a([].concat);n.exports=i("Reflect","ownKeys")||function(v){var _=s.f(f(v)),E=l.f;return E?h(_,E(v)):_}},function(n,o,r){var i=r(15),a=r(35),s=r(41),l=r(137).indexOf,f=r(72),h=i([].push);n.exports=function(v,_){var E,O=s(v),w=0,S=[];for(E in O)!a(f,E)&&a(O,E)&&h(S,E);for(;_.length>w;)a(O,E=_[w++])&&(~l(S,E)||h(S,E));return S}},function(n,o,r){var i=r(41),a=r(75),s=r(45),l=function(f){return function(h,v,_){var E,O=i(h),w=s(O),S=a(_,w);if(f&&v!=v){for(;w>S;)if((E=O[S++])!=E)return!0}else for(;w>S;S++)if((f||S in O)&&O[S]===v)return f||S||0;return!f&&-1}};n.exports={includes:l(!0),indexOf:l(!1)}},function(n,o,r){var i=r(46);n.exports=i("document","documentElement")},function(n,o,r){var i=r(51),a=r(41),s=r(74).f,l=r(114),f=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];n.exports.f=function(h){return f&&i(h)=="Window"?(function(v){try{return s(v)}catch{return l(f)}})(h):s(a(h))}},function(n,o,r){var i=r(28);o.f=i},function(n,o,r){var i=r(177),a=r(35),s=r(140),l=r(38).f;n.exports=function(f){var h=i.Symbol||(i.Symbol={});a(h,f)||l(h,f,{value:s.f(f)})}},function(n,o,r){var i,a,s,l=r(18),f=r(30),h=r(60),v=r(101),_=r(42),E=r(28),O=r(71),w=E("iterator"),S=!1;[].keys&&("next"in(s=[].keys())?(a=v(v(s)))!==Object.prototype&&(i=a):S=!0),i==null||l((function(){var M={};return i[w].call(M)!==M}))?i={}:O&&(i=h(i)),f(i[w])||_(i,w,(function(){return this})),n.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:S}},function(n,o,r){var i=r(18);n.exports=!i((function(){function a(){}return a.prototype.constructor=null,Object.getPrototypeOf(new a)!==a.prototype}))},function(n,o,r){var i=r(16),a=r(15),s=r(72),l=r(33),f=r(35),h=r(38).f,v=r(74),_=r(139),E=r(183),O=r(90),w=r(185),S=!1,M=O("meta"),T=0,B=function(P){h(P,M,{value:{objectID:"O"+T++,weakData:{}}})},R=n.exports={enable:function(){R.enable=function(){},S=!0;var P=v.f,$=a([].splice),I={};I[M]=1,P(I).length&&(v.f=function(F){for(var U=P(F),z=0,X=U.length;z<X;z++)if(U[z]===M){$(U,z,1);break}return U},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:_.f}))},fastKey:function(P,$){if(!l(P))return typeof P=="symbol"?P:(typeof P=="string"?"S":"P")+P;if(!f(P,M)){if(!E(P))return"F";if(!$)return"E";B(P)}return P[M].objectID},getWeakData:function(P,$){if(!f(P,M)){if(!E(P))return!0;if(!$)return!1;B(P)}return P[M].weakData},onFreeze:function(P){return w&&S&&E(P)&&!f(P,M)&&B(P),P}};s[M]=!0},function(n,o,r){var i=r(28),a=r(80),s=i("iterator"),l=Array.prototype;n.exports=function(f){return f!==void 0&&(a.Array===f||l[s]===f)}},function(n,o,r){var i=r(7),a=r(34),s=r(56),l=r(32),f=r(88),h=r(118),v=i.TypeError;n.exports=function(_,E){var O=arguments.length<2?h(_):E;if(s(O))return l(a(O,_));throw v(f(_)+" is not iterable")}},function(n,o,r){var i=r(34),a=r(32),s=r(62);n.exports=function(l,f,h){var v,_;a(l);try{if(!(v=s(l,"return"))){if(f==="throw")throw h;return h}v=i(v,l)}catch(E){_=!0,v=E}if(f==="throw")throw h;if(_)throw v;return a(v),h}},function(n,o,r){var i=r(30),a=r(33),s=r(102);n.exports=function(l,f,h){var v,_;return s&&i(v=f.constructor)&&v!==h&&a(_=v.prototype)&&_!==h.prototype&&s(l,_),l}},function(n,o,r){var i=r(42);n.exports=function(a,s,l){for(var f in s)i(a,f,s[f],l);return a}},function(n,o,r){var i=r(46),a=r(38),s=r(28),l=r(36),f=s("species");n.exports=function(h){var v=i(h),_=a.f;l&&v&&!v[f]&&_(v,f,{configurable:!0,get:function(){return this}})}},function(n,o,r){var i=r(15),a=r(59),s=r(39),l=r(44),f=i("".charAt),h=i("".charCodeAt),v=i("".slice),_=function(E){return function(O,w){var S,M,T=s(l(O)),B=a(w),R=T.length;return B<0||B>=R?E?"":void 0:(S=h(T,B))<55296||S>56319||B+1===R||(M=h(T,B+1))<56320||M>57343?E?f(T,B):S:E?v(T,B,B+2):M-56320+(S-55296<<10)+65536}};n.exports={codeAt:_(!1),charAt:_(!0)}},function(n,o){n.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(n,o,r){var i=r(91)("span").classList,a=i&&i.constructor&&i.constructor.prototype;n.exports=a===Object.prototype?void 0:a},function(n,o,r){var i=r(32);n.exports=function(){var a=i(this),s="";return a.global&&(s+="g"),a.ignoreCase&&(s+="i"),a.multiline&&(s+="m"),a.dotAll&&(s+="s"),a.unicode&&(s+="u"),a.sticky&&(s+="y"),s}},function(n,o,r){var i=r(18),a=r(7).RegExp,s=i((function(){var h=a("a","y");return h.lastIndex=2,h.exec("abcd")!=null})),l=s||i((function(){return!a("a","y").sticky})),f=s||i((function(){var h=a("^r","gy");return h.lastIndex=2,h.exec("str")!=null}));n.exports={BROKEN_CARET:f,MISSED_STICKY:l,UNSUPPORTED_Y:s}},function(n,o,r){var i=r(16),a=r(79).find,s=r(100),l="find",f=!0;l in[]&&Array(1).find((function(){f=!1})),i({target:"Array",proto:!0,forced:f},{find:function(h){return a(this,h,arguments.length>1?arguments[1]:void 0)}}),s(l)},function(n,o,r){var i=r(16),a=r(137).includes,s=r(100);i({target:"Array",proto:!0},{includes:function(l){return a(this,l,arguments.length>1?arguments[1]:void 0)}}),s("includes")},function(n,o,r){var i=r(16),a=r(15),s=r(197),l=r(44),f=r(39),h=r(198),v=a("".indexOf);i({target:"String",proto:!0,forced:!h("includes")},{includes:function(_){return!!~v(f(l(this)),f(s(_)),arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(33),a=r(51),s=r(28)("match");n.exports=function(l){var f;return i(l)&&((f=l[s])!==void 0?!!f:a(l)=="RegExp")}},function(n,o,r){var i=r(15);n.exports=i(1 .valueOf)},function(n,o,r){var i=r(15),a=r(44),s=r(39),l=r(162),f=i("".replace),h="["+l+"]",v=RegExp("^"+h+h+"*"),_=RegExp(h+h+"*$"),E=function(O){return function(w){var S=s(a(w));return 1&O&&(S=f(S,v,"")),2&O&&(S=f(S,_,"")),S}};n.exports={start:E(1),end:E(2),trim:E(3)}},function(n,o){n.exports=`
|
||
\v\f\r \u2028\u2029\uFEFF`},function(n,o){var r,i,a=n.exports={};function s(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function f(T){if(r===setTimeout)return setTimeout(T,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(T,0);try{return r(T,0)}catch{try{return r.call(null,T,0)}catch{return r.call(this,T,0)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:s}catch{r=s}try{i=typeof clearTimeout=="function"?clearTimeout:l}catch{i=l}})();var h,v=[],_=!1,E=-1;function O(){_&&h&&(_=!1,h.length?v=h.concat(v):E=-1,v.length&&w())}function w(){if(!_){var T=f(O);_=!0;for(var B=v.length;B;){for(h=v,v=[];++E<B;)h&&h[E].run();E=-1,B=v.length}h=null,_=!1,(function(R){if(i===clearTimeout)return clearTimeout(R);if((i===l||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(R);try{i(R)}catch{try{return i.call(null,R)}catch{return i.call(this,R)}}})(T)}}function S(T,B){this.fun=T,this.array=B}function M(){}a.nextTick=function(T){var B=new Array(arguments.length-1);if(arguments.length>1)for(var R=1;R<arguments.length;R++)B[R-1]=arguments[R];v.push(new S(T,B)),v.length!==1||_||f(w)},S.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=M,a.addListener=M,a.once=M,a.off=M,a.removeListener=M,a.removeAllListeners=M,a.emit=M,a.prependListener=M,a.prependOnceListener=M,a.listeners=function(T){return[]},a.binding=function(T){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(T){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(n,o,r){var i=r(32),a=r(165),s=r(28)("species");n.exports=function(l,f){var h,v=i(l).constructor;return v===void 0||(h=i(v)[s])==null?f:a(h)}},function(n,o,r){var i=r(7),a=r(99),s=r(88),l=i.TypeError;n.exports=function(f){if(a(f))return f;throw l(s(f)+" is not a constructor")}},function(n,o,r){var i=r(16),a=r(161).trim;i({target:"String",proto:!0,forced:r(200)("trim")},{trim:function(){return a(this)}})},function(n,o,r){var i=r(34),a=r(123),s=r(32),l=r(94),f=r(39),h=r(44),v=r(62),_=r(124),E=r(125);a("match",(function(O,w,S){return[function(M){var T=h(this),B=M==null?void 0:v(M,O);return B?i(B,M,T):new RegExp(M)[O](f(T))},function(M){var T=s(this),B=f(M),R=S(w,T,B);if(R.done)return R.value;if(!T.global)return E(T,B);var P=T.unicode;T.lastIndex=0;for(var $,I=[],F=0;($=E(T,B))!==null;){var U=f($[0]);I[F]=U,U===""&&(T.lastIndex=_(B,l(T.lastIndex),P)),F++}return F===0?null:I}]}))},function(n,o,r){var i,a,s,l,f=r(7),h=r(76),v=r(64),_=r(30),E=r(35),O=r(18),w=r(138),S=r(98),M=r(91),T=r(169),B=r(128),R=f.setImmediate,P=f.clearImmediate,$=f.process,I=f.Dispatch,F=f.Function,U=f.MessageChannel,z=f.String,X=0,Y={},W="onreadystatechange";try{i=f.location}catch{}var Q=function(Ae){if(E(Y,Ae)){var Pe=Y[Ae];delete Y[Ae],Pe()}},J=function(Ae){return function(){Q(Ae)}},ie=function(Ae){Q(Ae.data)},Se=function(Ae){f.postMessage(z(Ae),i.protocol+"//"+i.host)};R&&P||(R=function(Ae){var Pe=S(arguments,1);return Y[++X]=function(){h(_(Ae)?Ae:F(Ae),void 0,Pe)},a(X),X},P=function(Ae){delete Y[Ae]},B?a=function(Ae){$.nextTick(J(Ae))}:I&&I.now?a=function(Ae){I.now(J(Ae))}:U&&!T?(l=(s=new U).port2,s.port1.onmessage=ie,a=v(l.postMessage,l)):f.addEventListener&&_(f.postMessage)&&!f.importScripts&&i&&i.protocol!=="file:"&&!O(Se)?(a=Se,f.addEventListener("message",ie,!1)):a=W in M("script")?function(Ae){w.appendChild(M("script")).onreadystatechange=function(){w.removeChild(this),Q(Ae)}}:function(Ae){setTimeout(J(Ae),0)}),n.exports={set:R,clear:P}},function(n,o,r){var i=r(55);n.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},function(n,o,r){var i=r(56),a=function(s){var l,f;this.promise=new s((function(h,v){if(l!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");l=h,f=v})),this.resolve=i(l),this.reject=i(f)};n.exports.f=function(s){return new a(s)}},function(n,o,r){o.a=function(){return!1}},function(n,o,r){(function(i){r.d(o,"a",(function(){return $}));var a=r(1);function s(U){throw new Error("[mobx-utils] "+U)}function l(U,z){z===void 0&&(z="Illegal state"),U||s(z)}var f=function(U){return U&&U!==Object.prototype&&Object.getOwnPropertyNames(U).concat(f(Object.getPrototypeOf(U))||[])},h=function(U){return(function(z){var X=f(z);return X.filter((function(Y,W){return X.indexOf(Y)===W}))})(U).filter((function(z){return z!=="constructor"&&!~z.indexOf("__")}))},v="pending",_="fulfilled",E="rejected";function O(U){switch(this.state){case v:return U.pending&&U.pending(this.value);case E:return U.rejected&&U.rejected(this.value);case _:return U.fulfilled?U.fulfilled(this.value):this.value}}function w(U,z){if(l(arguments.length<=2,"fromPromise expects up to two arguments"),l(typeof U=="function"||typeof U=="object"&&U&&typeof U.then=="function","Please pass a promise or function to fromPromise"),U.isPromiseBasedObservable===!0)return U;typeof U=="function"&&(U=new Promise(U));var X=U;U.then(Object(a.k)("observableFromPromise-resolve",(function(W){X.value=W,X.state=_})),Object(a.k)("observableFromPromise-reject",(function(W){X.value=W,X.state=E}))),X.isPromiseBasedObservable=!0,X.case=O;var Y=z&&z.state===_?z.value:void 0;return Object(a.q)(X,{value:Y,state:v},{},{deep:!1}),X}(function(U){U.reject=Object(a.k)("fromPromise.reject",(function(z){var X=U(Promise.reject(z));return X.state=E,X.value=z,X})),U.resolve=Object(a.k)("fromPromise.resolve",(function(z){z===void 0&&(z=void 0);var X=U(Promise.resolve(z));return X.state=_,X.value=z,X}))})(w||(w={}));var S=function(U,z,X,Y){var W,Q=arguments.length,J=Q<3?z:Y===null?Y=Object.getOwnPropertyDescriptor(z,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(U,z,X,Y);else for(var ie=U.length-1;ie>=0;ie--)(W=U[ie])&&(J=(Q<3?W(J):Q>3?W(z,X,J):W(z,X))||J);return Q>3&&J&&Object.defineProperty(z,X,J),J};(function(){function U(z,X){var Y=this;Object(a.G)((function(){Y.current=X,Y.subscription=z.subscribe(Y)}))}U.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},U.prototype.next=function(z){this.current=z},U.prototype.complete=function(){this.dispose()},U.prototype.error=function(z){this.current=z,this.dispose()},S([a.C.ref],U.prototype,"current",void 0),S([a.k.bound],U.prototype,"next",null),S([a.k.bound],U.prototype,"complete",null),S([a.k.bound],U.prototype,"error",null)})();var M=function(){return M=Object.assign||function(U){for(var z,X=1,Y=arguments.length;X<Y;X++)for(var W in z=arguments[X])Object.prototype.hasOwnProperty.call(z,W)&&(U[W]=z[W]);return U},M.apply(this,arguments)},T=function(U,z,X,Y){var W,Q=arguments.length,J=Q<3?z:Y===null?Y=Object.getOwnPropertyDescriptor(z,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(U,z,X,Y);else for(var ie=U.length-1;ie>=0;ie--)(W=U[ie])&&(J=(Q<3?W(J):Q>3?W(z,X,J):W(z,X))||J);return Q>3&&J&&Object.defineProperty(z,X,J),J},B=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function U(z){var X=this;this.model=z,this.localValues=a.C.map({}),this.localComputedValues=a.C.map({}),this.isPropertyDirty=function(Y){return X.localValues.has(Y)},l(Object(a.A)(z),"createViewModel expects an observable object"),h(z).forEach((function(Y){if(Y!==a.a&&Y!=="__mobxDidRunLazyInitializers"){if(l(B.indexOf(Y)===-1,"The propertyname "+Y+" is reserved and cannot be used with viewModels"),Object(a.w)(z,Y)){var W=Object(a.h)(z,Y).derivation;X.localComputedValues.set(Y,Object(a.m)(W.bind(X)))}var Q=Object.getOwnPropertyDescriptor(z,Y),J=Q?{enumerable:Q.enumerable}:{};Object.defineProperty(X,Y,M(M({},J),{configurable:!0,get:function(){return Object(a.w)(z,Y)?X.localComputedValues.get(Y).get():X.isPropertyDirty(Y)?X.localValues.get(Y):X.model[Y]},set:Object(a.k)((function(ie){ie!==X.model[Y]?X.localValues.set(Y,ie):X.localValues.delete(Y)}))}))}}))}Object.defineProperty(U.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),U.prototype.submit=function(){var z=this;Object(a.B)(this.localValues).forEach((function(X){var Y=z.localValues.get(X),W=z.model[X];Object(a.y)(W)?W.replace(Y):Object(a.z)(W)?(W.clear(),W.merge(Y)):Object(a.v)(Y)||(z.model[X]=Y)})),this.localValues.clear()},U.prototype.reset=function(){this.localValues.clear()},U.prototype.resetProperty=function(z){this.localValues.delete(z)},T([a.m],U.prototype,"isDirty",null),T([a.m],U.prototype,"changedValues",null),T([a.k.bound],U.prototype,"submit",null),T([a.k.bound],U.prototype,"reset",null),T([a.k.bound],U.prototype,"resetProperty",null)})();function R(U){if(!U)return"ROOT";for(var z=[];U.parent;)z.push(U.path),U=U.parent;return z.reverse().join("/")}function P(U){return Object(a.A)(U)||Object(a.y)(U)||Object(a.z)(U)}function $(U,z){var X=new WeakMap;function Y(J){var ie=X.get(J.object);(function(Se,Ae){switch(Se.type){case"add":W(Se.newValue,Ae,Se.name);break;case"update":Q(Se.oldValue),W(Se.newValue,Ae,Se.name||""+Se.index);break;case"remove":case"delete":Q(Se.oldValue);break;case"splice":Se.removed.map(Q),Se.added.forEach((function(He,Ye){return W(He,Ae,""+(Se.index+Ye))}));for(var Pe=Se.index+Se.addedCount;Pe<Se.object.length;Pe++)if(P(Se.object[Pe])){var De=X.get(Se.object[Pe]);De&&(De.path=""+Pe)}}})(J,ie),z(J,R(ie),U)}function W(J,ie,Se){if(P(J)){var Ae=X.get(J);if(Ae){if(Ae.parent!==ie||Ae.path!==Se)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+R(ie)+"/"+Se+"', but it already exists at '"+R(Ae.parent)+"/"+Ae.path+"'")}else{var Pe={parent:ie,path:Se,dispose:Object(a.D)(J,Y)};X.set(J,Pe),Object(a.p)(J).forEach((function(De){var He=De[0];return W(De[1],Pe,He)}))}}}function Q(J){if(P(J)){var ie=X.get(J);if(!ie)return;X.delete(J),ie.dispose(),Object(a.L)(J).forEach(Q)}}return W(U,void 0,""),function(){Q(U)}}var I,F=(I=function(U,z){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,Y){X.__proto__=Y}||function(X,Y){for(var W in Y)Y.hasOwnProperty(W)&&(X[W]=Y[W])},I(U,z)},function(U,z){function X(){this.constructor=U}I(U,z),U.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)});(function(U){function z(X,Y,W){var Q=W===void 0?{}:W,J=Q.name,ie=J===void 0?"ogm"+(1e3*Math.random()|0):J,Se=Q.keyToName,Ae=Se===void 0?function(He){return""+He}:Se,Pe=U.call(this)||this;Pe._keyToName=Ae,Pe._groupBy=Y,Pe._ogmInfoKey=Symbol("ogmInfo"+ie),Pe._base=X;for(var De=0;De<X.length;De++)Pe._addItem(X[De]);return Pe._disposeBaseObserver=Object(a.D)(Pe._base,(function(He){if(He.type==="splice")Object(a.J)((function(){for(var Ye=0,Be=He.removed;Ye<Be.length;Ye++){var Je=Be[Ye];Pe._removeItem(Je)}for(var mt=0,le=He.added;mt<le.length;mt++){var Ze=le[mt];Pe._addItem(Ze)}}));else{if(He.type!=="update")throw new Error("illegal state");Object(a.J)((function(){Pe._removeItem(He.oldValue),Pe._addItem(He.newValue)}))}})),Pe}F(z,U),z.prototype.clear=function(){throw new Error("not supported")},z.prototype.delete=function(X){throw new Error("not supported")},z.prototype.set=function(X,Y){throw new Error("not supported")},z.prototype.dispose=function(){this._disposeBaseObserver();for(var X=0;X<this._base.length;X++){var Y=this._base[X];Y[this._ogmInfoKey].reaction(),delete Y[this._ogmInfoKey]}},z.prototype._getGroupArr=function(X){var Y=U.prototype.get.call(this,X);return Y===void 0&&(Y=Object(a.C)([],{name:"GroupArray["+this._keyToName(X)+"]",deep:!1}),U.prototype.set.call(this,X,Y)),Y},z.prototype._removeFromGroupArr=function(X,Y){var W=U.prototype.get.call(this,X);W.length===1?U.prototype.delete.call(this,X):(Y===W.length-1||(W[Y]=W[W.length-1],W[Y][this._ogmInfoKey].groupArrIndex=Y),W.length--)},z.prototype._addItem=function(X){var Y=this,W=this._groupBy(X),Q=this._getGroupArr(W),J={groupByValue:W,groupArrIndex:Q.length,reaction:Object(a.F)((function(){return Y._groupBy(X)}),(function(ie,Se){var Ae=X[Y._ogmInfoKey];Y._removeFromGroupArr(Ae.groupByValue,Ae.groupArrIndex);var Pe=Y._getGroupArr(ie),De=Pe.length;Pe.push(X),Ae.groupByValue=ie,Ae.groupArrIndex=De}))};Object.defineProperty(X,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:J}),Q.push(X)},z.prototype._removeItem=function(X){var Y=X[this._ogmInfoKey];this._removeFromGroupArr(Y.groupByValue,Y.groupArrIndex),Y.reaction(),delete X[this._ogmInfoKey]}})(a.b),(function(){function U(z,X){this.base=z,this.args=X,this.closestIdx=0,this.isDisposed=!1;for(var Y=this.closest=this.root=z,W=0;W<this.args.length-1&&(Y=Y.get(X[W]));W++)this.closest=Y;this.closestIdx=W}return U.prototype.exists=function(){this.assertNotDisposed();var z=this.args.length;return this.closestIdx>=z-1&&this.closest.has(this.args[z-1])},U.prototype.get=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");return this.closest.get(this.args[this.args.length-1])},U.prototype.set=function(z){this.assertNotDisposed();for(var X=this.args.length,Y=this.closest,W=this.closestIdx;W<X-1;W++){var Q=new Map;Y.set(this.args[W],Q),Y=Q}this.closestIdx=X-1,this.closest=Y,Y.set(this.args[X-1],z)},U.prototype.delete=function(){if(this.assertNotDisposed(),!this.exists())throw new Error("Entry doesn't exist");var z=this.args.length;this.closest.delete(this.args[z-1]);for(var X=this.root,Y=[X],W=0;W<z-1;W++)X=X.get(this.args[W]),Y.push(X);for(W=Y.length-1;W>0;W--)Y[W].size===0&&Y[W-1].delete(this.args[W-1]);this.isDisposed=!0},U.prototype.assertNotDisposed=function(){if(this.isDisposed)throw new Error("Concurrent modification exception")},U})(),Promise.resolve(),typeof queueMicrotask<"u"||i!==void 0&&i.nextTick}).call(this,r(163))},function(n,o,r){var i;(function(a,s,l){if(a){for(var f,h={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"},v={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},E={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},O=1;O<20;++O)h[111+O]="f"+O;for(O=0;O<=9;++O)h[O+96]=O.toString();P.prototype.bind=function($,I,F){var U=this;return $=$ instanceof Array?$:[$],U._bindMultiple.call(U,$,I,F),U},P.prototype.unbind=function($,I){return this.bind.call(this,$,(function(){}),I)},P.prototype.trigger=function($,I){var F=this;return F._directMap[$+":"+I]&&F._directMap[$+":"+I]({},$),F},P.prototype.reset=function(){var $=this;return $._callbacks={},$._directMap={},$},P.prototype.stopCallback=function($,I){if((" "+I.className+" ").indexOf(" mousetrap ")>-1||R(I,this.target))return!1;if("composedPath"in $&&typeof $.composedPath=="function"){var F=$.composedPath()[0];F!==$.target&&(I=F)}return I.tagName=="INPUT"||I.tagName=="SELECT"||I.tagName=="TEXTAREA"||I.isContentEditable},P.prototype.handleKey=function(){var $=this;return $._handleKey.apply($,arguments)},P.addKeycodes=function($){for(var I in $)$.hasOwnProperty(I)&&(h[I]=$[I]);f=null},P.init=function(){var $=P(s);for(var I in $)I.charAt(0)!=="_"&&(P[I]=(function(F){return function(){return $[F].apply($,arguments)}})(I))},P.init(),a.Mousetrap=P,n.exports&&(n.exports=P),(i=(function(){return P}).call(o,r,o,n))===void 0||(n.exports=i)}function w($,I,F){$.addEventListener?$.addEventListener(I,F,!1):$.attachEvent("on"+I,F)}function S($){if($.type=="keypress"){var I=String.fromCharCode($.which);return $.shiftKey||(I=I.toLowerCase()),I}return h[$.which]?h[$.which]:v[$.which]?v[$.which]:String.fromCharCode($.which).toLowerCase()}function M($){return $=="shift"||$=="ctrl"||$=="alt"||$=="meta"}function T($,I,F){return F||(F=(function(){if(!f)for(var U in f={},h)U>95&&U<112||h.hasOwnProperty(U)&&(f[h[U]]=U);return f})()[$]?"keydown":"keypress"),F=="keypress"&&I.length&&(F="keydown"),F}function B($,I){var F,U,z,X=[];for(F=(function(Y){return Y==="+"?["+"]:(Y=Y.replace(/\+{2}/g,"+plus")).split("+")})($),z=0;z<F.length;++z)U=F[z],E[U]&&(U=E[U]),I&&I!="keypress"&&_[U]&&(U=_[U],X.push("shift")),M(U)&&X.push(U);return{key:U,modifiers:X,action:I=T(U,X,I)}}function R($,I){return $!==null&&$!==s&&($===I||R($.parentNode,I))}function P($){var I=this;if($=$||s,!(I instanceof P))return new P($);I.target=$,I._callbacks={},I._directMap={};var F,U={},z=!1,X=!1,Y=!1;function W(Pe){Pe=Pe||{};var De,He=!1;for(De in U)Pe[De]?He=!0:U[De]=0;He||(Y=!1)}function Q(Pe,De,He,Ye,Be,Je){var mt,le,Ze,pe,se=[],we=He.type;if(!I._callbacks[Pe])return[];for(we=="keyup"&&M(Pe)&&(De=[Pe]),mt=0;mt<I._callbacks[Pe].length;++mt)if(le=I._callbacks[Pe][mt],(Ye||!le.seq||U[le.seq]==le.level)&&we==le.action&&(we=="keypress"&&!He.metaKey&&!He.ctrlKey||(Ze=De,pe=le.modifiers,Ze.sort().join(",")===pe.sort().join(",")))){var $e=!Ye&&le.combo==Be,rt=Ye&&le.seq==Ye&&le.level==Je;($e||rt)&&I._callbacks[Pe].splice(mt,1),se.push(le)}return se}function J(Pe,De,He,Ye){I.stopCallback(De,De.target||De.srcElement,He,Ye)||Pe(De,He)===!1&&((function(Be){Be.preventDefault?Be.preventDefault():Be.returnValue=!1})(De),(function(Be){Be.stopPropagation?Be.stopPropagation():Be.cancelBubble=!0})(De))}function ie(Pe){typeof Pe.which!="number"&&(Pe.which=Pe.keyCode);var De=S(Pe);De&&(Pe.type!="keyup"||z!==De?I.handleKey(De,(function(He){var Ye=[];return He.shiftKey&&Ye.push("shift"),He.altKey&&Ye.push("alt"),He.ctrlKey&&Ye.push("ctrl"),He.metaKey&&Ye.push("meta"),Ye})(Pe),Pe):z=!1)}function Se(Pe,De,He,Ye){function Be(Ze){return function(){Y=Ze,++U[Pe],clearTimeout(F),F=setTimeout(W,1e3)}}function Je(Ze){J(He,Ze,Pe),Ye!=="keyup"&&(z=S(Ze)),setTimeout(W,10)}U[Pe]=0;for(var mt=0;mt<De.length;++mt){var le=mt+1===De.length?Je:Be(Ye||B(De[mt+1]).action);Ae(De[mt],le,Ye,Pe,mt)}}function Ae(Pe,De,He,Ye,Be){I._directMap[Pe+":"+He]=De;var Je,mt=(Pe=Pe.replace(/\s+/g," ")).split(" ");mt.length>1?Se(Pe,mt,De,He):(Je=B(Pe,He),I._callbacks[Je.key]=I._callbacks[Je.key]||[],Q(Je.key,Je.modifiers,{type:Je.action},Ye,Pe,Be),I._callbacks[Je.key][Ye?"unshift":"push"]({callback:De,modifiers:Je.modifiers,action:Je.action,seq:Ye,level:Be,combo:Pe}))}I._handleKey=function(Pe,De,He){var Ye,Be=Q(Pe,De,He),Je={},mt=0,le=!1;for(Ye=0;Ye<Be.length;++Ye)Be[Ye].seq&&(mt=Math.max(mt,Be[Ye].level));for(Ye=0;Ye<Be.length;++Ye)if(Be[Ye].seq){if(Be[Ye].level!=mt)continue;le=!0,Je[Be[Ye].seq]=1,J(Be[Ye].callback,He,Be[Ye].combo,Be[Ye].seq)}else le||J(Be[Ye].callback,He,Be[Ye].combo);var Ze=He.type=="keypress"&&X;He.type!=Y||M(Pe)||Ze||W(Je),X=le&&He.type=="keydown"},I._bindMultiple=function(Pe,De,He){for(var Ye=0;Ye<Pe.length;++Ye)Ae(Pe[Ye],De,He)},w($,"keypress",ie),w($,"keydown",ie),w($,"keyup",ie)}})(typeof window<"u"?window:null,typeof window<"u"?document:null)},function(n,o,r){var i=r(7),a=r(34),s=r(30),l=r(33),f=i.TypeError;n.exports=function(h,v){var _,E;if(v==="string"&&s(_=h.toString)&&!l(E=a(_,h))||s(_=h.valueOf)&&!l(E=a(_,h))||v!=="string"&&s(_=h.toString)&&!l(E=a(_,h)))return E;throw f("Can't convert object to primitive value")}},function(n,o,r){var i=r(7),a=r(30),s=r(92),l=i.WeakMap;n.exports=a(l)&&/native code/.test(s(l))},function(n,o,r){var i=r(36),a=r(38),s=r(32),l=r(41),f=r(77);n.exports=i?Object.defineProperties:function(h,v){s(h);for(var _,E=l(v),O=f(v),w=O.length,S=0;w>S;)a.f(h,_=O[S++],E[_]);return h}},function(n,o,r){var i=r(7);n.exports=i},function(n,o,r){var i=r(7),a=r(96),s=r(99),l=r(33),f=r(28)("species"),h=i.Array;n.exports=function(v){var _;return a(v)&&(_=v.constructor,(s(_)&&(_===h||a(_.prototype))||l(_)&&(_=_[f])===null)&&(_=void 0)),_===void 0?h:_}},function(n,o,r){var i=r(113),a=r(97);n.exports=i?{}.toString:function(){return"[object "+a(this)+"]"}},function(n,o,r){var i=r(142).IteratorPrototype,a=r(60),s=r(69),l=r(78),f=r(80),h=function(){return this};n.exports=function(v,_,E,O){var w=_+" Iterator";return v.prototype=a(i,{next:s(+!O,E)}),l(v,w,!1,!0),f[w]=h,v}},function(n,o,r){var i=r(7),a=r(30),s=i.String,l=i.TypeError;n.exports=function(f){if(typeof f=="object"||a(f))return f;throw l("Can't set "+s(f)+" as a prototype")}},function(n,o,r){var i=r(16),a=r(7),s=r(15),l=r(95),f=r(42),h=r(144),v=r(117),_=r(119),E=r(30),O=r(33),w=r(18),S=r(120),M=r(78),T=r(148);n.exports=function(B,R,P){var $=B.indexOf("Map")!==-1,I=B.indexOf("Weak")!==-1,F=$?"set":"add",U=a[B],z=U&&U.prototype,X=U,Y={},W=function(Pe){var De=s(z[Pe]);f(z,Pe,Pe=="add"?function(He){return De(this,He===0?0:He),this}:Pe=="delete"?function(He){return!(I&&!O(He))&&De(this,He===0?0:He)}:Pe=="get"?function(He){return I&&!O(He)?void 0:De(this,He===0?0:He)}:Pe=="has"?function(He){return!(I&&!O(He))&&De(this,He===0?0:He)}:function(He,Ye){return De(this,He===0?0:He,Ye),this})};if(l(B,!E(U)||!(I||z.forEach&&!w((function(){new U().entries().next()})))))X=P.getConstructor(R,B,$,F),h.enable();else if(l(B,!0)){var Q=new X,J=Q[F](I?{}:-0,1)!=Q,ie=w((function(){Q.has(1)})),Se=S((function(Pe){new U(Pe)})),Ae=!I&&w((function(){for(var Pe=new U,De=5;De--;)Pe[F](De,De);return!Pe.has(-0)}));Se||((X=R((function(Pe,De){_(Pe,z);var He=T(new U,Pe,X);return De!=null&&v(De,He[F],{that:He,AS_ENTRIES:$}),He}))).prototype=z,z.constructor=X),(ie||Ae)&&(W("delete"),W("has"),$&&W("get")),(Ae||J)&&W(F),I&&z.clear&&delete z.clear}return Y[B]=X,i({global:!0,forced:X!=U},Y),M(X,B),I||P.setStrong(X,B,$),X}},function(n,o,r){var i=r(18),a=r(33),s=r(51),l=r(184),f=Object.isExtensible,h=i((function(){}));n.exports=h||l?function(v){return!!a(v)&&(!l||s(v)!="ArrayBuffer")&&(!f||f(v))}:f},function(n,o,r){var i=r(18);n.exports=i((function(){if(typeof ArrayBuffer=="function"){var a=new ArrayBuffer(8);Object.isExtensible(a)&&Object.defineProperty(a,"a",{value:8})}}))},function(n,o,r){var i=r(18);n.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(n,o,r){var i=r(38).f,a=r(60),s=r(149),l=r(64),f=r(119),h=r(117),v=r(116),_=r(150),E=r(36),O=r(144).fastKey,w=r(58),S=w.set,M=w.getterFor;n.exports={getConstructor:function(T,B,R,P){var $=T((function(X,Y){f(X,I),S(X,{type:B,index:a(null),first:void 0,last:void 0,size:0}),E||(X.size=0),Y!=null&&h(Y,X[P],{that:X,AS_ENTRIES:R})})),I=$.prototype,F=M(B),U=function(X,Y,W){var Q,J,ie=F(X),Se=z(X,Y);return Se?Se.value=W:(ie.last=Se={index:J=O(Y,!0),key:Y,value:W,previous:Q=ie.last,next:void 0,removed:!1},ie.first||(ie.first=Se),Q&&(Q.next=Se),E?ie.size++:X.size++,J!=="F"&&(ie.index[J]=Se)),X},z=function(X,Y){var W,Q=F(X),J=O(Y);if(J!=="F")return Q.index[J];for(W=Q.first;W;W=W.next)if(W.key==Y)return W};return s(I,{clear:function(){for(var X=F(this),Y=X.index,W=X.first;W;)W.removed=!0,W.previous&&(W.previous=W.previous.next=void 0),delete Y[W.index],W=W.next;X.first=X.last=void 0,E?X.size=0:this.size=0},delete:function(X){var Y=this,W=F(Y),Q=z(Y,X);if(Q){var J=Q.next,ie=Q.previous;delete W.index[Q.index],Q.removed=!0,ie&&(ie.next=J),J&&(J.previous=ie),W.first==Q&&(W.first=J),W.last==Q&&(W.last=ie),E?W.size--:Y.size--}return!!Q},forEach:function(X){for(var Y,W=F(this),Q=l(X,arguments.length>1?arguments[1]:void 0);Y=Y?Y.next:W.first;)for(Q(Y.value,Y.key,this);Y&&Y.removed;)Y=Y.previous},has:function(X){return!!z(this,X)}}),s(I,R?{get:function(X){var Y=z(this,X);return Y&&Y.value},set:function(X,Y){return U(this,X===0?0:X,Y)}}:{add:function(X){return U(this,X=X===0?0:X,X)}}),E&&i(I,"size",{get:function(){return F(this).size}}),$},setStrong:function(T,B,R){var P=B+" Iterator",$=M(B),I=M(P);v(T,B,(function(F,U){S(this,{type:P,target:F,state:$(F),kind:U,last:void 0})}),(function(){for(var F=I(this),U=F.kind,z=F.last;z&&z.removed;)z=z.previous;return F.target&&(F.last=z=z?z.next:F.state.first)?U=="keys"?{value:z.key,done:!1}:U=="values"?{value:z.value,done:!1}:{value:[z.key,z.value],done:!1}:(F.target=void 0,{value:void 0,done:!0})}),R?"entries":"values",!R,!0),_(B)}}},function(n,o,r){var i=r(79).forEach,a=r(121)("forEach");n.exports=a?[].forEach:function(s){return i(this,s,arguments.length>1?arguments[1]:void 0)}},function(n,o,r){var i=r(7),a=r(64),s=r(34),l=r(40),f=r(189),h=r(145),v=r(99),_=r(45),E=r(63),O=r(146),w=r(118),S=i.Array;n.exports=function(M){var T=l(M),B=v(this),R=arguments.length,P=R>1?arguments[1]:void 0,$=P!==void 0;$&&(P=a(P,R>2?arguments[2]:void 0));var I,F,U,z,X,Y,W=w(T),Q=0;if(!W||this==S&&h(W))for(I=_(T),F=B?new this(I):S(I);I>Q;Q++)Y=$?P(T[Q],Q):T[Q],E(F,Q,Y);else for(X=(z=O(T,W)).next,F=B?new this:[];!(U=s(X,z)).done;Q++)Y=$?f(z,P,[U.value,Q],!0):U.value,E(F,Q,Y);return F.length=Q,F}},function(n,o,r){var i=r(32),a=r(147);n.exports=function(s,l,f,h){try{return h?l(i(f)[0],f[1]):l(f)}catch(v){a(s,"throw",v)}}},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var s=a(".","s");return!(s.dotAll&&s.exec(`
|
||
`)&&s.flags==="s")}))},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var s=a("(?<a>b)","g");return s.exec("b").groups.a!=="b"||"b".replace(s,"$<a>c")!=="bc"}))},function(n,o,r){var i=r(16),a=r(15),s=r(56),l=r(40),f=r(45),h=r(39),v=r(18),_=r(193),E=r(121),O=r(194),w=r(195),S=r(70),M=r(196),T=[],B=a(T.sort),R=a(T.push),P=v((function(){T.sort(void 0)})),$=v((function(){T.sort(null)})),I=E("sort"),F=!v((function(){if(S)return S<70;if(!(O&&O>3)){if(w)return!0;if(M)return M<603;var U,z,X,Y,W="";for(U=65;U<76;U++){switch(z=String.fromCharCode(U),U){case 66:case 69:case 70:case 72:X=3;break;case 68:case 71:X=4;break;default:X=2}for(Y=0;Y<47;Y++)T.push({k:z+Y,v:X})}for(T.sort((function(Q,J){return J.v-Q.v})),Y=0;Y<T.length;Y++)z=T[Y].k.charAt(0),W.charAt(W.length-1)!==z&&(W+=z);return W!=="DGBEFHACIJK"}}));i({target:"Array",proto:!0,forced:P||!$||!I||!F},{sort:function(U){U!==void 0&&s(U);var z=l(this);if(F)return U===void 0?B(z):B(z,U);var X,Y,W=[],Q=f(z);for(Y=0;Y<Q;Y++)Y in z&&R(W,z[Y]);for(_(W,(function(J){return function(ie,Se){return Se===void 0?-1:ie===void 0?1:J!==void 0?+J(ie,Se)||0:h(ie)>h(Se)?1:-1}})(U)),X=W.length,Y=0;Y<X;)z[Y]=W[Y++];for(;Y<Q;)delete z[Y++];return z}})},function(n,o,r){var i=r(114),a=Math.floor,s=function(h,v){var _=h.length,E=a(_/2);return _<8?l(h,v):f(h,s(i(h,0,E),v),s(i(h,E),v),v)},l=function(h,v){for(var _,E,O=h.length,w=1;w<O;){for(E=w,_=h[w];E&&v(h[E-1],_)>0;)h[E]=h[--E];E!==w++&&(h[E]=_)}return h},f=function(h,v,_,E){for(var O=v.length,w=_.length,S=0,M=0;S<O||M<w;)h[S+M]=S<O&&M<w?E(v[S],_[M])<=0?v[S++]:_[M++]:S<O?v[S++]:_[M++];return h};n.exports=s},function(n,o,r){var i=r(55).match(/firefox\/(\d+)/i);n.exports=!!i&&+i[1]},function(n,o,r){var i=r(55);n.exports=/MSIE|Trident/.test(i)},function(n,o,r){var i=r(55).match(/AppleWebKit\/(\d+)\./);n.exports=!!i&&+i[1]},function(n,o,r){var i=r(7),a=r(159),s=i.TypeError;n.exports=function(l){if(a(l))throw s("The method doesn't accept regular expressions");return l}},function(n,o,r){var i=r(28)("match");n.exports=function(a){var s=/./;try{"/./"[a](s)}catch{try{return s[i]=!1,"/./"[a](s)}catch{}}return!1}},function(n,o,r){r(16)({target:"Number",stat:!0},{isNaN:function(i){return i!=i}})},function(n,o,r){var i=r(73).PROPER,a=r(18),s=r(162);n.exports=function(l){return a((function(){return!!s[l]()||"
"[l]()!=="
"||i&&s[l].name!==l}))}},function(n,o,r){var i=r(15),a=r(40),s=Math.floor,l=i("".charAt),f=i("".replace),h=i("".slice),v=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,_=/\$([$&'`]|\d{1,2})/g;n.exports=function(E,O,w,S,M,T){var B=w+E.length,R=S.length,P=_;return M!==void 0&&(M=a(M),P=v),f(T,P,(function($,I){var F;switch(l(I,0)){case"$":return"$";case"&":return E;case"`":return h(O,0,w);case"'":return h(O,B);case"<":F=M[h(I,1,-1)];break;default:var U=+I;if(U===0)return $;if(U>R){var z=s(U/10);return z===0?$:z<=R?S[z-1]===void 0?l(I,1):S[z-1]+l(I,1):$}F=S[U-1]}return F===void 0?"":F}))}},function(n,o,r){var i=r(36),a=r(15),s=r(34),l=r(18),f=r(77),h=r(112),v=r(84),_=r(40),E=r(85),O=Object.assign,w=Object.defineProperty,S=a([].concat);n.exports=!O||l((function(){if(i&&O({b:1},O(w({},"a",{enumerable:!0,get:function(){w(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var M={},T={},B=Symbol(),R="abcdefghijklmnopqrst";return M[B]=7,R.split("").forEach((function(P){T[P]=P})),O({},M)[B]!=7||f(O({},T)).join("")!=R}))?function(M,T){for(var B=_(M),R=arguments.length,P=1,$=h.f,I=v.f;R>P;)for(var F,U=E(arguments[P++]),z=$?S(f(U),$(U)):f(U),X=z.length,Y=0;X>Y;)F=z[Y++],i&&!s(I,U,F)||(B[F]=U[F]);return B}:O},function(n,o,r){var i=r(7),a=r(15),s=r(56),l=r(33),f=r(35),h=r(98),v=i.Function,_=a([].concat),E=a([].join),O={},w=function(S,M,T){if(!f(O,M)){for(var B=[],R=0;R<M;R++)B[R]="a["+R+"]";O[M]=v("C,a","return new C("+E(B,",")+")")}return O[M](S,T)};n.exports=v.bind||function(S){var M=s(this),T=M.prototype,B=h(arguments,1),R=function(){var P=_(B,h(arguments));return this instanceof R?w(M,P.length,P):M.apply(S,P)};return l(T)&&(R.prototype=T),R}},function(n,o,r){var i=r(35);n.exports=function(a){return a!==void 0&&(i(a,"value")||i(a,"writable"))}},function(n,o,r){var i=r(15),a=r(44),s=r(39),l=/"/g,f=i("".replace);n.exports=function(h,v,_,E){var O=s(a(h)),w="<"+v;return _!==""&&(w+=" "+_+'="'+f(s(E),l,""")+'"'),w+">"+O+"</"+v+">"}},function(n,o,r){var i=r(18);n.exports=function(a){return i((function(){var s=""[a]('"');return s!==s.toLowerCase()||s.split('"').length>3}))}},function(n,o,r){r(16)({target:"Number",stat:!0},{EPSILON:Math.pow(2,-52)})},function(n,o,r){var i,a,s,l,f=r(16),h=r(71),v=r(7),_=r(46),E=r(34),O=r(209),w=r(42),S=r(149),M=r(102),T=r(78),B=r(150),R=r(56),P=r(30),$=r(33),I=r(119),F=r(92),U=r(117),z=r(120),X=r(164),Y=r(168).set,W=r(210),Q=r(213),J=r(214),ie=r(170),Se=r(215),Ae=r(58),Pe=r(95),De=r(28),He=r(216),Ye=r(128),Be=r(70),Je=De("species"),mt="Promise",le=Ae.getterFor(mt),Ze=Ae.set,pe=Ae.getterFor(mt),se=O&&O.prototype,we=O,$e=se,rt=v.TypeError,pt=v.document,Lt=v.process,Jt=ie.f,en=Jt,zt=!!(pt&&pt.createEvent&&v.dispatchEvent),it=P(v.PromiseRejectionEvent),ae="unhandledrejection",re=!1,je=Pe(mt,(function(){var Le=F(we),dt=Le!==String(we);if(!dt&&Be===66||h&&!$e.finally)return!0;if(Be>=51&&/native code/.test(Le))return!1;var At=new we((function(En){En(1)})),Tt=function(En){En((function(){}),(function(){}))};return(At.constructor={})[Je]=Tt,!(re=At.then((function(){}))instanceof Tt)||!dt&&He&&!it})),vt=je||!z((function(Le){we.all(Le).catch((function(){}))})),q=function(Le){var dt;return!(!$(Le)||!P(dt=Le.then))&&dt},kt=function(Le,dt){if(!Le.notified){Le.notified=!0;var At=Le.reactions;W((function(){for(var Tt=Le.value,En=Le.state==1,Zn=0;At.length>Zn;){var ao,Lo,_o,ho=At[Zn++],Nn=En?ho.ok:ho.fail,qn=ho.resolve,rr=ho.reject,ut=ho.domain;try{Nn?(En||(Le.rejection===2&&qt(Le),Le.rejection=1),Nn===!0?ao=Tt:(ut&&ut.enter(),ao=Nn(Tt),ut&&(ut.exit(),_o=!0)),ao===ho.promise?rr(rt("Promise-chain cycle")):(Lo=q(ao))?E(Lo,ao,qn,rr):qn(ao)):rr(Tt)}catch(gn){ut&&!_o&&ut.exit(),rr(gn)}}Le.reactions=[],Le.notified=!1,dt&&!Le.rejection&&Gt(Le)}))}},Rt=function(Le,dt,At){var Tt,En;zt?((Tt=pt.createEvent("Event")).promise=dt,Tt.reason=At,Tt.initEvent(Le,!1,!0),v.dispatchEvent(Tt)):Tt={promise:dt,reason:At},!it&&(En=v["on"+Le])?En(Tt):Le===ae&&J("Unhandled promise rejection",At)},Gt=function(Le){E(Y,v,(function(){var dt,At=Le.facade,Tt=Le.value;if(Pn(Le)&&(dt=Se((function(){Ye?Lt.emit("unhandledRejection",Tt,At):Rt(ae,At,Tt)})),Le.rejection=Ye||Pn(Le)?2:1,dt.error))throw dt.value}))},Pn=function(Le){return Le.rejection!==1&&!Le.parent},qt=function(Le){E(Y,v,(function(){var dt=Le.facade;Ye?Lt.emit("rejectionHandled",dt):Rt("rejectionhandled",dt,Le.value)}))},On=function(Le,dt,At){return function(Tt){Le(dt,Tt,At)}},ke=function(Le,dt,At){Le.done||(Le.done=!0,At&&(Le=At),Le.value=dt,Le.state=2,kt(Le,!0))},Ke=function(Le,dt,At){if(!Le.done){Le.done=!0,At&&(Le=At);try{if(Le.facade===dt)throw rt("Promise can't be resolved itself");var Tt=q(dt);Tt?W((function(){var En={done:!1};try{E(Tt,dt,On(Ke,En,Le),On(ke,En,Le))}catch(Zn){ke(En,Zn,Le)}})):(Le.value=dt,Le.state=1,kt(Le,!1))}catch(En){ke({done:!1},En,Le)}}};if(je&&($e=(we=function(Le){I(this,$e),R(Le),E(i,this);var dt=le(this);try{Le(On(Ke,dt),On(ke,dt))}catch(At){ke(dt,At)}}).prototype,(i=function(Le){Ze(this,{type:mt,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=S($e,{then:function(Le,dt){var At=pe(this),Tt=At.reactions,En=Jt(X(this,we));return En.ok=!P(Le)||Le,En.fail=P(dt)&&dt,En.domain=Ye?Lt.domain:void 0,At.parent=!0,Tt[Tt.length]=En,At.state!=0&&kt(At,!1),En.promise},catch:function(Le){return this.then(void 0,Le)}}),a=function(){var Le=new i,dt=le(Le);this.promise=Le,this.resolve=On(Ke,dt),this.reject=On(ke,dt)},ie.f=Jt=function(Le){return Le===we||Le===s?new a(Le):en(Le)},!h&&P(O)&&se!==Object.prototype)){l=se.then,re||(w(se,"then",(function(Le,dt){var At=this;return new we((function(Tt,En){E(l,At,Tt,En)})).then(Le,dt)}),{unsafe:!0}),w(se,"catch",$e.catch,{unsafe:!0}));try{delete se.constructor}catch{}M&&M(se,$e)}f({global:!0,wrap:!0,forced:je},{Promise:we}),T(we,mt,!1,!0),B(mt),s=_(mt),f({target:mt,stat:!0,forced:je},{reject:function(Le){var dt=Jt(this);return E(dt.reject,void 0,Le),dt.promise}}),f({target:mt,stat:!0,forced:h||je},{resolve:function(Le){return Q(h&&this===s?we:this,Le)}}),f({target:mt,stat:!0,forced:vt},{all:function(Le){var dt=this,At=Jt(dt),Tt=At.resolve,En=At.reject,Zn=Se((function(){var ao=R(dt.resolve),Lo=[],_o=0,ho=1;U(Le,(function(Nn){var qn=_o++,rr=!1;ho++,E(ao,dt,Nn).then((function(ut){rr||(rr=!0,Lo[qn]=ut,--ho||Tt(Lo))}),En)})),--ho||Tt(Lo)}));return Zn.error&&En(Zn.value),At.promise},race:function(Le){var dt=this,At=Jt(dt),Tt=At.reject,En=Se((function(){var Zn=R(dt.resolve);U(Le,(function(ao){E(Zn,dt,ao).then(At.resolve,Tt)}))}));return En.error&&Tt(En.value),At.promise}})},function(n,o,r){var i=r(7);n.exports=i.Promise},function(n,o,r){var i,a,s,l,f,h,v,_,E=r(7),O=r(64),w=r(50).f,S=r(168).set,M=r(169),T=r(211),B=r(212),R=r(128),P=E.MutationObserver||E.WebKitMutationObserver,$=E.document,I=E.process,F=E.Promise,U=w(E,"queueMicrotask"),z=U&&U.value;z||(i=function(){var X,Y;for(R&&(X=I.domain)&&X.exit();a;){Y=a.fn,a=a.next;try{Y()}catch(W){throw a?l():s=void 0,W}}s=void 0,X&&X.enter()},M||R||B||!P||!$?!T&&F&&F.resolve?((v=F.resolve(void 0)).constructor=F,_=O(v.then,v),l=function(){_(i)}):R?l=function(){I.nextTick(i)}:(S=O(S,E),l=function(){S(i)}):(f=!0,h=$.createTextNode(""),new P(i).observe(h,{characterData:!0}),l=function(){h.data=f=!f})),n.exports=z||function(X){var Y={fn:X,next:void 0};s&&(s.next=Y),a||(a=Y,l()),s=Y}},function(n,o,r){var i=r(55),a=r(7);n.exports=/ipad|iphone|ipod/i.test(i)&&a.Pebble!==void 0},function(n,o,r){var i=r(55);n.exports=/web0s(?!.*chrome)/i.test(i)},function(n,o,r){var i=r(32),a=r(33),s=r(170);n.exports=function(l,f){if(i(l),a(f)&&f.constructor===l)return f;var h=s.f(l);return(0,h.resolve)(f),h.promise}},function(n,o,r){var i=r(7);n.exports=function(a,s){var l=i.console;l&&l.error&&(arguments.length==1?l.error(a):l.error(a,s))}},function(n,o){n.exports=function(r){try{return{error:!1,value:r()}}catch(i){return{error:!0,value:i}}}},function(n,o){n.exports=typeof window=="object"},function(n,o,r){var i=r(40),a=r(75),s=r(45);n.exports=function(l){for(var f=i(this),h=s(f),v=arguments.length,_=a(v>1?arguments[1]:void 0,h),E=v>2?arguments[2]:void 0,O=E===void 0?h:a(E,h);O>_;)f[_++]=l;return f}},function(n,o,r){var i=r(16),a=r(7),s=r(15),l=r(59),f=r(160),h=r(219),v=r(18),_=a.RangeError,E=a.String,O=Math.floor,w=s(h),S=s("".slice),M=s(1 .toFixed),T=function($,I,F){return I===0?F:I%2==1?T($,I-1,F*$):T($*$,I/2,F)},B=function($,I,F){for(var U=-1,z=F;++U<6;)z+=I*$[U],$[U]=z%1e7,z=O(z/1e7)},R=function($,I){for(var F=6,U=0;--F>=0;)U+=$[F],$[F]=O(U/I),U=U%I*1e7},P=function($){for(var I=6,F="";--I>=0;)if(F!==""||I===0||$[I]!==0){var U=E($[I]);F=F===""?U:F+w("0",7-U.length)+U}return F};i({target:"Number",proto:!0,forced:v((function(){return M(8e-5,3)!=="0.000"||M(.9,0)!=="1"||M(1.255,2)!=="1.25"||M(0xde0b6b3a7640080,0)!=="1000000000000000128"}))||!v((function(){M({})}))},{toFixed:function($){var I,F,U,z,X=f(this),Y=l($),W=[0,0,0,0,0,0],Q="",J="0";if(Y<0||Y>20)throw _("Incorrect fraction digits");if(X!=X)return"NaN";if(X<=-1e21||X>=1e21)return E(X);if(X<0&&(Q="-",X=-X),X>1e-21)if(F=(I=(function(ie){for(var Se=0,Ae=ie;Ae>=4096;)Se+=12,Ae/=4096;for(;Ae>=2;)Se+=1,Ae/=2;return Se})(X*T(2,69,1))-69)<0?X*T(2,-I,1):X/T(2,I,1),F*=4503599627370496,(I=52-I)>0){for(B(W,0,F),U=Y;U>=7;)B(W,1e7,0),U-=7;for(B(W,T(10,U,1),0),U=I-1;U>=23;)R(W,1<<23),U-=23;R(W,1<<U),B(W,1,1),R(W,2),J=P(W)}else B(W,0,F),B(W,1<<-I,0),J=P(W)+w("0",Y);return J=Y>0?Q+((z=J.length)<=Y?"0."+w("0",Y-z)+J:S(J,0,z-Y)+"."+S(J,z-Y)):Q+J}})},function(n,o,r){var i=r(7),a=r(59),s=r(39),l=r(44),f=i.RangeError;n.exports=function(h){var v=s(l(this)),_="",E=a(h);if(E<0||E==1/0)throw f("Wrong number of repetitions");for(;E>0;(E>>>=1)&&(v+=v))1&E&&(_+=v);return _}},function(n,o,r){var i=r(36),a=r(15),s=r(77),l=r(41),f=a(r(84).f),h=a([].push),v=function(_){return function(E){for(var O,w=l(E),S=s(w),M=S.length,T=0,B=[];M>T;)O=S[T++],i&&!f(w,O)||h(B,_?[O,w[O]]:w[O]);return B}};n.exports={entries:v(!0),values:v(!1)}},function(n,o){n.exports=function(r){return r.webpackPolyfill||(r.deprecate=function(){},r.paths=[],r.children||(r.children=[]),Object.defineProperty(r,"loaded",{enumerable:!0,get:function(){return r.l}}),Object.defineProperty(r,"id",{enumerable:!0,get:function(){return r.i}}),r.webpackPolyfill=1),r}},function(n,o,r){r.r(o),r.d(o,"observer",(function(){return Fc})),r.d(o,"LogicFlow",(function(){return XO})),r.d(o,"h",(function(){return re.g})),r.d(o,"LogicFlowUtil",(function(){return i})),r.d(o,"BaseNode",(function(){return Yf})),r.d(o,"RectNode",(function(){return Fx})),r.d(o,"CircleNode",(function(){return Vx})),r.d(o,"PolygonNode",(function(){return Xx})),r.d(o,"DiamondNode",(function(){return Zx})),r.d(o,"EllipseNode",(function(){return nO})),r.d(o,"TextNode",(function(){return iO})),r.d(o,"HtmlNode",(function(){return uO})),r.d(o,"BaseEdge",(function(){return Py})),r.d(o,"LineEdge",(function(){return xO})),r.d(o,"PolylineEdge",(function(){return TO})),r.d(o,"BezierEdge",(function(){return PO})),r.d(o,"Arrow",(function(){return WB})),r.d(o,"BaseEdgeModel",(function(){return Jp})),r.d(o,"BezierEdgeModel",(function(){return GE})),r.d(o,"LineEdgeModel",(function(){return Od})),r.d(o,"PolylineEdgeModel",(function(){return Cl})),r.d(o,"BaseNodeModel",(function(){return Xf})),r.d(o,"CircleNodeModel",(function(){return KE})),r.d(o,"DiamondNodeModel",(function(){return tx})),r.d(o,"EllipseNodeModel",(function(){return ix})),r.d(o,"PolygonNodeModel",(function(){return dx})),r.d(o,"RectNodeModel",(function(){return vx})),r.d(o,"TextNodeModel",(function(){return _x})),r.d(o,"HtmlNodeModel",(function(){return Ex})),r.d(o,"EditConfigModel",(function(){return Cp})),r.d(o,"GraphModel",(function(){return uT})),r.d(o,"SnaplineModel",(function(){return HC})),r.d(o,"Keyboard",(function(){return PN})),r.d(o,"get",(function(){return PT})),r.d(o,"defaults",(function(){return DT})),r.d(o,"ElementState",(function(){return Io})),r.d(o,"ModelType",(function(){return lo})),r.d(o,"ElementType",(function(){return ei})),r.d(o,"EventType",(function(){return ur})),r.d(o,"formateAnchorConnectValidateData",(function(){return au}));var i={};r.r(i),r.d(i,"createUuid",(function(){return tl})),r.d(i,"refreshGraphId",(function(){return Sf})),r.d(i,"StepDrag",(function(){return Ce})),r.d(i,"setupEdgeModel",(function(){return sn})),r.d(i,"isBboxOverLapping",(function(){return nn})),r.d(i,"filterRepeatPoints",(function(){return Mt})),r.d(i,"getSimplePolyline",(function(){return wn})),r.d(i,"getExpandedBBox",(function(){return hn})),r.d(i,"pointDirection",(function(){return rn})),r.d(i,"getExpandedBBoxPoint",(function(){return Wt})),r.d(i,"mergeBBox",(function(){return st})),r.d(i,"getBBoxOfPoints",(function(){return St})),r.d(i,"getPointsFromBBox",(function(){return ln})),r.d(i,"isPointOutsideBBox",(function(){return An})),r.d(i,"getBBoxXCrossPoints",(function(){return Xt})),r.d(i,"getBBoxYCrossPoints",(function(){return kn})),r.d(i,"getBBoxCrossPointsByPoint",(function(){return Kt})),r.d(i,"estimateDistance",(function(){return _n})),r.d(i,"costByPoints",(function(){return Yt})),r.d(i,"heuristicCostEstimate",(function(){return xn})),r.d(i,"rebuildPath",(function(){return ar})),r.d(i,"removeClosePointFromOpenList",(function(){return xr})),r.d(i,"isSegmentsIntersected",(function(){return on})),r.d(i,"isSegmentCrossingBBox",(function(){return Zt})),r.d(i,"getNextNeighborPoints",(function(){return Ht})),r.d(i,"pathFinder",(function(){return pr})),r.d(i,"getBoxByOriginNode",(function(){return Dr})),r.d(i,"pointFilter",(function(){return Un})),r.d(i,"getPolylinePoints",(function(){return $r})),r.d(i,"getLongestEdge",(function(){return Or})),r.d(i,"isSegmentsInNode",(function(){return Fr})),r.d(i,"isSegmentsCrossNode",(function(){return Qr})),r.d(i,"getCrossPointInRect",(function(){return ki})),r.d(i,"segmentDirection",(function(){return Si})),r.d(i,"points2PointsList",(function(){return jr})),r.d(i,"getSimplePoints",(function(){return Gi})),r.d(i,"getBytesLength",(function(){return Pi})),r.d(i,"getTextWidth",(function(){return Qi})),r.d(i,"getAppendAttributes",(function(){return la})),r.d(i,"getBezierControlPoints",(function(){return zi})),r.d(i,"getBezierPoints",(function(){return di})),r.d(i,"getEndTangent",(function(){return sa})),r.d(i,"getClosestPointOfPolyline",(function(){return co})),r.d(i,"pickEdgeConfig",(function(){return cr})),r.d(i,"twoPointDistance",(function(){return Xr})),r.d(i,"createEdgeGenerator",(function(){return Nr})),r.d(i,"snapToGrid",(function(){return fs})),r.d(i,"getGridOffset",(function(){return wf})),r.d(i,"sampleCubic",(function(){return Ni})),r.d(i,"getThetaOfVector",(function(){return eh})),r.d(i,"degrees",(function(){return mv})),r.d(i,"Vector",(function(){return ot})),r.d(i,"Point",(function(){return m})),r.d(i,"Matrix",(function(){return Fu})),r.d(i,"RotateMatrix",(function(){return Sd})),r.d(i,"ScaleMatrix",(function(){return wy})),r.d(i,"TranslateMatrix",(function(){return nh}));var a=r(1),s=r(10);if(!s.j)throw new Error("mobx-react-lite requires React with Hooks support");if(!a.H)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");var l=r(43),f=Object(l.b)("observerBatching");function h(c){c()}var v=!1;function _(){return v}function E(c){return Object(a.t)(c)}var O,w=1e4,S=new Set;function M(){O===void 0&&(O=setTimeout(T,1e4))}function T(){O=void 0;var c=Date.now();S.forEach((function(u){var d=u.current;d&&c>=d.cleanAt&&(d.reaction.dispose(),u.current=null,S.delete(u))})),S.size>0&&M()}var B=!1,R=[],P={};function $(c){return"observer"+c}function I(c,u,d){u===void 0&&(u="observed"),d===void 0&&(d=P),_();var p,y=(function(V){return function(){B?R.push(V):V()}})((d.useForceUpdate||l.d)()),g=s.d.useRef(null);if(!g.current){var b=new a.c($(u),(function(){A.mounted?y():(b.dispose(),g.current=null)})),A=(function(V){return{cleanAt:Date.now()+w,reaction:V}})(b);g.current=A,p=g,S.add(p),M()}var N=g.current.reaction;return s.d.useDebugValue(N,E),s.d.useEffect((function(){var V;return V=g,S.delete(V),g.current?g.current.mounted=!0:(g.current={reaction:new a.c($(u),(function(){y()})),cleanAt:1/0},y()),function(){g.current.reaction.dispose(),g.current=null}}),[]),(function(V){B=!0,R=[];try{var H=V();B=!1;var oe=R.length>0?R:void 0;return s.d.useLayoutEffect((function(){oe&&oe.forEach((function(ue){return ue()}))}),[oe]),H}finally{B=!1}})((function(){var V,H;if(N.track((function(){try{V=c()}catch(oe){H=oe}})),H)throw H;return V}))}var F=function(){return F=Object.assign||function(c){for(var u,d=1,p=arguments.length;d<p;d++)for(var y in u=arguments[d])Object.prototype.hasOwnProperty.call(u,y)&&(c[y]=u[y]);return c},F.apply(this,arguments)};function U(c,u){var d,p,y,g=F({forwardRef:!1},u),b=c.displayName||c.name,A=function(N,V){return I((function(){return c(N,V)}),b)};return A.displayName=b,d=g.forwardRef?Object(s.f)(Object(s.e)(A)):Object(s.f)(A),p=c,y=d,Object.keys(p).forEach((function(N){z[N]||Object.defineProperty(y,N,Object.getOwnPropertyDescriptor(p,N))})),d.displayName=b,d}var z={$$typeof:!0,render:!0,compare:!0,type:!0};function X(c){var u=c.children,d=c.render,p=u||d;return typeof p!="function"?null:I(p)}function Y(c,u,d,p,y){var g=u==="children"?"render":"children",b=typeof c[u]=="function",A=typeof c[g]=="function";return b&&A?new Error("MobX Observer: Do not use children and render in the same time in`"+d):b||A?null:new Error("Invalid prop `"+y+"` of type `"+typeof c[u]+"` supplied to `"+d+"`, expected `function`.")}X.propTypes={children:Y,render:Y},X.displayName="Observer";var W;(W=s.g)||(W=h),Object(a.n)({reactionScheduler:W}),Object(l.a)()[f]=!0;var Q=0,J={};function ie(c){return J[c]||(J[c]=(function(u){if(typeof Symbol=="function")return Symbol(u);var d="__$mobx-react "+u+" ("+Q+")";return Q++,d})(c)),J[c]}function Se(c,u){if(Ae(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var d=Object.keys(c),p=Object.keys(u);if(d.length!==p.length)return!1;for(var y=0;y<d.length;y++)if(!Object.hasOwnProperty.call(u,d[y])||!Ae(c[d[y]],u[d[y]]))return!1;return!0}function Ae(c,u){return c===u?c!==0||1/c==1/u:c!=c&&u!=u}function Pe(c,u,d){Object.hasOwnProperty.call(c,u)?c[u]=d:Object.defineProperty(c,u,{enumerable:!1,configurable:!0,writable:!0,value:d})}var De=ie("patchMixins"),He=ie("patchedDefinition");function Ye(c,u){for(var d=this,p=arguments.length,y=new Array(p>2?p-2:0),g=2;g<p;g++)y[g-2]=arguments[g];u.locks++;try{var b;return c!=null&&(b=c.apply(this,y)),b}finally{u.locks--,u.locks===0&&u.methods.forEach((function(A){A.apply(d,y)}))}}function Be(c,u){return function(){for(var d=arguments.length,p=new Array(d),y=0;y<d;y++)p[y]=arguments[y];Ye.call.apply(Ye,[this,c,u].concat(p))}}function Je(c,u,d){var p=(function(A,N){var V=A[De]=A[De]||{},H=V[N]=V[N]||{};return H.locks=H.locks||0,H.methods=H.methods||[],H})(c,u);p.methods.indexOf(d)<0&&p.methods.push(d);var y=Object.getOwnPropertyDescriptor(c,u);if(!y||!y[He]){var g=c[u],b=mt(c,u,y?y.enumerable:void 0,p,g);Object.defineProperty(c,u,b)}}function mt(c,u,d,p,y){var g,b=Be(y,p);return(g={})[He]=!0,g.get=function(){return b},g.set=function(A){if(this===c)b=Be(A,p);else{var N=mt(this,u,d,p,A);Object.defineProperty(this,u,N)}},g.configurable=!0,g.enumerable=d,g}var le=a.a||"$mobx",Ze=ie("isMobXReactObserver"),pe=ie("isUnmounted"),se=ie("skipRender"),we=ie("isForcingUpdate");function $e(c){var u=c.prototype;if(c[Ze]?rt(u):c[Ze]=!0,u.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(c.__proto__!==s.b)if(u.shouldComponentUpdate){if(u.shouldComponentUpdate!==Lt)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else u.shouldComponentUpdate=Lt;Jt(u,"props"),Jt(u,"state");var d=u.render;return u.render=function(){return pt.call(this,d)},Je(u,"componentWillUnmount",(function(){var p;(p=this.render[le])===null||p===void 0||p.dispose(),this[pe]=!0,!this.render[le]&&rt(this)})),c}function rt(c){return c.displayName||c.name||c.constructor&&(c.constructor.displayName||c.constructor.name)||"<component>"}function pt(c){var u=this;Pe(this,se,!1),Pe(this,we,!1);var d=rt(this),p=c.bind(this),y=!1,g=new a.c(d+".render()",(function(){if(!y&&(y=!0,u[pe]!==!0)){var A=!0;try{Pe(u,we,!0),u[se]||s.a.prototype.forceUpdate.call(u),A=!1}finally{Pe(u,we,!1),A&&g.dispose()}}}));function b(){y=!1;var A=void 0,N=void 0;if(g.track((function(){try{N=Object(a.d)(!1,p)}catch(V){A=V}})),A)throw A;return N}return g.reactComponent=this,b[le]=g,this.render=b,b.call(this)}function Lt(c,u){return this.state!==u||!Se(this.props,c)}function Jt(c,u){var d=ie("reactProp_"+u+"_valueHolder"),p=ie("reactProp_"+u+"_atomHolder");function y(){return this[p]||Pe(this,p,Object(a.o)("reactive "+u)),this[p]}Object.defineProperty(c,u,{configurable:!0,enumerable:!0,get:function(){var g=!1;return a.f&&a.e&&(g=Object(a.f)(!0)),y.call(this).reportObserved(),a.f&&a.e&&Object(a.e)(g),this[d]},set:function(g){this[we]||Se(this[d],g)?Pe(this,d,g):(Pe(this,d,g),Pe(this,se,!0),y.call(this).reportChanged(),Pe(this,se,!1))}})}var en=typeof Symbol=="function"&&Symbol.for,zt=en?Symbol.for("react.forward_ref"):typeof s.e=="function"&&Object(s.e)((function(c){return null})).$$typeof,it=en?Symbol.for("react.memo"):typeof s.f=="function"&&Object(s.f)((function(c){return null})).$$typeof;function ae(c){if(c.isMobxInjector,it&&c.$$typeof===it)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(zt&&c.$$typeof===zt){var u=c.render;if(typeof u!="function")throw new Error("render property of ForwardRef was not a function");return Object(s.e)((function(){var d=arguments;return Object(s.c)(X,null,(function(){return u.apply(void 0,d)}))}))}return typeof c!="function"||c.prototype&&c.prototype.render||c.isReactClass||Object.prototype.isPrototypeOf.call(s.a,c)?$e(c):U(c)}if(!s.a)throw new Error("mobx-react requires React to be available");if(!a.C)throw new Error("mobx-react requires mobx to be available");var re=r(0);r(4),r(8),r(2),r(3),r(52),r(6),r(5),r(11),r(37),r(27),r(21),r(20),r(24),r(22),r(25),r(9),r(17),r(23),r(19),r(192),r(156),r(104),r(157),r(158),r(199),r(61);var je=function(c,u){for(var d=-1,p=c==null?0:c.length,y=Array(p);++d<p;)y[d]=u(c[d],d,c);return y},vt=function(){this.__data__=[],this.size=0},q=function(c,u){return c===u||c!=c&&u!=u},kt=function(c,u){for(var d=c.length;d--;)if(q(c[d][0],u))return d;return-1},Rt=Array.prototype.splice,Gt=function(c){var u=this.__data__,d=kt(u,c);return!(d<0)&&(d==u.length-1?u.pop():Rt.call(u,d,1),--this.size,!0)},Pn=function(c){var u=this.__data__,d=kt(u,c);return d<0?void 0:u[d][1]},qt=function(c){return kt(this.__data__,c)>-1},On=function(c,u){var d=this.__data__,p=kt(d,c);return p<0?(++this.size,d.push([c,u])):d[p][1]=u,this};function ke(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}ke.prototype.clear=vt,ke.prototype.delete=Gt,ke.prototype.get=Pn,ke.prototype.has=qt,ke.prototype.set=On;var Ke=ke,Le=function(){this.__data__=new Ke,this.size=0},dt=function(c){var u=this.__data__,d=u.delete(c);return this.size=u.size,d},At=function(c){return this.__data__.get(c)},Tt=function(c){return this.__data__.has(c)},En=r(31),Zn=En.a.Symbol,ao=Object.prototype,Lo=ao.hasOwnProperty,_o=ao.toString,ho=Zn?Zn.toStringTag:void 0,Nn=function(c){var u=Lo.call(c,ho),d=c[ho];try{c[ho]=void 0;var p=!0}catch{}var y=_o.call(c);return p&&(u?c[ho]=d:delete c[ho]),y},qn=Object.prototype.toString,rr=function(c){return qn.call(c)},ut=Zn?Zn.toStringTag:void 0,gn=function(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":ut&&ut in Object(c)?Nn(c):rr(c)},Fn=function(c){var u=typeof c;return c!=null&&(u=="object"||u=="function")},sr,wo=function(c){if(!Fn(c))return!1;var u=gn(c);return u=="[object Function]"||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"},oo=En.a["__core-js_shared__"],ta=(sr=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||""))?"Symbol(src)_1."+sr:"",Ca=function(c){return!!ta&&ta in c},Yi=Function.prototype.toString,fa=function(c){if(c!=null){try{return Yi.call(c)}catch{}try{return c+""}catch{}}return""},Ka=/^\[object .+?Constructor\]$/,Sn=Function.prototype,Ts=Object.prototype,Oo=Sn.toString,es=Ts.hasOwnProperty,Ui=RegExp("^"+Oo.call(es).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yr=function(c){return!(!Fn(c)||Ca(c))&&(wo(c)?Ui:Ka).test(fa(c))},ml=function(c,u){return c==null?void 0:c[u]},pa=function(c,u){var d=ml(c,u);return yr(d)?d:void 0},qi=pa(En.a,"Map"),Na=pa(Object,"create"),al=function(){this.__data__=Na?Na(null):{},this.size=0},yl=function(c){var u=this.has(c)&&delete this.__data__[c];return this.size-=u?1:0,u},Cs=Object.prototype.hasOwnProperty,_l=function(c){var u=this.__data__;if(Na){var d=u[c];return d==="__lodash_hash_undefined__"?void 0:d}return Cs.call(u,c)?u[c]:void 0},ts=Object.prototype.hasOwnProperty,ve=function(c){var u=this.__data__;return Na?u[c]!==void 0:ts.call(u,c)},gt=function(c,u){var d=this.__data__;return this.size+=this.has(c)?0:1,d[c]=Na&&u===void 0?"__lodash_hash_undefined__":u,this};function dn(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}dn.prototype.clear=al,dn.prototype.delete=yl,dn.prototype.get=_l,dn.prototype.has=ve,dn.prototype.set=gt;var Kn=dn,br=function(){this.size=0,this.__data__={hash:new Kn,map:new(qi||Ke),string:new Kn}},so=function(c){var u=typeof c;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?c!=="__proto__":c===null},si=function(c,u){var d=c.__data__;return so(u)?d[typeof u=="string"?"string":"hash"]:d.map},ye=function(c){var u=si(this,c).delete(c);return this.size-=u?1:0,u},ht=function(c){return si(this,c).get(c)},pn=function(c){return si(this,c).has(c)},Rn=function(c,u){var d=si(this,c),p=d.size;return d.set(c,u),this.size+=d.size==p?0:1,this};function Cn(c){var u=-1,d=c==null?0:c.length;for(this.clear();++u<d;){var p=c[u];this.set(p[0],p[1])}}Cn.prototype.clear=br,Cn.prototype.delete=ye,Cn.prototype.get=ht,Cn.prototype.has=pn,Cn.prototype.set=Rn;var nr=Cn,Mn=function(c,u){var d=this.__data__;if(d instanceof Ke){var p=d.__data__;if(!qi||p.length<199)return p.push([c,u]),this.size=++d.size,this;d=this.__data__=new nr(p)}return d.set(c,u),this.size=d.size,this};function or(c){var u=this.__data__=new Ke(c);this.size=u.size}or.prototype.clear=Le,or.prototype.delete=dt,or.prototype.get=At,or.prototype.has=Tt,or.prototype.set=Mn;var lr=or,qr=function(c){return this.__data__.set(c,"__lodash_hash_undefined__"),this},na=function(c){return this.__data__.has(c)};function vi(c){var u=-1,d=c==null?0:c.length;for(this.__data__=new nr;++u<d;)this.add(c[u])}vi.prototype.add=vi.prototype.push=qr,vi.prototype.has=na;var bl=vi,Vi=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p;)if(u(c[d],d,c))return!0;return!1},Ns=function(c,u){return c.has(u)},Fl=function(c,u,d,p,y,g){var b=1&d,A=c.length,N=u.length;if(A!=N&&!(b&&N>A))return!1;var V=g.get(c),H=g.get(u);if(V&&H)return V==u&&H==c;var oe=-1,ue=!0,Ne=2&d?new bl:void 0;for(g.set(c,u),g.set(u,c);++oe<A;){var Ve=c[oe],qe=u[oe];if(p)var Ot=b?p(qe,Ve,oe,u,c,g):p(Ve,qe,oe,c,u,g);if(Ot!==void 0){if(Ot)continue;ue=!1;break}if(Ne){if(!Vi(u,(function(xt,Ft){if(!Ns(Ne,Ft)&&(Ve===xt||y(Ve,xt,d,p,g)))return Ne.push(Ft)}))){ue=!1;break}}else if(Ve!==qe&&!y(Ve,qe,d,p,g)){ue=!1;break}}return g.delete(c),g.delete(u),ue},Ro=En.a.Uint8Array,La=function(c){var u=-1,d=Array(c.size);return c.forEach((function(p,y){d[++u]=[y,p]})),d},id=function(c){var u=-1,d=Array(c.size);return c.forEach((function(p){d[++u]=p})),d},_u=Zn?Zn.prototype:void 0,Ia=_u?_u.valueOf:void 0,ra=function(c,u,d,p,y,g,b){switch(d){case"[object DataView]":if(c.byteLength!=u.byteLength||c.byteOffset!=u.byteOffset)return!1;c=c.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(c.byteLength!=u.byteLength||!g(new Ro(c),new Ro(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return q(+c,+u);case"[object Error]":return c.name==u.name&&c.message==u.message;case"[object RegExp]":case"[object String]":return c==u+"";case"[object Map]":var A=La;case"[object Set]":var N=1&p;if(A||(A=id),c.size!=u.size&&!N)return!1;var V=b.get(c);if(V)return V==u;p|=2,b.set(c,u);var H=Fl(A(c),A(u),p,y,g,b);return b.delete(c),H;case"[object Symbol]":if(Ia)return Ia.call(c)==Ia.call(u)}return!1},wl=function(c,u){for(var d=-1,p=u.length,y=c.length;++d<p;)c[y+d]=u[d];return c},qo=Array.isArray,Uh=function(c,u,d){var p=u(c);return qo(c)?p:wl(p,d(c))},Fa=function(c,u){for(var d=-1,p=c==null?0:c.length,y=0,g=[];++d<p;){var b=c[d];u(b,d,c)&&(g[y++]=b)}return g},_p=function(){return[]},bp=Object.prototype.propertyIsEnumerable,Ba=Object.getOwnPropertySymbols,Za=Ba?function(c){return c==null?[]:(c=Object(c),Fa(Ba(c),(function(u){return bp.call(c,u)})))}:_p,rf=function(c,u){for(var d=-1,p=Array(c);++d<c;)p[d]=u(d);return p},Mo=function(c){return c!=null&&typeof c=="object"},oa=function(c){return Mo(c)&&gn(c)=="[object Arguments]"},ad=Object.prototype,wp=ad.hasOwnProperty,of=ad.propertyIsEnumerable,ld=oa((function(){return arguments})())?oa:function(c){return Mo(c)&&wp.call(c,"callee")&&!of.call(c,"callee")},ns=ld,$a=r(48),bu=/^(?:0|[1-9]\d*)$/,Ja=function(c,u){var d=typeof c;return!!(u=u??9007199254740991)&&(d=="number"||d!="symbol"&&bu.test(c))&&c>-1&&c%1==0&&c<u},El=function(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=9007199254740991},vo={};vo["[object Float32Array]"]=vo["[object Float64Array]"]=vo["[object Int8Array]"]=vo["[object Int16Array]"]=vo["[object Int32Array]"]=vo["[object Uint8Array]"]=vo["[object Uint8ClampedArray]"]=vo["[object Uint16Array]"]=vo["[object Uint32Array]"]=!0,vo["[object Arguments]"]=vo["[object Array]"]=vo["[object ArrayBuffer]"]=vo["[object Boolean]"]=vo["[object DataView]"]=vo["[object Date]"]=vo["[object Error]"]=vo["[object Function]"]=vo["[object Map]"]=vo["[object Number]"]=vo["[object Object]"]=vo["[object RegExp]"]=vo["[object Set]"]=vo["[object String]"]=vo["[object WeakMap]"]=!1;var Ua=function(c){return Mo(c)&&El(c.length)&&!!vo[gn(c)]},Bl=function(c){return function(u){return c(u)}},ha=r(49),wu=ha.a&&ha.a.isTypedArray,Ks=wu?Bl(wu):Ua,$l=Object.prototype.hasOwnProperty,ui=function(c,u){var d=qo(c),p=!d&&ns(c),y=!d&&!p&&Object($a.a)(c),g=!d&&!p&&!y&&Ks(c),b=d||p||y||g,A=b?rf(c.length,String):[],N=A.length;for(var V in c)!u&&!$l.call(c,V)||b&&(V=="length"||y&&(V=="offset"||V=="parent")||g&&(V=="buffer"||V=="byteLength"||V=="byteOffset")||Ja(V,N))||A.push(V);return A},lc=Object.prototype,rs=function(c){var u=c&&c.constructor;return c===(typeof u=="function"&&u.prototype||lc)},xl=function(c,u){return function(d){return c(u(d))}},af=xl(Object.keys,Object),Vh=Object.prototype.hasOwnProperty,lf=function(c){if(!rs(c))return af(c);var u=[];for(var d in Object(c))Vh.call(c,d)&&d!="constructor"&&u.push(d);return u},Wi=function(c){return c!=null&&El(c.length)&&!wo(c)},sc=function(c){return Wi(c)?ui(c):lf(c)},os=function(c){return Uh(c,sc,Za)},Ki=Object.prototype.hasOwnProperty,sf=function(c,u,d,p,y,g){var b=1&d,A=os(c),N=A.length;if(N!=os(u).length&&!b)return!1;for(var V=N;V--;){var H=A[V];if(!(b?H in u:Ki.call(u,H)))return!1}var oe=g.get(c),ue=g.get(u);if(oe&&ue)return oe==u&&ue==c;var Ne=!0;g.set(c,u),g.set(u,c);for(var Ve=b;++V<N;){var qe=c[H=A[V]],Ot=u[H];if(p)var xt=b?p(Ot,qe,H,u,c,g):p(qe,Ot,H,c,u,g);if(!(xt===void 0?qe===Ot||y(qe,Ot,d,p,g):xt)){Ne=!1;break}Ve||(Ve=H=="constructor")}if(Ne&&!Ve){var Ft=c.constructor,vn=u.constructor;Ft==vn||!("constructor"in c)||!("constructor"in u)||typeof Ft=="function"&&Ft instanceof Ft&&typeof vn=="function"&&vn instanceof vn||(Ne=!1)}return g.delete(c),g.delete(u),Ne},ll=pa(En.a,"DataView"),Ol=pa(En.a,"Promise"),sd=pa(En.a,"Set"),Va=pa(En.a,"WeakMap"),Qa="[object Map]",ia="[object Promise]",sl="[object Set]",ka="[object WeakMap]",Ct="[object DataView]",un=fa(ll),fn=fa(qi),Gn=fa(Ol),Wr=fa(sd),go=fa(Va),ci=gn;(ll&&ci(new ll(new ArrayBuffer(1)))!=Ct||qi&&ci(new qi)!=Qa||Ol&&ci(Ol.resolve())!=ia||sd&&ci(new sd)!=sl||Va&&ci(new Va)!=ka)&&(ci=function(c){var u=gn(c),d=u=="[object Object]"?c.constructor:void 0,p=d?fa(d):"";if(p)switch(p){case un:return Ct;case fn:return Qa;case Gn:return ia;case Wr:return sl;case go:return ka}return u});var D=ci,L="[object Arguments]",Z="[object Array]",fe="[object Object]",Re=Object.prototype.hasOwnProperty,lt=function(c,u,d,p,y,g){var b=qo(c),A=qo(u),N=b?Z:D(c),V=A?Z:D(u),H=(N=N==L?fe:N)==fe,oe=(V=V==L?fe:V)==fe,ue=N==V;if(ue&&Object($a.a)(c)){if(!Object($a.a)(u))return!1;b=!0,H=!1}if(ue&&!H)return g||(g=new lr),b||Ks(c)?Fl(c,u,d,p,y,g):ra(c,u,N,d,p,y,g);if(!(1&d)){var Ne=H&&Re.call(c,"__wrapped__"),Ve=oe&&Re.call(u,"__wrapped__");if(Ne||Ve){var qe=Ne?c.value():c,Ot=Ve?u.value():u;return g||(g=new lr),y(qe,Ot,d,p,g)}}return!!ue&&(g||(g=new lr),sf(c,u,d,p,y,g))},It=function c(u,d,p,y,g){return u===d||(u==null||d==null||!Mo(u)&&!Mo(d)?u!=u&&d!=d:lt(u,d,p,y,c,g))},bn=function(c,u,d,p){var y=d.length,g=y;if(c==null)return!g;for(c=Object(c);y--;){var b=d[y];if(b[2]?b[1]!==c[b[0]]:!(b[0]in c))return!1}for(;++y<g;){var A=(b=d[y])[0],N=c[A],V=b[1];if(b[2]){if(N===void 0&&!(A in c))return!1}else{var H=new lr,oe;if(!(oe===void 0?It(V,N,3,p,H):oe))return!1}}return!0},Jn=function(c){return c==c&&!Fn(c)},no=function(c){for(var u=sc(c),d=u.length;d--;){var p=u[d],y=c[p];u[d]=[p,y,Jn(y)]}return u},$n=function(c,u){return function(d){return d!=null&&d[c]===u&&(u!==void 0||c in Object(d))}},Do=function(c){var u=no(c);return u.length==1&&u[0][2]?$n(u[0][0],u[0][1]):function(d){return d===c||bn(d,c,u)}},Kr=function(c){return typeof c=="symbol"||Mo(c)&&gn(c)=="[object Symbol]"},So=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ul=/^\w*$/,wi=function(c,u){if(qo(c))return!1;var d=typeof c;return!(d!="number"&&d!="symbol"&&d!="boolean"&&c!=null&&!Kr(c))||ul.test(c)||!So.test(c)||u!=null&&c in Object(u)};function el(c,u){if(typeof c!="function"||u!=null&&typeof u!="function")throw new TypeError("Expected a function");var d=function(){var p=arguments,y=u?u.apply(this,p):p[0],g=d.cache;if(g.has(y))return g.get(y);var b=c.apply(this,p);return d.cache=g.set(y,b)||g,b};return d.cache=new(el.Cache||nr),d}el.Cache=nr;var ks=el,Ps=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zs=/\\(\\)?/g,Eu=(function(c){var u=ks(c,(function(p){return d.size===500&&d.clear(),p})),d=u.cache;return u})((function(c){var u=[];return c.charCodeAt(0)===46&&u.push(""),c.replace(Ps,(function(d,p,y,g){u.push(y?g.replace(Zs,"$1"):p||d)})),u})),is=Zn?Zn.prototype:void 0,xu=is?is.toString:void 0,Zi=function c(u){if(typeof u=="string")return u;if(qo(u))return je(u,c)+"";if(Kr(u))return xu?xu.call(u):"";var d=u+"";return d=="0"&&1/u==-1/0?"-0":d},Js=function(c){return c==null?"":Zi(c)},Rs=function(c,u){return qo(c)?c:wi(c,u)?[c]:Eu(Js(c))},as=function(c){if(typeof c=="string"||Kr(c))return c;var u=c+"";return u=="0"&&1/c==-1/0?"-0":u},ls=function(c,u){for(var d=0,p=(u=Rs(u,c)).length;c!=null&&d<p;)c=c[as(u[d++])];return d&&d==p?c:void 0},uc=function(c,u,d){var p=c==null?void 0:ls(c,u);return p===void 0?d:p},fg=function(c,u){return c!=null&&u in Object(c)},pg=function(c,u,d){for(var p=-1,y=(u=Rs(u,c)).length,g=!1;++p<y;){var b=as(u[p]);if(!(g=c!=null&&d(c,b)))break;c=c[b]}return g||++p!=y?g:!!(y=c==null?0:c.length)&&El(y)&&Ja(b,y)&&(qo(c)||ns(c))},Wh=function(c,u){return c!=null&&pg(c,u,fg)},uf=function(c,u){return wi(c)&&Jn(u)?$n(as(c),u):function(d){var p=uc(d,c);return p===void 0&&p===u?Wh(d,c):It(u,p,3)}},cc=function(c){return c},Ep=function(c){return function(u){return u==null?void 0:u[c]}},hg=function(c){return function(u){return ls(u,c)}},dc=function(c){return wi(c)?Ep(as(c)):hg(c)},cf=function(c){return typeof c=="function"?c:c==null?cc:typeof c=="object"?qo(c)?uf(c[0],c[1]):Do(c):dc(c)},xp=(function(c){return function(u,d,p){for(var y=-1,g=Object(u),b=p(u),A=b.length;A--;){var N=b[++y];if(d(g[N],N,g)===!1)break}return u}})(),ji=(function(c,u){return function(d,p){if(d==null)return d;if(!Wi(d))return c(d,p);for(var y=d.length,g=-1,b=Object(d);++g<y&&p(b[g],g,b)!==!1;);return d}})((function(c,u){return c&&xp(c,u,sc)})),Wa=function(c,u){var d=-1,p=Wi(c)?Array(c.length):[];return ji(c,(function(y,g,b){p[++d]=u(y,g,b)})),p},Op=function(c,u){return(qo(c)?je:Wa)(c,cf(u))};Object(a.n)({isolateGlobalState:!0});var Sp=(function(){try{var c=pa(Object,"defineProperty");return c({},"",{}),c}catch{}})(),ud=function(c,u,d){u=="__proto__"&&Sp?Sp(c,u,{configurable:!0,enumerable:!0,value:d,writable:!0}):c[u]=d},dy=Object.prototype.hasOwnProperty,cd=function(c,u,d){var p=c[u];dy.call(c,u)&&q(p,d)&&(d!==void 0||u in c)||ud(c,u,d)},dd=function(c,u,d,p){var y=!d;d||(d={});for(var g=-1,b=u.length;++g<b;){var A=u[g],N=void 0;N===void 0&&(N=c[A]),y?ud(d,A,N):cd(d,A,N)}return d},df=function(c,u,d){switch(d.length){case 0:return c.call(u);case 1:return c.call(u,d[0]);case 2:return c.call(u,d[0],d[1]);case 3:return c.call(u,d[0],d[1],d[2])}return c.apply(u,d)},fc=Math.max,Ou=function(c,u,d){return u=fc(u===void 0?c.length-1:u,0),function(){for(var p=arguments,y=-1,g=fc(p.length-u,0),b=Array(g);++y<g;)b[y]=p[u+y];y=-1;for(var A=Array(u+1);++y<u;)A[y]=p[y];return A[u]=d(b),df(c,this,A)}},fd=function(c){return function(){return c}},ff=Sp?function(c,u){return Sp(c,"toString",{configurable:!0,enumerable:!1,value:fd(u),writable:!0})}:cc,Su=Date.now,fy=function(c){var u=0,d=0;return function(){var p=Su(),y=16-(p-d);if(d=p,y>0){if(++u>=800)return arguments[0]}else u=0;return c.apply(void 0,arguments)}},pf=fy(ff),py=function(c,u){return pf(Ou(c,u,cc),c+"")},hy=function(c,u,d){if(!Fn(d))return!1;var p=typeof u;return!!(p=="number"?Wi(d)&&Ja(u,d.length):p=="string"&&u in d)&&q(d[u],c)},vg=function(c){return py((function(u,d){var p=-1,y=d.length,g=y>1?d[y-1]:void 0,b=y>2?d[2]:void 0;for(g=c.length>3&&typeof g=="function"?(y--,g):void 0,b&&hy(d[0],d[1],b)&&(g=y<3?void 0:g,y=1),u=Object(u);++p<y;){var A=d[p];A&&c(u,A,p,g)}return u}))},Ap=Object.prototype.hasOwnProperty,Pa=vg((function(c,u){if(rs(u)||Wi(u))dd(u,sc(u),c);else for(var d in u)Ap.call(u,d)&&cd(c,d,u[d])})),gg=function(c,u,d,p){if(!Fn(c))return c;for(var y=-1,g=(u=Rs(u,c)).length,b=g-1,A=c;A!=null&&++y<g;){var N=as(u[y]),V=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return c;if(y!=b){var H=A[N];(V=void 0)==void 0&&(V=Fn(H)?H:Ja(u[y+1])?[]:{})}cd(A,N,V),A=A[N]}return c},he=function(c,u,d){for(var p=-1,y=u.length,g={};++p<y;){var b=u[p],A=ls(c,b);d(A,b)&&gg(g,Rs(b,c),A)}return g},pc=function(c,u){return he(c,u,(function(d,p){return Wh(c,p)}))},Qs=Zn?Zn.isConcatSpreadable:void 0,Ul=function(c){return qo(c)||ns(c)||!!(Qs&&c&&c[Qs])},mo=function(u,d,p,y,g){var b=-1,A=u.length;for(p||(p=Ul),g||(g=[]);++b<A;){var N=u[b];p(N)?wl(g,N):g[g.length]=N}return g},ba=function(c){return c!=null&&c.length?mo(c):[]},To,ss,eu,Sl,Mp,Tp,Gh,mg,tu,Li,pd,zh,nu,us,hf,Au,Al,Hh,Xh,cs=(function(c){return pf(Ou(c,void 0,ba),c+"")})((function(c,u){return c==null?{}:pc(c,u)}));function gi(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function yg(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Yh(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ii(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var Io,Ji,lo,ei,ur,ti,vf={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotation:!1,nodeSelectedOutline:!0,nodeTextEdit:!1,edgeTextEdit:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Ds=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotation","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],Cp=(ss=Ii((To=(function(){function c(p){(function(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),gi(this,"isSilentMode",ss,this),gi(this,"stopZoomGraph",eu,this),gi(this,"stopScrollGraph",Sl,this),gi(this,"stopMoveGraph",Mp,this),gi(this,"adjustEdge",Tp,this),gi(this,"adjustEdgeMiddle",Gh,this),gi(this,"adjustEdgeStartAndEnd",mg,this),gi(this,"adjustNodePosition",tu,this),gi(this,"hideAnchors",Li,this),gi(this,"allowRotation",pd,this),gi(this,"hoverOutline",zh,this),gi(this,"nodeSelectedOutline",nu,this),gi(this,"edgeSelectedOutline",us,this),gi(this,"nodeTextEdit",hf,this),gi(this,"edgeTextEdit",Au,this),gi(this,"nodeTextDraggable",Al,this),gi(this,"edgeTextDraggable",Hh,this),gi(this,"autoExpand",Xh,this),Yh(this,"multipleSelectKey",""),Yh(this,"defaultConfig",{}),Pa(this,this.getConfigDetail(p))}var u,d;return u=c,(d=[{key:"updateEditConfig",value:function(p){var y=this.getConfigDetail(p);Pa(this,y)}},{key:"getConfigDetail",value:function(p){var y=p.isSilentMode,g=p.textEdit,b={};if(y===!1&&Pa(b,this.defaultConfig),y===!0&&y!==this.isSilentMode){var A=cs(vf,Ds);this.defaultConfig={stopZoomGraph:this.stopZoomGraph,stopScrollGraph:this.stopScrollGraph,stopMoveGraph:this.stopMoveGraph,adjustEdge:this.adjustEdge,adjustEdgeMiddle:this.adjustEdgeMiddle,adjustEdgeStartAndEnd:this.adjustEdgeStartAndEnd,adjustNodePosition:this.adjustNodePosition,hideAnchors:this.hideAnchors,allowRotation:this.allowRotation,hoverOutline:this.hoverOutline,nodeSelectedOutline:this.nodeSelectedOutline,edgeSelectedOutline:this.edgeSelectedOutline,nodeTextEdit:this.nodeTextEdit,edgeTextEdit:this.edgeTextEdit,nodeTextDraggable:this.nodeTextDraggable,edgeTextDraggable:this.edgeTextDraggable,autoExpand:this.autoExpand},Pa(b,A)}g===!1&&Pa(b,{nodeTextEdit:!1,edgeTextEdit:!1});var N=cs(p,Ds);return Pa(b,N)}},{key:"getConfig",value:function(){return cs(this,Ds)}}])&&yg(u.prototype,d),c})()).prototype,"isSilentMode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),eu=Ii(To.prototype,"stopZoomGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sl=Ii(To.prototype,"stopScrollGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Mp=Ii(To.prototype,"stopMoveGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Tp=Ii(To.prototype,"adjustEdge",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Gh=Ii(To.prototype,"adjustEdgeMiddle",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),mg=Ii(To.prototype,"adjustEdgeStartAndEnd",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),tu=Ii(To.prototype,"adjustNodePosition",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Li=Ii(To.prototype,"hideAnchors",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pd=Ii(To.prototype,"allowRotation",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zh=Ii(To.prototype,"hoverOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),nu=Ii(To.prototype,"nodeSelectedOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),us=Ii(To.prototype,"edgeSelectedOutline",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),hf=Ii(To.prototype,"nodeTextEdit",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Au=Ii(To.prototype,"edgeTextEdit",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Al=Ii(To.prototype,"nodeTextDraggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Hh=Ii(To.prototype,"edgeTextDraggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Xh=Ii(To.prototype,"autoExpand",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ii(To.prototype,"updateEditConfig",[a.k],Object.getOwnPropertyDescriptor(To.prototype,"updateEditConfig"),To.prototype),To);r(65),r(66),(function(c){c[c.DEFAULT=1]="DEFAULT",c[c.TEXT_EDIT=2]="TEXT_EDIT",c[c.SHOW_MENU=3]="SHOW_MENU",c[c.ALLOW_CONNECT=4]="ALLOW_CONNECT",c[c.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(Io||(Io={})),(function(c){c.KEY="logic-flow",c.NODE_NAME="lf-node",c.EDGE_NAME="lf-edge"})(Ji||(Ji={})),(function(c){c.NODE="node",c.CIRCLE_NODE="circle-node",c.POLYGON_NODE="polygon-node",c.RECT_NODE="rect-node",c.TEXT_NODE="text-node",c.ELLIPSE_NODE="ellipse-node",c.DIAMOND_NODE="diamond-node",c.HTML_NODE="html-node",c.EDGE="edge",c.LINE_EDGE="line-edge",c.POLYLINE_EDGE="polyline-edge",c.BEZIER_EDGE="bezier-edge",c.GRAPH="graph"})(lo||(lo={})),(function(c){c.NODE="node",c.EDGE="edge",c.GRAPH="graph"})(ei||(ei={})),(function(c){c.ELEMENT_CLICK="element:click",c.NODE_CLICK="node:click",c.NODE_DBCLICK="node:dbclick",c.NODE_DELETE="node:delete",c.NODE_ADD="node:add",c.NODE_GROUP_COPY="node:group-copy-add",c.NODE_DND_ADD="node:dnd-add",c.NODE_DND_DRAG="node:dnd-drag",c.NODE_MOUSEDOWN="node:mousedown",c.NODE_DRAGSTART="node:dragstart",c.NODE_DRAG="node:drag",c.NODE_DROP="node:drop",c.NODE_MOUSEUP="node:mouseup",c.NODE_MOUSEMOVE="node:mousemove",c.NODE_MOUSEENTER="node:mouseenter",c.NODE_MOUSELEAVE="node:mouseleave",c.NODE_CONTEXTMENU="node:contextmenu",c.NODE_ROTATE="node:rotate",c.EDGE_DELETE="edge:delete",c.EDGE_ADD="edge:add",c.EDGE_CLICK="edge:click",c.EDGE_DBCLICK="edge:dbclick",c.EDGE_MOUSEENTER="edge:mouseenter",c.EDGE_MOUSELEAVE="edge:mouseleave",c.EDGE_CONTEXTMENU="edge:contextmenu",c.EDGE_ADJUST="edge:adjust",c.EDGE_EXCHANGE_NODE="edge:exchange-node",c.ANCHOR_DRAGSTART="anchor:dragstart",c.ANCHOR_DRAG="anchor:drag",c.ANCHOR_DROP="anchor:drop",c.ANCHOR_DRAGEND="anchor:dragend",c.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",c.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",c.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",c.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",c.ADJUST_POINT_DRAG="adjustPoint:drag",c.ADJUST_POINT_DROP="adjustPoint:drop",c.ADJUST_POINT_DRAGEND="adjustPoint:dragend",c.BLANK_MOUSEDOWN="blank:mousedown",c.BLANK_DRAGSTART="blank:dragstart",c.BLANK_DRAG="blank:drag",c.BLANK_DROP="blank:drop",c.BLANK_MOUSEMOVE="blank:mousemove",c.BLANK_MOUSEUP="blank:mouseup",c.BLANK_CLICK="blank:click",c.BLANK_CONTEXTMENU="blank:contextmenu",c.SELECTION_MOUSEDOWN="selection:mousedown",c.SELECTION_DRAGSTART="selection:dragstart",c.SELECTION_DRAG="selection:drag",c.SELECTION_DROP="selection:drop",c.SELECTION_MOUSEMOVE="selection:mousemove",c.SELECTION_MOUSEUP="selection:mouseup",c.SELECTION_CONTEXTMENU="selection:contextmenu",c.CONNECTION_NOT_ALLOWED="connection:not-allowed",c.HISTORY_CHANGE="history:change",c.TEXT_UPDATE="text:update",c.GRAPH_TRANSFORM="graph:transform",c.GRAPH_RENDERED="graph:rendered"})(ur||(ur={})),(function(c){c.HORIZONTAL="horizontal",c.VERTICAL="vertical"})(ti||(ti={}));var Ei,Mi,qh,Kh,gf,Ga,Np,hd,Vl;function Mu(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ru(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ru(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ru(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function Wl(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function _g(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function js(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ml(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}(function(c){c[c.DEFAULT=0]="DEFAULT",c[c.INCREASE=1]="INCREASE"})(Ei||(Ei={}));var Zh={false:[-1/0,-1/0,1/0,1/0],true:[0,0,0,0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},Jh=(Mi=(function(){function c(p,y){(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,c),js(this,"MINI_SCALE_SIZE",.2),js(this,"MAX_SCALE_SIZE",16),Wl(this,"SCALE_X",qh,this),Wl(this,"SKEW_Y",Kh,this),Wl(this,"SKEW_X",gf,this),Wl(this,"SCALE_Y",Ga,this),Wl(this,"TRANSLATE_X",Np,this),Wl(this,"TRANSLATE_Y",hd,this),Wl(this,"ZOOM_SIZE",Vl,this),js(this,"eventCenter",void 0),js(this,"translateLimitMinX",void 0),js(this,"translateLimitMinY",void 0),js(this,"translateLimitMaxX",void 0),js(this,"translateLimitMaxY",void 0),this.eventCenter=p;var g=y.stopMoveGraph,b=g!==void 0&&g;this.updateTranslateLimits(b)}var u,d;return u=c,d=[{key:"setZoomMiniSize",value:function(p){this.MINI_SCALE_SIZE=p}},{key:"setZoomMaxSize",value:function(p){this.MAX_SCALE_SIZE=p}},{key:"HtmlPointToCanvasPoint",value:function(p){var y=Mu(p,2),g=y[0],b=y[1];return[(g-this.TRANSLATE_X)/this.SCALE_X,(b-this.TRANSLATE_Y)/this.SCALE_Y]}},{key:"CanvasPointToHtmlPoint",value:function(p){var y=Mu(p,2),g=y[0],b=y[1];return[g*this.SCALE_X+this.TRANSLATE_X,b*this.SCALE_Y+this.TRANSLATE_Y]}},{key:"moveCanvasPointByHtml",value:function(p,y,g){var b=Mu(p,2),A=b[0],N=b[1];return[A+y/this.SCALE_X,N+g/this.SCALE_Y]}},{key:"fixDeltaXY",value:function(p,y){return[p/this.SCALE_X,y/this.SCALE_Y]}},{key:"getTransformStyle",value:function(){var p=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(p,")")}}},{key:"zoom",value:function(){var p=arguments.length>0&&arguments[0]!==void 0&&arguments[0],y=arguments.length>1?arguments[1]:void 0,g=this.SCALE_X,b=this.SCALE_Y;return p===!0?(g+=this.ZOOM_SIZE,b+=this.ZOOM_SIZE):p===!1?(g-=this.ZOOM_SIZE,b-=this.ZOOM_SIZE):typeof p=="number"&&(g=p,b=p),g<this.MINI_SCALE_SIZE||g>this.MAX_SCALE_SIZE||(y&&(this.TRANSLATE_X-=(g-this.SCALE_X)*y[0],this.TRANSLATE_Y-=(b-this.SCALE_Y)*y[1]),this.SCALE_X=g,this.SCALE_Y=b,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")}},{key:"emitGraphTransform",value:function(p){this.eventCenter.emit(ur.GRAPH_TRANSFORM,{type:p,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})}},{key:"resetZoom",value:function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")}},{key:"translate",value:function(p,y){this.TRANSLATE_X+p<=this.translateLimitMaxX&&this.TRANSLATE_X+p>=this.translateLimitMinX&&(this.TRANSLATE_X+=p),this.TRANSLATE_Y+y<=this.translateLimitMaxY&&this.TRANSLATE_Y+y>=this.translateLimitMinY&&(this.TRANSLATE_Y+=y),this.emitGraphTransform("translate")}},{key:"focusOn",value:function(p,y,g,b){var A=Mu(this.CanvasPointToHtmlPoint([p,y]),2),N=g/2-A[0],V=b/2-A[1];this.TRANSLATE_X+=N,this.TRANSLATE_Y+=V,this.emitGraphTransform("focusOn")}},{key:"updateTranslateLimits",value:function(p){var y=Mu(Array.isArray(p)&&p.length===4?p:Zh[p.toString()],4);this.translateLimitMinX=y[0],this.translateLimitMinY=y[1],this.translateLimitMaxX=y[2],this.translateLimitMaxY=y[3]}}],d&&_g(u.prototype,d),c})(),qh=Ml(Mi.prototype,"SCALE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Kh=Ml(Mi.prototype,"SKEW_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),gf=Ml(Mi.prototype,"SKEW_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ga=Ml(Mi.prototype,"SCALE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Np=Ml(Mi.prototype,"TRANSLATE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),hd=Ml(Mi.prototype,"TRANSLATE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Vl=Ml(Mi.prototype,"ZOOM_SIZE",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return .04}}),Ml(Mi.prototype,"zoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"zoom"),Mi.prototype),Ml(Mi.prototype,"resetZoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"resetZoom"),Mi.prototype),Ml(Mi.prototype,"translate",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"translate"),Mi.prototype),Ml(Mi.prototype,"focusOn",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"focusOn"),Mi.prototype),Mi),kp=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p&&u(c[d],d,c)!==!1;);return c},bg=function(c){var u=[];if(c!=null)for(var d in Object(c))u.push(d);return u},wg=Object.prototype.hasOwnProperty,Eg=function(c){if(!Fn(c))return bg(c);var u=rs(c),d=[];for(var p in c)(p!="constructor"||!u&&wg.call(c,p))&&d.push(p);return d},Pp=function(c){return Wi(c)?ui(c,!0):Eg(c)},Qh=r(107),ev=function(c,u){var d=-1,p=c.length;for(u||(u=Array(p));++d<p;)u[d]=c[d];return u},mf=xl(Object.getPrototypeOf,Object),uo=Object.prototype.hasOwnProperty,vy=function(c){var u=c.length,d=new c.constructor(u);return u&&typeof c[0]=="string"&&uo.call(c,"index")&&(d.index=c.index,d.input=c.input),d},tv=function(c){var u=new c.constructor(c.byteLength);return new Ro(u).set(new Ro(c)),u},hc=function(c,u){var d=tv(c.buffer);return new c.constructor(d,c.byteOffset,c.byteLength)},yf=/\w*$/,gy=function(c){var u=new c.constructor(c.source,yf.exec(c));return u.lastIndex=c.lastIndex,u},xg=Zn?Zn.prototype:void 0,Tl=xg?xg.valueOf:void 0,my=function(c){return Tl?Object(Tl.call(c)):{}},_f=function(c,u){var d=u?tv(c.buffer):c.buffer;return new c.constructor(d,c.byteOffset,c.length)},Rp=function(c,u,d){var p=c.constructor;switch(u){case"[object ArrayBuffer]":return tv(c);case"[object Boolean]":case"[object Date]":return new p(+c);case"[object DataView]":return hc(c);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return _f(c,d);case"[object Map]":case"[object Set]":return new p;case"[object Number]":case"[object String]":return new p(c);case"[object RegExp]":return gy(c);case"[object Symbol]":return my(c)}},nv=Object.create,Og=(function(){function c(){}return function(u){if(!Fn(u))return{};if(nv)return nv(u);c.prototype=u;var d=new c;return c.prototype=void 0,d}})(),cl=function(c){return typeof c.constructor!="function"||rs(c)?{}:Og(mf(c))},Tu=function(c){return Mo(c)&&D(c)=="[object Map]"},Dp=ha.a&&ha.a.isMap,vc=Dp?Bl(Dp):Tu,jp=function(c){return Mo(c)&&D(c)=="[object Set]"},rv=ha.a&&ha.a.isSet,Lp=rv?Bl(rv):jp,bf="[object Arguments]",Ip="[object Function]",Fp="[object Object]",jo={};jo[bf]=jo["[object Array]"]=jo["[object ArrayBuffer]"]=jo["[object DataView]"]=jo["[object Boolean]"]=jo["[object Date]"]=jo["[object Float32Array]"]=jo["[object Float64Array]"]=jo["[object Int8Array]"]=jo["[object Int16Array]"]=jo["[object Int32Array]"]=jo["[object Map]"]=jo["[object Number]"]=jo["[object Object]"]=jo["[object RegExp]"]=jo["[object Set]"]=jo["[object String]"]=jo["[object Symbol]"]=jo["[object Uint8Array]"]=jo["[object Uint8ClampedArray]"]=jo["[object Uint16Array]"]=jo["[object Uint32Array]"]=!0,jo["[object Error]"]=jo[Ip]=jo["[object WeakMap]"]=!1;var yy=function c(u,d,p,y,g,b){var A,N=1&d;if(A!==void 0)return A;if(!Fn(u))return u;var V=qo(u);if(V)A=vy(u);else{var H=D(u),oe=H==Ip||H=="[object GeneratorFunction]";if(Object($a.a)(u))return Object(Qh.a)(u,N);if(H==Fp||H==bf||oe&&!g)A=oe?{}:cl(u);else{if(!jo[H])return g?u:{};A=Rp(u,H,N)}}b||(b=new lr);var ue=b.get(u);if(ue)return ue;b.set(u,A),Lp(u)?u.forEach((function(Ve){A.add(c(Ve,d,p,Ve,u,b))})):vc(u)&&u.forEach((function(Ve,qe){A.set(qe,c(Ve,d,p,qe,u,b))}));var Ne=V?void 0:os(u);return kp(Ne||u,(function(Ve,qe){Ne&&(Ve=u[qe=Ve]),cd(A,qe,c(Ve,d,p,qe,u,b))})),A},Uo=function(c){return yy(c,5)},Bp=function(c,u,d){(d!==void 0&&!q(c[u],d)||d===void 0&&!(u in c))&&ud(c,u,d)},Sg=function(c){return Mo(c)&&Wi(c)},gc=Function.prototype,Ag=Object.prototype,vd=gc.toString,Mg=Ag.hasOwnProperty,mc=vd.call(Object),va=function(c){if(!Mo(c)||gn(c)!="[object Object]")return!1;var u=mf(c);if(u===null)return!0;var d=Mg.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&vd.call(d)==mc},ds=function(c,u){if((u!=="constructor"||typeof c[u]!="function")&&u!="__proto__")return c[u]},ou=function(c){return dd(c,Pp(c))},yc=function(c,u,d,p,y,g,b){var A=ds(c,d),N=ds(u,d),V=b.get(N);if(V)Bp(c,d,V);else{var H=void 0,oe=H===void 0;if(oe){var ue=qo(N),Ne=!ue&&Object($a.a)(N),Ve=!ue&&!Ne&&Ks(N);H=N,ue||Ne||Ve?qo(A)?H=A:Sg(A)?H=ev(A):Ne?(oe=!1,H=Object(Qh.a)(N,!0)):Ve?(oe=!1,H=_f(N,!0)):H=[]:va(N)||ns(N)?(H=A,ns(A)?H=ou(A):Fn(A)&&!wo(A)||(H=cl(N))):oe=!1}oe&&(b.set(N,H),y(H,N,p,g,b),b.delete(N)),Bp(c,d,H)}},_c=function c(u,d,p,y,g){u!==d&&xp(d,(function(b,A){if(g||(g=new lr),Fn(b))yc(u,d,A,p,c,y,g);else{var N=void 0;N===void 0&&(N=b),Bp(u,A,N)}}),Pp)},bc=vg((function(c,u,d){_c(c,u,d)})),$p={baseNode:{fill:"#FFFFFF",stroke:"#000000",strokeWidth:2},baseEdge:{stroke:"#000000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000000",fill:"#FFFFFF",r:4,hover:{fill:"#949494",fillOpacity:.5,stroke:"#949494",r:10}},nodeText:{color:"#000000",overflowMode:"default",lineHeight:1.2,fontSize:12},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#FFFFFF"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",stroke:"#949494",fillOpacity:1}},arrow:{offset:10,verticalLength:5},anchorLine:{stroke:"#000000",strokeWidth:2,strokeDasharray:"3,2"},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#FFFFFF",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10 10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5}},iu=function(c){var u=Uo($p);return c&&(u=bc(u,c)),u};r(82),r(166);function wc(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}var Up=(function(){function c(){var p,y,g;(function(b,A){if(!(b instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),g={},(y="_events")in(p=this)?Object.defineProperty(p,y,{value:g,enumerable:!0,configurable:!0,writable:!0}):p[y]=g}var u,d;return u=c,(d=[{key:"on",value:function(p,y,g){var b=this;return p==null||p.split(",").forEach((function(A){A=A.trim(),b._events[A]||(b._events[A]=[]),b._events[A].push({callback:y,once:!!g})})),this}},{key:"once",value:function(p,y){var g=this;p==null||p.split(",").forEach((function(b){return b=b.trim(),g.on(b,y,!0)}))}},{key:"emit",value:function(p,y){var g=this;p==null||p.split(",").forEach((function(b){var A=g._events[b]||[],N=g._events["*"]||[],V=function(H){for(var oe=H.length,ue=0;ue<oe;ue++)if(H[ue]){var Ne=H[ue],Ve=Ne.callback;Ne.once&&(H.splice(ue,1),H.length===0&&delete g._events[b],oe--,ue--),Ve.apply(g,[y])}};V(A),V(N)}))}},{key:"off",value:function(p,y){var g=this;return p||(this._events={}),p.split(",").forEach((function(b){if(y){for(var A=g._events[b]||[],N=A.length,V=0;V<N;V++)A[V].callback===y&&(A.splice(V,1),N--,V--);A.length===0&&delete g._events[b]}else delete g._events[b]})),this}},{key:"getEvents",value:function(){return this._events}}])&&wc(u.prototype,d),c})();function fs(c,u){return u*Math.round(c/u)||c}function wf(c,u){return c%u}function Ef(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return gd(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return gd(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function gd(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var md=function(c,u,d){var p=Ef(c,2),y=p[0],g=p[1],b=Ef(u,2),A=b[0],N=b[1],V=Ef(d,2),H=V[0],oe=V[1];return y>A&&y<H&&g>N&&g<oe},yd=function(c,u){var d=!1;switch(u.multipleSelectKey){case"meta":d=c.metaKey;break;case"alt":d=c.altKey;break;case"shift":d=c.shiftKey;break;case"ctrl":d=c.ctrlKey;break;default:d=!1}return d};r(167),r(126),r(83),r(29),r(12),r(13),r(14),r(47);var Vp=function(c){return function(u,d,p){var y=Object(u);if(!Wi(u)){var g=cf(d);u=sc(u),d=function(A){return g(y[A],A,y)}}var b=c(u,d,p);return b>-1?y[g?u[b]:b]:void 0}},_d=function(c,u,d,p){for(var y=c.length,g=d+-1;++g<y;)if(u(c[g],g,c))return g;return-1},ov=/\s/,Wp=function(c){for(var u=c.length;u--&&ov.test(c.charAt(u)););return u},Tg=/^\s+/,iv=function(c){return c&&c.slice(0,Wp(c)+1).replace(Tg,"")},ps=/^[-+]0x[0-9a-f]+$/i,av=/^0b[01]+$/i,lv=/^0o[0-7]+$/i,sv=parseInt,bd=function(c){if(typeof c=="number")return c;if(Kr(c))return NaN;if(Fn(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=Fn(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=iv(c);var d=av.test(c);return d||lv.test(c)?sv(c.slice(2),d?2:8):ps.test(c)?NaN:+c},Ls=1/0,xf=function(c){return c?(c=bd(c))===Ls||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0},Gp=function(c){var u=xf(c),d=u%1;return u==u?d?u-d:u:0},zp=Math.max,Cu,Nu=Vp((function(c,u,d){var p=c==null?0:c.length;if(!p)return-1;var y=d==null?0:Gp(d);return y<0&&(y=zp(p+y,0)),_d(c,cf(u),y)})),Rr=new Uint8Array(16);function wd(){if(!Cu&&!(Cu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Cu(Rr)}for(var Of=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,hs=function(c){return typeof c=="string"&&Of.test(c)},aa=[],Ec=0;Ec<256;++Ec)aa.push((Ec+256).toString(16).substr(1));var Ti=function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=(aa[c[u+0]]+aa[c[u+1]]+aa[c[u+2]]+aa[c[u+3]]+"-"+aa[c[u+4]]+aa[c[u+5]]+"-"+aa[c[u+6]]+aa[c[u+7]]+"-"+aa[c[u+8]]+aa[c[u+9]]+"-"+aa[c[u+10]]+aa[c[u+11]]+aa[c[u+12]]+aa[c[u+13]]+aa[c[u+14]]+aa[c[u+15]]).toLowerCase();if(!hs(d))throw TypeError("Stringified UUID is invalid");return d},ku=function(c,u,d){var p=(c=c||{}).random||(c.rng||wd)();return p[6]=15&p[6]|64,p[8]=63&p[8]|128,Ti(p)},tl=function(){return ku()},Sf=function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",d=c.nodes.reduce((function(p,y){return p[y.id]=u+ku(),y.id=p[y.id],p}),{});return c.edges.forEach((function(p){p.id=u+ku(),p.sourceNodeId=d[p.sourceNodeId],p.targetNodeId=d[p.targetNodeId]})),c},Ra=(r(105),r(127),r(207),function(c,u,d){var p=c.x,y=c.y,g=u.x,b=u.y,A=d.x,N=d.y,V=(N-b)/(A-g),H=b-V*g;return p>=g&&p<=A&&y>=b&&y<=N&&Math.abs(y-V*p+H)<Number.EPSILON});function Fi(c){return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Fi(c)}function Is(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Fs(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?Is(Object(d),!0).forEach((function(p){Hp(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):Is(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Hp(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Qt,xc,Af,Mf,Pu,Oc,Xp,uv,Sc,Tf,Yp,cv,Bs,dv,vs,Ru,qp,Cg,Ng,kg,fv,Kp=function(c){return c.anchors},Cf=function(c,u){for(var d,p=u.nodes,y=p.length-1;y>=0;y--){var g=p[y];if(_y(c,g)){var b=g.getTargetAnchor(c);if(b){var A={node:g,anchorIndex:b.index,anchor:b.anchor};d&&!Pg(g,d.node,u)||(d=A)}}}return d},Pg=function(c,u,d){return c.zIndex>u.zIndex||d.nodesMap[c.id].index>d.nodesMap[u.id].index},gs=function(c,u,d,p){return Math.hypot(c-d,u-p)},Du=function(c,u){var d=!1,p=mi(u);return c.x>=p.minX-0&&c.x<=p.maxX+0&&c.y>=p.minY-0&&c.y<=p.maxY+0&&(d=!0),d},_y=function(c,u){var d=!1,p=mi(u);return c.x>=p.minX-5&&c.x<=p.maxX+5&&c.y>=p.minY-5&&c.y<=p.maxY+5&&(d=!0),d},mi=function(c){var u=c.x,d=c.y,p=c.width,y=c.height;return{minX:u-p/2,minY:d-y/2,maxX:u+p/2,maxY:d+y/2,x:u,y:d,width:p,height:y,centerX:u,centerY:d}},Nf=function(c,u,d){var p,y=(function(b){var A=b,N=A.x,V=A.y,H=A.width,oe=A.height,ue=A.radius;return[{x:N-H/2+ue,y:V-oe/2+ue,r:ue},{x:N+H/2-ue,y:V-oe/2+ue,r:ue},{x:N-H/2+ue,y:V+oe/2-ue,r:ue},{x:N+H/2-ue,y:V+oe/2-ue,r:ue}]})(d),g=Number.MAX_SAFE_INTEGER;return y.forEach((function(b){var A=gs(c.x,c.y,b.x,b.y);A<g&&(g=A,p=b)})),Ac(c,u,p)},Ac=function(c,u,d){var p,y=d,g=y.x,b=y.y,A=y.r;if(u===ti.HORIZONTAL){var N=g-Math.sqrt(A*A-(c.y-b)*(c.y-b)),V=g+Math.sqrt(A*A-(c.y-b)*(c.y-b));p={x:Math.abs(N-c.x)<Math.abs(V-c.x)?N:V,y:c.y}}else if(u===ti.VERTICAL){var H=b-Math.sqrt(A*A-(c.x-g)*(c.x-g)),oe=b+Math.sqrt(A*A-(c.x-g)*(c.x-g)),ue=Math.abs(H-c.y)<Math.abs(oe-c.y)?H:oe;p={x:c.x,y:ue}}return p},kf=function(c,u){var d=u,p=!1,y=d.x-d.width/2+d.radius,g=d.x+d.width/2-d.radius,b=d.y-d.height/2+d.radius,A=d.y+d.height/2-d.radius,N=d.x,V=d.y,H=d.width,oe=d.height;return c.y===V+oe/2||c.y===V-oe/2?p=c.x>y&&c.x<g:c.x!==N+H/2&&c.x!==N-H/2||(p=c.y>b&&c.y<A),p},Ed=function(c,u,d){var p,y=d,g=y.x,b=y.y,A=y.rx,N=y.ry;if(u===ti.HORIZONTAL){var V=g-Math.sqrt(A*A-(c.y-b)*(c.y-b)*A*A/(N*N)),H=g+Math.sqrt(A*A-(c.y-b)*(c.y-b)*A*A/(N*N));p={x:Math.abs(V-c.x)<Math.abs(H-c.x)?V:H,y:c.y}}else if(u===ti.VERTICAL){var oe=b-Math.sqrt(N*N-(c.x-g)*(c.x-g)*N*N/(A*A)),ue=b+Math.sqrt(N*N-(c.x-g)*(c.x-g)*N*N/(A*A)),Ne=Math.abs(oe-c.y)<Math.abs(ue-c.y)?oe:ue;p={x:c.x,y:Ne}}return p},Pf=function(c,u,d){for(var p,y=d.pointsPosition,g=Number.MAX_SAFE_INTEGER,b=[],A=0;A<y.length;A++)b.push({start:y[A],end:y[(A+1)%y.length]});return b.forEach((function(N){var V=N.start,H=N.end,oe=V,ue=H;V.x>H.x&&(oe=H,ue=V);var Ne={x:c.x,y:c.y};if(oe.x===ue.x&&u===ti.HORIZONTAL&&(Ne={x:oe.x,y:c.y}),oe.y===ue.y&&u===ti.VERTICAL&&(Ne={x:c.x,y:oe.y}),oe.x!==ue.x&&oe.y!==ue.y){var Ve=(ue.y-oe.y)/(ue.x-oe.x),qe=(oe.x*ue.y-ue.x*oe.y)/(oe.x-ue.x);u===ti.HORIZONTAL?Ne={x:(c.y-qe)/Ve,y:c.y}:u===ti.VERTICAL&&(Ne={x:c.x,y:Ve*c.x+qe})}if(Ra(Ne,V,H)){var Ot=gs(Ne.x,Ne.y,c.x,c.y);Ot<g&&(g=Ot,p=Ne)}})),p},Rf=function(c,u,d,p){var y=c.x,g=c.y;return u.x>c.x?y=c.x+d/2:u.x<c.x&&(y=c.x-d/2),u.y>c.y?g=c.y+p/2:u.y<c.y&&(g=c.y-p/2),{x:y,y:g}},Df=function(c){var u=c.rows,d=c.style,p=c.rowsLength,y=c.className,g=document.createElement("div");g.style.fontSize=d.fontSize,g.style.width=d.width,g.className=y,g.style.lineHeight=d.lineHeight,g.style.padding=d.padding,d.fontFamily&&(g.style.fontFamily=d.fontFamily),p>1?u.forEach((function(A){var N=document.createElement("div");N.textContent=A,g.appendChild(N)})):g.textContent=u,document.body.appendChild(g);var b=g.clientHeight;return document.body.removeChild(g),b},Mc=function(c){var u=c.rows,d=c.rowsLength,p=c.fontSize,y=0;return u&&u.forEach((function(g){var b=Pi(g);y=b>y?b:y})),{width:Math.ceil(y/2)*p+p/4,height:d*(p+2)+p/4}},au=function(c){return Fi(c)!=="object"?{isAllPass:!!c,msg:c?"":"不允许连接"}:c},ga=function(c){try{return JSON.parse(JSON.stringify(c))}catch{return c}},Zp=1e3,jf=999,Tc=function(){return++Zp};function xd(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function wa(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?xd(Object(d),!0).forEach((function(p){za(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):xd(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function xi(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function Lf(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function za(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function wr(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var Jp=(Qt=(function(){function c(p,y){(function(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),za(this,"id",""),xi(this,"type",xc,this),xi(this,"sourceNodeId",Af,this),xi(this,"targetNodeId",Mf,this),xi(this,"startPoint",Pu,this),xi(this,"endPoint",Oc,this),xi(this,"text",Xp,this),xi(this,"properties",uv,this),xi(this,"points",Sc,this),xi(this,"pointsList",Tf,this),xi(this,"isSelected",Yp,this),xi(this,"isHovered",cv,this),xi(this,"isHitable",Bs,this),xi(this,"draggable",dv,this),xi(this,"visible",vs,this),za(this,"virtual",!1),xi(this,"isAnimation",Ru,this),xi(this,"isShowAdjustPoint",qp,this),za(this,"graphModel",void 0),xi(this,"zIndex",Cg,this),za(this,"BaseType",ei.EDGE),za(this,"modelType",lo.EDGE),xi(this,"state",Ng,this),za(this,"additionStateData",void 0),za(this,"sourceAnchorId",""),za(this,"targetAnchorId",""),za(this,"menu",void 0),za(this,"customTextPosition",!1),xi(this,"style",kg,this),xi(this,"arrowConfig",fv,this),this.graphModel=y,this.initEdgeData(p),this.setAttributes()}var u,d;return u=c,d=[{key:"initEdgeData",value:function(p){if(p.properties||(p.properties={}),!p.id){var y=this.graphModel.idGenerator,g=y&&y(p.type),b=this.createId();p.id=b||g||tl()}this.arrowConfig.markerEnd="url(#marker-end-".concat(p.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(p.id,")");var A=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=A,Pa(this,cr(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Tc()),this.setAnchors(),this.initPoints(),this.formatText(p)}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"getEdgeStyle",value:function(){return wa(wa({},this.graphModel.theme.baseEdge),this.style)}},{key:"getAdjustPointStyle",value:function(){return wa({},this.graphModel.theme.edgeAdjust)}},{key:"getTextStyle",value:function(){var p=this.graphModel.theme.edgeText;return Uo(p)}},{key:"getEdgeAnimationStyle",value:function(){var p=this.graphModel.theme.edgeAnimation;return Uo(p)}},{key:"getArrowStyle",value:function(){var p=this.getEdgeStyle(),y=this.getEdgeAnimationStyle(),g=this.graphModel.theme.arrow,b=this.isAnimation?y.stroke:p.stroke;return wa(wa({},p),{},{fill:b,stroke:b},g)}},{key:"getOutlineStyle",value:function(){var p=this.graphModel.theme.outline;return Uo(p)}},{key:"getTextPosition",value:function(){return{x:0,y:0}}},{key:"sourceNode",get:function(){var p,y;return(p=this.graphModel)===null||p===void 0||(y=p.nodesMap[this.sourceNodeId])===null||y===void 0?void 0:y.model}},{key:"targetNode",get:function(){var p,y;return(p=this.graphModel)===null||p===void 0||(y=p.nodesMap[this.targetNodeId])===null||y===void 0?void 0:y.model}},{key:"textPosition",get:function(){return this.getTextPosition()}},{key:"getBeginAnchor",value:function(p,y,g){var b,A,N=Kp(p);return g&&(b=Nu(N,(function(V){return V.id===g})))||N.forEach((function(V){var H=Xr(V,y);(A===void 0||H<A)&&(A=H,b=V)})),b}},{key:"getEndAnchor",value:function(p,y){var g,b,A=this,N=Kp(p);return y&&(g=Nu(N,(function(V){return V.id===y})))||N.forEach((function(V){var H=Xr(V,A.startPoint);(b===void 0||H<b)&&(b=H,g=V)})),g}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getData",value:function(){var p=this.text,y=p.x,g=p.y,b=p.value,A={id:this.id,type:this.type,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Object.assign({},this.startPoint),endPoint:Object.assign({},this.endPoint),properties:Object(a.I)(this.properties)};return b&&(A.text={x:y,y:g,value:b}),this.graphModel.overlapMode===Ei.INCREASE&&(A.zIndex=this.zIndex),A}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"setProperty",value:function(p,y){this.properties[p]=ga(y),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=wa(wa({},Object(a.I)(this.properties)),ga(p)),this.setAttributes()}},{key:"changeEdgeId",value:function(p){var y=this.arrowConfig,g=y.markerEnd,b=y.markerStart;b&&b==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(p,")")),g&&g==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(p,")")),this.id=p}},{key:"setStyle",value:function(p,y){this.style=wa(wa({},this.style),{},za({},p,ga(y)))}},{key:"setStyles",value:function(p){this.style=wa(wa({},this.style),ga(p))}},{key:"updateStyles",value:function(p){this.style=wa({},ga(p))}},{key:"formatText",value:function(p){var y=this.textPosition,g=y.x,b=y.y;p.text&&typeof p.text!="string"?Object.prototype.toString.call(p.text)==="[object Object]"&&(this.text={x:p.text.x||g,y:p.text.y||b,value:p.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:p.text||"",x:g,y:b,draggable:this.text.draggable,editable:this.text.editable}}},{key:"resetTextPosition",value:function(){var p=this.textPosition,y=p.x,g=p.y;this.text.x=y,this.text.y=g}},{key:"moveText",value:function(p,y){if(this.text){var g=this.text,b=g.x,A=g.y,N=g.value,V=g.draggable,H=g.editable;this.text={value:N,draggable:V,x:b+p,y:A+y,editable:H}}}},{key:"setText",value:function(p){p&&Pa(this.text,p)}},{key:"updateText",value:function(p){this.text=wa(wa({},Object(a.I)(this.text)),{},{value:p})}},{key:"setAnchors",value:function(){if(!this.sourceAnchorId||!this.startPoint){var p=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!p)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:p.x,y:p.y}),this.sourceAnchorId||(this.sourceAnchorId=p.id)}if(!this.targetAnchorId||!this.endPoint){var y=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!y)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:y.x,y:y.y}),this.targetAnchorId||(this.targetAnchorId=y.id)}}},{key:"setSelected",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=p}},{key:"setHovered",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=p}},{key:"setHitable",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=p}},{key:"openEdgeAnimation",value:function(){this.isAnimation=!0}},{key:"closeEdgeAnimation",value:function(){this.isAnimation=!1}},{key:"setElementState",value:function(p,y){this.state=p,this.additionStateData=y}},{key:"updateStartPoint",value:function(p){this.startPoint=p}},{key:"moveStartPoint",value:function(p,y){this.startPoint.x+=p,this.startPoint.y+=y}},{key:"updateEndPoint",value:function(p){this.endPoint=p}},{key:"moveEndPoint",value:function(p,y){this.endPoint.x+=p,this.endPoint.y+=y}},{key:"setZIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.zIndex=p}},{key:"initPoints",value:function(){}},{key:"updateAttributes",value:function(p){Pa(this,p)}},{key:"getAdjustStart",value:function(){return this.startPoint}},{key:"getAdjustEnd",value:function(){return this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(p){var y=p.startPoint,g=p.endPoint;this.updateStartPoint({x:y.x,y:y.y}),this.updateEndPoint({x:g.x,y:g.y})}}],d&&Lf(u.prototype,d),c})(),xc=wr(Qt.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Af=wr(Qt.prototype,"sourceNodeId",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Mf=wr(Qt.prototype,"targetNodeId",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Pu=wr(Qt.prototype,"startPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Oc=wr(Qt.prototype,"endPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Xp=wr(Qt.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),uv=wr(Qt.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),Sc=wr(Qt.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Tf=wr(Qt.prototype,"pointsList",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Yp=wr(Qt.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),cv=wr(Qt.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Bs=wr(Qt.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),dv=wr(Qt.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),vs=wr(Qt.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Ru=wr(Qt.prototype,"isAnimation",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),qp=wr(Qt.prototype,"isShowAdjustPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Cg=wr(Qt.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ng=wr(Qt.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),kg=wr(Qt.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),fv=wr(Qt.prototype,"arrowConfig",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")}}}),wr(Qt.prototype,"sourceNode",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"sourceNode"),Qt.prototype),wr(Qt.prototype,"targetNode",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"targetNode"),Qt.prototype),wr(Qt.prototype,"textPosition",[a.m],Object.getOwnPropertyDescriptor(Qt.prototype,"textPosition"),Qt.prototype),wr(Qt.prototype,"setProperty",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setProperty"),Qt.prototype),wr(Qt.prototype,"deleteProperty",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"deleteProperty"),Qt.prototype),wr(Qt.prototype,"setProperties",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setProperties"),Qt.prototype),wr(Qt.prototype,"changeEdgeId",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"changeEdgeId"),Qt.prototype),wr(Qt.prototype,"setStyle",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setStyle"),Qt.prototype),wr(Qt.prototype,"setStyles",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setStyles"),Qt.prototype),wr(Qt.prototype,"updateStyles",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateStyles"),Qt.prototype),wr(Qt.prototype,"formatText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"formatText"),Qt.prototype),wr(Qt.prototype,"resetTextPosition",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"resetTextPosition"),Qt.prototype),wr(Qt.prototype,"moveText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveText"),Qt.prototype),wr(Qt.prototype,"setText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setText"),Qt.prototype),wr(Qt.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateText"),Qt.prototype),wr(Qt.prototype,"setAnchors",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setAnchors"),Qt.prototype),wr(Qt.prototype,"setSelected",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setSelected"),Qt.prototype),wr(Qt.prototype,"setHovered",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setHovered"),Qt.prototype),wr(Qt.prototype,"setHitable",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setHitable"),Qt.prototype),wr(Qt.prototype,"openEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"openEdgeAnimation"),Qt.prototype),wr(Qt.prototype,"closeEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"closeEdgeAnimation"),Qt.prototype),wr(Qt.prototype,"setElementState",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setElementState"),Qt.prototype),wr(Qt.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateStartPoint"),Qt.prototype),wr(Qt.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveStartPoint"),Qt.prototype),wr(Qt.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateEndPoint"),Qt.prototype),wr(Qt.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"moveEndPoint"),Qt.prototype),wr(Qt.prototype,"setZIndex",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"setZIndex"),Qt.prototype),wr(Qt.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"initPoints"),Qt.prototype),wr(Qt.prototype,"updateAttributes",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateAttributes"),Qt.prototype),wr(Qt.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"getAdjustStart"),Qt.prototype),wr(Qt.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"getAdjustEnd"),Qt.prototype),wr(Qt.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Qt.prototype,"updateAfterAdjustStartAndEnd"),Qt.prototype),Qt),If=Jp;function Qp(c){return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Qp(c)}function pv(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Rg(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?pv(Object(d),!0).forEach((function(p){Lu(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):pv(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ju(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Dg(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Cc(){return Cc=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=jg(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Cc.apply(this,arguments)}function jg(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=lu(c))!==null;);return c}function hv(c,u){return hv=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hv(c,u)}function Ff(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=lu(c);if(u){var y=lu(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Lg(this,d)}}function Lg(c,u){if(u&&(Qp(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gl(c)}function Gl(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function lu(c){return lu=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},lu(c)}function Lu(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Er,vv,Od=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&hv(g,b)})(y,c);var u,d,p=Ff(y);function y(){var g;ju(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return Lu(Gl(g=p.call.apply(p,[this].concat(A))),"modelType",lo.LINE_EDGE),g}return u=y,(d=[{key:"getEdgeStyle",value:function(){var g=this.graphModel.theme.line;return Rg(Rg({},Cc(lu(y.prototype),"getEdgeStyle",this).call(this)),Uo(g))}},{key:"getTextPosition",value:function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}])&&Dg(u.prototype,d),y})(If);function su(c){return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},su(c)}function Bf(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return Ha(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return Ha(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Ha(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function ms(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ci(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?ms(Object(d),!0).forEach((function(p){gv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):ms(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function dl(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function zl(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function by(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function $f(){return $f=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=Nc(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},$f.apply(this,arguments)}function Nc(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=nl(c))!==null;);return c}function Jr(c,u){return Jr=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Jr(c,u)}function Ig(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=nl(c);if(u){var y=nl(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return fl(this,d)}}function fl(c,u){if(u&&(su(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oi(c)}function Oi(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function nl(c){return nl=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},nl(c)}function gv(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ea(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var Cl=(Er=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Jr(g,b)})(y,c);var u,d,p=Ig(y);function y(){var g;zl(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return gv(Oi(g=p.call.apply(p,[this].concat(A))),"modelType",lo.POLYLINE_EDGE),gv(Oi(g),"draggingPointList",void 0),dl(Oi(g),"dbClickPosition",vv,Oi(g)),g}return u=y,(d=[{key:"initEdgeData",value:function(g){this.offset=30,$f(nl(y.prototype),"initEdgeData",this).call(this,g)}},{key:"getEdgeStyle",value:function(){var g=this.graphModel.theme.polyline;return Ci(Ci({},$f(nl(y.prototype),"getEdgeStyle",this).call(this)),Uo(g))}},{key:"getTextPosition",value:function(){var g,b=(g=this.text)===null||g===void 0?void 0:g.value;if(this.dbClickPosition&&!b){var A=this.dbClickPosition;return{x:A.x,y:A.y}}var N=jr(this.points),V=Bf(Or(N),2),H=V[0],oe=V[1];return{x:(H.x+oe.x)/2,y:(H.y+oe.y)/2}}},{key:"getAfterAnchor",value:function(g,b,A){var N,V;return A.forEach((function(H){var oe;g===ti.HORIZONTAL?oe=Math.abs(b.y-H.y):g===ti.VERTICAL&&(oe=Math.abs(b.x-H.x)),(!V||V>oe)&&(V=oe,N=H)})),N}},{key:"getCrossPoint",value:function(g,b,A){var N;return g===ti.HORIZONTAL?N={x:A.x,y:b.y}:g===ti.VERTICAL&&(N={x:b.x,y:A.y}),N}},{key:"removeCrossPoints",value:function(g,b,A){var N=A.map((function(xt){return xt}));if(g===1){var V=N[g],H=N[b],oe=N[g-1];if(Fr(oe,V,this.sourceNode)){if(Qr(V,H,this.sourceNode)){var ue=ki(V,H,this.sourceNode);ue&&(N[g]=ue,N.splice(g-1,1),g--,b--)}}else this.sourceNode.anchors.forEach((function(xt){(xt.x===oe.x&&xt.x===V.x||xt.y===oe.y&&xt.y===V.y)&&gs(xt.x,xt.y,V.x,V.y)<gs(oe.x,oe.y,V.x,V.y)&&(N[g-1]=xt)}))}if(b===A.length-2){var Ne=N[g],Ve=N[b],qe=N[b+1];if(Fr(Ve,qe,this.targetNode)){if(Qr(Ne,Ve,this.targetNode)){var Ot=ki(Ne,Ve,this.targetNode);Ot&&(N[b]=Ot,N.splice(b+1,1))}}else this.targetNode.anchors.forEach((function(xt){(xt.x===qe.x&&xt.x===Ve.x||xt.y===qe.y&&xt.y===Ve.y)&&gs(xt.x,xt.y,Ve.x,Ve.y)<gs(qe.x,qe.y,Ve.x,Ve.y)&&(N[b+1]=xt)}))}return N}},{key:"getDraggingPoints",value:function(g,b,A,N,V){var H=V.map((function(Ne){return Ne})),oe=this.getAfterAnchor(g,A,N),ue=this.getCrossPoint(g,A,oe);return b==="start"?(H.unshift(ue),H.unshift(oe)):(H.push(ue),H.push(oe)),H}},{key:"updateCrossPoints",value:function(g){var b=g.map((function(vn){return vn})),A=g[0],N=g[1],V=g[b.length-2],H=g[b.length-1],oe=this.sourceNode,ue=this.targetNode,Ne=oe.modelType,Ve=ue.modelType,qe=Si(A,N),Ot=b[0];switch(Ne){case lo.RECT_NODE:oe.radius!==0&&(kf(A,oe)||(Ot=Nf(A,qe,oe)));break;case lo.CIRCLE_NODE:Ot=Ac(A,qe,oe);break;case lo.ELLIPSE_NODE:Ot=Ed(A,qe,oe);break;case lo.DIAMOND_NODE:case lo.POLYGON_NODE:Ot=Pf(A,qe,oe)}Ot&&(b[0]=Ot);var xt=Si(V,H),Ft=b[b.length-1];switch(Ve){case lo.RECT_NODE:ue.radius!==0&&(kf(H,ue)||(Ft=Nf(H,xt,ue)));break;case lo.CIRCLE_NODE:Ft=Ac(H,xt,ue);break;case lo.ELLIPSE_NODE:Ft=Ed(H,xt,ue);break;case lo.DIAMOND_NODE:case lo.POLYGON_NODE:Ft=Pf(H,xt,ue)}return Ft&&(b[b.length-1]=Ft),b}},{key:"getData",value:function(){var g=$f(nl(y.prototype),"getData",this).call(this),b=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Object.assign({},g,{pointsList:b})}},{key:"initPoints",value:function(){this.pointsList.length>0?this.points=this.pointsList.map((function(g){return"".concat(g.x,",").concat(g.y)})).join(" "):this.updatePoints()}},{key:"updatePoints",value:function(){var g=$r({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=g,this.points=g.map((function(b){return"".concat(b.x,",").concat(b.y)})).join(" ")}},{key:"updateStartPoint",value:function(g){this.startPoint=Object.assign({},g),this.updatePoints()}},{key:"moveStartPoint",value:function(g,b){this.startPoint.x+=g,this.startPoint.y+=b,this.updatePoints()}},{key:"updateEndPoint",value:function(g){this.endPoint=Object.assign({},g),this.updatePoints()}},{key:"moveEndPoint",value:function(g,b){this.endPoint.x+=g,this.endPoint.y+=b,this.updatePoints()}},{key:"updatePointsList",value:function(g,b){this.pointsList.forEach((function(V){V.x+=g,V.y+=b}));var A=this.pointsList[0];this.startPoint=Object.assign({},A);var N=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},N),this.initPoints()}},{key:"dragAppendStart",value:function(){this.draggingPointList=this.pointsList.map((function(g){return g}))}},{key:"dragAppendSimple",value:function(g,b){this.isDragging=!0;var A=g.start,N=g.end,V=g.startIndex,H=g.endIndex,oe=g.direction,ue=this.pointsList,Ne=ue;return oe===ti.HORIZONTAL?(ue[V]={x:A.x,y:A.y+b.y},ue[H]={x:N.x,y:N.y+b.y},Ne=this.pointsList.map((function(Ve){return Ve}))):oe===ti.VERTICAL&&(ue[V]={x:A.x+b.x,y:A.y},ue[H]={x:N.x+b.x,y:N.y},Ne=this.pointsList.map((function(Ve){return Ve}))),this.updatePointsAfterDrag(Ne),this.draggingPointList=Ne,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[V]),end:Object.assign({},ue[H]),startIndex:V,endIndex:H,direction:oe}}},{key:"dragAppend",value:function(g,b){this.isDragging=!0;var A=g.start,N=g.end,V=g.startIndex,H=g.endIndex,oe=g.direction,ue=this.pointsList;if(oe===ti.HORIZONTAL){ue[V]={x:A.x,y:A.y+b.y},ue[H]={x:N.x,y:N.y+b.y};var Ne=this.pointsList.map((function(Vn){return Vn}));if(V!==0&&H!==this.pointsList.length-1&&(Ne=this.removeCrossPoints(V,H,Ne)),V===0){var Ve={x:A.x,y:A.y+b.y};if(!Du(Ve,this.sourceNode)){var qe=this.sourceNode.anchors;Ne=this.getDraggingPoints(oe,"start",Ve,qe,Ne)}}if(H===this.pointsList.length-1){var Ot={x:N.x,y:N.y+b.y};if(!Du(Ot,this.targetNode)){var xt=this.targetNode.anchors;Ne=this.getDraggingPoints(oe,"end",Ot,xt,Ne)}}this.updatePointsAfterDrag(Ne),this.draggingPointList=Ne}else if(oe===ti.VERTICAL){ue[V]={x:A.x+b.x,y:A.y},ue[H]={x:N.x+b.x,y:N.y};var Ft=this.pointsList.map((function(Vn){return Vn}));if(V!==0&&H!==this.pointsList.length-1&&(Ft=this.removeCrossPoints(V,H,Ft)),V===0){var vn={x:A.x+b.x,y:A.y};if(!Du(vn,this.sourceNode)){var Hn=this.sourceNode.anchors;Ft=this.getDraggingPoints(oe,"start",vn,Hn,Ft)}}if(H===this.pointsList.length-1){var zn={x:N.x+b.x,y:N.y};if(!Du(zn,this.targetNode)){var Ar=this.targetNode.anchors;Ft=this.getDraggingPoints(oe,"end",zn,Ar,Ft)}}this.updatePointsAfterDrag(Ft),this.draggingPointList=Ft}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[V]),end:Object.assign({},ue[H]),startIndex:V,endIndex:H,direction:oe}}},{key:"dragAppendEnd",value:function(){if(this.draggingPointList){var g=Un(jr(this.points));this.pointsList=g.map((function(N){return N})),this.draggingPointList=[];var b=g[0];this.startPoint=Object.assign({},b);var A=g[g.length-1];this.endPoint=Object.assign({},A)}this.isDragging=!1}},{key:"updatePointsAfterDrag",value:function(g){var b=this.updateCrossPoints(g);this.points=b.map((function(A){return"".concat(A.x,",").concat(A.y)})).join(" ")}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var g=this.pointsList;return g[g.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(g){var b=g.startPoint,A=g.endPoint,N=g.sourceNode,V=g.targetNode,H=$r({x:b.x,y:b.y},{x:A.x,y:A.y},N,V,this.offset||0);this.pointsList=H,this.initPoints()}}])&&by(u.prototype,d),y})(If),vv=Ea(Er.prototype,"dbClickPosition",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ea(Er.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"initPoints"),Er.prototype),Ea(Er.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePoints"),Er.prototype),Ea(Er.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateStartPoint"),Er.prototype),Ea(Er.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"moveStartPoint"),Er.prototype),Ea(Er.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateEndPoint"),Er.prototype),Ea(Er.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"moveEndPoint"),Er.prototype),Ea(Er.prototype,"updatePointsList",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePointsList"),Er.prototype),Ea(Er.prototype,"dragAppendStart",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendStart"),Er.prototype),Ea(Er.prototype,"dragAppendSimple",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendSimple"),Er.prototype),Ea(Er.prototype,"dragAppend",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppend"),Er.prototype),Ea(Er.prototype,"dragAppendEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"dragAppendEnd"),Er.prototype),Ea(Er.prototype,"updatePointsAfterDrag",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updatePointsAfterDrag"),Er.prototype),Ea(Er.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"getAdjustStart"),Er.prototype),Ea(Er.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"getAdjustEnd"),Er.prototype),Ea(Er.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Er.prototype,"updateAfterAdjustStartAndEnd"),Er.prototype),Er),kc=function(c){var u=c.start,d=c.end,p=c.offset,y=c.verticalLength,g=c.type,b={leftX:0,leftY:0,rightX:0,rightY:0},A=Math.atan((d.y-u.y)/(d.x-u.x)),N=Math.atan(p/y),V=Math.sqrt(y*y+p*p);return g==="start"?d.x>=u.x?(b.leftX=u.x+V*Math.sin(A+N),b.leftY=u.y-V*Math.cos(A+N),b.rightX=u.x-V*Math.sin(A-N),b.rightY=u.y+V*Math.cos(A-N)):(b.leftX=u.x-V*Math.sin(A+N),b.leftY=u.y+V*Math.cos(A+N),b.rightX=u.x+V*Math.sin(A-N),b.rightY=u.y-V*Math.cos(A-N)):g==="end"&&(d.x>=u.x?(b.leftX=d.x+V*Math.sin(A-N),b.leftY=d.y-V*Math.cos(A-N),b.rightX=d.x-V*Math.sin(A+N),b.rightY=d.y+V*Math.cos(A+N)):(b.leftX=d.x-V*Math.sin(A-N),b.leftY=d.y+V*Math.cos(A-N),b.rightX=d.x+V*Math.sin(A+N),b.rightY=d.y-V*Math.cos(A+N))),b},Uf={x:1,y:0,z:0};function Ni(c,u,d,p,y){for(var g=function(Ve){if(Ve<0||Ve>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:c.x*Math.pow(1-Ve,3)+3*u.x*Ve*Math.pow(1-Ve,2)+3*d.x*Math.pow(Ve,2)*(1-Ve)+p.x*Math.pow(Ve,3),y:c.y*Math.pow(1-Ve,3)+3*u.y*Ve*Math.pow(1-Ve,2)+3*d.y*Math.pow(Ve,2)*(1-Ve)+p.y*Math.pow(Ve,3)}},b=0,A=2,N=p.x,V=p.y,H=p;b<y&&A<50;){var oe=H=g(1-A/100),ue=oe.x,Ne=oe.y;b=gs(N,V,ue,Ne),A++}return H}function Bi(c){var u=Math.hypot(c.x,c.y);return{x:c.x/u,y:c.y/u,z:0}}function eh(c){return p=(function(g,b){return g.x*b.y-g.y*b.x})(u=Uf,d=c),y=Math.acos((function(g,b){var A=[g.x,g.y,g.z];return[b.x,b.y,b.z].reduce((function(N,V,H){return N+V*A[H]}))})(Bi(u),Bi(d))),p>=0?y:-y;var u,d,p,y}function mv(c){return c*(180/Math.PI)}function K(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function ge(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?K(Object(d),!0).forEach((function(p){Ie(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):K(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Ie(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function wt(c){return(function(u){if(Array.isArray(u))return tn(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||Nt(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Dt(c){return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Dt(c)}function yt(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||Nt(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Nt(c,u){if(c){if(typeof c=="string")return tn(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?tn(c,u):void 0}}function tn(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var sn=function(c,u){var d;switch(c.type){case"line":default:d=new Od(c,u);break;case"polyline":d=new Cl(c,u)}return d},nn=function(c,u){return 2*Math.abs(c.centerX-u.centerX)<c.width+u.width&&2*Math.abs(c.centerY-u.centerY)<c.height+u.height},Mt=function(c){var u=[],d={};return c.forEach((function(p){var y="".concat(p.x,"-").concat(p.y);p.id=y,d[y]=p})),Object.keys(d).forEach((function(p){u.push(d[p])})),u},wn=function(c,u){var d=[c,{x:c.x,y:u.y},u];return Mt(d)},hn=function(c,u){return c.width===0&&c.height===0?c:{centerX:c.centerX,centerY:c.centerY,minX:c.minX-u,minY:c.minY-u,maxX:c.maxX+u,maxY:c.maxY+u,height:c.height+2*u,width:c.width+2*u}},rn=function(c,u){var d=Math.abs(c.x-u.centerX),p=Math.abs(c.y-u.centerY);return d/u.width>p/u.height?ti.HORIZONTAL:ti.VERTICAL},Wt=function(c,u,d){return rn(d,u)===ti.HORIZONTAL?{x:d.x>c.centerX?c.maxX:c.minX,y:d.y}:{x:d.x,y:d.y>c.centerY?c.maxY:c.minY}},st=function(c,u){var d=Math.min(c.minX,u.minX),p=Math.min(c.minY,u.minY),y=Math.max(c.maxX,u.maxX),g=Math.max(c.maxY,u.maxY);return{centerX:(d+y)/2,centerY:(p+g)/2,minX:d,minY:p,maxX:y,maxY:g,height:g-p,width:y-d}},St=function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=arguments.length>1?arguments[1]:void 0,d=[],p=[];c.forEach((function(H){d.push(H.x),p.push(H.y)}));var y=Math.min.apply(Math,d),g=Math.max.apply(Math,d),b=Math.min.apply(Math,p),A=Math.max.apply(Math,p),N=g-y,V=A-b;return u&&(N+=u,V+=u),{centerX:(y+g)/2,centerY:(b+A)/2,maxX:g,maxY:A,minX:y,minY:b,x:(y+g)/2,y:(b+A)/2,height:V,width:N}},ln=function(c){var u=c.minX,d=c.minY,p=c.maxX,y=c.maxY;return[{x:u,y:d},{x:p,y:d},{x:p,y},{x:u,y}]},An=function(c,u){var d=c.x,p=c.y;return d<u.minX||d>u.maxX||p<u.minY||p>u.maxY},Xt=function(c,u){return u<c.minX||u>c.maxX?[]:[{x:u,y:c.minY},{x:u,y:c.maxY}]},kn=function(c,u){return u<c.minY||u>c.maxY?[]:[{x:c.minX,y:u},{x:c.maxX,y:u}]},Kt=function(c,u){return Xt(c,u.x).concat(kn(c,u.y))},_n=function(c,u){return Math.abs(c.x-u.x)+Math.abs(c.y-u.y)},Yt=function(c,u){var d=0;return u.forEach((function(p){p&&(c.x===p.x&&(d+=-2),c.y===p.y&&(d+=-2))})),d},xn=function(c,u,d,p,y){return _n(c,u)+_n(c,d)+Yt(c,[u,d,p,y])},ar=function c(u,d,p,y,g){g||(g=0),u.unshift(d[y]),p[y]&&p[y]!==y&&g<=100&&c(u,d,p,p[y],g+1)},xr=function(c,u){var d=c.indexOf(u);d>-1&&c.splice(d,1)},on=function(c,u,d,p){var y=u.x-c.x,g=u.y-c.y,b=p.x-d.x,A=p.y-d.y,N=(-g*(c.x-d.x)+y*(c.y-d.y))/(-b*g+y*A),V=(b*(c.y-d.y)-A*(c.x-d.x))/(-b*g+y*A);return N>=0&&N<=1&&V>=0&&V<=1},Zt=function(c,u,d){if(d.width===0&&d.height===0)return!1;var p=yt(ln(d),4),y=p[0],g=p[1],b=p[2],A=p[3];return on(c,u,y,g)||on(c,u,y,A)||on(c,u,g,b)||on(c,u,b,A)},Ht=function(c,u,d,p){var y=[];return c.forEach((function(g){g!==u&&(g.x!==u.x&&g.y!==u.y||Zt(g,u,d)||Zt(g,u,p)||y.push(g))})),Mt(y)},pr=function(c,u,d,p,y,g,b){var A=[],N=[u],V={},H={},oe={};H[u.id]=0,oe[u.id]=xn(u,d,u);var ue={};c.forEach((function(qe){ue[qe.id]=qe}));for(var Ne=function(){var qe=void 0,Ot=1/0;if(N.forEach((function(Ft){oe[Ft.id]<Ot&&(Ot=oe[Ft.id],qe=Ft)})),qe===d){var xt=[];return ar(xt,ue,V,d.id),{v:xt}}xr(N,qe),A.push(qe),Ht(c,qe,p,y).forEach((function(Ft){if(A.indexOf(Ft)===-1){N.indexOf(Ft)===-1&&N.push(Ft);var vn=oe[qe.id]+_n(qe,Ft);H[Ft.id]&&vn>=H[Ft.id]||(V[Ft.id]=qe.id,H[Ft.id]=vn,oe[Ft.id]=H[Ft.id]+xn(Ft,d,u,g,b))}}))};N.length;){var Ve=Ne();if(Dt(Ve)==="object")return Ve.v}return[u,d]},Dr=function(c){return mi(c)},Un=function(c){for(var u=1;u<c.length-1;){var d=c[u-1],p=c[u],y=c[u+1];d.x===p.x&&p.x===y.x||d.y===p.y&&p.y===y.y?c.splice(u,1):u++}return c},$r=function(c,u,d,p,y){var g=Dr(d),b=Dr(p),A=hn(g,y),N=hn(b,y),V=Wt(A,g,c),H=Wt(N,b,u);if(nn(A,N)){var oe=Gi(c,u,V,H);return[c,V].concat(wt(oe),[H,u])}var ue=St([V,H]),Ne=st(A,ue),Ve=st(N,ue),qe=[];qe=(qe=qe.concat(ln(Ne))).concat(ln(Ve));var Ot={x:(c.x+u.x)/2,y:(c.y+u.y)/2};[ue,Ne,Ve].forEach((function(Ft){qe=qe.concat(Kt(Ft,Ot).filter((function(vn){return An(vn,A)&&An(vn,N)})))})),[{x:V.x,y:H.y},{x:H.x,y:V.y}].forEach((function(Ft){An(Ft,A)&&An(Ft,N)&&qe.push(Ft)})),qe.unshift(V),qe.push(H),qe=Mt(qe);var xt=pr(qe,V,H,g,b,c,u);return xt.unshift(c),xt.push(u),xt.length>2&&(xt=Un(xt)),Mt(xt)},Or=function(c){var u;if(c.length===1)u=[c[0],c[0]];else if(c.length>=2){for(var d=c[0],p=c[1],y=gs(d.x,d.y,p.x,p.y),g=1;g<c.length-1;g++){var b=c[g],A=c[g+1],N=gs(b.x,b.y,A.x,A.y);N>y&&(y=N,d=b,p=A)}u=[d,p]}return u},Fr=function(c,u,d){var p=Du(c,d),y=Du(u,d);return p&&y},Qr=function(c,u,d){var p=Du(c,d),y=Du(u,d);return!(p&&y)&&(p||y)},ki=function(c,u,d){for(var p,y,g=mi(d),b=ln(g),A=0;A<b.length;A++)on(c,u,b[A],b[(A+1)%b.length])&&(y=[b[A],b[(A+1)%b.length]]);return y&&(p=(function(N,V,H,oe){var ue=(V.y-N.y)*(oe.x-H.x)-(N.x-V.x)*(H.y-oe.y);if(ue===0)return!1;var Ne=((V.x-N.x)*(oe.x-H.x)*(H.y-N.y)+(V.y-N.y)*(oe.x-H.x)*N.x-(oe.y-H.y)*(V.x-N.x)*H.x)/ue,Ve=-((V.y-N.y)*(oe.y-H.y)*(H.x-N.x)+(V.x-N.x)*(oe.y-H.y)*N.y-(oe.x-H.x)*(V.y-N.y)*H.y)/ue;return(Ne-N.x)*(Ne-V.x)<=0&&(Ve-N.y)*(Ve-V.y)<=0&&(Ne-H.x)*(Ne-oe.x)<=0&&(Ve-H.y)*(Ve-oe.y)<=0&&{x:Ne,y:Ve}})(c,u,y[0],y[1])),p},Si=function(c,u){var d;return c.x===u.x?d=ti.VERTICAL:c.y===u.y&&(d=ti.HORIZONTAL),d},jr=function(c){var u=c.split(" "),d=[];return u&&u.forEach((function(p){var y=yt(p.split(","),2),g=y[0],b=y[1];d.push({x:Number(g),y:Number(b)})})),d},Gi=function(c,u,d,p){var y=[];if(Si(c,d)===Si(u,p))c.y===d.y?(y.push({x:d.x,y:(d.y+p.y)/2}),y.push({x:p.x,y:(d.y+p.y)/2})):(y.push({x:(d.x+p.x)/2,y:d.y}),y.push({x:(d.x+p.x)/2,y:p.y}));else{var g={x:d.x,y:p.y},b=Ra(g,c,d),A=Ra(g,u,p);if(b||A)g={x:p.x,y:d.y};else{var N=Ko(g,c,d),V=Ko(g,u,p);N&&V&&(g={x:p.x,y:d.y})}y.push(g)}return y},Ko=function(c,u,d){return c.x===u.x&&c.x===d.x||c.y===u.y&&c.y===d.y},Pi=function(c){if(!c)return 0;for(var u=0,d=0;d<c.length;d++){var p=c.charCodeAt(d);c.match(/[A-Z]/)?u+=1.5:u+=p>=1&&p<=126||p>=65376&&p<=65439?1:2}return u},$i=null,Qi=function(c,u){$i||($i=document.createElement("canvas"));var d=$i.getContext("2d");return d.font=u,d.measureText(c).width},la=function(c){var u,d=c.start,p=c.end;if(d.x===p.x&&d.y===p.y)u="";else{var y={start:d,end:p,offset:10,verticalLength:5},g=kc(ge(ge({},y),{},{type:"start"})),b=kc(ge(ge({},y),{},{type:"end"}));u="M".concat(g.leftX," ").concat(g.leftY,`
|
||
L`).concat(g.rightX," ").concat(g.rightY,`
|
||
L`).concat(b.rightX," ").concat(b.rightY,`
|
||
L`).concat(b.leftX," ").concat(b.leftY," z")}return{d:u,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},zi=function(c){var u=c.start,d=c.end,p=c.sourceNode,y=c.targetNode,g=c.offset,b=mi(p),A=mi(y),N=hn(b,g),V=hn(A,g);return{sNext:Wt(N,b,u),ePre:Wt(V,A,d)}},di=function(c){var u=c.replace(/M/g,"").replace(/C/g,",").split(",");return[Cr(u[0]),Cr(u[1]),Cr(u[2]),Cr(u[3])]},Cr=function(c){var u=yt(c.replace(/(^\s*)/g,"").split(" "),2);return{x:+u[0],y:+u[1]}},sa=function(c,u){var d=yt(c,4);return[Ni(d[0],d[1],d[2],d[3],u),c[3]]},co=function(c,u){for(var d,p=c.x,y=c.y,g=jr(u),b=Number.MAX_SAFE_INTEGER,A=[],N=0;N<g.length;N++)A.push({start:g[N],end:g[(N+1)%g.length]});if(A.forEach((function(ue){var Ne=ue.start,Ve=ue.end;if(Ne.x===Ve.x){var qe={x:Ne.x,y};if(Ra(qe,Ne,Ve)){var Ot=Math.abs(Ne.x-p);Ot<b&&(b=Ot,d=qe)}}else if(Ne.y===Ve.y){var xt={x:p,y:Ne.y};if(Ra(xt,Ne,Ve)){var Ft=Math.abs(Ne.y-y);Ft<b&&(b=Ft,d=xt)}}})),!d){var V=A[0],H=V.start,oe=V.end;d={x:H.x+(oe.x-H.x)/2,y:H.y+(oe.y-H.y)/2}}return d},cr=function(c){return cs(c,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Xr=function(c,u){return Math.sqrt(Math.pow(c.x-u.x,2)+Math.pow(c.y-u.y,2))};function Nr(c,u){return typeof u!="function"?function(d,p,y){return Object.assign({type:c.edgeType},y)}:function(d,p,y){var g=u(d,p,y);return g?typeof g=="string"?Object.assign({},y,{type:g}):Object.assign({type:g},y):{type:c.edgeType}}}r(208);var fi=function(){};function $s(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function yi(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Ce=(function(){function c(p){var y=this,g=p.onDragStart,b=g===void 0?fi:g,A=p.onDragging,N=A===void 0?fi:A,V=p.onDragEnd,H=V===void 0?fi:V,oe=p.eventType,ue=oe===void 0?"":oe,Ne=p.eventCenter,Ve=Ne===void 0?null:Ne,qe=p.step,Ot=qe===void 0?1:qe,xt=p.isStopPropagation,Ft=xt===void 0||xt,vn=p.model,Hn=vn===void 0?null:vn,zn=p.data,Ar=zn===void 0?null:zn;(function(Vn,vr){if(!(Vn instanceof vr))throw new TypeError("Cannot call a class as a function")})(this,c),yi(this,"onDragStart",void 0),yi(this,"onDragging",void 0),yi(this,"onDragEnd",void 0),yi(this,"step",void 0),yi(this,"isStopPropagation",void 0),yi(this,"isDragging",!1),yi(this,"isStartDragging",!1),yi(this,"startX",0),yi(this,"startY",0),yi(this,"sumDeltaX",0),yi(this,"sumDeltaY",0),yi(this,"eventType",void 0),yi(this,"eventCenter",void 0),yi(this,"model",void 0),yi(this,"data",void 0),yi(this,"startTime",void 0),yi(this,"handleMouseDown",(function(Vn){var vr,er,Eo,Co=(vr=window)===null||vr===void 0?void 0:vr.document;if(Vn.button===0){y.isStopPropagation&&Vn.stopPropagation(),y.isStartDragging=!0,y.startX=Vn.clientX,y.startY=Vn.clientY,Co.addEventListener("mousemove",y.handleMouseMove,!1),Co.addEventListener("mouseup",y.handleMouseUp,!1);var zr=(er=y.model)===null||er===void 0?void 0:er.getData();(Eo=y.eventCenter)===null||Eo===void 0||Eo.emit(ur["".concat(y.eventType,"_MOUSEDOWN")],{e:Vn,data:y.data||zr}),y.startTime=new Date().getTime()}})),yi(this,"handleMouseMove",(function(Vn){if(y.isStopPropagation&&Vn.stopPropagation(),y.isStartDragging&&(y.sumDeltaX+=Vn.clientX-y.startX,y.sumDeltaY+=Vn.clientY-y.startY,y.startX=Vn.clientX,y.startY=Vn.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var vr,er=y.sumDeltaX%y.step,Eo=y.sumDeltaY%y.step,Co=y.sumDeltaX-er,zr=y.sumDeltaY-Eo;y.sumDeltaX=er,y.sumDeltaY=Eo;var Fo,ma=(vr=y.model)===null||vr===void 0?void 0:vr.getData();y.isDragging||((Fo=y.eventCenter)===null||Fo===void 0||Fo.emit(ur["".concat(y.eventType,"_DRAGSTART")],{e:Vn,data:y.data||ma}),y.onDragStart({event:Vn})),y.isDragging=!0,Promise.resolve().then((function(){var ya,Nl;y.onDragging({deltaX:Co,deltaY:zr,event:Vn}),(ya=y.eventCenter)===null||ya===void 0||ya.emit(ur["".concat(y.eventType,"_MOUSEMOVE")],{e:Vn,data:y.data||ma}),(Nl=y.eventCenter)===null||Nl===void 0||Nl.emit(ur["".concat(y.eventType,"_DRAG")],{e:Vn,data:y.data||ma})}))}})),yi(this,"handleMouseUp",(function(Vn){var vr=window.document;y.isStartDragging=!1,y.isStopPropagation&&Vn.stopPropagation(),Promise.resolve().then((function(){var er,Eo,Co;vr.removeEventListener("mousemove",y.handleMouseMove,!1),vr.removeEventListener("mouseup",y.handleMouseUp,!1);var zr=(er=y.model)===null||er===void 0?void 0:er.getData();(Eo=y.eventCenter)===null||Eo===void 0||Eo.emit(ur["".concat(y.eventType,"_MOUSEUP")],{e:Vn,data:y.data||zr}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:Vn}),(Co=y.eventCenter)===null||Co===void 0||Co.emit(ur["".concat(y.eventType,"_DROP")],{e:Vn,data:y.data||zr}))}))})),yi(this,"cancelDrag",(function(){var Vn,vr=(Vn=window)===null||Vn===void 0?void 0:Vn.document;vr.removeEventListener("mousemove",y.handleMouseMove,!1),vr.removeEventListener("mouseup",y.handleMouseUp,!1),y.onDragEnd({event:null}),y.isDragging=!1})),this.onDragStart=b,this.onDragging=N,this.onDragEnd=H,this.step=Ot,this.isStopPropagation=Ft,this.eventType=ue,this.eventCenter=Ve,this.model=Hn,this.data=Ar}var u,d;return u=c,(d=[{key:"setStep",value:function(p){this.step=p}},{key:"setModel",value:function(p){this.model=p}}])&&$s(u.prototype,d),c})();function Et(c){return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Et(c)}function _t(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Ln(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Gr(c,u,d){return u&&Ln(c.prototype,u),c}function xe(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&Qe(c,u)}function de(c){var u=ze();return function(){var d,p=Ee(c);if(u){var y=Ee(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return We(this,d)}}function We(c,u){if(u&&(Et(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tt(c)}function tt(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function ct(c){var u=typeof Map=="function"?new Map:void 0;return ct=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,y)}function y(){return Xe(d,arguments,Ee(this).constructor)}return y.prototype=Object.create(d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),Qe(y,d)},ct(c)}function Xe(c,u,d){return Xe=ze()?Reflect.construct:function(p,y,g){var b=[null];b.push.apply(b,y);var A=new(Function.bind.apply(p,b));return g&&Qe(A,g.prototype),A},Xe.apply(null,arguments)}function ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function Qe(c,u){return Qe=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Qe(c,u)}function Ee(c){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ee(c)}function Ue(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function be(c,u){return c instanceof ot&&u instanceof ot}var nt=(function(c){xe(d,c);var u=de(d);function d(p,y,g){var b;return _t(this,d),Ue(tt(b=u.call(this,3)),"x",void 0),Ue(tt(b),"y",void 0),Ue(tt(b),"z",void 0),b[0]=p,b[1]=y,b[2]=g,b.x=p,b.y=y,b.z=g,Object.setPrototypeOf(tt(b),d.prototype),b}return Gr(d,[{key:"add",value:function(p){if(be(this,p))return new ot(this.x+p.x,this.y+p.y);var y=this.z+p.z;return new m((this.x+p.x)/y,(this.y+p.y)/y)}},{key:"subtract",value:function(p){if(be(this,p))return new ot(this.x-p.x,this.y-p.y);var y=this.z-p.z;return y===0?new ot(this.x-p.x,this.y-p.y):new m((this.x-p.x)/y,(this.y-p.y)/y)}}]),d})(ct(Array)),ot=(function(c){xe(d,c);var u=de(d);function d(p,y,g){var b;return _t(this,d),b=u.call(this,p,y,g??0),Object.setPrototypeOf(tt(b),d.prototype),b}return Gr(d,[{key:"toString",value:function(){return"Vector"}},{key:"dot",value:function(p){var y=this;return p.reduce((function(g,b,A){return g+b*y[A]}))}},{key:"cross",value:function(p){return new d(this.y*p.z-this.z*p.y,this.z*p.x-this.x*p.z,this.x*p.y-this.y*p.x)}},{key:"getLength",value:function(){return Math.hypot(this.x,this.y)}},{key:"normalize",value:function(){var p=this.getLength();return new d(this.x/p,this.y/p)}},{key:"crossZ",value:function(p){return this.x*p.y-this.y*p.x}},{key:"angle",value:function(p){var y=this.crossZ(p),g=Math.acos(this.normalize().dot(p.normalize()));return y>=0?g:-g}}]),d})(nt),m=(function(c){xe(d,c);var u=de(d);function d(p,y){var g;return _t(this,d),g=u.call(this,p,y,1),Object.setPrototypeOf(tt(g),d.prototype),g}return Gr(d,[{key:"toString",value:function(){return"Point"}}]),d})(nt);r(67),r(218);function x(c){return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},x(c)}function C(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||ne(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function G(c){return(function(u){if(Array.isArray(u))return ce(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||ne(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ne(c,u){if(c){if(typeof c=="string")return ce(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?ce(c,u):void 0}}function ce(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function Oe(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Fe(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function et(c,u,d){return u&&Fe(c.prototype,u),c}function jt(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&Tn(c,u)}function Vt(c){var u=an();return function(){var d,p=Br(c);if(u){var y=Br(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return yn(this,d)}}function yn(c,u){if(u&&(x(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yn(c)}function Yn(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Qn(c){var u=typeof Map=="function"?new Map:void 0;return Qn=function(d){if(d===null||(p=d,Function.toString.call(p).indexOf("[native code]")===-1))return d;var p;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,y)}function y(){return Sr(d,arguments,Br(this).constructor)}return y.prototype=Object.create(d.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),Tn(y,d)},Qn(c)}function Sr(c,u,d){return Sr=an()?Reflect.construct:function(p,y,g){var b=[null];b.push.apply(b,y);var A=new(Function.bind.apply(p,b));return g&&Tn(A,g.prototype),A},Sr.apply(null,arguments)}function an(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function Tn(c,u){return Tn=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Tn(c,u)}function Br(c){return Br=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Br(c)}function ir(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var at,Yr,Ao,Mr,Ur,xa,Hl,uu,Oa,Iu,Pc,th,yv,Fu=(function(c){jt(d,c);var u=Vt(d);function d(){var p;Oe(this,d);for(var y=arguments.length,g=new Array(y),b=0;b<y;b++)g[b]=arguments[b];return ir(Yn(p=u.call(this,g.length)),"rows",void 0),ir(Yn(p),"columns",void 0),p.fill(new Array(3)),g.forEach((function(A,N){p[N]=A})),p.columns=g[0].length,p.rows=g.length,Object.setPrototypeOf(Yn(p),d.prototype),p}return et(d,[{key:"getRow",value:function(p){return this[p]}},{key:"getColumn",value:function(p){return G(this.map((function(y){return y[p]})))}},{key:"transpose",value:function(){for(var p=[],y=0;y<this.columns;y++)p.push(this.getColumn(y));return Sr(d,p)}},{key:"cross",value:function(p){var y=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===p.rows)for(var g=0;g<this.rows;g++)for(var b=this.getRow(g),A=function(V){var H=p.getColumn(V);y[g][V]=b.reduce((function(oe,ue,Ne){return oe+ue*H[Ne]}),0)},N=0;N<p.columns;N++)A(N);return Sr(d,G(y))}},{key:"to2D",value:function(){return this.map((function(p){return[p[0],p[1]]}))}},{key:"toPoints",value:function(){return this.map((function(p){return new m(p[0],p[1])}))}},{key:"toString",value:function(){var p=C(this[0],2),y=p[0],g=p[1],b=C(this[1],2),A=b[0],N=b[1],V=C(this[2],2),H=V[0],oe=V[1];return"matrix(".concat(y," ").concat(g," ").concat(A," ").concat(N," ").concat(H," ").concat(oe,")")}},{key:"translate",value:function(p,y){return this.cross(new nh(p,y))}},{key:"rotate",value:function(p){return this.cross(new Sd(p))}},{key:"scale",value:function(p,y){return this.cross(new wy(p,y))}}]),d})(Qn(Array)),Sd=(function(c){jt(d,c);var u=Vt(d);function d(p){var y;return Oe(this,d),y=u.call(this,new ot(+Math.cos(p).toFixed(2),+Math.sin(p).toFixed(2),0),new ot(-Math.sin(p).toFixed(2),+Math.cos(p).toFixed(2),0),new ot(0,0,1)),Object.setPrototypeOf(Yn(y),d.prototype),y}return et(d,[{key:"inverse",value:function(){return this.transpose()}}]),d})(Fu),wy=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var g;return Oe(this,d),ir(Yn(g=u.call(this,new ot(p,0,0),new ot(0,y,0),new ot(0,0,1))),"sx",void 0),ir(Yn(g),"sy",void 0),g.sx=p,g.sy=y,Object.setPrototypeOf(Yn(g),d.prototype),g}return et(d,[{key:"inverse",value:function(){return new d(1/this.sx,1/this.sy)}}]),d})(Fu),nh=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var g;return Oe(this,d),ir(Yn(g=u.call(this,new ot(1,0,0),new ot(0,1,0),new ot(p,y,1))),"tx",void 0),ir(Yn(g),"ty",void 0),g.tx=p,g.ty=y,Object.setPrototypeOf(Yn(g),d.prototype),g}return et(d,[{key:"inverse",value:function(){return new d(-this.tx,-this.ty)}}]),d})(Fu),_v={node:!1,edge:!1},Ey={node:!0,edge:!0};function bv(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Vf(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?bv(Object(d),!0).forEach((function(p){Dc(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):bv(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Wf(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||wv(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Rc(c){return(function(u){if(Array.isArray(u))return gE(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||wv(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function wv(c,u){if(c){if(typeof c=="string")return gE(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?gE(c,u):void 0}}function gE(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function pb(c){return pb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},pb(c)}function Bu(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function v5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Dc(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Tr(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var lT,sT=200,uT=(at=(function(){function c(p){(function(Ne,Ve){if(!(Ne instanceof Ve))throw new TypeError("Cannot call a class as a function")})(this,c),Dc(this,"rootEl",void 0),Bu(this,"width",Yr,this),Bu(this,"height",Ao,this),Dc(this,"theme",void 0),Dc(this,"eventCenter",void 0),Dc(this,"modelMap",new Map),Dc(this,"topElement",void 0),Dc(this,"animation",void 0),Dc(this,"idGenerator",void 0),Dc(this,"edgeGenerator",void 0),Dc(this,"nodeMoveRules",[]),Dc(this,"customTrajectory",void 0),Bu(this,"edgeType",Mr,this),Bu(this,"nodes",Ur,this),Bu(this,"edges",xa,this),Bu(this,"overlapMode",Hl,this),Bu(this,"background",uu,this),Bu(this,"transformModel",Oa,this),Bu(this,"editConfigModel",Iu,this),Bu(this,"gridSize",Pc,this),Bu(this,"partial",th,this),Bu(this,"fakerNode",yv,this);var y,g=p.container,b=p.background,A=b===void 0?{}:b,N=p.grid,V=p.idGenerator,H=p.edgeGenerator,oe=p.animation,ue=p.customTrajectory;this.background=A,pb(N)==="object"&&(this.gridSize=N.size),this.rootEl=g,this.editConfigModel=new Cp(p),this.eventCenter=new Up,this.transformModel=new Jh(this.eventCenter,p),this.theme=iu(p.style),this.edgeType=p.edgeType||"polyline",this.width=p.width,this.height=p.height,this.animation=(y=oe)&&typeof y!="boolean"?bc(Uo(_v),y):Uo(y===!0?Ey:_v),this.partial=p.partial,this.overlapMode=p.overlapMode||0,this.idGenerator=V,this.customTrajectory=ue,this.edgeGenerator=Nr(this,H),this.width=p.width||this.rootEl.getBoundingClientRect().width,this.height=p.height||this.rootEl.getBoundingClientRect().height,this.flowId=tl()}var u,d;return u=c,d=[{key:"nodesMap",get:function(){return this.nodes.reduce((function(p,y,g){return p[y.id]={index:g,model:y},p}),{})}},{key:"edgesMap",get:function(){return this.edges.reduce((function(p,y,g){return p[y.id]={index:g,model:y},p}),{})}},{key:"modelsMap",get:function(){return[].concat(Rc(this.nodes),Rc(this.edges)).reduce((function(p,y){return p[y.id]=y,p}),{})}},{key:"sortElements",get:function(){var p=[];this.nodes.forEach((function(V){return p.push(V)})),this.edges.forEach((function(V){return p.push(V)})),p=p.sort((function(V,H){return V.zIndex-H.zIndex}));for(var y=[],g=[-200,-200],b=[this.width+sT,this.height+sT],A=0;A<p.length;A++){var N=p[A];N.visible&&(!this.partial||N.isSelected||this.isElementInArea(N,g,b,!1,!1))&&y.push(N)}return y}},{key:"textEditElement",get:function(){var p=this.nodes.find((function(g){return g.state===Io.TEXT_EDIT})),y=this.edges.find((function(g){return g.state===Io.TEXT_EDIT}));return p||y}},{key:"selectElements",get:function(){var p=new Map;return this.nodes.forEach((function(y){y.isSelected&&p.set(y.id,y)})),this.edges.forEach((function(y){y.isSelected&&p.set(y.id,y)})),p}},{key:"selectNodes",get:function(){var p=[];return this.nodes.forEach((function(y){y.isSelected&&p.push(y)})),p}},{key:"getAreaElement",value:function(p,y){var g=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],b=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=arguments.length>4&&arguments[4]!==void 0&&arguments[4],N=[],V=[];this.nodes.forEach((function(ue){return V.push(ue)})),this.edges.forEach((function(ue){return V.push(ue)}));for(var H=0;H<V.length;H++){var oe=V[H];A&&!oe.visible||!this.isElementInArea(oe,p,y,g,b)||N.push(oe)}return N}},{key:"getModel",value:function(p){return this.modelMap.get(p)}},{key:"getNodeModelById",value:function(p){var y;return this.fakerNode&&p===this.fakerNode.id?this.fakerNode:(y=this.nodesMap[p])===null||y===void 0?void 0:y.model}},{key:"getPointByClient",value:function(p){var y=p.x,g=p.y,b=this.rootEl.getBoundingClientRect(),A={x:y-b.left,y:g-b.top},N=Wf(this.transformModel.HtmlPointToCanvasPoint([A.x,A.y]),2);return{domOverlayPosition:A,canvasOverlayPosition:{x:N[0],y:N[1]}}}},{key:"isElementInArea",value:function(p,y,g){var b=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(p.BaseType===ei.NODE){for(var N=mi(p=p),V=N.minX,H=N.minY,oe=N.maxX,ue=N.maxY,Ne=[{x:V,y:H},{x:oe,y:H},{x:oe,y:ue},{x:V,y:ue}],Ve=A,qe=0;qe<Ne.length;qe++){var Ot=Ne[qe],xt=Ot.x,Ft=Ot.y,vn=this.transformModel.CanvasPointToHtmlPoint([xt,Ft]),Hn=Wf(vn,2);if(xt=Hn[0],Ft=Hn[1],md([xt,Ft],y,g)!==A){Ve=!A;break}}return Ve}if(p.BaseType===ei.EDGE){var zn=p=p,Ar=zn.startPoint,Vn=zn.endPoint,vr=this.transformModel.CanvasPointToHtmlPoint([Ar.x,Ar.y]),er=this.transformModel.CanvasPointToHtmlPoint([Vn.x,Vn.y]),Eo=md(vr,y,g),Co=md(er,y,g);return b?Eo&&Co:Eo||Co}return!1}},{key:"graphDataToModel",value:function(p){var y=this;if(this.width&&this.height||this.resize(),!p)return this.nodes=[],void(this.edges=[]);p.nodes?this.nodes=Op(p.nodes,(function(g){return y.getModelAfterSnapToGrid(g)})):this.nodes=[],p.edges?this.edges=Op(p.edges,(function(g){var b=y.getModel(g.type);if(!b)throw new Error("找不到".concat(g.type,"对应的边。"));return new b(g,y)})):this.edges=[]}},{key:"modelToGraphData",value:function(){var p=[];this.edges.forEach((function(g){var b=g.getData();b&&!g.virtual&&p.push(b)}));var y=[];return this.nodes.forEach((function(g){var b=g.getData();b&&!g.virtual&&y.push(b)})),{nodes:y,edges:p}}},{key:"modelToHistoryData",value:function(){for(var p=!1,y=[],g=0;g<this.nodes.length;g++){var b=this.nodes[g];if(b.isDragging){p=!0;break}y.push(b.getHistoryData())}if(p)return!1;for(var A=!1,N=[],V=0;V<this.edges.length;V++){var H=this.edges[V];if(H.isDragging){A=!0;break}N.push(H.getHistoryData())}return!A&&{nodes:y,edges:N}}},{key:"getEdgeModelById",value:function(p){var y;return(y=this.edgesMap[p])===null||y===void 0?void 0:y.model}},{key:"getElement",value:function(p){return this.modelsMap[p]}},{key:"getNodeEdges",value:function(p){for(var y=[],g=0;g<this.edges.length;g++){var b=this.edges[g],A=this.edges[g].sourceNodeId===p,N=this.edges[g].targetNodeId===p;(A||N)&&y.push(b)}return y}},{key:"getSelectElements",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],y=this.selectElements,g={nodes:[],edges:[]};return y.forEach((function(b){if(b.BaseType===ei.NODE&&g.nodes.push(b.getData()),b.BaseType===ei.EDGE){var A=b.getData(),N=y.get(A.sourceNodeId)&&y.get(A.targetNodeId);(p||N)&&g.edges.push(A)}})),g}},{key:"updateAttributes",value:function(p,y){this.getElement(p).updateAttributes(y)}},{key:"changeNodeId",value:function(p,y){return y||(y=tl()),this.nodesMap[y]?"":this.nodesMap[p]?(this.edges.forEach((function(g){g.sourceNodeId===p&&(g.sourceNodeId=y),g.targetNodeId===p&&(g.targetNodeId=y)})),this.nodesMap[p].model.id=y,this.nodesMap[y]=this.nodesMap[p],y):""}},{key:"changeEdgeId",value:function(p,y){return y||(y=tl()),this.edgesMap[y]?"":this.edgesMap[p]?(this.edges.forEach((function(g){g.id===p&&g.changeEdgeId(y)})),y):""}},{key:"setFakerNode",value:function(p){this.fakerNode=p}},{key:"removeFakerNode",value:function(){this.fakerNode=null}},{key:"setModel",value:function(p,y){return this.modelMap.set(p,y)}},{key:"toFront",value:function(p){var y,g,b,A=((y=this.nodesMap[p])===null||y===void 0?void 0:y.model)||((g=this.edgesMap[p])===null||g===void 0?void 0:g.model);A&&(this.overlapMode===Ei.DEFAULT&&((b=this.topElement)===null||b===void 0||b.setZIndex(),A.setZIndex(9999),this.topElement=A),this.overlapMode===Ei.INCREASE&&this.setElementZIndex(p,"top"))}},{key:"setElementZIndex",value:function(p,y){var g,b,A,N=((g=this.nodesMap[p])===null||g===void 0?void 0:g.model)||((b=this.edgesMap[p])===null||b===void 0?void 0:b.model);N&&(typeof y=="number"&&(A=y),y==="top"&&(A=Tc()),y==="bottom"&&(A=--jf),N.setZIndex(A))}},{key:"deleteNode",value:function(p){var y=this.nodesMap[p].model.getData();this.deleteEdgeBySource(p),this.deleteEdgeByTarget(p),this.nodes.splice(this.nodesMap[p].index,1),this.eventCenter.emit(ur.NODE_DELETE,{data:y})}},{key:"addNode",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,g=arguments.length>2?arguments[2]:void 0,b=ga(p);b.id&&this.nodesMap[p.id]&&delete b.id;var A=this.getModelAfterSnapToGrid(b);this.nodes.push(A);var N=A.getData(),V={data:N};return g&&(V.e=g),this.eventCenter.emit(y,V),A}},{key:"getModelAfterSnapToGrid",value:function(p){var y=this.getModel(p.type);if(!y)throw new Error("找不到".concat(p.type,"对应的节点,请确认是否已注册此类型节点。"));var g=p.x,b=p.y;return g&&b&&(p.x=fs(g,this.gridSize),p.y=fs(b,this.gridSize),pb(p.text)==="object"&&(p.text.x+=p.x-g,p.text.y+=p.y-b)),new y(p,this)}},{key:"cloneNode",value:function(p){var y=this.getNodeModelById(p),g=y.getData();g.x+=30,g.y+=30,delete g.id,g.text&&(g.text.x+=30,g.text.y+=30);var b=this.addNode(g);return b.setSelected(!0),y.setSelected(!1),b.getData()}},{key:"moveNode",value:function(p,y,g){var b=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,V=N.getMoveDistance(y,g,b),H=Wf(V,2);y=H[0],g=H[1],this.moveEdge(p,y,g)}}},{key:"moveNode2Coordinate",value:function(p,y,g){var b=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,V=N.x,H=N.y,oe=y-V,ue=g-H;this.moveNode(p,oe,ue,b)}}},{key:"editText",value:function(p){this.setElementStateById(p,Io.TEXT_EDIT)}},{key:"addEdge",value:function(p){var y=ga(p),g=y.type;g||(g=this.edgeType),y.id&&this.edgesMap[y.id]&&delete y.id;var b=this.getModel(g);if(!b)throw new Error("找不到".concat(g,"对应的边,请确认是否已注册此类型边。"));var A=new b(Vf(Vf({},y),{},{type:g}),this),N=A.getData();return this.edges.push(A),this.eventCenter.emit(ur.EDGE_ADD,{data:N}),A}},{key:"moveEdge",value:function(p,y,g){for(var b=0;b<this.edges.length;b++){var A=this.edges[b],N=A.textPosition,V=N.x,H=N.y,oe=this.edges[b].sourceNodeId===p,ue=this.edges[b].targetNodeId===p;oe&&A.moveStartPoint(y,g),ue&&A.moveEndPoint(y,g),(oe||ue)&&this.handleEdgeTextMove(A,V,H)}}},{key:"handleEdgeTextMove",value:function(p,y,g){var b;if(p.customTextPosition===!0)p.resetTextPosition();else if(p.modelType===lo.POLYLINE_EDGE&&(b=p.text)!==null&&b!==void 0&&b.value){var A=p.text,N=co(A,p.points);p.moveText(N.x-A.x,N.y-A.y)}else{var V=p.textPosition,H=V.x,oe=V.y;p.moveText(H-y,oe-g)}}},{key:"deleteEdgeBySourceAndTarget",value:function(p,y){for(var g=0;g<this.edges.length;g++)if(this.edges[g].sourceNodeId===p&&this.edges[g].targetNodeId===y){var b=this.edges[g].getData();this.edges.splice(g,1),g--,this.eventCenter.emit(ur.EDGE_DELETE,{data:b})}}},{key:"deleteEdgeById",value:function(p){if(this.edgesMap[p]){var y=this.edgesMap[p].index,g=this.edgesMap[p].model.getData();this.edges.splice(y,1),this.eventCenter.emit(ur.EDGE_DELETE,{data:g})}}},{key:"deleteEdgeBySource",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].sourceNodeId===p){var g=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:g})}}},{key:"deleteEdgeByTarget",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].targetNodeId===p){var g=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:g})}}},{key:"setElementStateById",value:function(p,y,g){this.nodes.forEach((function(b){b.id===p?b.setElementState(y,g):b.setElementState(Io.DEFAULT)})),this.edges.forEach((function(b){b.id===p?b.setElementState(y,g):b.setElementState(Io.DEFAULT)}))}},{key:"updateText",value:function(p,y){this.nodes.forEach((function(g){g.id===p&&g.updateText(y)})),this.edges.forEach((function(g){g.id===p&&g.updateText(y)}))}},{key:"selectNodeById",value:function(p){var y,g=arguments.length>1&&arguments[1]!==void 0&&arguments[1];g||this.clearSelectElements();var b=(y=this.nodesMap[p])===null||y===void 0?void 0:y.model;b==null||b.setSelected(!0)}},{key:"selectEdgeById",value:function(p){var y,g=arguments.length>1&&arguments[1]!==void 0&&arguments[1];g||this.clearSelectElements();var b=(y=this.edgesMap[p])===null||y===void 0?void 0:y.model;b==null||b.setSelected(!0)}},{key:"selectElementById",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0&&arguments[1];y||this.clearSelectElements();var g=this.getElement(p);g==null||g.setSelected(!0)}},{key:"clearSelectElements",value:function(){var p;this.selectElements.forEach((function(y){y==null||y.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Ei.DEFAULT&&((p=this.topElement)===null||p===void 0||p.setZIndex())}},{key:"moveNodes",value:function(p,y,g){for(var b=this,A=arguments.length>3&&arguments[3]!==void 0&&arguments[3],N=p.reduce((function(zn,Ar){var Vn=b.nodesMap[Ar].model.getMoveDistance(y,g,A);return zn[Ar]=Vn,zn}),{}),V=0;V<this.edges.length;V++){var H=this.edges[V],oe=H.textPosition,ue=oe.x,Ne=oe.y,Ve=N[H.sourceNodeId],qe=N[H.targetNodeId],Ot=void 0,xt=void 0;if(Ve&&qe&&H.modelType===lo.POLYLINE_EDGE){var Ft=Wf(Ve,2);Ot=Ft[0],xt=Ft[1],H.updatePointsList(Ot,xt)}else{if(Ve){var vn=Wf(Ve,2);Ot=vn[0],xt=vn[1],H.moveStartPoint(Ot,xt)}if(qe){var Hn=Wf(qe,2);Ot=Hn[0],xt=Hn[1],H.moveEndPoint(Ot,xt)}}(Ve||qe)&&this.handleEdgeTextMove(H,ue,Ne)}}},{key:"addNodeMoveRules",value:function(p){this.nodeMoveRules.includes(p)||this.nodeMoveRules.push(p)}},{key:"setDefaultEdgeType",value:function(p){this.edgeType=p}},{key:"changeNodeType",value:function(p,y){var g=this.getNodeModelById(p);if(g){var b=g.getData();b.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));var N=new A(b,this);this.nodes.splice(this.nodesMap[p].index,1,N),this.getNodeEdges(p).forEach((function(V){if(V.sourceNodeId===p){var H=Rf(N,V.startPoint,N.width,N.height);V.updateStartPoint(H)}if(V.targetNodeId===p){var oe=Rf(N,V.endPoint,N.width,N.height);V.updateEndPoint(oe)}}))}}},{key:"changeEdgeType",value:function(p,y){var g=this.getEdgeModelById(p);if(g&&g.type!==y){var b=g.getData();b.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));delete b.pointsList;var N=new A(b,this);this.edges.splice(this.edgesMap[p].index,1,N)}}},{key:"getNodeIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(g){g.targetNodeId===p&&y.push(g)})),y}},{key:"getNodeOutgoingEdge",value:function(p){var y=[];return this.edges.forEach((function(g){g.sourceNodeId===p&&y.push(g)})),y}},{key:"getAnchorIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(g){g.targetAnchorId===p&&y.push(g)})),y}},{key:"getAnchorOutcomingEdge",value:function(p){var y=[];return this.edges.forEach((function(g){g.sourceAnchorId===p&&y.push(g)})),y}},{key:"getNodeIncomingNode",value:function(p){var y=this,g=[];return this.edges.forEach((function(b){b.targetNodeId===p&&g.push(y.nodesMap[b.sourceNodeId].model)})),g}},{key:"getNodeOutgoingNode",value:function(p){var y=this,g=[];return this.edges.forEach((function(b){b.sourceNodeId===p&&g.push(y.nodesMap[b.targetNodeId].model)})),g}},{key:"setTheme",value:function(p){this.theme=iu(Vf(Vf({},this.theme),p))}},{key:"resize",value:function(p,y){this.width=p||this.rootEl.getBoundingClientRect().width,this.height=y||this.rootEl.getBoundingClientRect().height,!this.width||this.height}},{key:"clearData",value:function(){this.nodes=[],this.edges=[]}},{key:"getVirtualRectSize",value:function(){var p=this.nodes,y=[],g=[];p.forEach((function(oe){var ue=oe.x,Ne=oe.y,Ve=oe.width,qe=oe.height,Ot=oe.getNodeStyle().strokeWidth,xt=Ot===void 0?0:Ot,Ft=ue+Ve/2+xt,vn=ue-Ve/2-xt,Hn=Ne+qe/2+xt,zn=Ne-qe/2-xt;y=y.concat([Ft,vn].filter((function(Ar){return!Number.isNaN(Ar)}))),g=g.concat([Hn,zn].filter((function(Ar){return!Number.isNaN(Ar)})))}));var b=Math.min.apply(Math,Rc(y)),A=Math.max.apply(Math,Rc(y)),N=Math.min.apply(Math,Rc(g)),V=A-b||0,H=Math.max.apply(Math,Rc(g))-N||0;return{virtualRectWidth:V,virtualRectHeight:H,virtualRectCenterPositionX:b+V/2,virtualRectCenterPositionY:N+H/2}}},{key:"translateCenter",value:function(){var p=this.nodes,y=this.width,g=this.height,b=this.rootEl,A=this.transformModel;if(p.length){var N=y||b.clientWidth,V=g||b.clientHeight,H=this.getVirtualRectSize(),oe=H.virtualRectCenterPositionX,ue=H.virtualRectCenterPositionY;A.focusOn(oe,ue,N,V)}}},{key:"fitView",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:20,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,g=this.nodes,b=this.width,A=this.height,N=this.rootEl,V=this.transformModel;if(g.length){var H=b||N.clientWidth,oe=A||N.clientHeight,ue=this.getVirtualRectSize(),Ne=ue.virtualRectWidth,Ve=ue.virtualRectHeight,qe=ue.virtualRectCenterPositionX,Ot=ue.virtualRectCenterPositionY,xt=(Ne+y)/H,Ft=(Ve+p)/oe,vn=0;vn=1/Math.max(xt,Ft);var Hn=[H/2,oe/2];V.zoom(vn,Hn),V.focusOn(qe,Ot,H,oe)}}},{key:"openEdgeAnimation",value:function(p){this.getEdgeModelById(p).openEdgeAnimation()}},{key:"closeEdgeAnimation",value:function(p){this.getEdgeModelById(p).closeEdgeAnimation()}}],d&&v5(u.prototype,d),c})(),Yr=Tr(at.prototype,"width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ao=Tr(at.prototype,"height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Mr=Tr(at.prototype,"edgeType",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ur=Tr(at.prototype,"nodes",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),xa=Tr(at.prototype,"edges",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),Hl=Tr(at.prototype,"overlapMode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Ei.DEFAULT}}),uu=Tr(at.prototype,"background",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oa=Tr(at.prototype,"transformModel",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Iu=Tr(at.prototype,"editConfigModel",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pc=Tr(at.prototype,"gridSize",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),th=Tr(at.prototype,"partial",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yv=Tr(at.prototype,"fakerNode",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tr(at.prototype,"nodesMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"nodesMap"),at.prototype),Tr(at.prototype,"edgesMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"edgesMap"),at.prototype),Tr(at.prototype,"modelsMap",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"modelsMap"),at.prototype),Tr(at.prototype,"sortElements",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"sortElements"),at.prototype),Tr(at.prototype,"textEditElement",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"textEditElement"),at.prototype),Tr(at.prototype,"selectElements",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"selectElements"),at.prototype),Tr(at.prototype,"selectNodes",[a.m],Object.getOwnPropertyDescriptor(at.prototype,"selectNodes"),at.prototype),Tr(at.prototype,"setFakerNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setFakerNode"),at.prototype),Tr(at.prototype,"removeFakerNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"removeFakerNode"),at.prototype),Tr(at.prototype,"setModel",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setModel"),at.prototype),Tr(at.prototype,"toFront",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"toFront"),at.prototype),Tr(at.prototype,"setElementZIndex",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setElementZIndex"),at.prototype),Tr(at.prototype,"deleteNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteNode"),at.prototype),Tr(at.prototype,"addNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"addNode"),at.prototype),Tr(at.prototype,"cloneNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"cloneNode"),at.prototype),Tr(at.prototype,"moveNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNode"),at.prototype),Tr(at.prototype,"moveNode2Coordinate",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNode2Coordinate"),at.prototype),Tr(at.prototype,"editText",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"editText"),at.prototype),Tr(at.prototype,"addEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"addEdge"),at.prototype),Tr(at.prototype,"moveEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveEdge"),at.prototype),Tr(at.prototype,"deleteEdgeBySourceAndTarget",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeBySourceAndTarget"),at.prototype),Tr(at.prototype,"deleteEdgeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeById"),at.prototype),Tr(at.prototype,"deleteEdgeBySource",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeBySource"),at.prototype),Tr(at.prototype,"deleteEdgeByTarget",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"deleteEdgeByTarget"),at.prototype),Tr(at.prototype,"setElementStateById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setElementStateById"),at.prototype),Tr(at.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"updateText"),at.prototype),Tr(at.prototype,"selectNodeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectNodeById"),at.prototype),Tr(at.prototype,"selectEdgeById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectEdgeById"),at.prototype),Tr(at.prototype,"selectElementById",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"selectElementById"),at.prototype),Tr(at.prototype,"clearSelectElements",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"clearSelectElements"),at.prototype),Tr(at.prototype,"moveNodes",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"moveNodes"),at.prototype),Tr(at.prototype,"setDefaultEdgeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setDefaultEdgeType"),at.prototype),Tr(at.prototype,"changeNodeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"changeNodeType"),at.prototype),Tr(at.prototype,"changeEdgeType",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"changeEdgeType"),at.prototype),Tr(at.prototype,"getNodeIncomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeIncomingEdge"),at.prototype),Tr(at.prototype,"getNodeOutgoingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeOutgoingEdge"),at.prototype),Tr(at.prototype,"getAnchorIncomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getAnchorIncomingEdge"),at.prototype),Tr(at.prototype,"getAnchorOutcomingEdge",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getAnchorOutcomingEdge"),at.prototype),Tr(at.prototype,"getNodeIncomingNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeIncomingNode"),at.prototype),Tr(at.prototype,"getNodeOutgoingNode",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"getNodeOutgoingNode"),at.prototype),Tr(at.prototype,"setTheme",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"setTheme"),at.prototype),Tr(at.prototype,"resize",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"resize"),at.prototype),Tr(at.prototype,"clearData",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"clearData"),at.prototype),Tr(at.prototype,"translateCenter",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"translateCenter"),at.prototype),Tr(at.prototype,"fitView",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"fitView"),at.prototype),Tr(at.prototype,"openEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"openEdgeAnimation"),at.prototype),Tr(at.prototype,"closeEdgeAnimation",[a.k],Object.getOwnPropertyDescriptor(at.prototype,"closeEdgeAnimation"),at.prototype),at),g5=uT;function mE(c){return mE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},mE(c)}function yE(){return yE=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},yE.apply(this,arguments)}function m5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function _E(c,u){return _E=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},_E(c,u)}function y5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=hb(c);if(u){var y=hb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return _5(this,d)}}function _5(c,u){if(u&&(mE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ad(c)}function Ad(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function hb(c){return hb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},hb(c)}function Gf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var cT,b5=Fc(lT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&_E(g,b)})(y,c);var u,d,p=y5(y);function y(g){var b;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Gf(Ad(b=p.call(this)),"stepDrag",void 0),Gf(Ad(b),"stepScrollX",0),Gf(Ad(b),"stepScrollY",0),Gf(Ad(b),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY;b.setState({isDragging:!0});var Ne=b.props.graphModel,Ve=Ne.transformModel;Ne.editConfigModel.stopMoveGraph!==!0&&Ve.translate(oe,ue)})),Gf(Ad(b),"onDragEnd",(function(){b.setState({isDragging:!1})})),Gf(Ad(b),"zoomHandler",(function(H){var oe=b.props,ue=oe.graphModel,Ne=ue.editConfigModel,Ve=ue.transformModel,qe=ue.gridSize,Ot=oe.graphModel,xt=H.deltaX,Ft=H.deltaY;if(Ne.stopScrollGraph||H.ctrlKey===!0){if(!Ne.stopZoomGraph){H.preventDefault();var vn=Ot.getPointByClient({x:H.clientX,y:H.clientY}).canvasOverlayPosition,Hn=vn.x,zn=vn.y;Ve.zoom(H.deltaY<0,[Hn,zn])}}else{if(H.preventDefault(),b.stepScrollX+=xt,b.stepScrollY+=Ft,Math.abs(b.stepScrollX)>=qe){var Ar=b.stepScrollX%qe,Vn=b.stepScrollX-Ar;Ve.translate(-Vn*Ve.SCALE_X,0),b.stepScrollX=Ar}if(Math.abs(b.stepScrollY)>=qe){var vr=b.stepScrollY%qe,er=b.stepScrollY-vr;Ve.translate(0,-er*Ve.SCALE_Y),b.stepScrollY=vr}}})),Gf(Ad(b),"clickHandler",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){var oe=b.props.graphModel;oe.selectElements.size>0&&oe.clearSelectElements(),oe.eventCenter.emit(ur.BLANK_CLICK,{e:H})}})),Gf(Ad(b),"handleContextMenu",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){H.preventDefault();var oe=b.props.graphModel,ue=oe.getPointByClient({x:H.clientX,y:H.clientY});oe.eventCenter.emit(ur.BLANK_CONTEXTMENU,{e:H,position:ue})}})),Gf(Ad(b),"mouseDownHandler",(function(H){var oe=b.props.graphModel,ue=oe.eventCenter,Ne=oe.editConfigModel,Ve=oe.transformModel.SCALE_X,qe=oe.gridSize,Ot=H.target,xt=!Ne.adjustEdge&&!Ne.adjustNodePosition;(Ot.getAttribute("name")==="canvas-overlay"||xt)&&(Ne.stopMoveGraph!==!0?(b.stepDrag.setStep(qe*Ve),b.stepDrag.handleMouseDown(H)):ue.emit(ur.BLANK_MOUSEDOWN,{e:H}),b.clickHandler(H))}));var A=g.graphModel,N=A.gridSize,V=A.eventCenter;return b.stepDrag=new Ce({onDragging:b.onDragging,onDragEnd:b.onDragEnd,step:N,eventType:"BLANK",isStopPropagation:!1,eventCenter:V,model:null}),b.state={isDragging:!1},b}return u=y,(d=[{key:"render",value:function(){var g=this.props.graphModel.transformModel.getTransformStyle().transform,b=this.props,A=b.children,N=b.dnd,V=this.state.isDragging;return Object(re.g)("svg",yE({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:V?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},N.eventMap()),Object(re.g)("g",{transform:g},A))}}])&&m5(u.prototype,d),y})(re.a))||lT;function bE(c){return bE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bE(c)}function w5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function E5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function wE(c,u){return wE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wE(c,u)}function x5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=vb(c);if(u){var y=vb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return O5(this,d)}}function O5(c,u){if(u&&(bE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function vb(c){return vb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},vb(c)}var S5=Fc(cT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&wE(g,b)})(y,c);var u,d,p=x5(y);function y(){return w5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"componentDidMount",value:function(){this.triggerToolRender()}},{key:"componentDidUpdate",value:function(){this.triggerToolRender()}},{key:"getTools",value:function(){var g=this.props,b=g.tool,A=g.graphModel,N=b.getTools().map((function(V){return Object(re.g)(V,{graphModel:A,logicFlow:b.instance})}));return b.components=N,N}},{key:"triggerToolRender",value:function(){var g=this.props,b=g.tool,A=g.graphModel,N=document.querySelector("#ToolOverlay_".concat(A.flowId)),V=b.getInstance();V.components.forEach((function(H){return H(V,N)})),V.components=[]}},{key:"render",value:function(){var g=this.props.graphModel;return Object(re.g)("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(g.flowId)},this.getTools())}}])&&E5(u.prototype,d),y})(re.a))||cT;function EE(c){return EE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},EE(c)}function A5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function M5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function xE(c,u){return xE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},xE(c,u)}function T5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=gb(c);if(u){var y=gb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return C5(this,d)}}function C5(c,u){if(u&&(EE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function gb(c){return gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},gb(c)}var dT,N5=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&xE(g,b)})(y,c);var u,d,p=T5(y);function y(){return A5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var g=this.props.background;return Object(re.g)("div",{className:"lf-background"},Object(re.g)("div",{style:g,className:"lf-background-area"}))}}])&&M5(u.prototype,d),y})(re.a);function OE(c){return OE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},OE(c)}function k5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function P5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function SE(c,u){return SE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},SE(c,u)}function R5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=mb(c);if(u){var y=mb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return D5(this,d)}}function D5(c,u){if(u&&(OE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fT(c)}function fT(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function mb(c){return mb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},mb(c)}function j5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var pT=Fc(dT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&SE(g,b)})(y,c);var u,d,p=R5(y);function y(){var g;k5(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return j5(fT(g=p.call.apply(p,[this].concat(A))),"id",tl()),g}return u=y,(d=[{key:"renderDot",value:function(){var g=this.props,b=g.config,A=b.color,N=b.thickness,V=N===void 0?2:N,H=g.size,oe=g.visible,ue=Math.min(Math.max(2,V),H/2),Ne=1;return oe||(Ne=0),Object(re.g)("rect",{width:ue,height:ue,rx:ue/2,ry:ue/2,fill:A,opacity:Ne})}},{key:"renderMesh",value:function(){var g=this.props,b=g.config,A=b.color,N=b.thickness,V=N===void 0?1:N,H=g.size,oe=g.visible,ue=Math.min(Math.max(1,V),H/2),Ne="M ".concat(H," 0 H0 M0 0 V0 ").concat(H),Ve=1;return oe||(Ve=0),Object(re.g)("path",{d:Ne,stroke:A,strokeWidth:ue,opacity:Ve})}},{key:"render",value:function(){var g=this.props,b=g.type,A=g.size,N=g.graphModel.transformModel,V=[N.SCALE_X,N.SKEW_Y,N.SKEW_X,N.SCALE_Y,N.TRANSLATE_X,N.TRANSLATE_Y].join(","),H="matrix(".concat(V,")");return Object(re.g)("div",{className:"lf-grid"},Object(re.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%"},Object(re.g)("defs",null,Object(re.g)("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:H,x:"0",y:"0",width:A,height:A},b==="dot"&&this.renderDot(),b==="mesh"&&this.renderMesh())),Object(re.g)("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})))}}])&&P5(u.prototype,d),y})(re.a))||dT;pT.defaultProps={size:20,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},r(53);function AE(c){return AE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},AE(c)}function L5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return hT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return hT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function hT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var vT,Fg=function(c){var u={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(c).forEach((function(d){var p=L5(d,2),y=p[0],g=p[1];(y==="style"||AE(g)!=="object")&&(u[y]=g)})),Object(re.g)("line",u)};function ME(c){return ME=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ME(c)}function gT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function yb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gT(Object(d),!0).forEach((function(p){I5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function I5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function F5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function B5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function TE(c,u){return TE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},TE(c,u)}function $5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=_b(c);if(u){var y=_b(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return U5(this,d)}}function U5(c,u){if(u&&(ME(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function _b(c){return _b=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},_b(c)}var mT,V5=Fc(vT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&TE(g,b)})(y,c);var u,d,p=$5(y);function y(){return F5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var g=this.props.snaplineModel,b=g.position,A=g.isShowHorizontal,N=g.isShowVertical,V=g.getStyle(),H=b.x,oe=H===void 0?0:H,ue=b.y,Ne=ue===void 0?0:ue,Ve=yb(yb({x1:-1e5,y1:Ne,x2:1e5,y2:Ne},V),{},{stroke:A?V.stroke:"none"}),qe=yb(yb({x1:oe,y1:-1e5,x2:oe,y2:1e5},V),{},{stroke:N?V.stroke:"none"});return Object(re.g)("g",{className:"lf-snapline"},Object(re.g)(Fg,Ve),Object(re.g)(Fg,qe))}}])&&B5(u.prototype,d),y})(re.a))||vT;function CE(c){return CE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},CE(c)}function W5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return yT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return yT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function yT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function rh(c){var u=c.x,d=c.y,p=c.width,y=c.height,g=c.className,b=c.radius,A=u-p/2,N=d-y/2,V={};return Object.entries(c).forEach((function(H){var oe=W5(H,2),ue=oe[0],Ne=oe[1];CE(Ne)!=="object"&&(V[ue]=Ne)})),V.className=g?"lf-basic-shape ".concat(g):"lf-basic-shape",b&&(V.rx=b,V.ry=b),V.x=A,V.y=N,Object(re.g)("rect",V)}function NE(c){return NE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},NE(c)}function Bg(){return Bg=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Bg.apply(this,arguments)}function _T(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function bT(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?_T(Object(d),!0).forEach((function(p){G5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):_T(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function G5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function z5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function H5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function kE(c,u){return kE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kE(c,u)}function X5(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=bb(c);if(u){var y=bb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Y5(this,d)}}function Y5(c,u){if(u&&(NE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function bb(c){return bb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},bb(c)}rh.defaultProps={className:"",radius:""};var wT,q5=Fc(mT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&kE(g,b)})(y,c);var u,d,p=X5(y);function y(){return z5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getNodesOutline",value:function(){var g=this.props.graphModel,b=g.nodes,A=g.editConfigModel,N=A.hoverOutline,V=A.nodeSelectedOutline,H=[];return b.forEach((function(oe){if(oe.isHovered||oe.isSelected){var ue=oe.isHovered,Ne=oe.isSelected,Ve=oe.x,qe=oe.y,Ot=oe.width,xt=oe.height;if(V&&Ne||N&&ue){var Ft=oe.getOutlineStyle(),vn={};if(Object.keys(Ft).forEach((function(zn){zn!=="hover"&&(vn[zn]=Ft[zn])})),ue){var Hn=Ft.hover;vn=bT(bT({},vn),Hn)}H.push(Object(re.g)(rh,Bg({transform:oe.transform,className:"lf-outline-node",x:Ve,y:qe,width:Ot+10,height:xt+10},vn)))}}})),H}},{key:"getEdgeOutline",value:function(){for(var g=this.props.graphModel,b=g.edges,A=g.editConfigModel,N=A.edgeSelectedOutline,V=A.hoverOutline,H=[],oe=0;oe<b.length;oe++){var ue=b[oe];(N&&ue.isSelected||V&&ue.isHovered)&&(ue.modelType===lo.LINE_EDGE?H.push(this.getLineOutline(ue)):ue.modelType===lo.POLYLINE_EDGE?H.push(this.getPolylineOutline(ue)):ue.modelType===lo.BEZIER_EDGE&&H.push(this.getBezierOutline(ue)))}return H}},{key:"getLineOutline",value:function(g){var b=g.startPoint,A=g.endPoint,N=(b.x+A.x)/2,V=(b.y+A.y)/2,H=Math.abs(b.x-A.x)+10,oe=Math.abs(b.y-A.y)+10,ue=g.getOutlineStyle();return Object(re.g)(rh,Bg({className:"lf-outline-edge",x:N,y:V,width:H,height:oe},ue))}},{key:"getPolylineOutline",value:function(g){var b=g.points,A=jr(b),N=St(A,8),V=N.x,H=N.y,oe=N.width,ue=N.height,Ne=g.getOutlineStyle();return Object(re.g)(rh,Bg({className:"lf-outline",x:V,y:H,width:oe,height:ue},Ne))}},{key:"getBezierOutline",value:function(g){var b=g.path,A=di(b),N=St(A,8),V=N.x,H=N.y,oe=N.width,ue=N.height,Ne=g.getOutlineStyle();return Object(re.g)(rh,Bg({className:"lf-outline",x:V,y:H,width:oe,height:ue},Ne))}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-outline"},this.getNodesOutline(),this.getEdgeOutline())}}])&&H5(u.prototype,d),y})(re.a))||mT;function PE(c){return PE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},PE(c)}function K5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ET(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ET(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ET(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function $g(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,g=c.r,b=g===void 0?4:g,A=c.className,N={cx:d,cy:y,r:b,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(V){var H=K5(V,2),oe=H[0],ue=H[1];PE(ue)!=="object"&&(N[oe]=ue)})),N.className=A?"lf-basic-shape ".concat(A):"lf-basic-shape",Object(re.g)("circle",N)}function RE(c){return RE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},RE(c)}function Z5(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return xT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return xT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function xT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function xy(){return xy=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},xy.apply(this,arguments)}function OT(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function J5(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function ST(c,u,d){return u&&J5(c.prototype,u),c}function AT(c,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(u&&u.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),u&&DE(c,u)}function DE(c,u){return DE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},DE(c,u)}function MT(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Eb(c);if(u){var y=Eb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Q5(this,d)}}function Q5(c,u){if(u&&(RE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wb(c)}function wb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Eb(c){return Eb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Eb(c)}function jE(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var TT,CT=(function(c){AT(d,c);var u=MT(d);function d(){var p;return OT(this,d),jE(wb(p=u.call(this)),"dragHandler",void 0),jE(wb(p),"onDragging",(function(y){var g=y.event,b=p.props,A=b.graphModel,N=b.bezierModel,V=b.type,H=A.getPointByClient({x:g.clientX,y:g.clientY}).canvasOverlayPosition,oe=H.x,ue=H.y;N.updateAdjustAnchor({x:oe,y:ue},V),A.eventCenter.emit(ur.EDGE_ADJUST,{data:N.getData()})})),jE(wb(p),"onDragEnd",(function(){p.props.bezierModel.isDragging=!1})),p.dragHandler=new Ce({onDragging:p.onDragging,onDragEnd:p.onDragEnd}),p}return ST(d,[{key:"render",value:function(){var p=this,y=this.props.position,g=y.x,b=y.y,A=this.props.bezierModel.getEdgeStyle().adjustAnchor;return Object(re.g)($g,xy({className:"lf-bezier-adjust-anchor",x:g,y:b},A,{onMouseDown:function(N){p.dragHandler.handleMouseDown(N)}}))}}]),d})(re.a),e6=Fc(wT=(function(c){AT(d,c);var u=MT(d);function d(){return OT(this,d),u.apply(this,arguments)}return ST(d,[{key:"getBezierAdjust",value:function(p,y){var g=p.path,b=p.id,A=Z5(di(g),4),N=A[0],V=A[1],H=A[2],oe=A[3],ue=p.getEdgeStyle().adjustLine,Ne=[];return Ne.push(Object(re.g)(Fg,xy({x1:N.x,y1:N.y,x2:V.x,y2:V.y},ue))),Ne.push(Object(re.g)(CT,{position:V,bezierModel:p,graphModel:y,key:"".concat(b,"_ePre"),type:"sNext"})),Ne.push(Object(re.g)(Fg,xy({x1:oe.x,y1:oe.y,x2:H.x,y2:H.y},ue))),Ne.push(Object(re.g)(CT,{position:H,bezierModel:p,graphModel:y,key:"".concat(b,"_sNext"),type:"ePre"})),Ne}},{key:"selectedBezierEdge",value:function(){for(var p=this.props.graphModel,y=p.edges,g=[],b=0;b<y.length;b++){var A=y[b];A.isSelected&&A.modelType===lo.BEZIER_EDGE&&A.draggable&&g.push(this.getBezierAdjust(A,p))}return g}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-bezier-adjust"},this.selectedBezierEdge())}}]),d})(re.a))||wT;function LE(c){return LE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},LE(c)}function t6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function n6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function IE(c,u){return IE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},IE(c,u)}function r6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=xb(c);if(u){var y=xb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return o6(this,d)}}function o6(c,u){if(u&&(LE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function xb(c){return xb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},xb(c)}var NT,i6=Fc(TT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&IE(g,b)})(y,c);var u,d,p=r6(y);function y(){return t6(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var g=this.props.graphModel.transformModel.getTransformStyle().transform,b=this.props.children;return Object(re.g)("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay"},Object(re.g)("g",{transform:g},b))}}])&&n6(u.prototype,d),y})(re.a))||TT;function FE(c){return FE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},FE(c)}function BE(){return BE=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},BE.apply(this,arguments)}function a6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function l6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function $E(c,u){return $E=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},$E(c,u)}function s6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ob(c);if(u){var y=Ob(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return u6(this,d)}}function u6(c,u){if(u&&(FE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Ob(c){return Ob=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ob(c)}var c6=Fc(NT=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&$E(g,b)})(y,c);var u,d,p=s6(y);function y(){return a6(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getComponent",value:function(g,b){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"canvas-overlay",N=this.props.getView,V=N(g.type);return Object(re.g)(V,{key:g.id,model:g,graphModel:b,overlay:A})}},{key:"render",value:function(){var g=this,b=this.props,A=b.graphModel,N=b.tool,V=b.options,H=b.dnd,oe=b.snaplineModel,ue={};V.width&&(ue.width="".concat(A.width,"px")),V.height&&(ue.height="".concat(A.height,"px"));var Ne=V.grid,Ve=A.fakerNode,qe=A.editConfigModel.adjustEdge;return Object(re.g)("div",{className:"lf-graph","flow-id":A.flowId,style:ue},Object(re.g)(b5,{graphModel:A,dnd:H},Object(re.g)("g",{className:"lf-base"},Op(A.sortElements,(function(Ot){return g.getComponent(Ot,A)}))),Ve?this.getComponent(Ve,A):""),Object(re.g)(i6,{graphModel:A},Object(re.g)(q5,{graphModel:A}),qe?Object(re.g)(e6,{graphModel:A}):"",V.snapline!==!1?Object(re.g)(V5,{snaplineModel:oe}):""),Object(re.g)(S5,{graphModel:A,tool:N}),V.background&&Object(re.g)(N5,{background:V.background}),V.grid&&Object(re.g)(pT,BE({},Ne,{graphModel:A})))}}],d&&l6(u.prototype,d),y})(re.a))||NT,d6=c6;function kT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Sb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?kT(Object(d),!0).forEach((function(p){zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):kT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function f6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function zf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var p6=(function(){function c(p){var y=this;(function(b,A){if(!(b instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),zf(this,"nodeConfig",void 0),zf(this,"lf",void 0),zf(this,"fakerNode",void 0),zf(this,"stopDrag",(function(){y.nodeConfig=null,window.document.removeEventListener("mouseup",y.stopDrag)})),zf(this,"dragEnter",(function(b){y.nodeConfig&&!y.fakerNode&&(y.fakerNode=y.lf.createFakerNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:b.clientX,y:b.clientY}))))})),zf(this,"onDragOver",(function(b){if(b.preventDefault(),y.fakerNode){var A=y.clientToLocalPoint({x:b.clientX,y:b.clientY}),N=A.x,V=A.y;y.fakerNode.moveTo(N,V);var H=y.fakerNode.getData();y.lf.setNodeSnapLine(H),y.lf.graphModel.eventCenter.emit(ur.NODE_DND_DRAG,{data:H})}return!1})),zf(this,"onDragLeave",(function(){y.fakerNode&&(y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)})),zf(this,"onDrop",(function(b){y.lf.graphModel&&b&&y.nodeConfig&&(y.lf.addNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:b.clientX,y:b.clientY})),ur.NODE_DND_ADD,b),b.preventDefault(),b.stopPropagation(),y.nodeConfig=null,y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)}));var g=p.lf;this.lf=g}var u,d;return u=c,(d=[{key:"clientToLocalPoint",value:function(p){var y=p.x,g=p.y,b=uc(this.lf.options,["grid","size"]),A=this.lf.graphModel.getPointByClient({x:y,y:g}).canvasOverlayPosition,N=A.x,V=A.y;return{x:fs(N,b),y:fs(V,b)}}},{key:"startDrag",value:function(p){var y=this.lf.graphModel.editConfigModel;y!=null&&y.isSilentMode||(this.nodeConfig=p,window.document.addEventListener("mouseup",this.stopDrag))}},{key:"eventMap",value:function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}}}])&&f6(u.prototype,d),c})();function PT(c){var u=c.container,d=c.grid,p=c.width,y=c.height;if(!u)throw new Error("请检查 container 参数是否有效");if(typeof p=="string"||typeof y=="string")throw new Error("width或height不支持传入字符串,请传数字");return d&&(c.grid=bc({size:20,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}},d)),bc({},DT,c)}var Zo,RT,DT={background:!1,grid:!1,textEdit:!0,disabledTools:[]};function UE(c){return UE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},UE(c)}function VE(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return jT(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return jT(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function jT(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function LT(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ab(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?LT(Object(d),!0).forEach((function(p){IT(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):LT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function h6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function v6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function g6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Oy(){return Oy=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=m6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Oy.apply(this,arguments)}function m6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=oh(c))!==null;);return c}function WE(c,u){return WE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},WE(c,u)}function y6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=oh(c);if(u){var y=oh(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return _6(this,d)}}function _6(c,u){if(u&&(UE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mb(c)}function Mb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function oh(c){return oh=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},oh(c)}function IT(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function jc(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var GE=(Zo=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&WE(g,b)})(y,c);var u,d,p=y6(y);function y(){var g;v6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return IT(Mb(g=p.call.apply(p,[this].concat(A))),"modelType",lo.BEZIER_EDGE),h6(Mb(g),"path",RT,Mb(g)),g}return u=y,(d=[{key:"initEdgeData",value:function(g){this.offset=100,Oy(oh(y.prototype),"initEdgeData",this).call(this,g)}},{key:"getEdgeStyle",value:function(){var g=this.graphModel.theme.bezier;return Ab(Ab({},Oy(oh(y.prototype),"getEdgeStyle",this).call(this)),Uo(g))}},{key:"getTextPosition",value:function(){if(this.pointsList&&this.pointsList.length>0){var g=0,b=0;return this.pointsList.forEach((function(A){var N=A.x,V=A.y;g+=N,b+=V})),{x:g/this.pointsList.length,y:b/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}},{key:"getData",value:function(){var g=Oy(oh(y.prototype),"getData",this).call(this),b=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Ab(Ab({},g),{},{pointsList:b})}},{key:"getControls",value:function(){var g=this.startPoint,b=this.endPoint;return zi({start:g,end:b,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})}},{key:"getPath",value:function(g){var b=VE(g,4),A=b[0],N=b[1],V=b[2],H=b[3];return"M ".concat(A.x," ").concat(A.y,`
|
||
C `).concat(N.x," ").concat(N.y,`,
|
||
`).concat(V.x," ").concat(V.y,`,
|
||
`).concat(H.x," ").concat(H.y)}},{key:"initPoints",value:function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()}},{key:"updatePoints",value:function(){var g=this.getControls(),b=g.sNext,A=g.ePre;this.updatePath(b,A)}},{key:"updatePath",value:function(g,b){g=Uo(g),b=Uo(b);var A={x:this.startPoint.x,y:this.startPoint.y},N={x:this.endPoint.x,y:this.endPoint.y};if(!g||!b){var V=this.getControls();g=V.sNext,b=V.ePre}this.pointsList=[A,g,b,N],this.path=this.getPath(this.pointsList)}},{key:"updateStartPoint",value:function(g){this.startPoint=Object.assign({},g),this.updatePoints()}},{key:"updateEndPoint",value:function(g){this.endPoint=Object.assign({},g),this.updatePoints()}},{key:"moveStartPoint",value:function(g,b){this.startPoint.x+=g,this.startPoint.y+=b;var A=VE(this.pointsList,3),N=A[1],V=A[2];N.x+=g,N.y+=b,this.updatePath(N,V)}},{key:"moveEndPoint",value:function(g,b){this.endPoint.x+=g,this.endPoint.y+=b;var A=VE(this.pointsList,3),N=A[1],V=A[2];V.x+=g,V.y+=b,this.updatePath(N,V)}},{key:"updateAdjustAnchor",value:function(g,b){b==="sNext"?this.pointsList[1]=g:b==="ePre"&&(this.pointsList[2]=g),this.path=this.getPath(this.pointsList),this.setText(Object.assign({},this.text,this.textPosition))}},{key:"getAdjustStart",value:function(){return this.pointsList[0]||this.startPoint}},{key:"getAdjustEnd",value:function(){var g=this.pointsList;return g[g.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(g){var b=g.startPoint,A=g.endPoint,N=g.sourceNode,V=g.targetNode,H=zi({start:b,end:A,sourceNode:N,targetNode:V,offset:this.offset}),oe=H.sNext,ue=H.ePre;this.pointsList=[b,oe,ue,A],this.initPoints()}}])&&g6(u.prototype,d),y})(If),RT=jc(Zo.prototype,"path",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),jc(Zo.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"initPoints"),Zo.prototype),jc(Zo.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updatePoints"),Zo.prototype),jc(Zo.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateStartPoint"),Zo.prototype),jc(Zo.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateEndPoint"),Zo.prototype),jc(Zo.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveStartPoint"),Zo.prototype),jc(Zo.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveEndPoint"),Zo.prototype),jc(Zo.prototype,"updateAdjustAnchor",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAdjustAnchor"),Zo.prototype),jc(Zo.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustStart"),Zo.prototype),jc(Zo.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustEnd"),Zo.prototype),jc(Zo.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAfterAdjustStartAndEnd"),Zo.prototype),Zo),Dn,FT,BT,$T,UT,VT,WT,GT,zT,HT,XT,YT,qT,KT,ZT,JT,QT,eC,tC,nC,rC,oC,iC,b6=function(c){return c==null};function w6(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||aC(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function zE(c){return zE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},zE(c)}function aC(c,u){if(c){if(typeof c=="string")return lC(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?lC(c,u):void 0}}function lC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function sC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function ys(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?sC(Object(d),!0).forEach((function(p){Us(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):sC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Sa(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function E6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Us(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function fo(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var Hf,uC,Xf=(Dn=(function(){function c(p,y){(function(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),Us(this,"id",""),Sa(this,"type",FT,this),Sa(this,"x",BT,this),Sa(this,"y",$T,this),Sa(this,"text",UT,this),Sa(this,"properties",VT,this),Sa(this,"_width",WT,this),Sa(this,"_height",GT,this),Sa(this,"anchorsOffset",zT,this),Sa(this,"isSelected",HT,this),Sa(this,"isHovered",XT,this),Sa(this,"isShowAnchor",YT,this),Sa(this,"isDragging",qT,this),Sa(this,"isHitable",KT,this),Sa(this,"draggable",ZT,this),Sa(this,"visible",JT,this),Sa(this,"enableRotate",QT,this),Us(this,"virtual",!1),Us(this,"graphModel",void 0),Sa(this,"zIndex",eC,this),Sa(this,"state",tC,this),Sa(this,"autoToFront",nC,this),Sa(this,"style",rC,this),Sa(this,"transform",oC,this),Sa(this,"_rotate",iC,this),Us(this,"BaseType",ei.NODE),Us(this,"modelType",lo.NODE),Us(this,"additionStateData",void 0),Us(this,"targetRules",[]),Us(this,"sourceRules",[]),Us(this,"moveRules",[]),Us(this,"hasSetTargetRules",!1),Us(this,"hasSetSourceRules",!1),this.graphModel=y,this.initNodeData(p),this.setAttributes()}var u,d;return u=c,d=[{key:"width",get:function(){return this._width},set:function(p){this._width=p}},{key:"height",get:function(){return this._height},set:function(p){this._height=p}},{key:"rotate",get:function(){return this._rotate},set:function(p){this._rotate=p;var y=this.x,g=y===void 0?0:y,b=this.y,A=b===void 0?0:b;this.transform=new nh(-g,-A).rotate(p).translate(g,A).toString()}},{key:"incoming",get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}}},{key:"outgoing",get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}}},{key:"initNodeData",value:function(p){if(p.properties||(p.properties={}),!p.id){var y=this.graphModel.idGenerator,g=y&&y(p.type),b=this.createId();p.id=b||g||tl()}this.formatText(p),Pa(this,(function(A){return cs(A,["id","type","x","y","text","properties","virtual","rotate"])})(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Tc())}},{key:"setAttributes",value:function(){}},{key:"createId",value:function(){return null}},{key:"formatText",value:function(p){p.text||(p.text={value:"",x:p.x,y:p.y,draggable:!1,editable:!0}),p.text&&typeof p.text=="string"?p.text={value:p.text,x:p.x,y:p.y,draggable:!1,editable:!0}:p.text&&p.text.editable===void 0&&(p.text.editable=!0)}},{key:"getData",value:function(){var p=this.text,y=p.x,g=p.y,b=p.value,A=this.properties;Object(a.x)(A)&&(A=Object(a.I)(A));var N={id:this.id,type:this.type,x:this.x,y:this.y,properties:A};return this.rotate&&(N.rotate=this.rotate),this.graphModel.overlapMode===Ei.INCREASE&&(N.zIndex=this.zIndex),b&&(N.text={x:y,y:g,value:b}),N}},{key:"getHistoryData",value:function(){return this.getData()}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getOuterGAttributes",value:function(){return{className:""}}},{key:"getNodeStyle",value:function(){return ys(ys({},this.graphModel.theme.baseNode),this.style)}},{key:"getTextStyle",value:function(){var p=this.graphModel.theme.nodeText;return Uo(p)}},{key:"getRotateControlStyle",value:function(){var p=this.graphModel.theme.rotateControl;return Uo(p)}},{key:"getAnchorStyle",value:function(p){var y=this.graphModel.theme.anchor;return Uo(y)}},{key:"getAnchorLineStyle",value:function(p){var y=this.graphModel.theme.anchorLine;return Uo(y)}},{key:"getOutlineStyle",value:function(){var p=this.graphModel.theme.outline;return Uo(p)}},{key:"isAllowConnectedAsSource",value:function(p,y,g,b){var A=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var N,V=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,this,p,y,g,b)){V=!1,N=oe.message;break}}return{isAllPass:V,msg:N}}},{key:"getConnectedSourceRules",value:function(){return this.sourceRules}},{key:"isAllowConnectedAsTarget",value:function(p,y,g,b){var A=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var N,V=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,p,this,y,g,b)){V=!1,N=oe.message;break}}return{isAllPass:V,msg:N}}},{key:"isAllowMoveNode",value:function(p,y){var g,b=!0,A=!0,N=(function(oe,ue){var Ne=typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(!Ne){if(Array.isArray(oe)||(Ne=aC(oe))||ue){Ne&&(oe=Ne);var Ve=0,qe=function(){};return{s:qe,n:function(){return Ve>=oe.length?{done:!0}:{done:!1,value:oe[Ve++]}},e:function(vn){throw vn},f:qe}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ot,xt=!0,Ft=!1;return{s:function(){Ne=Ne.call(oe)},n:function(){var vn=Ne.next();return xt=vn.done,vn},e:function(vn){Ft=!0,Ot=vn},f:function(){try{xt||Ne.return==null||Ne.return()}finally{if(Ft)throw Ot}}}})(this.moveRules.concat(this.graphModel.nodeMoveRules));try{for(N.s();!(g=N.n()).done;){var V=(0,g.value)(this,p,y);if(!V)return!1;if(zE(V)==="object"){var H=V;if(H.x===!1&&H.y===!1)return!1;b=b&&H.x,A=A&&H.y}}}catch(oe){N.e(oe)}finally{N.f()}return{x:b,y:A}}},{key:"getConnectedTargetRules",value:function(){return this.targetRules}},{key:"getAnchorsByOffset",value:function(){var p=this.anchorsOffset,y=this.id,g=this.x,b=this.y;return p&&p.length>0?p.map((function(A,N){return A.length?(A=A,{id:"".concat(y,"_").concat(N),x:g+A[0],y:b+A[1]}):ys(ys({},A=A),{},{x:g+A.x,y:b+A.y,id:A.id||"".concat(y,"_").concat(N)})})):this.getDefaultAnchor()}},{key:"getDefaultAnchor",value:function(){return[]}},{key:"getTargetAnchor",value:function(p){return(function(y,g){for(var b,A=Kp(g),N=Number.MAX_SAFE_INTEGER,V=0;V<A.length;V++){var H=gs(y.x,y.y,A[V].x,A[V].y);H<N&&(N=H,b={index:V,anchor:Fs(Fs({},A[V]),{},{x:A[V].x,y:A[V].y,id:A[V].id})})}return b})(p,this)}},{key:"getBounds",value:function(){return{x1:this.x-this.width/2,y1:this.y-this.height/2,x2:this.x+this.width/2,y2:this.y+this.height/2}}},{key:"anchors",get:function(){var p=this.getAnchorsByOffset(),y=this.x,g=this.y,b=this.rotate;return p.forEach((function(A){var N=A.x,V=A.y,H=w6(new Fu([N,V,1]).translate(-y,-g).rotate(b).translate(y,g)[0],2),oe=H[0],ue=H[1];A.x=oe,A.y=ue})),p}},{key:"getAnchorInfo",value:function(p){if(!b6(p))for(var y=0;y<this.anchors.length;y++){var g=this.anchors[y];if(g.id===p)return g}}},{key:"addNodeMoveRules",value:function(p){this.moveRules.includes(p)||this.moveRules.push(p)}},{key:"move",value:function(p,y){var g=arguments.length>2&&arguments[2]!==void 0&&arguments[2],b=!1,A=!1;if(g)b=!0,A=!0;else{var N=this.isAllowMoveNode(p,y);typeof N=="boolean"?(b=N,A=N):(b=N.x,A=N.y)}if(b){var V=this.x+p;this.x=V,this.text&&this.moveText(p,0)}if(A){var H=this.y+y;this.y=H,this.text&&this.moveText(0,y)}return b||A}},{key:"getMoveDistance",value:function(p,y){var g=arguments.length>2&&arguments[2]!==void 0&&arguments[2],b=!1,A=!1,N=0,V=0;if(g)b=!0,A=!0;else{var H=this.isAllowMoveNode(p,y);typeof H=="boolean"?(b=H,A=H):(b=H.x,A=H.y)}if(b&&p){var oe=this.x+p;this.x=oe,this.text&&this.moveText(p,0),N=p}if(A&&y){var ue=this.y+y;this.y=ue,this.text&&this.moveText(0,y),V=y}return[N,V]}},{key:"moveTo",value:function(p,y){var g=arguments.length>2&&arguments[2]!==void 0&&arguments[2],b=p-this.x,A=y-this.y;return!(!g&&!this.isAllowMoveNode(b,A)||(this.text&&this.text&&this.moveText(b,A),this.x=p,this.y=y,0))}},{key:"moveText",value:function(p,y){var g=this.text,b=g.x,A=g.y,N=g.value,V=g.draggable,H=g.editable;this.text={value:N,editable:H,draggable:V,x:b+p,y:A+y}}},{key:"updateText",value:function(p){this.text=ys(ys({},Object(a.I)(this.text)),{},{value:p})}},{key:"setSelected",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isSelected=p}},{key:"setHovered",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHovered=p,this.setIsShowAnchor(p)}},{key:"setIsShowAnchor",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isShowAnchor=p}},{key:"setEnableRotate",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.enableRotate=p}},{key:"setHitable",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];this.isHitable=p}},{key:"setElementState",value:function(p,y){this.state=p,this.additionStateData=y}},{key:"setProperty",value:function(p,y){this.properties=ys(ys({},Object(a.I)(this.properties)),{},Us({},p,ga(y))),this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=ys(ys({},Object(a.I)(this.properties)),ga(p)),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setStyle",value:function(p,y){this.style=ys(ys({},this.style),{},Us({},p,ga(y)))}},{key:"setStyles",value:function(p){this.style=ys(ys({},this.style),ga(p))}},{key:"updateStyles",value:function(p){this.style=ys({},ga(p))}},{key:"setZIndex",value:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.zIndex=p}},{key:"updateAttributes",value:function(p){Pa(this,p)}}],d&&E6(u.prototype,d),c})(),FT=fo(Dn.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),BT=fo(Dn.prototype,"x",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),$T=fo(Dn.prototype,"y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),UT=fo(Dn.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),VT=fo(Dn.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),WT=fo(Dn.prototype,"_width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),GT=fo(Dn.prototype,"_height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),zT=fo(Dn.prototype,"anchorsOffset",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),HT=fo(Dn.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),XT=fo(Dn.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),YT=fo(Dn.prototype,"isShowAnchor",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),qT=fo(Dn.prototype,"isDragging",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),KT=fo(Dn.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),ZT=fo(Dn.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),JT=fo(Dn.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),QT=fo(Dn.prototype,"enableRotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),eC=fo(Dn.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),tC=fo(Dn.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),nC=fo(Dn.prototype,"autoToFront",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),rC=fo(Dn.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),oC=fo(Dn.prototype,"transform",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),iC=fo(Dn.prototype,"_rotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),fo(Dn.prototype,"incoming",[a.m],Object.getOwnPropertyDescriptor(Dn.prototype,"incoming"),Dn.prototype),fo(Dn.prototype,"outgoing",[a.m],Object.getOwnPropertyDescriptor(Dn.prototype,"outgoing"),Dn.prototype),fo(Dn.prototype,"addNodeMoveRules",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"addNodeMoveRules"),Dn.prototype),fo(Dn.prototype,"move",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"move"),Dn.prototype),fo(Dn.prototype,"getMoveDistance",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"getMoveDistance"),Dn.prototype),fo(Dn.prototype,"moveTo",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"moveTo"),Dn.prototype),fo(Dn.prototype,"moveText",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"moveText"),Dn.prototype),fo(Dn.prototype,"updateText",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateText"),Dn.prototype),fo(Dn.prototype,"setSelected",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setSelected"),Dn.prototype),fo(Dn.prototype,"setHovered",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setHovered"),Dn.prototype),fo(Dn.prototype,"setIsShowAnchor",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setIsShowAnchor"),Dn.prototype),fo(Dn.prototype,"setEnableRotate",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setEnableRotate"),Dn.prototype),fo(Dn.prototype,"setHitable",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setHitable"),Dn.prototype),fo(Dn.prototype,"setElementState",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setElementState"),Dn.prototype),fo(Dn.prototype,"setProperty",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setProperty"),Dn.prototype),fo(Dn.prototype,"setProperties",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setProperties"),Dn.prototype),fo(Dn.prototype,"deleteProperty",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"deleteProperty"),Dn.prototype),fo(Dn.prototype,"setStyle",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setStyle"),Dn.prototype),fo(Dn.prototype,"setStyles",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setStyles"),Dn.prototype),fo(Dn.prototype,"updateStyles",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateStyles"),Dn.prototype),fo(Dn.prototype,"setZIndex",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"setZIndex"),Dn.prototype),fo(Dn.prototype,"updateAttributes",[a.k],Object.getOwnPropertyDescriptor(Dn.prototype,"updateAttributes"),Dn.prototype),Dn);function HE(c){return HE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},HE(c)}function cC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function dC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?cC(Object(d),!0).forEach((function(p){fC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):cC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function x6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function O6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function S6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function XE(){return XE=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=A6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},XE.apply(this,arguments)}function A6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Ug(c))!==null;);return c}function YE(c,u){return YE=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},YE(c,u)}function M6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ug(c);if(u){var y=Ug(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return T6(this,d)}}function T6(c,u){if(u&&(HE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tb(c)}function Tb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ug(c){return Ug=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ug(c)}function fC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function qE(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var Xl,pC,hC,KE=(Hf=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&YE(g,b)})(y,c);var u,d,p=M6(y);function y(){var g;O6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return fC(Tb(g=p.call.apply(p,[this].concat(A))),"modelType",lo.CIRCLE_NODE),x6(Tb(g),"r",uC,Tb(g)),g}return u=y,(d=[{key:"width",get:function(){return 2*this.r}},{key:"height",get:function(){return 2*this.r}},{key:"getNodeStyle",value:function(){var g=XE(Ug(y.prototype),"getNodeStyle",this).call(this),b=this.graphModel.theme.circle;return dC(dC({},g),Uo(b))}},{key:"getDefaultAnchor",value:function(){var g=this.x,b=this.y,A=this.r;return[{x:g,y:b-A,id:"".concat(this.id,"_0")},{x:g+A,y:b,id:"".concat(this.id,"_1")},{x:g,y:b+A,id:"".concat(this.id,"_2")},{x:g-A,y:b,id:"".concat(this.id,"_3")}]}}])&&S6(u.prototype,d),y})(Xf),uC=qE(Hf.prototype,"r",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),qE(Hf.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"width"),Hf.prototype),qE(Hf.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"height"),Hf.prototype),Hf);r(129);function ZE(c){return ZE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ZE(c)}function JE(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return vC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return vC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function vC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function gC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function mC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gC(Object(d),!0).forEach((function(p){_C(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function yC(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function C6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function N6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function QE(){return QE=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=k6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},QE.apply(this,arguments)}function k6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Wg(c))!==null;);return c}function ex(c,u){return ex=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ex(c,u)}function P6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Wg(c);if(u){var y=Wg(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return R6(this,d)}}function R6(c,u){if(u&&(ZE(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vg(c)}function Vg(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Wg(c){return Wg=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Wg(c)}function _C(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Gg(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var Md,bC,wC,tx=(Xl=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&ex(g,b)})(y,c);var u,d,p=P6(y);function y(){var g;C6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return _C(Vg(g=p.call.apply(p,[this].concat(A))),"modelType",lo.DIAMOND_NODE),yC(Vg(g),"rx",pC,Vg(g)),yC(Vg(g),"ry",hC,Vg(g)),g}return u=y,(d=[{key:"getNodeStyle",value:function(){var g=QE(Wg(y.prototype),"getNodeStyle",this).call(this),b=this.graphModel.theme.diamond;return mC(mC({},g),Uo(b))}},{key:"points",get:function(){var g=this.x,b=this.y,A=this.rx,N=this.ry;return[[g,b-N],[g+A,b],[g,b+N],[g-A,b]]}},{key:"pointsPosition",get:function(){return this.points.map((function(g){return{x:g[0],y:g[1]}}))}},{key:"width",get:function(){var g=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=JE(A,1)[0];N<g&&(g=N),N>b&&(b=N)})),b-g}},{key:"height",get:function(){var g=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=JE(A,2)[1];N<g&&(g=N),N>b&&(b=N)})),b-g}},{key:"getDefaultAnchor",value:function(){var g=this;return this.points.map((function(b,A){var N=JE(b,2);return{x:N[0],y:N[1],id:"".concat(g.id,"_").concat(A)}}))}}])&&N6(u.prototype,d),y})(Xf),pC=Gg(Xl.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),hC=Gg(Xl.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),Gg(Xl.prototype,"points",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"points"),Xl.prototype),Gg(Xl.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"pointsPosition"),Xl.prototype),Gg(Xl.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"width"),Xl.prototype),Gg(Xl.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Xl.prototype,"height"),Xl.prototype),Xl);function nx(c){return nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},nx(c)}function EC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?EC(Object(d),!0).forEach((function(p){SC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):EC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function OC(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function D6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function j6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function rx(){return rx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=L6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},rx.apply(this,arguments)}function L6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Hg(c))!==null;);return c}function ox(c,u){return ox=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ox(c,u)}function I6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Hg(c);if(u){var y=Hg(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return F6(this,d)}}function F6(c,u){if(u&&(nx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zg(c)}function zg(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Hg(c){return Hg=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hg(c)}function SC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Cb(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var $u,AC,ix=(Md=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&ox(g,b)})(y,c);var u,d,p=I6(y);function y(){var g;D6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return SC(zg(g=p.call.apply(p,[this].concat(A))),"modelType",lo.ELLIPSE_NODE),OC(zg(g),"rx",bC,zg(g)),OC(zg(g),"ry",wC,zg(g)),g}return u=y,(d=[{key:"getNodeStyle",value:function(){var g=rx(Hg(y.prototype),"getNodeStyle",this).call(this),b=this.graphModel.theme.ellipse;return xC(xC({},g),Uo(b))}},{key:"width",get:function(){return 2*this.rx}},{key:"height",get:function(){return 2*this.ry}},{key:"getDefaultAnchor",value:function(){var g=this.x,b=this.y,A=this.rx,N=this.ry;return[{x:g,y:b-N,id:"".concat(this.id,"_0")},{x:g+A,y:b,id:"".concat(this.id,"_1")},{x:g,y:b+N,id:"".concat(this.id,"_2")},{x:g-A,y:b,id:"".concat(this.id,"_3")}]}}])&&j6(u.prototype,d),y})(Xf),bC=Cb(Md.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),wC=Cb(Md.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 45}}),Cb(Md.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Md.prototype,"width"),Md.prototype),Cb(Md.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Md.prototype,"height"),Md.prototype),Md);function ax(c){return ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ax(c)}function lx(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return MC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return MC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function MC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function TC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function CC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?TC(Object(d),!0).forEach((function(p){NC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):TC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function B6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function $6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function U6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function sx(){return sx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=V6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},sx.apply(this,arguments)}function V6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Xg(c))!==null;);return c}function ux(c,u){return ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ux(c,u)}function W6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Xg(c);if(u){var y=Xg(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return G6(this,d)}}function G6(c,u){if(u&&(ax(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nb(c)}function Nb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Xg(c){return Xg=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xg(c)}function NC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function kb(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var cx,kC,dx=($u=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&ux(g,b)})(y,c);var u,d,p=W6(y);function y(){var g;$6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return NC(Nb(g=p.call.apply(p,[this].concat(A))),"modelType",lo.POLYGON_NODE),B6(Nb(g),"points",AC,Nb(g)),g}return u=y,(d=[{key:"getNodeStyle",value:function(){var g=sx(Xg(y.prototype),"getNodeStyle",this).call(this),b=this.graphModel.theme.polygon;return CC(CC({},g),Uo(b))}},{key:"pointsPosition",get:function(){var g=this.x,b=this.y,A=this.width,N=this.height;return this.points.map((function(V){return{x:V[0]+g-A/2,y:V[1]+b-N/2}}))}},{key:"width",get:function(){var g=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=lx(A,1)[0];N<g&&(g=N),N>b&&(b=N)})),b-g}},{key:"height",get:function(){var g=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=lx(A,2)[1];N<g&&(g=N),N>b&&(b=N)})),b-g}},{key:"getDefaultAnchor",value:function(){var g=this,b=this.x,A=this.y,N=this.width,V=this.height;return this.points.map((function(H,oe){var ue=lx(H,2),Ne=ue[0],Ve=ue[1];return{x:b+Ne-N/2,y:A+Ve-V/2,id:"".concat(g.id,"_").concat(oe)}}))}}])&&U6(u.prototype,d),y})(Xf),AC=kb($u.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[[50,0],[100,50],[50,100],[0,50]]}}),kb($u.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"pointsPosition"),$u.prototype),kb($u.prototype,"width",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"width"),$u.prototype),kb($u.prototype,"height",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"height"),$u.prototype),$u);function fx(c){return fx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},fx(c)}function PC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function RC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?PC(Object(d),!0).forEach((function(p){DC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):PC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function z6(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function H6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function X6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function px(){return px=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=Y6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},px.apply(this,arguments)}function Y6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Yg(c))!==null;);return c}function hx(c,u){return hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hx(c,u)}function q6(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Yg(c);if(u){var y=Yg(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return K6(this,d)}}function K6(c,u){if(u&&(fx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pb(c)}function Pb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Yg(c){return Yg=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Yg(c)}function DC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var ih,vx=(cx=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&hx(g,b)})(y,c);var u,d,p=q6(y);function y(){var g;H6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return DC(Pb(g=p.call.apply(p,[this].concat(A))),"modelType",lo.RECT_NODE),z6(Pb(g),"radius",kC,Pb(g)),g}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var g=this.x,b=this.y,A=this.width,N=this.height;return[{x:g,y:b-N/2,id:"".concat(this.id,"_0")},{x:g+A/2,y:b,id:"".concat(this.id,"_1")},{x:g,y:b+N/2,id:"".concat(this.id,"_2")},{x:g-A/2,y:b,id:"".concat(this.id,"_3")}]}},{key:"getNodeStyle",value:function(){var g=px(Yg(y.prototype),"getNodeStyle",this).call(this),b=this.graphModel.theme.rect;return RC(RC({},g),Uo(b))}}])&&X6(u.prototype,d),y})(Xf),kC=(function(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g})(cx.prototype,"radius",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),cx);function gx(c){return gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},gx(c)}function jC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function LC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?jC(Object(d),!0).forEach((function(p){FC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):jC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Z6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function J6(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function mx(){return mx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=Q6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},mx.apply(this,arguments)}function Q6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=qg(c))!==null;);return c}function yx(c,u){return yx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yx(c,u)}function eF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=qg(c);if(u){var y=qg(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return tF(this,d)}}function tF(c,u){if(u&&(gx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IC(c)}function IC(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qg(c){return qg=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qg(c)}function FC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function BC(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var _x=(ih=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&yx(g,b)})(y,c);var u,d,p=eF(y);function y(){var g;Z6(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return FC(IC(g=p.call.apply(p,[this].concat(A))),"modelType",lo.TEXT_NODE),g}return u=y,(d=[{key:"getTextStyle",value:function(){var g=mx(qg(y.prototype),"getTextStyle",this).call(this),b=this.graphModel.theme.text;return LC(LC({},g),Uo(b))}},{key:"width",get:function(){var g=String(this.text.value).split(/[\r\n]/g),b=this.getTextStyle().fontSize;return Mc({rows:g,fontSize:b,rowsLength:g.length}).width}},{key:"height",get:function(){var g=String(this.text.value).split(/[\r\n]/g),b=this.getTextStyle().fontSize;return Mc({rows:g,fontSize:b,rowsLength:g.length}).height}}])&&J6(u.prototype,d),y})(Xf),BC(ih.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(ih.prototype,"width"),ih.prototype),BC(ih.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(ih.prototype,"height"),ih.prototype),ih);function bx(c){return bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bx(c)}function nF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function rF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function wx(c,u){return wx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wx(c,u)}function oF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Rb(c);if(u){var y=Rb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return iF(this,d)}}function iF(c,u){if(u&&(bx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $C(c)}function $C(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Rb(c){return Rb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Rb(c)}function aF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Lc,UC,VC,WC,Ex=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&wx(g,b)})(y,c);var u,d,p=oF(y);function y(){var g;nF(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return aF($C(g=p.call.apply(p,[this].concat(A))),"modelType",lo.HTML_NODE),g}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var g=this.x,b=this.y,A=this.width,N=this.height;return[{x:g,y:b-N/2,id:"".concat(this.id,"_0")},{x:g+A/2,y:b,id:"".concat(this.id,"_1")},{x:g,y:b+N/2,id:"".concat(this.id,"_2")},{x:g-A/2,y:b,id:"".concat(this.id,"_3")}]}}])&&rF(u.prototype,d),y})(Xf);function GC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xx(c,u,d,p){d&&Object.defineProperty(c,u,{enumerable:d.enumerable,configurable:d.configurable,writable:d.writable,value:d.initializer?d.initializer.call(p):void 0})}function lF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function zC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Sy(c,u,d,p,y){var g={};return Object.keys(p).forEach((function(b){g[b]=p[b]})),g.enumerable=!!g.enumerable,g.configurable=!!g.configurable,("value"in g||g.initializer)&&(g.writable=!0),g=d.slice().reverse().reduce((function(b,A){return A(c,u,b)||b}),g),y&&g.initializer!==void 0&&(g.value=g.initializer?g.initializer.call(y):void 0,g.initializer=void 0),g.initializer===void 0&&(Object.defineProperty(c,u,g),g=null),g}var HC=(Lc=(function(){function c(p){(function(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),zC(this,"graphModel",void 0),xx(this,"isShowHorizontal",UC,this),xx(this,"isShowVertical",VC,this),xx(this,"position",WC,this),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=p}var u,d;return u=c,d=[{key:"getStyle",value:function(){return(function(p){for(var y=1;y<arguments.length;y++){var g=arguments[y]!=null?arguments[y]:{};y%2?GC(Object(g),!0).forEach((function(b){zC(p,b,g[b])})):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(g)):GC(Object(g)).forEach((function(b){Object.defineProperty(p,b,Object.getOwnPropertyDescriptor(g,b))}))}return p})({},this.graphModel.theme.snapline)}},{key:"getCenterSnapLine",value:function(p,y){for(var g=p.x,b=p.y,A=!1,N=!1,V=0;V<y.length;V++){var H=y[V];if(H.id!==p.id&&(g===H.x&&(A=!0),b===H.y&&(N=!0),A&&N))break}return{isShowVertical:A,isShowHorizontal:N,position:{x:g,y:b}}}},{key:"getHorizontalSnapline",value:function(p,y){var g,b,A=!1,N=p.id;if(N){var V=this.graphModel.fakerNode;if(V&&V.id===N)b=mi(V);else{var H=this.graphModel.getNodeModelById(N);b=mi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ne=mi(ue);if(Ne.minY===b.minY||Ne.maxY===b.minY){A=!0,g=b.minY;break}if(Ne.minY===b.maxY||Ne.maxY===b.maxY){A=!0,g=b.maxY;break}}}return Pa({isShowHorizontal:A,position:{y:g}})}},{key:"getVerticalSnapline",value:function(p,y){var g,b,A=!1,N=p.id;if(N){var V=this.graphModel.fakerNode;if(V&&V.id===N)b=mi(V);else{var H=this.graphModel.getNodeModelById(N);b=mi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ne=mi(ue);if(Ne.minX===b.minX||Ne.maxX===b.minX){A=!0,g=b.minX;break}if(Ne.minX===b.maxX||Ne.maxX===b.maxX){A=!0,g=b.maxX;break}}}return Pa({isShowVertical:A,position:{x:g}})}},{key:"getSnapLinePosition",value:function(p,y){var g=this.getCenterSnapLine(p,y),b=g.isShowHorizontal,A=g.isShowVertical;if(!b){var N=this.getHorizontalSnapline(p,y);N.isShowHorizontal&&(g.isShowHorizontal=N.isShowHorizontal,g.position.y=N.position.y)}if(!A){var V=this.getVerticalSnapline(p,y);V.isShowVertical&&(g.isShowVertical=V.isShowVertical,g.position.x=V.position.x)}return g}},{key:"setSnaplineInfo",value:function(p){var y=p.isShowHorizontal,g=p.isShowVertical,b=p.position;this.position=b,this.isShowHorizontal=y,this.isShowVertical=g}},{key:"clearSnapline",value:function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1}},{key:"setNodeSnapLine",value:function(p){var y=this.graphModel.nodes,g=this.getSnapLinePosition(p,y);this.setSnaplineInfo(g)}}],d&&lF(u.prototype,d),c})(),UC=Sy(Lc.prototype,"isShowHorizontal",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),VC=Sy(Lc.prototype,"isShowVertical",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),WC=Sy(Lc.prototype,"position",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sy(Lc.prototype,"clearSnapline",[a.k],Object.getOwnPropertyDescriptor(Lc.prototype,"clearSnapline"),Lc.prototype),Sy(Lc.prototype,"setNodeSnapLine",[a.k],Object.getOwnPropertyDescriptor(Lc.prototype,"setNodeSnapLine"),Lc.prototype),Lc),Ay=new Map,XC=function(c){var u=tl(),d=window.requestAnimationFrame((function p(){if(c(),Ay.get(u)){var y=window.requestAnimationFrame(p);Ay.set(u,y)}}));return Ay.set(u,d),u},Db=function(c){var u=Ay.get(c);u&&(window.cancelAnimationFrame(u),Ay.delete(c))};function Ox(c){return Ox=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Ox(c)}function My(){return My=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},My.apply(this,arguments)}function YC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ty(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?YC(Object(d),!0).forEach((function(p){Cd(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):YC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function sF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return qC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return qC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function qC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function uF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Sx(c,u){return Sx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Sx(c,u)}function cF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=jb(c);if(u){var y=jb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return dF(this,d)}}function dF(c,u){if(u&&(Ox(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Td(c)}function Td(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function jb(c){return jb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},jb(c)}function Cd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var fF=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Sx(g,b)})(y,c);var u,d,p=cF(y);function y(){var g;return(function(b,A){if(!(b instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Cd(Td(g=p.call(this)),"preTargetNode",void 0),Cd(Td(g),"sourceRuleResults",void 0),Cd(Td(g),"targetRuleResults",void 0),Cd(Td(g),"dragHandler",void 0),Cd(Td(g),"t",void 0),Cd(Td(g),"onDragStart",(function(b){var A=b.event,N=g.props,V=N.anchorData,H=N.nodeModel,oe=N.graphModel;oe.overlapMode,oe.selectNodeById(H.id),H.autoToFront&&oe.toFront(H.id),oe.eventCenter.emit(ur.ANCHOR_DRAGSTART,{data:V,e:A,nodeModel:H}),g.setState({startX:V.x,startY:V.y,endX:V.x,endY:V.y})})),Cd(Td(g),"onDragging",(function(b){var A=b.event,N=g.props,V=N.graphModel,H=N.nodeModel,oe=N.anchorData,ue=V.transformModel,Ne=V.eventCenter,Ve=V.width,qe=V.height,Ot=V.editConfigModel,xt=Ot.autoExpand,Ft=Ot.stopMoveGraph,vn=A.clientX,Hn=A.clientY,zn=V.getPointByClient({x:vn,y:Hn}),Ar=zn.domOverlayPosition,Vn=Ar.x,vr=Ar.y,er=zn.canvasOverlayPosition,Eo=er.x,Co=er.y;g.t&&Db(g.t);var zr=[];Vn<10?zr=[10,0]:Vn+10>Ve?zr=[-10,0]:vr<10?zr=[0,10]:vr+10>qe&&(zr=[0,-10]),g.setState({endX:Eo,endY:Co,dragging:!0}),g.moveAnchorEnd(Eo,Co),zr.length>0&&!Ft&&xt&&(g.t=XC((function(){var Fo=sF(zr,2),ma=Fo[0],ya=Fo[1];ue.translate(ma,ya);var Nl=g.state,fu=Nl.endX,pu=Nl.endY;g.setState({endX:fu-ma,endY:pu-ya}),g.moveAnchorEnd(fu-ma,pu-ya)}))),Ne.emit(ur.ANCHOR_DRAG,{data:oe,e:A,nodeModel:H})})),Cd(Td(g),"onDragEnd",(function(b){var A=b.event;g.t&&Db(g.t);var N=g.checkEnd(A);g.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),g.sourceRuleResults.clear(),g.targetRuleResults.clear();var V=g.props,H=V.graphModel,oe=V.nodeModel,ue=V.anchorData;H.eventCenter.emit(ur.ANCHOR_DRAGEND,{data:ue,e:A,nodeModel:oe,edgeModel:N})})),Cd(Td(g),"checkEnd",(function(b){var A=g.props,N=A.graphModel,V=A.nodeModel,H=A.anchorData,oe=H.x,ue=H.y,Ne=H.id,Ve=(N.edgeType,g.state),qe=Ve.endX,Ot=Ve.endY,xt=Ve.dragging,Ft=Cf({x:qe,y:Ot},N);if(g.preTargetNode&&g.preTargetNode.state!==Io.DEFAULT&&g.preTargetNode.setElementState(Io.DEFAULT),xt&&Ft&&Ft.node){var vn=Ft.node,Hn=Ft.anchor.id,zn="".concat(V.id,"_").concat(vn.id,"_").concat(Hn,"_").concat(Ne),Ar=g.sourceRuleResults.get(zn)||{},Vn=Ar.isAllPass,vr=Ar.msg,er=g.targetRuleResults.get(zn)||{},Eo=er.isAllPass,Co=er.msg;if(Vn&&Eo){vn.setElementState(Io.DEFAULT);var zr=N.edgeGenerator(V.getData(),N.getNodeModelById(Ft.node.id).getData()),Fo=N.addEdge(Ty(Ty({},zr),{},{sourceNodeId:V.id,sourceAnchorId:Ne,startPoint:{x:oe,y:ue},targetNodeId:Ft.node.id,targetAnchorId:Ft.anchor.id,endPoint:{x:Ft.anchor.x,y:Ft.anchor.y}})),ma=g.props.anchorData;return N.eventCenter.emit(ur.ANCHOR_DROP,{data:ma,e:b,nodeModel:V,edgeModel:Fo}),Fo}var ya=vn.getData();return N.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:ya,msg:Co||vr||"不允许添加连线"}),null}})),g.sourceRuleResults=new Map,g.targetRuleResults=new Map,g.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},g.dragHandler=new Ce({onDragStart:g.onDragStart,onDragging:g.onDragging,onDragEnd:g.onDragEnd}),g}return u=y,(d=[{key:"getAnchorShape",value:function(){var g=this.props,b=g.anchorData,A=g.style,N=g.node.getAnchorShape(b);if(N)return N;var V=b.x,H=b.y,oe=Ty(Ty({},A),A.hover);return Object(re.g)("g",null,Object(re.g)($g,My({className:"lf-node-anchor-hover"},oe,{x:V,y:H})),Object(re.g)($g,My({className:"lf-node-anchor"},A,{x:V,y:H})))}},{key:"customTrajectory",get:function(){return this.props.graphModel.customTrajectory}},{key:"relateEdges",get:function(){var g=this.props,b=g.graphModel,A=b.getAnchorIncomingEdge,N=b.getAnchorOutcomingEdge,V=g.anchorData.id;return{incomingEdgeList:A(V),outcomingEdgeList:N(V)}}},{key:"moveAnchorEnd",value:function(g,b){var A=this.props,N=A.graphModel,V=A.nodeModel,H=A.anchorData,oe=Cf({x:g,y:b},N);if(oe){var ue=oe.node,Ne=oe.anchor.id;if(this.preTargetNode&&this.preTargetNode!==oe.node&&this.preTargetNode.setElementState(Io.DEFAULT),H.id===Ne)return;this.preTargetNode=ue;var Ve="".concat(V.id,"_").concat(ue.id,"_").concat(Ne,"_").concat(H.id);if(!this.targetRuleResults.has(Ve)){var qe=oe.anchor,Ot=V.isAllowConnectedAsSource(ue,H,qe),xt=ue.isAllowConnectedAsTarget(V,H,qe);this.sourceRuleResults.set(Ve,au(Ot)),this.targetRuleResults.set(Ve,au(xt))}var Ft=this.sourceRuleResults.get(Ve).isAllPass,vn=this.targetRuleResults.get(Ve).isAllPass;Ft&&vn?ue.setElementState(Io.ALLOW_CONNECT):ue.setElementState(Io.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Io.DEFAULT&&this.preTargetNode.setElementState(Io.DEFAULT)}},{key:"isShowLine",value:function(){var g=this.state,b=g.startX,A=g.startY,N=g.endX,V=g.endY;return gs(b,A,N,V)>10}},{key:"render",value:function(){var g=this,b=this.state,A=b.startX,N=b.startY,V=b.endX,H=b.endY,oe=this.props,ue=oe.anchorData.edgeAddable,Ne=oe.edgeStyle;return Object(re.g)("g",{className:"lf-anchor"},Object(re.g)("g",{onMouseDown:function(Ve){ue!==!1&&g.dragHandler.handleMouseDown(Ve)}},this.getAnchorShape()),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Ty({sourcePoint:{x:A,y:N},targetPoint:{x:V,y:H}},Ne)):Object(re.g)(Fg,My({x1:A,y1:N,x2:V,y2:H},Ne,{"pointer-events":"none"}))))}}])&&uF(u.prototype,d),y})(re.a);function KC(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function pF(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?KC(Object(d),!0).forEach((function(p){hF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):KC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function hF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Ax(c){return Ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Ax(c)}function vF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ZC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ZC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ZC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function JC(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,g=c.value,b=c.fontSize,A=c.fill,N=A===void 0?"currentColor":A,V=c.overflowMode,H=V===void 0?"default":V,oe=c.textWidth,ue=oe===void 0?"":oe,Ne=c.model,Ve={textAnchor:"middle","dominant-baseline":"middle",x:d,y,fill:N};if(Object.entries(c).forEach((function(Hn){var zn=vF(Hn,2),Ar=zn[0],Vn=zn[1];Ax(Vn)!=="object"&&(Ve[Ar]=Vn)})),g){var qe=String(g).split(/[\r\n]/g),Ot=qe.length;if(H!=="default"){var xt=Ne.BaseType,Ft=Ne.modelType;if(xt===ei.NODE&&Ft!==lo.TEXT_NODE||xt===ei.EDGE&&ue)return(function(Hn){var zn=Hn.value,Ar=Hn.fontSize,Vn=Hn.model,vr=Hn.fontFamily,er=vr===void 0?"":vr,Eo=Hn.lineHeight,Co=Hn.wrapPadding,zr=Co===void 0?"0, 0":Co,Fo=Hn.overflowMode,ma=Hn.x,ya=Hn.y,Nl=Vn.width,fu=Vn.textHeight,pu=Hn.textWidth||Nl,Pd=String(zn).split(/[\r\n]/g),Av=Pd.length,a0=Df({rows:Pd,style:{fontSize:"".concat(Ar,"px"),width:"".concat(pu,"px"),fontFamily:er,lineHeight:Eo,padding:zr},rowsLength:Av,className:"lf-get-text-height"}),Mv=Vn.height>a0?Vn.height:a0;fu&&(Mv=fu);var sh=Fo==="ellipsis";return sh&&(Mv=Ar+2),Object(re.g)("g",null,Object(re.g)("foreignObject",{width:pu,height:Mv,x:ma-pu/2,y:ya-Mv/2},Object(re.g)("div",{className:"lf-node-text-auto-wrap",style:{minHeight:Mv,width:pu,padding:zr}},Object(re.g)("div",{className:sh?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:sh?Pd.join(""):"",style:pF({},Hn)},Pd.map((function(uh){return Object(re.g)("div",{className:"lf-node-text--auto-wrap-inner"},uh)}))))))})(c)}if(Ot>1){var vn=qe.map((function(Hn,zn){var Ar=(zn-(Ot-1)/2)*(b+2);return Object(re.g)("tspan",{className:"lf-text-tspan",x:d,y:y+Ar},Hn)}));return Object(re.g)("text",Ve,vn)}return Object(re.g)("text",Ve,g)}}function Mx(c){return Mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Mx(c)}function Tx(){return Tx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Tx.apply(this,arguments)}function gF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return QC(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return QC(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function QC(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function mF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Cx(c,u){return Cx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Cx(c,u)}function yF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Lb(c);if(u){var y=Lb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return _F(this,d)}}function _F(c,u){if(u&&(Mx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ah(c)}function ah(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Lb(c){return Lb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Lb(c)}function Ev(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var eN=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Cx(g,b)})(y,c);var u,d,p=yF(y);function y(g){var b;(function(N,V){if(!(N instanceof V))throw new TypeError("Cannot call a class as a function")})(this,y),Ev(ah(b=p.call(this)),"dragHandler",void 0),Ev(ah(b),"sumDeltaX",0),Ev(ah(b),"sumDeltaY",0),Ev(ah(b),"stepDrag",void 0),Ev(ah(b),"onDragging",(function(N){var V=N.deltaX,H=N.deltaY,oe=b.props,ue=oe.model,Ne=gF(oe.graphModel.transformModel.fixDeltaXY(V,H),2),Ve=Ne[0],qe=Ne[1];ue.moveText(Ve,qe)})),Ev(ah(b),"dblClickHandler",(function(){b.props.editable&&b.props.model.setElementState(Io.TEXT_EDIT)})),Ev(ah(b),"mouseDownHandle",(function(N){var V=b.props,H=V.draggable,oe=V.model,ue=V.graphModel.editConfigModel.nodeTextDraggable;(H||ue)&&(b.stepDrag.model=oe,b.stepDrag.handleMouseDown(N))})),g.model;var A=g.draggable;return b.stepDrag=new Ce({onDragging:b.onDragging,step:1,isStopPropagation:A}),b}return u=y,(d=[{key:"getShape",value:function(){var g=this.props,b=g.model,A=g.graphModel,N=b.text,V=A.editConfigModel,H=N.value,oe=N.x,ue=N.y,Ne=N.editable,Ve=N.draggable,qe={x:oe,y:ue,className:"",value:H};Ne?qe.className="lf-element-text":Ve||V.nodeTextDraggable?qe.className="lf-text-draggable":qe.className="lf-text-disabled";var Ot=b.getTextStyle();return Object(re.g)(JC,Tx({},qe,Ot,{model:b}))}},{key:"render",value:function(){if(this.props.model.text)return Object(re.g)("g",{onMouseDown:this.mouseDownHandle,onDblClick:this.dblClickHandler},this.getShape())}}])&&mF(u.prototype,d),y})(re.a),bF=uc(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null,tN=r(130);function Nx(c){return Nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Nx(c)}function kx(){return kx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},kx.apply(this,arguments)}function wF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Px(c,u){return Px=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Px(c,u)}function EF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ib(c);if(u){var y=Ib(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return xF(this,d)}}function xF(c,u){if(u&&(Nx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kg(c)}function Kg(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ib(c){return Ib=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ib(c)}function Cy(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var OF=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Px(g,b)})(y,c);var u,d,p=EF(y);function y(g){var b;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),Cy(Kg(b=p.call(this,g)),"style",{}),Cy(Kg(b),"defaultAngle",void 0),Cy(Kg(b),"normal",void 0),Cy(Kg(b),"stepperDrag",void 0),Cy(Kg(b),"onDragging",(function(A){var N,V=A.event,H=b.props,oe=H.graphModel,ue=H.nodeModel,Ne=H.eventCenter,Ve=oe.selectNodes,qe=ue.x,Ot=ue.y,xt=V.clientX,Ft=V.clientY,vn=oe.getPointByClient({x:xt,y:Ft}).canvasOverlayPosition,Hn=vn.x,zn=vn.y,Ar=new ot(Hn-qe,zn-Ot),Vn=((N=b.normal)===null||N===void 0?void 0:N.angle(Ar))-b.defaultAngle,vr=new nh(-qe,-Ot).rotate(Vn).translate(qe,Ot).toString();ue.transform=vr,ue.rotate=Vn;var er=Object(tN.map)(Ve,(function(Co){return Co.id}));er.indexOf(ue.id)===-1&&(er=[ue.id]);var Eo=Object(tN.reduce)(er,(function(Co,zr){var Fo=oe.getNodeModelById(zr);return Co[zr]=Fo==null?void 0:Fo.getMoveDistance(0,0,!1),Co}),{});er.forEach((function(Co){oe.getNodeEdges(Co).forEach((function(zr){if(Eo[zr.sourceNodeId]){var Fo=oe.getNodeModelById(zr.sourceNodeId).anchors.find((function(ya){return ya.id===zr.sourceAnchorId}));zr.updateStartPoint(Fo)}if(Eo[zr.targetNodeId]){var ma=oe.getNodeModelById(zr.targetNodeId).anchors.find((function(ya){return ya.id===zr.targetAnchorId}));zr.updateEndPoint(ma)}}))})),Ne.emit(ur.NODE_ROTATE,{e:V,nodeModel:ue})})),b.style=g.style,b.stepperDrag=new Ce({onDragging:b.onDragging}),b}return u=y,(d=[{key:"render",value:function(){var g=this,b=this.props.nodeModel,A=b.x,N=b.y,V=A+b.width/2+20,H=N-b.height/2-20;return this.normal=new ot(1,0),this.defaultAngle=this.normal.angle(new ot(V-A,H-N)),b.defaultAngle=this.defaultAngle,Object(re.g)("g",{className:"lf-rotate-control"},Object(re.g)("g",{onMouseDown:function(oe){g.stepperDrag.handleMouseDown(oe)}},Object(re.g)($g,kx({},this.style,{cx:V,cy:H}))))}}])&&wF(u.prototype,d),y})(re.a);function Rx(c){return Rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Rx(c)}var SF=["className"];function Fb(){return Fb=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Fb.apply(this,arguments)}function AF(c,u){if(c==null)return{};var d,p,y=(function(b,A){if(b==null)return{};var N,V,H={},oe=Object.keys(b);for(V=0;V<oe.length;V++)N=oe[V],A.indexOf(N)>=0||(H[N]=b[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(c);for(p=0;p<g.length;p++)d=g[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function Bb(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return nN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return nN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function nN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function rN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Dx(c,u){return Dx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Dx(c,u)}function MF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=$b(c);if(u){var y=$b(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return TF(this,d)}}function TF(c,u){if(u&&(Rx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rl(c)}function rl(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function $b(c){return $b=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},$b(c)}function pl(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Yf=(function(c){(function(b,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(A&&A.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),A&&Dx(b,A)})(g,c);var u,d,p,y=MF(g);function g(b){var A;(function(ue,Ne){if(!(ue instanceof Ne))throw new TypeError("Cannot call a class as a function")})(this,g),pl(rl(A=y.call(this)),"t",void 0),pl(rl(A),"moveOffset",void 0),pl(rl(A),"stepDrag",void 0),pl(rl(A),"contextMenuTime",void 0),pl(rl(A),"mouseUpDrag",void 0),pl(rl(A),"startTime",void 0),pl(rl(A),"clickTimer",void 0),pl(rl(A),"modelDisposer",void 0),pl(rl(A),"onDragStart",(function(ue){var Ne=ue.event,Ve=Ne.clientX,qe=Ne.clientY,Ot=A.props,xt=Ot.model,Ft=Ot.graphModel.getPointByClient({x:Ve,y:qe}).canvasOverlayPosition,vn=Ft.x,Hn=Ft.y;A.moveOffset={x:xt.x-vn,y:xt.y-Hn}})),pl(rl(A),"onDragging",(function(ue){var Ne=ue.event,Ve=A.props,qe=Ve.model,Ot=Ve.graphModel,xt=Ot.editConfigModel,Ft=xt.stopMoveGraph,vn=xt.autoExpand,Hn=Ot.transformModel,zn=Ot.selectNodes,Ar=Ot.width,Vn=Ot.height,vr=Ot.gridSize;qe.isDragging=!0;var er=Ne.clientX,Eo=Ne.clientY,Co=Ot.getPointByClient({x:er,y:Eo}).canvasOverlayPosition,zr=Co.x,Fo=Co.y,ma=Bb(Hn.CanvasPointToHtmlPoint([zr,Fo]),2),ya=ma[0],Nl=ma[1];if(zr+=A.moveOffset.x,Fo+=A.moveOffset.y,zr=fs(zr,vr),Fo=fs(Fo,vr),Ar&&Vn){if(!vn||Ft||!(ya<0||Nl<0||ya>Ar||Nl>Vn)){var fu=Bb(Hn.CanvasPointToHtmlPoint([zr-qe.width/2,Fo-qe.height/2]),2),pu=fu[0],Pd=fu[1],Av=Bb(Hn.CanvasPointToHtmlPoint([zr+qe.width/2,Fo+qe.height/2]),2),a0=Av[0],Mv=Av[1],sh=Math.max(vr,20),uh=[];pu<0?uh=[sh,0]:a0>Ot.width?uh=[-sh,0]:Pd<0?uh=[0,sh]:Mv>Ot.height&&(uh=[0,-sh]),A.t&&Db(A.t);var d$=new nh(-zr,-Fo).rotate(qe.rotate).translate(zr,Fo).toString();qe.transform=d$;var l0=zn.map((function(s0){return s0.id}));l0.indexOf(qe.id)===-1&&(l0=[qe.id]),uh.length>0&&!Ft&&vn?A.t=XC((function(){var s0=Bb(uh,2),IN=s0[0],FN=s0[1];Hn.translate(IN,FN);var f$=-IN/Hn.SCALE_X,p$=-FN/Hn.SCALE_X;Ot.moveNodes(l0,f$,p$)})):Ot.moveNodes(l0,zr-qe.x,Fo-qe.y)}}else Ot.moveNode2Coordinate(qe.id,zr,Fo)})),pl(rl(A),"onDragEnd",(function(){A.t&&Db(A.t),A.props.model.isDragging=!1})),pl(rl(A),"handleMouseUp",(function(){var ue=A.props.model;A.mouseUpDrag=ue.isDragging})),pl(rl(A),"handleClick",(function(ue){var Ne=A.mouseUpDrag===!1;if(A.startTime){var Ve=A.props,qe=Ve.model,Ot=Ve.graphModel;if(Ne){var xt={data:qe.getData(),e:ue,position:Ot.getPointByClient({x:ue.clientX,y:ue.clientY}),isSelected:!1,isMultiple:!1},Ft=ue.button===2,vn=ue.detail===2;if(!Ft){var Hn=Ot.editConfigModel,zn=yd(ue,Hn);xt.isMultiple=zn,qe.isSelected&&!vn&&zn?(xt.isSelected=!1,qe.setSelected(!1)):(Ot.selectNodeById(qe.id,zn),xt.isSelected=!0,A.toFront()),vn?(Hn.nodeTextEdit&&qe.text.editable&&(qe.setSelected(!1),Ot.setElementStateById(qe.id,Io.TEXT_EDIT)),Ot.eventCenter.emit(ur.NODE_DBCLICK,xt)):(Ot.eventCenter.emit(ur.ELEMENT_CLICK,xt),Ot.eventCenter.emit(ur.NODE_CLICK,xt))}}}})),pl(rl(A),"handleContextMenu",(function(ue){ue.preventDefault();var Ne=A.props,Ve=Ne.model,qe=Ne.graphModel,Ot=Ve.getData(),xt=qe.getPointByClient({x:ue.clientX,y:ue.clientY});qe.setElementStateById(Ve.id,Io.SHOW_MENU,xt.domOverlayPosition),Ve.isSelected||qe.selectNodeById(Ve.id),qe.eventCenter.emit(ur.NODE_CONTEXTMENU,{data:Ot,e:ue,position:xt}),A.toFront()})),pl(rl(A),"handleMouseDown",(function(ue){var Ne=A.props,Ve=Ne.model,qe=Ne.graphModel;A.startTime=new Date().getTime(),qe.editConfigModel.adjustNodePosition&&Ve.draggable&&A.stepDrag&&A.stepDrag.handleMouseDown(ue)})),pl(rl(A),"setHoverON",(function(ue){var Ne=A.props,Ve=Ne.model,qe=Ne.graphModel;if(!Ve.isHovered){var Ot=Ve.getData();Ve.setHovered(!0),qe.eventCenter.emit(ur.NODE_MOUSEENTER,{data:Ot,e:ue})}})),pl(rl(A),"setHoverOFF",(function(ue){var Ne=A.props,Ve=Ne.model,qe=Ne.graphModel,Ot=Ve.getData();Ve.isHovered&&(Ve.setHovered(!1),qe.eventCenter.emit(ur.NODE_MOUSELEAVE,{data:Ot,e:ue}))})),pl(rl(A),"onMouseOut",(function(ue){bF&&A.setHoverOFF(ue)}));var N=b.graphModel,V=N.gridSize,H=N.eventCenter,oe=b.model;return A.stepDrag=new Ce({onDragStart:A.onDragStart,onDragging:A.onDragging,onDragEnd:A.onDragEnd,step:V,eventType:"NODE",isStopPropagation:!1,eventCenter:H,model:oe}),A.modelDisposer=Object(a.F)((function(){return A.props}),(function(ue){ue&&ue.model&&A.stepDrag.setModel(ue.model)})),A}return u=g,p=[{key:"getModel",value:function(b){return b}}],(d=[{key:"componentWillUnmount",value:function(){this.modelDisposer&&this.modelDisposer()}},{key:"getAnchorShape",value:function(b){return null}},{key:"getAnchors",value:function(){var b=this,A=this.props,N=A.model,V=A.graphModel,H=N.isSelected,oe=N.isHitable,ue=N.isDragging,Ne=N.isShowAnchor;return oe&&(H||Ne)&&!ue?Op(N.anchors,(function(Ve,qe){var Ot=N.getAnchorLineStyle(Ve),xt=N.getAnchorStyle(Ve);return Object(re.g)(fF,{anchorData:Ve,node:b,style:xt,edgeStyle:Ot,anchorIndex:qe,nodeModel:N,graphModel:V,setHoverOFF:b.setHoverOFF})})):[]}},{key:"getRotateControl",value:function(){var b=this.props,A=b.model,N=b.graphModel,V=A.isSelected,H=A.isHitable,oe=A.enableRotate,ue=A.isHovered,Ne=A.getRotateControlStyle().style;if(H&&(V||ue)&&oe)return Object(re.g)(OF,{graphModel:N,nodeModel:A,eventCenter:N.eventCenter,style:Ne})}},{key:"getText",value:function(){var b=this.props,A=b.model,N=b.graphModel;if(A.state===Io.TEXT_EDIT)return"";if(A.text){var V=N.editConfigModel,H=!1;return(A.text.draggable||V.nodeTextDraggable)&&(H=!0),Object(re.g)(eN,{editable:V.nodeTextEdit&&A.text.editable,model:A,graphModel:N,draggable:H})}}},{key:"getStateClassName",value:function(){var b=this.props.model,A=b.state,N=b.isDragging,V=b.isSelected,H="lf-node";switch(A){case Io.ALLOW_CONNECT:H+=" lf-node-allow";break;case Io.NOT_ALLOW_CONNECT:H+=" lf-node-not-allow";break;default:H+=" lf-node-default"}return N&&(H+=" lf-isDragging"),V&&(H+=" lf-node-selected"),H}},{key:"toFront",value:function(){var b=this.props,A=b.model,N=b.graphModel;A.autoToFront&&N.toFront(A.id)}},{key:"render",value:function(){var b,A=this.props,N=A.model,V=A.graphModel,H=V.editConfigModel,oe=H.hideAnchors,ue=H.adjustNodePosition,Ne=H.allowRotation,Ve=V.gridSize,qe=V.transformModel.SCALE_X,Ot=N.isHitable,xt=N.draggable,Ft=N.transform,vn=N.getOuterGAttributes(),Hn=vn.className,zn=Hn===void 0?"":Hn,Ar=AF(vn,SF),Vn=Object(re.g)("g",{className:"lf-node-content"},Object(re.g)("g",{transform:Ft},this.getShape(),this.getText(),Ne&&this.getRotateControl()),!oe&&this.getAnchors());return Ot?(ue&&xt&&this.stepDrag.setStep(Ve*qe),b=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverON,onMouseOver:this.setHoverON,onMouseLeave:this.setHoverOFF,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},Ar),Vn)):b=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn)},Ar),Vn),b}}])&&rN(u.prototype,d),p&&rN(u,p),g})(re.a);function jx(c){return jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},jx(c)}function Lx(){return Lx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},Lx.apply(this,arguments)}function CF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function NF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Ix(c,u){return Ix=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ix(c,u)}function kF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Ub(c);if(u){var y=Ub(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return PF(this,d)}}function PF(c,u){if(u&&(jx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Ub(c){return Ub=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ub(c)}var Fx=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Ix(g,b)})(y,c);var u,d,p=kF(y);function y(){return CF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var g=this.props.model,b=g.getNodeStyle();return Object(re.g)(rh,Lx({},b,{x:g.x,y:g.y,width:g.width,height:g.height,radius:g.radius}))}}])&&NF(u.prototype,d),y})(Yf);function Bx(c){return Bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Bx(c)}function $x(){return $x=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},$x.apply(this,arguments)}function RF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function DF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Ux(c,u){return Ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ux(c,u)}function jF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Vb(c);if(u){var y=Vb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return LF(this,d)}}function LF(c,u){if(u&&(Bx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Vb(c){return Vb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Vb(c)}var Vx=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Ux(g,b)})(y,c);var u,d,p=jF(y);function y(){return RF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var g=this.props.model,b=g.x,A=g.y,N=g.r,V=g.getNodeStyle();return Object(re.g)($g,$x({},V,{x:b,y:A,r:N}))}}])&&DF(u.prototype,d),y})(Yf);function Wx(c){return Wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Wx(c)}function IF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return oN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return oN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function oN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function iN(c){var u=c.points,d=c.className,p={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Object.entries(c).forEach((function(y){var g=IF(y,2),b=g[0],A=g[1];Wx(A)!=="object"&&(p[b]=A)})),p.className=d?"lf-basic-shape ".concat(d):"lf-basic-shape",p.points=u.map((function(y){return y.join(",")})).join(" "),Object(re.g)("polygon",p)}function Gx(c){return Gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Gx(c)}function zx(){return zx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},zx.apply(this,arguments)}function FF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function BF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Hx(c,u){return Hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Hx(c,u)}function $F(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Wb(c);if(u){var y=Wb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return UF(this,d)}}function UF(c,u){if(u&&(Gx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Wb(c){return Wb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Wb(c)}var Xx=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Hx(g,b)})(y,c);var u,d,p=$F(y);function y(){return FF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var g=this.props.model,b=g.x,A=g.y,N=g.width,V=g.height,H=g.points,oe=g.getNodeStyle(),ue={transform:"matrix(1 0 0 1 ".concat(b-N/2," ").concat(A-V/2,")")};return Object(re.g)("g",ue,Object(re.g)(iN,zx({},oe,{points:H,x:b,y:A})))}}])&&BF(u.prototype,d),y})(Yf);function Yx(c){return Yx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Yx(c)}function qx(){return qx=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},qx.apply(this,arguments)}function VF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function WF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function Kx(c,u){return Kx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Kx(c,u)}function GF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Gb(c);if(u){var y=Gb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return zF(this,d)}}function zF(c,u){if(u&&(Yx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Gb(c){return Gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Gb(c)}var Zx=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&Kx(g,b)})(y,c);var u,d,p=GF(y);function y(){return VF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var g=this.props.model,b=g.getNodeStyle();return Object(re.g)("g",null,Object(re.g)(iN,qx({},b,{points:g.points,x:g.x,y:g.y})))}}])&&WF(u.prototype,d),y})(Yf);function Jx(c){return Jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Jx(c)}function HF(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return aN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return aN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function aN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function XF(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,g=c.rx,b=g===void 0?4:g,A=c.ry,N=A===void 0?4:A,V=c.className,H={cx:d,cy:y,rx:b,ry:N,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(oe){var ue=HF(oe,2),Ne=ue[0],Ve=ue[1];Jx(Ve)!=="object"&&(H[Ne]=Ve)})),H.className=V?"lf-basic-shape ".concat(V):"lf-basic-shape",Object(re.g)("ellipse",H)}function Qx(c){return Qx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},Qx(c)}function eO(){return eO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},eO.apply(this,arguments)}function YF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function qF(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function tO(c,u){return tO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},tO(c,u)}function KF(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=zb(c);if(u){var y=zb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return ZF(this,d)}}function ZF(c,u){if(u&&(Qx(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function zb(c){return zb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},zb(c)}var nO=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&tO(g,b)})(y,c);var u,d,p=KF(y);function y(){return YF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var g=this.props.model,b=g.getNodeStyle();return Object(re.g)(XF,eO({},b,{x:g.x,y:g.y,rx:g.rx,ry:g.ry}))}}])&&qF(u.prototype,d),y})(Yf);function rO(c){return rO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},rO(c)}function lN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function sN(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?lN(Object(d),!0).forEach((function(p){JF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):lN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function JF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function QF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function eB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function oO(c,u){return oO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},oO(c,u)}function tB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Hb(c);if(u){var y=Hb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return nB(this,d)}}function nB(c,u){if(u&&(rO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Hb(c){return Hb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hb(c)}var iO=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&oO(g,b)})(y,c);var u,d,p=tB(y);function y(){return QF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getBackground",value:function(){var g=this.props.model,b=g.getTextStyle(),A=g.width,N=g.height,V=g.x,H=g.y,oe=sN(sN({},b.background),{},{x:V,y:H-1,width:A,height:N});return Object(re.g)(rh,oe)}},{key:"getShape",value:function(){return Object(re.g)("g",null,this.getBackground())}}])&&eB(u.prototype,d),y})(Yf);function aO(c){return aO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},aO(c)}function lO(){return lO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},lO.apply(this,arguments)}function rB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function oB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function sO(c,u){return sO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},sO(c,u)}function iB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Xb(c);if(u){var y=Xb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return aB(this,d)}}function aB(c,u){if(u&&(aO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ny(c)}function Ny(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Xb(c){return Xb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xb(c)}function Yb(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var uO=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&sO(g,b)})(y,c);var u,d,p=iB(y);function y(){var g;rB(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return Yb(Ny(g=p.call.apply(p,[this].concat(A))),"ref",void 0),Yb(Ny(g),"currentProperties",void 0),Yb(Ny(g),"preProperties",void 0),Yb(Ny(g),"setRef",(function(V){g.ref=V})),g}return u=y,(d=[{key:"rootEl",get:function(){return this.ref}},{key:"setHtml",value:function(g){g.appendChild(document.createElement("div"))}},{key:"shouldUpdate",value:function(){if(!this.preProperties||this.preProperties!==this.currentProperties)return this.preProperties=this.currentProperties,!0}},{key:"componentDidMount",value:function(){this.shouldUpdate()&&this.setHtml(this.rootEl)}},{key:"componentDidUpdate",value:function(){this.shouldUpdate()&&this.setHtml(this.rootEl)}},{key:"getShape",value:function(){var g=this.props.model,b=g.x,A=g.y,N=g.height,V=g.width,H=g.getNodeStyle();return this.currentProperties=JSON.stringify(g.properties),Object(re.g)("foreignObject",lO({},H,{x:b-V/2,y:A-N/2,width:V,height:N,ref:this.setRef}))}}])&&oB(u.prototype,d),y})(Yf);function cO(c){return cO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},cO(c)}function dO(){return dO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},dO.apply(this,arguments)}function uN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function xv(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?uN(Object(d),!0).forEach((function(p){hO(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):uN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function lB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function fO(c,u){return fO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},fO(c,u)}function sB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=qb(c);if(u){var y=qb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return uB(this,d)}}function uB(c,u){if(u&&(cO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pO(c)}function pO(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qb(c){return qb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qb(c)}function hO(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var cB=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&fO(g,b)})(y,c);var u,d,p=sB(y);function y(g){var b;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),hO(pO(b=p.call(this,g)),"setHoverON",(function(){b.setState({isHovered:!0})})),hO(pO(b),"setHoverOFF",(function(){b.setState({isHovered:!1})})),b.state={isHovered:!1},b}return u=y,(d=[{key:"getBackground",value:function(){var g=this.props.model,b=g.getTextStyle(),A=g.text,N=g.width,V=b.background||{};if(this.state.isHovered&&b.hover&&b.hover.background&&(V=xv(xv({},V),b.hover.background)),A&&A.value&&V.fill!=="transparent"){var H,oe=b.fontSize,ue=b.overflowMode,Ne=b.lineHeight,Ve=b.wrapPadding,qe=b.textWidth,Ot=A.value,xt=A.x,Ft=A.y,vn=String(Ot).split(/[\r\n]/g),Hn=vn.length;if(ue==="autoWrap"&&qe){var zn=Df({rows:vn,style:{fontSize:"".concat(oe,"px"),width:"".concat(qe,"px"),lineHeight:Ne,padding:Ve},rowsLength:Hn,className:"lf-get-text-height"});H=xv(xv({},V),{},{x:xt-1,y:Ft-1,width:qe,height:zn})}else{vn&&vn.forEach((function(Eo){Pi(Eo)}));var Ar=Mc({rows:vn,fontSize:oe,rowsLength:Hn}),Vn=Ar.width,vr=Ar.height;if(ue==="ellipsis"&&(Vn=qe||N,vr=oe+2),typeof V.wrapPadding=="string"){var er=V.wrapPadding.split(",").filter((function(Eo){return Eo.trim()})).map((function(Eo){return parseFloat(Eo.trim())}));er.length>0&&er.length<=4&&(er.length===1?er=[er[0],er[0],er[0],er[0]]:er.length===2?er=[er[0],er[1],er[0],er[1]]:er.length===3&&(er=[er[0],er[1],er[2],er[1]]),Vn+=er[1]+er[3],vr+=er[0]+er[2],xt+=(er[1]-er[3])/2,Ft+=(er[2]-er[0])/2)}H=xv(xv({},V),{},{x:xt-1,y:Ft-1,width:Vn,height:vr})}return Object(re.g)(rh,H)}}},{key:"getShape",value:function(){var g=this.props.model,b=g.text,A=b.value,N=b.x,V=b.y;if(A){var H=xv({x:N,y:V,className:"lf-element-text",value:A},g.getTextStyle());return Object(re.g)("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getBackground(),Object(re.g)(JC,dO({},H,{model:g})))}}}])&&lB(u.prototype,d),y})(eN);function vO(c){return vO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},vO(c)}var Nd,dB=["text","sourceAnchorId","targetAnchorId"];function cN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function qf(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?cN(Object(d),!0).forEach((function(p){du(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):cN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function fB(c,u){if(c==null)return{};var d,p,y=(function(b,A){if(b==null)return{};var N,V,H={},oe=Object.keys(b);for(V=0;V<oe.length;V++)N=oe[V],A.indexOf(N)>=0||(H[N]=b[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(c);for(p=0;p<g.length;p++)d=g[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function pB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return dN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return dN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function dN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function hB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function gO(c,u){return gO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},gO(c,u)}function vB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Kb(c);if(u){var y=Kb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return gB(this,d)}}function gB(c,u){if(u&&(vO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cu(c)}function cu(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Kb(c){return Kb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Kb(c)}function du(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}(function(c){c.SOURCE="SOURCE",c.TARGET="TARGET"})(Nd||(Nd={}));var fN=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&gO(g,b)})(y,c);var u,d,p=vB(y);function y(g){var b;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),du(cu(b=p.call(this)),"stepDragData",void 0),du(cu(b),"stepDrag",void 0),du(cu(b),"oldEdge",void 0),du(cu(b),"preTargetNode",void 0),du(cu(b),"targetRuleResults",void 0),du(cu(b),"sourceRuleResults",void 0),du(cu(b),"handleMouseDown",(function(H){b.stepDrag&&b.stepDrag.handleMouseDown(H)})),du(cu(b),"onDragStart",(function(){var H=b.props,oe=H.x,ue=H.y,Ne=H.edgeModel,Ve=Ne.startPoint,qe=Ne.endPoint,Ot=Ne.pointsList;b.oldEdge={startPoint:Ve,endPoint:qe,pointsList:Ot},b.setState({endX:oe,endY:ue,dragging:!0})})),du(cu(b),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ne=b.state,Ve=Ne.endX,qe=Ne.endY,Ot=b.props,xt=Ot.graphModel,Ft=Ot.type,vn=xt.transformModel,Hn=xt.editConfigModel,zn=pB(vn.moveCanvasPointByHtml([Ve,qe],oe,ue),2),Ar=zn[0],Vn=zn[1];b.setState({endX:Ar,endY:Vn,dragging:!0});var vr=b.props.edgeModel,er=Cf({x:Ve,y:qe},xt);if(er&&er.node&&b.isAllowAdjust(er).pass){var Eo,Co=vr.startPoint,zr=vr.endPoint,Fo=vr.sourceNode,ma=vr.targetNode;Ft===Nd.SOURCE?Eo={startPoint:{x:er.anchor.x,y:er.anchor.y},endPoint:{x:zr.x,y:zr.y},sourceNode:er.node,targetNode:ma}:Ft===Nd.TARGET&&(Eo={startPoint:{x:Co.x,y:Co.y},endPoint:{x:er.anchor.x,y:er.anchor.y},sourceNode:Fo,targetNode:er.node}),vr.updateAfterAdjustStartAndEnd(Eo)}else Ft===Nd.SOURCE?vr.updateStartPoint({x:Ar,y:Vn}):Ft===Nd.TARGET&&vr.updateEndPoint({x:Ar,y:Vn});vr.text.value&&Hn.adjustEdge&&vr.setText(Object.assign({},vr.text,vr.textPosition))})),du(cu(b),"onDragEnd",(function(H){var oe=H.event;try{var ue;b.setState({dragging:!1});var Ne=b.props,Ve=Ne.graphModel,qe=Ne.edgeModel,Ot=Ne.type,xt=b.state,Ft=xt.endX,vn=xt.endY,Hn=xt.dragging,zn=Cf({x:Ft,y:vn},Ve);if(!Hn)return;var Ar,Vn=!1;if(zn&&zn.node){var vr=b.isAllowAdjust(zn),er=vr.pass,Eo=vr.msg,Co=vr.newTargetNode;if(er){var zr=qe.getData(),Fo=zr.text,ma=zr.sourceAnchorId,ya=ma===void 0?"":ma,Nl=zr.targetAnchorId;Ar=qf(qf({sourceAnchorId:ya,targetAnchorId:Nl===void 0?"":Nl},fB(zr,dB)),{},{text:(Fo==null?void 0:Fo.value)||""}),Ot===Nd.SOURCE?(Ar=qf(qf({},Ve.edgeGenerator(Ve.getNodeModelById(zn.node.id).getData(),Ve.getNodeModelById(qe.targetNodeId).getData(),Ar)),{},{sourceNodeId:zn.node.id,sourceAnchorId:zn.anchor.id,startPoint:{x:zn.anchor.x,y:zn.anchor.y},targetNodeId:qe.targetNodeId,endPoint:qf({},qe.endPoint)}),qe.sourceNodeId===zn.node.id&&qe.sourceAnchorId===zn.anchor.id&&(Vn=!0)):Ot===Nd.TARGET&&(Ar=qf(qf({},Ve.edgeGenerator(Ve.getNodeModelById(qe.sourceNodeId).getData(),Ve.getNodeModelById(zn.node.id).getData(),Ar)),{},{sourceNodeId:qe.sourceNodeId,startPoint:qf({},qe.startPoint),targetNodeId:zn.node.id,targetAnchorId:zn.anchor.id,endPoint:{x:zn.anchor.x,y:zn.anchor.y}}),qe.targetNodeId===zn.node.id&&qe.targetAnchorId===zn.anchor.id&&(Vn=!0))}else{Vn=!0;var fu=Co.getData();Ve.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:fu,msg:Eo})}}else Vn=!0;if(Vn)b.recoveryEdge();else{var pu=qe.getData();Ve.deleteEdgeById(qe.id);var Pd=Ve.addEdge(qf({},Ar));Ve.eventCenter.emit(ur.EDGE_EXCHANGE_NODE,{data:{newEdge:Pd.getData(),oldEdge:pu}})}(ue=b.preTargetNode)===null||ue===void 0||ue.setElementState(Io.DEFAULT)}finally{b.props.graphModel.eventCenter.emit(ur.ADJUST_POINT_DRAGEND,{e:oe,data:b.stepDragData})}})),du(cu(b),"recoveryEdge",(function(){var H=b.props.edgeModel,oe=b.oldEdge,ue=oe.startPoint,Ne=oe.endPoint,Ve=oe.pointsList;H.updateStartPoint(ue),H.updateEndPoint(Ne),H.modelType!==lo.LINE_EDGE&&(H.pointsList=Ve,H.initPoints())})),du(cu(b),"getAdjustPointStyle",(function(){var H=b.props,oe=H.graphModel.theme;return H.edgeModel,oe.edgeAdjust})),b.state={dragging:!1,endX:0,endY:0},b.targetRuleResults=new Map,b.sourceRuleResults=new Map;var A=g.type,N=g.edgeModel,V=g.graphModel.eventCenter;return b.stepDragData={type:A,edgeData:N.getData()},b.stepDrag=new Ce({onDragStart:b.onDragStart,onDragging:b.onDragging,onDragEnd:b.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:V,data:b.stepDragData}),b}return u=y,(d=[{key:"isAllowAdjust",value:function(g){var b=this.props,A=b.edgeModel,N=A.id,V=A.sourceNode,H=A.targetNode,oe=A.sourceAnchorId,ue=A.targetAnchorId,Ne=b.type,Ve=null,qe=null,Ot=null,xt=null;if(Ne===Nd.SOURCE?(Ve=g.node,qe=H,Ot=g.anchor,xt=H.getAnchorInfo(ue)):(Ve=V,qe=g.node,xt=g.anchor,Ot=V.getAnchorInfo(oe)),this.preTargetNode&&this.preTargetNode!==g.node&&this.preTargetNode.setElementState(Io.DEFAULT),this.preTargetNode=g.node,xt.id===Ot.id)return{pass:!1,msg:"",newTargetNode:qe};var Ft="".concat(Ve.id,"_").concat(qe.id,"_").concat(Ot.id,"_").concat(xt.id);if(!this.targetRuleResults.has(Ft)){var vn=Ve.isAllowConnectedAsSource(qe,Ot,xt,N),Hn=qe.isAllowConnectedAsTarget(Ve,Ot,xt,N);this.sourceRuleResults.set(Ft,au(vn)),this.targetRuleResults.set(Ft,au(Hn))}var zn=this.sourceRuleResults.get(Ft),Ar=zn.isAllPass,Vn=zn.msg,vr=this.targetRuleResults.get(Ft),er=vr.isAllPass,Eo=vr.msg,Co=Ar&&er?Io.ALLOW_CONNECT:Io.NOT_ALLOW_CONNECT;return Ne===Nd.SOURCE?Ve.setElementState(Co):qe.setElementState(Co),{pass:Ar&&er,msg:Eo||Vn,newTargetNode:qe}}},{key:"render",value:function(){var g=this.props,b=g.x,A=g.y,N=g.getAdjustPointShape,V=g.edgeModel,H=this.state.dragging;return Object(re.g)("g",{pointerEvents:H?"none":"",onMouseDown:this.handleMouseDown},H?"":N(b,A,V))}}])&&hB(u.prototype,d),y})(re.a);function mO(c){return mO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},mO(c)}function ky(){return ky=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},ky.apply(this,arguments)}function mB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return pN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return pN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function pN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function yB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function _B(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function yO(c,u){return yO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yO(c,u)}function bB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Zb(c);if(u){var y=Zb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return wB(this,d)}}function wB(c,u){if(u&&(mO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ic(c)}function Ic(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Zb(c){return Zb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Zb(c)}function kd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Py=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&yO(g,b)})(y,c);var u,d,p=bB(y);function y(){var g;yB(this,y);for(var b=arguments.length,A=new Array(b),N=0;N<b;N++)A[N]=arguments[N];return kd(Ic(g=p.call.apply(p,[this].concat(A))),"startTime",void 0),kd(Ic(g),"contextMenuTime",void 0),kd(Ic(g),"clickTimer",void 0),kd(Ic(g),"textRef",Object(re.f)()),kd(Ic(g),"handleHover",(function(V,H){var oe=g.props,ue=oe.model,Ne=oe.graphModel.eventCenter;ue.setHovered(V);var Ve=V?ur.EDGE_MOUSEENTER:ur.EDGE_MOUSELEAVE,qe=ue.getData();Ne.emit(Ve,{data:qe,e:H})})),kd(Ic(g),"setHoverON",(function(V){g.props.model.isHovered||(g.textRef&&g.textRef.current&&g.textRef.current.setHoverON(),g.handleHover(!0,V))})),kd(Ic(g),"setHoverOFF",(function(V){g.props.model.isHovered&&(g.textRef&&g.textRef.current&&g.textRef.current.setHoverOFF(),g.handleHover(!1,V))})),kd(Ic(g),"handleContextMenu",(function(V){V.preventDefault(),g.contextMenuTime=new Date().getTime(),g.clickTimer&&clearTimeout(g.clickTimer);var H=g.props,oe=H.model,ue=H.graphModel,Ne=ue.getPointByClient({x:V.clientX,y:V.clientY});ue.setElementStateById(oe.id,Io.SHOW_MENU,Ne.domOverlayPosition),g.toFront(),oe.isSelected||ue.selectEdgeById(oe.id);var Ve=oe==null?void 0:oe.getData();ue.eventCenter.emit(ur.EDGE_CONTEXTMENU,{data:Ve,e:V,position:Ne})})),kd(Ic(g),"handleMouseDown",(function(V){V.stopPropagation(),g.startTime=new Date().getTime()})),kd(Ic(g),"handleMouseUp",(function(V){if(g.startTime&&!(new Date().getTime()-g.startTime>200||V.button===2)){var H=V.detail===2,oe=g.props,ue=oe.model,Ne=oe.graphModel,Ve=ue==null?void 0:ue.getData(),qe=Ne.getPointByClient({x:V.clientX,y:V.clientY});if(H){var Ot=Ne.editConfigModel,xt=Ne.textEditElement;if(xt&&xt.id===ue.id&&Ne.setElementStateById(ue.id,Io.DEFAULT),Ot.edgeTextEdit&&ue.text.editable&&Ne.setElementStateById(ue.id,Io.TEXT_EDIT),ue.modelType===lo.POLYLINE_EDGE){var Ft=ue,vn=Ne.getPointByClient({x:V.x,y:V.y}).canvasOverlayPosition,Hn=vn.x,zn=vn.y,Ar=co({x:Hn,y:zn},Ft.points);Ft.dbClickPosition=Ar}Ne.eventCenter.emit(ur.EDGE_DBCLICK,{data:Ve,e:V,position:qe})}else Ne.eventCenter.emit(ur.ELEMENT_CLICK,{data:Ve,e:V,position:qe}),Ne.eventCenter.emit(ur.EDGE_CLICK,{data:Ve,e:V,position:qe});var Vn=Ne.editConfigModel;Ne.selectEdgeById(ue.id,yd(V,Vn)),g.toFront()}})),g}return u=y,(d=[{key:"getShape",value:function(){return Object(re.g)("g",null,this.getEdge())}},{key:"getTextStyle",value:function(){}},{key:"getText",value:function(){var g=this.props,b=g.model,A=g.graphModel;if(b.state===Io.TEXT_EDIT)return null;var N=!1,V=A.editConfigModel;return(b.text.draggable||V.edgeTextDraggable)&&(N=!0),Object(re.g)(cB,{ref:this.textRef,editable:V.edgeTextEdit&&b.text.editable,model:b,graphModel:A,draggable:N})}},{key:"getArrowInfo",value:function(){var g=this.props.model,b=g.startPoint,A=g.endPoint,N=g.isSelected;return{start:b,end:A,hover:this.state.hover,isSelected:N}}},{key:"getLastTwoPoints",value:function(){var g=this.props.model;return[g.startPoint,g.endPoint]}},{key:"getArrowStyle",value:function(){return null}},{key:"getArrow",value:function(){var g=this.props.model,b=g.id,A=g.getArrowStyle(),N=A.refY,V=N===void 0?0:N,H=A.refX,oe=H===void 0?2:H,ue=mB(this.getLastTwoPoints(),2),Ne=ue[0],Ve=ue[1],qe="auto";return Ne!==null&&Ve!==null&&(qe=mv(eh({x:Ve.x-Ne.x,y:Ve.y-Ne.y,z:0}))),Object(re.g)("g",null,Object(re.g)("defs",null,Object(re.g)("marker",{id:"marker-start-".concat(b),refX:-oe,refY:V,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse"},this.getStartArrow()),Object(re.g)("marker",{id:"marker-end-".concat(b),refX:oe,refY:V,overflow:"visible",orient:qe,markerUnits:"userSpaceOnUse"},this.getEndArrow())))}},{key:"getStartArrow",value:function(){var g=this.props.model.getArrowStyle();return g.stroke,g.strokeWidth,g.offset,g.verticalLength,Object(re.g)("path",null)}},{key:"getEndArrow",value:function(){var g=this.props.model.getArrowStyle(),b=g.stroke,A=g.strokeWidth,N=g.offset,V=g.verticalLength;return Object(re.g)("path",{stroke:b,fill:b,strokeWidth:A,transform:"rotate(180)",d:"M 0 0 L ".concat(N," -").concat(V," L ").concat(N," ").concat(V," Z")})}},{key:"getAdjustPointShape",value:function(g,b,A){var N=A.getAdjustPointStyle();return Object(re.g)($g,ky({className:"lf-edge-adjust-point"},N,{x:g,y:b}))}},{key:"getAdjustPoints",value:function(){var g=this.props,b=g.model,A=g.graphModel,N=b.getAdjustStart(),V=b.getAdjustEnd();return Object(re.g)("g",null,Object(re.g)(fN,ky({type:"SOURCE"},N,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:b,graphModel:A})),Object(re.g)(fN,ky({type:"TARGET"},V,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:b,graphModel:A})))}},{key:"getAnimation",value:function(){}},{key:"getAppendWidth",value:function(){return Object(re.g)("g",null)}},{key:"getAppend",value:function(){return Object(re.g)("g",{className:"lf-edge-append"},this.getAppendWidth())}},{key:"getEdge",value:function(){return null}},{key:"toFront",value:function(){var g=this.props,b=g.graphModel,A=g.model;b.toFront(A.id)}},{key:"render",value:function(){var g=this.props,b=g.model,A=b.isSelected,N=b.isHitable,V=b.isShowAdjustPoint;return g.graphModel.animation,Object(re.g)("g",null,Object(re.g)("g",{className:["lf-edge",!N&&"pointer-none",A&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverON,onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getShape(),this.getAppend(),this.getText(),this.getArrow()),V&&A?this.getAdjustPoints():"")}}])&&_B(u.prototype,d),y})(re.a);function _O(c){return _O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},_O(c)}function EB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return hN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return hN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function hN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var Ry=function(c){var u={d:""};return Object.entries(c).forEach((function(d){var p=EB(d,2),y=p[0],g=p[1],b=_O(g);y!=="style"&&b==="object"||(u[y]=g)})),Object(re.g)("path",u)};function bO(c){return bO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},bO(c)}function wO(){return wO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},wO.apply(this,arguments)}function xB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function OB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function EO(c,u){return EO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},EO(c,u)}function SB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=Jb(c);if(u){var y=Jb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return AB(this,d)}}function AB(c,u){if(u&&(bO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function Jb(c){return Jb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Jb(c)}var xO=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&EO(g,b)})(y,c);var u,d,p=SB(y);function y(){return xB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var g=this.props.model,b=g.startPoint,A=g.endPoint,N=g.isAnimation,V=g.arrowConfig,H=g.getEdgeStyle(),oe=g.getEdgeAnimationStyle(),ue=oe.strokeDasharray,Ne=oe.stroke,Ve=oe.strokeDashoffset,qe=oe.animationName,Ot=oe.animationDuration,xt=oe.animationIterationCount,Ft=oe.animationTimingFunction,vn=oe.animationDirection;return Object(re.g)(Fg,wO({},H,{x1:b.x,y1:b.y,x2:A.x,y2:A.y},V,N?{strokeDasharray:ue,stroke:Ne,style:{strokeDashoffset:Ve,animationName:qe,animationDuration:Ot,animationIterationCount:xt,animationTimingFunction:Ft,animationDirection:vn}}:{}))}},{key:"getAppendWidth",value:function(){var g=this.props.model,b=g.startPoint,A=g.endPoint,N=la({start:b,end:A}),V=N.d,H=N.strokeWidth,oe=N.fill,ue=N.strokeDasharray,Ne=N.stroke;return Object(re.g)(Ry,{d:V,fill:oe,strokeWidth:H,stroke:Ne,strokeDasharray:ue})}}])&&OB(u.prototype,d),y})(Py);function OO(c){return OO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},OO(c)}function MB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return vN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return vN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function vN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}var TB=function(c){var u={points:"",fill:"none"};return Object.entries(c).forEach((function(d){var p=MB(d,2),y=p[0],g=p[1];(y==="style"||OO(g)!=="object")&&(u[y]=g)})),Object(re.g)("polyline",u)};function SO(c){return SO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},SO(c)}function gN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Qb(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?gN(Object(d),!0).forEach((function(p){Zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function AO(){return AO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},AO.apply(this,arguments)}function CB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return mN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return mN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function mN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function NB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function MO(c,u){return MO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},MO(c,u)}function kB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=e0(c);if(u){var y=e0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return PB(this,d)}}function PB(c,u){if(u&&(SO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kf(c)}function Kf(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function e0(c){return e0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},e0(c)}function Zf(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var TO=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&MO(g,b)})(y,c);var u,d,p=kB(y);function y(){var g;return(function(b,A){if(!(b instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Zf(Kf(g=p.call(this)),"drag",void 0),Zf(Kf(g),"isDragging",void 0),Zf(Kf(g),"isShowAdjustPointTemp",void 0),Zf(Kf(g),"appendInfo",void 0),Zf(Kf(g),"onDragStart",(function(){var b=g.props.model;b.dragAppendStart(),g.isShowAdjustPointTemp=b.isShowAdjustPoint,b.isShowAdjustPoint=!1})),Zf(Kf(g),"onDragging",(function(b){var A=b.deltaX,N=b.deltaY,V=g.props,H=V.model,oe=V.graphModel;g.isDragging=!0;var ue=oe.transformModel,Ne=oe.editConfigModel,Ve=CB(ue.fixDeltaXY(A,N),2),qe=Ve[0],Ot=Ve[1],xt=H,Ft=Ne.adjustEdgeMiddle;g.appendInfo=Ft?xt.dragAppendSimple(g.appendInfo,{x:qe,y:Ot}):xt.dragAppend(g.appendInfo,{x:qe,y:Ot})})),Zf(Kf(g),"onDragEnd",(function(){var b=g.props,A=b.model,N=b.graphModel.eventCenter,V=A;V.dragAppendEnd(),g.isDragging=!1,V.isShowAdjustPoint=g.isShowAdjustPointTemp,g.appendInfo=void 0,N.emit(ur.EDGE_ADJUST,{data:V.getData()})})),Zf(Kf(g),"beforeDragStart",(function(b,A){A.dragAble&&g.drag.handleMouseDown(b),g.appendInfo=A})),g.drag=new Ce({onDragStart:g.onDragStart,onDragging:g.onDragging,onDragEnd:g.onDragEnd,isStopPropagation:!1}),g}return u=y,(d=[{key:"getEdge",value:function(){var g=this.props.model,b=g.points,A=g.isAnimation,N=g.arrowConfig,V=g.getEdgeStyle(),H=g.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ne=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(TB,AO({points:b},V,N,A?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ne,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getArrowInfo",value:function(){var g=this.props.model,b=g.points,A=g.isSelected,N={start:null,end:null,hover:this.state.hover,isSelected:A},V=jr(b);return V.length>=2&&(N.start=V[V.length-2],N.end=V[V.length-1]),N}},{key:"getLastTwoPoints",value:function(){var g=this.props.model.points,b=jr(g);return b.length>=2?[b[b.length-2],b[b.length-1]]:[null,null]}},{key:"getAppendAttributes",value:function(g){var b,A=g.start,N=g.end;if(A.x===N.x&&A.y===N.y)b="";else{var V={start:A,end:N,offset:10,verticalLength:5},H=kc(Qb(Qb({},V),{},{type:"start"})),oe=kc(Qb(Qb({},V),{},{type:"end"}));b="M".concat(H.leftX," ").concat(H.leftY,`
|
||
L`).concat(H.rightX," ").concat(H.rightY,`
|
||
L`).concat(oe.rightX," ").concat(oe.rightY,`
|
||
L`).concat(oe.leftX," ").concat(oe.leftY," z")}return{d:b,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}}},{key:"getAppendShape",value:function(g){var b=this.getAppendAttributes(g),A=b.d,N=b.strokeWidth,V=b.fill,H=b.strokeDasharray,oe=b.stroke;return Object(re.g)(Ry,{d:A,fill:V,strokeWidth:N,stroke:oe,strokeDasharray:H})}},{key:"getAppendWidth",value:function(){for(var g=this,b=this.props,A=b.model,N=b.graphModel,V=A.pointsList,H=A.draggable,oe=[],ue=V.length,Ne=function(qe){var Ot="lf-polyline-append",xt={start:{x:V[qe].x,y:V[qe].y},end:{x:V[qe+1].x,y:V[qe+1].y},startIndex:qe,endIndex:qe+1,direction:"",dragAble:!0},Ft=Object(re.g)("g",{className:Ot},g.getAppendShape(xt)),vn=N.editConfigModel,Hn=vn.adjustEdge,zn=vn.adjustEdgeMiddle;if(Hn&&H){var Ar=xt.startIndex,Vn=xt.endIndex,vr=zn&&(Ar===0||Vn===ue-1);xt.dragAble=!vr,xt.start.x===xt.end.x?(xt.dragAble&&(Ot+="-ew-resize"),xt.direction=ti.VERTICAL):xt.start.y===xt.end.y&&(xt.dragAble&&(Ot+="-ns-resize"),xt.direction=ti.HORIZONTAL),Ft=Object(re.g)("g",{className:g.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(er){return g.beforeDragStart(er,xt)}},Object(re.g)("g",{className:Ot},g.getAppendShape(xt)))}oe.push(Ft)},Ve=0;Ve<ue-1;Ve++)Ne(Ve);return Object(re.g)("g",null,oe)}}])&&NB(u.prototype,d),y})(Py);function CO(c){return CO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},CO(c)}function RB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return yN(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return yN(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function yN(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function NO(){return NO=Object.assign||function(c){for(var u=1;u<arguments.length;u++){var d=arguments[u];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},NO.apply(this,arguments)}function DB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function jB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function kO(c,u){return kO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kO(c,u)}function LB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=t0(c);if(u){var y=t0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return IB(this,d)}}function IB(c,u){if(u&&(CO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function t0(c){return t0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},t0(c)}var PO=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&kO(g,b)})(y,c);var u,d,p=LB(y);function y(){return DB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var g=this.props.model,b=g.getEdgeStyle(),A=g.path,N=g.isAnimation,V=g.arrowConfig,H=g.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ne=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(Ry,NO({d:A},b,V,N?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ne,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getAppendWidth",value:function(){var g=this.props.model.path;return Object(re.g)(Ry,{d:g,strokeWidth:10,stroke:"transparent",fill:"none"})}},{key:"getArrowInfo",value:function(){var g=this.props.model,b=this.state.hover,A=g.isSelected,N=g.getArrowStyle().offset,V=g.pointsList.map((function(oe){return{x:oe.x,y:oe.y}})),H=RB(sa(V,N),2);return{start:H[0],end:H[1],hover:b,isSelected:A}}},{key:"getLastTwoPoints",value:function(){var g=this.props.model,b=g.getArrowStyle().offset,A=g.pointsList.map((function(N){return{x:N.x,y:N.y}}));return sa(A,b)}}])&&jB(u.prototype,d),y})(Py);function RO(c){return RO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},RO(c)}function _N(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function FB(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function BB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function $B(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function DO(c,u){return DO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},DO(c,u)}function UB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=n0(c);if(u){var y=n0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return VB(this,d)}}function VB(c,u){if(u&&(RO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(d){if(d===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d})(c)}function n0(c){return n0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},n0(c)}var WB=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&DO(g,b)})(y,c);var u,d,p=UB(y);function y(){return BB(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getArrowAttributes",value:function(){var g=this.props,b=g.arrowInfo,A=g.style,N=b.start,V=b.end,H={start:N,end:V,offset:A.offset,verticalLength:A.verticalLength,type:"end"},oe=kc(H),ue=oe.leftX,Ne=oe.leftY,Ve=oe.rightX,qe=oe.rightY;return(function(Ot){for(var xt=1;xt<arguments.length;xt++){var Ft=arguments[xt]!=null?arguments[xt]:{};xt%2?_N(Object(Ft),!0).forEach((function(vn){FB(Ot,vn,Ft[vn])})):Object.getOwnPropertyDescriptors?Object.defineProperties(Ot,Object.getOwnPropertyDescriptors(Ft)):_N(Object(Ft)).forEach((function(vn){Object.defineProperty(Ot,vn,Object.getOwnPropertyDescriptor(Ft,vn))}))}return Ot})({d:"M".concat(ue," ").concat(Ne," L").concat(V.x," ").concat(V.y," L").concat(Ve," ").concat(qe," z")},A)}},{key:"getShape",value:function(){var g=this.getArrowAttributes(),b=g.d,A=g.strokeWidth,N=g.stroke,V=g.fill;return Object(re.g)(Ry,{d:b,fill:V,strokeWidth:A,stroke:N})}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-arrow"},this.getShape())}}],d&&$B(u.prototype,d),y})(re.a),bN=function(c,u){return It(c,u)},GB=function(c){var u=c==null?0:c.length;return u?c[u-1]:void 0},jO=function(){return En.a.Date.now()},zB=Math.max,HB=Math.min,XB=function(c,u,d){var p,y,g,b,A,N,V=0,H=!1,oe=!1,ue=!0;if(typeof c!="function")throw new TypeError("Expected a function");function Ne(vn){var Hn=p,zn=y;return p=y=void 0,V=vn,b=c.apply(zn,Hn)}function Ve(vn){return V=vn,A=setTimeout(Ot,u),H?Ne(vn):b}function qe(vn){var Hn=vn-N;return N===void 0||Hn>=u||Hn<0||oe&&vn-V>=g}function Ot(){var vn=jO();if(qe(vn))return xt(vn);A=setTimeout(Ot,(function(Hn){var zn=u-(Hn-N);return oe?HB(zn,g-(Hn-V)):zn})(vn))}function xt(vn){return A=void 0,ue&&p?Ne(vn):(p=y=void 0,b)}function Ft(){var vn=jO(),Hn=qe(vn);if(p=arguments,y=this,N=vn,Hn){if(A===void 0)return Ve(N);if(oe)return clearTimeout(A),A=setTimeout(Ot,u),Ne(N)}return A===void 0&&(A=setTimeout(Ot,u)),b}return u=bd(u)||0,Fn(d)&&(H=!!d.leading,g=(oe="maxWait"in d)?zB(bd(d.maxWait)||0,u):g,ue="trailing"in d?!!d.trailing:ue),Ft.cancel=function(){A!==void 0&&clearTimeout(A),V=0,p=N=y=A=void 0},Ft.flush=function(){return A===void 0?b:xt(jO())},Ft},YB=r(172);function qB(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function lh(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var wN,EN,xN,KB=(function(){function c(p){(function(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")})(this,c),lh(this,"undos",[]),lh(this,"redos",[]),lh(this,"callbacks",[]),lh(this,"stopWatch",null),lh(this,"curData",null),lh(this,"maxSize",50),lh(this,"waitTime",100),lh(this,"eventCenter",void 0),this.eventCenter=p}var u,d;return u=c,(d=[{key:"add",value:function(p){bN(GB(this.undos),p)||(this.undos.push(p),bN(this.curData,p)||(this.redos=[]),this.eventCenter.emit(ur.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undos.length>1,redoAble:this.redos.length>0}}),this.undos.length>this.maxSize&&this.undos.shift())}},{key:"undoAble",value:function(){return this.undos.length>1}},{key:"undo",value:function(){if(this.undoAble()){var p=this.undos.pop();this.redos.push(p);var y=this.undos.pop();return this.curData=Uo(y),y}}},{key:"redoAble",value:function(){return this.redos.length>0}},{key:"redo",value:function(){if(this.redoAble()){var p=this.redos.pop();return this.curData=Uo(p),p}}},{key:"watch",value:function(p){var y=this;this.stopWatch&&this.stopWatch(),this.undos.push(p.modelToGraphData()),this.stopWatch=Object(YB.a)(p,XB((function(){var g=p.modelToHistoryData();g&&y.add(g)}),this.waitTime))}}])&&qB(u.prototype,d),c})();function LO(c){return LO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},LO(c)}function ZB(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return ON(d,p);var y=Object.prototype.toString.call(d).slice(8,-1);if(y==="Object"&&d.constructor&&(y=d.constructor.name),y==="Map"||y==="Set")return Array.from(d);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return ON(d,p)}})(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function ON(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function SN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Ov(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?SN(Object(d),!0).forEach((function(p){Sv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):SN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function AN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function IO(c,u){return IO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},IO(c,u)}function JB(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=r0(c);if(u){var y=r0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return QB(this,d)}}function QB(c,u){if(u&&(LO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zg(c)}function Zg(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function r0(c){return r0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},r0(c)}function Sv(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var MN,TN,CN,FO=Fc((xN=EN=(function(c){(function(b,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");b.prototype=Object.create(A&&A.prototype,{constructor:{value:b,writable:!0,configurable:!0}}),A&&IO(b,A)})(g,c);var u,d,p,y=JB(g);function g(){var b;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,g),Sv(Zg(b=y.call(this)),"ref",Object(re.f)()),Sv(Zg(b),"__prevText",{type:"",text:"",id:""}),Sv(Zg(b),"keyupHandler",(function(A){var N=b.props.graphModel.textEditElement;A.key==="Enter"&&A.altKey&&N.setElementState(0)})),Sv(Zg(b),"inputHandler",(function(A){var N=A.target.innerText,V=b.props.graphModel.textEditElement;b.__prevText={type:V.type,text:N.replace(/(\r\n)+$|(\n)+$/,""),id:V.id}})),Sv(Zg(b),"keydownHandler",(function(A){A.stopPropagation()})),b.state={style:{left:0,top:0}},b}return u=g,p=[{key:"getDerivedStateFromProps",value:function(b){var A,N=b.graphModel,V=N.transformModel,H=N.theme,oe=H.inputText,ue=N.textEditElement;if(ue){var Ne;if((Ne=ue.text)===null||Ne===void 0||!Ne.value)if(ue.BaseType===ei.EDGE){var Ve=(ue=ue).text,qe=ue.textPosition,Ot=qe.x,xt=qe.y;Ve.x=Ot,Ve.y=xt,ue.setText(Ve)}else ue=ue;var Ft={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(ue.BaseType===ei.EDGE){var vn=H.edgeText,Hn=vn.overflowMode,zn=vn.lineHeight,Ar=vn.wrapPadding,Vn=vn.textWidth;Vn&&Hn==="autoWrap"&&(A=Ov(Ov({},Ft),{},{width:Vn,minWidth:Vn,lineHeight:zn,padding:Ar}))}else if(ue.BaseType===ei.NODE){var vr=H.nodeText,er=vr.overflowMode,Eo=vr.lineHeight,Co=vr.wrapPadding,zr=vr.textWidth,Fo=ue,ma=Fo.width,ya=Fo.modelType,Nl=Fo.textWidth||zr||ma;(ya!==lo.TEXT_NODE&&er==="autoWrap"||ya===lo.TEXT_NODE&&zr)&&(A=Ov(Ov({},Ft),{},{width:Nl,minWidth:Nl,lineHeight:Eo,padding:Co}))}var fu=ue.text,pu=fu.x,Pd=fu.y,Av=ZB(V.CanvasPointToHtmlPoint([pu,Pd]),2);return{style:Ov(Ov({left:Av[0],top:Av[1]},A),oe)}}}}],(d=[{key:"componentDidUpdate",value:function(){var b=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var A=this.__prevText,N=A.text,V=A.id;b.updateText(V,N),b.eventCenter.emit(ur.TEXT_UPDATE,Ov({},this.__prevText)),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}}},{key:"placeCaretAtEnd",value:function(b){if(window.getSelection!==void 0&&document.createRange!==void 0){var A=document.createRange();A.selectNodeContents(b),A.collapse(!1);var N=window.getSelection();N.removeAllRanges(),N.addRange(A)}}},{key:"render",value:function(){var b,A=this.props.graphModel.textEditElement,N=this.state.style;return A?Object(re.g)("div",{contentEditable:!0,className:"lf-text-input",style:N,ref:this.ref,key:A.id,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler},(b=A.text)===null||b===void 0?void 0:b.value):null}}])&&AN(u.prototype,d),p&&AN(u,p),g})(re.a),Sv(EN,"toolName","textEdit"),wN=xN))||wN,e$=function(c){return c.modelType===lo.LINE_EDGE?(function(u){var d=u.startPoint,p=u.endPoint,y=(d.x+p.x)/2,g=(d.y+p.y)/2,b=Math.abs(d.x-p.x)+10,A=Math.abs(d.y-p.y)+10;return{x:y-b/2,y:g-A/2,x1:y+b/2,y1:g+A/2}})(c):c.modelType===lo.POLYLINE_EDGE?(function(u){var d=u.points,p=jr(d),y=St(p,8),g=y.x,b=y.y,A=y.width,N=y.height;return{x:g-A/2,y:b-N/2,x1:g+A/2,y1:b+N/2}})(c):c.modelType===lo.BEZIER_EDGE?(function(u){var d=u.path,p=di(d),y=St(p,8),g=y.x,b=y.y,A=y.width,N=y.height;return{x:g-A/2,y:b-N/2,x1:g+A/2,y1:b+N/2}})(c):void 0};function BO(c){return BO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},BO(c)}function NN(c,u){return(function(d){if(Array.isArray(d))return d})(c)||(function(d,p){var y=d==null?null:typeof Symbol<"u"&&d[Symbol.iterator]||d["@@iterator"];if(y!=null){var g,b,A=[],N=!0,V=!1;try{for(y=y.call(d);!(N=(g=y.next()).done)&&(A.push(g.value),!p||A.length!==p);N=!0);}catch(H){V=!0,b=H}finally{try{N||y.return==null||y.return()}finally{if(V)throw b}}return A}})(c,u)||kN(c,u)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function t$(c){return(function(u){if(Array.isArray(u))return $O(u)})(c)||(function(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)})(c)||kN(c)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function kN(c,u){if(c){if(typeof c=="string")return $O(c,u);var d=Object.prototype.toString.call(c).slice(8,-1);return d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set"?Array.from(c):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?$O(c,u):void 0}}function $O(c,u){(u==null||u>c.length)&&(u=c.length);for(var d=0,p=new Array(u);d<u;d++)p[d]=c[d];return p}function n$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function UO(c,u){return UO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},UO(c,u)}function r$(c){var u=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var d,p=o0(c);if(u){var y=o0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return o$(this,d)}}function o$(c,u){if(u&&(BO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jg(c)}function Jg(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function o0(c){return o0=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},o0(c)}function Qg(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var VO=Fc((CN=TN=(function(c){(function(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),b&&UO(g,b)})(y,c);var u,d,p=r$(y);function y(g){var b;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Qg(Jg(b=p.call(this)),"stepDrag",void 0),Qg(Jg(b),"handleMouseDown",(function(H){b.stepDrag.handleMouseDown(H)})),Qg(Jg(b),"handleWheelEvent",(function(H){var oe,ue;H.preventDefault();var Ne=H.deltaX,Ve=H.deltaY,qe=H.clientX,Ot=H.clientY,xt=H.ctrlKey,Ft=new WheelEvent("wheel",{deltaX:Ne,deltaY:Ve,clientX:qe,clientY:Ot,ctrlKey:xt});(oe=b.props.logicFlow.container)===null||oe===void 0||(ue=oe.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||ue===void 0||ue.dispatchEvent(Ft)})),Qg(Jg(b),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ne=b.props.graphModel,Ve=Ne.getSelectElements(!0);Ne.moveNodes(Ve.nodes.map((function(qe){return qe.id})),oe,ue)})),Qg(Jg(b),"handleContextMenu",(function(H){H.preventDefault();var oe=b.props,ue=oe.graphModel,Ne=oe.graphModel,Ve=Ne.eventCenter,qe=Ne.selectElements,Ot=ue.getPointByClient({x:H.clientX,y:H.clientY}),xt={nodes:[],edges:[]};t$(qe.values()).forEach((function(Ft){Ft.BaseType===ei.NODE&&xt.nodes.push(Ft.getData()),Ft.BaseType===ei.EDGE&&xt.edges.push(Ft.getData())})),Ve.emit(ur.SELECTION_CONTEXTMENU,{data:xt,e:H,position:Ot})}));var A=g.graphModel,N=A.gridSize,V=A.eventCenter;return b.stepDrag=new Ce({onDragging:b.onDragging,step:N,eventType:"SELECTION",eventCenter:V}),b}return u=y,(d=[{key:"render",value:function(){var g=this.props.graphModel,b=g.selectElements,A=g.transformModel;if(!(b.size<=1)){var N=Number.MAX_SAFE_INTEGER,V=Number.MAX_SAFE_INTEGER,H=Number.MIN_SAFE_INTEGER,oe=Number.MIN_SAFE_INTEGER;b.forEach((function(qe){var Ot={x:0,y:0,x1:0,y1:0};qe.BaseType===ei.NODE&&(Ot=(function(xt){var Ft=xt.x,vn=xt.y,Hn=xt.width,zn=xt.height;return{x:Ft-Hn/2,y:vn-zn/2,x1:Ft+Hn/2,y1:vn+zn/2}})(qe)),qe.BaseType===ei.EDGE&&(Ot=e$(qe)),N=Math.min(N,Ot.x),V=Math.min(V,Ot.y),H=Math.max(H,Ot.x1),oe=Math.max(oe,Ot.y1)}));var ue=NN(A.CanvasPointToHtmlPoint([N,V]),2);N=ue[0],V=ue[1];var Ne=NN(A.CanvasPointToHtmlPoint([H,oe]),2);H=Ne[0],oe=Ne[1];var Ve={left:"".concat(N-10,"px"),top:"".concat(V-10,"px"),width:"".concat(H-N+20,"px"),height:"".concat(oe-V+20,"px")};return Object(re.g)("div",{className:"lf-multiple-select",style:Ve,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}}}])&&n$(u.prototype,d),y})(re.a),Qg(TN,"toolName","multipleSelect"),MN=CN))||MN;function i$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function i0(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var a$=(function(){function c(p){(function(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),i0(this,"tools",void 0),i0(this,"components",void 0),i0(this,"toolMap",new Map),i0(this,"instance",void 0),this.instance=p,this.isDisabledTool(FO.toolName)||this.registerTool(FO.toolName,FO),this.isDisabledTool(VO.toolName)||this.registerTool(VO.toolName,VO);var y=p.graphModel;y.eventCenter.on("".concat(ur.GRAPH_TRANSFORM,",").concat(ur.NODE_CLICK,",").concat(ur.BLANK_CLICK," "),(function(){var g=y.textEditElement,b=y.editConfigModel,A=b.edgeTextEdit,N=b.nodeTextEdit;(A||N)&&g&&y.textEditElement.setElementState(Io.DEFAULT)}))}var u,d;return u=c,(d=[{key:"isDisabledTool",value:function(p){return this.instance.options.disabledTools.indexOf(p)!==-1}},{key:"registerTool",value:function(p,y){this.toolMap.set(p,y)}},{key:"getTools",value:function(){return Array.from(this.toolMap.values())}},{key:"getInstance",value:function(){return this.instance}}])&&i$(u.prototype,d),c})(),l$=r(173),s$=r.n(l$);function u$(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function WO(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var PN=(function(){function c(p){(function(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")})(this,c),WO(this,"mousetrap",void 0),WO(this,"options",void 0),WO(this,"target",void 0),p.keyboard||(p.keyboard={enabled:!1}),this.options=p;var y=p.lf;this.target=y.container,this.mousetrap=new s$.a(this.target),p.keyboard.enabled&&!y.options.isSilentMode&&this.enable(!0)}var u,d;return u=c,(d=[{key:"initShortcuts",value:function(){var p=this,y=this.options.keyboard.shortcuts;if(y)if(qo(y))y.forEach((function(N){var V=N.keys,H=N.callback,oe=N.action;return p.on(V,H,oe)}));else{var g=y.keys,b=y.callback,A=y.action;this.on(g,b,A)}}},{key:"on",value:function(p,y,g){this.mousetrap.bind(this.getKeys(p),y,g)}},{key:"disabled",get:function(){return this.options.keyboard.enabled!==!0}},{key:"off",value:function(p,y){this.mousetrap.unbind(this.getKeys(p),y)}},{key:"enable",value:function(p){(this.disabled||p)&&(this.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))}},{key:"disable",value:function(){this.disabled||(this.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}},{key:"getKeys",value:function(p){var y=this;return(Array.isArray(p)?p:[p]).map((function(g){return y.formatKey(g)}))}},{key:"formatKey",value:function(p){return p.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")}}])&&u$(u.prototype,d),c})(),c$=PN,Jf=null;function RN(c,u){return c.x+=u,c.y+=u,c.text&&(c.text.x+=u,c.text.y+=u),c}function DN(c,u){return c.startPoint&&(c.startPoint.x+=u,c.startPoint.y+=u),c.endPoint&&(c.endPoint.x+=u,c.endPoint.y+=u),c.pointsList&&c.pointsList.length>0&&c.pointsList.forEach((function(d){d.x+=u,d.y+=u})),c.text&&(c.text.x+=u,c.text.y+=u),c}var em=40,GO=40;function zO(c){return zO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},zO(c)}function jN(c,u){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter((function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable}))),d.push.apply(d,p)}return d}function Dy(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?jN(Object(d),!0).forEach((function(p){ua(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):jN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function LN(c,u){for(var d=0;d<u.length;d++){var p=u[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(c,p.key,p)}}function ua(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var HO=Symbol("plugin register by Logicflow.use"),XO=(function(){function c(y){var g,b,A=this;(function(N,V){if(!(N instanceof V))throw new TypeError("Cannot call a class as a function")})(this,c),ua(this,"container",void 0),ua(this,"width",void 0),ua(this,"height",void 0),ua(this,"graphModel",void 0),ua(this,"history",void 0),ua(this,"viewMap",new Map),ua(this,"tool",void 0),ua(this,"keyboard",void 0),ua(this,"dnd",void 0),ua(this,"options",void 0),ua(this,"snaplineModel",void 0),ua(this,"components",[]),ua(this,"plugins",void 0),ua(this,"extension",{}),ua(this,"adapterIn",void 0),ua(this,"adapterOut",void 0),ua(this,"getView",(function(N){return A.viewMap.get(N)})),y=PT(y),this.options=y,this.container=this.initContainer(y.container),this.plugins=y.plugins,this.graphModel=new g5(Dy({},y)),this.tool=new a$(this),this.history=new KB(this.graphModel.eventCenter),this.dnd=new p6({lf:this}),this.keyboard=new c$({lf:this,keyboard:y.keyboard}),y.snapline!==!1&&(this.snaplineModel=new HC(this.graphModel),g=this.graphModel.eventCenter,b=this.snaplineModel,g.on("node:mousemove",(function(N){var V=N.data;b.setNodeSnapLine(V)})),g.on("node:mouseup",(function(){b.clearSnapline()}))),(function(N,V){var H=N.keyboard,oe=H.options.keyboard;H.on(["cmd + c","ctrl + c"],(function(){if(GO=em,!oe.enabled||V.textEditElement)return!0;var ue=N.options.guards,Ne=V.getSelectElements(!1);return ue&&ue.beforeClone&&!ue.beforeClone(Ne)||Ne.nodes.length===0&&Ne.edges.length===0?(Jf=null,!0):((Jf=Ne).nodes.forEach((function(Ve){return RN(Ve,em)})),Jf.edges.forEach((function(Ve){return DN(Ve,em)})),!1)})),H.on(["cmd + v","ctrl + v"],(function(){if(!oe.enabled||V.textEditElement)return!0;if(Jf&&(Jf.nodes||Jf.edges)){N.clearSelectElements();var ue=N.addElements(Jf,GO);if(!ue)return!0;ue.nodes.forEach((function(Ne){return N.selectElementById(Ne.id,!0)})),ue.edges.forEach((function(Ne){return N.selectElementById(Ne.id,!0)})),Jf.nodes.forEach((function(Ne){return RN(Ne,em)})),Jf.edges.forEach((function(Ne){return DN(Ne,em)})),GO+=em}return!1})),H.on(["cmd + z","ctrl + z"],(function(){return!oe.enabled||!!V.textEditElement||(N.undo(),!1)})),H.on(["cmd + y","ctrl + y"],(function(){return!oe.enabled||!!V.textEditElement||(N.redo(),!1)})),H.on(["backspace"],(function(){if(!oe.enabled||V.textEditElement)return!0;var ue=V.getSelectElements(!0);return N.clearSelectElements(),ue.edges.forEach((function(Ne){return N.deleteEdge(Ne.id)})),ue.nodes.forEach((function(Ne){return N.deleteNode(Ne.id)})),!1}))})(this,this.graphModel),this.keyboard.initShortcuts(),this.defaultRegister(),this.installPlugins(y.disabledPlugins)}var u,d,p;return u=c,d=[{key:"register",value:function(y,g){var b=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(typeof y=="string"){var A={BaseEdge:Py,BaseEdgeModel:Jp,BaseNode:Yf,BaseNodeModel:Xf,RectNode:Fx,RectNodeModel:vx,CircleNode:Vx,CircleNodeModel:KE,PolygonNode:Xx,PolygonNodeModel:dx,TextNode:iO,TextNodeModel:_x,LineEdge:xO,LineEdgeModel:Od,DiamondNode:Zx,DiamondNodeModel:tx,PolylineEdge:TO,PolylineEdgeModel:Cl,BezierEdge:PO,BezierEdgeModel:GE,EllipseNode:nO,EllipseNodeModel:ix,HtmlNode:uO,HtmlNodeModel:Ex,h:re.g,type:y};this.viewMap.forEach((function(ue){var Ne=ue.extendKey;Ne&&(A[Ne]=ue)})),this.graphModel.modelMap.forEach((function(ue){var Ne=ue.extendKey;Ne&&(A[Ne]=ue)}));var N=g(A),V=N.view,H=N.model,oe=V;b&&!oe.isObervered&&(oe.isObervered=!0,oe=ae(oe)),this.setView(y,oe),this.graphModel.setModel(y,H)}else this.registerElement(y)}},{key:"registerElement",value:function(y){var g=y.view;y.isObserverView===!1||g.isObervered||(g.isObervered=!0,g=ae(g)),this.setView(y.type,g),this.graphModel.setModel(y.type,y.model)}},{key:"batchRegister",value:function(){var y=this,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach((function(b){y.registerElement(b)}))}},{key:"defaultRegister",value:function(){this.registerElement({view:Fx,model:vx,type:"rect"}),this.registerElement({type:"circle",view:Vx,model:KE}),this.registerElement({type:"polygon",view:Xx,model:dx}),this.registerElement({type:"line",view:xO,model:Od}),this.registerElement({type:"polyline",view:TO,model:Cl}),this.registerElement({type:"bezier",view:PO,model:GE}),this.registerElement({type:"text",view:iO,model:_x}),this.registerElement({type:"ellipse",view:nO,model:ix}),this.registerElement({type:"diamond",view:Zx,model:tx}),this.registerElement({type:"html",view:uO,model:Ex})}},{key:"selectElementById",value:function(y){var g=arguments.length>1&&arguments[1]!==void 0&&arguments[1],b=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.graphModel.selectElementById(y,g),!g&&b&&this.graphModel.toFront(y)}},{key:"focusOn",value:function(y){var g=this.graphModel.transformModel,b=y.coordinate,A=y.id;if(!b){var N=this.getNodeModelById(A);N&&(b=N.getData());var V=this.getEdgeModelById(A);V&&(b=V.textPosition)}var H=b,oe=H.x,ue=H.y;g.focusOn(oe,ue,this.graphModel.width,this.graphModel.height)}},{key:"setTheme",value:function(y){this.graphModel.setTheme(y)}},{key:"resize",value:function(y,g){this.graphModel.resize(y,g),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height}},{key:"setDefaultEdgeType",value:function(y){this.graphModel.setDefaultEdgeType(y)}},{key:"updateText",value:function(y,g){this.graphModel.updateText(y,g)}},{key:"deleteElement",value:function(y){var g,b,A,N=this.getModelById(y);return!!N&&(b=(A=(ua(g={},ei.NODE,this.deleteNode),ua(g,ei.EDGE,this.deleteEdge),g)[N.BaseType])===null||A===void 0?void 0:A.call(this,y))!==null&&b!==void 0&&b}},{key:"getModelById",value:function(y){return this.graphModel.getElement(y)}},{key:"getDataById",value:function(y){var g;return(g=this.graphModel.getElement(y))===null||g===void 0?void 0:g.getData()}},{key:"changeNodeType",value:function(y,g){this.graphModel.changeNodeType(y,g)}},{key:"changeEdgeType",value:function(y,g){this.graphModel.changeEdgeType(y,g)}},{key:"getNodeEdges",value:function(y){return this.graphModel.getNodeEdges(y)}},{key:"addNode",value:function(y){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,b=arguments.length>2?arguments[2]:void 0;return this.graphModel.addNode(y,g,b)}},{key:"deleteNode",value:function(y){var g=this.graphModel.getNodeModelById(y);if(!g)return!1;var b=g.getData(),A=this.options.guards,N=!A||!A.beforeDelete||A.beforeDelete(b);return N&&this.graphModel.deleteNode(y),N}},{key:"cloneNode",value:function(y){var g=this.graphModel.getNodeModelById(y).getData(),b=this.options.guards;if(!b||!b.beforeClone||b.beforeClone(g))return this.graphModel.cloneNode(y)}},{key:"changeNodeId",value:function(y,g){return this.graphModel.changeNodeId(y,g)}},{key:"getNodeModelById",value:function(y){return this.graphModel.getNodeModelById(y)}},{key:"getNodeDataById",value:function(y){var g;return(g=this.graphModel.getNodeModelById(y))===null||g===void 0?void 0:g.getData()}},{key:"addEdge",value:function(y){return this.graphModel.addEdge(y)}},{key:"deleteEdge",value:function(y){var g=this.options.guards,b=this.graphModel.edgesMap[y];if(!b)return!1;var A=b.model.getData(),N=!g||!g.beforeDelete||g.beforeDelete(A);return N&&this.graphModel.deleteEdgeById(y),N}},{key:"deleteEdgeByNodeId",value:function(y){var g=y.sourceNodeId,b=y.targetNodeId;g&&b?this.graphModel.deleteEdgeBySourceAndTarget(g,b):g?this.graphModel.deleteEdgeBySource(g):b&&this.graphModel.deleteEdgeByTarget(b)}},{key:"changeEdgeId",value:function(y,g){return this.graphModel.changeEdgeId(y,g)}},{key:"getEdgeModelById",value:function(y){var g;return(g=this.graphModel.edgesMap[y])===null||g===void 0?void 0:g.model}},{key:"getEdgeModels",value:function(y){var g=this.graphModel.edges,b=y.sourceNodeId,A=y.targetNodeId;if(b&&A){var N=[];return g.forEach((function(oe){oe.sourceNodeId===b&&oe.targetNodeId===A&&N.push(oe)})),N}if(b){var V=[];return g.forEach((function(oe){oe.sourceNodeId===b&&V.push(oe)})),V}if(A){var H=[];return g.forEach((function(oe){oe.targetNodeId===A&&H.push(oe)})),H}return[]}},{key:"getEdgeDataById",value:function(y){var g;return(g=this.getEdgeModelById(y))===null||g===void 0?void 0:g.getData()}},{key:"getNodeIncomingEdge",value:function(y){return this.graphModel.getNodeIncomingEdge(y)}},{key:"getNodeOutgoingEdge",value:function(y){return this.graphModel.getNodeOutgoingEdge(y)}},{key:"getNodeIncomingNode",value:function(y){return this.graphModel.getNodeIncomingNode(y)}},{key:"getNodeOutgoingNode",value:function(y){return this.graphModel.getNodeOutgoingNode(y)}},{key:"editText",value:function(y){this.graphModel.editText(y)}},{key:"setProperties",value:function(y,g){var b;(b=this.graphModel.getElement(y))===null||b===void 0||b.setProperties(ga(g))}},{key:"deleteProperty",value:function(y,g){var b;(b=this.graphModel.getElement(y))===null||b===void 0||b.deleteProperty(g)}},{key:"getProperties",value:function(y){var g;return(g=this.graphModel.getElement(y))===null||g===void 0?void 0:g.getProperties()}},{key:"toFront",value:function(y){this.graphModel.toFront(y)}},{key:"setElementZIndex",value:function(y,g){return this.graphModel.setElementZIndex(y,g)}},{key:"addElements",value:function(y){for(var g=this,b=y.nodes,A=y.edges,N={},V={nodes:[],edges:[]},H=0;H<b.length;H++){var oe=b[H],ue=oe.id,Ne=this.addNode(oe);if(!Ne)return;ue&&(N[ue]=Ne.id),V.nodes.push(Ne)}return A.forEach((function(Ve){var qe=Ve.sourceNodeId,Ot=Ve.targetNodeId;N[qe]&&(qe=N[qe]),N[Ot]&&(Ot=N[Ot]);var xt=g.graphModel.addEdge(Dy(Dy({},Ve),{},{sourceNodeId:qe,targetNodeId:Ot}));V.edges.push(xt)})),V}},{key:"getAreaElement",value:function(y,g){var b=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],A=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],N=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return this.graphModel.getAreaElement(y,g,b,A,N).map((function(V){return V.getData()}))}},{key:"getSelectElements",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this.graphModel.getSelectElements(y)}},{key:"clearSelectElements",value:function(){this.graphModel.clearSelectElements()}},{key:"getGraphData",value:function(){var y=this.graphModel.modelToGraphData();if(this.adapterOut){for(var g=arguments.length,b=new Array(g),A=0;A<g;A++)b[A]=arguments[A];return this.adapterOut.apply(this,[y].concat(b))}return y}},{key:"getGraphRawData",value:function(){return this.graphModel.modelToGraphData()}},{key:"clearData",value:function(){this.graphModel.clearData()}},{key:"updateEditConfig",value:function(y){var g=this.graphModel,b=g.editConfigModel,A=g.transformModel;b.updateEditConfig(y),(y==null?void 0:y.stopMoveGraph)!==void 0&&A.updateTranslateLimits(y.stopMoveGraph),y!=null&&y.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0)}},{key:"getEditConfig",value:function(){return this.graphModel.editConfigModel.getConfig()}},{key:"getPointByClient",value:function(y,g){return this.graphModel.getPointByClient({x:y,y:g})}},{key:"undo",value:function(){if(this.history.undoAble()){var y=ga(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"redo",value:function(){if(this.history.redoAble()){var y=ga(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"zoom",value:function(y,g){return this.graphModel.transformModel.zoom(y,g)}},{key:"resetZoom",value:function(){this.graphModel.transformModel.resetZoom()}},{key:"setZoomMiniSize",value:function(y){this.graphModel.transformModel.setZoomMiniSize(y)}},{key:"setZoomMaxSize",value:function(y){this.graphModel.transformModel.setZoomMaxSize(y)}},{key:"getTransform",value:function(){var y=this.graphModel.transformModel;return{SCALE_X:y.SCALE_X,SCALE_Y:y.SCALE_Y,TRANSLATE_X:y.TRANSLATE_X,TRANSLATE_Y:y.TRANSLATE_Y}}},{key:"translate",value:function(y,g){this.graphModel.transformModel.translate(y,g)}},{key:"resetTranslate",value:function(){var y=this.graphModel.transformModel,g=y.TRANSLATE_X,b=y.TRANSLATE_Y;this.translate(-g,-b)}},{key:"translateCenter",value:function(){this.graphModel.translateCenter()}},{key:"fitView",value:function(y,g){g===void 0&&(g=y),this.graphModel.fitView(y,g)}},{key:"openEdgeAnimation",value:function(y){this.graphModel.openEdgeAnimation(y)}},{key:"closeEdgeAnimation",value:function(y){this.graphModel.closeEdgeAnimation(y)}},{key:"on",value:function(y,g){this.graphModel.eventCenter.on(y,g)}},{key:"off",value:function(y,g){this.graphModel.eventCenter.off(y,g)}},{key:"once",value:function(y,g){this.graphModel.eventCenter.once(y,g)}},{key:"emit",value:function(y,g){this.graphModel.eventCenter.emit(y,g)}},{key:"initContainer",value:function(y){var g=document.createElement("div");return g.style.position="relative",g.style.width="100%",g.style.height="100%",y.innerHTML="",y.appendChild(g),g}},{key:"installPlugins",value:function(){var y,g=this,b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=(y=this.plugins)!==null&&y!==void 0?y:c.extensions;A.forEach((function(N){var V=null,H=null;N[HO]?(V=N.extension,H=N.props):V=N;var oe=V.pluginName||V.name;b.indexOf(oe)===-1&&g.installPlugin(V,H)}))}},{key:"installPlugin",value:function(y,g){if(zO(y)==="object"){var b=y.install,A=y.render;return b&&b.call(y,this,c),A&&this.components.push(A.bind(y)),void(this.extension[y.pluginName]=y)}var N=y,V=new N({lf:this,LogicFlow:c,options:this.options.pluginsOptions,props:g});V.render&&this.components.push(V.render.bind(V)),this.extension[N.pluginName]=V}},{key:"updateAttributes",value:function(y,g){this.graphModel.updateAttributes(y,g)}},{key:"createFakerNode",value:function(y){var g=this.graphModel.modelMap.get(y.type);if(g){var b=new g(Dy(Dy({},y),{},{virtual:!0}),this.graphModel);return this.graphModel.setFakerNode(b),b}}},{key:"removeFakerNode",value:function(){this.graphModel.removeFakerNode()}},{key:"setNodeSnapLine",value:function(y){this.snaplineModel&&this.snaplineModel.setNodeSnapLine(y)}},{key:"removeNodeSnapLine",value:function(){this.snaplineModel&&this.snaplineModel.clearSnapline()}},{key:"setView",value:function(y,g){this.viewMap.set(y,g)}},{key:"renderRawData",value:function(y){this.graphModel.graphDataToModel(ga(y)),this.options.history!==!1&&this.history.watch(this.graphModel),Object(re.j)(Object(re.g)(d6,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(ur.GRAPH_RENDERED,this.graphModel.modelToGraphData())}},{key:"render",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.adapterIn&&(y=this.adapterIn(y)),this.renderRawData(y)}}],p=[{key:"use",value:function(y,g){var b,A,N=y.pluginName;N||(N=y.name);var V=(b=this.extensions.get(N))===null||b===void 0?void 0:b.extension;V&&V.destroy&&V.destroy(),this.extensions.set(N,(ua(A={},HO,HO),ua(A,"extension",y),ua(A,"props",g),A))}}],d&&LN(u.prototype,d),p&&LN(u,p),c})();function Fc(c){return ae(c)}ua(XO,"extensions",new Map),o.default=XO}])}))})(I0,I0.exports)),I0.exports}var Hu=Fne();const t8=Z_(Hu);let eE=!1;const Ch=Rh({});function n8(t,e,n,o,r,i,a){i||(i=(s,l)=>({nodeModel:s,graph:l})),a||(a=(s,l)=>({getNode:()=>s,getGraph:()=>l})),eE&&(Ch[t]=i9(gr({render:()=>Dm(a9,{to:n},[Dm(e,i(o,r))]),provide:()=>a(o,r)})))}function r8(t){eE&&delete Ch[t]}function Bne(t){Object.keys(Ch).forEach(e=>{e.startsWith(t)&&delete Ch[e]})}function $ne(){Object.keys(Ch).forEach(t=>{delete Ch[t]})}function d1(){return eE}function Une(){return eE=!0,gr({props:{flowId:{type:String,required:!0}},setup(t){return()=>{const e=[];return Object.keys(Ch).forEach(n=>{e.push(Ch[n])}),Dm(Ir,{},e.map(n=>Dm(n)))}}})}class ai extends GI.view{constructor(n,o){super(n);hl(this,"isMounted");hl(this,"r");hl(this,"component");hl(this,"app");hl(this,"root");hl(this,"VueNode");hl(this,"up_node_field_dict");this.component=o,this.isMounted=!1,n.model.clear_next_node_field=this.clear_next_node_field.bind(this),n.model.get_up_node_field_dict=this.get_up_node_field_dict.bind(this),n.model.get_node_field_list=this.get_node_field_list.bind(this),n.model.get_up_node_field_list=this.get_up_node_field_list.bind(this),n.model.properties.noRender?delete n.model.properties.noRender:n.model.properties.stepName=this.getNodeName(n.graphModel.nodes.filter(r=>r.id!==n.model.id),n.model.properties.stepName),n.model.properties.config=this.getConfig(n),n.model.properties.height&&(n.model.height=n.model.properties.height)}getConfig(n){return w9[n.model.type].properties.config}getNodeName(n,o){let r=0,i=o;for(;;){if(r>0&&(i=o+r),!n.some(a=>a.properties.stepName===i.trim()))return i;r++}}get_node_field_list(){var o,r,i,a,s,l,f,h;const n=[];return this.props.model.type&&this.props.model.type==="start-node"&&(n.push({value:"global",label:Pt("views.applicationWorkflow.variable.global"),type:"global",children:((r=(o=this.props.model.properties)==null?void 0:o.config)==null?void 0:r.globalFields)||[]}),n.push({value:"chat",label:Pt("views.applicationWorkflow.variable.chat"),type:"chat",children:((a=(i=this.props.model.properties)==null?void 0:i.config)==null?void 0:a.chatFields)||[]})),n.push({value:this.props.model.id,icon:(l=(s=this.props.model.properties)==null?void 0:s.node_data)==null?void 0:l.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((h=(f=this.props.model.properties)==null?void 0:f.config)==null?void 0:h.fields)||[]}),n}get_up_node_field_dict(n,o){if(!this.up_node_field_dict||!o){const r=this.props.graphModel.getNodeIncomingNode(this.props.model.id);this.up_node_field_dict=r.filter(i=>i.id!="start-node"&&i.id!="loop-start-node").map(i=>i.get_up_node_field_dict(!0,o)).reduce((i,a)=>({...i,...a}),{})}return n?{...this.up_node_field_dict,[this.props.model.id]:this.get_node_field_list()}:this.up_node_field_dict?this.up_node_field_dict:{}}get_up_node_field_list(n,o){const r=Object.values(this.get_up_node_field_dict(n,o)).reduce((s,l)=>[...s,...l],[]),i=this.props.graphModel.getNodeModelById("start-node")||this.props.graphModel.getNodeModelById("loop-start-node");return[...i?i.get_node_field_list():[],...r]}clear_next_node_field(n){this.props.graphModel.getNodeOutgoingNode(this.props.model.id).forEach(r=>{r.clear_next_node_field(!0)}),n&&(this.up_node_field_dict=void 0)}getAnchorShape(n){const{x:o,y:r,type:i}=n;let a=!1;return i=="left"?a=this.props.graphModel.edges.some(s=>s.targetAnchorId==n.id):a=this.props.graphModel.edges.some(s=>s.sourceAnchorId==n.id),Hu.h("foreignObject",{...n,x:o-10,y:r-12,width:30,height:30},[Hu.h("div",{style:{zindex:0},onClick:()=>{i=="right"&&this.props.model.openNodeMenu(n)},dangerouslySetInnerHTML:{__html:a?`<svg width="100%" height="100%" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g filter="url(#filter0_d_5119_232585)">
|
||
<path d="M20.9998 29.8333C28.0875 29.8333 33.8332 24.0876 33.8332 17C33.8332 9.91231 28.0875 4.16663 20.9998 4.16663C13.9122 4.16663 8.1665 9.91231 8.1665 17C8.1665 24.0876 13.9122 29.8333 20.9998 29.8333Z" fill="white"/>
|
||
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.9998 27.5C26.7988 27.5 31.4998 22.799 31.4998 17C31.4998 11.201 26.7988 6.49996 20.9998 6.49996C15.2008 6.49996 10.4998 11.201 10.4998 17C10.4998 22.799 15.2008 27.5 20.9998 27.5ZM33.8332 17C33.8332 24.0876 28.0875 29.8333 20.9998 29.8333C13.9122 29.8333 8.1665 24.0876 8.1665 17C8.1665 9.91231 13.9122 4.16663 20.9998 4.16663C28.0875 4.16663 33.8332 9.91231 33.8332 17Z" fill="#3370FF"/>
|
||
</g>
|
||
<defs>
|
||
<filter id="filter0_d_5119_232585" x="-1" y="-1" width="44" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||
<feOffset dy="4"/>
|
||
<feGaussianBlur stdDeviation="4"/>
|
||
<feComposite in2="hardAlpha" operator="out"/>
|
||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.1 0"/>
|
||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5119_232585"/>
|
||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5119_232585" result="shape"/>
|
||
</filter>
|
||
</defs>
|
||
</svg>
|
||
`:`<svg width="100%" height="100%" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||
<g filter="url(#filter0_d_5199_166905)">
|
||
<path d="M20.9998 29.8333C28.0875 29.8333 33.8332 24.0876 33.8332 17C33.8332 9.91231 28.0875 4.16663 20.9998 4.16663C13.9122 4.16663 8.1665 9.91231 8.1665 17C8.1665 24.0876 13.9122 29.8333 20.9998 29.8333Z" fill="#3370FF"/>
|
||
<path d="M19.8332 11.75C19.8332 11.4278 20.0943 11.1666 20.4165 11.1666H21.5832C21.9053 11.1666 22.1665 11.4278 22.1665 11.75V15.8333H26.2498C26.572 15.8333 26.8332 16.0945 26.8332 16.4166V17.5833C26.8332 17.9055 26.572 18.1666 26.2498 18.1666H22.1665V22.25C22.1665 22.5721 21.9053 22.8333 21.5832 22.8333H20.4165C20.0943 22.8333 19.8332 22.5721 19.8332 22.25V18.1666H15.7498C15.4277 18.1666 15.1665 17.9055 15.1665 17.5833V16.4166C15.1665 16.0945 15.4277 15.8333 15.7498 15.8333H19.8332V11.75Z" fill="white"/>
|
||
</g>
|
||
<defs>
|
||
<filter id="filter0_d_5199_166905" x="-1" y="-1" width="44" height="44" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||
<feOffset dy="4"/>
|
||
<feGaussianBlur stdDeviation="4"/>
|
||
<feComposite in2="hardAlpha" operator="out"/>
|
||
<feColorMatrix type="matrix" values="0 0 0 0 0.2 0 0 0 0 0.439216 0 0 0 0 1 0 0 0 0.1 0"/>
|
||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5199_166905"/>
|
||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5199_166905" result="shape"/>
|
||
</filter>
|
||
</defs>
|
||
</svg>`}})])}setHtml(n){if(this.isMounted)this.r&&this.r.component&&(this.r.component.props.properties=this.props.model.getProperties());else{this.isMounted=!0;const o=document.createElement("div");n.appendChild(o),this.renderVueComponent(o)}}componentWillUnmount(){super.componentWillUnmount(),this.unmount()}getComponentContainer(){return this.root}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}renderVueComponent(n){var i;this.unmountVueComponent(),this.root=n;const{model:o,graphModel:r}=this.props;if(n)if(d1())n8(this.targetId(),this.component,n,o,r,void 0,this.props.graphModel.get_provide);else{this.r=Dm(this.component,{properties:this.props.model.properties,nodeModel:this.props.model}),this.app=Fj({render(){return this.r},provide(){return{getNode:()=>o,getGraph:()=>r,workflowMode:nc.Application}}}),this.app.use(l9,{locale:s9}),this.app.use(u9),this.app.use(c9),this.app.use(Ij);for(const[a,s]of Object.entries(d9))this.app.component(a,s);(i=this.app)==null||i.mount(n)}}unmountVueComponent(){return this.app&&(this.app.unmount(),this.app=null),this.root&&(this.root.innerHTML=""),this.root}unmount(){d1()&&r8(this.targetId()),this.unmountVueComponent()}}class li extends GI.model{refreshDeges(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}set_position(e){const{x:n,y:o}=e;n&&(this.x=n),o&&(this.y=o),this.refreshDeges()}getResizeOutlineStyle(){const e=super.getResizeOutlineStyle();return e.stroke="none",e}getControlPointStyle(){const e=super.getControlPointStyle();return e.stroke="none",e.fill="none",e}getNodeStyle(){return{overflow:"visible"}}getOutlineStyle(){const e=super.getOutlineStyle();return e.stroke="#e0e0e0",e.strokeWidth=1,e.hover&&(e.hover.stroke="#3370FF",e.hover.strokeWidth=2),e}getAnchorStyle(e){return super.getAnchorStyle(e)}setHeight(e){const n=this.height,o=e+100;this.height=o,this.properties.height=o,this.move(0,(o-n)/2),this.outgoing.edges.forEach(r=>{r.updatePathByAnchor()}),this.incoming.edges.forEach(r=>{r.updatePathByAnchor()})}get_width(){var e;return((e=this.properties)==null?void 0:e.width)||340}setAttributes(){const{t:e}=Ij.global;this.width=this.get_width();const n=(r,i)=>{const a=this.graphModel.getNodeIncomingNode(r);for(const s in a){const l=a[s];if(l.id===i)return!0;if(n(l.id,i))return!0}return!1},o={message:e("views.applicationWorkflow.tip.onlyRight"),validate:(r,i,a)=>a.type==="right"};this.sourceRules.push({message:e("views.applicationWorkflow.tip.notRecyclable"),validate:(r,i,a,s)=>i.id==r.id?!1:!this.graphModel.getNodeIncomingEdge(i.id).find(h=>h.targetAnchorId==s.id&&h.sourceAnchorId==a.id)&&!n(r.id,i.id)}),this.sourceRules.push(o),this.targetRules.push({message:e("views.applicationWorkflow.tip.onlyLeft"),validate:(r,i,a,s)=>s.type==="left"})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r}=this,i=this.properties.showNode===void 0?!0:this.properties.showNode,a=[];return this.type&&this.type!==kr.Base.toString()&&([kr.Start.toString(),kr.LoopStartNode.toString()].includes(this.type)||a.push({x:n-r/2+10,y:i?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"}),a.push({x:n+r/2-10,y:i?o:o-15,id:`${e}_right`,type:"right"})),a}}let Vne=class extends ai{constructor(e){super(e,Uq)}};const Wne={type:"ai-chat-node",model:li,view:Vne},o8=Object.freeze(Object.defineProperty({__proto__:null,default:Wne},Symbol.toStringTag,{value:"Module"})),Gne={class:"title-decoration-1 mb-8"},zne={class:"flex align-center"},Hne={class:"mr-4"},Xne=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=ja(),n=fr(()=>e.path.includes("resource-management")?"systemManage":"workspace"),o={question_reference_address:["start-node","question"],api_input_field_list:[],user_input_field_list:[],document_list:["start-node","document"],image_list:["start-node","image"],audio_list:["start-node","audio"],video_list:["start-node","video"]},r=Ge(),i=fr({get:()=>(l.nodeModel.properties.node_data||Me.set(l.nodeModel.properties,"node_data",o),l.nodeModel.properties.node_data),set:h=>{Me.set(l.nodeModel.properties,"node_data",h)}});function a(h,v){const _=`${h}_list`;v?l.nodeModel.properties.node_data[_]||Me.set(l.nodeModel.properties.node_data,_,[]):delete l.nodeModel.properties.node_data[_]}const s=()=>{if(!l.nodeModel.properties.node_data.application_id){Me.set(l.nodeModel.properties,"status",500);return}oi({type:"application",systemType:n.value}).getApplicationDetail(l.nodeModel.properties.node_data.application_id).then(h=>{const v=Me.cloneDeep(l.nodeModel.properties.node_data.api_input_field_list),_=Me.cloneDeep(l.nodeModel.properties.node_data.user_input_field_list);if(L2(h.data.type)){const E=h.data.work_flow.nodes[0].properties.node_data,O=Me.cloneDeep(h.data.work_flow.nodes[0].properties.api_input_field_list),w=Me.cloneDeep(h.data.work_flow.nodes[0].properties.user_input_field_list),S=(O||[]).map(R=>{const P=v==null?void 0:v.find($=>$.variable==R.variable);return P?{...R,value:P.value,label:typeof R.label=="object"&&R.label!=null?R.label.label:R.label}:R});Me.set(l.nodeModel.properties.node_data,"api_input_field_list",S);const M=(w||[]).map(R=>{const P=_==null?void 0:_.find($=>$.field==R.field);return P?{...R,value:P.value,label:typeof R.label=="object"&&R.label!=null?R.label.label:R.label}:R});Me.set(l.nodeModel.properties.node_data,"user_input_field_list",M);const T=E.file_upload_enable,B=E.file_upload_setting;T?(a("document",B.document),a("image",B.image),a("audio",B.audio),a("video",B.video)):["document_list","image_list","audio_list","video_list"].forEach(R=>{delete l.nodeModel.properties.node_data[R]}),Me.set(l.nodeModel.properties,"status",h.data.id?200:500)}}).catch(h=>{console.log(h),Me.set(l.nodeModel.properties,"status",500)})},l=t,f=()=>{var h;return(h=r.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:l.nodeModel,errMessage:v}))};return yo(()=>{s(),Me.set(l.nodeModel,"validate",f)}),(h,v)=>{const _=te("el-form-item"),E=te("AppIcon"),O=te("el-tooltip"),w=te("el-switch"),S=te("el-form"),M=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Gne,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),k(M,{shadow:"never",class:"card-never"},{default:j(()=>[k(S,{onSubmit:v[7]||(v[7]=mn(()=>{},["prevent"])),model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"applicationNodeFormRef",ref:r},{default:j(()=>[k(_,{label:h.$t("views.applicationWorkflow.nodes.startNode.question"),prop:"question_reference_address",rules:{message:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(Go,{ref_key:"applicationNodeFormRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.question_reference_address,"onUpdate:modelValue":v[0]||(v[0]=T=>i.value.question_reference_address=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),i.value.hasOwnProperty("document_list")||"document_list"in i.value?(Te(),bt(_,{key:0,label:h.$t("views.problem.relateParagraph.selectDocument"),prop:"document_list",rules:{message:h.$t("views.chatLog.documentPlaceholder"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.chatLog.documentPlaceholder"),modelValue:i.value.document_list,"onUpdate:modelValue":v[1]||(v[1]=T=>i.value.document_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):In("",!0),i.value.hasOwnProperty("image_list")||"image_list"in i.value?(Te(),bt(_,{key:1,label:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),prop:"image_list",rules:{message:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:i.value.image_list,"onUpdate:modelValue":v[2]||(v[2]=T=>i.value.image_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):In("",!0),i.value.hasOwnProperty("audio_list")||"audio_list"in i.value?(Te(),bt(_,{key:2,label:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:i.value.audio_list,"onUpdate:modelValue":v[3]||(v[3]=T=>i.value.audio_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):In("",!0),i.value.hasOwnProperty("video_list")||"video_list"in i.value?(Te(),bt(_,{key:3,label:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.label"),prop:"video_list",rules:{message:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),trigger:"blur",required:!1}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.videoUnderstandNode.video.requiredMessage"),modelValue:i.value.video_list,"onUpdate:modelValue":v[4]||(v[4]=T=>i.value.video_list=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):In("",!0),(Te(!0),cn(Ir,null,No(i.value.api_input_field_list,(T,B)=>(Te(),cn("div",{key:"api-input-"+B},[k(_,{label:T.variable,prop:"api_input_field_list."+B+".value",rules:[{required:T.is_required,message:`${h.$t("common.inputPlaceholder")}${T.variable}`,trigger:"blur"}]},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.api_input_field_list[B].value,"onUpdate:modelValue":R=>i.value.api_input_field_list[B].value=R},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),(Te(!0),cn(Ir,null,No(i.value.user_input_field_list,(T,B)=>(Te(),cn("div",{key:"user-input-"+B},[k(_,{label:T.label,prop:"user_input_field_list."+B+".value",rules:[{required:T.required,message:`${h.$t("common.inputPlaceholder")}${T.label}`,trigger:"blur"}]},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:i.value.user_input_field_list[B].value,"onUpdate:modelValue":R=>i.value.user_input_field_list[B].value=R},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),k(_,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[6]||(v[6]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",zne,[ee("div",Hne,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(O,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(w,{size:"small",modelValue:i.value.is_result,"onUpdate:modelValue":v[5]||(v[5]=T=>i.value.is_result=T)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Yne extends ai{constructor(e){super(e,Xne)}}const qne={type:"application-node",model:li,view:Yne},i8=Object.freeze(Object.defineProperty({__proto__:null,default:qne},Symbol.toStringTag,{value:"Module"}));/**!
|
||
* Sortable 1.15.6
|
||
* @author RubaXa <trash@rubaxa.org>
|
||
* @author owenm <owen23355@gmail.com>
|
||
* @license MIT
|
||
*/function PR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Yd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PR(Object(n),!0).forEach(function(o){Kne(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PR(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function tw(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tw=function(e){return typeof e}:tw=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tw(t)}function Kne(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cp(){return cp=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},cp.apply(this,arguments)}function Zne(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function Jne(t,e){if(t==null)return{};var n=Zne(t,e),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}var Qne="1.15.6";function ap(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var gp=ap(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ab=ap(/Edge/i),RR=ap(/firefox/i),g_=ap(/safari/i)&&!ap(/chrome/i)&&!ap(/android/i),FM=ap(/iP(ad|od|hone)/i),a8=ap(/chrome/i)&&ap(/android/i),l8={capture:!1,passive:!1};function Vo(t,e,n){t.addEventListener(e,n,!gp&&l8)}function Bo(t,e,n){t.removeEventListener(e,n,!gp&&l8)}function f1(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function s8(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function zc(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&f1(t,e):f1(t,e))||o&&t===n)return t;if(t===n)break}while(t=s8(t))}return null}var DR=/\s+/g;function vu(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(DR," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(DR," ")}}function ro(t,e,n){var o=t&&t.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in o)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),o[e]=n+(typeof n=="string"?"":"px")}}function Am(t,e){var n="";if(typeof t=="string")n=t;else do{var o=ro(t,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function u8(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function Hd(){var t=document.scrollingElement;return t||document.documentElement}function Ya(t,e,n,o,r){if(!(!t.getBoundingClientRect&&t!==window)){var i,a,s,l,f,h,v;if(t!==window&&t.parentNode&&t!==Hd()?(i=t.getBoundingClientRect(),a=i.top,s=i.left,l=i.bottom,f=i.right,h=i.height,v=i.width):(a=0,s=0,l=window.innerHeight,f=window.innerWidth,h=window.innerHeight,v=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!gp))do if(r&&r.getBoundingClientRect&&(ro(r,"transform")!=="none"||n&&ro(r,"position")!=="static")){var _=r.getBoundingClientRect();a-=_.top+parseInt(ro(r,"border-top-width")),s-=_.left+parseInt(ro(r,"border-left-width")),l=a+i.height,f=s+i.width;break}while(r=r.parentNode);if(o&&t!==window){var E=Am(r||t),O=E&&E.a,w=E&&E.d;E&&(a/=w,s/=O,v/=O,h/=w,l=a+h,f=s+v)}return{top:a,left:s,bottom:l,right:f,width:v,height:h}}}function jR(t,e,n){for(var o=wh(t,!0),r=Ya(t)[e];o;){var i=Ya(o)[n],a=void 0;if(a=r>=i,!a)return o;if(o===Hd())break;o=wh(o,!1)}return!1}function Xm(t,e,n,o){for(var r=0,i=0,a=t.children;i<a.length;){if(a[i].style.display!=="none"&&a[i]!==Zr.ghost&&(o||a[i]!==Zr.dragged)&&zc(a[i],n.draggable,t,!1)){if(r===e)return a[i];r++}i++}return null}function BM(t,e){for(var n=t.lastElementChild;n&&(n===Zr.ghost||ro(n,"display")==="none"||e&&!f1(n,e));)n=n.previousElementSibling;return n||null}function zu(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Zr.clone&&(!e||f1(t,e))&&n++;return n}function LR(t){var e=0,n=0,o=Hd();if(t)do{var r=Am(t),i=r.a,a=r.d;e+=t.scrollLeft*i,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function ere(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n)}return-1}function wh(t,e){if(!t||!t.getBoundingClientRect)return Hd();var n=t,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=ro(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Hd();if(o||e)return n;o=!0}}while(n=n.parentNode);return Hd()}function tre(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function ES(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var m_;function c8(t,e){return function(){if(!m_){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),m_=setTimeout(function(){m_=void 0},e)}}}function nre(){clearTimeout(m_),m_=void 0}function d8(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function f8(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function p8(t,e,n){var o={};return Array.from(t.children).forEach(function(r){var i,a,s,l;if(!(!zc(r,e.draggable,t,!1)||r.animated||r===n)){var f=Ya(r);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:1/0,f.left),o.top=Math.min((a=o.top)!==null&&a!==void 0?a:1/0,f.top),o.right=Math.max((s=o.right)!==null&&s!==void 0?s:-1/0,f.right),o.bottom=Math.max((l=o.bottom)!==null&&l!==void 0?l:-1/0,f.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var zs="Sortable"+new Date().getTime();function rre(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(r){if(!(ro(r,"display")==="none"||r===Zr.ghost)){t.push({target:r,rect:Ya(r)});var i=Yd({},t[t.length-1].rect);if(r.thisAnimationDuration){var a=Am(r,!0);a&&(i.top-=a.f,i.left-=a.e)}r.fromRect=i}})}},addAnimationState:function(o){t.push(o)},removeAnimationState:function(o){t.splice(ere(t,{target:o}),1)},animateAll:function(o){var r=this;if(!this.options.animation){clearTimeout(e),typeof o=="function"&&o();return}var i=!1,a=0;t.forEach(function(s){var l=0,f=s.target,h=f.fromRect,v=Ya(f),_=f.prevFromRect,E=f.prevToRect,O=s.rect,w=Am(f,!0);w&&(v.top-=w.f,v.left-=w.e),f.toRect=v,f.thisAnimationDuration&&ES(_,v)&&!ES(h,v)&&(O.top-v.top)/(O.left-v.left)===(h.top-v.top)/(h.left-v.left)&&(l=ire(O,_,E,r.options)),ES(v,h)||(f.prevFromRect=h,f.prevToRect=v,l||(l=r.options.animation),r.animate(f,O,v,l)),l&&(i=!0,a=Math.max(a,l),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},l),f.thisAnimationDuration=l)}),clearTimeout(e),i?e=setTimeout(function(){typeof o=="function"&&o()},a):typeof o=="function"&&o(),t=[]},animate:function(o,r,i,a){if(a){ro(o,"transition",""),ro(o,"transform","");var s=Am(this.el),l=s&&s.a,f=s&&s.d,h=(r.left-i.left)/(l||1),v=(r.top-i.top)/(f||1);o.animatingX=!!h,o.animatingY=!!v,ro(o,"transform","translate3d("+h+"px,"+v+"px,0)"),this.forRepaintDummy=ore(o),ro(o,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),ro(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){ro(o,"transition",""),ro(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},a)}}}}function ore(t){return t.offsetWidth}function ire(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}var sm=[],xS={initializeByDefault:!0},lb={mount:function(e){for(var n in xS)xS.hasOwnProperty(n)&&!(n in e)&&(e[n]=xS[n]);sm.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),sm.push(e)},pluginEvent:function(e,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";sm.forEach(function(a){n[a.pluginName]&&(n[a.pluginName][i]&&n[a.pluginName][i](Yd({sortable:n},o)),n.options[a.pluginName]&&n[a.pluginName][e]&&n[a.pluginName][e](Yd({sortable:n},o)))})},initializePlugins:function(e,n,o,r){sm.forEach(function(s){var l=s.pluginName;if(!(!e.options[l]&&!s.initializeByDefault)){var f=new s(e,n,e.options);f.sortable=e,f.options=e.options,e[l]=f,cp(o,f.defaults)}});for(var i in e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);typeof a<"u"&&(e.options[i]=a)}},getEventProperties:function(e,n){var o={};return sm.forEach(function(r){typeof r.eventProperties=="function"&&cp(o,r.eventProperties.call(n[r.pluginName],e))}),o},modifyOption:function(e,n,o){var r;return sm.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(r=i.optionListeners[n].call(e[i.pluginName],o))}),r}};function are(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,f=t.newIndex,h=t.oldDraggableIndex,v=t.newDraggableIndex,_=t.originalEvent,E=t.putSortable,O=t.extraEventProperties;if(e=e||n&&n[zs],!!e){var w,S=e.options,M="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!gp&&!ab?w=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(o,!0,!0)),w.to=a||n,w.from=s||n,w.item=r||n,w.clone=i,w.oldIndex=l,w.newIndex=f,w.oldDraggableIndex=h,w.newDraggableIndex=v,w.originalEvent=_,w.pullMode=E?E.lastPutMode:void 0;var T=Yd(Yd({},O),lb.getEventProperties(o,e));for(var B in T)w[B]=T[B];n&&n.dispatchEvent(w),S[M]&&S[M].call(e,w)}}var lre=["evt"],Ws=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=Jne(o,lre);lb.pluginEvent.bind(Zr)(e,n,Yd({dragEl:Xn,parentEl:Aa,ghostEl:po,rootEl:ca,nextEl:Dv,lastDownEl:nw,cloneEl:_a,cloneHidden:mh,dragStarted:Yy,putSortable:Dl,activeSortable:Zr.active,originalEvent:r,oldIndex:xm,oldDraggableIndex:y_,newIndex:gu,newDraggableIndex:gh,hideGhostForTarget:m8,unhideGhostForTarget:y8,cloneNowHidden:function(){mh=!0},cloneNowShown:function(){mh=!1},dispatchSortableEvent:function(s){_s({sortable:n,name:s,originalEvent:r})}},i))};function _s(t){are(Yd({putSortable:Dl,cloneEl:_a,targetEl:Xn,rootEl:ca,oldIndex:xm,oldDraggableIndex:y_,newIndex:gu,newDraggableIndex:gh},t))}var Xn,Aa,po,ca,Dv,nw,_a,mh,xm,gu,y_,gh,F0,Dl,hm=!1,p1=!1,h1=[],kv,Vc,OS,SS,IR,FR,Yy,um,__,b_=!1,B0=!1,rw,ql,AS=[],m2=!1,v1=[],tE=typeof document<"u",$0=FM,BR=ab||gp?"cssFloat":"float",sre=tE&&!a8&&!FM&&"draggable"in document.createElement("div"),h8=(function(){if(tE){if(gp)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),v8=function(e,n){var o=ro(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=Xm(e,0,n),a=Xm(e,1,n),s=i&&ro(i),l=a&&ro(a),f=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ya(i).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ya(a).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&s.float!=="none"){var v=s.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===v)?"vertical":"horizontal"}return i&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||f>=r&&o[BR]==="none"||a&&o[BR]==="none"&&f+h>r)?"vertical":"horizontal"},ure=function(e,n,o){var r=o?e.left:e.top,i=o?e.right:e.bottom,a=o?e.width:e.height,s=o?n.left:n.top,l=o?n.right:n.bottom,f=o?n.width:n.height;return r===s||i===l||r+a/2===s+f/2},cre=function(e,n){var o;return h1.some(function(r){var i=r[zs].options.emptyInsertThreshold;if(!(!i||BM(r))){var a=Ya(r),s=e>=a.left-i&&e<=a.right+i,l=n>=a.top-i&&n<=a.bottom+i;if(s&&l)return o=r}}),o},g8=function(e){function n(i,a){return function(s,l,f,h){var v=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(i==null&&(a||v))return!0;if(i==null||i===!1)return!1;if(a&&i==="clone")return i;if(typeof i=="function")return n(i(s,l,f,h),a)(s,l,f,h);var _=(a?s:l).options.group.name;return i===!0||typeof i=="string"&&i===_||i.join&&i.indexOf(_)>-1}}var o={},r=e.group;(!r||tw(r)!="object")&&(r={name:r}),o.name=r.name,o.checkPull=n(r.pull,!0),o.checkPut=n(r.put),o.revertClone=r.revertClone,e.group=o},m8=function(){!h8&&po&&ro(po,"display","none")},y8=function(){!h8&&po&&ro(po,"display","")};tE&&!a8&&document.addEventListener("click",function(t){if(p1)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),p1=!1,!1},!0);var Pv=function(e){if(Xn){e=e.touches?e.touches[0]:e;var n=cre(e.clientX,e.clientY);if(n){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]=e[r]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[zs]._onDragOver(o)}}},dre=function(e){Xn&&Xn.parentNode[zs]._isOutsideThisEl(e.target)};function Zr(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=cp({},e),t[zs]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return v8(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,s){a.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Zr.supportPointer!==!1&&"PointerEvent"in window&&(!g_||FM),emptyInsertThreshold:5};lb.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);g8(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:sre,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Vo(t,"pointerdown",this._onTapStart):(Vo(t,"mousedown",this._onTapStart),Vo(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Vo(t,"dragover",this),Vo(t,"dragenter",this)),h1.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),cp(this,rre())}Zr.prototype={constructor:Zr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(um=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,Xn):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,r=this.options,i=r.preventOnFilter,a=e.type,s=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(s||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,h=r.filter;if(_re(o),!Xn&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&g_&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=zc(l,r.draggable,o,!1),!(l&&l.animated)&&nw!==l)){if(xm=zu(l),y_=zu(l,r.draggable),typeof h=="function"){if(h.call(this,e,l,this)){_s({sortable:n,rootEl:f,name:"filter",targetEl:l,toEl:o,fromEl:o}),Ws("filter",n,{evt:e}),i&&e.preventDefault();return}}else if(h&&(h=h.split(",").some(function(v){if(v=zc(f,v.trim(),o,!1),v)return _s({sortable:n,rootEl:v,name:"filter",targetEl:l,fromEl:o,toEl:o}),Ws("filter",n,{evt:e}),!0}),h)){i&&e.preventDefault();return}r.handle&&!zc(f,r.handle,o,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,n,o){var r=this,i=r.el,a=r.options,s=i.ownerDocument,l;if(o&&!Xn&&o.parentNode===i){var f=Ya(o);if(ca=i,Xn=o,Aa=Xn.parentNode,Dv=Xn.nextSibling,nw=o,F0=a.group,Zr.dragged=Xn,kv={target:Xn,clientX:(n||e).clientX,clientY:(n||e).clientY},IR=kv.clientX-f.left,FR=kv.clientY-f.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,Xn.style["will-change"]="all",l=function(){if(Ws("delayEnded",r,{evt:e}),Zr.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!RR&&r.nativeDraggable&&(Xn.draggable=!0),r._triggerDragStart(e,n),_s({sortable:r,name:"choose",originalEvent:e}),vu(Xn,a.chosenClass,!0)},a.ignore.split(",").forEach(function(h){u8(Xn,h.trim(),MS)}),Vo(s,"dragover",Pv),Vo(s,"mousemove",Pv),Vo(s,"touchmove",Pv),a.supportPointer?(Vo(s,"pointerup",r._onDrop),!this.nativeDraggable&&Vo(s,"pointercancel",r._onDrop)):(Vo(s,"mouseup",r._onDrop),Vo(s,"touchend",r._onDrop),Vo(s,"touchcancel",r._onDrop)),RR&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Xn.draggable=!0),Ws("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ab||gp))){if(Zr.eventCanceled){this._onDrop();return}a.supportPointer?(Vo(s,"pointerup",r._disableDelayedDrag),Vo(s,"pointercancel",r._disableDelayedDrag)):(Vo(s,"mouseup",r._disableDelayedDrag),Vo(s,"touchend",r._disableDelayedDrag),Vo(s,"touchcancel",r._disableDelayedDrag)),Vo(s,"mousemove",r._delayedDragTouchMoveHandler),Vo(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&Vo(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Xn&&MS(Xn),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Bo(e,"mouseup",this._disableDelayedDrag),Bo(e,"touchend",this._disableDelayedDrag),Bo(e,"touchcancel",this._disableDelayedDrag),Bo(e,"pointerup",this._disableDelayedDrag),Bo(e,"pointercancel",this._disableDelayedDrag),Bo(e,"mousemove",this._delayedDragTouchMoveHandler),Bo(e,"touchmove",this._delayedDragTouchMoveHandler),Bo(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?Vo(document,"pointermove",this._onTouchMove):n?Vo(document,"touchmove",this._onTouchMove):Vo(document,"mousemove",this._onTouchMove):(Vo(Xn,"dragend",this),Vo(ca,"dragstart",this._onDragStart));try{document.selection?ow(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(hm=!1,ca&&Xn){Ws("dragStarted",this,{evt:n}),this.nativeDraggable&&Vo(document,"dragover",dre);var o=this.options;!e&&vu(Xn,o.dragClass,!1),vu(Xn,o.ghostClass,!0),Zr.active=this,e&&this._appendGhost(),_s({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Vc){this._lastX=Vc.clientX,this._lastY=Vc.clientY,m8();for(var e=document.elementFromPoint(Vc.clientX,Vc.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Vc.clientX,Vc.clientY),e!==n);)n=e;if(Xn.parentNode[zs]._isOutsideThisEl(e),n)do{if(n[zs]){var o=void 0;if(o=n[zs]._onDragOver({clientX:Vc.clientX,clientY:Vc.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=s8(n));y8()}},_onTouchMove:function(e){if(kv){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=e.touches?e.touches[0]:e,a=po&&Am(po,!0),s=po&&a&&a.a,l=po&&a&&a.d,f=$0&&ql&&LR(ql),h=(i.clientX-kv.clientX+r.x)/(s||1)+(f?f[0]-AS[0]:0)/(s||1),v=(i.clientY-kv.clientY+r.y)/(l||1)+(f?f[1]-AS[1]:0)/(l||1);if(!Zr.active&&!hm){if(o&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<o)return;this._onDragStart(e,!0)}if(po){a?(a.e+=h-(OS||0),a.f+=v-(SS||0)):a={a:1,b:0,c:0,d:1,e:h,f:v};var _="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ro(po,"webkitTransform",_),ro(po,"mozTransform",_),ro(po,"msTransform",_),ro(po,"transform",_),OS=h,SS=v,Vc=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!po){var e=this.options.fallbackOnBody?document.body:ca,n=Ya(Xn,!0,$0,!0,e),o=this.options;if($0){for(ql=e;ro(ql,"position")==="static"&&ro(ql,"transform")==="none"&&ql!==document;)ql=ql.parentNode;ql!==document.body&&ql!==document.documentElement?(ql===document&&(ql=Hd()),n.top+=ql.scrollTop,n.left+=ql.scrollLeft):ql=Hd(),AS=LR(ql)}po=Xn.cloneNode(!0),vu(po,o.ghostClass,!1),vu(po,o.fallbackClass,!0),vu(po,o.dragClass,!0),ro(po,"transition",""),ro(po,"transform",""),ro(po,"box-sizing","border-box"),ro(po,"margin",0),ro(po,"top",n.top),ro(po,"left",n.left),ro(po,"width",n.width),ro(po,"height",n.height),ro(po,"opacity","0.8"),ro(po,"position",$0?"absolute":"fixed"),ro(po,"zIndex","100000"),ro(po,"pointerEvents","none"),Zr.ghost=po,e.appendChild(po),ro(po,"transform-origin",IR/parseInt(po.style.width)*100+"% "+FR/parseInt(po.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,r=e.dataTransfer,i=o.options;if(Ws("dragStart",this,{evt:e}),Zr.eventCanceled){this._onDrop();return}Ws("setupClone",this),Zr.eventCanceled||(_a=f8(Xn),_a.removeAttribute("id"),_a.draggable=!1,_a.style["will-change"]="",this._hideClone(),vu(_a,this.options.chosenClass,!1),Zr.clone=_a),o.cloneId=ow(function(){Ws("clone",o),!Zr.eventCanceled&&(o.options.removeCloneOnHide||ca.insertBefore(_a,Xn),o._hideClone(),_s({sortable:o,name:"clone"}))}),!n&&vu(Xn,i.dragClass,!0),n?(p1=!0,o._loopId=setInterval(o._emulateDragOver,50)):(Bo(document,"mouseup",o._onDrop),Bo(document,"touchend",o._onDrop),Bo(document,"touchcancel",o._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(o,r,Xn)),Vo(document,"drop",o),ro(Xn,"transform","translateZ(0)")),hm=!0,o._dragStartId=ow(o._dragStarted.bind(o,n,e)),Vo(document,"selectstart",o),Yy=!0,window.getSelection().removeAllRanges(),g_&&ro(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,r,i,a,s=this.options,l=s.group,f=Zr.active,h=F0===l,v=s.sort,_=Dl||f,E,O=this,w=!1;if(m2)return;function S(Ae,Pe){Ws(Ae,O,Yd({evt:e,isOwner:h,axis:E?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:v,fromSortable:_,target:o,completed:T,onMove:function(He,Ye){return U0(ca,n,Xn,r,He,Ya(He),e,Ye)},changed:B},Pe))}function M(){S("dragOverAnimationCapture"),O.captureAnimationState(),O!==_&&_.captureAnimationState()}function T(Ae){return S("dragOverCompleted",{insertion:Ae}),Ae&&(h?f._hideClone():f._showClone(O),O!==_&&(vu(Xn,Dl?Dl.options.ghostClass:f.options.ghostClass,!1),vu(Xn,s.ghostClass,!0)),Dl!==O&&O!==Zr.active?Dl=O:O===Zr.active&&Dl&&(Dl=null),_===O&&(O._ignoreWhileAnimating=o),O.animateAll(function(){S("dragOverAnimationComplete"),O._ignoreWhileAnimating=null}),O!==_&&(_.animateAll(),_._ignoreWhileAnimating=null)),(o===Xn&&!Xn.animated||o===n&&!o.animated)&&(um=null),!s.dragoverBubble&&!e.rootEl&&o!==document&&(Xn.parentNode[zs]._isOutsideThisEl(e.target),!Ae&&Pv(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),w=!0}function B(){gu=zu(Xn),gh=zu(Xn,s.draggable),_s({sortable:O,name:"change",toEl:n,newIndex:gu,newDraggableIndex:gh,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=zc(o,s.draggable,n,!0),S("dragOver"),Zr.eventCanceled)return w;if(Xn.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||O._ignoreWhileAnimating===o)return T(!1);if(p1=!1,f&&!s.disabled&&(h?v||(a=Aa!==ca):Dl===this||(this.lastPutMode=F0.checkPull(this,f,Xn,e))&&l.checkPut(this,f,Xn,e))){if(E=this._getDirection(e,o)==="vertical",r=Ya(Xn),S("dragOverValid"),Zr.eventCanceled)return w;if(a)return Aa=ca,M(),this._hideClone(),S("revert"),Zr.eventCanceled||(Dv?ca.insertBefore(Xn,Dv):ca.appendChild(Xn)),T(!0);var R=BM(n,s.draggable);if(!R||vre(e,E,this)&&!R.animated){if(R===Xn)return T(!1);if(R&&n===e.target&&(o=R),o&&(i=Ya(o)),U0(ca,n,Xn,r,o,i,e,!!o)!==!1)return M(),R&&R.nextSibling?n.insertBefore(Xn,R.nextSibling):n.appendChild(Xn),Aa=n,B(),T(!0)}else if(R&&hre(e,E,this)){var P=Xm(n,0,s,!0);if(P===Xn)return T(!1);if(o=P,i=Ya(o),U0(ca,n,Xn,r,o,i,e,!1)!==!1)return M(),n.insertBefore(Xn,P),Aa=n,B(),T(!0)}else if(o.parentNode===n){i=Ya(o);var $=0,I,F=Xn.parentNode!==n,U=!ure(Xn.animated&&Xn.toRect||r,o.animated&&o.toRect||i,E),z=E?"top":"left",X=jR(o,"top","top")||jR(Xn,"top","top"),Y=X?X.scrollTop:void 0;um!==o&&(I=i[z],b_=!1,B0=!U&&s.invertSwap||F),$=gre(e,o,i,E,U?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,B0,um===o);var W;if($!==0){var Q=zu(Xn);do Q-=$,W=Aa.children[Q];while(W&&(ro(W,"display")==="none"||W===po))}if($===0||W===o)return T(!1);um=o,__=$;var J=o.nextElementSibling,ie=!1;ie=$===1;var Se=U0(ca,n,Xn,r,o,i,e,ie);if(Se!==!1)return(Se===1||Se===-1)&&(ie=Se===1),m2=!0,setTimeout(pre,30),M(),ie&&!J?n.appendChild(Xn):o.parentNode.insertBefore(Xn,ie?J:o),X&&d8(X,0,Y-X.scrollTop),Aa=Xn.parentNode,I!==void 0&&!B0&&(rw=Math.abs(I-Ya(o)[z])),B(),T(!0)}if(n.contains(Xn))return T(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Bo(document,"mousemove",this._onTouchMove),Bo(document,"touchmove",this._onTouchMove),Bo(document,"pointermove",this._onTouchMove),Bo(document,"dragover",Pv),Bo(document,"mousemove",Pv),Bo(document,"touchmove",Pv)},_offUpEvents:function(){var e=this.el.ownerDocument;Bo(e,"mouseup",this._onDrop),Bo(e,"touchend",this._onDrop),Bo(e,"pointerup",this._onDrop),Bo(e,"pointercancel",this._onDrop),Bo(e,"touchcancel",this._onDrop),Bo(document,"selectstart",this)},_onDrop:function(e){var n=this.el,o=this.options;if(gu=zu(Xn),gh=zu(Xn,o.draggable),Ws("drop",this,{evt:e}),Aa=Xn&&Xn.parentNode,gu=zu(Xn),gh=zu(Xn,o.draggable),Zr.eventCanceled){this._nulling();return}hm=!1,B0=!1,b_=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),y2(this.cloneId),y2(this._dragStartId),this.nativeDraggable&&(Bo(document,"drop",this),Bo(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),g_&&ro(document.body,"user-select",""),ro(Xn,"transform",""),e&&(Yy&&(e.cancelable&&e.preventDefault(),!o.dropBubble&&e.stopPropagation()),po&&po.parentNode&&po.parentNode.removeChild(po),(ca===Aa||Dl&&Dl.lastPutMode!=="clone")&&_a&&_a.parentNode&&_a.parentNode.removeChild(_a),Xn&&(this.nativeDraggable&&Bo(Xn,"dragend",this),MS(Xn),Xn.style["will-change"]="",Yy&&!hm&&vu(Xn,Dl?Dl.options.ghostClass:this.options.ghostClass,!1),vu(Xn,this.options.chosenClass,!1),_s({sortable:this,name:"unchoose",toEl:Aa,newIndex:null,newDraggableIndex:null,originalEvent:e}),ca!==Aa?(gu>=0&&(_s({rootEl:Aa,name:"add",toEl:Aa,fromEl:ca,originalEvent:e}),_s({sortable:this,name:"remove",toEl:Aa,originalEvent:e}),_s({rootEl:Aa,name:"sort",toEl:Aa,fromEl:ca,originalEvent:e}),_s({sortable:this,name:"sort",toEl:Aa,originalEvent:e})),Dl&&Dl.save()):gu!==xm&&gu>=0&&(_s({sortable:this,name:"update",toEl:Aa,originalEvent:e}),_s({sortable:this,name:"sort",toEl:Aa,originalEvent:e})),Zr.active&&((gu==null||gu===-1)&&(gu=xm,gh=y_),_s({sortable:this,name:"end",toEl:Aa,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ws("nulling",this),ca=Xn=Aa=po=Dv=_a=nw=mh=kv=Vc=Yy=gu=gh=xm=y_=um=__=Dl=F0=Zr.dragged=Zr.ghost=Zr.clone=Zr.active=null,v1.forEach(function(e){e.checked=!0}),v1.length=OS=SS=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Xn&&(this._onDragOver(e),fre(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,o=this.el.children,r=0,i=o.length,a=this.options;r<i;r++)n=o[r],zc(n,a.draggable,this.el,!1)&&e.push(n.getAttribute(a.dataIdAttr)||yre(n));return e},sort:function(e,n){var o={},r=this.el;this.toArray().forEach(function(i,a){var s=r.children[a];zc(s,this.options.draggable,r,!1)&&(o[i]=s)},this),n&&this.captureAnimationState(),e.forEach(function(i){o[i]&&(r.removeChild(o[i]),r.appendChild(o[i]))}),n&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,n){return zc(e,n||this.options.draggable,this.el,!1)},option:function(e,n){var o=this.options;if(n===void 0)return o[e];var r=lb.modifyOption(this,e,n);typeof r<"u"?o[e]=r:o[e]=n,e==="group"&&g8(o)},destroy:function(){Ws("destroy",this);var e=this.el;e[zs]=null,Bo(e,"mousedown",this._onTapStart),Bo(e,"touchstart",this._onTapStart),Bo(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Bo(e,"dragover",this),Bo(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),h1.splice(h1.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!mh){if(Ws("hideClone",this),Zr.eventCanceled)return;ro(_a,"display","none"),this.options.removeCloneOnHide&&_a.parentNode&&_a.parentNode.removeChild(_a),mh=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(mh){if(Ws("showClone",this),Zr.eventCanceled)return;Xn.parentNode==ca&&!this.options.group.revertClone?ca.insertBefore(_a,Xn):Dv?ca.insertBefore(_a,Dv):ca.appendChild(_a),this.options.group.revertClone&&this.animate(Xn,_a),ro(_a,"display",""),mh=!1}}};function fre(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function U0(t,e,n,o,r,i,a,s){var l,f=t[zs],h=f.options.onMove,v;return window.CustomEvent&&!gp&&!ab?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=r||e,l.relatedRect=i||Ya(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),h&&(v=h.call(f,l,a)),v}function MS(t){t.draggable=!1}function pre(){m2=!1}function hre(t,e,n){var o=Ya(Xm(n.el,0,n.options,!0)),r=p8(n.el,n.options,po),i=10;return e?t.clientX<r.left-i||t.clientY<o.top&&t.clientX<o.right:t.clientY<r.top-i||t.clientY<o.bottom&&t.clientX<o.left}function vre(t,e,n){var o=Ya(BM(n.el,n.options.draggable)),r=p8(n.el,n.options,po),i=10;return e?t.clientX>r.right+i||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>r.bottom+i||t.clientX>o.right&&t.clientY>o.top}function gre(t,e,n,o,r,i,a,s){var l=o?t.clientY:t.clientX,f=o?n.height:n.width,h=o?n.top:n.left,v=o?n.bottom:n.right,_=!1;if(!a){if(s&&rw<f*r){if(!b_&&(__===1?l>h+f*i/2:l<v-f*i/2)&&(b_=!0),b_)_=!0;else if(__===1?l<h+rw:l>v-rw)return-__}else if(l>h+f*(1-r)/2&&l<v-f*(1-r)/2)return mre(e)}return _=_||a,_&&(l<h+f*i/2||l>v-f*i/2)?l>h+f/2?1:-1:0}function mre(t){return zu(Xn)<zu(t)?1:-1}function yre(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function _re(t){v1.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&v1.push(o)}}function ow(t){return setTimeout(t,0)}function y2(t){return clearTimeout(t)}tE&&Vo(document,"touchmove",function(t){(Zr.active||hm)&&t.cancelable&&t.preventDefault()});Zr.utils={on:Vo,off:Bo,css:ro,find:u8,is:function(e,n){return!!zc(e,n,e,!1)},extend:tre,throttle:c8,closest:zc,toggleClass:vu,clone:f8,index:zu,nextTick:ow,cancelNextTick:y2,detectDirection:v8,getChild:Xm,expando:zs};Zr.get=function(t){return t[zs]};Zr.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(Zr.utils=Yd(Yd({},Zr.utils),o.utils)),lb.mount(o)})};Zr.create=function(t,e){return new Zr(t,e)};Zr.version=Qne;var Xa=[],qy,_2,b2=!1,TS,CS,g1,Ky;function bre(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?Vo(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Vo(document,"pointermove",this._handleFallbackAutoScroll):o.touches?Vo(document,"touchmove",this._handleFallbackAutoScroll):Vo(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?Bo(document,"dragover",this._handleAutoScroll):(Bo(document,"pointermove",this._handleFallbackAutoScroll),Bo(document,"touchmove",this._handleFallbackAutoScroll),Bo(document,"mousemove",this._handleFallbackAutoScroll)),$R(),iw(),nre()},nulling:function(){g1=_2=qy=b2=Ky=TS=CS=null,Xa.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var r=this,i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,s=document.elementFromPoint(i,a);if(g1=n,o||this.options.forceAutoScrollFallback||ab||gp||g_){NS(n,this.options,s,o);var l=wh(s,!0);b2&&(!Ky||i!==TS||a!==CS)&&(Ky&&$R(),Ky=setInterval(function(){var f=wh(document.elementFromPoint(i,a),!0);f!==l&&(l=f,iw()),NS(n,r.options,f,o)},10),TS=i,CS=a)}else{if(!this.options.bubbleScroll||wh(s,!0)===Hd()){iw();return}NS(n,this.options,wh(s,!1),!1)}}},cp(t,{pluginName:"scroll",initializeByDefault:!0})}function iw(){Xa.forEach(function(t){clearInterval(t.pid)}),Xa=[]}function $R(){clearInterval(Ky)}var NS=c8(function(t,e,n,o){if(e.scroll){var r=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,s=e.scrollSpeed,l=Hd(),f=!1,h;_2!==n&&(_2=n,iw(),qy=e.scroll,h=e.scrollFn,qy===!0&&(qy=wh(n,!0)));var v=0,_=qy;do{var E=_,O=Ya(E),w=O.top,S=O.bottom,M=O.left,T=O.right,B=O.width,R=O.height,P=void 0,$=void 0,I=E.scrollWidth,F=E.scrollHeight,U=ro(E),z=E.scrollLeft,X=E.scrollTop;E===l?(P=B<I&&(U.overflowX==="auto"||U.overflowX==="scroll"||U.overflowX==="visible"),$=R<F&&(U.overflowY==="auto"||U.overflowY==="scroll"||U.overflowY==="visible")):(P=B<I&&(U.overflowX==="auto"||U.overflowX==="scroll"),$=R<F&&(U.overflowY==="auto"||U.overflowY==="scroll"));var Y=P&&(Math.abs(T-r)<=a&&z+B<I)-(Math.abs(M-r)<=a&&!!z),W=$&&(Math.abs(S-i)<=a&&X+R<F)-(Math.abs(w-i)<=a&&!!X);if(!Xa[v])for(var Q=0;Q<=v;Q++)Xa[Q]||(Xa[Q]={});(Xa[v].vx!=Y||Xa[v].vy!=W||Xa[v].el!==E)&&(Xa[v].el=E,Xa[v].vx=Y,Xa[v].vy=W,clearInterval(Xa[v].pid),(Y!=0||W!=0)&&(f=!0,Xa[v].pid=setInterval((function(){o&&this.layer===0&&Zr.active._onTouchMove(g1);var J=Xa[this.layer].vy?Xa[this.layer].vy*s:0,ie=Xa[this.layer].vx?Xa[this.layer].vx*s:0;typeof h=="function"&&h.call(Zr.dragged.parentNode[zs],ie,J,t,g1,Xa[this.layer].el)!=="continue"||d8(Xa[this.layer].el,ie,J)}).bind({layer:v}),24))),v++}while(e.bubbleScroll&&_!==l&&(_=wh(_,!1)));b2=f}},30),_8=function(e){var n=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(n){var f=o||i;s();var h=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,v=document.elementFromPoint(h.clientX,h.clientY);l(),f&&!f.el.contains(v)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function $M(){}$M.prototype={startIndex:null,dragStart:function(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function(e){var n=e.dragEl,o=e.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var r=Xm(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(n,r):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:_8};cp($M,{pluginName:"revertOnSpill"});function UM(){}UM.prototype={onSpill:function(e){var n=e.dragEl,o=e.putSortable,r=o||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:_8};cp(UM,{pluginName:"removeOnSpill"});Zr.mount(new bre);Zr.mount(UM,$M);const wre={class:"dialog-footer"},Ere=gr({__name:"ApiFieldFormDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge(!1),s=Ge({name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""}),l=Rh({name:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],variable:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),f=Ge(!1);K_(f,E=>{E||(s.value={name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""},a.value=!1)});const h=E=>{E&&(s.value=Me.cloneDeep(E),a.value=!0),f.value=!0},v=()=>{f.value=!1,a.value=!1},_=async E=>{E&&await E.validate(O=>{O&&o("refresh",s.value)})};return e({open:h,close:v}),(E,O)=>{const w=te("el-input"),S=te("el-form-item"),M=te("el-switch"),T=te("el-form"),B=te("el-button"),R=te("el-dialog");return Te(),bt(R,{title:a.value?E.$t("common.param.editParam"):E.$t("common.param.addParam"),modelValue:f.value,"onUpdate:modelValue":O[10]||(O[10]=P=>f.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":v,"append-to-body":""},{footer:j(()=>[ee("span",wre,[k(B,{onClick:O[8]||(O[8]=mn(P=>f.value=!1,["prevent"]))},{default:j(()=>[ft(_e(E.$t("common.cancel")),1)]),_:1}),k(B,{type:"primary",onClick:O[9]||(O[9]=P=>_(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?E.$t("common.save"):E.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:l,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[k(S,{label:E.$t("dynamicsForm.paramForm.field.label"),prop:"variable"},{default:j(()=>[k(w,{modelValue:s.value.variable,"onUpdate:modelValue":O[0]||(O[0]=P=>s.value.variable=P),placeholder:E.$t("dynamicsForm.paramForm.field.placeholder"),maxlength:"64","show-word-limit":"",onBlur:O[1]||(O[1]=P=>s.value.variable=s.value.variable.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(S,{label:E.$t("common.desc")},{default:j(()=>[k(w,{modelValue:s.value.desc,"onUpdate:modelValue":O[2]||(O[2]=P=>s.value.desc=P),placeholder:E.$t("common.descPlaceholder"),onBlur:O[3]||(O[3]=P=>s.value.name=s.value.name.trim()),maxlength:"64","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(S,{label:E.$t("dynamicsForm.paramForm.required.label"),onClick:O[5]||(O[5]=mn(()=>{},["prevent"]))},{default:j(()=>[k(M,{size:"small",modelValue:s.value.is_required,"onUpdate:modelValue":O[4]||(O[4]=P=>s.value.is_required=P)},null,8,["modelValue"])]),_:1},8,["label"]),k(S,{label:E.$t("dynamicsForm.default.label"),prop:"default_value",rules:{required:s.value.is_required,message:E.$t("dynamicsForm.default.placeholder"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:s.value.default_value,"onUpdate:modelValue":O[6]||(O[6]=P=>s.value.default_value=P),placeholder:E.$t("dynamicsForm.default.placeholder"),onBlur:O[7]||(O[7]=P=>s.value.name=s.value.name.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),xre={class:"flex-between mb-16"},Ore={class:"lighter"},Sre=["title"],Are=["title"],Mre=["title"],Tre={class:"mr-4"},Cre=gr({__name:"ApiInputFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(null),r=Ge(),i=Ge([]);function a(h,v){typeof v<"u"&&(o.value=v),r.value.open(h)}function s(h){i.value.splice(h,1),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function l(h){for(let _=0;_<i.value.length;_++)if(i.value[_].variable===h.variable&&o.value!==_){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}const v=e.nodeModel.properties.user_input_field_list;for(let _=0;_<v.length;_++)if(v[_].field===h.variable){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}o.value!==null?i.value.splice(o.value,1,h):i.value.push(h),o.value=null,r.value.close(),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function f(){if(!n.value)return;const v=n.value.$el.querySelector(".api-input-field-table .el-table__body-wrapper tbody");v&&Zr.create(v,{animation:150,ghostClass:"ghost-row",onEnd:_=>{if(_.oldIndex===void 0||_.newIndex===void 0)return;const E=Me.cloneDeep([...i.value]),[O]=E.splice(_.oldIndex,1);E.splice(_.newIndex,0,O),i.value=E,e.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return yo(()=>{e.nodeModel.properties.api_input_field_list?i.value.push(...e.nodeModel.properties.api_input_field_list):e.nodeModel.properties.input_field_list&&e.nodeModel.properties.input_field_list.filter(h=>h.assignment_method==="api_input").forEach(h=>{i.value.push(h)}),Me.set(e.nodeModel.properties,"api_input_field_list",i),f()}),(h,v)=>{var T;const _=te("AppIcon"),E=te("el-button"),O=te("el-table-column"),w=te("el-switch"),S=te("el-tooltip"),M=te("el-table");return Te(),cn(Ir,null,[ee("div",xre,[ee("h5",Ore,_e(h.$t("views.model.modelForm.title.apiParamPassing")),1),k(E,{link:"",type:"primary",onClick:v[0]||(v[0]=B=>a())},{default:j(()=>[k(_,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(h.$t("common.add")),1)]),_:1})]),((T=e.nodeModel.properties.api_input_field_list)==null?void 0:T.length)>0?(Te(),bt(M,{key:0,data:e.nodeModel.properties.api_input_field_list,class:"mb-16 api-input-field-table",ref_key:"tableRef",ref:n,"row-key":"variable"},{default:j(()=>[k(O,{prop:"variable",label:h.$t("dynamicsForm.paramForm.field.label")},{default:j(({row:B})=>[ee("span",{class:"ellipsis-1",title:B.variable},_e(B.variable),9,Sre)]),_:1},8,["label"]),k(O,{prop:"desc",label:h.$t("common.desc")},{default:j(({row:B})=>[ee("span",{class:"ellipsis-1",title:B.desc},_e(B.desc),9,Are)]),_:1},8,["label"]),k(O,{prop:"default_value",label:h.$t("dynamicsForm.default.label")},{default:j(({row:B})=>[ee("span",{class:"ellipsis-1",title:B.default_value},_e(B.default_value),9,Mre)]),_:1},8,["label"]),k(O,{label:h.$t("common.required")},{default:j(({row:B})=>[ee("div",{onClick:v[1]||(v[1]=mn(()=>{},["stop"]))},[k(w,{disabled:"",size:"small",modelValue:B.is_required,"onUpdate:modelValue":R=>B.is_required=R},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(O,{label:h.$t("common.operation"),align:"left",width:"90"},{default:j(({row:B,$index:R})=>[ee("span",Tre,[k(S,{effect:"dark",content:h.$t("common.modify"),placement:"top"},{default:j(()=>[k(E,{type:"primary",text:"",onClick:mn(P=>a(B,R),["stop"])},{default:j(()=>[k(_,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(S,{effect:"dark",content:h.$t("common.delete"),placement:"top"},{default:j(()=>[k(E,{type:"primary",text:"",onClick:P=>s(R)},{default:j(()=>[k(_,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0),k(Ere,{ref_key:"ApiFieldFormDialogRef",ref:r,onRefresh:l},null,512)],64)}}}),Nre={class:"dialog-footer"},kre=gr({__name:"UserFieldFormDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge(!1),s=Ge(),l=(S,M)=>S.every(T=>f9.get(M,T,void 0)!==void 0),f=fr(()=>{if(s.value){const S=s.value;switch(S.type){case"input":return l(["field","input_type","label","required","attrs"],s.value)?s.value:{attrs:S.attrs||{maxlength:200,minlength:0},field:S.field||S.variable,input_type:"TextInput",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required};case"select":return l(["field","input_type","label","required","option_list"],s.value)?s.value:{attrs:S.attrs||{},field:S.field||S.variable,input_type:"SingleSelect",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required,option_list:S.option_list?S.option_list:S.optionList.map(M=>({key:M,value:M}))};case"date":return l(["field","input_type","label","required","attrs.format","attrs.value-format","attrs.type"],s.value)?s.value:{field:S.field||S.variable,input_type:"DatePicker",label:S.label||S.name,default_value:S.default_value,required:S.required!=null?S.required:S.is_required,attrs:{format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",type:"datetime"}};default:return s.value}}else return{input_type:"TextInput",required:!1,attrs:{maxlength:200,minlength:0},show_default_value:!0}}),h=Ge(null),v=Ge([{label:Pt("dynamicsForm.input_type_list.TextInput"),value:"TextInputConstructor"},{label:Pt("dynamicsForm.input_type_list.PasswordInput"),value:"PasswordInputConstructor"},{label:Pt("dynamicsForm.input_type_list.SingleSelect"),value:"SingleSelectConstructor"},{label:Pt("dynamicsForm.input_type_list.MultiSelect"),value:"MultiSelectConstructor"},{label:Pt("dynamicsForm.input_type_list.RadioCard"),value:"RadioCardConstructor"},{label:Pt("dynamicsForm.input_type_list.DatePicker"),value:"DatePickerConstructor"},{label:Pt("dynamicsForm.input_type_list.SwitchInput"),value:"SwitchInputConstructor"}]),_=Ge(!1),E=(S,M)=>{_.value=!0,S?(a.value=!0,s.value=Me.cloneDeep(S),h.value=M):s.value=null},O=()=>{_.value=!1,a.value=!1,h.value=null,s.value=null},w=async()=>{const S=r.value;S&&await S.validate().then(()=>{o("refresh",S==null?void 0:S.getData(),h.value),a.value=!1,s.value=null,h.value=null})};return e({open:E,close:O}),(S,M)=>{const T=te("el-button"),B=te("el-dialog");return Te(),bt(B,{title:a.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:_.value,"onUpdate:modelValue":M[2]||(M[2]=R=>_.value=R),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":O,"append-to-body":""},{footer:j(()=>[ee("span",Nre,[k(T,{onClick:mn(O,["prevent"])},{default:j(()=>[ft(_e(S.$t("common.cancel")),1)]),_:1}),k(T,{type:"primary",onClick:M[1]||(M[1]=R=>w()),loading:i.value},{default:j(()=>[ft(_e(a.value?S.$t("common.save"):S.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(F2,{modelValue:f.value,"onUpdate:modelValue":M[0]||(M[0]=R=>f.value=R),"label-position":"top","require-asterisk-position":"right",input_type_list:v.value,ref_key:"DynamicsFormConstructorRef",ref:r},null,8,["modelValue","input_type_list"])]),_:1},8,["title","modelValue"])}}}),Pre={class:"dialog-footer"},Rre=gr({__name:"UserInputTitleDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge({title:Pt("chat.userInput")}),s=Rh({title:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}]}),l=Ge(!1),f=_=>{_&&(a.value=Me.cloneDeep(_)),l.value=!0},h=()=>{l.value=!1},v=async _=>{_&&await _.validate(E=>{E&&o("refresh",a.value)})};return e({open:f,close:h}),(_,E)=>{const O=te("el-input"),w=te("el-form-item"),S=te("el-form"),M=te("el-button"),T=te("el-dialog");return Te(),bt(T,{title:_.$t("common.setting"),modelValue:l.value,"onUpdate:modelValue":E[5]||(E[5]=B=>l.value=B),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",Pre,[k(M,{onClick:E[3]||(E[3]=mn(B=>l.value=!1,["prevent"]))},{default:j(()=>[ft(_e(_.$t("common.cancel")),1)]),_:1}),k(M,{type:"primary",onClick:E[4]||(E[4]=B=>v(r.value)),loading:i.value},{default:j(()=>[ft(_e(_.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(S,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:s,model:a.value,"require-asterisk-position":"right",onSubmit:E[2]||(E[2]=mn(()=>{},["prevent"]))},{default:j(()=>[k(w,{label:_.$t("common.title"),prop:"title"},{default:j(()=>[k(O,{modelValue:a.value.title,"onUpdate:modelValue":E[0]||(E[0]=B=>a.value.title=B),maxlength:"64","show-word-limit":"",onBlur:E[1]||(E[1]=B=>a.value.title=a.value.title.trim())},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),Dre={class:"flex-between mb-16"},jre=["title"],Lre={class:"ml-4"},Ire=["title"],Fre={key:0},Bre=["title"],$re={key:1},Ure=["title"],Vre=["title"],Wre={class:"mr-4"},Gre=gr({__name:"UserInputFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(),r=Ge(),i=Ge([]),a=Ge({title:Pt("chat.userInput")});function s(O,w){o.value.open(O,w)}function l(){r.value.open(a.value)}function f(O){i.value.splice(O,1),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),E()}function h(O,w){for(let M=0;M<i.value.length;M++)if(i.value[M].field===O.field&&w!==M){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}const S=e.nodeModel.properties.api_input_field_list;for(let M=0;M<S.length;M++)if(S[M].variable===O.field){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}w!==null?i.value.splice(w,1,O):i.value.push(O),o.value.close(),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),E()}function v(O){a.value=O,r.value.close()}const _=O=>{var w;if(O.input_type==="PasswordInput")return"******";if(O.default_value){const S=(w=O.option_list)==null?void 0:w.filter(M=>O.default_value.indexOf(M.value)>-1).map(M=>M.label).join(",");return S||O.default_value}if(O.default_value!==void 0)return O.default_value};function E(){if(!n.value)return;const w=n.value.$el.querySelector(".el-table__body-wrapper tbody");w&&Zr.create(w,{animation:150,ghostClass:"ghost-row",onEnd:S=>{if(S.oldIndex===void 0||S.newIndex===void 0)return;const M=Me.cloneDeep([...i.value]),[T]=M.splice(S.oldIndex,1);M.splice(S.newIndex,0,T),i.value=M,e.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return yo(()=>{e.nodeModel.properties.user_input_field_list?i.value.push(...e.nodeModel.properties.user_input_field_list):e.nodeModel.properties.input_field_list&&e.nodeModel.properties.input_field_list.filter(O=>O.assignment_method==="user_input").forEach(O=>{i.value.push(O)}),i.value.forEach((O,w)=>{switch(O.label=O.label||O.name,O.field=O.field||O.variable,O.required=O.required||O.is_required,O.type){case"input":O.input_type="TextInput";break;case"select":O.input_type="SingleSelect";break;case"date":O.input_type="DatePicker";break}}),Me.set(e.nodeModel.properties,"user_input_field_list",i),e.nodeModel.properties.user_input_config&&(a.value=e.nodeModel.properties.user_input_config),Me.set(e.nodeModel.properties,"user_input_config",a),E()}),(O,w)=>{var I;const S=te("AppIcon"),M=te("el-button"),T=te("el-table-column"),B=te("el-tag"),R=te("el-switch"),P=te("el-tooltip"),$=te("el-table");return Te(),cn(Ir,null,[ee("div",Dre,[ee("h5",{class:"break-all ellipsis lighter",style:{"max-width":"80%"},title:a.value.title},_e(a.value.title),9,jre),ee("div",null,[k(M,{type:"primary",link:"",onClick:l},{default:j(()=>[k(S,{iconName:"app-setting"})]),_:1}),ee("span",Lre,[k(M,{link:"",type:"primary",onClick:w[0]||(w[0]=F=>s())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})])])]),((I=e.nodeModel.properties.user_input_field_list)==null?void 0:I.length)>0?(Te(),bt($,{key:0,data:e.nodeModel.properties.user_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(T,{prop:"field",label:O.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:F})=>[ee("span",{title:F.field,class:"ellipsis-1"},_e(F.field),9,Ire)]),_:1},8,["label"]),k(T,{prop:"label",label:O.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:F})=>[F.label&&F.label.input_type==="TooltipLabel"?(Te(),cn("span",Fre,[ee("span",{title:F.label.label,class:"ellipsis-1"},_e(F.label.label),9,Bre)])):(Te(),cn("span",$re,[ee("span",{title:F.label,class:"ellipsis-1"},_e(F.label),9,Ure)]))]),_:1},8,["label"]),k(T,{label:O.$t("dynamicsForm.paramForm.input_type.label"),width:"95"},{default:j(({row:F})=>[F.input_type==="TextInput"?(Te(),bt(B,{key:0,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.TextInput")),1)]),_:1})):In("",!0),F.input_type==="PasswordInput"?(Te(),bt(B,{key:1,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.PasswordInput")),1)]),_:1})):In("",!0),F.input_type==="Slider"?(Te(),bt(B,{key:2,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.Slider")),1)]),_:1})):In("",!0),F.input_type==="SwitchInput"?(Te(),bt(B,{key:3,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SwitchInput")),1)]),_:1})):In("",!0),F.input_type==="SingleSelect"?(Te(),bt(B,{key:4,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SingleSelect")),1)]),_:1})):In("",!0),F.input_type==="MultiSelect"?(Te(),bt(B,{key:5,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.MultiSelect")),1)]),_:1})):In("",!0),F.input_type==="RadioCard"?(Te(),bt(B,{key:6,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.RadioCard")),1)]),_:1})):In("",!0),F.input_type==="DatePicker"?(Te(),bt(B,{key:7,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.DatePicker")),1)]),_:1})):In("",!0)]),_:1},8,["label"]),k(T,{prop:"default_value",label:O.$t("dynamicsForm.default.label")},{default:j(({row:F})=>[ee("span",{title:F.default_value,class:"ellipsis-1"},_e(_(F)),9,Vre)]),_:1},8,["label"]),k(T,{label:O.$t("common.required")},{default:j(({row:F})=>[ee("div",{onClick:w[1]||(w[1]=mn(()=>{},["stop"]))},[k(R,{disabled:"",size:"small",modelValue:F.required,"onUpdate:modelValue":U=>F.required=U},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(T,{label:O.$t("common.operation"),align:"left",width:"90"},{default:j(({row:F,$index:U})=>[ee("span",Wre,[k(P,{effect:"dark",content:O.$t("common.modify"),placement:"top"},{default:j(()=>[k(M,{type:"primary",text:"",onClick:mn(z=>s(F,U),["stop"])},{default:j(()=>[k(S,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(P,{effect:"dark",content:O.$t("common.delete"),placement:"top"},{default:j(()=>[k(M,{type:"primary",text:"",onClick:z=>f(U)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0),k(kre,{ref_key:"UserFieldFormDialogRef",ref:o,onRefresh:h},null,512),k(Rre,{ref_key:"UserInputTitleDialogRef",ref:r,onRefresh:v},null,512)],64)}}}),zre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.8146C19.9934%202%2020.1647%202.07183%2020.29%202.19934L26.4756%208.49255C26.5982%208.61722%2026.6668%208.78505%2026.6668%208.95987V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%233370FF'/%3e%3cpath%20d='M20%202.02637C20.1089%202.05793%2020.2089%202.11704%2020.2899%202.19936L26.4755%208.49256C26.5261%208.54408%2026.5675%208.60297%2026.5987%208.66668H21.5135C20.6776%208.66668%2020%207.98906%2020%207.15317V2.02637Z'%20fill='%232B5FD9'/%3e%3cpath%20d='M10.7636%2013.5757H20.8727C20.9932%2013.5757%2021.0909%2013.6734%2021.0909%2013.7939V14.8121C21.0909%2014.9326%2020.9932%2015.0303%2020.8727%2015.0303H10.7636C10.6431%2015.0303%2010.5454%2014.9326%2010.5454%2014.8121V13.7939C10.5454%2013.6734%2010.6431%2013.5757%2010.7636%2013.5757ZM10.7636%2017.9394H20.8727C20.9932%2017.9394%2021.0909%2018.0371%2021.0909%2018.1576V19.1757C21.0909%2019.2962%2020.9932%2019.3939%2020.8727%2019.3939H10.7636C10.6431%2019.3939%2010.5454%2019.2962%2010.5454%2019.1757V18.1576C10.5454%2018.0371%2010.6431%2017.9394%2010.7636%2017.9394ZM10.7636%2022.303H16.1454C16.2659%2022.303%2016.3636%2022.4007%2016.3636%2022.5212V23.5394C16.3636%2023.6599%2016.2659%2023.7576%2016.1454%2023.7576H10.7636C10.6431%2023.7576%2010.5454%2023.6599%2010.5454%2023.5394V22.5212C10.5454%2022.4007%2010.6431%2022.303%2010.7636%2022.303Z'%20fill='white'/%3e%3c/svg%3e",Hre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.724C19.9008%202%2020.0704%202.07024%2020.1954%202.19526L26.4716%208.47141C26.5966%208.59643%2026.6668%208.766%2026.6668%208.94281V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%2314C0FF'/%3e%3cpath%20d='M20%202.05988C20.072%202.09264%2020.1383%202.13825%2020.1953%202.19526L26.4714%208.4714C26.5284%208.52841%2026.574%208.59467%2026.6068%208.66666H21.3333C20.597%208.66666%2020%208.06971%2020%207.33333V2.05988Z'%20fill='%2311A3D9'/%3e%3cpath%20d='M11.3335%2016C12.4381%2016%2013.3335%2015.1046%2013.3335%2014C13.3335%2012.8954%2012.4381%2012%2011.3335%2012C10.2289%2012%209.3335%2012.8954%209.3335%2014C9.3335%2015.1046%2010.2289%2016%2011.3335%2016Z'%20fill='white'/%3e%3cpath%20d='M22.2785%2014.9317C22.4218%2014.7884%2022.6668%2014.8899%2022.6668%2015.0925V24.0645C22.6668%2024.1901%2022.565%2024.2919%2022.4394%2024.2919H13.4674L13.4587%2024.2918H9.56142C9.35877%2024.2918%209.25728%2024.0468%209.40058%2023.9035L14.366%2018.938C14.4549%2018.8492%2014.5989%2018.8492%2014.6877%2018.938L16.48%2020.7302L22.2785%2014.9317Z'%20fill='white'/%3e%3c/svg%3e",Xre="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5.3335%203.33333C5.3335%202.59695%205.93045%202%206.66683%202H19.724C19.9008%202%2020.0704%202.07024%2020.1954%202.19526L26.4716%208.47141C26.5966%208.59643%2026.6668%208.766%2026.6668%208.94281V28.6667C26.6668%2029.403%2026.0699%2030%2025.3335%2030H6.66683C5.93045%2030%205.3335%2029.403%205.3335%2028.6667V3.33333Z'%20fill='%233370FF'/%3e%3cpath%20d='M20%202.05994C20.072%202.0927%2020.1383%202.13831%2020.1953%202.19532L26.4714%208.47146C26.5284%208.52847%2026.574%208.59473%2026.6068%208.66672H21.3333C20.597%208.66672%2020%208.06977%2020%207.33339V2.05994Z'%20fill='%232B5FD9'/%3e%3cpath%20d='M19.976%2012.8794C20.254%2012.9447%2020.4595%2013.1796%2020.4872%2013.4638L20.6106%2014.7297C20.6546%2015.1805%2020.2459%2015.5429%2019.8037%2015.4455L16.7344%2014.7691C16.5577%2014.7302%2016.3944%2014.8747%2016.4116%2015.0548L17.1297%2022.5884C17.1297%2022.7046%2017.1151%2022.7812%2017.0891%2022.8249C17.0254%2024.3752%2015.7484%2025.6124%2014.1825%2025.6124C12.5759%2025.6124%2011.2734%2024.31%2011.2734%2022.7033C11.2734%2021.0967%2012.5759%2019.7942%2014.1825%2019.7942C14.8467%2019.7942%2015.4589%2020.0168%2015.9485%2020.3914L15.274%2012.6749C15.2345%2012.2228%2015.6485%2011.8642%2016.0904%2011.9678L19.976%2012.8794Z'%20fill='white'/%3e%3c/svg%3e",Yre="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202.5C4%201.94772%204.44772%201.5%205%201.5H14.7929C14.9255%201.5%2015.0527%201.55268%2015.1464%201.64645L19.8536%206.35355C19.9473%206.44732%2020%206.5745%2020%206.70711V21.5C20%2022.0523%2019.5523%2022.5%2019%2022.5H5C4.44772%2022.5%204%2022.0523%204%2021.5V2.5Z'%20fill='%2334C724'/%3e%3cpath%20d='M15%201.54492C15.054%201.56949%2015.1037%201.6037%2015.1464%201.64646L19.8536%206.35357C19.8963%206.39632%2019.9305%206.44602%2019.9551%206.50001H16C15.4477%206.50001%2015%206.0523%2015%205.50001V1.54492Z'%20fill='%232CA91F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%2011.5C7.5%2011.2239%207.72386%2011%208%2011H13.3971C13.6733%2011%2013.8971%2011.2239%2013.8971%2011.5V12.1723L15.8207%2011.4333C15.9744%2011.3742%2016.1474%2011.3946%2016.2831%2011.4879C16.4189%2011.5812%2016.5%2011.7353%2016.5%2011.9V16.3C16.5%2016.4647%2016.4189%2016.6188%2016.2831%2016.7121C16.1474%2016.8054%2015.9744%2016.8258%2015.8207%2016.7667L13.8971%2016.0277V16.7C13.8971%2016.9761%2013.6733%2017.2%2013.3971%2017.2H8C7.72386%2017.2%207.5%2016.9761%207.5%2016.7V11.5ZM9.25%2013.5C9.66421%2013.5%2010%2013.1642%2010%2012.75C10%2012.3358%209.66421%2012%209.25%2012C8.83579%2012%208.5%2012.3358%208.5%2012.75C8.5%2013.1642%208.83579%2013.5%209.25%2013.5Z'%20fill='white'/%3e%3c/svg%3e",qre="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%202.5C4%201.94772%204.44772%201.5%205%201.5H14.7929C14.9255%201.5%2015.0527%201.55268%2015.1464%201.64645L19.8536%206.35355C19.9473%206.44732%2020%206.5745%2020%206.70711V21.5C20%2022.0523%2019.5523%2022.5%2019%2022.5H5C4.44772%2022.5%204%2022.0523%204%2021.5V2.5Z'%20fill='%238F959E'/%3e%3cpath%20d='M15%201.54492C15.054%201.56949%2015.1037%201.6037%2015.1464%201.64646L19.8536%206.35357C19.8963%206.39632%2019.9305%206.44602%2019.9551%206.50001H16C15.4477%206.50001%2015%206.0523%2015%205.50001V1.54492Z'%20fill='%23646A73'/%3e%3cpath%20d='M14.288%209.86441C13.7422%209.34739%2013.026%209.09082%2012.1353%209.09082C11.1347%209.09082%2010.3505%209.41162%209.78235%2010.065C9.30108%2010.6265%209.04179%2011.1646%209.00471%2012.013C9.00384%2012.033%209.00309%2012.0697%209.00247%2012.1122C9.00043%2012.2508%209.11287%2012.3635%209.25147%2012.3635H9.84253C9.98%2012.3635%2010.0914%2012.2525%2010.0936%2012.1151C10.0943%2012.0737%2010.0951%2012.038%2010.0961%2012.0189C10.1251%2011.4328%2010.278%2011.1262%2010.5508%2010.7851C10.8953%2010.3259%2011.4006%2010.0999%2012.0943%2010.0999C12.7134%2010.0999%2013.1776%2010.2578%2013.4979%2010.5782C13.8033%2010.8963%2013.9625%2011.3294%2013.9625%2011.8726C13.9625%2012.2435%2013.8281%2012.5967%2013.5549%2012.948C13.4678%2013.0568%2013.3425%2013.1862%2012.9388%2013.5899C12.3012%2014.1474%2011.9073%2014.601%2011.6993%2015.0468C11.5282%2015.3888%2011.441%2015.7775%2011.441%2016.1954V16.4772C11.441%2016.6153%2011.5529%2016.7272%2011.691%2016.7272H12.2956C12.4336%2016.7272%2012.5456%2016.6153%2012.5456%2016.4772V16.1954C12.5456%2015.8413%2012.6327%2015.5237%2012.8133%2015.2141C12.9486%2014.9841%2013.1223%2014.8038%2013.4251%2014.5389C14.0321%2013.9897%2014.3689%2013.6625%2014.5198%2013.4705C14.8821%2012.9923%2015.0671%2012.4446%2015.0671%2011.8454C15.0671%2011.0185%2014.8075%2010.355%2014.288%209.86441ZM11.7046%2017.8181C11.5666%2017.8181%2011.4546%2017.93%2011.4546%2018.0681V18.659C11.4546%2018.7971%2011.5666%2018.909%2011.7046%2018.909H12.2956C12.4336%2018.909%2012.5456%2018.7971%2012.5456%2018.659V18.0681C12.5456%2017.93%2012.4336%2017.8181%2012.2956%2017.8181H11.7046Z'%20fill='white'/%3e%3c/svg%3e",Kre={class:"p-8"},Zre={class:"flex-between"},Jre={class:"flex align-center"},Qre={class:"line-height-22 mt-4"},eoe={class:"flex-between"},toe={class:"flex align-center"},noe={class:"line-height-22 mt-4"},roe={class:"flex-between"},ooe={class:"flex align-center"},ioe={class:"line-height-22 mt-4"},aoe={class:"flex-between"},loe={class:"flex align-center"},soe={class:"line-height-22 mt-4"},uoe={class:"flex-between"},coe={class:"flex align-center"},doe={class:"line-height-22 mt-4"},foe={class:"dialog-footer"},poe=gr({__name:"FileUploadSettingDialog",props:{nodeModel:{}},emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=t,i=Ge(!1),a=Ge(!1),s=Ge(""),l=Ge(!1),f=Ge(),h=Ge(),v=["TXT","MD","DOCX","HTML","CSV","XLSX","XLS","PDF"],_=["JPG","JPEG","PNG","GIF"],E=["MP3","WAV","OGG","ACC","M4A"],O=["MP4","AVI","MKV","MOV","FLV","WMV"],w=Ge({maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["PPT","DOC"]});function S($){i.value=!0,up(()=>{w.value={...w.value,...$}})}function M(){i.value=!1}const T=$=>{w.value.otherExtensions=w.value.otherExtensions.filter(I=>I!==$)},B=()=>{a.value=!0,up(()=>{h.value.input.focus()})},R=()=>{if(s.value){if(s.value=s.value.toUpperCase(),w.value.otherExtensions.includes(s.value)||v.includes(s.value)||_.includes(s.value)||E.includes(s.value)){a.value=!1,s.value="",p9(Pt("common.fileUpload.existingExtensionsTip"));return}w.value.otherExtensions.push(s.value)}a.value=!1,s.value=""};async function P(){const $=f.value;$&&await $.validate().then(()=>{const I=Me.cloneDeep(w.value);o("refresh",I),r.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig"),i.value=!1})}return e({open:S}),($,I)=>{const F=te("el-slider"),U=te("el-form-item"),z=te("el-text"),X=te("el-checkbox"),Y=te("el-card"),W=te("el-tag"),Q=te("el-input"),J=te("el-button"),ie=te("el-space"),Se=te("el-form"),Ae=te("el-scrollbar"),Pe=te("el-dialog");return Te(),bt(Pe,{title:$.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.title"),modelValue:i.value,"onUpdate:modelValue":I[19]||(I[19]=De=>i.value=De),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":M,"append-to-body":"",width:"800","align-center":"",class:"scrollbar-dialog"},{footer:j(()=>[ee("span",foe,[k(J,{onClick:mn(M,["prevent"])},{default:j(()=>[ft(_e($.$t("common.cancel")),1)]),_:1}),k(J,{type:"primary",onClick:I[18]||(I[18]=De=>P()),loading:l.value},{default:j(()=>[ft(_e($.$t("common.confirm")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(Ae,{"max-height":"550"},{default:j(()=>[ee("div",Kre,[k(Se,{"label-position":"top",ref_key:"fieldFormRef",ref:f,model:w.value,"require-asterisk-position":"right"},{default:j(()=>[k(U,{label:$.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles")},{default:j(()=>[k(F,{modelValue:w.value.maxFiles,"onUpdate:modelValue":I[0]||(I[0]=De=>w.value.maxFiles=De),"show-input":"","show-input-controls":!1,min:1,max:100},null,8,["modelValue"])]),_:1},8,["label"]),k(U,{label:$.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit")},{default:j(()=>[k(F,{modelValue:w.value.fileLimit,"onUpdate:modelValue":I[1]||(I[1]=De=>w.value.fileLimit=De),"show-input":"","show-input-controls":!1,min:1,max:1e3},null,8,["modelValue"])]),_:1},8,["label"]),k(U,{label:$.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label")},{default:j(()=>[k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.document?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:I[4]||(I[4]=mn(De=>w.value.document=!w.value.document,["stop"]))},{default:j(()=>[ee("div",Zre,[ee("div",Jre,[I[20]||(I[20]=ee("img",{class:"mr-12",src:zre,alt:""},null,-1)),ee("div",null,[ee("p",Qre,[ft(_e($.$t("common.fileUpload.document"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText")),1)]),_:1})]),ee("p",null,_e(v.join("、")),1)])]),k(X,{modelValue:w.value.document,"onUpdate:modelValue":I[2]||(I[2]=De=>w.value.document=De),onChange:I[3]||(I[3]=De=>w.value.document=!w.value.document)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.image?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:I[7]||(I[7]=mn(De=>w.value.image=!w.value.image,["stop"]))},{default:j(()=>[ee("div",eoe,[ee("div",toe,[I[21]||(I[21]=ee("img",{class:"mr-12",src:Hre,alt:""},null,-1)),ee("div",null,[ee("p",noe,[ft(_e($.$t("common.fileUpload.image"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText")),1)]),_:1})]),ee("p",null,_e(_.join("、")),1)])]),k(X,{modelValue:w.value.image,"onUpdate:modelValue":I[5]||(I[5]=De=>w.value.image=De),onChange:I[6]||(I[6]=De=>w.value.image=!w.value.image)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.audio?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:I[10]||(I[10]=mn(De=>w.value.audio=!w.value.audio,["stop"]))},{default:j(()=>[ee("div",roe,[ee("div",ooe,[I[22]||(I[22]=ee("img",{class:"mr-12",src:Xre,alt:""},null,-1)),ee("div",null,[ee("p",ioe,[ft(_e($.$t("common.fileUpload.audio"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText")),1)]),_:1})]),ee("p",null,_e(E.join("、")),1)])]),k(X,{modelValue:w.value.audio,"onUpdate:modelValue":I[8]||(I[8]=De=>w.value.audio=De),onChange:I[9]||(I[9]=De=>w.value.audio=!w.value.audio)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.video?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:I[13]||(I[13]=mn(De=>w.value.video=!w.value.video,["stop"]))},{default:j(()=>[ee("div",aoe,[ee("div",loe,[I[23]||(I[23]=ee("img",{class:"mr-12",width:"32",src:Yre,alt:""},null,-1)),ee("div",null,[ee("p",soe,[ft(_e($.$t("common.fileUpload.video"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText")),1)]),_:1})]),ee("p",null,_e(O.join("、")),1)])]),k(X,{modelValue:w.value.video,"onUpdate:modelValue":I[11]||(I[11]=De=>w.value.video=De),onChange:I[12]||(I[12]=De=>w.value.video=!w.value.video)},null,8,["modelValue"])])]),_:1},8,["class"]),k(Y,{shadow:"hover",class:Gs(["card-checkbox cursor w-full mb-8",w.value.other?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:I[17]||(I[17]=mn(De=>w.value.other=!w.value.other,["stop"]))},{default:j(()=>[ee("div",uoe,[ee("div",coe,[I[24]||(I[24]=ee("img",{class:"mr-12",width:32,src:qre,alt:""},null,-1)),ee("div",null,[ee("p",doe,[ft(_e($.$t("common.fileUpload.other"))+" ",1),k(z,{class:"color-secondary"},{default:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText")),1)]),_:1})]),k(ie,{wrap:"",size:2,class:"mt-4"},{default:j(()=>[(Te(!0),cn(Ir,null,No(w.value.otherExtensions,De=>(Te(),bt(W,{key:De,closable:"","disable-transitions":!1,onClose:He=>T(De),type:"info",class:"mr-4",effect:"plain",style:{"--el-tag-border-radius":"4px","--el-tag-border-color":"var(--el-border-color)"}},{default:j(()=>[ft(_e(De),1)]),_:2},1032,["onClose"]))),128)),a.value?(Te(),bt(Q,{key:0,ref_key:"InputRef",ref:h,modelValue:s.value,"onUpdate:modelValue":I[14]||(I[14]=De=>s.value=De),size:"small",onKeyup:dA(R,["enter"]),onBlur:R},null,8,["modelValue"])):(Te(),bt(J,{key:1,class:"button-new-tag",size:"small",onClick:mn(B,["stop"])},{default:j(()=>[ft(" + "+_e($.$t("common.fileUpload.addExtensions")),1)]),_:1}))]),_:1})])]),k(X,{modelValue:w.value.other,"onUpdate:modelValue":I[15]||(I[15]=De=>w.value.other=De),onChange:I[16]||(I[16]=De=>w.value.other=!w.value.other)},null,8,["modelValue"])])]),_:1},8,["class"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1})]),_:1},8,["title","modelValue"])}}}),hoe={class:"dialog-footer"},voe=gr({__name:"ChatFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge(!1),s=Ge(null),l=Ge({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=Ge(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},_=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:_}),(O,w)=>{const S=te("el-input"),M=te("el-form-item"),T=te("el-form"),B=te("el-button"),R=te("el-dialog");return Te(),bt(R,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":_,"append-to-body":""},{footer:j(()=>[ee("span",hoe,[k(B,{onClick:mn(_,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(B,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),goe={class:"flex-between mb-16"},moe={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},yoe={class:"ml-4"},_oe=["title"],boe=["title"],woe={class:"mr-4"},Eoe=gr({__name:"ChatFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(),r=Ge([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1),e.nodeModel.graphModel.eventCenter.emit("chatFieldList")}function s(l,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===l.field&&f!==h){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close(),e.nodeModel.graphModel.eventCenter.emit("chatFieldList")}return yo(()=>{e.nodeModel.properties.chat_input_field_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.chat_input_field_list)),Me.set(e.nodeModel.properties,"chat_input_field_list",r)}),(l,f)=>{var w;const h=te("AppIcon"),v=te("el-button"),_=te("el-table-column"),E=te("el-tooltip"),O=te("el-table");return Te(),cn(Ir,null,[ee("div",goe,[ee("h5",moe,_e(l.$t("views.applicationWorkflow.variable.chat")),1),ee("div",null,[ee("span",yoe,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(l.$t("common.add")),1)]),_:1})])])]),((w=e.nodeModel.properties.chat_input_field_list)==null?void 0:w.length)>0?(Te(),bt(O,{key:0,data:e.nodeModel.properties.chat_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(_,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,_oe)]),_:1},8,["label"]),k(_,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",null,[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,boe)])]),_:1},8,["label"]),k(_,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",woe,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:mn(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0),k(voe,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),xoe={class:"flex-between"},Ooe={class:"flex align-center"},Soe={class:"mr-4"},Aoe={class:"flex-between"},Moe={class:"mr-4"},Toe={class:"flex"},Coe={class:"flex-between"},Noe={class:"mr-4"},koe={class:"flex"},Poe={class:"w-full"},Roe={class:"flex-between w-full"},Doe=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(null),l=Ge(),f=Ge(),h=Ge(),v=Ge(),_={name:"",desc:"",prologue:Pt("views.application.form.defaultPrologue")},E=W=>W.ctrlKey===!0?(W.preventDefault(),!0):(W.stopPropagation(),!0);function O(W){Me.set(i.nodeModel.properties.node_data,"prologue",W)}const w=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",_),i.nodeModel.properties.node_data),set:W=>{Me.set(i.nodeModel.properties,"node_data",W)}}),S=Ge(),M=()=>{var W;return w.value.tts_model_enable&&!w.value.tts_model_id&&w.value.tts_type==="TTS"?Promise.reject({node:i.nodeModel,errMessage:Pt("views.application.form.voicePlay.requiredMessage")}):w.value.stt_model_enable&&!w.value.stt_model_id?Promise.reject({node:i.nodeModel,errMessage:Pt("views.application.form.voiceInput.requiredMessage")}):(W=S.value)==null?void 0:W.validate().catch(Q=>Promise.reject({node:i.nodeModel,errMessage:Q}))},T=e();function B(){var Q;const W=r.value==="systemManage"?{model_type:"STT",workspace_id:(Q=T.value)==null?void 0:Q.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList(W).then(J=>{a.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function R(){var Q;const W=r.value==="systemManage"?{model_type:"TTS",workspace_id:(Q=T.value)==null?void 0:Q.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(W).then(J=>{s.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function P(){up(()=>{var W;w.value.tts_model_id?(W=l.value)==null||W.reset_default(w.value.tts_model_id,o):U({})})}function $(){w.value.tts_model_enable||(w.value.tts_model_id="",w.value.tts_type="BROWSER")}function I(){w.value.stt_model_enable||(w.value.stt_model_id="")}const F=()=>{var Q;const W=w.value.tts_model_id;if(!W){Sh(Pt("views.application.form.voicePlay.requiredMessage"));return}(Q=l.value)==null||Q.open(W,o,w.value.tts_model_params_setting)},U=W=>{w.value.tts_model_params_setting=W},z=()=>{const W={maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["ppt","doc"]};w.value.file_upload_enable&&(w.value.file_upload_setting=w.value.file_upload_setting||W),i.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig")},X=()=>{var W;(W=v.value)==null||W.open(w.value.file_upload_setting)},Y=W=>{w.value.file_upload_setting=W};return yo(()=>{Me.set(i.nodeModel,"validate",M),i.nodeModel.properties.node_data.tts_type||Me.set(i.nodeModel.properties.node_data,"tts_type","BROWSER"),R(),B()}),(W,Q)=>{const J=te("el-input"),ie=te("el-form-item"),Se=te("MdEditorMagnify"),Ae=te("AppIcon"),Pe=te("el-tooltip"),De=te("el-button"),He=te("el-switch"),Ye=te("el-checkbox"),Be=te("ModelSelect"),Je=te("el-radio"),mt=te("el-radio-group"),le=te("Operation"),Ze=te("el-icon"),pe=te("el-form");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(pe,{onSubmit:Q[13]||(Q[13]=mn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right",class:"mb-24","label-width":"auto",ref_key:"baseNodeFormRef",ref:S},{default:j(()=>[k(ie,{label:W.$t("views.applicationWorkflow.nodes.baseNode.appName.label"),prop:"name",rules:{message:Wn(Pt)("views.application.form.appName.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(J,{modelValue:w.value.name,"onUpdate:modelValue":Q[0]||(Q[0]=se=>w.value.name=se),maxlength:"64",placeholder:Wn(Pt)("views.application.form.appName.placeholder"),"show-word-limit":"",onBlur:Q[1]||(Q[1]=se=>{var we;return w.value.name=(we=w.value.name)==null?void 0:we.trim()})},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(ie,{label:W.$t("views.applicationWorkflow.nodes.baseNode.appDescription.label")},{default:j(()=>[k(J,{modelValue:w.value.desc,"onUpdate:modelValue":Q[2]||(Q[2]=se=>w.value.desc=se),placeholder:W.$t("views.application.form.appDescription.placeholder"),rows:3,type:"textarea",maxlength:"256","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(ie,{label:W.$t("views.application.form.prologue")},{default:j(()=>[k(Se,{onWheel:E,title:W.$t("views.application.form.prologue"),modelValue:w.value.prologue,"onUpdate:modelValue":Q[3]||(Q[3]=se=>w.value.prologue=se),style:{height:"150px"},onSubmitDialog:O},null,8,["title","modelValue"])]),_:1},8,["label"]),k(ie,null,{label:j(()=>[ee("div",xoe,[ee("div",Ooe,[ee("span",Soe,_e(W.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.label")),1),k(Pe,{effect:"dark",content:W.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.tooltip"),placement:"right"},{default:j(()=>[k(Ae,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])]),ee("div",null,[w.value.file_upload_enable?(Te(),bt(De,{key:0,type:"primary",link:"",onClick:X,class:"mr-4"},{default:j(()=>[k(Ae,{iconName:"app-setting",class:"mr-4"})]),_:1})):In("",!0),k(He,{size:"small",modelValue:w.value.file_upload_enable,"onUpdate:modelValue":Q[4]||(Q[4]=se=>w.value.file_upload_enable=se),onChange:z},null,8,["modelValue"])])])]),_:1}),k(Gre,{ref_key:"UserInputFieldTableFef",ref:f,"node-model":t.nodeModel},null,8,["node-model"]),k(Cre,{ref_key:"ApiInputFieldTableFef",ref:h,"node-model":t.nodeModel},null,8,["node-model"]),k(Eoe,{ref:"ChatFieldTeble","node-model":t.nodeModel},null,8,["node-model"]),k(ie,null,{label:j(()=>[ee("div",Aoe,[ee("span",Moe,_e(W.$t("views.application.form.voiceInput.label")),1),ee("div",Toe,[w.value.stt_model_enable?(Te(),bt(Ye,{key:0,modelValue:w.value.stt_autosend,"onUpdate:modelValue":Q[5]||(Q[5]=se=>w.value.stt_autosend=se)},{default:j(()=>[ft(_e(W.$t("views.application.form.voiceInput.autoSend")),1)]),_:1},8,["modelValue"])):In("",!0),k(He,{class:"ml-8",size:"small",modelValue:w.value.stt_model_enable,"onUpdate:modelValue":Q[6]||(Q[6]=se=>w.value.stt_model_enable=se),onChange:I},null,8,["modelValue"])])])]),default:j(()=>[Ql(k(Be,{onWheel:E,modelValue:w.value.stt_model_id,"onUpdate:modelValue":Q[7]||(Q[7]=se=>w.value.stt_model_id=se),placeholder:W.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"]),[[Oh,w.value.stt_model_enable]])]),_:1}),k(ie,null,{label:j(()=>[ee("div",Coe,[ee("span",Noe,_e(W.$t("views.application.form.voicePlay.label")),1),ee("div",koe,[w.value.tts_model_enable?(Te(),bt(Ye,{key:0,modelValue:w.value.tts_autoplay,"onUpdate:modelValue":Q[8]||(Q[8]=se=>w.value.tts_autoplay=se)},{default:j(()=>[ft(_e(W.$t("views.application.form.voicePlay.autoPlay")),1)]),_:1},8,["modelValue"])):In("",!0),k(He,{class:"ml-8",size:"small",modelValue:w.value.tts_model_enable,"onUpdate:modelValue":Q[9]||(Q[9]=se=>w.value.tts_model_enable=se),onChange:$},null,8,["modelValue"])])])]),default:j(()=>[ee("div",Poe,[Ql(k(mt,{modelValue:w.value.tts_type,"onUpdate:modelValue":Q[10]||(Q[10]=se=>w.value.tts_type=se)},{default:j(()=>[k(Je,{label:W.$t("views.application.form.voicePlay.browser"),value:"BROWSER"},null,8,["label"]),k(Je,{label:W.$t("views.application.form.voicePlay.tts"),value:"TTS"},null,8,["label"])]),_:1},8,["modelValue"]),[[Oh,w.value.tts_model_enable]])]),ee("div",Roe,[w.value.tts_type==="TTS"&&w.value.tts_model_enable?(Te(),bt(Be,{key:0,onWheel:E,modelValue:w.value.tts_model_id,"onUpdate:modelValue":Q[11]||(Q[11]=se=>w.value.tts_model_id=se),placeholder:W.$t("views.application.form.voicePlay.placeholder"),options:s.value,onChange:Q[12]||(Q[12]=se=>P()),showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])):In("",!0),w.value.tts_type==="TTS"&&w.value.tts_model_enable?(Te(),bt(De,{key:1,onClick:F,disabled:!w.value.tts_model_id,class:"ml-8"},{default:j(()=>[k(Ze,null,{default:j(()=>[k(Ze,null,{default:j(()=>[k(le)]),_:1})]),_:1})]),_:1},8,["disabled"])):In("",!0)])]),_:1})]),_:1},8,["model"]),k(Bj,{ref_key:"TTSModeParamSettingDialogRef",ref:l,onRefresh:U},null,512),k(poe,{ref_key:"FileUploadSettingDialogRef",ref:v,"node-model":t.nodeModel,onRefresh:Y},null,8,["node-model"])]),_:1},8,["nodeModel"])}}}),joe=fp(Doe,[["__scopeId","data-v-940d4dcd"]]);class Loe extends ai{constructor(e){super(e,joe)}}class Ioe extends li{constructor(e,n){super(e,n)}get_width(){return 600}}const Foe={type:"base-node",model:Ioe,view:Loe},b8=Object.freeze(Object.defineProperty({__proto__:null,default:Foe},Symbol.toStringTag,{value:"Module"})),Boe={class:"handle flex-between lighter"},$oe={class:"flex align-center"},Uoe={key:0,class:"info"},Voe={key:0,class:"mt-8"},Woe=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={branch:[{conditions:[{field:[],compare:"",value:""}],id:yu(),type:"IF",condition:"and"},{conditions:[],id:yu(),type:"ELSE",condition:"and"}]},o=w=>w.ctrlKey===!0?(w.preventDefault(),!0):(w.stopPropagation(),!0),r=(w,S,M)=>{const B=Me.cloneDeep(e.nodeModel.properties.branch_condition_list?e.nodeModel.properties.branch_condition_list:[]).map(R=>R.id===S.id?{...R,height:w.height,index:M}:R);Me.set(e.nodeModel.properties,"branch_condition_list",B),v(e.nodeModel.properties.node_data.branch,!0)},i=fr({get:()=>(e.nodeModel.properties.node_data||(Me.set(e.nodeModel.properties,"node_data",n),v(n.branch,!0)),e.nodeModel.properties.node_data),set:w=>{Me.set(e.nodeModel.properties,"node_data",w)}}),a=Ge(),s=Ge(),l=()=>{var S;const w=[(S=a.value)==null?void 0:S.validate(),...s.value.map(M=>M.validate())];return Promise.all(w).catch(M=>Promise.reject({node:e.nodeModel,errMessage:M}))};function f(w){const{oldIndex:S,newIndex:M}=w;if(S===void 0||M===void 0)return;const T=Me.cloneDeep(e.nodeModel.properties.node_data.branch);if(S===T.length-1||M===T.length-1)return;const B={...T[S],type:T[M].type,id:T[M].id},R={...T[M],type:T[S].type,id:T[S].id};T[M]=B,T[S]=R,Me.set(e.nodeModel.properties.node_data,"branch",T)}function h(){const w=Me.cloneDeep(e.nodeModel.properties.node_data.branch),S={conditions:[{field:[],compare:"",value:""}],type:"ELSE IF "+(w.length-1),id:yu(),condition:"and"};w.splice(w.length-1,0,S),v(w,!0),Me.set(e.nodeModel.properties.node_data,"branch",w)}function v(w,S){const M=Me.cloneDeep(e.nodeModel.properties.branch_condition_list?e.nodeModel.properties.branch_condition_list:[]),T=w.map((B,R)=>{const P=M.find($=>$.id===B.id);if(P)return{index:R,height:P.height,id:B.id};if(S)return{index:R,height:12,id:B.id}}).filter(B=>B);Me.set(e.nodeModel.properties,"branch_condition_list",T),e.nodeModel.refreshBranch()}function _(w){const S=Me.cloneDeep(e.nodeModel.properties.node_data.branch);S[w].conditions.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"branch",S)}function E(w,S){const M=Me.cloneDeep(e.nodeModel.properties.node_data.branch);if(M[w].conditions.splice(S,1),M[w].conditions.length===0){const B=M.splice(w,1).map(R=>e.nodeModel.id+"_"+R.id+"_right");e.nodeModel.graphModel.eventCenter.emit("delete_edge",e.nodeModel.outgoing.edges.filter(R=>B.includes(R.sourceAnchorId)).map(R=>R.id)),v(M,!1),M.forEach((R,P)=>{R.type==="ELSE IF "+(P+1)&&(R.type="ELSE IF "+P)})}Me.set(e.nodeModel.properties.node_data,"branch",M)}function O(w,S,M){if(["is_null","is_not_null","is_true","is_not_true"].includes(w)){const T=Me.cloneDeep(e.nodeModel.properties.node_data.branch);T[S].conditions[M].value=1,Me.set(e.nodeModel.properties.node_data,"branch",T)}}return yo(()=>{Me.set(e.nodeModel,"validate",l)}),(w,S)=>{const M=te("el-option"),T=te("el-select"),B=te("el-form-item"),R=te("el-col"),P=te("el-input"),$=te("AppIcon"),I=te("el-button"),F=te("el-row"),U=te("el-card"),z=te("el-form"),X=Rm("resize");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(z,{model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ConditionNodeFormRef",ref:a,onSubmit:S[0]||(S[0]=mn(()=>{},["prevent"]))},{default:j(()=>[k(Wn(Yj),{ref:"el",modelValue:i.value.branch,disabled:i.value.branch.length===2,handle:".handle",animation:150,ghostClass:"ghost",onEnd:f},{default:j(()=>[(Te(!0),cn(Ir,null,No(i.value.branch,(Y,W)=>Ql((Te(),bt(U,{key:Y.id,shadow:"never",class:Gs(["drag-card card-never mb-8",{"no-drag":W===i.value.branch.length-1||i.value.branch.length===2}]),style:{"--el-card-padding":"12px"}},{default:j(()=>[ee("div",Boe,[ee("span",$oe,[S[1]||(S[1]=ee("img",{src:qj,alt:"",height:"15",class:"handle-img mr-4"},null,-1)),ft(" "+_e(Y.type),1)]),Y.conditions.length>1?(Te(),cn("div",Uoe,[ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(T,{teleported:!1,modelValue:Y.condition,"onUpdate:modelValue":Q=>Y.condition=Q,size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(M,{label:w.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(M,{label:w.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"]),ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):In("",!0)]),W!==i.value.branch.length-1?(Te(),cn("div",Voe,[(Te(!0),cn(Ir,null,No(Y.conditions,(Q,J)=>(Te(),bt(F,{key:J,gutter:8},{default:j(()=>[k(R,{span:11},{default:j(()=>[k(B,{prop:"branch."+W+".conditions."+J+".field",rules:{type:"array",required:!0,message:w.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:s,nodeModel:t.nodeModel,class:"w-full",placeholder:w.$t("views.applicationWorkflow.variable.placeholder"),modelValue:Q.field,"onUpdate:modelValue":ie=>Q.field=ie},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(R,{span:6},{default:j(()=>[k(B,{prop:"branch."+W+".conditions."+J+".compare",rules:{required:!0,message:w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(T,{onWheel:o,teleported:!1,modelValue:Q.compare,"onUpdate:modelValue":ie=>Q.compare=ie,placeholder:w.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:"",onChange:ie=>O(ie,W,J)},{default:j(()=>[(Te(!0),cn(Ir,null,No(Wn(V2),(ie,Se)=>(Te(),bt(M,{key:Se,label:ie.label,value:ie.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","onChange"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(R,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(Q.compare)?In("",!0):(Te(),bt(B,{key:0,prop:"branch."+W+".conditions."+J+".value",rules:{required:!0,message:w.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(P,{modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:w.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(R,{span:1},{default:j(()=>[k(I,{disabled:i.value.branch.length===2&&Y.conditions.length===1,link:"",type:"info",class:"mt-4",onClick:ie=>E(W,J)},{default:j(()=>[k($,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024))),128))])):In("",!0),W!==i.value.branch.length-1?(Te(),bt(I,{key:1,link:"",type:"primary",onClick:Q=>_(W)},{default:j(()=>[k($,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1},8,["onClick"])):In("",!0)]),_:2},1032,["class"])),[[X,Q=>r(Q,Y,W)]])),128))]),_:1},8,["modelValue","disabled"]),k(I,{link:"",type:"primary",onClick:h},{default:j(()=>[k($,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("views.applicationWorkflow.nodes.conditionNode.addBranch")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Goe extends ai{constructor(e){super(e,Woe)}}const zoe=(t,e)=>t.filter((n,o)=>o<e).map(n=>n.height+8).reduce((n,o)=>n+o,0);class Hoe extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i,properties:{branch_condition_list:a}}=this;this.height===void 0&&(this.height=200);const s=this.properties.showNode===void 0?!0:this.properties.showNode,l=[];l.push({x:n-r/2+10,y:s?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"});const f=Array.isArray(a)?a:[];if(f.length>0)for(let h=0;h<f.length;h++){const v=f[h],_=zoe(f,h);l.push({x:n+r/2-10,y:s?o-i/2+75+_+(v.height||0)/2:o-15,id:`${e}_${v.id}_right`,type:"right"})}return l}}const Xoe={type:"condition-node",model:Hoe,view:Goe},w8=Object.freeze(Object.defineProperty({__proto__:null,default:Xoe},Symbol.toStringTag,{value:"Module"})),Yoe={class:"title-decoration-1 mb-8"},qoe=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={document_list:["start-node","document"]},o=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:r=>{Me.set(e.nodeModel.properties,"node_data",r)}});return(r,i)=>{const a=te("el-form-item"),s=te("el-form"),l=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Yoe,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),k(l,{shadow:"never",class:"card-never"},{default:j(()=>[k(s,{onSubmit:i[1]||(i[1]=mn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto"},{default:j(()=>[k(a,{label:r.$t("views.problem.relateParagraph.selectDocument"),rules:{type:"array",required:!0,message:r.$t("views.chatLog.documentPlaceholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:r.$t("views.chatLog.documentPlaceholder"),modelValue:o.value.document_list,"onUpdate:modelValue":i[0]||(i[0]=f=>o.value.document_list=f)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});let Koe=class extends ai{constructor(e){super(e,qoe)}};const Zoe={type:"document-extract-node",model:li,view:Koe},E8=Object.freeze(Object.defineProperty({__proto__:null,default:Zoe},Symbol.toStringTag,{value:"Module"})),Joe={class:"dialog-footer"},Qoe=gr({__name:"AddFormCollect",props:{title:{default:Pt("common.param.addParam")},addFormField:{}},emits:["submit"],setup(t,{expose:e,emit:n}){const o=t,r=Ge(!1),i=Ge(),a=Ge({}),s=Ge(!1),l=()=>{r.value=!0},f=()=>{r.value=!1,a.value={}},h=()=>{var v;(v=i.value)==null||v.validate().then(()=>{var _;o.addFormField((_=i.value)==null?void 0:_.getData()),f()})};return e({close:f,open:l}),(v,_)=>{const E=te("el-button"),O=te("el-dialog");return Te(),bt(O,{title:t.title,modelValue:r.value,"onUpdate:modelValue":_[3]||(_[3]=w=>r.value=w),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":f,"append-to-body":""},{footer:j(()=>[ee("span",Joe,[k(E,{onClick:_[1]||(_[1]=mn(w=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),k(E,{type:"primary",onClick:_[2]||(_[2]=w=>h()),loading:s.value},{default:j(()=>[ft(_e(v.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[_[4]||(_[4]=ft("l ",-1)),k(F2,{modelValue:a.value,"onUpdate:modelValue":_[0]||(_[0]=w=>a.value=w),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),eie={class:"dialog-footer"},tie=gr({__name:"EditFormCollect",props:{title:{default:Pt("common.param.editParam")},editFormField:{}},emits:["submit"],setup(t,{expose:e,emit:n}){const o=t,r=Ge(!1),i=Ge(),a=Ge({}),s=Ge(0),l=Ge(!1),f=(_,E)=>{r.value=!0,a.value=_,s.value=E},h=()=>{r.value=!1,a.value={}},v=()=>{var _;(_=i.value)==null||_.validate().then(()=>{var E;o.editFormField((E=i.value)==null?void 0:E.getData(),s.value),h()})};return e({close:h,open:f}),(_,E)=>{const O=te("el-button"),w=te("el-dialog");return Te(),bt(w,{title:t.title,modelValue:r.value,"onUpdate:modelValue":E[3]||(E[3]=S=>r.value=S),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",eie,[k(O,{onClick:E[1]||(E[1]=mn(S=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(_.$t("common.cancel")),1)]),_:1}),k(O,{type:"primary",onClick:E[2]||(E[2]=S=>v()),loading:l.value},{default:j(()=>[ft(_e(_.$t("common.modify")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(F2,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=S=>a.value=S),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),nie={class:"title-decoration-1 mb-8"},rie={class:"flex align-center"},oie={class:"mr-4"},iie={class:"flex-between"},aie={class:"lighter"},lie=["title"],sie={key:0},uie=["title"],cie={key:1},die=["title"],fie=["title"],pie={class:"mr-4"},hie=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t;O_("getModel",()=>e.nodeModel);const n=Ge(),o=Ge(),r=(T,B)=>{const R=E.value.form_field_list.map((P,$)=>B===$?Me.cloneDeep(T):Me.cloneDeep(P));E.value.form_field_list=R,a()},i=T=>{if(E.value.form_field_list.some(B=>B.field===T.field)){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+T.field);return}E.value.form_field_list=Me.cloneDeep([...E.value.form_field_list,T]),a()},a=()=>{const T=[{label:Pt("views.applicationWorkflow.nodes.formNode.formAllContent"),value:"form_data"},...E.value.form_field_list.map(B=>({value:B.field,label:typeof B.label=="string"?B.label:B.label.label}))];Me.set(e.nodeModel.properties.config,"fields",T),e.nodeModel.clear_next_node_field(!1),M()},s=Ge(),l=Ge(),f=()=>{var T;(T=s.value)==null||T.open()},h=(T,B)=>{var R;(R=l.value)==null||R.open(Me.cloneDeep(T),B)},v=T=>{E.value.form_field_list=E.value.form_field_list.filter(B=>B.field!==T.field),a()},_=Ge({is_result:!0,form_content_format:`${Pt("views.applicationWorkflow.nodes.formNode.form_content_format1")}
|
||
{{form}}
|
||
${Pt("views.applicationWorkflow.nodes.formNode.form_content_format2")}`,form_field_list:[]}),E=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",_.value),e.nodeModel.properties.node_data),set:T=>{Me.set(e.nodeModel.properties,"node_data",T)}}),O=T=>{var B;if(T.default_value){const R=(B=T.option_list)==null?void 0:B.filter(P=>T.default_value.indexOf(P.value)>-1).map(P=>P.label).join(",");return R||T.default_value}if(T.default_value!==void 0)return T.default_value},w=()=>{var T;return(T=n.value)==null?void 0:T.validate()};function S(T){Me.set(e.nodeModel.properties.node_data,"form_content_format",T)}function M(){if(!o.value)return;const B=o.value.$el.querySelector(".el-table__body-wrapper tbody");B&&Zr.create(B,{animation:150,ghostClass:"ghost-row",onEnd:R=>{if(R.oldIndex===void 0||R.newIndex===void 0)return;const P=Me.cloneDeep([...E.value.form_field_list]),[$]=P.splice(R.oldIndex,1);P.splice(R.newIndex,0,$),E.value.form_field_list=P,a()}})}return yo(()=>{Me.set(e.nodeModel,"validate",w),a(),e.nodeModel.graphModel.eventCenter.emit("refresh_incoming_node_field")}),(T,B)=>{const R=te("AppIcon"),P=te("el-tooltip"),$=te("MdEditorMagnify"),I=te("el-form-item"),F=te("el-button"),U=te("el-table-column"),z=te("el-tag"),X=te("el-switch"),Y=te("el-table"),W=te("el-form"),Q=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",nie,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(W,{onSubmit:B[4]||(B[4]=mn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"formNodeFormRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:T.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),prop:"form_content_format",rules:{required:!0,message:T.$t("views.applicationWorkflow.nodes.formNode.formContent.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",rie,[ee("div",oie,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.formNode.formContent.label")),1),B[5]||(B[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(P,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(T.$t("views.applicationWorkflow.nodes.formNode.formContent.tooltip",{form:"{ form }"})),1)]),default:j(()=>[k(R,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k($,{title:T.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),modelValue:E.value.form_content_format,"onUpdate:modelValue":B[0]||(B[0]=J=>E.value.form_content_format=J),style:{height:"150px"},onSubmitDialog:S},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(I,{label:T.$t("views.applicationWorkflow.nodes.formNode.formSetting"),onClick:B[3]||(B[3]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",iie,[ee("h5",aie,_e(T.$t("views.applicationWorkflow.nodes.formNode.formSetting")),1),k(F,{link:"",type:"primary",onClick:B[1]||(B[1]=J=>f())},{default:j(()=>[k(R,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(T.$t("common.add")),1)]),_:1})])]),default:j(()=>[E.value.form_field_list.length>0?(Te(),bt(Y,{key:0,class:"border",data:E.value.form_field_list,ref_key:"tableRef",ref:o,"row-key":"field"},{default:j(()=>[k(U,{prop:"field",label:T.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:J})=>[ee("span",{title:J.field,class:"ellipsis-1"},_e(J.field),9,lie)]),_:1},8,["label"]),k(U,{prop:"label",label:T.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:J})=>[J.label&&J.label.input_type==="TooltipLabel"?(Te(),cn("span",sie,[ee("span",{title:J.label.label,class:"ellipsis-1"},_e(J.label.label),9,uie)])):(Te(),cn("span",cie,[ee("span",{title:J.label,class:"ellipsis-1"},_e(J.label),9,die)]))]),_:1},8,["label"]),k(U,{label:T.$t("dynamicsForm.paramForm.input_type.label"),width:"110px"},{default:j(({row:J})=>[k(z,{type:"info",class:"info-tag"},{default:j(()=>{var ie;return[ft(_e((ie=Wn(h9).find(Se=>Se.value===J.input_type))==null?void 0:ie.label),1)]}),_:2},1024)]),_:1},8,["label"]),k(U,{prop:"default_value",label:T.$t("dynamicsForm.default.label")},{default:j(({row:J})=>[ee("span",{title:J.default_value,class:"ellipsis-1"},_e(O(J)),9,fie)]),_:1},8,["label"]),k(U,{label:T.$t("common.required"),width:"55"},{default:j(({row:J})=>[ee("div",{onClick:B[2]||(B[2]=mn(()=>{},["stop"]))},[k(X,{disabled:"",size:"small",modelValue:J.required,"onUpdate:modelValue":ie=>J.required=ie},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),k(U,{label:T.$t("common.operation"),align:"left",width:"80"},{default:j(({row:J,$index:ie})=>[ee("span",pie,[k(P,{effect:"dark",content:T.$t("common.modify"),placement:"top"},{default:j(()=>[k(F,{type:"primary",text:"",onClick:mn(Se=>h(J,ie),["stop"])},{default:j(()=>[k(R,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(P,{effect:"dark",content:T.$t("common.delete"),placement:"top"},{default:j(()=>[k(F,{type:"primary",text:"",onClick:Se=>v(J)},{default:j(()=>[k(R,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Qoe,{ref_key:"addFormCollectRef",ref:s,addFormField:i},null,512),k(tie,{ref_key:"editFormCollectRef",ref:l,editFormField:r},null,512)]),_:1},8,["nodeModel"])}}});class vie extends ai{constructor(e){super(e,hie)}getConfig(e){return e.model.properties.config}}const gie={type:"form-node",model:li,view:vie},x8=Object.freeze(Object.defineProperty({__proto__:null,default:gie},Symbol.toStringTag,{value:"Module"})),mie={class:"title-decoration-1 mb-8"},yie={class:"flex-between w-full"},_ie={class:"flex align-center"},bie={class:"mr-4"},wie={class:"flex align-center"},Eie={class:"mr-4"},xie={class:"flex align-center"},Oie={class:"mr-4"},Sie=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(),l=Ge(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch($=>Promise.reject({node:i.nodeModel,errMessage:$}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),_={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,image_list:["start-node","image"]},E=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",_),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=e();function w(){var $;const P=r.value==="systemManage"?{model_type:"TTI",workspace_id:($=O.value)==null?void 0:$.workspace_id}:{model_type:"TTI"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(I=>{a.value=Me.groupBy(I==null?void 0:I.data,"provider")})}const S=()=>{up(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var $;P&&(($=s.value)==null||$.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function B(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function R(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return yo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,$)=>{const I=te("AppIcon"),F=te("el-button"),U=te("ModelSelect"),z=te("el-form-item"),X=te("el-tooltip"),Y=te("MdEditorMagnify"),W=te("el-switch"),Q=te("el-form"),J=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",mie,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:$[6]||($[6]=mn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",yie,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label")),1),$[7]||($[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(F,{disabled:!E.value.model_id,type:"primary",link:"",onClick:$[0]||($[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(U,{onChange:S,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":$[1]||($[1]=ie=>E.value.model_id=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),options:a.value,showFooter:"",onFocus:w,"model-type":"TTI"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",_ie,[ee("div",bie,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label")),1),$[8]||($[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":$[2]||($[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:B},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",wie,[ee("div",Eie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":$[3]||($[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:R},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[5]||($[5]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",xie,[ee("div",Oie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(W,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":$[4]||($[4]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});let Aie=class extends ai{constructor(e){super(e,Sie)}};const Mie={type:"image-generate-node",model:li,view:Aie},O8=Object.freeze(Object.defineProperty({__proto__:null,default:Mie},Symbol.toStringTag,{value:"Module"})),Tie={class:"title-decoration-1 mb-8"},Cie={class:"flex-between w-full"},Nie={class:"flex align-center"},kie={class:"mr-4"},Pie={class:"flex align-center"},Rie={class:"mr-4"},Die={class:"flex align-center"},jie={class:"mr-4"},Lie=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(),l=Ge(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch($=>Promise.reject({node:i.nodeModel,errMessage:$}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),_={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,first_frame_url:["start-node","image"],last_frame_url:[]},E=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",_),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=e();function w(){var $;const P=r.value==="systemManage"?{model_type:"ITV",workspace_id:($=O.value)==null?void 0:$.workspace_id}:{model_type:"ITV"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(I=>{a.value=Me.groupBy(I==null?void 0:I.data,"provider")})}const S=()=>{up(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var $;P&&(($=s.value)==null||$.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function B(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function R(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return yo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,$)=>{const I=te("AppIcon"),F=te("el-button"),U=te("ModelSelect"),z=te("el-form-item"),X=te("el-tooltip"),Y=te("MdEditorMagnify"),W=te("el-switch"),Q=te("el-form"),J=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Tie,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:$[8]||($[8]=mn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Cie,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label")),1),$[9]||($[9]=ee("span",{class:"color-danger"},"*",-1))])]),k(F,{disabled:!E.value.model_id,type:"primary",link:"",onClick:$[0]||($[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(U,{onChange:S,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":$[1]||($[1]=ie=>E.value.model_id=ie),onFocus:w,placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"ITV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Nie,[ee("div",kie,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label")),1),$[10]||($[10]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":$[2]||($[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:B},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Pie,[ee("div",Rie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":$[3]||($[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:R},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label"),rules:{type:"array",required:!0,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label")),1),$[11]||($[11]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),modelValue:E.value.first_frame_url,"onUpdate:modelValue":$[4]||($[4]=ie=>E.value.first_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label"),rules:{type:"array",required:!1,message:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label")),1)]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:P.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),clearable:"",modelValue:E.value.last_frame_url,"onUpdate:modelValue":$[5]||($[5]=ie=>E.value.last_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[7]||($[7]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Die,[ee("div",jie,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(W,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":$[6]||($[6]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});class Iie extends ai{constructor(e){super(e,Lie)}}const Fie={type:"image-to-video-node",model:li,view:Iie},S8=Object.freeze(Object.defineProperty({__proto__:null,default:Fie},Symbol.toStringTag,{value:"Module"})),Bie={class:"title-decoration-1 mb-8"},$ie={class:"flex-between w-full"},Uie={class:"flex-between"},Vie={class:"flex align-center"},Wie={class:"flex align-center"},Gie={class:"mr-4"},zie={class:"flex-between"},Hie={class:"flex align-center"},Xie={class:"mr-4"},Yie=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(),l=Ge(),f=Ge(),h=()=>{var F;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(F=l.value)==null?void 0:F.validate()]).catch(U=>Promise.reject({node:i.nodeModel,errMessage:U}))},v=F=>F.ctrlKey===!0?(F.preventDefault(),!0):(F.stopPropagation(),!0),E={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,image_list:["start-node","image"]},O=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",E),i.nodeModel.properties.node_data),set:F=>{Me.set(i.nodeModel.properties,"node_data",F)}}),w=e();function S(){var U;const F=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(U=w.value)==null?void 0:U.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(F).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(F){Me.set(i.nodeModel.properties.node_data,"system",F)}function T(F){Me.set(i.nodeModel.properties.node_data,"prompt",F)}const B=F=>{var U;F&&((U=s.value)==null||U.open(F,o,O.value.model_params_setting))};function R(F){Me.set(i.nodeModel.properties.node_data,"model_params_setting",F)}const P=Ge(),$=F=>{var U;F&&((U=P.value)==null||U.open(F,o))},I=F=>{Me.set(i.nodeModel.properties.node_data,"system",F)};return yo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(F,U)=>{const z=te("AppIcon"),X=te("el-button"),Y=te("ModelSelect"),W=te("el-form-item"),Q=te("el-tooltip"),J=te("MdEditorMagnify"),ie=te("el-option"),Se=te("el-select"),Ae=te("el-input-number"),Pe=te("el-switch"),De=te("el-form"),He=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Bie,_e(F.$t("views.applicationWorkflow.nodeSetting")),1),k(He,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:U[10]||(U[10]=mn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(W,{label:F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",$ie,[ee("div",null,[ee("span",null,[ft(_e(Wn(Pt)("views.applicationWorkflow.nodes.imageUnderstandNode.model.label")),1),U[11]||(U[11]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{disabled:!O.value.model_id,type:"primary",link:"",onClick:U[0]||(U[0]=Ye=>B(O.value.model_id)),onRefreshForm:R},{default:j(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Y,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":U[1]||(U[1]=Ye=>O.value.model_id=Ye),placeholder:F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",Uie,[ee("div",Vie,[ee("span",null,_e(F.$t("views.application.form.roleSettings.label")),1),k(Q,{effect:"dark",content:F.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(X,{type:"primary",link:"",onClick:U[2]||(U[2]=Ye=>$(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(J,{title:F.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":U[3]||(U[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(W,{label:F.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:F.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",Wie,[ee("div",Gie,[ee("span",null,[ft(_e(F.$t("views.application.form.prompt.label")),1),U[12]||(U[12]=ee("span",{class:"color-danger"},"*",-1))])]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(J,{onWheel:v,title:F.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":U[4]||(U[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:T,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",zie,[ee("div",null,_e(F.$t("views.application.form.historyRecord.label")),1),k(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":U[5]||(U[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[k(ie,{label:F.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(ie,{label:F.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":U[6]||(U[6]=Ye=>O.value.dialogue_number=Ye),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(W,{label:F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),rules:{type:"array",required:!0,message:F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label")),1),U[13]||(U[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:F.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:O.value.image_list,"onUpdate:modelValue":U[7]||(U[7]=Ye=>O.value.image_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(W,{label:F.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:U[9]||(U[9]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Hie,[ee("div",Xie,[ee("span",null,_e(F.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Pe,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":U[8]||(U[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:R},null,512),k(W2,{onReplace:I,ref_key:"GeneratePromptDialogRef",ref:P},null,512)]),_:1},8,["node-model"])}}});let qie=class extends ai{constructor(e){super(e,Yie)}};const Kie={type:"image-understand-node",model:li,view:qie},A8=Object.freeze(Object.defineProperty({__proto__:null,default:Kie},Symbol.toStringTag,{value:"Module"})),Zie={class:"title-decoration-1 mb-8"},Jie={class:"flex-between"},Qie={class:"flex-between"},eae={class:"flex-between"},tae=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Ge(),a=Ge();function s(){const $=Me.cloneDeep(S.nodeModel.properties.node_data.branch),I={id:yu(),content:"",isOther:!1};$.splice($.length-1,0,I),f($,!0),Me.set(S.nodeModel.properties.node_data,"branch",$),S.nodeModel.refreshBranch()}function l($){var W;const I=Me.cloneDeep(S.nodeModel.properties.node_data.branch),F=I.find(Q=>Q.id===$);if(!F||F.isOther||I.filter(Q=>!Q.isOther).length<=1)return;const z=`${S.nodeModel.id}_${$}_right`,X=(((W=S.nodeModel.outgoing)==null?void 0:W.edges)||[]).filter(Q=>Q.sourceAnchorId===z).map(Q=>Q.id);X.length>0&&S.nodeModel.graphModel.eventCenter.emit("delete_edge",X);const Y=I.filter(Q=>Q.id!==$);Me.set(S.nodeModel.properties.node_data,"branch",Y),f(Y,!1)}function f($,I){const F=Me.cloneDeep(S.nodeModel.properties.branch_condition_list?S.nodeModel.properties.branch_condition_list:[]),U=$.map((z,X)=>{const Y=F.find(W=>W.id===z.id);if(Y)return{index:X,height:Y.height,id:z.id};if(I)return{index:X,height:12,id:z.id}}).filter(z=>z);Me.set(S.nodeModel.properties,"branch_condition_list",U),S.nodeModel.refreshBranch()}const h=$=>$.ctrlKey===!0?($.preventDefault(),!0):($.stopPropagation(),!0),v=$=>{var I;$?(I=a.value)==null||I.reset_default($,o):E({})},_={model_id:"",branch:[{id:yu(),content:"",isOther:!1},{id:yu(),content:Pt("views.applicationWorkflow.nodes.intentNode.other"),isOther:!0}],dialogue_number:1,content_list:[]};function E($){Me.set(S.nodeModel.properties.node_data,"model_params_setting",$)}const O=$=>{var I;$&&((I=a.value)==null||I.open($,o,w.value.model_params_setting))},w=fr({get:()=>(S.nodeModel.properties.node_data||(Me.set(S.nodeModel.properties,"node_data",_),f(_.branch,!0)),S.nodeModel.properties.node_data),set:$=>{Me.set(S.nodeModel.properties,"node_data",$)}}),S=t,M=Ge(),T=Ge(null),B=()=>{var $;return Promise.all([i.value?i.value.validate():Promise.resolve(""),($=M.value)==null?void 0:$.validate()]).then(()=>{if(w.value.branch.length!=new Set(w.value.branch.map(I=>I.content)).size)throw Pt("views.applicationWorkflow.nodes.intentNode.error2")}).catch(I=>Promise.reject({node:S.nodeModel,errMessage:I}))},R=e();function P(){var I;const $=r.value==="systemManage"?{model_type:"LLM",workspace_id:(I=R.value)==null?void 0:I.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList($).then(F=>{T.value=Me.groupBy(F==null?void 0:F.data,"provider")})}return yo(()=>{var $;P(),typeof(($=S.nodeModel.properties.node_data)==null?void 0:$.is_result)>"u"&&Qd(S.nodeModel)&&Me.set(S.nodeModel.properties.node_data,"is_result",!0),Me.set(S.nodeModel,"validate",B)}),($,I)=>{const F=te("AppIcon"),U=te("el-button"),z=te("ModelSelect"),X=te("el-form-item"),Y=te("el-input-number"),W=te("el-input"),Q=te("el-col"),J=te("el-row"),ie=te("el-form"),Se=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Zie,_e($.$t("views.applicationWorkflow.nodeSetting")),1),k(Se,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(ie,{onSubmit:I[4]||(I[4]=mn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"IntentClassifyNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[k(X,{label:$.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:$.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Jie,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.application.form.aiModel.label")),1),I[5]||(I[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(U,{type:"primary",link:"",disabled:!w.value.model_id,onClick:I[0]||(I[0]=Ae=>O(w.value.model_id)),onRefreshForm:E},{default:j(()=>[k(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(z,{onChange:v,onWheel:h,teleported:!1,modelValue:w.value.model_id,"onUpdate:modelValue":I[1]||(I[1]=Ae=>w.value.model_id=Ae),placeholder:$.$t("views.application.form.aiModel.placeholder"),options:T.value,onSubmitModel:P,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(X,{prop:"content_list",label:$.$t("views.applicationWorkflow.nodes.intentNode.input.label"),rules:{message:$.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Qie,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.intentNode.input.label")),1),I[6]||(I[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:i,nodeModel:t.nodeModel,class:"w-full",placeholder:$.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:w.value.content_list,"onUpdate:modelValue":I[2]||(I[2]=Ae=>w.value.content_list=Ae)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(X,{label:$.$t("views.application.form.historyRecord.label")},{default:j(()=>[k(Y,{modelValue:w.value.dialogue_number,"onUpdate:modelValue":I[3]||(I[3]=Ae=>w.value.dialogue_number=Ae),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(X,null,{label:j(()=>[ee("div",eae,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.intentNode.classify.label")),1),I[7]||(I[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(U,{onClick:s,type:"primary",size:"large",link:""},{default:j(()=>[k(F,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[ee("div",null,[(Te(!0),cn(Ir,null,No(w.value.branch,(Ae,Pe)=>(Te(),cn("div",{key:Ae.id,class:"mb-8"},[k(X,{prop:`branch.${Pe}.content`,rules:{message:$.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder"),trigger:"change",required:!0}},{default:j(()=>[k(J,{gutter:12,align:"middle"},{default:j(()=>[k(Q,{span:21},{default:j(()=>[k(W,{modelValue:Ae.content,"onUpdate:modelValue":De=>Ae.content=De,style:{width:"210px"},disabled:Ae.isOther,placeholder:$.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])]),_:2},1024),k(Q,{span:3},{default:j(()=>[Ae.isOther?In("",!0):(Te(),bt(U,{key:0,link:"",size:"large",disabled:w.value.branch.filter(De=>!De.isOther).length<=1,onClick:De=>l(Ae.id)},{default:j(()=>[k(F,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"]))]),_:2},1024)]),_:2},1024)]),_:2},1032,["prop","rules"])]))),128))])]),_:1})]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:a,onRefresh:E},null,512)]),_:1},8,["nodeModel"])}}});class nae extends ai{constructor(e){super(e,tae)}}class rae extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i,properties:{branch_condition_list:a}}=this;this.height===void 0&&(this.height=200);const s=this.properties.showNode===void 0?!0:this.properties.showNode,l=[];l.push({x:n-r/2+10,y:s?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"});const f=Array.isArray(a)?a:[];if(f.length>0)for(let v=0;v<f.length;v++){const _=f[v];l.push({x:n+r/2-10,y:s?o-i/2+397+v*41.36:o-15,id:`${e}_${_.id}_right`,type:"right"}),console.log(o-i/2+397+100/2)}return l}}const oae={type:"intent-node",model:rae,view:nae},M8=Object.freeze(Object.defineProperty({__proto__:null,default:oae},Symbol.toStringTag,{value:"Module"})),iae={class:"handle flex-between lighter mb-8"},aae={key:0,class:"info"},lae=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={condition_list:[],condition:"and"},o=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),r=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:f=>{Me.set(e.nodeModel.properties,"node_data",f)}}),i=()=>{var h;const f=Me.cloneDeep(((h=r.value)==null?void 0:h.condition_list)||[]);f.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"condition_list",f)},a=f=>{var v;const h=Me.cloneDeep(((v=r.value)==null?void 0:v.condition_list)||[]);h.splice(f,1),Me.set(e.nodeModel.properties.node_data,"condition_list",h)},s=Ge(),l=()=>{var h;const f=[(h=s.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))};return yo(()=>{Me.set(e.nodeModel,"validate",l)}),(f,h)=>{const v=te("el-option"),_=te("el-select"),E=te("el-form-item"),O=te("el-col"),w=te("el-input"),S=te("AppIcon"),M=te("el-button"),T=te("el-row"),B=te("el-form"),R=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(R,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(B,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:s,onSubmit:h[1]||(h[1]=mn(()=>{},["prevent"]))},{default:j(()=>[ee("div",iae,[r.value.condition_list.length>1?(Te(),cn("div",aae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(_,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=P=>r.value.condition=P),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(v,{label:f.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):In("",!0)]),(Te(!0),cn(Ir,null,No(r.value.condition_list,(P,$)=>(Te(),bt(T,{key:$,gutter:8},{default:j(()=>[k(O,{span:11},{default:j(()=>[k(E,{prop:"condition_list."+$+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:P.field,"onUpdate:modelValue":I=>P.field=I},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[k(E,{prop:"condition_list."+$+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(_,{onWheel:o,teleported:!1,modelValue:P.compare,"onUpdate:modelValue":I=>P.compare=I,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Te(!0),cn(Ir,null,No(Wn(V2),(I,F)=>(Te(),bt(v,{key:F,label:I.label,value:I.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(P.compare)?In("",!0):(Te(),bt(E,{key:0,prop:"condition_list."+$+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:P.value,"onUpdate:modelValue":I=>P.value=I,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(O,{span:1},{default:j(()=>[k(M,{link:"",type:"info",class:"mt-4",onClick:I=>a($)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(M,{link:"",type:"primary",onClick:h[2]||(h[2]=P=>i())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class sae extends ai{constructor(e){super(e,lae)}}const uae={type:"loop-break-node",model:li,view:sae},T8=Object.freeze(Object.defineProperty({__proto__:null,default:uae},Symbol.toStringTag,{value:"Module"})),cae={class:"handle flex-between lighter mb-8"},dae={key:0,class:"info"},fae=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={condition_list:[],condition:"and"},o=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),r=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:f=>{Me.set(e.nodeModel.properties,"node_data",f)}}),i=()=>{var h;const f=Me.cloneDeep(((h=r.value)==null?void 0:h.condition_list)||[]);f.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"condition_list",f)},a=f=>{var v;const h=Me.cloneDeep(((v=r.value)==null?void 0:v.condition_list)||[]);h.splice(f,1),Me.set(e.nodeModel.properties.node_data,"condition_list",h)},s=Ge(),l=()=>{var h;const f=[(h=s.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))};return yo(()=>{Me.set(e.nodeModel,"validate",l)}),(f,h)=>{const v=te("el-option"),_=te("el-select"),E=te("el-form-item"),O=te("el-col"),w=te("el-input"),S=te("AppIcon"),M=te("el-button"),T=te("el-row"),B=te("el-form"),R=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(R,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(B,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:s,onSubmit:h[1]||(h[1]=mn(()=>{},["prevent"]))},{default:j(()=>[ee("div",cae,[r.value.condition_list.length>1?(Te(),cn("div",dae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),k(_,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=P=>r.value.condition=P),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),k(v,{label:f.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue"]),ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):In("",!0)]),(Te(!0),cn(Ir,null,No(r.value.condition_list,(P,$)=>(Te(),bt(T,{key:$,gutter:8},{default:j(()=>[k(O,{span:11},{default:j(()=>[k(E,{prop:"condition_list."+$+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:P.field,"onUpdate:modelValue":I=>P.field=I},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[k(E,{prop:"condition_list."+$+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[k(_,{onWheel:o,teleported:!1,modelValue:P.compare,"onUpdate:modelValue":I=>P.compare=I,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Te(!0),cn(Ir,null,No(Wn(V2),(I,F)=>(Te(),bt(v,{key:F,label:I.label,value:I.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(P.compare)?In("",!0):(Te(),bt(E,{key:0,prop:"condition_list."+$+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[k(w,{modelValue:P.value,"onUpdate:modelValue":I=>P.value=I,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),k(O,{span:1},{default:j(()=>[k(M,{link:"",type:"info",class:"mt-4",onClick:I=>a($)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),k(M,{link:"",type:"primary",onClick:h[2]||(h[2]=P=>i())},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class pae extends ai{constructor(e){super(e,fae)}}const hae={type:"loop-continue-node",model:li,view:pae},C8=Object.freeze(Object.defineProperty({__proto__:null,default:hae},Symbol.toStringTag,{value:"Module"})),vae=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={loop_type:"ARRAY",array:[],number:1},o=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:h=>{Me.set(e.nodeModel.properties,"node_data",h)}}),r=fr(()=>e.nodeModel.properties.showNode!==void 0?e.nodeModel.properties.showNode:(Me.set(e.nodeModel.properties,"showNode",!0),!0));K_(r,()=>{r.value?Me.throttle(f,1e3)():Me.throttle(l,1e3)()});const i=Ge(),a=Ge(),s=()=>{var h;return Promise.all([a.value?a.value.validate():Promise.resolve(""),(h=i.value)==null?void 0:h.validate()]).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))},l=()=>{const v=e.nodeModel.graphModel.getNodeOutgoingNode(e.nodeModel.id).find(_=>_.type==c0.type);v&&(v.set_loop_body(),e.nodeModel.graphModel.deleteNode(v.id))},f=()=>{if(!e.nodeModel.graphModel.getNodeOutgoingNode(e.nodeModel.id).some(v=>v.type==c0.type)){let v={nodes:[E9],edges:[]},_=e.nodeModel.x,E=e.nodeModel.y+350;e.nodeModel.properties.node_data.loop_body&&(v=e.nodeModel.properties.node_data.loop_body),e.nodeModel.properties.node_data.loop&&(_=e.nodeModel.properties.node_data.loop.x,E=e.nodeModel.properties.node_data.loop.y);const O=e.nodeModel.graphModel.addNode({type:c0.type,properties:{...c0.properties,workflow:v,loop_node_id:e.nodeModel.id},x:_,y:E});e.nodeModel.graphModel.addEdge({type:"loop-edge",sourceNodeId:e.nodeModel.id,sourceAnchorId:e.nodeModel.id+"_children",targetNodeId:O.id,virtual:!0})}};return yo(()=>{var h;typeof((h=e.nodeModel.properties.node_data)==null?void 0:h.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",s),e.nodeModel.virtual||f()}),(h,v)=>{const _=te("el-option"),E=te("el-select"),O=te("el-form-item"),w=te("el-input-number"),S=te("el-form"),M=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(M,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(S,{onSubmit:v[6]||(v[6]=mn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:i},{default:j(()=>[k(O,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.label"),onClick:v[1]||(v[1]=mn(()=>{},["prevent"])),prop:"loop_type",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.requiredMessage"),trigger:"change",required:!0}},{default:j(()=>[k(E,{modelValue:o.value.loop_type,"onUpdate:modelValue":v[0]||(v[0]=T=>o.value.loop_type=T),type:"small"},{default:j(()=>[k(_,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.arrayLoop"),value:"ARRAY"},null,8,["label"]),k(_,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.numberLoop"),value:"NUMBER"},null,8,["label"]),k(_,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.infiniteLoop"),value:"LOOP"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),o.value.loop_type=="ARRAY"?(Te(),bt(O,{key:0,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.label"),onClick:v[3]||(v[3]=mn(()=>{},["prevent"])),prop:"array",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:a,nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.placeholder"),modelValue:o.value.array,"onUpdate:modelValue":v[2]||(v[2]=T=>o.value.array=T)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):o.value.loop_type=="NUMBER"?(Te(),bt(O,{key:1,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.label"),onClick:v[5]||(v[5]=mn(()=>{},["prevent"])),prop:"number",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[k(w,{modelValue:o.value.number,"onUpdate:modelValue":v[4]||(v[4]=T=>o.value.number=T),min:1},null,8,["modelValue"])]),_:1},8,["label","rules"])):In("",!0)]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class gae extends ai{constructor(e){const n=e.model.properties.config;super(e,vae),e.model.properties.config=n}}class mae extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i}=this,a=this.properties.showNode===void 0?!0:this.properties.showNode,s=[];return this.type&&this.type!==kr.Base.toString()&&(this.type!==kr.Start.toString()&&s.push({x:n-r/2+10,y:a?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"}),s.push({x:n+r/2-10,y:a?o:o-15,id:`${e}_right`,type:"right"})),s.push({x:n,y:o+i/2-25,id:`${e}_children`,type:"children"}),s}}const yae={type:"loop-node",model:mae,view:gae},N8=Object.freeze(Object.defineProperty({__proto__:null,default:yae},Symbol.toStringTag,{value:"Module"})),_ae={class:"dialog-footer"},bae=gr({__name:"LoopFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge(!1),s=Ge(null),l=Ge({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=Ge(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},_=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:_}),(O,w)=>{const S=te("el-input"),M=te("el-form-item"),T=te("el-form"),B=te("el-button"),R=te("el-dialog");return Te(),bt(R,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":_,"append-to-body":""},{footer:j(()=>[ee("span",_ae,[k(B,{onClick:mn(_,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(B,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),wae={class:"flex-between mb-16"},Eae={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},xae={class:"ml-4"},Oae=["title"],Sae=["title"],Aae={class:"mr-4"},Mae=gr({__name:"LoopFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(),r=Ge([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1)}function s(l,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===l.field&&f!==h){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close()}return yo(()=>{e.nodeModel.properties.loop_input_field_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.loop_input_field_list)),Me.set(e.nodeModel.properties,"loop_input_field_list",r)}),(l,f)=>{var w;const h=te("AppIcon"),v=te("el-button"),_=te("el-table-column"),E=te("el-tooltip"),O=te("el-table");return Te(),cn(Ir,null,[ee("div",wae,[ee("h5",Eae,_e(l.$t("views.applicationWorkflow.variable.loop")),1),ee("div",null,[ee("span",xae,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(l.$t("common.add")),1)]),_:1})])])]),((w=e.nodeModel.properties.loop_input_field_list)==null?void 0:w.length)>0?(Te(),bt(O,{key:0,data:e.nodeModel.properties.loop_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[k(_,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,Oae)]),_:1},8,["label"]),k(_,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",null,[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,Sae)])]),_:1},8,["label"]),k(_,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",Aae,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:mn(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0),k(bae,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),Tae={class:"title-decoration-1 mb-8"},Cae={class:"title-decoration-1 mb-8"},Nae={class:"break-all"},kae=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=fr(()=>(e.nodeModel.properties.loop_input_field_list?e.nodeModel.properties.loop_input_field_list:[]).map(r=>r.label&&r.label.input_type==="TooltipLabel"?{label:r.label.label,value:r.field||r.variable}:{label:r.label||r.name,value:r.field||r.variable}));K_(n,()=>{e.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))});const o=Ge(!1);return yo(()=>{e.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))}),(r,i)=>{const a=te("AppIcon"),s=te("el-button"),l=te("el-tooltip");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>{var f;return[ee("h5",Tae,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),k(Mae,{nodeModel:t.nodeModel},null,8,["nodeModel"]),(f=n.value)!=null&&f.length?(Te(),cn(Ir,{key:0},[ee("h5",Cae,_e(r.$t("views.applicationWorkflow.variable.loop")),1),(Te(!0),cn(Ir,null,No(n.value||[],(h,v)=>(Te(),cn("div",{key:v,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:i[0]||(i[0]=_=>o.value=!0),onMouseleave:i[1]||(i[1]=_=>o.value=!1)},[ee("span",Nae,_e(h.label)+" "+_e("{"+h.value+"}"),1),o.value===!0?(Te(),bt(l,{key:0,effect:"dark",content:r.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(s,{link:"",onClick:_=>Wn(x_)(`{{loop.${h.value}}}`),style:{padding:"0"}},{default:j(()=>[k(a,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):In("",!0)],32))),128))],64)):In("",!0)]}),_:1},8,["nodeModel"])}}});class Pae extends ai{constructor(e){super(e,kae)}get_node_field_list(){var n,o,r,i;const e=[];return this.props.model.type&&this.props.model.type==="loop-start-node"&&e.push({value:"loop",label:Pt("views.applicationWorkflow.variable.loop"),type:"loop",children:(Array.isArray(this.props.model.properties.loop_input_field_list)?this.props.model.properties.loop_input_field_list:[]).map(a=>a.label&&a.label.input_type==="TooltipLabel"?{label:a.label.label,value:a.field||a.variable}:{label:a.label||a.name,value:a.field||a.variable})||[]}),e.push({value:this.props.model.id,icon:(o=(n=this.props.model.properties)==null?void 0:n.node_data)==null?void 0:o.icon,label:this.props.model.properties.stepName,type:this.props.model.type,children:((i=(r=this.props.model.properties)==null?void 0:r.config)==null?void 0:i.fields)||[]}),e}}const Rae={type:"loop-start-node",model:li,view:Pae},k8=Object.freeze(Object.defineProperty({__proto__:null,default:Rae},Symbol.toStringTag,{value:"Module"})),Dae={class:"dialog-footer"},jae=gr({__name:"McpServerInputDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(!1),i=Ge(!1),a=Ge(),s=Ge({}),l=Ge([]);function f(v){r.value=!0,l.value=v}const h=async v=>{v&&await v.validate(_=>{_&&(o("refresh",s.value),r.value=!1)})};return e({open:f}),(v,_)=>{const E=te("el-input"),O=te("el-form-item"),w=te("el-form"),S=te("el-button"),M=te("el-dialog");return Te(),bt(M,{width:"600",title:"设置变量",modelValue:r.value,"onUpdate:modelValue":_[2]||(_[2]=T=>r.value=T),"close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0},{footer:j(()=>[ee("span",Dae,[k(S,{onClick:_[0]||(_[0]=mn(T=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),k(S,{type:"primary",onClick:_[1]||(_[1]=T=>h(a.value)),loading:i.value},{default:j(()=>[ft(_e(v.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(w,{"label-position":"top",ref_key:"formRef",ref:a,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[(Te(!0),cn(Ir,null,No(l.value,T=>(Te(),bt(O,{label:T,key:T,prop:T,rules:{required:!0,message:v.$t("dynamicsForm.tip.requiredMessage"),trigger:"blur"}},{default:j(()=>[k(E,{modelValue:s.value[T],"onUpdate:modelValue":B=>s.value[T]=B},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"]))),128))]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),Lae={class:"title-decoration-1 mb-8"},Iae={class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Fae={class:"flex-between"},Bae={class:"flex align-center"},$ae=["src"],Uae={class:"flex-between"},Vae={class:"ml-4"},Wae={class:"title-decoration-1 mb-8"},Gae={key:0,class:"p-8-12"},zae={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Hae={class:"flex-between"},Xae={key:1},Yae={key:2,class:"color-danger"},qae={key:0,class:"p-8-12"},Kae={key:1,class:"border-r-6 p-8-12 mb-8 layout-bg lighter"},Zae={class:"flex-between"},Jae={key:1},Qae={key:2,class:"color-danger"},ele=`{
|
||
"math": {
|
||
"url": "your_server",
|
||
"transport": "sse"
|
||
}
|
||
}`,tle=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=ja(),{params:{id:o}}=n,i=gl("getApplicationDetail")(),a=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),s=Ge(),l=Ge(!1),f=F=>F.ctrlKey===!0?(F.preventDefault(),!0):(F.stopPropagation(),!0),h={mcp_tool:"",mcp_tools:[],mcp_servers:"",mcp_server:"",mcp_source:"referencing",mcp_tool_id:"",tool_params:{},tool_form_field:[],params_nested:""},v=Ge([]);function _(F){Me.set(e.nodeModel.properties.node_data,"mcp_servers",F)}async function E(){const F=await oi({type:"tool",systemType:a.value}).getToolById(R.value.mcp_tool_id,l);R.value.mcp_servers=F.data.code}function O(){if(R.value.mcp_source==="referencing"&&!R.value.mcp_tool_id){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(R.value.mcp_source==="referencing"&&R.value.mcp_tool_id&&!v.value.find(F=>F.id===R.value.mcp_tool_id)){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(R.value.mcp_source==="custom"&&!R.value.mcp_servers){Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}try{JSON.parse(R.value.mcp_servers);const F=M(R.value.mcp_servers);if(F.length>0){S.value.open(F);return}}catch{Xi(Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}w(R.value.mcp_servers)}function w(F){oi({type:"application",systemType:a.value}).getMcpTools(o,F,l).then(U=>{var z;R.value.mcp_tools=U.data,Sh(Pt("views.applicationWorkflow.nodes.mcpNode.getToolsSuccess")),R.value.mcp_server=(z=R.value.mcp_tools.find(X=>X.name===R.value.mcp_tool))==null?void 0:z.server})}const S=Ge();function M(F){const U=/\{\{\s*([a-zA-Z_][\w.]*)\s*\}\}/g,z=new Set,X=Y=>{if(typeof Y=="string"){let W;for(;(W=U.exec(Y))!==null;)z.add(W[1])}else Array.isArray(Y)?Y.forEach(X):Y&&typeof Y=="object"&&Object.values(Y).forEach(X)};if(typeof F=="string")try{X(JSON.parse(F))}catch{X(F)}else X(F);return[...z]}function T(F){let U=R.value.mcp_servers;for(const z in F)U=U.replace(`{{${z}}}`,F[z]);w(U)}function B(){var U,z,X,Y,W,Q;R.value.mcp_server=(U=R.value.mcp_tools.find(J=>J.name===R.value.mcp_tool))==null?void 0:U.server;const F=(z=R.value.mcp_tools.find(J=>J.name===R.value.mcp_tool))==null?void 0:z.args_schema;R.value.tool_form_field=[];for(const J in F==null?void 0:F.properties){const ie=F==null?void 0:F.properties[J].properties;if(ie){R.value.params_nested=J;for(const Se in ie){let Ae="TextInput";ie[Se].type==="string"?Ae="TextInput":ie[Se].type==="number"?Ae="NumberInput":ie[Se].type==="boolean"?Ae="SwitchInput":(ie[Se].type==="array"||ie[Se].type==="object")&&(Ae="JsonInput"),R.value.tool_form_field.push({field:Se,label:{input_type:"TooltipLabel",label:Se,attrs:{tooltip:ie[Se].description},props_info:{}},input_type:Ae,source:"referencing",required:((X=F.properties[J].required)==null?void 0:X.indexOf(Se))!==-1,props_info:{rules:[{required:((Y=F.properties[J].required)==null?void 0:Y.indexOf(Se))!==-1,message:Pt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}else{R.value.params_nested="";let Se="TextInput";F.properties[J].type==="string"?Se="TextInput":F.properties[J].type==="number"?Se="NumberInput":F.properties[J].type==="boolean"?Se="SwitchInput":(F.properties[J].type==="array"||F.properties[J].type==="object")&&(Se="JsonInput"),R.value.tool_form_field.push({field:J,label:{input_type:"TooltipLabel",label:J,attrs:{tooltip:F.properties[J].description},props_info:{}},input_type:Se,source:"referencing",required:((W=F.required)==null?void 0:W.indexOf(J))!==-1,props_info:{rules:[{required:((Q=F.required)==null?void 0:Q.indexOf(J))!==-1,message:Pt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}R.value.params_nested?R.value.tool_params={[R.value.params_nested]:{}}:R.value.tool_params={}}const R=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",h),e.nodeModel.properties.node_data),set:F=>{Me.set(e.nodeModel.properties,"node_data",F)}}),P=Ge(),$=async()=>{if(s.value){const F=R.value.tool_form_field.filter(U=>U.required).map(U=>U.label.label);if(F.length>0){for(const U of F)if(R.value.params_nested){if(!R.value.tool_params[R.value.params_nested][U])return Promise.reject({node:e.nodeModel,errMessage:U+Pt("dynamicsForm.tip.requiredMessage")})}else if(!R.value.tool_params[U])return Promise.reject({node:e.nodeModel,errMessage:U+Pt("dynamicsForm.tip.requiredMessage")})}}if(P.value){const F=Me.cloneDeep(R.value);if(!F.mcp_servers)return Promise.reject({node:e.nodeModel,errMessage:Pt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip")});if(!F.mcp_tool)return Promise.reject({node:e.nodeModel,errMessage:Pt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip")})}};function I(){var U;const F=a.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(U=i.value)==null?void 0:U.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:a.value}).getAllToolList(F,l).then(z=>{v.value=[...z.data.shared_tools,...z.data.tools].filter(X=>X.is_active)})}return yo(()=>{var F;typeof((F=e.nodeModel.properties.node_data)==null?void 0:F.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),e.nodeModel.properties.node_data.mcp_servers&&!e.nodeModel.properties.node_data.mcp_source&&Me.set(e.nodeModel.properties.node_data,"mcp_source","custom"),I(),Me.set(e.nodeModel,"validate",$)}),(F,U)=>{const z=te("el-option"),X=te("el-select"),Y=te("MdEditorMagnify"),W=te("el-avatar"),Q=te("ToolIcon"),J=te("el-tag"),ie=te("el-form-item"),Se=te("AppIcon"),Ae=te("el-button"),Pe=te("el-tooltip"),De=te("el-form"),He=te("el-text"),Ye=te("el-input"),Be=te("el-input-number"),Je=te("el-switch"),mt=Rm("loading");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Lae,_e(F.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",Iae,[k(De,{onSubmit:U[5]||(U[5]=mn(()=>{},["prevent"])),model:R.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:P,"hide-required-asterisk":""},{default:j(()=>[k(ie,{label:"MCP Server Config"},{label:j(()=>[ee("div",Fae,[U[8]||(U[8]=ee("div",null,[ft(" MCP Server Config "),ee("span",{class:"color-danger"},"*")],-1)),k(X,{teleported:!1,modelValue:R.value.mcp_source,"onUpdate:modelValue":U[0]||(U[0]=le=>R.value.mcp_source=le),size:"small",style:{width:"85px"}},{default:j(()=>[k(z,{label:F.$t("views.applicationWorkflow.nodes.mcpNode.reference"),value:"referencing"},null,8,["label"]),k(z,{label:F.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[R.value.mcp_source==="custom"?(Te(),bt(Y,{key:0,onWheel:f,title:"MCP Server Config",modelValue:R.value.mcp_servers,"onUpdate:modelValue":U[1]||(U[1]=le=>R.value.mcp_servers=le),style:{height:"150px"},onSubmitDialog:_,placeholder:ele},null,8,["modelValue"])):(Te(),bt(X,{key:1,modelValue:R.value.mcp_tool_id,"onUpdate:modelValue":U[2]||(U[2]=le=>R.value.mcp_tool_id=le),filterable:"",onChange:E},{default:j(()=>[(Te(!0),cn(Ir,null,No(v.value,le=>(Te(),bt(z,{key:le.id,label:le.name,value:le.id},{default:j(()=>[ee("div",Bae,[le!=null&&le.icon?(Te(),bt(W,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>[ee("img",{src:Wn(yh)(le==null?void 0:le.icon),alt:""},null,8,$ae)]),_:2},1024)):(Te(),bt(Q,{key:1,size:20,type:le==null?void 0:le.tool_type,class:"mr-8"},null,8,["type"])),ee("span",null,_e(le.name),1),le.scope==="SHARED"?(Te(),bt(J,{key:2,type:"info",class:"info-tag ml-8"},{default:j(()=>[ft(_e(Wn(Pt)("views.shared.title")),1)]),_:1})):In("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))]),_:1}),k(ie,null,{label:j(()=>[ee("div",Uae,[ee("span",null,_e(F.$t("views.tool.title")),1),k(Ae,{type:"primary",link:"",onClick:U[3]||(U[3]=le=>O())},{default:j(()=>[k(Se,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(F.$t("views.applicationWorkflow.nodes.mcpNode.getTool")),1)]),_:1})])]),default:j(()=>[k(X,{modelValue:R.value.mcp_tool,"onUpdate:modelValue":U[4]||(U[4]=le=>R.value.mcp_tool=le),onChange:B,filterable:""},{default:j(()=>[(Te(!0),cn(Ir,null,No(R.value.mcp_tools,le=>(Te(),bt(z,{key:le.value,label:le.name,value:le.name,class:"flex align-center"},{default:j(()=>[k(Pe,{effect:"dark",content:le.description,placement:"top-start","popper-class":"max-w-350"},{default:j(()=>[k(Se,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"]),ee("span",Vae,_e(le.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),ee("h5",Wae,_e(F.$t("views.applicationWorkflow.nodes.mcpNode.toolParam")),1),R.value.tool_params[R.value.params_nested]?(Te(),cn(Ir,{key:0},[R.value.mcp_tool?(Te(),cn("div",zae,[R.value.mcp_tool?Ql((Te(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:s,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:U[6]||(U[6]=mn(()=>{},["prevent"]))},{default:j(()=>[(Te(!0),cn(Ir,null,No(R.value.tool_form_field,le=>(Te(),bt(ie,{key:le.field,required:le.required},{label:j(()=>[ee("div",Hae,[ee("div",null,[le.label.attrs.tooltip?(Te(),bt(VN,{key:0,label:le.label,tooltip:le.label.attrs.tooltip},null,8,["label","tooltip"])):(Te(),cn("span",Xae,_e(le.label.label),1)),le.required?(Te(),cn("span",Yae,"*")):In("",!0)]),k(X,{teleported:!1,modelValue:le.source,"onUpdate:modelValue":Ze=>le.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>R.value.tool_params[R.value.params_nested][le.label.label]=""},{default:j(()=>[k(z,{label:F.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{label:F.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[le.source==="custom"&&le.input_type==="TextInput"?(Te(),bt(Ye,{key:0,modelValue:R.value.tool_params[R.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[R.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="NumberInput"?(Te(),bt(Be,{key:1,modelValue:R.value.tool_params[R.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[R.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="SwitchInput"?(Te(),bt(Je,{key:2,modelValue:R.value.tool_params[R.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[R.value.params_nested][le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="JsonInput"?(Te(),bt(Ye,{key:3,modelValue:R.value.tool_params[R.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[R.value.params_nested][le.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):In("",!0),le.source==="referencing"?(Te(),bt(Go,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:t.nodeModel,class:"w-full",placeholder:F.$t("views.applicationWorkflow.variable.placeholder"),modelValue:R.value.tool_params[R.value.params_nested][le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[R.value.params_nested][le.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):In("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[mt,l.value]]):In("",!0)])):(Te(),cn("div",Gae,[k(He,{type:"info"},{default:j(()=>[ft(_e(F.$t("common.noData")),1)]),_:1})]))],64)):(Te(),cn(Ir,{key:1},[R.value.mcp_tool?(Te(),cn("div",Kae,[R.value.mcp_tool?Ql((Te(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:s,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:U[7]||(U[7]=mn(()=>{},["prevent"]))},{default:j(()=>[(Te(!0),cn(Ir,null,No(R.value.tool_form_field,le=>(Te(),bt(ie,{key:le.field,required:le.required},{label:j(()=>[ee("div",Zae,[ee("div",null,[le.label.attrs.tooltip?(Te(),bt(VN,{key:0,label:le.label,tooltip:le.label.attrs.tooltip},null,8,["label","tooltip"])):(Te(),cn("span",Jae,_e(le.label.label),1)),le.required?(Te(),cn("span",Qae,"*")):In("",!0)]),k(X,{teleported:!1,modelValue:le.source,"onUpdate:modelValue":Ze=>le.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>R.value.tool_params[le.label.label]=""},{default:j(()=>[k(z,{label:F.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(z,{label:F.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[le.source==="custom"&&le.input_type==="TextInput"?(Te(),bt(Ye,{key:0,modelValue:R.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="NumberInput"?(Te(),bt(Be,{key:1,modelValue:R.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="SwitchInput"?(Te(),bt(Je,{key:2,modelValue:R.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[le.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):le.source==="custom"&&le.input_type==="JsonInput"?(Te(),bt(Ye,{key:3,modelValue:R.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[le.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):In("",!0),le.source==="referencing"?(Te(),bt(Go,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:t.nodeModel,class:"w-full",placeholder:F.$t("views.applicationWorkflow.variable.placeholder"),modelValue:R.value.tool_params[le.label.label],"onUpdate:modelValue":Ze=>R.value.tool_params[le.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):In("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[mt,l.value]]):In("",!0)])):(Te(),cn("div",qae,[k(He,{type:"info"},{default:j(()=>[ft(_e(F.$t("common.noData")),1)]),_:1})]))],64)),k(jae,{ref_key:"mcpServerInputDialogRef",ref:S,onRefresh:T},null,512)]),_:1},8,["nodeModel"])}}});class nle extends ai{constructor(e){super(e,tle)}}const rle={type:"mcp-node",model:li,view:nle},P8=Object.freeze(Object.defineProperty({__proto__:null,default:rle},Symbol.toStringTag,{value:"Module"})),ole={class:"dialog-footer"},ile=gr({__name:"ParametersFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"object",label:"Object"},{value:"boolean",label:"Boolean"},{value:"array",label:"Array"}],i=Ge(),a=Ge(!1),s=Ge(!1),l=Ge(null),f=Ge({field:"",label:"",parameter_type:"",desc:""}),h=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:Pt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),v=Ge(!1),_=(w,S)=>{w&&(f.value=Me.cloneDeep(w),s.value=!0,l.value=S),v.value=!0},E=()=>{v.value=!1,s.value=!1,l.value=null,f.value={field:"",label:""}},O=async w=>{w&&await w.validate(S=>{S&&o("refresh",f.value,l.value)})};return e({open:_,close:E}),(w,S)=>{const M=te("el-input"),T=te("el-form-item"),B=te("el-option"),R=te("el-select"),P=te("el-form"),$=te("el-button"),I=te("el-dialog");return Te(),bt(I,{title:s.value?w.$t("common.param.editParam"):w.$t("common.param.addParam"),modelValue:v.value,"onUpdate:modelValue":S[5]||(S[5]=F=>v.value=F),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":E,"append-to-body":""},{footer:j(()=>[ee("span",ole,[k($,{onClick:mn(E,["prevent"])},{default:j(()=>[ft(_e(w.$t("common.cancel")),1)]),_:1}),k($,{type:"primary",onClick:S[4]||(S[4]=F=>O(i.value)),loading:a.value},{default:j(()=>[ft(_e(w.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(P,{"label-position":"top",ref_key:"fieldFormRef",ref:i,rules:h,model:f.value,"require-asterisk-position":"right"},{default:j(()=>[k(T,{label:w.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:h.field},{default:j(()=>[k(M,{modelValue:f.value.field,"onUpdate:modelValue":S[0]||(S[0]=F=>f.value.field=F),maxlength:64,placeholder:w.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:h.label},{default:j(()=>[k(M,{modelValue:f.value.label,"onUpdate:modelValue":S[1]||(S[1]=F=>f.value.label=F),maxlength:64,"show-word-limit":"",placeholder:w.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),required:!0,prop:"parameter_type",rules:h.label},{default:j(()=>[k(R,{modelValue:f.value.parameter_type,"onUpdate:modelValue":S[2]||(S[2]=F=>f.value.parameter_type=F),placeholder:w.$t("common.selectPlaceholder")+w.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),style:{width:"100%"}},{default:j(()=>[(Te(),cn(Ir,null,No(r,F=>k(B,{key:F.value,label:F.label,value:F.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),k(T,{label:w.$t("common.desc"),prop:"desc"},{default:j(()=>[k(M,{modelValue:f.value.desc,"onUpdate:modelValue":S[3]||(S[3]=F=>f.value.desc=F),style:{width:"100%"},rows:2,type:"textarea",placeholder:w.$t("common.descPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),ale={class:"flex-between w-full"},lle={class:"break-all lighter"},sle={class:"ml-4",style:{"margin-top":"-4px"}},ule=["title"],cle=["title"],dle={class:"mr-4"},fle=gr({__name:"ParametersFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(),r=Ge([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1);const f=[{label:Pt("common.result"),value:"result"},...r.value.map(h=>({label:h.label,value:h.field}))];Me.set(e.nodeModel.properties.config,"fields",f),e.nodeModel.clear_next_node_field(!1)}function s(l,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===l.field&&f!==v){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close();const h=[{label:Pt("common.result"),value:"result"},...r.value.map(v=>({label:v.label,value:v.field}))];Me.set(e.nodeModel.properties.config,"fields",h),e.nodeModel.clear_next_node_field(!1)}return yo(()=>{e.nodeModel.properties.node_data.variable_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.node_data.variable_list)),Me.set(e.nodeModel.properties.node_data,"variable_list",r);const l=[{label:Pt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(e.nodeModel.properties.config,"fields",l)}),(l,f)=>{var S;const h=te("AppIcon"),v=te("el-button"),_=te("el-table-column"),E=te("el-tag"),O=te("el-tooltip"),w=te("el-table");return Te(),cn(Ir,null,[ee("div",ale,[ee("h5",lle,[ft(_e(l.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",sle,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=M=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined",class:"mr-4"})]),_:1})])]),((S=e.nodeModel.properties.node_data.variable_list)==null?void 0:S.length)>0?(Te(),bt(w,{key:0,data:e.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:j(()=>[k(_,{prop:"field",label:l.$t("dynamicsForm.paramForm.field.label"),width:"90"},{default:j(({row:M})=>[ee("span",{title:M.field,class:"ellipsis-1"},_e(M.field),9,ule)]),_:1},8,["label"]),k(_,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:M})=>[ee("span",null,[ee("span",{title:M.label,class:"ellipsis-1"},_e(M.label),9,cle)])]),_:1},8,["label"]),k(_,{prop:"label",label:l.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType")},{default:j(({row:M})=>[k(E,{type:"info",class:"info-tag"},{default:j(()=>[ft(_e(M.parameter_type),1)]),_:2},1024)]),_:1},8,["label"]),k(_,{label:l.$t("common.operation"),align:"left",width:"80"},{default:j(({row:M,$index:T})=>[ee("span",dle,[k(O,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:mn(B=>i(M,T),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(O,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:B=>a(T)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0),k(ile,{ref_key:"ParametersFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),ple={class:"title-decoration-1 mb-8"},hle={class:"flex-between w-full"},vle={class:"flex-between"},gle=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=t,o=Ge(),r=ja(),{params:{id:i}}=r,a=T=>{var B;T&&((B=o.value)==null||B.open(T,i,O.value.model_params_setting))};function s(T){Me.set(n.nodeModel.properties.node_data,"model_params_setting",T)}const l=e(),f=Ge(null),h=T=>T.ctrlKey===!0?(T.preventDefault(),!0):(T.stopPropagation(),!0),v=fr(()=>r.path.includes("resource-management")?"systemManage":"workspace");function _(){var B;const T=v.value==="systemManage"?{model_type:"LLM",workspace_id:(B=l.value)==null?void 0:B.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:v.value}).getSelectModelList(T).then(R=>{f.value=Me.groupBy(R==null?void 0:R.data,"provider")})}const E={input_variable:[],model_params_setting:{},model_id:"",variable_list:[]},O=fr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",E),n.nodeModel.properties.node_data),set:T=>{Me.set(n.nodeModel.properties,"node_data",T)}}),w=T=>{var B;T?(B=o.value)==null||B.reset_default(T,i):s({})},S=Ge(),M=async()=>S.value.validate().catch(T=>Promise.reject({node:n.nodeModel,errMessage:T}));return yo(()=>{_(),Me.set(n.nodeModel,"validate",M)}),(T,B)=>{const R=te("AppIcon"),P=te("el-button"),$=te("ModelSelect"),I=te("el-form-item"),F=te("el-form"),U=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",ple,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(U,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(F,{onSubmit:B[3]||(B[3]=mn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:T.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:T.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hle,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.application.form.aiModel.label")),1),B[4]||(B[4]=ee("span",{class:"color-danger ml-4"},"*",-1))])]),k(P,{disabled:!O.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=z=>a(O.value.model_id)),onRefreshForm:s},{default:j(()=>[k(R,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k($,{onChange:w,onWheel:h,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=z=>O.value.model_id=z),placeholder:T.$t("views.application.form.aiModel.placeholder"),options:f.value,onSubmitModel:_,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(I,{prop:"input_variable",rules:{message:T.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",vle,[ee("div",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),B[5]||(B[5]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.variable.placeholder"),modelValue:O.value.input_variable,"onUpdate:modelValue":B[2]||(B[2]=z=>O.value.input_variable=z)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(I,{prop:"variable_list",rules:{message:T.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(fle,{ref:"ParametersFieldTableRef","node-model":t.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:o,onRefresh:s},null,512)]),_:1},8,["nodeModel"])}}});class mle extends ai{constructor(e){super(e,gle)}getConfig(e){return e.model.properties.config}}const yle={type:"parameter-extraction-node",model:li,view:mle},R8=Object.freeze(Object.defineProperty({__proto__:null,default:yle},Symbol.toStringTag,{value:"Module"})),_le={class:"title-decoration-1 mb-8"},ble={class:"flex-between"},wle={class:"flex-between"},Ele={class:"flex align-center"},xle={class:"flex align-center"},Ole={class:"mr-4"},Sle={class:"flex align-center"},Ale={class:"mr-4"},Mle=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Ge(),a=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),s=P=>{var $;P?($=i.value)==null||$.reset_default(P,o):_({})};function l(P){Me.set(w.nodeModel.properties.node_data,"prompt",P)}function f(P){Me.set(w.nodeModel.properties.node_data,"system",P)}const h=`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,v={model_id:"",system:Pt("views.applicationWorkflow.nodes.questionNode.systemDefault"),prompt:h,dialogue_number:1,is_result:!1};function _(P){Me.set(w.nodeModel.properties.node_data,"model_params_setting",P)}const E=P=>{var $;P&&(($=i.value)==null||$.open(P,o,O.value.model_params_setting))},O=fr({get:()=>(w.nodeModel.properties.node_data||Me.set(w.nodeModel.properties,"node_data",v),w.nodeModel.properties.node_data),set:P=>{Me.set(w.nodeModel.properties,"node_data",P)}}),w=t,S=Ge(),M=Ge(null),T=()=>{var P;return(P=S.value)==null?void 0:P.validate().catch($=>Promise.reject({node:w.nodeModel,errMessage:$}))},B=e();function R(){var $;const P=r.value==="systemManage"?{model_type:"LLM",workspace_id:($=B.value)==null?void 0:$.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(I=>{M.value=Me.groupBy(I==null?void 0:I.data,"provider")})}return yo(()=>{var P;R(),typeof((P=w.nodeModel.properties.node_data)==null?void 0:P.is_result)>"u"&&Qd(w.nodeModel)&&Me.set(w.nodeModel.properties.node_data,"is_result",!0),Me.set(w.nodeModel,"validate",T)}),(P,$)=>{const I=te("AppIcon"),F=te("el-button"),U=te("ModelSelect"),z=te("el-form-item"),X=te("el-tooltip"),Y=te("MdEditorMagnify"),W=te("el-input-number"),Q=te("el-switch"),J=te("el-form"),ie=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",_le,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(ie,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(J,{onSubmit:$[7]||($[7]=mn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"questionNodeFormRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",ble,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.application.form.aiModel.label")),1),$[8]||($[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(F,{type:"primary",link:"",disabled:!O.value.model_id,onClick:$[0]||($[0]=Se=>E(O.value.model_id)),onRefreshForm:_},{default:j(()=>[k(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(U,{onChange:s,onWheel:a,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":$[1]||($[1]=Se=>O.value.model_id=Se),placeholder:P.$t("views.application.form.aiModel.placeholder"),options:M.value,onSubmitModel:R,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,null,{label:j(()=>[ee("div",wle,[ee("div",Ele,[ee("span",null,_e(P.$t("views.application.form.roleSettings.label")),1),k(X,{effect:"dark",content:P.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])])]),default:j(()=>[k(Y,{title:P.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":$[2]||($[2]=Se=>O.value.system=Se),style:{height:"100px"},onSubmitDialog:f,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(z,{label:P.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("views.application.form.prompt.tooltip"),trigger:"blur"}},{label:j(()=>[ee("div",xle,[ee("div",Ole,[ee("span",null,[ft(_e(P.$t("views.application.form.prompt.label")),1),$[9]||($[9]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:a,title:P.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":$[3]||($[3]=Se=>O.value.prompt=Se),style:{height:"150px"},onSubmitDialog:l,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.application.form.historyRecord.label")},{default:j(()=>[k(W,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":$[4]||($[4]=Se=>O.value.dialogue_number=Se),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1},8,["label"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[6]||($[6]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Sle,[ee("div",Ale,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Q,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":$[5]||($[5]=Se=>O.value.is_result=Se)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:i,onRefresh:_},null,512)]),_:1},8,["nodeModel"])}}});class Tle extends ai{constructor(e){super(e,Mle)}}const Cle={type:"question-node",model:li,view:Tle},D8=Object.freeze(Object.defineProperty({__proto__:null,default:Cle},Symbol.toStringTag,{value:"Module"})),Nle={class:"flex-between"},kle={class:"flex align-center"},Ple={class:"mr-4"},Rle=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=f=>f.ctrlKey===!0?(f.preventDefault(),!0):(f.stopPropagation(),!0),o={reply_type:"content",content:"",fields:[],is_result:!0},r=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",o),e.nodeModel.properties.node_data),set:f=>{Me.set(e.nodeModel.properties,"node_data",f)}});function i(f){Me.set(e.nodeModel.properties.node_data,"content",f)}const a=Ge(),s=Ge(),l=()=>{var f;return Promise.all([s.value?s.value.validate():Promise.resolve(""),(f=a.value)==null?void 0:f.validate()]).catch(h=>Promise.reject({node:e.nodeModel,errMessage:h}))};return yo(()=>{var f;typeof((f=e.nodeModel.properties.node_data)==null?void 0:f.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",l)}),(f,h)=>{const v=te("el-option"),_=te("el-select"),E=te("MdEditorMagnify"),O=te("el-form-item"),w=te("AppIcon"),S=te("el-tooltip"),M=te("el-switch"),T=te("el-form"),B=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(B,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(T,{onSubmit:h[5]||(h[5]=mn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:a},{default:j(()=>[k(O,{label:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")},{label:j(()=>[ee("div",Nle,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")),1),k(_,{teleported:!1,modelValue:r.value.reply_type,"onUpdate:modelValue":h[0]||(h[0]=R=>r.value.reply_type=R),size:"small",style:{width:"85px"}},{default:j(()=>[k(v,{label:f.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(v,{label:f.$t("common.custom"),value:"content"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[r.value.reply_type==="content"?(Te(),bt(E,{key:0,onWheel:n,title:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent"),modelValue:r.value.content,"onUpdate:modelValue":h[1]||(h[1]=R=>r.value.content=R),style:{height:"150px"},onSubmitDialog:i},null,8,["title","modelValue"])):(Te(),bt(Go,{key:1,ref_key:"nodeCascaderRef",ref:s,nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.fields,"onUpdate:modelValue":h[2]||(h[2]=R=>r.value.fields=R)},null,8,["nodeModel","placeholder","modelValue"]))]),_:1},8,["label"]),k(O,{label:f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:h[4]||(h[4]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",kle,[ee("div",Ple,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(S,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(w,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(M,{size:"small",modelValue:r.value.is_result,"onUpdate:modelValue":h[3]||(h[3]=R=>r.value.is_result=R)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Dle extends ai{constructor(e){super(e,Rle)}}const jle={type:"reply-node",model:li,view:Dle},j8=Object.freeze(Object.defineProperty({__proto__:null,default:jle},Symbol.toStringTag,{value:"Module"})),Lle={class:"flex align-center"},Ile={class:"mr-4"},Fle={class:"dialog-footer"},Ble=gr({__name:"ParamSettingDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge({top_n:3,similarity:0,max_paragraph_char_number:5e3}),a=Ge(!1),s=Ge(!1);K_(a,h=>{h||(i.value={top_n:3,similarity:0,max_paragraph_char_number:5e3})});const l=h=>{i.value={...i.value,...Me.cloneDeep(h)},a.value=!0},f=()=>{var h;(h=r==null?void 0:r.value)==null||h.validate((v,_)=>{v&&(o("refresh",Me.cloneDeep(i.value)),a.value=!1)})};return e({open:l}),(h,v)=>{const _=te("AppIcon"),E=te("el-tooltip"),O=te("el-input-number"),w=te("el-form-item"),S=te("el-col"),M=te("el-row"),T=te("el-slider"),B=te("el-form"),R=te("el-button"),P=te("el-dialog");return Te(),bt(P,{"align-center":"",title:h.$t("common.paramSetting"),class:"param-dialog",modelValue:a.value,"onUpdate:modelValue":v[5]||(v[5]=$=>a.value=$),style:{width:"550px"},"append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:j(()=>[ee("span",Fle,[k(R,{onClick:v[3]||(v[3]=mn($=>a.value=!1,["prevent"]))},{default:j(()=>[ft(_e(h.$t("common.cancel")),1)]),_:1}),k(R,{type:"primary",onClick:v[4]||(v[4]=$=>f()),loading:s.value},{default:j(()=>[ft(_e(h.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(B,{"label-position":"top",ref_key:"paramFormRef",ref:r,model:i.value},{default:j(()=>[k(M,{gutter:12},{default:j(()=>[k(S,{span:12},{default:j(()=>[k(w,null,{label:j(()=>[ee("div",Lle,[ee("span",Ile,"Score "+_e(h.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1),k(E,{effect:"dark",content:h.$t("views.applicationWorkflow.nodes.rerankerNode.ScoreTooltip"),placement:"right"},{default:j(()=>[k(_,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[k(O,{modelValue:i.value.similarity,"onUpdate:modelValue":v[0]||(v[0]=$=>i.value.similarity=$),min:0,max:i.value.search_mode==="blend"?2:1,precision:3,step:.1,"value-on-clear":0,"controls-position":"right",class:"w-full"},null,8,["modelValue","max"])]),_:1})]),_:1}),k(S,{span:12},{default:j(()=>[k(w,{label:h.$t("views.application.dialog.topReferences")},{default:j(()=>[k(O,{modelValue:i.value.top_n,"onUpdate:modelValue":v[1]||(v[1]=$=>i.value.top_n=$),min:1,max:1e4,"value-on-clear":1,"controls-position":"right",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),k(w,{label:h.$t("views.application.dialog.maxCharacters")},{default:j(()=>[k(T,{modelValue:i.value.max_paragraph_char_number,"onUpdate:modelValue":v[2]||(v[2]=$=>i.value.max_paragraph_char_number=$),"show-input":"","show-input-controls":!1,min:500,max:1e5,class:"custom-slider"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])}}}),$le={class:"flex-between"},Ule={class:"flex-between"},Vle={class:"w-full"},Wle={class:"flex-between"},Gle={class:"flex-between"},zle=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(),s={reranker_reference_list:[[]],reranker_model_id:"",question_reference_address:[],reranker_setting:{top_n:3,similarity:0,max_paragraph_char_number:5e3},show_knowledge:!1},l=Ge(null),f=()=>{var R;(R=a.value)==null||R.open(_.value.reranker_setting)},h=R=>{const P=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);P.splice(R,1),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",P)},v=R=>R.ctrlKey===!0?(R.preventDefault(),!0):(R.stopPropagation(),!0),_=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",s),i.nodeModel.properties.node_data),set:R=>{Me.set(i.nodeModel.properties,"node_data",R)}});function E(R){Me.set(i.nodeModel.properties.node_data,"reranker_setting",R)}const O=e();function w(){var P;const R=r.value==="systemManage"?{model_type:"RERANKER",workspace_id:(P=O.value)==null?void 0:P.workspace_id}:{model_type:"RERANKER"};oi({type:"model",systemType:r.value}).getSelectModelList(R).then($=>{l.value=Me.groupBy($==null?void 0:$.data,"provider")})}const S=()=>{const R=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);R.push([]),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",R)},M=Ge(),T=Ge(),B=()=>{var R;return Promise.all([T.value?T.value.validate():Promise.resolve(""),(R=M.value)==null?void 0:R.validate()]).catch(P=>Promise.reject({node:i.nodeModel,errMessage:P}))};return yo(()=>{w(),_.value.show_knowledge=_.value.show_knowledge?_.value.show_knowledge:!1,Me.set(i.nodeModel,"validate",B)}),(R,P)=>{const $=te("AppIcon"),I=te("el-button"),F=te("el-form-item"),U=te("el-col"),z=te("el-row"),X=te("ModelSelect"),Y=te("el-switch"),W=te("el-form"),Q=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(W,{onSubmit:P[4]||(P[4]=mn(()=>{},["prevent"])),model:_.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"rerankerNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:R.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label"),prop:"reranker_reference_list",rules:{type:"array",message:R.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),trigger:"change",required:!0}},{label:j(()=>[ee("div",$le,[ee("span",null,[ft(_e(R.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label")),1),P[5]||(P[5]=ee("span",{class:"color-danger"},"*",-1))]),k(I,{onClick:S,link:"",type:"primary"},{default:j(()=>[k($,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[(Te(!0),cn(Ir,null,No(_.value.reranker_reference_list,(J,ie)=>(Te(),bt(z,{gutter:8,style:{"margin-bottom":"8px"},key:ie,class:"w-full"},{default:j(()=>[k(U,{span:22},{default:j(()=>[k(F,{prop:"reranker_reference_list."+ie,rules:{type:"array",required:!0,message:R.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[(Te(),bt(Go,{key:ie,nodeModel:t.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),modelValue:_.value.reranker_reference_list[ie],"onUpdate:modelValue":Se=>_.value.reranker_reference_list[ie]=Se},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules"])]),_:2},1024),k(U,{span:2},{default:j(()=>[k(I,{link:"",type:"info",onClick:Se=>h(ie)},{default:j(()=>[k($,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["label","rules"]),k(F,{label:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",Ule,[ee("span",null,_e(R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(I,{type:"primary",link:"",onClick:f},{default:j(()=>[k($,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",Vle,[k(z,null,{default:j(()=>[k(U,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(" Score "+_e(R.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1)]),_:1}),k(U,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=_.value.reranker_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),k(U,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(R.$t("chat.KnowledgeSource.referenceParagraph"))+" Top",1)]),_:1}),k(U,{span:12,class:"lighter"},{default:j(()=>[ft(_e(_.value.reranker_setting.top_n),1)]),_:1}),k(U,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(R.$t("views.applicationWorkflow.nodes.rerankerNode.max_paragraph_char_number")),1)]),_:1}),k(U,{span:12,class:"lighter"},{default:j(()=>[ft(_e(_.value.reranker_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(F,{label:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),prop:"question_reference_address",rules:{message:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Wle,[ee("span",null,[ft(_e(R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label")),1),P[6]||(P[6]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:T,nodeModel:t.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),modelValue:_.value.question_reference_address,"onUpdate:modelValue":P[0]||(P[0]=J=>_.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(F,{label:R.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label"),prop:"reranker_model_id",rules:{required:!0,message:R.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Gle,[ee("span",null,[ft(_e(R.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label")),1),P[7]||(P[7]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(X,{onWheel:v,teleported:!1,modelValue:_.value.reranker_model_id,"onUpdate:modelValue":P[1]||(P[1]=J=>_.value.reranker_model_id=J),placeholder:R.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),options:l.value,onSubmitModel:w,showFooter:"","model-type":"RERANKER"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(F,{label:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"),prop:"show_knowledge",required:"",onClick:P[3]||(P[3]=mn(()=>{},["prevent"]))},{default:j(()=>[k(Y,{size:"small",modelValue:_.value.show_knowledge,"onUpdate:modelValue":P[2]||(P[2]=J=>_.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Ble,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:E},null,512)]),_:1},8,["nodeModel"])}}}),Hle=fp(zle,[["__scopeId","data-v-298ea2ea"]]);class Xle extends ai{constructor(e){super(e,Hle)}}const Yle={type:"reranker-node",model:li,view:Xle},L8=Object.freeze(Object.defineProperty({__proto__:null,default:Yle},Symbol.toStringTag,{value:"Module"})),qle={class:"title-decoration-1 mb-8"},Kle={class:"flex-between"},Zle={key:0,class:"w-full"},Jle={class:"flex align-center",style:{"line-height":"20px"}},Qle=["title"],ese={key:1,class:"w-full"},tse={class:"flex-between"},nse={class:"flex align-center"},rse={class:"flex align-center"},ose={class:"w-full"},ise={key:1},ase={class:"flex align-center mb-8"},lse=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=ja(),n=t,o=Ge(),r=Ge(),i=[{value:"contain",label:Pt("views.applicationWorkflow.compare.contain")},{value:"not_contain",label:Pt("views.applicationWorkflow.compare.not_contain")},{value:"eq",label:Pt("views.applicationWorkflow.compare.eq")}],a=fr(()=>e.path.includes("shared")?"systemShare":e.path.includes("resource-management")?"systemManage":e.path.includes("share/")?"workspaceShare":"workspace"),s={knowledge_id_list:[],search_scope_type:"custom",search_scope_source:"knowledge",search_scope_reference:[],search_mode:"auto",question_reference:[],search_condition_type:"AND",search_condition_list:[],knowledge_tags:[]},l=fr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",s),n.nodeModel.properties.node_data),set:R=>{Me.set(n.nodeModel.properties,"node_data",R)}}),f=Ge(),h=Ge(),v=Ge([]),_=Ge(!1);function E(R){const P=n.nodeModel.properties.node_data.knowledge_id_list.filter($=>$!==R);Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",P)}function O(R){Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",R.map(P=>P.id)),Me.set(n.nodeModel.properties.node_data,"knowledge_list",R),v.value=R}function w(){h.value&&h.value.open(l.value.knowledge_id_list)}function S(){const R=Me.cloneDeep(l.value.search_condition_list);R.push({key:"",compare:"contain",value:""}),Me.set(l.value,"search_condition_list",R)}function M(R){const P=Me.cloneDeep(l.value.search_condition_list);P.splice(R,1),Me.set(l.value,"search_condition_list",P)}function T(R){if(R.length===0){Me.set(l.value,"knowledge_tags",[]);return}oi({type:"knowledge",systemType:a.value}).getAllTags({knowledge_ids:R},{}).then(P=>{Me.set(l.value,"knowledge_tags",P.data)})}const B=()=>{var R,P,$;return Promise.all([(R=o.value)==null?void 0:R.validate(),(P=r.value)==null?void 0:P.validate(),($=f.value)==null?void 0:$.validate()]).catch(I=>Promise.reject({node:n.nodeModel,errMessage:I}))};return yo(()=>{v.value=n.nodeModel.properties.node_data.knowledge_list,Me.set(n.nodeModel,"validate",B)}),(R,P)=>{const $=te("el-button"),I=te("el-option"),F=te("el-select"),U=te("el-text"),z=te("KnowledgeIcon"),X=te("Close"),Y=te("el-icon"),W=te("el-form-item"),Q=te("el-tooltip"),J=te("el-radio"),ie=te("el-radio-group"),Se=te("el-col"),Ae=te("el-input"),Pe=te("el-row"),De=te("el-form"),He=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",qle,_e(R.$t("views.applicationWorkflow.nodeSetting")),1),k(He,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:P[8]||(P[8]=mn(()=>{},["prevent"])),model:l.value,"label-position":"top","hide-required-asterisk":"","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:f},{default:j(()=>[k(W,null,{label:j(()=>[ee("div",Kle,[ee("span",null,_e(R.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[l.value.search_scope_type==="custom"?(Te(),bt($,{key:0,type:"primary",link:"",onClick:w},{default:j(()=>[k(Lv,{iconName:"app-add-outlined"})]),_:1})):In("",!0),k(F,{teleported:!1,size:"small",modelValue:l.value.search_scope_type,"onUpdate:modelValue":P[0]||(P[0]=Ye=>l.value.search_scope_type=Ye),style:{width:"85px"}},{default:j(()=>[k(I,{label:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(I,{label:R.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var Ye;return[l.value.search_scope_type==="custom"?(Te(),cn("div",Zle,[((Ye=l.value.knowledge_id_list)==null?void 0:Ye.length)===0?(Te(),bt(U,{key:0,type:"info"},{default:j(()=>[ft(_e(R.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Te(!0),cn(Ir,{key:1},No(l.value.knowledge_id_list,(Be,Je)=>{var mt,le,Ze;return Te(),cn("div",{key:Je,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Jle,[k(z,{type:(mt=Wn(bs)(v.value,Be,"id"))==null?void 0:mt.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(le=Wn(bs)(v.value,Be,"id"))==null?void 0:le.name},_e((Ze=Wn(bs)(v.value,Be,"id"))==null?void 0:Ze.name),9,Qle)]),k($,{text:"",onClick:pe=>E(Be)},{default:j(()=>[k(Y,null,{default:j(()=>[k(X)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Te(),cn("div",ese,[k(W,{prop:"search_scope_reference",rules:{message:R.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",tse,[ee("span",null,[ft(_e(R.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),P[9]||(P[9]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[k(F,{teleported:!1,size:"small",modelValue:l.value.search_scope_source,"onUpdate:modelValue":P[1]||(P[1]=Be=>l.value.search_scope_source=Be),style:{width:"95px"},onChange:P[2]||(P[2]=Be=>l.value.search_scope_reference=[])},{default:j(()=>[k(I,{label:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(I,{label:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:o,nodeModel:t.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.variable.placeholder"),modelValue:l.value.search_scope_reference,"onUpdate:modelValue":P[3]||(P[3]=Be=>l.value.search_scope_reference=Be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(W,{label:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.searchSetting")},{default:j(()=>[k(ie,{modelValue:l.value.search_mode,"onUpdate:modelValue":P[4]||(P[4]=Ye=>l.value.search_mode=Ye)},{default:j(()=>[k(J,{value:"auto"},{default:j(()=>[ee("span",nse,[ft(_e(R.$t("views.applicationWorkflow.nodes.searchDocumentNode.auto"))+" ",1),k(Q,{content:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.autoTooltip"),placement:"top"},{default:j(()=>[k(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1}),l.value.search_scope_type==="custom"?(Te(),bt(J,{key:0,value:"custom"},{default:j(()=>[ee("span",rse,[ft(_e(R.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"))+" ",1),k(Q,{c:"",content:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.customTooltip"),placement:"top"},{default:j(()=>[k(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1})):In("",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"]),ee("div",ose,[l.value.search_mode==="auto"?(Te(),bt(W,{key:0,prop:"question_reference",rules:{message:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("span",null,[ft(_e(R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),P[10]||(P[10]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef2",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:R.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:l.value.question_reference,"onUpdate:modelValue":P[5]||(P[5]=Ye=>l.value.question_reference=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])):(Te(),cn("div",ise,[ee("div",ase,[k(U,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(R.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1)]),_:1}),k(F,{modelValue:l.value.search_condition_type,"onUpdate:modelValue":P[6]||(P[6]=Ye=>l.value.search_condition_type=Ye),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[k(I,{label:R.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),k(I,{label:R.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),k(U,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(R.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)]),_:1})]),(Te(!0),cn(Ir,null,No(l.value.search_condition_list,(Ye,Be)=>(Te(),cn("div",{key:Be},[k(Pe,{gutter:8,class:"mb-8"},{default:j(()=>[k(Se,{span:8},{default:j(()=>[k(F,{modelValue:Ye.key,"onUpdate:modelValue":Je=>Ye.key=Je,filterable:"",onFocus:P[7]||(P[7]=Je=>T(l.value.knowledge_id_list))},{default:j(()=>[(Te(!0),cn(Ir,null,No(l.value.knowledge_tags,Je=>(Te(),bt(I,{key:Je,label:Je.key,value:Je.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(Se,{span:7},{default:j(()=>[k(F,{modelValue:Ye.compare,"onUpdate:modelValue":Je=>Ye.compare=Je},{default:j(()=>[(Te(),cn(Ir,null,No(i,Je=>k(I,{key:Je.value,value:Je.value,label:Je.label},null,8,["value","label"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),k(Se,{span:8},{default:j(()=>[k(Ae,{modelValue:Ye.value,"onUpdate:modelValue":Je=>Ye.value=Je,placeholder:R.$t("views.applicationWorkflow.nodes.searchDocumentNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),k(Se,{span:1},{default:j(()=>[k($,{link:"",onClick:Je=>M(Be),type:"info",class:"mt-4"},{default:j(()=>[k(Lv,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]))),128)),k($,{link:"",type:"primary",onClick:S,class:"mt-8"},{default:j(()=>[k(Lv,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(R.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]))])]),_:1},8,["model"])]),_:1}),k($j,{ref_key:"AddKnowledgeDialogRef",ref:h,onAddData:O,data:v.value,loading:_.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class sse extends ai{constructor(e){super(e,lse)}}const use={type:"search-document-node",model:li,view:sse},I8=Object.freeze(Object.defineProperty({__proto__:null,default:use},Symbol.toStringTag,{value:"Module"})),cse={class:"title-decoration-1 mb-8"},dse={class:"flex-between"},fse={key:0,class:"w-full"},pse={class:"flex align-center",style:{"line-height":"20px"}},hse=["title"],vse={key:1,class:"w-full"},gse={class:"flex-between"},mse={class:"flex-between"},yse={class:"w-full"},_se={class:"flex-between"},bse={class:"flex-between"},wse=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o={knowledge_id_list:[],knowledge_setting:{top_n:3,similarity:.6,max_paragraph_char_number:5e3,search_mode:"embedding"},question_reference_address:[],show_knowledge:!1,search_scope_type:"custom",search_scope_source:"knowledge",search_scope_reference:[]},r=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",o),e.nodeModel.properties.node_data),set:S=>{Me.set(e.nodeModel.properties,"node_data",S)}}),i=Ge(),a=Ge(),s=Ge(),l=Ge([]),f=Ge(!1);function h(S){Me.set(e.nodeModel.properties.node_data,"knowledge_setting",S.knowledge_setting)}const v=()=>{var S;(S=a.value)==null||S.open(r.value,"WORK_FLOW")};function _(S){const M=e.nodeModel.properties.node_data.knowledge_id_list.filter(T=>T!==S);Me.set(e.nodeModel.properties.node_data,"knowledge_id_list",M)}function E(S){Me.set(e.nodeModel.properties.node_data,"knowledge_id_list",S.map(M=>M.id)),Me.set(e.nodeModel.properties.node_data,"knowledge_list",S),l.value=S}function O(){s.value&&s.value.open(r.value.knowledge_id_list)}const w=()=>{var S;return Promise.all([n.value.validate(),(S=i.value)==null?void 0:S.validate()]).catch(M=>Promise.reject({node:e.nodeModel,errMessage:M}))};return yo(()=>{l.value=e.nodeModel.properties.node_data.knowledge_list,r.value.show_knowledge=r.value.show_knowledge?r.value.show_knowledge:!1,r.value.search_scope_type=r.value.search_scope_type?r.value.search_scope_type:"custom",r.value.search_scope_source=r.value.search_scope_source?r.value.search_scope_source:"knowledge",r.value.knowledge_id_list=r.value.knowledge_id_list?r.value.knowledge_id_list:[],Me.set(e.nodeModel,"validate",w)}),(S,M)=>{const T=te("el-button"),B=te("el-option"),R=te("el-select"),P=te("el-text"),$=te("KnowledgeIcon"),I=te("Close"),F=te("el-icon"),U=te("el-form-item"),z=te("el-col"),X=te("el-row"),Y=te("el-switch"),W=te("el-form"),Q=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",cse,_e(S.$t("views.applicationWorkflow.nodeSetting")),1),k(Q,{shadow:"never",class:"card-never"},{default:j(()=>[k(W,{onSubmit:M[7]||(M[7]=mn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:i,"hide-required-asterisk":""},{default:j(()=>[k(U,null,{label:j(()=>[ee("div",dse,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[r.value.search_scope_type==="custom"?(Te(),bt(T,{key:0,type:"primary",link:"",onClick:O},{default:j(()=>[k(Lv,{iconName:"app-add-outlined"})]),_:1})):In("",!0),k(R,{teleported:!1,size:"small",modelValue:r.value.search_scope_type,"onUpdate:modelValue":M[0]||(M[0]=J=>r.value.search_scope_type=J),style:{width:"85px"}},{default:j(()=>[k(B,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),k(B,{label:S.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var J;return[r.value.search_scope_type==="custom"?(Te(),cn("div",fse,[((J=r.value.knowledge_id_list)==null?void 0:J.length)===0?(Te(),bt(P,{key:0,type:"info"},{default:j(()=>[ft(_e(S.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Te(!0),cn(Ir,{key:1},No(r.value.knowledge_id_list,(ie,Se)=>{var Ae,Pe,De;return Te(),cn("div",{key:Se,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",pse,[k($,{type:(Ae=Wn(bs)(l.value,ie,"id"))==null?void 0:Ae.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(Pe=Wn(bs)(l.value,ie,"id"))==null?void 0:Pe.name},_e((De=Wn(bs)(l.value,ie,"id"))==null?void 0:De.name),9,hse)]),k(T,{text:"",onClick:He=>_(ie)},{default:j(()=>[k(F,null,{default:j(()=>[k(I)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Te(),cn("div",vse,[k(U,{prop:"search_scope_reference",rules:{message:S.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",gse,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),M[8]||(M[8]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[k(R,{teleported:!1,size:"small",modelValue:r.value.search_scope_source,"onUpdate:modelValue":M[1]||(M[1]=ie=>r.value.search_scope_source=ie),style:{width:"95px"},onChange:M[2]||(M[2]=ie=>r.value.search_scope_reference=[])},{default:j(()=>[k(B,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),k(B,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:n,nodeModel:t.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.variable.placeholder"),modelValue:r.value.search_scope_reference,"onUpdate:modelValue":M[3]||(M[3]=ie=>r.value.search_scope_reference=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),k(U,{label:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",mse,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),k(T,{type:"primary",link:"",onClick:v},{default:j(()=>[k(Lv,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",yse,[k(X,null,{default:j(()=>[k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.selectSearchMode")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(S.$t(Wn(v9)[r.value.knowledge_setting.search_mode])),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.similarityThreshold")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=r.value.knowledge_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.topReferences")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.top_n),1)]),_:1}),k(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.maxCharacters")),1)]),_:1}),k(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),k(U,{prop:"question_reference_address",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",_se,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),M[9]||(M[9]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:n,nodeModel:t.nodeModel,class:"w-full",placeholder:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:r.value.question_reference_address,"onUpdate:modelValue":M[4]||(M[4]=J=>r.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(U,{prop:"show_knowledge",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.requiredMessage"),trigger:"blur",required:!0},onClick:M[6]||(M[6]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",bse,[ee("span",null,[ft(_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"))+" ",1),M[10]||(M[10]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Y,{size:"small",modelValue:r.value.show_knowledge,"onUpdate:modelValue":M[5]||(M[5]=J=>r.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),k(A9,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:h},null,512),k($j,{ref_key:"AddknowledgeDialogRef",ref:s,onAddData:E,data:l.value,loading:f.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class Ese extends ai{constructor(e){super(e,wse)}}const xse={type:"search-knowledge-node",model:li,view:Ese},F8=Object.freeze(Object.defineProperty({__proto__:null,default:xse},Symbol.toStringTag,{value:"Module"})),Ose={class:"title-decoration-1 mb-8"},Sse={class:"flex-between w-full"},Ase={class:"flex-between w-full"},Mse={class:"flex align-center"},Tse={class:"mr-4"},Cse=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(),l=Ge(),f=Ge(),h=()=>{var B;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(B=l.value)==null?void 0:B.validate()]).catch(R=>Promise.reject({node:i.nodeModel,errMessage:R}))},v=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),_={stt_model_id:"",is_result:!0,audio_list:[],model_params_setting:{}},E=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",_),i.nodeModel.properties.node_data),set:B=>{Me.set(i.nodeModel.properties,"node_data",B)}}),O=()=>{var R;const B=E.value.stt_model_id;if(!B){Sh(Pt("views.application.form.voiceInput.requiredMessage"));return}(R=s.value)==null||R.open(B,o,E.value.model_params_setting)},w=B=>{Me.set(i.nodeModel.properties.node_data,"model_params_setting",B)};function S(B){var R;B?(R=s.value)==null||R.reset_default(B,o):w({})}const M=e();function T(){var R;const B=r.value==="systemManage"?{model_type:"STT",workspace_id:(R=M.value)==null?void 0:R.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList(B).then(P=>{a.value=Me.groupBy(P==null?void 0:P.data,"provider")})}return yo(()=>{T(),Me.set(i.nodeModel,"validate",h)}),(B,R)=>{const P=te("AppIcon"),$=te("el-button"),I=te("ModelSelect"),F=te("el-form-item"),U=te("el-tooltip"),z=te("el-switch"),X=te("el-form"),Y=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Ose,_e(B.$t("views.applicationWorkflow.nodeSetting")),1),k(Y,{shadow:"never",class:"card-never"},{default:j(()=>[k(X,{onSubmit:R[4]||(R[4]=mn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(F,{label:B.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label"),prop:"stt_model_id",rules:{required:!0,message:B.$t("views.application.form.voiceInput.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Sse,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label")),1),R[5]||(R[5]=ee("span",{class:"color-danger"},"*",-1))])]),k($,{type:"primary",link:"",onClick:O,disabled:!E.value.stt_model_id,class:"mr-4"},{default:j(()=>[k(P,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(I,{onWheel:v,teleported:!1,onChange:S,modelValue:E.value.stt_model_id,"onUpdate:modelValue":R[0]||(R[0]=W=>E.value.stt_model_id=W),placeholder:B.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(F,{label:B.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:B.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Ase,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label")),1),R[6]||(R[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:E.value.audio_list,"onUpdate:modelValue":R[1]||(R[1]=W=>E.value.audio_list=W)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(F,{label:B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:R[3]||(R[3]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Mse,[ee("div",Tse,[ee("span",null,_e(B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(U,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(P,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(z,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":R[2]||(R[2]=W=>E.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(M9,{ref_key:"STTModeParamSettingDialogRef",ref:s,onRefresh:w},null,512)]),_:1},8,["node-model"])}}});class Nse extends ai{constructor(e){super(e,Cse)}}const kse={type:"speech-to-text-node",model:li,view:Nse},B8=Object.freeze(Object.defineProperty({__proto__:null,default:kse},Symbol.toStringTag,{value:"Module"})),Pse={class:"title-decoration-1 mb-8"},Rse={class:"break-all"},Dse={class:"title-decoration-1 mb-8"},jse={class:"break-all"},Lse=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=Ge(!1),o=[{label:Pt("views.applicationWorkflow.nodes.startNode.currentTime"),value:"time"},{label:Pt("views.application.form.historyRecord.label"),value:"history_context"},{label:Pt("chat.chatId"),value:"chat_id"},{label:Pt("chat.chatUserId"),value:"chat_user_id"},{label:Pt("chat.chatUserType"),value:"chat_user_type"},{label:Pt("views.chatUser.title"),value:"chat_user"}],r=()=>{const l=e.nodeModel.graphModel.nodes.filter(h=>h.id==="base-node").map(h=>Me.cloneDeep(h.properties.user_input_field_list)).reduce((h,v)=>[...h,...v],[]).map(h=>h.label&&h.label.input_type==="TooltipLabel"?{label:h.label.label,value:h.field||h.variable}:{label:h.label||h.name,value:h.field||h.variable}),f=e.nodeModel.graphModel.nodes.filter(h=>h.id==="base-node").map(h=>Me.cloneDeep(h.properties.api_input_field_list)).reduce((h,v)=>[...h,...v],[]).map(h=>({label:h.name||h.variable,value:h.variable}));return[...l,...f]},i=()=>{const l=r();Me.set(e.nodeModel.properties.config,"globalFields",[...o,...l])},a=()=>{const l=e.nodeModel.graphModel.nodes.filter(f=>f.id==="base-node").map(f=>Me.cloneDeep(f.properties.chat_input_field_list)).reduce((f,h)=>[...f,...h],[]).map(f=>({label:f.label,value:f.field}));Me.set(e.nodeModel.properties.config,"chatFields",l)};e.nodeModel.graphModel.eventCenter.on("refreshFieldList",i),e.nodeModel.graphModel.eventCenter.on("chatFieldList",a);const s=()=>{let l=Me.cloneDeep(e.nodeModel.properties.config.fields);const f=e.nodeModel.graphModel.nodes.filter(v=>v.id==="base-node").filter(v=>v.properties.node_data.file_upload_enable).map(v=>Me.cloneDeep(v.properties.node_data.file_upload_setting)).filter(v=>v);if(l=l.filter(v=>v.value!=="image"&&v.value!=="document"&&v.value!=="audio"&&v.value!=="video"&&v.value!=="other"),f.length===0){Me.set(e.nodeModel.properties.config,"fields",l);return}const h=[];f[0].document&&h.push({label:Pt("common.fileUpload.document"),value:"document"}),f[0].image&&h.push({label:Pt("common.fileUpload.image"),value:"image"}),f[0].audio&&h.push({label:Pt("common.fileUpload.audio"),value:"audio"}),f[0].video&&h.push({label:Pt("common.fileUpload.video"),value:"video"}),f[0].other&&h.push({label:Pt("common.fileUpload.other"),value:"other"}),Me.set(e.nodeModel.properties.config,"fields",[...l,...h])};return e.nodeModel.graphModel.eventCenter.on("refreshFileUploadConfig",s),yo(()=>{a(),i(),s()}),(l,f)=>{const h=te("AppIcon"),v=te("el-button"),_=te("el-tooltip");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>{var E;return[ee("h5",Pse,_e(l.$t("views.applicationWorkflow.variable.global")),1),(Te(!0),cn(Ir,null,No(t.nodeModel.properties.config.globalFields,(O,w)=>(Te(),cn("div",{key:w,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:f[0]||(f[0]=S=>n.value=!0),onMouseleave:f[1]||(f[1]=S=>n.value=!1)},[ee("span",Rse,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Te(),bt(_,{key:0,effect:"dark",content:l.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(v,{link:"",onClick:S=>Wn(x_)(`{{global.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[k(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):In("",!0)],32))),128)),(E=t.nodeModel.properties.config.chatFields)!=null&&E.length?(Te(),cn(Ir,{key:0},[ee("h5",Dse,_e(l.$t("views.applicationWorkflow.variable.chat")),1),(Te(!0),cn(Ir,null,No(t.nodeModel.properties.config.chatFields||[],(O,w)=>(Te(),cn("div",{key:w,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:f[2]||(f[2]=S=>n.value=!0),onMouseleave:f[3]||(f[3]=S=>n.value=!1)},[ee("span",jse,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Te(),bt(_,{key:0,effect:"dark",content:l.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(v,{link:"",onClick:S=>Wn(x_)(`{{chat.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[k(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):In("",!0)],32))),128))],64)):In("",!0)]}),_:1},8,["nodeModel"])}}});class Ise extends ai{constructor(e){super(e,Lse)}}const Fse={type:"start-node",model:li,view:Ise},$8=Object.freeze(Object.defineProperty({__proto__:null,default:Fse},Symbol.toStringTag,{value:"Module"})),Bse={class:"title-decoration-1 mb-8"},$se={class:"flex-between w-full"},Use={class:"flex-between w-full"},Vse={class:"flex align-center"},Wse={class:"mr-4"},Gse=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(),s=Ge(null),l=Ge(),f=Ge(),h=()=>{var T;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(T=l.value)==null?void 0:T.validate()]).catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},v=T=>T.ctrlKey===!0?(T.preventDefault(),!0):(T.stopPropagation(),!0),_={tts_model_id:"",is_result:!0,content_list:[],model_params_setting:{}},E=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",_),i.nodeModel.properties.node_data),set:T=>{Me.set(i.nodeModel.properties,"node_data",T)}}),O=e();function w(){var B;const T=r.value==="systemManage"?{model_type:"TTS",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(T).then(R=>{s.value=Me.groupBy(R==null?void 0:R.data,"provider")})}const S=()=>{var B;const T=E.value.tts_model_id;if(!T){Sh(Pt("views.application.form.voicePlay.requiredMessage"));return}(B=a.value)==null||B.open(T,o,E.value.model_params_setting)},M=T=>{E.value.model_params_setting=T};return yo(()=>{w(),Me.set(i.nodeModel,"validate",h)}),(T,B)=>{const R=te("AppIcon"),P=te("el-button"),$=te("ModelSelect"),I=te("el-form-item"),F=te("el-tooltip"),U=te("el-switch"),z=te("el-form"),X=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Bse,_e(T.$t("views.applicationWorkflow.nodeSetting")),1),k(X,{shadow:"never",class:"card-never"},{default:j(()=>[k(z,{onSubmit:B[4]||(B[4]=mn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(I,{label:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label"),prop:"tts_model_id",rules:{required:!0,message:T.$t("views.application.form.voicePlay.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",$se,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label")),1),B[5]||(B[5]=ee("span",{class:"color-danger"},"*",-1))])]),k(P,{type:"primary",link:"",onClick:S,disabled:!E.value.tts_model_id,class:"mr-4"},{default:j(()=>[k(R,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k($,{onWheel:v,teleported:!1,modelValue:E.value.tts_model_id,"onUpdate:modelValue":B[0]||(B[0]=Y=>E.value.tts_model_id=Y),placeholder:T.$t("views.application.form.voicePlay.placeholder"),options:s.value,showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(I,{prop:"content_list",label:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),rules:{message:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Use,[ee("div",null,[ee("span",null,[ft(_e(T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label")),1),B[6]||(B[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:T.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:E.value.content_list,"onUpdate:modelValue":B[1]||(B[1]=Y=>E.value.content_list=Y)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(I,{label:T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[3]||(B[3]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Vse,[ee("div",Wse,[ee("span",null,_e(T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(F,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(T.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(R,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(U,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":B[2]||(B[2]=Y=>E.value.is_result=Y)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(Bj,{ref_key:"TTSModeParamSettingDialogRef",ref:a,onRefresh:M},null,512)]),_:1},8,["node-model"])}}});class zse extends ai{constructor(e){super(e,Gse)}}const Hse={type:"text-to-speech-node",model:li,view:zse},U8=Object.freeze(Object.defineProperty({__proto__:null,default:Hse},Symbol.toStringTag,{value:"Module"})),Xse={class:"title-decoration-1 mb-8"},Yse={class:"flex-between w-full"},qse={class:"flex align-center"},Kse={class:"mr-4"},Zse={class:"flex align-center"},Jse={class:"mr-4"},Qse={class:"flex align-center"},eue={class:"mr-4"},tue=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(),l=Ge(),f=()=>{var P;return(P=l.value)==null?void 0:P.validate().catch($=>Promise.reject({node:i.nodeModel,errMessage:$}))},h=P=>P.ctrlKey===!0?(P.preventDefault(),!0):(P.stopPropagation(),!0),_={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null},E=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",_),i.nodeModel.properties.node_data),set:P=>{Me.set(i.nodeModel.properties,"node_data",P)}}),O=e();function w(){var $;const P=r.value==="systemManage"?{model_type:"TTV",workspace_id:($=O.value)==null?void 0:$.workspace_id}:{model_type:"TTV"};oi({type:"model",systemType:r.value}).getSelectModelList(P).then(I=>{a.value=Me.groupBy(I==null?void 0:I.data,"provider")})}const S=()=>{up(()=>{var P;E.value.model_id?(P=s.value)==null||P.reset_default(E.value.model_id,o):T({})})},M=P=>{var $;P&&(($=s.value)==null||$.open(P,o,E.value.model_params_setting))};function T(P){Me.set(i.nodeModel.properties.node_data,"model_params_setting",P)}function B(P){Me.set(i.nodeModel.properties.node_data,"prompt",P)}function R(P){Me.set(i.nodeModel.properties.node_data,"negative_prompt",P)}return yo(()=>{w(),Me.set(i.nodeModel,"validate",f)}),(P,$)=>{const I=te("AppIcon"),F=te("el-button"),U=te("ModelSelect"),z=te("el-form-item"),X=te("el-tooltip"),Y=te("MdEditorMagnify"),W=te("el-switch"),Q=te("el-form"),J=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Xse,_e(P.$t("views.applicationWorkflow.nodeSetting")),1),k(J,{shadow:"never",class:"card-never"},{default:j(()=>[k(Q,{onSubmit:$[6]||($[6]=mn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Yse,[ee("div",null,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label")),1),$[7]||($[7]=ee("span",{class:"color-danger"},"*",-1))])]),k(F,{disabled:!E.value.model_id,type:"primary",link:"",onClick:$[0]||($[0]=ie=>M(E.value.model_id)),onRefreshForm:T},{default:j(()=>[k(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(U,{onChange:S,onWheel:h,onFocus:w,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":$[1]||($[1]=ie=>E.value.model_id=ie),placeholder:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"TTV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",qse,[ee("div",Kse,[ee("span",null,[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label")),1),$[8]||($[8]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),modelValue:E.value.prompt,"onUpdate:modelValue":$[2]||($[2]=ie=>E.value.prompt=ie),style:{height:"150px"},onSubmitDialog:B},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:P.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Zse,[ee("div",Jse,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Y,{onWheel:h,title:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),modelValue:E.value.negative_prompt,"onUpdate:modelValue":$[3]||($[3]=ie=>E.value.negative_prompt=ie),placeholder:P.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:R},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(z,{label:P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[5]||($[5]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Qse,[ee("div",eue,[ee("span",null,_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(P.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(I,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(W,{size:"small",modelValue:E.value.is_result,"onUpdate:modelValue":$[4]||($[4]=ie=>E.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:T},null,512)]),_:1},8,["node-model"])}}});class nue extends ai{constructor(e){super(e,tue)}}const rue={type:"text-to-video-node",model:li,view:nue},V8=Object.freeze(Object.defineProperty({__proto__:null,default:rue},Symbol.toStringTag,{value:"Module"})),oue={class:"title-decoration-1 mb-16"},iue={class:"lighter mb-8"},aue={key:0},lue={class:"flex-between"},sue={class:"flex align-center"},uue={class:"mr-4"},cue={key:1,class:"color-danger"},due={class:"flex align-center"},fue={class:"mr-4"},pue=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=ja(),o=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),r=Ge(),i={input_field_list:[],is_result:!1},a=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:h=>{Me.set(e.nodeModel.properties,"node_data",h)}}),s=Ge(),l=()=>{var h;return(h=s.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))},f=()=>{if(!e.nodeModel.properties.node_data.tool_lib_id){Me.set(e.nodeModel.properties,"status",500);return}oi({type:"tool",systemType:o.value}).getToolById(e.nodeModel.properties.node_data.tool_lib_id).then(h=>{const v=e.nodeModel.properties.node_data.input_field_list,_=h.data.input_field_list.map(E=>{const O=v.find(w=>w.name==E.name);return O&&O.source==E.source?{...E,value:JSON.parse(JSON.stringify(O.value))}:{...E,value:E.source=="reference"?[]:""}});Me.set(e.nodeModel.properties.node_data,"input_field_list",_),Me.set(e.nodeModel.properties,"status",h.data.is_active?200:500)}).catch(()=>{Me.set(e.nodeModel.properties,"status",500)})};return yo(()=>{var h;typeof((h=e.nodeModel.properties.node_data)==null?void 0:h.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),f(),Me.set(e.nodeModel,"validate",l)}),(h,v)=>{const _=te("auto-tooltip"),E=te("AppIcon"),O=te("el-tooltip"),w=te("el-tag"),S=te("el-input"),M=te("el-form-item"),T=te("el-text"),B=te("el-card"),R=te("el-switch"),P=te("el-form");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",oue,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),ee("h5",iue,_e(h.$t("common.param.inputParam")),1),k(P,{onSubmit:v[2]||(v[2]=mn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:s,model:a.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(B,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var $;return[(($=a.value.input_field_list)==null?void 0:$.length)>0?(Te(),cn("div",aue,[(Te(!0),cn(Ir,null,No(a.value.input_field_list,(I,F)=>(Te(),bt(M,{key:I.name,label:I.name,prop:"input_field_list."+F+".value",rules:{required:I.is_required,message:I.source==="reference"?h.$t("views.tool.form.param.selectPlaceholder"):h.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",lue,[ee("div",sue,[ee("div",uue,[k(_,{content:I.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(I.name),1)]),_:2},1032,["content"])]),I.desc?(Te(),bt(O,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.desc),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):In("",!0),I.is_required?(Te(),cn("span",cue,"*")):In("",!0),k(w,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(I.type),1)]),_:2},1024)])])]),default:j(()=>[I.source==="reference"?(Te(),bt(Go,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:h.$t("views.tool.form.param.selectPlaceholder"),modelValue:I.value,"onUpdate:modelValue":U=>I.value=U},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Te(),bt(S,{key:1,modelValue:I.value,"onUpdate:modelValue":U=>I.value=U,placeholder:h.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Te(),bt(T,{key:1,type:"info"},{default:j(()=>[ft(_e(h.$t("common.noData")),1)]),_:1}))]}),_:1}),k(M,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[1]||(v[1]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",due,[ee("div",fue,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(O,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(R,{size:"small",modelValue:a.value.is_result,"onUpdate:modelValue":v[0]||(v[0]=$=>a.value.is_result=$)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class hue extends ai{constructor(e){super(e,pue)}}const vue={type:"tool-lib-node",model:li,view:hue},W8=Object.freeze(Object.defineProperty({__proto__:null,default:vue},Symbol.toStringTag,{value:"Module"})),gue={class:"title-decoration-1 mb-16"},mue={class:"flex-between"},yue={class:"lighter mb-8"},_ue={key:0},bue={class:"flex-between"},wue={class:"flex align-center"},Eue={class:"mr-4"},xue={key:1,class:"color-danger"},Oue={class:"lighter mb-8"},Sue={key:0,class:"mb-8"},Aue={class:"flex align-center"},Mue={class:"mr-4"},Tue=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=w=>w.ctrlKey===!0?(w.preventDefault(),!0):(w.stopPropagation(),!0),o=Ge(),r=Ge(),i={code:"",input_field_list:[],is_result:!1},a=Ge(null),s=Ge(!1),l=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:w=>{Me.set(e.nodeModel.properties,"node_data",w)}}),f=Ge(),h=()=>{var w;return(w=f.value)==null?void 0:w.validate().catch(S=>Promise.reject({node:e.nodeModel,errMessage:S}))};function v(w){Me.set(e.nodeModel.properties.node_data,"code",w)}function _(w,S){typeof S<"u"&&(a.value=S),o.value.open(w)}function E(w){const S=Me.cloneDeep(e.nodeModel.properties.node_data.input_field_list);S.splice(w,1),Me.set(e.nodeModel.properties.node_data,"input_field_list",S)}function O(w){const S=Me.cloneDeep(e.nodeModel.properties.node_data.input_field_list),M={...w,value:w.source==="reference"?[]:""};a.value!==null?S.splice(a.value,1,M):S.push(M),Me.set(e.nodeModel.properties.node_data,"input_field_list",S),a.value=null}return yo(()=>{var w;typeof((w=e.nodeModel.properties.node_data)==null?void 0:w.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",h),setTimeout(()=>{s.value=!0},100)}),(w,S)=>{const M=te("AppIcon"),T=te("el-button"),B=te("auto-tooltip"),R=te("el-tooltip"),P=te("el-tag"),$=te("el-input"),I=te("el-form-item"),F=te("el-text"),U=te("el-card"),z=te("CodemirrorEditor"),X=te("el-switch"),Y=te("el-form");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",gue,_e(w.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",mue,[ee("h5",yue,_e(w.$t("common.param.inputParam")),1),k(T,{link:"",type:"primary",onClick:S[0]||(S[0]=W=>_())},{default:j(()=>[k(M,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(w.$t("common.add")),1)]),_:1})]),k(Y,{onSubmit:S[4]||(S[4]=mn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:f,model:l.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(U,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var W;return[((W=l.value.input_field_list)==null?void 0:W.length)>0?(Te(),cn("div",_ue,[(Te(!0),cn(Ir,null,No(l.value.input_field_list,(Q,J)=>(Te(),bt(I,{key:J,label:Q.name,prop:"input_field_list."+J+".value",rules:{required:Q.is_required,message:Q.source==="reference"?w.$t("views.tool.form.param.selectPlaceholder"):w.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",bue,[ee("div",wue,[ee("div",Eue,[k(B,{content:Q.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(Q.name),1)]),_:2},1032,["content"])]),Q.desc?(Te(),bt(R,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Q.desc),1)]),default:j(()=>[k(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):In("",!0),Q.is_required?(Te(),cn("span",xue,"*")):In("",!0),k(P,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(Q.type),1)]),_:2},1024)]),ee("div",null,[k(T,{text:"",onClick:mn(ie=>_(Q,J),["stop"])},{default:j(()=>[k(M,{iconName:"app-edit"})]),_:1},8,["onClick"]),k(T,{text:"",onClick:ie=>E(J),style:{"margin-left":"4px !important"}},{default:j(()=>[k(M,{iconName:"app-delete"})]),_:1},8,["onClick"])])])]),default:j(()=>[Q.source==="reference"?(Te(),bt(Go,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:w.$t("views.tool.form.param.selectPlaceholder"),modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,width:100},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Te(),bt($,{key:1,modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:w.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Te(),bt(F,{key:1,type:"info"},{default:j(()=>[ft(_e(w.$t("common.noData")),1)]),_:1}))]}),_:1}),ee("h5",Oue,_e(w.$t("views.tool.form.param.code")),1),s.value?(Te(),cn("div",Sue,[k(z,{title:w.$t("views.tool.form.param.code"),modelValue:l.value.code,"onUpdate:modelValue":S[1]||(S[1]=W=>l.value.code=W),onWheel:n,style:{height:"130px !important"},onSubmitDialog:v},null,8,["title","modelValue"])])):In("",!0),k(I,{label:w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:S[3]||(S[3]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Aue,[ee("div",Mue,[ee("span",null,_e(w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(R,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(w.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(X,{size:"small",modelValue:l.value.is_result,"onUpdate:modelValue":S[2]||(S[2]=W=>l.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"]),k(l7,{ref_key:"FieldFormDialogRef",ref:o,onRefresh:O},null,512)]),_:1},8,["nodeModel"])}}});class Cue extends ai{constructor(e){super(e,Tue)}}const Nue={type:"tool-node",model:li,view:Cue},G8=Object.freeze(Object.defineProperty({__proto__:null,default:Nue},Symbol.toStringTag,{value:"Module"})),kue={class:"dialog-footer"},Pue=gr({__name:"GroupFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge(!1),s=Ge(null),l=Ge({field:"",label:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:Pt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=Ge(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},_=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:_}),(O,w)=>{const S=te("el-input"),M=te("el-form-item"),T=te("el-form"),B=te("el-button"),R=te("el-dialog");return Te(),bt(R,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableAggregationNode.editGroup"):O.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup"),modelValue:h.value,"onUpdate:modelValue":w[3]||(w[3]=P=>h.value=P),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":_,"append-to-body":""},{footer:j(()=>[ee("span",kue,[k(B,{onClick:mn(_,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(B,{type:"primary",onClick:w[2]||(w[2]=P=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?O.$t("common.save"):O.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(T,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[k(M,{label:O.$t("common.variable"),prop:"field"},{default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=P=>l.value.field=P),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),k(M,{label:O.$t("dynamicsForm.paramForm.name.label"),prop:"label"},{default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=P=>l.value.label=P),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),Rue={class:"title-decoration-1 mb-8"},Due={class:"flex-between"},jue={class:"flex-between mb-12"},Lue=["title"],Iue={class:"flex align-center",style:{"margin-right":"-3px"}},Fue=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(),r=Ge(),i={strategy:"first_non_null",group_list:[{id:yu(),label:"Group1",field:"Group1",variable_list:[{v_id:yu(),variable:[]}]}]},a=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:M=>{Me.set(e.nodeModel.properties,"node_data",M)}}),s=Ge([]);function l(M,T){let B=null;M&&T!==void 0&&(B={field:M.field,label:M.label}),r.value.open(B,T)}function f(M,T){for(let R=0;R<s.value.length;R++)if(s.value[R].field===M.field&&T!==R){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+M.field);return}[void 0,null].includes(T)?(s.value.push(M),O(M)):(s.value.splice(T,1,M),h(M,T)),r.value.close();const B=[...s.value.map(R=>({label:R.label,value:R.field}))];Me.set(e.nodeModel.properties.config,"fields",B)}const h=(M,T)=>{const B=Me.cloneDeep(a.value.group_list);B[T].field=M.field,B[T].label=M.label,a.value.group_list=B},v=M=>{const T=Me.cloneDeep(a.value.group_list);T.splice(M,1),a.value.group_list=T,s.value.splice(M,1);const B=T.map(R=>({label:R.label,value:R.field}));Me.set(e.nodeModel.properties.config,"fields",B)},_=M=>{const T=Me.cloneDeep(a.value.group_list);T[M].variable_list.push({v_id:yu(),variable:[]}),a.value.group_list=T},E=(M,T)=>{const B=Me.cloneDeep(a.value.group_list);B[M].variable_list.splice(T,1),a.value.group_list=B},O=M=>{const T=Me.cloneDeep(a.value.group_list);T.push({id:yu(),field:M.field,label:M.label,variable_list:[{v_id:yu(),variable:[]}]}),a.value.group_list=T},w=async()=>{var T;const M=[...o.value.map(B=>B.validate()),(T=n.value)==null?void 0:T.validate()];return Promise.all(M).catch(B=>Promise.reject({node:e.nodeModel,errMessage:B}))};function S(M,T){const{oldIndex:B,newIndex:R}=M;if(B===void 0||R===void 0)return;const P=Me.cloneDeep(e.nodeModel.properties.node_data.group_list[T].variable_list),$={...P[B]},I={...P[R]};P[R]=$,P[B]=I,Me.set(e.nodeModel.properties.node_data.group_list[T],"variable_list",P)}return yo(()=>{var T;typeof((T=e.nodeModel.properties.node_data)==null?void 0:T.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",w),e.nodeModel.properties.node_data.group_list&&(s.value=a.value.group_list.map(B=>({label:B.label,field:B.field})));const M=a.value.group_list.map(B=>({label:B.label,value:B.field}));Me.set(e.nodeModel.properties.config,"fields",M)}),(M,T)=>{const B=te("el-option"),R=te("el-select"),P=te("el-form-item"),$=te("EditPen"),I=te("el-icon"),F=te("el-button"),U=te("AppIcon"),z=te("el-col"),X=te("el-row"),Y=te("el-card"),W=te("el-form");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Rue,_e(M.$t("views.applicationWorkflow.nodeSetting")),1),k(W,{onSubmit:T[2]||(T[2]=mn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableAggregationRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[k(P,{label:M.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"),rules:{required:!0,trigger:"change"}},{label:j(()=>[ee("div",Due,[ee("div",null,[ee("span",null,[ft(_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.Strategy"))+" ",1),T[3]||(T[3]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[k(R,{modelValue:a.value.strategy,"onUpdate:modelValue":T[0]||(T[0]=Q=>a.value.strategy=Q)},{default:j(()=>[k(B,{label:Wn(Pt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder"),value:"first_non_null"},null,8,["label"]),k(B,{label:Wn(Pt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder1"),value:"variable_to_json"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label"]),(Te(!0),cn(Ir,null,No(a.value.group_list,(Q,J)=>(Te(),cn("div",{key:Q.id,class:"mb-8"},[k(Y,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[ee("div",jue,[ee("span",{class:"ellipsis",title:Q.label},_e(Q.label),9,Lue),ee("div",Iue,[k(F,{onClick:ie=>l(Q,J),link:""},{default:j(()=>[k(I,null,{default:j(()=>[k($)]),_:1})]),_:1},8,["onClick"]),k(F,{onClick:ie=>v(J),link:"",disabled:a.value.group_list.length<=1},{default:j(()=>[k(U,{iconName:"app-delete"})]),_:1},8,["onClick","disabled"])])]),k(Wn(Yj),{ref_for:!0,ref:"el",modelValue:Q.variable_list,disabled:Q.variable_list.length===1,handle:".handle",animation:150,ghostClass:"ghost",onEnd:ie=>S(ie,J)},{default:j(()=>[(Te(!0),cn(Ir,null,No(Q.variable_list,(ie,Se)=>(Te(),cn("div",{key:ie.v_id,class:"drag-card"},[k(X,{class:"handle"},{default:j(()=>[k(z,{span:22,class:"flex"},{default:j(()=>[T[4]||(T[4]=ee("img",{src:qj,alt:"",height:"15",class:"mr-4 mt-8"},null,-1)),k(P,{prop:`group_list.${J}.variable_list.${Se}.variable`,rules:{type:"array",required:!0,message:M.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:o,nodeModel:t.nodeModel,style:{width:"200px"},placeholder:M.$t("views.applicationWorkflow.variable.placeholder"),modelValue:ie.variable,"onUpdate:modelValue":Ae=>ie.variable=Ae},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),k(z,{span:2},{default:j(()=>[k(F,{link:"",class:"mt-4 ml-4",disabled:Q.variable_list.length<=1,onClick:Ae=>E(J,Se)},{default:j(()=>[k(U,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024)]))),128))]),_:2},1032,["modelValue","disabled","onEnd"]),k(F,{onClick:ie=>_(J),type:"primary",size:"large",link:""},{default:j(()=>[k(U,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("common.add")),1)]),_:1},8,["onClick"])]),_:2},1024)]))),128)),k(F,{onClick:T[1]||(T[1]=Q=>l()),type:"primary",size:"large",link:""},{default:j(()=>[k(U,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup")),1)]),_:1})]),_:1},8,["model"]),k(Pue,{ref_key:"GroupFieldDialogRef",ref:r,onRefresh:f},null,512)]),_:1},8,["nodeModel"])}}});class Bue extends ai{constructor(e){super(e,Fue)}getConfig(e){return e.model.properties.config}}const $ue={type:"variable-aggregation-node",model:li,view:Bue},z8=Object.freeze(Object.defineProperty({__proto__:null,default:$ue},Symbol.toStringTag,{value:"Module"})),Uue={class:"flex-between"},Vue={class:"flex-between mb-8"},Wue={class:"lighter"},Gue={key:0,class:"flex w-full"},zue=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("workflowMode"),n=t,o=["string","num","json","bool"],r=O=>O.ctrlKey===!0?(O.preventDefault(),!0):(O.stopPropagation(),!0),i={variable_list:[{id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""}]};Ge(1);const a=fr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",i),n.nodeModel.properties.node_data),set:O=>{Me.set(n.nodeModel.properties,"node_data",O)}}),s=Ge(),l=Ge(),f=Ge(),h=async()=>{var w;let O=[(w=s.value)==null?void 0:w.validate(),...l.value.map(S=>S.validate())];return f.value&&(O=[...O,...l.value.map(S=>S.validate())]),Promise.all(O).catch(S=>Promise.reject({node:n.nodeModel,errMessage:S}))};function v(){const O=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list),w={id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""};O.push(w),Me.set(n.nodeModel.properties.node_data,"variable_list",O)}function _(O){const w=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list);w.splice(O,1),Me.set(n.nodeModel.properties.node_data,"variable_list",w)}function E(O){(e==nc.ApplicationLoop?[...n.nodeModel.graphModel.nodes,...n.nodeModel.graphModel.get_parent_nodes()]:n.nodeModel.graphModel.nodes).map(w=>{w.id==="start-node"&&(w.properties.config.globalFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)}),w.properties.config.chatFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)})),w.id==="loop-start-node"&&w.properties.loop_input_field_list.forEach(S=>{S.field===O.fields[1]&&(O.name=S.label)})})}return yo(()=>{var O;typeof((O=n.nodeModel.properties.node_data)==null?void 0:O.is_result)>"u"&&Qd(n.nodeModel)&&Me.set(n.nodeModel.properties.node_data,"is_result",!0),Me.set(n.nodeModel,"validate",h)}),(O,w)=>{const S=te("AppIcon"),M=te("el-button"),T=te("el-form-item"),B=te("el-option"),R=te("el-select"),P=te("el-input"),$=te("el-input-number"),I=te("CodemirrorEditor"),F=te("el-card"),U=te("el-form");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[k(U,{onSubmit:w[0]||(w[0]=mn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[(Te(!0),cn(Ir,null,No(a.value.variable_list,(z,X)=>(Te(),bt(F,{key:z.id,shadow:"never",class:"card-never mb-8",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(T,null,{label:j(()=>[ee("div",Uue,[ee("div",null,[ft(_e(O.$t("common.variable"))+" ",1),w[1]||(w[1]=ee("span",{class:"color-danger"},"*",-1))]),a.value.variable_list.length>1?(Te(),bt(M,{key:0,text:"",onClick:Y=>_(X)},{default:j(()=>[k(S,{iconName:"app-delete"})]),_:1},8,["onClick"])):In("",!0)])]),default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:l,nodeModel:t.nodeModel,class:"w-full",placeholder:O.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.fields,"onUpdate:modelValue":Y=>z.fields=Y,global:!0,onChange:Y=>E(z)},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),ee("div",Vue,[ee("span",Wue,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableAssignNode.assign")),1),w[2]||(w[2]=ee("span",{class:"color-danger"},"*",-1))]),k(R,{teleported:!1,modelValue:z.source,"onUpdate:modelValue":Y=>z.source=Y,size:"small",style:{width:"85px"}},{default:j(()=>[k(B,{label:O.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),k(B,{label:O.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"])]),z.source==="custom"?(Te(),cn("div",Gue,[k(R,{modelValue:z.type,"onUpdate:modelValue":Y=>z.type=Y,style:{"max-width":"85px"},class:"mr-8",onChange:Y=>{Y==="bool"?a.value.variable_list[X].value=!0:a.value.variable_list[X].value=null}},{default:j(()=>[(Te(),cn(Ir,null,No(o,Y=>k(B,{key:Y,label:Y,value:Y},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),z.type==="string"?(Te(),bt(T,{key:0,prop:"variable_list."+X+".value",rules:{message:Wn(Pt)("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(P,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,placeholder:O.$t("common.inputPlaceholder"),"show-word-limit":"",clearable:"",onWheel:r},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])):z.type==="num"?(Te(),bt(T,{key:1,prop:"variable_list."+X+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k($,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):z.type==="json"?(Te(),bt(T,{key:2,class:"w-full",prop:"variable_list."+X+".value",rules:[{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0},{validator:(Y,W,Q)=>{try{JSON.parse(W),Q()}catch{Q(new Error("Invalid JSON format"))}},trigger:"blur"}]},{default:j(()=>[k(I,{title:"JSON",modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,style:{height:"100px",width:"155px"},onSubmitDialog:Y=>a.value.variable_list[X].value=Y},null,8,["modelValue","onUpdate:modelValue","onSubmitDialog"])]),_:2},1032,["prop","rules"])):z.type==="bool"?(Te(),bt(T,{key:3,prop:"variable_list."+X+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(R,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,style:{width:"155px"}},{default:j(()=>[k(B,{label:"true",value:!0}),k(B,{label:"false",value:!1})]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):In("",!0)])):(Te(),bt(T,{key:1},{default:j(()=>[k(Go,{ref_for:!0,ref_key:"nodeCascaderRef2",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:O.$t("views.applicationWorkflow.variable.placeholder"),modelValue:z.reference,"onUpdate:modelValue":Y=>z.reference=Y},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1024))]),_:2},1024))),128)),k(M,{link:"",type:"primary",onClick:v},{default:j(()=>[k(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})]),_:1},8,["model"])]),_:1},8,["nodeModel"])}}});class Hue extends ai{constructor(e){super(e,zue)}}const Xue={type:"variable-assign-node",model:li,view:Hue},H8=Object.freeze(Object.defineProperty({__proto__:null,default:Xue},Symbol.toStringTag,{value:"Module"})),Yue={class:"flex align-center"},que={class:"mr-4"},Kue={class:"flex align-center"},Zue={class:"mr-4"},Jue={class:"flex align-center"},Que={class:"mr-4"},ece={class:"dialog-footer"},tce=gr({__name:"VariableFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=Ge(),i=Ge(!1),a=Ge(!1),s=Ge(null),l=Ge({field:"",label:"",expression:""}),f=Rh({label:[{required:!0,message:Pt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:Pt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:Pt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}],expression:[{required:!0,message:Pt("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder"),trigger:"blur"}]}),h=Ge(!1),v=(O,w)=>{O&&(l.value=Me.cloneDeep(O),a.value=!0,s.value=w),h.value=!0},_=()=>{h.value=!1,a.value=!1,s.value=null,l.value={field:"",label:""}},E=async O=>{O&&await O.validate(w=>{w&&o("refresh",l.value,s.value)})};return e({open:v,close:_}),(O,w)=>{const S=te("el-input"),M=te("el-form-item"),T=te("AppIcon"),B=te("el-tooltip"),R=te("el-form"),P=te("el-button"),$=te("el-dialog");return Te(),bt($,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableSplittingNode.editVariables"):O.$t("views.applicationWorkflow.nodes.variableSplittingNode.addVariables"),modelValue:h.value,"onUpdate:modelValue":w[4]||(w[4]=I=>h.value=I),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":_,"append-to-body":""},{footer:j(()=>[ee("span",ece,[k(P,{onClick:mn(_,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(P,{type:"primary",onClick:w[3]||(w[3]=I=>E(r.value)),loading:i.value},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[k(R,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:l.value,"require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[k(M,{prop:"field"},{label:j(()=>[ee("div",Yue,[ee("span",que,_e(O.$t("common.variable")),1),w[5]||(w[5]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(S,{modelValue:l.value.field,"onUpdate:modelValue":w[0]||(w[0]=I=>l.value.field=I),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1}),k(M,{prop:"label"},{label:j(()=>[ee("div",Kue,[ee("span",Zue,_e(O.$t("dynamicsForm.paramForm.name.label")),1),w[6]||(w[6]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[k(S,{modelValue:l.value.label,"onUpdate:modelValue":w[1]||(w[1]=I=>l.value.label=I),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1}),k(M,{prop:"expression"},{label:j(()=>[ee("div",Jue,[ee("span",Que,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.label"))+" ",1),w[7]||(w[7]=ee("span",{class:"color-danger"},"*",-1))]),k(B,{effect:"dark",content:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.tooltip"),placement:"right"},{default:j(()=>[k(T,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[k(S,{modelValue:l.value.expression,"onUpdate:modelValue":w[2]||(w[2]=I=>l.value.expression=I),maxlength:64,"show-word-limit":"",placeholder:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder")},null,8,["modelValue","placeholder"])]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),nce={class:"flex-between w-full"},rce={class:"break-all lighter"},oce={class:"ml-4",style:{"margin-top":"-4px"}},ice=["title"],ace=["title"],lce={class:"mr-4"},sce=gr({__name:"VariableFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=Ge(),o=Ge(),r=Ge([]);function i(l,f){o.value.open(l,f)}function a(l){r.value.splice(l,1);const f=[{label:Pt("common.result"),value:"result"},...r.value.map(h=>({label:h.label,value:h.field}))];Me.set(e.nodeModel.properties.config,"fields",f),e.nodeModel.clear_next_node_field(!1)}function s(l,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===l.field&&f!==v){Xi(Pt("views.applicationWorkflow.tip.paramErrorMessage")+l.field);return}[void 0,null].includes(f)?r.value.push(l):r.value.splice(f,1,l),o.value.close();const h=[{label:Pt("common.result"),value:"result"},...r.value.map(v=>({label:v.label,value:v.field}))];Me.set(e.nodeModel.properties.config,"fields",h),e.nodeModel.clear_next_node_field(!1)}return yo(()=>{e.nodeModel.properties.node_data.variable_list&&(r.value=Me.cloneDeep(e.nodeModel.properties.node_data.variable_list)),Me.set(e.nodeModel.properties.node_data,"variable_list",r);const l=[{label:Pt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(e.nodeModel.properties.config,"fields",l)}),(l,f)=>{var w;const h=te("AppIcon"),v=te("el-button"),_=te("el-table-column"),E=te("el-tooltip"),O=te("el-table");return Te(),cn(Ir,null,[ee("div",nce,[ee("h5",rce,[ft(_e(l.$t("views.applicationWorkflow.nodes.variableSplittingNode.splitVariables"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",oce,[k(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[k(h,{iconName:"app-add-outlined"})]),_:1})])]),((w=e.nodeModel.properties.node_data.variable_list)==null?void 0:w.length)>0?(Te(),bt(O,{key:0,data:e.nodeModel.properties.node_data.variable_list,ref_key:"tableRef",ref:n,"row-key":"field",class:"border-l border-r"},{default:j(()=>[k(_,{prop:"field",label:l.$t("common.variable"),width:"95"},{default:j(({row:S})=>[ee("span",{title:S.field,class:"ellipsis-1"},_e(S.field),9,ice)]),_:1},8,["label"]),k(_,{prop:"label",label:l.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:S})=>[ee("span",{title:S.label,class:"ellipsis-1"},_e(S.label),9,ace)]),_:1},8,["label"]),k(_,{label:l.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",lce,[k(E,{effect:"dark",content:l.$t("common.modify"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:mn(T=>i(S,M),["stop"])},{default:j(()=>[k(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),k(E,{effect:"dark",content:l.$t("common.delete"),placement:"top"},{default:j(()=>[k(v,{type:"primary",text:"",onClick:T=>a(M)},{default:j(()=>[k(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):In("",!0),k(tce,{ref_key:"VariableFieldDialogRef",ref:o,onRefresh:s},null,512)],64)}}}),uce={class:"title-decoration-1 mb-8"},cce={class:"flex-between"},dce=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={input_variable:[],variable_list:[]},o=fr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",n),e.nodeModel.properties.node_data),set:a=>{Me.set(e.nodeModel.properties,"node_data",a)}}),r=Ge(),i=async()=>r.value.validate().catch(a=>Promise.reject({node:e.nodeModel,errMessage:a}));return yo(()=>{Me.set(e.nodeModel,"validate",i)}),(a,s)=>{const l=te("el-form-item"),f=te("el-form"),h=te("el-card");return Te(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",uce,_e(a.$t("views.applicationWorkflow.nodeSetting")),1),k(h,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[k(f,{onSubmit:s[1]||(s[1]=mn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:r,"hide-required-asterisk":""},{default:j(()=>[k(l,{prop:"input_variable",rules:{message:a.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",cce,[ee("div",null,[ft(_e(a.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),s[2]||(s[2]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[k(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:a.$t("views.applicationWorkflow.variable.placeholder"),modelValue:o.value.input_variable,"onUpdate:modelValue":s[0]||(s[0]=v=>o.value.input_variable=v)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),k(l,{prop:"variable_list",rules:{message:a.$t("views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[k(sce,{ref:"VariableFieldTableRef","node-model":t.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class fce extends ai{constructor(e){super(e,dce)}getConfig(e){return e.model.properties.config}}const pce={type:"variable-splitting-node",model:li,view:fce},X8=Object.freeze(Object.defineProperty({__proto__:null,default:pce},Symbol.toStringTag,{value:"Module"})),hce={class:"title-decoration-1 mb-8"},vce={class:"flex-between w-full"},gce={class:"flex-between"},mce={class:"flex align-center"},yce={class:"flex align-center"},_ce={class:"mr-4"},bce={class:"flex-between"},wce={class:"flex align-center"},Ece={class:"mr-4"},xce=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=gl("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=Ge(null),s=Ge(),l=Ge(),f=Ge(),h=()=>{var F;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(F=l.value)==null?void 0:F.validate()]).catch(U=>Promise.reject({node:i.nodeModel,errMessage:U}))},v=F=>F.ctrlKey===!0?(F.preventDefault(),!0):(F.stopPropagation(),!0),E={model_id:"",system:"",prompt:`{{${Pt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null,video_list:["start-node","video"]},O=fr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",E),i.nodeModel.properties.node_data),set:F=>{Me.set(i.nodeModel.properties,"node_data",F)}}),w=e();function S(){var U;const F=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(U=w.value)==null?void 0:U.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(F).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(F){Me.set(i.nodeModel.properties.node_data,"system",F)}function T(F){Me.set(i.nodeModel.properties.node_data,"prompt",F)}const B=F=>{var U;F&&((U=s.value)==null||U.open(F,o,O.value.model_params_setting))},R=Ge(),P=F=>{var U;F&&((U=R.value)==null||U.open(F,o))},$=F=>{Me.set(i.nodeModel.properties.node_data,"system",F)};function I(F){Me.set(i.nodeModel.properties.node_data,"model_params_setting",F)}return yo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(F,U)=>{const z=te("AppIcon"),X=te("el-button"),Y=te("ModelSelect"),W=te("el-form-item"),Q=te("el-tooltip"),J=te("MdEditorMagnify"),ie=te("el-option"),Se=te("el-select"),Ae=te("el-input-number"),Pe=te("el-switch"),De=te("el-form"),He=te("el-card");return Te(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",hce,_e(F.$t("views.applicationWorkflow.nodeSetting")),1),k(He,{shadow:"never",class:"card-never"},{default:j(()=>[k(De,{onSubmit:U[10]||(U[10]=mn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[k(W,{label:F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",vce,[ee("div",null,[ee("span",null,[ft(_e(Wn(Pt)("views.applicationWorkflow.nodes.videoUnderstandNode.model.label")),1),U[11]||(U[11]=ee("span",{class:"color-danger"},"*",-1))])]),k(X,{disabled:!O.value.model_id,type:"primary",link:"",onClick:U[0]||(U[0]=Ye=>B(O.value.model_id)),onRefreshForm:I},{default:j(()=>[k(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[k(Y,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":U[1]||(U[1]=Ye=>O.value.model_id=Ye),placeholder:F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",gce,[ee("div",mce,[ee("span",null,_e(F.$t("views.application.form.roleSettings.label")),1),k(Q,{effect:"dark",content:F.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),k(X,{type:"primary",link:"",onClick:U[2]||(U[2]=Ye=>P(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[k(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[k(J,{title:F.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":U[3]||(U[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Wn(Pt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),k(W,{label:F.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:F.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",yce,[ee("div",_ce,[ee("span",null,[ft(_e(F.$t("views.application.form.prompt.label")),1),U[12]||(U[12]=ee("span",{class:"color-danger"},"*",-1))])]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(J,{onWheel:v,title:F.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":U[4]||(U[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:T,placeholder:`${Wn(Pt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(Pt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),k(W,null,{label:j(()=>[ee("div",bce,[ee("div",null,_e(F.$t("views.application.form.historyRecord.label")),1),k(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":U[5]||(U[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[k(ie,{label:F.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),k(ie,{label:F.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[k(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":U[6]||(U[6]=Ye=>O.value.dialogue_number=Ye),min:0,"value-on-clear":0,"controls-position":"right",class:"w-full",step:1,"step-strictly":!0},null,8,["modelValue"])]),_:1}),k(W,{label:F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label"),rules:{type:"array",required:!0,message:F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label")),1),U[13]||(U[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[k(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:F.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),modelValue:O.value.video_list,"onUpdate:modelValue":U[7]||(U[7]=Ye=>O.value.video_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),k(W,{label:F.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:U[9]||(U[9]=mn(()=>{},["prevent"]))},{label:j(()=>[ee("div",wce,[ee("div",Ece,[ee("span",null,_e(F.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),k(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[k(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[k(Pe,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":U[8]||(U[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),k(pp,{ref_key:"AIModeParamSettingDialogRef",ref:s,onRefresh:I},null,512),k(W2,{onReplace:$,ref_key:"GeneratePromptDialogRef",ref:R},null,512)]),_:1},8,["node-model"])}}});class Oce extends ai{constructor(e){super(e,xce)}}const Sce={type:"video-understand-node",model:li,view:Oce},Y8=Object.freeze(Object.defineProperty({__proto__:null,default:Sce},Symbol.toStringTag,{value:"Module"})),UR=gr({__name:"CustomLine",props:{model:{}},setup(t){const e=t,n=()=>{e.model.graphModel.deleteEdgeById(e.model.id)};return(o,r)=>Ql((Te(),cn("div",{class:"custom-edge cursor",onMouseup:r[0]||(r[0]=mn(()=>{},["stop"])),onClick:r[1]||(r[1]=mn(()=>{},["stop"]))},[(Te(),cn("svg",{onClick:n,width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...r[2]||(r[2]=[ee("path",{d:"M12 23.0001C5.925 23.0001 1 18.0751 1 12.0001C1 5.92512 5.925 1.00012 12 1.00012C18.075 1.00012 23 5.92512 23 12.0001C23 18.0751 18.075 23.0001 12 23.0001Z",fill:"#3370FF"},null,-1),ee("path",{d:"M9.02524 7.61124L12.0002 10.5862L14.9752 7.61124C15.069 7.5175 15.1962 7.46484 15.3287 7.46484C15.4613 7.46484 15.5885 7.5175 15.6822 7.61124L16.3892 8.31824C16.483 8.412 16.5356 8.53915 16.5356 8.67174C16.5356 8.80432 16.483 8.93147 16.3892 9.02524L13.4142 12.0002L16.3892 14.9752C16.483 15.069 16.5356 15.1962 16.5356 15.3287C16.5356 15.4613 16.483 15.5885 16.3892 15.6822L15.6822 16.3892C15.5885 16.483 15.4613 16.5356 15.3287 16.5356C15.1962 16.5356 15.069 16.483 14.9752 16.3892L12.0002 13.4142L9.02524 16.3892C8.93147 16.483 8.80432 16.5356 8.67174 16.5356C8.53916 16.5356 8.412 16.483 8.31824 16.3892L7.61124 15.6822C7.5175 15.5885 7.46484 15.4613 7.46484 15.3287C7.46484 15.1962 7.5175 15.069 7.61124 14.9752L10.5862 12.0002L7.61124 9.02524C7.5175 8.93147 7.46484 8.80432 7.46484 8.67174C7.46484 8.53915 7.5175 8.412 7.61124 8.31824L8.31824 7.61124C8.412 7.5175 8.53916 7.46484 8.67174 7.46484C8.80432 7.46484 8.93147 7.5175 9.02524 7.61124Z",fill:"white"},null,-1)])]))],544)),[[Oh,e.model.isHovered]])}});function Ace(t,e){const n=t.getBoundingClientRect();return e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom}const Mce=32,Tce=32;class Cce extends Hu.BezierEdge{constructor(){super();hl(this,"isMounted");hl(this,"customLineApp");hl(this,"root");this.isMounted=!1,this.handleMouseUp=n=>{this.props.graphModel.clearSelectElements(),this.props.model.isSelected=!0;const o=n.target.parentNode.parentNode.querySelector(".lf-custom-edge-wrapper");Ace(o,n)&&this.props.model.graphModel.deleteEdgeById(this.props.model.id)}}renderVueComponent(n){var r;this.unmountVueComponent(),this.root=n;const{graphModel:o}=this.props;n&&(d1()?n8(this.targetId(),UR,n,this.props.model,o,(i,a)=>({model:i,graph:a})):(this.customLineApp=Fj({render:()=>Dm(UR,{model:this.props.model})}),(r=this.customLineApp)==null||r.mount(n)))}targetId(){return`${this.props.graphModel.flowId}:${this.props.model.id}`}componentWillUnmount(){super.componentWillUnmount&&super.componentWillUnmount(),d1()&&r8(this.targetId()),this.unmountVueComponent()}unmountVueComponent(){return this.customLineApp&&(this.customLineApp.unmount(),this.customLineApp=null),this.root&&(this.root.innerHTML=""),this.root}getEdge(){const{model:n}=this.props,o=n.id,{customWidth:r=Mce,customHeight:i=Tce}=n.getProperties(),{startPoint:a,endPoint:s,path:l,isAnimation:f,arrowConfig:h}=n,v=n.getEdgeAnimationStyle(),{strokeDasharray:_,stroke:E,strokeDashoffset:O,animationName:w,animationDuration:S,animationIterationCount:M,animationTimingFunction:T,animationDirection:B}=v,R={x:(a.x+s.x-r)/2,y:(a.y+s.y-i)/2,width:r,height:i},P=n.getEdgeStyle(),$={width:r,height:i};return setTimeout(()=>{const I=document.getElementById(o);I&&!this.isMounted&&(this.isMounted=!0,this.renderVueComponent(I))},0),delete P.stroke,Hu.h("g",{},[Hu.h("style",{type:"text/css"},".lf-edge{stroke:#afafaf}.lf-edge:hover{stroke: #3370FF;}"),Hu.h("path",{d:l,...P,...h,...f?{strokeDasharray:_,stroke:E,style:{strokeDashoffset:O,animationName:w,animationDuration:S,animationIterationCount:M,animationTimingFunction:T,animationDirection:B}}:{}}),Hu.h("foreignObject",{...R,y:R.y+5,x:R.x+5,style:{}},[Hu.h("div",{id:o,style:{...$},className:"lf-custom-edge-wrapper"})])])}}let Nce=class extends Hu.BezierEdgeModel{getArrowStyle(){const e=super.getArrowStyle();return e.offset=1,e.verticalLength=0,e}getEdgeStyle(){const e=super.getEdgeStyle();return e.strokeWidth=2,e.stroke="#BBBFC4",e.offset=0,e}getData(){const e=super.getData();return e&&(e.sourceAnchorId=this.sourceAnchorId,e.targetAnchorId=this.targetAnchorId),e}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(i=>i.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(i=>i.id===this.targetAnchorId);if(n&&r){const i={x:n.x,y:n.y};this.updateStartPoint(i);const a={x:r.x,y:r.y};this.updateEndPoint(a)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}};const q8={type:"app-edge",view:Cce,model:Nce};class kce{constructor(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=()=>{}}layout(e){return this.init(e),this.execute(!0)}init(e){this.nodes=e.nodes||[],this.edges=e.edges||[],this.combos=e.combos||[],this.comboEdges=e.comboEdges||[],this.hiddenNodes=e.hiddenNodes||[],this.hiddenEdges=e.hiddenEdges||[],this.hiddenCombos=e.hiddenCombos||[],this.vedges=e.vedges||[]}execute(e){}executeWithWorker(){}getDefaultCfg(){return{}}updateCfg(e){e&&Object.assign(this,e)}getType(){return"base"}destroy(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0}}const Pce=t=>typeof t=="string",VR=Array.isArray,m1=t=>typeof t=="number",K8=t=>t!==null&&typeof t=="object",y1=t=>{if(t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){const e=[];return t.forEach(n=>{e.push(n)}),e.map(n=>y1(n))}if(typeof t=="object"&&Object.keys(t).length){const e=Object.assign({},t);return Object.keys(e).forEach(n=>{e[n]=y1(e[n])}),e}return t},cm=(t,e)=>{const n=t[e];return K8(n)?n.cell:n},WR=(t,e,n)=>{let o;return n?o=n:m1(t)?o=()=>t:o=()=>e,o},Rce=(t,e)=>{if(t!=="next"&&t!=="prev")return e},GR=t=>{t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev};let Dce=class{constructor(){const e={};e.prev=e,e.next=e.prev,this.shortcut=e}dequeue(){const e=this.shortcut,n=e.prev;if(n&&n!==e)return GR(n),n}enqueue(e){const n=this.shortcut;e.prev&&e.next&&GR(e),e.next=n.next,n.next.prev=e,n.next=e,e.prev=n}toString(){const e=[],n=this.shortcut;let o=n.prev;for(;o!==n;)e.push(JSON.stringify(o,Rce)),o=o==null?void 0:o.prev;return`[${e.join(", ")}]`}};var Mm;(function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""})(Mm||(Mm={}));function zR(t,e){var n=t.get(e)||0;t.set(e,n+1)}function HR(t,e){var n=t.get(e);n!==void 0&&(n=n-1,n>0?t.set(e,n):t.delete(e))}function Z8(t,e,n,o){var r=String(e),i=String(n);if(!t&&r>i){var a=r;r=i,i=a}return r+Mm.EDGE_KEY_DELIM+i+Mm.EDGE_KEY_DELIM+(o===void 0?Mm.DEFAULT_EDGE_NAME:o)}function XR(t,e,n,o){var r=String(e),i=String(n),a={v:e,w:n};if(!t&&r>i){var s=a.v;a.v=a.w,a.w=s}return o!==void 0&&(a.name=o),a}function kS(t,e){return Z8(t,e.v,e.w,e.name)}function YR(t){return typeof t=="function"}var jce=function(e){return e.nodes().map(function(n){var o=e.node(n),r=e.parent(n),i={id:n,value:o,parent:r};return i.value===void 0&&delete i.value,i.parent===void 0&&delete i.parent,i})},Lce=function(e){return e.edges().map(function(n){var o=e.edge(n),r={v:n.v,w:n.w,value:o,name:n.name};return r.name===void 0&&delete r.name,r.value===void 0&&delete r.value,r})},Ice=function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:jce(e),edges:Lce(e),value:e.graph()};return n.value===void 0&&delete n.value,n},Fce=function(e){var n=new sb(e.options);return e.value!==void 0&&n.setGraph(e.value),e.nodes.forEach(function(o){n.setNode(o.id,o.value),o.parent&&n.setParent(o.id,o.parent)}),e.edges.forEach(function(o){n.setEdge(o.v,o.w,o.value,o.name)}),n};function qR(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function KR(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qR(Object(n),!0).forEach(function(o){Bce(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Bce(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ce(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Vce(t,e,n){return e&&Uce(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var Wce={compound:!1,multigraph:!1,directed:!0},sb=(function(){function t(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$ce(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=Mm.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(r){return e.label=r,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(r){return YR(r)?e.defaultNodeLabelFn=r:e.defaultNodeLabelFn=function(){return r},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(r){return e.nodesLabelMap.get(r)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(r){var i;return!(!((i=e.inEdgesMap.get(r))===null||i===void 0)&&i.size)})},this.sinks=function(){return e.nodes().filter(function(r){var i;return!(!((i=e.outEdgesMap.get(r))===null||i===void 0)&&i.size)})},this.setNodes=function(r,i){return r.map(function(a){return e.setNode(a,i)}),e},this.hasNode=function(r){return e.nodesLabelMap.has(r)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(r){if(e.isCompound()){var i,a=(i=e.parentMap)===null||i===void 0?void 0:i.get(r);if(a!==e.GRAPH_NODE)return a}},this.removeFromParentsChildList=function(r){var i=e.parentMap.get(r);e.childrenMap.get(i).delete(r)},this.setParent=function(r,i){var a,s;e.checkCompound();for(var l=i===void 0?e.GRAPH_NODE:i,f=e.parent(l);f;){if(r===f)throw new Error("Setting "+i+" as parent of "+r+" would create a cycle");f=e.parent(f)}i&&e.setNode(i),e.setNode(r),e.removeFromParentsChildList(r),(a=e.parentMap)===null||a===void 0||a.set(r,l);var h=e.childrenMap.get(l);return h.set(r,!0),(s=e.childrenMap)===null||s===void 0||s.set(l,h),e},this.children=function(r){var i=r===void 0?e.GRAPH_NODE:r;if(e.isCompound()){var a,s=(a=e.childrenMap)===null||a===void 0?void 0:a.get(i);return s?Array.from(s.keys()):void 0}if(i===e.GRAPH_NODE)return e.nodes();if(r&&e.hasNode(r))return[]},this.predecessors=function(r){var i=e.predecessorsMap.get(r);return i?Array.from(i.keys()):void 0},this.successors=function(r){var i=e.successorsMap.get(r);return i?Array.from(i.keys()):void 0},this.neighbors=function(r){var i;if(e.hasNode(r))return Array.from(new Set((i=e.predecessors(r))===null||i===void 0?void 0:i.concat(e.successors(r))))},this.isLeaf=function(r){var i;if(e.isDirected()){var a;return!(!((a=e.successors(r))===null||a===void 0)&&a.length)}return!(!((i=e.neighbors(r))===null||i===void 0)&&i.length)},this.filterNodes=function(r){var i=e.directed,a=e.multigraph,s=e.compound,l=new t({directed:i,multigraph:a,compound:s});if(l.setGraph(e.graph()),e.nodes().forEach(function(h){r(h)&&l.setNode(h,e.node(h))}),e.edges().forEach(function(h){l.hasNode(h.v)&&l.hasNode(h.w)&&l.setEdgeObj(h,e.edge(h))}),s){var f=function(v){for(var _=e.parent(v);_!==void 0&&!l.hasNode(_);)_=e.parent(_);return _};l.nodes().forEach(function(h){l.setParent(h,f(h))})}return l},this.setDefaultEdgeLabel=function(r){return YR(r)?e.defaultEdgeLabelFn=r:e.defaultEdgeLabelFn=function(){return r},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(r,i){return e.setEdge(r.v,r.w,i,r.name)},this.setPath=function(r,i){return r.reduce(function(a,s){return e.setEdge(a,s,i),s}),e},this.edgeFromArgs=function(r,i,a){return e.edge({v:r,w:i,name:a})},this.edge=function(r){return e.edgesLabelsMap.get(kS(e.isDirected(),r))},this.hasEdge=function(r,i,a){return e.edgesLabelsMap.has(kS(e.isDirected(),{v:r,w:i,name:a}))},this.removeEdgeObj=function(r){var i=r.v,a=r.w,s=r.name;return e.removeEdge(i,a,s)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(r,i){var a=e.inEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(s){return!i||s.v===i})},this.outEdges=function(r,i){var a=e.outEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(s){return!i||s.w===i})},this.nodeEdges=function(r,i){var a;if(e.hasNode(r))return(a=e.inEdges(r,i))===null||a===void 0?void 0:a.concat(e.outEdges(r,i))},this.toJSON=function(){return Ice(e)},this.nodeInDegree=function(r){var i=e.inEdgesMap.get(r);return i?i.size:0},this.nodeOutDegree=function(r){var i=e.outEdgesMap.get(r);return i?i.size:0},this.nodeDegree=function(r){return e.nodeInDegree(r)+e.nodeOutDegree(r)},this.source=function(r){return r.v},this.target=function(r){return r.w};var o=KR(KR({},Wce),n);this.compound=o.compound,this.directed=o.directed,this.multigraph=o.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return Vce(t,[{key:"setNode",value:function(n,o){var r=this.nodesLabelMap,i=this.defaultNodeLabelFn,a=this.isCompound,s=this.parentMap,l=this.childrenMap,f=this.inEdgesMap,h=this.outEdgesMap,v=this.predecessorsMap,_=this.successorsMap;if(r.has(n))return o!==void 0&&r.set(n,o),this;if(r.set(n,o||i(n)),a()){var E;s==null||s.set(n,this.GRAPH_NODE),l==null||l.set(n,new Map),l!=null&&l.has(this.GRAPH_NODE)||l==null||l.set(this.GRAPH_NODE,new Map),l==null||(E=l.get(this.GRAPH_NODE))===null||E===void 0||E.set(n,!0)}return[f,h,v,_].forEach(function(O){return O.set(n,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(n){var o=this;if(this.hasNode(n)){var r=function(S){o.removeEdge(S.v,S.w,S.name)},i=this.inEdgesMap,a=this.outEdgesMap,s=this.predecessorsMap,l=this.successorsMap,f=this.nodesLabelMap;if(this.isCompound()){var h,v,_;this.removeFromParentsChildList(n),(h=this.parentMap)===null||h===void 0||h.delete(n),(v=this.children(n))===null||v===void 0||v.forEach(function(w){return o.setParent(w)}),(_=this.childrenMap)===null||_===void 0||_.delete(n)}var E=i.get(n),O=a.get(n);Array.from(E.values()).forEach(function(w){return r(w)}),Array.from(O.values()).forEach(function(w){return r(w)}),f.delete(n),i.delete(n),a.delete(n),s.delete(n),l.delete(n),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(n,o,r,i){var a,s,l=XR(this.isDirected(),n,o,i),f=kS(this.isDirected(),l),h=l.v,v=l.w;if(this.edgesLabelsMap.has(f))return this.edgesLabelsMap.set(f,r),this;if(i!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(v),this.edgesLabelsMap.set(f,r||this.defaultEdgeLabelFn(h,v,i)),Object.freeze(l),this.edgesMap.set(f,l);var _=this.predecessorsMap.get(v),E=this.successorsMap.get(h);return zR(_,h),zR(E,v),(a=this.inEdgesMap.get(v))===null||a===void 0||a.set(f,l),(s=this.outEdgesMap.get(h))===null||s===void 0||s.set(f,l),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(n,o,r){var i=Z8(this.isDirected(),n,o,r),a=this.edgesMap.get(i);if(a){var s=XR(this.isDirected(),n,o,r),l=s.v,f=s.w;this.edgesLabelsMap.delete(i),this.edgesMap.delete(i);var h=this.predecessorsMap.get(f),v=this.successorsMap.get(l);HR(h,l),HR(v,f),this.inEdgesMap.get(f).delete(i),this.outEdgesMap.get(l).delete(i),this.edgeCountNum-=1}return this}}]),t})();sb.fromJSON=Fce;var Gce=function t(e,n,o,r,i,a){r.includes(n)||(r.push(n),o||a.push(n),i(n).forEach(function(s){return t(e,s,o,r,i,a)}),o&&a.push(n))},VM=function(e,n,o){var r=Array.isArray(n)?n:[n],i=function(f){return e.isDirected()?e.successors(f):e.neighbors(f)},a=[],s=[];return r.forEach(function(l){if(e.hasNode(l))Gce(e,l,o==="post",s,i,a);else throw new Error("Graph does not have node: "+l)}),a},zce=function(e,n){return VM(e,n,"post")},Hce=function(e,n){return VM(e,n,"pre")};const Xce=Object.freeze(Object.defineProperty({__proto__:null,dfs:VM,postorder:zce,preorder:Hce},Symbol.toStringTag,{value:"Module"}));class Yce extends Dce{}class qce extends sb{}const Kce=()=>1,Zce=(t,e)=>{var n;if(t.nodeCount()<=1)return[];const o=Qce(t,e||Kce);return(n=Jce(o.graph,o.buckets,o.zeroIdx).map(i=>t.outEdges(i.v,i.w)))===null||n===void 0?void 0:n.flat()},Jce=(t,e,n)=>{let o=[];const r=e[e.length-1],i=e[0];let a;for(;t.nodeCount();){for(;a=i.dequeue();)PS(t,e,n,a);for(;a=r.dequeue();)PS(t,e,n,a);if(t.nodeCount()){for(let s=e.length-2;s>0;--s)if(a=e[s].dequeue(),a){o=o.concat(PS(t,e,n,a,!0));break}}}return o},PS=(t,e,n,o,r)=>{var i,a;const s=[];return(i=t.inEdges(o.v))===null||i===void 0||i.forEach(l=>{const f=t.edge(l),h=t.node(l.v);r&&s.push({v:l.v,w:l.w,in:0,out:0}),h.out===void 0&&(h.out=0),h.out-=f,w2(e,n,h)}),(a=t.outEdges(o.v))===null||a===void 0||a.forEach(l=>{const f=t.edge(l),h=l.w,v=t.node(h);v.in===void 0&&(v.in=0),v.in-=f,w2(e,n,v)}),t.removeNode(o.v),r?s:void 0},Qce=(t,e)=>{const n=new qce;let o=0,r=0;t.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),t.edges().forEach(l=>{const f=n.edge(l)||0,h=(e==null?void 0:e(l))||1,v=f+h;n.setEdge(l.v,l.w,v),r=Math.max(r,n.node(l.v).out+=h),o=Math.max(o,n.node(l.w).in+=h)});const i=[],a=r+o+3;for(let l=0;l<a;l++)i.push(new Yce);const s=o+1;return n.nodes().forEach(l=>{w2(i,s,n.node(l))}),{buckets:i,zeroIdx:s,graph:n}},w2=(t,e,n)=>{n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)},ede=t=>{const e=o=>r=>{var i;return((i=o.edge(r))===null||i===void 0?void 0:i.weight)||1},n=t.graph().acyclicer==="greedy"?Zce(t,e(t)):tde(t);n==null||n.forEach(o=>{const r=t.edge(o);t.removeEdgeObj(o),r.forwardName=o.name,r.reversed=!0,t.setEdge(o.w,o.v,r,`rev-${Math.random()}`)})},tde=t=>{const e=[],n={},o={},r=i=>{var a;o[i]||(o[i]=!0,n[i]=!0,(a=t.outEdges(i))===null||a===void 0||a.forEach(s=>{n[s.w]?e.push(s):r(s.w)}),delete n[i])};return t.nodes().forEach(r),e},nde=t=>{t.edges().forEach(e=>{const n=t.edge(e);if(n.reversed){t.removeEdgeObj(e);const o=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,o)}})},ZR={run:ede,undo:nde};class dp extends sb{}const rde=(t,e)=>Number(t)-Number(e),uy=(t,e,n,o)=>{let r;do r=`${o}${Math.random()}`;while(t.hasNode(r));return n.dummy=e,t.setNode(r,n),r},ode=t=>{const e=new dp().setGraph(t.graph());return t.nodes().forEach(n=>{e.setNode(n,t.node(n))}),t.edges().forEach(n=>{const o=e.edgeFromArgs(n.v,n.w)||{weight:0,minlen:1},r=t.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+r.weight,minlen:Math.max(o.minlen,r.minlen)})}),e},J8=t=>{const e=new dp({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach(n=>{var o;!((o=t.children(n))===null||o===void 0)&&o.length||e.setNode(n,t.node(n))}),t.edges().forEach(n=>{e.setEdgeObj(n,t.edge(n))}),e},ide=(t,e)=>t==null?void 0:t.reduce((n,o,r)=>(n[o]=e[r],n),{}),JR=(t,e)=>{const n=Number(t.x),o=Number(t.y),r=Number(e.x)-n,i=Number(e.y)-o;let a=Number(t.width)/2,s=Number(t.height)/2;if(!r&&!i)return{x:0,y:0};let l,f;return Math.abs(i)*a>Math.abs(r)*s?(i<0&&(s=-s),l=s*r/i,f=s):(r<0&&(a=-a),l=a,f=a*i/r),{x:n+l,y:o+f}},U_=t=>{const e=[],n=Q8(t)+1;for(let o=0;o<n;o++)e.push([]);t.nodes().forEach(o=>{const r=t.node(o);if(!r)return;const i=r.rank;i!==void 0&&e[i]&&e[i].push(o)});for(let o=0;o<n;o++)e[o]=e[o].sort((r,i)=>{var a,s;return rde((a=t.node(r))===null||a===void 0?void 0:a.order,(s=t.node(i))===null||s===void 0?void 0:s.order)});return e},ade=t=>{const e=t.nodes().filter(o=>{var r;return((r=t.node(o))===null||r===void 0?void 0:r.rank)!==void 0}).map(o=>t.node(o).rank),n=Math.min(...e);t.nodes().forEach(o=>{const r=t.node(o);r.hasOwnProperty("rank")&&n!==1/0&&(r.rank-=n)})},lde=t=>{const e=t.nodes(),n=e.filter(s=>{var l;return((l=t.node(s))===null||l===void 0?void 0:l.rank)!==void 0}).map(s=>t.node(s).rank),o=Math.min(...n),r=[];e.forEach(s=>{var l;const f=(((l=t.node(s))===null||l===void 0?void 0:l.rank)||0)-o;r[f]||(r[f]=[]),r[f].push(s)});let i=0;const a=t.graph().nodeRankFactor||0;for(let s=0;s<r.length;s++){const l=r[s];l===void 0?s%a!==0&&(i-=1):i&&(l==null||l.forEach(f=>{const h=t.node(f);h&&(h.rank=h.rank||0,h.rank+=i)}))}},QR=(t,e,n,o)=>{const r={width:0,height:0};return m1(n)&&m1(o)&&(r.rank=n,r.order=o),uy(t,"border",r,e)},Q8=t=>{let e;return t.nodes().forEach(n=>{var o;const r=(o=t.node(n))===null||o===void 0?void 0:o.rank;r!==void 0&&(e===void 0||r>e)&&(e=r)}),e||(e=0),e},sde=(t,e)=>{const n={lhs:[],rhs:[]};return t==null||t.forEach(o=>{e(o)?n.lhs.push(o):n.rhs.push(o)}),n},e4=(t,e)=>{const n=Date.now();try{return e()}finally{console.log(`${t} time: ${Date.now()-n}ms`)}},t4=(t,e)=>e(),WM=(t,e)=>t.reduce((n,o)=>{const r=e(n),i=e(o);return r>i?o:n}),ude=t=>{t.graph().dummyChains=[],t.edges().forEach(e=>cde(t,e))},cde=(t,e)=>{let n=e.v,o=t.node(n).rank;const r=e.w,i=t.node(r).rank,a=e.name,s=t.edge(e),l=s.labelRank;if(i===o+1)return;t.removeEdgeObj(e);const f=t.graph();let h,v,_;for(_=0,++o;o<i;++_,++o)s.points=[],v={edgeLabel:s,width:0,height:0,edgeObj:e,rank:o},h=uy(t,"edge",v,"_d"),o===l&&(v.width=s.width,v.height=s.height,v.dummy="edge-label",v.labelpos=s.labelpos),t.setEdge(n,h,{weight:s.weight},a),_===0&&(f.dummyChains||(f.dummyChains=[]),f.dummyChains.push(h)),n=h;t.setEdge(n,r,{weight:s.weight},a)},dde=t=>{var e;(e=t.graph().dummyChains)===null||e===void 0||e.forEach(n=>{let o=t.node(n);const r=o.edgeLabel;let i;o.edgeObj&&t.setEdgeObj(o.edgeObj,r);let a=n;for(;o.dummy;)i=t.successors(a)[0],t.removeNode(a),r.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(r.x=o.x,r.y=o.y,r.width=o.width,r.height=o.height),a=i,o=t.node(a)})},eD={run:ude,undo:dde},n4=t=>{var e;const n={},o=r=>{var i;const a=t.node(r);if(!a)return 0;if(n[r])return a.rank;n[r]=!0;let s;return(i=t.outEdges(r))===null||i===void 0||i.forEach(l=>{const f=o(l.w),h=t.edge(l).minlen,v=f-h;v&&(s===void 0||v<s)&&(s=v)}),s||(s=0),a.rank=s,s};(e=t.sources())===null||e===void 0||e.forEach(r=>o(r))},fde=t=>{var e;const n={};let o;const r=s=>{var l;const f=t.node(s);if(!f)return 0;if(n[s])return f.rank;n[s]=!0;let h;return(l=t.outEdges(s))===null||l===void 0||l.forEach(v=>{const _=r(v.w),E=t.edge(v).minlen,O=_-E;O&&(h===void 0||O<h)&&(h=O)}),h||(h=0),(o===void 0||h<o)&&(o=h),f.rank=h,h};(e=t.sources())===null||e===void 0||e.forEach(s=>{t.node(s)&&r(s)}),o===void 0&&(o=0);const i={},a=(s,l)=>{var f;const h=t.node(s),v=isNaN(h.layer)?l:h.layer;(h.rank===void 0||h.rank<v)&&(h.rank=v),!i[s]&&(i[s]=!0,(f=t.outEdges(s))===null||f===void 0||f.map(_=>{a(_.w,v+t.edge(_).minlen)}))};t.nodes().forEach(s=>{const l=t.node(s);l&&(isNaN(l.layer)?l.rank-=o:a(s,l.layer))})},Nh=(t,e)=>t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen,pde=t=>{const e=new dp({directed:!1}),n=t.nodes()[0],o=t.nodeCount();e.setNode(n,{});let r,i;for(;hde(e,t)<o;)r=r4(e,t),i=e.hasNode(r.v)?Nh(t,r):-Nh(t,r),o4(e,t,i);return e},hde=(t,e)=>{const n=o=>{e.nodeEdges(o).forEach(r=>{const i=r.v,a=o===i?r.w:i;!t.hasNode(a)&&!Nh(e,r)&&(t.setNode(a,{}),t.setEdge(o,a,{}),n(a))})};return t.nodes().forEach(n),t.nodeCount()},vde=t=>{const e=new dp({directed:!1}),n=t.nodes()[0],o=t.nodes().filter(a=>!!t.node(a)).length;e.setNode(n,{});let r,i;for(;gde(e,t)<o;)r=r4(e,t),i=e.hasNode(r.v)?Nh(t,r):-Nh(t,r),o4(e,t,i);return e},gde=(t,e)=>{const n=o=>{var r;(r=e.nodeEdges(o))===null||r===void 0||r.forEach(i=>{const a=i.v,s=o===a?i.w:a;!t.hasNode(s)&&(e.node(s).layer!==void 0||!Nh(e,i))&&(t.setNode(s,{}),t.setEdge(o,s,{}),n(s))})};return t.nodes().forEach(n),t.nodeCount()},r4=(t,e)=>WM(e.edges(),n=>t.hasNode(n.v)!==t.hasNode(n.w)?Nh(e,n):1/0),o4=(t,e,n)=>{t.nodes().forEach(o=>{e.node(o).rank||(e.node(o).rank=0),e.node(o).rank+=n})},{preorder:mde,postorder:yde}=Xce,_de=t=>{const e=ode(t);n4(e);const n=pde(e);a4(n),i4(n,e);let o,r;for(;o=Ede(n);)r=xde(n,e,o),Ode(n,e,o,r)},i4=(t,e)=>{let n=yde(t,t.nodes());n=n==null?void 0:n.slice(0,(n==null?void 0:n.length)-1),n==null||n.forEach(o=>{bde(t,e,o)})},bde=(t,e,n)=>{const r=t.node(n).parent;t.edgeFromArgs(n,r).cutvalue=wde(t,e,n)},wde=(t,e,n)=>{var o;const i=t.node(n).parent;let a=!0,s=e.edgeFromArgs(n,i),l=0;return s||(a=!1,s=e.edgeFromArgs(i,n)),l=s.weight,(o=e.nodeEdges(n))===null||o===void 0||o.forEach(f=>{const h=f.v===n,v=h?f.w:f.v;if(v!==i){const _=h===a,E=e.edge(f).weight;if(l+=_?E:-E,Ade(t,n,v)){const O=t.edgeFromArgs(n,v).cutvalue;l+=_?-O:O}}}),l},a4=(t,e=t.nodes()[0])=>{l4(t,{},1,e)},l4=(t,e,n,o,r)=>{var i;const a=n;let s=n;const l=t.node(o);return e[o]=!0,(i=t.neighbors(o))===null||i===void 0||i.forEach(f=>{e[f]||(s=l4(t,e,s,f,o))}),l.low=a,l.lim=s++,r?l.parent=r:delete l.parent,s},Ede=t=>t.edges().find(e=>t.edge(e).cutvalue<0),xde=(t,e,n)=>{let o=n.v,r=n.w;e.hasEdge(o,r)||(o=n.w,r=n.v);const i=t.node(o),a=t.node(r);let s=i,l=!1;i.lim>a.lim&&(s=a,l=!0);const f=e.edges().filter(h=>l===tD(t,t.node(h.v),s)&&l!==tD(t,t.node(h.w),s));return WM(f,h=>Nh(e,h))},Ode=(t,e,n,o)=>{const r=n.v,i=n.w;t.removeEdge(r,i),t.setEdge(o.v,o.w,{}),a4(t),i4(t,e),Sde(t,e)},Sde=(t,e)=>{const n=t.nodes().find(r=>{var i;return!(!((i=e.node(r))===null||i===void 0)&&i.parent)});let o=mde(t,n);o=o==null?void 0:o.slice(1),o==null||o.forEach(r=>{const i=t.node(r).parent;let a=e.edgeFromArgs(r,i),s=!1;a||(a=e.edgeFromArgs(i,r),s=!0),e.node(r).rank=e.node(i).rank+(s?a.minlen:-a.minlen)})},Ade=(t,e,n)=>t.hasEdge(e,n),tD=(t,e,n)=>n.low<=e.lim&&e.lim<=n.lim,Mde=t=>{switch(t.graph().ranker){case"network-simplex":Cde(t);break;case"tight-tree":nD(t);break;case"longest-path":Tde(t);break;default:nD(t)}},Tde=n4,nD=t=>{fde(t),vde(t)},Cde=t=>{_de(t)},Nde=t=>{var e;const n={};let o=0;const r=i=>{var a;const s=o;(a=t.children(i))===null||a===void 0||a.forEach(r),n[i]={low:s,lim:o++}};return(e=t.children())===null||e===void 0||e.forEach(r),n},kde=(t,e,n,o)=>{const r=[],i=[],a=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim);let l,f;l=n;do l=t.parent(l),r.push(l);while(l&&(e[l].low>a||s>e[l].lim));for(f=l,l=o;l&&l!==f;)i.push(l),l=t.parent(l);return{lca:f,path:r.concat(i.reverse())}},Pde=t=>{var e;const n=Nde(t);(e=t.graph().dummyChains)===null||e===void 0||e.forEach(o=>{var r,i;let a=o,s=t.node(a);const l=s.edgeObj;if(!l)return;const f=kde(t,n,l.v,l.w),h=f.path,v=f.lca;let _=0,E=h[_],O=!0;for(;a!==l.w;){if(s=t.node(a),O){for(;E!==v&&((r=t.node(E))===null||r===void 0?void 0:r.maxRank)<s.rank;)_++,E=h[_];E===v&&(O=!1)}if(!O){for(;_<h.length-1&&((i=t.node(h[_+1]))===null||i===void 0?void 0:i.minRank)<=s.rank;)_++;E=h[_]}t.setParent(a,E),a=t.successors(a)[0]}})},Rde=t=>{var e;const n=uy(t,"root",{},"_root"),o=Dde(t);let r=Math.max(...Object.values(o));Math.abs(r)===1/0&&(r=1);const i=r-1,a=2*i+1;t.graph().nestingRoot=n,t.edges().forEach(l=>{t.edge(l).minlen*=a});const s=jde(t)+1;(e=t.children())===null||e===void 0||e.forEach(l=>{s4(t,n,a,s,i,o,l)}),t.graph().nodeRankFactor=a},s4=(t,e,n,o,r,i,a)=>{const s=t.children(a);if(!(s!=null&&s.length)){a!==e&&t.setEdge(e,a,{weight:0,minlen:n});return}const l=QR(t,"_bt"),f=QR(t,"_bb"),h=t.node(a);t.setParent(l,a),h.borderTop=l,t.setParent(f,a),h.borderBottom=f,s==null||s.forEach(v=>{s4(t,e,n,o,r,i,v);const _=t.node(v),E=_.borderTop?_.borderTop:v,O=_.borderBottom?_.borderBottom:v,w=_.borderTop?o:2*o,S=E!==O?1:r-i[a]+1;t.setEdge(l,E,{minlen:S,weight:w,nestingEdge:!0}),t.setEdge(O,f,{minlen:S,weight:w,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,l,{weight:0,minlen:r+i[a]})},Dde=t=>{var e;const n={},o=(r,i)=>{const a=t.children(r);a==null||a.forEach(s=>o(s,i+1)),n[r]=i};return(e=t.children())===null||e===void 0||e.forEach(r=>o(r,1)),n},jde=t=>{let e=0;return t.edges().forEach(n=>{e+=t.edge(n).weight}),e},Lde=t=>{const e=t.graph();e.nestingRoot&&t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach(n=>{t.edge(n).nestingEdge&&t.removeEdgeObj(n)})},rD={run:Rde,cleanup:Lde},Ide=t=>{var e;const n=o=>{const r=t.children(o),i=t.node(o);if(r!=null&&r.length&&r.forEach(a=>n(a)),i.hasOwnProperty("minRank")){i.borderLeft=[],i.borderRight=[];for(let a=i.minRank,s=i.maxRank+1;a<s;a+=1)oD(t,"borderLeft","_bl",o,i,a),oD(t,"borderRight","_br",o,i,a)}};(e=t.children())===null||e===void 0||e.forEach(o=>n(o))},oD=(t,e,n,o,r,i)=>{const a={rank:i,borderType:e,width:0,height:0},s=r[e][i-1],l=uy(t,"border",a,n);r[e][i]=l,t.setParent(l,o),s&&t.setEdge(s,l,{weight:1})},Fde=t=>{var e;const n=(e=t.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&u4(t)},Bde=t=>{var e;const n=(e=t.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(n==="bt"||n==="rl")&&$de(t),(n==="lr"||n==="rl")&&(Ude(t),u4(t))},u4=t=>{t.nodes().forEach(e=>{iD(t.node(e))}),t.edges().forEach(e=>{iD(t.edge(e))})},iD=t=>{const e=t.width;t.width=t.height,t.height=e},$de=t=>{t.nodes().forEach(e=>{RS(t.node(e))}),t.edges().forEach(e=>{var n;const o=t.edge(e);(n=o.points)===null||n===void 0||n.forEach(r=>RS(r)),o.hasOwnProperty("y")&&RS(o)})},RS=t=>{t!=null&&t.y&&(t.y=-t.y)},Ude=t=>{t.nodes().forEach(e=>{DS(t.node(e))}),t.edges().forEach(e=>{var n;const o=t.edge(e);(n=o.points)===null||n===void 0||n.forEach(r=>DS(r)),o.hasOwnProperty("x")&&DS(o)})},DS=t=>{const e=t.x;t.x=t.y,t.y=e},aD={adjust:Fde,undo:Bde};function Vde(t){return Array.isArray(t)}function E2(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],o=1;o<e;o++)n=Math.max(n,t[o]);return n}const lD=(function(t){if(Vde(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])}),sD=t=>{const e={},n=t.nodes().filter(h=>{var v;return!(!((v=t.children(h))===null||v===void 0)&&v.length)}),o=n.map(h=>t.node(h).rank),r=E2(o),i=[];for(let h=0;h<r+1;h++)i.push([]);const a=h=>{var v;if(e.hasOwnProperty(h))return;e[h]=!0;const _=t.node(h);isNaN(_.rank)||i[_.rank].push(h),(v=t.successors(h))===null||v===void 0||v.forEach(E=>a(E))},s=n.sort((h,v)=>t.node(h).rank-t.node(v).rank),f=s.filter(h=>t.node(h).fixorder!==void 0).sort((h,v)=>t.node(h).fixorder-t.node(v).fixorder);return f==null||f.forEach(h=>{isNaN(t.node(h).rank)||i[t.node(h).rank].push(h),e[h]=!0}),s==null||s.forEach(a),i},Wde=(t,e,n)=>{const o=ide(n,n.map((h,v)=>v)),i=e.map(h=>{var v;const _=(v=t.outEdges(h))===null||v===void 0?void 0:v.map(E=>({pos:o[E.w]||0,weight:t.edge(E).weight}));return _==null?void 0:_.sort((E,O)=>E.pos-O.pos)}).flat().filter(h=>h!==void 0);let a=1;for(;a<n.length;)a<<=1;const s=2*a-1;a-=1;const l=Array(s).fill(0,0,s);let f=0;return i==null||i.forEach(h=>{if(h){let v=h.pos+a;l[v]+=h.weight;let _=0;for(;v>0;)v%2&&(_+=l[v+1]),v=v-1>>1,l[v]+=h.weight;f+=h.weight*_}}),f},uD=(t,e)=>{let n=0;for(let o=1;o<(e==null?void 0:e.length);o+=1)n+=Wde(t,e[o-1],e[o]);return n},Gde=(t,e,n)=>{const o=zde(t),r=new dp({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return t.nodes().forEach(i=>{var a;const s=t.node(i),l=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(r.setNode(i),r.setParent(i,l||o),(a=t[n](i))===null||a===void 0||a.forEach(f=>{const h=f.v===i?f.w:f.v,v=r.edgeFromArgs(h,i),_=v!==void 0?v.weight:0;r.setEdge(h,i,{weight:t.edge(f).weight+_})}),s.hasOwnProperty("minRank")&&r.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))}),r},zde=t=>{let e;for(;t.hasNode(e=`_root${Math.random()}`););return e},Hde=(t,e,n)=>{const o={};let r;n==null||n.forEach(i=>{let a=t.parent(i),s,l;for(;a;){if(s=t.parent(a),s?(l=o[s],o[s]=a):(l=r,r=a),l&&l!==a){e.setEdge(l,a);return}a=s}})},Xde=(t,e)=>e.map(n=>{const o=t.inEdges(n);if(!(o!=null&&o.length))return{v:n};{const r={sum:0,weight:0};return o==null||o.forEach(i=>{const a=t.edge(i),s=t.node(i.v);r.sum+=a.weight*s.order,r.weight+=a.weight}),{v:n,barycenter:r.sum/r.weight,weight:r.weight}}}),Yde=(t,e)=>{var n,o,r;const i={};t==null||t.forEach((s,l)=>{i[s.v]={i:l,indegree:0,in:[],out:[],vs:[s.v]};const f=i[s.v];s.barycenter!==void 0&&(f.barycenter=s.barycenter,f.weight=s.weight)}),(n=e.edges())===null||n===void 0||n.forEach(s=>{const l=i[s.v],f=i[s.w];l!==void 0&&f!==void 0&&(f.indegree++,l.out.push(i[s.w]))});const a=(r=(o=Object.values(i)).filter)===null||r===void 0?void 0:r.call(o,s=>!s.indegree);return qde(a)},qde=t=>{var e,n;const o=[],r=l=>f=>{f.merged||(f.barycenter===void 0||l.barycenter===void 0||f.barycenter>=l.barycenter)&&Kde(l,f)},i=l=>f=>{f.in.push(l),--f.indegree===0&&t.push(f)};for(;t!=null&&t.length;){const l=t.pop();o.push(l),(e=l.in.reverse())===null||e===void 0||e.forEach(f=>r(l)(f)),(n=l.out)===null||n===void 0||n.forEach(f=>i(l)(f))}const a=o.filter(l=>!l.merged),s=["vs","i","barycenter","weight"];return a.map(l=>{const f={};return s==null||s.forEach(h=>{l[h]!==void 0&&(f[h]=l[h])}),f})},Kde=(t,e)=>{var n;let o=0,r=0;t.weight&&(o+=t.barycenter*t.weight,r+=t.weight),e.weight&&(o+=e.barycenter*e.weight,r+=e.weight),t.vs=(n=e.vs)===null||n===void 0?void 0:n.concat(t.vs),t.barycenter=o/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0},Zde=(t,e,n,o)=>{const r=sde(t,_=>{const E=_.hasOwnProperty("fixorder")&&!isNaN(_.fixorder);return o?!E&&_.hasOwnProperty("barycenter"):E||_.hasOwnProperty("barycenter")}),i=r.lhs,a=r.rhs.sort((_,E)=>-_.i- -E.i),s=[];let l=0,f=0,h=0;i==null||i.sort(Jde(!!e,!!n)),h=cD(s,a,h),i==null||i.forEach(_=>{var E;h+=(E=_.vs)===null||E===void 0?void 0:E.length,s.push(_.vs),l+=_.barycenter*_.weight,f+=_.weight,h=cD(s,a,h)});const v={vs:s.flat()};return f&&(v.barycenter=l/f,v.weight=f),v},cD=(t,e,n)=>{let o=n,r;for(;e.length&&(r=e[e.length-1]).i<=o;)e.pop(),t==null||t.push(r.vs),o++;return o},Jde=(t,e)=>(n,o)=>{if(n.fixorder!==void 0&&o.fixorder!==void 0)return n.fixorder-o.fixorder;if(n.barycenter<o.barycenter)return-1;if(n.barycenter>o.barycenter)return 1;if(e&&n.order!==void 0&&o.order!==void 0){if(n.order<o.order)return-1;if(n.order>o.order)return 1}return t?o.i-n.i:n.i-o.i},c4=(t,e,n,o,r,i)=>{var a,s,l,f;let h=t.children(e);const v=t.node(e),_=v?v.borderLeft:void 0,E=v?v.borderRight:void 0,O={};_&&(h=h==null?void 0:h.filter(T=>T!==_&&T!==E));const w=Xde(t,h||[]);w==null||w.forEach(T=>{var B;if(!((B=t.children(T.v))===null||B===void 0)&&B.length){const R=c4(t,T.v,n,o,i);O[T.v]=R,R.hasOwnProperty("barycenter")&&efe(T,R)}});const S=Yde(w,n);Qde(S,O),(a=S.filter(T=>T.vs.length>0))===null||a===void 0||a.forEach(T=>{const B=t.node(T.vs[0]);B&&(T.fixorder=B.fixorder,T.order=B.order)});const M=Zde(S,o,r,i);if(_&&(M.vs=[_,M.vs,E].flat(),!((s=t.predecessors(_))===null||s===void 0)&&s.length)){const T=t.node(((l=t.predecessors(_))===null||l===void 0?void 0:l[0])||""),B=t.node(((f=t.predecessors(E))===null||f===void 0?void 0:f[0])||"");M.hasOwnProperty("barycenter")||(M.barycenter=0,M.weight=0),M.barycenter=(M.barycenter*M.weight+T.order+B.order)/(M.weight+2),M.weight+=2}return M},Qde=(t,e)=>{t==null||t.forEach(n=>{var o;const r=(o=n.vs)===null||o===void 0?void 0:o.map(i=>e[i]?e[i].vs:i);n.vs=r.flat()})},efe=(t,e)=>{t.barycenter!==void 0?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)},tfe=(t,e)=>{const n=Q8(t),o=[],r=[];for(let h=1;h<n+1;h++)o.push(h);for(let h=n-1;h>-1;h--)r.push(h);const i=dD(t,o,"inEdges"),a=dD(t,r,"outEdges");let s=sD(t);jS(t,s);let l=Number.POSITIVE_INFINITY,f;for(let h=0,v=0;v<4;++h,++v){fD(h%2?i:a,h%4>=2,!1,e),s=U_(t);const _=uD(t,s);_<l&&(v=0,f=y1(s),l=_)}s=sD(t),jS(t,s);for(let h=0,v=0;v<4;++h,++v){fD(h%2?i:a,h%4>=2,!0,e),s=U_(t);const _=uD(t,s);_<l&&(v=0,f=y1(s),l=_)}jS(t,f)},dD=(t,e,n)=>e.map(o=>Gde(t,o,n)),fD=(t,e,n,o)=>{const r=new dp;t==null||t.forEach(i=>{var a;const s=i.graph().root,l=c4(i,s,r,e,n,o);for(let f=0;f<((a=l.vs)===null||a===void 0?void 0:a.length);f++){const h=i.node(l.vs[f]);h&&(h.order=f)}Hde(i,r,l.vs)})},jS=(t,e)=>{e==null||e.forEach(n=>{n==null||n.forEach((o,r)=>{t.node(o).order=r})})};class nfe extends sb{}const rfe=(t,e)=>{const n={},o=(r,i)=>{let a=0,s=0;const l=r.length,f=i==null?void 0:i[(i==null?void 0:i.length)-1];return i==null||i.forEach((h,v)=>{var _;const E=ife(t,h),O=E?t.node(E).order:l;(E||h===f)&&((_=i.slice(s,v+1))===null||_===void 0||_.forEach(w=>{var S;(S=t.predecessors(w))===null||S===void 0||S.forEach(M=>{var T;const B=t.node(M),R=B.order;(R<a||O<R)&&!(B.dummy&&(!((T=t.node(w))===null||T===void 0)&&T.dummy))&&d4(n,M,w)})}),s=v+1,a=O)}),i};return e!=null&&e.length&&e.reduce(o),n},ofe=(t,e)=>{const n={};function o(s,l,f,h,v){var _,E;let O;for(let w=l;w<f;w++)O=s[w],!((_=t.node(O))===null||_===void 0)&&_.dummy&&((E=t.predecessors(O))===null||E===void 0||E.forEach(S=>{const M=t.node(S);M.dummy&&(M.order<h||M.order>v)&&d4(n,S,O)}))}function r(s){return JSON.stringify(s.slice(1))}function i(s,l){const f=r(s);l.get(f)||(o(...s),l.set(f,!0))}const a=(s,l)=>{let f=-1,h,v=0;const _=new Map;return l==null||l.forEach((E,O)=>{var w;if(((w=t.node(E))===null||w===void 0?void 0:w.dummy)==="border"){const S=t.predecessors(E)||[];S.length&&(h=t.node(S[0]).order,i([l,v,O,f,h],_),v=O,f=h)}i([l,v,l.length,h,s.length],_)}),l};return e!=null&&e.length&&e.reduce(a),n},ife=(t,e)=>{var n,o;if(!((n=t.node(e))===null||n===void 0)&&n.dummy)return(o=t.predecessors(e))===null||o===void 0?void 0:o.find(r=>t.node(r).dummy)},d4=(t,e,n)=>{let o=e,r=n;if(o>r){const a=o;o=r,r=a}let i=t[o];i||(t[o]=i={}),i[r]=!0},afe=(t,e,n)=>{let o=e,r=n;if(o>r){const i=e;o=r,r=i}return!!t[o]},lfe=(t,e,n,o)=>{const r={},i={},a={};return e==null||e.forEach(s=>{s==null||s.forEach((l,f)=>{r[l]=l,i[l]=l,a[l]=f})}),e==null||e.forEach(s=>{let l=-1;s==null||s.forEach(f=>{let h=o(f);if(h.length){h=h.sort((_,E)=>a[_]-a[E]);const v=(h.length-1)/2;for(let _=Math.floor(v),E=Math.ceil(v);_<=E;++_){const O=h[_];i[f]===f&&l<a[O]&&!afe(n,f,O)&&(i[O]=f,i[f]=r[f]=r[O],l=a[O])}}})}),{root:r,align:i}},sfe=(t,e,n,o,r)=>{var i;const a={},s=ufe(t,e,n,r),l=r?"borderLeft":"borderRight",f=(_,E)=>{let O=s.nodes(),w=O.pop();const S={};for(;w;)S[w]?_(w):(S[w]=!0,O.push(w),O=O.concat(E(w))),w=O.pop()},h=_=>{a[_]=(s.inEdges(_)||[]).reduce((E,O)=>Math.max(E,(a[O.v]||0)+s.edge(O)),0)},v=_=>{const E=(s.outEdges(_)||[]).reduce((w,S)=>Math.min(w,(a[S.w]||0)-s.edge(S)),Number.POSITIVE_INFINITY),O=t.node(_);E!==Number.POSITIVE_INFINITY&&O.borderType!==l&&(a[_]=Math.max(a[_],E))};return f(h,s.predecessors.bind(s)),f(v,s.successors.bind(s)),(i=Object.values(o))===null||i===void 0||i.forEach(_=>{a[_]=a[n[_]]}),a},ufe=(t,e,n,o)=>{const r=new nfe,i=t.graph(),a=pfe(i.nodesep,i.edgesep,o);return e==null||e.forEach(s=>{let l;s==null||s.forEach(f=>{const h=n[f];if(r.setNode(h),l){const v=n[l],_=r.edgeFromArgs(v,h);r.setEdge(v,h,Math.max(a(t,f,l),_||0))}l=f})}),r},cfe=(t,e)=>WM(Object.values(e),n=>{var o;let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return(o=Object.keys(n))===null||o===void 0||o.forEach(a=>{const s=n[a],l=hfe(t,a)/2;r=Math.max(s+l,r),i=Math.min(s-l,i)}),r-i});function dfe(t,e){const n=Object.values(e),o=lD(n),r=E2(n);["u","d"].forEach(i=>{["l","r"].forEach(a=>{const s=i+a,l=t[s];let f;if(l===e)return;const h=Object.values(l);f=a==="l"?o-lD(h):r-E2(h),f&&(t[s]={},Object.keys(l).forEach(v=>{t[s][v]=l[v]+f}))})})}const ffe=(t,e)=>{const n={};return Object.keys(t.ul).forEach(o=>{if(e)n[o]=t[e.toLowerCase()][o];else{const r=Object.values(t).map(i=>i[o]);n[o]=(r[0]+r[1])/2}}),n},pfe=(t,e,n)=>(o,r,i)=>{const a=o.node(r),s=o.node(i);let l=0,f;if(l+=a.width/2,a.hasOwnProperty("labelpos"))switch((a.labelpos||"").toLowerCase()){case"l":f=-a.width/2;break;case"r":f=a.width/2;break}if(f&&(l+=n?f:-f),f=0,l+=(a.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,s.labelpos)switch((s.labelpos||"").toLowerCase()){case"l":f=s.width/2;break;case"r":f=-s.width/2;break}return f&&(l+=n?f:-f),f=0,l},hfe=(t,e)=>t.node(e).width||0,vfe=t=>{const e=U_(t),n=t.graph().ranksep;let o=0;e==null||e.forEach(r=>{const i=r.map(s=>t.node(s).height),a=Math.max(...i,0);r==null||r.forEach(s=>{t.node(s).y=o+a/2}),o+=a+n})},gfe=t=>{const e=U_(t),n=Object.assign(rfe(t,e),ofe(t,e)),o={};let r=[];["u","d"].forEach(a=>{r=a==="u"?e:Object.values(e).reverse(),["l","r"].forEach(s=>{s==="r"&&(r=r.map(v=>Object.values(v).reverse()));const l=(a==="u"?t.predecessors:t.successors).bind(t),f=lfe(t,r,n,l),h=sfe(t,r,f.root,f.align,s==="r");s==="r"&&Object.keys(h).forEach(v=>h[v]=-h[v]),o[a+s]=h})});const i=cfe(t,o);return i&&dfe(o,i),ffe(o,t.graph().align)},mfe=t=>{var e;const n=J8(t);vfe(n);const o=gfe(n);(e=Object.keys(o))===null||e===void 0||e.forEach(r=>{n.node(r).x=o[r]})},yfe=(t,e)=>{const o=t.nodes().filter(a=>{var s;return!(!((s=t.children(a))===null||s===void 0)&&s.length)}).map(a=>t.node(a).rank),r=Math.max(...o),i=[];for(let a=0;a<r+1;a++)i[a]=[];e==null||e.forEach(a=>{const s=t.node(a);!s||s!=null&&s.dummy||isNaN(s.rank)||(s.fixorder=i[s.rank].length,i[s.rank].push(a))})},_fe=(t,e)=>{const n=e&&e.debugTiming?e4:t4;n("layout",()=>{e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",()=>{wfe(t,e.prevGraph)});const o=n(" buildLayoutGraph",()=>Cfe(t));e&&e.edgeLabelSpace===!1||n(" makeSpaceForEdgeLabels",()=>{Nfe(o)});try{n(" runLayout",()=>{bfe(o,n,e)})}catch(r){if(r.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
|
||
`,r);return}throw r}n(" updateInputGraph",()=>{Efe(t,o)})})},bfe=(t,e,n)=>{e(" removeSelfEdges",()=>{Bfe(t)}),e(" acyclic",()=>{ZR.run(t)}),e(" nestingGraph.run",()=>{rD.run(t)}),e(" rank",()=>{Mde(J8(t))}),e(" injectEdgeLabelProxies",()=>{kfe(t)}),e(" removeEmptyRanks",()=>{lde(t)}),e(" nestingGraph.cleanup",()=>{rD.cleanup(t)}),e(" normalizeRanks",()=>{ade(t)}),e(" assignRankMinMax",()=>{Pfe(t)}),e(" removeEdgeLabelProxies",()=>{Rfe(t)}),e(" normalize.run",()=>{eD.run(t)}),e(" parentDummyChains",()=>{Pde(t)}),e(" addBorderSegments",()=>{Ide(t)}),n&&n.keepNodeOrder&&e(" initDataOrder",()=>{yfe(t,n.nodeOrder)}),e(" order",()=>{tfe(t,n==null?void 0:n.keepNodeOrder)}),e(" insertSelfEdges",()=>{$fe(t)}),e(" adjustCoordinateSystem",()=>{aD.adjust(t)}),e(" position",()=>{mfe(t)}),e(" positionSelfEdges",()=>{Ufe(t)}),e(" removeBorderNodes",()=>{Ffe(t)}),e(" normalize.undo",()=>{eD.undo(t)}),e(" fixupEdgeLabelCoords",()=>{Lfe(t)}),e(" undoCoordinateSystem",()=>{aD.undo(t)}),e(" translateGraph",()=>{Dfe(t)}),e(" assignNodeIntersects",()=>{jfe(t)}),e(" reversePoints",()=>{Ife(t)}),e(" acyclic.undo",()=>{ZR.undo(t)})},wfe=(t,e)=>{t.nodes().forEach(n=>{const o=t.node(n),r=e.node(n);r!==void 0?(o.fixorder=r._order,delete r._order):delete o.fixorder})},Efe=(t,e)=>{t.nodes().forEach(n=>{var o;const r=t.node(n);if(r){const i=e.node(n);r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,!((o=e.children(n))===null||o===void 0)&&o.length&&(r.width=i.width,r.height=i.height)}}),t.edges().forEach(n=>{const o=t.edge(n),r=e.edge(n);o.points=r?r.points:[],r&&r.hasOwnProperty("x")&&(o.x=r.x,o.y=r.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height},xfe=["nodesep","edgesep","ranksep","marginx","marginy"],Ofe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},LS=["acyclicer","ranker","rankdir","align"],Sfe=["width","height","layer","fixorder"],Afe={width:0,height:0},Mfe=["minlen","weight","width","height","labeloffset"],Tfe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},IS=["labelpos"],Cfe=t=>{const e=new dp({multigraph:!0,compound:!0}),n=BS(t.graph()),o={};return LS==null||LS.forEach(r=>{n[r]!==void 0&&(o[r]=n[r])}),e.setGraph(Object.assign({},Ofe,FS(n,xfe),o)),t.nodes().forEach(r=>{const i=BS(t.node(r)),a=Object.assign(Object.assign({},Afe),i),s=FS(a,Sfe);e.setNode(r,s),e.setParent(r,t.parent(r))}),t.edges().forEach(r=>{const i=BS(t.edge(r)),a={};IS==null||IS.forEach(s=>{i[s]!==void 0&&(a[s]=i[s])}),e.setEdgeObj(r,Object.assign({},Tfe,FS(i,Mfe),a))}),e},Nfe=t=>{const e=t.graph();e.ranksep||(e.ranksep=0),e.ranksep/=2,t.nodes().forEach(n=>{const o=t.node(n);isNaN(o.layer)||o.layer||(o.layer=0)}),t.edges().forEach(n=>{var o;const r=t.edge(n);r.minlen*=2,((o=r.labelpos)===null||o===void 0?void 0:o.toLowerCase())!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})},kfe=t=>{t.edges().forEach(e=>{const n=t.edge(e);if(n.width&&n.height){const o=t.node(e.v),r=t.node(e.w),i={e,rank:(r.rank-o.rank)/2+o.rank};uy(t,"edge-proxy",i,"_ep")}})},Pfe=t=>{let e=0;t.nodes().forEach(n=>{var o,r;const i=t.node(n);i.borderTop&&(i.minRank=(o=t.node(i.borderTop))===null||o===void 0?void 0:o.rank,i.maxRank=(r=t.node(i.borderBottom))===null||r===void 0?void 0:r.rank,e=Math.max(e,i.maxRank||-1/0))}),t.graph().maxRank=e},Rfe=t=>{t.nodes().forEach(e=>{const n=t.node(e);n.dummy==="edge-proxy"&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})},Dfe=t=>{let e,n=0,o,r=0;const i=t.graph(),a=i.marginx||0,s=i.marginy||0,l=f=>{if(!f)return;const h=f.x,v=f.y,_=f.width,E=f.height;!isNaN(h)&&!isNaN(_)&&(e===void 0&&(e=h-_/2),e=Math.min(e,h-_/2),n=Math.max(n,h+_/2)),!isNaN(v)&&!isNaN(E)&&(o===void 0&&(o=v-E/2),o=Math.min(o,v-E/2),r=Math.max(r,v+E/2))};t.nodes().forEach(f=>{l(t.node(f))}),t.edges().forEach(f=>{const h=t.edge(f);h!=null&&h.hasOwnProperty("x")&&l(h)}),e-=a,o-=s,t.nodes().forEach(f=>{const h=t.node(f);h&&(h.x-=e,h.y-=o)}),t.edges().forEach(f=>{var h;const v=t.edge(f);(h=v.points)===null||h===void 0||h.forEach(_=>{_.x-=e,_.y-=o}),v.hasOwnProperty("x")&&(v.x-=e),v.hasOwnProperty("y")&&(v.y-=o)}),i.width=n-e+a,i.height=r-o+s},jfe=t=>{t.edges().forEach(e=>{const n=t.edge(e),o=t.node(e.v),r=t.node(e.w);let i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=r,a=o),n.points.unshift(JR(o,i)),n.points.push(JR(r,a))})},Lfe=t=>{t.edges().forEach(e=>{const n=t.edge(e);if(n!=null&&n.hasOwnProperty("x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})},Ife=t=>{t.edges().forEach(e=>{var n;const o=t.edge(e);o.reversed&&((n=o.points)===null||n===void 0||n.reverse())})},Ffe=t=>{t.nodes().forEach(e=>{var n,o,r;if(!((n=t.children(e))===null||n===void 0)&&n.length){const i=t.node(e),a=t.node(i.borderTop),s=t.node(i.borderBottom),l=t.node(i.borderLeft[((o=i.borderLeft)===null||o===void 0?void 0:o.length)-1]),f=t.node(i.borderRight[((r=i.borderRight)===null||r===void 0?void 0:r.length)-1]);i.width=Math.abs((f==null?void 0:f.x)-(l==null?void 0:l.x))||10,i.height=Math.abs((s==null?void 0:s.y)-(a==null?void 0:a.y))||10,i.x=((l==null?void 0:l.x)||0)+i.width/2,i.y=((a==null?void 0:a.y)||0)+i.height/2}}),t.nodes().forEach(e=>{var n;((n=t.node(e))===null||n===void 0?void 0:n.dummy)==="border"&&t.removeNode(e)})},Bfe=t=>{t.edges().forEach(e=>{if(e.v===e.w){const n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e,label:t.edge(e)}),t.removeEdgeObj(e)}})},$fe=t=>{const e=U_(t);e==null||e.forEach(n=>{let o=0;n==null||n.forEach((r,i)=>{var a;const s=t.node(r);s.order=i+o,(a=s.selfEdges)===null||a===void 0||a.forEach(l=>{uy(t,"selfedge",{width:l.label.width,height:l.label.height,rank:s.rank,order:i+ ++o,e:l.e,label:l.label},"_se")}),delete s.selfEdges})})},Ufe=t=>{t.nodes().forEach(e=>{const n=t.node(e);if(n.dummy==="selfedge"){const o=t.node(n.e.v),r=o.x+o.width/2,i=o.y,a=n.x-r,s=o.height/2;t.setEdgeObj(n.e,n.label),t.removeNode(e),n.label.points=[{x:r+2*a/3,y:i-s},{x:r+5*a/6,y:i-s},{y:i,x:r+a},{x:r+5*a/6,y:i+s},{x:r+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})},FS=(t,e)=>{const n={};return e==null||e.forEach(o=>{t[o]!==void 0&&(n[o]=+t[o])}),n},BS=(t={})=>{const e={};return Object.keys(t).forEach(n=>{e[n.toLowerCase()]=t[n]}),e},Vfe={layout:_fe,util:{time:e4,notime:t4}};class Wfe extends kce{constructor(e){super(),this.rankdir="TB",this.nodesep=50,this.ranksep=50,this.controlPoints=!1,this.sortByCombo=!1,this.edgeLabelSpace=!0,this.radial=!1,this.nodes=[],this.edges=[],this.onLayoutEnd=()=>{},this.layoutNode=n=>{const o=this,{nodes:r}=o,i=r.find(a=>a.id===n);return i?i.layout!==!1:!0},this.updateCfg(e)}getDefaultCfg(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}}execute(){var e,n,o,r;const i=this,{nodes:a,nodeSize:s,rankdir:l,combos:f,begin:h,radial:v,comboEdges:_=[],vedges:E=[]}=i;if(!a)return;const O=i.edges||[],w=new dp({multigraph:!0,compound:!0});i.nodeMap={};const S={};a.forEach(Y=>{i.nodeMap[Y.id]=Y,Y.comboId&&(S[Y.comboId]=S[Y.comboId]||[],S[Y.comboId].push(Y.id))});let M=[];const T={};!((e=i.nodeOrder)===null||e===void 0)&&e.length?(i.nodeOrder.forEach(Y=>{T[Y]=!0,M.push(i.nodeMap[Y])}),a.forEach(Y=>{T[Y.id]||M.push(Y)})):M=a;let B;s?VR(s)?B=()=>s:B=()=>[s,s]:B=Y=>Y.size?VR(Y.size)?Y.size:K8(Y.size)?[Y.size.width||40,Y.size.height||40]:[Y.size,Y.size]:[40,40];const R=WR(i.ranksep,50,i.ranksepFunc),P=WR(i.nodesep,50,i.nodesepFunc);let $=P,I=R;(l==="LR"||l==="RL")&&($=R,I=P),w.setDefaultEdgeLabel(()=>({})),w.setGraph(i);const F={};this.sortByCombo&&f&&f.forEach(Y=>{if(F[Y.id]=Y,Y.collapsed){const W=B(Y),Q=I(Y),J=$(Y),ie=W[0]+2*J,Se=W[1]+2*Q;w.setNode(Y.id,{width:ie,height:Se})}Y.parentId&&(F[Y.parentId]||w.setNode(Y.parentId,{}),w.setParent(Y.id,Y.parentId))}),M.filter(Y=>Y.layout!==!1).forEach(Y=>{const W=B(Y),Q=I(Y),J=$(Y),ie=W[0]+2*J,Se=W[1]+2*Q,Ae=Y.layer;m1(Ae)?w.setNode(Y.id,{width:ie,height:Se,layer:Ae}):w.setNode(Y.id,{width:ie,height:Se}),this.sortByCombo&&Y.comboId&&(F[Y.comboId]||(F[Y.comboId]={id:Y.comboId},w.setNode(Y.comboId,{})),w.setParent(Y.id,Y.comboId))}),O.forEach(Y=>{const W=cm(Y,"source"),Q=cm(Y,"target");this.layoutNode(W)&&this.layoutNode(Q)&&w.setEdge(W,Q,{weight:Y.weight||1})}),(n=_==null?void 0:_.concat(E||[]))===null||n===void 0||n.forEach(Y=>{var W,Q;const{source:J,target:ie}=Y,Se=!((W=F[J])===null||W===void 0)&&W.collapsed?[J]:S[J]||[J],Ae=!((Q=F[ie])===null||Q===void 0)&&Q.collapsed?[ie]:S[ie]||[ie];Se.forEach(Pe=>{Ae.forEach(De=>{w.setEdge(Pe,De,{weight:Y.weight||1})})})});let U;!((o=i.preset)===null||o===void 0)&&o.nodes&&(U=new dp({multigraph:!0,compound:!0}),i.preset.nodes.forEach(Y=>{U==null||U.setNode(Y.id,Y)})),Vfe.layout(w,{prevGraph:U,edgeLabelSpace:i.edgeLabelSpace,keepNodeOrder:!!i.nodeOrder,nodeOrder:i.nodeOrder});const z=[0,0];if(h){let Y=1/0,W=1/0;w.nodes().forEach(Q=>{const J=w.node(Q);Y>J.x&&(Y=J.x),W>J.y&&(W=J.y)}),w.edges().forEach(Q=>{var J;(J=w.edge(Q).points)===null||J===void 0||J.forEach(Se=>{Y>Se.x&&(Y=Se.x),W>Se.y&&(W=Se.y)})}),z[0]=h[0]-Y,z[1]=h[1]-W}const X=l==="LR"||l==="RL";if(v){const{focusNode:Y,ranksep:W,getRadialPos:Q}=this,J=Pce(Y)?Y:Y==null?void 0:Y.id,ie=J?(r=w.node(J))===null||r===void 0?void 0:r._rank:0,Se=[],Ae=X?"y":"x",Pe=X?"height":"width";let De=1/0,He=-1/0;w.nodes().forEach(se=>{const we=w.node(se);if(!i.nodeMap[se])return;const $e=P(i.nodeMap[se]);if(ie===0)Se[we._rank]||(Se[we._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[we._rank].nodes.push(se),Se[we._rank].totalWidth+=$e*2+we[Pe],Se[we._rank].maxSize<Math.max(we.width,we.height)&&(Se[we._rank].maxSize=Math.max(we.width,we.height));else{const Lt=we._rank-ie;if(Lt===0)Se[Lt]||(Se[Lt]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[Lt].nodes.push(se),Se[Lt].totalWidth+=$e*2+we[Pe],Se[Lt].maxSize<Math.max(we.width,we.height)&&(Se[Lt].maxSize=Math.max(we.width,we.height));else{const Jt=Math.abs(Lt);Se[Jt]||(Se[Jt]={left:[],right:[],totalWidth:0,maxSize:-1/0}),Se[Jt].totalWidth+=$e*2+we[Pe],Se[Jt].maxSize<Math.max(we.width,we.height)&&(Se[Jt].maxSize=Math.max(we.width,we.height)),Lt<0?Se[Jt].left.push(se):Se[Jt].right.push(se)}}const rt=we[Ae]-we[Pe]/2-$e,pt=we[Ae]+we[Pe]/2+$e;rt<De&&(De=rt),pt>He&&(He=pt)});let Ye=W||50;const Be={},Je=(He-De)/.9,mt=[(De+He-Je)*.5,(De+He+Je)*.5],le=(se,we,$e=-1/0,rt=[0,1])=>{let pt=$e;return se.forEach(Lt=>{const Jt=w.node(Lt);Be[Lt]=we;const{x:en,y:zt}=Q(Jt[Ae],mt,Je,we,rt);if(!i.nodeMap[Lt])return;i.nodeMap[Lt].x=en+z[0],i.nodeMap[Lt].y=zt+z[1],i.nodeMap[Lt]._order=Jt._order;const it=R(i.nodeMap[Lt]);pt<it&&(pt=it)}),pt};let Ze=!0;const pe=0;Se.forEach(se=>{var we,$e,rt,pt,Lt,Jt,en;if(!(!((we=se==null?void 0:se.nodes)===null||we===void 0)&&we.length)&&!(!(($e=se==null?void 0:se.left)===null||$e===void 0)&&$e.length)&&!(!((rt=se==null?void 0:se.right)===null||rt===void 0)&&rt.length))return;if(Ze&&se.nodes.length===1){const it=se.nodes[0];if(!i.nodeMap[it])return;i.nodeMap[it].x=z[0],i.nodeMap[it].y=z[1],Be[se.nodes[0]]=0,Ye=R(i.nodeMap[it]),Ze=!1;return}Ye=Math.max(Ye,se.totalWidth/(2*Math.PI));let zt=-1/0;if(ie===0||!((pt=se.nodes)===null||pt===void 0)&&pt.length)zt=le(se.nodes,Ye,zt,[0,1]);else{const it=((Lt=se.left)===null||Lt===void 0?void 0:Lt.length)/(((Jt=se.left)===null||Jt===void 0?void 0:Jt.length)+((en=se.right)===null||en===void 0?void 0:en.length));zt=le(se.left,Ye,zt,[0,it]),zt=le(se.right,Ye,zt,[it+.05,1])}Ye+=zt,Ze=!1,pe-se.maxSize}),w.edges().forEach(se=>{var we,$e,rt;const pt=w.edge(se),Lt=O.findIndex(Jt=>{const en=cm(Jt,"source"),zt=cm(Jt,"target");return en===se.v&&zt===se.w});if(!(Lt<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[Lt].type!=="loop"){const Jt=Ae==="x"?"y":"x",en=(we=pt==null?void 0:pt.points)===null||we===void 0?void 0:we.slice(1,pt.points.length-1),zt=[],it=($e=w.node(se.v))===null||$e===void 0?void 0:$e[Jt],ae=it-((rt=w.node(se.w))===null||rt===void 0?void 0:rt[Jt]),re=Be[se.v],je=re-Be[se.w];en==null||en.forEach(vt=>{const q=(vt[Jt]-it)/ae*je+re,kt=Q(vt[Ae],mt,Je,q);zt.push({x:kt.x+z[0],y:kt.y+z[1]})}),O[Lt].controlPoints=zt}})}else{const Y=new Set,Q=l==="BT"||l==="RL"?(Ae,Pe)=>Pe-Ae:(Ae,Pe)=>Ae-Pe;w.nodes().forEach(Ae=>{const Pe=w.node(Ae);if(!Pe)return;let De=this.nodeMap[Ae];De||(De=f==null?void 0:f.find(He=>He.id===Ae)),De&&(De.x=Pe.x+z[0],De.y=Pe.y+z[1],De._order=Pe._order,Y.add(X?De.x:De.y))});const J=Array.from(Y).sort(Q),ie=X?(Ae,Pe)=>Ae.x!==Pe.x:(Ae,Pe)=>Ae.y!==Pe.y,Se=X?(Ae,Pe,De)=>{const He=Math.max(Pe.y,De.y),Ye=Math.min(Pe.y,De.y);return Ae.filter(Be=>Be.y<=He&&Be.y>=Ye)}:(Ae,Pe,De)=>{const He=Math.max(Pe.x,De.x),Ye=Math.min(Pe.x,De.x);return Ae.filter(Be=>Be.x<=He&&Be.x>=Ye)};w.edges().forEach(Ae=>{var Pe;const De=w.edge(Ae),He=O.findIndex(Ye=>{const Be=cm(Ye,"source"),Je=cm(Ye,"target");return Be===Ae.v&&Je===Ae.w});if(!(He<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[He].type!=="loop"){(Pe=De==null?void 0:De.points)===null||Pe===void 0||Pe.forEach(Je=>{Je.x+=z[0],Je.y+=z[1]});const Ye=i.nodeMap[Ae.v],Be=i.nodeMap[Ae.w];O[He].controlPoints=Gfe(De==null?void 0:De.points,Ye,Be,J,X,ie,Se)}})}return i.onLayoutEnd&&i.onLayoutEnd(),{nodes:a,edges:O}}getRadialPos(e,n,o,r,i=[0,1]){let a=(e-n[0])/o;a=a*(i[1]-i[0])+i[0];const s=a*2*Math.PI;return{x:Math.cos(s)*r,y:Math.sin(s)*r}}getType(){return"dagre"}}const Gfe=(t,e,n,o,r,i,a)=>{let s=(t==null?void 0:t.slice(1,t.length-1))||[];if(e&&n){let{x:l,y:f}=e,{x:h,y:v}=n;if(r&&(l=e.y,f=e.x,h=n.y,v=n.x),v!==f&&l!==h){const _=o.indexOf(f),E=o[_+1];if(E){const S=s[0],M=r?{x:(f+E)/2,y:(S==null?void 0:S.y)||h}:{x:(S==null?void 0:S.x)||h,y:(f+E)/2};(!S||i(S,M))&&s.unshift(M)}const O=o.indexOf(v),w=Math.abs(O-_);if(w===1)s=a(s,e,n),s.length||s.push(r?{x:(f+v)/2,y:l}:{x:l,y:(f+v)/2});else if(w>1){const S=o[O-1];if(S){const M=s[s.length-1],T=r?{x:(v+S)/2,y:(M==null?void 0:M.y)||h}:{x:(M==null?void 0:M.x)||l,y:(v+S)/2};(!M||i(M,T))&&s.push(T)}}}}return s};var pD,hD,vD,gD;(function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"})(pD||(pD={})),(function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"})(hD||(hD={})),(function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"})(vD||(vD={})),(function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"})(gD||(gD={}));var V0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function GM(t,e){return t(e={exports:{}},e.exports),e.exports}var zfe=function(){this.__data__=[],this.size=0},cy=function(t,e){return t===e||t!=t&&e!=e},nE=function(t,e){for(var n=t.length;n--;)if(cy(t[n][0],e))return n;return-1},Hfe=Array.prototype.splice,Xfe=function(t){var e=this.__data__,n=nE(e,t);return!(n<0)&&(n==e.length-1?e.pop():Hfe.call(e,n,1),--this.size,!0)},Yfe=function(t){var e=this.__data__,n=nE(e,t);return n<0?void 0:e[n][1]},qfe=function(t){return nE(this.__data__,t)>-1},Kfe=function(t,e){var n=this.__data__,o=nE(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function vm(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}vm.prototype.clear=zfe,vm.prototype.delete=Xfe,vm.prototype.get=Yfe,vm.prototype.has=qfe,vm.prototype.set=Kfe;var rE=vm,Zfe=function(){this.__data__=new rE,this.size=0},Jfe=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Qfe=function(t){return this.__data__.get(t)},epe=function(t){return this.__data__.has(t)},f4=typeof V0=="object"&&V0&&V0.Object===Object&&V0,tpe=typeof self=="object"&&self&&self.Object===Object&&self,od=f4||tpe||Function("return this")(),ic=od.Symbol,p4=Object.prototype,npe=p4.hasOwnProperty,rpe=p4.toString,$y=ic?ic.toStringTag:void 0,ope=function(t){var e=npe.call(t,$y),n=t[$y];try{t[$y]=void 0;var o=!0}catch{}var r=rpe.call(t);return o&&(e?t[$y]=n:delete t[$y]),r},ipe=Object.prototype.toString,ape=function(t){return ipe.call(t)},mD=ic?ic.toStringTag:void 0,Bh=function(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":mD&&mD in Object(t)?ope(t):ape(t)},Xs=function(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")},yD,ub=function(t){if(!Xs(t))return!1;var e=Bh(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},$S=od["__core-js_shared__"],_D=(yD=/[^.]+$/.exec($S&&$S.keys&&$S.keys.IE_PROTO||""))?"Symbol(src)_1."+yD:"",lpe=function(t){return!!_D&&_D in t},spe=Function.prototype.toString,sg=function(t){if(t!=null){try{return spe.call(t)}catch{}try{return t+""}catch{}}return""},upe=/^\[object .+?Constructor\]$/,cpe=Function.prototype,dpe=Object.prototype,fpe=cpe.toString,ppe=dpe.hasOwnProperty,hpe=RegExp("^"+fpe.call(ppe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vpe=function(t){return!(!Xs(t)||lpe(t))&&(ub(t)?hpe:upe).test(sg(t))},gpe=function(t,e){return t==null?void 0:t[e]},ug=function(t,e){var n=gpe(t,e);return vpe(n)?n:void 0},V_=ug(od,"Map"),W_=ug(Object,"create"),mpe=function(){this.__data__=W_?W_(null):{},this.size=0},ype=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_pe=Object.prototype.hasOwnProperty,bpe=function(t){var e=this.__data__;if(W_){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return _pe.call(e,t)?e[t]:void 0},wpe=Object.prototype.hasOwnProperty,Epe=function(t){var e=this.__data__;return W_?e[t]!==void 0:wpe.call(e,t)},xpe=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=W_&&e===void 0?"__lodash_hash_undefined__":e,this};function gm(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}gm.prototype.clear=mpe,gm.prototype.delete=ype,gm.prototype.get=bpe,gm.prototype.has=Epe,gm.prototype.set=xpe;var bD=gm,Ope=function(){this.size=0,this.__data__={hash:new bD,map:new(V_||rE),string:new bD}},Spe=function(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null},oE=function(t,e){var n=t.__data__;return Spe(e)?n[typeof e=="string"?"string":"hash"]:n.map},Ape=function(t){var e=oE(this,t).delete(t);return this.size-=e?1:0,e},Mpe=function(t){return oE(this,t).get(t)},Tpe=function(t){return oE(this,t).has(t)},Cpe=function(t,e){var n=oE(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function mm(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}mm.prototype.clear=Ope,mm.prototype.delete=Ape,mm.prototype.get=Mpe,mm.prototype.has=Tpe,mm.prototype.set=Cpe;var iE=mm,Npe=function(t,e){var n=this.__data__;if(n instanceof rE){var o=n.__data__;if(!V_||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new iE(o)}return n.set(t,e),this.size=n.size,this};function ym(t){var e=this.__data__=new rE(t);this.size=e.size}ym.prototype.clear=Zfe,ym.prototype.delete=Jfe,ym.prototype.get=Qfe,ym.prototype.has=epe,ym.prototype.set=Npe;var Tm=ym,zM=function(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t},_1=(function(){try{var t=ug(Object,"defineProperty");return t({},"",{}),t}catch{}})(),aE=function(t,e,n){e=="__proto__"&&_1?_1(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},kpe=Object.prototype.hasOwnProperty,lE=function(t,e,n){var o=t[e];kpe.call(t,e)&&cy(o,n)&&(n!==void 0||e in t)||aE(t,e,n)},cb=function(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],l=void 0;l===void 0&&(l=t[s]),r?aE(n,s,l):lE(n,s,l)}return n},Ppe=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},nd=function(t){return t!=null&&typeof t=="object"},wD=function(t){return nd(t)&&Bh(t)=="[object Arguments]"},h4=Object.prototype,Rpe=h4.hasOwnProperty,Dpe=h4.propertyIsEnumerable,Ym=wD((function(){return arguments})())?wD:function(t){return nd(t)&&Rpe.call(t,"callee")&&!Dpe.call(t,"callee")},Ma=Array.isArray,jpe=function(){return!1},Jv=GM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n?od.Buffer:void 0,i=(r?r.isBuffer:void 0)||jpe;t.exports=i})),Lpe=/^(?:0|[1-9]\d*)$/,sE=function(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&Lpe.test(t))&&t>-1&&t%1==0&&t<e},HM=function(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991},ea={};ea["[object Float32Array]"]=ea["[object Float64Array]"]=ea["[object Int8Array]"]=ea["[object Int16Array]"]=ea["[object Int32Array]"]=ea["[object Uint8Array]"]=ea["[object Uint8ClampedArray]"]=ea["[object Uint16Array]"]=ea["[object Uint32Array]"]=!0,ea["[object Arguments]"]=ea["[object Array]"]=ea["[object ArrayBuffer]"]=ea["[object Boolean]"]=ea["[object DataView]"]=ea["[object Date]"]=ea["[object Error]"]=ea["[object Function]"]=ea["[object Map]"]=ea["[object Number]"]=ea["[object Object]"]=ea["[object RegExp]"]=ea["[object Set]"]=ea["[object String]"]=ea["[object WeakMap]"]=!1;var Ipe=function(t){return nd(t)&&HM(t.length)&&!!ea[Bh(t)]},uE=function(t){return function(e){return t(e)}},qm=GM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n&&f4.process,i=(function(){try{var a=o&&o.require&&o.require("util").types;return a||r&&r.binding&&r.binding("util")}catch{}})();t.exports=i})),ED=qm&&qm.isTypedArray,db=ED?uE(ED):Ipe,Fpe=Object.prototype.hasOwnProperty,v4=function(t,e){var n=Ma(t),o=!n&&Ym(t),r=!n&&!o&&Jv(t),i=!n&&!o&&!r&&db(t),a=n||o||r||i,s=a?Ppe(t.length,String):[],l=s.length;for(var f in t)!e&&!Fpe.call(t,f)||a&&(f=="length"||r&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||sE(f,l))||s.push(f);return s},Bpe=Object.prototype,cE=function(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||Bpe)},g4=function(t,e){return function(n){return t(e(n))}},$pe=g4(Object.keys,Object),Upe=Object.prototype.hasOwnProperty,XM=function(t){if(!cE(t))return $pe(t);var e=[];for(var n in Object(t))Upe.call(t,n)&&n!="constructor"&&e.push(n);return e},mp=function(t){return t!=null&&HM(t.length)&&!ub(t)},$h=function(t){return mp(t)?v4(t):XM(t)},Vpe=function(t,e){return t&&cb(e,$h(e),t)},Wpe=function(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e},Gpe=Object.prototype.hasOwnProperty,zpe=function(t){if(!Xs(t))return Wpe(t);var e=cE(t),n=[];for(var o in t)(o!="constructor"||!e&&Gpe.call(t,o))&&n.push(o);return n},cg=function(t){return mp(t)?v4(t,!0):zpe(t)},Hpe=function(t,e){return t&&cb(e,cg(e),t)},m4=GM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n?od.Buffer:void 0,i=r?r.allocUnsafe:void 0;t.exports=function(a,s){if(s)return a.slice();var l=a.length,f=i?i(l):new a.constructor(l);return a.copy(f),f}})),y4=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},_4=function(t,e){for(var n=-1,o=t==null?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[r++]=a)}return i},b4=function(){return[]},Xpe=Object.prototype.propertyIsEnumerable,xD=Object.getOwnPropertySymbols,YM=xD?function(t){return t==null?[]:(t=Object(t),_4(xD(t),(function(e){return Xpe.call(t,e)})))}:b4,Ype=function(t,e){return cb(t,YM(t),e)},qM=function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t},dE=g4(Object.getPrototypeOf,Object),w4=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)qM(e,YM(t)),t=dE(t);return e}:b4,qpe=function(t,e){return cb(t,w4(t),e)},E4=function(t,e,n){var o=e(t);return Ma(t)?o:qM(o,n(t))},x2=function(t){return E4(t,$h,YM)},Kpe=function(t){return E4(t,cg,w4)},O2=ug(od,"DataView"),S2=ug(od,"Promise"),Cm=ug(od,"Set"),A2=ug(od,"WeakMap"),Zpe=sg(O2),Jpe=sg(V_),Qpe=sg(S2),ehe=sg(Cm),the=sg(A2),jv=Bh;(O2&&jv(new O2(new ArrayBuffer(1)))!="[object DataView]"||V_&&jv(new V_)!="[object Map]"||S2&&jv(S2.resolve())!="[object Promise]"||Cm&&jv(new Cm)!="[object Set]"||A2&&jv(new A2)!="[object WeakMap]")&&(jv=function(t){var e=Bh(t),n=e=="[object Object]"?t.constructor:void 0,o=n?sg(n):"";if(o)switch(o){case Zpe:return"[object DataView]";case Jpe:return"[object Map]";case Qpe:return"[object Promise]";case ehe:return"[object Set]";case the:return"[object WeakMap]"}return e});var Qv=jv,nhe=Object.prototype.hasOwnProperty,rhe=function(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&nhe.call(t,"index")&&(n.index=t.index,n.input=t.input),n},b1=od.Uint8Array,KM=function(t){var e=new t.constructor(t.byteLength);return new b1(e).set(new b1(t)),e},ohe=function(t,e){var n=e?KM(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)},ihe=/\w*$/,ahe=function(t){var e=new t.constructor(t.source,ihe.exec(t));return e.lastIndex=t.lastIndex,e},OD=ic?ic.prototype:void 0,SD=OD?OD.valueOf:void 0,lhe=function(t){return SD?Object(SD.call(t)):{}},x4=function(t,e){var n=e?KM(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},she=function(t,e,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return KM(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return ohe(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return x4(t,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return ahe(t);case"[object Set]":return new o;case"[object Symbol]":return lhe(t)}},AD=Object.create,O4=(function(){function t(){}return function(e){if(!Xs(e))return{};if(AD)return AD(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})(),S4=function(t){return typeof t.constructor!="function"||cE(t)?{}:O4(dE(t))},uhe=function(t){return nd(t)&&Qv(t)=="[object Map]"},MD=qm&&qm.isMap,che=MD?uE(MD):uhe,dhe=function(t){return nd(t)&&Qv(t)=="[object Set]"},TD=qm&&qm.isSet,fhe=TD?uE(TD):dhe,Hi={};Hi["[object Arguments]"]=Hi["[object Array]"]=Hi["[object ArrayBuffer]"]=Hi["[object DataView]"]=Hi["[object Boolean]"]=Hi["[object Date]"]=Hi["[object Float32Array]"]=Hi["[object Float64Array]"]=Hi["[object Int8Array]"]=Hi["[object Int16Array]"]=Hi["[object Int32Array]"]=Hi["[object Map]"]=Hi["[object Number]"]=Hi["[object Object]"]=Hi["[object RegExp]"]=Hi["[object Set]"]=Hi["[object String]"]=Hi["[object Symbol]"]=Hi["[object Uint8Array]"]=Hi["[object Uint8ClampedArray]"]=Hi["[object Uint16Array]"]=Hi["[object Uint32Array]"]=!0,Hi["[object Error]"]=Hi["[object Function]"]=Hi["[object WeakMap]"]=!1;var A4=function t(e,n,o,r,i,a){var s,l=1&n,f=2&n,h=4&n;if(s!==void 0)return s;if(!Xs(e))return e;var v=Ma(e);if(v){if(s=rhe(e),!l)return y4(e,s)}else{var _=Qv(e),E=_=="[object Function]"||_=="[object GeneratorFunction]";if(Jv(e))return m4(e,l);if(_=="[object Object]"||_=="[object Arguments]"||E&&!i){if(s=f||E?{}:S4(e),!l)return f?qpe(e,Hpe(s,e)):Ype(e,Vpe(s,e))}else{if(!Hi[_])return i?e:{};s=she(e,_,l)}}a||(a=new Tm);var O=a.get(e);if(O)return O;a.set(e,s),fhe(e)?e.forEach((function(S){s.add(t(S,n,o,S,e,a))})):che(e)&&e.forEach((function(S,M){s.set(M,t(S,n,o,M,e,a))}));var w=v?void 0:(h?f?Kpe:x2:f?cg:$h)(e);return zM(w||e,(function(S,M){w&&(S=e[M=S]),lE(s,M,t(S,n,o,M,e,a))})),s},phe=function(t){return A4(t,4)},ZM=function(t){return function(){return t}},JM=(function(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),s=a.length;s--;){var l=a[++r];if(n(i[l],l,i)===!1)break}return e}})(),QM=function(t,e){return t&&JM(t,e,$h)},fE=(function(t,e){return function(n,o){if(n==null)return n;if(!mp(n))return t(n,o);for(var r=n.length,i=-1,a=Object(n);++i<r&&o(a[i],i,a)!==!1;);return n}})(QM),dg=function(t){return t},M4=function(t){return typeof t=="function"?t:dg},T4=function(t,e){return(Ma(t)?zM:fE)(t,M4(e))},C4=T4,hhe=function(t,e){var n=[];return fE(t,(function(o,r,i){e(o,r,i)&&n.push(o)})),n},vhe=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ghe=function(t){return this.__data__.has(t)};function aw(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new iE;++e<n;)this.add(t[e])}aw.prototype.add=aw.prototype.push=vhe,aw.prototype.has=ghe;var N4=aw,mhe=function(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1},k4=function(t,e){return t.has(e)},P4=function(t,e,n,o,r,i){var a=1&n,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var v=-1,_=!0,E=2&n?new N4:void 0;for(i.set(t,e),i.set(e,t);++v<s;){var O=t[v],w=e[v];if(o)var S=a?o(w,O,v,e,t,i):o(O,w,v,t,e,i);if(S!==void 0){if(S)continue;_=!1;break}if(E){if(!mhe(e,(function(M,T){if(!k4(E,T)&&(O===M||r(O,M,n,o,i)))return E.push(T)}))){_=!1;break}}else if(O!==w&&!r(O,w,n,o,i)){_=!1;break}}return i.delete(t),i.delete(e),_},yhe=function(t){var e=-1,n=Array(t.size);return t.forEach((function(o,r){n[++e]=[r,o]})),n},eT=function(t){var e=-1,n=Array(t.size);return t.forEach((function(o){n[++e]=o})),n},CD=ic?ic.prototype:void 0,US=CD?CD.valueOf:void 0,_he=function(t,e,n,o,r,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new b1(t),new b1(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return cy(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var s=yhe;case"[object Set]":var l=1&o;if(s||(s=eT),t.size!=e.size&&!l)return!1;var f=a.get(t);if(f)return f==e;o|=2,a.set(t,e);var h=P4(s(t),s(e),o,r,i,a);return a.delete(t),h;case"[object Symbol]":if(US)return US.call(t)==US.call(e)}return!1},bhe=Object.prototype.hasOwnProperty,whe=function(t,e,n,o,r,i){var a=1&n,s=x2(t),l=s.length;if(l!=x2(e).length&&!a)return!1;for(var f=l;f--;){var h=s[f];if(!(a?h in e:bhe.call(e,h)))return!1}var v=i.get(t),_=i.get(e);if(v&&_)return v==e&&_==t;var E=!0;i.set(t,e),i.set(e,t);for(var O=a;++f<l;){var w=t[h=s[f]],S=e[h];if(o)var M=a?o(S,w,h,e,t,i):o(w,S,h,t,e,i);if(!(M===void 0?w===S||r(w,S,n,o,i):M)){E=!1;break}O||(O=h=="constructor")}if(E&&!O){var T=t.constructor,B=e.constructor;T==B||!("constructor"in t)||!("constructor"in e)||typeof T=="function"&&T instanceof T&&typeof B=="function"&&B instanceof B||(E=!1)}return i.delete(t),i.delete(e),E},ND=Object.prototype.hasOwnProperty,Ehe=function(t,e,n,o,r,i){var a=Ma(t),s=Ma(e),l=a?"[object Array]":Qv(t),f=s?"[object Array]":Qv(e),h=(l=l=="[object Arguments]"?"[object Object]":l)=="[object Object]",v=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",_=l==f;if(_&&Jv(t)){if(!Jv(e))return!1;a=!0,h=!1}if(_&&!h)return i||(i=new Tm),a||db(t)?P4(t,e,n,o,r,i):_he(t,e,l,n,o,r,i);if(!(1&n)){var E=h&&ND.call(t,"__wrapped__"),O=v&&ND.call(e,"__wrapped__");if(E||O){var w=E?t.value():t,S=O?e.value():e;return i||(i=new Tm),r(w,S,n,o,i)}}return!!_&&(i||(i=new Tm),whe(t,e,n,o,r,i))},R4=function t(e,n,o,r,i){return e===n||(e==null||n==null||!nd(e)&&!nd(n)?e!=e&&n!=n:Ehe(e,n,o,r,t,i))},xhe=function(t,e,n,o){var r=n.length,i=r;if(t==null)return!i;for(t=Object(t);r--;){var a=n[r];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++r<i;){var s=(a=n[r])[0],l=t[s],f=a[1];if(a[2]){if(l===void 0&&!(s in t))return!1}else{var h=new Tm,v;if(!(v===void 0?R4(f,l,3,o,h):v))return!1}}return!0},D4=function(t){return t==t&&!Xs(t)},Ohe=function(t){for(var e=$h(t),n=e.length;n--;){var o=e[n],r=t[o];e[n]=[o,r,D4(r)]}return e},j4=function(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}},She=function(t){var e=Ohe(t);return e.length==1&&e[0][2]?j4(e[0][0],e[0][1]):function(n){return n===t||xhe(n,t,e)}},eg=function(t){return typeof t=="symbol"||nd(t)&&Bh(t)=="[object Symbol]"},Ahe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mhe=/^\w*$/,tT=function(t,e){if(Ma(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!eg(t))||Mhe.test(t)||!Ahe.test(t)||e!=null&&t in Object(e)};function nT(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,r=e?e.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=t.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(nT.Cache||iE),n}nT.Cache=iE;var The=nT,Che=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nhe=/\\(\\)?/g,khe=(function(t){var e=The(t,(function(o){return n.size===500&&n.clear(),o})),n=e.cache;return e})((function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Che,(function(n,o,r,i){e.push(r?i.replace(Nhe,"$1"):o||n)})),e})),Nm=function(t,e){for(var n=-1,o=t==null?0:t.length,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r},kD=ic?ic.prototype:void 0,PD=kD?kD.toString:void 0,Phe=function t(e){if(typeof e=="string")return e;if(Ma(e))return Nm(e,t)+"";if(eg(e))return PD?PD.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n},L4=function(t){return t==null?"":Phe(t)},pE=function(t,e){return Ma(t)?t:tT(t,e)?[t]:khe(L4(t))},fb=function(t){if(typeof t=="string"||eg(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e},hE=function(t,e){for(var n=0,o=(e=pE(e,t)).length;t!=null&&n<o;)t=t[fb(e[n++])];return n&&n==o?t:void 0},Rhe=function(t,e,n){var o=t==null?void 0:hE(t,e);return o===void 0?n:o},Dhe=function(t,e){return t!=null&&e in Object(t)},I4=function(t,e,n){for(var o=-1,r=(e=pE(e,t)).length,i=!1;++o<r;){var a=fb(e[o]);if(!(i=t!=null&&n(t,a)))break;t=t[a]}return i||++o!=r?i:!!(r=t==null?0:t.length)&&HM(r)&&sE(a,r)&&(Ma(t)||Ym(t))},F4=function(t,e){return t!=null&&I4(t,e,Dhe)},jhe=function(t,e){return tT(t)&&D4(e)?j4(fb(t),e):function(n){var o=Rhe(n,t);return o===void 0&&o===e?F4(n,t):R4(e,o,3)}},B4=function(t){return function(e){return e==null?void 0:e[t]}},Lhe=function(t){return function(e){return hE(e,t)}},Ihe=function(t){return tT(t)?B4(fb(t)):Lhe(t)},yp=function(t){return typeof t=="function"?t:t==null?dg:typeof t=="object"?Ma(t)?jhe(t[0],t[1]):She(t):Ihe(t)},$4=function(t,e){return(Ma(t)?_4:hhe)(t,yp(e))},Fhe=Object.prototype.hasOwnProperty,Bhe=function(t,e){return t!=null&&Fhe.call(t,e)},U4=function(t,e){return t!=null&&I4(t,e,Bhe)},$he=Object.prototype.hasOwnProperty,Uhe=function(t){if(t==null)return!0;if(mp(t)&&(Ma(t)||typeof t=="string"||typeof t.splice=="function"||Jv(t)||db(t)||Ym(t)))return!t.length;var e=Qv(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(cE(t))return!XM(t).length;for(var n in t)if($he.call(t,n))return!1;return!0},V4=function(t){return t===void 0},W4=function(t,e){var n=-1,o=mp(t)?Array(t.length):[];return fE(t,(function(r,i,a){o[++n]=e(r,i,a)})),o},G4=function(t,e){return(Ma(t)?Nm:W4)(t,yp(e))},Vhe=function(t,e,n,o){var r=-1,i=t==null?0:t.length;for(o&&i&&(n=t[++r]);++r<i;)n=e(n,t[r],r,t);return n},Whe=function(t,e,n,o,r){return r(t,(function(i,a,s){n=o?(o=!1,i):e(n,i,a,s)})),n},z4=function(t,e,n){var o=Ma(t)?Vhe:Whe,r=arguments.length<3;return o(t,yp(e),n,r,fE)},Ghe=function(t){return typeof t=="string"||!Ma(t)&&nd(t)&&Bh(t)=="[object String]"},zhe=B4("length"),Hhe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Xhe=function(t){return Hhe.test(t)},Yhe="[\\ud800-\\udfff]",M2="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",T2="\\ud83c[\\udffb-\\udfff]",H4="[^\\ud800-\\udfff]",X4="(?:\\ud83c[\\udde6-\\uddff]){2}",Y4="[\\ud800-\\udbff][\\udc00-\\udfff]",RD="(?:"+M2+"|"+T2+")?",qhe="[\\ufe0e\\ufe0f]?"+RD+("(?:\\u200d(?:"+[H4,X4,Y4].join("|")+")[\\ufe0e\\ufe0f]?"+RD+")*"),Khe="(?:"+[H4+M2+"?",M2,X4,Y4,Yhe].join("|")+")",DD=RegExp(T2+"(?="+T2+")|"+Khe+qhe,"g"),Zhe=function(t){for(var e=DD.lastIndex=0;DD.test(t);)++e;return e},Jhe=function(t){return Xhe(t)?Zhe(t):zhe(t)},Qhe=function(t){if(t==null)return 0;if(mp(t))return Ghe(t)?Jhe(t):t.length;var e=Qv(t);return e=="[object Map]"||e=="[object Set]"?t.size:XM(t).length},eve=function(t,e,n){var o=Ma(t),r=o||Jv(t)||db(t);if(e=yp(e),n==null){var i=t&&t.constructor;n=r?o?new i:[]:Xs(t)&&ub(i)?O4(dE(t)):{}}return(r?zM:QM)(t,(function(a,s,l){return e(n,a,s,l)})),n},jD=ic?ic.isConcatSpreadable:void 0,tve=function(t){return Ma(t)||Ym(t)||!!(jD&&t&&t[jD])},rT=function(e,n,o,r,i){var a=-1,s=e.length;for(o||(o=tve),i||(i=[]);++a<s;){var l=e[a];o(l)?qM(i,l):r||(i[i.length]=l)}return i},nve=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},LD=Math.max,q4=function(t,e,n){return e=LD(e===void 0?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=LD(o.length-e,0),a=Array(i);++r<i;)a[r]=o[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=o[r];return s[e]=n(a),nve(t,this,s)}},rve=_1?function(t,e){return _1(t,"toString",{configurable:!0,enumerable:!1,value:ZM(e),writable:!0})}:dg,ove=Date.now,K4=(function(t){var e=0,n=0;return function(){var o=ove(),r=16-(o-n);if(n=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}})(rve),vE=function(t,e){return K4(q4(t,e,dg),t+"")},Z4=function(t,e,n,o){for(var r=t.length,i=n+-1;++i<r;)if(e(t[i],i,t))return i;return-1},ive=function(t){return t!=t},ave=function(t,e,n){for(var o=n-1,r=t.length;++o<r;)if(t[o]===e)return o;return-1},lve=function(t,e,n){return e==e?ave(t,e,n):Z4(t,ive,n)},sve=function(t,e){return!!(t!=null&&t.length)&&lve(t,e,0)>-1},uve=function(){},cve=Cm&&1/eT(new Cm([,-0]))[1]==1/0?function(t){return new Cm(t)}:uve,dve=function(t,e,n){var o=-1,r=sve,i=t.length,a=!0,s=[],l=s;if(i>=200){var f=cve(t);if(f)return eT(f);a=!1,r=k4,l=new N4}else l=s;e:for(;++o<i;){var h=t[o],v=h;if(h=h!==0?h:0,a&&v==v){for(var _=l.length;_--;)if(l[_]===v)continue e;s.push(h)}else r(l,v,n)||(l!==s&&l.push(v),s.push(h))}return s},J4=function(t){return nd(t)&&mp(t)},fve=vE((function(t){return dve(rT(t,1,J4,!0))})),pve=function(t,e){return Nm(e,(function(n){return t[n]}))},w1,Q4=function(t){return t==null?[]:pve(t,$h(t))};try{w1={clone:phe,constant:ZM,each:C4,filter:$4,has:U4,isArray:Ma,isEmpty:Uhe,isFunction:ub,isUndefined:V4,keys:$h,map:G4,reduce:z4,size:Qhe,transform:eve,union:fve,values:Q4}}catch{}w1||(w1=window._);var tr=w1,oT=Po;function Po(t){this._isDirected=!tr.has(t,"directed")||t.directed,this._isMultigraph=!!tr.has(t,"multigraph")&&t.multigraph,this._isCompound=!!tr.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=tr.constant(void 0),this._defaultEdgeLabelFn=tr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function ID(t,e){t[e]?t[e]++:t[e]=1}function FD(t,e){--t[e]||delete t[e]}function Zy(t,e,n,o){var r=""+e,i=""+n;if(!t&&r>i){var a=r;r=i,i=a}return r+""+i+""+(tr.isUndefined(o)?"\0":o)}function hve(t,e,n,o){var r=""+e,i=""+n;if(!t&&r>i){var a=r;r=i,i=a}var s={v:r,w:i};return o&&(s.name=o),s}function VS(t,e){return Zy(t,e.v,e.w,e.name)}Po.prototype._nodeCount=0,Po.prototype._edgeCount=0,Po.prototype.isDirected=function(){return this._isDirected},Po.prototype.isMultigraph=function(){return this._isMultigraph},Po.prototype.isCompound=function(){return this._isCompound},Po.prototype.setGraph=function(t){return this._label=t,this},Po.prototype.graph=function(){return this._label},Po.prototype.setDefaultNodeLabel=function(t){return tr.isFunction(t)||(t=tr.constant(t)),this._defaultNodeLabelFn=t,this},Po.prototype.nodeCount=function(){return this._nodeCount},Po.prototype.nodes=function(){return tr.keys(this._nodes)},Po.prototype.sources=function(){var t=this;return tr.filter(this.nodes(),(function(e){return tr.isEmpty(t._in[e])}))},Po.prototype.sinks=function(){var t=this;return tr.filter(this.nodes(),(function(e){return tr.isEmpty(t._out[e])}))},Po.prototype.setNodes=function(t,e){var n=arguments,o=this;return tr.each(t,(function(r){n.length>1?o.setNode(r,e):o.setNode(r)})),this},Po.prototype.setNode=function(t,e){return tr.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},Po.prototype.node=function(t){return this._nodes[t]},Po.prototype.hasNode=function(t){return tr.has(this._nodes,t)},Po.prototype.removeNode=function(t){var e=this;if(tr.has(this._nodes,t)){var n=function(o){e.removeEdge(e._edgeObjs[o])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],tr.each(this.children(t),(function(o){e.setParent(o)})),delete this._children[t]),tr.each(tr.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],tr.each(tr.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},Po.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(tr.isUndefined(e))e="\0";else{for(var n=e+="";!tr.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},Po.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},Po.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!=="\0")return e}},Po.prototype.children=function(t){if(tr.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return tr.keys(e)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}},Po.prototype.predecessors=function(t){var e=this._preds[t];if(e)return tr.keys(e)},Po.prototype.successors=function(t){var e=this._sucs[t];if(e)return tr.keys(e)},Po.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return tr.union(e,this.successors(t))},Po.prototype.isLeaf=function(t){return(this.isDirected()?this.successors(t):this.neighbors(t)).length===0},Po.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;tr.each(this._nodes,(function(i,a){t(a)&&e.setNode(a,i)})),tr.each(this._edgeObjs,(function(i){e.hasNode(i.v)&&e.hasNode(i.w)&&e.setEdge(i,n.edge(i))}));var o={};function r(i){var a=n.parent(i);return a===void 0||e.hasNode(a)?(o[i]=a,a):a in o?o[a]:r(a)}return this._isCompound&&tr.each(e.nodes(),(function(i){e.setParent(i,r(i))})),e},Po.prototype.setDefaultEdgeLabel=function(t){return tr.isFunction(t)||(t=tr.constant(t)),this._defaultEdgeLabelFn=t,this},Po.prototype.edgeCount=function(){return this._edgeCount},Po.prototype.edges=function(){return tr.values(this._edgeObjs)},Po.prototype.setPath=function(t,e){var n=this,o=arguments;return tr.reduce(t,(function(r,i){return o.length>1?n.setEdge(r,i,e):n.setEdge(r,i),i})),this},Po.prototype.setEdge=function(){var t,e,n,o,r=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,e=i.w,n=i.name,arguments.length===2&&(o=arguments[1],r=!0)):(t=i,e=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),t=""+t,e=""+e,tr.isUndefined(n)||(n=""+n);var a=Zy(this._isDirected,t,e,n);if(tr.has(this._edgeLabels,a))return r&&(this._edgeLabels[a]=o),this;if(!tr.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=r?o:this._defaultEdgeLabelFn(t,e,n);var s=hve(this._isDirected,t,e,n);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,ID(this._preds[e],t),ID(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},Po.prototype.edge=function(t,e,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,t,e,n);return this._edgeLabels[o]},Po.prototype.hasEdge=function(t,e,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,t,e,n);return tr.has(this._edgeLabels,o)},Po.prototype.removeEdge=function(t,e,n){var o=arguments.length===1?VS(this._isDirected,arguments[0]):Zy(this._isDirected,t,e,n),r=this._edgeObjs[o];return r&&(t=r.v,e=r.w,delete this._edgeLabels[o],delete this._edgeObjs[o],FD(this._preds[e],t),FD(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--),this},Po.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var o=tr.values(n);return e?tr.filter(o,(function(r){return r.v===e})):o}},Po.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var o=tr.values(n);return e?tr.filter(o,(function(r){return r.w===e})):o}},Po.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var BD={Graph:oT,version:"2.1.8"},vve={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:gve(t),edges:mve(t)};return tr.isUndefined(t.graph())||(e.value=tr.clone(t.graph())),e},read:function(t){var e=new oT(t.options).setGraph(t.value);return tr.each(t.nodes,(function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)})),tr.each(t.edges,(function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),e}};function gve(t){return tr.map(t.nodes(),(function(e){var n=t.node(e),o=t.parent(e),r={v:e};return tr.isUndefined(n)||(r.value=n),tr.isUndefined(o)||(r.parent=o),r}))}function mve(t){return tr.map(t.edges(),(function(e){var n=t.edge(e),o={v:e.v,w:e.w};return tr.isUndefined(e.name)||(o.name=e.name),tr.isUndefined(n)||(o.value=n),o}))}var yve=function(t){var e,n={},o=[];function r(i){tr.has(n,i)||(n[i]=!0,e.push(i),tr.each(t.successors(i),r),tr.each(t.predecessors(i),r))}return tr.each(t.nodes(),(function(i){e=[],r(i),e.length&&o.push(e)})),o},e5=Gu;function Gu(){this._arr=[],this._keyIndices={}}Gu.prototype.size=function(){return this._arr.length},Gu.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},Gu.prototype.has=function(t){return tr.has(this._keyIndices,t)},Gu.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority},Gu.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Gu.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!tr.has(n,t)){var o=this._arr,r=o.length;return n[t]=r,o.push({key:t,priority:e}),this._decrease(r),!0}return!1},Gu.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},Gu.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},Gu.prototype._heapify=function(t){var e=this._arr,n=2*t,o=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,o<e.length&&(r=e[o].priority<e[r].priority?o:r),r!==t&&(this._swap(t,r),this._heapify(r)))},Gu.prototype._decrease=function(t){for(var e,n=this._arr,o=n[t].priority;t!==0&&!(n[e=t>>1].priority<o);)this._swap(t,e),t=e},Gu.prototype._swap=function(t,e){var n=this._arr,o=this._keyIndices,r=n[t],i=n[e];n[t]=i,n[e]=r,o[i.key]=t,o[r.key]=e};var t5=function(t,e,n,o){return(function(r,i,a,s){var l,f,h={},v=new e5,_=function(E){var O=E.v!==l?E.v:E.w,w=h[O],S=a(E),M=f.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+E+" Weight: "+S);M<w.distance&&(w.distance=M,w.predecessor=l,v.decrease(O,M))};for(r.nodes().forEach((function(E){var O=E===i?0:Number.POSITIVE_INFINITY;h[E]={distance:O},v.add(E,O)}));v.size()>0&&(l=v.removeMin(),(f=h[l]).distance!==Number.POSITIVE_INFINITY);)s(l).forEach(_);return h})(t,String(e),n||_ve,o||function(r){return t.outEdges(r)})},_ve=tr.constant(1),bve=function(t,e,n){return tr.transform(t.nodes(),(function(o,r){o[r]=t5(t,r,e,n)}),{})},n5=function(t){var e=0,n=[],o={},r=[];function i(a){var s=o[a]={onStack:!0,lowlink:e,index:e++};if(n.push(a),t.successors(a).forEach((function(h){tr.has(o,h)?o[h].onStack&&(s.lowlink=Math.min(s.lowlink,o[h].index)):(i(h),s.lowlink=Math.min(s.lowlink,o[h].lowlink))})),s.lowlink===s.index){var l,f=[];do l=n.pop(),o[l].onStack=!1,f.push(l);while(a!==l);r.push(f)}}return t.nodes().forEach((function(a){tr.has(o,a)||i(a)})),r},wve=function(t){return tr.filter(n5(t),(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])}))},Eve=function(t,e,n){return(function(o,r,i){var a={},s=o.nodes();return s.forEach((function(l){a[l]={},a[l][l]={distance:0},s.forEach((function(f){l!==f&&(a[l][f]={distance:Number.POSITIVE_INFINITY})})),i(l).forEach((function(f){var h=f.v===l?f.w:f.v,v=r(f);a[l][h]={distance:v,predecessor:l}}))})),s.forEach((function(l){var f=a[l];s.forEach((function(h){var v=a[h];s.forEach((function(_){var E=v[l],O=f[_],w=v[_],S=E.distance+O.distance;S<w.distance&&(w.distance=S,w.predecessor=O.predecessor)}))}))})),a})(t,e||xve,n||function(o){return t.outEdges(o)})},xve=tr.constant(1),WS=r5;function r5(t){var e={},n={},o=[];if(tr.each(t.sinks(),(function r(i){if(tr.has(n,i))throw new E1;tr.has(e,i)||(n[i]=!0,e[i]=!0,tr.each(t.predecessors(i),r),delete n[i],o.push(i))})),tr.size(e)!==t.nodeCount())throw new E1;return o}function E1(){}r5.CycleException=E1,E1.prototype=new Error;var $D=function(t,e,n){tr.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],i={};return tr.each(e,(function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);o5(t,a,n==="post",i,o,r)})),r};function o5(t,e,n,o,r,i){tr.has(o,e)||(o[e]=!0,n||i.push(e),tr.each(r(e),(function(a){o5(t,a,n,o,r,i)})),n&&i.push(e))}var x1,Ove={Graph:BD.Graph,json:vve,alg:{components:yve,dijkstra:t5,dijkstraAll:bve,findCycles:wve,floydWarshall:Eve,isAcyclic:function(t){try{WS(t)}catch(e){if(e instanceof WS.CycleException)return!1;throw e}return!0},postorder:function(t,e){return $D(t,e,"post")},preorder:function(t,e){return $D(t,e,"pre")},prim:function(t,e){var n,o=new oT,r={},i=new e5;function a(l){var f=l.v===n?l.w:l.v,h=i.priority(f);if(h!==void 0){var v=e(l);v<h&&(r[f]=n,i.decrease(f,v))}}if(t.nodeCount()===0)return o;tr.each(t.nodes(),(function(l){i.add(l,Number.POSITIVE_INFINITY),o.setNode(l)})),i.decrease(t.nodes()[0],0);for(var s=!1;i.size()>0;){if(n=i.removeMin(),tr.has(r,n))o.setEdge(n,r[n]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(n).forEach(a)}return o},tarjan:n5,topsort:WS},version:BD.version};try{x1=Ove}catch{}x1||(x1=window.graphlib);var nf=x1,Sve=function(t){return A4(t,5)},G_=function(t,e,n){if(!Xs(n))return!1;var o=typeof e;return!!(o=="number"?mp(n)&&sE(e,n.length):o=="string"&&e in n)&&cy(n[e],t)},i5=Object.prototype,Ave=i5.hasOwnProperty,Mve=vE((function(t,e){t=Object(t);var n=-1,o=e.length,r=o>2?e[2]:void 0;for(r&&G_(e[0],e[1],r)&&(o=1);++n<o;)for(var i=e[n],a=cg(i),s=-1,l=a.length;++s<l;){var f=a[s],h=t[f];(h===void 0||cy(h,i5[f])&&!Ave.call(t,f))&&(t[f]=i[f])}return t})),Tve=function(t){return function(e,n,o){var r=Object(e);if(!mp(e)){var i=yp(n);e=$h(e),n=function(s){return i(r[s],s,r)}}var a=t(e,n,o);return a>-1?r[i?e[a]:a]:void 0}},Cve=/^\s+|\s+$/g,Nve=/^[-+]0x[0-9a-f]+$/i,kve=/^0b[01]+$/i,Pve=/^0o[0-7]+$/i,Rve=parseInt,Dve=function(t){if(typeof t=="number")return t;if(eg(t))return NaN;if(Xs(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xs(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Cve,"");var n=kve.test(t);return n||Pve.test(t)?Rve(t.slice(2),n?2:8):Nve.test(t)?NaN:+t},lw=function(t){return t?(t=Dve(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:t===0?t:0},jve=function(t){var e=lw(t),n=e%1;return e==e?n?e-n:e:0},Lve=Math.max,Ive=Tve((function(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var r=n==null?0:jve(n);return r<0&&(r=Lve(o+r,0)),Z4(t,yp(e),r)})),a5=function(t){return t!=null&&t.length?rT(t):[]},Fve=function(t,e){return t==null?t:JM(t,M4(e),cg)},Bve=function(t){var e=t==null?0:t.length;return e?t[e-1]:void 0},$ve=function(t,e){var n={};return e=yp(e),QM(t,(function(o,r,i){aE(n,r,e(o,r,i))})),n},iT=function(t,e,n){for(var o=-1,r=t.length;++o<r;){var i=t[o],a=e(i);if(a!=null&&(s===void 0?a==a&&!eg(a):n(a,s)))var s=a,l=i}return l},Uve=function(t,e){return t>e},Vve=function(t){return t&&t.length?iT(t,dg,Uve):void 0},C2=function(t,e,n){(n!==void 0&&!cy(t[e],n)||n===void 0&&!(e in t))&&aE(t,e,n)},Wve=Function.prototype,Gve=Object.prototype,l5=Wve.toString,zve=Gve.hasOwnProperty,Hve=l5.call(Object),Xve=function(t){if(!nd(t)||Bh(t)!="[object Object]")return!1;var e=dE(t);if(e===null)return!0;var n=zve.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&l5.call(n)==Hve},UD=function(t,e){if((e!=="constructor"||typeof t[e]!="function")&&e!="__proto__")return t[e]},Yve=function(t){return cb(t,cg(t))},qve=function(t,e,n,o,r,i,a){var s=UD(t,n),l=UD(e,n),f=a.get(l);if(f)C2(t,n,f);else{var h=void 0,v=h===void 0;if(v){var _=Ma(l),E=!_&&Jv(l),O=!_&&!E&&db(l);h=l,_||E||O?Ma(s)?h=s:J4(s)?h=y4(s):E?(v=!1,h=m4(l,!0)):O?(v=!1,h=x4(l,!0)):h=[]:Xve(l)||Ym(l)?(h=s,Ym(s)?h=Yve(s):Xs(s)&&!ub(s)||(h=S4(l))):v=!1}v&&(a.set(l,h),r(h,l,o,i,a),a.delete(l)),C2(t,n,h)}},Kve=function t(e,n,o,r,i){e!==n&&JM(n,(function(a,s){if(i||(i=new Tm),Xs(a))qve(e,n,s,o,t,r,i);else{var l=void 0;l===void 0&&(l=a),C2(e,s,l)}}),cg)},Zve=(function(t){return vE((function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(r--,i):void 0,a&&G_(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++o<r;){var s=n[o];s&&t(e,s,o,i)}return e}))})((function(t,e,n){Kve(t,e,n)})),s5=function(t,e){return t<e},Jve=function(t){return t&&t.length?iT(t,dg,s5):void 0},Qve=function(t,e){return t&&t.length?iT(t,yp(e),s5):void 0},ege=function(){return od.Date.now()},tge=function(t,e,n,o){if(!Xs(t))return t;for(var r=-1,i=(e=pE(e,t)).length,a=i-1,s=t;s!=null&&++r<i;){var l=fb(e[r]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(r!=a){var h=s[l];(f=void 0)==void 0&&(f=Xs(h)?h:sE(e[r+1])?[]:{})}lE(s,l,f),s=s[l]}return t},nge=function(t,e,n){for(var o=-1,r=e.length,i={};++o<r;){var a=e[o],s=hE(t,a);n(s,a)&&tge(i,pE(a,t),s)}return i},rge=function(t,e){return nge(t,e,(function(n,o){return F4(t,o)}))},oge=(function(t){return K4(q4(t,void 0,a5),t+"")})((function(t,e){return t==null?{}:rge(t,e)})),ige=Math.ceil,age=Math.max,lge=function(t,e,n,o){for(var r=-1,i=age(ige((e-t)/(n||1)),0),a=Array(i);i--;)a[++r]=t,t+=n;return a},sge=(function(t){return function(e,n,o){return o&&typeof o!="number"&&G_(e,n,o)&&(n=o=void 0),e=lw(e),n===void 0?(n=e,e=0):n=lw(n),o=o===void 0?e<n?1:-1:lw(o),lge(e,n,o)}})(),uge=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},cge=function(t,e){if(t!==e){var n=t!==void 0,o=t===null,r=t==t,i=eg(t),a=e!==void 0,s=e===null,l=e==e,f=eg(e);if(!s&&!f&&!i&&t>e||i&&a&&l&&!s&&!f||o&&a&&l||!n&&l||!r)return 1;if(!o&&!i&&!f&&t<e||f&&n&&r&&!o&&!i||s&&n&&r||!a&&r||!l)return-1}return 0},dge=function(t,e,n){for(var o=-1,r=t.criteria,i=e.criteria,a=r.length,s=n.length;++o<a;){var l=cge(r[o],i[o]);if(l)return o>=s?l:l*(n[o]=="desc"?-1:1)}return t.index-e.index},fge=function(t,e,n){e=e.length?Nm(e,(function(i){return Ma(i)?function(a){return hE(a,i.length===1?i[0]:i)}:i})):[dg];var o=-1;e=Nm(e,uE(yp));var r=W4(t,(function(i,a,s){return{criteria:Nm(e,(function(l){return l(i)})),index:++o,value:i}}));return uge(r,(function(i,a){return dge(i,a,n)}))},pge=vE((function(t,e){if(t==null)return[];var n=e.length;return n>1&&G_(t,e[0],e[1])?e=[]:n>2&&G_(e[0],e[1],e[2])&&(e=[e[0]]),fge(t,rT(e),[])})),hge=0,vge=function(t){var e=++hge;return L4(t)+e},gge=function(t,e,n){for(var o=-1,r=t.length,i=e.length,a={};++o<r;){var s=o<i?e[o]:void 0;n(a,t[o],s)}return a},O1,mge=function(t,e){return gge(t||[],e||[],lE)};try{O1={cloneDeep:Sve,constant:ZM,defaults:Mve,each:C4,filter:$4,find:Ive,flatten:a5,forEach:T4,forIn:Fve,has:U4,isUndefined:V4,last:Bve,map:G4,mapValues:$ve,max:Vve,merge:Zve,min:Jve,minBy:Qve,now:ege,pick:oge,range:sge,reduce:z4,sortBy:pge,uniqueId:vge,values:Q4,zipObject:mge}}catch{}O1||(O1=window._);var yge=O1;nf.Graph;yge.constant(1);nf.Graph;nf.Graph;nf.alg.preorder;nf.alg.postorder;nf.Graph;nf.Graph;nf.Graph;nf.Graph;nf.Graph;var GS,VD;function _ge(){if(VD)return GS;VD=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return GS=e,GS}var zS,WD;function bge(){if(WD)return zS;WD=1;var t=B2(),e=_ge(),n=$2(),o="[object Arguments]",r="[object Array]",i="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",f="[object Map]",h="[object Number]",v="[object Object]",_="[object RegExp]",E="[object Set]",O="[object String]",w="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",T="[object Float32Array]",B="[object Float64Array]",R="[object Int8Array]",P="[object Int16Array]",$="[object Int32Array]",I="[object Uint8Array]",F="[object Uint8ClampedArray]",U="[object Uint16Array]",z="[object Uint32Array]",X={};X[T]=X[B]=X[R]=X[P]=X[$]=X[I]=X[F]=X[U]=X[z]=!0,X[o]=X[r]=X[S]=X[i]=X[M]=X[a]=X[s]=X[l]=X[f]=X[h]=X[v]=X[_]=X[E]=X[O]=X[w]=!1;function Y(W){return n(W)&&e(W.length)&&!!X[t(W)]}return zS=Y,zS}var HS,GD;function wge(){if(GD)return HS;GD=1;function t(e){return function(n){return e(n)}}return HS=t,HS}var Jy={exports:{}};Jy.exports;var zD;function Ege(){return zD||(zD=1,(function(t,e){var n=g9(),o=e&&!e.nodeType&&e,r=o&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===o,a=i&&n.process,s=(function(){try{var l=r&&r.require&&r.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}})();t.exports=s})(Jy,Jy.exports)),Jy.exports}var XS,HD;function xge(){if(HD)return XS;HD=1;var t=bge(),e=wge(),n=Ege(),o=n&&n.isTypedArray,r=o?e(o):t;return XS=r,XS}xge();var YS,XD;function Oge(){if(XD)return YS;XD=1;var t=B2(),e=$2(),n="[object Number]";function o(r){return typeof r=="number"||e(r)&&t(r)==n}return YS=o,YS}Oge();var qS={exports:{}},KS={exports:{}},YD;function u5(){return YD||(YD=1,(function(t){function e(n,o){this.v=n,this.k=o}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(KS)),KS.exports}var ZS={exports:{}},JS={exports:{}},qD;function c5(){return qD||(qD=1,(function(t){function e(n,o,r,i){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}t.exports=e=function(l,f,h,v){function _(E,O){e(l,E,function(w){return this._invoke(E,O,w)})}f?a?a(l,f,{value:h,enumerable:!v,configurable:!v,writable:!v}):l[f]=h:(_("next",0),_("throw",1),_("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,o,r,i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(JS)),JS.exports}var KD;function d5(){return KD||(KD=1,(function(t){var e=c5();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var o,r,i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function l(S,M,T,B){var R=M&&M.prototype instanceof h?M:h,P=Object.create(R.prototype);return e(P,"_invoke",(function($,I,F){var U,z,X,Y=0,W=F||[],Q=!1,J={p:0,n:0,v:o,a:ie,f:ie.bind(o,4),d:function(Ae,Pe){return U=Ae,z=0,X=o,J.n=Pe,f}};function ie(Se,Ae){for(z=Se,X=Ae,r=0;!Q&&Y&&!Pe&&r<W.length;r++){var Pe,De=W[r],He=J.p,Ye=De[2];Se>3?(Pe=Ye===Ae)&&(X=De[(z=De[4])?5:(z=3,3)],De[4]=De[5]=o):De[0]<=He&&((Pe=Se<2&&He<De[1])?(z=0,J.v=Ae,J.n=De[1]):He<Ye&&(Pe=Se<3||De[0]>Ae||Ae>Ye)&&(De[4]=Se,De[5]=Ae,J.n=Ye,z=0))}if(Pe||Se>1)return f;throw Q=!0,Ae}return function(Se,Ae,Pe){if(Y>1)throw TypeError("Generator is already running");for(Q&&Ae===1&&ie(Ae,Pe),z=Ae,X=Pe;(r=z<2?o:X)||!Q;){U||(z?z<3?(z>1&&(J.n=-1),ie(z,X)):J.n=X:J.v=X);try{if(Y=2,U){if(z||(Se="next"),r=U[Se]){if(!(r=r.call(U,X)))throw TypeError("iterator result is not an object");if(!r.done)return r;X=r.value,z<2&&(z=0)}else z===1&&(r=U.return)&&r.call(U),z<2&&(X=TypeError("The iterator does not provide a '"+Se+"' method"),z=1);U=o}else if((r=(Q=J.n<0)?X:$.call(I,J))!==f)break}catch(De){U=o,z=1,X=De}finally{Y=1}}return{value:r,done:Q}}})(S,T,B),!0),P}var f={};function h(){}function v(){}function _(){}r=Object.getPrototypeOf;var E=[][a]?r(r([][a]())):(e(r={},a,function(){return this}),r),O=_.prototype=h.prototype=Object.create(E);function w(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,_):(S.__proto__=_,e(S,s,"GeneratorFunction")),S.prototype=Object.create(O),S}return v.prototype=_,e(O,"constructor",_),e(_,"constructor",v),v.displayName="GeneratorFunction",e(_,s,"GeneratorFunction"),e(O),e(O,s,"Generator"),e(O,a,function(){return this}),e(O,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:l,m:w}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(ZS)),ZS.exports}var QS={exports:{}},eA={exports:{}},tA={exports:{}},ZD;function f5(){return ZD||(ZD=1,(function(t){var e=u5(),n=c5();function o(r,i){function a(l,f,h,v){try{var _=r[l](f),E=_.value;return E instanceof e?i.resolve(E.v).then(function(O){a("next",O,h,v)},function(O){a("throw",O,h,v)}):i.resolve(E).then(function(O){_.value=O,h(_)},function(O){return a("throw",O,h,v)})}catch(O){v(O)}}var s;this.next||(n(o.prototype),n(o.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(l,f,h){function v(){return new i(function(_,E){a(l,h,_,E)})}return s=s?s.then(v,v):v()},!0)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(tA)),tA.exports}var JD;function p5(){return JD||(JD=1,(function(t){var e=d5(),n=f5();function o(r,i,a,s,l){return new n(e().w(r,i,a,s),l||Promise)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(eA)),eA.exports}var QD;function Sge(){return QD||(QD=1,(function(t){var e=p5();function n(o,r,i,a,s){var l=e(o,r,i,a,s);return l.next().then(function(f){return f.done?f.value:l.next()})}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(QS)),QS.exports}var nA={exports:{}},ej;function Age(){return ej||(ej=1,(function(t){function e(n){var o=Object(n),r=[];for(var i in o)r.unshift(i);return function a(){for(;r.length;)if((i=r.pop())in o)return a.value=i,a.done=!1,a;return a.done=!0,a}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(nA)),nA.exports}var rA={exports:{}},oA={exports:{}},tj;function Mge(){return tj||(tj=1,(function(t){function e(n){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(oA)),oA.exports}var nj;function Tge(){return nj||(nj=1,(function(t){var e=Mge().default;function n(o){if(o!=null){var r=o[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],i=0;if(r)return r.call(o);if(typeof o.next=="function")return o;if(!isNaN(o.length))return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}}}throw new TypeError(e(o)+" is not iterable")}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(rA)),rA.exports}var rj;function Cge(){return rj||(rj=1,(function(t){var e=u5(),n=d5(),o=Sge(),r=p5(),i=f5(),a=Age(),s=Tge();function l(){var f=n(),h=f.m(l),v=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function _(w){var S=typeof w=="function"&&w.constructor;return!!S&&(S===v||(S.displayName||S.name)==="GeneratorFunction")}var E={throw:1,return:2,break:3,continue:3};function O(w){var S,M;return function(T){S||(S={stop:function(){return M(T.a,2)},catch:function(){return T.v},abrupt:function(R,P){return M(T.a,E[R],P)},delegateYield:function(R,P,$){return S.resultName=P,M(T.d,s(R),$)},finish:function(R){return M(T.f,R)}},M=function(R,P,$){T.p=S.prev,T.n=S.next;try{return R(P,$)}finally{S.next=T.n}}),S.resultName&&(S[S.resultName]=T.v,S.resultName=void 0),S.sent=T.v,S.next=T.n;try{return w.call(this,S)}finally{T.p=S.prev,T.n=S.next}}}return(t.exports=l=function(){return{wrap:function(M,T,B,R){return f.w(O(M),T,B,R&&R.reverse())},isGeneratorFunction:_,mark:f.m,awrap:function(M,T){return new e(M,T)},AsyncIterator:i,async:function(M,T,B,R,P){return(_(T)?r:o)(O(M),T,B,R,P)},keys:a,values:s}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=l,t.exports.__esModule=!0,t.exports.default=t.exports})(qS)),qS.exports}var iA,oj;function Nge(){if(oj)return iA;oj=1;var t=Cge()();iA=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}return iA}Nge();var jn;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.COPY_SRC=1]="COPY_SRC",t[t.COPY_DST=2]="COPY_DST",t[t.SAMPLED=4]="SAMPLED",t[t.STORAGE=8]="STORAGE",t[t.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(jn||(jn={}));var ij;(function(t){t.Void="Void",t.Boolean="Boolean",t.Float="Float",t.Uint32="Uint32",t.Int32="Int32",t.Vector="Vector",t.Vector2Float="vec2<f32>",t.Vector3Float="vec3<f32>",t.Vector4Float="vec4<f32>",t.Vector2Boolean="vec2<bool>",t.Vector3Boolean="vec3<bool>",t.Vector4Boolean="vec4<bool>",t.Vector2Uint="vec2<u32>",t.Vector3Uint="vec3<u32>",t.Vector4Uint="vec4<u32>",t.Vector2Int="vec2<i32>",t.Vector3Int="vec3<i32>",t.Vector4Int="vec4<i32>",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3<f32>",t.Matrix4x4Float="mat4x4<i32>",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4<f32>[]"})(ij||(ij={}));var aj;(function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"})(aj||(aj={}));var lj;(function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"})(lj||(lj={}));var sj;(function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"})(sj||(sj={}));var sw={exports:{}},kge=sw.exports,uj;function Pge(){return uj||(uj=1,(function(t,e){(function(n,o){t.exports=o()})(kge,(function(){var n=function(K){return K instanceof Uint8Array||K instanceof Uint16Array||K instanceof Uint32Array||K instanceof Int8Array||K instanceof Int16Array||K instanceof Int32Array||K instanceof Float32Array||K instanceof Float64Array||K instanceof Uint8ClampedArray},o=function(K,ge){for(var Ie=Object.keys(ge),wt=0;wt<Ie.length;++wt)K[Ie[wt]]=ge[Ie[wt]];return K},r=`
|
||
`;function i(K){return typeof atob<"u"?atob(K):"base64:"+K}function a(K){var ge=new Error("(regl) "+K);throw console.error(ge),ge}function s(K,ge){K||a(ge)}function l(K){return K?": "+K:""}function f(K,ge,Ie){K in ge||a("unknown parameter ("+K+")"+l(Ie)+". possible values: "+Object.keys(ge).join())}function h(K,ge){n(K)||a("invalid parameter type"+l(ge)+". must be a typed array")}function v(K,ge){switch(ge){case"number":return typeof K=="number";case"object":return typeof K=="object";case"string":return typeof K=="string";case"boolean":return typeof K=="boolean";case"function":return typeof K=="function";case"undefined":return typeof K>"u";case"symbol":return typeof K=="symbol"}}function _(K,ge,Ie){v(K,ge)||a("invalid parameter type"+l(Ie)+". expected "+ge+", got "+typeof K)}function E(K,ge){K>=0&&(K|0)===K||a("invalid parameter type, ("+K+")"+l(ge)+". must be a nonnegative integer")}function O(K,ge,Ie){ge.indexOf(K)<0&&a("invalid value"+l(Ie)+". must be one of: "+ge)}var w=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function S(K){Object.keys(K).forEach(function(ge){w.indexOf(ge)<0&&a('invalid regl constructor argument "'+ge+'". must be one of '+w)})}function M(K,ge){for(K=K+"";K.length<ge;)K=" "+K;return K}function T(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function B(K,ge){this.number=K,this.line=ge,this.errors=[]}function R(K,ge,Ie){this.file=K,this.line=ge,this.message=Ie}function P(){var K=new Error,ge=(K.stack||K).toString(),Ie=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(ge);if(Ie)return Ie[1];var wt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(ge);return wt?wt[1]:"unknown"}function $(){var K=new Error,ge=(K.stack||K).toString(),Ie=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(ge);if(Ie)return Ie[1];var wt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(ge);return wt?wt[1]:"unknown"}function I(K,ge){var Ie=K.split(`
|
||
`),wt=1,Dt=0,yt={unknown:new T,0:new T};yt.unknown.name=yt[0].name=ge||P(),yt.unknown.lines.push(new B(0,""));for(var Nt=0;Nt<Ie.length;++Nt){var tn=Ie[Nt],sn=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(tn);if(sn)switch(sn[1]){case"line":var nn=/(\d+)(\s+\d+)?/.exec(sn[2]);nn&&(wt=nn[1]|0,nn[2]&&(Dt=nn[2]|0,Dt in yt||(yt[Dt]=new T)));break;case"define":var Mt=/SHADER_NAME(_B64)?\s+(.*)$/.exec(sn[2]);Mt&&(yt[Dt].name=Mt[1]?i(Mt[2]):Mt[2]);break}yt[Dt].lines.push(new B(wt++,tn))}return Object.keys(yt).forEach(function(wn){var hn=yt[wn];hn.lines.forEach(function(rn){hn.index[rn.number]=rn})}),yt}function F(K){var ge=[];return K.split(`
|
||
`).forEach(function(Ie){if(!(Ie.length<5)){var wt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Ie);wt?ge.push(new R(wt[1]|0,wt[2]|0,wt[3].trim())):Ie.length>0&&ge.push(new R("unknown",0,Ie))}}),ge}function U(K,ge){ge.forEach(function(Ie){var wt=K[Ie.file];if(wt){var Dt=wt.index[Ie.line];if(Dt){Dt.errors.push(Ie),wt.hasErrors=!0;return}}K.unknown.hasErrors=!0,K.unknown.lines[0].errors.push(Ie)})}function z(K,ge,Ie,wt,Dt){if(!K.getShaderParameter(ge,K.COMPILE_STATUS)){var yt=K.getShaderInfoLog(ge),Nt=wt===K.FRAGMENT_SHADER?"fragment":"vertex";Se(Ie,"string",Nt+" shader source must be a string",Dt);var tn=I(Ie,Dt),sn=F(yt);U(tn,sn),Object.keys(tn).forEach(function(nn){var Mt=tn[nn];if(!Mt.hasErrors)return;var wn=[""],hn=[""];function rn(Wt,st){wn.push(Wt),hn.push(st||"")}rn("file number "+nn+": "+Mt.name+`
|
||
`,"color:red;text-decoration:underline;font-weight:bold"),Mt.lines.forEach(function(Wt){if(Wt.errors.length>0){rn(M(Wt.number,4)+"| ","background-color:yellow; font-weight:bold"),rn(Wt.line+r,"color:red; background-color:yellow; font-weight:bold");var st=0;Wt.errors.forEach(function(St){var ln=St.message,An=/^\s*'(.*)'\s*:\s*(.*)$/.exec(ln);if(An){var Xt=An[1];switch(ln=An[2],Xt){case"assign":Xt="=";break}st=Math.max(Wt.line.indexOf(Xt,st),0)}else st=0;rn(M("| ",6)),rn(M("^^^",st+3)+r,"font-weight:bold"),rn(M("| ",6)),rn(ln+r,"font-weight:bold")}),rn(M("| ",6)+r)}else rn(M(Wt.number,4)+"| "),rn(Wt.line+r,"color:red")}),typeof document<"u"&&!window.chrome?(hn[0]=wn.join("%c"),console.log.apply(console,hn)):console.log(wn.join(""))}),s.raise("Error compiling "+Nt+" shader, "+tn[0].name)}}function X(K,ge,Ie,wt,Dt){if(!K.getProgramParameter(ge,K.LINK_STATUS)){var yt=K.getProgramInfoLog(ge),Nt=I(Ie,Dt),tn=I(wt,Dt),sn='Error linking program with vertex shader, "'+tn[0].name+'", and fragment shader "'+Nt[0].name+'"';typeof document<"u"?console.log("%c"+sn+r+"%c"+yt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(sn+r+yt),s.raise(sn)}}function Y(K){K._commandRef=P()}function W(K,ge,Ie,wt){Y(K);function Dt(sn){return sn?wt.id(sn):0}K._fragId=Dt(K.static.frag),K._vertId=Dt(K.static.vert);function yt(sn,nn){Object.keys(nn).forEach(function(Mt){sn[wt.id(Mt)]=!0})}var Nt=K._uniformSet={};yt(Nt,ge.static),yt(Nt,ge.dynamic);var tn=K._attributeSet={};yt(tn,Ie.static),yt(tn,Ie.dynamic),K._hasCount="count"in K.static||"count"in K.dynamic||"elements"in K.static||"elements"in K.dynamic}function Q(K,ge){var Ie=$();a(K+" in command "+(ge||P())+(Ie==="unknown"?"":" called from "+Ie))}function J(K,ge,Ie){K||Q(ge,Ie||P())}function ie(K,ge,Ie,wt){K in ge||Q("unknown parameter ("+K+")"+l(Ie)+". possible values: "+Object.keys(ge).join(),wt||P())}function Se(K,ge,Ie,wt){v(K,ge)||Q("invalid parameter type"+l(Ie)+". expected "+ge+", got "+typeof K,wt||P())}function Ae(K){K()}function Pe(K,ge,Ie){K.texture?O(K.texture._texture.internalformat,ge,"unsupported texture format for attachment"):O(K.renderbuffer._renderbuffer.format,Ie,"unsupported renderbuffer format for attachment")}var De=33071,He=9728,Ye=9984,Be=9985,Je=9986,mt=9987,le=5120,Ze=5121,pe=5122,se=5123,we=5124,$e=5125,rt=5126,pt=32819,Lt=32820,Jt=33635,en=34042,zt=36193,it={};it[le]=it[Ze]=1,it[pe]=it[se]=it[zt]=it[Jt]=it[pt]=it[Lt]=2,it[we]=it[$e]=it[rt]=it[en]=4;function ae(K,ge){return K===Lt||K===pt||K===Jt?2:K===en?4:it[K]*ge}function re(K){return!(K&K-1)&&!!K}function je(K,ge,Ie){var wt,Dt=ge.width,yt=ge.height,Nt=ge.channels;s(Dt>0&&Dt<=Ie.maxTextureSize&&yt>0&&yt<=Ie.maxTextureSize,"invalid texture shape"),(K.wrapS!==De||K.wrapT!==De)&&s(re(Dt)&&re(yt),"incompatible wrap mode for texture, both width and height must be power of 2"),ge.mipmask===1?Dt!==1&&yt!==1&&s(K.minFilter!==Ye&&K.minFilter!==Je&&K.minFilter!==Be&&K.minFilter!==mt,"min filter requires mipmap"):(s(re(Dt)&&re(yt),"texture must be a square power of 2 to support mipmapping"),s(ge.mipmask===(Dt<<1)-1,"missing or incomplete mipmap data")),ge.type===rt&&(Ie.extensions.indexOf("oes_texture_float_linear")<0&&s(K.minFilter===He&&K.magFilter===He,"filter not supported, must enable oes_texture_float_linear"),s(!K.genMipmaps,"mipmap generation not supported with float textures"));var tn=ge.images;for(wt=0;wt<16;++wt)if(tn[wt]){var sn=Dt>>wt,nn=yt>>wt;s(ge.mipmask&1<<wt,"missing mipmap data");var Mt=tn[wt];if(s(Mt.width===sn&&Mt.height===nn,"invalid shape for mip images"),s(Mt.format===ge.format&&Mt.internalformat===ge.internalformat&&Mt.type===ge.type,"incompatible type for mip image"),!Mt.compressed)if(Mt.data){var wn=Math.ceil(ae(Mt.type,Nt)*sn/Mt.unpackAlignment)*Mt.unpackAlignment;s(Mt.data.byteLength===wn*nn,"invalid data for image, buffer size is inconsistent with image format")}else Mt.element||Mt.copy}else K.genMipmaps||s((ge.mipmask&1<<wt)===0,"extra mipmap data");ge.compressed&&s(!K.genMipmaps,"mipmap generation for compressed images not supported")}function vt(K,ge,Ie,wt){var Dt=K.width,yt=K.height,Nt=K.channels;s(Dt>0&&Dt<=wt.maxTextureSize&&yt>0&&yt<=wt.maxTextureSize,"invalid texture shape"),s(Dt===yt,"cube map must be square"),s(ge.wrapS===De&&ge.wrapT===De,"wrap mode not supported by cube map");for(var tn=0;tn<Ie.length;++tn){var sn=Ie[tn];s(sn.width===Dt&&sn.height===yt,"inconsistent cube map face shape"),ge.genMipmaps&&(s(!sn.compressed,"can not generate mipmap for compressed textures"),s(sn.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var nn=sn.images,Mt=0;Mt<16;++Mt){var wn=nn[Mt];if(wn){var hn=Dt>>Mt,rn=yt>>Mt;s(sn.mipmask&1<<Mt,"missing mipmap data"),s(wn.width===hn&&wn.height===rn,"invalid shape for mip images"),s(wn.format===K.format&&wn.internalformat===K.internalformat&&wn.type===K.type,"incompatible type for mip image"),wn.compressed||(wn.data?s(wn.data.byteLength===hn*rn*Math.max(ae(wn.type,Nt),wn.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):wn.element||wn.copy)}}}}var q=o(s,{optional:Ae,raise:a,commandRaise:Q,command:J,parameter:f,commandParameter:ie,constructor:S,type:_,commandType:Se,isTypedArray:h,nni:E,oneOf:O,shaderError:z,linkError:X,callSite:$,saveCommandRef:Y,saveDrawInfo:W,framebufferFormat:Pe,guessCommand:P,texture2D:je,textureCube:vt}),kt=0,Rt=0,Gt=5,Pn=6;function qt(K,ge){this.id=kt++,this.type=K,this.data=ge}function On(K){return K.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function ke(K){if(K.length===0)return[];var ge=K.charAt(0),Ie=K.charAt(K.length-1);if(K.length>1&&ge===Ie&&(ge==='"'||ge==="'"))return['"'+On(K.substr(1,K.length-2))+'"'];var wt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(K);if(wt)return ke(K.substr(0,wt.index)).concat(ke(wt[1])).concat(ke(K.substr(wt.index+wt[0].length)));var Dt=K.split(".");if(Dt.length===1)return['"'+On(K)+'"'];for(var yt=[],Nt=0;Nt<Dt.length;++Nt)yt=yt.concat(ke(Dt[Nt]));return yt}function Ke(K){return"["+ke(K).join("][")+"]"}function Le(K,ge){return new qt(K,Ke(ge+""))}function dt(K){return typeof K=="function"&&!K._reglType||K instanceof qt}function At(K,ge){if(typeof K=="function")return new qt(Rt,K);if(typeof K=="number"||typeof K=="boolean")return new qt(Gt,K);if(Array.isArray(K))return new qt(Pn,K.map((Ie,wt)=>At(Ie,ge+"["+wt+"]")));if(K instanceof qt)return K;q(!1,"invalid option type in uniform "+ge)}var Tt={DynamicVariable:qt,define:Le,isDynamic:dt,unbox:At,accessor:Ke},En={next:typeof requestAnimationFrame=="function"?function(K){return requestAnimationFrame(K)}:function(K){return setTimeout(K,16)},cancel:typeof cancelAnimationFrame=="function"?function(K){return cancelAnimationFrame(K)}:clearTimeout},Zn=typeof performance<"u"&&performance.now?function(){return performance.now()}:function(){return+new Date};function ao(){var K={"":0},ge=[""];return{id:function(Ie){var wt=K[Ie];return wt||(wt=K[Ie]=ge.length,ge.push(Ie),wt)},str:function(Ie){return ge[Ie]}}}function Lo(K,ge,Ie){var wt=document.createElement("canvas");o(wt.style,{border:0,margin:0,padding:0,top:0,left:0}),K.appendChild(wt),K===document.body&&(wt.style.position="absolute",o(K.style,{margin:0,padding:0}));function Dt(){var tn=window.innerWidth,sn=window.innerHeight;if(K!==document.body){var nn=K.getBoundingClientRect();tn=nn.right-nn.left,sn=nn.bottom-nn.top}wt.width=Ie*tn,wt.height=Ie*sn,o(wt.style,{width:tn+"px",height:sn+"px"})}var yt;K!==document.body&&typeof ResizeObserver=="function"?(yt=new ResizeObserver(function(){setTimeout(Dt)}),yt.observe(K)):window.addEventListener("resize",Dt,!1);function Nt(){yt?yt.disconnect():window.removeEventListener("resize",Dt),K.removeChild(wt)}return Dt(),{canvas:wt,onDestroy:Nt}}function _o(K,ge){function Ie(wt){try{return K.getContext(wt,ge)}catch{return null}}return Ie("webgl")||Ie("experimental-webgl")||Ie("webgl-experimental")}function ho(K){return typeof K.nodeName=="string"&&typeof K.appendChild=="function"&&typeof K.getBoundingClientRect=="function"}function Nn(K){return typeof K.drawArrays=="function"||typeof K.drawElements=="function"}function qn(K){return typeof K=="string"?K.split():(q(Array.isArray(K),"invalid extension array"),K)}function rr(K){return typeof K=="string"?(q(typeof document<"u","not supported outside of DOM"),document.querySelector(K)):K}function ut(K){var ge=K||{},Ie,wt,Dt,yt,Nt={},tn=[],sn=[],nn=typeof window>"u"?1:window.devicePixelRatio,Mt=!1,wn=function(Wt){Wt&&q.raise(Wt)},hn=function(){};if(typeof ge=="string"?(q(typeof document<"u","selector queries only supported in DOM enviroments"),Ie=document.querySelector(ge),q(Ie,"invalid query string for element")):typeof ge=="object"?ho(ge)?Ie=ge:Nn(ge)?(yt=ge,Dt=yt.canvas):(q.constructor(ge),"gl"in ge?yt=ge.gl:"canvas"in ge?Dt=rr(ge.canvas):"container"in ge&&(wt=rr(ge.container)),"attributes"in ge&&(Nt=ge.attributes,q.type(Nt,"object","invalid context attributes")),"extensions"in ge&&(tn=qn(ge.extensions)),"optionalExtensions"in ge&&(sn=qn(ge.optionalExtensions)),"onDone"in ge&&(q.type(ge.onDone,"function","invalid or missing onDone callback"),wn=ge.onDone),"profile"in ge&&(Mt=!!ge.profile),"pixelRatio"in ge&&(nn=+ge.pixelRatio,q(nn>0,"invalid pixel ratio"))):q.raise("invalid arguments to regl"),Ie&&(Ie.nodeName.toLowerCase()==="canvas"?Dt=Ie:wt=Ie),!yt){if(!Dt){q(typeof document<"u","must manually specify webgl context outside of DOM environments");var rn=Lo(wt||document.body,wn,nn);if(!rn)return null;Dt=rn.canvas,hn=rn.onDestroy}Nt.premultipliedAlpha===void 0&&(Nt.premultipliedAlpha=!0),yt=_o(Dt,Nt)}return yt?{gl:yt,canvas:Dt,container:wt,extensions:tn,optionalExtensions:sn,pixelRatio:nn,profile:Mt,onDone:wn,onDestroy:hn}:(hn(),wn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function gn(K,ge){var Ie={};function wt(Nt){q.type(Nt,"string","extension name must be string");var tn=Nt.toLowerCase(),sn;try{sn=Ie[tn]=K.getExtension(tn)}catch{}return!!sn}for(var Dt=0;Dt<ge.extensions.length;++Dt){var yt=ge.extensions[Dt];if(!wt(yt))return ge.onDestroy(),ge.onDone('"'+yt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return ge.optionalExtensions.forEach(wt),{extensions:Ie,restore:function(){Object.keys(Ie).forEach(function(Nt){if(Ie[Nt]&&!wt(Nt))throw new Error("(regl): error restoring extension "+Nt)})}}}function Fn(K,ge){for(var Ie=Array(K),wt=0;wt<K;++wt)Ie[wt]=ge(wt);return Ie}var sr=5120,wo=5121,oo=5122,ta=5123,Ca=5124,Yi=5125,fa=5126;function Ka(K){for(var ge=16;ge<=1<<28;ge*=16)if(K<=ge)return ge;return 0}function Sn(K){var ge,Ie;return ge=(K>65535)<<4,K>>>=ge,Ie=(K>255)<<3,K>>>=Ie,ge|=Ie,Ie=(K>15)<<2,K>>>=Ie,ge|=Ie,Ie=(K>3)<<1,K>>>=Ie,ge|=Ie,ge|K>>1}function Ts(){var K=Fn(8,function(){return[]});function ge(yt){var Nt=Ka(yt),tn=K[Sn(Nt)>>2];return tn.length>0?tn.pop():new ArrayBuffer(Nt)}function Ie(yt){K[Sn(yt.byteLength)>>2].push(yt)}function wt(yt,Nt){var tn=null;switch(yt){case sr:tn=new Int8Array(ge(Nt),0,Nt);break;case wo:tn=new Uint8Array(ge(Nt),0,Nt);break;case oo:tn=new Int16Array(ge(2*Nt),0,Nt);break;case ta:tn=new Uint16Array(ge(2*Nt),0,Nt);break;case Ca:tn=new Int32Array(ge(4*Nt),0,Nt);break;case Yi:tn=new Uint32Array(ge(4*Nt),0,Nt);break;case fa:tn=new Float32Array(ge(4*Nt),0,Nt);break;default:return null}return tn.length!==Nt?tn.subarray(0,Nt):tn}function Dt(yt){Ie(yt.buffer)}return{alloc:ge,free:Ie,allocType:wt,freeType:Dt}}var Oo=Ts();Oo.zero=Ts();var es=3408,Ui=3410,yr=3411,ml=3412,pa=3413,qi=3414,Na=3415,al=33901,yl=33902,Cs=3379,_l=3386,ts=34921,ve=36347,gt=36348,dn=35661,Kn=35660,br=34930,so=36349,si=34076,ye=34024,ht=7936,pn=7937,Rn=7938,Cn=35724,nr=34047,Mn=36063,or=34852,lr=3553,qr=34067,na=34069,vi=33984,bl=6408,Vi=5126,Ns=5121,Fl=36160,Ro=36053,La=36064,id=16384,_u=function(K,ge){var Ie=1;ge.ext_texture_filter_anisotropic&&(Ie=K.getParameter(nr));var wt=1,Dt=1;ge.webgl_draw_buffers&&(wt=K.getParameter(or),Dt=K.getParameter(Mn));var yt=!!ge.oes_texture_float;if(yt){var Nt=K.createTexture();K.bindTexture(lr,Nt),K.texImage2D(lr,0,bl,1,1,0,bl,Vi,null);var tn=K.createFramebuffer();if(K.bindFramebuffer(Fl,tn),K.framebufferTexture2D(Fl,La,lr,Nt,0),K.bindTexture(lr,null),K.checkFramebufferStatus(Fl)!==Ro)yt=!1;else{K.viewport(0,0,1,1),K.clearColor(1,0,0,1),K.clear(id);var sn=Oo.allocType(Vi,4);K.readPixels(0,0,1,1,bl,Vi,sn),K.getError()?yt=!1:(K.deleteFramebuffer(tn),K.deleteTexture(Nt),yt=sn[0]===1),Oo.freeType(sn)}}var nn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Mt=!0;if(!nn){var wn=K.createTexture(),hn=Oo.allocType(Ns,36);K.activeTexture(vi),K.bindTexture(qr,wn),K.texImage2D(na,0,bl,3,3,0,bl,Ns,hn),Oo.freeType(hn),K.bindTexture(qr,null),K.deleteTexture(wn),Mt=!K.getError()}return{colorBits:[K.getParameter(Ui),K.getParameter(yr),K.getParameter(ml),K.getParameter(pa)],depthBits:K.getParameter(qi),stencilBits:K.getParameter(Na),subpixelBits:K.getParameter(es),extensions:Object.keys(ge).filter(function(rn){return!!ge[rn]}),maxAnisotropic:Ie,maxDrawbuffers:wt,maxColorAttachments:Dt,pointSizeDims:K.getParameter(al),lineWidthDims:K.getParameter(yl),maxViewportDims:K.getParameter(_l),maxCombinedTextureUnits:K.getParameter(dn),maxCubeMapSize:K.getParameter(si),maxRenderbufferSize:K.getParameter(ye),maxTextureUnits:K.getParameter(br),maxTextureSize:K.getParameter(Cs),maxAttributes:K.getParameter(ts),maxVertexUniforms:K.getParameter(ve),maxVertexTextureUnits:K.getParameter(Kn),maxVaryingVectors:K.getParameter(gt),maxFragmentUniforms:K.getParameter(so),glsl:K.getParameter(Cn),renderer:K.getParameter(pn),vendor:K.getParameter(ht),version:K.getParameter(Rn),readFloat:yt,npotTextureCube:Mt}};function Ia(K){return!!K&&typeof K=="object"&&Array.isArray(K.shape)&&Array.isArray(K.stride)&&typeof K.offset=="number"&&K.shape.length===K.stride.length&&(Array.isArray(K.data)||n(K.data))}var ra=function(K){return Object.keys(K).map(function(ge){return K[ge]})},wl={shape:Ba,flatten:bp};function qo(K,ge,Ie){for(var wt=0;wt<ge;++wt)Ie[wt]=K[wt]}function Uh(K,ge,Ie,wt){for(var Dt=0,yt=0;yt<ge;++yt)for(var Nt=K[yt],tn=0;tn<Ie;++tn)wt[Dt++]=Nt[tn]}function Fa(K,ge,Ie,wt,Dt,yt){for(var Nt=yt,tn=0;tn<ge;++tn)for(var sn=K[tn],nn=0;nn<Ie;++nn)for(var Mt=sn[nn],wn=0;wn<wt;++wn)Dt[Nt++]=Mt[wn]}function _p(K,ge,Ie,wt,Dt){for(var yt=1,Nt=Ie+1;Nt<ge.length;++Nt)yt*=ge[Nt];var tn=ge[Ie];if(ge.length-Ie===4){var sn=ge[Ie+1],nn=ge[Ie+2],Mt=ge[Ie+3];for(Nt=0;Nt<tn;++Nt)Fa(K[Nt],sn,nn,Mt,wt,Dt),Dt+=yt}else for(Nt=0;Nt<tn;++Nt)_p(K[Nt],ge,Ie+1,wt,Dt),Dt+=yt}function bp(K,ge,Ie,wt){var Dt=1;if(ge.length)for(var yt=0;yt<ge.length;++yt)Dt*=ge[yt];else Dt=0;var Nt=wt||Oo.allocType(Ie,Dt);switch(ge.length){case 0:break;case 1:qo(K,ge[0],Nt);break;case 2:Uh(K,ge[0],ge[1],Nt);break;case 3:Fa(K,ge[0],ge[1],ge[2],Nt,0);break;default:_p(K,ge,0,Nt,0)}return Nt}function Ba(K){for(var ge=[],Ie=K;Ie.length;Ie=Ie[0])ge.push(Ie.length);return ge}var Za={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},rf=5120,Mo=5122,oa=5124,ad=5121,wp=5123,of=5125,ld=5126,ns=5126,$a={int8:rf,int16:Mo,int32:oa,uint8:ad,uint16:wp,uint32:of,float:ld,float32:ns},bu=35048,Ja=35040,El={dynamic:bu,stream:Ja,static:35044},vo=wl.flatten,Ua=wl.shape,Bl=35044,ha=35040,wu=5121,Ks=5126,$l=[];$l[5120]=1,$l[5122]=2,$l[5124]=4,$l[5121]=1,$l[5123]=2,$l[5125]=4,$l[5126]=4;function ui(K){return Za[Object.prototype.toString.call(K)]|0}function lc(K,ge){for(var Ie=0;Ie<ge.length;++Ie)K[Ie]=ge[Ie]}function rs(K,ge,Ie,wt,Dt,yt,Nt){for(var tn=0,sn=0;sn<Ie;++sn)for(var nn=0;nn<wt;++nn)K[tn++]=ge[Dt*sn+yt*nn+Nt]}function xl(K,ge,Ie,wt){var Dt=0,yt={};function Nt(st){this.id=Dt++,this.buffer=K.createBuffer(),this.type=st,this.usage=Bl,this.byteLength=0,this.dimension=1,this.dtype=wu,this.persistentData=null,Ie.profile&&(this.stats={size:0})}Nt.prototype.bind=function(){K.bindBuffer(this.type,this.buffer)},Nt.prototype.destroy=function(){hn(this)};var tn=[];function sn(st,St){var ln=tn.pop();return ln||(ln=new Nt(st)),ln.bind(),wn(ln,St,ha,0,1,!1),ln}function nn(st){tn.push(st)}function Mt(st,St,ln){st.byteLength=St.byteLength,K.bufferData(st.type,St,ln)}function wn(st,St,ln,An,Xt,kn){var Kt;if(st.usage=ln,Array.isArray(St)){if(st.dtype=An||Ks,St.length>0){var _n;if(Array.isArray(St[0])){Kt=Ua(St);for(var Yt=1,xn=1;xn<Kt.length;++xn)Yt*=Kt[xn];st.dimension=Yt,_n=vo(St,Kt,st.dtype),Mt(st,_n,ln),kn?st.persistentData=_n:Oo.freeType(_n)}else if(typeof St[0]=="number"){st.dimension=Xt;var ar=Oo.allocType(st.dtype,St.length);lc(ar,St),Mt(st,ar,ln),kn?st.persistentData=ar:Oo.freeType(ar)}else n(St[0])?(st.dimension=St[0].length,st.dtype=An||ui(St[0])||Ks,_n=vo(St,[St.length,St[0].length],st.dtype),Mt(st,_n,ln),kn?st.persistentData=_n:Oo.freeType(_n)):q.raise("invalid buffer data")}}else if(n(St))st.dtype=An||ui(St),st.dimension=Xt,Mt(st,St,ln),kn&&(st.persistentData=new Uint8Array(new Uint8Array(St.buffer)));else if(Ia(St)){Kt=St.shape;var xr=St.stride,on=St.offset,Zt=0,Ht=0,pr=0,Dr=0;Kt.length===1?(Zt=Kt[0],Ht=1,pr=xr[0],Dr=0):Kt.length===2?(Zt=Kt[0],Ht=Kt[1],pr=xr[0],Dr=xr[1]):q.raise("invalid shape"),st.dtype=An||ui(St.data)||Ks,st.dimension=Ht;var Un=Oo.allocType(st.dtype,Zt*Ht);rs(Un,St.data,Zt,Ht,pr,Dr,on),Mt(st,Un,ln),kn?st.persistentData=Un:Oo.freeType(Un)}else St instanceof ArrayBuffer?(st.dtype=wu,st.dimension=Xt,Mt(st,St,ln),kn&&(st.persistentData=new Uint8Array(new Uint8Array(St)))):q.raise("invalid buffer data")}function hn(st){ge.bufferCount--,wt(st);var St=st.buffer;q(St,"buffer must not be deleted already"),K.deleteBuffer(St),st.buffer=null,delete yt[st.id]}function rn(st,St,ln,An){ge.bufferCount++;var Xt=new Nt(St);yt[Xt.id]=Xt;function kn(Yt){var xn=Bl,ar=null,xr=0,on=0,Zt=1;return Array.isArray(Yt)||n(Yt)||Ia(Yt)||Yt instanceof ArrayBuffer?ar=Yt:typeof Yt=="number"?xr=Yt|0:Yt&&(q.type(Yt,"object","buffer arguments must be an object, a number or an array"),"data"in Yt&&(q(ar===null||Array.isArray(ar)||n(ar)||Ia(ar),"invalid data for buffer"),ar=Yt.data),"usage"in Yt&&(q.parameter(Yt.usage,El,"invalid buffer usage"),xn=El[Yt.usage]),"type"in Yt&&(q.parameter(Yt.type,$a,"invalid buffer type"),on=$a[Yt.type]),"dimension"in Yt&&(q.type(Yt.dimension,"number","invalid dimension"),Zt=Yt.dimension|0),"length"in Yt&&(q.nni(xr,"buffer length must be a nonnegative integer"),xr=Yt.length|0)),Xt.bind(),ar?wn(Xt,ar,xn,on,Zt,An):(xr&&K.bufferData(Xt.type,xr,xn),Xt.dtype=on||wu,Xt.usage=xn,Xt.dimension=Zt,Xt.byteLength=xr),Ie.profile&&(Xt.stats.size=Xt.byteLength*$l[Xt.dtype]),kn}function Kt(Yt,xn){q(xn+Yt.byteLength<=Xt.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Yt.byteLength+" starting from offset "+xn+" to a buffer of size "+Xt.byteLength),K.bufferSubData(Xt.type,xn,Yt)}function _n(Yt,xn){var ar=(xn||0)|0,xr;if(Xt.bind(),n(Yt)||Yt instanceof ArrayBuffer)Kt(Yt,ar);else if(Array.isArray(Yt)){if(Yt.length>0)if(typeof Yt[0]=="number"){var on=Oo.allocType(Xt.dtype,Yt.length);lc(on,Yt),Kt(on,ar),Oo.freeType(on)}else if(Array.isArray(Yt[0])||n(Yt[0])){xr=Ua(Yt);var Zt=vo(Yt,xr,Xt.dtype);Kt(Zt,ar),Oo.freeType(Zt)}else q.raise("invalid buffer data")}else if(Ia(Yt)){xr=Yt.shape;var Ht=Yt.stride,pr=0,Dr=0,Un=0,$r=0;xr.length===1?(pr=xr[0],Dr=1,Un=Ht[0],$r=0):xr.length===2?(pr=xr[0],Dr=xr[1],Un=Ht[0],$r=Ht[1]):q.raise("invalid shape");var Or=Array.isArray(Yt.data)?Xt.dtype:ui(Yt.data),Fr=Oo.allocType(Or,pr*Dr);rs(Fr,Yt.data,pr,Dr,Un,$r,Yt.offset),Kt(Fr,ar),Oo.freeType(Fr)}else q.raise("invalid data for buffer subdata");return kn}return ln||kn(st),kn._reglType="buffer",kn._buffer=Xt,kn.subdata=_n,Ie.profile&&(kn.stats=Xt.stats),kn.destroy=function(){hn(Xt)},kn}function Wt(){ra(yt).forEach(function(st){st.buffer=K.createBuffer(),K.bindBuffer(st.type,st.buffer),K.bufferData(st.type,st.persistentData||st.byteLength,st.usage)})}return Ie.profile&&(ge.getTotalBufferSize=function(){var st=0;return Object.keys(yt).forEach(function(St){st+=yt[St].stats.size}),st}),{create:rn,createStream:sn,destroyStream:nn,clear:function(){ra(yt).forEach(hn),tn.forEach(hn)},getBuffer:function(st){return st&&st._buffer instanceof Nt?st._buffer:null},restore:Wt,_initBuffer:wn}}var af=0,Vh=0,lf=1,Wi=1,sc=4,os=4,Ki={points:af,point:Vh,lines:lf,line:Wi,triangles:sc,triangle:os,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},sf=0,ll=1,Ol=4,sd=5120,Va=5121,Qa=5122,ia=5123,sl=5124,ka=5125,Ct=34963,un=35040,fn=35044;function Gn(K,ge,Ie,wt){var Dt={},yt=0,Nt={uint8:Va,uint16:ia};ge.oes_element_index_uint&&(Nt.uint32=ka);function tn(Wt){this.id=yt++,Dt[this.id]=this,this.buffer=Wt,this.primType=Ol,this.vertCount=0,this.type=0}tn.prototype.bind=function(){this.buffer.bind()};var sn=[];function nn(Wt){var st=sn.pop();return st||(st=new tn(Ie.create(null,Ct,!0,!1)._buffer)),wn(st,Wt,un,-1,-1,0,0),st}function Mt(Wt){sn.push(Wt)}function wn(Wt,st,St,ln,An,Xt,kn){Wt.buffer.bind();var Kt;if(st){var _n=kn;!kn&&(!n(st)||Ia(st)&&!n(st.data))&&(_n=ge.oes_element_index_uint?ka:ia),Ie._initBuffer(Wt.buffer,st,St,_n,3)}else K.bufferData(Ct,Xt,St),Wt.buffer.dtype=Kt||Va,Wt.buffer.usage=St,Wt.buffer.dimension=3,Wt.buffer.byteLength=Xt;if(Kt=kn,!kn){switch(Wt.buffer.dtype){case Va:case sd:Kt=Va;break;case ia:case Qa:Kt=ia;break;case ka:case sl:Kt=ka;break;default:q.raise("unsupported type for element array")}Wt.buffer.dtype=Kt}Wt.type=Kt,q(Kt!==ka||!!ge.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Yt=An;Yt<0&&(Yt=Wt.buffer.byteLength,Kt===ia?Yt>>=1:Kt===ka&&(Yt>>=2)),Wt.vertCount=Yt;var xn=ln;if(ln<0){xn=Ol;var ar=Wt.buffer.dimension;ar===1&&(xn=sf),ar===2&&(xn=ll),ar===3&&(xn=Ol)}Wt.primType=xn}function hn(Wt){wt.elementsCount--,q(Wt.buffer!==null,"must not double destroy elements"),delete Dt[Wt.id],Wt.buffer.destroy(),Wt.buffer=null}function rn(Wt,st){var St=Ie.create(null,Ct,!0),ln=new tn(St._buffer);wt.elementsCount++;function An(Xt){if(!Xt)St(),ln.primType=Ol,ln.vertCount=0,ln.type=Va;else if(typeof Xt=="number")St(Xt),ln.primType=Ol,ln.vertCount=Xt|0,ln.type=Va;else{var kn=null,Kt=fn,_n=-1,Yt=-1,xn=0,ar=0;Array.isArray(Xt)||n(Xt)||Ia(Xt)?kn=Xt:(q.type(Xt,"object","invalid arguments for elements"),"data"in Xt&&(kn=Xt.data,q(Array.isArray(kn)||n(kn)||Ia(kn),"invalid data for element buffer")),"usage"in Xt&&(q.parameter(Xt.usage,El,"invalid element buffer usage"),Kt=El[Xt.usage]),"primitive"in Xt&&(q.parameter(Xt.primitive,Ki,"invalid element buffer primitive"),_n=Ki[Xt.primitive]),"count"in Xt&&(q(typeof Xt.count=="number"&&Xt.count>=0,"invalid vertex count for elements"),Yt=Xt.count|0),"type"in Xt&&(q.parameter(Xt.type,Nt,"invalid buffer type"),ar=Nt[Xt.type]),"length"in Xt?xn=Xt.length|0:(xn=Yt,ar===ia||ar===Qa?xn*=2:(ar===ka||ar===sl)&&(xn*=4))),wn(ln,kn,Kt,_n,Yt,xn,ar)}return An}return An(Wt),An._reglType="elements",An._elements=ln,An.subdata=function(Xt,kn){return St.subdata(Xt,kn),An},An.destroy=function(){hn(ln)},An}return{create:rn,createStream:nn,destroyStream:Mt,getElements:function(Wt){return typeof Wt=="function"&&Wt._elements instanceof tn?Wt._elements:null},clear:function(){ra(Dt).forEach(hn)}}}var Wr=new Float32Array(1),go=new Uint32Array(Wr.buffer),ci=5123;function D(K){for(var ge=Oo.allocType(ci,K.length),Ie=0;Ie<K.length;++Ie)if(isNaN(K[Ie]))ge[Ie]=65535;else if(K[Ie]===1/0)ge[Ie]=31744;else if(K[Ie]===-1/0)ge[Ie]=64512;else{Wr[0]=K[Ie];var wt=go[0],Dt=wt>>>31<<15,yt=(wt<<1>>>24)-127,Nt=wt>>13&1023;if(yt<-24)ge[Ie]=Dt;else if(yt<-14){var tn=-14-yt;ge[Ie]=Dt+(Nt+1024>>tn)}else yt>15?ge[Ie]=Dt+31744:ge[Ie]=Dt+(yt+15<<10)+Nt}return ge}function L(K){return Array.isArray(K)||n(K)}var Z=function(K){return!(K&K-1)&&!!K},fe=34467,Re=3553,lt=34067,It=34069,bn=6408,Jn=6406,no=6407,$n=6409,Do=6410,Kr=32854,So=32855,ul=36194,wi=32819,el=32820,ks=33635,Ps=34042,Zs=6402,Eu=34041,is=35904,xu=35906,Zi=36193,Js=33776,Rs=33777,as=33778,ls=33779,uc=35986,fg=35987,pg=34798,Wh=35840,uf=35841,cc=35842,Ep=35843,hg=36196,dc=5121,cf=5123,xp=5125,ji=5126,Wa=10242,Op=10243,Sp=10497,ud=33071,dy=33648,cd=10240,dd=10241,df=9728,fc=9729,Ou=9984,fd=9985,ff=9986,Su=9987,fy=33170,pf=4352,py=4353,hy=4354,vg=34046,Ap=3317,Pa=37440,gg=37441,he=37443,pc=37444,Qs=33984,Ul=[Ou,ff,fd,Su],mo=[0,$n,Do,no,bn],ba={};ba[$n]=ba[Jn]=ba[Zs]=1,ba[Eu]=ba[Do]=2,ba[no]=ba[is]=3,ba[bn]=ba[xu]=4;function To(K){return"[object "+K+"]"}var ss=To("HTMLCanvasElement"),eu=To("OffscreenCanvas"),Sl=To("CanvasRenderingContext2D"),Mp=To("ImageBitmap"),Tp=To("HTMLImageElement"),Gh=To("HTMLVideoElement"),mg=Object.keys(Za).concat([ss,eu,Sl,Mp,Tp,Gh]),tu=[];tu[dc]=1,tu[ji]=4,tu[Zi]=2,tu[cf]=2,tu[xp]=4;var Li=[];Li[Kr]=2,Li[So]=2,Li[ul]=2,Li[Eu]=4,Li[Js]=.5,Li[Rs]=.5,Li[as]=1,Li[ls]=1,Li[uc]=.5,Li[fg]=1,Li[pg]=1,Li[Wh]=.5,Li[uf]=.25,Li[cc]=.5,Li[Ep]=.25,Li[hg]=.5;function pd(K){return Array.isArray(K)&&(K.length===0||typeof K[0]=="number")}function zh(K){if(!Array.isArray(K))return!1;var ge=K.length;return!(ge===0||!L(K[0]))}function nu(K){return Object.prototype.toString.call(K)}function us(K){return nu(K)===ss}function hf(K){return nu(K)===eu}function Au(K){return nu(K)===Sl}function Al(K){return nu(K)===Mp}function Hh(K){return nu(K)===Tp}function Xh(K){return nu(K)===Gh}function cs(K){if(!K)return!1;var ge=nu(K);return mg.indexOf(ge)>=0?!0:pd(K)||zh(K)||Ia(K)}function gi(K){return Za[Object.prototype.toString.call(K)]|0}function yg(K,ge){var Ie=ge.length;switch(K.type){case dc:case cf:case xp:case ji:var wt=Oo.allocType(K.type,Ie);wt.set(ge),K.data=wt;break;case Zi:K.data=D(ge);break;default:q.raise("unsupported texture type, must specify a typed array")}}function Yh(K,ge){return Oo.allocType(K.type===Zi?ji:K.type,ge)}function Ii(K,ge){K.type===Zi?(K.data=D(ge),Oo.freeType(ge)):K.data=ge}function Io(K,ge,Ie,wt,Dt,yt){for(var Nt=K.width,tn=K.height,sn=K.channels,nn=Nt*tn*sn,Mt=Yh(K,nn),wn=0,hn=0;hn<tn;++hn)for(var rn=0;rn<Nt;++rn)for(var Wt=0;Wt<sn;++Wt)Mt[wn++]=ge[Ie*rn+wt*hn+Dt*Wt+yt];Ii(K,Mt)}function Ji(K,ge,Ie,wt,Dt,yt){var Nt;if(typeof Li[K]<"u"?Nt=Li[K]:Nt=ba[K]*tu[ge],yt&&(Nt*=6),Dt){for(var tn=0,sn=Ie;sn>=1;)tn+=Nt*sn*sn,sn/=2;return tn}else return Nt*Ie*wt}function lo(K,ge,Ie,wt,Dt,yt,Nt){var tn={"don't care":pf,"dont care":pf,nice:hy,fast:py},sn={repeat:Sp,clamp:ud,mirror:dy},nn={nearest:df,linear:fc},Mt=o({mipmap:Su,"nearest mipmap nearest":Ou,"linear mipmap nearest":fd,"nearest mipmap linear":ff,"linear mipmap linear":Su},nn),wn={none:0,browser:pc},hn={uint8:dc,rgba4:wi,rgb565:ks,"rgb5 a1":el},rn={alpha:Jn,luminance:$n,"luminance alpha":Do,rgb:no,rgba:bn,rgba4:Kr,"rgb5 a1":So,rgb565:ul},Wt={};ge.ext_srgb&&(rn.srgb=is,rn.srgba=xu),ge.oes_texture_float&&(hn.float32=hn.float=ji),ge.oes_texture_half_float&&(hn.float16=hn["half float"]=Zi),ge.webgl_depth_texture&&(o(rn,{depth:Zs,"depth stencil":Eu}),o(hn,{uint16:cf,uint32:xp,"depth stencil":Ps})),ge.webgl_compressed_texture_s3tc&&o(Wt,{"rgb s3tc dxt1":Js,"rgba s3tc dxt1":Rs,"rgba s3tc dxt3":as,"rgba s3tc dxt5":ls}),ge.webgl_compressed_texture_atc&&o(Wt,{"rgb atc":uc,"rgba atc explicit alpha":fg,"rgba atc interpolated alpha":pg}),ge.webgl_compressed_texture_pvrtc&&o(Wt,{"rgb pvrtc 4bppv1":Wh,"rgb pvrtc 2bppv1":uf,"rgba pvrtc 4bppv1":cc,"rgba pvrtc 2bppv1":Ep}),ge.webgl_compressed_texture_etc1&&(Wt["rgb etc1"]=hg);var st=Array.prototype.slice.call(K.getParameter(fe));Object.keys(Wt).forEach(function(Ce){var Et=Wt[Ce];st.indexOf(Et)>=0&&(rn[Ce]=Et)});var St=Object.keys(rn);Ie.textureFormats=St;var ln=[];Object.keys(rn).forEach(function(Ce){var Et=rn[Ce];ln[Et]=Ce});var An=[];Object.keys(hn).forEach(function(Ce){var Et=hn[Ce];An[Et]=Ce});var Xt=[];Object.keys(nn).forEach(function(Ce){var Et=nn[Ce];Xt[Et]=Ce});var kn=[];Object.keys(Mt).forEach(function(Ce){var Et=Mt[Ce];kn[Et]=Ce});var Kt=[];Object.keys(sn).forEach(function(Ce){var Et=sn[Ce];Kt[Et]=Ce});var _n=St.reduce(function(Ce,Et){var _t=rn[Et];return _t===$n||_t===Jn||_t===$n||_t===Do||_t===Zs||_t===Eu||ge.ext_srgb&&(_t===is||_t===xu)?Ce[_t]=_t:_t===So||Et.indexOf("rgba")>=0?Ce[_t]=bn:Ce[_t]=no,Ce},{});function Yt(){this.internalformat=bn,this.format=bn,this.type=dc,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=pc,this.width=0,this.height=0,this.channels=0}function xn(Ce,Et){Ce.internalformat=Et.internalformat,Ce.format=Et.format,Ce.type=Et.type,Ce.compressed=Et.compressed,Ce.premultiplyAlpha=Et.premultiplyAlpha,Ce.flipY=Et.flipY,Ce.unpackAlignment=Et.unpackAlignment,Ce.colorSpace=Et.colorSpace,Ce.width=Et.width,Ce.height=Et.height,Ce.channels=Et.channels}function ar(Ce,Et){if(!(typeof Et!="object"||!Et)){if("premultiplyAlpha"in Et&&(q.type(Et.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Ce.premultiplyAlpha=Et.premultiplyAlpha),"flipY"in Et&&(q.type(Et.flipY,"boolean","invalid texture flip"),Ce.flipY=Et.flipY),"alignment"in Et&&(q.oneOf(Et.alignment,[1,2,4,8],"invalid texture unpack alignment"),Ce.unpackAlignment=Et.alignment),"colorSpace"in Et&&(q.parameter(Et.colorSpace,wn,"invalid colorSpace"),Ce.colorSpace=wn[Et.colorSpace]),"type"in Et){var _t=Et.type;q(ge.oes_texture_float||!(_t==="float"||_t==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),q(ge.oes_texture_half_float||!(_t==="half float"||_t==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),q(ge.webgl_depth_texture||!(_t==="uint16"||_t==="uint32"||_t==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),q.parameter(_t,hn,"invalid texture type"),Ce.type=hn[_t]}var Ln=Ce.width,Gr=Ce.height,xe=Ce.channels,de=!1;"shape"in Et?(q(Array.isArray(Et.shape)&&Et.shape.length>=2,"shape must be an array"),Ln=Et.shape[0],Gr=Et.shape[1],Et.shape.length===3&&(xe=Et.shape[2],q(xe>0&&xe<=4,"invalid number of channels"),de=!0),q(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid width"),q(Gr>=0&&Gr<=Ie.maxTextureSize,"invalid height")):("radius"in Et&&(Ln=Gr=Et.radius,q(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid radius")),"width"in Et&&(Ln=Et.width,q(Ln>=0&&Ln<=Ie.maxTextureSize,"invalid width")),"height"in Et&&(Gr=Et.height,q(Gr>=0&&Gr<=Ie.maxTextureSize,"invalid height")),"channels"in Et&&(xe=Et.channels,q(xe>0&&xe<=4,"invalid number of channels"),de=!0)),Ce.width=Ln|0,Ce.height=Gr|0,Ce.channels=xe|0;var We=!1;if("format"in Et){var tt=Et.format;q(ge.webgl_depth_texture||!(tt==="depth"||tt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),q.parameter(tt,rn,"invalid texture format");var ct=Ce.internalformat=rn[tt];Ce.format=_n[ct],tt in hn&&("type"in Et||(Ce.type=hn[tt])),tt in Wt&&(Ce.compressed=!0),We=!0}!de&&We?Ce.channels=ba[Ce.format]:de&&!We?Ce.channels!==mo[Ce.format]&&(Ce.format=Ce.internalformat=mo[Ce.channels]):We&&de&&q(Ce.channels===ba[Ce.format],"number of channels inconsistent with specified format")}}function xr(Ce){K.pixelStorei(Pa,Ce.flipY),K.pixelStorei(gg,Ce.premultiplyAlpha),K.pixelStorei(he,Ce.colorSpace),K.pixelStorei(Ap,Ce.unpackAlignment)}function on(){Yt.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Zt(Ce,Et){var _t=null;if(cs(Et)?_t=Et:Et&&(q.type(Et,"object","invalid pixel data type"),ar(Ce,Et),"x"in Et&&(Ce.xOffset=Et.x|0),"y"in Et&&(Ce.yOffset=Et.y|0),cs(Et.data)&&(_t=Et.data)),q(!Ce.compressed||_t instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Et.copy){q(!_t,"can not specify copy and data field for the same texture");var Ln=Dt.viewportWidth,Gr=Dt.viewportHeight;Ce.width=Ce.width||Ln-Ce.xOffset,Ce.height=Ce.height||Gr-Ce.yOffset,Ce.needsCopy=!0,q(Ce.xOffset>=0&&Ce.xOffset<Ln&&Ce.yOffset>=0&&Ce.yOffset<Gr&&Ce.width>0&&Ce.width<=Ln&&Ce.height>0&&Ce.height<=Gr,"copy texture read out of bounds")}else if(!_t)Ce.width=Ce.width||1,Ce.height=Ce.height||1,Ce.channels=Ce.channels||4;else if(n(_t))Ce.channels=Ce.channels||4,Ce.data=_t,!("type"in Et)&&Ce.type===dc&&(Ce.type=gi(_t));else if(pd(_t))Ce.channels=Ce.channels||4,yg(Ce,_t),Ce.alignment=1,Ce.needsFree=!0;else if(Ia(_t)){var xe=_t.data;!Array.isArray(xe)&&Ce.type===dc&&(Ce.type=gi(xe));var de=_t.shape,We=_t.stride,tt,ct,Xe,ze,Qe,Ee;de.length===3?(Xe=de[2],Ee=We[2]):(q(de.length===2,"invalid ndarray pixel data, must be 2 or 3D"),Xe=1,Ee=1),tt=de[0],ct=de[1],ze=We[0],Qe=We[1],Ce.alignment=1,Ce.width=tt,Ce.height=ct,Ce.channels=Xe,Ce.format=Ce.internalformat=mo[Xe],Ce.needsFree=!0,Io(Ce,xe,ze,Qe,Ee,_t.offset)}else if(us(_t)||hf(_t)||Au(_t))us(_t)||hf(_t)?Ce.element=_t:Ce.element=_t.canvas,Ce.width=Ce.element.width,Ce.height=Ce.element.height,Ce.channels=4;else if(Al(_t))Ce.element=_t,Ce.width=_t.width,Ce.height=_t.height,Ce.channels=4;else if(Hh(_t))Ce.element=_t,Ce.width=_t.naturalWidth,Ce.height=_t.naturalHeight,Ce.channels=4;else if(Xh(_t))Ce.element=_t,Ce.width=_t.videoWidth,Ce.height=_t.videoHeight,Ce.channels=4;else if(zh(_t)){var Ue=Ce.width||_t[0].length,be=Ce.height||_t.length,nt=Ce.channels;L(_t[0][0])?nt=nt||_t[0][0].length:nt=nt||1;for(var ot=wl.shape(_t),m=1,x=0;x<ot.length;++x)m*=ot[x];var C=Yh(Ce,m);wl.flatten(_t,ot,"",C),Ii(Ce,C),Ce.alignment=1,Ce.width=Ue,Ce.height=be,Ce.channels=nt,Ce.format=Ce.internalformat=mo[nt],Ce.needsFree=!0}Ce.type===ji?q(Ie.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Ce.type===Zi&&q(Ie.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Ht(Ce,Et,_t){var Ln=Ce.element,Gr=Ce.data,xe=Ce.internalformat,de=Ce.format,We=Ce.type,tt=Ce.width,ct=Ce.height;xr(Ce),Ln?K.texImage2D(Et,_t,de,de,We,Ln):Ce.compressed?K.compressedTexImage2D(Et,_t,xe,tt,ct,0,Gr):Ce.needsCopy?(wt(),K.copyTexImage2D(Et,_t,de,Ce.xOffset,Ce.yOffset,tt,ct,0)):K.texImage2D(Et,_t,de,tt,ct,0,de,We,Gr||null)}function pr(Ce,Et,_t,Ln,Gr){var xe=Ce.element,de=Ce.data,We=Ce.internalformat,tt=Ce.format,ct=Ce.type,Xe=Ce.width,ze=Ce.height;xr(Ce),xe?K.texSubImage2D(Et,Gr,_t,Ln,tt,ct,xe):Ce.compressed?K.compressedTexSubImage2D(Et,Gr,_t,Ln,We,Xe,ze,de):Ce.needsCopy?(wt(),K.copyTexSubImage2D(Et,Gr,_t,Ln,Ce.xOffset,Ce.yOffset,Xe,ze)):K.texSubImage2D(Et,Gr,_t,Ln,Xe,ze,tt,ct,de)}var Dr=[];function Un(){return Dr.pop()||new on}function $r(Ce){Ce.needsFree&&Oo.freeType(Ce.data),on.call(Ce),Dr.push(Ce)}function Or(){Yt.call(this),this.genMipmaps=!1,this.mipmapHint=pf,this.mipmask=0,this.images=Array(16)}function Fr(Ce,Et,_t){var Ln=Ce.images[0]=Un();Ce.mipmask=1,Ln.width=Ce.width=Et,Ln.height=Ce.height=_t,Ln.channels=Ce.channels=4}function Qr(Ce,Et){var _t=null;if(cs(Et))_t=Ce.images[0]=Un(),xn(_t,Ce),Zt(_t,Et),Ce.mipmask=1;else if(ar(Ce,Et),Array.isArray(Et.mipmap))for(var Ln=Et.mipmap,Gr=0;Gr<Ln.length;++Gr)_t=Ce.images[Gr]=Un(),xn(_t,Ce),_t.width>>=Gr,_t.height>>=Gr,Zt(_t,Ln[Gr]),Ce.mipmask|=1<<Gr;else _t=Ce.images[0]=Un(),xn(_t,Ce),Zt(_t,Et),Ce.mipmask=1;xn(Ce,Ce.images[0]),Ce.compressed&&(Ce.internalformat===Js||Ce.internalformat===Rs||Ce.internalformat===as||Ce.internalformat===ls)&&q(Ce.width%4===0&&Ce.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function ki(Ce,Et){for(var _t=Ce.images,Ln=0;Ln<_t.length;++Ln){if(!_t[Ln])return;Ht(_t[Ln],Et,Ln)}}var Si=[];function jr(){var Ce=Si.pop()||new Or;Yt.call(Ce),Ce.mipmask=0;for(var Et=0;Et<16;++Et)Ce.images[Et]=null;return Ce}function Gi(Ce){for(var Et=Ce.images,_t=0;_t<Et.length;++_t)Et[_t]&&$r(Et[_t]),Et[_t]=null;Si.push(Ce)}function Ko(){this.minFilter=df,this.magFilter=df,this.wrapS=ud,this.wrapT=ud,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=pf}function Pi(Ce,Et){if("min"in Et){var _t=Et.min;q.parameter(_t,Mt),Ce.minFilter=Mt[_t],Ul.indexOf(Ce.minFilter)>=0&&!("faces"in Et)&&(Ce.genMipmaps=!0)}if("mag"in Et){var Ln=Et.mag;q.parameter(Ln,nn),Ce.magFilter=nn[Ln]}var Gr=Ce.wrapS,xe=Ce.wrapT;if("wrap"in Et){var de=Et.wrap;typeof de=="string"?(q.parameter(de,sn),Gr=xe=sn[de]):Array.isArray(de)&&(q.parameter(de[0],sn),q.parameter(de[1],sn),Gr=sn[de[0]],xe=sn[de[1]])}else{if("wrapS"in Et){var We=Et.wrapS;q.parameter(We,sn),Gr=sn[We]}if("wrapT"in Et){var tt=Et.wrapT;q.parameter(tt,sn),xe=sn[tt]}}if(Ce.wrapS=Gr,Ce.wrapT=xe,"anisotropic"in Et){var ct=Et.anisotropic;q(typeof ct=="number"&&ct>=1&&ct<=Ie.maxAnisotropic,"aniso samples must be between 1 and "),Ce.anisotropic=Et.anisotropic}if("mipmap"in Et){var Xe=!1;switch(typeof Et.mipmap){case"string":q.parameter(Et.mipmap,tn,"invalid mipmap hint"),Ce.mipmapHint=tn[Et.mipmap],Ce.genMipmaps=!0,Xe=!0;break;case"boolean":Xe=Ce.genMipmaps=Et.mipmap;break;case"object":q(Array.isArray(Et.mipmap),"invalid mipmap type"),Ce.genMipmaps=!1,Xe=!0;break;default:q.raise("invalid mipmap type")}Xe&&!("min"in Et)&&(Ce.minFilter=Ou)}}function $i(Ce,Et){K.texParameteri(Et,dd,Ce.minFilter),K.texParameteri(Et,cd,Ce.magFilter),K.texParameteri(Et,Wa,Ce.wrapS),K.texParameteri(Et,Op,Ce.wrapT),ge.ext_texture_filter_anisotropic&&K.texParameteri(Et,vg,Ce.anisotropic),Ce.genMipmaps&&(K.hint(fy,Ce.mipmapHint),K.generateMipmap(Et))}var Qi=0,la={},zi=Ie.maxTextureUnits,di=Array(zi).map(function(){return null});function Cr(Ce){Yt.call(this),this.mipmask=0,this.internalformat=bn,this.id=Qi++,this.refCount=1,this.target=Ce,this.texture=K.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ko,Nt.profile&&(this.stats={size:0})}function sa(Ce){K.activeTexture(Qs),K.bindTexture(Ce.target,Ce.texture)}function co(){var Ce=di[0];Ce?K.bindTexture(Ce.target,Ce.texture):K.bindTexture(Re,null)}function cr(Ce){var Et=Ce.texture;q(Et,"must not double destroy texture");var _t=Ce.unit,Ln=Ce.target;_t>=0&&(K.activeTexture(Qs+_t),K.bindTexture(Ln,null),di[_t]=null),K.deleteTexture(Et),Ce.texture=null,Ce.params=null,Ce.pixels=null,Ce.refCount=0,delete la[Ce.id],yt.textureCount--}o(Cr.prototype,{bind:function(){var Ce=this;Ce.bindCount+=1;var Et=Ce.unit;if(Et<0){for(var _t=0;_t<zi;++_t){var Ln=di[_t];if(Ln){if(Ln.bindCount>0)continue;Ln.unit=-1}di[_t]=Ce,Et=_t;break}Et>=zi&&q.raise("insufficient number of texture units"),Nt.profile&&yt.maxTextureUnits<Et+1&&(yt.maxTextureUnits=Et+1),Ce.unit=Et,K.activeTexture(Qs+Et),K.bindTexture(Ce.target,Ce.texture)}return Et},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&cr(this)}});function Xr(Ce,Et){var _t=new Cr(Re);la[_t.id]=_t,yt.textureCount++;function Ln(de,We){var tt=_t.texInfo;Ko.call(tt);var ct=jr();return typeof de=="number"?typeof We=="number"?Fr(ct,de|0,We|0):Fr(ct,de|0,de|0):de?(q.type(de,"object","invalid arguments to regl.texture"),Pi(tt,de),Qr(ct,de)):Fr(ct,1,1),tt.genMipmaps&&(ct.mipmask=(ct.width<<1)-1),_t.mipmask=ct.mipmask,xn(_t,ct),q.texture2D(tt,ct,Ie),_t.internalformat=ct.internalformat,Ln.width=ct.width,Ln.height=ct.height,sa(_t),ki(ct,Re),$i(tt,Re),co(),Gi(ct),Nt.profile&&(_t.stats.size=Ji(_t.internalformat,_t.type,ct.width,ct.height,tt.genMipmaps,!1)),Ln.format=ln[_t.internalformat],Ln.type=An[_t.type],Ln.mag=Xt[tt.magFilter],Ln.min=kn[tt.minFilter],Ln.wrapS=Kt[tt.wrapS],Ln.wrapT=Kt[tt.wrapT],Ln}function Gr(de,We,tt,ct){q(!!de,"must specify image data");var Xe=We|0,ze=tt|0,Qe=ct|0,Ee=Un();return xn(Ee,_t),Ee.width=0,Ee.height=0,Zt(Ee,de),Ee.width=Ee.width||(_t.width>>Qe)-Xe,Ee.height=Ee.height||(_t.height>>Qe)-ze,q(_t.type===Ee.type&&_t.format===Ee.format&&_t.internalformat===Ee.internalformat,"incompatible format for texture.subimage"),q(Xe>=0&&ze>=0&&Xe+Ee.width<=_t.width&&ze+Ee.height<=_t.height,"texture.subimage write out of bounds"),q(_t.mipmask&1<<Qe,"missing mipmap data"),q(Ee.data||Ee.element||Ee.needsCopy,"missing image data"),sa(_t),pr(Ee,Re,Xe,ze,Qe),co(),$r(Ee),Ln}function xe(de,We){var tt=de|0,ct=We|0||tt;if(tt===_t.width&&ct===_t.height)return Ln;Ln.width=_t.width=tt,Ln.height=_t.height=ct,sa(_t);for(var Xe=0;_t.mipmask>>Xe;++Xe){var ze=tt>>Xe,Qe=ct>>Xe;if(!ze||!Qe)break;K.texImage2D(Re,Xe,_t.format,ze,Qe,0,_t.format,_t.type,null)}return co(),Nt.profile&&(_t.stats.size=Ji(_t.internalformat,_t.type,tt,ct,!1,!1)),Ln}return Ln(Ce,Et),Ln.subimage=Gr,Ln.resize=xe,Ln._reglType="texture2d",Ln._texture=_t,Nt.profile&&(Ln.stats=_t.stats),Ln.destroy=function(){_t.decRef()},Ln}function Nr(Ce,Et,_t,Ln,Gr,xe){var de=new Cr(lt);la[de.id]=de,yt.cubeCount++;var We=new Array(6);function tt(ze,Qe,Ee,Ue,be,nt){var ot,m=de.texInfo;for(Ko.call(m),ot=0;ot<6;++ot)We[ot]=jr();if(typeof ze=="number"||!ze){var x=ze|0||1;for(ot=0;ot<6;++ot)Fr(We[ot],x,x)}else if(typeof ze=="object")if(Qe)Qr(We[0],ze),Qr(We[1],Qe),Qr(We[2],Ee),Qr(We[3],Ue),Qr(We[4],be),Qr(We[5],nt);else if(Pi(m,ze),ar(de,ze),"faces"in ze){var C=ze.faces;for(q(Array.isArray(C)&&C.length===6,"cube faces must be a length 6 array"),ot=0;ot<6;++ot)q(typeof C[ot]=="object"&&!!C[ot],"invalid input for cube map face"),xn(We[ot],de),Qr(We[ot],C[ot])}else for(ot=0;ot<6;++ot)Qr(We[ot],ze);else q.raise("invalid arguments to cube map");for(xn(de,We[0]),Ie.npotTextureCube||q(Z(de.width)&&Z(de.height),"your browser does not support non power or two texture dimensions"),m.genMipmaps?de.mipmask=(We[0].width<<1)-1:de.mipmask=We[0].mipmask,q.textureCube(de,m,We,Ie),de.internalformat=We[0].internalformat,tt.width=We[0].width,tt.height=We[0].height,sa(de),ot=0;ot<6;++ot)ki(We[ot],It+ot);for($i(m,lt),co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,m.genMipmaps,!0)),tt.format=ln[de.internalformat],tt.type=An[de.type],tt.mag=Xt[m.magFilter],tt.min=kn[m.minFilter],tt.wrapS=Kt[m.wrapS],tt.wrapT=Kt[m.wrapT],ot=0;ot<6;++ot)Gi(We[ot]);return tt}function ct(ze,Qe,Ee,Ue,be){q(!!Qe,"must specify image data"),q(typeof ze=="number"&&ze===(ze|0)&&ze>=0&&ze<6,"invalid face");var nt=Ee|0,ot=Ue|0,m=be|0,x=Un();return xn(x,de),x.width=0,x.height=0,Zt(x,Qe),x.width=x.width||(de.width>>m)-nt,x.height=x.height||(de.height>>m)-ot,q(de.type===x.type&&de.format===x.format&&de.internalformat===x.internalformat,"incompatible format for texture.subimage"),q(nt>=0&&ot>=0&&nt+x.width<=de.width&&ot+x.height<=de.height,"texture.subimage write out of bounds"),q(de.mipmask&1<<m,"missing mipmap data"),q(x.data||x.element||x.needsCopy,"missing image data"),sa(de),pr(x,It+ze,nt,ot,m),co(),$r(x),tt}function Xe(ze){var Qe=ze|0;if(Qe!==de.width){tt.width=de.width=Qe,tt.height=de.height=Qe,sa(de);for(var Ee=0;Ee<6;++Ee)for(var Ue=0;de.mipmask>>Ue;++Ue)K.texImage2D(It+Ee,Ue,de.format,Qe>>Ue,Qe>>Ue,0,de.format,de.type,null);return co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,!1,!0)),tt}}return tt(Ce,Et,_t,Ln,Gr,xe),tt.subimage=ct,tt.resize=Xe,tt._reglType="textureCube",tt._texture=de,Nt.profile&&(tt.stats=de.stats),tt.destroy=function(){de.decRef()},tt}function fi(){for(var Ce=0;Ce<zi;++Ce)K.activeTexture(Qs+Ce),K.bindTexture(Re,null),di[Ce]=null;ra(la).forEach(cr),yt.cubeCount=0,yt.textureCount=0}Nt.profile&&(yt.getTotalTextureSize=function(){var Ce=0;return Object.keys(la).forEach(function(Et){Ce+=la[Et].stats.size}),Ce});function $s(){for(var Ce=0;Ce<zi;++Ce){var Et=di[Ce];Et&&(Et.bindCount=0,Et.unit=-1,di[Ce]=null)}ra(la).forEach(function(_t){_t.texture=K.createTexture(),K.bindTexture(_t.target,_t.texture);for(var Ln=0;Ln<32;++Ln)if((_t.mipmask&1<<Ln)!==0)if(_t.target===Re)K.texImage2D(Re,Ln,_t.internalformat,_t.width>>Ln,_t.height>>Ln,0,_t.internalformat,_t.type,null);else for(var Gr=0;Gr<6;++Gr)K.texImage2D(It+Gr,Ln,_t.internalformat,_t.width>>Ln,_t.height>>Ln,0,_t.internalformat,_t.type,null);$i(_t.texInfo,_t.target)})}function yi(){for(var Ce=0;Ce<zi;++Ce){var Et=di[Ce];Et&&(Et.bindCount=0,Et.unit=-1,di[Ce]=null),K.activeTexture(Qs+Ce),K.bindTexture(Re,null),K.bindTexture(lt,null)}}return{create2D:Xr,createCube:Nr,clear:fi,getTexture:function(Ce){return null},restore:$s,refresh:yi}}var ei=36161,ur=32854,ti=32855,vf=36194,Ds=33189,Cp=36168,Ei=34041,Mi=35907,qh=34836,Kh=34842,gf=34843,Ga=[];Ga[ur]=2,Ga[ti]=2,Ga[vf]=2,Ga[Ds]=2,Ga[Cp]=1,Ga[Ei]=4,Ga[Mi]=4,Ga[qh]=16,Ga[Kh]=8,Ga[gf]=6;function Np(K,ge,Ie){return Ga[K]*ge*Ie}var hd=function(K,ge,Ie,wt,Dt){var yt={rgba4:ur,rgb565:vf,"rgb5 a1":ti,depth:Ds,stencil:Cp,"depth stencil":Ei};ge.ext_srgb&&(yt.srgba=Mi),ge.ext_color_buffer_half_float&&(yt.rgba16f=Kh,yt.rgb16f=gf),ge.webgl_color_buffer_float&&(yt.rgba32f=qh);var Nt=[];Object.keys(yt).forEach(function(rn){var Wt=yt[rn];Nt[Wt]=rn});var tn=0,sn={};function nn(rn){this.id=tn++,this.refCount=1,this.renderbuffer=rn,this.format=ur,this.width=0,this.height=0,Dt.profile&&(this.stats={size:0})}nn.prototype.decRef=function(){--this.refCount<=0&&Mt(this)};function Mt(rn){var Wt=rn.renderbuffer;q(Wt,"must not double destroy renderbuffer"),K.bindRenderbuffer(ei,null),K.deleteRenderbuffer(Wt),rn.renderbuffer=null,rn.refCount=0,delete sn[rn.id],wt.renderbufferCount--}function wn(rn,Wt){var st=new nn(K.createRenderbuffer());sn[st.id]=st,wt.renderbufferCount++;function St(An,Xt){var kn=0,Kt=0,_n=ur;if(typeof An=="object"&&An){var Yt=An;if("shape"in Yt){var xn=Yt.shape;q(Array.isArray(xn)&&xn.length>=2,"invalid renderbuffer shape"),kn=xn[0]|0,Kt=xn[1]|0}else"radius"in Yt&&(kn=Kt=Yt.radius|0),"width"in Yt&&(kn=Yt.width|0),"height"in Yt&&(Kt=Yt.height|0);"format"in Yt&&(q.parameter(Yt.format,yt,"invalid renderbuffer format"),_n=yt[Yt.format])}else typeof An=="number"?(kn=An|0,typeof Xt=="number"?Kt=Xt|0:Kt=kn):An?q.raise("invalid arguments to renderbuffer constructor"):kn=Kt=1;if(q(kn>0&&Kt>0&&kn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),!(kn===st.width&&Kt===st.height&&_n===st.format))return St.width=st.width=kn,St.height=st.height=Kt,st.format=_n,K.bindRenderbuffer(ei,st.renderbuffer),K.renderbufferStorage(ei,_n,kn,Kt),q(K.getError()===0,"invalid render buffer format"),Dt.profile&&(st.stats.size=Np(st.format,st.width,st.height)),St.format=Nt[st.format],St}function ln(An,Xt){var kn=An|0,Kt=Xt|0||kn;return kn===st.width&&Kt===st.height||(q(kn>0&&Kt>0&&kn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),St.width=st.width=kn,St.height=st.height=Kt,K.bindRenderbuffer(ei,st.renderbuffer),K.renderbufferStorage(ei,st.format,kn,Kt),q(K.getError()===0,"invalid render buffer format"),Dt.profile&&(st.stats.size=Np(st.format,st.width,st.height))),St}return St(rn,Wt),St.resize=ln,St._reglType="renderbuffer",St._renderbuffer=st,Dt.profile&&(St.stats=st.stats),St.destroy=function(){st.decRef()},St}Dt.profile&&(wt.getTotalRenderbufferSize=function(){var rn=0;return Object.keys(sn).forEach(function(Wt){rn+=sn[Wt].stats.size}),rn});function hn(){ra(sn).forEach(function(rn){rn.renderbuffer=K.createRenderbuffer(),K.bindRenderbuffer(ei,rn.renderbuffer),K.renderbufferStorage(ei,rn.format,rn.width,rn.height)}),K.bindRenderbuffer(ei,null)}return{create:wn,clear:function(){ra(sn).forEach(Mt)},restore:hn}},Vl=36160,Mu=36161,ru=3553,Wl=34069,_g=36064,js=36096,Ml=36128,Zh=33306,Jh=36053,kp=36054,bg=36055,wg=36057,Eg=36061,Pp=36193,Qh=5121,ev=5126,mf=6407,uo=6408,vy=6402,tv=[mf,uo],hc=[];hc[uo]=4,hc[mf]=3;var yf=[];yf[Qh]=1,yf[ev]=4,yf[Pp]=2;var gy=32854,xg=32855,Tl=36194,my=33189,_f=36168,Rp=34041,nv=35907,Og=34836,cl=34842,Tu=34843,Dp=[gy,xg,Tl,nv,cl,Tu,Og],vc={};vc[Jh]="complete",vc[kp]="incomplete attachment",vc[wg]="incomplete dimensions",vc[bg]="incomplete, missing attachment",vc[Eg]="unsupported";function jp(K,ge,Ie,wt,Dt,yt){var Nt={cur:null,next:null,dirty:!1,setFBO:null},tn=["rgba"],sn=["rgba4","rgb565","rgb5 a1"];ge.ext_srgb&&sn.push("srgba"),ge.ext_color_buffer_half_float&&sn.push("rgba16f","rgb16f"),ge.webgl_color_buffer_float&&sn.push("rgba32f");var nn=["uint8"];ge.oes_texture_half_float&&nn.push("half float","float16"),ge.oes_texture_float&&nn.push("float","float32");function Mt(on,Zt,Ht){this.target=on,this.texture=Zt,this.renderbuffer=Ht;var pr=0,Dr=0;Zt?(pr=Zt.width,Dr=Zt.height):Ht&&(pr=Ht.width,Dr=Ht.height),this.width=pr,this.height=Dr}function wn(on){on&&(on.texture&&on.texture._texture.decRef(),on.renderbuffer&&on.renderbuffer._renderbuffer.decRef())}function hn(on,Zt,Ht){if(on)if(on.texture){var pr=on.texture._texture,Dr=Math.max(1,pr.width),Un=Math.max(1,pr.height);q(Dr===Zt&&Un===Ht,"inconsistent width/height for supplied texture"),pr.refCount+=1}else{var $r=on.renderbuffer._renderbuffer;q($r.width===Zt&&$r.height===Ht,"inconsistent width/height for renderbuffer"),$r.refCount+=1}}function rn(on,Zt){Zt&&(Zt.texture?K.framebufferTexture2D(Vl,on,Zt.target,Zt.texture._texture.texture,0):K.framebufferRenderbuffer(Vl,on,Mu,Zt.renderbuffer._renderbuffer.renderbuffer))}function Wt(on){var Zt=ru,Ht=null,pr=null,Dr=on;typeof on=="object"&&(Dr=on.data,"target"in on&&(Zt=on.target|0)),q.type(Dr,"function","invalid attachment data");var Un=Dr._reglType;return Un==="texture2d"?(Ht=Dr,q(Zt===ru)):Un==="textureCube"?(Ht=Dr,q(Zt>=Wl&&Zt<Wl+6,"invalid cube map target")):Un==="renderbuffer"?(pr=Dr,Zt=Mu):q.raise("invalid regl object for attachment"),new Mt(Zt,Ht,pr)}function st(on,Zt,Ht,pr,Dr){if(Ht){var Un=wt.create2D({width:on,height:Zt,format:pr,type:Dr});return Un._texture.refCount=0,new Mt(ru,Un,null)}else{var $r=Dt.create({width:on,height:Zt,format:pr});return $r._renderbuffer.refCount=0,new Mt(Mu,null,$r)}}function St(on){return on&&(on.texture||on.renderbuffer)}function ln(on,Zt,Ht){on&&(on.texture?on.texture.resize(Zt,Ht):on.renderbuffer&&on.renderbuffer.resize(Zt,Ht),on.width=Zt,on.height=Ht)}var An=0,Xt={};function kn(){this.id=An++,Xt[this.id]=this,this.framebuffer=K.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Kt(on){on.colorAttachments.forEach(wn),wn(on.depthAttachment),wn(on.stencilAttachment),wn(on.depthStencilAttachment)}function _n(on){var Zt=on.framebuffer;q(Zt,"must not double destroy framebuffer"),K.deleteFramebuffer(Zt),on.framebuffer=null,yt.framebufferCount--,delete Xt[on.id]}function Yt(on){var Zt;K.bindFramebuffer(Vl,on.framebuffer);var Ht=on.colorAttachments;for(Zt=0;Zt<Ht.length;++Zt)rn(_g+Zt,Ht[Zt]);for(Zt=Ht.length;Zt<Ie.maxColorAttachments;++Zt)K.framebufferTexture2D(Vl,_g+Zt,ru,null,0);K.framebufferTexture2D(Vl,Zh,ru,null,0),K.framebufferTexture2D(Vl,js,ru,null,0),K.framebufferTexture2D(Vl,Ml,ru,null,0),rn(js,on.depthAttachment),rn(Ml,on.stencilAttachment),rn(Zh,on.depthStencilAttachment);var pr=K.checkFramebufferStatus(Vl);!K.isContextLost()&&pr!==Jh&&q.raise("framebuffer configuration not supported, status = "+vc[pr]),K.bindFramebuffer(Vl,Nt.next?Nt.next.framebuffer:null),Nt.cur=Nt.next,K.getError()}function xn(on,Zt){var Ht=new kn;yt.framebufferCount++;function pr(Un,$r){var Or;q(Nt.next!==Ht,"can not update framebuffer which is currently in use");var Fr=0,Qr=0,ki=!0,Si=!0,jr=null,Gi=!0,Ko="rgba",Pi="uint8",$i=1,Qi=null,la=null,zi=null,di=!1;if(typeof Un=="number")Fr=Un|0,Qr=$r|0||Fr;else if(!Un)Fr=Qr=1;else{q.type(Un,"object","invalid arguments for framebuffer");var Cr=Un;if("shape"in Cr){var sa=Cr.shape;q(Array.isArray(sa)&&sa.length>=2,"invalid shape for framebuffer"),Fr=sa[0],Qr=sa[1]}else"radius"in Cr&&(Fr=Qr=Cr.radius),"width"in Cr&&(Fr=Cr.width),"height"in Cr&&(Qr=Cr.height);("color"in Cr||"colors"in Cr)&&(jr=Cr.color||Cr.colors,Array.isArray(jr)&&q(jr.length===1||ge.webgl_draw_buffers,"multiple render targets not supported")),jr||("colorCount"in Cr&&($i=Cr.colorCount|0,q($i>0,"invalid color buffer count")),"colorTexture"in Cr&&(Gi=!!Cr.colorTexture,Ko="rgba4"),"colorType"in Cr&&(Pi=Cr.colorType,Gi?(q(ge.oes_texture_float||!(Pi==="float"||Pi==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),q(ge.oes_texture_half_float||!(Pi==="half float"||Pi==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):Pi==="half float"||Pi==="float16"?(q(ge.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Ko="rgba16f"):(Pi==="float"||Pi==="float32")&&(q(ge.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Ko="rgba32f"),q.oneOf(Pi,nn,"invalid color type")),"colorFormat"in Cr&&(Ko=Cr.colorFormat,tn.indexOf(Ko)>=0?Gi=!0:sn.indexOf(Ko)>=0?Gi=!1:Gi?q.oneOf(Cr.colorFormat,tn,"invalid color format for texture"):q.oneOf(Cr.colorFormat,sn,"invalid color format for renderbuffer"))),("depthTexture"in Cr||"depthStencilTexture"in Cr)&&(di=!!(Cr.depthTexture||Cr.depthStencilTexture),q(!di||ge.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Cr&&(typeof Cr.depth=="boolean"?ki=Cr.depth:(Qi=Cr.depth,Si=!1)),"stencil"in Cr&&(typeof Cr.stencil=="boolean"?Si=Cr.stencil:(la=Cr.stencil,ki=!1)),"depthStencil"in Cr&&(typeof Cr.depthStencil=="boolean"?ki=Si=Cr.depthStencil:(zi=Cr.depthStencil,ki=!1,Si=!1))}var co=null,cr=null,Xr=null,Nr=null;if(Array.isArray(jr))co=jr.map(Wt);else if(jr)co=[Wt(jr)];else for(co=new Array($i),Or=0;Or<$i;++Or)co[Or]=st(Fr,Qr,Gi,Ko,Pi);q(ge.webgl_draw_buffers||co.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),q(co.length<=Ie.maxColorAttachments,"too many color attachments, not supported"),Fr=Fr||co[0].width,Qr=Qr||co[0].height,Qi?cr=Wt(Qi):ki&&!Si&&(cr=st(Fr,Qr,di,"depth","uint32")),la?Xr=Wt(la):Si&&!ki&&(Xr=st(Fr,Qr,!1,"stencil","uint8")),zi?Nr=Wt(zi):!Qi&&!la&&Si&&ki&&(Nr=st(Fr,Qr,di,"depth stencil","depth stencil")),q(!!Qi+!!la+!!zi<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var fi=null;for(Or=0;Or<co.length;++Or)if(hn(co[Or],Fr,Qr),q(!co[Or]||co[Or].texture&&tv.indexOf(co[Or].texture._texture.format)>=0||co[Or].renderbuffer&&Dp.indexOf(co[Or].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Or+" is invalid"),co[Or]&&co[Or].texture){var $s=hc[co[Or].texture._texture.format]*yf[co[Or].texture._texture.type];fi===null?fi=$s:q(fi===$s,"all color attachments much have the same number of bits per pixel.")}return hn(cr,Fr,Qr),q(!cr||cr.texture&&cr.texture._texture.format===vy||cr.renderbuffer&&cr.renderbuffer._renderbuffer.format===my,"invalid depth attachment for framebuffer object"),hn(Xr,Fr,Qr),q(!Xr||Xr.renderbuffer&&Xr.renderbuffer._renderbuffer.format===_f,"invalid stencil attachment for framebuffer object"),hn(Nr,Fr,Qr),q(!Nr||Nr.texture&&Nr.texture._texture.format===Rp||Nr.renderbuffer&&Nr.renderbuffer._renderbuffer.format===Rp,"invalid depth-stencil attachment for framebuffer object"),Kt(Ht),Ht.width=Fr,Ht.height=Qr,Ht.colorAttachments=co,Ht.depthAttachment=cr,Ht.stencilAttachment=Xr,Ht.depthStencilAttachment=Nr,pr.color=co.map(St),pr.depth=St(cr),pr.stencil=St(Xr),pr.depthStencil=St(Nr),pr.width=Ht.width,pr.height=Ht.height,Yt(Ht),pr}function Dr(Un,$r){q(Nt.next!==Ht,"can not resize a framebuffer which is currently in use");var Or=Math.max(Un|0,1),Fr=Math.max($r|0||Or,1);if(Or===Ht.width&&Fr===Ht.height)return pr;for(var Qr=Ht.colorAttachments,ki=0;ki<Qr.length;++ki)ln(Qr[ki],Or,Fr);return ln(Ht.depthAttachment,Or,Fr),ln(Ht.stencilAttachment,Or,Fr),ln(Ht.depthStencilAttachment,Or,Fr),Ht.width=pr.width=Or,Ht.height=pr.height=Fr,Yt(Ht),pr}return pr(on,Zt),o(pr,{resize:Dr,_reglType:"framebuffer",_framebuffer:Ht,destroy:function(){_n(Ht),Kt(Ht)},use:function(Un){Nt.setFBO({framebuffer:pr},Un)}})}function ar(on){var Zt=Array(6);function Ht(Dr){var Un;q(Zt.indexOf(Nt.next)<0,"can not update framebuffer which is currently in use");var $r={color:null},Or=0,Fr=null,Qr="rgba",ki="uint8",Si=1;if(typeof Dr=="number")Or=Dr|0;else if(!Dr)Or=1;else{q.type(Dr,"object","invalid arguments for framebuffer");var jr=Dr;if("shape"in jr){var Gi=jr.shape;q(Array.isArray(Gi)&&Gi.length>=2,"invalid shape for framebuffer"),q(Gi[0]===Gi[1],"cube framebuffer must be square"),Or=Gi[0]}else"radius"in jr&&(Or=jr.radius|0),"width"in jr?(Or=jr.width|0,"height"in jr&&q(jr.height===Or,"must be square")):"height"in jr&&(Or=jr.height|0);("color"in jr||"colors"in jr)&&(Fr=jr.color||jr.colors,Array.isArray(Fr)&&q(Fr.length===1||ge.webgl_draw_buffers,"multiple render targets not supported")),Fr||("colorCount"in jr&&(Si=jr.colorCount|0,q(Si>0,"invalid color buffer count")),"colorType"in jr&&(q.oneOf(jr.colorType,nn,"invalid color type"),ki=jr.colorType),"colorFormat"in jr&&(Qr=jr.colorFormat,q.oneOf(jr.colorFormat,tn,"invalid color format for texture"))),"depth"in jr&&($r.depth=jr.depth),"stencil"in jr&&($r.stencil=jr.stencil),"depthStencil"in jr&&($r.depthStencil=jr.depthStencil)}var Ko;if(Fr)if(Array.isArray(Fr))for(Ko=[],Un=0;Un<Fr.length;++Un)Ko[Un]=Fr[Un];else Ko=[Fr];else{Ko=Array(Si);var Pi={radius:Or,format:Qr,type:ki};for(Un=0;Un<Si;++Un)Ko[Un]=wt.createCube(Pi)}for($r.color=Array(Ko.length),Un=0;Un<Ko.length;++Un){var $i=Ko[Un];q(typeof $i=="function"&&$i._reglType==="textureCube","invalid cube map"),Or=Or||$i.width,q($i.width===Or&&$i.height===Or,"invalid cube map shape"),$r.color[Un]={target:Wl,data:Ko[Un]}}for(Un=0;Un<6;++Un){for(var Qi=0;Qi<Ko.length;++Qi)$r.color[Qi].target=Wl+Un;Un>0&&($r.depth=Zt[0].depth,$r.stencil=Zt[0].stencil,$r.depthStencil=Zt[0].depthStencil),Zt[Un]?Zt[Un]($r):Zt[Un]=xn($r)}return o(Ht,{width:Or,height:Or,color:Ko})}function pr(Dr){var Un,$r=Dr|0;if(q($r>0&&$r<=Ie.maxCubeMapSize,"invalid radius for cube fbo"),$r===Ht.width)return Ht;var Or=Ht.color;for(Un=0;Un<Or.length;++Un)Or[Un].resize($r);for(Un=0;Un<6;++Un)Zt[Un].resize($r);return Ht.width=Ht.height=$r,Ht}return Ht(on),o(Ht,{faces:Zt,resize:pr,_reglType:"framebufferCube",destroy:function(){Zt.forEach(function(Dr){Dr.destroy()})}})}function xr(){Nt.cur=null,Nt.next=null,Nt.dirty=!0,ra(Xt).forEach(function(on){on.framebuffer=K.createFramebuffer(),Yt(on)})}return o(Nt,{getFramebuffer:function(on){if(typeof on=="function"&&on._reglType==="framebuffer"){var Zt=on._framebuffer;if(Zt instanceof kn)return Zt}return null},create:xn,createCube:ar,clear:function(){ra(Xt).forEach(_n)},restore:xr})}var rv=5126,Lp=34962;function bf(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=rv,this.offset=0,this.stride=0,this.divisor=0}function Ip(K,ge,Ie,wt,Dt){for(var yt=Ie.maxAttributes,Nt=new Array(yt),tn=0;tn<yt;++tn)Nt[tn]=new bf;var sn=0,nn={},Mt={Record:bf,scope:{},state:Nt,currentVAO:null,targetVAO:null,restore:hn()?Xt:function(){},createVAO:kn,getVAO:Wt,destroyBuffer:wn,setVAO:hn()?st:St,clear:hn()?ln:function(){}};function wn(Kt){for(var _n=0;_n<Nt.length;++_n){var Yt=Nt[_n];Yt.buffer===Kt&&(K.disableVertexAttribArray(_n),Yt.buffer=null)}}function hn(){return ge.oes_vertex_array_object}function rn(){return ge.angle_instanced_arrays}function Wt(Kt){return typeof Kt=="function"&&Kt._vao?Kt._vao:null}function st(Kt){if(Kt!==Mt.currentVAO){var _n=hn();Kt?_n.bindVertexArrayOES(Kt.vao):_n.bindVertexArrayOES(null),Mt.currentVAO=Kt}}function St(Kt){if(Kt!==Mt.currentVAO){if(Kt)Kt.bindAttrs();else for(var _n=rn(),Yt=0;Yt<Nt.length;++Yt){var xn=Nt[Yt];xn.buffer?(K.enableVertexAttribArray(Yt),K.vertexAttribPointer(Yt,xn.size,xn.type,xn.normalized,xn.stride,xn.offfset),_n&&xn.divisor&&_n.vertexAttribDivisorANGLE(Yt,xn.divisor)):(K.disableVertexAttribArray(Yt),K.vertexAttrib4f(Yt,xn.x,xn.y,xn.z,xn.w))}Mt.currentVAO=Kt}}function ln(){ra(nn).forEach(function(Kt){Kt.destroy()})}function An(){this.id=++sn,this.attributes=[];var Kt=hn();Kt?this.vao=Kt.createVertexArrayOES():this.vao=null,nn[this.id]=this,this.buffers=[]}An.prototype.bindAttrs=function(){for(var Kt=rn(),_n=this.attributes,Yt=0;Yt<_n.length;++Yt){var xn=_n[Yt];xn.buffer?(K.enableVertexAttribArray(Yt),K.bindBuffer(Lp,xn.buffer.buffer),K.vertexAttribPointer(Yt,xn.size,xn.type,xn.normalized,xn.stride,xn.offset),Kt&&xn.divisor&&Kt.vertexAttribDivisorANGLE(Yt,xn.divisor)):(K.disableVertexAttribArray(Yt),K.vertexAttrib4f(Yt,xn.x,xn.y,xn.z,xn.w))}for(var ar=_n.length;ar<yt;++ar)K.disableVertexAttribArray(ar)},An.prototype.refresh=function(){var Kt=hn();Kt&&(Kt.bindVertexArrayOES(this.vao),this.bindAttrs(),Mt.currentVAO=this)},An.prototype.destroy=function(){if(this.vao){var Kt=hn();this===Mt.currentVAO&&(Mt.currentVAO=null,Kt.bindVertexArrayOES(null)),Kt.deleteVertexArrayOES(this.vao),this.vao=null}nn[this.id]&&(delete nn[this.id],wt.vaoCount-=1)};function Xt(){var Kt=hn();Kt&&ra(nn).forEach(function(_n){_n.refresh()})}function kn(Kt){var _n=new An;wt.vaoCount+=1;function Yt(xn){q(Array.isArray(xn),"arguments to vertex array constructor must be an array"),q(xn.length<yt,"too many attributes"),q(xn.length>0,"must specify at least one attribute");var ar={},xr=_n.attributes;xr.length=xn.length;for(var on=0;on<xn.length;++on){var Zt=xn[on],Ht=xr[on]=new bf,pr=Zt.data||Zt;if(Array.isArray(pr)||n(pr)||Ia(pr)){var Dr;_n.buffers[on]&&(Dr=_n.buffers[on],n(pr)&&Dr._buffer.byteLength>=pr.byteLength?Dr.subdata(pr):(Dr.destroy(),_n.buffers[on]=null)),_n.buffers[on]||(Dr=_n.buffers[on]=Dt.create(Zt,Lp,!1,!0)),Ht.buffer=Dt.getBuffer(Dr),Ht.size=Ht.buffer.dimension|0,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1,ar[on]=1}else Dt.getBuffer(Zt)?(Ht.buffer=Dt.getBuffer(Zt),Ht.size=Ht.buffer.dimension|0,Ht.normalized=!1,Ht.type=Ht.buffer.dtype,Ht.offset=0,Ht.stride=0,Ht.divisor=0,Ht.state=1):Dt.getBuffer(Zt.buffer)?(Ht.buffer=Dt.getBuffer(Zt.buffer),Ht.size=(+Zt.size||Ht.buffer.dimension)|0,Ht.normalized=!!Zt.normalized||!1,"type"in Zt?(q.parameter(Zt.type,$a,"invalid buffer type"),Ht.type=$a[Zt.type]):Ht.type=Ht.buffer.dtype,Ht.offset=(Zt.offset||0)|0,Ht.stride=(Zt.stride||0)|0,Ht.divisor=(Zt.divisor||0)|0,Ht.state=1,q(Ht.size>=1&&Ht.size<=4,"size must be between 1 and 4"),q(Ht.offset>=0,"invalid offset"),q(Ht.stride>=0&&Ht.stride<=255,"stride must be between 0 and 255"),q(Ht.divisor>=0,"divisor must be positive"),q(!Ht.divisor||!!ge.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Zt?(q(on>0,"first attribute must not be a constant"),Ht.x=+Zt.x||0,Ht.y=+Zt.y||0,Ht.z=+Zt.z||0,Ht.w=+Zt.w||0,Ht.state=2):q(!1,"invalid attribute spec for location "+on)}for(var Un=0;Un<_n.buffers.length;++Un)!ar[Un]&&_n.buffers[Un]&&(_n.buffers[Un].destroy(),_n.buffers[Un]=null);return _n.refresh(),Yt}return Yt.destroy=function(){for(var xn=0;xn<_n.buffers.length;++xn)_n.buffers[xn]&&_n.buffers[xn].destroy();_n.buffers.length=0,_n.destroy()},Yt._vao=_n,Yt._reglType="vao",Yt(Kt)}return Mt}var Fp=35632,jo=35633,yy=35718,Uo=35721;function Bp(K,ge,Ie,wt){var Dt={},yt={};function Nt(st,St,ln,An){this.name=st,this.id=St,this.location=ln,this.info=An}function tn(st,St){for(var ln=0;ln<st.length;++ln)if(st[ln].id===St.id){st[ln].location=St.location;return}st.push(St)}function sn(st,St,ln){var An=st===Fp?Dt:yt,Xt=An[St];if(!Xt){var kn=ge.str(St);Xt=K.createShader(st),K.shaderSource(Xt,kn),K.compileShader(Xt),q.shaderError(K,Xt,kn,st,ln),An[St]=Xt}return Xt}var nn={},Mt=[],wn=0;function hn(st,St){this.id=wn++,this.fragId=st,this.vertId=St,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,wt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function rn(st,St,ln){var An,Xt,kn=sn(Fp,st.fragId),Kt=sn(jo,st.vertId),_n=st.program=K.createProgram();if(K.attachShader(_n,kn),K.attachShader(_n,Kt),ln)for(An=0;An<ln.length;++An){var Yt=ln[An];K.bindAttribLocation(_n,Yt[0],Yt[1])}K.linkProgram(_n),q.linkError(K,_n,ge.str(st.fragId),ge.str(st.vertId),St);var xn=K.getProgramParameter(_n,yy);wt.profile&&(st.stats.uniformsCount=xn);var ar=st.uniforms;for(An=0;An<xn;++An)if(Xt=K.getActiveUniform(_n,An),Xt)if(Xt.size>1)for(var xr=0;xr<Xt.size;++xr){var on=Xt.name.replace("[0]","["+xr+"]");tn(ar,new Nt(on,ge.id(on),K.getUniformLocation(_n,on),Xt))}else tn(ar,new Nt(Xt.name,ge.id(Xt.name),K.getUniformLocation(_n,Xt.name),Xt));var Zt=K.getProgramParameter(_n,Uo);wt.profile&&(st.stats.attributesCount=Zt);var Ht=st.attributes;for(An=0;An<Zt;++An)Xt=K.getActiveAttrib(_n,An),Xt&&tn(Ht,new Nt(Xt.name,ge.id(Xt.name),K.getAttribLocation(_n,Xt.name),Xt))}wt.profile&&(Ie.getMaxUniformsCount=function(){var st=0;return Mt.forEach(function(St){St.stats.uniformsCount>st&&(st=St.stats.uniformsCount)}),st},Ie.getMaxAttributesCount=function(){var st=0;return Mt.forEach(function(St){St.stats.attributesCount>st&&(st=St.stats.attributesCount)}),st});function Wt(){Dt={},yt={};for(var st=0;st<Mt.length;++st)rn(Mt[st],null,Mt[st].attributes.map(function(St){return[St.location,St.name]}))}return{clear:function(){var st=K.deleteShader.bind(K);ra(Dt).forEach(st),Dt={},ra(yt).forEach(st),yt={},Mt.forEach(function(St){K.deleteProgram(St.program)}),Mt.length=0,nn={},Ie.shaderCount=0},program:function(st,St,ln,An){q.command(st>=0,"missing vertex shader",ln),q.command(St>=0,"missing fragment shader",ln);var Xt=nn[St];Xt||(Xt=nn[St]={});var kn=Xt[st];if(kn&&(kn.refCount++,!An))return kn;var Kt=new hn(St,st);return Ie.shaderCount++,rn(Kt,ln,An),kn||(Xt[st]=Kt),Mt.push(Kt),o(Kt,{destroy:function(){if(Kt.refCount--,Kt.refCount<=0){K.deleteProgram(Kt.program);var _n=Mt.indexOf(Kt);Mt.splice(_n,1),Ie.shaderCount--}Xt[Kt.vertId].refCount<=0&&(K.deleteShader(yt[Kt.vertId]),delete yt[Kt.vertId],delete nn[Kt.fragId][Kt.vertId]),Object.keys(nn[Kt.fragId]).length||(K.deleteShader(Dt[Kt.fragId]),delete Dt[Kt.fragId],delete nn[Kt.fragId])}})},restore:Wt,shader:sn,frag:-1,vert:-1}}var Sg=6408,gc=5121,Ag=3333,vd=5126;function Mg(K,ge,Ie,wt,Dt,yt,Nt){function tn(Mt){var wn;ge.next===null?(q(Dt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),wn=gc):(q(ge.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),wn=ge.next.colorAttachments[0].texture._texture.type,yt.oes_texture_float?(q(wn===gc||wn===vd,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),wn===vd&&q(Nt.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):q(wn===gc,"Reading from a framebuffer is only allowed for the type 'uint8'"));var hn=0,rn=0,Wt=wt.framebufferWidth,st=wt.framebufferHeight,St=null;n(Mt)?St=Mt:Mt&&(q.type(Mt,"object","invalid arguments to regl.read()"),hn=Mt.x|0,rn=Mt.y|0,q(hn>=0&&hn<wt.framebufferWidth,"invalid x offset for regl.read"),q(rn>=0&&rn<wt.framebufferHeight,"invalid y offset for regl.read"),Wt=(Mt.width||wt.framebufferWidth-hn)|0,st=(Mt.height||wt.framebufferHeight-rn)|0,St=Mt.data||null),St&&(wn===gc?q(St instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):wn===vd&&q(St instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),q(Wt>0&&Wt+hn<=wt.framebufferWidth,"invalid width for read pixels"),q(st>0&&st+rn<=wt.framebufferHeight,"invalid height for read pixels"),Ie();var ln=Wt*st*4;return St||(wn===gc?St=new Uint8Array(ln):wn===vd&&(St=St||new Float32Array(ln))),q.isTypedArray(St,"data buffer for regl.read() must be a typedarray"),q(St.byteLength>=ln,"data buffer for regl.read() too small"),K.pixelStorei(Ag,4),K.readPixels(hn,rn,Wt,st,Sg,wn,St),St}function sn(Mt){var wn;return ge.setFBO({framebuffer:Mt.framebuffer},function(){wn=tn(Mt)}),wn}function nn(Mt){return!Mt||!("framebuffer"in Mt)?tn(Mt):sn(Mt)}return nn}function mc(K){return Array.prototype.slice.call(K)}function va(K){return mc(K).join("")}function ds(){var K=0,ge=[],Ie=[];function wt(wn){for(var hn=0;hn<Ie.length;++hn)if(Ie[hn]===wn)return ge[hn];var rn="g"+K++;return ge.push(rn),Ie.push(wn),rn}function Dt(){var wn=[];function hn(){wn.push.apply(wn,mc(arguments))}var rn=[];function Wt(){var st="v"+K++;return rn.push(st),arguments.length>0&&(wn.push(st,"="),wn.push.apply(wn,mc(arguments)),wn.push(";")),st}return o(hn,{def:Wt,toString:function(){return va([rn.length>0?"var "+rn.join(",")+";":"",va(wn)])}})}function yt(){var wn=Dt(),hn=Dt(),rn=wn.toString,Wt=hn.toString;function st(St,ln){hn(St,ln,"=",wn.def(St,ln),";")}return o(function(){wn.apply(wn,mc(arguments))},{def:wn.def,entry:wn,exit:hn,save:st,set:function(St,ln,An){st(St,ln),wn(St,ln,"=",An,";")},toString:function(){return rn()+Wt()}})}function Nt(){var wn=va(arguments),hn=yt(),rn=yt(),Wt=hn.toString,st=rn.toString;return o(hn,{then:function(){return hn.apply(hn,mc(arguments)),this},else:function(){return rn.apply(rn,mc(arguments)),this},toString:function(){var St=st();return St&&(St="else{"+St+"}"),va(["if(",wn,"){",Wt(),"}",St])}})}var tn=Dt(),sn={};function nn(wn,hn){var rn=[];function Wt(){var Xt="a"+rn.length;return rn.push(Xt),Xt}hn=hn||0;for(var st=0;st<hn;++st)Wt();var St=yt(),ln=St.toString,An=sn[wn]=o(St,{arg:Wt,toString:function(){return va(["function(",rn.join(),"){",ln(),"}"])}});return An}function Mt(){var wn=['"use strict";',tn,"return {"];Object.keys(sn).forEach(function(Wt){wn.push('"',Wt,'":',sn[Wt].toString(),",")}),wn.push("}");var hn=va(wn).replace(/;/g,`;
|
||
`).replace(/}/g,`}
|
||
`).replace(/{/g,`{
|
||
`),rn=Function.apply(null,ge.concat(hn));return rn.apply(null,Ie)}return{global:tn,link:wt,block:Dt,proc:nn,scope:yt,cond:Nt,compile:Mt}}var ou="xyzw".split(""),yc=5121,_c=1,bc=2,$p=0,iu=1,wc=2,Up=3,fs=4,wf=5,Ef=6,gd="dither",md="blend.enable",yd="blend.color",Vp="blend.equation",_d="blend.func",ov="depth.enable",Wp="depth.func",Tg="depth.range",iv="depth.mask",ps="colorMask",av="cull.enable",lv="cull.face",sv="frontFace",bd="lineWidth",Ls="polygonOffset.enable",xf="polygonOffset.offset",Gp="sample.alpha",zp="sample.enable",Cu="sample.coverage",Nu="stencil.enable",Rr="stencil.mask",wd="stencil.func",Of="stencil.opFront",hs="stencil.opBack",aa="scissor.enable",Ec="scissor.box",Ti="viewport",ku="profile",tl="framebuffer",Sf="vert",Ra="frag",Fi="elements",Is="primitive",Fs="count",Hp="offset",Qt="instances",xc="vao",Af="Width",Mf="Height",Pu=tl+Af,Oc=tl+Mf,Xp=Ti+Af,uv=Ti+Mf,Sc="drawingBuffer",Tf=Sc+Af,Yp=Sc+Mf,cv=[_d,Vp,wd,Of,hs,Cu,Ti,Ec,xf],Bs=34962,dv=34963,vs=35632,Ru=35633,qp=3553,Cg=34067,Ng=2884,kg=3042,fv=3024,Kp=2960,Cf=2929,Pg=3089,gs=32823,Du=32926,_y=32928,mi=5126,Nf=35664,Ac=35665,kf=35666,Ed=5124,Pf=35667,Rf=35668,Df=35669,Mc=35670,au=35671,ga=35672,Zp=35673,jf=35674,Tc=35675,xd=35676,wa=35678,xi=35680,Lf=4,za=1028,wr=1029,Jp=2304,If=2305,Qp=32775,pv=32776,Rg=519,ju=7680,Dg=0,Cc=1,jg=32774,hv=513,Ff=36160,Lg=36064,Gl={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},lu=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Lu={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Er={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vv={frag:vs,vert:Ru},Od={cw:Jp,ccw:If};function su(K){return Array.isArray(K)||n(K)||Ia(K)}function Bf(K){return K.sort(function(ge,Ie){return ge===Ti?-1:Ie===Ti?1:ge<Ie?-1:1})}function Ha(K,ge,Ie,wt){this.thisDep=K,this.contextDep=ge,this.propDep=Ie,this.append=wt}function ms(K){return K&&!(K.thisDep||K.contextDep||K.propDep)}function Ci(K){return new Ha(!1,!1,!1,K)}function dl(K,ge){var Ie=K.type;if(Ie===$p){var wt=K.data.length;return new Ha(!0,wt>=1,wt>=2,ge)}else if(Ie===fs){var Dt=K.data;return new Ha(Dt.thisDep,Dt.contextDep,Dt.propDep,ge)}else{if(Ie===wf)return new Ha(!1,!1,!1,ge);if(Ie===Ef){for(var yt=!1,Nt=!1,tn=!1,sn=0;sn<K.data.length;++sn){var nn=K.data[sn];if(nn.type===iu)tn=!0;else if(nn.type===wc)Nt=!0;else if(nn.type===Up)yt=!0;else if(nn.type===$p){yt=!0;var Mt=nn.data;Mt>=1&&(Nt=!0),Mt>=2&&(tn=!0)}else nn.type===fs&&(yt=yt||nn.data.thisDep,Nt=Nt||nn.data.contextDep,tn=tn||nn.data.propDep)}return new Ha(yt,Nt,tn,ge)}else return new Ha(Ie===Up,Ie===wc,Ie===iu,ge)}}var zl=new Ha(!1,!1,!1,function(){});function by(K,ge,Ie,wt,Dt,yt,Nt,tn,sn,nn,Mt,wn,hn,rn,Wt){var st=nn.Record,St={add:32774,subtract:32778,"reverse subtract":32779};Ie.ext_blend_minmax&&(St.min=Qp,St.max=pv);var ln=Ie.angle_instanced_arrays,An=Ie.webgl_draw_buffers,Xt={dirty:!0,profile:Wt.profile},kn={},Kt=[],_n={},Yt={};function xn(xe){return xe.replace(".","_")}function ar(xe,de,We){var tt=xn(xe);Kt.push(xe),kn[tt]=Xt[tt]=!!We,_n[tt]=de}function xr(xe,de,We){var tt=xn(xe);Kt.push(xe),Array.isArray(We)?(Xt[tt]=We.slice(),kn[tt]=We.slice()):Xt[tt]=kn[tt]=We,Yt[tt]=de}ar(gd,fv),ar(md,kg),xr(yd,"blendColor",[0,0,0,0]),xr(Vp,"blendEquationSeparate",[jg,jg]),xr(_d,"blendFuncSeparate",[Cc,Dg,Cc,Dg]),ar(ov,Cf,!0),xr(Wp,"depthFunc",hv),xr(Tg,"depthRange",[0,1]),xr(iv,"depthMask",!0),xr(ps,ps,[!0,!0,!0,!0]),ar(av,Ng),xr(lv,"cullFace",wr),xr(sv,sv,If),xr(bd,bd,1),ar(Ls,gs),xr(xf,"polygonOffset",[0,0]),ar(Gp,Du),ar(zp,_y),xr(Cu,"sampleCoverage",[1,!1]),ar(Nu,Kp),xr(Rr,"stencilMask",-1),xr(wd,"stencilFunc",[Rg,0,-1]),xr(Of,"stencilOpSeparate",[za,ju,ju,ju]),xr(hs,"stencilOpSeparate",[wr,ju,ju,ju]),ar(aa,Pg),xr(Ec,"scissor",[0,0,K.drawingBufferWidth,K.drawingBufferHeight]),xr(Ti,Ti,[0,0,K.drawingBufferWidth,K.drawingBufferHeight]);var on={gl:K,context:hn,strings:ge,next:kn,current:Xt,draw:wn,elements:yt,buffer:Dt,shader:Mt,attributes:nn.state,vao:nn,uniforms:sn,framebuffer:tn,extensions:Ie,timer:rn,isBufferArgs:su},Zt={primTypes:Ki,compareFuncs:Lu,blendFuncs:Gl,blendEquations:St,stencilOps:Er,glTypes:$a,orientationType:Od};q.optional(function(){on.isArrayLike=L}),An&&(Zt.backBuffer=[wr],Zt.drawBuffer=Fn(wt.maxDrawbuffers,function(xe){return xe===0?[0]:Fn(xe,function(de){return Lg+de})}));var Ht=0;function pr(){var xe=ds(),de=xe.link,We=xe.global;xe.id=Ht++,xe.batchId="0";var tt=de(on),ct=xe.shared={props:"a0"};Object.keys(on).forEach(function(Ue){ct[Ue]=We.def(tt,".",Ue)}),q.optional(function(){xe.CHECK=de(q),xe.commandStr=q.guessCommand(),xe.command=de(xe.commandStr),xe.assert=function(Ue,be,nt){Ue("if(!(",be,"))",this.CHECK,".commandRaise(",de(nt),",",this.command,");")},Zt.invalidBlendCombinations=lu});var Xe=xe.next={},ze=xe.current={};Object.keys(Yt).forEach(function(Ue){Array.isArray(Xt[Ue])&&(Xe[Ue]=We.def(ct.next,".",Ue),ze[Ue]=We.def(ct.current,".",Ue))});var Qe=xe.constants={};Object.keys(Zt).forEach(function(Ue){Qe[Ue]=We.def(JSON.stringify(Zt[Ue]))}),xe.invoke=function(Ue,be){switch(be.type){case $p:var nt=["this",ct.context,ct.props,xe.batchId];return Ue.def(de(be.data),".call(",nt.slice(0,Math.max(be.data.length+1,4)),")");case iu:return Ue.def(ct.props,be.data);case wc:return Ue.def(ct.context,be.data);case Up:return Ue.def("this",be.data);case fs:return be.data.append(xe,Ue),be.data.ref;case wf:return be.data.toString();case Ef:return be.data.map(function(ot){return xe.invoke(Ue,ot)})}},xe.attribCache={};var Ee={};return xe.scopeAttrib=function(Ue){var be=ge.id(Ue);if(be in Ee)return Ee[be];var nt=nn.scope[be];nt||(nt=nn.scope[be]=new st);var ot=Ee[be]=de(nt);return ot},xe}function Dr(xe){var de=xe.static,We=xe.dynamic,tt;if(ku in de){var ct=!!de[ku];tt=Ci(function(ze,Qe){return ct}),tt.enable=ct}else if(ku in We){var Xe=We[ku];tt=dl(Xe,function(ze,Qe){return ze.invoke(Qe,Xe)})}return tt}function Un(xe,de){var We=xe.static,tt=xe.dynamic;if(tl in We){var ct=We[tl];return ct?(ct=tn.getFramebuffer(ct),q.command(ct,"invalid framebuffer object"),Ci(function(ze,Qe){var Ee=ze.link(ct),Ue=ze.shared;Qe.set(Ue.framebuffer,".next",Ee);var be=Ue.context;return Qe.set(be,"."+Pu,Ee+".width"),Qe.set(be,"."+Oc,Ee+".height"),Ee})):Ci(function(ze,Qe){var Ee=ze.shared;Qe.set(Ee.framebuffer,".next","null");var Ue=Ee.context;return Qe.set(Ue,"."+Pu,Ue+"."+Tf),Qe.set(Ue,"."+Oc,Ue+"."+Yp),"null"})}else if(tl in tt){var Xe=tt[tl];return dl(Xe,function(ze,Qe){var Ee=ze.invoke(Qe,Xe),Ue=ze.shared,be=Ue.framebuffer,nt=Qe.def(be,".getFramebuffer(",Ee,")");q.optional(function(){ze.assert(Qe,"!"+Ee+"||"+nt,"invalid framebuffer object")}),Qe.set(be,".next",nt);var ot=Ue.context;return Qe.set(ot,"."+Pu,nt+"?"+nt+".width:"+ot+"."+Tf),Qe.set(ot,"."+Oc,nt+"?"+nt+".height:"+ot+"."+Yp),nt})}else return null}function $r(xe,de,We){var tt=xe.static,ct=xe.dynamic;function Xe(Ee){if(Ee in tt){var Ue=tt[Ee];q.commandType(Ue,"object","invalid "+Ee,We.commandStr);var be=!0,nt=Ue.x|0,ot=Ue.y|0,m,x;return"width"in Ue?(m=Ue.width|0,q.command(m>=0,"invalid "+Ee,We.commandStr)):be=!1,"height"in Ue?(x=Ue.height|0,q.command(x>=0,"invalid "+Ee,We.commandStr)):be=!1,new Ha(!be&&de&&de.thisDep,!be&&de&&de.contextDep,!be&&de&&de.propDep,function(ne,ce){var Oe=ne.shared.context,Fe=m;"width"in Ue||(Fe=ce.def(Oe,".",Pu,"-",nt));var et=x;return"height"in Ue||(et=ce.def(Oe,".",Oc,"-",ot)),[nt,ot,Fe,et]})}else if(Ee in ct){var C=ct[Ee],G=dl(C,function(ne,ce){var Oe=ne.invoke(ce,C);q.optional(function(){ne.assert(ce,Oe+"&&typeof "+Oe+'==="object"',"invalid "+Ee)});var Fe=ne.shared.context,et=ce.def(Oe,".x|0"),jt=ce.def(Oe,".y|0"),Vt=ce.def('"width" in ',Oe,"?",Oe,".width|0:","(",Fe,".",Pu,"-",et,")"),yn=ce.def('"height" in ',Oe,"?",Oe,".height|0:","(",Fe,".",Oc,"-",jt,")");return q.optional(function(){ne.assert(ce,Vt+">=0&&"+yn+">=0","invalid "+Ee)}),[et,jt,Vt,yn]});return de&&(G.thisDep=G.thisDep||de.thisDep,G.contextDep=G.contextDep||de.contextDep,G.propDep=G.propDep||de.propDep),G}else return de?new Ha(de.thisDep,de.contextDep,de.propDep,function(ne,ce){var Oe=ne.shared.context;return[0,0,ce.def(Oe,".",Pu),ce.def(Oe,".",Oc)]}):null}var ze=Xe(Ti);if(ze){var Qe=ze;ze=new Ha(ze.thisDep,ze.contextDep,ze.propDep,function(Ee,Ue){var be=Qe.append(Ee,Ue),nt=Ee.shared.context;return Ue.set(nt,"."+Xp,be[2]),Ue.set(nt,"."+uv,be[3]),be})}return{viewport:ze,scissor_box:Xe(Ec)}}function Or(xe,de){var We=xe.static,tt=typeof We[Ra]=="string"&&typeof We[Sf]=="string";if(tt){if(Object.keys(de.dynamic).length>0)return null;var ct=de.static,Xe=Object.keys(ct);if(Xe.length>0&&typeof ct[Xe[0]]=="number"){for(var ze=[],Qe=0;Qe<Xe.length;++Qe)q(typeof ct[Xe[Qe]]=="number","must specify all vertex attribute locations when using vaos"),ze.push([ct[Xe[Qe]]|0,Xe[Qe]]);return ze}}return null}function Fr(xe,de,We){var tt=xe.static,ct=xe.dynamic;function Xe(be){if(be in tt){var nt=ge.id(tt[be]);q.optional(function(){Mt.shader(vv[be],nt,q.guessCommand())});var ot=Ci(function(){return nt});return ot.id=nt,ot}else if(be in ct){var m=ct[be];return dl(m,function(x,C){var G=x.invoke(C,m),ne=C.def(x.shared.strings,".id(",G,")");return q.optional(function(){C(x.shared.shader,".shader(",vv[be],",",ne,",",x.command,");")}),ne})}return null}var ze=Xe(Ra),Qe=Xe(Sf),Ee=null,Ue;return ms(ze)&&ms(Qe)?(Ee=Mt.program(Qe.id,ze.id,null,We),Ue=Ci(function(be,nt){return be.link(Ee)})):Ue=new Ha(ze&&ze.thisDep||Qe&&Qe.thisDep,ze&&ze.contextDep||Qe&&Qe.contextDep,ze&&ze.propDep||Qe&&Qe.propDep,function(be,nt){var ot=be.shared.shader,m;ze?m=ze.append(be,nt):m=nt.def(ot,".",Ra);var x;Qe?x=Qe.append(be,nt):x=nt.def(ot,".",Sf);var C=ot+".program("+x+","+m;return q.optional(function(){C+=","+be.command}),nt.def(C+")")}),{frag:ze,vert:Qe,progVar:Ue,program:Ee}}function Qr(xe,de){var We=xe.static,tt=xe.dynamic;function ct(){if(Fi in We){var be=We[Fi];su(be)?be=yt.getElements(yt.create(be,!0)):be&&(be=yt.getElements(be),q.command(be,"invalid elements",de.commandStr));var nt=Ci(function(m,x){if(be){var C=m.link(be);return m.ELEMENTS=C,C}return m.ELEMENTS=null,null});return nt.value=be,nt}else if(Fi in tt){var ot=tt[Fi];return dl(ot,function(m,x){var C=m.shared,G=C.isBufferArgs,ne=C.elements,ce=m.invoke(x,ot),Oe=x.def("null"),Fe=x.def(G,"(",ce,")"),et=m.cond(Fe).then(Oe,"=",ne,".createStream(",ce,");").else(Oe,"=",ne,".getElements(",ce,");");return q.optional(function(){m.assert(et.else,"!"+ce+"||"+Oe,"invalid elements")}),x.entry(et),x.exit(m.cond(Fe).then(ne,".destroyStream(",Oe,");")),m.ELEMENTS=Oe,Oe})}return null}var Xe=ct();function ze(){if(Is in We){var be=We[Is];return q.commandParameter(be,Ki,"invalid primitve",de.commandStr),Ci(function(ot,m){return Ki[be]})}else if(Is in tt){var nt=tt[Is];return dl(nt,function(ot,m){var x=ot.constants.primTypes,C=ot.invoke(m,nt);return q.optional(function(){ot.assert(m,C+" in "+x,"invalid primitive, must be one of "+Object.keys(Ki))}),m.def(x,"[",C,"]")})}else if(Xe)return ms(Xe)?Xe.value?Ci(function(ot,m){return m.def(ot.ELEMENTS,".primType")}):Ci(function(){return Lf}):new Ha(Xe.thisDep,Xe.contextDep,Xe.propDep,function(ot,m){var x=ot.ELEMENTS;return m.def(x,"?",x,".primType:",Lf)});return null}function Qe(be,nt){if(be in We){var ot=We[be]|0;return q.command(!nt||ot>=0,"invalid "+be,de.commandStr),Ci(function(x,C){return nt&&(x.OFFSET=ot),ot})}else if(be in tt){var m=tt[be];return dl(m,function(x,C){var G=x.invoke(C,m);return nt&&(x.OFFSET=G,q.optional(function(){x.assert(C,G+">=0","invalid "+be)})),G})}else if(nt&&Xe)return Ci(function(x,C){return x.OFFSET="0",0});return null}var Ee=Qe(Hp,!0);function Ue(){if(Fs in We){var be=We[Fs]|0;return q.command(typeof be=="number"&&be>=0,"invalid vertex count",de.commandStr),Ci(function(){return be})}else if(Fs in tt){var nt=tt[Fs];return dl(nt,function(x,C){var G=x.invoke(C,nt);return q.optional(function(){x.assert(C,"typeof "+G+'==="number"&&'+G+">=0&&"+G+"===("+G+"|0)","invalid vertex count")}),G})}else if(Xe)if(ms(Xe)){if(Xe)return Ee?new Ha(Ee.thisDep,Ee.contextDep,Ee.propDep,function(x,C){var G=C.def(x.ELEMENTS,".vertCount-",x.OFFSET);return q.optional(function(){x.assert(C,G+">=0","invalid vertex offset/element buffer too small")}),G}):Ci(function(x,C){return C.def(x.ELEMENTS,".vertCount")});var ot=Ci(function(){return-1});return q.optional(function(){ot.MISSING=!0}),ot}else{var m=new Ha(Xe.thisDep||Ee.thisDep,Xe.contextDep||Ee.contextDep,Xe.propDep||Ee.propDep,function(x,C){var G=x.ELEMENTS;return x.OFFSET?C.def(G,"?",G,".vertCount-",x.OFFSET,":-1"):C.def(G,"?",G,".vertCount:-1")});return q.optional(function(){m.DYNAMIC=!0}),m}return null}return{elements:Xe,primitive:ze(),count:Ue(),instances:Qe(Qt,!1),offset:Ee}}function ki(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Kt.forEach(function(Xe){var ze=xn(Xe);function Qe(Ee,Ue){if(Xe in We){var be=Ee(We[Xe]);ct[ze]=Ci(function(){return be})}else if(Xe in tt){var nt=tt[Xe];ct[ze]=dl(nt,function(ot,m){return Ue(ot,m,ot.invoke(m,nt))})}}switch(Xe){case av:case md:case gd:case Nu:case ov:case aa:case Ls:case Gp:case zp:case iv:return Qe(function(Ee){return q.commandType(Ee,"boolean",Xe,de.commandStr),Ee},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,"typeof "+be+'==="boolean"',"invalid flag "+Xe,Ee.commandStr)}),be});case Wp:return Qe(function(Ee){return q.commandParameter(Ee,Lu,"invalid "+Xe,de.commandStr),Lu[Ee]},function(Ee,Ue,be){var nt=Ee.constants.compareFuncs;return q.optional(function(){Ee.assert(Ue,be+" in "+nt,"invalid "+Xe+", must be one of "+Object.keys(Lu))}),Ue.def(nt,"[",be,"]")});case Tg:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===2&&typeof Ee[0]=="number"&&typeof Ee[1]=="number"&&Ee[0]<=Ee[1],"depth range is 2d array",de.commandStr),Ee},function(Ee,Ue,be){q.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===2&&typeof "+be+'[0]==="number"&&typeof '+be+'[1]==="number"&&'+be+"[0]<="+be+"[1]","depth range must be a 2d array")});var nt=Ue.def("+",be,"[0]"),ot=Ue.def("+",be,"[1]");return[nt,ot]});case _d:return Qe(function(Ee){q.commandType(Ee,"object","blend.func",de.commandStr);var Ue="srcRGB"in Ee?Ee.srcRGB:Ee.src,be="srcAlpha"in Ee?Ee.srcAlpha:Ee.src,nt="dstRGB"in Ee?Ee.dstRGB:Ee.dst,ot="dstAlpha"in Ee?Ee.dstAlpha:Ee.dst;return q.commandParameter(Ue,Gl,ze+".srcRGB",de.commandStr),q.commandParameter(be,Gl,ze+".srcAlpha",de.commandStr),q.commandParameter(nt,Gl,ze+".dstRGB",de.commandStr),q.commandParameter(ot,Gl,ze+".dstAlpha",de.commandStr),q.command(lu.indexOf(Ue+", "+nt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Ue+", "+nt+")",de.commandStr),[Gl[Ue],Gl[nt],Gl[be],Gl[ot]]},function(Ee,Ue,be){var nt=Ee.constants.blendFuncs;q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid blend func, must be an object")});function ot(Oe,Fe){var et=Ue.def('"',Oe,Fe,'" in ',be,"?",be,".",Oe,Fe,":",be,".",Oe);return q.optional(function(){Ee.assert(Ue,et+" in "+nt,"invalid "+Xe+"."+Oe+Fe+", must be one of "+Object.keys(Gl))}),et}var m=ot("src","RGB"),x=ot("dst","RGB");q.optional(function(){var Oe=Ee.constants.invalidBlendCombinations;Ee.assert(Ue,Oe+".indexOf("+m+'+", "+'+x+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var C=Ue.def(nt,"[",m,"]"),G=Ue.def(nt,"[",ot("src","Alpha"),"]"),ne=Ue.def(nt,"[",x,"]"),ce=Ue.def(nt,"[",ot("dst","Alpha"),"]");return[C,ne,G,ce]});case Vp:return Qe(function(Ee){if(typeof Ee=="string")return q.commandParameter(Ee,St,"invalid "+Xe,de.commandStr),[St[Ee],St[Ee]];if(typeof Ee=="object")return q.commandParameter(Ee.rgb,St,Xe+".rgb",de.commandStr),q.commandParameter(Ee.alpha,St,Xe+".alpha",de.commandStr),[St[Ee.rgb],St[Ee.alpha]];q.commandRaise("invalid blend.equation",de.commandStr)},function(Ee,Ue,be){var nt=Ee.constants.blendEquations,ot=Ue.def(),m=Ue.def(),x=Ee.cond("typeof ",be,'==="string"');return q.optional(function(){function C(G,ne,ce){Ee.assert(G,ce+" in "+nt,"invalid "+ne+", must be one of "+Object.keys(St))}C(x.then,Xe,be),Ee.assert(x.else,be+"&&typeof "+be+'==="object"',"invalid "+Xe),C(x.else,Xe+".rgb",be+".rgb"),C(x.else,Xe+".alpha",be+".alpha")}),x.then(ot,"=",m,"=",nt,"[",be,"];"),x.else(ot,"=",nt,"[",be,".rgb];",m,"=",nt,"[",be,".alpha];"),Ue(x),[ot,m]});case yd:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===4,"blend.color must be a 4d array",de.commandStr),Fn(4,function(Ue){return+Ee[Ue]})},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===4","blend.color must be a 4d array")}),Fn(4,function(nt){return Ue.def("+",be,"[",nt,"]")})});case Rr:return Qe(function(Ee){return q.commandType(Ee,"number",ze,de.commandStr),Ee|0},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,"typeof "+be+'==="number"',"invalid stencil.mask")}),Ue.def(be,"|0")});case wd:return Qe(function(Ee){q.commandType(Ee,"object",ze,de.commandStr);var Ue=Ee.cmp||"keep",be=Ee.ref||0,nt="mask"in Ee?Ee.mask:-1;return q.commandParameter(Ue,Lu,Xe+".cmp",de.commandStr),q.commandType(be,"number",Xe+".ref",de.commandStr),q.commandType(nt,"number",Xe+".mask",de.commandStr),[Lu[Ue],be,nt]},function(Ee,Ue,be){var nt=Ee.constants.compareFuncs;q.optional(function(){function C(){Ee.assert(Ue,Array.prototype.join.call(arguments,""),"invalid stencil.func")}C(be+"&&typeof ",be,'==="object"'),C('!("cmp" in ',be,")||(",be,".cmp in ",nt,")")});var ot=Ue.def('"cmp" in ',be,"?",nt,"[",be,".cmp]",":",ju),m=Ue.def(be,".ref|0"),x=Ue.def('"mask" in ',be,"?",be,".mask|0:-1");return[ot,m,x]});case Of:case hs:return Qe(function(Ee){q.commandType(Ee,"object",ze,de.commandStr);var Ue=Ee.fail||"keep",be=Ee.zfail||"keep",nt=Ee.zpass||"keep";return q.commandParameter(Ue,Er,Xe+".fail",de.commandStr),q.commandParameter(be,Er,Xe+".zfail",de.commandStr),q.commandParameter(nt,Er,Xe+".zpass",de.commandStr),[Xe===hs?wr:za,Er[Ue],Er[be],Er[nt]]},function(Ee,Ue,be){var nt=Ee.constants.stencilOps;q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid "+Xe)});function ot(m){return q.optional(function(){Ee.assert(Ue,'!("'+m+'" in '+be+")||("+be+"."+m+" in "+nt+")","invalid "+Xe+"."+m+", must be one of "+Object.keys(Er))}),Ue.def('"',m,'" in ',be,"?",nt,"[",be,".",m,"]:",ju)}return[Xe===hs?wr:za,ot("fail"),ot("zfail"),ot("zpass")]});case xf:return Qe(function(Ee){q.commandType(Ee,"object",ze,de.commandStr);var Ue=Ee.factor|0,be=Ee.units|0;return q.commandType(Ue,"number",ze+".factor",de.commandStr),q.commandType(be,"number",ze+".units",de.commandStr),[Ue,be]},function(Ee,Ue,be){q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid "+Xe)});var nt=Ue.def(be,".factor|0"),ot=Ue.def(be,".units|0");return[nt,ot]});case lv:return Qe(function(Ee){var Ue=0;return Ee==="front"?Ue=za:Ee==="back"&&(Ue=wr),q.command(!!Ue,ze,de.commandStr),Ue},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,be+'==="front"||'+be+'==="back"',"invalid cull.face")}),Ue.def(be,'==="front"?',za,":",wr)});case bd:return Qe(function(Ee){return q.command(typeof Ee=="number"&&Ee>=wt.lineWidthDims[0]&&Ee<=wt.lineWidthDims[1],"invalid line width, must be a positive number between "+wt.lineWidthDims[0]+" and "+wt.lineWidthDims[1],de.commandStr),Ee},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,"typeof "+be+'==="number"&&'+be+">="+wt.lineWidthDims[0]+"&&"+be+"<="+wt.lineWidthDims[1],"invalid line width")}),be});case sv:return Qe(function(Ee){return q.commandParameter(Ee,Od,ze,de.commandStr),Od[Ee]},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,be+'==="cw"||'+be+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),Ue.def(be+'==="cw"?'+Jp+":"+If)});case ps:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===4,"color.mask must be length 4 array",de.commandStr),Ee.map(function(Ue){return!!Ue})},function(Ee,Ue,be){return q.optional(function(){Ee.assert(Ue,Ee.shared.isArrayLike+"("+be+")&&"+be+".length===4","invalid color.mask")}),Fn(4,function(nt){return"!!"+be+"["+nt+"]"})});case Cu:return Qe(function(Ee){q.command(typeof Ee=="object"&&Ee,ze,de.commandStr);var Ue="value"in Ee?Ee.value:1,be=!!Ee.invert;return q.command(typeof Ue=="number"&&Ue>=0&&Ue<=1,"sample.coverage.value must be a number between 0 and 1",de.commandStr),[Ue,be]},function(Ee,Ue,be){q.optional(function(){Ee.assert(Ue,be+"&&typeof "+be+'==="object"',"invalid sample.coverage")});var nt=Ue.def('"value" in ',be,"?+",be,".value:1"),ot=Ue.def("!!",be,".invert");return[nt,ot]})}}),ct}function Si(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Object.keys(We).forEach(function(Xe){var ze=We[Xe],Qe;if(typeof ze=="number"||typeof ze=="boolean")Qe=Ci(function(){return ze});else if(typeof ze=="function"){var Ee=ze._reglType;Ee==="texture2d"||Ee==="textureCube"?Qe=Ci(function(Ue){return Ue.link(ze)}):Ee==="framebuffer"||Ee==="framebufferCube"?(q.command(ze.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Xe+'"',de.commandStr),Qe=Ci(function(Ue){return Ue.link(ze.color[0])})):q.commandRaise('invalid data for uniform "'+Xe+'"',de.commandStr)}else L(ze)?Qe=Ci(function(Ue){var be=Ue.global.def("[",Fn(ze.length,function(nt){return q.command(typeof ze[nt]=="number"||typeof ze[nt]=="boolean","invalid uniform "+Xe,Ue.commandStr),ze[nt]}),"]");return be}):q.commandRaise('invalid or missing data for uniform "'+Xe+'"',de.commandStr);Qe.value=ze,ct[Xe]=Qe}),Object.keys(tt).forEach(function(Xe){var ze=tt[Xe];ct[Xe]=dl(ze,function(Qe,Ee){return Qe.invoke(Ee,ze)})}),ct}function jr(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Object.keys(We).forEach(function(Xe){var ze=We[Xe],Qe=ge.id(Xe),Ee=new st;if(su(ze))Ee.state=_c,Ee.buffer=Dt.getBuffer(Dt.create(ze,Bs,!1,!0)),Ee.type=0;else{var Ue=Dt.getBuffer(ze);if(Ue)Ee.state=_c,Ee.buffer=Ue,Ee.type=0;else if(q.command(typeof ze=="object"&&ze,"invalid data for attribute "+Xe,de.commandStr),"constant"in ze){var be=ze.constant;Ee.buffer="null",Ee.state=bc,typeof be=="number"?Ee.x=be:(q.command(L(be)&&be.length>0&&be.length<=4,"invalid constant for attribute "+Xe,de.commandStr),ou.forEach(function(ne,ce){ce<be.length&&(Ee[ne]=be[ce])}))}else{su(ze.buffer)?Ue=Dt.getBuffer(Dt.create(ze.buffer,Bs,!1,!0)):Ue=Dt.getBuffer(ze.buffer),q.command(!!Ue,'missing buffer for attribute "'+Xe+'"',de.commandStr);var nt=ze.offset|0;q.command(nt>=0,'invalid offset for attribute "'+Xe+'"',de.commandStr);var ot=ze.stride|0;q.command(ot>=0&&ot<256,'invalid stride for attribute "'+Xe+'", must be integer betweeen [0, 255]',de.commandStr);var m=ze.size|0;q.command(!("size"in ze)||m>0&&m<=4,'invalid size for attribute "'+Xe+'", must be 1,2,3,4',de.commandStr);var x=!!ze.normalized,C=0;"type"in ze&&(q.commandParameter(ze.type,$a,"invalid type for attribute "+Xe,de.commandStr),C=$a[ze.type]);var G=ze.divisor|0;"divisor"in ze&&(q.command(G===0||ln,'cannot specify divisor for attribute "'+Xe+'", instancing not supported',de.commandStr),q.command(G>=0,'invalid divisor for attribute "'+Xe+'"',de.commandStr)),q.optional(function(){var ne=de.commandStr,ce=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(ze).forEach(function(Oe){q.command(ce.indexOf(Oe)>=0,'unknown parameter "'+Oe+'" for attribute pointer "'+Xe+'" (valid parameters are '+ce+")",ne)})}),Ee.buffer=Ue,Ee.state=_c,Ee.size=m,Ee.normalized=x,Ee.type=C||Ue.dtype,Ee.offset=nt,Ee.stride=ot,Ee.divisor=G}}ct[Xe]=Ci(function(ne,ce){var Oe=ne.attribCache;if(Qe in Oe)return Oe[Qe];var Fe={isStream:!1};return Object.keys(Ee).forEach(function(et){Fe[et]=Ee[et]}),Ee.buffer&&(Fe.buffer=ne.link(Ee.buffer),Fe.type=Fe.type||Fe.buffer+".dtype"),Oe[Qe]=Fe,Fe})}),Object.keys(tt).forEach(function(Xe){var ze=tt[Xe];function Qe(Ee,Ue){var be=Ee.invoke(Ue,ze),nt=Ee.shared,ot=Ee.constants,m=nt.isBufferArgs,x=nt.buffer;q.optional(function(){Ee.assert(Ue,be+"&&(typeof "+be+'==="object"||typeof '+be+'==="function")&&('+m+"("+be+")||"+x+".getBuffer("+be+")||"+x+".getBuffer("+be+".buffer)||"+m+"("+be+'.buffer)||("constant" in '+be+"&&(typeof "+be+'.constant==="number"||'+nt.isArrayLike+"("+be+".constant))))",'invalid dynamic attribute "'+Xe+'"')});var C={isStream:Ue.def(!1)},G=new st;G.state=_c,Object.keys(G).forEach(function(Fe){C[Fe]=Ue.def(""+G[Fe])});var ne=C.buffer,ce=C.type;Ue("if(",m,"(",be,")){",C.isStream,"=true;",ne,"=",x,".createStream(",Bs,",",be,");",ce,"=",ne,".dtype;","}else{",ne,"=",x,".getBuffer(",be,");","if(",ne,"){",ce,"=",ne,".dtype;",'}else if("constant" in ',be,"){",C.state,"=",bc,";","if(typeof "+be+'.constant === "number"){',C[ou[0]],"=",be,".constant;",ou.slice(1).map(function(Fe){return C[Fe]}).join("="),"=0;","}else{",ou.map(function(Fe,et){return C[Fe]+"="+be+".constant.length>"+et+"?"+be+".constant["+et+"]:0;"}).join(""),"}}else{","if(",m,"(",be,".buffer)){",ne,"=",x,".createStream(",Bs,",",be,".buffer);","}else{",ne,"=",x,".getBuffer(",be,".buffer);","}",ce,'="type" in ',be,"?",ot.glTypes,"[",be,".type]:",ne,".dtype;",C.normalized,"=!!",be,".normalized;");function Oe(Fe){Ue(C[Fe],"=",be,".",Fe,"|0;")}return Oe("size"),Oe("offset"),Oe("stride"),Oe("divisor"),Ue("}}"),Ue.exit("if(",C.isStream,"){",x,".destroyStream(",ne,");","}"),C}ct[Xe]=dl(ze,Qe)}),ct}function Gi(xe,de){var We=xe.static,tt=xe.dynamic;if(xc in We){var ct=We[xc];return ct!==null&&nn.getVAO(ct)===null&&(ct=nn.createVAO(ct)),Ci(function(ze){return ze.link(nn.getVAO(ct))})}else if(xc in tt){var Xe=tt[xc];return dl(Xe,function(ze,Qe){var Ee=ze.invoke(Qe,Xe);return Qe.def(ze.shared.vao+".getVAO("+Ee+")")})}return null}function Ko(xe){var de=xe.static,We=xe.dynamic,tt={};return Object.keys(de).forEach(function(ct){var Xe=de[ct];tt[ct]=Ci(function(ze,Qe){return typeof Xe=="number"||typeof Xe=="boolean"?""+Xe:ze.link(Xe)})}),Object.keys(We).forEach(function(ct){var Xe=We[ct];tt[ct]=dl(Xe,function(ze,Qe){return ze.invoke(Qe,Xe)})}),tt}function Pi(xe,de,We,tt,ct){var Xe=xe.static,ze=xe.dynamic;q.optional(function(){var Oe=[tl,Sf,Ra,Fi,Is,Hp,Fs,Qt,ku,xc].concat(Kt);function Fe(et){Object.keys(et).forEach(function(jt){q.command(Oe.indexOf(jt)>=0,'unknown parameter "'+jt+'"',ct.commandStr)})}Fe(Xe),Fe(ze)});var Qe=Or(xe,de),Ee=Un(xe),Ue=$r(xe,Ee,ct),be=Qr(xe,ct),nt=ki(xe,ct),ot=Fr(xe,ct,Qe);function m(Oe){var Fe=Ue[Oe];Fe&&(nt[Oe]=Fe)}m(Ti),m(xn(Ec));var x=Object.keys(nt).length>0,C={framebuffer:Ee,draw:be,shader:ot,state:nt,dirty:x,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=Dr(xe),C.uniforms=Si(We,ct),C.drawVAO=C.scopeVAO=Gi(xe),!C.drawVAO&&ot.program&&!Qe&&Ie.angle_instanced_arrays){var G=!0,ne=ot.program.attributes.map(function(Oe){var Fe=de.static[Oe];return G=G&&!!Fe,Fe});if(G&&ne.length>0){var ce=nn.getVAO(nn.createVAO(ne));C.drawVAO=new Ha(null,null,null,function(Oe,Fe){return Oe.link(ce)}),C.useVAO=!0}}return Qe?C.useVAO=!0:C.attributes=jr(de,ct),C.context=Ko(tt),C}function $i(xe,de,We){var tt=xe.shared,ct=tt.context,Xe=xe.scope();Object.keys(We).forEach(function(ze){de.save(ct,"."+ze);var Qe=We[ze],Ee=Qe.append(xe,de);Array.isArray(Ee)?Xe(ct,".",ze,"=[",Ee.join(),"];"):Xe(ct,".",ze,"=",Ee,";")}),de(Xe)}function Qi(xe,de,We,tt){var ct=xe.shared,Xe=ct.gl,ze=ct.framebuffer,Qe;An&&(Qe=de.def(ct.extensions,".webgl_draw_buffers"));var Ee=xe.constants,Ue=Ee.drawBuffer,be=Ee.backBuffer,nt;We?nt=We.append(xe,de):nt=de.def(ze,".next"),tt||de("if(",nt,"!==",ze,".cur){"),de("if(",nt,"){",Xe,".bindFramebuffer(",Ff,",",nt,".framebuffer);"),An&&de(Qe,".drawBuffersWEBGL(",Ue,"[",nt,".colorAttachments.length]);"),de("}else{",Xe,".bindFramebuffer(",Ff,",null);"),An&&de(Qe,".drawBuffersWEBGL(",be,");"),de("}",ze,".cur=",nt,";"),tt||de("}")}function la(xe,de,We){var tt=xe.shared,ct=tt.gl,Xe=xe.current,ze=xe.next,Qe=tt.current,Ee=tt.next,Ue=xe.cond(Qe,".dirty");Kt.forEach(function(be){var nt=xn(be);if(!(nt in We.state)){var ot,m;if(nt in ze){ot=ze[nt],m=Xe[nt];var x=Fn(Xt[nt].length,function(G){return Ue.def(ot,"[",G,"]")});Ue(xe.cond(x.map(function(G,ne){return G+"!=="+m+"["+ne+"]"}).join("||")).then(ct,".",Yt[nt],"(",x,");",x.map(function(G,ne){return m+"["+ne+"]="+G}).join(";"),";"))}else{ot=Ue.def(Ee,".",nt);var C=xe.cond(ot,"!==",Qe,".",nt);Ue(C),nt in _n?C(xe.cond(ot).then(ct,".enable(",_n[nt],");").else(ct,".disable(",_n[nt],");"),Qe,".",nt,"=",ot,";"):C(ct,".",Yt[nt],"(",ot,");",Qe,".",nt,"=",ot,";")}}}),Object.keys(We.state).length===0&&Ue(Qe,".dirty=false;"),de(Ue)}function zi(xe,de,We,tt){var ct=xe.shared,Xe=xe.current,ze=ct.current,Qe=ct.gl;Bf(Object.keys(We)).forEach(function(Ee){var Ue=We[Ee];if(!(tt&&!tt(Ue))){var be=Ue.append(xe,de);if(_n[Ee]){var nt=_n[Ee];ms(Ue)?be?de(Qe,".enable(",nt,");"):de(Qe,".disable(",nt,");"):de(xe.cond(be).then(Qe,".enable(",nt,");").else(Qe,".disable(",nt,");")),de(ze,".",Ee,"=",be,";")}else if(L(be)){var ot=Xe[Ee];de(Qe,".",Yt[Ee],"(",be,");",be.map(function(m,x){return ot+"["+x+"]="+m}).join(";"),";")}else de(Qe,".",Yt[Ee],"(",be,");",ze,".",Ee,"=",be,";")}})}function di(xe,de){ln&&(xe.instancing=de.def(xe.shared.extensions,".angle_instanced_arrays"))}function Cr(xe,de,We,tt,ct){var Xe=xe.shared,ze=xe.stats,Qe=Xe.current,Ee=Xe.timer,Ue=We.profile;function be(){return typeof performance>"u"?"Date.now()":"performance.now()"}var nt,ot;function m(Oe){nt=de.def(),Oe(nt,"=",be(),";"),typeof ct=="string"?Oe(ze,".count+=",ct,";"):Oe(ze,".count++;"),rn&&(tt?(ot=de.def(),Oe(ot,"=",Ee,".getNumPendingQueries();")):Oe(Ee,".beginQuery(",ze,");"))}function x(Oe){Oe(ze,".cpuTime+=",be(),"-",nt,";"),rn&&(tt?Oe(Ee,".pushScopeStats(",ot,",",Ee,".getNumPendingQueries(),",ze,");"):Oe(Ee,".endQuery();"))}function C(Oe){var Fe=de.def(Qe,".profile");de(Qe,".profile=",Oe,";"),de.exit(Qe,".profile=",Fe,";")}var G;if(Ue){if(ms(Ue)){Ue.enable?(m(de),x(de.exit),C("true")):C("false");return}G=Ue.append(xe,de),C(G)}else G=de.def(Qe,".profile");var ne=xe.block();m(ne),de("if(",G,"){",ne,"}");var ce=xe.block();x(ce),de.exit("if(",G,"){",ce,"}")}function sa(xe,de,We,tt,ct){var Xe=xe.shared;function ze(Ee){switch(Ee){case Nf:case Pf:case au:return 2;case Ac:case Rf:case ga:return 3;case kf:case Df:case Zp:return 4;default:return 1}}function Qe(Ee,Ue,be){var nt=Xe.gl,ot=de.def(Ee,".location"),m=de.def(Xe.attributes,"[",ot,"]"),x=be.state,C=be.buffer,G=[be.x,be.y,be.z,be.w],ne=["buffer","normalized","offset","stride"];function ce(){de("if(!",m,".buffer){",nt,".enableVertexAttribArray(",ot,");}");var Fe=be.type,et;if(be.size?et=de.def(be.size,"||",Ue):et=Ue,de("if(",m,".type!==",Fe,"||",m,".size!==",et,"||",ne.map(function(Vt){return m+"."+Vt+"!=="+be[Vt]}).join("||"),"){",nt,".bindBuffer(",Bs,",",C,".buffer);",nt,".vertexAttribPointer(",[ot,et,Fe,be.normalized,be.stride,be.offset],");",m,".type=",Fe,";",m,".size=",et,";",ne.map(function(Vt){return m+"."+Vt+"="+be[Vt]+";"}).join(""),"}"),ln){var jt=be.divisor;de("if(",m,".divisor!==",jt,"){",xe.instancing,".vertexAttribDivisorANGLE(",[ot,jt],");",m,".divisor=",jt,";}")}}function Oe(){de("if(",m,".buffer){",nt,".disableVertexAttribArray(",ot,");",m,".buffer=null;","}if(",ou.map(function(Fe,et){return m+"."+Fe+"!=="+G[et]}).join("||"),"){",nt,".vertexAttrib4f(",ot,",",G,");",ou.map(function(Fe,et){return m+"."+Fe+"="+G[et]+";"}).join(""),"}")}x===_c?ce():x===bc?Oe():(de("if(",x,"===",_c,"){"),ce(),de("}else{"),Oe(),de("}"))}tt.forEach(function(Ee){var Ue=Ee.name,be=We.attributes[Ue],nt;if(be){if(!ct(be))return;nt=be.append(xe,de)}else{if(!ct(zl))return;var ot=xe.scopeAttrib(Ue);q.optional(function(){xe.assert(de,ot+".state","missing attribute "+Ue)}),nt={},Object.keys(new st).forEach(function(m){nt[m]=de.def(ot,".",m)})}Qe(xe.link(Ee),ze(Ee.info.type),nt)})}function co(xe,de,We,tt,ct){for(var Xe=xe.shared,ze=Xe.gl,Qe,Ee=0;Ee<tt.length;++Ee){var Ue=tt[Ee],be=Ue.name,nt=Ue.info.type,ot=We.uniforms[be],m=xe.link(Ue),x=m+".location",C;if(ot){if(!ct(ot))continue;if(ms(ot)){var G=ot.value;if(q.command(G!==null&&typeof G<"u",'missing uniform "'+be+'"',xe.commandStr),nt===wa||nt===xi){q.command(typeof G=="function"&&(nt===wa&&(G._reglType==="texture2d"||G._reglType==="framebuffer")||nt===xi&&(G._reglType==="textureCube"||G._reglType==="framebufferCube")),"invalid texture for uniform "+be,xe.commandStr);var ne=xe.link(G._texture||G.color[0]._texture);de(ze,".uniform1i(",x,",",ne+".bind());"),de.exit(ne,".unbind();")}else if(nt===jf||nt===Tc||nt===xd){q.optional(function(){q.command(L(G),"invalid matrix for uniform "+be,xe.commandStr),q.command(nt===jf&&G.length===4||nt===Tc&&G.length===9||nt===xd&&G.length===16,"invalid length for matrix uniform "+be,xe.commandStr)});var ce=xe.global.def("new Float32Array(["+Array.prototype.slice.call(G)+"])"),Oe=2;nt===Tc?Oe=3:nt===xd&&(Oe=4),de(ze,".uniformMatrix",Oe,"fv(",x,",false,",ce,");")}else{switch(nt){case mi:q.commandType(G,"number","uniform "+be,xe.commandStr),Qe="1f";break;case Nf:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2f";break;case Ac:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3f";break;case kf:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4f";break;case Mc:q.commandType(G,"boolean","uniform "+be,xe.commandStr),Qe="1i";break;case Ed:q.commandType(G,"number","uniform "+be,xe.commandStr),Qe="1i";break;case au:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case Pf:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case ga:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3i";break;case Rf:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3i";break;case Zp:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4i";break;case Df:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4i";break}de(ze,".uniform",Qe,"(",x,",",L(G)?Array.prototype.slice.call(G):G,");")}continue}else C=ot.append(xe,de)}else{if(!ct(zl))continue;C=de.def(Xe.uniforms,"[",ge.id(be),"]")}nt===wa?(q(!Array.isArray(C),"must specify a scalar prop for textures"),de("if(",C,"&&",C,'._reglType==="framebuffer"){',C,"=",C,".color[0];","}")):nt===xi&&(q(!Array.isArray(C),"must specify a scalar prop for cube maps"),de("if(",C,"&&",C,'._reglType==="framebufferCube"){',C,"=",C,".color[0];","}")),q.optional(function(){function yn(an,Tn){xe.assert(de,an,'bad data or missing for uniform "'+be+'". '+Tn)}function Yn(an){q(!Array.isArray(C),"must not specify an array type for uniform"),yn("typeof "+C+'==="'+an+'"',"invalid type, expected "+an)}function Qn(an,Tn){Array.isArray(C)?q(C.length===an,"must have length "+an):yn(Xe.isArrayLike+"("+C+")&&"+C+".length==="+an,"invalid vector, should have length "+an,xe.commandStr)}function Sr(an){q(!Array.isArray(C),"must not specify a value type"),yn("typeof "+C+'==="function"&&'+C+'._reglType==="texture'+(an===qp?"2d":"Cube")+'"',"invalid texture type",xe.commandStr)}switch(nt){case Ed:Yn("number");break;case Pf:Qn(2);break;case Rf:Qn(3);break;case Df:Qn(4);break;case mi:Yn("number");break;case Nf:Qn(2);break;case Ac:Qn(3);break;case kf:Qn(4);break;case Mc:Yn("boolean");break;case au:Qn(2);break;case ga:Qn(3);break;case Zp:Qn(4);break;case jf:Qn(4);break;case Tc:Qn(9);break;case xd:Qn(16);break;case wa:Sr(qp);break;case xi:Sr(Cg);break}});var Fe=1;switch(nt){case wa:case xi:var et=de.def(C,"._texture");de(ze,".uniform1i(",x,",",et,".bind());"),de.exit(et,".unbind();");continue;case Ed:case Mc:Qe="1i";break;case Pf:case au:Qe="2i",Fe=2;break;case Rf:case ga:Qe="3i",Fe=3;break;case Df:case Zp:Qe="4i",Fe=4;break;case mi:Qe="1f";break;case Nf:Qe="2f",Fe=2;break;case Ac:Qe="3f",Fe=3;break;case kf:Qe="4f",Fe=4;break;case jf:Qe="Matrix2fv";break;case Tc:Qe="Matrix3fv";break;case xd:Qe="Matrix4fv";break}if(de(ze,".uniform",Qe,"(",x,","),Qe.charAt(0)==="M"){var jt=Math.pow(nt-jf+2,2),Vt=xe.global.def("new Float32Array(",jt,")");Array.isArray(C)?de("false,(",Fn(jt,function(yn){return Vt+"["+yn+"]="+C[yn]}),",",Vt,")"):de("false,(Array.isArray(",C,")||",C," instanceof Float32Array)?",C,":(",Fn(jt,function(yn){return Vt+"["+yn+"]="+C+"["+yn+"]"}),",",Vt,")")}else Fe>1?de(Fn(Fe,function(yn){return Array.isArray(C)?C[yn]:C+"["+yn+"]"})):(q(!Array.isArray(C),"uniform value must not be an array"),de(C));de(");")}}function cr(xe,de,We,tt){var ct=xe.shared,Xe=ct.gl,ze=ct.draw,Qe=tt.draw;function Ee(){var et=Qe.elements,jt,Vt=de;return et?((et.contextDep&&tt.contextDynamic||et.propDep)&&(Vt=We),jt=et.append(xe,Vt)):jt=Vt.def(ze,".",Fi),jt&&Vt("if("+jt+")"+Xe+".bindBuffer("+dv+","+jt+".buffer.buffer);"),jt}function Ue(){var et=Qe.count,jt,Vt=de;return et?((et.contextDep&&tt.contextDynamic||et.propDep)&&(Vt=We),jt=et.append(xe,Vt),q.optional(function(){et.MISSING&&xe.assert(de,"false","missing vertex count"),et.DYNAMIC&&xe.assert(Vt,jt+">=0","missing vertex count")})):(jt=Vt.def(ze,".",Fs),q.optional(function(){xe.assert(Vt,jt+">=0","missing vertex count")})),jt}var be=Ee();function nt(et){var jt=Qe[et];return jt?jt.contextDep&&tt.contextDynamic||jt.propDep?jt.append(xe,We):jt.append(xe,de):de.def(ze,".",et)}var ot=nt(Is),m=nt(Hp),x=Ue();if(typeof x=="number"){if(x===0)return}else We("if(",x,"){"),We.exit("}");var C,G;ln&&(C=nt(Qt),G=xe.instancing);var ne=be+".type",ce=Qe.elements&&ms(Qe.elements);function Oe(){function et(){We(G,".drawElementsInstancedANGLE(",[ot,x,ne,m+"<<(("+ne+"-"+yc+")>>1)",C],");")}function jt(){We(G,".drawArraysInstancedANGLE(",[ot,m,x,C],");")}be?ce?et():(We("if(",be,"){"),et(),We("}else{"),jt(),We("}")):jt()}function Fe(){function et(){We(Xe+".drawElements("+[ot,x,ne,m+"<<(("+ne+"-"+yc+")>>1)"]+");")}function jt(){We(Xe+".drawArrays("+[ot,m,x]+");")}be?ce?et():(We("if(",be,"){"),et(),We("}else{"),jt(),We("}")):jt()}ln&&(typeof C!="number"||C>=0)?typeof C=="string"?(We("if(",C,">0){"),Oe(),We("}else if(",C,"<0){"),Fe(),We("}")):Oe():Fe()}function Xr(xe,de,We,tt,ct){var Xe=pr(),ze=Xe.proc("body",ct);return q.optional(function(){Xe.commandStr=de.commandStr,Xe.command=Xe.link(de.commandStr)}),ln&&(Xe.instancing=ze.def(Xe.shared.extensions,".angle_instanced_arrays")),xe(Xe,ze,We,tt),Xe.compile().body}function Nr(xe,de,We,tt){di(xe,de),We.useVAO?We.drawVAO?de(xe.shared.vao,".setVAO(",We.drawVAO.append(xe,de),");"):de(xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"):(de(xe.shared.vao,".setVAO(null);"),sa(xe,de,We,tt.attributes,function(){return!0})),co(xe,de,We,tt.uniforms,function(){return!0}),cr(xe,de,de,We)}function fi(xe,de){var We=xe.proc("draw",1);di(xe,We),$i(xe,We,de.context),Qi(xe,We,de.framebuffer),la(xe,We,de),zi(xe,We,de.state),Cr(xe,We,de,!1,!0);var tt=de.shader.progVar.append(xe,We);if(We(xe.shared.gl,".useProgram(",tt,".program);"),de.shader.program)Nr(xe,We,de,de.shader.program);else{We(xe.shared.vao,".setVAO(null);");var ct=xe.global.def("{}"),Xe=We.def(tt,".id"),ze=We.def(ct,"[",Xe,"]");We(xe.cond(ze).then(ze,".call(this,a0);").else(ze,"=",ct,"[",Xe,"]=",xe.link(function(Qe){return Xr(Nr,xe,de,Qe,1)}),"(",tt,");",ze,".call(this,a0);"))}Object.keys(de.state).length>0&&We(xe.shared.current,".dirty=true;")}function $s(xe,de,We,tt){xe.batchId="a1",di(xe,de);function ct(){return!0}sa(xe,de,We,tt.attributes,ct),co(xe,de,We,tt.uniforms,ct),cr(xe,de,de,We)}function yi(xe,de,We,tt){di(xe,de);var ct=We.contextDep,Xe=de.def(),ze="a0",Qe="a1",Ee=de.def();xe.shared.props=Ee,xe.batchId=Xe;var Ue=xe.scope(),be=xe.scope();de(Ue.entry,"for(",Xe,"=0;",Xe,"<",Qe,";++",Xe,"){",Ee,"=",ze,"[",Xe,"];",be,"}",Ue.exit);function nt(ne){return ne.contextDep&&ct||ne.propDep}function ot(ne){return!nt(ne)}if(We.needsContext&&$i(xe,be,We.context),We.needsFramebuffer&&Qi(xe,be,We.framebuffer),zi(xe,be,We.state,nt),We.profile&&nt(We.profile)&&Cr(xe,be,We,!1,!0),tt)We.useVAO?We.drawVAO?nt(We.drawVAO)?be(xe.shared.vao,".setVAO(",We.drawVAO.append(xe,be),");"):Ue(xe.shared.vao,".setVAO(",We.drawVAO.append(xe,Ue),");"):Ue(xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"):(Ue(xe.shared.vao,".setVAO(null);"),sa(xe,Ue,We,tt.attributes,ot),sa(xe,be,We,tt.attributes,nt)),co(xe,Ue,We,tt.uniforms,ot),co(xe,be,We,tt.uniforms,nt),cr(xe,Ue,be,We);else{var m=xe.global.def("{}"),x=We.shader.progVar.append(xe,be),C=be.def(x,".id"),G=be.def(m,"[",C,"]");be(xe.shared.gl,".useProgram(",x,".program);","if(!",G,"){",G,"=",m,"[",C,"]=",xe.link(function(ne){return Xr($s,xe,We,ne,2)}),"(",x,");}",G,".call(this,a0[",Xe,"],",Xe,");")}}function Ce(xe,de){var We=xe.proc("batch",2);xe.batchId="0",di(xe,We);var tt=!1,ct=!0;Object.keys(de.context).forEach(function(m){tt=tt||de.context[m].propDep}),tt||($i(xe,We,de.context),ct=!1);var Xe=de.framebuffer,ze=!1;Xe?(Xe.propDep?tt=ze=!0:Xe.contextDep&&tt&&(ze=!0),ze||Qi(xe,We,Xe)):Qi(xe,We,null),de.state.viewport&&de.state.viewport.propDep&&(tt=!0);function Qe(m){return m.contextDep&&tt||m.propDep}la(xe,We,de),zi(xe,We,de.state,function(m){return!Qe(m)}),(!de.profile||!Qe(de.profile))&&Cr(xe,We,de,!1,"a1"),de.contextDep=tt,de.needsContext=ct,de.needsFramebuffer=ze;var Ee=de.shader.progVar;if(Ee.contextDep&&tt||Ee.propDep)yi(xe,We,de,null);else{var Ue=Ee.append(xe,We);if(We(xe.shared.gl,".useProgram(",Ue,".program);"),de.shader.program)yi(xe,We,de,de.shader.program);else{We(xe.shared.vao,".setVAO(null);");var be=xe.global.def("{}"),nt=We.def(Ue,".id"),ot=We.def(be,"[",nt,"]");We(xe.cond(ot).then(ot,".call(this,a0,a1);").else(ot,"=",be,"[",nt,"]=",xe.link(function(m){return Xr(yi,xe,de,m,2)}),"(",Ue,");",ot,".call(this,a0,a1);"))}}Object.keys(de.state).length>0&&We(xe.shared.current,".dirty=true;")}function Et(xe,de){var We=xe.proc("scope",3);xe.batchId="a2";var tt=xe.shared,ct=tt.current;$i(xe,We,de.context),de.framebuffer&&de.framebuffer.append(xe,We),Bf(Object.keys(de.state)).forEach(function(ze){var Qe=de.state[ze],Ee=Qe.append(xe,We);L(Ee)?Ee.forEach(function(Ue,be){We.set(xe.next[ze],"["+be+"]",Ue)}):We.set(tt.next,"."+ze,Ee)}),Cr(xe,We,de,!0,!0),[Fi,Hp,Fs,Qt,Is].forEach(function(ze){var Qe=de.draw[ze];Qe&&We.set(tt.draw,"."+ze,""+Qe.append(xe,We))}),Object.keys(de.uniforms).forEach(function(ze){var Qe=de.uniforms[ze].append(xe,We);Array.isArray(Qe)&&(Qe="["+Qe.join()+"]"),We.set(tt.uniforms,"["+ge.id(ze)+"]",Qe)}),Object.keys(de.attributes).forEach(function(ze){var Qe=de.attributes[ze].append(xe,We),Ee=xe.scopeAttrib(ze);Object.keys(new st).forEach(function(Ue){We.set(Ee,"."+Ue,Qe[Ue])})}),de.scopeVAO&&We.set(tt.vao,".targetVAO",de.scopeVAO.append(xe,We));function Xe(ze){var Qe=de.shader[ze];Qe&&We.set(tt.shader,"."+ze,Qe.append(xe,We))}Xe(Sf),Xe(Ra),Object.keys(de.state).length>0&&(We(ct,".dirty=true;"),We.exit(ct,".dirty=true;")),We("a1(",xe.shared.context,",a0,",xe.batchId,");")}function _t(xe){if(!(typeof xe!="object"||L(xe))){for(var de=Object.keys(xe),We=0;We<de.length;++We)if(Tt.isDynamic(xe[de[We]]))return!0;return!1}}function Ln(xe,de,We){var tt=de.static[We];if(!tt||!_t(tt))return;var ct=xe.global,Xe=Object.keys(tt),ze=!1,Qe=!1,Ee=!1,Ue=xe.global.def("{}");Xe.forEach(function(nt){var ot=tt[nt];if(Tt.isDynamic(ot)){typeof ot=="function"&&(ot=tt[nt]=Tt.unbox(ot));var m=dl(ot,null);ze=ze||m.thisDep,Ee=Ee||m.propDep,Qe=Qe||m.contextDep}else{switch(ct(Ue,".",nt,"="),typeof ot){case"number":ct(ot);break;case"string":ct('"',ot,'"');break;case"object":Array.isArray(ot)&&ct("[",ot.join(),"]");break;default:ct(xe.link(ot));break}ct(";")}});function be(nt,ot){Xe.forEach(function(m){var x=tt[m];if(Tt.isDynamic(x)){var C=nt.invoke(ot,x);ot(Ue,".",m,"=",C,";")}})}de.dynamic[We]=new Tt.DynamicVariable(fs,{thisDep:ze,contextDep:Qe,propDep:Ee,ref:Ue,append:be}),delete de.static[We]}function Gr(xe,de,We,tt,ct){var Xe=pr();Xe.stats=Xe.link(ct),Object.keys(de.static).forEach(function(Qe){Ln(Xe,de,Qe)}),cv.forEach(function(Qe){Ln(Xe,xe,Qe)});var ze=Pi(xe,de,We,tt,Xe);return fi(Xe,ze),Et(Xe,ze),Ce(Xe,ze),o(Xe.compile(),{destroy:function(){ze.shader.program.destroy()}})}return{next:kn,current:Xt,procs:(function(){var xe=pr(),de=xe.proc("poll"),We=xe.proc("refresh"),tt=xe.block();de(tt),We(tt);var ct=xe.shared,Xe=ct.gl,ze=ct.next,Qe=ct.current;tt(Qe,".dirty=false;"),Qi(xe,de),Qi(xe,We,null,!0);var Ee;ln&&(Ee=xe.link(ln)),Ie.oes_vertex_array_object&&We(xe.link(Ie.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var Ue=0;Ue<wt.maxAttributes;++Ue){var be=We.def(ct.attributes,"[",Ue,"]"),nt=xe.cond(be,".buffer");nt.then(Xe,".enableVertexAttribArray(",Ue,");",Xe,".bindBuffer(",Bs,",",be,".buffer.buffer);",Xe,".vertexAttribPointer(",Ue,",",be,".size,",be,".type,",be,".normalized,",be,".stride,",be,".offset);").else(Xe,".disableVertexAttribArray(",Ue,");",Xe,".vertexAttrib4f(",Ue,",",be,".x,",be,".y,",be,".z,",be,".w);",be,".buffer=null;"),We(nt),ln&&We(Ee,".vertexAttribDivisorANGLE(",Ue,",",be,".divisor);")}return We(xe.shared.vao,".currentVAO=null;",xe.shared.vao,".setVAO(",xe.shared.vao,".targetVAO);"),Object.keys(_n).forEach(function(ot){var m=_n[ot],x=tt.def(ze,".",ot),C=xe.block();C("if(",x,"){",Xe,".enable(",m,")}else{",Xe,".disable(",m,")}",Qe,".",ot,"=",x,";"),We(C),de("if(",x,"!==",Qe,".",ot,"){",C,"}")}),Object.keys(Yt).forEach(function(ot){var m=Yt[ot],x=Xt[ot],C,G,ne=xe.block();if(ne(Xe,".",m,"("),L(x)){var ce=x.length;C=xe.global.def(ze,".",ot),G=xe.global.def(Qe,".",ot),ne(Fn(ce,function(Oe){return C+"["+Oe+"]"}),");",Fn(ce,function(Oe){return G+"["+Oe+"]="+C+"["+Oe+"];"}).join("")),de("if(",Fn(ce,function(Oe){return C+"["+Oe+"]!=="+G+"["+Oe+"]"}).join("||"),"){",ne,"}")}else C=tt.def(ze,".",ot),G=tt.def(Qe,".",ot),ne(C,");",Qe,".",ot,"=",C,";"),de("if(",C,"!==",G,"){",ne,"}");We(ne)}),xe.compile()})(),compile:Gr}}function $f(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Nc=34918,Jr=34919,Ig=35007,fl=function(K,ge){if(!ge.ext_disjoint_timer_query)return null;var Ie=[];function wt(){return Ie.pop()||ge.ext_disjoint_timer_query.createQueryEXT()}function Dt(ln){Ie.push(ln)}var yt=[];function Nt(ln){var An=wt();ge.ext_disjoint_timer_query.beginQueryEXT(Ig,An),yt.push(An),rn(yt.length-1,yt.length,ln)}function tn(){ge.ext_disjoint_timer_query.endQueryEXT(Ig)}function sn(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var nn=[];function Mt(){return nn.pop()||new sn}function wn(ln){nn.push(ln)}var hn=[];function rn(ln,An,Xt){var kn=Mt();kn.startQueryIndex=ln,kn.endQueryIndex=An,kn.sum=0,kn.stats=Xt,hn.push(kn)}var Wt=[],st=[];function St(){var ln,An,Xt=yt.length;if(Xt!==0){st.length=Math.max(st.length,Xt+1),Wt.length=Math.max(Wt.length,Xt+1),Wt[0]=0,st[0]=0;var kn=0;for(ln=0,An=0;An<yt.length;++An){var Kt=yt[An];ge.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Jr)?(kn+=ge.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Nc),Dt(Kt)):yt[ln++]=Kt,Wt[An+1]=kn,st[An+1]=ln}for(yt.length=ln,ln=0,An=0;An<hn.length;++An){var _n=hn[An],Yt=_n.startQueryIndex,xn=_n.endQueryIndex;_n.sum+=Wt[xn]-Wt[Yt];var ar=st[Yt],xr=st[xn];xr===ar?(_n.stats.gpuTime+=_n.sum/1e6,wn(_n)):(_n.startQueryIndex=ar,_n.endQueryIndex=xr,hn[ln++]=_n)}hn.length=ln}}return{beginQuery:Nt,endQuery:tn,pushScopeStats:rn,update:St,getNumPendingQueries:function(){return yt.length},clear:function(){Ie.push.apply(Ie,yt);for(var ln=0;ln<Ie.length;ln++)ge.ext_disjoint_timer_query.deleteQueryEXT(Ie[ln]);yt.length=0,Ie.length=0},restore:function(){yt.length=0,Ie.length=0}}},Oi=16384,nl=256,gv=1024,Ea=34962,Cl="webglcontextlost",kc="webglcontextrestored",Uf=1,Ni=2,Bi=3;function eh(K,ge){for(var Ie=0;Ie<K.length;++Ie)if(K[Ie]===ge)return Ie;return-1}function mv(K){var ge=ut(K);if(!ge)return null;var Ie=ge.gl,wt=Ie.getContextAttributes(),Dt=Ie.isContextLost(),yt=gn(Ie,ge);if(!yt)return null;var Nt=ao(),tn=$f(),sn=yt.extensions,nn=fl(Ie,sn),Mt=Zn(),wn=Ie.drawingBufferWidth,hn=Ie.drawingBufferHeight,rn={tick:0,time:0,viewportWidth:wn,viewportHeight:hn,framebufferWidth:wn,framebufferHeight:hn,drawingBufferWidth:wn,drawingBufferHeight:hn,pixelRatio:ge.pixelRatio},Wt={},st={elements:null,primitive:4,count:-1,offset:0,instances:-1},St=_u(Ie,sn),ln=xl(Ie,tn,ge,Xt),An=Ip(Ie,sn,St,tn,ln);function Xt(cr){return An.destroyBuffer(cr)}var kn=Gn(Ie,sn,ln,tn),Kt=Bp(Ie,Nt,tn,ge),_n=lo(Ie,sn,St,function(){ar.procs.poll()},rn,tn,ge),Yt=hd(Ie,sn,St,tn,ge),xn=jp(Ie,sn,St,_n,Yt,tn),ar=by(Ie,Nt,sn,St,ln,kn,_n,xn,Wt,An,Kt,st,rn,nn,ge),xr=Mg(Ie,xn,ar.procs.poll,rn,wt,sn,St),on=ar.next,Zt=Ie.canvas,Ht=[],pr=[],Dr=[],Un=[ge.onDestroy],$r=null;function Or(){if(Ht.length===0){nn&&nn.update(),$r=null;return}$r=En.next(Or),zi();for(var cr=Ht.length-1;cr>=0;--cr){var Xr=Ht[cr];Xr&&Xr(rn,null,0)}Ie.flush(),nn&&nn.update()}function Fr(){!$r&&Ht.length>0&&($r=En.next(Or))}function Qr(){$r&&(En.cancel(Or),$r=null)}function ki(cr){cr.preventDefault(),Dt=!0,Qr(),pr.forEach(function(Xr){Xr()})}function Si(cr){Ie.getError(),Dt=!1,yt.restore(),Kt.restore(),ln.restore(),_n.restore(),Yt.restore(),xn.restore(),An.restore(),nn&&nn.restore(),ar.procs.refresh(),Fr(),Dr.forEach(function(Xr){Xr()})}Zt&&(Zt.addEventListener(Cl,ki,!1),Zt.addEventListener(kc,Si,!1));function jr(){Ht.length=0,Qr(),Zt&&(Zt.removeEventListener(Cl,ki),Zt.removeEventListener(kc,Si)),Kt.clear(),xn.clear(),Yt.clear(),_n.clear(),kn.clear(),ln.clear(),An.clear(),nn&&nn.clear(),Un.forEach(function(cr){cr()})}function Gi(cr){q(!!cr,"invalid args to regl({...})"),q.type(cr,"object","invalid args to regl({...})");function Xr(ct){var Xe=o({},ct);delete Xe.uniforms,delete Xe.attributes,delete Xe.context,delete Xe.vao,"stencil"in Xe&&Xe.stencil.op&&(Xe.stencil.opBack=Xe.stencil.opFront=Xe.stencil.op,delete Xe.stencil.op);function ze(Qe){if(Qe in Xe){var Ee=Xe[Qe];delete Xe[Qe],Object.keys(Ee).forEach(function(Ue){Xe[Qe+"."+Ue]=Ee[Ue]})}}return ze("blend"),ze("depth"),ze("cull"),ze("stencil"),ze("polygonOffset"),ze("scissor"),ze("sample"),"vao"in ct&&(Xe.vao=ct.vao),Xe}function Nr(ct,Xe){var ze={},Qe={};return Object.keys(ct).forEach(function(Ee){var Ue=ct[Ee];if(Tt.isDynamic(Ue)){Qe[Ee]=Tt.unbox(Ue,Ee);return}else if(Xe&&Array.isArray(Ue)){for(var be=0;be<Ue.length;++be)if(Tt.isDynamic(Ue[be])){Qe[Ee]=Tt.unbox(Ue,Ee);return}}ze[Ee]=Ue}),{dynamic:Qe,static:ze}}var fi=Nr(cr.context||{},!0),$s=Nr(cr.uniforms||{},!0),yi=Nr(cr.attributes||{},!1),Ce=Nr(Xr(cr),!1),Et={gpuTime:0,cpuTime:0,count:0},_t=ar.compile(Ce,yi,$s,fi,Et),Ln=_t.draw,Gr=_t.batch,xe=_t.scope,de=[];function We(ct){for(;de.length<ct;)de.push(null);return de}function tt(ct,Xe){var ze;if(Dt&&q.raise("context lost"),typeof ct=="function")return xe.call(this,null,ct,0);if(typeof Xe=="function")if(typeof ct=="number")for(ze=0;ze<ct;++ze)xe.call(this,null,Xe,ze);else if(Array.isArray(ct))for(ze=0;ze<ct.length;++ze)xe.call(this,ct[ze],Xe,ze);else return xe.call(this,ct,Xe,0);else if(typeof ct=="number"){if(ct>0)return Gr.call(this,We(ct|0),ct|0)}else if(Array.isArray(ct)){if(ct.length)return Gr.call(this,ct,ct.length)}else return Ln.call(this,ct)}return o(tt,{stats:Et,destroy:function(){_t.destroy()}})}var Ko=xn.setFBO=Gi({framebuffer:Tt.define.call(null,Uf,"framebuffer")});function Pi(cr,Xr){var Nr=0;ar.procs.poll();var fi=Xr.color;fi&&(Ie.clearColor(+fi[0]||0,+fi[1]||0,+fi[2]||0,+fi[3]||0),Nr|=Oi),"depth"in Xr&&(Ie.clearDepth(+Xr.depth),Nr|=nl),"stencil"in Xr&&(Ie.clearStencil(Xr.stencil|0),Nr|=gv),q(!!Nr,"called regl.clear with no buffer specified"),Ie.clear(Nr)}function $i(cr){if(q(typeof cr=="object"&&cr,"regl.clear() takes an object as input"),"framebuffer"in cr)if(cr.framebuffer&&cr.framebuffer_reglType==="framebufferCube")for(var Xr=0;Xr<6;++Xr)Ko(o({framebuffer:cr.framebuffer.faces[Xr]},cr),Pi);else Ko(cr,Pi);else Pi(null,cr)}function Qi(cr){q.type(cr,"function","regl.frame() callback must be a function"),Ht.push(cr);function Xr(){var Nr=eh(Ht,cr);q(Nr>=0,"cannot cancel a frame twice");function fi(){var $s=eh(Ht,fi);Ht[$s]=Ht[Ht.length-1],Ht.length-=1,Ht.length<=0&&Qr()}Ht[Nr]=fi}return Fr(),{cancel:Xr}}function la(){var cr=on.viewport,Xr=on.scissor_box;cr[0]=cr[1]=Xr[0]=Xr[1]=0,rn.viewportWidth=rn.framebufferWidth=rn.drawingBufferWidth=cr[2]=Xr[2]=Ie.drawingBufferWidth,rn.viewportHeight=rn.framebufferHeight=rn.drawingBufferHeight=cr[3]=Xr[3]=Ie.drawingBufferHeight}function zi(){rn.tick+=1,rn.time=Cr(),la(),ar.procs.poll()}function di(){_n.refresh(),la(),ar.procs.refresh(),nn&&nn.update()}function Cr(){return(Zn()-Mt)/1e3}di();function sa(cr,Xr){q.type(Xr,"function","listener callback must be a function");var Nr;switch(cr){case"frame":return Qi(Xr);case"lost":Nr=pr;break;case"restore":Nr=Dr;break;case"destroy":Nr=Un;break;default:q.raise("invalid event, must be one of frame,lost,restore,destroy")}return Nr.push(Xr),{cancel:function(){for(var fi=0;fi<Nr.length;++fi)if(Nr[fi]===Xr){Nr[fi]=Nr[Nr.length-1],Nr.pop();return}}}}var co=o(Gi,{clear:$i,prop:Tt.define.bind(null,Uf),context:Tt.define.bind(null,Ni),this:Tt.define.bind(null,Bi),draw:Gi({}),buffer:function(cr){return ln.create(cr,Ea,!1,!1)},elements:function(cr){return kn.create(cr,!1)},texture:_n.create2D,cube:_n.createCube,renderbuffer:Yt.create,framebuffer:xn.create,framebufferCube:xn.createCube,vao:An.createVAO,attributes:wt,frame:Qi,on:sa,limits:St,hasExtension:function(cr){return St.extensions.indexOf(cr.toLowerCase())>=0},read:xr,destroy:jr,_gl:Ie,_refresh:di,poll:function(){zi(),nn&&nn.update()},now:Cr,stats:tn});return ge.onDone(null,co),co}return mv}))})(sw)),sw.exports}Pge();var ep,Uy,tp,Wu,Vy,dh,Wy,W0,jd,Rv,Pl,Ld,Id,G0;ep={},Bn(ep,jn.POINTS,"points"),Bn(ep,jn.LINES,"lines"),Bn(ep,jn.LINE_LOOP,"line loop"),Bn(ep,jn.LINE_STRIP,"line strip"),Bn(ep,jn.TRIANGLES,"triangles"),Bn(ep,jn.TRIANGLE_FAN,"triangle fan"),Bn(ep,jn.TRIANGLE_STRIP,"triangle strip");Uy={},Bn(Uy,jn.STATIC_DRAW,"static"),Bn(Uy,jn.DYNAMIC_DRAW,"dynamic"),Bn(Uy,jn.STREAM_DRAW,"stream");tp={},Bn(tp,jn.BYTE,"int8"),Bn(tp,jn.UNSIGNED_INT,"int16"),Bn(tp,jn.INT,"int32"),Bn(tp,jn.UNSIGNED_BYTE,"uint8"),Bn(tp,jn.UNSIGNED_SHORT,"uint16"),Bn(tp,jn.UNSIGNED_INT,"uint32"),Bn(tp,jn.FLOAT,"float");Wu={},Bn(Wu,jn.ALPHA,"alpha"),Bn(Wu,jn.LUMINANCE,"luminance"),Bn(Wu,jn.LUMINANCE_ALPHA,"luminance alpha"),Bn(Wu,jn.RGB,"rgb"),Bn(Wu,jn.RGBA,"rgba"),Bn(Wu,jn.RGBA4,"rgba4"),Bn(Wu,jn.RGB5_A1,"rgb5 a1"),Bn(Wu,jn.RGB565,"rgb565"),Bn(Wu,jn.DEPTH_COMPONENT,"depth"),Bn(Wu,jn.DEPTH_STENCIL,"depth stencil");Vy={},Bn(Vy,jn.DONT_CARE,"dont care"),Bn(Vy,jn.NICEST,"nice"),Bn(Vy,jn.FASTEST,"fast");dh={},Bn(dh,jn.NEAREST,"nearest"),Bn(dh,jn.LINEAR,"linear"),Bn(dh,jn.LINEAR_MIPMAP_LINEAR,"mipmap"),Bn(dh,jn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Bn(dh,jn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Bn(dh,jn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest");Wy={},Bn(Wy,jn.REPEAT,"repeat"),Bn(Wy,jn.CLAMP_TO_EDGE,"clamp"),Bn(Wy,jn.MIRRORED_REPEAT,"mirror");W0={},Bn(W0,jn.NONE,"none"),Bn(W0,jn.BROWSER_DEFAULT_WEBGL,"browser");jd={},Bn(jd,jn.NEVER,"never"),Bn(jd,jn.ALWAYS,"always"),Bn(jd,jn.LESS,"less"),Bn(jd,jn.LEQUAL,"lequal"),Bn(jd,jn.GREATER,"greater"),Bn(jd,jn.GEQUAL,"gequal"),Bn(jd,jn.EQUAL,"equal"),Bn(jd,jn.NOTEQUAL,"notequal");Rv={},Bn(Rv,jn.FUNC_ADD,"add"),Bn(Rv,jn.MIN_EXT,"min"),Bn(Rv,jn.MAX_EXT,"max"),Bn(Rv,jn.FUNC_SUBTRACT,"subtract"),Bn(Rv,jn.FUNC_REVERSE_SUBTRACT,"reverse subtract");Pl={},Bn(Pl,jn.ZERO,"zero"),Bn(Pl,jn.ONE,"one"),Bn(Pl,jn.SRC_COLOR,"src color"),Bn(Pl,jn.ONE_MINUS_SRC_COLOR,"one minus src color"),Bn(Pl,jn.SRC_ALPHA,"src alpha"),Bn(Pl,jn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Bn(Pl,jn.DST_COLOR,"dst color"),Bn(Pl,jn.ONE_MINUS_DST_COLOR,"one minus dst color"),Bn(Pl,jn.DST_ALPHA,"dst alpha"),Bn(Pl,jn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Bn(Pl,jn.CONSTANT_COLOR,"constant color"),Bn(Pl,jn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Bn(Pl,jn.CONSTANT_ALPHA,"constant alpha"),Bn(Pl,jn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Bn(Pl,jn.SRC_ALPHA_SATURATE,"src alpha saturate");Ld={},Bn(Ld,jn.NEVER,"never"),Bn(Ld,jn.ALWAYS,"always"),Bn(Ld,jn.LESS,"less"),Bn(Ld,jn.LEQUAL,"lequal"),Bn(Ld,jn.GREATER,"greater"),Bn(Ld,jn.GEQUAL,"gequal"),Bn(Ld,jn.EQUAL,"equal"),Bn(Ld,jn.NOTEQUAL,"notequal");Id={},Bn(Id,jn.ZERO,"zero"),Bn(Id,jn.KEEP,"keep"),Bn(Id,jn.REPLACE,"replace"),Bn(Id,jn.INVERT,"invert"),Bn(Id,jn.INCR,"increment"),Bn(Id,jn.DECR,"decrement"),Bn(Id,jn.INCR_WRAP,"increment wrap"),Bn(Id,jn.DECR_WRAP,"decrement wrap");G0={},Bn(G0,jn.FRONT,"front"),Bn(G0,jn.BACK,"back");var aA,cj;function Rge(){if(cj)return aA;cj=1;function t(e,n){return function(o){return e(n(o))}}return aA=t,aA}var lA,dj;function Dge(){if(dj)return lA;dj=1;var t=Rge(),e=t(Object.getPrototypeOf,Object);return lA=e,lA}var sA,fj;function jge(){if(fj)return sA;fj=1;var t=B2(),e=Dge(),n=$2(),o="[object Object]",r=Function.prototype,i=Object.prototype,a=r.toString,s=i.hasOwnProperty,l=a.call(Object);function f(h){if(!n(h)||t(h)!=o)return!1;var v=e(h);if(v===null)return!0;var _=s.call(v,"constructor")&&v.constructor;return typeof _=="function"&&_ instanceof _&&a.call(_)==l}return sA=f,sA}jge();class aT{constructor(){hl(this,"lf");hl(this,"option")}render(e){this.lf=e}layout(e={}){var f;const{nodes:n,edges:o,gridSize:r}=this.lf.graphModel;let i=40,a=40;r>20&&(i=r*2,a=r*2),this.option={type:"dagre",rankdir:"LR",align:"DR",nodesep:i,ranksep:a,begin:[120,120],...e},(f=new Wfe(this.option).layout({nodes:n.map(h=>({id:h.id,size:{width:h.width,height:h.height},model:h})),edges:o.map(h=>({source:h.sourceNodeId,target:h.targetNodeId,model:h}))}).nodes)==null||f.forEach(h=>{const{model:v}=h;v.set_position({x:h.x,y:h.y})}),this.lf.fitView()}}hl(aT,"pluginName","dagre");let Fd=null;function pj(t,e){return t.x+=e,t.y+=e,t.text&&(t.text.x+=e,t.text.y+=e),t}function hj(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach(n=>{n.x+=e,n.y+=e}),t.text&&(t.text.x+=e,t.text.y+=e),t}const dm=40;let z0=40;function h5(t,e){const{keyboard:n}=t,{options:{keyboard:o}}=n,r=()=>{var v,_;if(z0=dm,!(o!=null&&o.enabled)||e.textEditElement)return!0;const{guards:s}=t.options,l=e.getSelectElements(!1);if(!(s&&s.beforeClone?s.beforeClone(l):!0)||l.nodes.length===0&&l.edges.length===0)return Fd=null,!0;const h=l.nodes.filter(E=>E.type===kr.Start||E.type===kr.Base);if(h.length>0){Xi(((_=(v=h[0])==null?void 0:v.properties)==null?void 0:_.stepName)+Pt("views.applicationWorkflow.tip.cannotCopy"));return}return Fd=Me.cloneDeep(l),Fd.nodes.forEach(E=>pj(E,dm)),Fd.edges.forEach(E=>hj(E,dm)),Sh(Pt("views.applicationWorkflow.tip.copyError")),!1},i=()=>{if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(Fd&&(Fd.nodes||Fd.edges)){t.clearSelectElements();const s=t.addElements(Fd,z0);if(!s)return!0;s.nodes.forEach(l=>t.selectElementById(l.id,!0)),s.edges.forEach(l=>t.selectElementById(l.id,!0)),Fd.nodes.forEach(l=>pj(l,dm)),Fd.edges.forEach(l=>hj(l,dm)),z0=z0+dm}return!1},a=()=>{var f;const s=e.getSelectElements(!0);if(t.clearSelectElements(),s.nodes.length==0&&s.edges.length==0)return;if(s.edges.length>0&&s.nodes.length==0){s.edges.filter(h=>!["loop-edge"].includes(h.type||"")).forEach(h=>t.deleteEdge(h.id));return}const l=s.nodes.filter(h=>["start-node","base-node","loop-body-node","loop-start-node"].includes(h.type));if(l.length>0){Xi(`${(f=l[0].properties)==null?void 0:f.stepName}${Pt("views.applicationWorkflow.delete.deleteMessage")}`);return}return I2(Pt("common.tip"),Pt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:Pt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{if(!(o!=null&&o.enabled)||e.textEditElement)return!0;s.edges.forEach(h=>t.deleteEdge(h.id)),s.nodes.forEach(h=>{h.type==="loop-node"&&t.getNodeOutgoingNode(h.id).forEach(_=>{_.type==="loop-body-node"&&t.deleteNode(_.id)}),t.deleteNode(h.id)})}),!1};e.eventCenter.on("copy_node",r),n.on(["cmd + c","ctrl + c"],r),n.on(["cmd + v","ctrl + v"],i),n.on(["cmd + z","ctrl + z"],()=>{}),n.on(["cmd + y","ctrl + y"],()=>!(o!=null&&o.enabled)||e.textEditElement?!0:(t.redo(),!1)),n.on(["backspace"],a)}const Lge={class:"flex-between"},Ige={class:"flex align-center"},Fge={class:"ellipsis-1 break-all"},Bge={class:"title-decoration-1 mb-8 mt-8"},$ge=["onMouseenter"],Uge={class:"break-all"},Vge={class:"dialog-footer"},Wge=gr({__name:"LoopBodyContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",nc.ApplicationLoop);const e=Ge(),n=Ge(!1),o=Ge({title:""}),r=fr({set:O=>{Me.set(h.nodeModel.properties,"showNode",O)},get:()=>h.nodeModel.properties.showNode!==void 0?h.nodeModel.properties.showNode:(Me.set(h.nodeModel.properties,"showNode",!0),!0)}),i=fr(()=>h.nodeModel.properties.status?h.nodeModel.properties.status:200),a=async O=>{O&&await O.validate(w=>{var S;w&&((S=h.nodeModel.graphModel.nodes)!=null&&S.some(M=>M.properties.stepName===o.value.title)?m9.error(Pt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(h.nodeModel.properties,"stepName",o.value.title),n.value=!1,O.resetFields()))})},s=()=>{h.nodeModel.graphModel.clearSelectElements(),Me.set(h.nodeModel,"isSelected",!0),Me.set(h.nodeModel,"isHovered",!0),h.nodeModel.graphModel.toFront(h.nodeModel.id)},l=Ge(null),f=Ge(600),h=t,v=fr(()=>{var O;return h.nodeModel.properties.config.fields?(O=h.nodeModel.properties.config.fields)==null?void 0:O.map(S=>({label:S.label,value:S.value,globeLabel:`{{${h.nodeModel.properties.stepName}.${S.value}}}`,globeValue:`{{context['${h.nodeModel.id}'].${S.value}}}`})):[]}),_=Ge(!1);function E(){if(_.value=!_.value,_.value){h.nodeModel.graphModel.transformModel.focusOn(h.nodeModel.x,h.nodeModel.y,h.nodeModel.width+window.innerWidth-h.nodeModel.width,h.nodeModel.height-30),f.value=(h.nodeModel.graphModel.height-100)/h.nodeModel.graphModel.transformModel.SCALE_Y;const O=window.innerWidth/h.nodeModel.graphModel.transformModel.SCALE_X;h.nodeModel.width=O,h.nodeModel.setHeight(f.value)}else{f.value=600;const O=1920;h.nodeModel.width=O,h.nodeModel.setHeight(f.value)}}return(O,w)=>{var U;const S=te("AppIcon"),M=te("el-button"),T=te("el-alert"),B=te("el-tooltip"),R=te("el-collapse-transition"),P=te("el-input"),$=te("el-form-item"),I=te("el-form"),F=te("el-dialog");return Te(),cn("div",{onMousedown:s,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gs(["step-container app-card p-16",{isSelected:h.nodeModel.isSelected,error:i.value!==200}]),style:{overflow:"visible",background:"#fff"}},[ee("div",null,[ee("div",Lge,[ee("div",Ige,[(Te(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(U=t.nodeModel)==null?void 0:U.properties.node_data},null,8,["item"])),ee("h4",Fge,_e(t.nodeModel.properties.stepName),1)]),k(M,{link:"",onClick:E},{default:j(()=>[k(S,{iconName:_.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1})]),k(R,null,{default:j(()=>[Ql(ee("div",{onMousedown:w[1]||(w[1]=mn(()=>{},["stop"])),onKeydown:w[2]||(w[2]=mn(()=>{},["stop"])),onClick:w[3]||(w[3]=mn(()=>{},["stop"])),class:"mt-16"},[i.value!=200?(Te(),bt(T,{key:0,class:"mb-16",title:h.nodeModel.type==="application-node"?O.$t("views.applicationWorkflow.tip.applicationNodeError"):O.$t("views.applicationWorkflow.tip.functionNodeError"),type:"error","show-icon":"",closable:!1},null,8,["title"])):In("",!0),ee("div",{style:jj(`height:${f.value}px`)},[Lj(O.$slots,"default",{},void 0,!0)],4),v.value.length>0?(Te(),cn(Ir,{key:1},[ee("h5",Bge,_e(O.$t("common.param.outputParam")),1),(Te(!0),cn(Ir,null,No(v.value,(z,X)=>(Te(),cn("div",{key:X,class:"flex-between border-r-4 p-8-12 mb-8 layout-bg lighter",onMouseenter:Y=>l.value=X,onMouseleave:w[0]||(w[0]=Y=>l.value=null)},[ee("span",Uge,_e(z.label)+" "+_e("{"+z.value+"}"),1),l.value===X?(Te(),bt(B,{key:0,effect:"dark",content:O.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[k(M,{link:"",onClick:Y=>Wn(x_)(z.globeLabel),style:{padding:"0"}},{default:j(()=>[k(S,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):In("",!0)],40,$ge))),128))],64)):In("",!0)],544),[[Oh,r.value]])]),_:3})])],2),k(F,{title:O.$t("views.applicationWorkflow.nodeName"),modelValue:n.value,"onUpdate:modelValue":w[8]||(w[8]=z=>n.value=z),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:w[9]||(w[9]=mn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",Vge,[k(M,{onClick:w[6]||(w[6]=mn(z=>n.value=!1,["prevent"]))},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),k(M,{type:"primary",onClick:w[7]||(w[7]=z=>a(e.value))},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1})])]),default:j(()=>[k(I,{"label-position":"top",ref_key:"titleFormRef",ref:e,model:o.value},{default:j(()=>[k($,{prop:"title",rules:[{required:!0,message:O.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[k(P,{modelValue:o.value.title,"onUpdate:modelValue":w[4]||(w[4]=z=>o.value.title=z),onBlur:w[5]||(w[5]=z=>o.value.title=o.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),Gge=fp(Wge,[["__scopeId","data-v-cdf21a30"]]),zge=[kr.AiChat,kr.Reply,kr.ToolLib,kr.ToolLibCustom,kr.ImageUnderstandNode,kr.Application,kr.SpeechToTextNode,kr.TextToSpeechNode,kr.ImageGenerateNode,kr.ImageToVideoGenerateNode,kr.TextToVideoGenerateNode,kr.ImageGenerateNode,kr.LoopBodyNode,kr.LoopNode,kr.LoopBreakNode,kr.VideoUnderstandNode,kr.VariableAssignNode],Hge=[kr.AiChat,kr.Reply,kr.ToolLib,kr.ToolLibCustom,kr.ImageUnderstandNode,kr.VideoUnderstandNode,kr.Application,kr.SpeechToTextNode,kr.TextToSpeechNode,kr.ImageGenerateNode,kr.ImageToVideoGenerateNode,kr.TextToVideoGenerateNode,kr.ImageGenerateNode,kr.LoopBodyNode,kr.LoopNode,kr.LoopBreakNode,kr.VariableAssignNode],vj={[nc.Application]:zge,[nc.ApplicationLoop]:Hge};class N2{constructor(e,n){hl(this,"nodes");hl(this,"edges");hl(this,"workFlowNodes");hl(this,"workflowModel");this.nodes=e.nodes,this.edges=e.edges,this.workFlowNodes=[],this.workflowModel=n||nc.Application}is_valid_start_node(){const e=this.nodes.filter(n=>[kr.Start,kr.LoopStartNode].includes(n.id));if(e.length==0)throw Pt("views.applicationWorkflow.validate.startNodeRequired");if(e.length>1)throw Pt("views.applicationWorkflow.validate.startNodeOnly")}is_valid_base_node(){const e=this.nodes.filter(n=>n.id===kr.Base);if(e.length==0)throw Pt("views.applicationWorkflow.validate.baseNodeRequired");if(e.length>1)throw Pt("views.applicationWorkflow.validate.baseNodeOnly")}is_valid(){this.is_valid_start_node(),this.is_valid_base_node(),this.is_valid_work_flow(),this.is_valid_nodes()}is_loop_valid(){this.is_valid_start_node(),this.is_valid_work_flow(),this.is_valid_nodes()}get_start_node(){return this.nodes.filter(n=>[kr.Start,kr.LoopStartNode].includes(n.id))[0]}get_base_node(){return this.nodes.filter(n=>n.id===kr.Base)[0]}exist_break_node(){return this.nodes.some(e=>e.type===kr.LoopBreakNode)}_is_valid_work_flow(e){e||(e=this.get_start_node()),this.workFlowNodes.push(e),this.is_valid_node(e);const n=this.get_next_nodes(e);for(const o of n)this._is_valid_work_flow(o)}is_valid_work_flow(){this.workFlowNodes=[],this._is_valid_work_flow();const e=this.nodes.filter(n=>n.id!==kr.Start&&n.id!==kr.Base).filter(n=>!this.workFlowNodes.includes(n));if(e.length>0)throw`${Pt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${e.map(n=>n.properties.stepName).join(",")}`;this.workFlowNodes=[]}get_next_nodes(e){const o=this.edges.filter(i=>i.sourceNodeId==e.id).map(i=>this.nodes.filter(a=>a.id==i.targetNodeId)).reduce((i,a)=>[...i,...a],[]),r=vj[this.workflowModel];if(o.length==0&&!r.includes(e.type))throw Pt("views.applicationWorkflow.validate.noNextNode");return o}is_valid_nodes(){for(const e of this.nodes)if(e.type!==kr.Base&&e.type!==kr.Start&&e.type!==kr.LoopStartNode&&!this.edges.some(n=>n.targetNodeId===e.id))throw`${Pt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${e.properties.stepName}`}is_valid_node(e){if(e.properties.status&&e.properties.status===500)throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.nodeUnavailable")}`;if(e.type===kr.Condition){const n=e.properties.node_data.branch;for(const o of n){const r=`${e.id}_${o.id}_right`;if(this.edges.filter(a=>a.sourceAnchorId==r).length==0)throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.needConnect1")}${o.type}${Pt("views.applicationWorkflow.validate.needConnect2")}`}}else{const n=this.edges.filter(r=>r.sourceNodeId==e.id),o=vj[this.workflowModel];if(n.length==0&&!o.includes(e.type))throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.cannotEndNode")}`}if(e.properties.status&&e.properties.status!==200)throw`${e.properties.stepName} ${Pt("views.applicationWorkflow.validate.nodeUnavailable")}`}}const Xge=gr({__name:"index",props:{nodeModel:{}},setup(t){const e=Object.assign({"/src/workflow/nodes/ai-chat-node/index.ts":o8,"/src/workflow/nodes/application-node/index.ts":i8,"/src/workflow/nodes/base-node/index.ts":b8,"/src/workflow/nodes/condition-node/index.ts":w8,"/src/workflow/nodes/document-extract-node/index.ts":E8,"/src/workflow/nodes/form-node/index.ts":x8,"/src/workflow/nodes/image-generate/index.ts":O8,"/src/workflow/nodes/image-to-video/index.ts":S8,"/src/workflow/nodes/image-understand/index.ts":A8,"/src/workflow/nodes/intent-classify-node/index.ts":M8,"/src/workflow/nodes/loop-body-node/index.ts":Kj,"/src/workflow/nodes/loop-break-node/index.ts":T8,"/src/workflow/nodes/loop-continue-node/index.ts":C8,"/src/workflow/nodes/loop-node/index.ts":N8,"/src/workflow/nodes/loop-start-node/index.ts":k8,"/src/workflow/nodes/mcp-node/index.ts":P8,"/src/workflow/nodes/parameter-extraction-node/index.ts":R8,"/src/workflow/nodes/question-node/index.ts":D8,"/src/workflow/nodes/reply-node/index.ts":j8,"/src/workflow/nodes/reranker-node/index.ts":L8,"/src/workflow/nodes/search-document-node/index.ts":I8,"/src/workflow/nodes/search-knowledge-node/index.ts":F8,"/src/workflow/nodes/speech-to-text-node/index.ts":B8,"/src/workflow/nodes/start-node/index.ts":$8,"/src/workflow/nodes/text-to-speech-node/index.ts":U8,"/src/workflow/nodes/text-to-video/index.ts":V8,"/src/workflow/nodes/tool-lib-node/index.ts":W8,"/src/workflow/nodes/tool-node/index.ts":G8,"/src/workflow/nodes/variable-aggregation-node/index.ts":z8,"/src/workflow/nodes/variable-assign-node/index.ts":H8,"/src/workflow/nodes/variable-splitting/index.ts":X8,"/src/workflow/nodes/video-understand/index.ts":Y8}),n=t,o=Ge(),r=()=>{const f=new N2(s.value.getGraphData(),nc.ApplicationLoop);return Promise.all(s.value.graphModel.nodes.map(h=>{var v;return(v=h==null?void 0:h.validate)==null?void 0:v.call(h)})).then(()=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);try{return f.is_loop_valid(),v.properties.node_data.loop_type=="LOOP"&&!f.exist_break_node()?Promise.reject({node:v,errMessage:Pt("views.applicationWorkflow.validate.loopNodeBreakNodeRequired")}):Promise.resolve({})}catch(_){return Promise.reject({node:v,errMessage:_})}}).catch(h=>{throw n.nodeModel.graphModel.selectNodeById(n.nodeModel.id),n.nodeModel.graphModel.transformModel.focusOn(n.nodeModel.x,n.nodeModel.y,n.nodeModel.width,n.nodeModel.height),h})},i=()=>{const f=n.nodeModel.properties.loop_node_id,h=n.nodeModel.graphModel.getNodeModelById(f);h.properties.node_data.loop={x:n.nodeModel.x,y:n.nodeModel.y},h.properties.node_data.loop_body=s.value.getGraphData()},a=f=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);v&&(v.properties.config.fields=f)},s=Ge(),l=f=>{const h=o.value;if(h){let v=function(_){let E=s.value.graphModel.transformModel.SCALE_X,O=s.value.graphModel.transformModel.SCALE_Y,w=s.value.graphModel.transformModel.TRANSLATE_X,S=s.value.graphModel.transformModel.TRANSLATE_Y;const[M,T]=_;return n.nodeModel.graphModel.transformModel,E*=n.nodeModel.graphModel.transformModel.SCALE_X,O*=n.nodeModel.graphModel.transformModel.SCALE_Y,w*=n.nodeModel.graphModel.transformModel.SCALE_X,S*=n.nodeModel.graphModel.transformModel.SCALE_Y,[(M-w)/E,(T-S)/O]};s.value=new t8({plugins:[aT],textEdit:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,background:{backgroundColor:"#f5f6f7"},grid:{size:10,type:"dot",config:{color:"#DEE0E3",thickness:1}},keyboard:{enabled:!0},isSilentMode:!1,container:h}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.graphModel.transformModel.HtmlPointToCanvasPoint=v.bind(s.value.graphModel.transformModel),h5(s.value,s.value.graphModel),s.value.graphModel.refresh_loop_fields=a,s.value.graphModel.get_parent_nodes=()=>n.nodeModel.graphModel.nodes,s.value.graphModel.get_up_node_field_list=n.nodeModel.get_up_node_field_list,s.value.batchRegister([...Object.keys(e).map(_=>e[_].default),q8]),s.value.setDefaultEdgeType("app-edge"),s.value.render(f||{}),s.value.graphModel.eventCenter.on("delete_edge",_=>{_.forEach(E=>{s.value.deleteEdge(E)})}),s.value.graphModel.eventCenter.on("anchor:drop",_=>{_.nodeModel.clear_next_node_field(!1)}),s.value.graphModel.eventCenter.on("anchor:drop",_=>{_.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var _;(_=s.value)==null||_.fitView()},500)}};return yo(()=>{l(Me.cloneDeep(n.nodeModel.properties.workflow)),Me.set(n.nodeModel,"validate",r),Me.set(n.nodeModel,"set_loop_body",i)}),U2(()=>{Bne(s.value.graphModel.flowId),s.value=null}),(f,h)=>(Te(),bt(Gge,{nodeModel:t.nodeModel},{default:j(()=>[ee("div",{ref_key:"containerRef",ref:o,onWheel:h[0]||(h[0]=mn(()=>{},["stop"])),style:{height:"100%",width:"100%"}},null,544)]),_:1},8,["nodeModel"]))}});class Yge extends ai{constructor(e){super(e,Xge)}getNodeName(){return Pt("views.applicationWorkflow.nodes.loopBodyNode.label")}get_up_node_field_list(e,n){const o=this.props.model.properties.loop_node_id;if(typeof o=="string"){const r=this.props.graphModel.getNodeModelById(o);if(r&&typeof r.get_up_node_field_list=="function")return r.get_up_node_field_list(e,n)}return[]}}class qge extends li{refreshBranch(){this.incoming.edges.forEach(e=>{e.updatePathByAnchor()}),this.outgoing.edges.forEach(e=>{e.updatePathByAnchor()})}getDefaultAnchor(){const{id:e,x:n,y:o,width:r,height:i}=this;this.properties.showNode===void 0||this.properties.showNode;const a=[];return a.push({edgeAddable:!1,x:n,y:o-i/2+10,id:`${e}_children`,type:"children"}),a}setHeight(e){this.properties.height=e,this.outgoing.edges.forEach(n=>{n.updatePathByAnchor()}),this.incoming.edges.forEach(n=>{n.updatePathByAnchor()})}}const Kge={type:"loop-body-node",model:qge,view:Yge};class Zge extends Hu.BezierEdgeModel{getArrowStyle(){const e=super.getArrowStyle();return e.offset=0,e.verticalLength=0,e}getEdgeStyle(){const e=super.getEdgeStyle();return e.strokeWidth=2,e.stroke="#BBBFC4",e.offset=0,e}getData(){const e=super.getData();return e&&(e.sourceAnchorId=this.sourceAnchorId,e.targetAnchorId=this.targetAnchorId),e}updatePathByAnchor(){const n=this.graphModel.getNodeModelById(this.sourceNodeId).getDefaultAnchor().find(i=>i.id===this.sourceAnchorId),r=this.graphModel.getNodeModelById(this.targetNodeId).getDefaultAnchor().find(i=>i.id===this.targetAnchorId);if(n&&r){const i={x:n.x,y:n.y-10};this.updateStartPoint(i);const a={x:r.x,y:r.y+3};this.updateEndPoint(a)}this.pointsList=[],this.initPoints()}setAttributes(){super.setAttributes(),this.isHitable=!0,this.zIndex=0}}const Jge={type:"loop-edge",view:Hu.BezierEdge,model:Zge},Qge=gr({__name:"NodeControl",props:{lf:Object||String||null},setup(t){const e=t,n=Ge(!1);function o(){var h;(h=e.lf)==null||h.zoom(!0,[0,0])}function r(){var h;(h=e.lf)==null||h.zoom(!1,[0,0])}function i(){var h,v,_;(h=e.lf)==null||h.resetZoom(),(v=e.lf)==null||v.resetTranslate(),(_=e.lf)==null||_.fitView()}const a=()=>{var h;(h=e.lf)==null||h.extension.dagre.layout()},s=()=>{var h;(h=e.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!1})},l=()=>{var h;(h=e.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!0})},f=h=>{var _,E,O;const v=document.querySelector(".lf-drag-able");n.value=h,h?(v.style.cursor="default",(_=e.lf)==null||_.openSelectionSelect(),(E=e.lf)==null||E.extension.selectionSelect.setSelectionSense(!0,!1)):(v.style.cursor="pointer",(O=e.lf)==null||O.closeSelectionSelect())};return(h,v)=>{const _=te("Position"),E=te("el-icon"),O=te("el-button"),w=te("AppIcon"),S=te("el-divider"),M=te("ZoomOut"),T=te("el-tooltip"),B=te("ZoomIn"),R=te("el-card");return Te(),bt(R,{shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:j(()=>[k(O,{onClick:v[0]||(v[0]=P=>f(!0)),style:{border:"none",padding:"4px",height:"24px"},class:Gs({"is-drag-active":n.value})},{default:j(()=>[k(E,{size:16},{default:j(()=>[k(_)]),_:1})]),_:1},8,["class"]),k(O,{onClick:v[1]||(v[1]=P=>f(!1)),style:{border:"none",padding:"4px",height:"24px","margin-left":"8px"},class:Gs({"is-drag-active":!n.value})},{default:j(()=>[k(w,{iconName:"app-raisehand",size:16})]),_:1},8,["class"]),k(S,{direction:"vertical"}),k(O,{link:"",onClick:r,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomOut"),placement:"top"},{default:j(()=>[k(E,{size:16,title:h.$t("views.applicationWorkflow.control.zoomOut")},{default:j(()=>[k(M)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:o,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomIn"),placement:"top"},{default:j(()=>[k(E,{size:16,title:h.$t("views.applicationWorkflow.control.zoomIn")},{default:j(()=>[k(B)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:i,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.fitView"),placement:"top"},{default:j(()=>[k(w,{iconName:"app-fitview",title:h.$t("views.applicationWorkflow.control.fitView")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(S,{direction:"vertical"}),k(O,{link:"",onClick:s,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.retract"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-retract",title:h.$t("views.applicationWorkflow.control.retract")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:l,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.extend"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-extend",title:h.$t("views.applicationWorkflow.control.extend")},null,8,["title"])]),_:1},8,["content"])]),_:1}),k(O,{link:"",onClick:a,style:{border:"none"}},{default:j(()=>[k(T,{effect:"dark",content:h.$t("views.applicationWorkflow.control.beautify"),placement:"top"},{default:j(()=>[k(w,{style:{"font-size":"16px"},iconName:"app-beautify",title:h.$t("views.applicationWorkflow.control.beautify")},null,8,["title"])]),_:1},8,["content"])]),_:1})]),_:1})}}}),eme=fp(Qge,[["__scopeId","data-v-510558f4"]]),tme={class:"workflow-search-container flex-between"},nme={key:0,class:"lighter"},rme={key:1,class:"lighter color-secondary",style:{width:"42px"}},ome=gr({__name:"NodeSearch",props:{lf:{}},setup(t){const e=t,n=Ge(!1),o=Ge(""),r=Ge(null),i=B=>{(B.ctrlKey||B.metaKey)&&B.key==="f"&&(B.preventDefault(),w()),B.key==="Escape"&&n.value&&S()},a=B=>{var R,P,$;($=e.lf)==null||$.graphModel.transformModel.focusOn(B.x,B.y,(R=e.lf)==null?void 0:R.container.clientWidth,(P=e.lf)==null?void 0:P.container.clientHeight)},s=Ge(),l=Ge(0),f=fr(()=>{var B;return(B=s.value)==null?void 0:B.length}),h=B=>{var $;const R=[];return(($=e.lf)==null?void 0:$.getGraphData()).nodes.filter(I=>{var F;if(I.properties.stepName.includes(B)&&R.push({...I,order:1,focusOn:()=>{var U;a(I),(U=e.lf)==null||U.graphModel.getNodeModelById(I.id).focusOn(o.value)},selectOn:()=>{var U;(U=e.lf)==null||U.graphModel.getNodeModelById(I.id).selectOn(o.value)},clearSelectOn:()=>{var U;(U=e.lf)==null||U.graphModel.getNodeModelById(I.id).clearSelectOn(o.value)}}),I.type=="loop-body-node"){const z=((F=e.lf)==null?void 0:F.graphModel).getNodeModelById(I.id);z.getSelectNodes(o.value).map(X=>{R.push({...X,order:2,focusOn:()=>{a(I),z.focusOn({node:X,kw:o.value})},selectOn:()=>{z.selectOn({node:X,kw:o.value})},clearSelectOn:()=>{z.clearSelectOn({node:X,kw:o.value})}})})}}),R.sort((I,F)=>I.order-F.order||I.y-F.y||I.x-F.x),R},v=B=>{B.forEach(R=>R.selectOn())},_=()=>{var B,R;s.value&&s.value.length>0&&((B=s.value[l.value])==null||B.selectOn(),s.value.length-1>=l.value+1?l.value++:l.value=0,(R=s.value[l.value])==null||R.focusOn())},E=()=>{var B,R;s.value&&s.value.length>0&&((B=s.value[l.value])==null||B.selectOn(),l.value-1<=0?l.value=s.value.length-1:l.value--,(R=s.value[l.value])==null||R.focusOn())},O=B=>{if(s.value===void 0){const R=h(B);R&&R.length>0&&(s.value=R,v(R),R[l.value].focusOn())}},w=()=>{n.value=!0,o.value="",up(()=>{var B;(B=r.value)==null||B.focus()})},S=()=>{M(),n.value=!1,o.value=""},M=()=>{var R,P;s.value&&s.value.forEach($=>{$.clearSelectOn()}),s.value=void 0,l.value=0,(R=e.lf)==null||R.graphModel.clearSelectElements(),((P=e.lf)==null?void 0:P.getGraphData()).nodes.forEach($=>{var I;$.type=="loop-body-node"&&((I=e.lf)==null||I.graphModel.getNodeModelById($.id).clearSelectElements())})},T=B=>{o.value=B,M(),o.value.trim()&&(O==null||O(o.value))};return yo(()=>{window.addEventListener("keydown",i)}),U2(()=>{window.removeEventListener("keydown",i)}),(B,R)=>{const P=te("el-input"),$=te("el-divider"),I=te("ArrowUp"),F=te("el-icon"),U=te("el-button"),z=te("ArrowDown"),X=te("Close"),Y=te("el-space"),W=te("el-card"),Q=te("Search");return Te(),cn("div",null,[n.value?(Te(),bt(W,{key:0,class:"workflow-search",shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:j(()=>[ee("div",tme,[k(P,{ref_key:"searchInputRef",ref:r,modelValue:o.value,"onUpdate:modelValue":T,placeholder:B.$t("workflow.tip.searchPlaceholder"),clearable:"",onKeyup:[dA(_,["enter"]),dA(S,["esc"])]},null,8,["modelValue","placeholder"]),ee("span",null,[k(Y,{size:4},{default:j(()=>[f.value&&f.value>0?(Te(),cn("span",nme,_e(l.value+1)+"/"+_e(f.value),1)):o.value.length>0?(Te(),cn("span",rme," 无结果 ")):In("",!0),k($,{direction:"vertical"}),k(U,{text:""},{default:j(()=>[k(F,{onClick:E},{default:j(()=>[k(I)]),_:1})]),_:1}),k(U,{text:""},{default:j(()=>[k(F,{onClick:_},{default:j(()=>[k(z)]),_:1})]),_:1}),k(U,{text:"",onClick:R[0]||(R[0]=J=>S())},{default:j(()=>[k(F,null,{default:j(()=>[k(X)]),_:1})]),_:1})]),_:1})])])]),_:1})):(Te(),bt(U,{key:1,onClick:R[1]||(R[1]=J=>w()),circle:"",class:"workflow-search-button",size:"large"},{default:j(()=>[k(F,{size:20},{default:j(()=>[k(Q)]),_:1})]),_:1}))])}}}),ime=fp(ome,[["__scopeId","data-v-cdd34e89"]]),ame=gr({name:"WorkFlow"}),lme=gr({...ame,props:{data:Object||null},setup(t,{expose:e}){const n=Object.assign({"./nodes/ai-chat-node/index.ts":o8,"./nodes/application-node/index.ts":i8,"./nodes/base-node/index.ts":b8,"./nodes/condition-node/index.ts":w8,"./nodes/document-extract-node/index.ts":E8,"./nodes/form-node/index.ts":x8,"./nodes/image-generate/index.ts":O8,"./nodes/image-to-video/index.ts":S8,"./nodes/image-understand/index.ts":A8,"./nodes/intent-classify-node/index.ts":M8,"./nodes/loop-body-node/index.ts":Kj,"./nodes/loop-break-node/index.ts":T8,"./nodes/loop-continue-node/index.ts":C8,"./nodes/loop-node/index.ts":N8,"./nodes/loop-start-node/index.ts":k8,"./nodes/mcp-node/index.ts":P8,"./nodes/parameter-extraction-node/index.ts":R8,"./nodes/question-node/index.ts":D8,"./nodes/reply-node/index.ts":j8,"./nodes/reranker-node/index.ts":L8,"./nodes/search-document-node/index.ts":I8,"./nodes/search-knowledge-node/index.ts":F8,"./nodes/speech-to-text-node/index.ts":B8,"./nodes/start-node/index.ts":$8,"./nodes/text-to-speech-node/index.ts":U8,"./nodes/text-to-video/index.ts":V8,"./nodes/tool-lib-node/index.ts":W8,"./nodes/tool-node/index.ts":G8,"./nodes/variable-aggregation-node/index.ts":z8,"./nodes/variable-assign-node/index.ts":H8,"./nodes/variable-splitting/index.ts":X8,"./nodes/video-understand/index.ts":Y8}),o=gl("workflowMode")||nc.Application,r=gl("loopWorkflowMode")||nc.ApplicationLoop,i=Une(),a=Ge(""),s=Ge();yo(()=>{f()}),U2(()=>{$ne()});const l=w=>{s.value.render(w)},f=w=>{const S=document.querySelector("#container");S&&(s.value=new t8({plugins:[aT,Cne],textEdit:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,background:{backgroundColor:"#f5f6f7"},grid:{size:10,type:"dot",config:{color:"#DEE0E3",thickness:1}},keyboard:{enabled:!0},isSilentMode:!1,container:S}),s.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),s.value.on("graph:rendered",()=>{a.value=s.value.graphModel.flowId}),h5(s.value,s.value.graphModel),s.value.batchRegister([...Object.keys(n).map(M=>n[M].default),q8,Jge]),s.value.setDefaultEdgeType("app-edge"),s.value.render(w||{}),s.value.graphModel.get_provide=(M,T)=>({getNode:()=>M,getGraph:()=>T,workflowMode:o,loopWorkflowMode:r}),s.value.graphModel.eventCenter.on("delete_edge",M=>{M.forEach(T=>{s.value.deleteEdge(T)})}),s.value.graphModel.eventCenter.on("anchor:drop",M=>{M.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var M,T,B;((M=s.value.graphModel)==null?void 0:M.nodes.length)>1?(T=s.value)==null||T.fitView():(B=s.value)==null||B.translateCenter()},500))};return e({onmousedown:w=>{w.type&&s.value.dnd.startDrag({type:w.type,properties:{...w.properties}}),w.callback&&w.callback(s.value)},validate:()=>Promise.all(s.value.graphModel.nodes.map(w=>{var S;return(S=w==null?void 0:w.validate)==null?void 0:S.call(w)})),getGraphData:()=>{const w=s.value.getGraphData();w.nodes.forEach(M=>{M.type==="loop-body-node"&&s.value.getNodeModelById(M.id).set_loop_body()});const S=s.value.getGraphData();return S.nodes=S.nodes.filter(M=>M.type!=="loop-body-node"),S.edges=w.edges.filter(M=>M.type!=="loop-edge"),S},addNode:w=>{s.value.clearSelectElements();const{virtualRectCenterPositionX:S,virtualRectCenterPositionY:M}=s.value.graphModel.getVirtualRectSize(),T=s.value.graphModel.addNode({type:w.type,properties:w.properties,x:S,y:M-s.value.graphModel.height/2});T.isSelected=!0,T.isHovered=!0,s.value.toFront(T.id)},clearGraphData:()=>s.value.clearData(),renderGraphData:f,render:l}),(w,S)=>(Te(),cn(Ir,null,[S[0]||(S[0]=ee("div",{className:"workflow-app",id:"container"},null,-1)),s.value?(Te(),bt(eme,{key:0,class:"workflow-control",lf:s.value},null,8,["lf"])):In("",!0),k(Wn(i),{"flow-id":a.value},null,8,["flow-id"]),k(ime,{lf:s.value},null,8,["lf"])],64))}}),sme={class:"workflow-publish-history border-l white-bg"},ume={class:"border-b p-16-24"},cme={class:"list-height pt-0"},dme={class:"p-8 pt-0"},fme={class:"flex-between"},pme={style:{"max-width":"80%"}},hme={class:"text-center"},vme=gr({__name:"PublishHistory",emits:["click","refreshVersion"],setup(t,{emit:e}){const n=ja(),{params:{id:o}}=n,r=fr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=Ge(!1),s=Ge([]),l=Ge("");function f(S){l.value=S.id}function h(S){i("click",S)}function v(S){i("refreshVersion",S)}function _(S){S.writeStatus=!0}function E(S){S.writeStatus=!1}function O(S,M){if(S){const T={name:S};oi({type:"workflowVersion",systemType:r.value}).putWorkFlowVersion(o,M.id,T,a).then(()=>{Sh(Pt("common.modifySuccess")),M.writeStatus=!1,w()})}else Xi(Pt("views.applicationWorkflow.tip.nameMessage"))}function w(){oi({type:"workflowVersion",systemType:r.value}).getWorkFlowVersion(o,a).then(S=>{s.value=S.data})}return yo(()=>{w()}),(S,M)=>{const T=te("ReadWrite"),B=te("el-tag"),R=te("UserFilled"),P=te("el-icon"),$=te("el-avatar"),I=te("el-text"),F=te("AppIcon"),U=te("el-button"),z=te("el-dropdown-item"),X=te("RefreshLeft"),Y=te("el-dropdown-menu"),W=te("el-dropdown"),Q=te("common-list"),J=te("el-scrollbar"),ie=Rm("loading");return Te(),cn("div",sme,[ee("h4",ume,_e(S.$t("views.applicationWorkflow.setting.releaseHistory")),1),ee("div",cme,[k(J,null,{default:j(()=>[ee("div",dme,[Ql((Te(),bt(Q,{data:s.value,class:"mt-8",onClick:h,onMouseenter:f,onMouseleave:M[1]||(M[1]=Se=>l.value="")},{default:j(({row:Se,index:Ae})=>[ee("div",fme,[ee("div",pme,[ee("h5",{class:Gs([Ae===0?"primary":"","flex align-center"])},[k(T,{onChange:Pe=>O(Pe,Se),data:Se.name||Wn(fA)(Se.update_time),trigger:"manual",write:Se.writeStatus,onClose:Pe=>E(Se)},null,8,["onChange","data","write","onClose"]),Ae===0?(Te(),bt(B,{key:0,class:"default-tag ml-4"},{default:j(()=>[ft(_e(S.$t("views.applicationWorkflow.setting.latestRelease")),1)]),_:1})):In("",!0)],2),k(I,{type:"info",class:"color-secondary flex align-center mt-8"},{default:j(()=>[k($,{size:20,class:"avatar-grey mr-4"},{default:j(()=>[k(P,null,{default:j(()=>[k(R)]),_:1})]),_:1}),ft(" "+_e(Se.publish_user_name),1)]),_:2},1024)]),Ql(ee("div",{onClick:M[0]||(M[0]=mn(()=>{},["stop"]))},[k(W,{trigger:"click",teleported:!1},{dropdown:j(()=>[k(Y,null,{default:j(()=>[k(z,{onClick:mn(Pe=>_(Se),["stop"])},{default:j(()=>[k(F,{iconName:"app-edit",class:"color-secondary"}),ft(" "+_e(S.$t("common.edit")),1)]),_:1},8,["onClick"]),k(z,{onClick:Pe=>v(Se)},{default:j(()=>[k(P,{class:"color-secondary"},{default:j(()=>[k(X)]),_:1}),ft(" "+_e(S.$t("views.applicationWorkflow.setting.restoreCurrentVersion")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:j(()=>[k(U,{text:""},{default:j(()=>[k(F,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[Oh,l.value===Se.id]])])]),empty:j(()=>[ee("div",hme,[k(I,{type:"info"},{default:j(()=>[ft(_e(S.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data"])),[[ie,a.value]])])]),_:1})])])}}}),gme=fp(vme,[["__scopeId","data-v-85be1165"]]),mme={class:"application-workflow"},yme={class:"header border-b flex-between p-12-24 white-bg"},_me={class:"flex align-center"},bme=["title"],wme={key:0},Eme={key:0},xme={key:1},Ome=["href"],Sme={class:"ml-4"},Ame={class:"flex-between"},Mme={class:"flex align-center"},Tme={class:"mr-12 ml-24 flex"},Cme=["src"],Nme=["title"],kme={class:"mr-16"},Pme={class:"scrollbar-height"},Jme=gr({__name:"index",setup(t){O_("getApplicationDetail",()=>E),O_("workflowMode",nc.Application);const{theme:e}=Rj(),n=y9(),o=ja(),{params:{id:r,from:i}}=o,a=fr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),s=fr(()=>Dj.application[a.value]),l=fr(()=>e.isDefaultTheme());let f;const h=Ge(),v=Ge(),_=Ge(!1),E=Ge(null),O=Ge(!1),w=Ge(!1),S=Ge(!1),M=Ge(""),T=Ge(!1),B=Ge(!1),R=Ge(!1),P=Ge({}),$=Ge(null),I=Ge([]),F=fr(()=>WN(I.value)?"?"+WN(I.value):""),U=fr(()=>{var $e;return`${window.location.origin}/chat/`+(($e=E.value)==null?void 0:$e.access_token)+F.value});function z(){JSON.stringify($.value)!==JSON.stringify(Be())?I2(Pt("common.tip"),Pt("views.applicationWorkflow.tip.saveMessage"),{confirmButtonText:Pt("views.applicationWorkflow.setting.exitSave"),cancelButtonText:Pt("views.applicationWorkflow.setting.exit"),distinguishCancelAndClose:!0}).then(()=>{mt(!0,!0)}).catch($e=>{$e==="cancel"&&le()}):le()}function X(){R.value||(B.value=!1,R.value=!1)}function Y($e){$e&&Q($e),B.value=!1,R.value=!1}function W($e){R.value=!0,P.value=$e,Q($e),we()}function Q($e){var rt;$e.work_flow.nodes.map(pt=>{pt.properties.noRender=!0}),E.value.work_flow=$e.work_flow,M.value=$e==null?void 0:$e.update_time,(rt=h.value)==null||rt.clearGraphData(),up(()=>{var pt;(pt=h.value)==null||pt.render($e.work_flow)})}function J(){Je(),T.value&&se(),B.value=!1,R.value=!1}function ie(){B.value=!0}function Se($e){$e?se():we(),localStorage.setItem("workflowAutoSave",$e.toString())}function Ae($e){O.value=!1}function Pe($e){O.value=!1}function De(){O.value=!1}const He=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{const rt=Be(),pt=new N2(rt);try{pt.is_valid()}catch(Lt){Xi(Lt.toString());return}oi({type:"application",systemType:a.value}).putApplication(r,{work_flow:rt},_).then(()=>oi({type:"application",systemType:a.value}).publish(r,{},_)).then(Lt=>{var Jt,en;E.value.name=Lt.data.name,(en=(Jt=Lt.data.work_flow)==null?void 0:Jt.nodes)==null||en.filter(zt=>zt.id==="base-node").map(zt=>{I.value=zt.properties.api_input_field_list?zt.properties.api_input_field_list.map(it=>({name:it.variable,value:it.default_value})):zt.properties.input_field_list?zt.properties.input_field_list.filter(it=>it.assignment_method==="api_input").map(it=>({name:it.variable,value:it.default_value})):[]}),Sh(Pt("views.application.tip.publishSuccess"))}).catch(Lt=>{var zt,it,ae,re;const Jt=Lt.node,en=Lt.errMessage;if(typeof en=="string")Xi(((zt=Lt.node.properties)==null?void 0:zt.stepName)+` ${Pt("views.applicationWorkflow.node").toLowerCase()} `+en.toLowerCase());else{const je=Object.keys(en);Xi(((it=Jt.properties)==null?void 0:it.stepName)+` ${Pt("views.applicationWorkflow.node").toLowerCase()} `+((re=(ae=en[je[0]])==null?void 0:ae[0])==null?void 0:re.message.toLowerCase()))}})}).catch(rt=>{var Jt,en,zt,it;const pt=rt.node,Lt=rt.errMessage;if(typeof Lt=="string")Xi(((Jt=rt.node.properties)==null?void 0:Jt.stepName)+` ${Pt("views.applicationWorkflow.node")},`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${Pt("views.applicationWorkflow.node")},`+((it=(zt=Lt[ae[0]])==null?void 0:zt[0])==null?void 0:it.message))}})},Ye=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{var Lt;const rt=Be(),pt=new N2(rt);try{pt.is_valid(),E.value={...E.value,type:"WORK_FLOW",...(Lt=pt.get_base_node())==null?void 0:Lt.properties.node_data,work_flow:Be()},w.value=!0}catch(Jt){Xi(Jt.toString())}}).catch(rt=>{var Jt,en,zt,it;const pt=rt.node,Lt=rt.errMessage;if(typeof Lt=="string")Xi(((Jt=rt.node.properties)==null?void 0:Jt.stepName)+` ${Pt("views.applicationWorkflow.node")},`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${Pt("views.applicationWorkflow.node")},`+((it=(zt=Lt[ae[0]])==null?void 0:zt[0])==null?void 0:it.message))}})};function Be(){var $e;return($e=h.value)==null?void 0:$e.getGraphData()}function Je(){oi({type:"application",systemType:a.value}).getApplicationDetail(r).then($e=>{var rt,pt,Lt,Jt,en;(rt=$e.data)==null||rt.work_flow.nodes.map(zt=>{zt.properties.noRender=!0}),E.value=$e.data,E.value.stt_model_id=$e.data.stt_model,E.value.tts_model_id=$e.data.tts_model,E.value.tts_type=$e.data.tts_type,M.value=(pt=$e.data)==null?void 0:pt.update_time,(Jt=(Lt=E.value.work_flow)==null?void 0:Lt.nodes)==null||Jt.filter(zt=>zt.id==="base-node").map(zt=>{I.value=zt.properties.api_input_field_list?zt.properties.api_input_field_list.map(it=>({name:it.variable,value:it.default_value})):zt.properties.input_field_list?zt.properties.input_field_list.filter(it=>it.assignment_method==="api_input").map(it=>({name:it.variable,value:it.default_value})):[]}),oi({type:"application",systemType:a.value}).getAccessToken(r,_).then(zt=>{E.value={...E.value,...zt.data}}),(en=h.value)==null||en.clearGraphData(),up(()=>{var zt;(zt=h.value)==null||zt.render(E.value.work_flow),$.value=Be()}),Qf([Vs.IS_EE,Vs.IS_PE],"OR")&&oi({type:"application",systemType:a.value}).getApplicationSetting(r).then(zt=>{E.value={...E.value,...zt.data}})})}function mt($e,rt){const pt={work_flow:Be()};_.value=rt||!1,oi({type:"application",systemType:a.value}).putApplication(r,pt).then(()=>{M.value=new Date,$e&&($.value=Be(),Sh(Pt("common.saveSuccess")),rt&&le())}).catch(()=>{_.value=!1})}const le=()=>o.path.includes("workspace")?n.push({path:pe()}):n.push({path:Ze()}),Ze=()=>Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_OVERVIEW_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_ACCESS_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_CHAT_USER_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([Bc.ADMIN,Yl.RESOURCE_APPLICATION_CHAT_LOG_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/system/resource-management/application",pe=()=>Qf([new ch([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Bc.WORKSPACE_MANAGE.getWorkspaceRole,Yl.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,Yl.APPLICATION_OVERVIEW_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([new ch([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"AND"),new ch([Bc.WORKSPACE_MANAGE.getWorkspaceRole],[Yl.APPLICATION_ACCESS_READ.getWorkspacePermissionWorkspaceManageRole],[Vs.IS_EE,Vs.IS_PE],"OR"),new ch([],[Yl.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([new ch([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"AND"),new ch([Bc.WORKSPACE_MANAGE.getWorkspaceRole],[Yl.APPLICATION_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole],[Vs.IS_EE,Vs.IS_PE],"OR"),new ch([],[Yl.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(r)],[Vs.IS_EE,Vs.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([new ch([Bc.USER],[Yl.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Yl.APPLICATION_CHAT_LOG_READ.getWorkspacePermissionWorkspaceManageRole,Yl.APPLICATION_CHAT_LOG_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/application",se=()=>{f=setInterval(()=>{mt()},6e4)},we=()=>{f&&clearInterval(f)};return yo(()=>{Je();const $e=localStorage.getItem("workflowAutoSave");T.value=$e==="true",T.value&&se()}),_9(()=>{var $e;we(),($e=h.value)==null||$e.clearGraphData()}),($e,rt)=>{var ke,Ke,Le;const pt=te("back-button"),Lt=te("el-text"),Jt=te("el-button"),en=te("el-divider"),zt=te("Close"),it=te("el-icon"),ae=te("AppIcon"),re=te("el-dropdown-item"),je=te("el-switch"),vt=te("el-dropdown-menu"),q=te("el-dropdown"),kt=te("el-collapse-transition"),Rt=te("el-avatar"),Gt=te("LogoIcon"),Pn=te("AiChat"),qt=Rm("click-outside"),On=Rm("loading");return Ql((Te(),cn("div",mme,[ee("div",yme,[ee("div",_me,[k(pt,{onClick:z}),ee("h4",{class:"ellipsis",style:{"max-width":"300px"},title:(ke=E.value)==null?void 0:ke.name},_e((Ke=E.value)==null?void 0:Ke.name),9,bme),B.value&&R.value?(Te(),cn("div",wme,[k(Lt,{type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.previewVersion"))+" "+_e(P.value.name||Wn(fA)(P.value.update_time)),1)]),_:1})])):M.value?(Te(),bt(Lt,{key:1,type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.saveTime"))+_e(Wn(fA)(M.value)),1)]),_:1})):In("",!0)]),B.value&&R.value?(Te(),cn("div",Eme,[k(Jt,{type:"primary",class:"mr-8",onClick:rt[0]||(rt[0]=dt=>Y())},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.setting.restoreVersion")),1)]),_:1}),k(en,{direction:"vertical"}),k(Jt,{text:"",onClick:J},{default:j(()=>[k(it,null,{default:j(()=>[k(zt)]),_:1})]),_:1})])):(Te(),cn("div",xme,[k(Jt,{onClick:rt[1]||(rt[1]=dt=>O.value=!O.value)},{default:j(()=>[k(ae,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.addComponent")),1)]),_:1}),s.value.debug(Wn(r))?(Te(),bt(Jt,{key:0,onClick:Ye,disabled:w.value},{default:j(()=>[k(ae,{iconName:"app-debug-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.debug")),1)]),_:1},8,["disabled"])):In("",!0),s.value.edit(Wn(r))?(Te(),bt(Jt,{key:1,onClick:rt[2]||(rt[2]=dt=>mt(!0))},{default:j(()=>[k(ae,{iconName:"app-save-outlined",class:"mr-4"}),ft(" "+_e($e.$t("common.save")),1)]),_:1})):In("",!0),s.value.edit(Wn(r))?(Te(),bt(Jt,{key:2,type:"primary",onClick:He},{default:j(()=>[ft(_e($e.$t("views.application.operation.publish")),1)]),_:1})):In("",!0),k(q,{trigger:"click"},{dropdown:j(()=>[k(vt,null,{default:j(()=>[ee("a",{href:U.value,target:"_blank"},[k(re,null,{default:j(()=>[k(ae,{iconName:"app-create-chat",class:"color-secondary"}),ft(" "+_e($e.$t("views.application.operation.toChat")),1)]),_:1})],8,Ome),k(re,{onClick:ie},{default:j(()=>[k(ae,{iconName:"app-history-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.releaseHistory")),1)]),_:1}),k(re,null,{default:j(()=>[k(ae,{iconName:"app-save-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.autoSave"))+" ",1),ee("div",Sme,[k(je,{size:"small",modelValue:T.value,"onUpdate:modelValue":rt[4]||(rt[4]=dt=>T.value=dt),onChange:Se},null,8,["modelValue"])])]),_:1})]),_:1})]),default:j(()=>[k(Jt,{text:"",onClick:rt[3]||(rt[3]=mn(()=>{},["stop"])),class:"ml-8 mt-4"},{default:j(()=>[k(ae,{iconName:"app-more",class:"rotate-90"})]),_:1})]),_:1})]))]),k(kt,null,{default:j(()=>[Ql(k(y3,{show:O.value,id:Wn(r),onClickNodes:Ae,onOnmousedown:Pe,workflowRef:h.value},null,8,["show","id","workflowRef"]),[[qt,De]])]),_:1}),ee("div",{class:"workflow-main",ref_key:"workflowMainRef",ref:v},[E.value?(Te(),bt(lme,{key:0,ref_key:"workflowRef",ref:h,data:(Le=E.value)==null?void 0:Le.work_flow},null,8,["data"])):In("",!0)],512),k(kt,null,{default:j(()=>{var dt,At,Tt;return[w.value?(Te(),cn("div",{key:0,class:Gs(["workflow-debug-container",S.value?"enlarge":""])},[ee("div",{class:Gs(["workflow-debug-header",l.value?"":"custom-header"])},[ee("div",Ame,[ee("div",Mme,[ee("div",Tme,[Wn(cA)((dt=E.value)==null?void 0:dt.icon)?(Te(),bt(Rt,{key:0,shape:"square",size:32,style:{background:"none"}},{default:j(()=>{var En;return[ee("img",{src:Wn(yh)((En=E.value)==null?void 0:En.icon),alt:""},null,8,Cme)]}),_:1})):(Te(),bt(Gt,{key:1,height:"32px"}))]),ee("h4",{class:"ellipsis",style:{"max-width":"270px"},title:(At=E.value)==null?void 0:At.name},_e(((Tt=E.value)==null?void 0:Tt.name)||$e.$t("views.application.form.appName.label")),9,Nme)]),ee("div",kme,[k(Jt,{link:"",onClick:rt[5]||(rt[5]=En=>S.value=!S.value)},{default:j(()=>[k(ae,{iconName:S.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1}),k(Jt,{link:"",onClick:rt[6]||(rt[6]=En=>w.value=!1)},{default:j(()=>[k(it,{size:20,class:"color-secondary"},{default:j(()=>[k(zt)]),_:1})]),_:1})])])],2),ee("div",Pme,[k(Pn,{"application-details":E.value,type:"debug-ai-chat"},null,8,["application-details"])])],2)):In("",!0)]}),_:1}),B.value?Ql((Te(),bt(gme,{key:0,onClick:W,onRefreshVersion:Y},null,512)),[[qt,X]]):In("",!0)])),[[On,_.value]])}}});export{Jme as default};
|