UnisKB/static/admin/assets/index-tIZToCYL.js

216 lines
1.9 MiB
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

var p$=Object.defineProperty;var h$=(t,e,n)=>e in t?p$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var hs=(t,e,n)=>h$(t,typeof e!="symbol"?e+"":e,n);import{dr as Pg,eP as Jc,dn as zo,eQ as IN,db as tm,eR as z_,eS as sp,eT as nm,eU as Qy,eV as qu,ef as qd,dc as qa,eW as v$,dd as Kd,ea as hj,eX as m$,eY as H_,eZ as Ju,e6 as SE,e8 as N2,dk as rm,au as Zd,e_ as om,e$ as im,eg as Kg,f0 as P2,di as Yo,f1 as AE,dM as ME,ee as lp,dS as Ri,f2 as kg,dj as Nh,f3 as Zg,f4 as X_,dR as Jd,dh as El,df as _i,f5 as g$,f6 as vj,eE as Qu,ed as js,f7 as y$,f8 as _$,f9 as Jg,fa as TE,fb as mj,dL as am,fc as gj,bL as ec,dg as Y_,at as Ph,dQ as w_,dO as Hv,e9 as b$,ec as FN,eb as w$,as as yj,fd as _j,fe as E$,dm as CE,de as x$,ei as uw,ff as O$,fg as bj,fh as wj,fi as S$,fj as Ej,fk as A$,dp as M$,fl as T$,fm as C$,fn as N$,fo as cw,fp as P$,el as k$,fq as xj,dN as Oj,eh as k2,fr as Sj,fs as R2,ft as R$,dl as q_,fu as Aj,fv as D$,fw as Mj,fx as Tj,fy as j$,fz as L$,fA as I$,em as E_,eC as F$,fB as B$,fC as $$,aw as U$,fD as V$,fE as W$,fF as D2,fG as G$,fH as Cj,fI as z$,fJ as H$,ai as X$,eF as to,fK as Y$,ax as dw,fL as uA,fM as q$,fN as K$,fO as wl,fP as Z$,fQ as J$,av as Xv,fR as Q$,eG as Yv,fS as e7,eD as Vv,fT as Nj,fU as t7,fV as n7,fW as r7,ay as _r,aB as He,aV as K_,aD as ne,aE as Ne,aW as mn,aX as Ir,aH as P,aI as ee,aY as No,aF as bt,aG as j,b2 as Wn,c$ as cA,bX as mh,dw as BN,aJ as _e,bY as j2,aK as ft,b1 as Bn,aS as gn,cf as kh,fX as Qs,aQ as ja,aA as Pj,aO as hr,aP as kj,b6 as bo,b8 as Js,bc as Rj,ch as Eh,cq as fw,fY as pw,bW as u0,aT as oi,aN as Qc,aZ as Me,b7 as Rg,ce as Gl,cF as Dj,cj as x_,c1 as Xi,aC as kt,c0 as L2,aM as Pr,fZ as O_,ci as bl,d5 as Z_,bB as Dg,aU as Rh,f_ as o7,f$ as i7,g0 as jj,g1 as Lj,g2 as a7,g3 as s7,g4 as l7,g5 as u7,g6 as c7,g7 as Go,du as I2,dv as d7,cu as f7,bD as xh,dJ as p7,b3 as Oh,g8 as yu,cJ as h7,g9 as $N,ga as Lv,gb as v7,gc as F2,gd as B2,ge as m7,gf as g7,b4 as Ij,bZ as dA,az as y7,er as UN,cY as _7,bG as Qf,bH as Vl,bI as Ic,bK as Xs,bJ as lh}from"./admin-CVV10WkZ.js";import{t as VN,a as WN,g as b7,i as Qd,n as w7,c as $2,l as c0,d as E7}from"./data-CmtZQ9WV.js";import{_ as dp}from"./AIModeParamSettingDialog.vue_vue_type_script_setup_true_lang-B1HLyRcH.js";import{G as U2,d as x7,e as O7,f as S7,_ as Fj,c as Bj,b as A7,a as M7}from"./ToolDialog.vue_vue_type_style_index_0_lang-Mqox5Ibc.js";import{d as $j,c as sm,v as J_,e as T7,g as Uj,f as C7,a as ri,r as Vj}from"./reduce-B5b7KIXW.js";import{c as N7,a as P7,b as k7,e as Wj,f as Sh,m as R7,d as D7,h as hw}from"./min-C6aCKoU5.js";import{c as V2,b as NE,i as W2,p as Gj,n as G2,a as j7,d as z2,e as L7,f as I7,g as F7,h as B7,u as $7,j as U7,k as V7,l as zj,m as W7,r as G7,o as z7,q as H7,s as X7,t as Xo}from"./uniqBy-C-Npuxsd.js";import{d as Hj,e as Y7,g as q7,h as K7,i as Z7,z as J7,s as Q7,m as e9,a as t9,b as n9,f as r9,c as o9,r as i9,u as a9}from"./zipObject-DNn7XrIH.js";import{l as Xj,_ as Yj}from"./vue-draggable-plus-BVkTPn2t.js";import{_ as s9}from"./FieldFormDialog.vue_vue_type_script_setup_true_lang-ov9RwYOC.js";import{_ as Fn}from"./defineProperty-DbXIQDXj.js";import"./typeof-QjJsDpFa.js";const qj=Object.freeze(Object.defineProperty({__proto__:null,get default(){return Kme}},Symbol.toStringTag,{value:"Module"}));var l9=NaN;function GN(t){return typeof t=="number"?t:Pg(t)?l9:+t}function PE(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=Jc(n),o=Jc(o)):(n=GN(n),o=GN(o)),r=t(n,o)}return r}}var u9=PE(function(t,e){return t+e},0),c9="Expected a function";function d9(t,e){if(typeof e!="function")throw new TypeError(c9);return t=zo(t),function(){if(--t<1)return e.apply(this,arguments)}}var vw=IN&&new IN,Kj=vw?function(t,e){return vw.set(t,e),t}:tm;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 sp(o)?o:n}}var f9=1;function p9(t,e,n){var o=e&f9,r=S_(t);function i(){var a=this&&this!==nm&&this instanceof i?r:t;return a.apply(o?n:this,arguments)}return i}var h9=Math.max;function Zj(t,e,n,o){for(var r=-1,i=t.length,a=n.length,l=-1,s=e.length,f=h9(i-a,0),h=Array(s+f),v=!o;++l<s;)h[l]=e[l];for(;++r<a;)(v||r<i)&&(h[n[r]]=t[r]);for(;f--;)h[l++]=t[r++];return h}var v9=Math.max;function Jj(t,e,n,o){for(var r=-1,i=t.length,a=-1,l=n.length,s=-1,f=e.length,h=v9(i-l,0),v=Array(h+f),b=!o;++r<h;)v[r]=t[r];for(var w=r;++s<f;)v[w+s]=e[s];for(;++a<l;)(b||r<i)&&(v[w+n[a]]=t[r++]);return v}function m9(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}function kE(){}var g9=4294967295;function $o(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g9,this.__views__=[]}$o.prototype=z_(kE.prototype);$o.prototype.constructor=$o;var H2=vw?function(t){return vw.get(t)}:Qy,Og={},y9=Object.prototype,_9=y9.hasOwnProperty;function H0(t){for(var e=t.name+"",n=Og[e],o=_9.call(Og,e)?n.length:0;o--;){var r=n[o],i=r.func;if(i==null||i==t)return r.name}return e}function tc(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}tc.prototype=z_(kE.prototype);tc.prototype.constructor=tc;function Qj(t){if(t instanceof $o)return t.clone();var e=new tc(t.__wrapped__,t.__chain__);return e.__actions__=qu(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var b9=Object.prototype,w9=b9.hasOwnProperty;function ge(t){if(qd(t)&&!qa(t)&&!(t instanceof $o)){if(t instanceof tc)return t;if(w9.call(t,"__wrapped__"))return Qj(t)}return new tc(t)}ge.prototype=kE.prototype;ge.prototype.constructor=ge;function fA(t){var e=H0(t),n=ge[e];if(typeof n!="function"||!(e in $o.prototype))return!1;if(t===n)return!0;var o=H2(n);return!!o&&t===o[0]}var eL=v$(Kj),E9=/\{\n\/\* \[wrapped with (.+)\] \*/,x9=/,? & /;function O9(t){var e=t.match(E9);return e?e[1].split(x9):[]}var S9=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function A9(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(S9,`{
/* [wrapped with `+e+`] */
`)}var M9=1,T9=2,C9=8,N9=16,P9=32,k9=64,R9=128,D9=256,j9=512,L9=[["ary",R9],["bind",M9],["bindKey",T9],["curry",C9],["curryRight",N9],["flip",j9],["partial",P9],["partialRight",k9],["rearg",D9]];function I9(t,e){return Kd(L9,function(n){var o="_."+n[0];e&n[1]&&!hj(t,o)&&t.push(o)}),t.sort()}function tL(t,e,n){var o=e+"";return m$(t,A9(o,I9(O9(o),n)))}var F9=4,B9=8,zN=32,HN=64;function nL(t,e,n,o,r,i,a,l,s,f){var h=e&B9,v=h?a:void 0,b=h?void 0:a,w=h?i:void 0,O=h?void 0:i;e|=h?zN:HN,e&=~(h?HN:zN),e&F9||(e&=-4);var E=[t,e,r,w,v,O,b,l,s,f],S=n.apply(void 0,E);return fA(t)&&eL(S,E),S.placeholder=o,tL(S,t,e)}function Qg(t){var e=t;return e.placeholder}var $9=Math.min;function U9(t,e){for(var n=t.length,o=$9(e.length,n),r=qu(t);o--;){var i=e[o];t[o]=H_(i,n)?r[i]:void 0}return t}var XN="__lodash_placeholder__";function Ah(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n];(a===e||a===XN)&&(t[n]=XN,i[r++]=n)}return i}var V9=1,W9=2,G9=8,z9=16,H9=128,X9=512;function RE(t,e,n,o,r,i,a,l,s,f){var h=e&H9,v=e&V9,b=e&W9,w=e&(G9|z9),O=e&X9,E=b?void 0:S_(t);function S(){for(var M=arguments.length,C=Array(M),$=M;$--;)C[$]=arguments[$];if(w)var D=Qg(S),k=m9(C,D);if(o&&(C=Zj(C,o,r,w)),i&&(C=Jj(C,i,a,w)),M-=k,w&&M<f){var B=Ah(C,D);return nL(t,e,RE,S.placeholder,n,C,B,l,s,f-M)}var F=v?n:this,I=b?F[t]:t;return M=C.length,l?C=U9(C,l):O&&M>1&&C.reverse(),h&&s<M&&(C.length=s),this&&this!==nm&&this instanceof S&&(I=E||S_(I)),I.apply(F,C)}return S}function Y9(t,e,n){var o=S_(t);function r(){for(var i=arguments.length,a=Array(i),l=i,s=Qg(r);l--;)a[l]=arguments[l];var f=i<3&&a[0]!==s&&a[i-1]!==s?[]:Ah(a,s);if(i-=f.length,i<n)return nL(t,e,RE,r.placeholder,void 0,a,f,void 0,void 0,n-i);var h=this&&this!==nm&&this instanceof r?o:t;return Ju(h,this,a)}return r}var q9=1;function K9(t,e,n,o){var r=e&q9,i=S_(t);function a(){for(var l=-1,s=arguments.length,f=-1,h=o.length,v=Array(h+s),b=this&&this!==nm&&this instanceof a?i:t;++f<h;)v[f]=o[f];for(;s--;)v[f++]=arguments[++l];return Ju(b,r?n:this,v)}return a}var YN="__lodash_placeholder__",YO=1,Z9=2,J9=4,qN=8,jy=128,KN=256,Q9=Math.min;function eU(t,e){var n=t[1],o=e[1],r=n|o,i=r<(YO|Z9|jy),a=o==jy&&n==qN||o==jy&&n==KN&&t[7].length<=e[8]||o==(jy|KN)&&e[7].length<=e[8]&&n==qN;if(!(i||a))return t;o&YO&&(t[2]=e[2],r|=n&YO?0:J9);var l=e[3];if(l){var s=t[3];t[3]=s?Zj(s,l,e[4]):l,t[4]=s?Ah(t[3],YN):e[4]}return l=e[5],l&&(s=t[5],t[5]=s?Jj(s,l,e[6]):l,t[6]=s?Ah(t[5],YN):e[6]),l=e[7],l&&(t[7]=l),o&jy&&(t[8]=t[8]==null?e[8]:Q9(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=r,t}var tU="Expected a function",ZN=1,nU=2,JN=8,QN=16,eP=32,rU=64,tP=Math.max;function fp(t,e,n,o,r,i,a,l){var s=e&nU;if(!s&&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:tP(zo(a),0),l=l===void 0?l:zo(l),f-=r?r.length:0,e&rU){var h=o,v=r;o=r=void 0}var b=s?void 0:H2(t),w=[t,e,n,o,r,h,v,i,a,l];if(b&&eU(w,b),t=w[0],e=w[1],n=w[2],o=w[3],r=w[4],l=w[9]=w[9]===void 0?s?0:t.length:tP(w[9]-f,0),!l&&e&(JN|QN)&&(e&=-25),!e||e==ZN)var O=p9(t,e,n);else e==JN||e==QN?O=Y9(t,e,l):(e==eP||e==(ZN|eP))&&!r.length?O=K9(t,e,n,o):O=RE.apply(void 0,w);var E=b?Kj:eL;return tL(E(O,w),t,e)}var oU=128;function rL(t,e,n){return e=n?void 0:e,e=t&&e==null?t.length:e,fp(t,oU,void 0,void 0,void 0,void 0,e)}var iU=SE(function(t,e){N2(e,rm(e),t)}),pA=SE(function(t,e,n,o){N2(e,rm(e),t,o)}),aU=SE(function(t,e,n,o){N2(e,Zd(e),t,o)});function X2(t,e){for(var n=-1,o=e.length,r=Array(o),i=t==null;++n<o;)r[n]=i?void 0:om(t,e[n]);return r}var sU=im(X2),lU="[object DOMException]",uU="[object Error]";function Y2(t){if(!qd(t))return!1;var e=Kg(t);return e==uU||e==lU||typeof t.message=="string"&&typeof t.name=="string"&&!P2(t)}var oL=Yo(function(t,e){try{return Ju(t,void 0,e)}catch(n){return Y2(n)?n:new Error(n)}}),cU="Expected a function";function iL(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,DE=Yo(function(t,e,n){var o=dU;if(n.length){var r=Ah(n,Qg(DE));o|=fU}return fp(t,o,e,n,r)});DE.placeholder={};var pU=im(function(t,e){return Kd(e,function(n){n=AE(n),ME(t,n,DE(t[n],t))}),t}),hU=1,vU=2,mU=32,q2=Yo(function(t,e,n){var o=hU|vU;if(n.length){var r=Ah(n,Qg(q2));o|=mU}return fp(e,o,t,n,r)});q2.placeholder={};function Dh(t,e,n){var o=t.length;return n=n===void 0?o:n,!e&&n>=o?t:lp(t,e,n)}var gU="\\ud800-\\udfff",yU="\\u0300-\\u036f",_U="\\ufe20-\\ufe2f",bU="\\u20d0-\\u20ff",wU=yU+_U+bU,EU="\\ufe0e\\ufe0f",xU="\\u200d",OU=RegExp("["+xU+gU+wU+EU+"]");function ey(t){return OU.test(t)}function SU(t){return t.split("")}var aL="\\ud800-\\udfff",AU="\\u0300-\\u036f",MU="\\ufe20-\\ufe2f",TU="\\u20d0-\\u20ff",CU=AU+MU+TU,NU="\\ufe0e\\ufe0f",PU="["+aL+"]",hA="["+CU+"]",vA="\\ud83c[\\udffb-\\udfff]",kU="(?:"+hA+"|"+vA+")",sL="[^"+aL+"]",lL="(?:\\ud83c[\\udde6-\\uddff]){2}",uL="[\\ud800-\\udbff][\\udc00-\\udfff]",RU="\\u200d",cL=kU+"?",dL="["+NU+"]?",DU="(?:"+RU+"(?:"+[sL,lL,uL].join("|")+")"+dL+cL+")*",jU=dL+cL+DU,LU="(?:"+[sL+hA+"?",hA,lL,uL,PU].join("|")+")",IU=RegExp(vA+"(?="+vA+")|"+LU+jU,"g");function FU(t){return t.match(IU)||[]}function ed(t){return ey(t)?FU(t):SU(t)}function fL(t){return function(e){e=Ri(e);var n=ey(e)?ed(e):void 0,o=n?n[0]:e.charAt(0),r=n?Dh(n,1).join(""):e.slice(1);return o[t]()+r}}var K2=fL("toUpperCase");function pL(t){return K2(Ri(t).toLowerCase())}function Z2(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=Z2(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 hL(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 vL="\\ud800-\\udfff",JU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",eV="\\u20d0-\\u20ff",tV=JU+QU+eV,mL="\\u2700-\\u27bf",gL="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",yL="A-Z\\xc0-\\xd6\\xd8-\\xde",aV="\\ufe0e\\ufe0f",_L=nV+rV+oV+iV,bL="[']",nP="["+_L+"]",sV="["+tV+"]",wL="\\d+",lV="["+mL+"]",EL="["+gL+"]",xL="[^"+vL+_L+wL+mL+gL+yL+"]",uV="\\ud83c[\\udffb-\\udfff]",cV="(?:"+sV+"|"+uV+")",dV="[^"+vL+"]",OL="(?:\\ud83c[\\udde6-\\uddff]){2}",SL="[\\ud800-\\udbff][\\udc00-\\udfff]",fg="["+yL+"]",fV="\\u200d",rP="(?:"+EL+"|"+xL+")",pV="(?:"+fg+"|"+xL+")",oP="(?:"+bL+"(?:d|ll|m|re|s|t|ve))?",iP="(?:"+bL+"(?:D|LL|M|RE|S|T|VE))?",AL=cV+"?",ML="["+aV+"]?",hV="(?:"+fV+"(?:"+[dV,OL,SL].join("|")+")"+ML+AL+")*",vV="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",mV="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gV=ML+AL+hV,yV="(?:"+[lV,OL,SL].join("|")+")"+gV,_V=RegExp([fg+"?"+EL+"+"+oP+"(?="+[nP,fg,"$"].join("|")+")",pV+"+"+iP+"(?="+[nP,fg+rP,"$"].join("|")+")",fg+"?"+rP+"+"+oP,fg+"+"+iP,mV,vV,wL,yV].join("|"),"g");function bV(t){return t.match(_V)||[]}function TL(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 $j(TL(hL(e).replace(EV,"")),t,"")}}var xV=ty(function(t,e,n){return e=e.toLowerCase(),t+(n?pL(e):e)}),OV=nm.isFinite,SV=Math.min;function J2(t){var e=Math[t];return function(n,o){if(n=kg(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=J2("ceil");function CL(t){var e=ge(t);return e.__chain__=!0,e}var MV=Math.ceil,TV=Math.max;function CV(t,e,n){(n?Nh(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++]=lp(t,r,r+=e);return a}var NV=1,PV=4;function kV(t,e){return e=typeof e=="function"?e:void 0,Zg(t,NV|PV,e)}var RV=4;function DV(t,e){return e=typeof e=="function"?e:void 0,Zg(t,RV,e)}function jV(){return new tc(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)?qu(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?El(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(Ju(i[0],this,o))return Ju(i[1],this,o)}})}function NL(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 NL(n,t,e)}}var $V=1;function UV(t){return BV(Zg(t,$V))}function VV(t,e){return e==null||NL(t,e,Zd(e))}var WV=Object.prototype,GV=WV.hasOwnProperty,zV=V2(function(t,e,n){GV.call(t,n)?++t[n]:ME(t,n,1)});function HV(t,e){var n=z_(t);return e==null?n:g$(n,e)}var XV=8;function Q2(t,e,n){e=n?void 0:e;var o=fp(t,XV,void 0,void 0,void 0,void 0,void 0,e);return o.placeholder=Q2.placeholder,o}Q2.placeholder={};var YV=16;function eM(t,e,n){e=n?void 0:e;var o=fp(t,YV,void 0,void 0,void 0,void 0,void 0,e);return o.placeholder=eM.placeholder,o}eM.placeholder={};function qV(t,e){return t==null||t!==t?e:t}function PL(t,e,n,o,r,i){return sp(t)&&sp(e)&&(i.set(e,t),vj(t,e,void 0,PL,i),i.delete(e)),t}var kL=SE(function(t,e,n,o){vj(t,e,n,o)}),KV=Yo(function(t){return t.push(void 0,PL),Ju(kL,void 0,t)}),ZV="Expected a function";function RL(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 RL(t,1,e)}),QV=Yo(function(t,e,n){return RL(t,kg(e)||0,n)}),eW=Yo(function(t,e){var n=Qu(e);return js(n)&&(n=void 0),js(t)?NE(t,Jd(e,1,js,!0),_i(n)):[]}),tW=Yo(function(t,e){var n=Qu(e);return js(n)&&(n=void 0),js(t)?NE(t,Jd(e,1,js,!0),void 0,n):[]}),nW=PE(function(t,e){return t/e},1);function jE(t,e,n,o){for(var r=t.length,i=o?r:-1;(o?i--:++i<r)&&e(t[i],i,t););return n?lp(t,o?0:i,o?i+1:r):lp(t,o?i+1:0,o?r:i)}function rW(t,e){return t&&t.length?jE(t,_i(e),!0,!0):[]}function oW(t,e){return t&&t.length?jE(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 DL=y$(!0);function tM(t,e){return t&&DL(t,e,Zd)}var jL=_$(tM,!0);function aW(t,e){var n=qa(t)?iW:jL;return n(t,sm(e))}function sW(t,e,n){t=Ri(t),e=Jc(e);var o=t.length;n=n===void 0?o:Jg(zo(n),0,o);var r=n;return n-=e.length,n>=0&&t.slice(n,r)==e}function lW(t,e){return El(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 LL(t){return function(e){var n=TE(e);return n==cW?mj(e):n==dW?uW(e):lW(e,t(e))}}var pp=LL(Zd),fW=LL(rm),pW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},hW=Z2(pW),IL=/[&<>"']/g,vW=RegExp(IL.source);function FL(t){return t=Ri(t),t&&vW.test(t)?t.replace(IL,hW):t}var BL=/[\\^$.*+?()[\]{}|]/g,mW=RegExp(BL.source);function gW(t){return t=Ri(t),t&&mW.test(t)?t.replace(BL,"\\$&"):t}var yW=4294967295;function $L(t){return t?Jg(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:$L(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"&&Nh(t,e,n)&&(n=0,o=r),_W(t,e,n,o)):[]}function UL(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 UL(t,_i(e),am)}var EW=N7(gj);function xW(t,e){return UL(t,_i(e),tM)}var OW=1/0;function SW(t,e){return Jd(ec(t,e),OW)}function AW(t,e,n){return n=n===void 0?1:zo(n),Jd(ec(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 fp(t,TW)}var NW=J2("floor"),PW="Expected a function",kW=8,RW=32,DW=128,jW=256;function VL(t){return im(function(e){var n=e.length,o=n,r=tc.prototype.thru;for(t&&e.reverse();o--;){var i=e[o];if(typeof i!="function")throw new TypeError(PW);if(r&&!a&&H0(i)=="wrapper")var a=new tc([],!0)}for(o=a?o:n;++o<n;){i=e[o];var l=H0(i),s=l=="wrapper"?H2(i):void 0;s&&fA(s[0])&&s[1]==(DW|kW|RW|jW)&&!s[4].length&&s[9]==1?a=a[H0(s[0])].apply(a,s[3]):a=i.length==1&&fA(i)?a[l]():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,b=n?e[v].apply(this,f):h;++v<n;)b=e[v].call(this,b);return b}})}var LW=VL(),IW=VL(!0);function FW(t,e){return t==null?t:DL(t,sm(e),rm)}function BW(t,e){return t&&tM(t,sm(e))}function LE(t,e){return Y_(e,function(n){return Ph(t[n])})}function $W(t){return t==null?[]:LE(t,Zd(t))}function UW(t){return t==null?[]:LE(t,rm(t))}function IE(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=kg(e),n=kg(n)),t(e,n)}}var VW=IE(Hj),WW=IE(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=kg(t),HW(t,e,n)}function YW(t){var e=t==null?0:t.length;return e?lp(t,0,-1):[]}var qW=Math.min;function nM(t,e,n){for(var o=n?w$:hj,r=t[0].length,i=t.length,a=i,l=Array(i),s=1/0,f=[];a--;){var h=t[a];a&&e&&(h=El(h,Hv(e))),s=qW(h.length,s),l[a]=!n&&(e||r>=120&&h.length>=120)?new b$(a&&h):void 0}h=t[0];var v=-1,b=l[0];e:for(;++v<r&&f.length<s;){var w=h[v],O=e?e(w):w;if(w=n||w!==0?w:0,!(b?FN(b,O):o(f,O,n))){for(a=i;--a;){var E=l[a];if(!(E?FN(E,O):o(t[a],O,n)))continue e}b&&b.push(O),f.push(w)}}return f}function rM(t){return js(t)?t:[]}var KW=Yo(function(t){var e=El(t,rM);return e.length&&e[0]===t[0]?nM(e):[]}),ZW=Yo(function(t){var e=Qu(t),n=El(t,rM);return e===Qu(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?nM(n,_i(e)):[]}),JW=Yo(function(t){var e=Qu(t),n=El(t,rM);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?nM(n,void 0,e):[]});function QW(t,e,n,o){return am(t,function(r,i,a){e(o,n(r),i,a)}),o}function WL(t,e){return function(n,o){return QW(n,t,e(o),{})}}var eG=Object.prototype,tG=eG.toString,nG=WL(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=tG.call(e)),t[e]=n},yj(tm)),GL=Object.prototype,rG=GL.hasOwnProperty,oG=GL.toString,iG=WL(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=_j(e,t),t=E$(t,e);var o=t==null?t:t[AE(Qu(e))];return o==null?void 0:Ju(o,t,n)}var aG=Yo(Q_),sG=Yo(function(t,e,n){var o=-1,r=typeof e=="function",i=CE(t)?Array(t.length):[];return x$(t,function(a){i[++o]=r?Ju(e,a,n):Q_(a,e,n)}),i}),lG="[object ArrayBuffer]";function uG(t){return qd(t)&&Kg(t)==lG}var aP=uw&&uw.isArrayBuffer,cG=aP?Hv(aP):uG,dG="[object Boolean]";function mw(t){return t===!0||t===!1||qd(t)&&Kg(t)==dG}var fG="[object Date]";function pG(t){return qd(t)&&Kg(t)==fG}var sP=uw&&uw.isDate,hG=sP?Hv(sP):pG;function vG(t){return qd(t)&&t.nodeType===1&&!P2(t)}function mG(t,e,n){n=typeof n=="function"?n:void 0;var o=n?n(t,e):void 0;return o===void 0?O$(t,e,void 0,n):!!o}var gG=nm.isFinite;function yG(t){return typeof t=="number"&&gG(t)}function zL(t){return typeof t=="number"&&t==zo(t)}function _G(t,e){return t===e||bj(t,e,wj(e))}function bG(t,e,n){return n=typeof n=="function"?n:void 0,bj(t,e,wj(e),n)}var wG="[object Number]";function HL(t){return typeof t=="number"||qd(t)&&Kg(t)==wG}function EG(t){return HL(t)&&t!=+t}var xG=S$?Ph:Ej,OG="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function SG(t){if(xG(t))throw new Error(OG);return A$(t)}var lP=9007199254740991;function AG(t){return zL(t)&&t>=-lP&&t<=lP}var MG="[object WeakMap]";function TG(t){return qd(t)&&TE(t)==MG}var CG="[object WeakSet]";function NG(t){return qd(t)&&Kg(t)==CG}var PG=1;function kG(t){return _i(typeof t=="function"?t:Zg(t,PG))}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=V2(function(t,e,n){ME(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):M$(t,T$,r,!0)}var VG=ty(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),WG=fL("toLowerCase"),GG=IE(P7),zG=IE(function(t,e){return t<=e});function XL(t,e){var n={};return e=_i(e),am(t,function(o,r,i){ME(n,e(o,r,i),o)}),n}var HG=1;function XG(t){return C$(Zg(t,HG))}var YG=1;function qG(t,e){return N$(t,Zg(e,YG))}function KG(t,e){return t&&t.length?k7(t,_i(e),Hj):void 0}function oM(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 YL(t,e){var n=t==null?0:t.length;return n?oM(t,e)/n:ZG}function JG(t){return YL(t,tm)}function QG(t,e){return YL(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=LE(e,o),i=!(sp(n)&&"chain"in n)||!!n.chain,a=Ph(t);return Kd(r,function(l){var s=e[l];t[l]=s,a&&(t.prototype[l]=function(){var f=this.__chain__;if(i||f){var h=t(this.__wrapped__),v=h.__actions__=qu(this.__actions__);return v.push({func:s,args:arguments,thisArg:t}),h.__chain__=f,h}return s.apply(t,X_([this.value()],arguments))})}),t}var rz=PE(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 qL(t){if(!t)return[];if(CE(t))return W2(t)?ed(t):qu(t);if(qO&&t[qO])return oz(t[qO]());var e=TE(t),n=e==iz?mj:e==az?P$:J_;return n(t)}function sz(){this.__values__===void 0&&(this.__values__=qL(this.value()));var t=this.__index__>=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function KL(t,e){var n=t.length;if(n)return e+=e<0?n:0,H_(e,n)?t[e]:void 0}function lz(t,e){return t&&t.length?KL(t,zo(e)):void 0}function uz(t){return t=zo(t),Yo(function(e){return KL(e,t)})}function cz(t,e){return Gj(t,G2(_i(e)))}function dz(t){return iL(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]),Y7(t,e,n))}function iM(t){return im(function(e){return e=El(e,Hv(_i)),Yo(function(n){var o=this;return t(e,function(r){return Ju(r,o,n)})})})}var pz=iM(El),hz=Yo,vz=Math.min,mz=hz(function(t,e){e=e.length==1&&qa(e[0])?El(e[0],Hv(_i)):El(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 Ju(t,this,o)})}),gz=iM(j7),yz=iM(k$),_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=xj("length"),ZL="\\ud800-\\udfff",Ez="\\u0300-\\u036f",xz="\\ufe20-\\ufe2f",Oz="\\u20d0-\\u20ff",Sz=Ez+xz+Oz,Az="\\ufe0e\\ufe0f",Mz="["+ZL+"]",gA="["+Sz+"]",yA="\\ud83c[\\udffb-\\udfff]",Tz="(?:"+gA+"|"+yA+")",JL="[^"+ZL+"]",QL="(?:\\ud83c[\\udde6-\\uddff]){2}",eI="[\\ud800-\\udbff][\\udc00-\\udfff]",Cz="\\u200d",tI=Tz+"?",nI="["+Az+"]?",Nz="(?:"+Cz+"(?:"+[JL,QL,eI].join("|")+")"+nI+tI+")*",Pz=nI+tI+Nz,kz="(?:"+[JL+gA+"?",gA,QL,eI,Mz].join("|")+")",uP=RegExp(yA+"(?="+yA+")|"+kz+Pz,"g");function Rz(t){for(var e=uP.lastIndex=0;uP.test(t);)++e;return e}function ny(t){return ey(t)?Rz(t):wz(t)}var Dz=Math.ceil;function gw(t,e){e=e===void 0?" ":Jc(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(ed(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 gw(Lz(r),n)+t+gw(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+gw(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?gw(e-o,n)+t:t}var $z=/^\s+/,Uz=nm.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,FE=Yo(function(t,e){var n=Ah(e,Qg(FE));return fp(t,Wz,void 0,e,n)});FE.placeholder={};var Gz=64,aM=Yo(function(t,e){var n=Ah(e,Qg(aM));return fp(t,Gz,void 0,e,n)});aM.placeholder={};var zz=V2(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});function Hz(t){for(var e,n=this;n instanceof kE;){var o=Qj(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:Oj(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,cP=qz.splice;function sM(t,e,n,o){var r=o?Yz:k2,i=-1,a=e.length,l=t;for(t===e&&(e=qu(e)),n&&(l=El(t,Hv(n)));++i<a;)for(var s=0,f=e[i],h=n?n(f):f;(s=r(l,h,s,o))>-1;)l!==t&&cP.call(l,s,1),cP.call(t,s,1);return t}function rI(t,e){return t&&t.length&&e&&e.length?sM(t,e):t}var Kz=Yo(rI);function Zz(t,e,n){return t&&t.length&&e&&e.length?sM(t,e,_i(n)):t}function Jz(t,e,n){return t&&t.length&&e&&e.length?sM(t,e,void 0,n):t}var Qz=Array.prototype,eH=Qz.splice;function oI(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):Sj(t,r)}}return t}var tH=im(function(t,e){var n=t==null?0:t.length,o=X2(t,e);return oI(t,El(e,function(r){return H_(r,n)?+r:r}).sort(q7)),o}),nH=Math.floor,rH=Math.random;function lM(t,e){return t+nH(rH()*(e-t+1))}var oH=parseFloat,iH=Math.min,aH=Math.random;function sH(t,e,n){if(n&&typeof n!="boolean"&&Nh(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 lM(t,e)}var lH=K7(!0),uH=256,cH=im(function(t,e){return fp(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:T7,r=arguments.length<3;return o(t,_i(e),n,r,jL)}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 oI(t,r),n}function hH(t,e,n){return(n?Nh(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 mH="Expected a function";function gH(t,e){if(typeof t!="function")throw new TypeError(mH);return e=e===void 0?e:zo(e),Yo(t,e)}function yH(t,e,n){e=_j(e,t);var o=-1,r=e.length;for(r||(r=1,t=void 0);++o<r;){var i=t==null?void 0:t[AE(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 _A(t){return t==null?t:bH.call(t)}var wH=J2("round");function iI(t){var e=t.length;return e?t[lM(0,e-1)]:void 0}function EH(t){return iI(J_(t))}function xH(t){var e=qa(t)?iI:EH;return e(t)}function BE(t,e){var n=-1,o=t.length,r=o-1;for(e=e===void 0?o:e;++n<e;){var i=lM(n,r),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function OH(t,e){return BE(qu(t),Jg(e,0,t.length))}function SH(t,e){var n=J_(t);return BE(n,Jg(e,0,n.length))}function AH(t,e,n){(n?Nh(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:R2(t,e,n,o)}function TH(t){return BE(qu(t))}function CH(t){return BE(J_(t))}function NH(t){var e=qa(t)?TH:CH;return e(t)}var PH="[object Map]",kH="[object Set]";function RH(t){if(t==null)return 0;if(CE(t))return W2(t)?ny(t):t.length;var e=TE(t);return e==PH||e==kH?t.size:R$(t).length}function DH(t,e,n){var o=t==null?0:t.length;return o?(n&&typeof n!="number"&&Nh(t,e,n)?(e=0,n=o):(e=e==null?0:zo(e),n=n===void 0?o:zo(n)),lp(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 uM(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,l=e===null,s=Pg(e),f=e===void 0;r<i;){var h=FH((r+i)/2),v=n(t[h]),b=v!==void 0,w=v===null,O=v===v,E=Pg(v);if(a)var S=o||O;else f?S=O&&(o||b):l?S=O&&b&&(o||!w):s?S=O&&b&&!w&&(o||!E):w||E?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 $E(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&&!Pg(a)&&(n?a<=e:a<e)?o=i+1:r=i}return r}return uM(t,e,tm,n)}function VH(t,e){return $E(t,e)}function WH(t,e,n){return uM(t,e,_i(n))}function GH(t,e){var n=t==null?0:t.length;if(n){var o=$E(t,e);if(o<n&&q_(t[o],e))return o}return-1}function zH(t,e){return $E(t,e,!0)}function HH(t,e,n){return uM(t,e,_i(n),!0)}function XH(t,e){var n=t==null?0:t.length;if(n){var o=$E(t,e,!0)-1;if(q_(t[o],e))return o}return-1}function aI(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n],l=e?e(a):a;if(!n||!q_(l,s)){var s=l;i[r++]=a===0?0:a}}return i}function YH(t){return t&&t.length?aI(t):[]}function qH(t,e){return t&&t.length?aI(t,_i(e)):[]}var KH=4294967295;function ZH(t,e,n){return n&&typeof n!="number"&&Nh(t,e,n)&&(e=n=void 0),n=n===void 0?KH:n>>>0,n?(t=Ri(t),t&&(typeof e=="string"||e!=null&&!z2(e))&&(e=Jc(e),!e&&ey(t))?Dh(ed(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),Ju(t,this,r)})}var tX=ty(function(t,e,n){return t+(n?" ":"")+K2(e)});function nX(t,e,n){return t=Ri(t),n=n==null?0:Jg(zo(n),0,t.length),e=Jc(e),t.slice(n,n+e.length)==e}function rX(){return{}}function oX(){return""}function iX(){return!0}var aX=PE(function(t,e){return t-e},0);function sX(t){return t&&t.length?oM(t,tm):0}function lX(t,e){return t&&t.length?oM(t,_i(e)):0}function uX(t){var e=t==null?0:t.length;return e?lp(t,1,e):[]}function cX(t,e,n){return t&&t.length?(e=n||e===void 0?1:zo(e),lp(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,lp(t,e<0?0:e,o)):[]}function fX(t,e){return t&&t.length?jE(t,_i(e),!1,!0):[]}function pX(t,e){return t&&t.length?jE(t,_i(e)):[]}function hX(t,e){return e(t),t}var sI=Object.prototype,vX=sI.hasOwnProperty;function dP(t,e,n,o){return t===void 0||q_(t,sI[n])&&!vX.call(o,n)?e:t}var mX={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gX(t){return"\\"+mX[t]}var lI=/<%=([\s\S]+?)%>/g,yX=/<%-([\s\S]+?)%>/g,_X=/<%([\s\S]+?)%>/g,bA={escape:yX,evaluate:_X,interpolate:lI,variable:"",imports:{_:{escape:FL}}},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,fP=MX.hasOwnProperty;function TX(t,e,n){var o=bA.imports._.templateSettings||bA;n&&Nh(t,e,n)&&(e=void 0),t=Ri(t),e=pA({},e,o,dP);var r=pA({},e.imports,o.imports,dP),i=Zd(r),a=Uj(r,i),l,s,f=0,h=e.interpolate||d0,v="__p += '",b=RegExp((e.escape||d0).source+"|"+h.source+"|"+(h===lI?SX:d0).source+"|"+(e.evaluate||d0).source+"|$","g"),w=fP.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
`:"";t.replace(b,function(S,M,C,$,D,k){return C||(C=$),v+=t.slice(f,k).replace(AX,gX),M&&(l=!0,v+=`' +
__e(`+M+`) +
'`),D&&(s=!0,v+=`';
`+D+`;
__p += '`),C&&(v+=`' +
((__t = (`+C+`)) == null ? '' : __t) +
'`),f=k+S.length,S}),v+=`';
`;var O=fP.call(e,"variable")&&e.variable;if(!O)v=`with (obj) {
`+v+`
}
`;else if(OX.test(O))throw new Error(bX);v=(s?v.replace(wX,""):v).replace(EX,"$1").replace(xX,"$1;"),v="function("+(O||"obj")+`) {
`+(O?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(s?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+v+`return __p
}`;var E=oL(function(){return Function(i,w+"return "+v).apply(void 0,a)});if(E.source=v,Y2(E))throw E;return E}function UE(t,e){return e(t)}var CX=9007199254740991,KO=4294967295,NX=Math.min;function PX(t,e){if(t=zo(t),t<1||t>CX)return[];var n=KO,o=NX(t,KO);e=sm(e),t-=KO;for(var r=Aj(o,e);++n<t;)e(n);return r}function kX(){return this}function uI(t,e){var n=t;return n instanceof $o&&(n=n.value()),$j(e,function(o,r){return r.func.apply(r.thisArg,X_([o],r.args))},n)}function RX(){return uI(this.__wrapped__,this.__actions__)}function DX(t){return Ri(t).toLowerCase()}function jX(t){return qa(t)?El(t,AE):Pg(t)?[t]:qu(D$(Ri(t)))}var pP=9007199254740991;function LX(t){return t?Jg(zo(t),-pP,pP):t===0?t:0}function IX(t){return Ri(t).toUpperCase()}function FX(t,e,n){var o=qa(t),r=o||Mj(t)||Tj(t);if(e=_i(e),n==null){var i=t&&t.constructor;r?n=o?new i:[]:sp(t)?n=Ph(i)?z_(j$(t)):{}:n={}}return(r?Kd:am)(t,function(a,l,s){return e(n,a,l,s)}),n}function cI(t,e){for(var n=t.length;n--&&k2(e,t[n],0)>-1;);return n}function dI(t,e){for(var n=-1,o=t.length;++n<o&&k2(e,t[n],0)>-1;);return n}function BX(t,e,n){if(t=Ri(t),t&&(n||e===void 0))return L$(t);if(!t||!(e=Jc(e)))return t;var o=ed(t),r=ed(e),i=dI(o,r),a=cI(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,I$(t)+1);if(!t||!(e=Jc(e)))return t;var o=ed(t),r=cI(o,ed(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=Jc(e)))return t;var o=ed(t),r=dI(o,ed(e));return Dh(o,r).join("")}var WX=30,GX="...",zX=/\w*$/;function HX(t,e){var n=WX,o=GX;if(sp(e)){var r="separator"in e?e.separator:r;n="length"in e?zo(e.length):n,o="omission"in e?Jc(e.omission):o}t=Ri(t);var i=t.length;if(ey(t)){var a=ed(t);i=a.length}if(n>=i)return t;var l=n-ny(o);if(l<1)return o;var s=a?Dh(a,0,l).join(""):t.slice(0,l);if(r===void 0)return s+o;if(a&&(l+=s.length-l),z2(r)){if(t.slice(l).search(r)){var f,h=s;for(r.global||(r=RegExp(r.source,Ri(zX.exec(r))+"g")),r.lastIndex=0;f=r.exec(h);)var v=f.index;s=s.slice(0,v===void 0?l:v)}}else if(t.indexOf(Jc(r),l)!=l){var b=s.lastIndexOf(r);b>-1&&(s=s.slice(0,b))}return s+o}function XX(t){return rL(t,1)}var YX={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},qX=Z2(YX),fI=/&(?:amp|lt|gt|quot|#39);/g,KX=RegExp(fI.source);function ZX(t){return t=Ri(t),t&&KX.test(t)?t.replace(fI,qX):t}var JX=Yo(function(t){var e=Qu(t);return js(e)&&(e=void 0),E_(Jd(t,1,js,!0),_i(e))}),QX=Yo(function(t){var e=Qu(t);return e=typeof e=="function"?e:void 0,E_(Jd(t,1,js,!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:Sj(t,e)}var nY=Math.max;function cM(t){if(!(t&&t.length))return[];var e=0;return t=Y_(t,function(n){if(js(n))return e=nY(n.length,e),!0}),Aj(e,function(n){return El(t,xj(n))})}function pI(t,e){if(!(t&&t.length))return[];var n=cM(t);return e==null?n:El(n,function(o){return Ju(e,void 0,o)})}function hI(t,e,n,o){return R2(t,e,n(Oj(t,e)),o)}function rY(t,e,n){return t==null?t:hI(t,e,sm(n))}function oY(t,e,n,o){return o=typeof o=="function"?o:void 0,t==null?t:hI(t,e,sm(n),o)}var iY=ty(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function aY(t){return t==null?[]:Uj(t,rm(t))}var sY=Yo(function(t,e){return js(t)?NE(t,e):[]});function lY(t,e){return FE(sm(e),t)}var uY=im(function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(i){return X2(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:UE,args:[r],thisArg:void 0}),new tc(o,this.__chain__).thru(function(i){return e&&!i.length&&i.push(void 0),i}))});function cY(){return CL(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:UE,args:[_A],thisArg:void 0}),new tc(e,this.__chain__)}return this.thru(_A)}function dM(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],l=-1;++l<o;)l!=r&&(i[r]=NE(i[r]||a,t[l],e,n));return E_(Jd(i,1),e,n)}var fY=Yo(function(t){return dM(Y_(t,js))}),pY=Yo(function(t){var e=Qu(t);return js(e)&&(e=void 0),dM(Y_(t,js),_i(e))}),hY=Yo(function(t){var e=Qu(t);return e=typeof e=="function"?e:void 0,dM(Y_(t,js),void 0,e)}),vY=Yo(cM);function mY(t,e){return Z7(t||[],e||[],R2)}var gY=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,pI(t,n)});const mr={chunk:CV,compact:L7,concat:LV,difference:I7,differenceBy:eW,differenceWith:tW,drop:F7,dropRight:B7,dropRightWhile:rW,dropWhile:oW,fill:bW,findIndex:Wj,findLastIndex:gj,flatten:F$,flattenDeep:B$,flattenDepth:MW,fromPairs:$$,head:V7,indexOf:zj,initial:YW,intersection:KW,intersectionBy:ZW,intersectionWith:JW,join:jG,lastIndexOf:UG,nth:lz,pull:Kz,pullAll:rI,pullAllBy:Zz,pullAllWith:Jz,pullAt:tH,remove:pH,reverse:_A,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:U$,unionBy:JX,unionWith:QX,uniq:$7,uniqBy:U7,uniqWith:eY,unzip:cM,unzipWith:pI,without:sY,xor:fY,xorBy:pY,xorWith:hY,zip:vY,zipObject:J7,zipObjectDeep:mY,zipWith:gY},Di={countBy:zV,every:z7,filter:C7,find:Sh,findLast:EW,flatMap:V$,flatMapDeep:SW,flatMapDepth:AW,forEach:ri,forEachRight:aW,groupBy:W7,includes:H7,invokeMap:sG,keyBy:IG,map:ec,orderBy:fz,partition:zz,reduce:Vj,reduceRight:fH,reject:G7,sample:xH,sampleSize:AH,shuffle:NH,size:RH,some:X7,sortBy:Q7},yY={now:W$},Ta={after:d9,ary:rL,before:iL,bind:DE,bindKey:q2,curry:Q2,curryRight:eM,debounce:D2,defer:JV,delay:QV,flip:CW,memoize:G$,once:dz,overArgs:mz,partial:FE,partialRight:aM,rearg:cH,rest:gH,spread:eX,throttle:Cj,unary:XX,wrap:lY},Vr={castArray:z$,clone:X$,cloneDeep:to,cloneDeepWith:kV,cloneWith:DV,conformsTo:VV,eq:q_,gt:VW,gte:WW,isArguments:Y$,isArrayBuffer:cG,isArrayLike:CE,isArrayLikeObject:js,isBoolean:mw,isBuffer:Mj,isDate:hG,isElement:vG,isEmpty:dw,isEqual:uA,isEqualWith:mG,isError:Y2,isFinite:yG,isFunction:Ph,isInteger:zL,isLength:q$,isMap:K$,isMatch:_G,isMatchWith:bG,isNaN:EG,isNative:SG,isNil:wl,isNull:Z$,isNumber:HL,isObjectLike:qd,isPlainObject:P2,isRegExp:z2,isSafeInteger:AG,isSet:J$,isString:W2,isSymbol:Pg,isTypedArray:Tj,isUndefined:Xv,isWeakMap:TG,isWeakSet:NG,lt:GG,lte:zG,toArray:qL,toFinite:w_,toLength:$L,toNumber:kg,toPlainObject:H$,toSafeInteger:LX,toString:Ri},Sl={add:u9,ceil:AV,divide:nW,floor:NW,max:e9,maxBy:KG,mean:JG,meanBy:QG,min:R7,minBy:t9,multiply:rz,round:wH,subtract:aX,sum:sX,sumBy:lX},fM={clamp:Q$,inRange:XW,random:sH},io={assign:Xo,assignIn:iU,assignInWith:pA,assignWith:aU,at:sU,create:HV,defaults:D7,defaultsDeep:KV,findKey:wW,findLastKey:xW,forIn:r9,forInRight:FW,forOwn:o9,forOwnRight:BW,functions:$W,functionsIn:UW,get:om,has:hw,hasIn:t7,invert:nG,invertBy:iG,invoke:aG,keysIn:rm,mapKeys:XL,mapValues:n9,merge:Yv,mergeWith:kL,omit:e7,omitBy:cz,pick:Vv,pickBy:Gj,result:yH,set:Nj,setWith:MH,toPairs:pp,toPairsIn:fW,transform:FX,unset:tY,update:rY,updateWith:oY,values:J_,valuesIn:aY},ef={at:uY,chain:CL,commit:jV,next:sz,plant:Hz,reverse:dY,tap:hX,toIterator:kX,value:RX,wrapperChain:cY},pi={camelCase:xV,capitalize:pL,deburr:hL,endsWith:sW,escape:FL,escapeRegExp:gW,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:bA,toLower:DX,toUpper:IX,trim:BX,trimEnd:$X,trimStart:VX,truncate:HX,unescape:ZX,upperCase:iY,upperFirst:K2,words:TL},bi={attempt:oL,bindAll:pU,cond:FV,conforms:UV,constant:yj,defaultTo:qV,flow:LW,flowRight:IW,iteratee:kG,matches:XG,matchesProperty:qG,method:ez,methodOf:tz,noop:Qy,nthArg:uz,over:pz,overEvery:gz,overSome:yz,property:n7,propertyOf:Xz,range:i9,rangeRight:lH,stubArray:r7,stubFalse:Ej,stubObject:rX,stubString:oX,stubTrue:iX,times:PX,toPath:jX,uniqueId:a9};function _Y(){var t=new $o(this.__wrapped__);return t.__actions__=qu(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=qu(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=qu(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,l=i.end,s=l-a,f=o?l:a-1,h=this.__iteratees__,v=h.length,b=0,w=AY(s,this.__takeCount__);if(!n||!o&&r==s&&w==s)return uI(t,this.__actions__);var O=[];e:for(;s--&&b<w;){f+=e;for(var E=-1,S=t[f];++E<v;){var M=h[E],C=M.iteratee,$=M.type,D=C(S);if($==SY)S=D;else if(!D){if($==OY)continue e;break e}}O[b++]=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,PY=3,vI=4294967295,kY=Array.prototype,RY=Object.prototype,mI=RY.hasOwnProperty,hP=cw?cw.iterator:void 0,DY=Math.max,vP=Math.min,pM=(function(t){return function(e,n,o){if(o==null){var r=sp(n),i=r&&Zd(n),a=i&&i.length&&LE(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}})(nz);ge.after=Ta.after;ge.ary=Ta.ary;ge.assign=io.assign;ge.assignIn=io.assignIn;ge.assignInWith=io.assignInWith;ge.assignWith=io.assignWith;ge.at=io.at;ge.before=Ta.before;ge.bind=Ta.bind;ge.bindAll=bi.bindAll;ge.bindKey=Ta.bindKey;ge.castArray=Vr.castArray;ge.chain=ef.chain;ge.chunk=mr.chunk;ge.compact=mr.compact;ge.concat=mr.concat;ge.cond=bi.cond;ge.conforms=bi.conforms;ge.constant=bi.constant;ge.countBy=Di.countBy;ge.create=io.create;ge.curry=Ta.curry;ge.curryRight=Ta.curryRight;ge.debounce=Ta.debounce;ge.defaults=io.defaults;ge.defaultsDeep=io.defaultsDeep;ge.defer=Ta.defer;ge.delay=Ta.delay;ge.difference=mr.difference;ge.differenceBy=mr.differenceBy;ge.differenceWith=mr.differenceWith;ge.drop=mr.drop;ge.dropRight=mr.dropRight;ge.dropRightWhile=mr.dropRightWhile;ge.dropWhile=mr.dropWhile;ge.fill=mr.fill;ge.filter=Di.filter;ge.flatMap=Di.flatMap;ge.flatMapDeep=Di.flatMapDeep;ge.flatMapDepth=Di.flatMapDepth;ge.flatten=mr.flatten;ge.flattenDeep=mr.flattenDeep;ge.flattenDepth=mr.flattenDepth;ge.flip=Ta.flip;ge.flow=bi.flow;ge.flowRight=bi.flowRight;ge.fromPairs=mr.fromPairs;ge.functions=io.functions;ge.functionsIn=io.functionsIn;ge.groupBy=Di.groupBy;ge.initial=mr.initial;ge.intersection=mr.intersection;ge.intersectionBy=mr.intersectionBy;ge.intersectionWith=mr.intersectionWith;ge.invert=io.invert;ge.invertBy=io.invertBy;ge.invokeMap=Di.invokeMap;ge.iteratee=bi.iteratee;ge.keyBy=Di.keyBy;ge.keys=Zd;ge.keysIn=io.keysIn;ge.map=Di.map;ge.mapKeys=io.mapKeys;ge.mapValues=io.mapValues;ge.matches=bi.matches;ge.matchesProperty=bi.matchesProperty;ge.memoize=Ta.memoize;ge.merge=io.merge;ge.mergeWith=io.mergeWith;ge.method=bi.method;ge.methodOf=bi.methodOf;ge.mixin=pM;ge.negate=G2;ge.nthArg=bi.nthArg;ge.omit=io.omit;ge.omitBy=io.omitBy;ge.once=Ta.once;ge.orderBy=Di.orderBy;ge.over=bi.over;ge.overArgs=Ta.overArgs;ge.overEvery=bi.overEvery;ge.overSome=bi.overSome;ge.partial=Ta.partial;ge.partialRight=Ta.partialRight;ge.partition=Di.partition;ge.pick=io.pick;ge.pickBy=io.pickBy;ge.property=bi.property;ge.propertyOf=bi.propertyOf;ge.pull=mr.pull;ge.pullAll=mr.pullAll;ge.pullAllBy=mr.pullAllBy;ge.pullAllWith=mr.pullAllWith;ge.pullAt=mr.pullAt;ge.range=bi.range;ge.rangeRight=bi.rangeRight;ge.rearg=Ta.rearg;ge.reject=Di.reject;ge.remove=mr.remove;ge.rest=Ta.rest;ge.reverse=mr.reverse;ge.sampleSize=Di.sampleSize;ge.set=io.set;ge.setWith=io.setWith;ge.shuffle=Di.shuffle;ge.slice=mr.slice;ge.sortBy=Di.sortBy;ge.sortedUniq=mr.sortedUniq;ge.sortedUniqBy=mr.sortedUniqBy;ge.split=pi.split;ge.spread=Ta.spread;ge.tail=mr.tail;ge.take=mr.take;ge.takeRight=mr.takeRight;ge.takeRightWhile=mr.takeRightWhile;ge.takeWhile=mr.takeWhile;ge.tap=ef.tap;ge.throttle=Ta.throttle;ge.thru=UE;ge.toArray=Vr.toArray;ge.toPairs=io.toPairs;ge.toPairsIn=io.toPairsIn;ge.toPath=bi.toPath;ge.toPlainObject=Vr.toPlainObject;ge.transform=io.transform;ge.unary=Ta.unary;ge.union=mr.union;ge.unionBy=mr.unionBy;ge.unionWith=mr.unionWith;ge.uniq=mr.uniq;ge.uniqBy=mr.uniqBy;ge.uniqWith=mr.uniqWith;ge.unset=io.unset;ge.unzip=mr.unzip;ge.unzipWith=mr.unzipWith;ge.update=io.update;ge.updateWith=io.updateWith;ge.values=io.values;ge.valuesIn=io.valuesIn;ge.without=mr.without;ge.words=pi.words;ge.wrap=Ta.wrap;ge.xor=mr.xor;ge.xorBy=mr.xorBy;ge.xorWith=mr.xorWith;ge.zip=mr.zip;ge.zipObject=mr.zipObject;ge.zipObjectDeep=mr.zipObjectDeep;ge.zipWith=mr.zipWith;ge.entries=io.toPairs;ge.entriesIn=io.toPairsIn;ge.extend=io.assignIn;ge.extendWith=io.assignInWith;pM(ge,ge);ge.add=Sl.add;ge.attempt=bi.attempt;ge.camelCase=pi.camelCase;ge.capitalize=pi.capitalize;ge.ceil=Sl.ceil;ge.clamp=fM.clamp;ge.clone=Vr.clone;ge.cloneDeep=Vr.cloneDeep;ge.cloneDeepWith=Vr.cloneDeepWith;ge.cloneWith=Vr.cloneWith;ge.conformsTo=Vr.conformsTo;ge.deburr=pi.deburr;ge.defaultTo=bi.defaultTo;ge.divide=Sl.divide;ge.endsWith=pi.endsWith;ge.eq=Vr.eq;ge.escape=pi.escape;ge.escapeRegExp=pi.escapeRegExp;ge.every=Di.every;ge.find=Di.find;ge.findIndex=mr.findIndex;ge.findKey=io.findKey;ge.findLast=Di.findLast;ge.findLastIndex=mr.findLastIndex;ge.findLastKey=io.findLastKey;ge.floor=Sl.floor;ge.forEach=Di.forEach;ge.forEachRight=Di.forEachRight;ge.forIn=io.forIn;ge.forInRight=io.forInRight;ge.forOwn=io.forOwn;ge.forOwnRight=io.forOwnRight;ge.get=io.get;ge.gt=Vr.gt;ge.gte=Vr.gte;ge.has=io.has;ge.hasIn=io.hasIn;ge.head=mr.head;ge.identity=tm;ge.includes=Di.includes;ge.indexOf=mr.indexOf;ge.inRange=fM.inRange;ge.invoke=io.invoke;ge.isArguments=Vr.isArguments;ge.isArray=qa;ge.isArrayBuffer=Vr.isArrayBuffer;ge.isArrayLike=Vr.isArrayLike;ge.isArrayLikeObject=Vr.isArrayLikeObject;ge.isBoolean=Vr.isBoolean;ge.isBuffer=Vr.isBuffer;ge.isDate=Vr.isDate;ge.isElement=Vr.isElement;ge.isEmpty=Vr.isEmpty;ge.isEqual=Vr.isEqual;ge.isEqualWith=Vr.isEqualWith;ge.isError=Vr.isError;ge.isFinite=Vr.isFinite;ge.isFunction=Vr.isFunction;ge.isInteger=Vr.isInteger;ge.isLength=Vr.isLength;ge.isMap=Vr.isMap;ge.isMatch=Vr.isMatch;ge.isMatchWith=Vr.isMatchWith;ge.isNaN=Vr.isNaN;ge.isNative=Vr.isNative;ge.isNil=Vr.isNil;ge.isNull=Vr.isNull;ge.isNumber=Vr.isNumber;ge.isObject=sp;ge.isObjectLike=Vr.isObjectLike;ge.isPlainObject=Vr.isPlainObject;ge.isRegExp=Vr.isRegExp;ge.isSafeInteger=Vr.isSafeInteger;ge.isSet=Vr.isSet;ge.isString=Vr.isString;ge.isSymbol=Vr.isSymbol;ge.isTypedArray=Vr.isTypedArray;ge.isUndefined=Vr.isUndefined;ge.isWeakMap=Vr.isWeakMap;ge.isWeakSet=Vr.isWeakSet;ge.join=mr.join;ge.kebabCase=pi.kebabCase;ge.last=Qu;ge.lastIndexOf=mr.lastIndexOf;ge.lowerCase=pi.lowerCase;ge.lowerFirst=pi.lowerFirst;ge.lt=Vr.lt;ge.lte=Vr.lte;ge.max=Sl.max;ge.maxBy=Sl.maxBy;ge.mean=Sl.mean;ge.meanBy=Sl.meanBy;ge.min=Sl.min;ge.minBy=Sl.minBy;ge.stubArray=bi.stubArray;ge.stubFalse=bi.stubFalse;ge.stubObject=bi.stubObject;ge.stubString=bi.stubString;ge.stubTrue=bi.stubTrue;ge.multiply=Sl.multiply;ge.nth=mr.nth;ge.noop=bi.noop;ge.now=yY.now;ge.pad=pi.pad;ge.padEnd=pi.padEnd;ge.padStart=pi.padStart;ge.parseInt=pi.parseInt;ge.random=fM.random;ge.reduce=Di.reduce;ge.reduceRight=Di.reduceRight;ge.repeat=pi.repeat;ge.replace=pi.replace;ge.result=io.result;ge.round=Sl.round;ge.sample=Di.sample;ge.size=Di.size;ge.snakeCase=pi.snakeCase;ge.some=Di.some;ge.sortedIndex=mr.sortedIndex;ge.sortedIndexBy=mr.sortedIndexBy;ge.sortedIndexOf=mr.sortedIndexOf;ge.sortedLastIndex=mr.sortedLastIndex;ge.sortedLastIndexBy=mr.sortedLastIndexBy;ge.sortedLastIndexOf=mr.sortedLastIndexOf;ge.startCase=pi.startCase;ge.startsWith=pi.startsWith;ge.subtract=Sl.subtract;ge.sum=Sl.sum;ge.sumBy=Sl.sumBy;ge.template=pi.template;ge.times=bi.times;ge.toFinite=Vr.toFinite;ge.toInteger=zo;ge.toLength=Vr.toLength;ge.toLower=pi.toLower;ge.toNumber=Vr.toNumber;ge.toSafeInteger=Vr.toSafeInteger;ge.toString=Vr.toString;ge.toUpper=pi.toUpper;ge.trim=pi.trim;ge.trimEnd=pi.trimEnd;ge.trimStart=pi.trimStart;ge.truncate=pi.truncate;ge.unescape=pi.unescape;ge.uniqueId=bi.uniqueId;ge.upperCase=pi.upperCase;ge.upperFirst=pi.upperFirst;ge.each=Di.forEach;ge.eachRight=Di.forEachRight;ge.first=mr.head;pM(ge,(function(){var t={};return am(ge,function(e,n){mI.call(ge.prototype,n)||(t[n]=e)}),t})(),{chain:!1});ge.VERSION=TY;(ge.templateSettings=pi.templateSettings).imports._=ge;Kd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){ge[t].placeholder=ge});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__=vP(n,o.__takeCount__):o.__views__.push({size:vP(n,vI),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==PY;$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(tm)};$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(G2(_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(vI)};am($o.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=ge[o?"take"+(e=="last"?"Right":""):e],i=o||/^find/.test(e);r&&(ge.prototype[e]=function(){var a=this.__wrapped__,l=o?[1]:arguments,s=a instanceof $o,f=l[0],h=s||qa(a),v=function(M){var C=r.apply(ge,X_([M],l));return o&&b?C[0]:C};h&&n&&typeof f=="function"&&f.length!=1&&(s=h=!1);var b=this.__chain__,w=!!this.__actions__.length,O=i&&!b,E=s&&!w;if(!i&&h){a=E?a:new $o(this);var S=t.apply(a,l);return S.__actions__.push({func:UE,args:[v],thisArg:void 0}),new tc(S,b)}return O&&E?t.apply(this,l):(S=this.thru(v),O?o?S.value()[0]:S.value():S)})});Kd(["pop","push","shift","sort","splice","unshift"],function(t){var e=kY[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);ge.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)})}});am($o.prototype,function(t,e){var n=ge[e];if(n){var o=n.name+"";mI.call(Og,o)||(Og[o]=[]),Og[o].push({name:e,func:n})}});Og[RE(void 0,CY).name]=[{name:"wrapper",func:void 0}];$o.prototype.clone=_Y;$o.prototype.reverse=bY;$o.prototype.value=MY;ge.prototype.at=ef.at;ge.prototype.chain=ef.wrapperChain;ge.prototype.commit=ef.commit;ge.prototype.next=ef.next;ge.prototype.plant=ef.plant;ge.prototype.reverse=ef.reverse;ge.prototype.toJSON=ge.prototype.valueOf=ge.prototype.value=ef.value;ge.prototype.first=ge.prototype.head;hP&&(ge.prototype[hP]=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=_r({__name:"NodeContent",props:{list:{}},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=t,o=e,r=He(""),i=He([]);function a(l,s){return s.length?l.filter(f=>f.name.toLowerCase().includes(s.toLowerCase())):l}return K_([()=>r.value,()=>n.list],()=>{i.value=a(n.list,r.value)}),(l,s)=>{const f=ne("el-input"),h=ne("el-avatar"),v=ne("el-tag"),b=ne("el-text"),w=ne("el-popover"),O=ne("el-empty");return Ne(),mn(Ir,null,[P(f,{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=E=>r.value=E),modelModifiers:{trim:!0},placeholder:l.$t("common.search"),"prefix-icon":"Search",clearable:"",style:{padding:"12px 12px 0 12px"}},null,8,["modelValue","placeholder"]),ee("div",IY,[i.value.length?(Ne(!0),mn(Ir,{key:0},No(i.value,E=>(Ne(),bt(w,{key:E.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:gn(S=>o("clickNodes",E),["stop"]),onMousedown:gn(S=>o("onmousedown",E),["stop"])},[Wn(cA)(E==null?void 0:E.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(E==null?void 0:E.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,BY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...s[1]||(s[1]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"ml-8 ellipsis",title:E.name},_e(E.name),9,$Y)],40,FY)]),default:j(()=>[ee("div",UY,[ee("div",VY,[Wn(cA)(E==null?void 0:E.icon)?(Ne(),bt(h,{key:0,shape:"square",size:20,style:{background:"none"}},{default:j(()=>[ee("img",{src:Wn(mh)(E==null?void 0:E.icon,Wn(mh)("./favicon.ico")),alt:""},null,8,WY)]),_:2},1024)):(Ne(),bt(h,{key:1,class:"avatar-green",shape:"square",size:20},{default:j(()=>[...s[2]||(s[2]=[ee("img",{src:BN,style:{width:"58%"},alt:""},null,-1)])]),_:1})),ee("span",{class:"font-medium ml-8 break-all",title:E.name},_e(E.name),9,GY)]),E.type?(Ne(),mn("div",zY,[Wn(j2)(E.type)?(Ne(),bt(v,{key:0,class:"warning-tag"},{default:j(()=>[ft(_e(l.$t("views.application.workflow")),1)]),_:1})):(Ne(),bt(v,{key:1,class:"blue-tag"},{default:j(()=>[ft(_e(l.$t("views.application.simple")),1)]),_:1}))])):Bn("",!0)]),P(b,{type:"info",size:"small",class:"mt-4"},{default:j(()=>[ft(_e(E.desc),1)]),_:2},1024)]),_:2},1024))),128)):(Ne(),bt(O,{key:1,description:l.$t("common.noData")},null,8,["description"]))])],64)}}}),mP=kh(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=_r({__name:"DropdownMenu",props:{show:{type:Boolean,default:!1},id:{type:String,default:""},workflowRef:Object},emits:["clickNodes","onmousedown"],setup(t,{emit:e}){const n=Qs("workflowMode"),o=ja(),{user:r,folder:i}=Pj(),a=b7(n||Qc.Application),l=He(""),s=t,f=e,h=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),v=hr(()=>kj.tool[h.value]),b=He(!1),w=He("base"),O=hr(()=>{if(!l.value)return a||[];const X=l.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 E(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=s.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"&&(j2(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=s.workflowRef)==null||Q.onmousedown(X),f("onmousedown",X)}const M=He([]),C=He([]);async function $(){var Y;const X=await i.asyncGetFolder(u0.TOOL,{},b);M.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})}async function D(){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"});C.value=((Q=X.data)==null?void 0:Q.tools)||X.data||[],C.value=(J=C.value)==null?void 0:J.filter(ie=>ie.is_active)}const k=He([]),B=He([]);function F(){i.asyncGetFolder(u0.APPLICATION,{},b).then(X=>{var Y;k.value=X.data,i.setCurrentFolder(((Y=X.data)==null?void 0:Y[0])||{})})}async function I(){var Y;const X=await oi({type:"application",systemType:"workspace"}).getAllApplication({folder_id:((Y=i.currentFolder)==null?void 0:Y.id)||r.getWorkspaceId()});B.value=X.data.filter(W=>W.resource_type==="application"&&W.id!==s.id&&W.is_publish)}function V(X){i.setCurrentFolder(X),w.value==="tool"?D():I()}async function z(X){console.log(X),X==="tool"?(await $(),D()):X==="application"&&(F(),I())}return bo(()=>{}),(X,Y)=>{const W=ne("search"),Q=ne("el-icon"),J=ne("el-input"),ie=ne("el-text"),Se=ne("el-popover"),Ae=ne("el-scrollbar"),ke=ne("el-tab-pane"),De=ne("folder-tree"),ze=ne("LayoutContainer"),Ye=ne("el-tabs");return Js((Ne(),mn("div",{class:"workflow-dropdown-menu border border-r-6 white-bg",style:Rj({width:w.value==="base"?"400px":"640px"})},[P(Ye,{modelValue:w.value,"onUpdate:modelValue":Y[5]||(Y[5]=Be=>w.value=Be),class:"workflow-dropdown-tabs",onTabChange:z},{default:j(()=>[Js(ee("div",XY,[P(J,{modelValue:l.value,"onUpdate:modelValue":Y[0]||(Y[0]=Be=>l.value=Be),class:"mr-12 ml-12",placeholder:X.$t("views.applicationWorkflow.searchBar.placeholder")},{suffix:j(()=>[P(Q,{class:"el-input__icon"},{default:j(()=>[P(W)]),_:1})]),_:1},8,["modelValue","placeholder"])],512),[[Eh,w.value==="base"]]),P(ke,{label:X.$t("views.applicationWorkflow.baseComponent"),name:"base"},{default:j(()=>[P(Ae,{height:"400"},{default:j(()=>[O.value.length>0?(Ne(),mn("div",YY,[(Ne(!0),mn(Ir,null,No(O.value,(Be,Je)=>(Ne(),mn(Ir,{key:Je},[P(ie,{type:"info",size:"small",class:"color-secondary ml-12"},{default:j(()=>[ft(_e(Be.label),1)]),_:2},1024),ee("div",qY,[(Ne(!0),mn(Ir,null,No(Be.list,(gt,se)=>(Ne(),bt(Se,{key:se,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:gn(Ze=>E(gt),["stop"]),onMousedown:gn(Ze=>S(gt),["stop"])},[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:20})),ee("div",ZY,_e(gt.label),1)],40,KY)]),default:j(()=>[ee("div",JY,[(Ne(),bt(fw(Wn(pw)(`${gt.type}-icon`)),{class:"mr-8",size:32})),ee("div",QY,_e(gt.label),1)]),P(ie,{type:"info",size:"small",class:"color-secondary lighter"},{default:j(()=>[ft(_e(gt.text),1)]),_:2},1024)]),_:2},1024))),128))])],64))),128))])):(Ne(),mn("div",eq,[P(ie,{type:"info"},{default:j(()=>[ft(_e(X.$t("views.applicationWorkflow.tip.noData")),1)]),_:1})]))]),_:1})]),_:1},8,["label"]),P(ke,{label:X.$t("views.tool.title"),name:"tool"},{default:j(()=>[P(ze,null,{left:j(()=>{var Be;return[P(De,{source:Wn(u0).TOOL,data:M.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,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(()=>[P(Ae,{height:"450"},{default:j(()=>[P(mP,{list:C.value,onClickNodes:Y[1]||(Y[1]=Be=>E(Wn(VN),Be,"tool")),onOnmousedown:Y[2]||(Y[2]=Be=>S(Wn(VN),Be,"tool"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"]),P(ke,{label:X.$t("views.application.title"),name:"application"},{default:j(()=>[P(ze,null,{left:j(()=>{var Be;return[P(De,{source:Wn(u0).APPLICATION,data:k.value,currentNodeKey:(Be=Wn(i).currentFolder)==null?void 0:Be.id,onHandleNodeClick:V,canOperation:!1,treeStyle:{height:"400px"}},null,8,["source","data","currentNodeKey"])]}),default:j(()=>[P(Ae,{height:"450"},{default:j(()=>[P(mP,{list:B.value,onClickNodes:Y[3]||(Y[3]=Be=>E(Wn(WN),Be,"application")),onOnmousedown:Y[4]||(Y[4]=Be=>S(Wn(WN),Be,"application"))},null,8,["list"])]),_:1})]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])],4)),[[Eh,t.show]])}}}),gI=kh(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"},sq={class:"mt-8 lighter"},lq={class:"title-decoration-1 mb-8 mt-8"},uq=["onMouseenter"],cq={class:"break-all"},dq={class:"dialog-footer"},fq=_r({__name:"NodeContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",Qc.Application);const e=ja(),{params:{id:n}}=e,o=He({stepContainerHeight:0,inputContainerHeight:0,outputContainerHeight:0}),r=He(!1),i=He(),a=He(),l=He(!1),s=He({title:""}),f=hr({set:z=>{Me.set(k.nodeModel.properties,"condition",z)},get:()=>k.nodeModel.properties.condition?k.nodeModel.properties.condition:(Me.set(k.nodeModel.properties,"condition","AND"),!0)}),h=hr({set:z=>{Me.set(k.nodeModel.properties,"showNode",z)},get:()=>k.nodeModel.properties.showNode!==void 0?k.nodeModel.properties.showNode:(Me.set(k.nodeModel.properties,"showNode",!0),!0)}),v=z=>{z.ctrlKey||z.metaKey||z.stopPropagation()},b=hr(()=>k.nodeModel.properties.status?k.nodeModel.properties.status:200);function w(){s.value.title=k.nodeModel.properties.stepName,l.value=!0}const O=async z=>{z&&await z.validate(X=>{var Y;X&&((Y=k.nodeModel.graphModel.nodes.filter(W=>W.id!==k.nodeModel.id))!=null&&Y.some(W=>W.properties.stepName===s.value.title)?Xi(kt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(k.nodeModel.properties,"stepName",s.value.title),l.value=!1,z.resetFields()))})},E=z=>{z!=null&&z.shiftKey||k.nodeModel.graphModel.clearSelectElements(),Me.set(k.nodeModel,"isSelected",!k.nodeModel.isSelected),Me.set(k.nodeModel,"isHovered",!k.nodeModel.isSelected),k.nodeModel.graphModel.toFront(k.nodeModel.id)},S=He(null),M=()=>{k.nodeModel.graphModel.clearSelectElements();const z=k.nodeModel.graphModel.cloneNode(k.nodeModel.id);Me.set(z,"isSelected",!0),Me.set(z,"isHovered",!0),k.nodeModel.graphModel.toFront(z.id)},C=()=>{L2(kt("common.tip"),kt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:kt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{k.nodeModel.type===Pr.LoopNode&&k.nodeModel.graphModel.getNodeOutgoingNode(k.nodeModel.id).forEach(X=>{X.type==="loop-body-node"&&k.nodeModel.graphModel.deleteNode(X.id)}),k.nodeModel.graphModel.deleteNode(k.nodeModel.id)}),k.nodeModel.graphModel.eventCenter.emit("delete_node")},$=z=>{z.height&&(k.nodeModel.virtual||(o.value.stepContainerHeight=z.height,k.nodeModel.setHeight(o.value.stepContainerHeight)))};function D(z){var W,Q,J;const X=z.properties.width?z.properties.width:214,Y=k.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});k.nodeModel.graphModel.addEdge({type:"app-edge",sourceNodeId:k.nodeModel.id,sourceAnchorId:(J=i.value)==null?void 0:J.id,targetNodeId:Y.id,targetAnchorId:Y.id+"_left"}),V()}const k=t,B=hr(()=>{var z;return k.nodeModel.properties.config.fields?(z=k.nodeModel.properties.config.fields)==null?void 0:z.map(Y=>({label:Y.label,value:Y.value,globeLabel:`{{${k.nodeModel.properties.stepName}.${Y.value}}}`,globeValue:`{{context['${k.nodeModel.id}'].${Y.value}}}`})):[]});function F(z){return![Pr.Start,Pr.Base,Pr.LoopStartNode.toString()].includes(z)}const I=z=>{r.value=!0,i.value=z},V=()=>{r.value=!1,i.value=void 0};return bo(()=>{Me.set(k.nodeModel,"openNodeMenu",z=>{r.value?V():I(z)})}),(z,X)=>{var le;const Y=ne("ArrowDownBold"),W=ne("el-icon"),Q=ne("el-button"),J=ne("el-option"),ie=ne("el-select"),Se=ne("el-dropdown"),Ae=ne("AppIcon"),ke=ne("el-dropdown-item"),De=ne("el-dropdown-menu"),ze=ne("el-alert"),Ye=ne("el-tooltip"),Be=ne("el-collapse-transition"),Je=ne("el-input"),gt=ne("el-form-item"),se=ne("el-form"),Ze=ne("el-dialog"),pe=Rg("resize");return Ne(),mn("div",{onMousedown:E,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gl(["step-container app-card p-16",{isSelected:k.nodeModel.isSelected,error:b.value!==200}]),style:{overflow:"visible"}},[Js((Ne(),mn("div",null,[ee("div",nq,[ee("div",{class:"flex align-center",onDragstart:X[0]||(X[0]=gn(()=>{},["prevent"])),onDrag:X[1]||(X[1]=gn(()=>{},["prevent"])),onDragover:X[2]||(X[2]=gn(()=>{},["prevent"])),onDragend:X[3]||(X[3]=gn(()=>{},["prevent"])),style:{width:"69%"}},[(Ne(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(le=t.nodeModel)==null?void 0:le.properties.node_data},null,8,["item"])),ee("h4",rq,_e(t.nodeModel.properties.stepName),1)],32),ee("div",{onMousemove:X[6]||(X[6]=gn(()=>{},["stop"])),onMousedown:X[7]||(X[7]=gn(()=>{},["stop"])),onKeydown:X[8]||(X[8]=gn(()=>{},["stop"])),onClick:X[9]||(X[9]=gn(()=>{},["stop"]))},[P(Q,{text:"",onClick:X[4]||(X[4]=we=>h.value=!h.value)},{default:j(()=>[P(W,{class:Gl(["arrow-icon color-secondary",h.value?"rotate-180":""])},{default:j(()=>[P(Y)]),_:1},8,["class"])]),_:1}),F(t.nodeModel.type)?(Ne(),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",sq,[ee("span",null,_e(z.$t("views.applicationWorkflow.condition.front")),1),P(ie,{modelValue:f.value,"onUpdate:modelValue":X[5]||(X[5]=we=>f.value=we),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[P(J,{label:z.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),P(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(()=>[P(Q,{text:""},{default:j(()=>[f.value==="OR"?(Ne(),mn("img",oq)):Bn("",!0),f.value==="AND"?(Ne(),mn("img",iq)):Bn("",!0)]),_:1})]),_:1})):Bn("",!0),F(t.nodeModel.type)?(Ne(),bt(Se,{key:1,teleported:!1,trigger:"click"},{dropdown:j(()=>[P(De,{style:{"min-width":"80px"}},{default:j(()=>[P(ke,{onClick:w,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.rename")),1)]),_:1}),P(ke,{onClick:M,class:"p-8"},{default:j(()=>[ft(_e(z.$t("common.copy")),1)]),_:1}),P(ke,{onClick:C,class:"border-t p-8"},{default:j(()=>[ft(_e(z.$t("common.delete")),1)]),_:1})]),_:1})]),default:j(()=>[P(Q,{text:""},{default:j(()=>[P(Ae,{iconName:"app-more",class:"color-secondary"})]),_:1})]),_:1})):Bn("",!0)],32)]),P(Be,null,{default:j(()=>[Js(ee("div",{onMousedown:X[11]||(X[11]=gn(()=>{},["stop"])),onKeydown:X[12]||(X[12]=gn(()=>{},["stop"])),onClick:X[13]||(X[13]=gn(()=>{},["stop"])),class:"mt-16"},[b.value!=200?(Ne(),bt(ze,{key:0,class:"mb-16",title:k.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"])):Bn("",!0),Dj(z.$slots,"default",{},void 0,!0),B.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",lq,_e(z.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(B.value,(we,$e)=>(Ne(),mn("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?(Ne(),bt(Ye,{key:0,effect:"dark",content:z.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[P(Q,{link:"",onClick:rt=>Wn(x_)(we.globeLabel),style:{padding:"0"}},{default:j(()=>[P(Ae,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,uq))),128))],64)):Bn("",!0)],544),[[Eh,h.value]])]),_:3})])),[[pe,$]])],2),P(Be,null,{default:j(()=>[r.value?(Ne(),bt(gI,{key:0,onMousemove:X[14]||(X[14]=gn(()=>{},["stop"])),onMousedown:X[15]||(X[15]=gn(()=>{},["stop"])),onClick:X[16]||(X[16]=gn(()=>{},["stop"])),onWheel:v,show:r.value,id:Wn(n),style:{left:"100%",top:"50%",transform:"translate(0, -50%)"},onClickNodes:D},null,8,["show","id"])):Bn("",!0)]),_:1}),P(Ze,{title:z.$t("views.applicationWorkflow.nodeName"),modelValue:l.value,"onUpdate:modelValue":X[21]||(X[21]=we=>l.value=we),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:X[22]||(X[22]=gn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",dq,[P(Q,{onClick:X[19]||(X[19]=gn(we=>l.value=!1,["prevent"]))},{default:j(()=>[ft(_e(z.$t("common.cancel")),1)]),_:1}),P(Q,{type:"primary",onClick:X[20]||(X[20]=we=>O(a.value))},{default:j(()=>[ft(_e(z.$t("common.save")),1)]),_:1})])]),default:j(()=>[P(se,{"label-position":"top",ref_key:"titleFormRef",ref:a,model:s.value},{default:j(()=>[P(gt,{prop:"title",rules:[{required:!0,message:z.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[P(Je,{modelValue:s.value.title,"onUpdate:modelValue":X[17]||(X[17]=we=>s.value.title=we),onBlur:X[18]||(X[18]=we=>s.value.title=s.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),hi=kh(fq,[["__scopeId","data-v-4532ca06"]]),pq={class:"title-decoration-1 mb-8"},hq={class:"flex-between w-full"},vq={class:"flex-between"},mq={class:"flex align-center"},gq={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"},Pq={key:2,class:"w-full mb-16"},kq={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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=Be=>Be.ctrlKey===!0?(Be.preventDefault(),!0):(Be.stopPropagation(),!0);function a(Be){Me.set(b.nodeModel.properties.node_data,"system",Be)}function l(Be){Me.set(b.nodeModel.properties.node_data,"prompt",Be)}const s=Be=>{var Je;Be?(Je=E.value)==null||Je.reset_default(Be,o):V({})},h={model_id:"",system:"",prompt:`${kt("views.applicationWorkflow.nodes.aiChatNode.defaultPrompt")}
{{${kt("views.applicationWorkflow.nodes.searchKnowledgeNode.label")}.data}}
${kt("views.problem.title")}
{{${kt("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=hr({get:()=>b.nodeModel.properties.node_data?(b.nodeModel.properties.node_data.model_setting||Me.set(b.nodeModel.properties.node_data,"model_setting",{reasoning_content_start:"<think>",reasoning_content_end:"</think>",reasoning_content_enable:!1}),b.nodeModel.properties.node_data):(Me.set(b.nodeModel.properties,"node_data",h),b.nodeModel.properties.node_data),set:Be=>{Me.set(b.nodeModel.properties,"node_data",Be)}}),b=t,w=He(),O=He(null),E=He(),S=He(),M=()=>{var Be;return(Be=w.value)==null?void 0:Be.validate().catch(Je=>Promise.reject({node:b.nodeModel,errMessage:Je}))},C=e();function $(){var Je;const Be=r.value==="systemManage"?{model_type:"LLM",workspace_id:(Je=C.value)==null?void 0:Je.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(Be).then(gt=>{O.value=Me.groupBy(gt==null?void 0:gt.data,"provider")})}const D=Be=>{var Je;Be&&((Je=E.value)==null||Je.open(Be,o,v.value.model_params_setting))},k=He(),B=Be=>{var Je;Be&&((Je=k.value)==null||Je.open(Be,o))},F=Be=>{Me.set(b.nodeModel.properties.node_data,"system",Be)},I=()=>{var Be;(Be=S.value)==null||Be.open(v.value.model_setting)};function V(Be){Me.set(b.nodeModel.properties.node_data,"model_params_setting",Be)}function z(Be){let Je=Me.cloneDeep(b.nodeModel.properties.node_data.model_setting);Je={...Je,...Be},Me.set(b.nodeModel.properties.node_data,"model_setting",Je)}const X=He();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,ze.value)}function W(Be){Me.set(b.nodeModel.properties.node_data,"mcp_servers",Be.mcp_servers),Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Be.mcp_tool_ids),Me.set(b.nodeModel.properties.node_data,"mcp_source",Be.mcp_source)}const Q=He();function J(){Q.value.open(v.value.tool_ids)}function ie(Be){Me.set(b.nodeModel.properties.node_data,"tool_ids",Be.tool_ids)}function Se(Be){const Je=b.nodeModel.properties.node_data.tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"tool_ids",Je)}function Ae(Be){const Je=b.nodeModel.properties.node_data.mcp_tool_ids.filter(gt=>gt!==Be);Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",Je)}const ke=He([]);function De(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"CUSTOM",workspace_id:(Je=C.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"CUSTOM"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{ke.value=[...gt.data.shared_tools,...gt.data.tools].filter(se=>se.is_active)})}const ze=He([]);function Ye(){var Je;const Be=r.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(Je=C.value)==null?void 0:Je.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:r.value}).getAllToolList(Be).then(gt=>{ze.value=[...gt.data.shared_tools,...gt.data.tools].filter(se=>se.is_active)})}return bo(()=>{var Be,Je,gt,se;$(),typeof((Be=b.nodeModel.properties.node_data)==null?void 0:Be.is_result)>"u"&&Qd(b.nodeModel)&&Me.set(b.nodeModel.properties.node_data,"is_result",!0),Me.set(b.nodeModel,"validate",M),v.value.dialogue_type||(v.value.dialogue_type="WORKFLOW"),(Je=b.nodeModel.properties.node_data)!=null&&Je.mcp_tool_id&&(Me.set(b.nodeModel.properties.node_data,"mcp_tool_ids",[(gt=b.nodeModel.properties.node_data)==null?void 0:gt.mcp_tool_id]),Me.set(b.nodeModel.properties.node_data,"mcp_tool_id",void 0)),((se=b.nodeModel.properties.node_data)==null?void 0:se.mcp_output_enable)===void 0&&Me.set(b.nodeModel.properties.node_data,"mcp_output_enable",!0),De(),Ye()}),(Be,Je)=>{const gt=ne("AppIcon"),se=ne("el-button"),Ze=ne("ModelSelect"),pe=ne("el-form-item"),le=ne("el-tooltip"),we=ne("MdEditorMagnify"),$e=ne("el-option"),rt=ne("el-select"),pt=ne("el-input-number"),Lt=ne("el-switch"),Jt=ne("el-avatar"),en=ne("ToolIcon"),zt=ne("Close"),it=ne("el-icon"),ae=ne("el-form"),re=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",pq,_e(Be.$t("views.applicationWorkflow.nodeSetting")),1),P(re,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(ae,{onSubmit:Je[16]||(Je[16]=gn(()=>{},["prevent"])),model:v.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:w,"hide-required-asterisk":""},{default:j(()=>{var je,vt;return[P(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))])]),P(se,{disabled:!v.value.model_id,type:"primary",link:"",onClick:Je[0]||(Je[0]=q=>D(v.value.model_id)),onRefreshForm:V},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(Ze,{onChange:s,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:$,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(pe,null,{label:j(()=>[ee("div",vq,[ee("div",mq,[ee("span",null,_e(Be.$t("views.application.form.roleSettings.label")),1),P(le,{effect:"dark",content:Be.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[P(gt,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),P(se,{type:"primary",link:"",onClick:Je[2]||(Je[2]=q=>B(v.value.model_id)),disabled:!v.value.model_id},{default:j(()=>[P(gt,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[P(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(kt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),P(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",gq,[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))])]),P(le,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[P(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(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:l,placeholder:`${Wn(kt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(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),P(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(()=>[P($e,{label:Be.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),P($e,{label:Be.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[P(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?(Ne(),bt(se,{key:0,type:"primary",class:"mr-4",link:"",onClick:Y,onRefreshForm:V},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),P(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?(Ne(),mn("div",wq,[(Ne(!0),mn(Ir,null,No(v.value.mcp_tool_ids,(q,Pt)=>{var Rt,Gt,kn;return Ne(),mn(Ir,{key:Pt},[Wn(bl)(ze.value,q,"id")?(Ne(),mn("div",Eq,[ee("div",xq,[(Rt=Wn(bl)(ze.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bl)(ze.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Oq)]}),_:2},1024)):(Ne(),bt(en,{key:1,type:"MCP",class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bl)(ze.value,q,"id"))==null?void 0:Gt.name},_e(((kn=Wn(bl)(ze.value,q,"id"))==null?void 0:kn.name)||Be.$t("common.custom")+" MCP"),9,Sq)]),P(se,{text:"",onClick:qt=>Ae(q)},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1},8,["onClick"])])):Bn("",!0)],64)}),128))])):Bn("",!0),v.value.mcp_servers&&v.value.mcp_servers.length>0?(Ne(),mn("div",Aq,[ee("div",Mq,[P(en,{type:"MCP",class:"mr-8",size:20}),ee("div",Tq,_e(Be.$t("common.custom")+" MCP"),1)]),P(se,{text:"",onClick:Je[8]||(Je[8]=q=>v.value.mcp_servers="")},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1})])):Bn("",!0),ee("div",Cq,[ee("div",Nq,_e(Be.$t("views.tool.title")),1),ee("div",null,[v.value.tool_enable?(Ne(),bt(se,{key:0,type:"primary",class:"mr-4",link:"",onClick:J,onRefreshForm:V},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),P(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?(Ne(),mn("div",Pq,[(Ne(!0),mn(Ir,null,No(v.value.tool_ids,(q,Pt)=>{var Rt,Gt,kn;return Ne(),mn("div",{key:Pt,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",kq,[(Rt=Wn(bl)(ke.value,q,"id"))!=null&&Rt.icon?(Ne(),bt(Jt,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>{var qt;return[ee("img",{src:Wn(mh)((qt=Wn(bl)(ke.value,q,"id"))==null?void 0:qt.icon),alt:""},null,8,Rq)]}),_:2},1024)):(Ne(),bt(en,{key:1,class:"mr-8",size:20})),ee("div",{class:"ellipsis",title:(Gt=Wn(bl)(ke.value,q,"id"))==null?void 0:Gt.name},_e((kn=Wn(bl)(ke.value,q,"id"))==null?void 0:kn.name),9,Dq)]),P(se,{text:"",onClick:qt=>Se(q)},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1},8,["onClick"])])}),128))])):Bn("",!0),v.value.mcp_enable||v.value.tool_enable?(Ne(),bt(pe,{key:3,onClick:Je[11]||(Je[11]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",jq,[ee("span",Lq,_e(Be.$t("views.application.form.mcp_output_enable")),1),ee("div",Iq,[P(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})):Bn("",!0),P(pe,{onClick:Je[13]||(Je[13]=gn(()=>{},["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?(Ne(),bt(se,{key:0,type:"primary",link:"",onClick:I,onRefreshForm:V,class:"mr-4"},{default:j(()=>[P(gt,{iconName:"app-setting"})]),_:1})):Bn("",!0),P(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}),P(pe,{onClick:Je[15]||(Je[15]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Bq,[ee("div",$q,[ee("span",null,_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(le,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Be.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(gt,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(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}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:E,onRefresh:V},null,512),P(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:k},null,512),P(x7,{ref_key:"ReasoningParamSettingDialogRef",ref:S,onRefresh:z},null,512),P(O7,{ref_key:"mcpServersDialogRef",ref:X,onRefresh:W},null,512),P(S7,{ref_key:"toolDialogRef",ref:Q,onRefresh:ie},null,512)]),_:1},8,["nodeModel"])}}});var gP={width:40,height:40},yP={width:40,height:40},_P={width:40,height:40},bP={width:100,height:80},wP={width:100,height:80},VE,xo,yI,Iv,EP,_I,bI,wI,hM,wA,EA,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 vM(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?VE.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??++yI,__i:-1,__u:0};return r==null&&xo.vnode!=null&&xo.vnode(i),i}function WE(){return{current:null}}function jg(t){return t.children}function Po(t,e){this.props=t,this.context=e}function Lg(t,e){if(e==null)return t.__?Lg(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"?Lg(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),mM(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,n??Lg(e),!!(32&e.__u),r),i.__v=e.__v,i.__.__k[i.__i]=i,SI(o,i,r),e.__e=e.__=null,i.__e!=n&&EI(i)}}function EI(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}),EI(t)}function xP(t){(!t.__d&&(t.__d=!0)&&Iv.push(t)&&!bw.__r++||EP!=xo.debounceRendering)&&((EP=xo.debounceRendering)||_I)(bw)}function bw(){for(var t,e=1;Iv.length;)Iv.length>e&&Iv.sort(bI),t=Iv.shift(),e=Iv.length,Wq(t);bw.__r=0}function xI(t,e,n,o,r,i,a,l,s,f,h){var v,b,w,O,E,S,M,C=o&&o.__k||_w,$=e.length;for(s=Gq(n,e,C,s,$),v=0;v<$;v++)(w=n.__k[v])!=null&&(b=w.__i!=-1&&C[w.__i]||yw,w.__i=v,S=mM(t,w,b,r,i,a,l,s,f,h),O=w.__e,w.ref&&b.ref!=w.ref&&(b.ref&&gM(b.ref,null,w),h.push(w.ref,w.__c||O,w)),E==null&&O!=null&&(E=O),(M=!!(4&w.__u))||b.__k===w.__k?s=OI(w,s,t,M):typeof w.type=="function"&&S!==void 0?s=S:O&&(s=O.nextSibling),w.__u&=-7);return n.__e=E,s}function Gq(t,e,n,o,r){var i,a,l,s,f,h=n.length,v=h,b=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(jg,{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,s=i+b,a.__=t,a.__b=t.__b+1,l=null,(f=a.__i=zq(a,n,s,v))!=-1&&(v--,(l=n[f])&&(l.__u|=2)),l==null||l.__v==null?(f==-1&&(r>h?b--:r<h&&b++),typeof a.type!="function"&&(a.__u|=4)):f!=s&&(f==s-1?b--:f==s+1?b++:(f>s?b--:b++,a.__u|=4))):t.__k[i]=null;if(v)for(i=0;i<h;i++)(l=n[i])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=Lg(l)),MI(l,l));return o}function OI(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=OI(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=Lg(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,l=t.key,s=t.type,f=e[n],h=f!=null&&(2&f.__u)==0;if(f===null&&l==null||h&&l==f.key&&s==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&&l==f.key&&s==f.type)return a}return-1}function OP(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||OP(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||OP(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(wI,"$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=hM,t.addEventListener(e,i?EA:wA,i)):t.removeEventListener(e,i?EA:wA,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 SP(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=hM++;else if(e.t<n.u)return;return n(xo.event?xo.event(e):e)}}}function mM(t,e,n,o,r,i,a,l,s,f){var h,v,b,w,O,E,S,M,C,$,D,k,B,F,I,V=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(s=!!(32&n.__u),i=[l=e.__e=n.__e]),(h=xo.__b)&&h(e);e:if(typeof V=="function")try{if(M=e.props,C="prototype"in V&&V.prototype.render,$=(h=V.contextType)&&o[h.__c],D=h?$?$.props.value:h.__:o,n.__c?S=(v=e.__c=n.__c).__=v.__E:(C?e.__c=v=new V(M,D):(e.__c=v=new Po(M,D),v.constructor=V,v.render=Xq),$&&$.sub(v),v.state||(v.state={}),v.__n=o,b=v.__d=!0,v.__h=[],v._sb=[]),C&&v.__s==null&&(v.__s=v.state),C&&V.getDerivedStateFromProps!=null&&(v.__s==v.state&&(v.__s=op({},v.__s)),op(v.__s,V.getDerivedStateFromProps(M,v.__s))),w=v.props,O=v.state,v.__v=e,b)C&&V.getDerivedStateFromProps==null&&v.componentWillMount!=null&&v.componentWillMount(),C&&v.componentDidMount!=null&&v.__h.push(v.componentDidMount);else{if(C&&V.getDerivedStateFromProps==null&&M!==w&&v.componentWillReceiveProps!=null&&v.componentWillReceiveProps(M,D),e.__v==n.__v||!v.__e&&v.shouldComponentUpdate!=null&&v.shouldComponentUpdate(M,v.__s,D)===!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,D),C&&v.componentDidUpdate!=null&&v.__h.push(function(){v.componentDidUpdate(w,O,E)})}if(v.context=D,v.props=M,v.__P=t,v.__e=!1,k=xo.__r,B=0,C)v.state=v.__s,v.__d=!1,k&&k(e),h=v.render(v.props,v.state,v.context),_w.push.apply(v.__h,v._sb),v._sb=[];else do v.__d=!1,k&&k(e),h=v.render(v.props,v.state,v.context),v.state=v.__s;while(v.__d&&++B<25);v.state=v.__s,v.getChildContext!=null&&(o=op(op({},o),v.getChildContext())),C&&!b&&v.getSnapshotBeforeUpdate!=null&&(E=v.getSnapshotBeforeUpdate(w,O)),F=h!=null&&h.type===jg&&h.key==null?AI(h.props.children):h,l=xI(t,eb(F)?F:[F],e,n,o,r,i,a,l,s,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,s||i!=null)if(z.then){for(e.__u|=s?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,e.__e=l}else{for(I=i.length;I--;)vM(i[I]);xA(e)}else e.__e=n.__e,e.__k=n.__k,z.then||xA(e);xo.__e(z,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=Hq(n.__e,e,n,o,r,i,a,s,f);return(h=xo.diffed)&&h(e),128&e.__u?void 0:l}function xA(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(xA))}function SI(t,e,n){for(var o=0;o<n.length;o++)gM(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 AI(t){return typeof t!="object"||t==null||t.__b>0?t:eb(t)?t.map(AI):op({},t)}function Hq(t,e,n,o,r,i,a,l,s){var f,h,v,b,w,O,E,S=n.props||yw,M=e.props,C=e.type;if(C=="svg"?r="http://www.w3.org/2000/svg":C=="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((w=i[f])&&"setAttribute"in w==!!C&&(C?w.localName==C:w.nodeType==3)){t=w,i[f]=null;break}}if(t==null){if(C==null)return document.createTextNode(M);t=document.createElementNS(r,C,M.is&&M),l&&(xo.__m&&xo.__m(e,i),l=!1),i=null}if(C==null)S===M||l&&t.data==M||(t.data=M);else{if(i=i&&VE.call(t.childNodes),!l&&i!=null)for(S={},f=0;f<t.attributes.length;f++)S[(w=t.attributes[f]).name]=w.value;for(f in S)w=S[f],f=="dangerouslySetInnerHTML"?v=w:f=="children"||f in M||f=="value"&&"defaultValue"in M||f=="checked"&&"defaultChecked"in M||f0(t,f,null,w,r);for(f in M)w=M[f],f=="children"?b=w:f=="dangerouslySetInnerHTML"?h=w:f=="value"?O=w:f=="checked"?E=w:l&&typeof w!="function"||S[f]===w||f0(t,f,w,S[f],r);if(h)l||v&&(h.__html==v.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(v&&(t.innerHTML=""),xI(e.type=="template"?t.content:t,eb(b)?b:[b],e,n,o,C=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&Lg(n,0),l,s),i!=null)for(f=i.length;f--;)vM(i[f]);l||(f="value",C=="progress"&&O==null?t.removeAttribute("value"):O!=null&&(O!==t[f]||C=="progress"&&!O||C=="option"&&O!=S[f])&&f0(t,f,O,S[f],r),f="checked",E!=null&&E!=t[f]&&f0(t,f,E,S[f],r))}return t}function gM(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 MI(t,e,n){var o,r;if(xo.unmount&&xo.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||gM(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]&&MI(o[r],e,n||typeof t.type!="function");n||vM(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=[],mM(e,t=e.__k=Lr(jg,null,[t]),r||yw,yw,e.namespaceURI,r?null:e.firstChild?VE.call(e.childNodes):null,i,r?r.__e:e.firstChild,o,a),SI(i,t,a)}VE=_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(l){t=l}throw t}},yI=0,Po.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),xP(this))},Po.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),xP(this))},Po.prototype.render=jg,Iv=[],_I=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bI=function(t,e){return t.__v.__b-e.__v.__b},bw.__r=0,wI=/(PointerCapture)$|Capture$/i,hM=0,wA=SP(!1),EA=SP(!0);var qq="An invariant failed, however the error is obfuscated because this is a production build.",Ew=[];Object.freeze(Ew);var yM={};Object.freeze(yM);function Hl(){return++yr.mobxGuid}function Qo(t){throw Wv(!1,t),"X"}function Wv(t,e){if(!t)throw new Error("[mobx] "+(e||qq))}function TI(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 _M(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)||Yl(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 _M(o)&&o[n]===!0}}function iy(t){return t instanceof Map}function tb(t){return t instanceof Set}function CI(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 gh(t){return t&&t.toString?t.toString():new String(t).toString()}function NI(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@"+Hl()),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 UI(this)},t.prototype.reportChanged=function(){Yc(),EK(this),qc()},t.prototype.toString=function(){return this.name},t})(),bM=jh("Atom",ay);function wM(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&&XI(o,n),o}function tK(t,e){return r3(t,e)}function nK(t,e){return Object.is(t,e)}var Ig={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 OA=function(t,e){return OA=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])},OA(t,e)};function rK(t,e){OA(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 _g(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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function EM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_g(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=EM(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=Vd(r),a=i.next();!a.done;a=i.next()){var l=a.value,s=o[l];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function PI(t,e){return function(){var o,r=function(a,l,s,f){if(f===!0)return e(a,l,s,a,o),null;if(!Object.prototype.hasOwnProperty.call(a,Gy)){var h=a[Gy];oy(a,Gy,xw({},h))}return a[Gy][l]={prop:l,propertyCreator:e,descriptor:s,decoratorTarget:a,decoratorArguments:o},aK(l,t)};return sK(arguments)?(o=Ew,r.apply(null,arguments)):(o=Array.prototype.slice.call(arguments),r)}}function sK(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 Ug(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 lK(t,e,n){return t==null||nd(t)||tf(t)||Yl(t)||nc(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 GE(t){return t}function uK(t,e,n){return r3(t,e)?e:t}function zE(t){Wv(t);var e=PI(!0,function(o,r,i,a,l){var s=i?i.initializer?i.initializer.call(o):i.value:void 0;MM(o).addObservableProp(r,s,t)}),n=e;return n.enhancer=t,n}var kI={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(kI);function pg(t){return t==null?kI:typeof t=="string"?{name:t,deep:!0,proxy:!0}:t}var xM=zE(nb),cK=zE(lK),RI=zE(GE),dK=zE(uK);function h0(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?GE:nb}function fK(t,e,n){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return xM.apply(null,arguments);if(Ug(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 AP={box:function(t,e){arguments.length>2&&Ly("box");var n=pg(e);return new zv(t,h0(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&Ly("array");var n=pg(e);return KK(t,h0(n),n.name)},map:function(t,e){arguments.length>2&&Ly("map");var n=pg(e);return new AM(t,h0(n),n.name)},set:function(t,e){arguments.length>2&&Ly("set");var n=pg(e);return new t3(t,h0(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&Ly("object");var o=pg(n);if(o.proxy===!1)return NA({},t,e,o);var r=qI(o),i=NA({},void 0,void 0,o),a=XK(i);return KI(a,t,e,r),a},ref:RI,shallow:cK,deep:xM,struct:dK},Ut=fK;Object.keys(AP).forEach(function(t){return Ut[t]=AP[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=PI(!1,function(t,e,n,o,r){var i=n.get,a=n.set,l=r[0]||{};MM(t).addComputedProp(t,e,xw({get:i,set:a,context:t},l))}),pK=Sw({equals:Ig.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 Bg(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 SA(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=OM(!0),n=sy(),o=t.observing,r=o.length,i=0;i<r;i++){var a=o[i];if($g(a)){if(yr.disableErrorBoundaries)a.get();else try{a.get()}catch{return bh(n),e_(e),!0}if(t.dependenciesState===ii.STALE)return bh(n),e_(e),!0}}return LI(t),bh(n),e_(e),!1}}}function Fg(t){var e=t.observers.size>0;yr.computationDepth>0&&e&&Qo(!1),!yr.allowStateChanges&&(e||yr.enforceActions==="strict")&&Qo(!1)}function DI(t,e,n){var o=OM(!0);LI(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++yr.runId;var r=yr.trackingDerivation;yr.trackingDerivation=t;var i;if(yr.disableErrorBoundaries===!0)i=e.call(n);else try{i=e.call(n)}catch(a){i=new Aw(a)}return yr.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 l=n[a];l.diffValue===0&&(l.diffValue=1,r!==a&&(n[r]=l),r++),l.dependenciesState>o&&(o=l.dependenciesState)}for(n.length=r,t.newObserving=null,i=e.length;i--;){var l=e[i];l.diffValue===0&&BI(l,t),l.diffValue=0}for(;r--;){var l=n[r];l.diffValue===1&&(l.diffValue=0,wK(l,t))}o!==ii.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}function AA(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)BI(e[n],t);t.dependenciesState=ii.NOT_TRACKING}function jI(t){var e=sy();try{return t()}finally{bh(e)}}function sy(){var t=yr.trackingDerivation;return yr.trackingDerivation=null,t}function bh(t){yr.trackingDerivation=t}function OM(t){var e=yr.allowStateReads;return yr.allowStateReads=t,e}function e_(t){yr.allowStateReads=t}function LI(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,MP=Object.getOwnPropertyDescriptor(function(){},"name");MP&&MP.configurable;function Gv(t,e,n){var o=function(){return II(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function II(t,e,n,o){var r=mK();try{return e.apply(n,o)}catch(i){throw r.error=i,i}finally{gK(r)}}function mK(t,e,n){var o=Ku(),r=0,i=sy();Yc();var a=HE(!0),l=OM(!0),s={prevDerivation:i,prevAllowStateChanges:a,prevAllowStateReads:l,notifySpy:o,startTime:r,actionId:vK++,parentActionId:Mw};return Mw=s.actionId,s}function gK(t){Mw!==t.actionId&&Qo("invalid action stack. did you forget to finish an action?"),Mw=t.parentActionId,t.error!==void 0&&(yr.suppressReactionErrors=!0),XE(t.prevAllowStateChanges),e_(t.prevAllowStateReads),qc(),bh(t.prevDerivation),yr.suppressReactionErrors=!1}function HE(t){var e=yr.allowStateChanges;return yr.allowStateChanges=t,e}function XE(t){yr.allowStateChanges=t}var zv=(function(t){rK(e,t);function e(n,o,r,i,a){r===void 0&&(r="ObservableValue@"+Hl()),a===void 0&&(a=Ig.default);var l=t.call(this,r)||this;return l.enhancer=o,l.name=r,l.equals=a,l.hasUnreportedChange=!1,l.value=o(n,void 0,r),l}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!==yr.UNCHANGED&&this.setNewValue(n)},e.prototype.prepareNewValue=function(n){if(Fg(this),Gd(this)){var o=zd(this,{object:this,type:"update",newValue:n});if(!o)return yr.UNCHANGED;n=o.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?yr.UNCHANGED:n},e.prototype.setNewValue=function(n){var o=this.value;this.value=n,this.reportChanged(),Kc(this)&&Zc(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 NI(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(ay),yK=jh("ObservableValue",zv),Bg=(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="#"+Hl(),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@"+Hl(),e.set&&(this.setter=Gv(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?Ig.structural:Ig.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),yr.inBatch===0&&this.observers.size===0&&!this.keepAlive?SA(this)&&(this.warnAboutUntrackedRead(),Yc(),this.value=this.computeValue(!1),qc()):(UI(this),SA(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,yr.computationDepth++;var n;if(e)n=DI(this,this.derivation,this.scope);else if(yr.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(o){n=new Aw(o)}return yr.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(AA(this),this.value=void 0)},t.prototype.observe=function(e,n){var o=this,r=!0,i=void 0;return kK(function(){var a=o.get();if(!r||n){var l=sy();e({type:"update",object:o,newValue:a,oldValue:i}),bh(l)}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 NI(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(),$g=jh("ComputedValue",Bg),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 MA(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:_K}var q0=!0,FI=!1,yr=(function(){var t=MA();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(){FI||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(){(yr.pendingReactions.length||yr.inBatch||yr.isRunningReactions)&&Qo("isolateGlobalState should be called before MobX is running any reactions"),FI=!0,q0&&(--MA().__mobxInstanceCount===0&&(MA().__mobxGlobals=void 0),yr=new Y0)}function TA(){return yr}function wK(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function BI(t,e){t.observers.delete(e),t.observers.size===0&&$I(t)}function $I(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,yr.pendingUnobservations.push(t))}function Yc(){yr.inBatch++}function qc(){if(--yr.inBatch===0){GI();for(var t=yr.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 Bg&&n.suspend())}yr.pendingUnobservations=[]}}function UI(t){var e=yr.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&&yr.inBatch>0&&$I(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&&VI(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&&VI(e,t),e.onBecomeStale())}))}function VI(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===Wd.BREAK){var n=[];WI(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 Bg?t.derivation.toString().replace(/[*]\//g,"/"):"")+`
The dependencies for this derivation are:
`+n.join(`
`)+`
*/
`)()}}function WI(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 WI(o,e,n+1)})}var A_=(function(){function t(e,n,o,r){e===void 0&&(e="Reaction@"+Hl()),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="#"+Hl(),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,yr.pendingReactions.push(this),GI())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Yc(),this._isScheduled=!1,SA(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ku()}catch(e){this.reportExceptionInDerivation(e)}}qc()}},t.prototype.track=function(e){if(!this.isDisposed){Yc(),this._isRunning=!0;var n=DI(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&AA(this),zy(n)&&this.reportExceptionInDerivation(n.cause),qc()}},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(yr.disableErrorBoundaries)throw e;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";yr.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(o,e),yr.globalReactionErrorHandlers.forEach(function(r){return r(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Yc(),AA(this),qc()))},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})(),TP=100,CA=function(t){return t()};function GI(){yr.inBatch>0||yr.isRunningReactions||CA(SK)}function SK(){yr.isRunningReactions=!0;for(var t=yr.pendingReactions,e=0;t.length>0;){++e===TP&&(console.error("Reaction doesn't converge to a stable state after "+TP+" 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()}yr.isRunningReactions=!1}var Tw=jh("Reaction",A_);function AK(t){var e=CA;CA=function(n){return t(function(){return e(n)})}}function Ku(){return!1}function MK(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function TK(){Qo(!1)}function CP(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 CP(e);if(r===!0)oy(e,n,Gv(e.name||n,o.value,this));else return CP(n).apply(null,arguments)};Bt.bound=NK;function PK(t,e){var n=typeof t=="string"?t:t.name||"<unnamed action>",o=typeof t=="function"?t:e;return II(n,o,this,void 0)}function ZO(t,e,n){oy(t,e,Gv(e,n.bind(t)))}function kK(t,e){e===void 0&&(e=yM);var n=e&&e.name||t.name||"Autorun@"+Hl(),o=!e.scheduler&&!e.delay,r;if(o)r=new A_(n,function(){this.track(l)},e.onError,e.requiresObservable);else{var i=zI(e),a=!1;r=new A_(n,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(l)}))},e.onError,e.requiresObservable)}function l(){t(r)}return r.schedule(),r.getDisposer()}var RK=function(t){return t()};function zI(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:RK}function HI(t,e,n){n===void 0&&(n=yM);var o=n.name||"Reaction@"+Hl(),r=Bt(o,n.onError?DK(n.onError,e):e),i=!n.scheduler&&!n.delay,a=zI(n),l=!0,s=!1,f,h=n.compareStructural?Ig.structural:n.equals||Ig.default,v=new A_(o,function(){l||i?b():s||(s=!0,a(b))},n.onError,n.requiresObservable);function b(){if(s=!1,!v.isDisposed){var w=!1;v.track(function(){var O=t(v);w=l||!h(f,O),f=O}),l&&n.fireImmediately&&r(f,v),!l&&w===!0&&r(f,v),l&&(l=!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 YI("onBecomeObserved",t,e)}function XI(t,e,n){return YI("onBecomeUnobserved",t,e)}function YI(t,e,n,o){var r=Mh(e),i=n,a=t+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var l=r[t];return typeof l!="function"?Qo(!1):function(){var s=r[a];s&&(s.delete(i),s.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,l=t.observableRequiresReaction;if(bK(),e!==void 0){var s=void 0;switch(e){case!0:case"observed":s=!0;break;case!1:case"never":s=!1;break;case"strict":case"always":s="strict";break;default:Qo("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}yr.enforceActions=s,yr.allowStateChanges=!(s===!0||s==="strict")}n!==void 0&&(yr.computedRequiresReaction=!!n),a!==void 0&&(yr.reactionRequiresObservable=!!a),l!==void 0&&(yr.observableRequiresReaction=!!l,yr.allowStateReads=!yr.observableRequiresReaction),o!==void 0&&(yr.computedConfigurable=!!o),r!==void 0&&(r===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),yr.disableErrorBoundaries=!!r),i&&AK(i)}function NA(t,e,n,o){o=pg(o);var r=qI(o);return qv(t),MM(t,o.name,r.enhancer),e&&KI(t,e,n,r),t}function qI(t){return t.defaultDecorator||(t.deep===!1?RI:xM)}function KI(t,e,n,o){var r,i,a,l,s;Yc();try{var a=eK(e);try{for(var f=Vd(a),h=f.next();!h.done;h=f.next()){var s=h.value,v=Object.getOwnPropertyDescriptor(e,s),b=n&&s in n?n[s]:v.get?Sw:o,w=b(t,s,v,!0);w&&Object.defineProperty(t,s,w)}}catch(E){r={error:E}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}finally{qc()}}function IK(t,e){return ZI(Mh(t,e))}function ZI(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=Kq(t.observing).map(ZI)),e}function JI(t,e){if(t==null)return!1;if(e!==void 0){if(nd(t)===!1||!t[eo].values.has(e))return!1;var n=Mh(t,e);return $g(n)}return $g(t)}function FK(t){return arguments.length>1?Qo(!1):JI(t)}function NP(t,e){return typeof e!="string"?Qo(!1):JI(t,e)}function BK(t,e){return t==null?!1:nd(t)||!!t[eo]||bM(t)||Tw(t)||$g(t)}function Ug(t){return arguments.length!==1&&Qo(!1),BK(t)}function Vg(t){return nd(t)?t[eo].getKeys():Yl(t)||nc(t)?Array.from(t.keys()):tf(t)?t.map(function(e,n){return n}):Qo(!1)}function $K(t){return nd(t)?Vg(t).map(function(e){return t[e]}):Yl(t)?Vg(t).map(function(e){return t.get(e)}):nc(t)?Array.from(t.values()):tf(t)?t.slice():Qo(!1)}function UK(t){return nd(t)?Vg(t).map(function(e){return[e,t[e]]}):Yl(t)?Vg(t).map(function(e){return[e,t.get(e)]}):nc(t)?Array.from(t.entries()):tf(t)?t.map(function(e,n){return[n,e]}):Qo(!1)}function SM(t,e,n){if(arguments.length===2&&!nc(t)){Yc();var o=e;try{for(var r in o)SM(t,r,o[r])}finally{qc()}return}if(nd(t)){var i=t[eo],a=i.values.get(e);a?i.write(e,n):i.addObservableProp(e,n,i.defaultEnhancer)}else if(Yl(t))t.set(e,n);else if(nc(t))t.add(e);else if(tf(t))typeof e!="number"&&(e=parseInt(e,10)),Wv(e>=0,"Not a valid index: '"+e+"'"),Yc(),e>=t.length&&(t.length=e+1),t[e]=n,qc();else return Qo(!1)}function QI(t,e,n,o){return VK(t,e,n)}function VK(t,e,n){return YE(t).observe(e,n)}var WK={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function tg(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function ch(t,e,n){if(!e.recurseEverything&&!Ug(t)||typeof t!="object")return t;if(t===null)return null;if(t instanceof Date)return t;if(yK(t))return ch(t.get(),e,n);Ug(t)&&Vg(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=tg(n,t,[],e),i=t.map(function(w){return ch(w,e,n)});r.length=i.length;for(var a=0,l=i.length;a<l;a++)r[a]=i[a];return r}if(nc(t)||Object.getPrototypeOf(t)===Set.prototype)if(e.exportMapsAsObjects===!1){var s=tg(n,t,new Set,e);return t.forEach(function(w){s.add(ch(w,e,n))}),s}else{var f=tg(n,t,[],e);return t.forEach(function(w){f.push(ch(w,e,n))}),f}if(Yl(t)||Object.getPrototypeOf(t)===Map.prototype)if(e.exportMapsAsObjects===!1){var h=tg(n,t,new Map,e);return t.forEach(function(w,O){h.set(O,ch(w,e,n))}),h}else{var v=tg(n,t,{},e);return t.forEach(function(w,O){v[O]=ch(w,e,n)}),v}var b=tg(n,t,{},e);return CI(t).forEach(function(w){b[w]=ch(t[w],e,n)}),b}function Gc(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),ch(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 yr.trackingDerivation;case 1:return Mh(t[0]);case 2:return Mh(t[0],t[1])}}function Hc(t,e){e===void 0&&(e=void 0),Yc();try{return t.apply(e)}finally{qc()}}function v0(t){return t[eo]}function m0(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 m0(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 m0(e)&&n.has(e),t[e]},set:function(t,e,n){return m0(e)?(SM(t,e,n),!0):!1},deleteProperty:function(t,e){if(!m0(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),TI(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function zd(t,e){var n=sy();try{for(var o=EM(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{bh(n)}}function Kc(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function ob(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),TI(function(){var o=n.indexOf(e);o!==-1&&n.splice(o,1)})}function Zc(t,e){var n=sy(),o=t.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r<i;r++)o[r](e);bh(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@"+Hl()),o===void 0&&(o=!1);var r=new e3(n,e,o);Jq(r.values,eo,r);var i=new Proxy(r.values,qK);if(r.proxy=i,t&&t.length){var a=HE(!0);r.spliceWithArray(0,0,t),XE(a)}return i}var e3=(function(){function t(e,n,o){this.owned=o,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new ay(e||"ObservableArray@"+Hl()),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;Fg(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(s){return r.enhancer(s,void 0)});var l=this.spliceItemsIntoValues(e,n,o);return(n!==0||o.length!==0)&&this.notifyArraySplice(e,o,l),this.dehanceValues(l)},t.prototype.spliceItemsIntoValues=function(e,n,o){var r;if(o.length<YK)return(r=this.values).splice.apply(r,EM([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&&Ku(),i=Kc(this),a=i||r?{object:this.proxy,type:"update",index:e,newValue:n,oldValue:o}:null;this.atom.reportChanged(),i&&Zc(this,a)},t.prototype.notifyArraySplice=function(e,n,o){var r=!this.owned&&Ku(),i=Kc(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&&Zc(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){Fg(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,l){return e.call(n,a,l,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",e3);function tf(t){return _M(t)&&ZK(t[eo])}var PP,JK={},AM=(function(){function t(e,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableMap@"+Hl()),this.enhancer=n,this.name=o,this[PP]=JK,this._keysAtom=wM(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(!yr.trackingDerivation)return this._has(e);var o=this._hasMap.get(e);if(!o){var r=o=new zv(this._has(e),GE,this.name+"."+gh(e)+"?",!1);this._hasMap.set(e,r),XI(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(Fg(this._keysAtom),Gd(this)){var o=zd(this,{type:"delete",object:this,name:e});if(!o)return!1}if(this._has(e)){var r=Ku(),i=Kc(this),o=i||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return Hc(function(){n._keysAtom.reportChanged(),n._updateHasMapEntry(e,!1);var l=n._data.get(e);l.setNewValue(void 0),n._data.delete(e)}),i&&Zc(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!==yr.UNCHANGED){var r=Ku(),i=Kc(this),a=i||r?{type:"update",object:this,oldValue:o.value,name:e,newValue:n}:null;o.setNewValue(n),i&&Zc(this,a)}},t.prototype._addValue=function(e,n){var o=this;Fg(this._keysAtom),Hc(function(){var l=new zv(n,o.enhancer,o.name+"."+gh(e),!1);o._data.set(e,l),n=l.value,o._updateHasMapEntry(e,!0),o._keysAtom.reportChanged()});var r=Ku(),i=Kc(this),a=i||r?{type:"add",object:this,name:e,newValue:n}:null;i&&Zc(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[PP=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 l=_g(a.value,2),s=l[0],f=l[1];e.call(n,f,s,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 Yl(e)&&(e=e.toJS()),Hc(function(){var o=HE(!0);try{ry(e)?CI(e).forEach(function(r){return n.set(r,e[r])}):Array.isArray(e)?e.forEach(function(r){var i=_g(r,2),a=i[0],l=i[1];return n.set(a,l)}):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{XE(o)}}),this},t.prototype.clear=function(){var e=this;Hc(function(){jI(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(l){n={error:l}}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 Hc(function(){var o,r,i,a,l=Zq(e),s=new Map,f=!1;try{for(var h=Vd(n._data.keys()),v=h.next();!v.done;v=h.next()){var b=v.value;if(!l.has(b)){var w=n.delete(b);if(w)f=!0;else{var O=n._data.get(b);s.set(b,O)}}}}catch(I){o={error:I}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}try{for(var E=Vd(l.entries()),S=E.next();!S.done;S=E.next()){var M=_g(S.value,2),b=M[0],O=M[1],C=n._data.has(b);if(n.set(b,O),n._data.has(b)){var $=n._data.get(b);s.set(b,$),C||(f=!0)}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(i)throw i.error}}if(!f)if(n._data.size!==s.size)n._keysAtom.reportChanged();else for(var D=n._data.keys(),k=s.keys(),B=D.next(),F=k.next();!B.done;){if(B.value!==F.value){n._keysAtom.reportChanged();break}B=D.next(),F=k.next()}n._data=s}),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=_g(i.value,2),l=a[0],s=a[1];o[typeof l=="symbol"?l:gh(l)]=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.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 gh(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})(),Yl=jh("ObservableMap",AM),kP,QK={},t3=(function(){function t(e,n,o){if(n===void 0&&(n=nb),o===void 0&&(o="ObservableSet@"+Hl()),this.name=o,this[kP]=QK,this._data=new Set,this._atom=wM(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;Hc(function(){jI(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(l){n={error:l}}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 l=a.value;e.call(n,l,l,this)}}catch(s){o={error:s}}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(Fg(this._atom),Gd(this)){var o=zd(this,{type:"add",object:this,newValue:e});if(!o)return this}if(!this.has(e)){Hc(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var r=Ku(),i=Kc(this),o=i||r?{type:"add",object:this,newValue:e}:null;i&&Zc(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=Ku(),i=Kc(this),o=i||r?{type:"delete",object:this,oldValue:e}:null;return Hc(function(){n._atom.reportChanged(),n._data.delete(e)}),i&&Zc(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 nc(e)&&(e=e.toJS()),Hc(function(){var o=HE(!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{XE(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[kP=eo,Symbol.iterator]=function(){return this.values()},t})(),nc=jh("ObservableSet",t3),n3=(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 Bg){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!==yr.UNCHANGED){var a=Kc(this),l=Ku(),i=a||l?{type:"update",object:this.proxy||o,oldValue:r.value,name:e,newValue:n}:null;r.setNewValue(n),a&&Zc(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,GE,this.name+"."+gh(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+"."+gh(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+"."+gh(n),this.values.set(n,new Bg(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{Yc();var r=Kc(this),i=Ku(),a=this.values.get(e),l=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var s=this.pendingKeys.get(e);s&&s.set(!1)}delete this.target[e];var o=r||i?{type:"remove",object:this.proxy||n,oldValue:l,name:e}:null;r&&Zc(this,o)}finally{qc()}}},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=Kc(this),r=Ku(),i=o||r?{type:"add",object:this.proxy||this.target,name:e,newValue:n}:null;if(o&&Zc(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=_g(i.value,2),l=a[0],s=a[1];s instanceof zv&&o.push(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})();function MM(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")+"@"+Hl()),e||(e="ObservableObject@"+Hl());var o=new n3(t,new Map,gh(e),n);return oy(t,eo,o),o}var RP=Object.create(null),DP=Object.create(null);function eZ(t){return RP[t]||(RP[t]={configurable:!0,enumerable:!0,get:function(){return this[eo].read(t)},set:function(e){this[eo].write(t,e)}})}function jP(t){var e=t[eo];return e||(qv(t),t[eo])}function tZ(t){return DP[t]||(DP[t]={configurable:yr.computedConfigurable,enumerable:!1,get:function(){return jP(this).read(t)},set:function(e){jP(this).write(t,e)}})}var nZ=jh("ObservableObjectAdministration",n3);function nd(t){return _M(t)?(qv(t),nZ(t[eo])):!1}function Mh(t,e){if(typeof t=="object"&&t!==null){if(tf(t))return e!==void 0&&Qo(!1),t[eo].atom;if(nc(t))return t[eo];if(Yl(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],nd(t)){if(!e)return Qo(!1);var o=t[eo].values.get(e);return o||Qo(!1),o}if(bM(t)||$g(t)||Tw(t))return t}else if(typeof t=="function"&&Tw(t[eo]))return t[eo];return Qo(!1)}function YE(t,e){if(t||Qo("Expecting some object"),e!==void 0)return YE(Mh(t,e));if(bM(t)||$g(t)||Tw(t)||Yl(t)||nc(t))return t;if(qv(t),t[eo])return t[eo];Qo(!1)}function rZ(t,e){var n;return e!==void 0?n=Mh(t,e):nd(t)||Yl(t)||nc(t)?n=YE(t):n=Mh(t),n.name}var LP=Object.prototype.toString;function r3(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=LP.call(t);if(a!==LP.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=IP(t),e=IP(e);var l=a==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var s=t.constructor,f=e.constructor;if(s!==f&&!(typeof s=="function"&&s instanceof s&&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),l){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),b=void 0;if(h=v.length,Object.keys(e).length!==h)return!1;for(;h--;)if(b=v[h],!(oZ(e,b)&&PA(t[b],e[b],n-1,o,r)))return!1}return o.pop(),r.pop(),!0}function IP(t){return tf(t)?t.slice():iy(t)||Yl(t)||tb(t)||nc(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)&&!Po.isPrototypeOf(t)}function o3(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 FP=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},i3=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a3=(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}})(),s3=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)},l3=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},BP=console;function sZ(t){var e=TA().allowStateChanges;return TA().allowStateChanges=t,e}function lZ(t){TA().allowStateChanges=t}function uZ(t,e,n,o,r){var i=sZ(t),a=void 0;try{a=e(n,o,r)}finally{lZ(i)}return a}function $P(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=t[e],r=u3[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 UP(t,e){if(t==null||e==null||(typeof t>"u"?"undefined":FP(t))!=="object"||(typeof e>"u"?"undefined":FP(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 u3={componentWillMount:function(){var e=this,n=o3(this),o=!1,r=!1;function i(v){var b=this[v],w=wM("reactive "+v);Object.defineProperty(this,v,{configurable:!0,enumerable:!0,get:function(){return w.reportObserved(),b},set:function(E){!r&&UP(b,E)?(b=E,o=!0,w.reportChanged(),o=!1):b=E}})}i.call(this,"props"),i.call(this,"state");var a=this.render.bind(this),l=null,s=!1,f=function(){return l=new A_(n+".render()",function(){if(!s&&(s=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var b=!0;try{r=!0,o||Po.prototype.forceUpdate.call(e),b=!1}finally{r=!1,b&&l.dispose()}}}),l.reactComponent=e,h.$mobx=l,e.render=h,h(e.props,e.state,e.context)},h=function(b,w,O){s=!1;var E=void 0,S=void 0;if(l.track(function(){try{S=uZ(!1,a,b,w,O)}catch(M){E=M}}),E)throw E;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:UP(this.props,e)}};function TM(t){if(arguments.length>1&&BP.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&&BP.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 TM((n=e=(function(r){s3(i,r);function i(){return i3(this,i),l3(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return a3(i,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),i})(Po),e.displayName=o3(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){$P(t,"componentWillMount",!0),$P(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=u3.shouldComponentUpdate)}var dZ=TM(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,l=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,f=s&&s(Object);return function h(v,b,w){if(typeof b!="string"){if(f){var O=s(b);O&&O!==f&&h(v,O,w)}var E=i(b);a&&(E=E.concat(a(b)));for(var S=0;S<E.length;++S){var M=E[S];if(!n[M]&&!o[M]&&(!w||!w[M])){var C=l(b,M);try{r(v,M,C)}catch{}}}return v}return v}}))});var VP={children:!0,key:!0,ref:!0},WP=console;(function(t){s3(e,t);function e(){return i3(this,e),l3(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return a3(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)!VP[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&&WP.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)!VP[r]&&this.props[r]!==o[r]&&WP.warn("MobX Provider: Provided store '"+r+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e})(Po);if(!Po)throw new Error("mobx-preact requires Preact to be available");var Bd,JO,GP,c3=[],Ds=xo,zP=Ds.__b,HP=Ds.__r,XP=Ds.diffed,YP=Ds.__c,qP=Ds.unmount,KP=Ds.__;function hZ(){for(var t;t=c3.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(K0),e.__h.some(kA),e.__h=[]}catch(n){e.__h=[],Ds.__e(n,t.__v)}}}Ds.__b=function(t){Bd=null,zP&&zP(t)},Ds.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),KP&&KP(t,e)},Ds.__r=function(t){HP&&HP(t);var e=(Bd=t.__c).__H;e&&(JO===Bd?(e.__h=[],Bd.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(K0),e.__h.some(kA),e.__h=[])),JO=Bd},Ds.diffed=function(t){XP&&XP(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(c3.push(e)!==1&&GP===Ds.requestAnimationFrame||((GP=Ds.requestAnimationFrame)||vZ)(hZ)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),JO=Bd=null},Ds.__c=function(t,e){e.some(function(n){try{n.__h.some(K0),n.__h=n.__h.filter(function(o){return!o.__||kA(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Ds.__e(o,n.__v)}}),YP&&YP(t,e)},Ds.unmount=function(t){qP&&qP(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&&Ds.__e(e,n.__v))};var ZP=typeof requestAnimationFrame=="function";function vZ(t){var e,n=function(){clearTimeout(o),ZP&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);ZP&&(e=requestAnimationFrame(n))}function K0(t){var e=Bd,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Bd=e}function kA(t){var e=Bd;t.__c=t.__(),Bd=e}function mZ(t,e){for(var n in e)t[n]=e[n];return t}function JP(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 QP(t,e){this.props=t,this.context=e}(QP.prototype=new Po).isPureReactComponent=!0,QP.prototype.shouldComponentUpdate=function(t,e){return JP(this.props,t)||JP(this.state,e)};var ek=xo.__b;xo.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),ek&&ek(t)};var gZ=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)}gZ(t,e,n,o)};var tk=xo.unmount;function d3(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=mZ({},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 d3(o,e,n)})),t}function f3(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return f3(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 p3(t){if(!t.__)return null;var e=t.__.__c;return e&&e.__a&&e.__a(t)}function g0(){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),tk&&tk(t)},(QO.prototype=new Po).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=p3(o.__v),i=!1,a=function(){i||o.__z||(i=!0,n.__R=null,r?r(s):s())};n.__R=a;var l=n.__P;n.__P=null;var s=function(){if(!--o.__u){if(o.state.__a){var f=o.state.__a;o.__v.__k[0]=f3(f,f.__c.__P,f.__c.__O)}var h;for(o.setState({__a:o.__b=null});h=o.o.pop();)h.__P=l,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]=d3(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&Lr(jg,null,t.fallback);return r&&(r.__u&=-33),[Lr(jg,null,e.__a?null:t.children),r]};var nk=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]}};(g0.prototype=new Po).__a=function(t){var e=this,n=p3(e.__v),o=e.l.get(t);return o[0]++,function(r){var i=function(){e.props.revealOrder?(o.push(r),nk(e,t,o)):r()};n?n(i):i()}},g0.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},g0.prototype.componentDidUpdate=g0.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){nk(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 rk(t,e,n){return e.__k==null&&(e.textContent=""),Yq(t,e),typeof n=="function"&&n(),t?t.__c:null}Po.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Po.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var ok=xo.event;function OZ(){}function SZ(){return this.cancelBubble}function AZ(){return this.defaultPrevented}xo.event=function(t){return ok&&(t=ok(t)),t.persist=OZ,t.isPropagationStopped=SZ,t.isDefaultPrevented=AZ,t.nativeEvent=t};var MZ={enumerable:!1,configurable:!0,get:function(){return this.class}},ik=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 l=n[a];if(!(a==="value"&&"defaultValue"in n&&l==null||EZ&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&l===!0?l="":s==="translate"&&l==="no"?l=!1:s[0]==="o"&&s[1]==="n"?s==="ondoubleclick"?a="ondblclick":s!=="onchange"||o!=="input"&&o!=="textarea"||xZ(n.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":bZ.test(a)&&(a=s):s=a="oninput":i&&_Z.test(a)?a=a.replace(wZ,"-$&").toLowerCase():l===null&&(l=void 0),s==="oninput"&&r[a=s]&&(a="oninputCapture"),r[a]=l}}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,ik&&ik(t)};var ak=xo.__r;xo.__r=function(t){ak&&ak(t),t.__c};var sk=xo.diffed;xo.diffed=function(t){sk&&sk(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,l,s=e;if("ref"in s)for(l in s={},e)l=="ref"?a=e[l]:s[l]=e[l];var f={type:t,props:s,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(l in a)s[l]===void 0&&(s[l]=a[l]);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 lk={node:!1,edge:!1},NZ={node:!0,edge:!0},PZ=function(t){return!t||typeof t=="boolean"?t===!0?to(NZ):to(lk):Yv(to(lk),t)},kZ=function(){return om(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function Zs(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 _o;(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"})(_o||(_o={}));var pr;(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"})(pr||(pr={}));var vs;(function(t){t[t.STATIC=-1]="STATIC",t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE",t[t.EDGE_TOP=2]="EDGE_TOP"})(vs||(vs={}));var ni;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(ni||(ni={}));var Zu;(function(t){t.TEXT="text",t.LABEL="label"})(Zu||(Zu={}));var jZ=0,oc=(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,l=a===void 0?Qy:a,s=e.eventType,f=s===void 0?"":s,h=e.eventCenter,v=e.step,b=v===void 0?1:v,w=e.isStopPropagation,O=w===void 0?!0:w,E=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(C){var $,D,k=window==null?void 0:window.document;if(C.button===jZ){M.isStopPropagation&&C.stopPropagation(),M.isStartDragging=!0,M.startX=C.clientX,M.startY=C.clientY,k.addEventListener("mousemove",M.handleMouseMove,!1),k.addEventListener("mouseup",M.handleMouseUp,!1);var B=($=M.model)===null||$===void 0?void 0:$.getData();(D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_MOUSEDOWN")],{e:C,data:M.data||B}),M.startTime=new Date().getTime()}},this.handleMouseMove=function(C){var $,D;if(M.isStopPropagation&&C.stopPropagation(),!!M.isStartDragging&&(M.sumDeltaX+=C.clientX-M.startX,M.sumDeltaY+=C.clientY-M.startY,M.startX=C.clientX,M.startY=C.clientY,M.step<=1||Math.abs(M.sumDeltaX)>M.step||Math.abs(M.sumDeltaY)>M.step)){var k=M.sumDeltaX%M.step,B=M.sumDeltaY%M.step,F=M.sumDeltaX-k,I=M.sumDeltaY-B;M.sumDeltaX=k,M.sumDeltaY=B;var V=($=M.model)===null||$===void 0?void 0:$.getData();M.isDragging||((D=M.eventCenter)===null||D===void 0||D.emit(pr["".concat(M.eventType,"_DRAGSTART")],{e:C,data:M.data||V}),M.onDragStart({event:C})),M.isDragging=!0,Promise.resolve().then(function(){var z,X;M.onDragging({deltaX:F,deltaY:I,event:C}),(z=M.eventCenter)===null||z===void 0||z.emit(pr["".concat(M.eventType,"_MOUSEMOVE")],{deltaX:F,deltaY:I,e:C,data:M.data||V}),(X=M.eventCenter)===null||X===void 0||X.emit(pr["".concat(M.eventType,"_DRAG")],{e:C,data:M.data||V})})}},this.handleMouseUp=function(C){var $=window.document;M.isStartDragging=!1,M.isStopPropagation&&C.stopPropagation(),Promise.resolve().then(function(){var D,k,B;$.removeEventListener("mousemove",M.handleMouseMove,!1),$.removeEventListener("mouseup",M.handleMouseUp,!1);var F=(D=M.model)===null||D===void 0?void 0:D.getData();(k=M.eventCenter)===null||k===void 0||k.emit(pr["".concat(M.eventType,"_MOUSEUP")],{e:C,data:M.data||F}),M.isDragging&&(M.isDragging=!1,M.onDragEnd({event:C}),(B=M.eventCenter)===null||B===void 0||B.emit(pr["".concat(M.eventType,"_DROP")],{e:C,data:M.data||F}))})},this.cancelDrag=function(){var C=window==null?void 0:window.document;C.removeEventListener("mousemove",M.handleMouseMove,!1),C.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=l,this.step=b,this.isStopPropagation=O,this.eventType=f,this.eventCenter=h,this.model=E,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,l=o.height;return{x:r-a/2,y:i-l/2,x1:r+a/2,y1:i+l/2}},BZ=function(t){var e=t.path,n=CM(e),o=N_(n,8),r=o.x,i=o.y,a=o.width,l=o.height;return{x:r-a/2,y:i-l/2,x1:r+a/2,y1:i+l/2}},$Z=function(t){if(t.modelType===_o.LINE_EDGE)return IZ(t);if(t.modelType===_o.POLYLINE_EDGE)return FZ(t);if(t.modelType===_o.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,l=n.x,s=n.y,f=(s-a)/(l-i),h=a-f*i;return(o>=i&&o<=l||o<=i&&o>=l)&&(r>=a&&r<=s||r<=a&&r>=s)&&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},l=Math.atan((n.y-e.y)/(n.x-e.x)),s=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(l+s),a.leftY=e.y-f*Math.cos(l+s),a.rightX=e.x-f*Math.sin(l-s),a.rightY=e.y+f*Math.cos(l-s)):(a.leftX=e.x-f*Math.sin(l+s),a.leftY=e.y+f*Math.cos(l+s),a.rightX=e.x+f*Math.sin(l-s),a.rightY=e.y-f*Math.cos(l-s)):i==="end"&&(n.x>=e.x?(a.leftX=n.x+f*Math.sin(l-s),a.leftY=n.y-f*Math.cos(l-s),a.rightX=n.x-f*Math.sin(l+s),a.rightY=n.y+f*Math.cos(l+s)):(a.leftX=n.x-f*Math.sin(l-s),a.leftY=n.y+f*Math.cos(l-s),a.rightX=n.x+f*Math.sin(l+s),a.rightY=n.y-f*Math.cos(l+s))),a},bg=function(){return bg=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},bg.apply(this,arguments)},Xu=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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yh=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},RA=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},Pw=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}},uk=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,yh([],Xu(n),!1)),i=Math.max.apply(Math,yh([],Xu(n),!1)),a=Math.min.apply(Math,yh([],Xu(o),!1)),l=Math.max.apply(Math,yh([],Xu(o),!1)),s=i-r,f=l-a;return e&&(s+=e,f+=e),{centerX:(r+i)/2,centerY:(a+l)/2,maxX:i,maxY:l,minX:r,minY:a,x:(r+i)/2,y:(a+l)/2,height:f,width:s}},kw=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 yh(yh([],Xu(GZ(t,e.x)),!1),Xu(zZ(t,e.y)),!1)},DA=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},ck=function(t,e,n,o,r){return DA(t,e)+DA(t,n)+XZ(t,[e,n,o,r])},h3=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&h3(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,l=o.y-n.y,s=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*l),f=(a*(t.y-n.y)-l*(t.x-n.x))/(-a*i+r*l);return s>=0&&s<=1&&f>=0&&f<=1},dk=function(t,e,n){if(n.width===0&&n.height===0)return!1;var o=Xu(kw(n),4),r=o[0],i=o[1],a=o[2],l=o[3];return Hy(t,e,r,i)||Hy(t,e,r,l)||Hy(t,e,i,a)||Hy(t,e,a,l)},qZ=function(t,e,n,o){var r=[];return t.forEach(function(i){i!==e&&(i.x===e.x||i.y===e.y)&&!dk(i,e,n)&&!dk(i,e,o)&&r.push(i)}),RA(r)},KZ=function(t,e,n,o,r,i,a){var l=[],s=[e],f={},h={},v={};e.id&&(h[e.id]=0,v[e.id]=ck(e,n,e));var b={};t.forEach(function(E){E.id&&(b[E.id]=E)});for(var w=function(){var E,S=1/0;if(s.forEach(function(C){C.id&&v[C.id]<S&&(S=v[C.id],E=C)}),E===n&&n.id){var M=[];return h3(M,b,f,n.id),{value:M}}if(!E)return{value:[e,n]};YZ(s,E),l.push(E),qZ(t,E,o,r).forEach(function(C){var $;if(l.indexOf(C)===-1&&(s.indexOf(C)===-1&&s.push(C),E!=null&&E.id&&(C!=null&&C.id))){var D=(($=h[E.id])!==null&&$!==void 0?$:0)+DA(E,C);if(h[C.id]&&D>=h[C.id])return;f[C.id]=E.id,h[C.id]=D,v[C.id]=h[C.id]+ck(C,n,e,i,a)}})};s.length;){var O=w();if(typeof O=="object")return O.value}return[e,n]},fk=function(t){return gu(t)},v3=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},pk=function(t,e,n,o,r){var i=fk(n),a=fk(o),l=Nw(i,r),s=Nw(a,r),f=Pw(l,i,t),h=Pw(s,a,e);if(VZ(l,s)){var v=JZ(t,e,f,h);return yh(yh([t,f],Xu(v),!1),[h,e],!1)}var b=N_([f,h]),w=uk(l,b),O=uk(s,b),E=[];E=E.concat(kw(w)),E=E.concat(kw(O));var S={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[b,w,O].forEach(function(C){E=E.concat(HZ(C,S).filter(function($){return _0($,l)&&_0($,s)}))}),[{x:f.x,y:h.y},{x:h.x,y:f.y}].forEach(function(C){_0(C,l)&&_0(C,s)&&E.push(C)}),E.unshift(f),E.push(h),E=RA(E);var M=KZ(E,f,h,i,a,t,e);return M.unshift(t),M.push(e),M.length>2&&(M=v3(M)),RA(M)},ZZ=function(t){if(t.length===1){var e=Xu(t,1),n=e[0];return[n,n]}else{for(var o=t[0],r=t[1],i=Xc(o.x,o.y,r.x,r.y),a=1;a<t.length-1;a++){var l=t[a],s=t[a+1],f=Xc(l.x,l.y,s.x,s.y);f>i&&(i=f,o=l,r=s)}return[o,r]}},hk=function(t,e,n){var o=ip(t,n),r=ip(e,n);return o&&r},vk=function(t,e,n){var o=ip(t,n),r=ip(e,n),i=o&&r,a=o||r;return!i&&a},mk=function(t,e,n){for(var o=void 0,r=gu(n),i=kw(r),a=0;a<i.length;a++){var l=Hy(t,e,i[a],i[(a+1)%i.length]);l&&(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=Xu(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 l={x:n.x,y:o.y},s=T_(l,t,n),f=T_(l,e,o);if(s||f)l={x:o.x,y:n.y};else{var h=gk(l,t,n),v=gk(l,e,o);h&&v&&(l={x:o.x,y:n.y})}r.push(l)}return r},gk=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},m3=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_(bg(bg({},r),{type:"start"})),a=C_(bg(bg({},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"}},yk=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=gu(o),l=gu(r),s=Nw(a,i),f=Nw(l,i),h=Pw(s,a,e),v=Pw(f,l,n);return{sNext:h,ePre:v}},CM=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=Xu(t.replace(/(^\s*)/g,"").split(" "),2),n=e[0],o=e[1];return{x:+n,y:+o}},_k=function(t,e){var n=Xu(t,4),o=n[0],r=n[1],i=n[2],a=n[3],l=WJ(o,r,i,a,e);return[l,t[3]]},g3=function(t,e){for(var n=t.x,o=t.y,r=Kv(e),i=Number.MAX_SAFE_INTEGER,a,l=[],s=0;s<r.length;s++)l.push({start:r[s],end:r[(s+1)%r.length]});if(l.forEach(function(b){var w=b.start,O=b.end;if(w.x===O.x){var E={x:w.x,y:o},S=T_(E,w,O);if(S){var M=Math.abs(w.x-n);M<i&&(i=M,a=E)}}else if(w.y===O.y){var E={x:n,y:w.y},S=T_(E,w,O);if(S){var M=Math.abs(w.y-o);M<i&&(i=M,a=E)}}}),!a){var f=l[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"])},bk=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=m3(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},ng=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(l){a={error:l}}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 Wg(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([],ng(t.map(function(E){return E[0]})),!1)),r=Math.max.apply(Math,w0([],ng(t.map(function(E){return E[0]})),!1)),i=Math.min.apply(Math,w0([],ng(t.map(function(E){return E[1]})),!1)),a=Math.max.apply(Math,w0([],ng(t.map(function(E){return E[1]})),!1)),l=-o,s=-i,f=t.map(function(E){var S=ng(E,2),M=S[0],C=S[1];return[M+l,C+s]}),h=r-o,v=a-i,b=e?e/h:1,w=n?n/v:1,O=Math.min(b,w);return f.map(function(E){var S=ng(E,2),M=S[0],C=S[1];return[M*O,C*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(l){a={error:l}}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),l=a[0],s=a[1],f=eS(n,2),h=f[0],v=f[1];return r>l&&r<h&&i>s&&i<v},y3=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},NM=(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 wk(t,e){return t instanceof Ls&&e instanceof Ls}var _3=(function(t){NM(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(wk(this,n))return new Ls(this.x+n.x,this.y+n.y);var o=this.z+n.z;return new jA((this.x+n.x)/o,(this.y+n.y)/o)},e.prototype.subtract=function(n){if(wk(this,n))return new Ls(this.x-n.x,this.y-n.y);var o=this.z-n.z;return o===0?new Ls(this.x-n.x,this.y-n.y):new jA((this.x-n.x)/o,(this.y-n.y)/o)},e})(Array),Ls=(function(t){NM(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})(_3),jA=(function(t){NM(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})(_3),qE=(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)}})(),rg=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(l){a={error:l}}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){qE(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([],rg(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],rg(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(s){var f=n.getColumn(s);o[r][s]=i.reduce(function(h,v,b){return h+v*f[b]},0)},l=0;l<n.columns;l++)a(l);return new(e.bind.apply(e,nS([void 0],rg(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 jA(n[0],n[1])})},e.prototype.toString=function(){var n=rg(this[0],2),o=n[0],r=n[1],i=rg(this[1],2),a=i[0],l=i[1],s=rg(this[2],2),f=s[0],h=s[1];return"matrix(".concat(o," ").concat(r," ").concat(a," ").concat(l," ").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){qE(e,t);function e(n){var o=t.call(this,new Ls(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Ls(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Ls(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.inverse=function(){return this.transpose()},e})(ib),iJ=(function(t){qE(e,t);function e(n,o){var r=t.call(this,new Ls(n,0,0),new Ls(0,o,0),new Ls(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){qE(e,t);function e(n,o){var r=t.call(this,new Ls(1,0,0),new Ls(0,1,0),new Ls(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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},LA=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 l=i.getTargetAnchor(t);if(l){var s={node:i,anchorIndex:l.index,anchor:l.anchor};(!o||sJ(i,o.node,e))&&(o=s)}}}return o},sJ=function(t,e,n){return t.zIndex>e.zIndex?!0:n.nodesMap[t.id].index>n.nodesMap[e.id].index},lJ=function(t,e){for(var n=LA(e),o,r=Number.MAX_SAFE_INTEGER,i=0;i<n.length;i++){var a=Xc(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},Xc=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=gu(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],l=i[1],s={x:a,y:l};return s.x>=r.minX-n&&s.x<=r.maxX+n&&s.y>=r.minY-n&&s.y<=r.maxY+n&&(o=!0),o},uJ=function(t,e){return ip(t,e,5)},gu=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}]},Ek=function(t,e,n){var o=cJ(n),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var l=Xc(t.x,t.y,a.x,a.y);l<i&&(i=l,r=a)}),IA(t,e,r)},IA=function(t,e,n){var o,r=n.x,i=n.y,a=n.r;if(e===ni.HORIZONTAL){var l=r-Math.sqrt(a*a-(t.y-i)*(t.y-i)),s=r+Math.sqrt(a*a-(t.y-i)*(t.y-i)),f=Math.abs(l-t.x)<Math.abs(s-t.x)?l:s;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)),b=Math.abs(h-t.y)<Math.abs(v-t.y)?h:v;o={x:t.x,y:b}}return o},xk=function(t,e){var n=e,o=!1,r=n.x,i=n.y,a=n.width,l=n.height,s=n.radius,f={minX:r-a/2+s,maxX:r+a/2-s,minY:i-l/2+s,maxY:i+l/2-s};return t.y===i+l/2||t.y===i-l/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},Ok=function(t,e,n){var o,r=n,i=r.x,a=r.y,l=r.rx,s=r.ry;if(e===ni.HORIZONTAL){var f=i-Math.sqrt(l*l-(t.y-a)*(t.y-a)*l*l/(s*s)),h=i+Math.sqrt(l*l-(t.y-a)*(t.y-a)*l*l/(s*s)),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 b=a-Math.sqrt(s*s-(t.x-i)*(t.x-i)*s*s/(l*l)),w=a+Math.sqrt(s*s-(t.x-i)*(t.x-i)*s*s/(l*l)),O=Math.abs(b-t.y)<Math.abs(w-t.y)?b:w;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=[],l=0;l<o.length;l++)a.push({start:o[l],end:o[(l+1)%o.length]});return a.forEach(function(s){var f=s.start,h=s.end,v=f,b=h;f.x>h.x&&(v=h,b=f);var w={x:t.x,y:t.y};if(v.x===b.x&&e===ni.HORIZONTAL&&(w={x:v.x,y:t.y}),v.y===b.y&&e===ni.VERTICAL&&(w={x:t.x,y:v.y}),v.x!==b.x&&v.y!==b.y){var O=(b.y-v.y)/(b.x-v.x),E=(v.x*b.y-b.x*v.y)/(v.x-b.x);e===ni.HORIZONTAL?w={x:(t.y-E)/O,y:t.y}:e===ni.VERTICAL&&(w={x:t.x,y:O*t.x+E})}var S=T_(w,f,h);if(S){var M=Xc(w.x,w.y,t.x,t.y);M<r&&(r=M,i=w)}}),i},dJ=function(t){var e=Vv(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},Sk=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}},b3=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(l){var s=document.createElement("div");s.textContent=l,i.appendChild(s)}):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},Ak=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach(function(i){var a=m3(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 ks=[];for(let t=0;t<256;++t)ks.push((t+256).toString(16).slice(1));function hJ(t,e=0){return ks[t[e+0]]+ks[t[e+1]]+ks[t[e+2]]+ks[t[e+3]]+"-"+ks[t[e+4]]+ks[t[e+5]]+"-"+ks[t[e+6]]+ks[t[e+7]]+"-"+ks[t[e+8]]+ks[t[e+9]]+"-"+ks[t[e+10]]+ks[t[e+11]]+ks[t[e+12]]+ks[t[e+13]]+ks[t[e+14]]+ks[t[e+15]]}const vJ=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Mk={randomUUID:vJ};function mJ(t,e,n){if(Mk.randomUUID&&!t)return Mk.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 wh=function(){return mJ()},t_=new Map,w3=function(t){var e=wh();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))},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)},gJ=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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function E3(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,l=a===void 0?12:a,s=t.fill,f=s===void 0?"currentColor":s,h=t.overflowMode,v=h===void 0?"default":h,b=t.textWidth,w=b===void 0?void 0:b,O=t.model,E={x:n,y:r,fill:f,fontSize:l,textAnchor:"middle",dominantBaseline:"central"};if(ri(pp(t),function(k){var B=gJ(k,2),F=B[0],I=B[1];typeof I!="object"&&(E[F]=I)}),i){var S=String(i).split(/[\r\n]/g),M=S.length;if(v!=="default"){var C=O.BaseType,$=O.modelType;if(C===da.NODE&&$!==_o.TEXT_NODE||C===da.EDGE&&w)return yJ(t)}if(M>1){var D=S.map(function(k,B){var F=l+2,I=(B-(M-1)/2)*F;return $t("tspan",{className:"lf-text-tspan",x:n,y:r+I,children:k})});return $t("text",P_({},E,{children:D}))}return $t("text",P_({},E,{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,l=a===void 0?12:a,s=t.lineHeight,f=t.fontFamily,h=f===void 0?"":f,v=t.wrapPadding,b=v===void 0?"0, 0":v,w=t.overflowMode,O=r.width,E=r.height,S=r.textHeight,M=i||O,C=String(o).split(/[\r\n]/g),$=C.length,D=b3({rows:C,style:{fontSize:"".concat(l,"px"),width:"".concat(M,"px"),fontFamily:h,lineHeight:s,padding:b},rowsLength:$,className:"lf-get-text-height"}),k=E>D?E:D;S&&(k=S);var B=w==="ellipsis";return B&&(k=l+2),$t("g",{children:$t("foreignObject",{width:M,height:k,x:e-M/2,y:n-k/2,style:{overflow:"visible",textAlign:"left"},children:$t("div",{className:"lf-node-text-auto-wrap",style:{minHeight:k,width:M,padding:b},children:$t("div",{className:B?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:B?C.join(""):"",style:P_({},t),children:C.map(function(F){return $t("div",{className:"lf-node-text--auto-wrap-inner",children:F})})})})})})}var FA=function(){return FA=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},FA.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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Gg(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return ri(pp(t),function(n){var o=_J(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("line",FA({},e))}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)},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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function Yu(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,l=t.radius,s=l===void 0?0:l,f=e-o/2,h=n-r/2,v={};return v["stroke-width"]=a,ri(pp(t),function(b){var w=bJ(b,2),O=w[0],E=w[1];typeof E!="object"&&(v[O]=E)}),i?v.className="lf-basic-shape ".concat(i):v.className="lf-basic-shape",s&&(v.rx=s,v.ry=s),v.x=f,v.y=h,$t("rect",BA({},v))}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)},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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function k_(t){var e={d:""};return ri(pp(t),function(n){var o=wJ(n,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(e[r]=i)}),$t("path",$A({},e))}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)},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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};function zg(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,l=t.className,s={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(f){var h=EJ(f,2),v=h[0],b=h[1];typeof b!="object"&&(s[v]=b)}),l?s.className="lf-basic-shape ".concat(l):s.className="lf-basic-shape",$t("circle",UA({},s))}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)},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(l){a={error:l}}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,l=t.ry,s=l===void 0?4:l,f=t.className,h={cx:n,cy:r,rx:a,ry:s,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return ri(pp(t),function(v){var b=xJ(v,2),w=b[0],O=b[1];typeof O!="object"&&(h[w]=O)}),f?h.className="lf-basic-shape ".concat(f):h.className="lf-basic-shape",$t("ellipse",VA({},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(l){a={error:l}}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(C){return{x:C[0],y:C[1]}}),o=n.length;if(o<3)return"";for(var r=Math.abs(e),i="",a=0;a<o;a++){var l=n[(a-1+o)%o],s=n[a],f=n[(a+1)%o],h={x:s.x-l.x,y:s.y-l.y},v={x:f.x-s.x,y:f.y-s.y},b=Math.hypot(h.x,h.y),w=Math.hypot(v.x,v.y),O={x:h.x/b,y:h.y/b},E={x:v.x/w,y:v.y/w},S={x:s.x-O.x*r,y:s.y-O.y*r},M={x:s.x+E.x*r,y:s.y+E.y*r};a===0?i+="M ".concat(S.x," ").concat(S.y," "):i+="L ".concat(S.x," ").concat(S.y," "),i+="Q ".concat(s.x," ").concat(s.y," ").concat(M.x," ").concat(M.y," ")}return i+="Z",i}function PM(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(pp(t),function(l){var s=SJ(l,2),f=s[0],h=s[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(l){return l.join(",")}).join(" "),$t("polygon",Bw({},i))}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)},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(l){a={error:l}}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(pp(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",WA({},n))}var x3=(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(l){a={error:l}}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 PJ=(function(t){x3(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(l){l.key==="Shift"&&(o.isShiftPressed=!0)},o.handleKeyUp=function(l){l.key==="Shift"&&(o.isShiftPressed=!1)},o.updateEdgePointByAnchors=function(){var l=o.nodeModel,s=l.id,f=l.anchors,h=o.graphModel.getNodeEdges(s);ri(h,function(v){if(v.sourceNodeId===s){var b=Sh(f,function(w){return w.id===v.sourceAnchorId});b&&v.updateStartPoint({x:b.x,y:b.y})}else if(v.targetNodeId===s){var b=Sh(f,function(O){return O.id===v.targetAnchorId});b&&v.updateEndPoint({x:b.x,y:b.y})}})},o.triggerResizeEvent=function(l,s,f,h,v,b){o.graphModel.eventCenter.emit(pr.NODE_RESIZE,{preData:l,data:s,deltaX:f,deltaY:h,index:v,model:b})},o.recalcResizeInfo=function(l,s,f,h,v){f===void 0&&(f=1),h===void 0&&(h=!1),v===void 0&&(v=!1);var b=to(s),w=b.deltaX,O=b.deltaY,E=b.width,S=b.height,M=b.PCTResizeInfo;if(M){var C=4,$=0,D=0;switch(l){case Ho.LEFT_TOP:D=(w*-1-O)/C;break;case Ho.RIGHT_TOP:D=(w-O)/C;break;case Ho.RIGHT_BOTTOM:D=(w+O)/C;break;case Ho.LEFT_BOTTOM:D=(w*-1+O)/C;break}D!==0&&($=Math.round(D/M.ResizeBasis.basisHeight*1e5)/1e3),M.ResizePCT.widthPCT=Math.max(Math.min(M.ResizePCT.widthPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit),M.ResizePCT.heightPCT=Math.max(Math.min(M.ResizePCT.heightPCT+$,M.ScaleLimit.maxScaleLimit),M.ScaleLimit.minScaleLimit);var k=Math.round(M.ResizePCT.widthPCT*M.ResizeBasis.basisWidth/100),B=Math.round(M.ResizePCT.heightPCT*M.ResizeBasis.basisHeight/100);switch(l){case Ho.LEFT_TOP:w=E-k,O=S-B;break;case Ho.RIGHT_TOP:w=k-E,O=S-B;break;case Ho.RIGHT_BOTTOM:w=k-E,O=B-S;break;case Ho.LEFT_BOTTOM:w=E-k,O=B-S;break}return b}switch(l){case Ho.LEFT_TOP:b.width=h?E:E-w*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_TOP:b.width=h?E:E+w*f,b.height=v?S:S-O*f;break;case Ho.RIGHT_BOTTOM:b.width=h?E:E+w*f,b.height=v?S:S+O*f;break;case Ho.LEFT_BOTTOM:b.width=h?E:E-w*f,b.height=v?S:S+O*f;break}return b},o.resizeNode=function(l){var s=l.deltaX,f=l.deltaY,h=o.index,v=o.props,b=v.model,w=v.graphModel,O=v.x,E=v.y;O3({x:O,y:E,deltaX:s,deltaY:f,index:h,nodeModel:b,graphModel:w,forceProportional:o.isShiftPressed,cancelCallback:function(){o.dragHandler.cancelDrag()}})},o.onDragStart=function(){o.graphModel.selectNodeById(o.nodeModel.id)},o.onDragging=function(l){var s=l.deltaX,f=l.deltaY,h=o.graphModel.transformModel,v=NJ(h.fixDeltaXY(s,f),2),b=v[0],w=v[1];o.resizeNode({deltaX:b,deltaY:w})},o.onDragEnd=function(){var l=o.nodeModel.x,s=o.nodeModel.y;o.nodeModel.moveTo(l,s),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 oc({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,l=a.getResizeControlStyle(),s=l.width,f=l.height,h=CJ(l,["width","height"]);return $t("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[$t(Yu,R_({className:"lf-resize-control-content",x:o,y:r,width:s??7,height:f??7},h)),$t(Yu,{className:"lf-resize-control-content",x:o,y:r,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e})(Po),kJ=(function(t){x3(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=gu(o),a=i.minX,l=i.minY,s=i.maxX,f=i.maxY,h=[{index:Ho.LEFT_TOP,direction:"nw",x:a,y:l},{index:Ho.RIGHT_TOP,direction:"ne",x:s,y:l},{index:Ho.RIGHT_BOTTOM,direction:"se",x:s,y:f},{index:Ho.LEFT_BOTTOM,direction:"sw",x:a,y:f}];return ec(h,function(v){return $t(PJ,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,l=n.getResizeOutlineStyle();return $t(Yu,R_({},l,{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})(Po);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,l=r*Math.sin(o)+i*Math.cos(o)+e.y;return{x:a,y:l}}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,l){r===void 0&&(r=!1),i===void 0&&(i=!1);var s={x:n.x-(t.x-n.x),y:n.y-(t.y-n.y)},f=RJ(s,e),h=Xy(e,f,-o),v=Xy(s,f,-o);if(r){var b=Math.abs(h.x-v.x),w=b-a;f.x>h.x?f.x=f.x+w/2:f.x=f.x-w/2}if(i){var O=Math.abs(h.y-v.y),E=O-l;f.y>h.y?f.y=f.y+E/2:f.y=f.y-E/2}if(r||i){var S=Xy(v,f,o),M=S.x-s.x,C=S.y-s.y;f.x=f.x-M,f.y=f.y-C,v=Xy(s,f,-o),h={x:f.x-(v.x-f.x),y:f.y-(v.y-f.y)}}var $=Math.abs(h.x-v.x),D=Math.abs(h.y-v.y);return r&&($=a),i&&(D=l),{width:$,height:D,center:f}}function IJ(t,e,n,o,r,i,a,l,s){l===void 0&&(l=!1),s===void 0&&(s=!1);var f=e.deltaX,h=e.deltaY,v=e.width,b=e.height,w=jJ(n),O={x:o,y:r},E={x:i,y:a},S=Xy(O,E,w),M={x:S.x+f,y:S.y+h},C=LJ(S,M,E,w,l,s,v,b),$=C.width,D=C.height,k=C.center;return e.width=$*t,e.height=D*t,e.deltaX=(k.x-E.x)*2,e.deltaY=(k.y-E.y)*2,e}var FJ=function(t,e,n,o,r,i,a,l,s,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),b=v.deltaX,w=v.deltaY,O=v.width,E=v.height,S=v.PCTResizeInfo;if(S){var M=4,C=0,$=0;switch(t){case Ho.LEFT_TOP:$=(b*-1-w)/M;break;case Ho.RIGHT_TOP:$=(b-w)/M;break;case Ho.RIGHT_BOTTOM:$=(b+w)/M;break;case Ho.LEFT_BOTTOM:$=(b*-1+w)/M;break}$!==0&&(C=Math.round($/S.ResizeBasis.basisHeight*1e5)/1e3),S.ResizePCT.widthPCT=Math.max(Math.min(S.ResizePCT.widthPCT+C,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit),S.ResizePCT.heightPCT=Math.max(Math.min(S.ResizePCT.heightPCT+C,S.ScaleLimit.maxScaleLimit),S.ScaleLimit.minScaleLimit);var D=Math.round(S.ResizePCT.widthPCT*S.ResizeBasis.basisWidth/100),k=Math.round(S.ResizePCT.heightPCT*S.ResizeBasis.basisHeight/100);switch(t){case Ho.LEFT_TOP:b=O-D,w=E-k;break;case Ho.RIGHT_TOP:b=D-O,w=E-k;break;case Ho.RIGHT_BOTTOM:b=D-O,w=k-E;break;case Ho.LEFT_BOTTOM:b=O-D,w=k-E;break}return v}if(i%(2*Math.PI)!==0&&a!==void 0&&l!==void 0)return IJ(n,v,i,a,l,s,f,o,r);if(h){var B=O/E,F=0,I=O,V=E;switch(t){case Ho.LEFT_TOP:F=Math.abs(b)>Math.abs(w)?-b:-w,B>=1?(I=O+F,V=I/B):(V=E+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=E-V;break;case Ho.RIGHT_TOP:F=Math.abs(b)>Math.abs(w)?b:-w,B>=1?(I=O+F,V=I/B):(V=E-F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=E-V;break;case Ho.RIGHT_BOTTOM:F=Math.abs(b)>Math.abs(w)?b:w,B>=1?(I=O+F,V=I/B):(V=E+F,I=V*B),v.width=I,v.height=V,v.deltaX=I-O,v.deltaY=V-E;break;case Ho.LEFT_BOTTOM:F=Math.abs(b)>Math.abs(w)?-b:w,B>=1?(I=O-F,V=I/B):(V=E+F,I=V*B),v.width=I,v.height=V,v.deltaX=O-I,v.deltaY=V-E;break}return v}switch(t){case Ho.LEFT_TOP:v.width=o?O:O-b*n,v.height=r?E:E-w*n;break;case Ho.RIGHT_TOP:v.width=o?O:O+b*n,v.height=r?E:E-w*n;break;case Ho.RIGHT_BOTTOM:v.width=o?O:O+b*n,v.height=r?E:E+w*n;break;case Ho.LEFT_BOTTOM:v.width=o?O:O-b*n,v.height=r?E:E+w*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=Sh(o,function(l){return l.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===n){var a=Sh(o,function(s){return s.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},$J=function(t,e,n,o,r,i,a){a.eventCenter.emit(pr.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:r,model:i})},O3=function(t){var e=t.x,n=t.y,o=t.deltaX,r=t.deltaY,i=t.index,a=t.nodeModel,l=t.graphModel,s=t.cancelCallback,f=t.forceProportional,h=f===void 0?!1:f,v=a.r,b=a.rx,w=a.ry,O=a.width,E=a.height,S=a.PCTResizeInfo,M=a.minWidth,C=a.minHeight,$=a.maxWidth,D=a.maxHeight,k=a.rotate,B=a.x,F=a.y,I=M===$,V=C===D,z={width:v||b||O,height:v||w||E,deltaX:o,deltaY:r,PCTResizeInfo:S},X=v||b&&w?1/2:1,Y=e,W=n,Q=FJ(i,z,X,I,V,k,Y,W,B,F,h);if(Q.width<M||Q.width>$||Q.height<C||Q.height>D){s==null||s();return}(k%(2*Math.PI)==0||S||Y===void 0||W===void 0)&&(Q.deltaX=I?0:Q.deltaX,Q.deltaY=V?0:Q.deltaY);var J=a.getData(),ie=a.resize(Q);J.x===ie.x&&J.y===ie.y||(BJ(a,l),$J(J,ie,o,r,i,a,l))},UJ=100,VJ={x:1,y:0};function WJ(t,e,n,o,r){for(var i=function(w){if(w<0||w>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-w,3)+3*e.x*w*Math.pow(1-w,2)+3*n.x*Math.pow(w,2)*(1-w)+o.x*Math.pow(w,3),y:t.y*Math.pow(1-w,3)+3*e.y*w*Math.pow(1-w,2)+3*n.y*Math.pow(w,2)*(1-w)+o.y*Math.pow(w,3)}},a=0,l=2,s=o.x,f=o.y,h=o;a<r&&l<50;){h=i(1-l/UJ);var v=h.x,b=h.y;a=Xc(s,f,v,b),l++}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(Tk(t),Tk(e)));return n>=0?o:-o}function Tk(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 S3={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:S3},JJ={background:"#23272e"},QJ={background:"#fefeff"},GA={background:"#ffffff"},j_={colorful:QJ,dark:JJ,radius:GA,default:GA},eQ={color:"#66676a",thickness:1},tQ={color:"#dadada",thickness:1},zA={color:"#acacac",thickness:1},L_={colorful:tQ,dark:eQ,radius:zA,default:zA},A3=function(t,e){var n=to(S3);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||GA,L_[t]=e.grid||zA},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=A3,aQ=1e3,sQ=999,I_=function(){return++aQ},lQ=function(){return--sQ},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)},kr=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},KE=(function(){function t(e,n){var o;this.BaseType=da.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Zu.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=_o.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||wh()}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 l=this.graphModel,s=l.overlapMode,f=l.eventCenter;this.updateZIndexByOverlap(s,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=LA(e);if(o){if(r=Sh(a,function(l){return l.id===o}),r)return r;console.warn("未在节点上找到指定的起点锚点".concat(o,",已使用默认锚点作为起点"))}return a.forEach(function(l){var s=bk(l,n);(i===void 0||s<i)&&(i=s,r=l)}),r},t.prototype.getEndAnchor=function(e,n){var o=this,r,i,a=LA(e);if(n){if(r=Sh(a,function(l){return l.id===n}),r)return r;console.warn("未在节点上找到指定的终点锚点".concat(n,",已使用默认锚点作为终点"))}return a.forEach(function(l){if(o.startPoint){var s=bk(l,o.startPoint);(i===void 0||s<i)&&(i=s,r=l)}}),r},t.prototype.getProperties=function(){return Gc(this.properties)},t.prototype.getData=function(){var e=this.properties;Ug(e)&&(e=Gc(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)};[vs.INCREASE,vs.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){SM(this.properties,e,Zs(n)),this.setAttributes()},t.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},t.prototype.setProperties=function(e){this.properties=Da(Da({},Gc(this.properties)),Zs(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]=Zs(n),o))},t.prototype.setStyles=function(e){this.style=Da(Da({},this.style),Zs(e))},t.prototype.updateStyles=function(e){this.style=Da({},Zs(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,l=i.edgeTextEdit,s=this.textPosition,f=s.x,h=s.y,v=e.text,b={value:"",x:f,y:h,draggable:a,editable:l};v&&(typeof v=="string"?b=Da(Da({},b),{value:v}):(b=Da(Da({},b),{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)||(b.draggable=v.draggable),Xv(v.editable)||(b.editable=v.editable))),this.text=b},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,l=o.draggable,s=o.editable;this.text={value:a,editable:s,draggable:l,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({},Gc(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 vs.DEFAULT:this.zIndex=0;break;case vs.EDGE_TOP:this.zIndex=1;break;case vs.INCREASE:this.zIndex=n;break}},t.BaseType=da.EDGE,kr([Ut],t.prototype,"type",void 0),kr([Ut],t.prototype,"sourceNodeId",void 0),kr([Ut],t.prototype,"targetNodeId",void 0),kr([Ut],t.prototype,"startPoint",void 0),kr([Ut],t.prototype,"endPoint",void 0),kr([Ut],t.prototype,"textMode",void 0),kr([Ut],t.prototype,"text",void 0),kr([Ut],t.prototype,"properties",void 0),kr([Ut],t.prototype,"points",void 0),kr([Ut],t.prototype,"pointsList",void 0),kr([Ut],t.prototype,"isSelected",void 0),kr([Ut],t.prototype,"isHovered",void 0),kr([Ut],t.prototype,"isHitable",void 0),kr([Ut],t.prototype,"isHittable",void 0),kr([Ut],t.prototype,"draggable",void 0),kr([Ut],t.prototype,"visible",void 0),kr([Ut],t.prototype,"isAnimation",void 0),kr([Ut],t.prototype,"isShowAdjustPoint",void 0),kr([Ut],t.prototype,"zIndex",void 0),kr([Ut],t.prototype,"state",void 0),kr([Ut],t.prototype,"style",void 0),kr([Ut],t.prototype,"arrowConfig",void 0),kr([Ai],t.prototype,"sourceNode",null),kr([Ai],t.prototype,"targetNode",null),kr([Ai],t.prototype,"textPosition",null),kr([Bt],t.prototype,"setProperty",null),kr([Bt],t.prototype,"deleteProperty",null),kr([Bt],t.prototype,"setProperties",null),kr([Bt],t.prototype,"changeEdgeId",null),kr([Bt],t.prototype,"setStyle",null),kr([Bt],t.prototype,"setStyles",null),kr([Bt],t.prototype,"updateStyles",null),kr([Bt],t.prototype,"setTextMode",null),kr([Bt],t.prototype,"formatText",null),kr([Bt],t.prototype,"resetTextPosition",null),kr([Bt],t.prototype,"moveText",null),kr([Bt],t.prototype,"setText",null),kr([Bt],t.prototype,"updateText",null),kr([Bt],t.prototype,"setAnchors",null),kr([Bt],t.prototype,"setSelected",null),kr([Bt],t.prototype,"setHovered",null),kr([Bt],t.prototype,"setHitable",null),kr([Bt],t.prototype,"setHittable",null),kr([Bt],t.prototype,"openEdgeAnimation",null),kr([Bt],t.prototype,"closeEdgeAnimation",null),kr([Bt],t.prototype,"setElementState",null),kr([Bt],t.prototype,"updateStartPoint",null),kr([Bt],t.prototype,"moveStartPoint",null),kr([Bt],t.prototype,"updateEndPoint",null),kr([Bt],t.prototype,"moveEndPoint",null),kr([Bt],t.prototype,"setZIndex",null),kr([Bt],t.prototype,"initPoints",null),kr([Bt],t.prototype,"updateAttributes",null),kr([Bt],t.prototype,"getAdjustStart",null),kr([Bt],t.prototype,"getAdjustEnd",null),kr([Bt],t.prototype,"updateAfterAdjustStartAndEnd",null),kr([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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ck=(function(t){uQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.BEZIER_EDGE,r.path="",r.initEdgeData(n),r.setAttributes(),r}return e.prototype.initEdgeData=function(n){this.offset=om(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=yk({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],l=o[3];return"M ".concat(r.x," ").concat(r.y,`
C `).concat(i.x," ").concat(i.y,`,
`).concat(a.x," ").concat(a.y,`,
`).concat(l.x," ").concat(l.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,l=yk({start:o,end:r,sourceNode:i,targetNode:a,offset:this.offset}),s=l.sNext,f=l.ePre;this.pointsList=[o,s,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})(KE),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)},Nk=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(l){a={error:l}}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))},Pk=(function(t){cQ(e,t);function e(){var n=t.apply(this,dQ([],Nk(arguments),!1))||this;return n.modelType=_o.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=Nk(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})(KE),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)},Ns=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},kk=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(l){a={error:l}}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([],kk(arguments),!1))||this;return n.modelType=_o.POLYLINE_EDGE,n.draggingPointList=[],n}return e.prototype.initEdgeData=function(n){var o=om(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(D,k){var B=D[D.length-1];(!B||B.x!==k.x||B.y!==k.y)&&D.push({x:k.x,y:k.y})},r=function(D,k){return D.x===k.x||D.y===k.y},i=function(D,k){return Math.abs(D.x-k.x)+Math.abs(D.y-k.y)},a=[];o(a,n[0]);for(var l,s=0;s<n.length-1;s++){var f=a[a.length-1],h=n[s+1];if(!(!f||!h)){if(r(f,h)){o(a,h),l=f.x===h.x?ni.VERTICAL:ni.HORIZONTAL;continue}var v={x:h.x,y:f.y},b={x:f.x,y:h.y},w=l===ni.VERTICAL?b:l===ni.HORIZONTAL||i(f,v)<=i(f,b)?v:b;(w.x!==f.x||w.y!==f.y)&&o(a,w),o(a,h);var O=a[a.length-2],E=a[a.length-1];l=O&&E?O.x===E.x?ni.VERTICAL:ni.HORIZONTAL:l}}for(var S=[],s=0;s<a.length;s++){var M=a[s-1],C=a[s],h=a[s+1];M&&C&&h&&(M.x===C.x&&C.x===h.x||M.y===C.y&&C.y===h.y)||o(S,C)}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 $=S.length<2||S.every(function(D,k,B){return k===0?!0:r(B[k-1],B[k])});return $?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 l=Kv(this.points),s=kk(ZZ(l),2),f=s[0],h=s[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(l){var s;n===ni.HORIZONTAL?s=Math.abs(o.y-l.y):n===ni.VERTICAL&&(s=Math.abs(o.x-l.x)),(!a||a>s)&&(a=s,i=l)}),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],l=i[o],s=i[n-1],f=hk(s,a,this.sourceNode);if(f){var h=vk(a,l,this.sourceNode);if(h){var v=mk(a,l,this.sourceNode);v&&(i[n]=v,i.splice(n-1,1),n--,o--)}}else{var b=this.sourceNode.anchors;b.forEach(function(M){if(M.x===s.x&&M.x===a.x||M.y===s.y&&M.y===a.y){var C=Xc(M.x,M.y,a.x,a.y),$=Xc(s.x,s.y,a.x,a.y);C<$&&(i[n-1]=M)}})}}if(o===r.length-2){var w=i[n],O=i[o],E=i[o+1],S=hk(O,E,this.targetNode);if(S){var h=vk(w,O,this.targetNode);if(h){var v=mk(w,O,this.targetNode);v&&(i[o]=v,i.splice(o+1,1))}}else{var b=this.targetNode.anchors;b.forEach(function(C){if(C.x===E.x&&C.x===O.x||C.y===E.y&&C.y===O.y){var $=Xc(C.x,C.y,O.x,O.y),D=Xc(E.x,E.y,O.x,O.y);$<D&&(i[o+1]=C)}})}}return i},e.prototype.getDraggingPoints=function(n,o,r,i,a){var l=a.map(function(h){return h}),s=this.getAfterAnchor(n,r,i),f=this.getCrossPoint(n,r,s);return o==="start"?(l.unshift(f),l.unshift(s)):(l.push(f),l.push(s)),l},e.prototype.updateCrossPoints=function(n){var o=n.map(function(C){return C}),r=n[0],i=n[1],a=n[o.length-2],l=n[o.length-1],s=this,f=s.sourceNode,h=s.targetNode,v=f.modelType,b=h.modelType,w=Rw(r,i),O=o[0];switch(v){case _o.RECT_NODE:if(f.radius!==0){var E=xk(r,f);E||(O=Ek(r,w,f))}break;case _o.CIRCLE_NODE:O=IA(r,w,f);break;case _o.ELLIPSE_NODE:O=Ok(r,w,f);break;case _o.DIAMOND_NODE:O=E0(r,w,f);break;case _o.POLYGON_NODE:O=E0(r,w,f);break}O&&(o[0]=O);var S=Rw(a,l),M=o[o.length-1];switch(b){case _o.RECT_NODE:if(h.radius!==0){var E=xk(l,h);E||(M=Ek(l,S,h))}break;case _o.CIRCLE_NODE:M=IA(l,S,h);break;case _o.ELLIPSE_NODE:M=Ok(l,S,h);break;case _o.DIAMOND_NODE:M=E0(l,S,h);break;case _o.POLYGON_NODE:M=E0(l,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=pk({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,l=n.startIndex,s=n.endIndex,f=n.direction,h=this.pointsList,v=h;return f===ni.HORIZONTAL?(h[l]={x:i.x,y:i.y+o.y},h[s]={x:a.x,y:a.y+o.y},v=this.pointsList.map(function(b){return b})):f===ni.VERTICAL&&(h[l]={x:i.x+o.x,y:i.y},h[s]={x:a.x+o.x,y:a.y},v=this.pointsList.map(function(b){return b})),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[l]),end:Xo({},h[s]),startIndex:l,endIndex:s,direction:f}},e.prototype.dragAppend=function(n,o){var r;this.isDragging=!0;var i=n.start,a=n.end,l=n.startIndex,s=n.endIndex,f=n.direction,h=this.pointsList;if(f===ni.HORIZONTAL){h[l]={x:i.x,y:i.y+o.y},h[s]={x:a.x,y:a.y+o.y};var v=this.pointsList.map(function(S){return S});if(l!==0&&s!==this.pointsList.length-1&&(v=this.removeCrossPoints(l,s,v)),l===0){var b={x:i.x,y:i.y+o.y},w=ip(b,this.sourceNode);if(!w){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(s===this.pointsList.length-1){var E={x:a.x,y:a.y+o.y},w=ip(E,this.targetNode);if(!w){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",E,O,v)}}this.updatePointsAfterDrag(v),this.draggingPointList=v}else if(f===ni.VERTICAL){h[l]={x:i.x+o.x,y:i.y},h[s]={x:a.x+o.x,y:a.y};var v=this.pointsList.map(function(M){return M});if(l!==0&&s!==this.pointsList.length-1&&(v=this.removeCrossPoints(l,s,v)),l===0){var b={x:i.x+o.x,y:i.y},w=ip(b,this.sourceNode);if(!w){var O=this.sourceNode.anchors;v=this.getDraggingPoints(f,"start",b,O,v)}}if(s===this.pointsList.length-1){var E={x:a.x+o.x,y:a.y},w=ip(E,this.targetNode);if(!w){var O=this.targetNode.anchors;v=this.getDraggingPoints(f,"end",E,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[l]),end:Xo({},h[s]),startIndex:l,endIndex:s,direction:f}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var n=v3(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(pk({x:o.x,y:o.y},{x:r.x,y:r.y},i,a,this.offset||0)),this.initPoints()},Ns([Ut],e.prototype,"offset",void 0),Ns([Ut],e.prototype,"dbClickPosition",void 0),Ns([Bt],e.prototype,"initPoints",null),Ns([Bt],e.prototype,"updatePoints",null),Ns([Bt],e.prototype,"updateStartPoint",null),Ns([Bt],e.prototype,"moveStartPoint",null),Ns([Bt],e.prototype,"updateEndPoint",null),Ns([Bt],e.prototype,"moveEndPoint",null),Ns([Bt],e.prototype,"updatePointsList",null),Ns([Bt],e.prototype,"dragAppendStart",null),Ns([Bt],e.prototype,"dragAppendSimple",null),Ns([Bt],e.prototype,"dragAppend",null),Ns([Bt],e.prototype,"dragAppendEnd",null),Ns([Bt],e.prototype,"updatePointsAfterDrag",null),Ns([Bt],e.prototype,"getAdjustStart",null),Ns([Bt],e.prototype,"getAdjustEnd",null),Ns([Bt],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(KE),is=function(){return is=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},is.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},Rk=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(l){a={error:l}}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=Zu.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=_o.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||wh()}this.formatText(e),Xo(this,dJ(e));var a=this.graphModel,l=a.overlapMode,s=a.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||I_()),s.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,l=i.nodeTextEdit,s=e.x,f=e.y,h=e.text,v={value:"",x:s,y:f,draggable:a,editable:l};h&&(typeof h=="string"?v.value=h:(v=is(is({},v),{x:(n=h.x)!==null&&n!==void 0?n:s,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;Ug(i)&&(i=Gc(i)),wl(i.width)&&(i.width=this.width),wl(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),[vs.INCREASE,vs.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 Gc(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return is(is({},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 is(is({},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,l="",s=0;s<i.length;s++){var f=i[s];if(!f.validate.call(this,this,e,n,o,r)){a=!1,l=f.message;break}}return{isAllPass:a,msg:l}},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,l="",s=0;s<i.length;s++){var f=i[s];if(!f.validate.call(this,e,this,n,o,r)){a=!1,l=f.message;break}}return{isAllPass:a,msg:l}},t.prototype.isAllowMoveNode=function(e,n){var o,r,i=!0,a=!0,l=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=Rk(l),f=s.next();!f.done;f=s.next()){var h=f.value,v=h(this,e,n);if(!v)return!1;if(typeof v=="object"){var b=v;if(!b.x&&!b.y)return!1;i=i&&b.x,a=a&&b.y}}}catch(w){o={error:w}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}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,l){return a.length?(a=a,{id:"".concat(o,"_").concat(l),x:r+a[0],y:i+a[1]}):(a=a,is(is({},a),{x:r+a.x,y:i+a.y,id:a.id||"".concat(o,"_").concat(l)}))}):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(e){return lJ(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 l=a.x,s=a.y,f=hQ(new ib([l,s,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(!wl(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,l=0,s=0;return i&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),l=e),a&&n&&(this.y=this.y+n,this.text&&this.moveText(0,n),s=n),this.transform=new Dw(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[l,s]},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,l=o.draggable,s=o.editable;this.text={value:a,editable:s,draggable:l,x:r+e,y:i+n}},t.prototype.updateText=function(e){this.text=is(is({},Gc(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,l=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var s=Rk(l),f=s.next();!f.done;f=s.next()){var h=f.value,v=h(this,e,n,o,r);if(!v)return!1}}catch(b){i={error:b}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}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=Gc(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(pr.NODE_PROPERTIES_CHANGE,{id:this.id,keys:n,preProperties:o,properties:e})},t.prototype.setProperty=function(e,n){var o=Gc(this.properties),r=to(o);Nj(r,e,Zs(n)),this.updateProperties(r,[e])},t.prototype.setProperties=function(e){var n=Gc(this.properties),o=is(is({},n),Zs(e)),r=[];XL(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=is(is({},this.style),(o={},o[e]=Zs(n),o))},t.prototype.setStyles=function(e){this.style=is(is({},this.style),Zs(e))},t.prototype.updateStyles=function(e){this.style=is({},Zs(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 vs.DEFAULT:this.zIndex=1;break;case vs.EDGE_TOP:this.zIndex=0;break;case vs.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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=_o.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),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)}})(),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)},og=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},HA=(function(t){mQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.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 ec(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 ec(this.points,function(o,r){var i=O0(o,2),a=i[0],l=i[1];return{x:a,y:l,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()},og([Ut],e.prototype,"rx",void 0),og([Ut],e.prototype,"ry",void 0),og([Ai],e.prototype,"points",null),og([Ai],e.prototype,"pointsPosition",null),og([Ai],e.prototype,"width",null),og([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)}})(),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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},XA=(function(t){gQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.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)}})(),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)},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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}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=_o.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 s_(s_(s_({},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(l){return{x:l[0]+o-i/2,y:l[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,l=o.height,s=o.points;return s.map(function(f,h){var v=M0(f,2),b=v[0],w=v[1];return{x:r+b-a/2,y:i+w-l/2,id:"".concat(n.id,"_").concat(h)}})},e.prototype.resize=function(n){var o=this,r=n.width,i=n.height,a=n.deltaX,l=n.deltaY;this.move(a/2,l/2);var s=ec(this.points,function(f){var h=M0(f,2),v=h[0],b=h[1];return[v*r/o.width,b*i/o.height]});return this.points=s,this.properties.points=s,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)}})(),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)},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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},Hg=(function(t){_Q(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.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;wl(o)||(this.width=o),wl(r)||(this.height=r),wl(i)||(this.radius=i),wl(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 l_(l_(l_({},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)},Dk=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}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))},jk=(function(t){wQ(e,t);function e(){var n=t.apply(this,xQ([],EQ(arguments),!1))||this;return n.modelType=_o.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=Ak({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=Ak({rows:n,fontSize:o,rowsLength:n.length}).height;return r},enumerable:!1,configurable:!0}),Dk([Ai],e.prototype,"width",null),Dk([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)}})(),YA=(function(t){OQ(e,t);function e(n,o){var r=t.call(this,n,o)||this;return r.modelType=_o.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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=Zu.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Zu.TEXT,this.edgeTextMode=Zu.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,l={};if(n===!1&&Xo(l,this.stagedConfig),n===!0&&n!==this.isSilentMode){var s=Vv(SQ,T0);this.stagedConfig=Vv(this,T0),Xo(l,s)}Xv(i)||Xo(l,{nodeTextEdit:i,edgeTextEdit:i}),Xv(o)||Xo(l,{nodeTextDraggable:o,edgeTextDraggable:o}),r&&Xo(l,{nodeTextMode:r,edgeTextMode:r}),mw(a)&&Xo(l,{adjustEdgeStart:a,adjustEdgeEnd:a});var f=Vv(e,T0);return Xo(l,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]||[],l=function(s){for(var f=s.length,h=0;h<f;h++)if(s[h]){var v=s[h],b=v.callback,w=v.once;w&&(s.splice(h,1),s.length===0&&delete o._events[r],f--,h--),b.apply(o,[n])}};l(i),l(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,l=0;l<a;l++)i[l].callback===n&&(i.splice(l,1),a--,l--);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)}})(),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)},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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},PQ=(function(t){CQ(e,t);function e(n){var o=t.call(this)||this;o.stepScrollX=0,o.stepScrollY=0,o.onDragging=function(l){var s=l.deltaX,f=l.deltaY;o.setState({isDragging:!0});var h=o.props.graphModel,v=h.transformModel,b=h.editConfigModel;b.stopMoveGraph!==!0&&v.translate(s,f)},o.onDragEnd=function(){o.setState({isDragging:!1})},o.zoomHandler=function(l){var s=o.props,f=s.graphModel,h=f.editConfigModel,v=f.transformModel,b=f.gridSize,w=s.graphModel,O=l.deltaX,E=l.deltaY,S=h.stopScrollGraph,M=h.stopZoomGraph;if(!S&&!l.ctrlKey&&!l.metaKey){if(l.preventDefault(),o.stepScrollX+=O,o.stepScrollY+=E,Math.abs(o.stepScrollX)>=b){var C=o.stepScrollX%b,$=o.stepScrollX-C;v.translate(-$*v.SCALE_X,0),o.stepScrollX=C}if(Math.abs(o.stepScrollY)>=b){var D=o.stepScrollY%b,k=o.stepScrollY-D;v.translate(0,-k*v.SCALE_Y),o.stepScrollY=D}return}if(!M){l.preventDefault();var B=w.getPointByClient({x:l.clientX,y:l.clientY}),F=B.canvasOverlayPosition,I=F.x,V=F.y;v.zoom(l.deltaY<0,[I,V])}},o.clickHandler=function(l){var s=l.target;if(s.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(pr.BLANK_CLICK,{e:l})}},o.handleContextMenu=function(l){var s=l.target;if(s.getAttribute("name")==="canvas-overlay"){l.preventDefault();var f=o.props.graphModel,h=f.getPointByClient({x:l.clientX,y:l.clientY});f.eventCenter.emit(pr.BLANK_CONTEXTMENU,{e:l,position:h})}},o.mouseDownHandler=function(l){var s=o.props.graphModel,f=s.eventCenter,h=s.editConfigModel,v=s.transformModel.SCALE_X,b=s.gridSize,w=h.adjustEdge,O=h.adjustNodePosition,E=h.stopMoveGraph,S=l.target,M=!w&&!O;(S.getAttribute("name")==="canvas-overlay"||M)&&(E!==!0?(o.stepDrag.setStep(b*v),o.stepDrag.handleMouseDown(l)):f.emit(pr.BLANK_MOUSEDOWN,{e:l}),o.clickHandler(l))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new oc({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,l=this.state.isDragging;return $t("svg",qA({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:l?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:$t("g",{transform:o,children:i})}))},e=NQ([xl],e),e})(Po),M3=(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)},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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Lk=(function(t){M3(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,l=i.bezierModel,s=i.type,f=a.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,h=f.x,v=f.y;l.updateAdjustAnchor({x:h,y:v},s),a.eventCenter.emit(pr.EDGE_ADJUST,{data:l.getData()})},n.onDragEnd=function(){var o=n.props.bezierModel;o.isDragging=!1},n.dragHandler=new oc({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,l=a.getEdgeStyle().adjustAnchor;return $t(zg,B_({className:"lf-bezier-adjust-anchor",x:r,y:i},l,{onMouseDown:function(s){n.dragHandler.handleMouseDown(s)}}))},e})(Po),DQ=(function(t){M3(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=CM(r),l=RQ(a,4),s=l[0],f=l[1],h=l[2],v=l[3],b=n.getEdgeStyle().adjustLine,w=[];return w.push($t(Gg,B_({x1:s.x,y1:s.y,x2:f.x,y2:f.y},b))),w.push($t(Lk,{position:f,bezierModel:n,graphModel:o,type:"sNext"},"".concat(i,"_ePre"))),w.push($t(Gg,B_({x1:v.x,y1:v.y,x2:h.x,y2:h.y},b))),w.push($t(Lk,{position:h,bezierModel:n,graphModel:o,type:"ePre"},"".concat(i,"_sNext"))),w},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===_o.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=kQ([xl],e),e})(Po),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 l=t.length-1;l>=0;l--)(a=t[l])&&(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:sp(n)?n:{},className:"lf-background-area"})})},e=LQ([xl],e),e})(Po),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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},Sg=(function(t){FQ(e,t);function e(n){var o=t.call(this,n)||this;return o.id=wh(),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,l=o??{},s=l.color,f=l.thickness,h=f===void 0?2:f,v=Math.min(Math.max(2,h),i/4),b=a?1:0;return $t("g",{fill:s,opacity:b,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,l=o??{},s=l.color,f=l.thickness,h=f===void 0?1:f,v=Math.min(Math.max(1,h),i/2),b="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),w=a?1:0;return $t("path",{d:b,stroke:s,strokeWidth:v/2,opacity:w,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,l=i.size,s=l===void 0?1:l,f=o.SCALE_X,h=o.SKEW_Y,v=o.SKEW_X,b=o.SCALE_Y,w=o.TRANSLATE_X,O=o.TRANSLATE_Y,E=[f,h,v,b,w,O].join(","),S="matrix(".concat(E,")");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:s,height:s,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),$t("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=BQ([xl],e),e})(Po);(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})(Sg||(Sg={}));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 l=t.length-1;l>=0;l--)(a=t[l])&&(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([xl],e),e})(Po),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)}})(),dh=function(){return dh=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},dh.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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,l=[];return o.forEach(function(s){if(s.isHovered||s.isSelected){var f=s.isHovered,h=s.isSelected,v=s.x,b=s.y,w=s.width,O=s.height;if(a&&h||i&&f){var E=s.getOutlineStyle()||{},S={};if(Object.keys(E).forEach(function(C){C!=="hover"&&(S[C]=E[C])}),f){var M=E.hover;S=dh(dh({},S),M)}l.push($t(Yu,dh({transform:s.transform,className:"lf-outline-node",x:v,y:b,width:w+10,height:O+10},S)))}}}),l},e.prototype.getEdgeOutline=function(){for(var n=this.props.graphModel,o=n.edges,r=n.editConfigModel,i=r.edgeSelectedOutline,a=r.hoverOutline,l=[],s=0;s<o.length;s++){var f=o[s];(i&&f.isSelected||a&&f.isHovered)&&(f.modelType===_o.LINE_EDGE?l.push(this.getLineOutline(f)):f.modelType===_o.POLYLINE_EDGE?l.push(this.getPolylineOutline(f)):f.modelType===_o.BEZIER_EDGE&&l.push(this.getBezierOutline(f)))}return l},e.prototype.getLineOutline=function(n){var o=n.startPoint,r=n.endPoint,i=(o.x+r.x)/2,a=(o.y+r.y)/2,l=Math.abs(o.x-r.x)+10,s=Math.abs(o.y-r.y)+10,f=n.getOutlineStyle();return $t(Yu,dh({className:"lf-outline-edge",x:i,y:a,width:l,height:s},f))},e.prototype.getPolylineOutline=function(n){var o=n.points,r=Kv(o),i=N_(r,8),a=i.x,l=i.y,s=i.width,f=i.height,h=n.getOutlineStyle();return $t(Yu,dh({className:"lf-outline",x:a,y:l,width:s,height:f},h))},e.prototype.getBezierOutline=function(n){var o=n.path,r=CM(o),i=N_(r,8),a=i.x,l=i.y,s=i.width,f=i.height,h=n.getOutlineStyle();return $t(Yu,dh({className:"lf-outline",x:a,y:l,width:s,height:f},h))},e.prototype.render=function(){return $t("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=GQ([xl],e),e})(Po),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)}})(),fh=function(){return fh=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},fh.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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,l=n==null?void 0:n.getStyle(),s=r??{},f=s.x,h=f===void 0?0:f,v=s.y,b=v===void 0?0:v,w=fh(fh({x1:-1e5,y1:b,x2:1e5,y2:b},l),{stroke:i?l==null?void 0:l.stroke:"none"}),O=fh(fh({x1:h,y1:-1e5,x2:h,y2:1e5},l),{stroke:a?l==null?void 0:l.stroke:"none"});return $t("g",{className:"lf-snapline",children:[$t(Gg,fh({},w)),$t(Gg,fh({},O))]})},e=XQ([xl],e),e})(Po),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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(),l=a.map(function(s){return Lr(s,{textEditElement:i,graphModel:r,lf:o.instance})});return o.components=l,l},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(l){return l(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([xl],e),e})(Po),Fc=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},ig=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(l){a={error:l}}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=ig(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=ig(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=ig(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(pr.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=ig(this.CanvasPointToHtmlPoint([e,n]),2),a=i[0],l=i[1],s=ig([o/2-a,r/2-l],2),f=s[0],h=s[1];this.TRANSLATE_X+=f,this.TRANSLATE_Y+=h,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(e){var n;n=ig(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]},Fc([Ut],t.prototype,"SCALE_X",void 0),Fc([Ut],t.prototype,"SKEW_Y",void 0),Fc([Ut],t.prototype,"SKEW_X",void 0),Fc([Ut],t.prototype,"SCALE_Y",void 0),Fc([Ut],t.prototype,"TRANSLATE_X",void 0),Fc([Ut],t.prototype,"TRANSLATE_Y",void 0),Fc([Ut],t.prototype,"ZOOM_SIZE",void 0),Fc([Bt],t.prototype,"zoom",null),Fc([Bt],t.prototype,"resetZoom",null),Fc([Bt],t.prototype,"translate",null),Fc([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(l){a={error:l}}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(),l=a.scaleX,s=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[(r-h)/l,(i-v)/s]},e.prototype.CanvasPointToHtmlPoint=function(n){var o=iS(n,2),r=o[0],i=o[1],a=this.getCumulativeScale(),l=a.scaleX,s=a.scaleY,f=this.getCumulativeTranslate(),h=f.translateX,v=f.translateY;return[r*l+h,i*s+v]},e.prototype.moveCanvasPointByHtml=function(n,o,r){var i=iS(n,2),a=i[0],l=i[1],s=this.getCumulativeScale(),f=s.scaleX,h=s.scaleY;return[a+o/f,l+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),qs=function(){return qs=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},qs.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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.")},os=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(l){a={error:l}}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=vs.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var i=e.container,a=e.partial,l=e.background,s=l===void 0?{}:l,f=e.grid,h=e.idGenerator,v=e.edgeGenerator,b=e.animation,w=e.customTrajectory;this.rootEl=i,this.partial=!!a,this.background=s,typeof f=="object"&&e.snapGrid&&(this.gridSize=f.size||1),this.customStyles=e.style||{},this.grid=Sg.getGridOptions(f??!1),this.theme=A3(e.style,e.themeMode),this.theme.grid=to(this.grid),this.theme.background=to(this.background),this.edgeType=e.edgeType||"polyline",this.animation=PZ(b),this.overlapMode=e.overlapMode||vs.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(o=e.width)!==null&&o!==void 0?o:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=wl(e.width),this.height=(r=e.height)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=wl(e.height);var O=new ResizeObserver(D2((function(E){var S,M;try{for(var C=nee(E),$=C.next();!$.done;$=C.next()){var D=$.value;if(D.target===n.rootEl){var k=document.body.contains(n.rootEl);if(!k)return;n.resize(),n.eventCenter.emit("graph:resize",{target:n.rootEl,contentRect:D.contentRect})}}}catch(B){S={error:B}}finally{try{$&&!$.done&&(M=C.return)&&M.call(C)}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=wh(),this.idGenerator=h,this.edgeGenerator=tJ(this,v),this.customTrajectory=w}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([],os(this.nodes),!1),os(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(s){return hu([],os(s),!1).sort(function(f,h){return f.zIndex-h.zIndex})},n=e(hu(hu([],os(this.nodes),!1),os(this.edges),!1)),o=[],r=[-y0,-y0],i=[this.width+y0,this.height+y0],a=0;a<n.length;a++){var l=n[a];l.visible&&(!this.partial||l.isSelected||this.isElementInArea(l,r,i,!1,!1))&&o.push(l)}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 l=[];return ri(hu(hu([],os(this.nodes),!1),os(this.edges),!1),function(s){var f=a.isElementInArea(s,e,n,o,r);(!i||s.visible)&&f&&l.push(s)}),l},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=os(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2),l=a[0],s=a[1],f={x:l,y:s};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 l=gu(e),s=l.minX,f=l.minY,h=l.maxX,v=l.maxY,b=[{x:s,y:f},{x:h,y:f},{x:h,y:v},{x:s,y:v}],w=i,O=0;O<b.length;O++){var E=b[O],S=E.x,M=E.y;if(a=os(this.transformModel.CanvasPointToHtmlPoint([S,M]),2),S=a[0],M=a[1],tS([S,M],n,o)!==i){w=!i;break}}return w}if(e.BaseType===da.EDGE){e=e;var C=e.startPoint,$=e.endPoint,D=this.transformModel.CanvasPointToHtmlPoint([C.x,C.y]),k=this.transformModel.CanvasPointToHtmlPoint([$.x,$.y]),B=tS(D,n,o),F=tS(k,n,o);return r?B&&F:B||F}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=ec(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=ec(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 l=new a(r,n);return n.edgeModelMap.set(l.id,l),n.elementsModelMap.set(l.id,l),l})}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=[],l=0;l<this.edges.length;l++){var s=this.edges[l];if(s.isDragging){i=!0;break}s.virtual||a.push(s.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=wh()),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=wh()),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||Zu.TEXT;if(e.BaseType===da.EDGE)return e.textMode||i||o||Zu.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===vs.STATIC)return;if(this.overlapMode===vs.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=lQ())),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(pr.NODE_DELETE,{data:o,model:n})},t.prototype.addNode=function(e,n,o){n===void 0&&(n=pr.NODE_ADD);var r=Zs(e),i=r.id;i&&this.nodesMap[i]&&delete r.id;var a=this.getModelAfterSnapToGrid(r);this.nodes.push(a);var l=a.getData(),s={data:l};return o&&(s.e=o),this.eventCenter.emit(n,s),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=Wg(r,this.gridSize,o),e.y=Wg(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 l=a.model;i=os(l.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,l=a.x,s=a.y,f=n-l,h=o-s;this.moveNode(e,f,h,r)},t.prototype.editText=function(e){this.setElementStateById(e,Wo.TEXT_EDIT)},t.prototype.addEdge=function(e){var n=Zs(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(qs(qs({},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(pr.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,l=a.x,s=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,l,s)}},t.prototype.handleEdgeTextMove=function(e,n,o){var r;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===_o.POLYLINE_EDGE&&(!((r=e.text)===null||r===void 0)&&r.value)){var i=e.text,a=g3(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}var l=e.textPosition,s=l.x,f=l.y;e.moveText(s-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(pr.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(pr.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(pr.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(pr.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=Sh(hu(hu([],os(this.nodes),!1),os(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(),[vs.DEFAULT,vs.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,l,s=this;r===void 0&&(r=!1);for(var f=e.reduce(function($,D){var k,B=(k=s.nodesMap[D])===null||k===void 0?void 0:k.model;return B&&($[D]=B.getMoveDistance(n,o,r)),$},{}),h=0;h<this.edges.length;h++){var v=this.edges[h],b=v.textPosition,w=b.x,O=b.y,E=f[v.sourceNodeId],S=f[v.targetNodeId],M=void 0,C=void 0;E&&S&&v.modelType===_o.POLYLINE_EDGE?(i=os(E,2),M=i[0],C=i[1],v.updatePointsList(M,C)):(E&&(a=os(E,2),M=a[0],C=a[1],v.moveStartPoint(M,C)),S&&(l=os(S,2),M=l[0],C=l[1],v.moveEndPoint(M,C))),(E||S)&&this.handleEdgeTextMove(v,w,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 l=this.getNodeEdges(e);l.forEach(function(s){if(s.sourceNodeId===e){var f=Sk(a,s.startPoint,a.width,a.height);s.updateStartPoint(f)}if(s.targetNodeId===e){var f=Sk(a,s.endPoint,a.width,a.height);s.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(qs(qs({},typeof this.background=="object"?this.background:{}),j_[n])),L_[n]&&this.updateGridOptions(Sg.getGridOptions(qs(qs({},this.grid),L_[n])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var r=Sg.getGridOptions((o=e.grid)!==null&&o!==void 0?o:!1);this.updateGridOptions(r)}this.theme=iQ(qs(qs({},this.customStyles),e),n),this.customStyles=qs(qs({},this.customStyles),e)},t.prototype.getTheme=function(){var e=this,n=e.background,o=e.grid,r=qs(qs({},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){mw(e)||mw(this.background)?this.background=e:this.background=qs(qs({},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=wl(e),this.height=n??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=wl(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(b){var w=b.x,O=b.y,E=b.width,S=b.height,M=b.getNodeStyle().strokeWidth,C=M===void 0?0:M,$=w+E/2+C,D=w-E/2-C,k=O+S/2+C,B=O-S/2-C;n=n.concat([$,D].filter(function(F){return!Number.isNaN(F)})),o=o.concat([k,B].filter(function(F){return!Number.isNaN(F)}))});var r=Math.min.apply(Math,hu([],os(n),!1)),i=Math.max.apply(Math,hu([],os(n),!1)),a=Math.min.apply(Math,hu([],os(o),!1)),l=Math.max.apply(Math,hu([],os(o),!1)),s=i-r||0,f=l-a||0,h=r+s/2,v=a+f/2;return{width:s,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 l=o||i.clientWidth,s=r||i.clientHeight,f=this.getVirtualRectSize(),h=f.x,v=f.y;a.focusOn(h,v,l,s)}},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,l=o.rootEl,s=o.transformModel;if(r.length){var f=i||l.clientWidth,h=a||l.clientHeight,v=this.getVirtualRectSize(),b=v.width,w=v.height,O=v.x,E=v.y,S=(b+n)/f,M=(w+e)/h,C=1/Math.max(S,M),$=[f/2,h/2];s.zoom(C,$),s.focusOn(O,E,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 l=t.length-1;l>=0;l--)(a=t[l])&&(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,l=0;l<n.length;l++){var s=n[l];if(s.id!==e.id&&(Bc(o,s.x,this.epsilon)&&(i=!0),Bc(r,s.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 l=this.graphModel.fakeNode;if(l&&l.id===i)a=gu(l);else{var s=this.graphModel.getNodeModelById(i);s&&(a=gu(s))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==e.id){var v=gu(h);if(Bc(v.minY,a==null?void 0:a.minY,this.epsilon)||Bc(v.maxY,a==null?void 0:a.minY,this.epsilon)){o=!0,r=a.minY;break}if(Bc(v.minY,a==null?void 0:a.maxY,this.epsilon)||Bc(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 l=this.graphModel.fakeNode;if(l&&l.id===i)a=gu(l);else{var s=this.graphModel.getNodeModelById(i);s&&(a=gu(s))}}for(var f=0;f<n.length;f++){var h=n[f];if(h.id!==e.id){var v=gu(h);if(Bc(v.minX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Bc(v.minX,a==null?void 0:a.minX,this.epsilon)||Bc(v.maxX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Bc(v.minX,a==null?void 0:a.maxX,this.epsilon)||Bc(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 l=this.getVerticalSnapline(e,n);l.isShowVertical&&(o.isShowVertical=l.isShowVertical,o.position.x=l.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 Bc(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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},see=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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},lee=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,lee([],see(arguments),!1))||this;return n.handleResize=function(){var o=n.props,r=o.graphModel,i=o.options,a=r.width,l=r.height,s=r.isContainerWidth,f=r.isContainerHeight,h=a,v=l,b=!1;s&&(h=void 0,b=!0),f&&(v=void 0,b=!0),b&&r.resize(h,v),i.width=a,i.height=l},n.throttleResize=Cj(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(pr.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,l=o.dnd,s=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,b=r.background,w=v.adjustEdge;return $t("div",{className:"lf-graph","flow-id":r.flowId,style:f,children:[$t(PQ,{graphModel:r,dnd:l,children:[$t("g",{className:"lf-base",children:ec(r.sortElements,function(O){return n.getComponent(O,r)})}),h?this.getComponent(h,r):""]}),$t(VQ,{graphModel:r,children:[$t(zQ,{graphModel:r}),w?$t(DQ,{graphModel:r}):"",a.snapline!==!1?$t(YQ,{snaplineModel:s}):""]}),$t(ZQ,{graphModel:r,tool:i}),b&&$t(IQ,{background:b}),$t(Sg,{graphModel:r})]})},e=aee([xl],e),e})(Po),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)}})(),Fd=function(){return Fd=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},Fd.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(l){a={error:l}}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,l=i.nodeModel,s=i.graphModel;s.selectNodeById(l.id),l.autoToFront&&s.toFront(l.id),s.eventCenter.emit(pr.ANCHOR_DRAGSTART,{data:a,e:r,nodeModel:l}),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,l=i.nodeModel,s=i.anchorData,f=a.transformModel,h=a.eventCenter,v=a.width,b=a.height,w=a.editConfigModel,O=w.autoExpand,E=w.stopMoveGraph;if(r){var S=r.clientX,M=r.clientY,C=a.getPointByClient({x:S,y:M}),$=C.domOverlayPosition,D=$.x,k=$.y,B=C.canvasOverlayPosition,F=B.x,I=B.y;n.t&&Fw(n.t);var V=[],z=10;D<10?V=[z,0]:D+10>v?V=[-z,0]:k<10?V=[0,z]:k+10>b&&(V=[0,-z]),n.setState({endX:F,endY:I,dragging:!0}),n.moveAnchorEnd(F,I),V.length>0&&!E&&O&&(n.t=w3(function(){var X=dee(V,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(pr.ANCHOR_DRAG,{data:s,e:r,nodeModel:l})}},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,l=a.graphModel,s=a.nodeModel,f=a.anchorData;l.eventCenter.emit(pr.ANCHOR_DRAGEND,{data:f,e:r,nodeModel:s,edgeModel:i??void 0})},n.checkEnd=function(o){var r,i=n.props,a=i.graphModel,l=i.nodeModel,s=i.anchorData,f=s.x,h=s.y,v=s.id,b=n.state,w=b.endX,O=b.endY,E=b.dragging,S=Lw({x:w,y:O},a);if(n.preTargetNode&&n.preTargetNode.state!==Wo.DEFAULT&&n.preTargetNode.setElementState(Wo.DEFAULT),!!E&&S&&S.node){var M=S.node,C=S.anchor.id,$="".concat(l.id,"_").concat(M.id,"_").concat(C,"_").concat(v),D=n.sourceRuleResults.get($)||{},k=D.isAllPass,B=D.msg,F=n.targetRuleResults.get($)||{},I=F.isAllPass,V=F.msg;if(k&&I){M.setElementState(Wo.DEFAULT);var z=a.getNodeModelById(S.node.id),X=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,l.getData(),z==null?void 0:z.getData()),Y=a.addEdge(Fd(Fd({},X),{sourceNodeId:l.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(pr.ANCHOR_DROP,{data:W,e:o,nodeModel:l,edgeModel:Y}),Y}var Q=M.getData();return a.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Q,msg:V||B||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new oc({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 l=o.x,s=o.y,f=Fd(Fd({},r),r==null?void 0:r.hover);return $t("g",{children:[$t(zg,Fd({className:"lf-node-anchor-hover"},f,{x:l,y:s})),$t(zg,Fd({className:"lf-node-anchor"},r,{x:l,y:s}))]})},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,l=a.graphModel,s=a.nodeModel,f=a.anchorData,h=Lw({x:n,y:o},l);if(h){var v=h.node,b=h.anchor.id;if(this.preTargetNode&&this.preTargetNode!==h.node&&this.preTargetNode.setElementState(Wo.DEFAULT),f.id===b)return;this.preTargetNode=v;var w="".concat(s.id,"_").concat(v.id,"_").concat(b,"_").concat(f.id);if(!this.targetRuleResults.has(w)){var O=h.anchor,E=s.isAllowConnectedAsSource(v,f,O),S=v.isAllowConnectedAsTarget(s,f,O);this.sourceRuleResults.set(w,Iw(E)),this.targetRuleResults.set(w,Iw(S))}var M=((r=this.sourceRuleResults.get(w))!==null&&r!==void 0?r:{}).isAllPass,C=((i=this.targetRuleResults.get(w))!==null&&i!==void 0?i:{}).isAllPass;M&&C?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,l=Xc(o,r,i,a);return l>10},e.prototype.render=function(){var n=this,o=this.state,r=o.startX,i=o.startY,a=o.endX,l=o.endY,s=this.props,f=s.anchorData,h=s.edgeStyle,v=s.nodeModel,b=s.graphModel,w=f.edgeAddable;return $t("g",{className:"lf-anchor",children:[$t("g",{onClick:function(O){O.stopPropagation(),b.eventCenter.emit(pr.ANCHOR_CLICK,{data:f,e:O,nodeModel:v})},onMouseDown:function(O){b.eventCenter.emit(pr.ANCHOR_MOUSEDOWN,{data:f,e:O,nodeModel:v}),w!==!1&&n.dragHandler.handleMouseDown(O)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Fd({sourcePoint:{x:r,y:i},targetPoint:{x:a,y:l}},h)):$t(Gg,Fd({x1:r,y1:i,x2:a,y2:l},h,{"pointer-events":"none"})))]})},e})(Po),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)}})(),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)},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,l=o.props,s=l.graphModel,f=l.nodeModel,h=l.eventCenter,v=s.selectNodes,b=f.x,w=f.y,O=a.clientX,E=a.clientY,S=s.getPointByClient({x:O,y:E}).canvasOverlayPosition,M=S.x,C=S.y,$=new Ls(M-b,C-w),D=((i=o.normal)===null||i===void 0?void 0:i.angle($))-o.defaultAngle,k=new Dw(-b,-w).rotate(D).translate(b,w).toString();f.transform=k,f.rotate=D;var B=ec(v,function(I){return I.id});B.indexOf(f.id)===-1&&(B=[f.id]);var F=Vj(B,function(I,V){var z=s.getNodeModelById(V);return I[V]=z==null?void 0:z.getMoveDistance(0,0,!1),I},{});B.forEach(function(I){var V=s.getNodeEdges(I);V.forEach(function(z){if(F[z.sourceNodeId]){var X=s.getNodeModelById(z.sourceNodeId),Y=X.anchors.find(function(W){return W.id===z.sourceAnchorId});z.updateStartPoint(Y)}if(F[z.targetNodeId]){var X=s.getNodeModelById(z.targetNodeId),Y=X.anchors.find(function(J){return J.id===z.targetAnchorId});z.updateEndPoint(Y)}})}),h.emit(pr.NODE_ROTATE,{e:a,model:f,data:f.getData()})},o.style=n.style,o.stepperDrag=new oc({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,l=o.height,s=r+a/2+20,f=i-l/2-20;return this.normal=new Ls(1,0),this.defaultAngle=this.normal.angle(new Ls(s-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(zg,KA({},this.style,{cx:s,cy:f}))})})},e})(Po),aS={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/var Ik;function vee(){return Ik||(Ik=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var l=arguments[a];l&&(i=r(i,o(l)))}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 l in i)e.call(i,l)&&i[l]&&(a=r(a,l));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 mee=vee();const ZA=Z_(mee);var gee=(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)}})(),JA=function(){return JA=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},JA.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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},T3=(function(t){gee(e,t);function e(n){var o=t.call(this)||this;o.mouseDownHandler=function(i){var a=o.props,l=a.draggable,s=a.model,f=a.graphModel,h=f.editConfigModel.nodeTextDraggable;(l??h)&&(i.stopPropagation(),o.stepperDrag.model=s,o.stepperDrag.handleMouseDown(i))},o.onDragging=function(i){var a=i.deltaX,l=i.deltaY,s=o.props,f=s.model,h=s.graphModel.transformModel;if(a||l){var v=yee(h.fixDeltaXY(a,l),2),b=v[0],w=v[1];f.moveText(b,w)}},o.dbClickHandler=function(){var i=o.props,a=i.editable,l=i.graphModel.eventCenter,s=i.model;a&&s.setElementState(Wo.TEXT_EDIT),l.emit(pr.TEXT_DBCLICK,{data:s.text,model:s})};var r=n.draggable;return o.stepperDrag=new oc({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,l=a.value,s=a.x,f=a.y,h=a.editable,v=a.draggable,b={x:s,y:f,className:"",value:l},w=o.getTextStyle(),O=i.nodeTextDraggable||v;return $t(E3,JA({},b,w,{className:ZA({"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})(Po),_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)}})(),Uc=function(){return Uc=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},Uc.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(l){a={error:l}}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=Uc(Uc({},a),i.hover.background)),r!=null&&r.value&&(a==null?void 0:a.fill)!=="transparent"){var l=i.fontSize,s=i.textWidth,f=i.lineHeight,h=i.overflowMode,v=a.wrapPadding,b=r==null?void 0:r.value.split(/[\r\n]/g),w=b.length,O=r.x,E=r.y,S={};if(h==="autoWrap"&&s){var M=b3({rows:b,style:{fontSize:"".concat(l,"px"),width:"".concat(s,"px"),lineHeight:f,padding:v},rowsLength:w,className:"lf-get-text-height"});S=Uc(Uc({},a),{x:O,y:E,width:s,height:M})}else{var C=nJ({rows:b,rowsLength:w,fontSize:l}),$=C.width,D=C.height;if(h==="ellipsis"&&($=s,D=l+2),typeof a.wrapPadding=="string"){var k=a.wrapPadding.split(",").filter(function(ke){return ke.trim()}).map(function(ke){return parseFloat(ke.trim())});if(k.length>0&&k.length<=4){if(k.length===1){var B=C0(k,1),F=B[0];k=[F,F,F,F]}else if(k.length===2){var I=C0(k,2),V=I[0],z=I[1];k=[V,z,V,z]}else if(k.length===3){var X=C0(k,3),Y=X[0],z=X[1],W=X[2];k=[Y,z,W,z]}var Q=C0(k,4),J=Q[0],ie=Q[1],Se=Q[2],Ae=Q[3];$+=ie+Ae,D+=J+Se,O=O+(ie-Ae)/2,E=E+(Se-J)/2}}S=Uc(Uc({},a),{x:O-1,y:E-1,width:$,height:D})}return $t(Yu,Uc({},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 l=n.getTextStyle(),s=Uc({x:r,y:i,value:a,model:n,className:"lf-element-text"},l);return $t("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),$t(E3,Uc({},s))]})},e})(T3),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(l){a={error:l}}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(s){var f=s.event,h=o.props,v=h.model,b=h.graphModel;if(f){var w=b.getPointByClient({x:f.clientX,y:f.clientY}).canvasOverlayPosition,O=w.x,E=w.y;o.moveOffset={dx:v.x-O,dy:v.y-E}}},o.onDragging=function(s){var f,h,v,b,w=s.event,O=o.props,E=O.model,S=O.graphModel,M=S.editConfigModel,C=M.stopMoveGraph,$=M.autoExpand,D=M.snapGrid,k=S.transformModel,B=S.selectNodes,F=S.width,I=S.height,V=S.gridSize;E.isDragging=!0;var z=w,X=z.clientX,Y=z.clientY,W=o.mouseDownPosition,Q=W.x,J=W.y;(X-Q>V||Y-J>V)&&(E.isDragging=!0);var ie=S.getPointByClient({x:X,y:Y}).canvasOverlayPosition,Se=ie.x,Ae=ie.y,ke=N0(k.CanvasPointToHtmlPoint([Se,Ae]),2),De=ke[0],ze=ke[1];if(Se=Se+((h=(f=o.moveOffset)===null||f===void 0?void 0:f.dx)!==null&&h!==void 0?h:0),Ae=Ae+((b=(v=o.moveOffset)===null||v===void 0?void 0:v.dy)!==null&&b!==void 0?b:0),Se=Wg(Se,V,D),Ae=Wg(Ae,V,D),!F||!I){S.moveNode2Coordinate(E.id,Se,Ae);return}var Ye=De<0||ze<0||De>F||ze>I;if(!($&&!C&&Ye)){var Be=N0(k.CanvasPointToHtmlPoint([Se-E.width/2,Ae-E.height/2]),2),Je=Be[0],gt=Be[1],se=N0(k.CanvasPointToHtmlPoint([Se+E.width/2,Ae+E.height/2]),2),Ze=se[0],pe=se[1],le=Math.max(V,20),we=[];Je<0?we=[le,0]:Ze>S.width?we=[-le,0]:gt<0?we=[0,le]:pe>S.height&&(we=[0,-le]),o.t&&Fw(o.t);var $e=B.map(function(rt){return rt.id});$e.indexOf(E.id)===-1&&($e=[E.id]),we.length>0&&!C&&$?o.t=w3(function(){var rt=N0(we,2),pt=rt[0],Lt=rt[1];k.translate(pt??0,Lt??0);var Jt=-(pt??0)/k.SCALE_X,en=-(Lt??0)/k.SCALE_X;S.moveNodes($e,Jt,en)}):S.moveNodes($e,Se-E.x,Ae-E.y)}},o.onDragEnd=function(){o.t&&Fw(o.t);var s=o.props.model;s.isDragging=!1},o.onMouseOut=function(s){kZ()&&o.setHoverOff(s)},o.handleMouseUp=function(){var s=o.props.model;o.mouseUpDrag=s.isDragging},o.handleClick=function(s){var f=o.mouseUpDrag===!1,h=new Date().getTime();if(o.startTime){var v=h-o.startTime,b=o.props,w=b.model,O=b.graphModel;if(!(!f&&v>300)){f||(o.onDragEnd(),o.handleMouseUp());var E=w.getData(),S=O.getPointByClient({x:s.clientX,y:s.clientY}),M={data:E,e:s,position:S,isSelected:!1,isMultiple:!1},C=s.button===2,$=s.detail===2;if(!C){var D=O.editConfigModel,k=y3(s,D);if(M.isMultiple=k,w.isSelected&&!$&&k?(M.isSelected=!1,w.setSelected(!1)):(O.selectNodeById(w.id,k),M.isSelected=!0,D.isSilentMode||o.toFront()),$)D.nodeTextEdit&&w.text.editable&&D.textMode===Zu.TEXT&&(w.setSelected(!1),O.setElementStateById(w.id,Wo.TEXT_EDIT)),O.eventCenter.emit(pr.NODE_DBCLICK,M);else{O.eventCenter.emit(pr.ELEMENT_CLICK,M),O.eventCenter.emit(pr.NODE_CLICK,M);var B=s.currentTarget,F=!wl(window)&&Ph(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(I){return setTimeout(I,0)};F(function(){B.focus()})}}}}},o.handleContextMenu=function(s){s.preventDefault();var f=o.props,h=f.model,v=f.graphModel,b=v.editConfigModel,w=h.getData(),O=v.getPointByClient({x:s.clientX,y:s.clientY});v.setElementStateById(h.id,Wo.SHOW_MENU,O.domOverlayPosition),h.isSelected||v.selectNodeById(h.id),v.eventCenter.emit(pr.NODE_CONTEXTMENU,{data:w,e:s,position:O}),b.isSilentMode||o.toFront()},o.handleMouseDown=function(s){var f=o.props,h=f.model,v=f.graphModel;o.mouseDownPosition={x:s.clientX,y:s.clientY},o.startTime=new Date().getTime();var b=v.editConfigModel;b.adjustNodePosition&&h.draggable&&o.stepDrag&&o.stepDrag.handleMouseDown(s)},o.handleFocus=function(){var s=o.props,f=s.model,h=s.graphModel;h.eventCenter.emit(pr.NODE_FOCUS,{data:f.getData()})},o.handleBlur=function(){if(o.props){var s=o.props,f=s.model,h=s.graphModel;h.eventCenter.emit(pr.NODE_BLUR,{data:f.getData()})}},o.setHoverOn=function(s){var f=o.props,h=f.model,v=f.graphModel;if(!h.isHovered){var b=h.getData();h.setHovered(!0),v.eventCenter.emit(pr.NODE_MOUSEENTER,{data:b,e:s})}},o.setHoverOff=function(s){var f=o.props,h=f.model,v=f.graphModel,b=h.getData();h.isHovered&&(h.setHovered(!1),v.eventCenter.emit(pr.NODE_MOUSELEAVE,{data:b,e:s}))};var r=n.graphModel,i=r.gridSize,a=r.eventCenter,l=n.model;return o.stepDrag=new oc({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:l}),o.modelDisposer=HI(function(){return o.props},function(s){s&&s.model&&o.stepDrag.setModel(s.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,l=r.isHitable,s=r.isDragging,f=r.isShowAnchor;return l&&(a||f)&&!s?ec(r.anchors,function(h,v){var b=r.getAnchorLineStyle(h),w=r.getAnchorStyle(h);return $t(fee,{anchorData:h,node:n,style:w,edgeStyle:b,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,l=i.allowRotate,s=o.isSelected,f=o.isHitable,h=o.rotatable,v=o.isHovered,b=l&&h,w=o.getRotateControlStyle();if(!a&&f&&(s||v)&&b)return $t(hee,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:w})},e.prototype.getResizeControl=function(){var n=this.props,o=n.model,r=n.graphModel,i=r.editConfigModel,a=i.isSilentMode,l=i.allowResize,s=o.isSelected,f=o.isHitable,h=o.resizable,v=o.isHovered,b=l&&h,w=o.getResizeControlStyle();return!a&&f&&(s||v)&&b?$t(kJ,{style:w,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!==Zu.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var l=!1;return a.nodeTextDraggable&&r.text.draggable&&(l=!0),$t(T3,{editable:a.nodeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:l})}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,l=i.adjustNodePosition,s=i.allowRotate,f=i.allowResize,h=r.gridSize,v=r.transformModel.SCALE_X,b=o.isHitable,w=o.draggable,O=o.transform,E=o.getOuterGAttributes(),S=E.className,M=S===void 0?"":S,C=Eee(E,["className"]),$=$t("g",{className:"lf-node-content",children:[$t("g",{transform:O,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),f&&this.getResizeControl()]}),!a&&this.getAnchors()]}),D;return b?(l&&w&&this.stepDrag.setStep(h*v),D=$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},C,{children:$}))):D=$t("g",Vw({className:"".concat(this.getStateClassName()," ").concat(M)},C,{children:$})),D},e.isObserved=!1,e})(Po),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)}})(),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)},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(Yu,QA({},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)}})(),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)},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(zg,e2({},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,l=o.height,s=o.points,f=n.getNodeStyle(),h={transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-l/2,")")};return $t("g",Gw({},h,{children:$t(PM,Gw({},f,{points:s,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)}})(),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)},n2=(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(PM,t2({},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)}})(),r2=function(){return r2=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},r2.apply(this,arguments)},o2=(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,r2({},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)},Fk=(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,l=n.y,s=c_(c_({},o.background),{x:a,y:l,width:r,height:i});return $t(Yu,c_({},s))},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)}})(),i2=function(){return i2=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},i2.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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Pee=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))},a2=(function(t){Cee(e,t);function e(){var n=t.apply(this,Pee([],Nee(arguments),!1))||this;return n.ref=WE(),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,l=n.getNodeStyle();return this.currentProperties=JSON.stringify(n.properties),$t("foreignObject",i2({},l,{x:o-a/2,y:r-i/2,width:a,height:i,ref:this.ref}))},e})(Ih),kee=(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)}})(),Vc=function(){return Vc=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},Vc.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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$d;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})($d||($d={}));var Bk=(function(t){kee(e,t);function e(n){var o=t.call(this)||this;o.handleMouseDown=function(s){o.stepDrag&&o.stepDrag.handleMouseDown(s)},o.onDragStart=function(){var s=o.props,f=s.x,h=s.y,v=s.edgeModel,b=v.startPoint,w=v.endPoint,O=v.pointsList;o.oldEdge={startPoint:b,endPoint:w,pointsList:O},o.setState({endX:f,endY:h,dragging:!0})},o.onDragging=function(s){var f=s.deltaX,h=s.deltaY,v=o.state,b=v.endX,w=v.endY,O=o.props,E=O.graphModel,S=O.type,M=E.transformModel,C=E.editConfigModel,$=Dee(M.moveCanvasPointByHtml([b,w],f,h),2),D=$[0],k=$[1];o.setState({endX:D,endY:k,dragging:!0});var B=o.props.edgeModel,F=Lw({x:b,y:w},E);if(F&&F.node&&o.isAllowAdjust(F).pass){var I=B.startPoint,V=B.endPoint,z=B.sourceNode,X=B.targetNode,Y=S===$d.SOURCE?{startPoint:{x:F.anchor.x,y:F.anchor.y},endPoint:{x:V.x,y:V.y},sourceNode:F.node,targetNode:X}:{startPoint:{x:I.x,y:I.y},endPoint:{x:F.anchor.x,y:F.anchor.y},sourceNode:z,targetNode:F.node};B.updateAfterAdjustStartAndEnd(Y)}else S===$d.SOURCE?B.updateStartPoint({x:D,y:k}):B.updateEndPoint({x:D,y:k});B.text.value&&C.adjustEdge&&B.setText(Object.assign({},B.text,B.textPosition))},o.onDragEnd=function(s){var f,h,v,b=s.event;try{o.setState({dragging:!1});var w=o.props,O=w.graphModel,E=w.edgeModel,S=w.type,M=o.state,C=M.endX,$=M.endY,D=M.dragging,k=Lw({x:C,y:$},O);if(!D)return;var B=!1,F=void 0;if(k&&k.node){var I=o.isAllowAdjust(k),V=I.pass,z=I.msg,X=I.newTargetNode;if(V){var Y=E.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(F=Vc(Vc({sourceAnchorId:J,targetAnchorId:Se},Ae),{text:(W==null?void 0:W.value)||""}),S===$d.SOURCE){var ke=O.getNodeModelById(k.node.id),De=O.getNodeModelById(E.targetNodeId),ze=(f=O.edgeGenerator)===null||f===void 0?void 0:f.call(O,ke==null?void 0:ke.getData(),De==null?void 0:De.getData(),F);F=Vc(Vc({},ze),{sourceNodeId:k.node.id,sourceAnchorId:k.anchor.id,startPoint:{x:k.anchor.x,y:k.anchor.y},targetNodeId:E.targetNodeId,endPoint:Vc({},E.endPoint)}),E.sourceNodeId===k.node.id&&E.sourceAnchorId===k.anchor.id&&(B=!0)}else if(S===$d.TARGET){var ke=O.getNodeModelById(E.sourceNodeId),De=O.getNodeModelById(k.node.id),ze=(h=O.edgeGenerator)===null||h===void 0?void 0:h.call(O,ke==null?void 0:ke.getData(),De==null?void 0:De.getData(),F);F=Vc(Vc({},ze),{sourceNodeId:E.sourceNodeId,startPoint:Vc({},E.startPoint),targetNodeId:k.node.id,targetAnchorId:k.anchor.id,endPoint:{x:k.anchor.x,y:k.anchor.y}}),E.targetNodeId===k.node.id&&E.targetAnchorId===k.anchor.id&&(B=!0)}}else{B=!0;var Ye=X.getData();O.eventCenter.emit(pr.CONNECTION_NOT_ALLOWED,{data:Ye,msg:z})}}else B=!0;if(B)o.recoveryEdge();else{var Be=E.getData();O.deleteEdgeById(E.id);var Je=O.addEdge(Vc({},F));O.eventCenter.emit(pr.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(pr.ADJUST_POINT_DRAGEND,{e:b,data:o.stepDragData})}},o.recoveryEdge=function(){var s=o.props.edgeModel,f=o.oldEdge,h=f.startPoint,v=f.endPoint,b=f.pointsList;s.updateStartPoint(h),s.updateEndPoint(v),s.modelType!==_o.LINE_EDGE&&(s.pointsList=b??[],s.initPoints())},o.getAdjustPointStyle=function(){var s=o.props.graphModel.theme,f=s.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,l=a.eventCenter;return o.stepDragData={type:r,edgeData:i.getData()},o.stepDrag=new oc({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:l,data:o.stepDragData}),o}return e.prototype.isAllowAdjust=function(n){var o=this.props,r=o.edgeModel,i=r.id,a=r.sourceNode,l=r.targetNode,s=r.sourceAnchorId,f=r.targetAnchorId,h=o.type,v,b,w,O;if(h===$d.SOURCE?(v=n.node,b=l,w=n.anchor,O=l.getAnchorInfo(f)):(v=a,b=n.node,O=n.anchor,w=a.getAnchorInfo(s)),this.preTargetNode&&this.preTargetNode!==n.node&&this.preTargetNode.setElementState(Wo.DEFAULT),this.preTargetNode=n.node,O.id===w.id)return{pass:!1,msg:"",newTargetNode:b};var E="".concat(v.id,"_").concat(b.id,"_").concat(w.id,"_").concat(O.id);if(!this.targetRuleResults.has(E)){var S=v.isAllowConnectedAsSource(b,w,O,i),M=b.isAllowConnectedAsTarget(v,w,O,i);this.sourceRuleResults.set(E,Iw(S)),this.targetRuleResults.set(E,Iw(M))}var C=this.sourceRuleResults.get(E),$=C.isAllPass,D=C.msg,k=this.targetRuleResults.get(E),B=k.isAllPass,F=k.msg,I=$&&B?Wo.ALLOW_CONNECT:Wo.NOT_ALLOW_CONNECT;return h===$d.SOURCE?v.setElementState(I):b.setElementState(I),{pass:$&&B,msg:F||D,newTargetNode:b}},e.prototype.render=function(){var n=this.props,o=n.x,r=n.y,i=n.getAdjustPointShape,a=n.edgeModel,l=this.state.dragging;return $t("g",{pointerEvents:l?"none":"",onMouseDown:this.handleMouseDown,children:l?"":i(o,r,a)})},e})(Po),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,l={start:i,end:a,offset:r.offset,verticalLength:r.verticalLength,type:"end"},s=C_(l),f=s.leftX,h=s.leftY,v=s.rightX,b=s.rightY;return s2({d:"M".concat(f," ").concat(h," L").concat(a.x," ").concat(a.y," L").concat(v," ").concat(b," z")},r)},e.prototype.getShape=function(){var n=this.getArrowAttributes(),o=n.d,r=n.strokeWidth,i=n.stroke,a=n.fill;return $t(k_,{d:o,fill:a,strokeWidth:r,stroke:i})},e.prototype.render=function(){return $t("g",{className:"lf-arrow",children:this.getShape()})},e})(Po);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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ZE=(function(t){Lee(e,t);function e(){var n=t.call(this)||this;return n.textRef=WE(),n.handleHover=function(o,r){var i=n.props,a=i.model,l=i.graphModel.eventCenter;a.setHovered(o);var s=o?pr.EDGE_MOUSEENTER:pr.EDGE_MOUSELEAVE,f=a.getData();l.emit(s,{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,l=a.editConfigModel,s=a.getPointByClient({x:o.clientX,y:o.clientY});a.setElementStateById(i.id,Wo.SHOW_MENU,s.domOverlayPosition),l.isSilentMode||n.toFront(),i.isSelected||a.selectEdgeById(i.id);var f=i==null?void 0:i.getData();a.eventCenter.emit(pr.EDGE_CONTEXTMENU,{data:f,e:o,position:s})},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,l=a.model,s=a.graphModel,f=l==null?void 0:l.getData(),h=s.getPointByClient({x:o.clientX,y:o.clientY});if(i){var v=s.editConfigModel,b=s.textEditElement,w=l.id,O=l.text,E=l.modelType;if(b&&b.id===w&&s.setElementStateById(w,Wo.DEFAULT),v.edgeTextEdit&&O.editable&&(l.setSelected(!1),s.setElementStateById(w,Wo.TEXT_EDIT)),E===_o.POLYLINE_EDGE){var S=l,M=s.getPointByClient({x:o.x,y:o.y}).canvasOverlayPosition,C=M.x,$=M.y;S.dbClickPosition=g3({x:C,y:$},S.points)}s.eventCenter.emit(pr.EDGE_DBCLICK,{data:f,e:o,position:h})}else{s.eventCenter.emit(pr.ELEMENT_CLICK,{data:f,e:o,position:h}),s.eventCenter.emit(pr.EDGE_CLICK,{data:f,e:o,position:h});var D=o.currentTarget,k=!wl(window)&&Ph(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(F){return setTimeout(F,0)};k(function(){D.focus()})}var B=s.editConfigModel;s.selectEdgeById(l.id,y3(o,B)),B.isSilentMode||n.toFront()}}},n.handleFocus=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.EDGE_FOCUS,{data:r.getData()})},n.handleBlur=function(){var o=n.props,r=o.model,i=o.graphModel;i.eventCenter.emit(pr.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!==Zu.TEXT||r.state===Wo.TEXT_EDIT)return null;if(r.text){var l=!1;return a.edgeTextDraggable&&r.text.draggable&&(l=!0),$t(bee,{ref:this.textRef,editable:a.edgeTextEdit&&((n=r.text.editable)!==null&&n!==void 0?n:!0),model:r,graphModel:i,draggable:l})}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,l=r.refX,s=l===void 0?2:l,f=Iee(this.getLastTwoPoints(),2),h=f[0],v=f[1],b="auto";if(h&&v){var w=v.x-h.x,O=v.y-h.y;if(w!==0||O!==0){var E=YJ(XJ({x:w,y:O}));Number.isFinite(E)&&!Number.isNaN(E)&&(b=E)}}return $t("g",{children:$t("defs",{children:[$t("marker",{id:"marker-start-".concat(o),refX:-s,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),$t("marker",{id:"marker-end-".concat(o),refX:s,refY:a,overflow:"visible",orient:b,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(n,o){var r=o.stroke,i=o.fill,a=i===void 0?r:i,l=o.strokeWidth,s=o.offset,f=s===void 0?10:s,h=o.verticalLength,v=o.strokeLinecap,b=o.strokeLinejoin,w=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:l,strokeLinecap:v,strokeLinejoin:b,transform:w})},e.prototype.getStartArrow=function(){var n=this.props.model,o=n.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,l=o.verticalLength,s=o.startArrowType,f=s===void 0?"none":s,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:l,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,l=o.verticalLength,s=o.endArrowType,f=s===void 0?"solid":s,h=o.strokeLinecap,v=o.strokeLinejoin;return this.getArrowPath(f,{stroke:r,strokeWidth:i,offset:a,verticalLength:l,strokeLinecap:h,strokeLinejoin:v,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(n,o,r){var i=r.getAdjustPointStyle();return $t(zg,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,l=i.adjustEdgeStart,s=i.adjustEdgeEnd,f=o.getAdjustStart(),h=o.getAdjustEnd();return $t("g",{children:[a&&l&&$t(Bk,d_({type:$d.SOURCE},f,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r})),a&&s&&$t(Bk,d_({type:$d.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})(Po),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)}})(),l2=function(){return l2=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},l2.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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},$k=(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,l=r.arrowConfig,s=n.getEdgeAnimationStyle(),f=s.strokeDasharray,h=s.stroke,v=s.strokeDashoffset,b=s.animationName,w=s.animationDuration,O=s.animationIterationCount,E=s.animationTimingFunction,S=s.animationDirection;return $t(k_,l2({d:i},o,l,a?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:w,animationIterationCount:O,animationTimingFunction:E,animationDirection:S}}:{}))},e.prototype.getAppendWidth=function(){var n=this.props.model.path;return $t(k_,{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}}),l=Bee(_k(a,i),2),s=l[0],f=l[1],h={start:s,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 _k(r,o)},e})(ZE),$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)}})(),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)},Uk=(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,l=n.getEdgeStyle(),s=n.getEdgeAnimationStyle(),f=s.strokeDasharray,h=s.stroke,v=s.strokeDashoffset,b=s.animationName,w=s.animationDuration,O=s.animationIterationCount,E=s.animationTimingFunction,S=s.animationDirection;return $t(Gg,u2({},l,{x1:o.x,y1:o.y,x2:r.x,y2:r.y},a,i?{strokeDasharray:f,stroke:h,style:{strokeDashoffset:v,animationName:b,animationDuration:w,animationIterationCount:O,animationTimingFunction:E,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),l=a.d,s=a.strokeWidth,f=a.fill,h=a.strokeDasharray,v=a.stroke;return $t(k_,{d:l,fill:f,strokeWidth:s,stroke:v,strokeDasharray:h})},e})(ZE),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(l){a={error:l}}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,l=a.model,s=a.graphModel;n.isDragging=!0;var f=s.transformModel,h=s.editConfigModel,v=Vee(f.fixDeltaXY(r,i),2),b=v[0],w=v[1],O=l,E=h.adjustEdgeMiddle;E?n.appendInfo=O.dragAppendSimple(n.appendInfo,{x:b,y:w}):n.appendInfo=O.dragAppend(n.appendInfo,{x:b,y:w})},n.onDragEnd=function(){var o,r=n.props,i=r.model,a=r.graphModel.eventCenter,l=i;l.dragAppendEnd(),n.isDragging=!1,l.isShowAdjustPoint=(o=n.isShowAdjustPointTemp)!==null&&o!==void 0?o:!1,n.appendInfo=void 0,a.emit(pr.EDGE_ADJUST,{data:l.getData()})},n.beforeDragStart=function(o,r){r.draggable&&n.drag.handleMouseDown(o),n.appendInfo=r},n.drag=new oc({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(),l=n.getEdgeAnimationStyle(),s=l.strokeDasharray,f=l.stroke,h=l.strokeDashoffset,v=l.animationName,b=l.animationDuration,w=l.animationIterationCount,O=l.animationTimingFunction,E=l.animationDirection;return $t(TJ,$v({points:o},a,i,r?{strokeDasharray:s,stroke:f,style:{strokeDashoffset:h,animationName:v,animationDuration:b,animationIterationCount:w,animationTimingFunction:O,animationDirection:E}}:{}))},e.prototype.getArrowInfo=function(){var n=this.props.model,o=n.points,r=n.isSelected,i=this.state.hover,a=Kv(o),l=a[0],s=a[0];return a.length>=2&&(l=a[a.length-2],s=a[a.length-1]),{start:l,end:s,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},l=C_($v($v({},a),{type:"start"})),s=C_($v($v({},a),{type:"end"}));i="M".concat(l.leftX," ").concat(l.leftY,`
L`).concat(l.rightX," ").concat(l.rightY,`
L`).concat(s.rightX," ").concat(s.rightY,`
L`).concat(s.leftX," ").concat(s.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,l=o.strokeDasharray,s=o.stroke;return $t(k_,{d:r,fill:a,strokeWidth:i,stroke:s,strokeDasharray:l})},e.prototype.getAppendWidth=function(){for(var n=this,o=this.props,r=o.model,i=o.graphModel,a=r.pointsList,l=r.draggable,s=[],f=a.length,h=function(w){var O="lf-polyline-append",E={start:{x:a[w].x,y:a[w].y},end:{x:a[w+1].x,y:a[w+1].y},startIndex:w,endIndex:w+1,direction:ni.HORIZONTAL,draggable:!0},S=$t("g",{className:O,children:v.getAppendShape(E)}),M=i.editConfigModel,C=M.adjustEdge,$=M.adjustEdgeMiddle;if(C&&l){var D=E.startIndex,k=E.endIndex,B=$&&(D===0||k===f-1);E.draggable=!B,E.start.x===E.end.x?(E.draggable&&(O+="-ew-resize"),E.direction=ni.VERTICAL):E.start.y===E.end.y&&(E.draggable&&(O+="-ns-resize"),E.direction=ni.HORIZONTAL),S=$t("g",{className:v.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(F){return n.beforeDragStart(F,E)},children:$t("g",{className:O,children:v.getAppendShape(E)})})}s.push(S)},v=this,b=0;b<f-1;b++)h(b);return $t("g",{children:s})},e})(ZE),wg=function(){return wg=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},wg.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(wg(wg({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY}))))},this.onDragOver=function(r){if(n.lf.graphModel.eventCenter.emit(pr.BLANK_CANVAS_MOUSEMOVE,{e:r}),r.preventDefault(),n.fakeNode){var i=n.clientToLocalPoint({x:r.clientX,y:r.clientY}),a=i.x,l=i.y;n.fakeNode.moveTo(a,l);var s=n.fakeNode.getData();n.lf.setNodeSnapLine(s),n.lf.graphModel.eventCenter.emit(pr.NODE_DND_DRAG,{data:s,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(wg(wg({},n.nodeConfig),n.clientToLocalPoint({x:r.clientX,y:r.clientY})),pr.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=om(this.lf.options,["grid","size"]),i=this.lf.graphModel.getPointByClient({x:n,y:o}),a=i.canvasOverlayPosition,l=a.x,s=a.y,f=this.lf.graphModel.editConfigModel.snapGrid;return{x:Wg(l,r,f),y:Wg(s,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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}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=WE(),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,l=i.theme,s=l.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,b=v.x,w=v.y;h.x=b,h.y=w,r.setText(h)}var O={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===da.EDGE){var E=l.edgeText,S=E.overflowMode,M=E.lineHeight,C=E.wrapPadding,$=E.textWidth;$&&S==="autoWrap"&&(f=np(np({},O),{width:$,minWidth:$,lineHeight:M,padding:C}))}else if(r.BaseType===da.NODE){var D=l.nodeText,S=D.overflowMode,M=D.lineHeight,C=D.wrapPadding,$=D.textWidth,k=r.width,B=r.modelType,F=r.textWidth,I=F||$||k;(B!==_o.TEXT_NODE&&S==="autoWrap"||B===_o.TEXT_NODE&&$)&&(f=np(np({},O),{width:I,minWidth:I,lineHeight:M,padding:C}))}var V=r.text,z=V.x,X=V.y,Y=Xee(a.CanvasPointToHtmlPoint([z,X]),2),W=Y[0],Q=Y[1];return{style:np(np({left:W,top:Q},f),s)}}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(pr.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([xl],e),e})(Po),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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},sS=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(l){a={error:l}}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(l){var s=o.props,f=s.graphModel.gridSize,h=s.lf,v=h.getTransform().SCALE_X;o.stepDrag.setStep(f*v),o.stepDrag.handleMouseDown(l)},o.handleWheelEvent=function(l){var s,f;l.preventDefault();var h=l.deltaX,v=l.deltaY,b=l.clientX,w=l.clientY,O=l.ctrlKey,E=new WheelEvent("wheel",{deltaX:h,deltaY:v,clientX:b,clientY:w,ctrlKey:O});(f=(s=o.props.lf.container)===null||s===void 0?void 0:s.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||f===void 0||f.dispatchEvent(E)},o.onDragging=function(l){var s=l.deltaX,f=l.deltaY,h=o.props,v=h.graphModel,b=h.lf,w=b.getTransform(),O=w.SCALE_X,E=w.SCALE_Y,S=v.getSelectElements(!0);v.moveNodes(S.nodes.map(function(M){return M.id}),s/O,f/E)},o.handleContextMenu=function(l){l.preventDefault();var s=o.props,f=s.graphModel,h=s.graphModel,v=h.eventCenter,b=h.selectElements,w=f.getPointByClient({x:l.clientX,y:l.clientY}),O={nodes:[],edges:[]},E=Zee([],sS(b.values()),!1);E.forEach(function(S){S.BaseType===da.NODE&&O.nodes.push(S.getData()),S.BaseType===da.EDGE&&O.edges.push(S.getData())}),v.emit(pr.SELECTION_CONTEXTMENU,{data:O,e:l,position:w})};var r=n.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new oc({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,l=this.props.lf.getTransform(),s=l.SCALE_X,f=l.SCALE_Y;if(!(i.size<=1)){var h=Number.MAX_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,b=Number.MIN_SAFE_INTEGER,w=Number.MIN_SAFE_INTEGER;i.forEach(function(E){var S;E.BaseType===da.NODE&&(S=LZ(E)),E.BaseType===da.EDGE&&(S=$Z(E)),S!==void 0&&(h=Math.min(h,S.x),v=Math.min(v,S.y),b=Math.max(b,S.x1),w=Math.max(w,S.y1))}),n=sS(a.CanvasPointToHtmlPoint([h,v]),2),h=n[0],v=n[1],o=sS(a.CanvasPointToHtmlPoint([b,w]),2),b=o[0],w=o[1];var O={left:"".concat(h-20*s/2,"px"),top:"".concat(v-20*f/2,"px"),width:"".concat(b-h+20*s,"px"),height:"".concat(w-v+20*f,"px"),"border-width":"".concat(2*s,"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([xl],e),e})(Po),lS=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(pr.GRAPH_TRANSFORM,",").concat(pr.NODE_CLICK,",").concat(pr.BLANK_CLICK," "),function(){var i,a=o.textEditElement,l=o.editConfigModel,s=l.edgeTextEdit,f=l.nodeTextEdit;(s||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()},lS([Ut],t.prototype,"toolMap",void 0),lS([Bt],t.prototype,"disableTool",null),lS([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 C3=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(C3(Object.getPrototypeOf(t))||[])},nte=function(t){var e=C3(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("__")})},N3="pending",Xw="fulfilled",kM="rejected";function ote(t){switch(this.state){case N3:return t.pending&&t.pending(this.value);case kM:return t.rejected&&t.rejected(this.value);case Xw:return t.fulfilled?t.fulfilled(this.value):this.value}}function Vk(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=kM})),n.isPromiseBasedObservable=!0,n.case=ote;var o=e&&e.state===Xw?e.value:void 0;return NA(n,{value:o,state:N3},{},{deep:!1}),n}(function(t){t.reject=Bt("fromPromise.reject",function(n){var o=t(Promise.reject(n));return o.state=kM,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)})(Vk||(Vk={}));var P0=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 l=t.length-1;l>=0;l--)(a=t[l])&&(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;PK(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()},P0([Ut.ref],t.prototype,"current",void 0),P0([Bt.bound],t.prototype,"next",null),P0([Bt.bound],t.prototype,"complete",null),P0([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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(nd(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"),NP(e,o)){var r=YE(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 NP(e,o)?n.localComputedValues.get(o).get():n.isPropertyDirty(o)?n.localValues.get(o):n.model[o]},set:Bt(function(l){l!==n.model[o]?n.localValues.set(o,l):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;Vg(this.localValues).forEach(function(n){var o=e.localValues.get(n),r=e.model[n];tf(r)?r.replace(o):Yl(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 nd(t)||tf(t)||Yl(t)}function ate(t,e){var n=new WeakMap;function o(l){var s=n.get(l.object);r(l,s),e(l,uS(s),t)}function r(l,s){switch(l.type){case"add":i(l.newValue,s,l.name);break;case"update":a(l.oldValue),i(l.newValue,s,l.name||""+l.index);break;case"remove":case"delete":a(l.oldValue);break;case"splice":l.removed.map(a),l.added.forEach(function(v,b){return i(v,s,""+(l.index+b))});for(var f=l.index+l.addedCount;f<l.object.length;f++)if(cS(l.object[f])){var h=n.get(l.object[f]);h&&(h.path=""+f)}break}}function i(l,s,f){if(cS(l)){var h=n.get(l);if(h){if(h.parent!==s||h.path!==f)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+uS(s)+"/"+f+"',")+(" but it already exists at '"+uS(h.parent)+"/"+h.path+"'"))}else{var v={parent:s,path:f,dispose:QI(l,o)};n.set(l,v),UK(l).forEach(function(b){var w=b[0],O=b[1];return i(O,v,w)})}}}function a(l){if(cS(l)){var s=n.get(l);if(!s)return;n.delete(l),s.dispose(),$K(l).forEach(a)}}return i(t,void 0,""),function(){a(t)}}var ste=(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){ste(e,t);function e(n,o,r){var i=r===void 0?{}:r,a=i.name,l=a===void 0?"ogm"+(Math.random()*1e3|0):a,s=i.keyToName,f=s===void 0?function(b){return""+b}:s,h=t.call(this)||this;h._keyToName=f,h._groupBy=o,h._ogmInfoKey=Symbol("ogmInfo"+l),h._base=n;for(var v=0;v<n.length;v++)h._addItem(n[v]);return h._disposeBaseObserver=QI(h._base,function(b){if(b.type==="splice")Hc(function(){for(var w=0,O=b.removed;w<O.length;w++){var E=O[w];h._removeItem(E)}for(var S=0,M=b.added;S<M.length;S++){var C=M[S];h._addItem(C)}});else if(b.type==="update")Hc(function(){h._removeItem(b.oldValue),h._addItem(b.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:HI(function(){return o._groupBy(n)},function(l,s){var f=n[o._ogmInfoKey];o._removeFromGroupArr(f.groupByValue,f.groupArrIndex);var h=o._getGroupArr(l),v=h.length;h.push(n),f.groupByValue=l,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})(AM);Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var 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)},lte=(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(Qu(this.undos),e)||(this.undos.push(e),uA(this.curData,e)||(this.redos=[]),this.eventCenter.emit(pr.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,D2(function(){var o=e.modelToHistoryData();o&&n.add(c2({},o))},this.waitTime))},t.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},t})(),dS={exports:{}},Wk;function ute(){return Wk||(Wk=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",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},s,f=1;f<20;++f)r[111+f]="f"+f;for(f=0;f<=9;++f)r[f+96]=f.toString();function h(F,I,V){if(F.addEventListener){F.addEventListener(I,V,!1);return}F.attachEvent("on"+I,V)}function v(F){if(F.type=="keypress"){var I=String.fromCharCode(F.which);return F.shiftKey||(I=I.toLowerCase()),I}return r[F.which]?r[F.which]:i[F.which]?i[F.which]:String.fromCharCode(F.which).toLowerCase()}function b(F,I){return F.sort().join(",")===I.sort().join(",")}function w(F){var I=[];return F.shiftKey&&I.push("shift"),F.altKey&&I.push("alt"),F.ctrlKey&&I.push("ctrl"),F.metaKey&&I.push("meta"),I}function O(F){if(F.preventDefault){F.preventDefault();return}F.returnValue=!1}function E(F){if(F.stopPropagation){F.stopPropagation();return}F.cancelBubble=!0}function S(F){return F=="shift"||F=="ctrl"||F=="alt"||F=="meta"}function M(){if(!s){s={};for(var F in r)F>95&&F<112||r.hasOwnProperty(F)&&(s[r[F]]=F)}return s}function C(F,I,V){return V||(V=M()[F]?"keydown":"keypress"),V=="keypress"&&I.length&&(V="keydown"),V}function $(F){return F==="+"?["+"]:(F=F.replace(/\+{2}/g,"+plus"),F.split("+"))}function D(F,I){var V,z,X,Y=[];for(V=$(F),X=0;X<V.length;++X)z=V[X],l[z]&&(z=l[z]),I&&I!="keypress"&&a[z]&&(z=a[z],Y.push("shift")),S(z)&&Y.push(z);return I=C(z,Y,I),{key:z,modifiers:Y,action:I}}function k(F,I){return F===null||F===n?!1:F===I?!0:k(F.parentNode,I)}function B(F){var I=this;if(F=F||n,!(I instanceof B))return new B(F);I.target=F,I._callbacks={},I._directMap={};var V={},z,X=!1,Y=!1,W=!1;function Q(ze){ze=ze||{};var Ye=!1,Be;for(Be in V){if(ze[Be]){Ye=!0;continue}V[Be]=0}Ye||(W=!1)}function J(ze,Ye,Be,Je,gt,se){var Ze,pe,le=[],we=Be.type;if(!I._callbacks[ze])return[];for(we=="keyup"&&S(ze)&&(Ye=[ze]),Ze=0;Ze<I._callbacks[ze].length;++Ze)if(pe=I._callbacks[ze][Ze],!(!Je&&pe.seq&&V[pe.seq]!=pe.level)&&we==pe.action&&(we=="keypress"&&!Be.metaKey&&!Be.ctrlKey||b(Ye,pe.modifiers))){var $e=!Je&&pe.combo==gt,rt=Je&&pe.seq==Je&&pe.level==se;($e||rt)&&I._callbacks[ze].splice(Ze,1),le.push(pe)}return le}function ie(ze,Ye,Be,Je){I.stopCallback(Ye,Ye.target||Ye.srcElement,Be,Je)||ze(Ye,Be)===!1&&(O(Ye),E(Ye))}I._handleKey=function(ze,Ye,Be){var Je=J(ze,Ye,Be),gt,se={},Ze=0,pe=!1;for(gt=0;gt<Je.length;++gt)Je[gt].seq&&(Ze=Math.max(Ze,Je[gt].level));for(gt=0;gt<Je.length;++gt){if(Je[gt].seq){if(Je[gt].level!=Ze)continue;pe=!0,se[Je[gt].seq]=1,ie(Je[gt].callback,Be,Je[gt].combo,Je[gt].seq);continue}pe||ie(Je[gt].callback,Be,Je[gt].combo)}var le=Be.type=="keypress"&&Y;Be.type==W&&!S(ze)&&!le&&Q(se),Y=pe&&Be.type=="keydown"};function Se(ze){typeof ze.which!="number"&&(ze.which=ze.keyCode);var Ye=v(ze);if(Ye){if(ze.type=="keyup"&&X===Ye){X=!1;return}I.handleKey(Ye,w(ze),ze)}}function Ae(){clearTimeout(z),z=setTimeout(Q,1e3)}function ke(ze,Ye,Be,Je){V[ze]=0;function gt(we){return function(){W=we,++V[ze],Ae()}}function se(we){ie(Be,we,ze),Je!=="keyup"&&(X=v(we)),setTimeout(Q,10)}for(var Ze=0;Ze<Ye.length;++Ze){var pe=Ze+1===Ye.length,le=pe?se:gt(Je||D(Ye[Ze+1]).action);De(Ye[Ze],le,Je,ze,Ze)}}function De(ze,Ye,Be,Je,gt){I._directMap[ze+":"+Be]=Ye,ze=ze.replace(/\s+/g," ");var se=ze.split(" "),Ze;if(se.length>1){ke(ze,se,Ye,Be);return}Ze=D(ze,Be),I._callbacks[Ze.key]=I._callbacks[Ze.key]||[],J(Ze.key,Ze.modifiers,{type:Ze.action},Je,ze,gt),I._callbacks[Ze.key][Je?"unshift":"push"]({callback:Ye,modifiers:Ze.modifiers,action:Ze.action,seq:Je,level:gt,combo:ze})}I._bindMultiple=function(ze,Ye,Be){for(var Je=0;Je<ze.length;++Je)De(ze[Je],Ye,Be)},h(F,"keypress",Se),h(F,"keydown",Se),h(F,"keyup",Se)}B.prototype.bind=function(F,I,V){var z=this;return F=F instanceof Array?F:[F],z._bindMultiple.call(z,F,I,V),z},B.prototype.unbind=function(F,I){var V=this;return V.bind.call(V,F,function(){},I)},B.prototype.trigger=function(F,I){var V=this;return V._directMap[F+":"+I]&&V._directMap[F+":"+I]({},F),V},B.prototype.reset=function(){var F=this;return F._callbacks={},F._directMap={},F},B.prototype.stopCallback=function(F,I){var V=this;if((" "+I.className+" ").indexOf(" mousetrap ")>-1||k(I,V.target))return!1;if("composedPath"in F&&typeof F.composedPath=="function"){var z=F.composedPath()[0];z!==F.target&&(I=z)}return I.tagName=="INPUT"||I.tagName=="SELECT"||I.tagName=="TEXTAREA"||I.isContentEditable},B.prototype.handleKey=function(){var F=this;return F._handleKey.apply(F,arguments)},B.addKeycodes=function(F){for(var I in F)F.hasOwnProperty(I)&&(r[I]=F[I]);s=null},B.init=function(){var F=B(n);for(var I in F)I.charAt(0)!=="_"&&(B[I]=(function(V){return function(){return F[V].apply(F,arguments)}})(I))},B.init(),e.Mousetrap=B,t.exports&&(t.exports=B)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(dS)),dS.exports}var cte=ute();const dte=Z_(cte);var kd=null;function Gk(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 zk(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 ag=40,k0=40;function fte(t,e){var n=t.keyboard,o=n.options.keyboard;n.on(["cmd + c","ctrl + c"],function(){if(k0=ag,!(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?(kd=null,!0):(kd=i,kd.nodes.forEach(function(l){return Gk(l,ag)}),kd.edges.forEach(function(l){return zk(l,ag)}),!1)}),n.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(kd&&(kd.nodes||kd.edges)){t.clearSelectElements();var r=t.addElements(kd,k0);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)}),kd.nodes.forEach(function(i){return Gk(i,ag)}),kd.edges.forEach(function(i){return zk(i,ag)}),k0=k0+ag}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(l){var s=l.keys,f=l.callback,h=l.action;return e.on(s,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})(),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)},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(l){a={error:l}}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"),Hk=(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,l=r.height;this.options=r,this.container=this.initContainer(i,a,l),this.graphModel=new ree(ph(ph({},r),{container:this.container})),this.plugins=(o=r.plugins)!==null&&o!==void 0?o:[];var s=this.graphModel.eventCenter;this.tool=new ete(this),this.dnd=new Wee({lf:this}),this.history=new lte(s),this.keyboard=new pte({lf:this,keyboard:r.keyboard}),r.snapline!==!1&&(this.snaplineModel=new oee(this.graphModel,r.snaplineEpsilon),Gee(s,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:ZE,BaseEdgeModel:KE,BaseNode:Ih,BaseNodeModel:Lh,RectNode:Zv,RectNodeModel:Hg,CircleNode:Ww,CircleNodeModel:$w,PolygonNode:zw,PolygonNodeModel:Uw,TextNode:Fk,TextNodeModel:jk,LineEdge:Uk,LineEdgeModel:Pk,DiamondNode:n2,DiamondNodeModel:HA,PolylineEdge:$_,PolylineEdgeModel:F_,BezierEdge:$k,BezierEdgeModel:Ck,EllipseNode:o2,EllipseNodeModel:XA,HtmlNode:a2,HtmlNodeModel:YA,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,l=i.model,s=a;o&&!s.isObserved&&(s.isObserved=!0,s=xl(s)),this.setView(e,s),this.graphModel.setModel(e,l)}},t.prototype.registerElement=function(e){var n=e.view;e.isObserverView!==!1&&!n.isObserved&&(n.isObserved=!0,n=xl(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:Hg},{type:"circle",view:Ww,model:$w},{type:"polygon",view:zw,model:Uw},{type:"text",view:Fk,model:jk},{type:"ellipse",view:o2,model:XA},{type:"diamond",view:n2,model:HA},{type:"html",view:a2,model:YA},{type:"line",view:Uk,model:Pk},{type:"polyline",view:$_,model:F_},{type:"bezier",view:$k,model:Ck}];this.batchRegister(e)},t.prototype.addNode=function(e,n,o){return n===void 0&&(n=pr.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(ph(ph({},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={},l={nodes:[],edges:[]};return ri(r,function(s){var f=s.id,h=o.addNode(s);f&&(a[f]=h.id),l.nodes.push(h)}),ri(i,function(s){var f=s.sourceNodeId,h=s.targetNodeId;a[f]&&(f=a[f]),a[h]&&(h=a[h]);var v=o.graphModel.addEdge(ph(ph({},s),{sourceNodeId:f,targetNodeId:h}));l.edges.push(v)}),l},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(Zs(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),!wl(e==null?void 0:e.snapGrid)&&e.snapGrid!==i){var a=this.graphModel.grid.size,l=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?l:1)}this.emit(pr.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 l=this.getEdgeModelById(e);if(l){var s=l.textPosition,i=s.x,a=s.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,l=e.y;o.focusOn(a,l,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(Zs(e)),this.options.history!==!1&&this.history.watch(this.graphModel),rk($t(uee,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(pr.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=Zs(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},t.prototype.redo=function(){if(this.history.redoAble()){var e=Zs(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),l=a[1];return l}),r=fS(fS([],R0(this.plugins),!1),R0(o),!1);ri(r,function(i){var a,l;pS in i?(a=i.extension,l=i.props):a=i;var s=a==null?void 0:a.pluginName;zj(e,s)===-1&&n.installPlugin(a,l)})},t.prototype.installPlugin=function(e,n){var o,r;if("pluginName"in e&&"install"in e){var i=e.pluginName,a=e.install,l=e.render;i&&(a&&a.call(e,this,t),l&&this.components.push(l.bind(e)),this.extension[i]=e);return}var s=e,f=s.pluginName,h=new s({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(),rk(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)})(Hk||(Hk={}));function xl(t){return TM(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 ly(){return vte.next()}var P3=(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){P3(e,t);function e(n,o){return n.id||(n.id="Event_".concat(ly())),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){P3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e})(Ww);var k3=(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){k3(e,t);function e(n,o){return n.id||(n.id="Event_".concat(ly())),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){k3(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,l=r.r,s=t.prototype.getShape.call(this);return Lr("g",{},s,Lr("circle",qw(qw({},o),{cx:i,cy:a,r:l-5})))},e.extendKey="EndEventView",e})(Ww);var R3=(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){R3(e,t);function e(n,o){return n.id||(n.id="Flow_".concat(ly())),t.call(this,n,o)||this}return e.extendKey="SequenceFlowModel",e})(F_);(function(t){R3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e})($_);var D3=(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){D3(e,t);function e(n,o){var r=this;return n.id||(n.id="Gateway_".concat(ly())),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){D3(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,l=o.height,s=o.points,f=n.getNodeStyle();return Lr("g",{transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-l/2,")")},Lr("polygon",f_(f_({},f),{x:r,y:i,points:s})),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 j3=(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)}})(),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)};(function(t){j3(e,t);function e(n,o){return n.id||(n.id="Activity_".concat(ly())),t.call(this,n,o)||this}return e.extendKey="ServiceTaskModel",e})(Hg);(function(t){j3(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,l=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:l.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,l=n.radius,s=n.getNodeStyle();return Lr("g",{},[Lr("rect",d2({x:o-i/2,y:r-a/2,rx:l,ry:l,width:i,height:a},s)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e})(Zv);var L3=(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){L3(e,t);function e(n,o){return n.id||(n.id="Activity_".concat(ly())),t.call(this,n,o)||this}return e.extendKey="UserTaskModel",e})(Hg);(function(t){L3(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,l=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:l.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,l=n.radius,s=n.getNodeStyle();return Lr("g",{},[Lr("rect",Kw(Kw({},s),{x:o-i/2,y:r-a/2,rx:l,ry:l,width:i,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e})(Zv);var mte=(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})(),gte=(globalThis==null?void 0:globalThis._ids)||new mte;function Xk(){return gte.next()}function I3(t){return Object.prototype.toString.call(t)}function yte(t){return" ".repeat(t)}function Zw(t){var e=t;return I3(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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}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(s){r+=Z0(s,e,n+1)});else if(I3(t)==="[object Object]"){var i=Object.keys(t),a="",l="";r+=(n===0?"":Tv+o)+"<"+e,i.forEach(function(s){s.charAt(0)==="-"?a+=Z0(t[s],s,n+1):l+=Z0(t[s],s,n+1)}),r+=a+(l!==""?">".concat(l).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 Al=function(){};Al.ObjTree=function(){return this};Al.ObjTree.VERSION="0.23";Al.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
`;Al.ObjTree.prototype.attr_prefix="-";Al.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)};Al.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,l=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),l&&l(h)}}else o.asynchronous=!1;var s;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(s=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(s=f.transport)}if(n)return s;if(s&&s.responseXML&&s.responseXML.documentElement)return this.parseDOM(s.responseXML.documentElement)};Al.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}};Al.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 l=!0;n&&(l=!1);for(var r=0;r<t.childNodes.length&&l;r++){var s=t.childNodes[r].nodeType;s==3||s==4||s==8||(l=!1)}if(l){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}};Al.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};Al.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Al.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(""),l=n.join("");return typeof t>"u"||t==null||(n.length>0?l.match(/\n/)?l="<"+t+a+`>
`+l+"</"+t+`>
`:l="<"+t+a+">"+l+"</"+t+`>
`:l="<"+t+a+` />
`),l};Al.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("")};Al.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+`>
`};Al.ObjTree.prototype.xml_escape=Jw;var wte=function(t){return new Al.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)}})(),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)},JE=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(l){a={error:l}}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 F3=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],Yk=["properties","startPoint","endPoint","pointsList"],B3=function(t){return String(t||"").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'")};function qk(t){var e=t?Yk.concat(t):Yk;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 l=JE(a,2),s=l[0],f=l[1];typeof f!="object"?s.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(s)?i[s]=f:i["-".concat(s)]=f:e.includes(s)?i["-".concat(s)]=o(f):i[s]=o(f)}),i)}return o(n)}}function Qw(t){var e={};return Object.entries(t).forEach(function(n){var o=JE(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,l={"-id":i.id};if(!((a=i.text)===null||a===void 0)&&a.value&&(l["-name"]=i.text.value),i.properties){var s=qk(n)(i.properties);Object.assign(l,s)}o.set(i.id,l),t[i.type]?Array.isArray(t[i.type])?t[i.type].push(l):t[i.type]=[t[i.type],l]:t[i.type]=l});var r=e.edges.map(function(i){var a,l,s=o.get(i.targetNodeId);s["bpmn:incoming"]?Array.isArray(s["bpmn:incoming"])?s["bpmn:incoming"].push(i.id):s["bpmn:incoming"]=[s["bpmn:incoming"],i.id]:s["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"]=(l=i.text)===null||l===void 0?void 0:l.value),i.properties){var h=qk(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(l){var s=l.x,f=l.y;return{"-x":s,"-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,l=n.x,s=n.y,f=Fh.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),l-=i/2,s-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":l,"-y":s,"-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(l){if(l.indexOf("bpmn:")===0){var s=r[l];if(l===Xd.FLOW){var f=a["bpmndi:BPMNEdge"],h=(Array.isArray(f),f);n=Mte(s,h)}else{var v=a["bpmndi:BPMNShape"],b=(Array.isArray(v),v);e=e.concat(Ate(s,b,l))}}})}return{nodes:e,edges:n}}function Ate(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var l;Array.isArray(e)?l=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):l=e;var s=Kk(l,n,a);o.push(s)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=Kk(r,n,t);o.push(i)}return o}function Kk(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=B3(n["-name"]),a=Fh.shapeConfigMap.get(e);a&&(o+=a.width/2,r+=a.height/2);var l;Object.entries(n).forEach(function(v){var b=JE(v,2),w=b[0],O=b[1];F3.indexOf(w)===-1&&(l||(l={}),l[w]=O)}),l&&(l=Qw(l));var s;if(i&&(s={x:o,y:r,value:i},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var f=t["bpmndi:BPMNLabel"]["dc:Bounds"];s.x=Number(f["-x"])+Number(f["-width"])/2,s.y=Number(f["-y"])+Number(f["-height"])/2}var h={id:t["-bpmnElement"],type:e,x:o,y:r,properties:l};return s&&(h.text=s),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(Zk(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(Zk(o,t))}return n}function Zk(t,e){var n,o=e["-name"]?B3("".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(w){i<w.length&&(i=w.length)}),r)n={value:o,x:Number(r["-x"])+i*10/2,y:Number(r["-y"])+7};else{var a=t["di:waypoint"]||[],l=a[0],s=a[a.length-1]||l,f=(Number((l==null?void 0:l["-x"])||0)+Number((s==null?void 0:s["-x"])||0))/2,h=(Number((l==null?void 0:l["-y"])||0)+Number((s==null?void 0:s["-y"])||0))/2;n={value:o,x:f,y:h}}}var v;Object.entries(e).forEach(function(w){var O=JE(w,2),E=O[0],S=O[1];F3.indexOf(E)===-1&&(v||(v={}),v[E]=S)}),v&&(v=Qw(v));var b={id:e["-id"],type:Xd.FLOW,pointsList:t["di:waypoint"].map(function(w){return{x:Number(w["-x"]),y:Number(w["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:v};return n&&(b.text=n),b}var Fh=(function(){function t(e){var n=e.lf,o=this;this.adapterOut=function(r,i){var a=f2({},o.processAttributes);xte(a,r,i);var l={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};Ote(l,r);var s=o.definitionAttributes;s["bpmn:process"]=a,s["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":l};var f={"bpmn:definitions":s};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(Xk())},this.definitionAttributes={"-id":"Definitions_".concat(Xk()),"-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:gP.width,height:gP.height});Fh.shapeConfigMap.set(Xd.END,{width:yP.width,height:yP.height});Fh.shapeConfigMap.set(Xd.GATEWAY,{width:_P.width,height:_P.height});Fh.shapeConfigMap.set(Xd.SYSTEM,{width:bP.width,height:bP.height});Fh.shapeConfigMap.set(Xd.USER,{width:wP.width,height:wP.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,l=wte(a);return o.adapterIn(l)},o.adapterXmlOut=function(i,a){var l=o.adapterOut(i,a);return bte(l)};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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");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 Pte=(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)},kte=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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Rte=oc,Dte=(function(t){Pte(e,t);function e(n){var o=t.call(this)||this;return o.updatePosition=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.x,f=l.y;o.nodeModel.x=s+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,l=r.deltaY,s=r.width,f=r.height,h=r.PCTResizeInfo,v=r.pct,b=v===void 0?1:v,w=r.freezeWidth,O=w===void 0?!1:w,E=r.freezeHeight,S=E===void 0?!1:E,M={width:s,height:f,deltaX:a,deltaY:l};if(h){var C=4,$=0,D=0;switch(i){case 0:D=(a*-1-l)/C;break;case 1:D=(a-l)/C;break;case 2:D=(a+l)/C;break;case 3:D=(a*-1+l)/C;break}D!==0&&($=Math.round(D/h.ResizeBasis.basisHeight*1e5)/1e3),h.ResizePCT.widthPCT=Math.max(Math.min(h.ResizePCT.widthPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit),h.ResizePCT.heightPCT=Math.max(Math.min(h.ResizePCT.heightPCT+$,h.ScaleLimit.maxScaleLimit),h.ScaleLimit.minScaleLimit);var k=Math.round(h.ResizePCT.widthPCT*h.ResizeBasis.basisWidth/100),B=Math.round(h.ResizePCT.heightPCT*h.ResizeBasis.basisHeight/100);switch(i){case 0:a=s-k,l=f-B;break;case 1:a=k-s,l=f-B;break;case 2:a=k-s,l=B-f;break;case 3:a=s-k,l=B-f;break}return M.width=k,M.height=B,M.deltaX=a/b,M.deltaY=l/b,M}switch(i){case 0:M.width=O?s:s-a*b,M.height=S?f:f-l*b;break;case 1:M.width=O?s:s+a*b,M.height=S?f:f-l*b;break;case 2:M.width=O?s:s+a*b,M.height=S?f:f+l*b;break;case 3:M.width=O?s:s-a*b,M.height=S?f:f+l*b;break}return M},o.updateEdgePointByAnchors=function(){var r=o.nodeModel,i=r.id,a=r.anchors,l=o.getNodeEdges(i);l.sourceEdges.forEach(function(s){var f=a.find(function(h){return h.id===s.sourceAnchorId});f&&s.updateStartPoint({x:f.x,y:f.y})}),l.targetEdges.forEach(function(s){var f=a.find(function(h){return h.id===s.targetAnchorId});f&&s.updateEndPoint({x:f.x,y:f.y})})},o.updateRect=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.x,f=l.y,h=l.width,v=l.height,b=l.radius,w=l.PCTResizeInfo,O=o.nodeModel,E=O.minWidth,S=O.minHeight,M=O.maxWidth,C=O.maxHeight,$=o.index,D=E===M,k=S===C,B=o.getResize({index:$,deltaX:i,deltaY:a,width:h,height:v,PCTResizeInfo:w,pct:1,freezeWidth:D,freezeHeight:k});if(B.width<E||B.width>M||B.height<S||B.height>C){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:D?0:B.deltaX,deltaY:k?0:B.deltaY}),o.nodeModel.width=B.width,o.nodeModel.height=B.height,o.nodeModel.setProperties({nodeSize:{width:B.width,height:B.height}});var F={x:s,y:f,width:h,height:v,radius:b},I={x:o.nodeModel.x,y:o.nodeModel.y,width:o.nodeModel.width,height:o.nodeModel.height,radius:b};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:F,afterNode:I})},o.updateEllipse=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.rx,f=l.ry,h=l.x,v=l.y,b=l.PCTResizeInfo,w=o.index,O=o.nodeModel,E=O.minWidth,S=O.minHeight,M=O.maxWidth,C=O.maxHeight,$=E===M,D=S===C,k=s,B=f,F=o.getResize({index:w,deltaX:i,deltaY:a,width:k,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.width<E/2||F.width>M/2||F.height<S/2||F.height>C/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:Uv(Uv({},I),{rx:s,ry:f}),afterNode:V})},o.updateDiamond=function(r){var i=r.deltaX,a=r.deltaY,l=o.nodeModel,s=l.rx,f=l.ry,h=l.x,v=l.y,b=l.PCTResizeInfo,w=o.index,O=o.nodeModel,E=O.minWidth,S=O.minHeight,M=O.maxWidth,C=O.maxHeight,$=E===M,D=S===C,k=s,B=f,F=o.getResize({index:w,deltaX:i,deltaY:a,width:k,height:B,PCTResizeInfo:b,pct:1/2,freezeWidth:$,freezeHeight:D});if(F.width<E/2||F.width>M/2||F.height<S/2||F.height>C/2){o.dragHandler.cancelDrag();return}o.updatePosition({deltaX:$?0:F.deltaX,deltaY:D?0:F.deltaY}),o.nodeModel.rx=F.width,o.nodeModel.ry=F.height,o.nodeModel.setProperties({nodeSize:{rx:F.width,ry:F.height}});var I={x:h,y:v,rx:s,ry:f},V={rx:F.width,ry:F.height,x:o.nodeModel.x,y:o.nodeModel.y};o.updateEdgePointByAnchors(),o.eventEmit({deltaX:i,deltaY:a,beforeNode:I,afterNode:V})},o.eventEmit=function(r){var i=r.deltaX,a=r.deltaY,l=r.beforeNode,s=r.afterNode,f=o.nodeModel,h=f.id,v=f.modelType,b=f.type,w=Uv({id:h,modelType:v,type:b},l),O=Uv({id:h,modelType:v,type:b},s);o.graphModel.eventCenter.emit("node:resize",{preData:w,data:O,deltaX:i,deltaY:a,index:o.index,model:o.nodeModel})},o.onDragging=function(r){var i,a=r.deltaX,l=r.deltaY,s=o.graphModel.transformModel,f=o.nodeModel.modelType;i=kte(s.fixDeltaXY(a,l),2),a=i[0],l=i[1],f===_o.RECT_NODE||f===_o.HTML_NODE?o.updateRect({deltaX:a,deltaY:l}):f===_o.ELLIPSE_NODE?o.updateEllipse({deltaX:a,deltaY:l}):f===_o.DIAMOND_NODE&&o.updateDiamond({deltaX:a,deltaY:l})},o.onDragEnd=function(){var r=o.graphModel.gridSize,i=r===void 0?1:r,a=i*Math.round(o.nodeModel.x/i),l=i*Math.round(o.nodeModel.y/i);o.nodeModel.moveTo(a,l),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=[],l=0;l<r.length;l++){var s=r[l];s.sourceNodeId===n?i.push(s):r[l].targetNodeId===n&&a.push(s)}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,l=a.getControlPointStyle();return $t("g",{className:"lf-resize-control-".concat(i),children:$t(Yu,Uv({className:"lf-node-control",x:o,y:r},l,{onMouseDown:this.dragHandler.handleMouseDown}))})},e})(Po),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)}})(),eE=function(){return eE=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},eE.apply(this,arguments)},QE=(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,l=o.width,s=o.height,f={minX:i-l/2,minY:a-s/2,maxX:i+l/2,maxY:a+s/2},h=f.minX,v=f.minY,b=f.maxX,w=f.maxY,O=[{x:h,y:v},{x:b,y:v},{x:b,y:w},{x:h,y:w}];return O.map(function(E,S){return $t(Dte,eE({index:S},E,{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,l=n.getResizeOutlineStyle();return $t(Yu,eE({},l,{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})(Po),$3=(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){$3(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})(XA);(function(t){$3(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(QE,{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})(o2);var U3=(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)};(function(t){U3(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})(HA);(function(t){U3(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(QE,{model:o,graphModel:r})},e.prototype.getResizeShape=function(){var n=this.props.model,o=n.points,r=n.getNodeStyle();return $t("g",{children:$t(PM,p2({},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})(n2);var V3=(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){V3(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})(YA),Ite=(function(t){V3(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(QE,{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})(a2),W3={view:Ite,model:Lte},G3=(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){G3(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})(Hg),Bte=(function(t){G3(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(QE,{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),z3=(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)}})(),tE=function(){return tE=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},tE.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(l){a={error:l}}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))},Jk=500,Qk=300,$te=-1e4;(function(t){z3(e,t);function e(){var n=t.apply(this,Nv([],Cv(arguments),!1))||this;return n.isGroup=!0,n.isFolded=!1,n.unfoldedWidth=Jk,n.unfoldedHeight=Qk,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=Jk,this.height=Qk,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 l=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(n),a.isGroup&&!n){var s=o.childrenLastFoldStatus[i];s!==void 0&&s!==a.isFolded&&a.foldGroup(s)}o.childrenLastFoldStatus[i]=!!l,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 l=i.id,s=i.sourceNodeId,f=i.targetNodeId,h=i.startPoint,v=i.endPoint,b=i.type,w=i.text,O=i.getProperties(),E={id:"".concat(l,"__").concat(a),sourceNodeId:s,targetNodeId:f,startPoint:h,endPoint:v,type:b,properties:O,text:w==null?void 0:w.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(s);M||(M=r.graphModel.getNodeModelById(s)),n&&i.visible!==!1&&(r.children.has(s)||r.id===s?(E.startPoint=void 0,E.sourceNodeId=r.id):(E.endPoint=void 0,E.targetNodeId=r.id),(S.id!==r.id||M.id!==r.id)&&r.createVirtualEdge(E),i.visible=!1),!n&&i.visible===!1&&(S&&S.isGroup&&S.isFolded?(E.targetNodeId=S.id,E.endPoint=void 0,r.createVirtualEdge(E)):M&&M.isGroup&&M.isFolded?(E.sourceNodeId=M.id,E.startPoint=void 0,r.createVirtualEdge(E)):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){z3(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,l=n.radius,s=n.properties,f=n.getAddableOutlineStyle;if(!s.groupAddable)return null;var h=this.props.model.getNodeStyle().strokeWidth,v=h===void 0?0:h,b=f(),w=o+v+8,O=r+v+8;return Lr("rect",tE(tE({},b),{width:w,height:O,x:i-w/2,y:a-O/2,rx:l,ry:l}))},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 eR=(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){eR(r,o);function r(i,a){i.id||(i.id="Flow_".concat(Nte()));var l=p_(p_(p_({},{}),i.properties),{isDefaultFlow:!1});return i.properties=l,o.call(this,i,a)||this}return r.extendKey="SequenceFlowModel",r})(F_),n=(function(o){eR(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 tR={width:40,height:40},nR={width:40,height:40},rR={width:100,height:80},nE={width:100,height:80},oR={width:100,height:80},iR={width:100,height:80},aR={width:100,height:80},sR={width:100,height:80},lR={width:100,height:80},uR={width:100,height:80};function H3(t){return Object.prototype.toString.call(t)}function cR(t){return" ".repeat(t)}function rE(t){return H3(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var o=n;return n.charAt(0)==="-"&&(o=n.substring(1)),e[o]=rE(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return rE(e)}):t}function oE(t){return t==null?"":t.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Vte(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch{e=JSON.stringify(rE(t)).replace(/"/g,"'")}return oE(String(e))}var dR=`
`;function J0(t,e,n){var o=cR(n),r="",i=dR+o;if(e==="-json")return"";if(e==="#text")return i+oE(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(H3(t)==="[object Object]"){var a=Object.keys(t),l="",s=t["-json"]?dR+cR(n+1)+t["-json"]:"";r+="".concat(n===0?"":i,"<").concat(e),a.forEach(function(f){f.charAt(0)==="-"?l+=J0(t[f],f,n+1):s+=J0(t[f],f,n+1)}),r+=l+(s!==""?">".concat(s).concat(i,"</").concat(e,">"):" />")}else r+="".concat(i,"<").concat(e,">").concat(oE(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 Ml=function(){};Ml.ObjTree=function(){return this};Ml.ObjTree.VERSION="0.23";Ml.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
`;Ml.ObjTree.prototype.attr_prefix="-";Ml.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}};Ml.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,l=o.onComplete;o.onComplete=function(h){var v;h&&h.responseXML&&h.responseXML.documentElement&&(v=i.parseDOM(h.responseXML.documentElement)),a(v,h),l&&l(h)}}else o.asynchronous=!1;var s;if(typeof HTTP<"u"&&HTTP.Request){o.uri=t;var f=new HTTP.Request(o);f&&(s=f.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var f=new Ajax.Request(t,o);f&&(s=f.transport)}if(n)return s;if(s&&s.responseXML&&s.responseXML.documentElement)return this.parseDOM(s.responseXML.documentElement)};Ml.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}};Ml.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 l=!0;n&&(l=!1);for(var r=0;r<t.childNodes.length&&l;r++){var s=t.childNodes[r].nodeType;s===3||s===4||s===8||(l=!1)}if(l){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}};Ml.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};Ml.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e};Ml.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(""),l=n.join("");return typeof t>"u"||t==null||(n.length>0?l.match(/\n/)?l="<".concat(t).concat(a,`>
`).concat(l,"</").concat(t,`>
`):l="<".concat(t).concat(a,">").concat(l,"</").concat(t,`>
`):l="<".concat(t).concat(a,` />
`)),l};Ml.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("")};Ml.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,`>
`)};Ml.ObjTree.prototype.xml_escape=oE;var Gte=function(t){return new Ml.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)}})(),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)},fR=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},RM=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.")},Ks=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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},zc=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))},Ol;(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"})(Ol||(Ol={}));var X3=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],Hte=["properties","startPoint","endPoint","pointsList"],iE={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},Y3=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},Hu={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return((n=(e=Hu[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=Hu[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=Hu[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=Hu[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,l=e["-id"],s="",f="";try{for(var h=RM(Object.keys(e)),v=h.next();!v.done;v=h.next()){var b=v.value;b.includes("bpmn:")&&(r=Ks(b.split(":"),2),s=r[1],f=(i=e[b])===null||i===void 0?void 0:i["#text"])}}catch(w){n={error:w}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return{"-definitionId":l,"-definitionType":a,"-timerType":s,"-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(zc(zc([],Ks(Hte),!1),Ks(n||[]),!1)),a={in:new Set(zc(zc([],Ks(iE.in),!1),Ks((o==null?void 0:o.in)||[]),!1)),out:new Set(zc(zc([],Ks(iE.out),!1),Ks((o==null?void 0:o.out)||[]),!1))};return Hu=Y3(Hu,r),function(l){var s=l.nodes,f=l.edges;function h(v,b){var w,O;if((v==null?void 0:v.flag)!==1){var E;if((E=Hu[v.type])&&E.out){var S=E.out(v),M=Object.keys(S);M.length>0&&M.forEach(function(V){v[V]=S[V]})}v!=null&&v.children&&(v.children=v.children.map(function(V){var z=s.find(function(X){return X.id===V})||f.find(function(X){return X.id===V});return z||{}}));var C={};if(typeof v=="string")return v;if(Array.isArray(v))return v.map(function(V){return h(V,"")}).filter(function(V){return V!=null});try{for(var $=RM(Object.entries(v)),D=$.next();!D.done;D=$.next()){var k=Ks(D.value,2),B=k[0],F=k[1];if((F==null?void 0:F.flag)===1)return;var I=[b,B].filter(function(V){return V}).join(".");a.out.has(I)||(typeof F!="object"?B.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(B)?C[B]=F:C["-".concat(B)]=F:i.has(I)?C["-".concat(B)]=h(F,I):C[B]=h(F,I))}}catch(V){w={error:V}}finally{try{D&&!D.done&&(O=$.return)&&O.call($)}finally{if(w)throw w.error}}return C}}return h(l,"")}}function aE(t){var e,n,o={};try{for(var r=RM(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=Ks(i.value,2),l=a[0],s=a[1];l.indexOf("-")===0?o[l.substring(1)]=rE(s):typeof s=="string"?o[l]=s:Object.prototype.toString.call(s)==="[object Object]"?o[l]=aE(s):Array.isArray(s)?o[l]=s.map(function(f){return aE(f)}):o[l]=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}function Yte(t,e,n){var o,r=new Map,i=Xte(n)(e);i.nodes.forEach(function(l){var s=l["-id"],f=l["-type"],h=l.text,v=l.children,b=fR(l,["-id","-type","text","children"]),w={"-id":s};h!=null&&h["-value"]&&(w["-name"]=h["-value"]),b["-json"]&&(w["-json"]=b["-json"]),b["-properties"]&&Object.assign(w,b["-properties"]),v&&(w.children=v),t[f]||(t[f]=[]),t[f].push(w),r.set(s,w)});var a=i.edges.map(function(l){var s=l["-id"],f=l["-sourceNodeId"],h=l["-targetNodeId"],v=l.text,b=fR(l,["-id","-sourceNodeId","-targetNodeId","text"]),w=r.get(h);w["bpmn:incoming"]||(w["bpmn:incoming"]=[]),w["bpmn:incoming"].push(s);var O={"-id":s,"-sourceRef":f,"-targetRef":h};return v!=null&&v["-value"]&&(O["-name"]=v["-value"]),b["-json"]&&(O["-json"]=b["-json"]),b["-properties"]&&Object.assign(O,b["-properties"]),O});return e.edges.forEach(function(l){var s=l.sourceNodeId,f=l.id,h=r.get(s);h["bpmn:outgoing"]||(h["bpmn:outgoing"]=[]),h["bpmn:outgoing"].push(f)}),(o=t["bpmn:subProcess"])===null||o===void 0||o.forEach(function(l){var s={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},f=[];l.children.forEach(function(E){var S,M=r.get(E["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function($){M[$]&&M[$].forEach(function(D){s[$].add(D)})});var C=(S=t[E["-type"]])===null||S===void 0?void 0:S.findIndex(function($){return $["-id"]===E["-id"]});C>=0&&t[E["-type"]].splice(C,1),r.delete(E["-id"]),l[E["-type"]]||(l[E["-type"]]=[]),l[E["-type"]].push(M)});var h=s["bpmn:incoming"],v=s["bpmn:outgoing"];v.forEach(function(E){h.has(E)&&f.push(E)});for(var b=function(E){var S=a.findIndex(function(M){return M["-id"]===f[E]});S>=0?(l["bpmn:sequenceFlow"]||(l["bpmn:sequenceFlow"]=[]),l["bpmn:sequenceFlow"].push(a[S]),a.splice(S,1)):E++,w=E},w,O=0;O<f.length;)b(O),O=w;delete l.children}),t[Ol.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(l){var s=l.x,f=l.y;return{"-x":s,"-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,l=n.x,s=n.y,f=ql.shapeConfigMap.get(n.type);f&&(i=f.width,a=f.height),l-=i/2,s-=a/2;var h={"-id":"".concat(r,"_di"),"-bpmnElement":r,"dc:Bounds":{"-x":l,"-y":s,"-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,l=i.excludeFields,s={in:new Set(zc(zc([],Ks(iE.in),!1),Ks((l==null?void 0:l.in)||[]),!1)),out:new Set(zc(zc([],Ks(iE.out),!1),Ks((l==null?void 0:l.out)||[]),!1))};Hu=Y3(Hu,a);var f=t["bpmn:definitions"];if(f){var h=f["bpmn:process"];(function(b,w){w.forEach(function(O){try{Object.keys(b).forEach(function(E){try{O(E)}catch(S){console.error(S)}})}catch(E){console.error(E)}})})(h,[function(b){function w(E){E["-children"]||(E["-children"]=[]),Object.keys(E).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(E[S])?(M=h[S]).push.apply(M,zc([],Ks(E[S]),!1)):h[S].push(E[S]),Array.isArray(E[S])?E[S].forEach(function(C){!S.includes("Flow")&&E["-children"].push(C["-id"])}):!S.includes("Flow")&&E["-children"].push(E[S]["-id"]),delete E[S])})}if(b==="bpmn:subProcess"){var O=h[b];Array.isArray(O)?O.forEach(function(E){b==="bpmn:subProcess"&&w(E)}):w(O)}},function(b){var w=function(E){Object.keys(E).forEach(function(S){var M,C;if(S.includes("bpmn:")){var $={};Hu[S]&&Hu[S].in?($=(C=(M=Hu[S]).in)===null||C===void 0?void 0:C.call(M,S,ge.cloneDeep(E[S])),delete E[S]):O(E[S]);var D=void 0;(D=Reflect.ownKeys($)).length>0&&D.forEach(function(k){Reflect.set(E,k,$[k])})}})};function O(E){r.set(E["-id"],E),Array.isArray(E)?E.forEach(function(S){O(S)}):typeof E=="object"&&w(E)}O(h[b])},function(b){if(b.indexOf("bpmn:")===0){var w=h[b];if(b==="bpmn:sequenceFlow"){var O=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=Qte(w,O)}else{var E=f["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(b==="bpmn:boundaryEvent"){var S=h[b],M=function(C){var $=C["-attachedToRef"],D=r.get($);D["-boundaryEvents"]||(D["-boundaryEvents"]=[]),D["-boundaryEvents"].push(C["-id"])};Array.isArray(S)?S.forEach(function(C){M(C)}):M(S)}n=n.concat(Jte(w,E,b))}}}])}var v=function(b,w,O){Object.keys(b).forEach(function(E){var S=O?"".concat(O,".").concat(E):E;w.has(S)?delete b[E]:typeof b[E]=="object"&&v(b[E],w,S)})};return n.forEach(function(b){var w,O;if(!((w=e==null?void 0:e.mapping)===null||w===void 0)&&w.in){var E=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;E[S]&&(b.type=E[S])}v(b,s.in,"")}),o.forEach(function(b){var w,O;if(!((w=e==null?void 0:e.mapping)===null||w===void 0)&&w.in){var E=(O=e==null?void 0:e.mapping)===null||O===void 0?void 0:O.in,S=b.type;E[S]&&(b.type=E[S])}v(b,s.in,"")}),{nodes:n,edges:o}}function Jte(t,e,n){var o=[];if(Array.isArray(t))t.forEach(function(a){var l;Array.isArray(e)?l=e.find(function(f){return f["-bpmnElement"]===a["-id"]}):l=e;var s=pR(l,n,a);o.push(s)});else{var r=void 0;Array.isArray(e)?r=e.find(function(a){return a["-bpmnElement"]===t["-id"]}):r=e;var i=pR(r,n,t);o.push(i)}return o}function pR(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],l=ql.shapeConfigMap.get(e);l&&(o+=l.width/2,r+=l.height/2);var s={};Object.entries(n).forEach(function(b){var w=Ks(b,2),O=w[0],E=w[1];X3.includes(O)||(s[O]=E)}),s=aE(s);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:s};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(hR(i,r))});else{var o=void 0;Array.isArray(e)?o=e.find(function(r){return r["-bpmnElement"]===t["-id"]}):o=e,n.push(hR(o,t))}return n}function hR(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=Ks(f,2),v=h[0],b=h[1];X3.includes(v)||(a[v]=b)}),a=aE(a);var l=t["di:waypoint"].map(function(f){return{x:Number(f["-x"]),y:Number(f["-y"])}}),s={id:e["-id"],type:Ol.FLOW,pointsList:l,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(s.text=n),s}var ql=(function(){function t(e){var n=e.lf,o=this;this.adapterOut=function(r,i){var a,l,s=h2({},o.processAttributes);Yte(s,r,i);var f={"-id":"BPMNPlane_1","-bpmnElement":s["-id"]};qte(f,r);var h=o.definitionAttributes;h["bpmn:process"]=s,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 b=(l=i==null?void 0:i.mapping)===null||l===void 0?void 0:l.out,w=function(O){Array.isArray(O)&&O.forEach(function(E){return w(E)}),typeof O=="object"&&Object.keys(O).forEach(function(E){var S;(S=b[E])?(O[S]=ge.cloneDeep(O[E]),delete O[E],w(O[S])):w(O[E])})};w(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})();ql.shapeConfigMap.set(Ol.START,{width:tR.width,height:tR.height});ql.shapeConfigMap.set(Ol.END,{width:nR.width,height:nR.height});ql.shapeConfigMap.set(Ol.INTERMEDIATE_CATCH,{width:nE.width,height:nE.height});ql.shapeConfigMap.set(Ol.INTERMEDIATE_THROW,{width:nE.width,height:nE.height});ql.shapeConfigMap.set(Ol.BOUNDARY,{width:rR.width,height:rR.height});ql.shapeConfigMap.set(Ol.PARALLEL_GATEWAY,{width:oR.width,height:oR.height});ql.shapeConfigMap.set(Ol.INCLUSIVE_GATEWAY,{width:iR.width,height:iR.height});ql.shapeConfigMap.set(Ol.EXCLUSIVE_GATEWAY,{width:aR.width,height:aR.height});ql.shapeConfigMap.set(Ol.SYSTEM,{width:sR.width,height:sR.height});ql.shapeConfigMap.set(Ol.USER,{width:lR.width,height:lR.height});ql.shapeConfigMap.set(Ol.SUBPROCESS,{width:uR.width,height:uR.height});(function(t){zte(e,t);function e(n){var o=t.call(this,n)||this;o.adapterXmlIn=function(a){var l=Gte(a);return o.adapterIn(l,o.props)},o.adapterXmlOut=function(a){var l=o.adapterOut(a,o.props);return Wte(l)};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})(ql);function ene(t,e,n){var o=e.x,r=e.y,i=t.x,a=t.y,l=i-o,s=a-r,f=l*Math.cos(n)-s*Math.sin(n),h=l*Math.sin(n)+s*Math.cos(n),v=f+o,b=h+r;return{x:v,y:b}}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)}})(),sE=function(){return sE=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},sE.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(l){a={error:l}}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,l=i.graphModel,s=a.transformWithContainer,f=a.isRestrict,h=n.childrenPositionMap;if(!(!s||f)&&r.id===a.id){var v={x:a.x,y:a.y};ri(Array.from(a.children),function(b){var w=l.getNodeModelById(b);if(w){var O={x:w.x,y:w.y};h.has(w.id)?O=h.get(w.id):h.set(w.id,O);var E=r.rotate*(180/Math.PI);E<0&&(E+=360);var S=E*(Math.PI/180),M=ene(O,v,S);w.moveTo(M.x,M.y),w.rotate=r.rotate}})}},n.onNodeResize=function(o){var r=o.deltaX,i=o.deltaY,a=o.index,l=o.model,s=o.preData,f=n.props,h=f.model,v=f.graphModel,b=h.transformWithContainer,w=h.isRestrict;if(!(!b||w)&&l.id===h.id){var O=s.properties,E=O||{},S=E.width,M=E.height;ri(Array.from(h.children),function(C){var $=v.getNodeModelById(C);if($){var D=$.width/S*r,k=$.height/M*i;O3({deltaX:D,deltaY:k,index:a,nodeModel:$,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 l=o.getNodeModelById(a);l!=null&&l.isGroup&&(i=i.concat(r.getNodesInGroup(l,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,l=n.radius,s=n.groupAddable;if(!s)return null;var f=n.getNodeStyle().strokeWidth,h=f===void 0?0:f,v=n.getAddableOutlineStyle(),b=o+h+8,w=r+h+8;return Lr("rect",sE(sE({},v),{width:b,height:w,x:i-b/2,y:a-w/2,rx:l,ry:l}))},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,l=o-i/2+10,s=r-a/2+10;if(!n.collapsible)return null;var f=n!=null&&n.isCollapsed?this.getCollapseIcon(l,s):this.getExpandIcon(l,s),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:l,y:s,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)}})(),lE=function(){return lE=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},lE.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},sg=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(l){a={error:l}}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,sne=80,lne=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,l=r.height,s=r.collapsedWidth,f=r.collapsedHeight,h=r.collapsible,v=r.isCollapsed,b=r.zIndex,w=r.isRestrict,O=r.autoResize,E=r.autoToFront,S=r.transformWithContainer;this.children=i?new Set(i):new Set,this.zIndex=b??une,this.isCollapsed=v??!1,this.setProperties({isCollapsed:v??!1});var M=a??ine,C=l??ane;this.width=M,this.height=C,this.expandWidth=M,this.expandHeight=C,this.collapsedWidth=s??sne,this.collapsedHeight=f??lne,this.isRestrict=w??!1,this.transformWithContainer=S??!1,this.autoResize=O??!1,this.collapsible=h??!0,this.autoToFront=E??!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=sg(t.prototype.getMoveDistance.call(this,n,o,r),2),a=i[0],l=i[1],s=this.getNodesInGroup(this);return this.graphModel.moveNodes(s,n,o,r),[a,l]},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,l=o.collapsedHeight,s=o.expandWidth,f=o.expandHeight,h=o.isCollapsed;return h&&(n.x=r+s/2-a/2,n.y=i+f/2-l/2,n.text&&(n.text.x=n.text.x+s/2-a/2,n.text.y=n.text.y+f/2-l/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([],sg(this.incoming.edges),!1),sg(this.outgoing.edges),!1),l=Array.from(this.children);ri(l,function(s){var f,h,v=o.graphModel.elementsModelMap.get(s);if(v){var b=v.isCollapsed;if(v.isGroup){var w=v;if(w.isCollapsed||w.toggleCollapse(n),!n){var O=(f=o.childrenLastCollapseStateDict)===null||f===void 0?void 0:f.get(s);O!==void 0&&O!==v.isCollapsed&&w.toggleCollapse(O)}}if((h=o.childrenLastCollapseStateDict)===null||h===void 0||h.set(s,!!b),v.visible=!n,v.BaseType===da.NODE){var E=v.incoming.edges,S=v.outgoing.edges;a=By(By(By([],sg(a),!1),sg(E),!1),sg(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,l=n.height,s=n.collapsedWidth,f=n.collapsedHeight;this.x=o-a/2+s/2,this.y=r-l/2+f/2,this.text.x=i.x-a/2+s/2,this.text.y=i.y-l/2+f/2,this.expandWidth=a,this.expandHeight=l,this.width=s,this.height=f},e.prototype.expand=function(){var n=this,o=n.x,r=n.y,i=n.text,a=n.expandWidth,l=n.expandHeight,s=n.collapsedWidth,f=n.collapsedHeight;this.width=a,this.height=l,this.x=o+this.width/2-s/2,this.y=r+this.height/2-f/2,this.text.x=i.x+this.width/2-s/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,l){var s,f=a.getData(),h=f.targetNodeId,v=f.sourceNodeId,b=lE(lE({},f),{id:"".concat(f.id,"__").concat(l),text:(s=f.text)===null||s===void 0?void 0:s.value});a.virtual&&i.deleteEdgeById(a.id);var w=i.dynamicGroup.getGroupByNodeId(h);w||(w=i.getNodeModelById(h));var O=i.dynamicGroup.getGroupByNodeId(v);O||(O=i.getNodeModelById(v)),n&&a.visible&&(r.children.has(v)||r.id===v?(b.startPoint=void 0,b.sourceNodeId=r.id):(b.endPoint=void 0,b.targetNodeId=r.id),(w.id!==r.id||O.id!==r.id)&&r.createVirtualEdge(b),a.visible=!1),!n&&!a.visible&&(w&&w.isGroup&&w.isCollapsed?(b.targetNodeId=w.id,b.endPoint=void 0,r.createVirtualEdge(b)):O&&O.isGroup&&O.isCollapsed?(b.sourceNodeId=O.id,b.startPoint=void 0,r.createVirtualEdge(b)):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})(Hg);var vR;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})(vR||(vR={}));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 l=t.length-1;l>=0;l--)(a=t[l])&&(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(l){a={error:l}}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=WE(),o.setHoverOn=function(){var s=o.props.element;s.isDragging||o.state.isHovered||(o.setState({isHovered:!0}),s.setHovered(!0))},o.setHoverOff=function(){var s=o.props.element;o.state.isHovered&&(o.setState({isHovered:!1}),s.setHovered(!1))},o.handleMouseDown=function(s){var f,h=o.props,v=h.label,b=h.graphModel,w=b.editConfigModel.nodeTextDraggable;((f=v.draggable)!==null&&f!==void 0?f:w)&&!o.state.isDragging&&!o.state.isEditing&&o.stepDrag.handleMouseDown(s)},o.handleMouseUp=function(s){o.state.isDragging&&o.stepDrag.handleMouseUp(s)},o.handleDragging=function(s){var f=s.deltaX,h=s.deltaY;o.state.isDragging||o.setState({isDragging:!0});var v=o.props,b=v.label,w=v.graphModel,O=w.transformModel,E=fne(O.fixDeltaXY(f,h),2),S=E[0],M=E[1];o.setElementModelLabelInfo({x:b.x+S,y:b.y+M}),w.eventCenter.emit("label:drag",{data:b.getData(),model:b})},o.handleDragEnd=function(){o.setState({isDragging:!1})},o.handleClick=function(s){var f=o.props,h=f.label,v=f.element,b=f.graphModel;v.setSelected(!o.state.isSelected),o.setState({isSelected:!o.state.isSelected}),o.setElementModelLabelInfo({isSelected:!0}),b.eventCenter.emit("label:click",{data:h.getData(),e:s,model:v})},o.handleDbClick=function(s){var f=o.props,h=f.label,v=f.element,b=f.graphModel;if(b.eventCenter.emit("label:dblclick",{data:h.getData(),e:s,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 w=document.createRange(),O=window.getSelection();w.selectNodeContents(o.textRef.current),w.collapse(!1),O==null||O.removeAllRanges(),O==null||O.addRange(w)}},o.handleBlur=function(s){var f=o.props,h=f.label,v=f.element,b=f.graphModel.eventCenter;b.emit("label:blur",{e:s,model:v,data:h.getData(),element:o.textRef.current}),o.setState({isDragging:!1,isHovered:!1,isSelected:!1})},o.handleInput=function(s){var f=o.props,h=f.label,v=f.graphModel;v.eventCenter.emit("label:input",{e:s,data:h.getData()})},o.reCalcLabelSize=function(){};var r=n.label,i=n.graphModel,a=i.gridSize,l=i.eventCenter;return o.stepDrag=new oc({onDragging:o.handleDragging,onDragEnd:o.handleDragEnd,step:a,eventType:"LABEL",model:r,eventCenter:l}),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,l=i.properties._label,s=l,f=Wj(s,function(b){return b.id===r.id}),h=s[f];s[f]=h_(h_({},h),n);var v=a.getElement(i.id);v==null||v.setProperty("_label",s)},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(l){var s,f,h,v,b=l.data;if(((b==null?void 0:b.type)!=="label"||b.type==="label"&&b.id!==r.id||n.state.isSelected)&&n.setState({isSelected:!1}),((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.id!==r.id)&&n.state.isEditing){n.setState({isEditing:!1});var w=(f=(s=n.textRef.current)===null||s===void 0?void 0:s.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:w,content:O,isSelected:!1}),i.setElementState(Wo.DEFAULT)}((b==null?void 0:b.type)!=="label"||b.type=="label"&&b.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,l=this.state,s=l.isDragging,f=l.isHovered,h=l.isSelected,v=l.isEditing,b=a.transformModel,w=b.getTransformStyle().transform,O=r.id,E=r.x,S=r.y,M=r.zIndex,C=r.vertical,$=r.style,D=r.rotate,k=r.content,B=r.labelWidth,F=r.textOverflowMode,I=B??(i.BaseType==="node"?i.width-20:80),V={left:"".concat(E-I/2,"px"),top:"".concat(S-10,"px"),width:"".concat(I,"px"),height:"20px",zIndex:M??1,transform:D?"".concat(w," rotate(").concat(D,"deg)"):"".concat(w," rotate(").concat(C?-.25:0,"turn)")};return $t("div",{id:"element-container-".concat(O),className:ZA("lf-label-editor-container"),style:V,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:ZA("lf-label-editor",(n={"lf-label-editor-dragging":s,"lf-label-editor-editing":v,"lf-label-editor-hover":!v&&(f||h)},n["lf-label-editor-".concat(F)]=!v,n)),onInput:this.handleInput,style:h_({maxWidth:"".concat(I,"px"),boxSizing:"border-box",display:"inline-block",background:v||i.BaseType==="edge"?"#fff":"transparent"},$),dangerouslySetInnerHTML:{__html:k}})})},e=dne([xl],e),e})(Po),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 l=t.length-1;l>=0;l--)(a=t[l])&&(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=wh,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:Gc(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,mR;function mne(){return mR||(mR=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,"")},l=Array[o].indexOf||function(O){for(var E=0,S=this.length;E<S;E++)if(E in this&&this[E]===O)return E;return-1},s=function(O,E){this.name=O,this.code=DOMException[O],this.message=E},f=function(O,E){if(E==="")throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(E))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return l.call(O,E)},h=function(O){for(var E=a.call(O.getAttribute("class")||""),S=E?E.split(/\s+/):[],M=0,C=S.length;M<C;M++)this.push(S[M]);this._updateClassName=function(){O.setAttribute("class",this.toString())}},v=h[o]=[],b=function(){return new h(this)};if(s[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,E=0,S=O.length,M,C=!1;do M=O[E]+"",f(this,M)===-1&&(this.push(M),C=!0);while(++E<S);C&&this._updateClassName()},v.remove=function(){var O=arguments,E=0,S=O.length,M,C=!1,$;do for(M=O[E]+"",$=f(this,M);$!==-1;)this.splice($,1),C=!0,$=f(this,M);while(++E<S);C&&this._updateClassName()},v.toggle=function(O,E){O+="";var S=this.contains(O),M=S?E!==!0&&"remove":E!==!1&&"add";return M&&this[M](O),E===!0||E===!1?E:!S},v.toString=function(){return this.join(" ")},i.defineProperty){var w={get:b,enumerable:!0,configurable:!0};try{i.defineProperty(r,n,w)}catch(O){O.number===-2146823252&&(w.enumerable=!1,i.defineProperty(r,n,w))}}else i[o].__defineGetter__&&r.__defineGetter__(n,b)}})(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(F){return Object.prototype.toString.call(F).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},l=function(I,V,z){this.data=I,this.size=I.length,this.type=V,this.encoding=z},s=a.prototype,f=l.prototype,h=r.FileReaderSync,v=function(F){this.code=this[this.name=F]},b="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),w=b.length,O=r.URL||r.webkitURL||r,E=O.createObjectURL,S=O.revokeObjectURL,M=O,C=r.btoa,$=r.atob,D=r.ArrayBuffer,k=r.Uint8Array,B=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(l.fake=f.fake=!0;w--;)v.prototype[b[w]]=w+1;return O.createObjectURL||(M=r.URL=function(F){var I=document.createElementNS("http://www.w3.org/1999/xhtml","a"),V;return I.href=F,"origin"in I||(I.protocol.toLowerCase()==="data:"?I.origin=null:(V=F.match(B),I.origin=V&&V[1])),I}),M.createObjectURL=function(F){var I=F.type,V;if(I===null&&(I="application/octet-stream"),F instanceof l)return V="data:"+I,F.encoding==="base64"?V+";base64,"+F.data:F.encoding==="URI"?V+","+decodeURIComponent(F.data):C?V+";base64,"+C(F.data):V+","+encodeURIComponent(F.data);if(E)return E.call(O,F)},M.revokeObjectURL=function(F){F.substring(0,5)!=="data:"&&S&&S.call(O,F)},s.append=function(F){var I=this.data;if(k&&(F instanceof D||F instanceof k)){for(var V="",z=new k(F),X=0,Y=z.length;X<Y;X++)V+=String.fromCharCode(z[X]);I.push(V)}else if(i(F)==="Blob"||i(F)==="File")if(h){var W=new h;I.push(W.readAsBinaryString(F))}else throw new v("NOT_READABLE_ERR");else F instanceof l?F.encoding==="base64"&&$?I.push($(F.data)):F.encoding==="URI"?I.push(decodeURIComponent(F.data)):F.encoding==="raw"&&I.push(F.data):(typeof F!="string"&&(F+=""),I.push(unescape(encodeURIComponent(F))))},s.getBlob=function(F){return arguments.length||(F=null),new l(this.data.join(""),F,"raw")},s.toString=function(){return"[object BlobBuilder]"},f.slice=function(F,I,V){var z=arguments.length;return z<3&&(V=null),new l(this.data.slice(F,z>1?I:this.data.length),V,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||"",l=new n;if(r)for(var s=0,f=r.length;s<f;s++)Uint8Array&&r[s]instanceof Uint8Array?l.append(r[s].buffer):l.append(r[s]);var h=l.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(s,f){var h,v=Array.prototype.slice.call(arguments,2);f=f||{};for(var b=0;b<v.length;b++){var w=v[b];if(w)for(h in w)w.hasOwnProperty(h)&&typeof w[h]<"u"&&(s||f.hasOwnProperty(h)===!1)&&(f[h]=w[h])}return f}var r=!1;try{var i=document.createElement("div"),a=document.createTextNode(" ");i.appendChild(a),r=i.contains(a)}catch{}var l={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(s){return!!(l.isMac&&s.metaKey||!l.isMac&&s.ctrlKey)},isKey:function(s,f){var h=l.getKeyCode(s);return Array.isArray(f)===!1?h===f:f.indexOf(h)!==-1},getKeyCode:function(s){var f=s.which;return f===null&&(f=s.charCode!==null?s.charCode:s.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(s,f,h,v){var b=s.createElement("a");return l.moveTextRangeIntoElement(f[0],f[f.length-1],b),b.setAttribute("href",h),v&&(v==="_blank"&&b.setAttribute("rel","noopener noreferrer"),b.setAttribute("target",v)),b},findOrCreateMatchingTextNodes:function(s,f,h){for(var v=s.createTreeWalker(f,NodeFilter.SHOW_ALL,null,!1),b=[],w=0,O=!1,E=null,S=null;(E=v.nextNode())!==null;)if(!(E.nodeType>3))if(E.nodeType===3){if(!O&&h.start<w+E.nodeValue.length&&(O=!0,S=l.splitStartNodeIfNeeded(E,h.start,w)),O&&l.splitEndNodeIfNeeded(E,S,h.end,w),O&&w===h.end)break;if(O&&w>h.end+1)throw new Error("PerformLinking overshot the target!");O&&b.push(S||E),w+=E.nodeValue.length,S!==null&&(w+=S.nodeValue.length,v.nextNode()),S=null}else E.tagName.toLowerCase()==="img"&&(!O&&h.start<=w&&(O=!0),O&&b.push(E));return b},splitStartNodeIfNeeded:function(s,f,h){return f!==h?s.splitText(f-h):null},splitEndNodeIfNeeded:function(s,f,h,v){var b,w;b=v+s.nodeValue.length+(f?f.nodeValue.length:0)-1,w=h-v-(f?s.nodeValue.length:0),b>=h&&v!==b&&w!==0&&(f||s).splitText(w)},splitByBlockElements:function(s){if(s.nodeType!==3&&s.nodeType!==1)return[];var f=[],h=e.util.blockContainerElementNames.join(",");if(s.nodeType===3||s.querySelectorAll(h).length===0)return[s];for(var v=0;v<s.childNodes.length;v++){var b=s.childNodes[v];if(b.nodeType===3)f.push(b);else if(b.nodeType===1){var w=b.querySelectorAll(h);w.length===0?f.push(b):f=f.concat(e.util.splitByBlockElements(b))}}return f},findAdjacentTextNodeWithContent:function(f,h,v){var b=!1,w,O=v.createNodeIterator(f,NodeFilter.SHOW_TEXT,null,!1);for(w=O.nextNode();w;){if(w===h)b=!0;else if(b&&w.nodeType===3&&w.nodeValue&&w.nodeValue.trim().length>0)break;w=O.nextNode()}return w},findPreviousSibling:function(s){if(!s||l.isMediumEditorElement(s))return!1;for(var f=s.previousSibling;!f&&!l.isMediumEditorElement(s.parentNode);)s=s.parentNode,f=s.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 b=h.parentNode;b!==null;){if(b===f)return!0;b=b.parentNode}return!1},isElement:function(f){return!!(f&&f.nodeType===1)},throttle:function(s,f){var h=50,v,b,w,O=null,E=0,S=function(){E=Date.now(),O=null,w=s.apply(v,b),O||(v=b=null)};return!f&&f!==0&&(f=h),function(){var M=Date.now(),C=f-(M-E);return v=this,b=arguments,C<=0||C>f?(O&&(clearTimeout(O),O=null),E=M,w=s.apply(v,b),O||(v=b=null)):O||(O=setTimeout(S,C)),w}},traverseUp:function(s,f){if(!s)return!1;do{if(s.nodeType===1){if(f(s))return s;if(l.isMediumEditorElement(s))return!1}s=s.parentNode}while(s);return!1},htmlEntities:function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},insertHTMLCommand:function(s,f){var h,v,b,w,O,E,S,M=!1,C=["insertHTML",!1,f];if(!e.util.isEdge&&s.queryCommandSupported("insertHTML"))try{return s.execCommand.apply(s,C)}catch{}if(h=s.getSelection(),h.rangeCount){if(v=h.getRangeAt(0),S=v.commonAncestorContainer,l.isMediumEditorElement(S)&&!S.firstChild)v.selectNode(S.appendChild(s.createTextNode("")));else if(S.nodeType===3&&v.startOffset===0&&v.endOffset===S.nodeValue.length||S.nodeType!==3&&S.innerHTML===v.toString()){for(;!l.isMediumEditorElement(S)&&S.parentNode&&S.parentNode.childNodes.length===1&&!l.isMediumEditorElement(S.parentNode);)S=S.parentNode;v.selectNode(S)}for(v.deleteContents(),b=s.createElement("div"),b.innerHTML=f,w=s.createDocumentFragment();b.firstChild;)O=b.firstChild,E=w.appendChild(O);v.insertNode(w),E&&(v=v.cloneRange(),v.setStartAfter(E),v.collapse(!0),e.selection.selectRange(s,v)),M=!0}return s.execCommand.callListeners&&s.execCommand.callListeners(C,M),M},execFormatBlock:function(s,f){var h=l.getTopBlockContainer(e.selection.getSelectionStart(s)),v;if(f==="blockquote"){if(h&&(v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return l.isBlockContainer(b)})))return s.execCommand("outdent",!1,null);if(l.isIE)return s.execCommand("indent",!1,f)}if(h&&f===h.nodeName.toLowerCase()&&(f="p"),l.isIE&&(f="<"+f+">"),h&&h.nodeName.toLowerCase()==="blockquote"){if(l.isIE&&f==="<p>")return s.execCommand("outdent",!1,f);if((l.isFF||l.isEdge)&&f==="p")return v=Array.prototype.slice.call(h.childNodes),v.some(function(b){return!l.isBlockContainer(b)})&&s.execCommand("formatBlock",!1,f),s.execCommand("outdent",!1,f)}return s.execCommand("formatBlock",!1,f)},setTargetBlank:function(s,f){var h,v=f||!1;if(s.nodeName.toLowerCase()==="a")s.target="_blank",s.rel="noopener noreferrer";else for(s=s.getElementsByTagName("a"),h=0;h<s.length;h+=1)(v===!1||v===s[h].attributes.href.value)&&(s[h].target="_blank",s[h].rel="noopener noreferrer")},removeTargetBlank:function(s,f){var h;if(s.nodeName.toLowerCase()==="a")s.removeAttribute("target"),s.removeAttribute("rel");else for(s=s.getElementsByTagName("a"),h=0;h<s.length;h+=1)f===s[h].attributes.href.value&&(s[h].removeAttribute("target"),s[h].removeAttribute("rel"))},addClassToAnchors:function(s,f){var h=f.split(" "),v,b;if(s.nodeName.toLowerCase()==="a")for(b=0;b<h.length;b+=1)s.classList.add(h[b]);else{var w=s.getElementsByTagName("a");if(w.length===0){var O=l.getClosestTag(s,"a");s=O?[O]:[]}else s=w;for(v=0;v<s.length;v+=1)for(b=0;b<h.length;b+=1)s[v].classList.add(h[b])}},isListItem:function(s){if(!s)return!1;if(s.nodeName.toLowerCase()==="li")return!0;for(var f=s.parentNode,h=f.nodeName.toLowerCase();h==="li"||!l.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(s,f){if(f.nodeName.toLowerCase()==="li"){var h=f.parentElement;h.parentElement.nodeName.toLowerCase()==="p"&&(l.unwrap(h.parentElement,s),e.selection.moveCursor(s,f.firstChild,f.firstChild.textContent.length))}},splitOffDOMTree:function(s,f,h){for(var v=f,b=null,w=!h;v!==s;){var O=v.parentNode,E=O.cloneNode(!1),S=w?v:O.firstChild,M;for(b&&(w?E.appendChild(b):M=b),b=E;S;){var C=S.nextSibling;S===v?(S.hasChildNodes()?S=S.cloneNode(!1):S.parentNode.removeChild(S),S.textContent&&b.appendChild(S),S=w?C:null):(S.parentNode.removeChild(S),(S.hasChildNodes()||S.textContent)&&b.appendChild(S),S=C)}M&&b.appendChild(M),v=O}return b},moveTextRangeIntoElement:function(s,f,h){if(!s||!f)return!1;var v=l.findCommonRoot(s,f);if(!v)return!1;if(f===s){var b=s.parentNode,w=s.nextSibling;return b.removeChild(s),h.appendChild(s),w?b.insertBefore(h,w):b.appendChild(h),h.hasChildNodes()}for(var O=[],E,S,M,C=0;C<v.childNodes.length;C++)if(M=v.childNodes[C],!E)l.isDescendant(M,s,!0)&&(E=M);else if(l.isDescendant(M,f,!0)){S=M;break}else O.push(M);var $=S.nextSibling,D=v.ownerDocument.createDocumentFragment();return E===s?(E.parentNode.removeChild(E),D.appendChild(E)):D.appendChild(l.splitOffDOMTree(E,s)),O.forEach(function(k){k.parentNode.removeChild(k),D.appendChild(k)}),S===f?(S.parentNode.removeChild(S),D.appendChild(S)):D.appendChild(l.splitOffDOMTree(S,f,!0)),h.appendChild(D),S.parentNode===v?v.insertBefore(h,S):$?v.insertBefore(h,$):v.appendChild(h),h.hasChildNodes()},depthOfNode:function(s){for(var f=0,h=s;h.parentNode!==null;)h=h.parentNode,f++;return f},findCommonRoot:function(s,f){for(var h=l.depthOfNode(s),v=l.depthOfNode(f),b=s,w=f;h!==v;)h>v?(b=b.parentNode,h-=1):(w=w.parentNode,v-=1);for(;b!==w;)b=b.parentNode,w=w.parentNode;return b},isElementAtBeginningOfBlock:function(s){for(var f,h;!l.isBlockContainer(s)&&!l.isMediumEditorElement(s);){for(h=s;h=h.previousSibling;)if(f=h.nodeType===3?h.nodeValue:h.textContent,f.length>0)return!1;s=s.parentNode}return!0},isMediumEditorElement:function(s){return s&&s.getAttribute&&!!s.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(s){return l.traverseUp(s,function(f){return l.isMediumEditorElement(f)})},isBlockContainer:function(s){return s&&s.nodeType!==3&&l.blockContainerElementNames.indexOf(s.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(s){return l.traverseUp(s,function(f){return l.isBlockContainer(f)||l.isMediumEditorElement(f)})},getTopBlockContainer:function(s){var f=l.isBlockContainer(s)?s:!1;return l.traverseUp(s,function(h){return l.isBlockContainer(h)&&(f=h),!f&&l.isMediumEditorElement(h)?(f=h,!0):!1}),f},getFirstSelectableLeafNode:function(s){for(;s&&s.firstChild;)s=s.firstChild;if(s=l.traverseUp(s,function(h){return l.emptyElementNames.indexOf(h.nodeName.toLowerCase())===-1}),s.nodeName.toLowerCase()==="table"){var f=s.querySelector("th, td");f&&(s=f)}return s},getFirstTextNode:function(s){return l.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),l._getFirstTextNode(s)},_getFirstTextNode:function(s){if(s.nodeType===3)return s;for(var f=0;f<s.childNodes.length;f++){var h=l._getFirstTextNode(s.childNodes[f]);if(h!==null)return h}return null},ensureUrlHasProtocol:function(s){return s.indexOf("://")===-1?"http://"+s:s},warn:function(){n.console!==void 0&&typeof n.console.warn=="function"&&n.console.warn.apply(n.console,arguments)},deprecated:function(s,f,h){var v=s+" is deprecated, please use "+f+" instead.";h&&(v+=" Will be removed in "+h),l.warn(v)},deprecatedMethod:function(s,f,h,v){l.deprecated(s,f,v),typeof this[f]=="function"&&this[f].apply(this,h)},cleanupAttrs:function(s,f){f.forEach(function(h){s.removeAttribute(h)})},cleanupTags:function(s,f){f.indexOf(s.nodeName.toLowerCase())!==-1&&s.parentNode.removeChild(s)},unwrapTags:function(s,f){f.indexOf(s.nodeName.toLowerCase())!==-1&&e.util.unwrap(s,document)},getClosestTag:function(s,f){return l.traverseUp(s,function(h){return h.nodeName.toLowerCase()===f.toLowerCase()})},unwrap:function(s,f){for(var h=f.createDocumentFragment(),v=Array.prototype.slice.call(s.childNodes),b=0;b<v.length;b++)h.appendChild(v[b]);h.childNodes.length?s.parentNode.replaceChild(h,s):s.parentNode.removeChild(s)},guid:function(){function s(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return s()+s()+"-"+s()+"-"+s()+"-"+s()+"-"+s()+s()+s()}};e.util=l})(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(),l,s;return a.rangeCount===0?!1:(l=a.getRangeAt(0),s=l.commonAncestorContainer,e.util.traverseUp(s,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,l=i.getSelection();if(l.rangeCount>0){var s=l.getRangeAt(0),f=s.cloneRange(),h;f.selectNodeContents(r),f.setEnd(s.startContainer,s.startOffset),h=f.toString().length,a={start:h,end:h+s.toString().length},this.doesRangeStartWithImages(s,i)&&(a.startsWithImage=!0);var v=this.getTrailingImageCount(r,a,s.endContainer,s.endOffset);if(v&&(a.trailingImageCount=v),h!==0){var b=this.getIndexRelativeToAdjacentEmptyBlocks(i,r,s.startContainer,s.startOffset);b!==-1&&(a.emptyBlocksIndex=b)}}return a},importSelection:function(r,i,a,l){if(!(!r||!i)){var s=a.createRange();s.setStart(i,0),s.collapse(!0);var f=i,h=[],v=0,b=!1,w=!1,O=0,E=!1,S,M=!1,C=null;for((l||r.startsWithImage||typeof r.emptyBlocksIndex<"u")&&(M=!0);!E&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!w)S=v+f.length,!b&&r.start>=v&&r.start<=S&&(M||r.start<S?(s.setStart(f,r.start-v),b=!0):C=f),b&&r.end>=v&&r.end<=S&&(r.trailingImageCount?w=!0:(s.setEnd(f,r.end-v),E=!0)),v=S;else{if(r.trailingImageCount&&w&&(f.nodeName.toLowerCase()==="img"&&O++,O===r.trailingImageCount)){for(var $=0;f.parentNode.childNodes[$]!==f;)$++;s.setEnd(f.parentNode,$+1),E=!0}if(!E&&f.nodeType===1)for(var D=f.childNodes.length-1;D>=0;)h.push(f.childNodes[D]),D-=1}E||(f=h.pop())}!b&&C&&(s.setStart(C,C.length),s.setEnd(C,C.length)),typeof r.emptyBlocksIndex<"u"&&(s=this.importSelectionMoveCursorPastBlocks(a,i,r.emptyBlocksIndex,s)),l&&(s=this.importSelectionMoveCursorPastAnchor(r,s)),this.selectRange(a,s)}},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 l=i.startContainer,s=i.startContainer.parentNode;s!==null&&s.nodeName.toLowerCase()!=="a";)s.childNodes[s.childNodes.length-1]!==l?s=null:(l=s,s=s.parentNode);if(s!==null&&s.nodeName.toLowerCase()==="a"){for(var f=null,h=0;f===null&&h<s.parentNode.childNodes.length;h++)s.parentNode.childNodes[h]===s&&(f=h);i.setStart(s.parentNode,f+1),i.collapse(!0)}}return i},importSelectionMoveCursorPastBlocks:function(r,i,a,l){var s=r.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,n,!1),f=l.startContainer,h,v,b=0;for(a=a||1,f.nodeType===3&&e.util.isBlockContainer(f.previousSibling)?h=f.previousSibling:h=e.util.getClosestBlockContainer(f);s.nextNode();)if(!v)h===s.currentNode&&(v=s.currentNode);else if(v=s.currentNode,b++,b===a||v.textContent.length>0)break;return v||(v=h),l.setStart(e.util.getFirstSelectableLeafNode(v),0),l},getIndexRelativeToAdjacentEmptyBlocks:function(r,i,a,l){if(a.textContent.length>0&&l>0)return-1;var s=a;if(s.nodeType!==3&&(s=a.childNodes[l]),s){if(!e.util.isElementAtBeginningOfBlock(s))return-1;var f=e.util.findPreviousSibling(s);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),b=0;v.nextNode();){var w=v.currentNode.textContent==="";if((w||b>0)&&(b+=1),v.currentNode===h)return b;w||(b=0)}return b},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 l=i.createTreeWalker(r.startContainer,NodeFilter.SHOW_ALL,null,!1);l.nextNode();){var s=l.currentNode;if(s===a)break;if(s.nodeValue)return!1}return!0},getTrailingImageCount:function(r,i,a,l){if(l===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var s=a.childNodes[l-1];s.hasChildNodes();)s=s.lastChild;for(var f=r,h=[],v=0,b=!1,w=!1,O=!1,E,S=0;!O&&f;){if(f.nodeType>3){f=h.pop();continue}if(f.nodeType===3&&!w)S=0,E=v+f.length,!b&&i.start>=v&&i.start<=E&&(b=!0),b&&i.end>=v&&i.end<=E&&(w=!0),v=E;else if(f.nodeName.toLowerCase()==="img"&&S++,f===s)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(l){var s=l&&l.getAttribute("contenteditable");return s==="true"&&(i=!0),l.nodeName!=="#text"&&s==="false"},r);return!i&&a},getSelectionHtml:function(i){var a,l="",s=i.getSelection(),f,h;if(s.rangeCount){for(h=i.createElement("div"),a=0,f=s.rangeCount;a<f;a+=1)h.appendChild(s.getRangeAt(a).cloneContents());l=h.innerHTML}return l},getCaretOffsets:function(i,a){var l,s;return a||(a=window.getSelection().getRangeAt(0)),l=a.cloneRange(),s=a.cloneRange(),l.selectNodeContents(i),l.setEnd(a.endContainer,a.endOffset),s.selectNodeContents(i),s.setStart(a.endContainer,a.endOffset),{left:l.toString().length,right:s.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,l,s;if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(a=i.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(l=[],s=a.commonAncestorContainer;s.parentNode&&s.parentNode.childNodes.length===1;)l.push(s.parentNode),s=s.parentNode;return l}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,l,s){var f=r.createRange();return f.setStart(i,a),l?f.setEnd(l,s):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 l=a.getInteractionElements();return l?(Array.isArray(l)||(l=[l]),l.some(function(s){return e.util.isDescendant(s,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,l){var s=this.base.options.contentWindow,f=this.base.options.ownerDocument;r=e.util.isElement(r)||[s,f].indexOf(r)>-1?[r]:r,Array.prototype.forEach.call(r,(function(h){h.addEventListener(i,a,l),this.events.push([h,i,a,l])}).bind(this))},detachDOMEvent:function(r,i,a,l){var s,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(b){s=this.indexOfListener(b,i,a,l),s!==-1&&(f=this.events.splice(s,1)[0],f[0].removeEventListener(f[1],f[2],f[3]))}).bind(this)))},indexOfListener:function(r,i,a,l){var s,f,h;for(s=0,f=this.events.length;s<f;s=s+1)if(h=this.events[s],h[0]===r&&h[1]===i&&h[2]===a&&h[3]===l)return s;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,l=i.length;a<l;a++){var s=i[a];this.detachDOMEvent(s[0],s[1],s[2],s[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(l){l(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(l,s){r.execCommand.listeners&&r.execCommand.listeners.forEach(function(f){f({command:l[0],value:l[2],args:l,result:s})})},a=function(){var l=r.execCommand.orig.apply(this,arguments);if(!r.execCommand.listeners)return l;var s=Array.prototype.slice.call(arguments);return i(s,l),l};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(),l;a&&i.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||n(this.base.extensions,this.lastMousedownTarget))&&(l=a),l||this.base.elements.some(function(f){return!l&&e.util.isDescendant(f,r,!0)&&(l=f),!!l},this);var s=!e.util.isDescendant(a,r,!0)&&!n(this.base.extensions,r);l!==a&&(a&&s&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",i,a)),l&&(l.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",i,l))),s&&this.triggerCustomEvent("externalInteraction",i)},updateInput:function(r,i){if(this.contentCache){var a=r.getAttribute("medium-editor-index"),l=r.innerHTML;l!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",i,r),this.contentCache[a]=l}},handleDocumentSelectionChange:function(r){if(r.currentTarget&&r.currentTarget.activeElement){var i=r.currentTarget.activeElement,a;this.base.elements.some(function(l){return e.util.isDescendant(l,i,!0)?(a=l,!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(l){o.classList.add(l)}),o.setAttribute("data-action",this.getAction()),i&&(o.setAttribute("title",i),o.setAttribute("aria-label",i)),this.attrs&&Object.keys(this.attrs).forEach(function(l){o.setAttribute(l,this.attrs[l])},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,l;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("|"),l=this.window.getComputedStyle(o,null).getPropertyValue(this.style.prop),a.forEach(function(s){this.knownState||(r=l.indexOf(s)!==-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>&bull;</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>&rarr;</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>&larr;</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>&ldquo;</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:"&#10003;",formCloseLabel:"&times;",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 l=o.buttonClass?o.buttonClass.split(" "):[];a.checked=l.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="",l=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,s=o.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),f=s[1],h=s[2],v=s[3];if(l.test(o))return"tel:"+o;if(!i){var b=f.split("/")[0];(b.match(/.+(\.|:).+/)||b==="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(),l=this.diffLeft,s=this.diffTop,f=this.getEditorOption("elementsContainer"),h=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,v={},b,w,O,E,S;b=this.anchorPreview.offsetWidth/2;var M=this.base.getExtensionByName("toolbar");M&&(l=M.diffLeft,s=M.diffTop),w=l-b,h?(E=f.getBoundingClientRect(),["top","left"].forEach(function(C){v[C]=a[C]-E[C]}),v.width=a.width,v.height=a.height,a=v,r=E.width,S=f.scrollTop):S=this.window.pageYOffset,O=a.left+a.width/2,S+=i+a.top+a.height-s-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(S)+"px",this.anchorPreview.style.right="initial",O<b?(this.anchorPreview.style.left=w+b+"px",this.anchorPreview.style.right="initial"):r-O<b?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=w+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 l(f){return!e.util.getClosestTag(f,"a")}var s=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 b=0;b<h.length;b++)v=this.removeObsoleteAutoLinkSpans(h[b])||v,v=this.performLinkingWithinElement(h[b])||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,b=0;b<h.length;b++){var w=h[b].textContent;if(w.indexOf("://")===-1&&(w=e.util.ensureUrlHasProtocol(w)),h[b].getAttribute("data-href")!==w&&l(h[b])){v=!0;var O=w.replace(/\s+$/,"");if(h[b].getAttribute("data-href")===O){var E=w.length-O.length,S=e.util.splitOffDOMTree(h[b],this.splitTextBeforeEnd(h[b],E));h[b].parentNode.insertBefore(S,h[b].nextSibling)}else e.util.unwrap(h[b],this.document)}}return v},splitTextBeforeEnd:function(f,h){for(var v=this.document.createTreeWalker(f,NodeFilter.SHOW_TEXT,null,!1),b=!0;b;)b=v.lastChild()!==null;for(var w,O,E;h>0&&E!==null;)w=v.currentNode,O=w.nodeValue,O.length>h?(E=w.splitText(O.length-h),h=0):(E=v.previousNode(),h-=O.length);return E},performLinkingWithinElement:function(f){for(var h=this.findLinkableText(f),v=!1,b=0;b<h.length;b++){var w=e.util.findOrCreateMatchingTextNodes(this.document,f,h[b]);this.shouldNotLink(w)||this.createAutoLink(w,h[b].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(b){return b.nodeName.toLowerCase()==="a"||b.getAttribute&&b.getAttribute("data-auto-link")==="true"});return h},findLinkableText:function(f){for(var h=f.textContent,v=null,b=[];(v=a.exec(h))!==null;){var w=!0,O=v.index+v[0].length;w=(v.index===0||n.indexOf(h[v.index-1])!==-1)&&(O===h.length||n.indexOf(h[O])!==-1),w=w&&(v[0].indexOf("/")!==-1||i.test(v[0].split(".").pop().split("?").shift())),w&&b.push({href:v[0],start:v.index,end:O})}return b},createAutoLink:function(f,h){h=e.util.ensureUrlHasProtocol(h);var v=e.util.createLink(this.document,f,h,this.getEditorOption("targetBlank")?"_blank":null),b=this.document.createElement("span");for(b.setAttribute("data-auto-link","true"),b.setAttribute("data-href",h),v.insertBefore(b,v.firstChild);v.childNodes.length>1;)b.appendChild(v.childNodes[1])}});e.extensions.autoLink=s})(),(function(){var n="medium-editor-dragover";function o(i){var a=e.util.getContainerEditorElement(i),l=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+n));l.forEach(function(s){s.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(l){this.isAllowedFile(l)&&l.type.match("image")&&this.insertImageFile(l)},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(l){var s=this.document.createElement("img");s.src=l.target.result,e.util.insertHTMLCommand(this.document,s.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,l=!!o.altKey;this.keys[r].forEach(function(s){s.meta===i&&s.shift===a&&(s.alt===l||s.alt===void 0)&&(o.preventDefault(),o.stopPropagation(),typeof s.command=="function"?s.command.apply(this):s.command!==!1&&this.execAction(s.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"&#xB1;",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"),l=o.createElement("a"),s;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++)s=o.createElement("option"),s.innerHTML=this.fonts[f],s.value=this.fonts[f],i.appendChild(s);return i.className="medium-editor-toolbar-select",r.appendChild(i),this.on(i,"change",this.handleFontChange.bind(this)),l.setAttribute("href","#"),l.className="medium-editor-toobar-save",l.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"&#10003;",r.appendChild(l),this.on(l,"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>':"&times;",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:"&#xB1;",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"),l=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)),l.setAttribute("href","#"),l.className="medium-editor-toobar-save",l.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"&#10003;",r.appendChild(l),this.on(l,"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>':"&times;",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(/&lt;(\/?)(i|b|a)&gt;/gi),"<$1$2>"],[new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|"|“|”)(((?!&quot;|&rdquo;|&ldquo;|"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|"|“|”)(?:(?!&gt;).)*&gt;/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 l(f,h,v){var b=f.clipboardData||h.clipboardData||v.dataTransfer,w={};if(!b)return w;if(b.getData){var O=b.getData("Text");O&&O.length>0&&(w["text/plain"]=O)}if(b.types)for(var E=0;E<b.types.length;E++){var S=b.types[E];w[S]=b.getData(S)}return w}var s=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=l(f,this.window,this.document),b=v["text/html"],w=v["text/plain"];this.window.clipboardData&&f.clipboardData===void 0&&!b&&(b=w),(b||w)&&(f.preventDefault(),this.doPaste(b,w,h))}},doPaste:function(f,h,v){var b,w="",O;if(this.cleanPastedHTML&&f)return this.cleanPaste(f);if(h){if(this.getEditorOption("disableReturn")||v&&v.getAttribute("data-disable-return"))w=e.util.htmlEntities(h);else if(b=h.split(/[\r\n]+/g),b.length>1)for(O=0;O<b.length;O+=1)b[O]!==""&&(w+="<p>"+e.util.htmlEntities(b[O])+"</p>");else w=e.util.htmlEntities(b[0]);e.util.insertHTMLCommand(this.document,w)}},handlePasteBinPaste:function(f){if(f.defaultPrevented){this.removePasteBin();return}var h=l(f,this.window,this.document),v=h["text/html"],b=h["text/plain"],w=r;if(!this.cleanPastedHTML||v){f.preventDefault(),this.removePasteBin(),this.doPaste(v,b,w),this.trigger("editablePaste",{currentTarget:w,target:w},w);return}setTimeout((function(){this.cleanPastedHTML&&(v=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(v,b,w),this.trigger("editablePaste",{currentTarget:w,target:w},w)}).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),b=this.window.pageYOffset;r=f,v&&(h=v.getClientRects(),h.length?b+=h[0].top:v.startContainer.getBoundingClientRect!==void 0?b+=v.startContainer.getBoundingClientRect().top:b+=v.getBoundingClientRect().top),o=v;var w=this.document.createElement("div");w.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),w.setAttribute("style","border: 1px red solid; position: absolute; top: "+b+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),w.setAttribute("contentEditable",!0),w.innerHTML=n,this.document.body.appendChild(w),this.on(w,"focus",i),this.on(w,"focusin",i),this.on(w,"focusout",i),w.focus(),e.selection.selectNode(w,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(w,"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,b,w,O=/<p|<br|<div/.test(f),E=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(h=0;h<E.length;h+=1)f=f.replace(E[h][0],E[h][1]);if(!O)return this.pasteHTML(f);for(b=this.document.createElement("div"),b.innerHTML="<p>"+f.split("<br><br>").join("</p><p>")+"</p>",v=b.querySelectorAll("a,p,div,br"),h=0;h<v.length;h+=1)switch(w=v[h],w.innerHTML=w.innerHTML.replace(/\n/gi," "),w.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(w);break;case"br":this.filterLineBreak(w);break}this.pasteHTML(b.innerHTML)},pasteHTML:function(f,h){h=e.util.defaults({},h,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var v,b,w,O,E=this.document.createDocumentFragment();for(E.appendChild(this.document.createElement("body")),O=E.querySelector("body"),O.innerHTML=f,this.cleanupSpans(O),v=O.querySelectorAll("*"),w=0;w<v.length;w+=1)b=v[w],b.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(b),e.util.cleanupAttrs(b,h.cleanAttrs),e.util.cleanupTags(b,h.cleanTags),e.util.unwrapTags(b,h.unwrapTags);e.util.insertHTMLCommand(this.document,O.innerHTML.replace(/&nbsp;/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,b,w=f.querySelectorAll(".replace-with"),O=function(E){return E&&E.nodeName!=="#text"&&E.getAttribute("contenteditable")==="false"};for(h=0;h<w.length;h+=1)v=w[h],b=this.document.createElement(v.classList.contains("bold")?"b":"i"),v.classList.contains("bold")&&v.classList.contains("italic")?b.innerHTML="<i>"+v.innerHTML+"</i>":b.innerHTML=v.innerHTML,v.parentNode.replaceChild(b,v);for(w=f.querySelectorAll("span"),h=0;h<w.length;h+=1){if(v=w[h],e.util.traverseUp(v,O))return!1;e.util.unwrap(v,this.document)}}});e.extensions.paste=s})(),(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,l,s,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"?(s=h,f=null):(s=h.name,f=h),l=this.base.addBuiltInExtension(s,f),l&&typeof l.getButton=="function"&&(i=l.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,l=function(s){typeof s.checkState=="function"?s.checkState(a):typeof s.isActive=="function"&&typeof s.isAlreadyApplied=="function"&&typeof s.setActive=="function"&&!s.isActive()&&s.isAlreadyApplied(a)&&s.setActive()};if(i&&(this.forEachExtension(function(s){if(typeof s.queryCommandState=="function"&&(r=s.queryCommandState(),r!==null)){r&&typeof s.setActive=="function"&&s.setActive();return}o.push(s)}),a=e.selection.getSelectedParentElement(i),!!this.getEditorElements().some(function(s){return e.util.isDescendant(s,a,!0)})))for(;a&&(o.forEach(l),!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(),l=o.getBoundingClientRect(),s=l.top+r,f=l.left+l.width/2,h=a.offsetHeight,v=a.offsetWidth,b=v/2,w;switch(this.sticky?r>s+o.offsetHeight-h-this.stickyTopOffset?(a.style.top=s+o.offsetHeight-h+"px",a.classList.remove("medium-editor-sticky-toolbar")):r>s-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=s-h+"px"):a.style.top=s-h+"px",this.align){case"left":w=l.left;break;case"right":w=l.right-v;break;case"center":w=f-b;break}w<0?w=0:w+v>i&&(w=i-Math.ceil(v)-1),a.style.left=w+"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,l=this.getToolbarElement(),s=l.offsetHeight,f=l.offsetWidth,h=f/2,v=50,b=this.diffLeft-h,w=this.getEditorOption("elementsContainer"),O=["absolute","fixed"].indexOf(window.getComputedStyle(w).getPropertyValue("position"))>-1,E={},S={},M,C;O?(C=w.getBoundingClientRect(),["top","left"].forEach(function($){S[$]=i[$]-C[$]}),S.width=i.width,S.height=i.height,i=S,a=C.width,E.top=w.scrollTop):E.top=this.window.pageYOffset,M=i.left+i.width/2,E.top+=i.top-s,i.top<v?(l.classList.add("medium-toolbar-arrow-over"),l.classList.remove("medium-toolbar-arrow-under"),E.top+=v+i.height-this.diffTop):(l.classList.add("medium-toolbar-arrow-under"),l.classList.remove("medium-toolbar-arrow-over"),E.top+=this.diffTop),M<h?(E.left=b+h,E.right="initial"):a-M<h?(E.left="auto",E.right=0):(E.left=b+M,E.right="initial"),["top","left","right"].forEach(function($){l.style[$]=E[$]+(isNaN(E[$])?"":"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 l,s;l=new FileReader,l.readAsDataURL(a),s="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+s+'" />'),l.onload=(function(){var f=this.document.getElementById(s);f&&(f.removeAttribute("id"),f.removeAttribute("class"),f.src=l.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 l(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 s(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 b(W,Q){return Object.keys(Q).forEach(function(J){W[J]===void 0&&(W[J]=Q[J])}),W}function w(W,Q,J){var ie={window:J.options.contentWindow,document:J.options.ownerDocument,base:J};return W=b(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 E(){return O.call(this)?this.options.anchorPreview!==!1:!1}function S(){return this.options.placeholder!==!1}function M(){return this.options.autoLink!==!1}function C(){return this.options.imageDragging!==!1}function $(){return this.options.keyboardCommands!==!1}function D(){return!this.options.extensions.imageDragging}function k(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,ke=Se.length;Ae<ke;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 B(W,Q){if(!W.getAttribute("data-medium-editor-element")){W.nodeName.toLowerCase()==="textarea"&&(W=k.call(this,W),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=l.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 F(){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 I(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(Se){Se!=="toolbar"&&this.options.extensions[Se]&&this.extensions.push(w(this.options.extensions[Se],Se,this))},this),D.call(this)){var W=this.options.fileDragging;W||(W={},C.call(this)||(W.allowedTypes=[])),this.addBuiltInExtension("fileDragging",W)}var Q={paste:!0,"anchor-preview":E.call(this),autoLink:M.call(this),keyboardCommands:$.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(w(J,"toolbar",this))}function V(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 ke=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,ke)}if(W==="html"){var De=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,De)}if(ie.exec(W)){var ze=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)),ze}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=V.call(this,this.defaults,Q),this.origElements=W,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(s.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,I.call(this),F.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(w(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),ke=Ae.commonAncestorContainer,De,ze,Ye,Be;if(Ae.endContainer.nodeType===3&&Ae.startContainer.nodeType!==3&&Ae.startOffset===0&&Ae.startContainer.firstChild===Ae.endContainer&&(ke=Ae.endContainer),ze=e.util.getClosestBlockContainer(Ae.startContainer),Ye=e.util.getClosestBlockContainer(Ae.endContainer),ke.nodeType!==3&&ke.textContent.length!==0&&ze===Ye){var Je=ze||Q,gt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),De=this.exportSelection(),gt.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 se=this.exportSelection();Be=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,gt,{start:De.start-se.start,end:De.end-se.start,editableElementIndex:De.editableElementIndex}),Be.length===0&&(gt=this.options.ownerDocument.createDocumentFragment(),gt.appendChild(ke.cloneNode(!0)),Be=[gt.firstChild.firstChild,gt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Be,ie.trim());var Ze=(gt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,gt.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,le=this.elements.length;pe<le;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=B.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 gne=mne();const D0=Z_(gne);/*!
* 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 DM=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},jM=(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 l=e[Symbol.iterator](),s;!(r=(s=l.next()).done)&&(o.push(s.value),!(n&&o.length===n));r=!0);}catch(f){i=!0,a=f}finally{try{!r&&l.return&&l.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 gR(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){DM(this,t);var i=this;function a(s){if(s.startsWith("hsl")){var f=s.match(/([\-\d\.e]+)/g).map(Number),h=j0(f,4),v=h[0],b=h[1],w=h[2],O=h[3];O===void 0&&(O=1),v/=360,b/=100,w/=100,i.hsla=[v,b,w,O]}else if(s.startsWith("rgb")){var E=s.match(/([\-\d\.e]+)/g).map(Number),S=j0(E,4),M=S[0],C=S[1],$=S[2],D=S[3];D===void 0&&(D=1),i.rgba=[M,C,$,D]}else s.startsWith("#")?i.rgba=t.hexToRgb(s):i.rgba=t.nameToRgb(s)||t.hexToRgb(s)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(o===void 0){var l=e&&""+e;l&&a(l.toLowerCase())}else this.rgba=[e,n,o,r===void 0?1:r]}return jM(t,[{key:"printRGB",value:function(n){var o=n?this.rgba:this.rgba.slice(0,3),r=o.map(function(i,a){return gR(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(l,s){return gR(l*o[s],s===3?3:1)+r[s]});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],l=o[3];r/=255,i/=255,a/=255;var s=Math.max(r,i,a),f=Math.min(r,i,a),h=void 0,v=void 0,b=(s+f)/2;if(s===f)h=v=0;else{var w=s-f;switch(v=b>.5?w/(2-s-f):w/(s+f),s){case r:h=(i-a)/w+(i<a?6:0);break;case i:h=(a-r)/w+2;break;case a:h=(r-i)/w+4;break}h/=6}return[h,v,b,l]}},{key:"hslToRgb",value:function(n){var o=j0(n,4),r=o[0],i=o[1],a=o[2],l=o[3],s=void 0,f=void 0,h=void 0;if(i===0)s=f=h=a;else{var v=function(S,M,C){return C<0&&(C+=1),C>1&&(C-=1),C<.16666666666666666?S+(M-S)*6*C:C<.5?M:C<.6666666666666666?S+(M-S)*(.6666666666666666-C)*6:S},b=a<.5?a*(1+i):a+i-a*i,w=2*a-b;s=v(w,b,r+1/3),f=v(w,b,r),h=v(w,b,r-1/3)}var O=[s*255,f*255,h*255].map(Math.round);return O[3]=l,O}}]),t})(),bne=(function(){function t(){DM(this,t),this._events=[]}return jM(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 mS(t,e,n){var o=!1;function r(s,f,h){return Math.max(f,Math.min(s,h))}function i(s,f,h){if(h&&(o=!0),!!o){s.preventDefault();var v=e.getBoundingClientRect(),b=v.width,w=v.height,O=f.clientX,E=f.clientY,S=r(O-v.left,0,b),M=r(E-v.top,0,w);n(S/b,M/w)}}function a(s,f){var h=s.buttons===void 0?s.which:s.buttons;h===1?i(s,s,f):o=!1}function l(s,f){s.touches.length===1?i(s,s.touches[0],f):o=!1}t.add(e,"mousedown",function(s){a(s,!0)}),t.add(e,"touchstart",function(s){l(s,!0)}),t.add(window,"mousemove",a),t.add(e,"touchmove",l),t.add(window,"mouseup",function(s){o=!1}),t.add(e,"touchend",function(s){o=!1}),t.add(e,"touchcancel",function(s){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,q3="keydown",L0="mousedown",gS="focusin";function Rd(t,e){return(e||document).querySelector(t)}function One(t){t.preventDefault(),t.stopPropagation()}function yS(t,e,n,o,r){t.add(e,q3,function(i){n.indexOf(i.key)>=0&&o(i)})}var K3=(function(){function t(e){DM(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 jM(t,[{key:"setOptions",value:function(n){var o=this;if(!n)return;var r=this.settings;function i(f,h,v){for(var b in f)h[b]=f[b]}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 l=r.parent;if(l&&r.popup&&!this._popupInited){var s=function(h){return o.openHandler(h)};this._events.add(l,"click",s),yS(this._events,l,[" ","Spacebar","Enter"],s),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===q3?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===gS){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=Rd(".picker_hue",i),this._domSL=Rd(".picker_sl",i),this._domA=Rd(".picker_alpha",i),this._domEdit=Rd(".picker_editor input",i),this._domSample=Rd(".picker_sample",i),this._domOkay=Rd(".picker_done button",i),this._domCancel=Rd(".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()}),mS(i,this._domH,function(f,h){return o._setHSLA(f)}),mS(i,this._domSL,function(f,h){return o._setHSLA(null,f,1-h)}),this.settings.alpha&&mS(i,this._domA,function(f,h){return o._setHSLA(null,null,null,1-h)});var l=this._domEdit;a(l,"input",function(f){o._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(l,"focus",function(f){var h=this;h.selectionStart===h.selectionEnd&&h.select()}),this._ifPopup(function(){var f=function(b){return n.closeHandler(b)};a(window,L0,f),a(window,gS,f),yS(i,r,["Esc","Escape"],f);var h=function(b){n.__containedEvent=b.timeStamp};a(r,L0,h),a(r,gS,h),a(n._domCancel,"click",f)});var s=function(h){n._ifPopup(function(){return n.closeHandler(h)}),n.onDone&&n.onDone(n.colour)};a(this._domOkay,"click",s),yS(i,r,["Enter"],s)}},{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 l=this.colour,s=l.hsla;[n,o,r,i].forEach(function(f,h){(f||f===0)&&(s[h]=f)}),l.hsla=s,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(l)}},{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,l=o.hslaString,s=this._domH,f=this._domSL,h=this._domA,v=Rd(".picker_selector",s),b=Rd(".picker_selector",f),w=Rd(".picker_selector",h);function O(B,F,I){F.style.left=I*100+"%"}function E(B,F,I){F.style.top=I*100+"%"}O(s,v,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,O(f,b,r[1]),E(f,b,1-r[2]),f.style.color=a,E(h,w,1-r[3]);var S=a,M=S.replace("hsl","hsla").replace(")",", 0)"),C="linear-gradient("+[S,M]+")";if(this._domA.style.background=C+", "+Ene,!n.fromEditor){var $=this.settings.editorFormat,D=this.settings.alpha,k=void 0;switch($){case"rgb":k=o.printRGB(D);break;case"hsl":k=o.printHSL(D);break;default:k=o.printHex(D)}this._domEdit.value=k}this._domSample.style.color=l}},{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),K3.StyleElement=_S}var bS={exports:{}},yR;function Z3(){return yR||(yR=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"],l=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],s=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function f(se,Ze){var pe=typeof se[Ze];return pe==o||!!(pe==n&&se[Ze])||pe=="unknown"}function h(se,Ze){return!!(typeof se[Ze]==n&&se[Ze])}function v(se,Ze){return typeof se[Ze]!=r}function b(se){return function(Ze,pe){for(var le=pe.length;le--;)if(!se(Ze,pe[le]))return!1;return!0}}var w=b(f),O=b(h),E=b(v);function S(se){return se&&w(se,s)&&E(se,l)}function M(se){return h(se,"body")?se.body:se.getElementsByTagName("body")[0]}var C=[].forEach?function(se,Ze){se.forEach(Ze)}:function(se,Ze){for(var pe=0,le=se.length;pe<le;++pe)Ze(se[pe],pe)},$={},D=typeof window!=r&&typeof document!=r,k={isHostMethod:f,isHostObject:h,isHostProperty:v,areHostMethods:w,areHostObjects:O,areHostProperties:E,isTextRange:S,getBody:M,forEach:C},B={version:"1.3.2",initialized:!1,isBrowser:D,supported:!0,util:k,features:{},modules:$,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==r?!0:rangyAutoInitialize}};function F(se){typeof console!=r&&f(console,"log")&&console.log(se)}function I(se,Ze){D&&Ze?alert(se):F(se)}function V(se){B.initialized=!0,B.supported=!1,I("Rangy is not supported in this environment. Reason: "+se,B.config.alertOnFail)}B.fail=V;function z(se){I("Rangy warning: "+se,B.config.alertOnWarn)}B.warn=z;var X;({}).hasOwnProperty?(k.extend=X=function(se,Ze,pe){var le,we;for(var $e in Ze)$e==="__proto__"||$e==="constructor"||$e==="prototype"||Ze.hasOwnProperty($e)&&(le=se[$e],we=Ze[$e],pe&&le!==null&&typeof le=="object"&&we!==null&&typeof we=="object"&&X(le,we,!0),se[$e]=we);return Ze.hasOwnProperty("toString")&&(se.toString=Ze.toString),se},k.createOptions=function(se,Ze){var pe={};return X(pe,Ze),se&&X(pe,se),pe}):V("hasOwnProperty not supported"),D||V("Rangy can only run in a browser"),(function(){var se;if(D){var Ze=document.createElement("div");Ze.appendChild(document.createElement("span"));var pe=[].slice;try{pe.call(Ze.childNodes,0)[0].nodeType==1&&(se=function(le){return pe.call(le,0)})}catch{}}se||(se=function(le){for(var we=[],$e=0,rt=le.length;$e<rt;++$e)we[$e]=le[$e];return we}),k.toArray=se})();var Y;D&&(f(document,"addEventListener")?Y=function(se,Ze,pe){se.addEventListener(Ze,pe,!1)}:f(document,"attachEvent")?Y=function(se,Ze,pe){se.attachEvent("on"+Ze,pe)}:V("Document does not have required addEventListener or attachEvent method"),k.addListener=Y);var W=[];function Q(se){return se.message||se.description||String(se)}function J(){if(!(!D||B.initialized)){var se,Ze=!1,pe=!1;f(document,"createRange")&&(se=document.createRange(),w(se,a)&&E(se,i)&&(Ze=!0));var le=M(document);if(!le||le.nodeName.toLowerCase()!="body"){V("No body element found");return}if(le&&f(le,"createTextRange")&&(se=le.createTextRange(),S(se)&&(pe=!0)),!Ze&&!pe){V("Neither Range nor TextRange are available");return}B.initialized=!0,B.features={implementsDomRange:Ze,implementsTextRange:pe};var we,$e;for(var rt in $)(we=$[rt])instanceof De&&we.init(we,B);for(var pt=0,Lt=W.length;pt<Lt;++pt)try{W[pt](B)}catch(Jt){$e="Rangy init listener threw an exception. Continuing. Detail: "+Q(Jt),F($e)}}}function ie(se,Ze,pe){pe&&(se+=" in module "+pe.name),B.warn("DEPRECATED: "+se+" is deprecated. Please use "+Ze+" instead.")}function Se(se,Ze,pe,le){se[Ze]=function(){return ie(Ze,pe,le),se[pe].apply(se,k.toArray(arguments))}}k.deprecationNotice=ie,k.createAliasForDeprecatedMethod=Se,B.init=J,B.addInitListener=function(se){B.initialized?se(B):W.push(se)};var Ae=[];B.addShimListener=function(se){Ae.push(se)};function ke(se){se=se||window,J();for(var Ze=0,pe=Ae.length;Ze<pe;++Ze)Ae[Ze](se)}D&&(B.shim=B.createMissingNativeApi=ke,Se(B,"createMissingNativeApi","shim"));function De(se,Ze,pe){this.name=se,this.dependencies=Ze,this.initialized=!1,this.supported=!1,this.initializer=pe}De.prototype={init:function(){for(var se=this.dependencies||[],Ze=0,pe=se.length,le,we;Ze<pe;++Ze){if(we=se[Ze],le=$[we],!le||!(le instanceof De))throw new Error("required module '"+we+"' not found");if(le.init(),!le.supported)throw new Error("required module '"+we+"' not supported")}this.initializer(this)},fail:function(se){throw this.initialized=!0,this.supported=!1,new Error(se)},warn:function(se){B.warn("Module "+this.name+": "+se)},deprecationNotice:function(se,Ze){B.warn("DEPRECATED: "+se+" in module "+this.name+" is deprecated. Please use "+Ze+" instead")},createError:function(se){return new Error("Error in Rangy "+this.name+" module: "+se)}};function ze(se,Ze,pe){var le=new De(se,Ze,function(we){if(!we.initialized){we.initialized=!0;try{pe(B,we),we.supported=!0}catch(rt){var $e="Module '"+se+"' failed to load: "+Q(rt);F($e),rt.stack&&F(rt.stack)}}});return $[se]=le,le}B.createModule=function(se){var Ze,pe;arguments.length==2?(Ze=arguments[1],pe=[]):(Ze=arguments[2],pe=arguments[1]);var le=ze(se,pe,Ze);B.initialized&&B.supported&&le.init()},B.createCoreModule=function(se,Ze,pe){ze(se,Ze,pe)};function Ye(){}B.RangePrototype=Ye,B.rangePrototype=new Ye;function Be(){}B.selectionPrototype=new Be,B.createCoreModule("DomUtil",[],function(se,Ze){var pe="undefined",le=se.util,we=le.getBody;le.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||Ze.fail("document missing a Node creation method"),le.isHostMethod(document,"getElementsByTagName")||Ze.fail("document missing getElementsByTagName method");var $e=document.createElement("div");le.areHostMethods($e,["insertBefore","appendChild","cloneNode"])||Ze.fail("Incomplete Element implementation"),le.isHostProperty($e,"innerHTML")||Ze.fail("Element is missing innerHTML property");var rt=document.createTextNode("test");le.areHostMethods(rt,["splitText","deleteData","insertData","appendData","cloneNode"])||Ze.fail("Incomplete Text Node implementation");var pt=function(ut,vn){for(var In=ut.length;In--;)if(ut[In]===vn)return!0;return!1};function Lt(ut){var vn;return typeof ut.namespaceURI==pe||(vn=ut.namespaceURI)===null||vn=="http://www.w3.org/1999/xhtml"}function Jt(ut){var vn=ut.parentNode;return vn.nodeType==1?vn:null}function en(ut){for(var vn=0;ut=ut.previousSibling;)++vn;return vn}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,vn){var In=[],lr;for(lr=ut;lr;lr=lr.parentNode)In.push(lr);for(lr=vn;lr;lr=lr.parentNode)if(pt(In,lr))return lr;return null}function ae(ut,vn,In){for(var lr=In?vn:vn.parentNode;lr;){if(lr===ut)return!0;lr=lr.parentNode}return!1}function re(ut,vn){return ae(ut,vn,!0)}function je(ut,vn,In){for(var lr,wo=In?ut:ut.parentNode;wo;){if(lr=wo.parentNode,lr===vn)return wo;wo=lr}return null}function vt(ut){var vn=ut.nodeType;return vn==3||vn==4||vn==8}function q(ut){if(!ut)return!1;var vn=ut.nodeType;return vn==3||vn==8}function Pt(ut,vn){var In=vn.nextSibling,lr=vn.parentNode;return In?lr.insertBefore(ut,In):lr.appendChild(ut),ut}function Rt(ut,vn,In){var lr=ut.cloneNode(!1);if(lr.deleteData(0,vn),ut.deleteData(vn,ut.length-vn),Pt(lr,ut),In)for(var wo=0,oo;oo=In[wo++];)oo.node==ut&&oo.offset>vn?(oo.node=lr,oo.offset-=vn):oo.node==ut.parentNode&&oo.offset>en(ut)&&++oo.offset;return lr}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 kn(ut){var vn=Gt(ut);if(typeof vn.defaultView!=pe)return vn.defaultView;if(typeof vn.parentWindow!=pe)return vn.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 Pe(ut){return ut&&le.isHostMethod(ut,"setTimeout")&&le.isHostObject(ut,"document")}function Ke(ut,vn,In){var lr;if(ut?le.isHostProperty(ut,"nodeType")?lr=ut.nodeType==1&&ut.tagName.toLowerCase()=="iframe"?qt(ut):Gt(ut):Pe(ut)&&(lr=ut.document):lr=document,!lr)throw vn.createError(In+"(): Parameter must be a Window object or DOM node");return lr}function Le(ut){for(var vn;vn=ut.parentNode;)ut=vn;return ut}function dt(ut,vn,In,lr){var wo,oo,ta,Ca,Yi;if(ut==In)return vn===lr?0:vn<lr?-1:1;if(wo=je(In,ut,!0))return vn<=en(wo)?-1:1;if(wo=je(ut,In,!0))return en(wo)<lr?-1:1;if(oo=it(ut,In),!oo)throw new Error("comparePoints error: nodes have no common ancestor");if(ta=ut===oo?oo:je(ut,oo,!0),Ca=In===oo?oo:je(In,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 vn;try{return vn=ut.parentNode,!1}catch{return!0}}(function(){var ut=document.createElement("b");ut.innerHTML="1";var vn=ut.firstChild;ut.innerHTML="<br />",At=Tt(vn),se.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 vn=ut.id?' id="'+ut.id+'"':"";return"<"+ut.nodeName+vn+">[index:"+en(ut)+",length:"+ut.childNodes.length+"]["+(ut.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return ut.nodeName}function Zn(ut){for(var vn=Gt(ut).createDocumentFragment(),In;In=ut.firstChild;)vn.appendChild(In);return vn}var ao;typeof window.getComputedStyle!=pe?ao=function(ut,vn){return kn(ut).getComputedStyle(ut,null)[vn]}:typeof document.documentElement.currentStyle!=pe?ao=function(ut,vn){return ut.currentStyle?ut.currentStyle[vn]:""}:Ze.fail("No means of obtaining computed style properties found");function Lo(ut,vn,In){var lr=we(ut),wo=ut.createElement("div");wo.contentEditable=""+!!In,vn&&(wo.innerHTML=vn);var oo=lr.firstChild;return oo?lr.insertBefore(wo,oo):lr.appendChild(wo),wo}function yo(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,vn,In;if(this._current)if(vn=ut.firstChild,vn)this._next=vn;else{for(In=null;ut!==this.root&&!(In=ut.nextSibling);)ut=ut.parentNode;this._next=In}return this._current},detach:function(){this._current=this._next=this.root=null}};function Nn(ut){return new ho(ut)}function qn(ut,vn){this.node=ut,this.offset=vn}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},se.dom={arrayContains:pt,isHtmlNamespace:Lt,parentElement:Jt,getNodeIndex:en,getNodeLength:zt,getCommonAncestor:it,isAncestorOf:ae,isOrIsAncestorOf:re,getClosestAncestorIn:je,isCharacterDataNode:vt,isTextOrCommentNode:q,insertAfter:Pt,splitDataNode:Rt,getDocument:Gt,getWindow:kn,getIframeWindow:On,getIframeDocument:qt,getBody:we,isWindow:Pe,getContentDocument:Ke,getRootContainer:Le,comparePoints:dt,isBrokenNode:Tt,inspectNode:En,getComputedStyleProperty:ao,createTestElement:Lo,removeNode:yo,fragmentFromNodeChildren:Zn,createIterator:Nn,DomPosition:qn},se.DOMException=rr}),B.createCoreModule("DomRange",["DomUtil"],function(se,Ze){var pe=se.dom,le=se.util,we=pe.DomPosition,$e=se.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=se.features.crashyTextNodes,q=pe.removeNode;function Pt(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 kn(ye){return new we(ye.parentNode,pt(ye))}function qt(ye){return new we(ye.parentNode,pt(ye)+1)}function On(ye,ht,fn){var Rn=ye.nodeType==11?ye.firstChild:ye;return rt(ht)?fn==ht.length?pe.insertAfter(ye,ht):ht.parentNode.insertBefore(ye,fn==0?ht:zt(ht,fn)):fn>=ht.childNodes.length?ht.appendChild(ye):ht.insertBefore(ye,ht.childNodes[fn]),Rn}function Pe(ye,ht,fn){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 fn?Rn<=0&&Cn>=0:Rn<0&&Cn>0}function Ke(ye){for(var ht,fn,Rn=Rt(ye.range).createDocumentFragment(),Cn;fn=ye.next();){if(ht=ye.isPartiallySelectedSubtree(),fn=fn.cloneNode(!ht),ht&&(Cn=ye.getSubtreeIterator(),fn.appendChild(Ke(Cn)),Cn.detach()),fn.nodeType==10)throw new $e("HIERARCHY_REQUEST_ERR");Rn.appendChild(fn)}return Rn}function Le(ye,ht,fn){var Rn,Cn;fn=fn||{stop:!1};for(var nr,Mn;nr=ye.next();)if(ye.isPartiallySelectedSubtree()){if(ht(nr)===!1){fn.stop=!0;return}else if(Mn=ye.getSubtreeIterator(),Le(Mn,ht,fn),Mn.detach(),fn.stop)return}else for(Rn=pe.createIterator(nr);Cn=Rn.next();)if(ht(Cn)===!1){fn.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,fn=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");fn.appendChild(ht)}return fn}function Tt(ye,ht,fn){var Rn=!!(ht&&ht.length),Cn,nr=!!fn;Rn&&(Cn=new RegExp("^("+ht.join("|")+")$"));var Mn=[];return Le(new Zn(ye,!1),function(or){if(!(Rn&&!Cn.test(or.nodeType))&&!(nr&&!fn(or))){var sr=ye.startContainer;if(!(or==sr&&rt(sr)&&ye.startOffset==sr.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 fn=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===fn&&!rt(this.sc)?this.sc.childNodes[this.so]:it(this.sc,fn,!0),this._last=this.ec===fn&&!rt(this.ec)?this.ec.childNodes[this.eo-1]:it(this.ec,fn,!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,fn;rt(ye)&&(ye===this.sc||ye===this.ec)?(ht=ye===this.sc?this.so:0,fn=ye===this.ec?this.eo:ye.length,ht!=fn&&ye.deleteData(ht,fn-ht)):ye.parentNode&&q(ye)},isPartiallySelectedSubtree:function(){var ye=this._current;return Pt(ye,this.range)},getSubtreeIterator:function(){var ye;if(this.isSingleCharacterDataNode)ye=this.range.cloneRange(),ye.collapse(!1);else{ye=new li(Rt(this.range));var ht=this._current,fn=ht,Rn=0,Cn=ht,nr=ae(ht);Lt(ht,this.sc)&&(fn=this.sc,Rn=this.so),Lt(ht,this.ec)&&(Cn=this.ec,nr=this.eo),lo(ye,fn,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],yo=[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,fn){for(var Rn,Cn=fn?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(yo),vn=qn([6,10,12]),In=qn([1]);function lr(ye,ht){if(vn(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 Tl=document.createElement("style"),Oo=!1;try{Tl.innerHTML="<b>x</b>",Oo=Tl.firstChild.nodeType==3}catch{}se.features.htmlParsingConforms=Oo;var el=Oo?function(ye){var ht=this.startContainer,fn=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=fn.createElement("body"):Rn=Rn.cloneNode(!1),Rn.innerHTML=ye,pe.fragmentFromNodeChildren(Rn)}:function(ye){var ht=Rt(this),fn=ht.createElement("body");return fn.innerHTML=ye,pe.fragmentFromNodeChildren(fn)};function Ui(ye,ht){Sn(ye);var fn=ye.startContainer,Rn=ye.startOffset,Cn=ye.endContainer,nr=ye.endOffset,Mn=fn===Cn;rt(Cn)&&nr>0&&nr<Cn.length&&zt(Cn,nr,ht),rt(fn)&&Rn>0&&Rn<fn.length&&(fn=zt(fn,Rn,ht),Mn?(nr-=Rn,Cn=fn):Cn==fn.parentNode&&nr>=pt(fn)&&nr++,Rn=0),ye.setStartAndEnd(fn,Rn,Cn,nr)}function gr(ye){Sn(ye);var ht=ye.commonAncestorContainer.parentNode.cloneNode(!1);return ht.appendChild(ye.cloneContents()),ht.innerHTML}var ms=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],pa=0,qi=1,Na=2,as=3,gs=0,Cl=1,ys=2,tl=3;le.extend(se.rangePrototype,{compareBoundaryPoints:function(ye,ht){Sn(this),ta(this.startContainer,ht.startContainer);var fn,Rn,Cn,nr,Mn=ye==as||ye==pa?"start":"end",or=ye==qi||ye==pa?"start":"end";return fn=this[Mn+"Container"],Rn=this[Mn+"Offset"],Cn=ht[or+"Container"],nr=ht[or+"Offset"],en(fn,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 fn=new Zn(this,!0);return ye=Ke(fn),fn.detach(),ye},canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var ye=new Zn(this,!0),ht=ye._first&&Pt(ye._first,this)||ye._last&&Pt(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 li(Rt(this)),ht=ms.length,fn;ht--;)fn=ms[ht],ye[fn]=this[fn];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=[],fn=new Zn(this,!0);return Le(fn,function(Rn){(Rn.nodeType==3||Rn.nodeType==4)&&ht.push(Rn.data)}),fn.detach(),ht.join("")},compareNode:function(ye){Sn(this);var ht=ye.parentNode,fn=pt(ye);if(!ht)throw new $e("NOT_FOUND_ERR");var Rn=this.comparePoint(ht,fn),Cn=this.comparePoint(ht,fn+1);return Rn<0?Cn>0?ys:gs:Cn>0?Cl:tl},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:el,toHtml:function(){return gr(this)},intersectsNode:function(ye,ht){if(Sn(this),je(ye)!=Gt(this))return!1;var fn=ye.parentNode,Rn=pt(ye);if(!fn)return!0;var Cn=en(fn,Rn,this.endContainer,this.endOffset),nr=en(fn,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 Pe(this,ye,!1)},intersectsOrTouchesRange:function(ye){return Pe(this,ye,!0)},intersection:function(ye){if(this.intersectsRange(ye)){var ht=en(this.startContainer,this.startOffset,ye.startContainer,ye.startOffset),fn=en(this.endContainer,this.endOffset,ye.endContainer,ye.endOffset),Rn=this.cloneRange();return ht==-1&&Rn.setStart(ye.startContainer,ye.startOffset),fn==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)==tl},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 fn=ht.getNodes([3]);if(fn.length>0){ht.setStart(fn[0],0);var Rn=fn.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),fn=se.createRange(ht);ye=ye||pe.getBody(ht),fn.selectNodeContents(ye);var Rn=this.intersection(fn),Cn=0,nr=0;return Rn&&(fn.setEnd(Rn.startContainer,Rn.startOffset),Cn=fn.toString().length,nr=Cn+Rn.toString().length),{start:Cn,end:nr,containerNode:ye}},moveToBookmark:function(ye){var ht=ye.containerNode,fn=0;this.setStart(ht,0),this.collapse(!0);for(var Rn=[ht],Cn,nr=!1,Mn=!1,or,sr,qr;!Mn&&(Cn=Rn.pop());)if(Cn.nodeType==3)or=fn+Cn.length,!nr&&ye.start>=fn&&ye.start<=or&&(this.setStart(Cn,ye.start-fn),nr=!0),nr&&ye.end>=fn&&ye.end<=or&&(this.setEnd(Cn,ye.end-fn),Mn=!0),fn=or;else for(qr=Cn.childNodes,sr=qr.length;sr--;)Rn.push(qr[sr])},getName:function(){return"DomRange"},equals:function(ye){return li.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=as,ye.NODE_BEFORE=gs,ye.NODE_AFTER=Cl,ye.NODE_BEFORE_AND_AFTER=ys,ye.NODE_INSIDE=tl}function mt(ye){ve(ye),ve(ye.prototype)}function cn(ye,ht){return function(){Sn(this);var fn=this.startContainer,Rn=this.startOffset,Cn=this.commonAncestorContainer,nr=new Zn(this,!0),Mn,or;fn!==Cn&&(Mn=it(fn,Cn,!0),or=qt(Mn),fn=or.node,Rn=or.offset),Le(nr,Ca),nr.reset();var sr=ye(nr);return nr.detach(),ht(this,fn,Rn,fn,Rn),sr}}function Kn(ye,ht){function fn(Mn,or){return function(sr){wo(sr,ao),wo(je(sr),Lo);var qr=(Mn?kn:qt)(sr);(or?Rn:Cn)(this,qr.node,qr.offset)}}function Rn(Mn,or,sr){var qr=Mn.endContainer,na=Mn.endOffset;(or!==Mn.startContainer||sr!==Mn.startOffset)&&((je(or)!=je(qr)||en(or,sr,qr,na)==1)&&(qr=or,na=sr),ht(Mn,or,sr,qr,na))}function Cn(Mn,or,sr){var qr=Mn.startContainer,na=Mn.startOffset;(or!==Mn.endContainer||sr!==Mn.endOffset)&&((je(or)!=je(qr)||en(or,sr,qr,na)==-1)&&(qr=or,na=sr),ht(Mn,qr,na,or,sr))}var nr=function(){};nr.prototype=se.rangePrototype,ye.prototype=new nr,le.extend(ye.prototype,{setStart:function(Mn,or){lr(Mn,!0),oo(Mn,or),Rn(this,Mn,or)},setEnd:function(Mn,or){lr(Mn,!0),oo(Mn,or),Cn(this,Mn,or)},setStartAndEnd:function(){var Mn=arguments,or=Mn[0],sr=Mn[1],qr=or,na=sr;switch(Mn.length){case 3:na=Mn[2];break;case 4:qr=Mn[2],na=Mn[3];break}lr(or,!0),oo(or,sr),lr(qr,!0),oo(qr,na),ht(this,or,sr,qr,na)},setBoundary:function(Mn,or,sr){this["set"+(sr?"Start":"End")](Mn,or)},setStartBefore:fn(!0,!0),setStartAfter:fn(!1,!0),setEndBefore:fn(!0,!1),setEndAfter:fn(!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){lr(Mn,!0),ht(this,Mn,0,Mn,ae(Mn))},selectNode:function(Mn){lr(Mn,!1),wo(Mn,ao);var or=kn(Mn),sr=qt(Mn);ht(this,or.node,or.offset,sr.node,sr.offset)},extractContents:cn(At,ht),deleteContents:cn(dt,ht),canSurroundContents:function(){Sn(this),Ca(this.startContainer),Ca(this.endContainer);var Mn=new Zn(this,!0),or=Mn._first&&Pt(Mn._first,this)||Mn._last&&Pt(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,sr=this.endContainer,qr=this.endOffset,na=function(Ro){var La=Ro.nextSibling;La&&La.nodeType==Ro.nodeType&&(sr=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 od=Ro.length;if(or=La.length,Ro.insertData(0,La.data),q(La),Mn==sr)qr+=or,sr=Mn;else if(sr==Ro.parentNode){var _u=pt(Ro);qr==_u?(sr=Ro,qr=od):qr>_u&&qr--}}},_s=!0,Vi;if(rt(sr))qr==sr.length?na(sr):qr==0&&(Vi=sr.previousSibling,Vi&&Vi.nodeType==sr.nodeType&&(qr=Vi.length,Mn==sr&&(_s=!1),Vi.appendData(sr.data),q(sr),sr=Vi));else{if(qr>0){var Nl=sr.childNodes[qr-1];Nl&&rt(Nl)&&na(Nl)}_s=!this.collapsed}if(_s){if(rt(Mn))or==0?vi(Mn):or==Mn.length&&(Vi=Mn.nextSibling,Vi&&Vi.nodeType==Mn.nodeType&&(sr==Vi&&(sr=Mn,qr+=Mn.length),Mn.appendData(Vi.data),q(Vi)));else if(or<Mn.childNodes.length){var Is=Mn.childNodes[or];Is&&rt(Is)&&vi(Is)}}else Mn=sr,or=qr;ht(this,Mn,or,sr,qr)},collapseToPoint:function(Mn,or){lr(Mn,!0),oo(Mn,or),this.setStartAndEnd(Mn,or)},parentElement:function(){Sn(this);var Mn=this.commonAncestorContainer;return Mn?In(this.commonAncestorContainer,!0):null}}),mt(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 lo(ye,ht,fn,Rn,Cn){ye.startContainer=ht,ye.startOffset=fn,ye.endContainer=Rn,ye.endOffset=Cn,ye.document=pe.getDocument(ht),br(ye)}function li(ye){lo(this,ye,0,ye,0)}Kn(li,lo),le.extend(li,{rangeProperties:ms,RangeIterator:Zn,copyComparisonConstants:mt,createPrototypeRange:Kn,inspect:En,toHtml:gr,getRangeDocument:Rt,rangesEqual:function(ye,ht){return ye.startContainer===ht.startContainer&&ye.startOffset===ht.startOffset&&ye.endContainer===ht.endContainer&&ye.endOffset===ht.endOffset}}),se.DomRange=li}),B.createCoreModule("WrappedRange",["DomRange"],function(se,Ze){var pe,le,we=se.dom,$e=se.util,rt=we.DomPosition,pt=se.DomRange,Lt=we.getBody,Jt=we.getContentDocument,en=we.isCharacterDataNode;if(se.features.implementsDomRange&&(function(){var q,Pt=pt.rangeProperties;function Rt(At){for(var Tt=Pt.length,En;Tt--;)En=Pt[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,yo=At.endContainer!==Zn||At.endOffset!=ao,ho=!At.equals(At.nativeRange);(Lo||yo||ho)&&(At.setEnd(Zn,ao),At.setStart(Tt,En))}var kn;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)},kn=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)},kn=function(Tt,En){return function(Zn){try{this.nativeRange[Tt](Zn)}catch{this.nativeRange[En](Zn),this.nativeRange[Tt](Zn)}Rt(this)}}}q.setStartBefore=kn("setStartBefore","setEndBefore"),q.setStartAfter=kn("setStartAfter","setEndAfter"),q.setEndBefore=kn("setEndBefore","setStartBefore"),q.setEndAfter=kn("setEndAfter","setStartAfter"),q.selectNodeContents=function(At){this.setStartAndEnd(At,0,we.getNodeLength(At))},On.selectNodeContents(qt),On.setEnd(qt,3);var Pe=document.createRange();Pe.selectNodeContents(qt),Pe.setEnd(qt,4),Pe.setStart(qt,2),On.compareBoundaryPoints(On.START_TO_END,Pe)==-1&&On.compareBoundaryPoints(On.END_TO_START,Pe)==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"},se.WrappedRange=pe,se.createNativeRange=function(At){return At=Jt(At,Ze,"createNativeRange"),At.createRange()}})(),se.features.implementsTextRange){var zt=function(q){var Pt=q.parentElement(),Rt=q.duplicate();Rt.collapse(!0);var Gt=Rt.parentElement();Rt=q.duplicate(),Rt.collapse(!1);var kn=Rt.parentElement(),qt=Gt==kn?Gt:we.getCommonAncestor(Gt,kn);return qt==Pt?qt:we.getCommonAncestor(Pt,qt)},it=function(q){return q.compareEndPoints("StartToEnd",q)==0},ae=function(q,Pt,Rt,Gt,kn){var qt=q.duplicate();qt.collapse(Rt);var On=qt.parentElement();if(we.isOrIsAncestorOf(Pt,On)||(On=Pt),!On.canHaveHTML){var Pe=new rt(On.parentNode,we.getNodeIndex(On));return{boundaryPosition:Pe,nodeInfo:{nodeIndex:Pe.offset,containerElement:Pe.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=kn&&kn.containerElement==On?kn.nodeIndex:0,Lo=On.childNodes.length,yo=Lo,ho=yo;ho==Lo?On.appendChild(Ke):On.insertBefore(Ke,On.childNodes[ho]),qt.moveToElementText(Ke),Le=qt.compareEndPoints(dt,q),!(Le==0||ao==yo);){if(Le==-1){if(yo==ao+1)break;ao=ho}else yo=yo==ao+1?ao:ho;ho=Math.floor((ao+yo)/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,Pt){var Rt,Gt,kn=q.offset,qt=we.getDocument(q.node),On,Pe,Ke=Lt(qt).createTextRange(),Le=en(q.node);return Le?(Rt=q.node,Gt=Rt.parentNode):(Pe=q.node.childNodes,Rt=kn<Pe.length?Pe[kn]:null,Gt=q.node),On=qt.createElement("span"),On.innerHTML="&#feff;",Rt?Gt.insertBefore(On,Rt):Gt.appendChild(On),Ke.moveToElementText(On),Ke.collapse(!Pt),Gt.removeChild(On),Le&&Ke[Pt?"moveStart":"moveEnd"]("character",kn),Ke};le=function(q){this.textRange=q,this.refresh()},le.prototype=new pt(document),le.prototype.refresh=function(){var q,Pt,Rt,Gt=zt(this.textRange);it(this.textRange)?Pt=q=ae(this.textRange,Gt,!0,!0).boundaryPosition:(Rt=ae(this.textRange,Gt,!0,!1),q=Rt.boundaryPosition,Pt=ae(this.textRange,Gt,!1,!1,Rt.nodeInfo).boundaryPosition),this.setStart(q.node,q.offset),this.setEnd(Pt.node,Pt.offset)},le.prototype.getName=function(){return"WrappedTextRange"},pt.copyComparisonConstants(le);var je=function(q){if(q.collapsed)return re(new rt(q.startContainer,q.startOffset),!0);var Pt=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",Pt),Gt.setEndPoint("EndToEnd",Rt),Gt};if(le.rangeToTextRange=je,le.prototype.toTextRange=function(){return je(this)},se.WrappedTextRange=le,!se.features.implementsDomRange||se.config.preferTextRange){var vt=(function(q){return q("return this;")()})(Function);typeof vt.Range>"u"&&(vt.Range=le),se.createNativeRange=function(q){return q=Jt(q,Ze,"createNativeRange"),Lt(q).createTextRange()},se.WrappedRange=le}}se.createRange=function(q){return q=Jt(q,Ze,"createRange"),new se.WrappedRange(se.createNativeRange(q))},se.createRangyRange=function(q){return q=Jt(q,Ze,"createRangyRange"),new pt(q)},$e.createAliasForDeprecatedMethod(se,"createIframeRange","createRange"),$e.createAliasForDeprecatedMethod(se,"createIframeRangyRange","createRangyRange"),se.addShimListener(function(q){var Pt=q.document;typeof Pt.createRange>"u"&&(Pt.createRange=function(){return se.createRange(Pt)}),Pt=q=null})}),B.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(se,Ze){se.config.checkSelectionRanges=!0;var pe="boolean",le="number",we=se.dom,$e=se.util,rt=$e.isHostMethod,pt=se.DomRange,Lt=se.WrappedRange,Jt=se.DOMException,en=we.DomPosition,zt,it,ae=se.features,re="Control",je=we.getDocument,vt=we.getBody,q=pt.rangesEqual;function Pt(ve){return typeof ve=="string"?/^backward(s)?$/i.test(ve):!!ve}function Rt(ve,mt){if(ve){if(we.isWindow(ve))return ve;if(ve instanceof Sn)return ve.win;var cn=we.getContentDocument(ve,Ze,mt);return we.getWindow(cn)}else return window}function Gt(ve){return Rt(ve,"getWinSelection").getSelection()}function kn(ve){return Rt(ve,"getDocSelection").document.selection}function qt(ve){var mt=!1;return ve.anchorNode&&(mt=we.comparePoints(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset)==1),mt}var On=rt(window,"getSelection"),Pe=$e.isHostObject(document,"selection");ae.implementsWinGetSelection=On,ae.implementsDocSelection=Pe;var Ke=Pe&&(!On||se.config.preferTextRange);if(Ke)zt=kn,se.isSelectionValid=function(ve){var mt=Rt(ve,"isSelectionValid").document,cn=mt.selection;return cn.type!="None"||je(cn.createRange().parentElement())==mt};else if(On)zt=Gt,se.isSelectionValid=function(){return!0};else return Ze.fail("Neither document.selection or window.getSelection() detected."),!1;se.getNativeSelection=zt;var Le=zt();if(!Le)return Ze.fail("Native selection was null (possibly issue 138?)"),!1;var dt=se.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==le;ae.selectionHasRangeCount=ao;var Lo=!1,yo=!0,ho=En?function(ve,mt){var cn=pt.getRangeDocument(mt),Kn=se.createRange(cn);Kn.collapseToPoint(mt.endContainer,mt.endOffset),ve.addRange(lr(Kn)),ve.extend(mt.startContainer,mt.startOffset)}:null;$e.areHostMethods(Le,["addRange","getRangeAt","removeAllRanges"])&&typeof Le.rangeCount==le&&ae.implementsDomRange&&(function(){var ve=window.getSelection();if(ve){for(var mt=ve.rangeCount,cn=mt>1,Kn=[],br=qt(ve),lo=0;lo<mt;++lo)Kn[lo]=ve.getRangeAt(lo);var li=we.createTestElement(document,"",!1),ye=li.appendChild(document.createTextNode("   ")),ht=document.createRange();if(ht.setStart(ye,1),ht.collapse(!0),ve.removeAllRanges(),ve.addRange(ht),yo=ve.rangeCount==1,ve.removeAllRanges(),!cn){var fn=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(fn&&parseInt(fn[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(li),ve.removeAllRanges(),lo=0;lo<mt;++lo)lo==0&&br?ho?ho(ve,Kn[lo]):(se.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),ve.addRange(Kn[lo])):ve.addRange(Kn[lo])}})(),ae.selectionSupportsMultipleRanges=Lo,ae.collapsedNonEditableSelectionsSupported=yo;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,mt,cn){var Kn=cn?"end":"start",br=cn?"start":"end";ve.anchorNode=mt[Kn+"Container"],ve.anchorOffset=mt[Kn+"Offset"],ve.focusNode=mt[br+"Container"],ve.focusOffset=mt[br+"Offset"]}function ut(ve){var mt=ve.nativeSelection;ve.anchorNode=mt.anchorNode,ve.anchorOffset=mt.anchorOffset,ve.focusNode=mt.focusNode,ve.focusOffset=mt.focusOffset}function vn(ve){ve.anchorNode=ve.focusNode=null,ve.anchorOffset=ve.focusOffset=0,ve.rangeCount=0,ve.isCollapsed=!0,ve._ranges.length=0,In(ve)}function In(ve){ve.type=ve.rangeCount==0?"None":it(ve)?"Caret":"Range"}function lr(ve){var mt;return ve instanceof pt?(mt=se.createNativeRange(ve.getDocument()),mt.setEnd(ve.endContainer,ve.endOffset),mt.setStart(ve.startContainer,ve.startOffset)):ve instanceof Lt?mt=ve.nativeRange:ae.implementsDomRange&&ve instanceof we.getWindow(ve.startContainer).Range&&(mt=ve),mt}function wo(ve){if(!ve.length||ve[0].nodeType!=1)return!1;for(var mt=1,cn=ve.length;mt<cn;++mt)if(!we.isAncestorOf(ve[0],ve[mt]))return!1;return!0}function oo(ve){var mt=ve.getNodes();if(!wo(mt))throw Ze.createError("getSingleElementFromRange: range "+ve.inspect()+" did not consist of a single element");return mt[0]}function ta(ve){return!!ve&&typeof ve.text<"u"}function Ca(ve,mt){var cn=new Lt(mt);ve._ranges=[cn],rr(ve,cn,!1),ve.rangeCount=1,ve.isCollapsed=cn.collapsed,In(ve)}function Yi(ve){if(ve._ranges.length=0,ve.docSelection.type=="None")vn(ve);else{var mt=ve.docSelection.createRange();if(ta(mt))Ca(ve,mt);else{ve.rangeCount=mt.length;for(var cn,Kn=je(mt.item(0)),br=0;br<ve.rangeCount;++br)cn=se.createRange(Kn),cn.selectNode(mt.item(br)),ve._ranges.push(cn);ve.isCollapsed=ve.rangeCount==1&&ve._ranges[0].collapsed,rr(ve,ve._ranges[ve.rangeCount-1],!1),In(ve)}}}function fa(ve,mt){for(var cn=ve.docSelection.createRange(),Kn=oo(mt),br=je(cn.item(0)),lo=vt(br).createControlRange(),li=0,ye=cn.length;li<ye;++li)lo.add(cn.item(li));try{lo.add(Kn)}catch{throw Ze.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}lo.select(),Yi(ve)}var Ka;rt(Le,"getRangeAt")?Ka=function(ve,mt){try{return ve.getRangeAt(mt)}catch{return null}}:Tt&&(Ka=function(ve){var mt=je(ve.anchorNode),cn=se.createRange(mt);return cn.setStartAndEnd(ve.anchorNode,ve.anchorOffset,ve.focusNode,ve.focusOffset),cn.collapsed!==this.isCollapsed&&cn.setStartAndEnd(ve.focusNode,ve.focusOffset,ve.anchorNode,ve.anchorOffset),cn});function Sn(ve,mt,cn){this.nativeSelection=ve,this.docSelection=mt,this._ranges=[],this.win=cn,this.refresh()}Sn.prototype=se.selectionPrototype;function Tl(ve){ve.win=ve.anchorNode=ve.focusNode=ve._ranges=null,ve.rangeCount=ve.anchorOffset=ve.focusOffset=0,ve.detached=!0,In(ve)}var Oo=[];function el(ve,mt){for(var cn=Oo.length,Kn,br;cn--;)if(Kn=Oo[cn],br=Kn.selection,mt=="deleteAll")Tl(br);else if(Kn.win==ve)return mt=="delete"?(Oo.splice(cn,1),!0):br;return mt=="deleteAll"&&(Oo.length=0),null}var Ui=function(ve){if(ve&&ve instanceof Sn)return ve.refresh(),ve;ve=Rt(ve,"getNativeSelection");var mt=el(ve),cn=zt(ve),Kn=Pe?kn(ve):null;return mt?(mt.nativeSelection=cn,mt.docSelection=Kn,mt.refresh()):(mt=new Sn(cn,Kn,ve),Oo.push({win:ve,selection:mt})),mt};se.getSelection=Ui,$e.createAliasForDeprecatedMethod(se,"getIframeSelection","getSelection");var gr=Sn.prototype;function ms(ve,mt){for(var cn=je(mt[0].startContainer),Kn=vt(cn).createControlRange(),br=0,lo,li=mt.length;br<li;++br){lo=oo(mt[br]);try{Kn.add(lo)}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"])){gr.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),vn(this)};var pa=function(ve,mt){ho(ve.nativeSelection,mt),ve.refresh()};ao?gr.addRange=function(ve,mt){if(Nn&&Pe&&this.docSelection.type==re)fa(this,ve);else if(Pt(mt)&&En)pa(this,ve);else{var cn;Lo?cn=this.rangeCount:(this.removeAllRanges(),cn=0);var Kn=lr(ve).cloneRange();try{this.nativeSelection.addRange(Kn)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==cn+1){if(se.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,as(this.nativeSelection)),this.isCollapsed=it(this),In(this)}else this.refresh()}}:gr.addRange=function(ve,mt){Pt(mt)&&En?pa(this,ve):(this.nativeSelection.addRange(lr(ve)),this.refresh())},gr.setRanges=function(ve){if(Nn&&Pe&&ve.length>1)ms(this,ve);else{this.removeAllRanges();for(var mt=0,cn=ve.length;mt<cn;++mt)this.addRange(ve[mt])}}}else if(rt(Le,"empty")&&rt(dt,"select")&&Nn&&Ke)gr.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 mt=this.docSelection.createRange();mt.length&&(ve=je(mt.item(0)))}if(ve){var cn=vt(ve).createTextRange();cn.select(),this.docSelection.empty()}}}catch{}vn(this)},gr.addRange=function(ve){this.docSelection.type==re?fa(this,ve):(se.WrappedTextRange.rangeToTextRange(ve).select(),this._ranges[0]=ve,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,rr(this,ve,!1),In(this))},gr.setRanges=function(ve){this.removeAllRanges();var mt=ve.length;mt>1?ms(this,ve):mt&&this.addRange(ve[0])};else return Ze.fail("No means of selecting a Range or TextRange was found"),!1;gr.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 mt;se.isSelectionValid(ve.win)?mt=ve.docSelection.createRange():(mt=vt(ve.win.document).createTextRange(),mt.collapse(!0)),ve.docSelection.type==re?Yi(ve):ta(mt)?Ca(ve,mt):vn(ve)};else if(rt(Le,"getRangeAt")&&typeof Le.rangeCount==le)qi=function(ve){if(Nn&&Pe&&ve.docSelection.type==re)Yi(ve);else if(ve._ranges.length=ve.rangeCount=ve.nativeSelection.rangeCount,ve.rangeCount){for(var mt=0,cn=ve.rangeCount;mt<cn;++mt)ve._ranges[mt]=new se.WrappedRange(ve.nativeSelection.getRangeAt(mt));rr(ve,ve._ranges[ve.rangeCount-1],as(ve.nativeSelection)),ve.isCollapsed=it(ve),In(ve)}else vn(ve)};else if(Tt&&typeof Le.isCollapsed==pe&&typeof dt.collapsed==pe&&ae.implementsDomRange)qi=function(ve){var mt,cn=ve.nativeSelection;cn.anchorNode?(mt=Ka(cn,0),ve._ranges=[mt],ve.rangeCount=1,ut(ve),ve.isCollapsed=it(ve),In(ve)):vn(ve)};else return Ze.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;gr.refresh=function(ve){var mt=ve?this._ranges.slice(0):null,cn=this.anchorNode,Kn=this.anchorOffset;if(qi(this),ve){var br=mt.length;if(br!=this._ranges.length||this.anchorNode!=cn||this.anchorOffset!=Kn)return!0;for(;br--;)if(!q(mt[br],this._ranges[br]))return!0;return!1}};var Na=function(ve,mt){var cn=ve.getAllRanges();ve.removeAllRanges();for(var Kn=0,br=cn.length;Kn<br;++Kn)q(mt,cn[Kn])||ve.addRange(cn[Kn]);ve.rangeCount||vn(ve)};Nn&&Pe?gr.removeRange=function(ve){if(this.docSelection.type==re){for(var mt=this.docSelection.createRange(),cn=oo(ve),Kn=je(mt.item(0)),br=vt(Kn).createControlRange(),lo,li=!1,ye=0,ht=mt.length;ye<ht;++ye)lo=mt.item(ye),lo!==cn||li?br.add(mt.item(ye)):li=!0;br.select(),Yi(this)}else Na(this,ve)}:gr.removeRange=function(ve){Na(this,ve)};var as;!Ke&&Tt&&ae.implementsDomRange?(as=qt,gr.isBackward=function(){return as(this)}):as=gr.isBackward=function(){return!1},gr.isBackwards=gr.isBackward,gr.toString=function(){for(var ve=[],mt=0,cn=this.rangeCount;mt<cn;++mt)ve[mt]=""+this._ranges[mt];return ve.join("")};function gs(ve,mt){if(ve.win.document!=je(mt))throw new Jt("WRONG_DOCUMENT_ERR")}function Cl(ve,mt){if(mt<0||mt>(we.isCharacterDataNode(ve)?ve.length:ve.childNodes.length))throw new Jt("INDEX_SIZE_ERR")}gr.collapse=function(ve,mt){gs(this,ve);var cn=se.createRange(ve);cn.collapseToPoint(ve,mt),this.setSingleRange(cn),this.isCollapsed=!0},gr.collapseToStart=function(){if(this.rangeCount){var ve=this._ranges[0];this.collapse(ve.startContainer,ve.startOffset)}else throw new Jt("INVALID_STATE_ERR")},gr.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")},gr.selectAllChildren=function(ve){gs(this,ve);var mt=se.createRange(ve);mt.selectNodeContents(ve),this.setSingleRange(mt)},Zn?gr.setBaseAndExtent=function(ve,mt,cn,Kn){this.nativeSelection.setBaseAndExtent(ve,mt,cn,Kn),this.refresh()}:En&&(gr.setBaseAndExtent=function(ve,mt,cn,Kn){Cl(ve,mt),Cl(cn,Kn),gs(this,ve),gs(this,cn);var br=se.createRange(node),lo=we.comparePoints(ve,mt,cn,Kn)==-1;lo?br.setStartAndEnd(cn,Kn,ve,mt):br.setStartAndEnd(ve,mt,cn,Kn),this.setSingleRange(br,lo)}),gr.deleteFromDocument=function(){if(Nn&&Pe&&this.docSelection.type==re){for(var ve=this.docSelection.createRange(),mt;ve.length;)mt=ve.item(0),ve.remove(mt),we.removeNode(mt);this.refresh()}else if(this.rangeCount){var cn=this.getAllRanges();if(cn.length){this.removeAllRanges();for(var Kn=0,br=cn.length;Kn<br;++Kn)cn[Kn].deleteContents();this.addRange(cn[br-1])}}},gr.eachRange=function(ve,mt){for(var cn=0,Kn=this._ranges.length;cn<Kn;++cn)if(ve(this.getRangeAt(cn)))return mt},gr.getAllRanges=function(){var ve=[];return this.eachRange(function(mt){ve.push(mt)}),ve},gr.setSingleRange=function(ve,mt){this.removeAllRanges(),this.addRange(ve,mt)},gr.callMethodOnEachRange=function(ve,mt){var cn=[];return this.eachRange(function(Kn){cn.push(Kn[ve].apply(Kn,mt||[]))}),cn};function ys(ve){return function(mt,cn){var Kn;this.rangeCount?(Kn=this.getRangeAt(0),Kn["set"+(ve?"Start":"End")](mt,cn)):(Kn=se.createRange(this.win.document),Kn.setStartAndEnd(mt,cn)),this.setSingleRange(Kn,this.isBackward())}}gr.setStart=ys(!0),gr.setEnd=ys(!1),se.rangePrototype.select=function(ve){Ui(this.getDocument()).setSingleRange(this,ve)},gr.changeEachRange=function(ve){var mt=[],cn=this.isBackward();this.eachRange(function(Kn){ve(Kn),mt.push(Kn)}),this.removeAllRanges(),cn&&mt.length==1?this.addRange(mt[0],"backward"):this.setRanges(mt)},gr.containsNode=function(ve,mt){return this.eachRange(function(cn){return cn.containsNode(ve,mt)},!0)||!1},gr.getBookmark=function(ve){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[ve])}},gr.moveToBookmark=function(ve){for(var mt=[],cn=0,Kn,br;Kn=ve.rangeBookmarks[cn++];)br=se.createRange(this.win),br.moveToBookmark(Kn),mt.push(br);ve.backward?this.setSingleRange(mt[0],"backward"):this.setRanges(mt)},gr.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},gr.restoreRanges=function(ve){this.removeAllRanges();for(var mt=0,cn;cn=ve.ranges[mt];++mt)this.addRange(cn,ve.backward&&mt==0)},gr.toHtml=function(){var ve=[];return this.eachRange(function(mt){ve.push(pt.toHtml(mt))}),ve.join("")},ae.implementsTextRange&&(gr.getNativeTextRange=function(){var ve;if(ve=this.docSelection){var mt=ve.createRange();if(ta(mt))return mt;throw Ze.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return se.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw Ze.createError("getNativeTextRange: selection contains no range")}});function tl(ve){var mt=[],cn=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 lo=0,li=ve.rangeCount;lo<li;++lo)mt[lo]=pt.inspect(ve.getRangeAt(lo));return"["+br+"(Ranges: "+mt.join(", ")+")(anchor: "+cn.inspect()+", focus: "+Kn.inspect()+"]"}gr.getName=function(){return"WrappedSelection"},gr.inspect=function(){return tl(this)},gr.detach=function(){el(this.win,"delete"),Tl(this)},Sn.detachAll=function(){el(null,"deleteAll")},Sn.inspect=tl,Sn.isDirectionBackward=Pt,se.Selection=Sn,se.selectionPrototype=gr,se.addShimListener(function(ve){typeof ve.getSelection>"u"&&(ve.getSelection=function(){return Ui(ve)}),ve=null})});var Je=!1,gt=function(se){Je||(Je=!0,!B.initialized&&B.config.autoInitialize&&J())};return D&&(document.readyState=="complete"?gt():(f(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",gt,!1),Y(window,"load",gt))),B})})(bS)),bS.exports}var Sne=Z3();const _R=Z_(Sne);var wS={exports:{}},bR;function Ane(){return bR||(bR=1,(function(t,e){(function(n,o){t.exports=n(Z3())})(function(n){return n.createModule("ClassApplier",["WrappedSelection"],function(o,r){var i=o.dom,a=i.DomPosition,l=i.arrayContains,s=o.util,f=s.forEach,h="span",v=s.isHostMethod(document,"createElementNS");function b(ae,re){for(var je in ae)if(ae.hasOwnProperty(je)&&re(je,ae[je])===!1)return!1;return!0}function w(ae){return ae.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function O(ae,re){return!!ae&&new RegExp("(?:^|\\s)"+re+"(?:\\s|$)").test(ae)}function E(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 C(ae){var re=typeof ae.className=="string";return re?ae.className:ae.getAttribute("class")}function $(ae){return ae&&ae.split(/\s+/).sort().join(" ")}function D(ae){return $(C(ae))}function k(ae,re){return D(ae)==D(re)}function B(ae,re){for(var je=re.split(/\s+/),vt=0,q=je.length;vt<q;++vt)if(!E(ae,w(je[vt])))return!1;return!0}function F(ae){var re=ae.parentNode;return re&&re.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(re.nodeName)}function I(ae,re,je,vt,q){var Pt=ae.node,Rt=ae.offset,Gt=Pt,kn=Rt;Pt==vt&&Rt>q&&++kn,Pt==re&&(Rt==je||Rt==je+1)&&(Gt=vt,kn+=q-je),Pt==re&&Rt>je+1&&--kn,ae.node=Gt,ae.offset=kn}function V(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,Pt=i.getNodeIndex(ae);f(vt,function(Rt){I(Rt,q,Pt,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){V(q,je,vt)}),i.removeNode(ae)}function Y(ae,re,je,vt,q){for(var Pt,Rt=[];Pt=ae.firstChild;)z(Pt,re,je++,q),Rt.push(Pt);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,Pt,Rt;je<vt;++je)if(q=ae.attributes[je],Rt=q.name,Rt!="class"&&(Pt=re.attributes.getNamedItem(Rt),q===null!=(Pt===null)||q.specified!=Pt.specified||q.specified&&q.nodeValue!==Pt.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&&l(re,q))&&ae.attributes[je].specified&&q!="class")return!0;return!1}var Ae=i.getComputedStyleProperty,ke=(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"||ke(re.parentNode)}})();function De(ae){var re;return ae&&ae.nodeType==1&&((re=ae.parentNode)&&re.nodeType==9&&re.designMode=="on"||ke(ae)&&!ke(ae.parentNode))}function ze(ae){return(ke(ae)||ae.nodeType!=1&&ke(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 gt(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 se(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,Pt,Rt=ae.length;je<Rt;++je)vt=ae[je],q=re[je*2],Pt=re[je*2+1],vt.setStartAndEnd(q.node,q.offset,Pt.node,Pt.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 le(ae,re,je,vt){var q,Pt,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),Pt=re.parentNode,q.id&&q.removeAttribute("id");for(var kn,qt=0;kn=re.childNodes[je];)z(kn,q,qt++,vt);return z(q,Pt,i.getNodeIndex(re)+1,vt),re==ae?q:le(ae,Pt,i.getNodeIndex(q),vt)}else if(ae!=re){q=re.parentNode;var On=i.getNodeIndex(re);return Rt||On++,le(ae,q,On,vt)}return ae}function we(ae,re){return ae.namespaceURI==re.namespaceURI&&ae.tagName.toLowerCase()==re.tagName.toLowerCase()&&k(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,Pt=je[re];if(Pt){if(Pt&&Pt.nodeType==3)return Pt}else if(vt&&(Pt=q[re],Pt&&Pt.nodeType==1&&we(q,Pt))){var Rt=Pt[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=[],Pt=0,Rt;f(re,function(Gt,kn){Rt=Gt.parentNode,kn>0&&(Rt.removeChild(Gt),Rt.hasChildNodes()||i.removeNode(Rt),ae&&f(ae,function(qt){qt.node==Gt&&(qt.node=je,qt.offset+=Pt),qt.node==Rt&&qt.offset>vt&&(--qt.offset,qt.offset==vt+1&&kn<re.length-1&&(qt.node=je,qt.offset=Pt))})),q[kn]=Gt.data,Pt+=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,Pt,Rt,Gt=this;Gt.cssClass=Gt.className=ae;var kn=null,qt={};if(typeof re=="object"&&re!==null){for(typeof re.elementTagName<"u"&&(re.elementTagName=re.elementTagName.toLowerCase()),je=re.tagNames,kn=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(kn,On,!0),b(qt,function(Ke,Le){Gt.attrExceptions.push(Ke),qt[Ke]=""+Le}),Gt.elementAttributes=qt,Gt.elementSortedClassName=Gt.elementProperties.hasOwnProperty("className")?$(Gt.elementProperties.className+" "+ae):ae,Gt.applyToAnyTagName=!1;var Pe=typeof je;if(Pe=="string")je=="*"?Gt.applyToAnyTagName=!0:Gt.tagNames=w(je.toLowerCase()).split(/\s*,\s*/);else if(Pe=="object"&&typeof je.length=="number")for(Gt.tagNames=[],q=0,Pt=je.length;q<Pt;++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,Pt={},Rt,Gt,kn,qt;for(var On in ae)if(ae.hasOwnProperty(On))if(Gt=ae[On],kn=re[On],On=="className")S(re,Gt),S(re,this.className),re[On]=$(re[On]),je&&(Pt[On]=Gt);else if(On=="style"){q=kn,je&&(Pt[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&&(Pt[On]=re[On],qt=en.hasOwnProperty(On)?en[On]:On,this.attrExceptions.push(qt));return je?Pt:""},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 l(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))&&E(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||ze(ae)},isIgnorableWhiteSpaceNode:function(ae){return this.ignoreWhiteSpace&&ae&&ae.nodeType==3&&gt(ae)},postApply:function(ae,re,je,vt){var q=ae[0],Pt=ae[ae.length-1],Rt=[],Gt,kn=q,qt=Pt,On=0,Pe=Pt.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&&(kn=Gt.textNodes[0],On=kn.length),Tt===Pt&&(qt=Gt.textNodes[0],Pe=Gt.getLength())):Gt=null});var Le=pt(Pt,!vt);if(Le&&(Gt||(Gt=new Lt(Pt),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(kn,On,qt,Pe)}},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 b(re,function(vt,q){if(vt=="className")return B(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 b(re,function(je,vt){if(ae.getAttribute(je)!==vt)return!1})},applyToTextNode:function(ae,re){if(F(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&&D(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(Pt){return re.isEmptyContainer(Pt)}),vt=[ae],q=se(vt);f(je,function(Pt){X(Pt,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)&&(le(je,re.endContainer,re.endOffset,vt),re.setEndAfter(je)),q.isPointInRange(re.startContainer,re.startOffset)&&(je=le(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&&le(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=se(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 Pt=q[q.length-1];ae.setStartAndEnd(q[0],0,Pt,Pt.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=se(re);ae.splitBoundariesPreservingPositions(vt),je.removeEmptyElements&&je.removeEmptyContainers(ae,vt);var q=J(ae),Pt,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 kn=0,qt=q.length;kn<qt;++kn)Pt=q[kn],Rt=je.getSelfOrAncestorWithClass(Pt),Rt&&je.isModifiable(Pt)&&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(Pe){M(Pe,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&&!l(re,q)&&re.push(q)}),re},detach:function(){}};function it(ae,re,je){return new zt(ae,re,je)}zt.util={hasClass:E,addClass:S,removeClass:M,getClass:C,hasSameClasses:k,hasAllClasses:B,replaceWithOwnChildren:W,elementsHaveSameNonClassAttributes:ie,elementHasNonClassAttributes:Se,splitNodeAt:le,isEditableElement:ke,isEditingHost:De,isEditable:ze},o.CssClassApplier=o.ClassApplier=zt,o.createClassApplier=it,s.createAliasForDeprecatedMethod(o,"createCssClassApplier","createClassApplier",r)}),n})})(wS)),wS.exports}Ane();var wR={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 ER(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,l,s;try{_R.init()}catch{console.error("rangy.init failed")}try{(s=(l=o==null?void 0:o.prototype)===null||l===void 0?void 0:l.init)===null||s===void 0||s.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new K3({parent:this.button||void 0,color:"#000",onDone:function(f){var h,v,b,w,O;try{a.coloredText&&(!((v=(h=a.coloredText).isAppliedToSelection)===null||v===void 0)&&v.call(h))&&a.coloredText.undoToSelection(),a.coloredText=_R.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:f.hex}},normalize:!0}),a.coloredText.toggleSelection(),(w=(b=a.base)===null||b===void 0?void 0:b.checkContentChanged)===null||w===void 0||w.call(b),(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,l,s;(a=this.setActive)===null||a===void 0||a.call(this),(s=(l=this.colorPicker)===null||l===void 0?void 0:l.show)===null||s===void 0||s.call(l)},isAlreadyApplied:function(a){var l,s;return((s=(l=a==null?void 0:a.nodeName)===null||l===void 0?void 0:l.toLowerCase)===null||s===void 0?void 0:s.call(l))==="mark"},isActive:function(){var a,l;return(l=(a=this.button)===null||a===void 0?void 0:a.classList)===null||l===void 0?void 0:l.contains("medium-editor-button-active")},setInactive:function(){var a,l;(l=(a=this.button)===null||a===void 0?void 0:a.classList)===null||l===void 0||l.remove("medium-editor-button-active")},setActive:function(){var a,l;(l=(a=this.button)===null||a===void 0?void 0:a.classList)===null||l===void 0||l.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 l=t.length-1;l>=0;l--)(a=t[l])&&(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},xR=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(l){a={error:l}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},OR=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(wR,{autoLink:!0,extensions:{colorPicker:new(ER(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(wR,{autoLink:!0,extensions:{colorPicker:new(ER(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=OR(OR([],xR(i.nodes),!1),xR(i.edges),!1),l=r.label;if(l){var s=[];return ri(a,function(f){var h,v,b=f.getData(),w=(v=(h=b.properties)===null||h===void 0?void 0:h._label)!==null&&v!==void 0?v:[];ri(w,function(O){var E=n.labelMap,S=new vne(O,f,i);E.set(S.id,S),s.push($t(pne,{label:S,element:f,graphModel:i},S.id))})}),s}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([xl],e),e})(Po);var 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(l){a={error:l}}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))},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 l=a.e;r.handleMouseDown(l)},this.draw=function(a){var l=r.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,s=l.x,f=l.y;if(r.endPoint={x:s,y:f},r.startPoint){var h=r.startPoint,v=h.x,b=h.y,w=v,O=b,E=s-v,S=f-b;s<v&&(w=s,E=v-s),f<b&&(O=f,S=b-f),r.wrapper&&(r.wrapper.style.left="".concat(w,"px"),r.wrapper.style.top="".concat(O,"px"),r.wrapper.style.width="".concat(E,"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 l=r.mouseDownInfo,s=l.x,f=l.y,h=l.time,v=Math.abs(a.clientX-s)<5&&Math.abs(a.clientY-f)<5&&Date.now()-h<200;if(v){r.lf.clearSelectElements(),r.cleanupSelectionState();return}}var b=to(r.startPoint),w=to(r.endPoint);if(document.removeEventListener("mousemove",r.draw),r.exclusiveMode||document.removeEventListener("mouseup",r.drawOff),b&&w){var s=b.x,f=b.y,O=w.x,E=w.y,S=[Math.min(s,O),Math.min(f,E)],M=[Math.max(s,O),Math.max(f,E)];if(r.lf.emit("selection:selected-area",{topLeft:S,bottomRight:M}),Math.abs(O-s)<10&&Math.abs(E-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 C=r.lf.graphModel.getAreaElement(S,M,r.isWholeEdge,r.isWholeNode,!0),$=r.lf.graphModel,D=$.dynamicGroup,k=$.group,B=[],F=r.lf.getSelectElements(),I=new Set(AR(AR([],SR(F.nodes.map(function(X){return X.id})),!1),SR(F.edges.map(function(X){return X.id})),!1));C.forEach(function(X){if(k){var Y=k.getNodeGroup(X.id);if(C.includes(Y))return}if(D){var Y=D.getGroupByNodeId(X.id);if(C.includes(Y))return}if(r.exclusiveMode&&I.has(X.id)){r.lf.deselectElementById(X.id);return}r.lf.selectElementById(X.id,!0),B.push(X)}),r.startPoint=void 0,r.endPoint=void 0,B.length>0&&r.lf.emit("selection:drop",{e:a}),r.lf.emit("selection:selected",{elements:B,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 l=document.createElement("div");l.className="lf-selection-select",l.oncontextmenu=function(f){f.preventDefault()},l.style.top="".concat(this.startPoint.y,"px"),l.style.left="".concat(this.startPoint.x,"px"),(n=this.container)===null||n===void 0||n.appendChild(l),this.wrapper=l,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 J3=(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)}})(),Eg=function(){return Eg=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},Eg.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(l){a={error:l}}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 Pne(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),l=a[0],s=a[1],f=v_(e[n+1],2),h=f[0],v=f[1];r===l&&l===h||i===s&&s===v?e.splice(n,1):n++}return e}function kne(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 C=M[0]-S[0],$=M[1]-S[1],D=Math.abs(C),k=Math.abs($);return k<=i&&D>i?C<0?"l":"r":D<=i&&k>i?$<0?"t":"b":D<=i&&k<=i?"":D<k?C<0?"l":"r":$<0?"t":"b"},l=a(t,e),s=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(l).concat(s),v=Nne[h]||"-",b="";if(v==="-")b+="L ".concat(e[0]," ").concat(e[1]);else{var w=v_(kne(e,h,v,f),2),O=w[0],E=w[1];O&&E&&(b+="L ".concat(O[0]," ").concat(O[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(E[0]," ").concat(E[1]),r=v_(E,2),e[0]=r[0],e[1]=r[1])}return b}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){J3(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,l=a===void 0?5:a,s=n.getEdgeStyle(),f=n.getEdgeAnimationStyle(),h=Pne(o.split(" ").map(function(w){return w.split(",").map(function(O){return+O})})),v=Dne(h,l),b=Eg(Eg(Eg({style:r?f:{}},s),i),{fill:"none"});return Lr("path",Eg({d:v},b))},e})($_);(function(t){J3(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(F_);var Q3=(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)}})(),uE=function(){return uE=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},uE.apply(this,arguments)},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(l){a={error:l}}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))},jne=(function(t){Q3(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,l=n.height,s=n.properties,f=this.props.model.getNodeStyle();return Lr("svg",{x:r-a/2,y:i-l/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[s.labelText?Lr("text",{x:0,y:-5,fontSize:"16px",fill:f.stroke},s.labelText):"",s.disabledDelete?"":Lr("text",{x:s.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,l=n.id,s=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",uE(uE({},s),{x:o-i/2,y:r-a/2,width:i,height:a,id:l})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(n){var o=this.props.graphModel;o.deleteNode(n)},e})(zw),Lne=(function(t){Q3(e,t);function e(){var n=t.apply(this,TR([],MR(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,l=-1/0,s=-1/0;n.forEach(function(f){var h=o.graphModel.getNodeModelById(f);if(h){var v=h.width,b=h.height,w=h.x,O=h.y;i=Math.min(i,w-v/2-o.d),a=Math.min(a,O-b/2-o.d),l=Math.max(l,w+v/2+o.d),s=Math.max(s,O+b/2+o.d)}}),r.push([i,a],[l,a],[l,s],[i,s]),![i,a,l,s].some(function(f){return Math.abs(f)===1/0})&&(this.updatePoints(r),this.updateCoordinate({x:(l+i)/2,y:(s+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},l=(this.properties.node_selection_ids||[]).slice(),s=[],f=new Set;l.length;){var h=l.shift(),v=(o=this.graphModel.nodesMap[h])===null||o===void 0?void 0:o.model;if(v){if(!ew(v)){s.push(v);continue}f.has(v.id)||(f.add(v.id),l.push.apply(l,TR([],MR(v.properties.node_selection_ids||[]),!1)))}}var b={x:this.x-this.width/2,y:this.y-this.height/2},w=t.prototype.resize.call(this,n),O={x:this.x-this.width/2,y:this.y-this.height/2};return s.forEach(function(E){E.width=E.width*a.x,E.height=E.height*a.y;var S=(E.x-b.x)*a.x+O.x-E.x,M=(E.y-b.y)*a.y+O.y-E.y;E.move(S,M,!0)}),this.isResize=!1,w},e})(Uw),v2="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:v2,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=om(i,"properties.node_selection_ids",[]);return r.every(function(l){return a.includes(l)})}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===v2)){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===v2)},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)}})(),cE=function(){return cE=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},cE.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,l=n.properties;return Lr("text",{x:o-i/2+5,y:r-a/2+16,fontSize:12,fill:"blue"},l.moreText)},e.prototype.getShape=function(){var n=this.props.model,o=n.x,r=n.y,i=n.width,a=n.height,l=this.props.model.getNodeStyle();return Lr("g",{},[Lr("rect",cE(cE({},l),{fill:"#FFFFFF",x:o-i/2,y:r-a/2})),this.getLabelShape()])},e})(Zv);var I0={exports:{}},CR;function Fne(){return CR||(CR=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,l){r.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:l})},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 l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:i}),2&a&&typeof i!="string")for(var s in i)r.d(l,s,(function(f){return i[f]}).bind(null,s));return l},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 k})),r.d(o,"b",(function(){return D})),r.d(o,"c",(function(){return se})),r.d(o,"d",(function(){return Ze})),r.d(o,"e",(function(){return M})),r.d(o,"f",(function(){return $})),r.d(o,"g",(function(){return M})),r.d(o,"h",(function(){return gt})),r.d(o,"i",(function(){return a})),r.d(o,"j",(function(){return Je})),r.d(o,"k",(function(){return Y}));var i,a,l,s,f,h,v,b={},w=[],O=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function E(pe,le){for(var we in le)pe[we]=le[we];return pe}function S(pe){var le=pe.parentNode;le&&le.removeChild(pe)}function M(pe,le,we){var $e,rt,pt,Lt={};for(pt in le)pt=="key"?$e=le[pt]:pt=="ref"?rt=le[pt]:Lt[pt]=le[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 C(pe,Lt,$e,rt,null)}function C(pe,le,we,$e,rt){var pt={type:pe,props:le,key:we,ref:$e,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:rt??++l};return rt==null&&a.vnode!=null&&a.vnode(pt),pt}function $(){return{current:null}}function D(pe){return pe.children}function k(pe,le){this.props=pe,this.context=le}function B(pe,le){if(le==null)return pe.__?B(pe.__,pe.__.__k.indexOf(pe)+1):null;for(var we;le<pe.__k.length;le++)if((we=pe.__k[le])!=null&&we.__e!=null)return we.__e;return typeof pe.type=="function"?B(pe):null}function F(pe){var le,we;if((pe=pe.__)!=null&&pe.__c!=null){for(pe.__e=pe.__c.base=null,le=0;le<pe.__k.length;le++)if((we=pe.__k[le])!=null&&we.__e!=null){pe.__e=pe.__c.base=we.__e;break}return F(pe)}}function I(pe){(!pe.__d&&(pe.__d=!0)&&s.push(pe)&&!V.__r++||h!==a.debounceRendering)&&((h=a.debounceRendering)||f)(V)}function V(){for(var pe;V.__r=s.length;)pe=s.sort((function(le,we){return le.__v.__b-we.__v.__b})),s=[],pe.some((function(le){var we,$e,rt,pt,Lt,Jt;le.__d&&(Lt=(pt=(we=le).__v).__e,(Jt=we.__P)&&($e=[],(rt=E({},pt)).__v=pt.__v+1,Ae(Jt,pt,rt,we.__n,Jt.ownerSVGElement!==void 0,pt.__h!=null?[Lt]:null,$e,Lt??B(pt),pt.__h),ke($e,pt),pt.__e!=Lt&&F(pt)))}))}function z(pe,le,we,$e,rt,pt,Lt,Jt,en,zt){var it,ae,re,je,vt,q,Pt,Rt=$e&&$e.__k||w,Gt=Rt.length;for(we.__k=[],it=0;it<le.length;it++)if((je=we.__k[it]=(je=le[it])==null||typeof je=="boolean"?null:typeof je=="string"||typeof je=="number"||typeof je=="bigint"?C(null,je,null,null,je):Array.isArray(je)?C(D,{children:je},null,null,null):je.__b>0?C(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||b,rt,pt,Lt,Jt,en,zt),vt=je.__e,(ae=je.ref)&&re.ref!=ae&&(Pt||(Pt=[]),re.ref&&Pt.push(re.ref,null,je),Pt.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=B(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=B($e,it+1)),Ye(Rt[it],Rt[it]));if(Pt)for(it=0;it<Pt.length;it++)ze(Pt[it],Pt[++it],Pt[++it])}function X(pe,le,we){for(var $e,rt=pe.__k,pt=0;rt&&pt<rt.length;pt++)($e=rt[pt])&&($e.__=pe,le=typeof $e.type=="function"?X($e,le,we):W(we,$e,$e,rt,$e.__e,le));return le}function Y(pe,le){return le=le||[],pe==null||typeof pe=="boolean"||(Array.isArray(pe)?pe.some((function(we){Y(we,le)})):le.push(pe)),le}function W(pe,le,we,$e,rt,pt){var Lt,Jt,en;if(le.__d!==void 0)Lt=le.__d,le.__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,le,we){le[0]==="-"?pe.setProperty(le,we):pe[le]=we==null?"":typeof we!="number"||O.test(le)?we:we+"px"}function J(pe,le,we,$e,rt){var pt;e:if(le==="style")if(typeof we=="string")pe.style.cssText=we;else{if(typeof $e=="string"&&(pe.style.cssText=$e=""),$e)for(le in $e)we&&le in we||Q(pe.style,le,"");if(we)for(le in we)$e&&we[le]===$e[le]||Q(pe.style,le,we[le])}else if(le[0]==="o"&&le[1]==="n")pt=le!==(le=le.replace(/Capture$/,"")),le=le.toLowerCase()in pe?le.toLowerCase().slice(2):le.slice(2),pe.l||(pe.l={}),pe.l[le+pt]=we,we?$e||pe.addEventListener(le,pt?Se:ie,pt):pe.removeEventListener(le,pt?Se:ie,pt);else if(le!=="dangerouslySetInnerHTML"){if(rt)le=le.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(le!=="href"&&le!=="list"&&le!=="form"&&le!=="tabIndex"&&le!=="download"&&le in pe)try{pe[le]=we??"";break e}catch{}typeof we=="function"||(we!=null&&(we!==!1||le[0]==="a"&&le[1]==="r")?pe.setAttribute(le,we):pe.removeAttribute(le))}}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,le,we,$e,rt,pt,Lt,Jt,en){var zt,it,ae,re,je,vt,q,Pt,Rt,Gt,kn,qt=le.type;if(le.constructor!==void 0)return null;we.__h!=null&&(en=we.__h,Jt=le.__e=we.__e,le.__h=null,pt=[Jt]),(zt=a.__b)&&zt(le);try{e:if(typeof qt=="function"){if(Pt=le.props,Rt=(zt=qt.contextType)&&$e[zt.__c],Gt=zt?Rt?Rt.props.value:zt.__:$e,we.__c?q=(it=le.__c=we.__c).__=it.__E:("prototype"in qt&&qt.prototype.render?le.__c=it=new qt(Pt,Gt):(le.__c=it=new k(Pt,Gt),it.constructor=qt,it.render=Be),Rt&&Rt.sub(it),it.props=Pt,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=E({},it.__s)),E(it.__s,qt.getDerivedStateFromProps(Pt,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&&Pt!==re&&it.componentWillReceiveProps!=null&&it.componentWillReceiveProps(Pt,Gt),!it.__e&&it.shouldComponentUpdate!=null&&it.shouldComponentUpdate(Pt,it.__s,Gt)===!1||le.__v===we.__v){it.props=Pt,it.state=it.__s,le.__v!==we.__v&&(it.__d=!1),it.__v=le,le.__e=we.__e,le.__k=we.__k,le.__k.forEach((function(On){On&&(On.__=le)})),it.__h.length&&Lt.push(it);break e}it.componentWillUpdate!=null&&it.componentWillUpdate(Pt,it.__s,Gt),it.componentDidUpdate!=null&&it.__h.push((function(){it.componentDidUpdate(re,je,vt)}))}it.context=Gt,it.props=Pt,it.state=it.__s,(zt=a.__r)&&zt(le),it.__d=!1,it.__v=le,it.__P=pe,zt=it.render(it.props,it.state,it.context),it.state=it.__s,it.getChildContext!=null&&($e=E(E({},$e),it.getChildContext())),ae||it.getSnapshotBeforeUpdate==null||(vt=it.getSnapshotBeforeUpdate(re,je)),kn=zt!=null&&zt.type===D&&zt.key==null?zt.props.children:zt,z(pe,Array.isArray(kn)?kn:[kn],le,we,$e,rt,pt,Lt,Jt,en),it.base=le.__e,le.__h=null,it.__h.length&&Lt.push(it),q&&(it.__E=it.__=null),it.__e=!1}else pt==null&&le.__v===we.__v?(le.__k=we.__k,le.__e=we.__e):le.__e=De(we.__e,le,we,$e,rt,pt,Lt,en);(zt=a.diffed)&&zt(le)}catch(On){le.__v=null,(en||pt!=null)&&(le.__e=Jt,le.__h=!!en,pt[pt.indexOf(Jt)]=null),a.__e(On,le,we)}}function ke(pe,le){a.__c&&a.__c(le,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,le,we,$e,rt,pt,Lt,Jt){var en,zt,it,ae=we.props,re=le.props,je=le.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||b).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,Pt,Rt,Gt,kn){var qt;for(qt in Rt)qt==="children"||qt==="key"||qt in Pt||J(q,qt,null,Rt[qt],Gt);for(qt in Pt)kn&&typeof Pt[qt]!="function"||qt==="children"||qt==="key"||qt==="value"||qt==="checked"||Rt[qt]===Pt[qt]||J(q,qt,Pt[qt],Rt[qt],Gt)})(pe,re,ae,rt,Jt),it)le.__k=[];else if(vt=le.props.children,z(pe,Array.isArray(vt)?vt:[vt],le,we,$e,rt&&je!=="foreignObject",pt,Lt,pt?pt[0]:we.__k&&B(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 ze(pe,le,we){try{typeof pe=="function"?pe(le):pe.current=le}catch($e){a.__e($e,we)}}function Ye(pe,le,we){var $e,rt;if(a.unmount&&a.unmount(pe),($e=pe.ref)&&($e.current&&$e.current!==pe.__e||ze($e,null,le)),($e=pe.__c)!=null){if($e.componentWillUnmount)try{$e.componentWillUnmount()}catch(pt){a.__e(pt,le)}$e.base=$e.__P=null}if($e=pe.__k)for(rt=0;rt<$e.length;rt++)$e[rt]&&Ye($e[rt],le,typeof pe.type!="function");we||pe.__e==null||S(pe.__e),pe.__e=pe.__d=void 0}function Be(pe,le,we){return this.constructor(pe,we)}function Je(pe,le,we){var $e,rt,pt;a.__&&a.__(pe,le),rt=($e=typeof we=="function")?null:we&&we.__k||le.__k,pt=[],Ae(le,pe=(!$e&&we||le).__k=M(D,null,[pe]),rt||b,b,le.ownerSVGElement!==void 0,!$e&&we?[we]:rt?null:le.firstChild?i.call(le.childNodes):null,pt,!$e&&we?we:rt?rt.__e:le.firstChild,$e),ke(pt,pe)}function gt(pe,le){Je(pe,le,gt)}function se(pe,le,we){var $e,rt,pt,Lt=E({},pe.props);for(pt in le)pt=="key"?$e=le[pt]:pt=="ref"?rt=le[pt]:Lt[pt]=le[pt];return arguments.length>2&&(Lt.children=arguments.length>3?i.call(arguments,2):we),C(pe.type,Lt,$e||pe.key,rt||pe.ref,null)}function Ze(pe,le){var we={__c:le="__cC"+v++,__:pe,Consumer:function($e,rt){return $e.children(rt)},Provider:function($e){var rt,pt;return this.getChildContext||(rt=[],(pt={})[le]=this,this.getChildContext=function(){return pt},this.shouldComponentUpdate=function(Lt){this.props.value!==Lt.value&&rt.some(I)},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=w.slice,a={__e:function(pe,le){for(var we,$e,rt;le=le.__;)if((we=le.__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}},l=0,k.prototype.setState=function(pe,le){var we;we=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=E({},this.state),typeof pe=="function"&&(pe=pe(E({},we),this.props)),pe&&E(we,pe),pe!=null&&this.__v&&(le&&this.__h.push(le),I(this))},k.prototype.forceUpdate=function(pe){this.__v&&(this.__e=!0,pe&&this.__h.push(pe),I(this))},k.prototype.render=D,s=[],f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,V.__r=0,v=0},function(n,o,r){(function(i,a){r.d(o,"a",(function(){return I})),r.d(o,"b",(function(){return sf})),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 Pa})),r.d(o,"i",(function(){return kn})),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 sr})),r.d(o,"r",(function(){return Is})),r.d(o,"s",(function(){return ls})),r.d(o,"t",(function(){return vi})),r.d(o,"u",(function(){return li})),r.d(o,"v",(function(){return od})),r.d(o,"w",(function(){return _u})),r.d(o,"x",(function(){return ra})),r.d(o,"y",(function(){return Es})),r.d(o,"z",(function(){return Wi})),r.d(o,"A",(function(){return ia})),r.d(o,"B",(function(){return bs})),r.d(o,"C",(function(){return zt})),r.d(o,"D",(function(){return gp})),r.d(o,"E",(function(){return nr})),r.d(o,"F",(function(){return Cn})),r.d(o,"G",(function(){return lo})),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 id}));var l=[];Object.freeze(l);var s={};function f(){return++Sn.mobxGuid}function h(R){throw v(!1,R),"X"}function v(R,L){if(!R)throw new Error("[mobx] "+(L||"An invariant failed, however the error is obfuscated because this is a production build."))}Object.freeze(s);function b(R){var L=!1;return function(){if(!L)return L=!0,R.apply(this,arguments)}}var w=function(){};function O(R){return R!==null&&typeof R=="object"}function E(R){if(R===null||typeof R!="object")return!1;var L=Object.getPrototypeOf(R);return L===Object.prototype||L===null}function S(R,L,Z){Object.defineProperty(R,L,{enumerable:!1,writable:!0,configurable:!0,value:Z})}function M(R,L){var Z="isMobX"+R;return L.prototype[Z]=!0,function(fe){return O(fe)&&fe[Z]===!0}}function C(R){return R instanceof Map}function $(R){return R instanceof Set}function D(R){var L=new Set;for(var Z in R)L.add(Z);return Object.getOwnPropertySymbols(R).forEach((function(fe){Object.getOwnPropertyDescriptor(R,fe).enumerable&&L.add(fe)})),Array.from(L)}function k(R){return R&&R.toString?R.toString():new String(R).toString()}function B(R){return R===null?null:typeof R=="object"?""+R:R}var F=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:Object.getOwnPropertyNames,I=Symbol("mobx administration"),V=(function(){function R(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 R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.reportObserved=function(){return ms(this)},R.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),gr()},R.prototype.toString=function(){return this.name},R})(),z=M("Atom",V);function X(R,L,Z){L===void 0&&(L=w),Z===void 0&&(Z=w);var fe,Re=new V(R);return L!==w&&Mn("onBecomeObserved",Re,L,fe),Z!==w&&nr(Re,Z),Re}var Y={structural:function(R,L){return un(R,L)},default:function(R,L){return Object.is(R,L)}},W=function(R,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(R,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(R){for(var L,Z=1,fe=arguments.length;Z<fe;Z++)for(var Re in L=arguments[Z])Object.prototype.hasOwnProperty.call(L,Re)&&(R[Re]=L[Re]);return R},Q.apply(this,arguments)};function J(R){var L=typeof Symbol=="function"&&R[Symbol.iterator],Z=0;return L?L.call(R):{next:function(){return R&&Z>=R.length&&(R=void 0),{value:R&&R[Z++],done:!R}}}}function ie(R,L){var Z=typeof Symbol=="function"&&R[Symbol.iterator];if(!Z)return R;var fe,Re,st=Z.call(R),It=[];try{for(;(L===void 0||L-- >0)&&!(fe=st.next()).done;)It.push(fe.value)}catch(bn){Re={error:bn}}finally{try{fe&&!fe.done&&(Z=st.return)&&Z.call(st)}finally{if(Re)throw Re.error}}return It}function Se(){for(var R=[],L=0;L<arguments.length;L++)R=R.concat(ie(arguments[L]));return R}var Ae=Symbol("mobx did run lazy initializers"),ke=Symbol("mobx pending decorators"),De={},ze={};function Ye(R,L){var Z=L?De:ze;return Z[R]||(Z[R]={configurable:!0,enumerable:L,get:function(){return Be(this),this[R]},set:function(fe){Be(this),this[R]=fe}})}function Be(R){var L,Z;if(R[Ae]!==!0){var fe=R[ke];if(fe){S(R,Ae,!0);var Re=Se(Object.getOwnPropertySymbols(fe),Object.keys(fe));try{for(var st=J(Re),It=st.next();!It.done;It=st.next()){var bn=fe[It.value];bn.propertyCreator(R,bn.prop,bn.descriptor,bn.decoratorTarget,bn.decoratorArguments)}}catch(Jn){L={error:Jn}}finally{try{It&&!It.done&&(Z=st.return)&&Z.call(st)}finally{if(L)throw L.error}}}}}function Je(R,L){return function(){var Z,fe=function(Re,st,It,bn){if(bn===!0)return L(Re,st,It,Re,Z),null;if(!Object.prototype.hasOwnProperty.call(Re,ke)){var Jn=Re[ke];S(Re,ke,Q({},Jn))}return Re[ke][st]={prop:st,propertyCreator:L,descriptor:It,decoratorTarget:Re,decoratorArguments:Z},Ye(st,R)};return gt(arguments)?(Z=l,fe.apply(null,arguments)):(Z=Array.prototype.slice.call(arguments),fe)}}function gt(R){return(R.length===2||R.length===3)&&(typeof R[1]=="string"||typeof R[1]=="symbol")||R.length===4&&R[3]===!0}function se(R,L,Z){return ra(R)?R:Array.isArray(R)?zt.array(R,{name:Z}):E(R)?zt.object(R,void 0,{name:Z}):C(R)?zt.map(R,{name:Z}):$(R)?zt.set(R,{name:Z}):R}function Ze(R){return R}function pe(R){v(R);var L=Je(!0,(function(fe,Re,st,It,bn){var Jn=st?st.initializer?st.initializer.call(fe):st.value:void 0;ss(fe).addObservableProp(Re,Jn,R)})),Z=(i!==void 0&&i.env,L);return Z.enhancer=R,Z}var le={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function we(R){return R==null?le:typeof R=="string"?{name:R,deep:!0,proxy:!0}:R}Object.freeze(le);var $e=pe(se),rt=pe((function(R,L,Z){return R==null||ia(R)||Es(R)||Wi(R)||Ki(R)?R:Array.isArray(R)?zt.array(R,{name:Z,deep:!1}):E(R)?zt.object(R,void 0,{name:Z,deep:!1}):C(R)?zt.map(R,{name:Z,deep:!1}):$(R)?zt.set(R,{name:Z,deep:!1}):h(!1)})),pt=pe(Ze),Lt=pe((function(R,L,Z){return un(R,L)?L:R}));function Jt(R){return R.defaultDecorator?R.defaultDecorator.enhancer:R.deep===!1?Ze:se}var en={box:function(R,L){arguments.length>2&&it("box");var Z=we(L);return new In(R,Jt(Z),Z.name,!0,Z.equals)},array:function(R,L){arguments.length>2&&it("array");var Z=we(L);return Kl(R,Jt(Z),Z.name)},map:function(R,L){arguments.length>2&&it("map");var Z=we(L);return new sf(R,Jt(Z),Z.name)},set:function(R,L){arguments.length>2&&it("set");var Z=we(L);return new ol(R,Jt(Z),Z.name)},object:function(R,L,Z){typeof arguments[1]=="string"&&it("object");var fe=we(Z);if(fe.proxy===!1)return sr({},R,L,fe);var Re=qr(fe),st=sr({},void 0,void 0,fe),It=bu(st);return na(It,R,L,Re),It},ref:pt,shallow:rt,deep:$e,struct:Lt},zt=function(R,L,Z){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return $e.apply(null,arguments);if(ra(R))return R;var fe=E(R)?zt.object(R,L,Z):Array.isArray(R)?zt.array(R,L):C(R)?zt.map(R,L):$(R)?zt.set(R,L):R;if(fe!==R)return fe;h(!1)};function it(R){h("Expected one or two arguments to observable."+R+". Did you accidentally try to use observable."+R+" as decorator?")}Object.keys(en).forEach((function(R){return zt[R]=en[R]}));var ae,re,je=Je(!1,(function(R,L,Z,fe,Re){var st=Z.get,It=Z.set,bn=Re[0]||{};ss(R).addComputedProp(R,L,Q({get:st,set:It,context:R},bn))})),vt=je({equals:Y.structural}),q=function(R,L,Z){if(typeof L=="string"||R!==null&&typeof R=="object"&&arguments.length===1)return je.apply(null,arguments);var fe=typeof L=="object"?L:{};return fe.get=R,fe.set=typeof L=="function"?L:fe.set,fe.name=fe.name||R.name||"",new wo(fe)};q.struct=vt,(function(R){R[R.NOT_TRACKING=-1]="NOT_TRACKING",R[R.UP_TO_DATE=0]="UP_TO_DATE",R[R.POSSIBLY_STALE=1]="POSSIBLY_STALE",R[R.STALE=2]="STALE"})(ae||(ae={})),(function(R){R[R.NONE=0]="NONE",R[R.LOG=1]="LOG",R[R.BREAK=2]="BREAK"})(re||(re={}));var Pt=function(R){this.cause=R};function Rt(R){return R instanceof Pt}function Gt(R){switch(R.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=R.observing,Re=fe.length,st=0;st<Re;st++){var It=fe[st];if(oo(It)){if(Sn.disableErrorBoundaries)It.get();else try{It.get()}catch{return dt(Z),Tt(L),!0}if(R.dependenciesState===ae.STALE)return dt(Z),Tt(L),!0}}return En(R),dt(Z),Tt(L),!1}}function kn(){return Sn.trackingDerivation!==null}function qt(R){var L=R.observers.size>0;Sn.computationDepth>0&&L&&h(!1),Sn.allowStateChanges||!L&&Sn.enforceActions!=="strict"||h(!1)}function On(R,L,Z){var fe=At(!0);En(R),R.newObserving=new Array(R.observing.length+100),R.unboundDepsCount=0,R.runId=++Sn.runId;var Re,st=Sn.trackingDerivation;if(Sn.trackingDerivation=R,Sn.disableErrorBoundaries===!0)Re=L.call(Z);else try{Re=L.call(Z)}catch(It){Re=new Pt(It)}return Sn.trackingDerivation=st,(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,Tl(So,It))}no!==ae.UP_TO_DATE&&(It.dependenciesState=no,It.onBecomeStale())})(R),Tt(fe),Re}function Pe(R){var L=R.observing;R.observing=[];for(var Z=L.length;Z--;)Oo(L[Z],R);R.dependenciesState=ae.NOT_TRACKING}function Ke(R){var L=Le();try{return R()}finally{dt(L)}}function Le(){var R=Sn.trackingDerivation;return Sn.trackingDerivation=null,R}function dt(R){Sn.trackingDerivation=R}function At(R){var L=Sn.allowStateReads;return Sn.allowStateReads=R,L}function Tt(R){Sn.allowStateReads=R}function En(R){if(R.dependenciesState!==ae.UP_TO_DATE){R.dependenciesState=ae.UP_TO_DATE;for(var L=R.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 yo(R,L,Z){var fe=function(){return ho(R,L,Z||this,arguments)};return fe.isMobxAction=!0,fe}function ho(R,L,Z,fe){var Re=Nn();try{return L.apply(Z,fe)}catch(st){throw Re.error=st,st}finally{qn(Re)}}function Nn(R,L,Z){var fe=0,Re=Le();Ui();var st={prevDerivation:Re,prevAllowStateChanges:ut(!0),prevAllowStateReads:At(!0),notifySpy:!1,startTime:fe,actionId:ao++,parentActionId:Zn};return Zn=st.actionId,st}function qn(R){Zn!==R.actionId&&h("invalid action stack. did you forget to finish an action?"),Zn=R.parentActionId,R.error!==void 0&&(Sn.suppressReactionErrors=!0),vn(R.prevAllowStateChanges),Tt(R.prevAllowStateReads),gr(),dt(R.prevDerivation),R.notifySpy,Sn.suppressReactionErrors=!1}function rr(R,L){var Z,fe=ut(R);try{Z=L()}finally{vn(fe)}return Z}function ut(R){var L=Sn.allowStateChanges;return Sn.allowStateChanges=R,L}function vn(R){Sn.allowStateChanges=R}var In=(function(R){function L(Z,fe,Re,st,It){Re===void 0&&(Re="ObservableValue@"+f()),It===void 0&&(It=Y.default);var bn=R.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,R),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 ws(this,Z)},L.prototype.observe=function(Z,fe){return fe&&Z({object:this,type:"update",newValue:this.value,oldValue:void 0}),Fs(this,Z)},L.prototype.toJSON=function(){return this.get()},L.prototype.toString=function(){return this.name+"["+this.value+"]"},L.prototype.valueOf=function(){return B(this.get())},L.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},L})(V),lr=M("ObservableValue",In),wo=(function(){function R(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 Pt(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=yo(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 R.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)},R.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(L){return L()}))},R.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(L){return L()}))},R.prototype.get=function(){this.isComputing&&h("Cycle detected in computation "+this.name+": "+this.derivation),Sn.inBatch!==0||this.observers.size!==0||this.keepAlive?(ms(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),gr());var L=this.value;if(Rt(L))throw L.cause;return L},R.prototype.peek=function(){var L=this.computeValue(!1);if(Rt(L))throw L.cause;return L},R.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)},R.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},R.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 Pt(fe)}return Sn.computationDepth--,this.isComputing=!1,Z},R.prototype.suspend=function(){this.keepAlive||(Pe(this),this.value=void 0)},R.prototype.observe=function(L,Z){var fe=this,Re=!0,st=void 0;return ht((function(){var It=fe.get();if(!Re||Z){var bn=Le();L({type:"update",object:fe,newValue:It,oldValue:st}),dt(bn)}Re=!1,st=It}))},R.prototype.warnAboutUntrackedRead=function(){},R.prototype.toJSON=function(){return this.get()},R.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},R.prototype.valueOf=function(){return B(this.get())},R.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},R})(),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 R=Yi();return R.__mobxInstanceCount>0&&!R.__mobxGlobals&&(fa=!1),R.__mobxGlobals&&R.__mobxGlobals.version!==new ta().version&&(fa=!1),fa?R.__mobxGlobals?(R.__mobxInstanceCount+=1,R.__mobxGlobals.UNCHANGED||(R.__mobxGlobals.UNCHANGED={}),R.__mobxGlobals):(R.__mobxInstanceCount=1,R.__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 Tl(R,L){R.observers.add(L),R.lowestObserverState>L.dependenciesState&&(R.lowestObserverState=L.dependenciesState)}function Oo(R,L){R.observers.delete(L),R.observers.size===0&&el(R)}function el(R){R.isPendingUnobservation===!1&&(R.isPendingUnobservation=!0,Sn.pendingUnobservations.push(R))}function Ui(){Sn.inBatch++}function gr(){if(--Sn.inBatch==0){gs();for(var R=Sn.pendingUnobservations,L=0;L<R.length;L++){var Z=R[L];Z.isPendingUnobservation=!1,Z.observers.size===0&&(Z.isBeingObserved&&(Z.isBeingObserved=!1,Z.onBecomeUnobserved()),Z instanceof wo&&Z.suspend())}Sn.pendingUnobservations=[]}}function ms(R){var L=Sn.trackingDerivation;return L!==null?(L.runId!==R.lastAccessedBy&&(R.lastAccessedBy=L.runId,L.newObserving[L.unboundDepsCount++]=R,R.isBeingObserved||(R.isBeingObserved=!0,R.onBecomeObserved())),!0):(R.observers.size===0&&Sn.inBatch>0&&el(R),!1)}function pa(R,L){if(R.isTracing===re.BREAK){var Z=[];qi(vi(R),Z,1),new Function(`debugger;
/*
Tracing '`+R.name+`'
You are entering this break point because derivation '`+R.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.
`+(R instanceof wo?R.derivation.toString().replace(/[*]\//g,"/"):"")+`
The dependencies for this derivation are:
`+Z.join(`
`)+`
*/
`)()}}function qi(R,L,Z){L.length>=1e3?L.push("(and many more)"):(L.push(""+new Array(Z).join(" ")+R.name),R.dependencies&&R.dependencies.forEach((function(fe){return qi(fe,L,Z+1)})))}var Na=(function(){function R(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 R.prototype.onBecomeStale=function(){this.schedule()},R.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Sn.pendingReactions.push(this),gs())},R.prototype.isScheduled=function(){return this._isScheduled},R.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)}}gr()}},R.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&&Pe(this),Rt(Z)&&this.reportExceptionInDerivation(Z.cause),gr()}},R.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)}))}},R.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ui(),Pe(this),gr()))},R.prototype.getDisposer=function(){var L=this.dispose.bind(this);return L[I]=this,L},R.prototype.toString=function(){return"Reaction["+this.name+"]"},R.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 st=Mo(Z);if(!st)return h(!1);st.isTracing,re.NONE,st.isTracing=Re?re.BREAK:re.LOG})(this,L)},R})(),as=function(R){return R()};function gs(){Sn.inBatch>0||Sn.isRunningReactions||as(Cl)}function Cl(){Sn.isRunningReactions=!0;for(var R=Sn.pendingReactions,L=0;R.length>0;){++L==100&&R.splice(0);for(var Z=R.splice(0),fe=0,Re=Z.length;fe<Re;fe++)Z[fe].runReaction()}Sn.isRunningReactions=!1}var ys=M("Reaction",Na);function tl(R){var L=as;as=function(Z){return R((function(){return L(Z)}))}}function ve(R){return function(){}}function mt(){h(!1)}function cn(R){return function(L,Z,fe){if(fe){if(fe.value)return{value:yo(R,fe.value),enumerable:!1,configurable:!0,writable:!0};var Re=fe.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return yo(R,Re.call(this))}}}return Kn(R).apply(this,arguments)}}function Kn(R){return function(L,Z,fe){Object.defineProperty(L,Z,{configurable:!0,enumerable:!1,get:function(){},set:function(Re){S(this,Z,br(R,Re))}})}}var br=function(R,L,Z,fe){return arguments.length===1&&typeof R=="function"?yo(R.name||"<unnamed action>",R):arguments.length===2&&typeof L=="function"?yo(R,L):arguments.length===1&&typeof R=="string"?cn(R):fe!==!0?cn(L).apply(null,arguments):void S(R,L,yo(R.name||L,Z.value,this))};function lo(R,L){return ho(typeof R=="string"?R:R.name||"<unnamed action>",typeof R=="function"?R:L,this,void 0)}function li(R){return typeof R=="function"&&R.isMobxAction===!0}function ye(R,L,Z){S(R,L,yo(L,Z.bind(R)))}function ht(R,L){L===void 0&&(L=s);var Z,fe=L&&L.name||R.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),st=!1;Z=new Na(fe,(function(){st||(st=!0,Re((function(){st=!1,Z.isDisposed||Z.track(It)})))}),L.onError,L.requiresObservable)}function It(){R(Z)}return Z.schedule(),Z.getDisposer()}br.bound=function(R,L,Z,fe){return fe===!0?(ye(R,L,Z.value),null):Z?{configurable:!0,enumerable:!1,get:function(){return ye(this,L,Z.value||Z.initializer.call(this)),this[L]},set:mt}:{enumerable:!1,configurable:!0,set:function(Re){ye(this,L,Re)},get:function(){}}};var fn=function(R){return R()};function Rn(R){return R.scheduler?R.scheduler:R.delay?function(L){return setTimeout(L,R.delay)}:fn}function Cn(R,L,Z){Z===void 0&&(Z=s);var fe,Re,st,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?us():Do||(Do=!0,no(us))}),Z.onError,Z.requiresObservable);function us(){if(Do=!1,!So.isDisposed){var wi=!1;So.track((function(){var es=R(So);wi=$n||!Kr(st,es),st=es})),$n&&Z.fireImmediately&&bn(st,So),$n||wi!==!0||bn(st,So),$n&&($n=!1)}}return So.schedule(),So.getDisposer()}function nr(R,L,Z){return Mn("onBecomeUnobserved",R,L,Z)}function Mn(R,L,Z,fe){var Re=typeof fe=="function"?ls(L,Z):ls(L),st=typeof fe=="function"?fe:Z,It=R+"Listeners";return Re[It]?Re[It].add(st):Re[It]=new Set([st]),typeof Re[R]!="function"?h(!1):function(){var bn=Re[It];bn&&(bn.delete(st),bn.size===0&&delete Re[It])}}function or(R){var L=R.enforceActions,Z=R.computedRequiresReaction,fe=R.computedConfigurable,Re=R.disableErrorBoundaries,st=R.reactionScheduler,It=R.reactionRequiresObservable,bn=R.observableRequiresReaction;if(R.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),st&&tl(st)}function sr(R,L,Z,fe){var Re=qr(fe=we(fe));return Be(R),ss(R,fe.name,Re.enhancer),L&&na(R,L,Z,Re),R}function qr(R){return R.defaultDecorator||(R.deep===!1?pt:$e)}function na(R,L,Z,fe){var Re,st;Ui();try{var It=F(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)(R,no,$n,!0);Do&&Object.defineProperty(R,no,Do)}}catch(Kr){Re={error:Kr}}finally{try{Jn&&!Jn.done&&(st=bn.return)&&st.call(bn)}finally{if(Re)throw Re.error}}}finally{gr()}}function vi(R,L){return _s(ls(R,L))}function _s(R){var L,Z,fe={name:R.name};return R.observing&&R.observing.length>0&&(fe.dependencies=(L=R.observing,Z=[],L.forEach((function(Re){Z.indexOf(Re)===-1&&Z.push(Re)})),Z).map(_s)),fe}var Vi=0;function Nl(){this.message="FLOW_CANCELLED"}function Is(R){arguments.length!==1&&h("Flow expects 1 argument and cannot be used as decorator");var L=R.name||"<unnamed flow>";return function(){var Z,fe=this,Re=arguments,st=++Vi,It=br(L+" - runid: "+st+" - init",R).apply(fe,Re),bn=void 0,Jn=new Promise((function(no,$n){var Do=0;function Kr(wi){var es;bn=void 0;try{es=br(L+" - runid: "+st+" - yield "+Do++,It.next).call(It,wi)}catch(Pl){return $n(Pl)}us(es)}function So(wi){var es;bn=void 0;try{es=br(L+" - runid: "+st+" - yield "+Do++,It.throw).call(It,wi)}catch(Pl){return $n(Pl)}us(es)}function us(wi){if(!wi||typeof wi.then!="function")return wi.done?no(wi.value):(bn=Promise.resolve(wi.value)).then(Kr,So);wi.then(us,$n)}Z=$n,Kr(void 0)}));return Jn.cancel=br(L+" - runid: "+st+" - cancel",(function(){try{bn&&Ro(bn);var no=It.return(void 0),$n=Promise.resolve(no.value);$n.then(w,w),Ro($n),Z(new Nl)}catch(Do){Z(Do)}})),Jn}}function Ro(R){typeof R.cancel=="function"&&R.cancel()}function La(R,L){if(R==null)return!1;if(L!==void 0){if(ia(R)===!1||!R[I].values.has(L))return!1;var Z=ls(R,L);return oo(Z)}return oo(R)}function od(R){return arguments.length>1?h(!1):La(R)}function _u(R,L){return typeof L!="string"?h(!1):La(R,L)}function Ia(R,L){return R!=null&&(L!==void 0?!!ia(R)&&R[I].values.has(L):ia(R)||!!R[I]||z(R)||ys(R)||oo(R))}function ra(R){return arguments.length!==1&&h(!1),Ia(R)}function bs(R){return ia(R)?R[I].getKeys():Wi(R)||Ki(R)?Array.from(R.keys()):Es(R)?R.map((function(L,Z){return Z})):h(!1)}function qo(R){return ia(R)?bs(R).map((function(L){return R[L]})):Wi(R)?bs(R).map((function(L){return R.get(L)})):Ki(R)?Array.from(R.values()):Es(R)?R.slice():h(!1)}function Uh(R){return ia(R)?bs(R).map((function(L){return[L,R[L]]})):Wi(R)?bs(R).map((function(L){return[L,R.get(L)]})):Ki(R)?Array.from(R.entries()):Es(R)?R.map((function(L,Z){return[Z,L]})):h(!1)}function Fa(R,L,Z){if(arguments.length!==2||Ki(R))if(ia(R)){var fe=R[I],Re=fe.values.get(L);Re?fe.write(L,Z):fe.addObservableProp(L,Z,fe.defaultEnhancer)}else if(Wi(R))R.set(L,Z);else if(Ki(R))R.add(L);else{if(!Es(R))return h(!1);typeof L!="number"&&(L=parseInt(L,10)),v(L>=0,"Not a valid index: '"+L+"'"),Ui(),L>=R.length&&(R.length=L+1),R[L]=Z,gr()}else{Ui();var st=L;try{for(var It in st)Fa(R,It,st[It])}finally{gr()}}}function gp(R,L,Z,fe){return typeof Z=="function"?(function(Re,st,It,bn){return Pa(Re,st).observe(It,bn)})(R,L,Z,fe):(function(Re,st,It){return Pa(Re).observe(st,It)})(R,L,Z)}Nl.prototype=Object.create(Error.prototype);var yp={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ba(R,L,Z,fe){return fe.detectCycles&&R.set(L,Z),Z}function Za(R,L,Z){if(!L.recurseEverything&&!ra(R)||typeof R!="object")return R;if(R===null)return null;if(R instanceof Date)return R;if(lr(R))return Za(R.get(),L,Z);if(ra(R)&&bs(R),L.detectCycles===!0&&R!==null&&Z.has(R))return Z.get(R);if(Es(R)||Array.isArray(R)){var fe=Ba(Z,R,[],L),Re=R.map((function(Kr){return Za(Kr,L,Z)}));fe.length=Re.length;for(var st=0,It=Re.length;st<It;st++)fe[st]=Re[st];return fe}if(Ki(R)||Object.getPrototypeOf(R)===Set.prototype){if(L.exportMapsAsObjects===!1){var bn=Ba(Z,R,new Set,L);return R.forEach((function(Kr){bn.add(Za(Kr,L,Z))})),bn}var Jn=Ba(Z,R,[],L);return R.forEach((function(Kr){Jn.push(Za(Kr,L,Z))})),Jn}if(Wi(R)||Object.getPrototypeOf(R)===Map.prototype){if(L.exportMapsAsObjects===!1){var no=Ba(Z,R,new Map,L);return R.forEach((function(Kr,So){no.set(So,Za(Kr,L,Z))})),no}var $n=Ba(Z,R,{},L);return R.forEach((function(Kr,So){$n[So]=Za(Kr,L,Z)})),$n}var Do=Ba(Z,R,{},L);return D(R).forEach((function(Kr){Do[Kr]=Za(R[Kr],L,Z)})),Do}function rf(R,L){var Z;return typeof L=="boolean"&&(L={detectCycles:L}),L||(L=yp),L.detectCycles=L.detectCycles===void 0?L.recurseEverything===!0:L.detectCycles===!0,L.detectCycles&&(Z=new Map),Za(R,L,Z)}function Mo(R){switch(R.length){case 0:return Sn.trackingDerivation;case 1:return ls(R[0]);case 2:return ls(R[0],R[1])}}function oa(R,L){L===void 0&&(L=void 0),Ui();try{return R.apply(L)}finally{gr()}}function id(R,L,Z){return arguments.length===1||L&&typeof L=="object"?of(R,L):_p(R,L,Z||{})}function _p(R,L,Z){var fe;typeof Z.timeout=="number"&&(fe=setTimeout((function(){if(!st[I].isDisposed){st();var It=new Error("WHEN_TIMEOUT");if(!Z.onError)throw It;Z.onError(It)}}),Z.timeout)),Z.name=Z.name||"When@"+f();var Re=yo(Z.name+"-effect",L),st=ht((function(It){R()&&(It.dispose(),fe&&clearTimeout(fe),Re())}),Z);return st}function of(R,L){var Z,fe=new Promise((function(Re,st){var It=_p(R,Re,Q(Q({},L),{onError:st}));Z=function(){It(),st("WHEN_CANCELLED")}}));return fe.cancel=Z,fe}function ad(R){return R[I]}function nl(R){return typeof R=="string"||typeof R=="number"||typeof R=="symbol"}var $a={has:function(R,L){if(L===I||L==="constructor"||L===Ae)return!0;var Z=ad(R);return nl(L)?Z.has(L):L in R},get:function(R,L){if(L===I||L==="constructor"||L===Ae)return R[L];var Z=ad(R),fe=Z.values.get(L);if(fe instanceof V){var Re=fe.get();return Re===void 0&&Z.has(L),Re}return nl(L)&&Z.has(L),R[L]},set:function(R,L,Z){return!!nl(L)&&(Fa(R,L,Z),!0)},deleteProperty:function(R,L){return!!nl(L)&&(ad(R).remove(L),!0)},ownKeys:function(R){return ad(R).keysAtom.reportObserved(),Reflect.ownKeys(R)},preventExtensions:function(R){return h("Dynamic observable objects cannot be frozen"),!1}};function bu(R){var L=new Proxy(R,$a);return R[I].proxy=L,L}function Ja(R){return R.interceptors!==void 0&&R.interceptors.length>0}function ws(R,L){var Z=R.interceptors||(R.interceptors=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function vo(R,L){var Z=Le();try{for(var fe=Se(R.interceptors||[]),Re=0,st=fe.length;Re<st&&(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(R){return R.changeListeners!==void 0&&R.changeListeners.length>0}function Fs(R,L){var Z=R.changeListeners||(R.changeListeners=[]);return Z.push(L),b((function(){var fe=Z.indexOf(L);fe!==-1&&Z.splice(fe,1)}))}function ha(R,L){var Z=Le(),fe=R.changeListeners;if(fe){for(var Re=0,st=(fe=fe.slice()).length;Re<st;Re++)fe[Re](L);dt(Z)}}var wu={get:function(R,L){return L===I?R[I]:L==="length"?R[I].getArrayLength():typeof L=="number"?ui.get.call(R,L):typeof L!="string"||isNaN(L)?ui.hasOwnProperty(L)?ui[L]:R[L]:ui.get.call(R,parseInt(L))},set:function(R,L,Z){return L==="length"&&R[I].setArrayLength(Z),typeof L=="number"&&ui.set.call(R,L,Z),typeof L=="symbol"||isNaN(L)?R[L]=Z:ui.set.call(R,parseInt(L),Z),!0},preventExtensions:function(R){return h("Observable arrays cannot be frozen"),!1}};function Kl(R,L,Z,fe){Z===void 0&&(Z="ObservableArray@"+f()),fe===void 0&&(fe=!1);var Re,st,It,bn=new Bs(Z,L,fe);Re=bn.values,st=I,It=bn,Object.defineProperty(Re,st,{enumerable:!1,writable:!1,configurable:!0,value:It});var Jn=new Proxy(bn.values,wu);if(bn.proxy=Jn,R&&R.length){var no=ut(!0);bn.spliceWithArray(0,0,R),vn(no)}return Jn}var Bs=(function(){function R(L,Z,fe){this.owned=fe,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new V(L||"ObservableArray@"+f()),this.enhancer=function(Re,st){return Z(Re,st,L+"[..]")}}return R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.dehanceValues=function(L){return this.dehancer!==void 0&&L.length>0?L.map(this.dehancer):L},R.prototype.intercept=function(L){return ws(this,L)},R.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}),Fs(this,L)},R.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},R.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)},R.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},R.prototype.spliceWithArray=function(L,Z,fe){var Re=this;qt(this.atom);var st=this.values.length;if(L===void 0?L=0:L>st?L=st:L<0&&(L=Math.max(0,st+L)),Z=arguments.length===1?st-L:Z==null?0:Math.max(0,Math.min(Z,st-L)),fe===void 0&&(fe=l),Ja(this)){var It=vo(this,{object:this.proxy,type:"splice",index:L,removedCount:Z,added:fe});if(!It)return l;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)},R.prototype.spliceItemsIntoValues=function(L,Z,fe){var Re;if(fe.length<1e4)return(Re=this.values).splice.apply(Re,Se([L,Z],fe));var st=this.values.slice(L,L+Z);return this.values=this.values.slice(0,L).concat(fe,this.values.slice(L+Z)),st},R.prototype.notifyArrayChildUpdate=function(L,Z,fe){var Re=!this.owned&&!1,st=Ua(this),It=st||Re?{object:this.proxy,type:"update",index:L,newValue:Z,oldValue:fe}:null;this.atom.reportChanged(),st&&ha(this,It)},R.prototype.notifyArraySplice=function(L,Z,fe){var Re=!this.owned&&!1,st=Ua(this),It=st||Re?{object:this.proxy,type:"splice",index:L,removed:fe,added:Z,removedCount:fe.length,addedCount:Z.length}:null;this.atom.reportChanged(),st&&ha(this,It)},R})(),ui={intercept:function(R){return this[I].intercept(R)},observe:function(R,L){return L===void 0&&(L=!1),this[I].observe(R,L)},clear:function(){return this.splice(0)},replace:function(R){var L=this[I];return L.spliceWithArray(0,L.values.length,R)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(R,L){for(var Z=[],fe=2;fe<arguments.length;fe++)Z[fe-2]=arguments[fe];var Re=this[I];switch(arguments.length){case 0:return[];case 1:return Re.spliceWithArray(R);case 2:return Re.spliceWithArray(R,L)}return Re.spliceWithArray(R,L,Z)},spliceWithArray:function(R,L,Z){return this[I].spliceWithArray(R,L,Z)},push:function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var Z=this[I];return Z.spliceWithArray(Z.values.length,0,R),Z.values.length},pop:function(){return this.splice(Math.max(this[I].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var R=[],L=0;L<arguments.length;L++)R[L]=arguments[L];var Z=this[I];return Z.spliceWithArray(0,0,R),Z.values.length},reverse:function(){var R=this.slice();return R.reverse.apply(R,arguments)},sort:function(R){var L=this.slice();return L.sort.apply(L,arguments)},remove:function(R){var L=this[I],Z=L.dehanceValues(L.values).indexOf(R);return Z>-1&&(this.splice(Z,1),!0)},get:function(R){var L=this[I];if(L&&R<L.values.length)return L.atom.reportObserved(),L.dehanceValue(L.values[R])},set:function(R,L){var Z=this[I],fe=Z.values;if(R<fe.length){qt(Z.atom);var Re=fe[R];if(Ja(Z)){var st=vo(Z,{type:"update",object:Z.proxy,index:R,newValue:L});if(!st)return;L=st.newValue}(L=Z.enhancer(L,Re))!==Re&&(fe[R]=L,Z.notifyArrayChildUpdate(R,L,Re))}else{if(R!==fe.length)throw new Error("[mobx.array] Index out of bounds, "+R+" is larger than "+fe.length);Z.spliceWithArray(R,0,[L])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(R){typeof Array.prototype[R]=="function"&&(ui[R]=function(){var L=this[I];L.atom.reportObserved();var Z=L.dehanceValues(L.values);return Z[R].apply(Z,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(R){typeof Array.prototype[R]=="function"&&(ui[R]=function(L,Z){var fe=this,Re=this[I];return Re.atom.reportObserved(),Re.dehanceValues(Re.values)[R]((function(st,It){return L.call(Z,st,It,fe)}),Z)})})),["reduce","reduceRight"].forEach((function(R){ui[R]=function(){var L=this,Z=this[I];Z.atom.reportObserved();var fe=arguments[0];return arguments[0]=function(Re,st,It){return st=Z.dehanceValue(st),fe(Re,st,It,L)},Z.values[R].apply(Z.values,arguments)}}));var ic,rl=M("ObservableArrayAdministration",Bs);function Es(R){return O(R)&&rl(R[I])}var af,Vh={},sf=(function(){function R(L,Z,fe){if(Z===void 0&&(Z=se),fe===void 0&&(fe="ObservableMap@"+f()),this.enhancer=Z,this.name=fe,this[ic]=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 R.prototype._has=function(L){return this._data.has(L)},R.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 In(this._has(L),Ze,this.name+"."+k(L)+"?",!1);this._hasMap.set(L,Re),nr(Re,(function(){return Z._hasMap.delete(L)}))}return fe.get()},R.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},R.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},R.prototype._updateHasMapEntry=function(L,Z){var fe=this._hasMap.get(L);fe&&fe.setNewValue(Z)},R.prototype._updateValue=function(L,Z){var fe=this._data.get(L);if((Z=fe.prepareNewValue(Z))!==Sn.UNCHANGED){var Re=Ua(this),st=Re?{type:"update",object:this,oldValue:fe.value,name:L,newValue:Z}:null;fe.setNewValue(Z),Re&&ha(this,st)}},R.prototype._addValue=function(L,Z){var fe=this;qt(this._keysAtom),oa((function(){var It=new In(Z,fe.enhancer,fe.name+"."+k(L),!1);fe._data.set(L,It),Z=It.value,fe._updateHasMapEntry(L,!0),fe._keysAtom.reportChanged()}));var Re=Ua(this),st=Re?{type:"add",object:this,name:L,newValue:Z}:null;Re&&ha(this,st)},R.prototype.get=function(L){return this.has(L)?this.dehanceValue(this._data.get(L).get()):this.dehanceValue(void 0)},R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},R.prototype.values=function(){var L=this,Z=this.keys();return mo({next:function(){var fe=Z.next(),Re=fe.done,st=fe.value;return{done:Re,value:Re?void 0:L.get(st)}}})},R.prototype.entries=function(){var L=this,Z=this.keys();return mo({next:function(){var fe=Z.next(),Re=fe.done,st=fe.value;return{done:Re,value:Re?void 0:[st,L.get(st)]}}})},R.prototype[ic=I,Symbol.iterator]=function(){return this.entries()},R.prototype.forEach=function(L,Z){var fe,Re;try{for(var st=J(this),It=st.next();!It.done;It=st.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=st.return)&&Re.call(st)}finally{if(fe)throw fe.error}}},R.prototype.merge=function(L){var Z=this;return Wi(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{E(L)?D(L).forEach((function(Re){return Z.set(Re,L[Re])})):Array.isArray(L)?L.forEach((function(Re){var st=ie(Re,2),It=st[0],bn=st[1];return Z.set(It,bn)})):C(L)?(L.constructor!==Map&&h("Cannot initialize from classes that inherit from Map: "+L.constructor.name),L.forEach((function(Re,st){return Z.set(st,Re)}))):L!=null&&h("Cannot initialize map from "+L)}finally{vn(fe)}})),this},R.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L.keys()),st=Re.next();!st.done;st=Re.next()){var It=st.value;L.delete(It)}}catch(bn){Z={error:bn}}finally{try{st&&!st.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},R.prototype.replace=function(L){var Z=this;return oa((function(){var fe,Re,st,It,bn=(function(Zi){if(C(Zi)||Wi(Zi))return Zi;if(Array.isArray(Zi))return new Map(Zi);if(E(Zi)){var Jl=new Map;for(var Rl in Zi)Jl.set(Rl,Zi[Rl]);return Jl}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 us=J(bn.entries()),wi=us.next();!wi.done;wi=us.next()){var es=ie(wi.value,2),Pl=(Kr=es[0],So=es[1],Z._data.has(Kr));if(Z.set(Kr,So),Z._data.has(Kr)){var kl=Z._data.get(Kr);Jn.set(Kr,kl),Pl||(no=!0)}}}catch(Zi){st={error:Zi}}finally{try{wi&&!wi.done&&(It=us.return)&&It.call(us)}finally{if(st)throw st.error}}if(!no)if(Z._data.size!==Jn.size)Z._keysAtom.reportChanged();else for(var Zl=Z._data.keys(),Eu=Jn.keys(),il=Zl.next(),xu=Eu.next();!il.done;){if(il.value!==xu.value){Z._keysAtom.reportChanged();break}il=Zl.next(),xu=Eu.next()}Z._data=Jn})),this},Object.defineProperty(R.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),R.prototype.toPOJO=function(){var L,Z,fe={};try{for(var Re=J(this),st=Re.next();!st.done;st=Re.next()){var It=ie(st.value,2),bn=It[0],Jn=It[1];fe[typeof bn=="symbol"?bn:k(bn)]=Jn}}catch(no){L={error:no}}finally{try{st&&!st.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},R.prototype.toJS=function(){return new Map(this)},R.prototype.toJSON=function(){return this.toPOJO()},R.prototype.toString=function(){var L=this;return this.name+"[{ "+Array.from(this.keys()).map((function(Z){return k(Z)+": "+L.get(Z)})).join(", ")+" }]"},R.prototype.observe=function(L,Z){return Fs(this,L)},R.prototype.intercept=function(L){return ws(this,L)},R})(),Wi=M("ObservableMap",sf),ac={},ol=(function(){function R(L,Z,fe){if(Z===void 0&&(Z=se),fe===void 0&&(fe="ObservableSet@"+f()),this.name=fe,this[af]=ac,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,st){return Z(Re,st,fe)},L&&this.replace(L)}return R.prototype.dehanceValue=function(L){return this.dehancer!==void 0?this.dehancer(L):L},R.prototype.clear=function(){var L=this;oa((function(){Ke((function(){var Z,fe;try{for(var Re=J(L._data.values()),st=Re.next();!st.done;st=Re.next()){var It=st.value;L.delete(It)}}catch(bn){Z={error:bn}}finally{try{st&&!st.done&&(fe=Re.return)&&fe.call(Re)}finally{if(Z)throw Z.error}}}))}))},R.prototype.forEach=function(L,Z){var fe,Re;try{for(var st=J(this),It=st.next();!It.done;It=st.next()){var bn=It.value;L.call(Z,bn,bn,this)}}catch(Jn){fe={error:Jn}}finally{try{It&&!It.done&&(Re=st.return)&&Re.call(st)}finally{if(fe)throw fe.error}}},Object.defineProperty(R.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),R.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},R.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},R.prototype.has=function(L){return this._atom.reportObserved(),this._data.has(this.dehanceValue(L))},R.prototype.entries=function(){var L=0,Z=Array.from(this.keys()),fe=Array.from(this.values());return mo({next:function(){var Re=L;return L+=1,Re<fe.length?{value:[Z[Re],fe[Re]],done:!1}:{done:!0}}})},R.prototype.keys=function(){return this.values()},R.prototype.values=function(){this._atom.reportObserved();var L=this,Z=0,fe=Array.from(this._data.values());return mo({next:function(){return Z<fe.length?{value:L.dehanceValue(fe[Z++]),done:!1}:{done:!0}}})},R.prototype.replace=function(L){var Z=this;return Ki(L)&&(L=L.toJS()),oa((function(){var fe=ut(!0);try{Array.isArray(L)||$(L)?(Z.clear(),L.forEach((function(Re){return Z.add(Re)}))):L!=null&&h("Cannot initialize set from "+L)}finally{vn(fe)}})),this},R.prototype.observe=function(L,Z){return Fs(this,L)},R.prototype.intercept=function(L){return ws(this,L)},R.prototype.toJS=function(){return new Set(this)},R.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},R.prototype[af=I,Symbol.iterator]=function(){return this.values()},R})(),Ki=M("ObservableSet",ol),lf=(function(){function R(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 V(fe+".keys")}return R.prototype.read=function(L){return this.values.get(L).get()},R.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 st=Ua(this),It=st?{type:"update",object:this.proxy||fe,oldValue:Re.value,name:L,newValue:Z}:null;Re.setNewValue(Z),st&&ha(this,It)}}},R.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 In(Re,Ze,this.name+"."+k(L)+"?",!1),Z.set(L,fe),fe.get()},R.prototype.addObservableProp=function(L,Z,fe){fe===void 0&&(fe=this.defaultEnhancer);var Re=this.target;if(Ja(this)){var st=vo(this,{object:this.proxy||Re,name:L,type:"add",newValue:Z});if(!st)return;Z=st.newValue}var It=new In(Z,fe,this.name+"."+k(L),!1);this.values.set(L,It),Z=It.value,Object.defineProperty(Re,L,(function(bn){return xs[bn]||(xs[bn]={configurable:!0,enumerable:!0,get:function(){return this[I].read(bn)},set:function(Jn){this[I].write(bn,Jn)}})})(L)),this.notifyPropertyAddition(L,Z)},R.prototype.addComputedProp=function(L,Z,fe){var Re,st,It,bn=this.target;fe.name=fe.name||this.name+"."+k(Z),this.values.set(Z,new wo(fe)),(L===bn||(Re=L,st=Z,!(It=Object.getOwnPropertyDescriptor(Re,st))||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))},R.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,st=this.values.get(L),It=st&&st.get();if(st&&st.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{gr()}}},R.prototype.illegalAccess=function(L,Z){},R.prototype.observe=function(L,Z){return Fs(this,L)},R.prototype.intercept=function(L){return ws(this,L)},R.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 st=this.pendingKeys.get(L);st&&st.set(!0)}this.keysAtom.reportChanged()},R.prototype.getKeys=function(){var L,Z;this.keysAtom.reportObserved();var fe=[];try{for(var Re=J(this.values),st=Re.next();!st.done;st=Re.next()){var It=ie(st.value,2),bn=It[0];It[1]instanceof In&&fe.push(bn)}}catch(Jn){L={error:Jn}}finally{try{st&&!st.done&&(Z=Re.return)&&Z.call(Re)}finally{if(L)throw L.error}}return fe},R})();function ss(R,L,Z){if(L===void 0&&(L=""),Z===void 0&&(Z=se),Object.prototype.hasOwnProperty.call(R,I))return R[I];E(R)||(L=(R.constructor.name||"ObservableObject")+"@"+f()),L||(L="ObservableObject@"+f());var fe=new lf(R,new Map,k(L),Z);return S(R,I,fe),fe}var xs=Object.create(null),sd=Object.create(null);function Va(R){var L=R[I];return L||(Be(R),R[I])}var Qa=M("ObservableObjectAdministration",lf);function ia(R){return!!O(R)&&(Be(R),Qa(R[I]))}function ls(R,L){if(typeof R=="object"&&R!==null){if(Es(R))return L!==void 0&&h(!1),R[I].atom;if(Ki(R))return R[I];if(Wi(R)){var Z=R;return L===void 0?Z._keysAtom:((fe=Z._data.get(L)||Z._hasMap.get(L))||h(!1),fe)}var fe;if(Be(R),L&&!R[I]&&R[L],ia(R))return L?((fe=R[I].values.get(L))||h(!1),fe):h(!1);if(z(R)||oo(R)||ys(R))return R}else if(typeof R=="function"&&ys(R[I]))return R[I];return h(!1)}function Pa(R,L){return R||h("Expecting some object"),L!==void 0?Pa(ls(R,L)):z(R)||oo(R)||ys(R)||Wi(R)||Ki(R)?R:(Be(R),R[I]?R[I]:void h(!1))}var Ct=Object.prototype.toString;function un(R,L,Z){return Z===void 0&&(Z=-1),dn(R,L,Z)}function dn(R,L,Z,fe,Re){if(R===L)return R!==0||1/R==1/L;if(R==null||L==null)return!1;if(R!=R)return L!=L;var st=typeof R;if(st!=="function"&&st!=="object"&&typeof L!="object")return!1;var It=Ct.call(R);if(It!==Ct.call(L))return!1;switch(It){case"[object RegExp]":case"[object String]":return""+R==""+L;case"[object Number]":return+R!=+R?+L!=+L:+R==0?1/+R==1/L:+R==+L;case"[object Date]":case"[object Boolean]":return+R==+L;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(R)===Symbol.valueOf.call(L);case"[object Map]":case"[object Set]":Z>=0&&Z++}R=Gn(R),L=Gn(L);var bn=It==="[object Array]";if(!bn){if(typeof R!="object"||typeof L!="object")return!1;var Jn=R.constructor,no=L.constructor;if(Jn!==no&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof no=="function"&&no instanceof no)&&"constructor"in R&&"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]===R)return Re[$n]===L;if(fe.push(R),Re.push(L),bn){if(($n=R.length)!==L.length)return!1;for(;$n--;)if(!dn(R[$n],L[$n],Z-1,fe,Re))return!1}else{var Do=Object.keys(R),Kr=void 0;if($n=Do.length,Object.keys(L).length!==$n)return!1;for(;$n--;)if(!Wr(L,Kr=Do[$n])||!dn(R[Kr],L[Kr],Z-1,fe,Re))return!1}return fe.pop(),Re.pop(),!0}function Gn(R){return Es(R)?R.slice():C(R)||Wi(R)||$(R)||Ki(R)?Array.from(R.entries()):R}function Wr(R,L){return Object.prototype.hasOwnProperty.call(R,L)}function mo(R){return R[Symbol.iterator]=ci,R}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(R,L){return(L!==void 0?ls(R,L):ia(R)||Wi(R)||Ki(R)?Pa(R):ls(R)).name}},$mobx:I})}).call(this,r(163),r(68))},function(n,o,r){var i=r(113),a=r(42),l=r(179);i||a(Object.prototype,"toString",l,{unsafe:!0})},function(n,o,r){var i=r(41),a=r(100),l=r(80),s=r(58),f=r(116),h="Array Iterator",v=s.set,b=s.getterFor(h);n.exports=f(Array,"Array",(function(w,O){v(this,{type:h,target:i(w),index:0,kind:O})}),(function(){var w=b(this),O=w.target,E=w.kind,S=w.index++;return!O||S>=O.length?(w.target=void 0,{value:void 0,done:!0}):E=="keys"?{value:S,done:!1}:E=="values"?{value:O[S],done:!1}:{value:[S,O[S]],done:!1}}),"values"),l.Arguments=l.Array,a("keys"),a("values"),a("entries")},function(n,o,r){var i=r(16),a=r(7),l=r(46),s=r(76),f=r(34),h=r(15),v=r(71),b=r(36),w=r(108),O=r(18),E=r(35),S=r(96),M=r(30),C=r(33),$=r(54),D=r(87),k=r(32),B=r(40),F=r(41),I=r(86),V=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),ke=r(98),De=r(42),ze=r(89),Ye=r(93),Be=r(72),Je=r(90),gt=r(28),se=r(140),Ze=r(141),pe=r(78),le=r(58),we=r(79).forEach,$e=Ye("hidden"),rt="Symbol",pt=gt("toPrimitive"),Lt=le.set,Jt=le.getterFor(rt),en=Object.prototype,zt=a.Symbol,it=zt&&zt.prototype,ae=a.TypeError,re=a.QObject,je=l("JSON","stringify"),vt=ie.f,q=Se.f,Pt=Q.f,Rt=Ae.f,Gt=h([].push),kn=ze("symbols"),qt=ze("op-symbols"),On=ze("string-to-symbol-registry"),Pe=ze("symbol-to-string-registry"),Ke=ze("wks"),Le=!re||!re.prototype||!re.prototype.findChild,dt=b&&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=kn[Nn]=X(it);return Lt(rr,{type:rt,tag:Nn,description:qn}),b||(rr.description=qn),rr},Tt=function(Nn,qn,rr){Nn===en&&Tt(qt,qn,rr),k(Nn);var ut=I(qn);return k(rr),E(kn,ut)?(rr.enumerable?(E(Nn,$e)&&Nn[$e][ut]&&(Nn[$e][ut]=!1),rr=X(rr,{enumerable:z(0,!1)})):(E(Nn,$e)||q(Nn,$e,z(1,{})),Nn[$e][ut]=!0),dt(Nn,ut,rr)):q(Nn,ut,rr)},En=function(Nn,qn){k(Nn);var rr=F(qn),ut=Y(rr).concat(yo(rr));return we(ut,(function(vn){b&&!f(Zn,rr,vn)||Tt(Nn,vn,rr[vn])})),Nn},Zn=function(Nn){var qn=I(Nn),rr=f(Rt,this,qn);return!(this===en&&E(kn,qn)&&!E(qt,qn))&&(!(rr||!E(this,qn)||!E(kn,qn)||E(this,$e)&&this[$e][qn])||rr)},ao=function(Nn,qn){var rr=F(Nn),ut=I(qn);if(rr!==en||!E(kn,ut)||E(qt,ut)){var vn=vt(rr,ut);return!vn||!E(kn,ut)||E(rr,$e)&&rr[$e][ut]||(vn.enumerable=!0),vn}},Lo=function(Nn){var qn=Pt(F(Nn)),rr=[];return we(qn,(function(ut){E(kn,ut)||E(Be,ut)||Gt(rr,ut)})),rr},yo=function(Nn){var qn=Nn===en,rr=Pt(qn?qt:F(Nn)),ut=[];return we(rr,(function(vn){!E(kn,vn)||qn&&!E(en,vn)||Gt(ut,kn[vn])})),ut};if(w||(zt=function(){if($(it,this))throw ae("Symbol is not a constructor");var Nn=arguments.length&&arguments[0]!==void 0?V(arguments[0]):void 0,qn=Je(Nn),rr=function(ut){this===en&&f(rr,qt,ut),E(this,$e)&&E(this[$e],qn)&&(this[$e][qn]=!1),dt(this,qn,z(1,ut))};return b&&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=yo,se.f=function(Nn){return At(gt(Nn),Nn)},b&&(q(it,"description",{configurable:!0,get:function(){return Jt(this).description}}),v||De(en,"propertyIsEnumerable",Zn,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!w,sham:!w},{Symbol:zt}),we(Y(Ke),(function(Nn){Ze(Nn)})),i({target:rt,stat:!0,forced:!w},{for:function(Nn){var qn=V(Nn);if(E(On,qn))return On[qn];var rr=zt(qn);return On[qn]=rr,Pe[rr]=qn,rr},keyFor:function(Nn){if(!D(Nn))throw ae(Nn+" is not a symbol");if(E(Pe,Nn))return Pe[Nn]},useSetter:function(){Le=!0},useSimple:function(){Le=!1}}),i({target:"Object",stat:!0,forced:!w,sham:!b},{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:!w},{getOwnPropertyNames:Lo,getOwnPropertySymbols:yo}),i({target:"Object",stat:!0,forced:O((function(){J.f(1)}))},{getOwnPropertySymbols:function(Nn){return J.f(B(Nn))}}),je&&i({target:"JSON",stat:!0,forced:!w||O((function(){var Nn=zt();return je([Nn])!="[null]"||je({a:Nn})!="{}"||je(Object(Nn))!="{}"}))},{stringify:function(Nn,qn,rr){var ut=ke(arguments),vn=qn;if((C(qn)||Nn!==void 0)&&!D(Nn))return S(qn)||(qn=function(In,lr){if(M(vn)&&(lr=f(vn,this,In,lr)),!D(lr))return lr}),ut[1]=qn,s(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),l=r(153),s=r(3),f=r(57),h=r(28),v=h("iterator"),b=h("toStringTag"),w=s.values,O=function(S,M){if(S){if(S[v]!==w)try{f(S,v,w)}catch{S[v]=w}if(S[b]||f(S,b,M),a[M]){for(var C in s)if(S[C]!==s[C])try{f(S,C,s[C])}catch{S[C]=s[C]}}}};for(var E in a)O(i[E]&&i[E].prototype,E);O(l,"DOMTokenList")},function(n,o,r){var i=r(151).charAt,a=r(39),l=r(58),s=r(116),f="String Iterator",h=l.set,v=l.getterFor(f);s(String,"String",(function(b){h(this,{type:f,string:a(b),index:0})}),(function(){var b,w=v(this),O=w.string,E=w.index;return E>=O.length?{value:void 0,done:!0}:(b=i(O,E),w.index+=b.length,{value:b,done:!1})}))},function(n,o,r){(function(i){var a=function(l){return l&&l.Math==Math&&l};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),l=r(7),s=r(15),f=r(35),h=r(30),v=r(54),b=r(39),w=r(38).f,O=r(134),E=l.Symbol,S=E&&E.prototype;if(a&&h(E)&&(!("description"in S)||E().description!==void 0)){var M={},C=function(){var V=arguments.length<1||arguments[0]===void 0?void 0:b(arguments[0]),z=v(S,this)?new E(V):V===void 0?E():E(V);return V===""&&(M[z]=!0),z};O(C,E),C.prototype=S,S.constructor=C;var $=String(E("test"))=="Symbol(test)",D=s(S.toString),k=s(S.valueOf),B=/^Symbol\((.*)\)[^)]+$/,F=s("".replace),I=s("".slice);w(S,"description",{configurable:!0,get:function(){var V=k(this),z=D(V);if(f(M,V))return"";var X=$?I(z,7,-1):F(z,B,"$1");return X===""?void 0:X}}),i({global:!0,forced:!0},{Symbol:C})}},function(n,o,r){r(141)("iterator")},function(n,o,r){r.d(o,"a",(function(){return s.a})),r.d(o,"c",(function(){return s.e})),r.d(o,"h",(function(){return B})),r.d(o,"i",(function(){return $})),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 kn}));var i,a,l,s=r(0),f=0,h=[],v=s.i.__b,b=s.i.__r,w=s.i.diffed,O=s.i.__c,E=s.i.unmount;function S(Pe,Ke){s.i.__h&&s.i.__h(a,Pe,f||Ke),f=0;var Le=a.__H||(a.__H={__:[],__h:[]});return Pe>=Le.__.length&&Le.__.push({}),Le.__[Pe]}function M(Pe){return f=1,C(W,Pe)}function C(Pe,Ke,Le){var dt=S(i++,2);return dt.t=Pe,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 $(Pe,Ke){var Le=S(i++,3);!s.i.__s&&Y(Le.__H,Ke)&&(Le.__=Pe,Le.__H=Ke,a.__H.__h.push(Le))}function D(Pe,Ke){var Le=S(i++,4);!s.i.__s&&Y(Le.__H,Ke)&&(Le.__=Pe,Le.__H=Ke,a.__h.push(Le))}function k(Pe,Ke){var Le=S(i++,7);return Y(Le.__H,Ke)&&(Le.__=Pe(),Le.__H=Ke,Le.__h=Pe),Le.__}function B(Pe,Ke){return f=8,k((function(){return Pe}),Ke)}function F(){var Pe;for(h.sort((function(Ke,Le){return Ke.__v.__b-Le.__v.__b}));Pe=h.pop();)if(Pe.__P)try{Pe.__H.__h.forEach(z),Pe.__H.__h.forEach(X),Pe.__H.__h=[]}catch(Ke){Pe.__H.__h=[],s.i.__e(Ke,Pe.__v)}}s.i.__b=function(Pe){a=null,v&&v(Pe)},s.i.__r=function(Pe){b&&b(Pe),i=0;var Ke=(a=Pe.__c).__H;Ke&&(Ke.__h.forEach(z),Ke.__h.forEach(X),Ke.__h=[])},s.i.diffed=function(Pe){w&&w(Pe);var Ke=Pe.__c;Ke&&Ke.__H&&Ke.__H.__h.length&&(h.push(Ke)!==1&&l===s.i.requestAnimationFrame||((l=s.i.requestAnimationFrame)||V)(F)),a=null},s.i.__c=function(Pe,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=[],s.i.__e(dt,Le.__v)}})),O&&O(Pe,Ke)},s.i.unmount=function(Pe){E&&E(Pe);var Ke,Le=Pe.__c;Le&&Le.__H&&(Le.__H.__.forEach((function(dt){try{z(dt)}catch(At){Ke=At}})),Ke&&s.i.__e(Ke,Le.__v))};var I=typeof requestAnimationFrame=="function";function V(Pe){var Ke,Le=function(){clearTimeout(dt),I&&cancelAnimationFrame(Ke),setTimeout(Pe)},dt=setTimeout(Le,100);I&&(Ke=requestAnimationFrame(Le))}function z(Pe){var Ke=a,Le=Pe.__c;typeof Le=="function"&&(Pe.__c=void 0,Le()),a=Ke}function X(Pe){var Ke=a;Pe.__c=Pe.__(),a=Ke}function Y(Pe,Ke){return!Pe||Pe.length!==Ke.length||Ke.some((function(Le,dt){return Le!==Pe[dt]}))}function W(Pe,Ke){return typeof Ke=="function"?Ke(Pe):Ke}function Q(Pe,Ke){for(var Le in Ke)Pe[Le]=Ke[Le];return Pe}function J(Pe,Ke){for(var Le in Pe)if(Le!=="__source"&&!(Le in Ke))return!0;for(var dt in Ke)if(dt!=="__source"&&Pe[dt]!==Ke[dt])return!0;return!1}function ie(Pe){this.props=Pe}function Se(Pe,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(s.e)(Pe,At)}return dt.displayName="Memo("+(Pe.displayName||Pe.name)+")",dt.prototype.isReactComponent=!0,dt.__f=!0,dt}(ie.prototype=new s.a).isPureReactComponent=!0,ie.prototype.shouldComponentUpdate=function(Pe,Ke){return J(this.props,Pe)||J(this.state,Ke)};var Ae=s.i.__b;s.i.__b=function(Pe){Pe.type&&Pe.type.__f&&Pe.ref&&(Pe.props.ref=Pe.ref,Pe.ref=null),Ae&&Ae(Pe)};var ke=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function De(Pe){function Ke(Le,dt){var At=Q({},Le);return delete At.ref,Pe(At,!(dt=Le.ref||dt)||typeof dt=="object"&&!("current"in dt)?null:dt)}return Ke.$$typeof=ke,Ke.render=Ke,Ke.prototype.isReactComponent=Ke.__f=!0,Ke.displayName="ForwardRef("+(Pe.displayName||Pe.name)+")",Ke}var ze=function(Pe,Ke){return Pe==null?null:Object(s.k)(Object(s.k)(Pe).map(Ke))},Ye={map:ze,forEach:ze,count:function(Pe){return Pe?Object(s.k)(Pe).length:0},only:function(Pe){var Ke=Object(s.k)(Pe);if(Ke.length!==1)throw"Children.only";return Ke[0]},toArray:s.k},Be=s.i.__e;s.i.__e=function(Pe,Ke,Le){if(Pe.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(Pe,Ke)}Be(Pe,Ke,Le)};var Je=s.i.unmount;function gt(Pe,Ke,Le){return Pe&&(Pe.__c&&Pe.__c.__H&&(Pe.__c.__H.__.forEach((function(dt){typeof dt.__c=="function"&&dt.__c()})),Pe.__c.__H=null),(Pe=Q({},Pe)).__c!=null&&(Pe.__c.__P===Le&&(Pe.__c.__P=Ke),Pe.__c=null),Pe.__k=Pe.__k&&Pe.__k.map((function(dt){return gt(dt,Ke,Le)}))),Pe}function se(Pe,Ke,Le){return Pe&&(Pe.__v=null,Pe.__k=Pe.__k&&Pe.__k.map((function(dt){return se(dt,Ke,Le)})),Pe.__c&&Pe.__c.__P===Ke&&(Pe.__e&&Le.insertBefore(Pe.__e,Pe.__d),Pe.__c.__e=!0,Pe.__c.__P=Le)),Pe}function Ze(){this.__u=0,this.t=null,this.__b=null}function pe(Pe){var Ke=Pe.__.__c;return Ke&&Ke.__e&&Ke.__e(Pe)}function le(){this.u=null,this.o=null}s.i.unmount=function(Pe){var Ke=Pe.__c;Ke&&Ke.__R&&Ke.__R(),Ke&&Pe.__h===!0&&(Pe.type=null),Je&&Je(Pe)},(Ze.prototype=new s.a).__c=function(Pe,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]=se(Lo,Lo.__c.__P,Lo.__c.__O)}var yo;for(dt.setState({__e:dt.__b=null});yo=dt.t.pop();)yo.forceUpdate()}},ao=Ke.__h===!0;dt.__u++||ao||dt.setState({__e:dt.__b=dt.__v.__k[0]}),Pe.then(En,En)},Ze.prototype.componentWillUnmount=function(){this.t=[]},Ze.prototype.render=function(Pe,Ke){if(this.__b){if(this.__v.__k){var Le=document.createElement("div"),dt=this.__v.__k[0].__c;this.__v.__k[0]=gt(this.__b,Le,dt.__O=dt.__P)}this.__b=null}var At=Ke.__e&&Object(s.e)(s.b,null,Pe.fallback);return At&&(At.__h=null),[Object(s.e)(s.b,null,Ke.__e?null:Pe.children),At]};var we=function(Pe,Ke,Le){if(++Le[1]===Le[0]&&Pe.o.delete(Ke),Pe.props.revealOrder&&(Pe.props.revealOrder[0]!=="t"||!Pe.o.size))for(Le=Pe.u;Le;){for(;Le.length>3;)Le.pop()();if(Le[1]<Le[0])break;Pe.u=Le=Le[2]}};function $e(Pe){return this.getChildContext=function(){return Pe.context},Pe.children}function rt(Pe){var Ke=this,Le=Pe.i;Ke.componentWillUnmount=function(){Object(s.j)(null,Ke.l),Ke.l=null,Ke.i=null},Ke.i&&Ke.i!==Le&&Ke.componentWillUnmount(),Pe.__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(s.j)(Object(s.e)($e,{context:Ke.context},Pe.__v),Ke.l)):Ke.l&&Ke.componentWillUnmount()}(le.prototype=new s.a).__e=function(Pe){var Ke=this,Le=pe(Ke.__v),dt=Ke.o.get(Pe);return dt[0]++,function(At){var Tt=function(){Ke.props.revealOrder?(dt.push(At),we(Ke,Pe,dt)):At()};Le?Le(Tt):Tt()}},le.prototype.render=function(Pe){this.u=null,this.o=new Map;var Ke=Object(s.k)(Pe.children);Pe.revealOrder&&Pe.revealOrder[0]==="b"&&Ke.reverse();for(var Le=Ke.length;Le--;)this.o.set(Ke[Le],this.u=[1,0,this.u]);return Pe.children},le.prototype.componentDidUpdate=le.prototype.componentDidMount=function(){var Pe=this;this.o.forEach((function(Ke,Le){we(Pe,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(Pe){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(Pe)};s.a.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(Pe){Object.defineProperty(s.a.prototype,Pe,{configurable:!0,get:function(){return this["UNSAFE_"+Pe]},set:function(Ke){Object.defineProperty(this,Pe,{configurable:!0,writable:!0,value:Ke})}})}));var zt=s.i.event;function it(){}function ae(){return this.cancelBubble}function re(){return this.defaultPrevented}s.i.event=function(Pe){return zt&&(Pe=zt(Pe)),Pe.persist=it,Pe.isPropagationStopped=ae,Pe.isDefaultPrevented=re,Pe.nativeEvent=Pe};var je,vt={configurable:!0,get:function(){return this.class}},q=s.i.vnode;s.i.vnode=function(Pe){var Ke=Pe.type,Le=Pe.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(s.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.value.indexOf(Zn.props.value)!=-1}))),Ke=="select"&&dt.defaultValue!=null&&(dt.value=Object(s.k)(Le.children).forEach((function(Zn){Zn.props.selected=dt.multiple?dt.defaultValue.indexOf(Zn.props.value)!=-1:dt.defaultValue==Zn.props.value}))),Pe.props=dt,Le.class!=Le.className&&(vt.enumerable="className"in Le,Le.className!=null&&(dt.class=Le.className),Object.defineProperty(dt,"className",vt))}Pe.$$typeof=pt,q&&q(Pe)};var Pt=s.i.__r;s.i.__r=function(Pe){Pt&&Pt(Pe),je=Pe.__c};var Rt={ReactCurrentDispatcher:{current:{readContext:function(Pe){return je.__n[Pe.__c].props.value}}}};function Gt(Pe){return!!Pe&&Pe.$$typeof===pt}var kn=function(Pe,Ke){return Pe(Ke)},qt=s.b,On={useState:M,useReducer:C,useEffect:$,useLayoutEffect:D,useRef:function(Pe){return f=5,k((function(){return{current:Pe}}),[])},useImperativeHandle:function(Pe,Ke,Le){f=6,D((function(){typeof Pe=="function"?Pe(Ke()):Pe&&(Pe.current=Ke())}),Le==null?Le:Le.concat(Pe))},useMemo:k,useCallback:B,useContext:function(Pe){var Ke=a.context[Pe.__c],Le=S(i++,9);return Le.c=Pe,Ke?(Le.__==null&&(Le.__=!0,Ke.sub(a)),Ke.props.value):Pe.__},useDebugValue:function(Pe,Ke){s.i.useDebugValue&&s.i.useDebugValue(Ke?Ke(Pe):Pe)},version:"17.0.2",Children:Ye,render:function(Pe,Ke,Le){return Ke.__k==null&&(Ke.textContent=""),Object(s.j)(Pe,Ke),typeof Le=="function"&&Le(),Pe?Pe.__c:null},hydrate:function(Pe,Ke,Le){return Object(s.h)(Pe,Ke),typeof Le=="function"&&Le(),Pe?Pe.__c:null},unmountComponentAtNode:function(Pe){return!!Pe.__k&&(Object(s.j)(null,Pe),!0)},createPortal:function(Pe,Ke){return Object(s.e)(rt,{__v:Pe,i:Ke})},createElement:s.e,createContext:s.d,createFactory:function(Pe){return s.e.bind(null,Pe)},cloneElement:function(Pe){return Gt(Pe)?s.c.apply(null,arguments):Pe},createRef:s.f,Fragment:s.b,isValidElement:Gt,findDOMNode:function(Pe){return Pe&&(Pe.base||Pe.nodeType===1&&Pe)||null},Component:s.a,PureComponent:ie,memo:Se,forwardRef:De,flushSync:function(Pe,Ke){return Pe(Ke)},unstable_batchedUpdates:kn,StrictMode:qt,Suspense:Ze,SuspenseList:le,lazy:function(Pe){var Ke,Le,dt;function At(Tt){if(Ke||(Ke=Pe()).then((function(En){Le=En.default||En}),(function(En){dt=En})),dt)throw dt;if(!Le)throw Ke;return Object(s.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),l=r(153),s=r(187),f=r(57),h=function(b){if(b&&b.forEach!==s)try{f(b,"forEach",s)}catch{b.forEach=s}};for(var v in a)a[v]&&h(i[v]&&i[v].prototype);h(l)},function(n,o,r){r(16)({target:"Object",stat:!0},{setPrototypeOf:r(102)})},function(n,o,r){var i=r(16),a=r(18),l=r(40),s=r(101),f=r(143);i({target:"Object",stat:!0,forced:a((function(){s(1)})),sham:!f},{getPrototypeOf:function(h){return s(l(h))}})},function(n,o,r){var i=r(16),a=r(46),l=r(76),s=r(203),f=r(165),h=r(32),v=r(33),b=r(60),w=r(18),O=a("Reflect","construct"),E=Object.prototype,S=[].push,M=w((function(){function D(){}return!(O((function(){}),[],D)instanceof D)})),C=!w((function(){O((function(){}))})),$=M||C;i({target:"Reflect",stat:!0,forced:$,sham:$},{construct:function(D,k){f(D),h(k);var B=arguments.length<3?D:f(arguments[2]);if(C&&!M)return O(D,k,B);if(D==B){switch(k.length){case 0:return new D;case 1:return new D(k[0]);case 2:return new D(k[0],k[1]);case 3:return new D(k[0],k[1],k[2]);case 4:return new D(k[0],k[1],k[2],k[3])}var F=[null];return l(S,F,k),new(l(s,D,F))}var I=B.prototype,V=b(v(I)?I:E),z=l(D,V,k);return v(z)?z:V}})},function(n,o){var r=Function.prototype,i=r.bind,a=r.call,l=i&&i.bind(a);n.exports=i?function(s){return s&&l(a,s)}:function(s){return s&&function(){return a.apply(s,arguments)}}},function(n,o,r){var i=r(7),a=r(50).f,l=r(57),s=r(42),f=r(110),h=r(134),v=r(95);n.exports=function(b,w){var O,E,S,M,C,$=b.target,D=b.global,k=b.stat;if(O=D?i:k?i[$]||f($,{}):(i[$]||{}).prototype)for(E in w){if(M=w[E],S=b.noTargetGet?(C=a(O,E))&&C.value:O[E],!v(D?E:$+(k?".":"#")+E,b.forced)&&S!==void 0){if(typeof M==typeof S)continue;h(M,S)}(b.sham||S&&S.sham)&&l(M,"sham",!0),s(O,E,M,b)}}},function(n,o,r){var i=r(16),a=r(7),l=r(96),s=r(99),f=r(33),h=r(75),v=r(45),b=r(41),w=r(63),O=r(28),E=r(81),S=r(98),M=E("slice"),C=O("species"),$=a.Array,D=Math.max;i({target:"Array",proto:!0,forced:!M},{slice:function(k,B){var F,I,V,z=b(this),X=v(z),Y=h(k,X),W=h(B===void 0?X:B,X);if(l(z)&&(F=z.constructor,(s(F)&&(F===$||l(F.prototype))||f(F)&&(F=F[C])===null)&&(F=void 0),F===$||F===void 0))return S(z,Y,W);for(I=new(F===void 0?$:F)(D(W-Y,0)),V=0;Y<W;Y++,V++)Y in z&&w(I,V,z[Y]);return I.length=V,I}})},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),l=r(77);i({target:"Object",stat:!0,forced:r(18)((function(){l(1)}))},{keys:function(s){return l(a(s))}})},function(n,o,r){var i=r(36),a=r(73).EXISTS,l=r(15),s=r(38).f,f=Function.prototype,h=l(f.toString),v=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,b=l(v.exec);i&&!a&&s(f,"name",{configurable:!0,get:function(){try{return b(v,h(this))[1]}catch{return""}}})},function(n,o,r){var i=r(16),a=r(18),l=r(41),s=r(50).f,f=r(36),h=a((function(){s(1)}));i({target:"Object",stat:!0,forced:!f||h,sham:!f},{getOwnPropertyDescriptor:function(v,b){return s(l(v),b)}})},function(n,o,r){var i=r(16),a=r(188);i({target:"Array",stat:!0,forced:!r(120)((function(l){Array.from(l)}))},{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(l){return a(this,l,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(16),a=r(36),l=r(135),s=r(41),f=r(50),h=r(63);i({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(v){for(var b,w,O=s(v),E=f.f,S=l(O),M={},C=0;S.length>C;)(w=E(O,b=S[C++]))!==void 0&&h(M,b,w);return M}})},,function(n,o,r){var i=r(16),a=r(7),l=r(18),s=r(96),f=r(33),h=r(40),v=r(45),b=r(63),w=r(115),O=r(81),E=r(28),S=r(70),M=E("isConcatSpreadable"),C=9007199254740991,$="Maximum allowed index exceeded",D=a.TypeError,k=S>=51||!l((function(){var I=[];return I[M]=!1,I.concat()[0]!==I})),B=O("concat"),F=function(I){if(!f(I))return!1;var V=I[M];return V!==void 0?!!V:s(I)};i({target:"Array",proto:!0,forced:!k||!B},{concat:function(I){var V,z,X,Y,W,Q=h(this),J=w(Q,0),ie=0;for(V=-1,X=arguments.length;V<X;V++)if(F(W=V===-1?Q:arguments[V])){if(ie+(Y=v(W))>C)throw D($);for(z=0;z<Y;z++,ie++)z in W&&b(J,ie,W[z])}else{if(ie>=C)throw D($);b(J,ie++,W)}return J.length=ie,J}})},function(n,o,r){var i=r(7),a=r(89),l=r(35),s=r(90),f=r(108),h=r(132),v=a("wks"),b=i.Symbol,w=b&&b.for,O=h?b:b&&b.withoutSetter||s;n.exports=function(E){if(!l(v,E)||!f&&typeof v[E]!="string"){var S="Symbol."+E;f&&l(b,E)?v[E]=b[E]:v[E]=h&&w?w(S):O(S)}return v[E]}},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,l=i.a||a||Function("return this")();o.a=l},function(n,o,r){var i=r(7),a=r(33),l=i.String,s=i.TypeError;n.exports=function(f){if(a(f))return f;throw s(l(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),l=i({}.hasOwnProperty);n.exports=Object.hasOwn||function(s,f){return l(a(s),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(l){return a(this,l,arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(7),a=r(36),l=r(133),s=r(32),f=r(86),h=i.TypeError,v=Object.defineProperty;o.f=a?v:function(b,w,O){if(s(b),w=f(w),s(O),l)try{return v(b,w,O)}catch{}if("get"in O||"set"in O)throw h("Accessors not supported");return"value"in O&&(b[w]=O.value),b}},function(n,o,r){var i=r(7),a=r(97),l=i.String;n.exports=function(s){if(a(s)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return l(s)}},function(n,o,r){var i=r(7),a=r(44),l=i.Object;n.exports=function(s){return l(a(s))}},function(n,o,r){var i=r(85),a=r(44);n.exports=function(l){return i(a(l))}},function(n,o,r){var i=r(7),a=r(30),l=r(35),s=r(57),f=r(110),h=r(92),v=r(58),b=r(73).CONFIGURABLE,w=v.get,O=v.enforce,E=String(String).split("String");(n.exports=function(S,M,C,$){var D,k=!!$&&!!$.unsafe,B=!!$&&!!$.enumerable,F=!!$&&!!$.noTargetGet,I=$&&$.name!==void 0?$.name:M;a(C)&&(String(I).slice(0,7)==="Symbol("&&(I="["+String(I).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!l(C,"name")||b&&C.name!==I)&&s(C,"name",I),(D=O(C)).source||(D.source=E.join(typeof I=="string"?I:""))),S!==i?(k?!F&&S[M]&&(B=!0):delete S[M],B?S[M]=C:s(S,M,C)):B?S[M]=C:f(M,C)})(Function.prototype,"toString",(function(){return a(this)&&w(this).source||h(this)}))},function(n,o,r){(function(i){r.d(o,"d",(function(){return s})),r.d(o,"c",(function(){return f})),r.d(o,"b",(function(){return h})),r.d(o,"a",(function(){return b}));var a=r(10),l=function(w,O){var E=typeof Symbol=="function"&&w[Symbol.iterator];if(!E)return w;var S,M,C=E.call(w),$=[];try{for(;(O===void 0||O-- >0)&&!(S=C.next()).done;)$.push(S.value)}catch(D){M={error:D}}finally{try{S&&!S.done&&(E=C.return)&&E.call(C)}finally{if(M)throw M.error}}return $};function s(){var w=l(Object(a.j)(0),2)[1];return Object(a.h)((function(){w((function(O){return O+1}))}),[])}function f(w){if(!w||typeof w!="object")return!1;var O=Object.getPrototypeOf(w);return!O||O===Object.prototype}function h(w){return typeof Symbol=="function"?Symbol.for(w):"__$mobx-react "+w+"__"}var v={};function b(){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),l=function(s){return a(s)?s:void 0};n.exports=function(s,f){return arguments.length<2?l(i[s]):i[s]&&i[s][f]}},function(n,o,r){var i=r(16),a=r(34),l=r(33),s=r(32),f=r(204),h=r(50),v=r(101);i({target:"Reflect",stat:!0},{get:function b(w,O){var E,S,M=arguments.length<3?w:arguments[2];return s(w)===M?w[O]:(E=h.f(w,O))?f(E)?E.value:E.get===void 0?void 0:a(E.get,M):l(S=v(w))?b(S,O,M):void 0}})},function(n,o,r){(function(i){var a=r(31),l=r(171),s=e&&!e.nodeType&&e,f=s&&typeof i=="object"&&i&&!i.nodeType&&i,h=f&&f.exports===s?a.a.Buffer:void 0,v=(h?h.isBuffer:void 0)||l.a;o.a=v}).call(this,r(122)(n))},function(n,o,r){(function(i){var a=r(106),l=e&&!e.nodeType&&e,s=l&&typeof i=="object"&&i&&!i.nodeType&&i,f=s&&s.exports===l&&a.a.process,h=(function(){try{var v=s&&s.require&&s.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),l=r(84),s=r(69),f=r(41),h=r(86),v=r(35),b=r(133),w=Object.getOwnPropertyDescriptor;o.f=i?w:function(O,E){if(O=f(O),E=h(E),b)try{return w(O,E)}catch{}if(v(O,E))return s(!a(l.f,O,E),O[E])}},function(n,o,r){var i=r(15),a=i({}.toString),l=i("".slice);n.exports=function(s){return l(a(s),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(l){return a(l)}})},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),l=r(88),s=i.TypeError;n.exports=function(f){if(a(f))return f;throw s(l(f)+" is not a function")}},function(n,o,r){var i=r(36),a=r(38),l=r(69);n.exports=i?function(s,f,h){return a.f(s,f,l(1,h))}:function(s,f,h){return s[f]=h,s}},function(n,o,r){var i,a,l,s=r(175),f=r(7),h=r(15),v=r(33),b=r(57),w=r(35),O=r(109),E=r(93),S=r(72),M="Object already initialized",C=f.TypeError,$=f.WeakMap;if(s||O.state){var D=O.state||(O.state=new $),k=h(D.get),B=h(D.has),F=h(D.set);i=function(V,z){if(B(D,V))throw new C(M);return z.facade=V,F(D,V,z),z},a=function(V){return k(D,V)||{}},l=function(V){return B(D,V)}}else{var I=E("state");S[I]=!0,i=function(V,z){if(w(V,I))throw new C(M);return z.facade=V,b(V,I,z),z},a=function(V){return w(V,I)?V[I]:{}},l=function(V){return w(V,I)}}n.exports={set:i,get:a,has:l,enforce:function(V){return l(V)?a(V):i(V,{})},getterFor:function(V){return function(z){var X;if(!v(z)||(X=a(z)).type!==V)throw C("Incompatible receiver, "+V+" required");return X}}}},function(n,o){var r=Math.ceil,i=Math.floor;n.exports=function(a){var l=+a;return l!=l||l===0?0:(l>0?i:r)(l)}},function(n,o,r){var i,a=r(32),l=r(176),s=r(111),f=r(72),h=r(138),v=r(91),b=r(93),w=b("IE_PROTO"),O=function(){},E=function(C){return"<script>"+C+"<\/script>"},S=function(C){C.write(E("")),C.close();var $=C.parentWindow.Object;return C=null,$},M=function(){try{i=new ActiveXObject("htmlfile")}catch{}var C,$;M=typeof document<"u"?document.domain&&i?S(i):(($=v("iframe")).style.display="none",h.appendChild($),$.src="javascript:",(C=$.contentWindow.document).open(),C.write(E("document.F=Object")),C.close(),C.F):S(i);for(var D=s.length;D--;)delete M.prototype[s[D]];return M()};f[w]=!0,n.exports=Object.create||function(C,$){var D;return C!==null?(O.prototype=a(C),D=new O,O.prototype=null,D[w]=C):D=M(),$===void 0?D:l(D,$)}},function(n,o,r){var i=r(36),a=r(7),l=r(15),s=r(95),f=r(42),h=r(35),v=r(148),b=r(54),w=r(87),O=r(131),E=r(18),S=r(74).f,M=r(50).f,C=r(38).f,$=r(160),D=r(161).trim,k="Number",B=a.Number,F=B.prototype,I=a.TypeError,V=l("".slice),z=l("".charCodeAt),X=function(Se){var Ae=O(Se,"number");return typeof Ae=="bigint"?Ae:Y(Ae)},Y=function(Se){var Ae,ke,De,ze,Ye,Be,Je,gt,se=O(Se,"number");if(w(se))throw I("Cannot convert a Symbol value to a number");if(typeof se=="string"&&se.length>2){if(se=D(se),(Ae=z(se,0))===43||Ae===45){if((ke=z(se,2))===88||ke===120)return NaN}else if(Ae===48){switch(z(se,1)){case 66:case 98:De=2,ze=49;break;case 79:case 111:De=8,ze=55;break;default:return+se}for(Be=(Ye=V(se,2)).length,Je=0;Je<Be;Je++)if((gt=z(Ye,Je))<48||gt>ze)return NaN;return parseInt(Ye,De)}}return+se};if(s(k,!B(" 0o1")||!B("0b1")||B("+0x1"))){for(var W,Q=function(Se){var Ae=arguments.length<1?0:B(X(Se)),ke=this;return b(F,ke)&&E((function(){$(ke)}))?v(Object(Ae),ke,Q):Ae},J=i?S(B):"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(B,W=J[ie])&&!h(Q,W)&&C(Q,W,M(B,W));Q.prototype=F,F.constructor=Q,f(a,k,Q)}},function(n,o,r){var i=r(56);n.exports=function(a,l){var s=a[l];return s==null?void 0:i(s)}},function(n,o,r){var i=r(86),a=r(38),l=r(69);n.exports=function(s,f,h){var v=i(f);v in s?a.f(s,v,l(0,h)):s[v]=h}},function(n,o,r){var i=r(15),a=r(56),l=i(i.bind);n.exports=function(s,f){return a(s),f===void 0?s:l?l(s,f):function(){return s.apply(f,arguments)}}},function(n,o,r){var i=r(16),a=r(15),l=r(85),s=r(41),f=r(121),h=a([].join),v=l!=Object,b=f("join",",");i({target:"Array",proto:!0,forced:v||!b},{join:function(w){return h(s(this),w===void 0?",":w)}})},function(n,o,r){var i=r(15),a=r(73).PROPER,l=r(42),s=r(32),f=r(54),h=r(39),v=r(18),b=r(154),w="toString",O=RegExp.prototype,E=O.toString,S=i(b),M=v((function(){return E.call({source:"a",flags:"b"})!="/a/b"})),C=a&&E.name!=w;(M||C)&&l(RegExp.prototype,w,(function(){var $=s(this),D=h($.source),k=$.flags;return"/"+D+"/"+h(k===void 0&&f(O,$)&&!("flags"in O)?S($):k)}),{unsafe:!0})},function(n,o,r){var i=r(16),a=r(217),l=r(100);i({target:"Array",proto:!0},{fill:a}),l("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,l=r(7),s=r(55),f=l.process,h=l.Deno,v=f&&f.versions||h&&h.version,b=v&&v.v8;b&&(a=(i=b.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!a&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.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),l=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,f=a(l,"name"),h=f&&(function(){}).name==="something",v=f&&(!i||i&&s(l,"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(l){return i(l,a)}},function(n,o,r){var i=r(59),a=Math.max,l=Math.min;n.exports=function(s,f){var h=i(s);return h<0?a(h+f,0):l(h,f)}},function(n,o){var r=Function.prototype,i=r.apply,a=r.bind,l=r.call;n.exports=typeof Reflect=="object"&&Reflect.apply||(a?l.bind(i):function(){return l.apply(i,arguments)})},function(n,o,r){var i=r(136),a=r(111);n.exports=Object.keys||function(l){return i(l,a)}},function(n,o,r){var i=r(38).f,a=r(35),l=r(28)("toStringTag");n.exports=function(s,f,h){s&&!a(s=h?s:s.prototype,l)&&i(s,l,{configurable:!0,value:f})}},function(n,o,r){var i=r(64),a=r(15),l=r(85),s=r(40),f=r(45),h=r(115),v=a([].push),b=function(w){var O=w==1,E=w==2,S=w==3,M=w==4,C=w==6,$=w==7,D=w==5||C;return function(k,B,F,I){for(var V,z,X=s(k),Y=l(X),W=i(B,F),Q=f(Y),J=0,ie=I||h,Se=O?ie(k,Q):E||$?ie(k,0):void 0;Q>J;J++)if((D||J in Y)&&(z=W(V=Y[J],J,X),w))if(O)Se[J]=z;else if(z)switch(w){case 3:return!0;case 5:return V;case 6:return J;case 2:v(Se,V)}else switch(w){case 4:return!1;case 7:v(Se,V)}return C?-1:S||M?M:Se}};n.exports={forEach:b(0),map:b(1),filter:b(2),some:b(3),every:b(4),find:b(5),findIndex:b(6),filterReject:b(7)}},function(n,o){n.exports={}},function(n,o,r){var i=r(18),a=r(28),l=r(70),s=a("species");n.exports=function(f){return l>=51||!i((function(){var h=[];return(h.constructor={})[s]=function(){return{foo:1}},h[f](Boolean).foo!==1}))}},function(n,o,r){var i=r(76),a=r(34),l=r(15),s=r(123),f=r(159),h=r(32),v=r(44),b=r(164),w=r(124),O=r(94),E=r(39),S=r(62),M=r(114),C=r(125),$=r(103),D=r(155),k=r(18),B=D.UNSUPPORTED_Y,F=4294967295,I=Math.min,V=[].push,z=l(/./.exec),X=l(V),Y=l("".slice),W=!k((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"}));s("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,ke){var De=E(v(this)),ze=ke===void 0?F:ke>>>0;if(ze===0)return[];if(Ae===void 0)return[De];if(!f(Ae))return a(J,De,Ae,ze);for(var Ye,Be,Je,gt=[],se=(Ae.ignoreCase?"i":"")+(Ae.multiline?"m":"")+(Ae.unicode?"u":"")+(Ae.sticky?"y":""),Ze=0,pe=new RegExp(Ae.source,se+"g");(Ye=a($,pe,De))&&!((Be=pe.lastIndex)>Ze&&(X(gt,Y(De,Ze,Ye.index)),Ye.length>1&&Ye.index<De.length&&i(V,gt,M(Ye,1)),Je=Ye[0].length,Ze=Be,gt.length>=ze));)pe.lastIndex===Ye.index&&pe.lastIndex++;return Ze===De.length?!Je&&z(pe,"")||X(gt,""):X(gt,Y(De,Ze)),gt.length>ze?M(gt,0,ze):gt}:"0".split(void 0,0).length?function(Ae,ke){return Ae===void 0&&ke===0?[]:a(J,this,Ae,ke)}:J,[function(Ae,ke){var De=v(this),ze=Ae==null?void 0:S(Ae,Q);return ze?a(ze,Ae,De,ke):a(Se,E(De),Ae,ke)},function(Ae,ke){var De=h(this),ze=E(Ae),Ye=ie(Se,De,ze,ke,Se!==J);if(Ye.done)return Ye.value;var Be=b(De,RegExp),Je=De.unicode,gt=(De.ignoreCase?"i":"")+(De.multiline?"m":"")+(De.unicode?"u":"")+(B?"g":"y"),se=new Be(B?"^(?:"+De.source+")":De,gt),Ze=ke===void 0?F:ke>>>0;if(Ze===0)return[];if(ze.length===0)return C(se,ze)===null?[ze]:[];for(var pe=0,le=0,we=[];le<ze.length;){se.lastIndex=B?0:le;var $e,rt=C(se,B?Y(ze,le):ze);if(rt===null||($e=I(O(se.lastIndex+(B?le:0)),ze.length))===pe)le=w(ze,le,Je);else{if(X(we,Y(ze,pe,le)),we.length===Ze)return we;for(var pt=1;pt<=rt.length-1;pt++)if(X(we,rt[pt]),we.length===Ze)return we;le=pe=$e}}return X(we,Y(ze,pe)),we}]}),!W,B)},function(n,o,r){r(16)({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(n,o,r){var i={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,l=a&&!i.call({1:2},1);o.f=l?function(s){var f=a(this,s);return!!f&&f.enumerable}:i},function(n,o,r){var i=r(7),a=r(15),l=r(18),s=r(51),f=i.Object,h=a("".split);n.exports=l((function(){return!f("z").propertyIsEnumerable(0)}))?function(v){return s(v)=="String"?h(v,""):f(v)}:f},function(n,o,r){var i=r(131),a=r(87);n.exports=function(l){var s=i(l,"string");return a(s)?s:s+""}},function(n,o,r){var i=r(7),a=r(46),l=r(30),s=r(54),f=r(132),h=i.Object;n.exports=f?function(v){return typeof v=="symbol"}:function(v){var b=a("Symbol");return l(b)&&s(b.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(l,s){return a[l]||(a[l]=s!==void 0?s:{})})("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,l=Math.random(),s=i(1 .toString);n.exports=function(f){return"Symbol("+(f===void 0?"":f)+")_"+s(++a+l,36)}},function(n,o,r){var i=r(7),a=r(33),l=i.document,s=a(l)&&a(l.createElement);n.exports=function(f){return s?l.createElement(f):{}}},function(n,o,r){var i=r(15),a=r(30),l=r(109),s=i(Function.toString);a(l.inspectSource)||(l.inspectSource=function(f){return s(f)}),n.exports=l.inspectSource},function(n,o,r){var i=r(89),a=r(90),l=i("keys");n.exports=function(s){return l[s]||(l[s]=a(s))}},function(n,o,r){var i=r(59),a=Math.min;n.exports=function(l){return l>0?a(i(l),9007199254740991):0}},function(n,o,r){var i=r(18),a=r(30),l=/#|\.prototype\./,s=function(w,O){var E=h[f(w)];return E==b||E!=v&&(a(O)?i(O):!!O)},f=s.normalize=function(w){return String(w).replace(l,".").toLowerCase()},h=s.data={},v=s.NATIVE="N",b=s.POLYFILL="P";n.exports=s},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),l=r(30),s=r(51),f=r(28)("toStringTag"),h=i.Object,v=s((function(){return arguments})())=="Arguments";n.exports=a?s:function(b){var w,O,E;return b===void 0?"Undefined":b===null?"Null":typeof(O=(function(S,M){try{return S[M]}catch{}})(w=h(b),f))=="string"?O:v?s(w):(E=s(w))=="Object"&&l(w.callee)?"Arguments":E}},function(n,o,r){var i=r(15);n.exports=i([].slice)},function(n,o,r){var i=r(15),a=r(18),l=r(30),s=r(97),f=r(46),h=r(92),v=function(){},b=[],w=f("Reflect","construct"),O=/^\s*(?:class|function)\b/,E=i(O.exec),S=!O.exec(v),M=function(C){if(!l(C))return!1;try{return w(v,b,C),!0}catch{return!1}};n.exports=!w||a((function(){var C;return M(M.call)||!M(Object)||!M((function(){C=!0}))||C}))?function(C){if(!l(C))return!1;switch(s(C)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return S||!!E(O,h(C))}:M},function(n,o,r){var i=r(28),a=r(60),l=r(38),s=i("unscopables"),f=Array.prototype;f[s]==null&&l.f(f,s,{configurable:!0,value:a(null)}),n.exports=function(h){f[s][h]=!0}},function(n,o,r){var i=r(7),a=r(35),l=r(30),s=r(40),f=r(93),h=r(143),v=f("IE_PROTO"),b=i.Object,w=b.prototype;n.exports=h?b.getPrototypeOf:function(O){var E=s(O);if(a(E,v))return E[v];var S=E.constructor;return l(S)&&E instanceof S?S.prototype:E instanceof b?w:null}},function(n,o,r){var i=r(15),a=r(32),l=r(181);n.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var s,f=!1,h={};try{(s=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(h,[]),f=h instanceof Array}catch{}return function(v,b){return a(v),l(b),f?s(v,b):v.__proto__=b,v}})():void 0)},function(n,o,r){var i,a,l=r(34),s=r(15),f=r(39),h=r(154),v=r(155),b=r(89),w=r(60),O=r(58).get,E=r(190),S=r(191),M=b("native-string-replace",String.prototype.replace),C=RegExp.prototype.exec,$=C,D=s("".charAt),k=s("".indexOf),B=s("".replace),F=s("".slice),I=(a=/b*/g,l(C,i=/a/,"a"),l(C,a,"a"),i.lastIndex!==0||a.lastIndex!==0),V=v.BROKEN_CARET,z=/()??/.exec("")[1]!==void 0;(I||z||V||E||S)&&($=function(X){var Y,W,Q,J,ie,Se,Ae,ke=this,De=O(ke),ze=f(X),Ye=De.raw;if(Ye)return Ye.lastIndex=ke.lastIndex,Y=l($,Ye,ze),ke.lastIndex=Ye.lastIndex,Y;var Be=De.groups,Je=V&&ke.sticky,gt=l(h,ke),se=ke.source,Ze=0,pe=ze;if(Je&&(gt=B(gt,"y",""),k(gt,"g")===-1&&(gt+="g"),pe=F(ze,ke.lastIndex),ke.lastIndex>0&&(!ke.multiline||ke.multiline&&D(ze,ke.lastIndex-1)!==`
`)&&(se="(?: "+se+")",pe=" "+pe,Ze++),W=new RegExp("^(?:"+se+")",gt)),z&&(W=new RegExp("^"+se+"$(?!\\s)",gt)),I&&(Q=ke.lastIndex),J=l(C,Je?W:ke,pe),Je?J?(J.input=F(J.input,Ze),J[0]=F(J[0],Ze),J.index=ke.lastIndex,ke.lastIndex+=J[0].length):ke.lastIndex=0:I&&J&&(ke.lastIndex=ke.global?J.index+J[0].length:Q),z&&J&&J.length>1&&l(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=w(null),ie=0;ie<Be.length;ie++)Se[(Ae=Be[ie])[0]]=J[Ae[1]];return J}),n.exports=$},function(n,o,r){var i=r(16),a=r(7),l=r(75),s=r(59),f=r(45),h=r(40),v=r(115),b=r(63),w=r(81)("splice"),O=a.TypeError,E=Math.max,S=Math.min,M=9007199254740991,C="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!w},{splice:function($,D){var k,B,F,I,V,z,X=h(this),Y=f(X),W=l($,Y),Q=arguments.length;if(Q===0?k=B=0:Q===1?(k=0,B=Y-W):(k=Q-2,B=S(E(s(D),0),Y-W)),Y+k-B>M)throw O(C);for(F=v(X,B),I=0;I<B;I++)(V=W+I)in X&&b(F,I,X[V]);if(F.length=B,k<B){for(I=W;I<Y-B;I++)z=I+k,(V=I+B)in X?X[z]=X[V]:delete X[z];for(I=Y;I>Y-B+k;I--)delete X[I-1]}else if(k>B)for(I=Y-B;I>W;I--)z=I+k-1,(V=I+B-1)in X?X[z]=X[V]:delete X[z];for(I=0;I<k;I++)X[I+W]=arguments[I+2];return X.length=Y-B+k,F}})},function(n,o,r){var i=r(16),a=r(205);i({target:"String",proto:!0,forced:r(206)("anchor")},{anchor:function(l){return a(this,"a","name",l)}})},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),l=e&&!e.nodeType&&e,s=l&&typeof i=="object"&&i&&!i.nodeType&&i,f=s&&s.exports===l?a.a.Buffer:void 0,h=f?f.allocUnsafe:void 0;o.a=function(v,b){if(b)return v.slice();var w=v.length,O=h?h(w):new v.constructor(w);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 l=Symbol();return!String(l)||!(Object(l)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},function(n,o,r){var i=r(7),a=r(110),l="__core-js_shared__",s=i[l]||a(l,{});n.exports=s},function(n,o,r){var i=r(7),a=Object.defineProperty;n.exports=function(l,s){try{a(i,l,{value:s,configurable:!0,writable:!0})}catch{i[l]=s}return s}},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),l=r(45),s=r(63),f=i.Array,h=Math.max;n.exports=function(v,b,w){for(var O=l(v),E=a(b,O),S=a(w===void 0?O:w,O),M=f(h(S-E,0)),C=0;E<S;E++,C++)s(M,C,v[E]);return M.length=C,M}},function(n,o,r){var i=r(178);n.exports=function(a,l){return new(i(a))(l===0?0:l)}},function(n,o,r){var i=r(16),a=r(34),l=r(71),s=r(73),f=r(30),h=r(180),v=r(101),b=r(102),w=r(78),O=r(57),E=r(42),S=r(28),M=r(80),C=r(142),$=s.PROPER,D=s.CONFIGURABLE,k=C.IteratorPrototype,B=C.BUGGY_SAFARI_ITERATORS,F=S("iterator"),I="keys",V="values",z="entries",X=function(){return this};n.exports=function(Y,W,Q,J,ie,Se,Ae){h(Q,W,J);var ke,De,ze,Ye=function(le){if(le===ie&&Ze)return Ze;if(!B&&le in gt)return gt[le];switch(le){case I:case V:case z:return function(){return new Q(this,le)}}return function(){return new Q(this)}},Be=W+" Iterator",Je=!1,gt=Y.prototype,se=gt[F]||gt["@@iterator"]||ie&&gt[ie],Ze=!B&&se||Ye(ie),pe=W=="Array"&&gt.entries||se;if(pe&&(ke=v(pe.call(new Y)))!==Object.prototype&&ke.next&&(l||v(ke)===k||(b?b(ke,k):f(ke[F])||E(ke,F,X)),w(ke,Be,!0,!0),l&&(M[Be]=X)),$&&ie==V&&se&&se.name!==V&&(!l&&D?O(gt,"name",V):(Je=!0,Ze=function(){return a(se,this)})),ie)if(De={values:Ye(V),keys:Se?Ze:Ye(I),entries:Ye(z)},Ae)for(ze in De)(B||Je||!(ze in gt))&&E(gt,ze,De[ze]);else i({target:W,proto:!0,forced:B||Je},De);return l&&!Ae||gt[F]===Ze||E(gt,F,Ze,{name:ie}),M[W]=Ze,De}},function(n,o,r){var i=r(7),a=r(64),l=r(34),s=r(32),f=r(88),h=r(145),v=r(45),b=r(54),w=r(146),O=r(118),E=r(147),S=i.TypeError,M=function($,D){this.stopped=$,this.result=D},C=M.prototype;n.exports=function($,D,k){var B,F,I,V,z,X,Y,W=k&&k.that,Q=!(!k||!k.AS_ENTRIES),J=!(!k||!k.IS_ITERATOR),ie=!(!k||!k.INTERRUPTED),Se=a(D,W),Ae=function(De){return B&&E(B,"normal",De),new M(!0,De)},ke=function(De){return Q?(s(De),ie?Se(De[0],De[1],Ae):Se(De[0],De[1])):ie?Se(De,Ae):Se(De)};if(J)B=$;else{if(!(F=O($)))throw S(f($)+" is not iterable");if(h(F)){for(I=0,V=v($);V>I;I++)if((z=ke($[I]))&&b(C,z))return z;return new M(!1)}B=w($,F)}for(X=B.next;!(Y=l(X,B)).done;){try{z=ke(Y.value)}catch(De){E(B,"throw",De)}if(typeof z=="object"&&z&&b(C,z))return z}return new M(!1)}},function(n,o,r){var i=r(97),a=r(62),l=r(80),s=r(28)("iterator");n.exports=function(f){if(f!=null)return a(f,s)||a(f,"@@iterator")||l[i(f)]}},function(n,o,r){var i=r(7),a=r(54),l=i.TypeError;n.exports=function(s,f){if(a(f,s))return s;throw l("Incorrect invocation")}},function(n,o,r){var i=r(28)("iterator"),a=!1;try{var l=0,s={next:function(){return{done:!!l++}},return:function(){a=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch{}n.exports=function(f,h){if(!h&&!a)return!1;var v=!1;try{var b={};b[i]=function(){return{next:function(){return{done:v=!0}}}},f(b)}catch{}return v}},function(n,o,r){var i=r(18);n.exports=function(a,l){var s=[][a];return!!s&&i((function(){s.call(null,l||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),l=r(103),s=r(18),f=r(28),h=r(57),v=f("species"),b=RegExp.prototype;n.exports=function(w,O,E,S){var M=f(w),C=!s((function(){var B={};return B[M]=function(){return 7},""[w](B)!=7})),$=C&&!s((function(){var B=!1,F=/a/;return w==="split"&&((F={}).constructor={},F.constructor[v]=function(){return F},F.flags="",F[M]=/./[M]),F.exec=function(){return B=!0,null},F[M](""),!B}));if(!C||!$||E){var D=i(/./[M]),k=O(M,""[w],(function(B,F,I,V,z){var X=i(B),Y=F.exec;return Y===l||Y===b.exec?C&&!z?{done:!0,value:D(F,I,V)}:{done:!0,value:X(I,F,V)}:{done:!1}}));a(String.prototype,w,k[0]),a(b,M,k[1])}S&&h(b[M],"sham",!0)}},function(n,o,r){var i=r(151).charAt;n.exports=function(a,l,s){return l+(s?i(a,l).length:1)}},function(n,o,r){var i=r(7),a=r(34),l=r(32),s=r(30),f=r(51),h=r(103),v=i.TypeError;n.exports=function(b,w){var O=b.exec;if(s(O)){var E=a(O,b,w);return E!==null&&l(E),E}if(f(b)==="RegExp")return a(h,b,w);throw v("RegExp#exec called on incompatible receiver")}},function(n,o,r){var i=r(76),a=r(34),l=r(15),s=r(123),f=r(18),h=r(32),v=r(30),b=r(59),w=r(94),O=r(39),E=r(44),S=r(124),M=r(62),C=r(201),$=r(125),D=r(28)("replace"),k=Math.max,B=Math.min,F=l([].concat),I=l([].push),V=l("".indexOf),z=l("".slice),X="a".replace(/./,"$0")==="$0",Y=!!/./[D]&&/./[D]("a","$0")==="";s("replace",(function(W,Q,J){var ie=Y?"$":"$0";return[function(Se,Ae){var ke=E(this),De=Se==null?void 0:M(Se,D);return De?a(De,Se,ke,Ae):a(Q,O(ke),Se,Ae)},function(Se,Ae){var ke=h(this),De=O(Se);if(typeof Ae=="string"&&V(Ae,ie)===-1&&V(Ae,"$<")===-1){var ze=J(Q,ke,De,Ae);if(ze.done)return ze.value}var Ye=v(Ae);Ye||(Ae=O(Ae));var Be=ke.global;if(Be){var Je=ke.unicode;ke.lastIndex=0}for(var gt=[];;){var se=$(ke,De);if(se===null||(I(gt,se),!Be))break;O(se[0])===""&&(ke.lastIndex=S(De,w(ke.lastIndex),Je))}for(var Ze,pe="",le=0,we=0;we<gt.length;we++){for(var $e=O((se=gt[we])[0]),rt=k(B(b(se.index),De.length),0),pt=[],Lt=1;Lt<se.length;Lt++)I(pt,(Ze=se[Lt])===void 0?Ze:String(Ze));var Jt=se.groups;if(Ye){var en=F([$e],pt,rt,De);Jt!==void 0&&I(en,Jt);var zt=O(i(Ae,void 0,en))}else zt=C($e,De,rt,pt,Jt,Ae);rt>=le&&(pe+=z(De,le,rt)+zt,le=rt+$e.length)}return pe+z(De,le)}]}),!!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,l=Math.abs,s=Math.sqrt;i({target:"Math",stat:!0,forced:!!a&&a(1/0,NaN)!==1/0},{hypot:function(f,h){for(var v,b,w=0,O=0,E=arguments.length,S=0;O<E;)S<(v=l(arguments[O++]))?(w=w*(b=S/v)*b+1,S=v):w+=v>0?(b=v/S)*b:v;return S===1/0?1/0:S*s(w)}})},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 l;/**
* @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 s,f="Expected a function",h="__lodash_hash_undefined__",v="__lodash_placeholder__",b=16,w=32,O=64,E=128,S=256,M=1/0,C=9007199254740991,$=NaN,D=4294967295,k=[["ary",E],["bind",1],["bindKey",2],["curry",8],["curryRight",b],["flip",512],["partial",w],["partialRight",O],["rearg",S]],B="[object Arguments]",F="[object Array]",I="[object Boolean]",V="[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]",ke="[object String]",De="[object Symbol]",ze="[object WeakMap]",Ye="[object ArrayBuffer]",Be="[object DataView]",Je="[object Float32Array]",gt="[object Float64Array]",se="[object Int8Array]",Ze="[object Int16Array]",pe="[object Int32Array]",le="[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)\]/,Pt=/^\w*$/,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gt=/[\\^$.*+?()[\]{}|]/g,kn=RegExp(Gt.source),qt=/^\s+/,On=/\s/,Pe=/\{(?:\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,yo=/^\[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,vn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",In="\\u2700-\\u27bf",lr="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="["+vn+"]",Sn="\\d+",Tl="[\\u2700-\\u27bf]",Oo="["+lr+"]",el="[^\\ud800-\\udfff"+ta+Sn+In+lr+wo+"]",Ui="\\ud83c[\\udffb-\\udfff]",gr="[^\\ud800-\\udfff]",ms="(?:\\ud83c[\\udde6-\\uddff]){2}",pa="[\\ud800-\\udbff][\\udc00-\\udfff]",qi="["+wo+"]",Na="(?:"+Oo+"|"+el+")",as="(?:"+qi+"|"+el+")",gs="(?:['](?:d|ll|m|re|s|t|ve))?",Cl="(?:['](?:D|LL|M|RE|S|T|VE))?",ys="(?:"+Ka+"|"+Ui+")?",tl="[\\ufe0e\\ufe0f]?",ve=tl+ys+("(?:\\u200d(?:"+[gr,ms,pa].join("|")+")"+tl+ys+")*"),mt="(?:"+[Tl,ms,pa].join("|")+")"+ve,cn="(?:"+[gr+Ka+"?",Ka,ms,pa,Yi].join("|")+")",Kn=RegExp(Ca,"g"),br=RegExp(Ka,"g"),lo=RegExp(Ui+"(?="+Ui+")|"+cn+ve,"g"),li=RegExp([qi+"?"+Oo+"+"+gs+"(?="+[fa,qi,"$"].join("|")+")",as+"+"+Cl+"(?="+[fa,qi+Na,"$"].join("|")+")",qi+"?"+Na+"+"+gs,qi+"+"+Cl,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sn,mt].join("|"),"g"),ye=RegExp("[\\u200d\\ud800-\\udfff"+vn+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 ]/,fn=["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[gt]=Cn[se]=Cn[Ze]=Cn[pe]=Cn[le]=Cn[we]=Cn[$e]=Cn[rt]=!0,Cn[B]=Cn[F]=Cn[Ye]=Cn[I]=Cn[Be]=Cn[V]=Cn[z]=Cn[X]=Cn[W]=Cn[Q]=Cn[J]=Cn[Se]=Cn[Ae]=Cn[ke]=Cn[ze]=!1;var nr={};nr[B]=nr[F]=nr[Ye]=nr[Be]=nr[I]=nr[V]=nr[Je]=nr[gt]=nr[se]=nr[Ze]=nr[pe]=nr[W]=nr[Q]=nr[J]=nr[Se]=nr[Ae]=nr[ke]=nr[De]=nr[le]=nr[we]=nr[$e]=nr[rt]=!0,nr[z]=nr[X]=nr[ze]=!1;var Mn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},or=parseFloat,sr=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")(),_s=o&&!o.nodeType&&o,Vi=_s&&typeof a=="object"&&a&&!a.nodeType&&a,Nl=Vi&&Vi.exports===_s,Is=Nl&&qr.process,Ro=(function(){try{var Ct=Vi&&Vi.require&&Vi.require("util").types;return Ct||Is&&Is.binding&&Is.binding("util")}catch{}})(),La=Ro&&Ro.isArrayBuffer,od=Ro&&Ro.isDate,_u=Ro&&Ro.isMap,Ia=Ro&&Ro.isRegExp,ra=Ro&&Ro.isSet,bs=Ro&&Ro.isTypedArray;function qo(Ct,un,dn){switch(dn.length){case 0:return Ct.call(un);case 1:return Ct.call(un,dn[0]);case 2:return Ct.call(un,dn[0],dn[1]);case 3:return Ct.call(un,dn[0],dn[1],dn[2])}return Ct.apply(un,dn)}function Uh(Ct,un,dn,Gn){for(var Wr=-1,mo=Ct==null?0:Ct.length;++Wr<mo;){var ci=Ct[Wr];un(Gn,ci,dn(ci),Ct)}return Gn}function Fa(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length;++dn<Gn&&un(Ct[dn],dn,Ct)!==!1;);return Ct}function gp(Ct,un){for(var dn=Ct==null?0:Ct.length;dn--&&un(Ct[dn],dn,Ct)!==!1;);return Ct}function yp(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length;++dn<Gn;)if(!un(Ct[dn],dn,Ct))return!1;return!0}function Ba(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length,Wr=0,mo=[];++dn<Gn;){var ci=Ct[dn];un(ci,dn,Ct)&&(mo[Wr++]=ci)}return mo}function Za(Ct,un){return!!(Ct!=null&&Ct.length)&&bu(Ct,un,0)>-1}function rf(Ct,un,dn){for(var Gn=-1,Wr=Ct==null?0:Ct.length;++Gn<Wr;)if(dn(un,Ct[Gn]))return!0;return!1}function Mo(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length,Wr=Array(Gn);++dn<Gn;)Wr[dn]=un(Ct[dn],dn,Ct);return Wr}function oa(Ct,un){for(var dn=-1,Gn=un.length,Wr=Ct.length;++dn<Gn;)Ct[Wr+dn]=un[dn];return Ct}function id(Ct,un,dn,Gn){var Wr=-1,mo=Ct==null?0:Ct.length;for(Gn&&mo&&(dn=Ct[++Wr]);++Wr<mo;)dn=un(dn,Ct[Wr],Wr,Ct);return dn}function _p(Ct,un,dn,Gn){var Wr=Ct==null?0:Ct.length;for(Gn&&Wr&&(dn=Ct[--Wr]);Wr--;)dn=un(dn,Ct[Wr],Wr,Ct);return dn}function of(Ct,un){for(var dn=-1,Gn=Ct==null?0:Ct.length;++dn<Gn;)if(un(Ct[dn],dn,Ct))return!0;return!1}var ad=Ua("length");function nl(Ct,un,dn){var Gn;return dn(Ct,(function(Wr,mo,ci){if(un(Wr,mo,ci))return Gn=mo,!1})),Gn}function $a(Ct,un,dn,Gn){for(var Wr=Ct.length,mo=dn+(Gn?1:-1);Gn?mo--:++mo<Wr;)if(un(Ct[mo],mo,Ct))return mo;return-1}function bu(Ct,un,dn){return un==un?(function(Gn,Wr,mo){for(var ci=mo-1,R=Gn.length;++ci<R;)if(Gn[ci]===Wr)return ci;return-1})(Ct,un,dn):$a(Ct,ws,dn)}function Ja(Ct,un,dn,Gn){for(var Wr=dn-1,mo=Ct.length;++Wr<mo;)if(Gn(Ct[Wr],un))return Wr;return-1}function ws(Ct){return Ct!=Ct}function vo(Ct,un){var dn=Ct==null?0:Ct.length;return dn?wu(Ct,un)/dn:$}function Ua(Ct){return function(un){return un==null?s:un[Ct]}}function Fs(Ct){return function(un){return Ct==null?s:Ct[un]}}function ha(Ct,un,dn,Gn,Wr){return Wr(Ct,(function(mo,ci,R){dn=Gn?(Gn=!1,mo):un(dn,mo,ci,R)})),dn}function wu(Ct,un){for(var dn,Gn=-1,Wr=Ct.length;++Gn<Wr;){var mo=un(Ct[Gn]);mo!==s&&(dn=dn===s?mo:dn+mo)}return dn}function Kl(Ct,un){for(var dn=-1,Gn=Array(Ct);++dn<Ct;)Gn[dn]=un(dn);return Gn}function Bs(Ct){return Ct&&Ct.slice(0,ia(Ct)+1).replace(qt,"")}function ui(Ct){return function(un){return Ct(un)}}function ic(Ct,un){return Mo(un,(function(dn){return Ct[dn]}))}function rl(Ct,un){return Ct.has(un)}function Es(Ct,un){for(var dn=-1,Gn=Ct.length;++dn<Gn&&bu(un,Ct[dn],0)>-1;);return dn}function af(Ct,un){for(var dn=Ct.length;dn--&&bu(un,Ct[dn],0)>-1;);return dn}function Vh(Ct,un){for(var dn=Ct.length,Gn=0;dn--;)Ct[dn]===un&&++Gn;return Gn}var sf=Fs({À:"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=Fs({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ac(Ct){return"\\"+Mn[Ct]}function ol(Ct){return ye.test(Ct)}function Ki(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Gn,Wr){dn[++un]=[Wr,Gn]})),dn}function lf(Ct,un){return function(dn){return Ct(un(dn))}}function ss(Ct,un){for(var dn=-1,Gn=Ct.length,Wr=0,mo=[];++dn<Gn;){var ci=Ct[dn];ci!==un&&ci!==v||(Ct[dn]=v,mo[Wr++]=dn)}return mo}function xs(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Gn){dn[++un]=Gn})),dn}function sd(Ct){var un=-1,dn=Array(Ct.size);return Ct.forEach((function(Gn){dn[++un]=[Gn,Gn]})),dn}function Va(Ct){return ol(Ct)?(function(un){for(var dn=lo.lastIndex=0;lo.test(un);)++dn;return dn})(Ct):ad(Ct)}function Qa(Ct){return ol(Ct)?(function(un){return un.match(lo)||[]})(Ct):(function(un){return un.split("")})(Ct)}function ia(Ct){for(var un=Ct.length;un--&&On.test(Ct.charAt(un)););return un}var ls=Fs({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Pa=(function Ct(un){var dn,Gn=(un=un==null?vi:Pa.defaults(vi.Object(),un,Pa.pick(vi,fn))).Array,Wr=un.Date,mo=un.Error,ci=un.Function,R=un.Math,L=un.Object,Z=un.RegExp,fe=un.String,Re=un.TypeError,st=Gn.prototype,It=ci.prototype,bn=L.prototype,Jn=un["__core-js_shared__"],no=It.toString,$n=bn.hasOwnProperty,Do=0,Kr=(dn=/[^.]+$/.exec(Jn&&Jn.keys&&Jn.keys.IE_PROTO||""))?"Symbol(src)_1."+dn:"",So=bn.toString,us=no.call(L),wi=vi._,es=Z("^"+no.call($n).replace(Gt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pl=Nl?un.Buffer:s,kl=un.Symbol,Zl=un.Uint8Array,Eu=Pl?Pl.allocUnsafe:s,il=lf(L.getPrototypeOf,L),xu=L.create,Zi=bn.propertyIsEnumerable,Jl=st.splice,Rl=kl?kl.isConcatSpreadable:s,al=kl?kl.iterator:s,sl=kl?kl.toStringTag:s,sc=(function(){try{var g=hl(L,"defineProperty");return g({},"",{}),g}catch{}})(),fm=un.clearTimeout!==vi.clearTimeout&&un.clearTimeout,pm=Wr&&Wr.now!==vi.Date.now&&Wr.now,Wh=un.setTimeout!==vi.setTimeout&&un.setTimeout,uf=R.ceil,lc=R.floor,bp=L.getOwnPropertySymbols,hm=Pl?Pl.isBuffer:s,uc=un.isFinite,cf=st.join,wp=lf(L.keys,L),ji=R.max,Wa=R.min,Ep=Wr.now,xp=un.parseInt,ld=R.random,dy=st.reverse,ud=hl(un,"DataView"),cd=hl(un,"Map"),df=hl(un,"Promise"),cc=hl(un,"Set"),Ou=hl(un,"WeakMap"),dd=hl(L,"create"),ff=Ou&&new Ou,Su={},fy=Ru(ud),pf=Ru(cd),py=Ru(df),hy=Ru(cc),vm=Ru(Ou),Op=kl?kl.prototype:s,ka=Op?Op.valueOf:s,mm=Op?Op.toString:s;function he(g){if(Bi(g)&&!Jr(g)&&!(g instanceof go)){if(g instanceof $s)return g;if($n.call(g,"__wrapped__"))return Xp(g)}return new $s(g)}var dc=(function(){function g(){}return function(x){if(!Ni(x))return{};if(xu)return xu(x);g.prototype=x;var T=new g;return g.prototype=s,T}})();function Ql(){}function $s(g,x){this.__wrapped__=g,this.__actions__=[],this.__chain__=!!x,this.__index__=0,this.__values__=s}function go(g){this.__wrapped__=g,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=D,this.__views__=[]}function ba(g){var x=-1,T=g==null?0:g.length;for(this.clear();++x<T;){var G=g[x];this.set(G[0],G[1])}}function To(g){var x=-1,T=g==null?0:g.length;for(this.clear();++x<T;){var G=g[x];this.set(G[0],G[1])}}function ll(g){var x=-1,T=g==null?0:g.length;for(this.clear();++x<T;){var G=g[x];this.set(G[0],G[1])}}function eu(g){var x=-1,T=g==null?0:g.length;for(this.__data__=new ll;++x<T;)this.add(g[x])}function Os(g){var x=this.__data__=new To(g);this.size=x.size}function Sp(g,x){var T=Jr(g),G=!T&&Tc(g),te=!T&&!G&&ns(g),ce=!T&&!G&&!te&&yt(g),Oe=T||G||te||ce,Fe=Oe?Kl(g.length,fe):[],et=Fe.length;for(var jt in g)!x&&!$n.call(g,jt)||Oe&&(jt=="length"||te&&(jt=="offset"||jt=="parent")||ce&&(jt=="buffer"||jt=="byteLength"||jt=="byteOffset")||Ra(jt,et))||Fe.push(jt);return Fe}function Ap(g){var x=g.length;return x?g[ev(0,x-1)]:s}function Gh(g,x){return Bl(va(g),Au(x,0,g.length))}function gm(g){return Bl(va(g))}function tu(g,x,T){(T!==s&&!Gs(g[x],T)||T===s&&!(x in g))&&ul(g,x,T)}function Li(g,x,T){var G=g[x];$n.call(g,x)&&Gs(G,T)&&(T!==s||x in g)||ul(g,x,T)}function fd(g,x){for(var T=g.length;T--;)if(Gs(g[T][0],x))return T;return-1}function zh(g,x,T,G){return mi(g,(function(te,ce,Oe){x(G,te,T(te),Oe)})),G}function nu(g,x){return g&&dl(x,on(x),g)}function ul(g,x,T){x=="__proto__"&&sc?sc(g,x,{configurable:!0,enumerable:!0,value:T,writable:!0}):g[x]=T}function hf(g,x){for(var T=-1,G=x.length,te=Gn(G),ce=g==null;++T<G;)te[T]=ce?s:_n(g,x[T]);return te}function Au(g,x,T){return g==g&&(T!==s&&(g=g<=T?g:T),x!==s&&(g=g>=x?g:x)),g}function Ss(g,x,T,G,te,ce){var Oe,Fe=1&x,et=2&x,jt=4&x;if(T&&(Oe=te?T(g,G,te,ce):T(g)),Oe!==s)return Oe;if(!Ni(g))return g;var Vt=Jr(g);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})(g),!Fe)return va(g,Oe)}else{var yn=Ti(g),Yn=yn==X||yn==Y;if(ns(g))return Sm(g,Fe);if(yn==J||yn==B||Yn&&!te){if(Oe=et||Yn?{}:ts(g),!Fe)return et?(function(an,Tn){return dl(an,bc(an),Tn)})(g,(function(an,Tn){return an&&dl(Tn,Zt(Tn),an)})(Oe,g)):(function(an,Tn){return dl(an,aa(an),Tn)})(g,nu(Oe,g))}else{if(!nr[yn])return te?g:{};Oe=(function(an,Tn,Br){var ir=an.constructor;switch(Tn){case Ye:return hc(an);case I:case V:return new ir(+an);case Be:return(function(Yr,Ao){var Mr=Ao?hc(Yr.buffer):Yr.buffer;return new Yr.constructor(Mr,Yr.byteOffset,Yr.byteLength)})(an,Br);case Je:case gt:case se:case Ze:case pe:case le:case we:case $e:case rt:return Am(an,Br);case W:return new ir;case Q:case ke: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,ka?L(ka.call(at)):{}}var at})(g,yn,Fe)}}ce||(ce=new Os);var Qn=ce.get(g);if(Qn)return Qn;ce.set(g,Oe),Ie(g)?g.forEach((function(an){Oe.add(Ss(an,x,T,an,g,ce))})):Jp(g)&&g.forEach((function(an,Tn){Oe.set(Tn,Ss(an,x,T,Tn,g,ce))}));var Sr=Vt?s:(jt?et?Vp:xf:et?Zt:on)(g);return Fa(Sr||g,(function(an,Tn){Sr&&(an=g[Tn=an]),Li(Oe,Tn,Ss(an,x,T,Tn,g,ce))})),Oe}function Hh(g,x,T){var G=T.length;if(g==null)return!G;for(g=L(g);G--;){var te=T[G],ce=x[te],Oe=g[te];if(Oe===s&&!(te in g)||!ce(Oe))return!1}return!0}function Xh(g,x,T){if(typeof g!="function")throw new Re(f);return xc((function(){g.apply(s,T)}),x)}function cl(g,x,T,G){var te=-1,ce=Za,Oe=!0,Fe=g.length,et=[],jt=x.length;if(!Fe)return et;T&&(x=Mo(x,ui(T))),G?(ce=rf,Oe=!1):x.length>=200&&(ce=rl,Oe=!1,x=new eu(x));e:for(;++te<Fe;){var Vt=g[te],yn=T==null?Vt:T(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=Ql.prototype,he.prototype.constructor=he,$s.prototype=dc(Ql.prototype),$s.prototype.constructor=$s,go.prototype=dc(Ql.prototype),go.prototype.constructor=go,ba.prototype.clear=function(){this.__data__=dd?dd(null):{},this.size=0},ba.prototype.delete=function(g){var x=this.has(g)&&delete this.__data__[g];return this.size-=x?1:0,x},ba.prototype.get=function(g){var x=this.__data__;if(dd){var T=x[g];return T===h?s:T}return $n.call(x,g)?x[g]:s},ba.prototype.has=function(g){var x=this.__data__;return dd?x[g]!==s:$n.call(x,g)},ba.prototype.set=function(g,x){var T=this.__data__;return this.size+=this.has(g)?0:1,T[g]=dd&&x===s?h:x,this},To.prototype.clear=function(){this.__data__=[],this.size=0},To.prototype.delete=function(g){var x=this.__data__,T=fd(x,g);return!(T<0)&&(T==x.length-1?x.pop():Jl.call(x,T,1),--this.size,!0)},To.prototype.get=function(g){var x=this.__data__,T=fd(x,g);return T<0?s:x[T][1]},To.prototype.has=function(g){return fd(this.__data__,g)>-1},To.prototype.set=function(g,x){var T=this.__data__,G=fd(T,g);return G<0?(++this.size,T.push([g,x])):T[G][1]=x,this},ll.prototype.clear=function(){this.size=0,this.__data__={hash:new ba,map:new(cd||To),string:new ba}},ll.prototype.delete=function(g){var x=bd(this,g).delete(g);return this.size-=x?1:0,x},ll.prototype.get=function(g){return bd(this,g).get(g)},ll.prototype.has=function(g){return bd(this,g).has(g)},ll.prototype.set=function(g,x){var T=bd(this,g),G=T.size;return T.set(g,x),this.size+=T.size==G?0:1,this},eu.prototype.add=eu.prototype.push=function(g){return this.__data__.set(g,h),this},eu.prototype.has=function(g){return this.__data__.has(g)},Os.prototype.clear=function(){this.__data__=new To,this.size=0},Os.prototype.delete=function(g){var x=this.__data__,T=x.delete(g);return this.size=x.size,T},Os.prototype.get=function(g){return this.__data__.get(g)},Os.prototype.has=function(g){return this.__data__.has(g)},Os.prototype.set=function(g,x){var T=this.__data__;if(T instanceof To){var G=T.__data__;if(!cd||G.length<199)return G.push([g,x]),this.size=++T.size,this;T=this.__data__=new ll(G)}return T.set(g,x),this.size=T.size,this};var mi=gc(ur),ym=gc(ti,!0);function Yh(g,x){var T=!0;return mi(g,(function(G,te,ce){return T=!!x(G,te,ce)})),T}function Ii(g,x,T){for(var G=-1,te=g.length;++G<te;){var ce=g[G],Oe=x(ce);if(Oe!=null&&(Fe===s?Oe==Oe&&!Dt(Oe):T(Oe,Fe)))var Fe=Oe,et=ce}return et}function Io(g,x){var T=[];return mi(g,(function(G,te,ce){x(G,te,ce)&&T.push(G)})),T}function Ji(g,x,T,G,te){var ce=-1,Oe=g.length;for(T||(T=Sf),te||(te=[]);++ce<Oe;){var Fe=g[ce];x>0&&T(Fe)?x>1?Ji(Fe,x-1,T,G,te):oa(te,Fe):G||(te[te.length]=Fe)}return te}var so=yc(),ei=yc(!0);function ur(g,x){return g&&so(g,x,on)}function ti(g,x){return g&&ei(g,x,on)}function vf(g,x){return Ba(x,(function(T){return Ts(g[T])}))}function Dl(g,x){for(var T=0,G=(x=jo(x,g)).length;g!=null&&T<G;)g=g[vl(x[T++])];return T&&T==G?g:s}function Mp(g,x,T){var G=x(g);return Jr(g)?G:oa(G,T(g))}function Ei(g){return g==null?g===s?"[object Undefined]":"[object Null]":sl&&sl in L(g)?(function(x){var T=$n.call(x,sl),G=x[sl];try{x[sl]=s;var te=!0}catch{}var ce=So.call(x);return te&&(T?x[sl]=G:delete x[sl]),ce})(g):(function(x){return So.call(x)})(g)}function Mi(g,x){return g>x}function qh(g,x){return g!=null&&$n.call(g,x)}function Kh(g,x){return g!=null&&x in L(g)}function mf(g,x,T){for(var G=T?rf:Za,te=g[0].length,ce=g.length,Oe=ce,Fe=Gn(ce),et=1/0,jt=[];Oe--;){var Vt=g[Oe];Oe&&x&&(Vt=Mo(Vt,ui(x))),et=Wa(Vt.length,et),Fe[Oe]=!T&&(x||te>=120&&Vt.length>=120)?new eu(Oe&&Vt):s}Vt=g[0];var yn=-1,Yn=Fe[0];e:for(;++yn<te&&jt.length<et;){var Qn=Vt[yn],Sr=x?x(Qn):Qn;if(Qn=T||Qn!==0?Qn:0,!(Yn?rl(Yn,Sr):G(jt,Sr,T))){for(Oe=ce;--Oe;){var an=Fe[Oe];if(!(an?rl(an,Sr):G(g[Oe],Sr,T)))continue e}Yn&&Yn.push(Sr),jt.push(Qn)}}return jt}function Ga(g,x,T){var G=(g=ku(g,x=jo(x,g)))==null?g:g[vl(gi(x))];return G==null?s:qo(G,g,T)}function Tp(g){return Bi(g)&&Ei(g)==B}function pd(g,x,T,G,te){return g===x||(g==null||x==null||!Bi(g)&&!Bi(x)?g!=g&&x!=x:(function(ce,Oe,Fe,et,jt,Vt){var yn=Jr(ce),Yn=Jr(Oe),Qn=yn?F:Ti(ce),Sr=Yn?F:Ti(Oe),an=(Qn=Qn==B?J:Qn)==J,Tn=(Sr=Sr==B?J:Sr)==J,Br=Qn==Sr;if(Br&&ns(ce)){if(!ns(Oe))return!1;yn=!0,an=!1}if(Br&&!an)return Vt||(Vt=new Os),yn||yt(ce)?_d(ce,Oe,Fe,et,jt,Vt):(function(Mr,Ur,xa,zs,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 Zl(Mr),new Zl(Ur)));case I:case V:case Q:return Gs(+Mr,+Ur);case z:return Mr.name==Ur.name&&Mr.message==Ur.message;case Se:case ke:return Mr==Ur+"";case W:var Nc=Ki;case Ae:var Qp=1&zs;if(Nc||(Nc=xs),Mr.size!=Ur.size&&!Qp)return!1;var yv=Iu.get(Mr);if(yv)return yv==Ur;zs|=2,Iu.set(Mr,Ur);var Fu=_d(Nc(Mr),Nc(Ur),zs,uu,Oa,Iu);return Iu.delete(Mr),Fu;case De:if(ka)return ka.call(Mr)==ka.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 Os),jt(Yr,Ao,Fe,et,Vt)}}return Br?(Vt||(Vt=new Os),(function(Mr,Ur,xa,zs,uu,Oa){var Iu=1&xa,Nc=xf(Mr),Qp=Nc.length,yv=xf(Ur).length;if(Qp!=yv&&!Iu)return!1;for(var Fu=Qp;Fu--;){var Od=Nc[Fu];if(!(Iu?Od in Ur:$n.call(Ur,Od)))return!1}var wy=Oa.get(Mr),eh=Oa.get(Ur);if(wy&&eh)return wy==Ur&&eh==Mr;var _v=!0;Oa.set(Mr,Ur),Oa.set(Ur,Mr);for(var Ey=Iu;++Fu<Qp;){var bv=Mr[Od=Nc[Fu]],Vf=Ur[Od];if(zs)var Wf=Iu?zs(Vf,bv,Od,Ur,Mr,Oa):zs(bv,Vf,Od,Mr,Ur,Oa);if(!(Wf===s?bv===Vf||uu(bv,Vf,xa,zs,Oa):Wf)){_v=!1;break}Ey||(Ey=Od=="constructor")}if(_v&&!Ey){var Pc=Mr.constructor,wv=Ur.constructor;Pc==wv||!("constructor"in Mr)||!("constructor"in Ur)||typeof Pc=="function"&&Pc instanceof Pc&&typeof wv=="function"&&wv instanceof wv||(_v=!1)}return Oa.delete(Mr),Oa.delete(Ur),_v})(ce,Oe,Fe,et,jt,Vt)):!1})(g,x,T,G,pd,te))}function Us(g,x,T,G){var te=T.length,ce=te,Oe=!G;if(g==null)return!ce;for(g=L(g);te--;){var Fe=T[te];if(Oe&&Fe[2]?Fe[1]!==g[Fe[0]]:!(Fe[0]in g))return!1}for(;++te<ce;){var et=(Fe=T[te])[0],jt=g[et],Vt=Fe[1];if(Oe&&Fe[2]){if(jt===s&&!(et in g))return!1}else{var yn=new Os;if(G)var Yn=G(jt,Vt,et,g,x,yn);if(!(Yn===s?pd(Vt,jt,3,G,yn):Yn))return!1}}return!0}function Mu(g){return!(!Ni(g)||(x=g,Kr&&Kr in x))&&(Ts(g)?es:yo).test(Ru(g));var x}function ru(g){return typeof g=="function"?g:g==null?Nr:typeof g=="object"?Jr(g)?Jh(g[0],g[1]):Zh(g):xe(g)}function Vs(g){if(!Qt(g))return wp(g);var x=[];for(var T in L(g))$n.call(g,T)&&T!="constructor"&&x.push(T);return x}function _m(g){if(!Ni(g))return(function(te){var ce=[];if(te!=null)for(var Oe in L(te))ce.push(Oe);return ce})(g);var x=Qt(g),T=[];for(var G in g)(G!="constructor"||!x&&$n.call(g,G))&&T.push(G);return T}function jl(g,x){return g<x}function As(g,x){var T=-1,G=fs(g)?Gn(g.length):[];return mi(g,(function(te,ce,Oe){G[++T]=x(te,ce,Oe)})),G}function Zh(g){var x=Of(g);return x.length==1&&x[0][2]?Af(x[0][0],x[0][1]):function(T){return T===g||Us(T,g,x)}}function Jh(g,x){return Il(g)&&wc(x)?Af(vl(g),x):function(T){var G=_n(T,g);return G===s&&G===x?Yt(T,g):pd(x,G,3)}}function Cp(g,x,T,G,te){g!==x&&so(x,(function(ce,Oe){if(te||(te=new Os),Ni(ce))(function(et,jt,Vt,yn,Yn,Qn,Sr){var an=zp(et,Vt),Tn=zp(jt,Vt),Br=Sr.get(Tn);if(Br)return void tu(et,Vt,Br);var ir=Qn?Qn(an,Tn,Vt+"",et,jt,Sr):s,at=ir===s;if(at){var Yr=Jr(Tn),Ao=!Yr&&ns(Tn),Mr=!Yr&&!Ao&&yt(Tn);ir=Tn,Yr||Ao||Mr?Jr(an)?ir=an:Oi(an)?ir=va(an):Ao?(at=!1,ir=Sm(Tn,!0)):Mr?(at=!1,ir=Am(Tn,!0)):ir=[]:K(Tn)||Tc(Tn)?(ir=an,Tc(an)?ir=rn(an):Ni(an)&&!Ts(an)||(ir=ts(Tn))):at=!1}at&&(Sr.set(Tn,ir),Yn(ir,Tn,yn,Qn,Sr),Sr.delete(Tn)),tu(et,Vt,ir)})(g,x,Oe,T,Cp,G,te);else{var Fe=G?G(zp(g,Oe),ce,Oe+"",g,x,te):s;Fe===s&&(Fe=ce),tu(g,Oe,Fe)}}),Zt)}function bm(g,x){var T=g.length;if(T)return Ra(x+=x<0?T:0,T)?g[x]:s}function wm(g,x,T){x=x.length?Mo(x,(function(ce){return Jr(ce)?function(Oe){return Dl(Oe,ce.length===1?ce[0]:ce)}:ce})):[Nr];var G=-1;x=Mo(x,ui(Rr()));var te=As(g,(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})(te,(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=hd(yn[Vt],Yn[Vt]);if(an)return Vt>=Sr?an:an*(jt[Vt]=="desc"?-1:1)}return Fe.index-et.index})(ce,Oe,T)}))}function Em(g,x,T){for(var G=-1,te=x.length,ce={};++G<te;){var Oe=x[G],Fe=Dl(g,Oe);T(Fe,Oe)&&fc(ce,jo(Oe,g),Fe)}return ce}function Np(g,x,T,G){var te=G?Ja:bu,ce=-1,Oe=x.length,Fe=g;for(g===x&&(x=va(x)),T&&(Fe=Mo(g,ui(T)));++ce<Oe;)for(var et=0,jt=x[ce],Vt=T?T(jt):jt;(et=te(Fe,Vt,et,G))>-1;)Fe!==g&&Jl.call(Fe,et,1),Jl.call(g,et,1);return g}function Qh(g,x){for(var T=g?x.length:0,G=T-1;T--;){var te=x[T];if(T==G||te!==ce){var ce=te;Ra(te)?Jl.call(g,te,1):kp(g,te)}}return g}function ev(g,x){return g+lc(ld()*(x-g+1))}function gf(g,x){var T="";if(!g||x<1||x>C)return T;do x%2&&(T+=g),(x=lc(x/2))&&(g+=g);while(x);return T}function uo(g,x){return Tf(Mf(g,x,Nr),g+"")}function vy(g){return Ap(Qr(g))}function tv(g,x){var T=Qr(g);return Bl(T,Au(x,0,T.length))}function fc(g,x,T,G){if(!Ni(g))return g;for(var te=-1,ce=(x=jo(x,g)).length,Oe=ce-1,Fe=g;Fe!=null&&++te<ce;){var et=vl(x[te]),jt=T;if(et==="__proto__"||et==="constructor"||et==="prototype")return g;if(te!=Oe){var Vt=Fe[et];(jt=G?G(Vt,et,Fe):s)===s&&(jt=Ni(Vt)?Vt:Ra(x[te+1])?[]:{})}Li(Fe,et,jt),Fe=Fe[et]}return g}var yf=ff?function(g,x){return ff.set(g,x),g}:Nr,my=sc?function(g,x){return sc(g,"toString",{configurable:!0,enumerable:!1,value:co(x),writable:!0})}:Nr;function xm(g){return Bl(Qr(g))}function Ms(g,x,T){var G=-1,te=g.length;x<0&&(x=-x>te?0:te+x),(T=T>te?te:T)<0&&(T+=te),te=x>T?0:T-x>>>0,x>>>=0;for(var ce=Gn(te);++G<te;)ce[G]=g[G+x];return ce}function gy(g,x){var T;return mi(g,(function(G,te,ce){return!(T=x(G,te,ce))})),!!T}function _f(g,x,T){var G=0,te=g==null?G:g.length;if(typeof x=="number"&&x==x&&te<=2147483647){for(;G<te;){var ce=G+te>>>1,Oe=g[ce];Oe!==null&&!Dt(Oe)&&(T?Oe<=x:Oe<x)?G=ce+1:te=ce}return te}return Pp(g,x,Nr,T)}function Pp(g,x,T,G){var te=0,ce=g==null?0:g.length;if(ce===0)return 0;for(var Oe=(x=T(x))!=x,Fe=x===null,et=Dt(x),jt=x===s;te<ce;){var Vt=lc((te+ce)/2),yn=T(g[Vt]),Yn=yn!==s,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?te=Vt+1:ce=Vt}return Wa(ce,4294967294)}function nv(g,x){for(var T=-1,G=g.length,te=0,ce=[];++T<G;){var Oe=g[T],Fe=x?x(Oe):Oe;if(!T||!Gs(Fe,et)){var et=Fe;ce[te++]=Oe===0?0:Oe}}return ce}function Om(g){return typeof g=="number"?g:Dt(g)?$:+g}function cs(g){if(typeof g=="string")return g;if(Jr(g))return Mo(g,cs)+"";if(Dt(g))return mm?mm.call(g):"";var x=g+"";return x=="0"&&1/g==-1/0?"-0":x}function Tu(g,x,T){var G=-1,te=Za,ce=g.length,Oe=!0,Fe=[],et=Fe;if(T)Oe=!1,te=rf;else if(ce>=200){var jt=x?null:Tm(g);if(jt)return xs(jt);Oe=!1,te=rl,et=new eu}else et=x?[]:Fe;e:for(;++G<ce;){var Vt=g[G],yn=x?x(Vt):Vt;if(Vt=T||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 te(et,yn,T)||(et!==Fe&&et.push(yn),Fe.push(Vt))}return Fe}function kp(g,x){return(g=ku(g,x=jo(x,g)))==null||delete g[vl(gi(x))]}function pc(g,x,T,G){return fc(g,x,T(Dl(g,x)),G)}function Rp(g,x,T,G){for(var te=g.length,ce=G?te:-1;(G?ce--:++ce<te)&&x(g[ce],ce,g););return T?Ms(g,G?0:ce,G?ce+1:te):Ms(g,G?ce+1:0,G?te:ce)}function rv(g,x){var T=g;return T instanceof go&&(T=T.value()),id(x,(function(G,te){return te.func.apply(te.thisArg,oa([G],te.args))}),T)}function Dp(g,x,T){var G=g.length;if(G<2)return G?Tu(g[0]):[];for(var te=-1,ce=Gn(G);++te<G;)for(var Oe=g[te],Fe=-1;++Fe<G;)Fe!=te&&(ce[te]=cl(ce[te]||Oe,g[Fe],x,T));return Tu(Ji(ce,1),x,T)}function bf(g,x,T){for(var G=-1,te=g.length,ce=x.length,Oe={};++G<te;){var Fe=G<ce?x[G]:s;T(Oe,g[G],Fe)}return Oe}function jp(g){return Oi(g)?g:[]}function Lp(g){return typeof g=="function"?g:Nr}function jo(g,x){return Jr(g)?g:Il(g,x)?[g]:dv(Wt(g))}var yy=uo;function Uo(g,x,T){var G=g.length;return T=T===s?G:T,!x&&T>=G?g:Ms(g,x,T)}var Ip=fm||function(g){return vi.clearTimeout(g)};function Sm(g,x){if(x)return g.slice();var T=g.length,G=Eu?Eu(T):new g.constructor(T);return g.copy(G),G}function hc(g){var x=new g.constructor(g.byteLength);return new Zl(x).set(new Zl(g)),x}function Am(g,x){var T=x?hc(g.buffer):g.buffer;return new g.constructor(T,g.byteOffset,g.length)}function hd(g,x){if(g!==x){var T=g!==s,G=g===null,te=g==g,ce=Dt(g),Oe=x!==s,Fe=x===null,et=x==x,jt=Dt(x);if(!Fe&&!jt&&!ce&&g>x||ce&&Oe&&et&&!Fe&&!jt||G&&Oe&&et||!T&&et||!te)return 1;if(!G&&!ce&&!jt&&g<x||jt&&T&&te&&!G&&!ce||Fe&&T&&te||!Oe&&te||!et)return-1}return 0}function Mm(g,x,T,G){for(var te=-1,ce=g.length,Oe=T.length,Fe=-1,et=x.length,jt=ji(ce-Oe,0),Vt=Gn(et+jt),yn=!G;++Fe<et;)Vt[Fe]=x[Fe];for(;++te<Oe;)(yn||te<ce)&&(Vt[T[te]]=g[te]);for(;jt--;)Vt[Fe++]=g[te++];return Vt}function vc(g,x,T,G){for(var te=-1,ce=g.length,Oe=-1,Fe=T.length,et=-1,jt=x.length,Vt=ji(ce-Fe,0),yn=Gn(Vt+jt),Yn=!G;++te<Vt;)yn[te]=g[te];for(var Qn=te;++et<jt;)yn[Qn+et]=x[et];for(;++Oe<Fe;)(Yn||te<ce)&&(yn[Qn+T[Oe]]=g[te++]);return yn}function va(g,x){var T=-1,G=g.length;for(x||(x=Gn(G));++T<G;)x[T]=g[T];return x}function dl(g,x,T,G){var te=!T;T||(T={});for(var ce=-1,Oe=x.length;++ce<Oe;){var Fe=x[ce],et=G?G(T[Fe],g[Fe],Fe,T,g):s;et===s&&(et=g[Fe]),te?ul(T,Fe,et):Li(T,Fe,et)}return T}function ou(g,x){return function(T,G){var te=Jr(T)?Uh:zh,ce=x?x():{};return te(T,g,Rr(G,2),ce)}}function mc(g){return uo((function(x,T){var G=-1,te=T.length,ce=te>1?T[te-1]:s,Oe=te>2?T[2]:s;for(ce=g.length>3&&typeof ce=="function"?(te--,ce):s,Oe&&Fi(T[0],T[1],Oe)&&(ce=te<3?s:ce,te=1),x=L(x);++G<te;){var Fe=T[G];Fe&&g(x,Fe,G,ce)}return x}))}function gc(g,x){return function(T,G){if(T==null)return T;if(!fs(T))return g(T,G);for(var te=T.length,ce=x?te:-1,Oe=L(T);(x?ce--:++ce<te)&&G(Oe[ce],ce,Oe)!==!1;);return T}}function yc(g){return function(x,T,G){for(var te=-1,ce=L(x),Oe=G(x),Fe=Oe.length;Fe--;){var et=Oe[g?Fe:++te];if(T(ce[et],et,ce)===!1)break}return x}}function Fp(g){return function(x){var T=ol(x=Wt(x))?Qa(x):s,G=T?T[0]:x.charAt(0),te=T?Uo(T,1).join(""):x.slice(1);return G[g]()+te}}function iu(g){return function(x){return id(di(jr(x).replace(Kn,"")),g,"")}}function _c(g){return function(){var x=arguments;switch(x.length){case 0:return new g;case 1:return new g(x[0]);case 2:return new g(x[0],x[1]);case 3:return new g(x[0],x[1],x[2]);case 4:return new g(x[0],x[1],x[2],x[3]);case 5:return new g(x[0],x[1],x[2],x[3],x[4]);case 6:return new g(x[0],x[1],x[2],x[3],x[4],x[5]);case 7:return new g(x[0],x[1],x[2],x[3],x[4],x[5],x[6])}var T=dc(g.prototype),G=g.apply(T,x);return Ni(G)?G:T}}function Bp(g){return function(x,T,G){var te=L(x);if(!fs(x)){var ce=Rr(T,3);x=on(x),T=function(Fe){return ce(te[Fe],Fe,te)}}var Oe=g(x,T,G);return Oe>-1?te[ce?x[Oe]:Oe]:s}}function fl(g){return Ll((function(x){var T=x.length,G=T,te=$s.prototype.thru;for(g&&x.reverse();G--;){var ce=x[G];if(typeof ce!="function")throw new Re(f);if(te&&!Oe&&Cu(ce)=="wrapper")var Oe=new $s([],!0)}for(G=Oe?G:T;++G<T;){var Fe=Cu(ce=x[G]),et=Fe=="wrapper"?Wp(ce):s;Oe=et&&Fl(et[0])&&et[1]==424&&!et[4].length&&et[9]==1?Oe[Cu(et[0])].apply(Oe,et[3]):ce.length==1&&Fl(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=T?x[yn].apply(this,jt):Vt;++yn<T;)Yn=x[yn].call(this,Yn);return Yn}}))}function wf(g,x,T,G,te,ce,Oe,Fe,et,jt){var Vt=x&E,yn=1&x,Yn=2&x,Qn=24&x,Sr=512&x,an=Yn?s:_c(g);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=Mm(ir,G,te,Qn)),ce&&(ir=vc(ir,ce,Oe,Qn)),Br-=Ao,Qn&&Br<jt){var Mr=ss(ir,Yr);return ov(g,x,wf,Tn.placeholder,T,ir,Mr,Fe,et,jt-Br)}var Ur=yn?T:this,xa=Yn?Ur[g]:g;return Br=ir.length,Fe?ir=Ec(ir,Fe):Sr&&Br>1&&ir.reverse(),Vt&&et<Br&&(ir.length=et),this&&this!==vi&&this instanceof Tn&&(xa=an||_c(xa)),xa.apply(Ur,ir)}}function Ef(g,x){return function(T,G){return(function(te,ce,Oe,Fe){return ur(te,(function(et,jt,Vt){ce(Fe,Oe(et),jt,Vt)})),Fe})(T,g,x(G),{})}}function vd(g,x){return function(T,G){var te;if(T===s&&G===s)return x;if(T!==s&&(te=T),G!==s){if(te===s)return G;typeof T=="string"||typeof G=="string"?(T=cs(T),G=cs(G)):(T=Om(T),G=Om(G)),te=g(T,G)}return te}}function md(g){return Ll((function(x){return x=Mo(x,ui(Rr())),uo((function(T){var G=this;return g(x,(function(te){return qo(te,G,T)}))}))}))}function gd(g,x){var T=(x=x===s?" ":cs(x)).length;if(T<2)return T?gf(x,g):x;var G=gf(x,uf(g/Va(x)));return ol(x)?Uo(Qa(G),0,g).join(""):G.slice(0,g)}function $p(g){return function(x,T,G){return G&&typeof G!="number"&&Fi(x,T,G)&&(T=G=s),x=nn(x),T===s?(T=x,x=0):T=nn(T),(function(te,ce,Oe,Fe){for(var et=-1,jt=ji(uf((ce-te)/(Oe||1)),0),Vt=Gn(jt);jt--;)Vt[Fe?jt:++et]=te,te+=Oe;return Vt})(x,T,G=G===s?x<T?1:-1:nn(G),g)}}function yd(g){return function(x,T){return typeof x=="string"&&typeof T=="string"||(x=pn(x),T=pn(T)),g(x,T)}}function ov(g,x,T,G,te,ce,Oe,Fe,et,jt){var Vt=8&x;x|=Vt?w:O,4&(x&=~(Vt?O:w))||(x&=-4);var yn=[g,x,te,Vt?ce:s,Vt?Oe:s,Vt?s:ce,Vt?s:Oe,Fe,et,jt],Yn=T.apply(s,yn);return Fl(g)&&uv(Yn,yn),Yn.placeholder=G,Hp(Yn,g,x)}function Up(g){var x=R[g];return function(T,G){if(T=pn(T),(G=G==null?0:Wa(Mt(G),292))&&uc(T)){var te=(Wt(T)+"e").split("e");return+((te=(Wt(x(te[0]+"e"+(+te[1]+G)))+"e").split("e"))[0]+"e"+(+te[1]-G))}return x(T)}}var Tm=cc&&1/xs(new cc([,-0]))[1]==M?function(g){return new cc(g)}:Et;function iv(g){return function(x){var T=Ti(x);return T==W?Ki(x):T==Ae?sd(x):(function(G,te){return Mo(te,(function(ce){return[ce,G[ce]]}))})(x,g(x))}}function pl(g,x,T,G,te,ce,Oe,Fe){var et=2&x;if(!et&&typeof g!="function")throw new Re(f);var jt=G?G.length:0;if(jt||(x&=-97,G=te=s),Oe=Oe===s?Oe:ji(Mt(Oe),0),Fe=Fe===s?Fe:Mt(Fe),jt-=te?te.length:0,x&O){var Vt=G,yn=te;G=te=s}var Yn=et?s:Wp(g),Qn=[g,x,T,G,te,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==E&&Br==8||ir==E&&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?Mm(Ur,Mr,Tn[4]):Mr,an[4]=Ur?ss(an[3],v):Tn[4]}(Mr=Tn[5])&&(Ur=an[5],an[5]=Ur?vc(Ur,Mr,Tn[6]):Mr,an[6]=Ur?ss(an[5],v):Tn[6]),(Mr=Tn[7])&&(an[7]=Mr),ir&E&&(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),g=Qn[0],x=Qn[1],T=Qn[2],G=Qn[3],te=Qn[4],!(Fe=Qn[9]=Qn[9]===s?et?0:g.length:ji(Qn[9]-jt,0))&&24&x&&(x&=-25),x&&x!=1)Sr=x==8||x==b?(function(an,Tn,Br){var ir=_c(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?[]:ss(Ao,Ur);return(Yr-=xa.length)<Br?ov(an,Tn,wf,at.placeholder,s,Ao,xa,s,s,Br-Yr):qo(this&&this!==vi&&this instanceof at?ir:an,this,Ao)}})(g,x,Fe):x!=w&&x!=33||te.length?wf.apply(s,Qn):(function(an,Tn,Br,ir){var at=1&Tn,Yr=_c(an);return function Ao(){for(var Mr=-1,Ur=arguments.length,xa=-1,zs=ir.length,uu=Gn(zs+Ur),Oa=this&&this!==vi&&this instanceof Ao?Yr:an;++xa<zs;)uu[xa]=ir[xa];for(;Ur--;)uu[xa++]=arguments[++Mr];return qo(Oa,at?Br:this,uu)}})(g,x,T,G);else var Sr=(function(an,Tn,Br){var ir=1&Tn,at=_c(an);return function Yr(){return(this&&this!==vi&&this instanceof Yr?at:an).apply(ir?Br:this,arguments)}})(g,x,T);return Hp((Yn?yf:uv)(Sr,Qn),g,x)}function av(g,x,T,G){return g===s||Gs(g,bn[T])&&!$n.call(G,T)?x:g}function sv(g,x,T,G,te,ce){return Ni(g)&&Ni(x)&&(ce.set(x,g),Cp(g,x,s,sv,ce),ce.delete(x)),g}function lv(g){return K(g)?s:g}function _d(g,x,T,G,te,ce){var Oe=1&T,Fe=g.length,et=x.length;if(Fe!=et&&!(Oe&&et>Fe))return!1;var jt=ce.get(g),Vt=ce.get(x);if(jt&&Vt)return jt==x&&Vt==g;var yn=-1,Yn=!0,Qn=2&T?new eu:s;for(ce.set(g,x),ce.set(x,g);++yn<Fe;){var Sr=g[yn],an=x[yn];if(G)var Tn=Oe?G(an,Sr,yn,x,g,ce):G(Sr,an,yn,g,x,ce);if(Tn!==s){if(Tn)continue;Yn=!1;break}if(Qn){if(!of(x,(function(Br,ir){if(!rl(Qn,ir)&&(Sr===Br||te(Sr,Br,T,G,ce)))return Qn.push(ir)}))){Yn=!1;break}}else if(Sr!==an&&!te(Sr,an,T,G,ce)){Yn=!1;break}}return ce.delete(g),ce.delete(x),Yn}function Ll(g){return Tf(Mf(g,s,Cf),g+"")}function xf(g){return Mp(g,on,aa)}function Vp(g){return Mp(g,Zt,bc)}var Wp=ff?function(g){return ff.get(g)}:Et;function Cu(g){for(var x=g.name+"",T=Su[x],G=$n.call(Su,x)?T.length:0;G--;){var te=T[G],ce=te.func;if(ce==null||ce==g)return te.name}return x}function Nu(g){return($n.call(he,"placeholder")?he:g).placeholder}function Rr(){var g=he.iteratee||fi;return g=g===fi?ru:g,arguments.length?g(arguments[0],arguments[1]):g}function bd(g,x){var T,G,te=g.__data__;return((G=typeof(T=x))=="string"||G=="number"||G=="symbol"||G=="boolean"?T!=="__proto__":T===null)?te[typeof x=="string"?"string":"hash"]:te.map}function Of(g){for(var x=on(g),T=x.length;T--;){var G=x[T],te=g[G];x[T]=[G,te,wc(te)]}return x}function hl(g,x){var T=(function(G,te){return G==null?s:G[te]})(g,x);return Mu(T)?T:s}var aa=bp?function(g){return g==null?[]:(g=L(g),Ba(bp(g),(function(x){return Zi.call(g,x)})))}:tt,bc=bp?function(g){for(var x=[];g;)oa(x,aa(g)),g=il(g);return x}:tt,Ti=Ei;function Pu(g,x,T){for(var G=-1,te=(x=jo(x,g)).length,ce=!1;++G<te;){var Oe=vl(x[G]);if(!(ce=g!=null&&T(g,Oe)))break;g=g[Oe]}return ce||++G!=te?ce:!!(te=g==null?0:g.length)&&Uf(te)&&Ra(Oe,te)&&(Jr(g)||Tc(g))}function ts(g){return typeof g.constructor!="function"||Qt(g)?{}:dc(il(g))}function Sf(g){return Jr(g)||Tc(g)||!!(Rl&&g&&g[Rl])}function Ra(g,x){var T=typeof g;return!!(x=x??C)&&(T=="number"||T!="symbol"&&Nn.test(g))&&g>-1&&g%1==0&&g<x}function Fi(g,x,T){if(!Ni(T))return!1;var G=typeof x;return!!(G=="number"?fs(T)&&Ra(x,T.length):G=="string"&&x in T)&&Gs(T[x],g)}function Il(g,x){if(Jr(g))return!1;var T=typeof g;return!(T!="number"&&T!="symbol"&&T!="boolean"&&g!=null&&!Dt(g))||Pt.test(g)||!q.test(g)||x!=null&&g in L(x)}function Fl(g){var x=Cu(g),T=he[x];if(typeof T!="function"||!(x in go.prototype))return!1;if(g===T)return!0;var G=Wp(T);return!!G&&g===G[0]}(ud&&Ti(new ud(new ArrayBuffer(1)))!=Be||cd&&Ti(new cd)!=W||df&&Ti(df.resolve())!=ie||cc&&Ti(new cc)!=Ae||Ou&&Ti(new Ou)!=ze)&&(Ti=function(g){var x=Ei(g),T=x==J?g.constructor:s,G=T?Ru(T):"";if(G)switch(G){case fy:return Be;case pf:return W;case py:return ie;case hy:return Ae;case vm:return ze}return x});var Gp=Jn?Ts:ct;function Qt(g){var x=g&&g.constructor;return g===(typeof x=="function"&&x.prototype||bn)}function wc(g){return g==g&&!Ni(g)}function Af(g,x){return function(T){return T!=null&&T[g]===x&&(x!==s||g in L(T))}}function Mf(g,x,T){return x=ji(x===s?g.length-1:x,0),function(){for(var G=arguments,te=-1,ce=ji(G.length-x,0),Oe=Gn(ce);++te<ce;)Oe[te]=G[x+te];te=-1;for(var Fe=Gn(x+1);++te<x;)Fe[te]=G[te];return Fe[x]=T(Oe),qo(g,this,Fe)}}function ku(g,x){return x.length<2?g:Dl(g,Ms(x,0,-1))}function Ec(g,x){for(var T=g.length,G=Wa(x.length,T),te=va(g);G--;){var ce=x[G];g[G]=Ra(ce,T)?te[ce]:s}return g}function zp(g,x){if((x!=="constructor"||typeof g[x]!="function")&&x!="__proto__")return g[x]}var uv=cv(yf),xc=Wh||function(g,x){return vi.setTimeout(g,x)},Tf=cv(my);function Hp(g,x,T){var G=x+"";return Tf(g,(function(te,ce){var Oe=ce.length;if(!Oe)return te;var Fe=Oe-1;return ce[Fe]=(Oe>1?"& ":"")+ce[Fe],ce=ce.join(Oe>2?", ":" "),te.replace(Pe,`{
/* [wrapped with `+ce+`] */
`)})(G,(function(te,ce){return Fa(k,(function(Oe){var Fe="_."+Oe[0];ce&Oe[1]&&!Za(te,Fe)&&te.push(Fe)})),te.sort()})((function(te){var ce=te.match(Ke);return ce?ce[1].split(Le):[]})(G),T)))}function cv(g){var x=0,T=0;return function(){var G=Ep(),te=16-(G-T);if(T=G,te>0){if(++x>=800)return arguments[0]}else x=0;return g.apply(s,arguments)}}function Bl(g,x){var T=-1,G=g.length,te=G-1;for(x=x===s?G:x;++T<x;){var ce=ev(T,te),Oe=g[ce];g[ce]=g[T],g[T]=Oe}return g.length=x,g}var dv=(function(g){var x=lu(g,(function(G){return T.size===500&&T.clear(),G})),T=x.cache;return x})((function(g){var x=[];return g.charCodeAt(0)===46&&x.push(""),g.replace(Rt,(function(T,G,te,ce){x.push(te?ce.replace(Tt,"$1"):G||T)})),x}));function vl(g){if(typeof g=="string"||Dt(g))return g;var x=g+"";return x=="0"&&1/g==-1/0?"-0":x}function Ru(g){if(g!=null){try{return no.call(g)}catch{}try{return g+""}catch{}}return""}function Xp(g){if(g instanceof go)return g.clone();var x=new $s(g.__wrapped__,g.__chain__);return x.__actions__=va(g.__actions__),x.__index__=g.__index__,x.__values__=g.__values__,x}var Cm=uo((function(g,x){return Oi(g)?cl(g,Ji(x,1,Oi,!0)):[]})),Nm=uo((function(g,x){var T=gi(x);return Oi(T)&&(T=s),Oi(g)?cl(g,Ji(x,1,Oi,!0),Rr(T,2)):[]})),Pm=uo((function(g,x){var T=gi(x);return Oi(T)&&(T=s),Oi(g)?cl(g,Ji(x,1,Oi,!0),s,T):[]}));function fv(g,x,T){var G=g==null?0:g.length;if(!G)return-1;var te=T==null?0:Mt(T);return te<0&&(te=ji(G+te,0)),$a(g,Rr(x,3),te)}function Yp(g,x,T){var G=g==null?0:g.length;if(!G)return-1;var te=G-1;return T!==s&&(te=Mt(T),te=T<0?ji(G+te,0):Wa(te,G-1)),$a(g,Rr(x,3),te,!0)}function Cf(g){return g!=null&&g.length?Ji(g,1):[]}function km(g){return g&&g.length?g[0]:s}var ml=uo((function(g){var x=Mo(g,jp);return x.length&&x[0]===g[0]?mf(x):[]})),Du=uo((function(g){var x=gi(g),T=Mo(g,jp);return x===gi(T)?x=s:T.pop(),T.length&&T[0]===g[0]?mf(T,Rr(x,2)):[]})),_y=uo((function(g){var x=gi(g),T=Mo(g,jp);return(x=typeof x=="function"?x:s)&&T.pop(),T.length&&T[0]===g[0]?mf(T,s,x):[]}));function gi(g){var x=g==null?0:g.length;return x?g[x-1]:s}var Nf=uo(Oc);function Oc(g,x){return g&&g.length&&x&&x.length?Np(g,x):g}var Pf=Ll((function(g,x){var T=g==null?0:g.length,G=hf(g,x);return Qh(g,Mo(x,(function(te){return Ra(te,T)?+te:te})).sort(hd)),G}));function wd(g){return g==null?g:dy.call(g)}var kf=uo((function(g){return Tu(Ji(g,1,Oi,!0))})),Rf=uo((function(g){var x=gi(g);return Oi(x)&&(x=s),Tu(Ji(g,1,Oi,!0),Rr(x,2))})),Df=uo((function(g){var x=gi(g);return x=typeof x=="function"?x:s,Tu(Ji(g,1,Oi,!0),s,x)}));function Sc(g){if(!g||!g.length)return[];var x=0;return g=Ba(g,(function(T){if(Oi(T))return x=ji(T.length,x),!0})),Kl(x,(function(T){return Mo(g,Ua(T))}))}function au(g,x){if(!g||!g.length)return[];var T=Sc(g);return x==null?T:Mo(T,(function(G){return qo(x,s,G)}))}var ma=uo((function(g,x){return Oi(g)?cl(g,x):[]})),qp=uo((function(g){return Dp(Ba(g,Oi))})),jf=uo((function(g){var x=gi(g);return Oi(x)&&(x=s),Dp(Ba(g,Oi),Rr(x,2))})),Ac=uo((function(g){var x=gi(g);return x=typeof x=="function"?x:s,Dp(Ba(g,Oi),s,x)})),Ed=uo(Sc),wa=uo((function(g){var x=g.length,T=x>1?g[x-1]:s;return T=typeof T=="function"?(g.pop(),T):s,au(g,T)}));function xi(g){var x=he(g);return x.__chain__=!0,x}function Lf(g,x){return x(g)}var za=Ll((function(g){var x=g.length,T=x?g[0]:0,G=this.__wrapped__,te=function(ce){return hf(ce,g)};return!(x>1||this.__actions__.length)&&G instanceof go&&Ra(T)?((G=G.slice(T,+T+(x?1:0))).__actions__.push({func:Lf,args:[te],thisArg:s}),new $s(G,this.__chain__).thru((function(ce){return x&&!ce.length&&ce.push(s),ce}))):this.thru(te)})),wr=ou((function(g,x,T){$n.call(g,T)?++g[T]:ul(g,T,1)})),Kp=Bp(fv),If=Bp(Yp);function Zp(g,x){return(Jr(g)?Fa:mi)(g,Rr(x,3))}function pv(g,x){return(Jr(g)?gp:ym)(g,Rr(x,3))}var Rm=ou((function(g,x,T){$n.call(g,T)?g[T].push(x):ul(g,T,[x])})),ju=uo((function(g,x,T){var G=-1,te=typeof x=="function",ce=fs(g)?Gn(g.length):[];return mi(g,(function(Oe){ce[++G]=te?qo(x,Oe,T):Ga(Oe,x,T)})),ce})),Dm=ou((function(g,x,T){ul(g,T,x)}));function Mc(g,x){return(Jr(g)?Mo:As)(g,Rr(x,3))}var jm=ou((function(g,x,T){g[T?0:1].push(x)}),(function(){return[[],[]]})),hv=uo((function(g,x){if(g==null)return[];var T=x.length;return T>1&&Fi(g,x[0],x[1])?x=[]:T>2&&Fi(x[0],x[1],x[2])&&(x=[x[0]]),wm(g,Ji(x,1),[])})),Ff=pm||function(){return vi.Date.now()};function Lm(g,x,T){return x=T?s:x,x=g&&x==null?g.length:x,pl(g,E,s,s,s,s,x)}function Ws(g,x){var T;if(typeof x!="function")throw new Re(f);return g=Mt(g),function(){return--g>0&&(T=x.apply(this,arguments)),g<=1&&(x=s),T}}var su=uo((function(g,x,T){var G=1;if(T.length){var te=ss(T,Nu(su));G|=w}return pl(g,G,x,T,te)})),Lu=uo((function(g,x,T){var G=3;if(T.length){var te=ss(T,Nu(Lu));G|=w}return pl(x,G,g,T,te)}));function Er(g,x,T){var G,te,ce,Oe,Fe,et,jt=0,Vt=!1,yn=!1,Yn=!0;if(typeof g!="function")throw new Re(f);function Qn(at){var Yr=G,Ao=te;return G=te=s,jt=at,Oe=g.apply(Ao,Yr)}function Sr(at){return jt=at,Fe=xc(Tn,x),Vt?Qn(at):Oe}function an(at){var Yr=at-et;return et===s||Yr>=x||Yr<0||yn&&at-jt>=ce}function Tn(){var at=Ff();if(an(at))return Br(at);Fe=xc(Tn,(function(Yr){var Ao=x-(Yr-et);return yn?Wa(Ao,ce-(Yr-jt)):Ao})(at))}function Br(at){return Fe=s,Yn&&G?Qn(at):(G=te=s,Oe)}function ir(){var at=Ff(),Yr=an(at);if(G=arguments,te=this,et=at,Yr){if(Fe===s)return Sr(et);if(yn)return Ip(Fe),Fe=xc(Tn,x),Qn(et)}return Fe===s&&(Fe=xc(Tn,x)),Oe}return x=pn(x)||0,Ni(T)&&(Vt=!!T.leading,ce=(yn="maxWait"in T)?ji(pn(T.maxWait)||0,x):ce,Yn="trailing"in T?!!T.trailing:Yn),ir.cancel=function(){Fe!==s&&Ip(Fe),jt=0,G=et=te=Fe=s},ir.flush=function(){return Fe===s?Oe:Br(Ff())},ir}var vv=uo((function(g,x){return Xh(g,1,x)})),xd=uo((function(g,x,T){return Xh(g,pn(x)||0,T)}));function lu(g,x){if(typeof g!="function"||x!=null&&typeof x!="function")throw new Re(f);var T=function(){var G=arguments,te=x?x.apply(this,G):G[0],ce=T.cache;if(ce.has(te))return ce.get(te);var Oe=g.apply(this,G);return T.cache=ce.set(te,Oe)||ce,Oe};return T.cache=new(lu.Cache||ll),T}function Bf(g){if(typeof g!="function")throw new Re(f);return function(){var x=arguments;switch(x.length){case 0:return!g.call(this);case 1:return!g.call(this,x[0]);case 2:return!g.call(this,x[0],x[1]);case 3:return!g.call(this,x[0],x[1],x[2])}return!g.apply(this,x)}}lu.Cache=ll;var Ha=yy((function(g,x){var T=(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 te=-1,ce=Wa(G.length,T);++te<ce;)G[te]=x[te].call(this,G[te]);return qo(g,this,G)}))})),gl=uo((function(g,x){var T=ss(x,Nu(gl));return pl(g,w,s,x,T)})),Ci=uo((function(g,x){var T=ss(x,Nu(Ci));return pl(g,O,s,x,T)})),ds=Ll((function(g,x){return pl(g,S,s,s,s,x)}));function Gs(g,x){return g===x||g!=g&&x!=x}var by=yd(Mi),$f=yd((function(g,x){return g>=x})),Tc=Tp((function(){return arguments})())?Tp:function(g){return Bi(g)&&$n.call(g,"callee")&&!Zi.call(g,"callee")},Jr=Gn.isArray,Im=La?ui(La):function(g){return Bi(g)&&Ei(g)==Ye};function fs(g){return g!=null&&Uf(g.length)&&!Ts(g)}function Oi(g){return Bi(g)&&fs(g)}var ns=hm||ct,mv=od?ui(od):function(g){return Bi(g)&&Ei(g)==V};function Ea(g){if(!Bi(g))return!1;var x=Ei(g);return x==z||x=="[object DOMException]"||typeof g.message=="string"&&typeof g.name=="string"&&!K(g)}function Ts(g){if(!Ni(g))return!1;var x=Ei(g);return x==X||x==Y||x=="[object AsyncFunction]"||x=="[object Proxy]"}function Cc(g){return typeof g=="number"&&g==Mt(g)}function Uf(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=C}function Ni(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Bi(g){return g!=null&&typeof g=="object"}var Jp=_u?ui(_u):function(g){return Bi(g)&&Ti(g)==W};function gv(g){return typeof g=="number"||Bi(g)&&Ei(g)==Q}function K(g){if(!Bi(g)||Ei(g)!=J)return!1;var x=il(g);if(x===null)return!0;var T=$n.call(x,"constructor")&&x.constructor;return typeof T=="function"&&T instanceof T&&no.call(T)==us}var me=Ia?ui(Ia):function(g){return Bi(g)&&Ei(g)==Se},Ie=ra?ui(ra):function(g){return Bi(g)&&Ti(g)==Ae};function wt(g){return typeof g=="string"||!Jr(g)&&Bi(g)&&Ei(g)==ke}function Dt(g){return typeof g=="symbol"||Bi(g)&&Ei(g)==De}var yt=bs?ui(bs):function(g){return Bi(g)&&Uf(g.length)&&!!Cn[Ei(g)]},Nt=yd(jl),tn=yd((function(g,x){return g<=x}));function ln(g){if(!g)return[];if(fs(g))return wt(g)?Qa(g):va(g);if(al&&g[al])return(function(T){for(var G,te=[];!(G=T.next()).done;)te.push(G.value);return te})(g[al]());var x=Ti(g);return(x==W?Ki:x==Ae?xs:Qr)(g)}function nn(g){return g?(g=pn(g))===M||g===-1/0?17976931348623157e292*(g<0?-1:1):g==g?g:0:g===0?g:0}function Mt(g){var x=nn(g),T=x%1;return x==x?T?x-T:x:0}function wn(g){return g?Au(Mt(g),0,D):0}function pn(g){if(typeof g=="number")return g;if(Dt(g))return $;if(Ni(g)){var x=typeof g.valueOf=="function"?g.valueOf():g;g=Ni(x)?x+"":x}if(typeof g!="string")return g===0?g:+g;g=Bs(g);var T=Lo.test(g);return T||ho.test(g)?sr(g.slice(2),T?2:8):ao.test(g)?$:+g}function rn(g){return dl(g,Zt(g))}function Wt(g){return g==null?"":cs(g)}var lt=mc((function(g,x){if(Qt(x)||fs(x))dl(x,on(x),g);else for(var T in x)$n.call(x,T)&&Li(g,T,x[T])})),St=mc((function(g,x){dl(x,Zt(x),g)})),sn=mc((function(g,x,T,G){dl(x,Zt(x),g,G)})),An=mc((function(g,x,T,G){dl(x,on(x),g,G)})),Xt=Ll(hf),Pn=uo((function(g,x){g=L(g);var T=-1,G=x.length,te=G>2?x[2]:s;for(te&&Fi(x[0],x[1],te)&&(G=1);++T<G;)for(var ce=x[T],Oe=Zt(ce),Fe=-1,et=Oe.length;++Fe<et;){var jt=Oe[Fe],Vt=g[jt];(Vt===s||Gs(Vt,bn[jt])&&!$n.call(g,jt))&&(g[jt]=ce[jt])}return g})),Kt=uo((function(g){return g.push(s,sv),qo(fr,s,g)}));function _n(g,x,T){var G=g==null?s:Dl(g,x);return G===s?T:G}function Yt(g,x){return g!=null&&Pu(g,x,Kh)}var xn=Ef((function(g,x,T){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),g[x]=T}),co(Nr)),ar=Ef((function(g,x,T){x!=null&&typeof x.toString!="function"&&(x=So.call(x)),$n.call(g,x)?g[x].push(T):g[x]=[T]}),Rr),xr=uo(Ga);function on(g){return fs(g)?Sp(g):Vs(g)}function Zt(g){return fs(g)?Sp(g,!0):_m(g)}var Ht=mc((function(g,x,T){Cp(g,x,T)})),fr=mc((function(g,x,T,G){Cp(g,x,T,G)})),Dr=Ll((function(g,x){var T={};if(g==null)return T;var G=!1;x=Mo(x,(function(ce){return ce=jo(ce,g),G||(G=ce.length>1),ce})),dl(g,Vp(g),T),G&&(T=Ss(T,7,lv));for(var te=x.length;te--;)kp(T,x[te]);return T})),Un=Ll((function(g,x){return g==null?{}:(function(T,G){return Em(T,G,(function(te,ce){return Yt(T,ce)}))})(g,x)}));function $r(g,x){if(g==null)return{};var T=Mo(Vp(g),(function(G){return[G]}));return x=Rr(x),Em(g,T,(function(G,te){return x(G,te[0])}))}var Or=iv(on),Fr=iv(Zt);function Qr(g){return g==null?[]:ic(g,on(g))}var Pi=iu((function(g,x,T){return x=x.toLowerCase(),g+(T?Si(x):x)}));function Si(g){return zi(Wt(g).toLowerCase())}function jr(g){return(g=Wt(g))&&g.replace(qn,sf).replace(br,"")}var Gi=iu((function(g,x,T){return g+(T?"-":"")+x.toLowerCase()})),Ko=iu((function(g,x,T){return g+(T?" ":"")+x.toLowerCase()})),ki=Fp("toLowerCase"),$i=iu((function(g,x,T){return g+(T?"_":"")+x.toLowerCase()})),Qi=iu((function(g,x,T){return g+(T?" ":"")+zi(x)})),sa=iu((function(g,x,T){return g+(T?" ":"")+x.toUpperCase()})),zi=Fp("toUpperCase");function di(g,x,T){return g=Wt(g),(x=T?s:x)===s?(function(G){return ht.test(G)})(g)?(function(G){return G.match(li)||[]})(g):(function(G){return G.match(dt)||[]})(g):g.match(x)||[]}var Cr=uo((function(g,x){try{return qo(g,s,x)}catch(T){return Ea(T)?T:new mo(T)}})),la=Ll((function(g,x){return Fa(x,(function(T){T=vl(T),ul(g,T,su(g[T],g))})),g}));function co(g){return function(){return g}}var cr=fl(),Xr=fl(!0);function Nr(g){return g}function fi(g){return ru(typeof g=="function"?g:Ss(g,1))}var $l=uo((function(g,x){return function(T){return Ga(T,g,x)}})),yi=uo((function(g,x){return function(T){return Ga(g,T,x)}}));function Te(g,x,T){var G=on(x),te=vf(x,G);T!=null||Ni(x)&&(te.length||!G.length)||(T=x,x=g,g=this,te=vf(x,on(x)));var ce=!(Ni(T)&&"chain"in T&&!T.chain),Oe=Ts(g);return Fa(te,(function(Fe){var et=x[Fe];g[Fe]=et,Oe&&(g.prototype[Fe]=function(){var jt=this.__chain__;if(ce||jt){var Vt=g(this.__wrapped__),yn=Vt.__actions__=va(this.__actions__);return yn.push({func:et,args:arguments,thisArg:g}),Vt.__chain__=jt,Vt}return et.apply(g,oa([this.value()],arguments))})})),g}function Et(){}var _t=md(Mo),Ln=md(yp),Gr=md(of);function xe(g){return Il(g)?Ua(vl(g)):(function(x){return function(T){return Dl(T,x)}})(g)}var de=$p(),We=$p(!0);function tt(){return[]}function ct(){return!1}var Xe=vd((function(g,x){return g+x}),0),Ge=Up("ceil"),Qe=vd((function(g,x){return g/x}),1),Ee=Up("floor"),Ue,be=vd((function(g,x){return g*x}),1),nt=Up("round"),ot=vd((function(g,x){return g-x}),0);return he.after=function(g,x){if(typeof x!="function")throw new Re(f);return g=Mt(g),function(){if(--g<1)return x.apply(this,arguments)}},he.ary=Lm,he.assign=lt,he.assignIn=St,he.assignInWith=sn,he.assignWith=An,he.at=Xt,he.before=Ws,he.bind=su,he.bindAll=la,he.bindKey=Lu,he.castArray=function(){if(!arguments.length)return[];var g=arguments[0];return Jr(g)?g:[g]},he.chain=xi,he.chunk=function(g,x,T){x=(T?Fi(g,x,T):x===s)?1:ji(Mt(x),0);var G=g==null?0:g.length;if(!G||x<1)return[];for(var te=0,ce=0,Oe=Gn(uf(G/x));te<G;)Oe[ce++]=Ms(g,te,te+=x);return Oe},he.compact=function(g){for(var x=-1,T=g==null?0:g.length,G=0,te=[];++x<T;){var ce=g[x];ce&&(te[G++]=ce)}return te},he.concat=function(){var g=arguments.length;if(!g)return[];for(var x=Gn(g-1),T=arguments[0],G=g;G--;)x[G-1]=arguments[G];return oa(Jr(T)?va(T):[T],Ji(x,1))},he.cond=function(g){var x=g==null?0:g.length,T=Rr();return g=x?Mo(g,(function(G){if(typeof G[1]!="function")throw new Re(f);return[T(G[0]),G[1]]})):[],uo((function(G){for(var te=-1;++te<x;){var ce=g[te];if(qo(ce[0],this,G))return qo(ce[1],this,G)}}))},he.conforms=function(g){return(function(x){var T=on(x);return function(G){return Hh(G,x,T)}})(Ss(g,1))},he.constant=co,he.countBy=wr,he.create=function(g,x){var T=dc(g);return x==null?T:nu(T,x)},he.curry=function g(x,T,G){var te=pl(x,8,s,s,s,s,s,T=G?s:T);return te.placeholder=g.placeholder,te},he.curryRight=function g(x,T,G){var te=pl(x,b,s,s,s,s,s,T=G?s:T);return te.placeholder=g.placeholder,te},he.debounce=Er,he.defaults=Pn,he.defaultsDeep=Kt,he.defer=vv,he.delay=xd,he.difference=Cm,he.differenceBy=Nm,he.differenceWith=Pm,he.drop=function(g,x,T){var G=g==null?0:g.length;return G?Ms(g,(x=T||x===s?1:Mt(x))<0?0:x,G):[]},he.dropRight=function(g,x,T){var G=g==null?0:g.length;return G?Ms(g,0,(x=G-(x=T||x===s?1:Mt(x)))<0?0:x):[]},he.dropRightWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!0,!0):[]},he.dropWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!0):[]},he.fill=function(g,x,T,G){var te=g==null?0:g.length;return te?(T&&typeof T!="number"&&Fi(g,x,T)&&(T=0,G=te),(function(ce,Oe,Fe,et){var jt=ce.length;for((Fe=Mt(Fe))<0&&(Fe=-Fe>jt?0:jt+Fe),(et=et===s||et>jt?jt:Mt(et))<0&&(et+=jt),et=Fe>et?0:wn(et);Fe<et;)ce[Fe++]=Oe;return ce})(g,x,T,G)):[]},he.filter=function(g,x){return(Jr(g)?Ba:Io)(g,Rr(x,3))},he.flatMap=function(g,x){return Ji(Mc(g,x),1)},he.flatMapDeep=function(g,x){return Ji(Mc(g,x),M)},he.flatMapDepth=function(g,x,T){return T=T===s?1:Mt(T),Ji(Mc(g,x),T)},he.flatten=Cf,he.flattenDeep=function(g){return g!=null&&g.length?Ji(g,M):[]},he.flattenDepth=function(g,x){return g!=null&&g.length?Ji(g,x=x===s?1:Mt(x)):[]},he.flip=function(g){return pl(g,512)},he.flow=cr,he.flowRight=Xr,he.fromPairs=function(g){for(var x=-1,T=g==null?0:g.length,G={};++x<T;){var te=g[x];G[te[0]]=te[1]}return G},he.functions=function(g){return g==null?[]:vf(g,on(g))},he.functionsIn=function(g){return g==null?[]:vf(g,Zt(g))},he.groupBy=Rm,he.initial=function(g){return g!=null&&g.length?Ms(g,0,-1):[]},he.intersection=ml,he.intersectionBy=Du,he.intersectionWith=_y,he.invert=xn,he.invertBy=ar,he.invokeMap=ju,he.iteratee=fi,he.keyBy=Dm,he.keys=on,he.keysIn=Zt,he.map=Mc,he.mapKeys=function(g,x){var T={};return x=Rr(x,3),ur(g,(function(G,te,ce){ul(T,x(G,te,ce),G)})),T},he.mapValues=function(g,x){var T={};return x=Rr(x,3),ur(g,(function(G,te,ce){ul(T,te,x(G,te,ce))})),T},he.matches=function(g){return Zh(Ss(g,1))},he.matchesProperty=function(g,x){return Jh(g,Ss(x,1))},he.memoize=lu,he.merge=Ht,he.mergeWith=fr,he.method=$l,he.methodOf=yi,he.mixin=Te,he.negate=Bf,he.nthArg=function(g){return g=Mt(g),uo((function(x){return bm(x,g)}))},he.omit=Dr,he.omitBy=function(g,x){return $r(g,Bf(Rr(x)))},he.once=function(g){return Ws(2,g)},he.orderBy=function(g,x,T,G){return g==null?[]:(Jr(x)||(x=x==null?[]:[x]),Jr(T=G?s:T)||(T=T==null?[]:[T]),wm(g,x,T))},he.over=_t,he.overArgs=Ha,he.overEvery=Ln,he.overSome=Gr,he.partial=gl,he.partialRight=Ci,he.partition=jm,he.pick=Un,he.pickBy=$r,he.property=xe,he.propertyOf=function(g){return function(x){return g==null?s:Dl(g,x)}},he.pull=Nf,he.pullAll=Oc,he.pullAllBy=function(g,x,T){return g&&g.length&&x&&x.length?Np(g,x,Rr(T,2)):g},he.pullAllWith=function(g,x,T){return g&&g.length&&x&&x.length?Np(g,x,s,T):g},he.pullAt=Pf,he.range=de,he.rangeRight=We,he.rearg=ds,he.reject=function(g,x){return(Jr(g)?Ba:Io)(g,Bf(Rr(x,3)))},he.remove=function(g,x){var T=[];if(!g||!g.length)return T;var G=-1,te=[],ce=g.length;for(x=Rr(x,3);++G<ce;){var Oe=g[G];x(Oe,G,g)&&(T.push(Oe),te.push(G))}return Qh(g,te),T},he.rest=function(g,x){if(typeof g!="function")throw new Re(f);return uo(g,x=x===s?x:Mt(x))},he.reverse=wd,he.sampleSize=function(g,x,T){return x=(T?Fi(g,x,T):x===s)?1:Mt(x),(Jr(g)?Gh:tv)(g,x)},he.set=function(g,x,T){return g==null?g:fc(g,x,T)},he.setWith=function(g,x,T,G){return G=typeof G=="function"?G:s,g==null?g:fc(g,x,T,G)},he.shuffle=function(g){return(Jr(g)?gm:xm)(g)},he.slice=function(g,x,T){var G=g==null?0:g.length;return G?(T&&typeof T!="number"&&Fi(g,x,T)?(x=0,T=G):(x=x==null?0:Mt(x),T=T===s?G:Mt(T)),Ms(g,x,T)):[]},he.sortBy=hv,he.sortedUniq=function(g){return g&&g.length?nv(g):[]},he.sortedUniqBy=function(g,x){return g&&g.length?nv(g,Rr(x,2)):[]},he.split=function(g,x,T){return T&&typeof T!="number"&&Fi(g,x,T)&&(x=T=s),(T=T===s?D:T>>>0)?(g=Wt(g))&&(typeof x=="string"||x!=null&&!me(x))&&!(x=cs(x))&&ol(g)?Uo(Qa(g),0,T):g.split(x,T):[]},he.spread=function(g,x){if(typeof g!="function")throw new Re(f);return x=x==null?0:ji(Mt(x),0),uo((function(T){var G=T[x],te=Uo(T,0,x);return G&&oa(te,G),qo(g,this,te)}))},he.tail=function(g){var x=g==null?0:g.length;return x?Ms(g,1,x):[]},he.take=function(g,x,T){return g&&g.length?Ms(g,0,(x=T||x===s?1:Mt(x))<0?0:x):[]},he.takeRight=function(g,x,T){var G=g==null?0:g.length;return G?Ms(g,(x=G-(x=T||x===s?1:Mt(x)))<0?0:x,G):[]},he.takeRightWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3),!1,!0):[]},he.takeWhile=function(g,x){return g&&g.length?Rp(g,Rr(x,3)):[]},he.tap=function(g,x){return x(g),g},he.throttle=function(g,x,T){var G=!0,te=!0;if(typeof g!="function")throw new Re(f);return Ni(T)&&(G="leading"in T?!!T.leading:G,te="trailing"in T?!!T.trailing:te),Er(g,x,{leading:G,maxWait:x,trailing:te})},he.thru=Lf,he.toArray=ln,he.toPairs=Or,he.toPairsIn=Fr,he.toPath=function(g){return Jr(g)?Mo(g,vl):Dt(g)?[g]:va(dv(Wt(g)))},he.toPlainObject=rn,he.transform=function(g,x,T){var G=Jr(g),te=G||ns(g)||yt(g);if(x=Rr(x,4),T==null){var ce=g&&g.constructor;T=te?G?new ce:[]:Ni(g)&&Ts(ce)?dc(il(g)):{}}return(te?Fa:ur)(g,(function(Oe,Fe,et){return x(T,Oe,Fe,et)})),T},he.unary=function(g){return Lm(g,1)},he.union=kf,he.unionBy=Rf,he.unionWith=Df,he.uniq=function(g){return g&&g.length?Tu(g):[]},he.uniqBy=function(g,x){return g&&g.length?Tu(g,Rr(x,2)):[]},he.uniqWith=function(g,x){return x=typeof x=="function"?x:s,g&&g.length?Tu(g,s,x):[]},he.unset=function(g,x){return g==null||kp(g,x)},he.unzip=Sc,he.unzipWith=au,he.update=function(g,x,T){return g==null?g:pc(g,x,Lp(T))},he.updateWith=function(g,x,T,G){return G=typeof G=="function"?G:s,g==null?g:pc(g,x,Lp(T),G)},he.values=Qr,he.valuesIn=function(g){return g==null?[]:ic(g,Zt(g))},he.without=ma,he.words=di,he.wrap=function(g,x){return gl(Lp(x),g)},he.xor=qp,he.xorBy=jf,he.xorWith=Ac,he.zip=Ed,he.zipObject=function(g,x){return bf(g||[],x||[],Li)},he.zipObjectDeep=function(g,x){return bf(g||[],x||[],fc)},he.zipWith=wa,he.entries=Or,he.entriesIn=Fr,he.extend=St,he.extendWith=sn,Te(he,he),he.add=Xe,he.attempt=Cr,he.camelCase=Pi,he.capitalize=Si,he.ceil=Ge,he.clamp=function(g,x,T){return T===s&&(T=x,x=s),T!==s&&(T=(T=pn(T))==T?T:0),x!==s&&(x=(x=pn(x))==x?x:0),Au(pn(g),x,T)},he.clone=function(g){return Ss(g,4)},he.cloneDeep=function(g){return Ss(g,5)},he.cloneDeepWith=function(g,x){return Ss(g,5,x=typeof x=="function"?x:s)},he.cloneWith=function(g,x){return Ss(g,4,x=typeof x=="function"?x:s)},he.conformsTo=function(g,x){return x==null||Hh(g,x,on(x))},he.deburr=jr,he.defaultTo=function(g,x){return g==null||g!=g?x:g},he.divide=Qe,he.endsWith=function(g,x,T){g=Wt(g),x=cs(x);var G=g.length,te=T=T===s?G:Au(Mt(T),0,G);return(T-=x.length)>=0&&g.slice(T,te)==x},he.eq=Gs,he.escape=function(g){return(g=Wt(g))&&ae.test(g)?g.replace(zt,Wi):g},he.escapeRegExp=function(g){return(g=Wt(g))&&kn.test(g)?g.replace(Gt,"\\$&"):g},he.every=function(g,x,T){var G=Jr(g)?yp:Yh;return T&&Fi(g,x,T)&&(x=s),G(g,Rr(x,3))},he.find=Kp,he.findIndex=fv,he.findKey=function(g,x){return nl(g,Rr(x,3),ur)},he.findLast=If,he.findLastIndex=Yp,he.findLastKey=function(g,x){return nl(g,Rr(x,3),ti)},he.floor=Ee,he.forEach=Zp,he.forEachRight=pv,he.forIn=function(g,x){return g==null?g:so(g,Rr(x,3),Zt)},he.forInRight=function(g,x){return g==null?g:ei(g,Rr(x,3),Zt)},he.forOwn=function(g,x){return g&&ur(g,Rr(x,3))},he.forOwnRight=function(g,x){return g&&ti(g,Rr(x,3))},he.get=_n,he.gt=by,he.gte=$f,he.has=function(g,x){return g!=null&&Pu(g,x,qh)},he.hasIn=Yt,he.head=km,he.identity=Nr,he.includes=function(g,x,T,G){g=fs(g)?g:Qr(g),T=T&&!G?Mt(T):0;var te=g.length;return T<0&&(T=ji(te+T,0)),wt(g)?T<=te&&g.indexOf(x,T)>-1:!!te&&bu(g,x,T)>-1},he.indexOf=function(g,x,T){var G=g==null?0:g.length;if(!G)return-1;var te=T==null?0:Mt(T);return te<0&&(te=ji(G+te,0)),bu(g,x,te)},he.inRange=function(g,x,T){return x=nn(x),T===s?(T=x,x=0):T=nn(T),(function(G,te,ce){return G>=Wa(te,ce)&&G<ji(te,ce)})(g=pn(g),x,T)},he.invoke=xr,he.isArguments=Tc,he.isArray=Jr,he.isArrayBuffer=Im,he.isArrayLike=fs,he.isArrayLikeObject=Oi,he.isBoolean=function(g){return g===!0||g===!1||Bi(g)&&Ei(g)==I},he.isBuffer=ns,he.isDate=mv,he.isElement=function(g){return Bi(g)&&g.nodeType===1&&!K(g)},he.isEmpty=function(g){if(g==null)return!0;if(fs(g)&&(Jr(g)||typeof g=="string"||typeof g.splice=="function"||ns(g)||yt(g)||Tc(g)))return!g.length;var x=Ti(g);if(x==W||x==Ae)return!g.size;if(Qt(g))return!Vs(g).length;for(var T in g)if($n.call(g,T))return!1;return!0},he.isEqual=function(g,x){return pd(g,x)},he.isEqualWith=function(g,x,T){var G=(T=typeof T=="function"?T:s)?T(g,x):s;return G===s?pd(g,x,s,T):!!G},he.isError=Ea,he.isFinite=function(g){return typeof g=="number"&&uc(g)},he.isFunction=Ts,he.isInteger=Cc,he.isLength=Uf,he.isMap=Jp,he.isMatch=function(g,x){return g===x||Us(g,x,Of(x))},he.isMatchWith=function(g,x,T){return T=typeof T=="function"?T:s,Us(g,x,Of(x),T)},he.isNaN=function(g){return gv(g)&&g!=+g},he.isNative=function(g){if(Gp(g))throw new mo("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mu(g)},he.isNil=function(g){return g==null},he.isNull=function(g){return g===null},he.isNumber=gv,he.isObject=Ni,he.isObjectLike=Bi,he.isPlainObject=K,he.isRegExp=me,he.isSafeInteger=function(g){return Cc(g)&&g>=-9007199254740991&&g<=C},he.isSet=Ie,he.isString=wt,he.isSymbol=Dt,he.isTypedArray=yt,he.isUndefined=function(g){return g===s},he.isWeakMap=function(g){return Bi(g)&&Ti(g)==ze},he.isWeakSet=function(g){return Bi(g)&&Ei(g)=="[object WeakSet]"},he.join=function(g,x){return g==null?"":cf.call(g,x)},he.kebabCase=Gi,he.last=gi,he.lastIndexOf=function(g,x,T){var G=g==null?0:g.length;if(!G)return-1;var te=G;return T!==s&&(te=(te=Mt(T))<0?ji(G+te,0):Wa(te,G-1)),x==x?(function(ce,Oe,Fe){for(var et=Fe+1;et--;)if(ce[et]===Oe)return et;return et})(g,x,te):$a(g,ws,te,!0)},he.lowerCase=Ko,he.lowerFirst=ki,he.lt=Nt,he.lte=tn,he.max=function(g){return g&&g.length?Ii(g,Nr,Mi):s},he.maxBy=function(g,x){return g&&g.length?Ii(g,Rr(x,2),Mi):s},he.mean=function(g){return vo(g,Nr)},he.meanBy=function(g,x){return vo(g,Rr(x,2))},he.min=function(g){return g&&g.length?Ii(g,Nr,jl):s},he.minBy=function(g,x){return g&&g.length?Ii(g,Rr(x,2),jl):s},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(g,x){return g&&g.length?bm(g,Mt(x)):s},he.noConflict=function(){return vi._===this&&(vi._=wi),this},he.noop=Et,he.now=Ff,he.pad=function(g,x,T){g=Wt(g);var G=(x=Mt(x))?Va(g):0;if(!x||G>=x)return g;var te=(x-G)/2;return gd(lc(te),T)+g+gd(uf(te),T)},he.padEnd=function(g,x,T){g=Wt(g);var G=(x=Mt(x))?Va(g):0;return x&&G<x?g+gd(x-G,T):g},he.padStart=function(g,x,T){g=Wt(g);var G=(x=Mt(x))?Va(g):0;return x&&G<x?gd(x-G,T)+g:g},he.parseInt=function(g,x,T){return T||x==null?x=0:x&&(x=+x),xp(Wt(g).replace(qt,""),x||0)},he.random=function(g,x,T){if(T&&typeof T!="boolean"&&Fi(g,x,T)&&(x=T=s),T===s&&(typeof x=="boolean"?(T=x,x=s):typeof g=="boolean"&&(T=g,g=s)),g===s&&x===s?(g=0,x=1):(g=nn(g),x===s?(x=g,g=0):x=nn(x)),g>x){var G=g;g=x,x=G}if(T||g%1||x%1){var te=ld();return Wa(g+te*(x-g+or("1e-"+((te+"").length-1))),x)}return ev(g,x)},he.reduce=function(g,x,T){var G=Jr(g)?id:ha,te=arguments.length<3;return G(g,Rr(x,4),T,te,mi)},he.reduceRight=function(g,x,T){var G=Jr(g)?_p:ha,te=arguments.length<3;return G(g,Rr(x,4),T,te,ym)},he.repeat=function(g,x,T){return x=(T?Fi(g,x,T):x===s)?1:Mt(x),gf(Wt(g),x)},he.replace=function(){var g=arguments,x=Wt(g[0]);return g.length<3?x:x.replace(g[1],g[2])},he.result=function(g,x,T){var G=-1,te=(x=jo(x,g)).length;for(te||(te=1,g=s);++G<te;){var ce=g==null?s:g[vl(x[G])];ce===s&&(G=te,ce=T),g=Ts(ce)?ce.call(g):ce}return g},he.round=nt,he.runInContext=Ct,he.sample=function(g){return(Jr(g)?Ap:vy)(g)},he.size=function(g){if(g==null)return 0;if(fs(g))return wt(g)?Va(g):g.length;var x=Ti(g);return x==W||x==Ae?g.size:Vs(g).length},he.snakeCase=$i,he.some=function(g,x,T){var G=Jr(g)?of:gy;return T&&Fi(g,x,T)&&(x=s),G(g,Rr(x,3))},he.sortedIndex=function(g,x){return _f(g,x)},he.sortedIndexBy=function(g,x,T){return Pp(g,x,Rr(T,2))},he.sortedIndexOf=function(g,x){var T=g==null?0:g.length;if(T){var G=_f(g,x);if(G<T&&Gs(g[G],x))return G}return-1},he.sortedLastIndex=function(g,x){return _f(g,x,!0)},he.sortedLastIndexBy=function(g,x,T){return Pp(g,x,Rr(T,2),!0)},he.sortedLastIndexOf=function(g,x){if(g!=null&&g.length){var T=_f(g,x,!0)-1;if(Gs(g[T],x))return T}return-1},he.startCase=Qi,he.startsWith=function(g,x,T){return g=Wt(g),T=T==null?0:Au(Mt(T),0,g.length),x=cs(x),g.slice(T,T+x.length)==x},he.subtract=ot,he.sum=function(g){return g&&g.length?wu(g,Nr):0},he.sumBy=function(g,x){return g&&g.length?wu(g,Rr(x,2)):0},he.template=function(g,x,T){var G=he.templateSettings;T&&Fi(g,x,T)&&(x=s),g=Wt(g),x=sn({},x,G,av);var te,ce,Oe=sn({},x.imports,G.imports,av),Fe=on(Oe),et=ic(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+"]")+`
`;g.replace(Yn,(function(Tn,Br,ir,at,Yr,Ao){return ir||(ir=at),yn+=g.slice(jt,Ao).replace(ut,ac),Br&&(te=!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 mo("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 = ''"+(te?", __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(s,et)}));if(an.source=yn,Ea(an))throw an;return an},he.times=function(g,x){if((g=Mt(g))<1||g>C)return[];var T=D,G=Wa(g,D);x=Rr(x),g-=D;for(var te=Kl(G,x);++T<g;)x(T);return te},he.toFinite=nn,he.toInteger=Mt,he.toLength=wn,he.toLower=function(g){return Wt(g).toLowerCase()},he.toNumber=pn,he.toSafeInteger=function(g){return g?Au(Mt(g),-9007199254740991,C):g===0?g:0},he.toString=Wt,he.toUpper=function(g){return Wt(g).toUpperCase()},he.trim=function(g,x,T){if((g=Wt(g))&&(T||x===s))return Bs(g);if(!g||!(x=cs(x)))return g;var G=Qa(g),te=Qa(x);return Uo(G,Es(G,te),af(G,te)+1).join("")},he.trimEnd=function(g,x,T){if((g=Wt(g))&&(T||x===s))return g.slice(0,ia(g)+1);if(!g||!(x=cs(x)))return g;var G=Qa(g);return Uo(G,0,af(G,Qa(x))+1).join("")},he.trimStart=function(g,x,T){if((g=Wt(g))&&(T||x===s))return g.replace(qt,"");if(!g||!(x=cs(x)))return g;var G=Qa(g);return Uo(G,Es(G,Qa(x))).join("")},he.truncate=function(g,x){var T=30,G="...";if(Ni(x)){var te="separator"in x?x.separator:te;T="length"in x?Mt(x.length):T,G="omission"in x?cs(x.omission):G}var ce=(g=Wt(g)).length;if(ol(g)){var Oe=Qa(g);ce=Oe.length}if(T>=ce)return g;var Fe=T-Va(G);if(Fe<1)return G;var et=Oe?Uo(Oe,0,Fe).join(""):g.slice(0,Fe);if(te===s)return et+G;if(Oe&&(Fe+=et.length-Fe),me(te)){if(g.slice(Fe).search(te)){var jt,Vt=et;for(te.global||(te=Z(te.source,Wt(Zn.exec(te))+"g")),te.lastIndex=0;jt=te.exec(Vt);)var yn=jt.index;et=et.slice(0,yn===s?Fe:yn)}}else if(g.indexOf(cs(te),Fe)!=Fe){var Yn=et.lastIndexOf(te);Yn>-1&&(et=et.slice(0,Yn))}return et+G},he.unescape=function(g){return(g=Wt(g))&&it.test(g)?g.replace(en,ls):g},he.uniqueId=function(g){var x=++Do;return Wt(g)+x},he.upperCase=sa,he.upperFirst=zi,he.each=Zp,he.eachRight=pv,he.first=km,Te(he,(Ue={},ur(he,(function(g,x){$n.call(he.prototype,x)||(Ue[x]=g)})),Ue),{chain:!1}),he.VERSION="4.17.21",Fa(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(g){he[g].placeholder=he})),Fa(["drop","take"],(function(g,x){go.prototype[g]=function(T){T=T===s?1:ji(Mt(T),0);var G=this.__filtered__&&!x?new go(this):this.clone();return G.__filtered__?G.__takeCount__=Wa(T,G.__takeCount__):G.__views__.push({size:Wa(T,D),type:g+(G.__dir__<0?"Right":"")}),G},go.prototype[g+"Right"]=function(T){return this.reverse()[g](T).reverse()}})),Fa(["filter","map","takeWhile"],(function(g,x){var T=x+1,G=T==1||T==3;go.prototype[g]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:Rr(te,3),type:T}),ce.__filtered__=ce.__filtered__||G,ce}})),Fa(["head","last"],(function(g,x){var T="take"+(x?"Right":"");go.prototype[g]=function(){return this[T](1).value()[0]}})),Fa(["initial","tail"],(function(g,x){var T="drop"+(x?"":"Right");go.prototype[g]=function(){return this.__filtered__?new go(this):this[T](1)}})),go.prototype.compact=function(){return this.filter(Nr)},go.prototype.find=function(g){return this.filter(g).head()},go.prototype.findLast=function(g){return this.reverse().find(g)},go.prototype.invokeMap=uo((function(g,x){return typeof g=="function"?new go(this):this.map((function(T){return Ga(T,g,x)}))})),go.prototype.reject=function(g){return this.filter(Bf(Rr(g)))},go.prototype.slice=function(g,x){g=Mt(g);var T=this;return T.__filtered__&&(g>0||x<0)?new go(T):(g<0?T=T.takeRight(-g):g&&(T=T.drop(g)),x!==s&&(T=(x=Mt(x))<0?T.dropRight(-x):T.take(x-g)),T)},go.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},go.prototype.toArray=function(){return this.take(D)},ur(go.prototype,(function(g,x){var T=/^(?:filter|find|map|reject)|While$/.test(x),G=/^(?:head|last)$/.test(x),te=he[G?"take"+(x=="last"?"Right":""):x],ce=G||/^find/.test(x);te&&(he.prototype[x]=function(){var Oe=this.__wrapped__,Fe=G?[1]:arguments,et=Oe instanceof go,jt=Fe[0],Vt=et||Jr(Oe),yn=function(Br){var ir=te.apply(he,oa([Br],Fe));return G&&Yn?ir[0]:ir};Vt&&T&&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 go(this);var Tn=g.apply(Oe,Fe);return Tn.__actions__.push({func:Lf,args:[yn],thisArg:s}),new $s(Tn,Yn)}return Sr&&an?g.apply(this,Fe):(Tn=this.thru(yn),Sr?G?Tn.value()[0]:Tn.value():Tn)})})),Fa(["pop","push","shift","sort","splice","unshift"],(function(g){var x=st[g],T=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",G=/^(?:pop|shift)$/.test(g);he.prototype[g]=function(){var te=arguments;if(G&&!this.__chain__){var ce=this.value();return x.apply(Jr(ce)?ce:[],te)}return this[T]((function(Oe){return x.apply(Jr(Oe)?Oe:[],te)}))}})),ur(go.prototype,(function(g,x){var T=he[x];if(T){var G=T.name+"";$n.call(Su,G)||(Su[G]=[]),Su[G].push({name:x,func:T})}})),Su[wf(s,2).name]=[{name:"wrapper",func:s}],go.prototype.clone=function(){var g=new go(this.__wrapped__);return g.__actions__=va(this.__actions__),g.__dir__=this.__dir__,g.__filtered__=this.__filtered__,g.__iteratees__=va(this.__iteratees__),g.__takeCount__=this.__takeCount__,g.__views__=va(this.__views__),g},go.prototype.reverse=function(){if(this.__filtered__){var g=new go(this);g.__dir__=-1,g.__filtered__=!0}else(g=this.clone()).__dir__*=-1;return g},go.prototype.value=function(){var g=this.__wrapped__.value(),x=this.__dir__,T=Jr(g),G=x<0,te=T?g.length:0,ce=(function(Ao,Mr,Ur){for(var xa=-1,zs=Ur.length;++xa<zs;){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,te,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(!T||!G&&te==et&&Qn==et)return rv(g,this.__actions__);var Sr=[];e:for(;et--&&Yn<Qn;){for(var an=-1,Tn=g[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 $s(this.value(),this.__chain__)},he.prototype.next=function(){this.__values__===s&&(this.__values__=ln(this.value()));var g=this.__index__>=this.__values__.length;return{done:g,value:g?s:this.__values__[this.__index__++]}},he.prototype.plant=function(g){for(var x,T=this;T instanceof Ql;){var G=Xp(T);G.__index__=0,G.__values__=s,x?te.__wrapped__=G:x=G;var te=G;T=T.__wrapped__}return te.__wrapped__=g,x},he.prototype.reverse=function(){var g=this.__wrapped__;if(g instanceof go){var x=g;return this.__actions__.length&&(x=new go(this)),(x=x.reverse()).__actions__.push({func:Lf,args:[wd],thisArg:s}),new $s(x,this.__chain__)}return this.thru(wd)},he.prototype.toJSON=he.prototype.valueOf=he.prototype.value=function(){return rv(this.__wrapped__,this.__actions__)},he.prototype.first=he.prototype.head,al&&(he.prototype[al]=function(){return this}),he})();vi._=Pa,(l=(function(){return Pa}).call(o,r,o,a))===s||(a.exports=l)}).call(this)}).call(this,r(68),r(221)(n))},function(n,o,r){var i=r(7),a=r(34),l=r(33),s=r(87),f=r(62),h=r(174),v=r(28),b=i.TypeError,w=v("toPrimitive");n.exports=function(O,E){if(!l(O)||s(O))return O;var S,M=f(O,w);if(M){if(E===void 0&&(E="default"),S=a(M,O,E),!l(S)||s(S))return S;throw b("Can't convert object to primitive value")}return E===void 0&&(E="number"),h(O,E)}},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),l=r(91);n.exports=!i&&!a((function(){return Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a!=7}))},function(n,o,r){var i=r(35),a=r(135),l=r(50),s=r(38);n.exports=function(f,h){for(var v=a(h),b=s.f,w=l.f,O=0;O<v.length;O++){var E=v[O];i(f,E)||b(f,E,w(h,E))}}},function(n,o,r){var i=r(46),a=r(15),l=r(74),s=r(112),f=r(32),h=a([].concat);n.exports=i("Reflect","ownKeys")||function(v){var b=l.f(f(v)),w=s.f;return w?h(b,w(v)):b}},function(n,o,r){var i=r(15),a=r(35),l=r(41),s=r(137).indexOf,f=r(72),h=i([].push);n.exports=function(v,b){var w,O=l(v),E=0,S=[];for(w in O)!a(f,w)&&a(O,w)&&h(S,w);for(;b.length>E;)a(O,w=b[E++])&&(~s(S,w)||h(S,w));return S}},function(n,o,r){var i=r(41),a=r(75),l=r(45),s=function(f){return function(h,v,b){var w,O=i(h),E=l(O),S=a(b,E);if(f&&v!=v){for(;E>S;)if((w=O[S++])!=w)return!0}else for(;E>S;S++)if((f||S in O)&&O[S]===v)return f||S||0;return!f&&-1}};n.exports={includes:s(!0),indexOf:s(!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),l=r(74).f,s=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 l(v)}catch{return s(f)}})(h):l(a(h))}},function(n,o,r){var i=r(28);o.f=i},function(n,o,r){var i=r(177),a=r(35),l=r(140),s=r(38).f;n.exports=function(f){var h=i.Symbol||(i.Symbol={});a(h,f)||s(h,f,{value:l.f(f)})}},function(n,o,r){var i,a,l,s=r(18),f=r(30),h=r(60),v=r(101),b=r(42),w=r(28),O=r(71),E=w("iterator"),S=!1;[].keys&&("next"in(l=[].keys())?(a=v(v(l)))!==Object.prototype&&(i=a):S=!0),i==null||s((function(){var M={};return i[E].call(M)!==M}))?i={}:O&&(i=h(i)),f(i[E])||b(i,E,(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),l=r(72),s=r(33),f=r(35),h=r(38).f,v=r(74),b=r(139),w=r(183),O=r(90),E=r(185),S=!1,M=O("meta"),C=0,$=function(k){h(k,M,{value:{objectID:"O"+C++,weakData:{}}})},D=n.exports={enable:function(){D.enable=function(){},S=!0;var k=v.f,B=a([].splice),F={};F[M]=1,k(F).length&&(v.f=function(I){for(var V=k(I),z=0,X=V.length;z<X;z++)if(V[z]===M){B(V,z,1);break}return V},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:b.f}))},fastKey:function(k,B){if(!s(k))return typeof k=="symbol"?k:(typeof k=="string"?"S":"P")+k;if(!f(k,M)){if(!w(k))return"F";if(!B)return"E";$(k)}return k[M].objectID},getWeakData:function(k,B){if(!f(k,M)){if(!w(k))return!0;if(!B)return!1;$(k)}return k[M].weakData},onFreeze:function(k){return E&&S&&w(k)&&!f(k,M)&&$(k),k}};l[M]=!0},function(n,o,r){var i=r(28),a=r(80),l=i("iterator"),s=Array.prototype;n.exports=function(f){return f!==void 0&&(a.Array===f||s[l]===f)}},function(n,o,r){var i=r(7),a=r(34),l=r(56),s=r(32),f=r(88),h=r(118),v=i.TypeError;n.exports=function(b,w){var O=arguments.length<2?h(b):w;if(l(O))return s(a(O,b));throw v(f(b)+" is not iterable")}},function(n,o,r){var i=r(34),a=r(32),l=r(62);n.exports=function(s,f,h){var v,b;a(s);try{if(!(v=l(s,"return"))){if(f==="throw")throw h;return h}v=i(v,s)}catch(w){b=!0,v=w}if(f==="throw")throw h;if(b)throw v;return a(v),h}},function(n,o,r){var i=r(30),a=r(33),l=r(102);n.exports=function(s,f,h){var v,b;return l&&i(v=f.constructor)&&v!==h&&a(b=v.prototype)&&b!==h.prototype&&l(s,b),s}},function(n,o,r){var i=r(42);n.exports=function(a,l,s){for(var f in l)i(a,f,l[f],s);return a}},function(n,o,r){var i=r(46),a=r(38),l=r(28),s=r(36),f=l("species");n.exports=function(h){var v=i(h),b=a.f;s&&v&&!v[f]&&b(v,f,{configurable:!0,get:function(){return this}})}},function(n,o,r){var i=r(15),a=r(59),l=r(39),s=r(44),f=i("".charAt),h=i("".charCodeAt),v=i("".slice),b=function(w){return function(O,E){var S,M,C=l(s(O)),$=a(E),D=C.length;return $<0||$>=D?w?"":void 0:(S=h(C,$))<55296||S>56319||$+1===D||(M=h(C,$+1))<56320||M>57343?w?f(C,$):S:w?v(C,$,$+2):M-56320+(S-55296<<10)+65536}};n.exports={codeAt:b(!1),charAt:b(!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),l="";return a.global&&(l+="g"),a.ignoreCase&&(l+="i"),a.multiline&&(l+="m"),a.dotAll&&(l+="s"),a.unicode&&(l+="u"),a.sticky&&(l+="y"),l}},function(n,o,r){var i=r(18),a=r(7).RegExp,l=i((function(){var h=a("a","y");return h.lastIndex=2,h.exec("abcd")!=null})),s=l||i((function(){return!a("a","y").sticky})),f=l||i((function(){var h=a("^r","gy");return h.lastIndex=2,h.exec("str")!=null}));n.exports={BROKEN_CARET:f,MISSED_STICKY:s,UNSUPPORTED_Y:l}},function(n,o,r){var i=r(16),a=r(79).find,l=r(100),s="find",f=!0;s 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)}}),l(s)},function(n,o,r){var i=r(16),a=r(137).includes,l=r(100);i({target:"Array",proto:!0},{includes:function(s){return a(this,s,arguments.length>1?arguments[1]:void 0)}}),l("includes")},function(n,o,r){var i=r(16),a=r(15),l=r(197),s=r(44),f=r(39),h=r(198),v=a("".indexOf);i({target:"String",proto:!0,forced:!h("includes")},{includes:function(b){return!!~v(f(s(this)),f(l(b)),arguments.length>1?arguments[1]:void 0)}})},function(n,o,r){var i=r(33),a=r(51),l=r(28)("match");n.exports=function(s){var f;return i(s)&&((f=s[l])!==void 0?!!f:a(s)=="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),l=r(39),s=r(162),f=i("".replace),h="["+s+"]",v=RegExp("^"+h+h+"*"),b=RegExp(h+h+"*$"),w=function(O){return function(E){var S=l(a(E));return 1&O&&(S=f(S,v,"")),2&O&&(S=f(S,b,"")),S}};n.exports={start:w(1),end:w(2),trim:w(3)}},function(n,o){n.exports=`
\v\f\r    \u2028\u2029\uFEFF`},function(n,o){var r,i,a=n.exports={};function l(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function f(C){if(r===setTimeout)return setTimeout(C,0);if((r===l||!r)&&setTimeout)return r=setTimeout,setTimeout(C,0);try{return r(C,0)}catch{try{return r.call(null,C,0)}catch{return r.call(this,C,0)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:l}catch{r=l}try{i=typeof clearTimeout=="function"?clearTimeout:s}catch{i=s}})();var h,v=[],b=!1,w=-1;function O(){b&&h&&(b=!1,h.length?v=h.concat(v):w=-1,v.length&&E())}function E(){if(!b){var C=f(O);b=!0;for(var $=v.length;$;){for(h=v,v=[];++w<$;)h&&h[w].run();w=-1,$=v.length}h=null,b=!1,(function(D){if(i===clearTimeout)return clearTimeout(D);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(D);try{i(D)}catch{try{return i.call(null,D)}catch{return i.call(this,D)}}})(C)}}function S(C,$){this.fun=C,this.array=$}function M(){}a.nextTick=function(C){var $=new Array(arguments.length-1);if(arguments.length>1)for(var D=1;D<arguments.length;D++)$[D-1]=arguments[D];v.push(new S(C,$)),v.length!==1||b||f(E)},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(C){return[]},a.binding=function(C){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(C){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(n,o,r){var i=r(32),a=r(165),l=r(28)("species");n.exports=function(s,f){var h,v=i(s).constructor;return v===void 0||(h=i(v)[l])==null?f:a(h)}},function(n,o,r){var i=r(7),a=r(99),l=r(88),s=i.TypeError;n.exports=function(f){if(a(f))return f;throw s(l(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),l=r(32),s=r(94),f=r(39),h=r(44),v=r(62),b=r(124),w=r(125);a("match",(function(O,E,S){return[function(M){var C=h(this),$=M==null?void 0:v(M,O);return $?i($,M,C):new RegExp(M)[O](f(C))},function(M){var C=l(this),$=f(M),D=S(E,C,$);if(D.done)return D.value;if(!C.global)return w(C,$);var k=C.unicode;C.lastIndex=0;for(var B,F=[],I=0;(B=w(C,$))!==null;){var V=f(B[0]);F[I]=V,V===""&&(C.lastIndex=b($,s(C.lastIndex),k)),I++}return I===0?null:F}]}))},function(n,o,r){var i,a,l,s,f=r(7),h=r(76),v=r(64),b=r(30),w=r(35),O=r(18),E=r(138),S=r(98),M=r(91),C=r(169),$=r(128),D=f.setImmediate,k=f.clearImmediate,B=f.process,F=f.Dispatch,I=f.Function,V=f.MessageChannel,z=f.String,X=0,Y={},W="onreadystatechange";try{i=f.location}catch{}var Q=function(Ae){if(w(Y,Ae)){var ke=Y[Ae];delete Y[Ae],ke()}},J=function(Ae){return function(){Q(Ae)}},ie=function(Ae){Q(Ae.data)},Se=function(Ae){f.postMessage(z(Ae),i.protocol+"//"+i.host)};D&&k||(D=function(Ae){var ke=S(arguments,1);return Y[++X]=function(){h(b(Ae)?Ae:I(Ae),void 0,ke)},a(X),X},k=function(Ae){delete Y[Ae]},$?a=function(Ae){B.nextTick(J(Ae))}:F&&F.now?a=function(Ae){F.now(J(Ae))}:V&&!C?(s=(l=new V).port2,l.port1.onmessage=ie,a=v(s.postMessage,s)):f.addEventListener&&b(f.postMessage)&&!f.importScripts&&i&&i.protocol!=="file:"&&!O(Se)?(a=Se,f.addEventListener("message",ie,!1)):a=W in M("script")?function(Ae){E.appendChild(M("script")).onreadystatechange=function(){E.removeChild(this),Q(Ae)}}:function(Ae){setTimeout(J(Ae),0)}),n.exports={set:D,clear:k}},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(l){var s,f;this.promise=new l((function(h,v){if(s!==void 0||f!==void 0)throw TypeError("Bad Promise constructor");s=h,f=v})),this.resolve=i(s),this.reject=i(f)};n.exports.f=function(l){return new a(l)}},function(n,o,r){o.a=function(){return!1}},function(n,o,r){(function(i){r.d(o,"a",(function(){return B}));var a=r(1);function l(V){throw new Error("[mobx-utils] "+V)}function s(V,z){z===void 0&&(z="Illegal state"),V||l(z)}var f=function(V){return V&&V!==Object.prototype&&Object.getOwnPropertyNames(V).concat(f(Object.getPrototypeOf(V))||[])},h=function(V){return(function(z){var X=f(z);return X.filter((function(Y,W){return X.indexOf(Y)===W}))})(V).filter((function(z){return z!=="constructor"&&!~z.indexOf("__")}))},v="pending",b="fulfilled",w="rejected";function O(V){switch(this.state){case v:return V.pending&&V.pending(this.value);case w:return V.rejected&&V.rejected(this.value);case b:return V.fulfilled?V.fulfilled(this.value):this.value}}function E(V,z){if(s(arguments.length<=2,"fromPromise expects up to two arguments"),s(typeof V=="function"||typeof V=="object"&&V&&typeof V.then=="function","Please pass a promise or function to fromPromise"),V.isPromiseBasedObservable===!0)return V;typeof V=="function"&&(V=new Promise(V));var X=V;V.then(Object(a.k)("observableFromPromise-resolve",(function(W){X.value=W,X.state=b})),Object(a.k)("observableFromPromise-reject",(function(W){X.value=W,X.state=w}))),X.isPromiseBasedObservable=!0,X.case=O;var Y=z&&z.state===b?z.value:void 0;return Object(a.q)(X,{value:Y,state:v},{},{deep:!1}),X}(function(V){V.reject=Object(a.k)("fromPromise.reject",(function(z){var X=V(Promise.reject(z));return X.state=w,X.value=z,X})),V.resolve=Object(a.k)("fromPromise.resolve",(function(z){z===void 0&&(z=void 0);var X=V(Promise.resolve(z));return X.state=b,X.value=z,X}))})(E||(E={}));var S=function(V,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(V,z,X,Y);else for(var ie=V.length-1;ie>=0;ie--)(W=V[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 V(z,X){var Y=this;Object(a.G)((function(){Y.current=X,Y.subscription=z.subscribe(Y)}))}V.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},V.prototype.next=function(z){this.current=z},V.prototype.complete=function(){this.dispose()},V.prototype.error=function(z){this.current=z,this.dispose()},S([a.C.ref],V.prototype,"current",void 0),S([a.k.bound],V.prototype,"next",null),S([a.k.bound],V.prototype,"complete",null),S([a.k.bound],V.prototype,"error",null)})();var M=function(){return M=Object.assign||function(V){for(var z,X=1,Y=arguments.length;X<Y;X++)for(var W in z=arguments[X])Object.prototype.hasOwnProperty.call(z,W)&&(V[W]=z[W]);return V},M.apply(this,arguments)},C=function(V,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(V,z,X,Y);else for(var ie=V.length-1;ie>=0;ie--)(W=V[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},$=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function V(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)},s(Object(a.A)(z),"createViewModel expects an observable object"),h(z).forEach((function(Y){if(Y!==a.a&&Y!=="__mobxDidRunLazyInitializers"){if(s($.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(V.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),V.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()},V.prototype.reset=function(){this.localValues.clear()},V.prototype.resetProperty=function(z){this.localValues.delete(z)},C([a.m],V.prototype,"isDirty",null),C([a.m],V.prototype,"changedValues",null),C([a.k.bound],V.prototype,"submit",null),C([a.k.bound],V.prototype,"reset",null),C([a.k.bound],V.prototype,"resetProperty",null)})();function D(V){if(!V)return"ROOT";for(var z=[];V.parent;)z.push(V.path),V=V.parent;return z.reverse().join("/")}function k(V){return Object(a.A)(V)||Object(a.y)(V)||Object(a.z)(V)}function B(V,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(ze,Ye){return W(ze,Ae,""+(Se.index+Ye))}));for(var ke=Se.index+Se.addedCount;ke<Se.object.length;ke++)if(k(Se.object[ke])){var De=X.get(Se.object[ke]);De&&(De.path=""+ke)}}})(J,ie),z(J,D(ie),V)}function W(J,ie,Se){if(k(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 '"+D(ie)+"/"+Se+"', but it already exists at '"+D(Ae.parent)+"/"+Ae.path+"'")}else{var ke={parent:ie,path:Se,dispose:Object(a.D)(J,Y)};X.set(J,ke),Object(a.p)(J).forEach((function(De){var ze=De[0];return W(De[1],ke,ze)}))}}}function Q(J){if(k(J)){var ie=X.get(J);if(!ie)return;X.delete(J),ie.dispose(),Object(a.L)(J).forEach(Q)}}return W(V,void 0,""),function(){Q(V)}}var F,I=(F=function(V,z){return F=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])},F(V,z)},function(V,z){function X(){this.constructor=V}F(V,z),V.prototype=z===null?Object.create(z):(X.prototype=z.prototype,new X)});(function(V){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(ze){return""+ze}:Se,ke=V.call(this)||this;ke._keyToName=Ae,ke._groupBy=Y,ke._ogmInfoKey=Symbol("ogmInfo"+ie),ke._base=X;for(var De=0;De<X.length;De++)ke._addItem(X[De]);return ke._disposeBaseObserver=Object(a.D)(ke._base,(function(ze){if(ze.type==="splice")Object(a.J)((function(){for(var Ye=0,Be=ze.removed;Ye<Be.length;Ye++){var Je=Be[Ye];ke._removeItem(Je)}for(var gt=0,se=ze.added;gt<se.length;gt++){var Ze=se[gt];ke._addItem(Ze)}}));else{if(ze.type!=="update")throw new Error("illegal state");Object(a.J)((function(){ke._removeItem(ze.oldValue),ke._addItem(ze.newValue)}))}})),ke}I(z,V),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=V.prototype.get.call(this,X);return Y===void 0&&(Y=Object(a.C)([],{name:"GroupArray["+this._keyToName(X)+"]",deep:!1}),V.prototype.set.call(this,X,Y)),Y},z.prototype._removeFromGroupArr=function(X,Y){var W=V.prototype.get.call(this,X);W.length===1?V.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 ke=Y._getGroupArr(ie),De=ke.length;ke.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 V(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 V.prototype.exists=function(){this.assertNotDisposed();var z=this.args.length;return this.closestIdx>=z-1&&this.closest.has(this.args[z-1])},V.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])},V.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)},V.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},V.prototype.assertNotDisposed=function(){if(this.isDisposed)throw new Error("Concurrent modification exception")},V})(),Promise.resolve(),typeof queueMicrotask<"u"||i!==void 0&&i.nextTick}).call(this,r(163))},function(n,o,r){var i;(function(a,l,s){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:"'"},b={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},w={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();k.prototype.bind=function(B,F,I){var V=this;return B=B instanceof Array?B:[B],V._bindMultiple.call(V,B,F,I),V},k.prototype.unbind=function(B,F){return this.bind.call(this,B,(function(){}),F)},k.prototype.trigger=function(B,F){var I=this;return I._directMap[B+":"+F]&&I._directMap[B+":"+F]({},B),I},k.prototype.reset=function(){var B=this;return B._callbacks={},B._directMap={},B},k.prototype.stopCallback=function(B,F){if((" "+F.className+" ").indexOf(" mousetrap ")>-1||D(F,this.target))return!1;if("composedPath"in B&&typeof B.composedPath=="function"){var I=B.composedPath()[0];I!==B.target&&(F=I)}return F.tagName=="INPUT"||F.tagName=="SELECT"||F.tagName=="TEXTAREA"||F.isContentEditable},k.prototype.handleKey=function(){var B=this;return B._handleKey.apply(B,arguments)},k.addKeycodes=function(B){for(var F in B)B.hasOwnProperty(F)&&(h[F]=B[F]);f=null},k.init=function(){var B=k(l);for(var F in B)F.charAt(0)!=="_"&&(k[F]=(function(I){return function(){return B[I].apply(B,arguments)}})(F))},k.init(),a.Mousetrap=k,n.exports&&(n.exports=k),(i=(function(){return k}).call(o,r,o,n))===void 0||(n.exports=i)}function E(B,F,I){B.addEventListener?B.addEventListener(F,I,!1):B.attachEvent("on"+F,I)}function S(B){if(B.type=="keypress"){var F=String.fromCharCode(B.which);return B.shiftKey||(F=F.toLowerCase()),F}return h[B.which]?h[B.which]:v[B.which]?v[B.which]:String.fromCharCode(B.which).toLowerCase()}function M(B){return B=="shift"||B=="ctrl"||B=="alt"||B=="meta"}function C(B,F,I){return I||(I=(function(){if(!f)for(var V in f={},h)V>95&&V<112||h.hasOwnProperty(V)&&(f[h[V]]=V);return f})()[B]?"keydown":"keypress"),I=="keypress"&&F.length&&(I="keydown"),I}function $(B,F){var I,V,z,X=[];for(I=(function(Y){return Y==="+"?["+"]:(Y=Y.replace(/\+{2}/g,"+plus")).split("+")})(B),z=0;z<I.length;++z)V=I[z],w[V]&&(V=w[V]),F&&F!="keypress"&&b[V]&&(V=b[V],X.push("shift")),M(V)&&X.push(V);return{key:V,modifiers:X,action:F=C(V,X,F)}}function D(B,F){return B!==null&&B!==l&&(B===F||D(B.parentNode,F))}function k(B){var F=this;if(B=B||l,!(F instanceof k))return new k(B);F.target=B,F._callbacks={},F._directMap={};var I,V={},z=!1,X=!1,Y=!1;function W(ke){ke=ke||{};var De,ze=!1;for(De in V)ke[De]?ze=!0:V[De]=0;ze||(Y=!1)}function Q(ke,De,ze,Ye,Be,Je){var gt,se,Ze,pe,le=[],we=ze.type;if(!F._callbacks[ke])return[];for(we=="keyup"&&M(ke)&&(De=[ke]),gt=0;gt<F._callbacks[ke].length;++gt)if(se=F._callbacks[ke][gt],(Ye||!se.seq||V[se.seq]==se.level)&&we==se.action&&(we=="keypress"&&!ze.metaKey&&!ze.ctrlKey||(Ze=De,pe=se.modifiers,Ze.sort().join(",")===pe.sort().join(",")))){var $e=!Ye&&se.combo==Be,rt=Ye&&se.seq==Ye&&se.level==Je;($e||rt)&&F._callbacks[ke].splice(gt,1),le.push(se)}return le}function J(ke,De,ze,Ye){F.stopCallback(De,De.target||De.srcElement,ze,Ye)||ke(De,ze)===!1&&((function(Be){Be.preventDefault?Be.preventDefault():Be.returnValue=!1})(De),(function(Be){Be.stopPropagation?Be.stopPropagation():Be.cancelBubble=!0})(De))}function ie(ke){typeof ke.which!="number"&&(ke.which=ke.keyCode);var De=S(ke);De&&(ke.type!="keyup"||z!==De?F.handleKey(De,(function(ze){var Ye=[];return ze.shiftKey&&Ye.push("shift"),ze.altKey&&Ye.push("alt"),ze.ctrlKey&&Ye.push("ctrl"),ze.metaKey&&Ye.push("meta"),Ye})(ke),ke):z=!1)}function Se(ke,De,ze,Ye){function Be(Ze){return function(){Y=Ze,++V[ke],clearTimeout(I),I=setTimeout(W,1e3)}}function Je(Ze){J(ze,Ze,ke),Ye!=="keyup"&&(z=S(Ze)),setTimeout(W,10)}V[ke]=0;for(var gt=0;gt<De.length;++gt){var se=gt+1===De.length?Je:Be(Ye||$(De[gt+1]).action);Ae(De[gt],se,Ye,ke,gt)}}function Ae(ke,De,ze,Ye,Be){F._directMap[ke+":"+ze]=De;var Je,gt=(ke=ke.replace(/\s+/g," ")).split(" ");gt.length>1?Se(ke,gt,De,ze):(Je=$(ke,ze),F._callbacks[Je.key]=F._callbacks[Je.key]||[],Q(Je.key,Je.modifiers,{type:Je.action},Ye,ke,Be),F._callbacks[Je.key][Ye?"unshift":"push"]({callback:De,modifiers:Je.modifiers,action:Je.action,seq:Ye,level:Be,combo:ke}))}F._handleKey=function(ke,De,ze){var Ye,Be=Q(ke,De,ze),Je={},gt=0,se=!1;for(Ye=0;Ye<Be.length;++Ye)Be[Ye].seq&&(gt=Math.max(gt,Be[Ye].level));for(Ye=0;Ye<Be.length;++Ye)if(Be[Ye].seq){if(Be[Ye].level!=gt)continue;se=!0,Je[Be[Ye].seq]=1,J(Be[Ye].callback,ze,Be[Ye].combo,Be[Ye].seq)}else se||J(Be[Ye].callback,ze,Be[Ye].combo);var Ze=ze.type=="keypress"&&X;ze.type!=Y||M(ke)||Ze||W(Je),X=se&&ze.type=="keydown"},F._bindMultiple=function(ke,De,ze){for(var Ye=0;Ye<ke.length;++Ye)Ae(ke[Ye],De,ze)},E(B,"keypress",ie),E(B,"keydown",ie),E(B,"keyup",ie)}})(typeof window<"u"?window:null,typeof window<"u"?document:null)},function(n,o,r){var i=r(7),a=r(34),l=r(30),s=r(33),f=i.TypeError;n.exports=function(h,v){var b,w;if(v==="string"&&l(b=h.toString)&&!s(w=a(b,h))||l(b=h.valueOf)&&!s(w=a(b,h))||v!=="string"&&l(b=h.toString)&&!s(w=a(b,h)))return w;throw f("Can't convert object to primitive value")}},function(n,o,r){var i=r(7),a=r(30),l=r(92),s=i.WeakMap;n.exports=a(s)&&/native code/.test(l(s))},function(n,o,r){var i=r(36),a=r(38),l=r(32),s=r(41),f=r(77);n.exports=i?Object.defineProperties:function(h,v){l(h);for(var b,w=s(v),O=f(v),E=O.length,S=0;E>S;)a.f(h,b=O[S++],w[b]);return h}},function(n,o,r){var i=r(7);n.exports=i},function(n,o,r){var i=r(7),a=r(96),l=r(99),s=r(33),f=r(28)("species"),h=i.Array;n.exports=function(v){var b;return a(v)&&(b=v.constructor,(l(b)&&(b===h||a(b.prototype))||s(b)&&(b=b[f])===null)&&(b=void 0)),b===void 0?h:b}},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),l=r(69),s=r(78),f=r(80),h=function(){return this};n.exports=function(v,b,w,O){var E=b+" Iterator";return v.prototype=a(i,{next:l(+!O,w)}),s(v,E,!1,!0),f[E]=h,v}},function(n,o,r){var i=r(7),a=r(30),l=i.String,s=i.TypeError;n.exports=function(f){if(typeof f=="object"||a(f))return f;throw s("Can't set "+l(f)+" as a prototype")}},function(n,o,r){var i=r(16),a=r(7),l=r(15),s=r(95),f=r(42),h=r(144),v=r(117),b=r(119),w=r(30),O=r(33),E=r(18),S=r(120),M=r(78),C=r(148);n.exports=function($,D,k){var B=$.indexOf("Map")!==-1,F=$.indexOf("Weak")!==-1,I=B?"set":"add",V=a[$],z=V&&V.prototype,X=V,Y={},W=function(ke){var De=l(z[ke]);f(z,ke,ke=="add"?function(ze){return De(this,ze===0?0:ze),this}:ke=="delete"?function(ze){return!(F&&!O(ze))&&De(this,ze===0?0:ze)}:ke=="get"?function(ze){return F&&!O(ze)?void 0:De(this,ze===0?0:ze)}:ke=="has"?function(ze){return!(F&&!O(ze))&&De(this,ze===0?0:ze)}:function(ze,Ye){return De(this,ze===0?0:ze,Ye),this})};if(s($,!w(V)||!(F||z.forEach&&!E((function(){new V().entries().next()})))))X=k.getConstructor(D,$,B,I),h.enable();else if(s($,!0)){var Q=new X,J=Q[I](F?{}:-0,1)!=Q,ie=E((function(){Q.has(1)})),Se=S((function(ke){new V(ke)})),Ae=!F&&E((function(){for(var ke=new V,De=5;De--;)ke[I](De,De);return!ke.has(-0)}));Se||((X=D((function(ke,De){b(ke,z);var ze=C(new V,ke,X);return De!=null&&v(De,ze[I],{that:ze,AS_ENTRIES:B}),ze}))).prototype=z,z.constructor=X),(ie||Ae)&&(W("delete"),W("has"),B&&W("get")),(Ae||J)&&W(I),F&&z.clear&&delete z.clear}return Y[$]=X,i({global:!0,forced:X!=V},Y),M(X,$),F||k.setStrong(X,$,B),X}},function(n,o,r){var i=r(18),a=r(33),l=r(51),s=r(184),f=Object.isExtensible,h=i((function(){}));n.exports=h||s?function(v){return!!a(v)&&(!s||l(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),l=r(149),s=r(64),f=r(119),h=r(117),v=r(116),b=r(150),w=r(36),O=r(144).fastKey,E=r(58),S=E.set,M=E.getterFor;n.exports={getConstructor:function(C,$,D,k){var B=C((function(X,Y){f(X,F),S(X,{type:$,index:a(null),first:void 0,last:void 0,size:0}),w||(X.size=0),Y!=null&&h(Y,X[k],{that:X,AS_ENTRIES:D})})),F=B.prototype,I=M($),V=function(X,Y,W){var Q,J,ie=I(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),w?ie.size++:X.size++,J!=="F"&&(ie.index[J]=Se)),X},z=function(X,Y){var W,Q=I(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 l(F,{clear:function(){for(var X=I(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,w?X.size=0:this.size=0},delete:function(X){var Y=this,W=I(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),w?W.size--:Y.size--}return!!Q},forEach:function(X){for(var Y,W=I(this),Q=s(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)}}),l(F,D?{get:function(X){var Y=z(this,X);return Y&&Y.value},set:function(X,Y){return V(this,X===0?0:X,Y)}}:{add:function(X){return V(this,X=X===0?0:X,X)}}),w&&i(F,"size",{get:function(){return I(this).size}}),B},setStrong:function(C,$,D){var k=$+" Iterator",B=M($),F=M(k);v(C,$,(function(I,V){S(this,{type:k,target:I,state:B(I),kind:V,last:void 0})}),(function(){for(var I=F(this),V=I.kind,z=I.last;z&&z.removed;)z=z.previous;return I.target&&(I.last=z=z?z.next:I.state.first)?V=="keys"?{value:z.key,done:!1}:V=="values"?{value:z.value,done:!1}:{value:[z.key,z.value],done:!1}:(I.target=void 0,{value:void 0,done:!0})}),D?"entries":"values",!D,!0),b($)}}},function(n,o,r){var i=r(79).forEach,a=r(121)("forEach");n.exports=a?[].forEach:function(l){return i(this,l,arguments.length>1?arguments[1]:void 0)}},function(n,o,r){var i=r(7),a=r(64),l=r(34),s=r(40),f=r(189),h=r(145),v=r(99),b=r(45),w=r(63),O=r(146),E=r(118),S=i.Array;n.exports=function(M){var C=s(M),$=v(this),D=arguments.length,k=D>1?arguments[1]:void 0,B=k!==void 0;B&&(k=a(k,D>2?arguments[2]:void 0));var F,I,V,z,X,Y,W=E(C),Q=0;if(!W||this==S&&h(W))for(F=b(C),I=$?new this(F):S(F);F>Q;Q++)Y=B?k(C[Q],Q):C[Q],w(I,Q,Y);else for(X=(z=O(C,W)).next,I=$?new this:[];!(V=l(X,z)).done;Q++)Y=B?f(z,k,[V.value,Q],!0):V.value,w(I,Q,Y);return I.length=Q,I}},function(n,o,r){var i=r(32),a=r(147);n.exports=function(l,s,f,h){try{return h?s(i(f)[0],f[1]):s(f)}catch(v){a(l,"throw",v)}}},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var l=a(".","s");return!(l.dotAll&&l.exec(`
`)&&l.flags==="s")}))},function(n,o,r){var i=r(18),a=r(7).RegExp;n.exports=i((function(){var l=a("(?<a>b)","g");return l.exec("b").groups.a!=="b"||"b".replace(l,"$<a>c")!=="bc"}))},function(n,o,r){var i=r(16),a=r(15),l=r(56),s=r(40),f=r(45),h=r(39),v=r(18),b=r(193),w=r(121),O=r(194),E=r(195),S=r(70),M=r(196),C=[],$=a(C.sort),D=a(C.push),k=v((function(){C.sort(void 0)})),B=v((function(){C.sort(null)})),F=w("sort"),I=!v((function(){if(S)return S<70;if(!(O&&O>3)){if(E)return!0;if(M)return M<603;var V,z,X,Y,W="";for(V=65;V<76;V++){switch(z=String.fromCharCode(V),V){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++)C.push({k:z+Y,v:X})}for(C.sort((function(Q,J){return J.v-Q.v})),Y=0;Y<C.length;Y++)z=C[Y].k.charAt(0),W.charAt(W.length-1)!==z&&(W+=z);return W!=="DGBEFHACIJK"}}));i({target:"Array",proto:!0,forced:k||!B||!F||!I},{sort:function(V){V!==void 0&&l(V);var z=s(this);if(I)return V===void 0?$(z):$(z,V);var X,Y,W=[],Q=f(z);for(Y=0;Y<Q;Y++)Y in z&&D(W,z[Y]);for(b(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}})(V)),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,l=function(h,v){var b=h.length,w=a(b/2);return b<8?s(h,v):f(h,l(i(h,0,w),v),l(i(h,w),v),v)},s=function(h,v){for(var b,w,O=h.length,E=1;E<O;){for(w=E,b=h[E];w&&v(h[w-1],b)>0;)h[w]=h[--w];w!==E++&&(h[w]=b)}return h},f=function(h,v,b,w){for(var O=v.length,E=b.length,S=0,M=0;S<O||M<E;)h[S+M]=S<O&&M<E?w(v[S],b[M])<=0?v[S++]:b[M++]:S<O?v[S++]:b[M++];return h};n.exports=l},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),l=i.TypeError;n.exports=function(s){if(a(s))throw l("The method doesn't accept regular expressions");return s}},function(n,o,r){var i=r(28)("match");n.exports=function(a){var l=/./;try{"/./"[a](l)}catch{try{return l[i]=!1,"/./"[a](l)}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),l=r(162);n.exports=function(s){return a((function(){return!!l[s]()||"…"[s]()!=="…"||i&&l[s].name!==s}))}},function(n,o,r){var i=r(15),a=r(40),l=Math.floor,s=i("".charAt),f=i("".replace),h=i("".slice),v=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,b=/\$([$&'`]|\d{1,2})/g;n.exports=function(w,O,E,S,M,C){var $=E+w.length,D=S.length,k=b;return M!==void 0&&(M=a(M),k=v),f(C,k,(function(B,F){var I;switch(s(F,0)){case"$":return"$";case"&":return w;case"`":return h(O,0,E);case"'":return h(O,$);case"<":I=M[h(F,1,-1)];break;default:var V=+F;if(V===0)return B;if(V>D){var z=l(V/10);return z===0?B:z<=D?S[z-1]===void 0?s(F,1):S[z-1]+s(F,1):B}I=S[V-1]}return I===void 0?"":I}))}},function(n,o,r){var i=r(36),a=r(15),l=r(34),s=r(18),f=r(77),h=r(112),v=r(84),b=r(40),w=r(85),O=Object.assign,E=Object.defineProperty,S=a([].concat);n.exports=!O||s((function(){if(i&&O({b:1},O(E({},"a",{enumerable:!0,get:function(){E(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var M={},C={},$=Symbol(),D="abcdefghijklmnopqrst";return M[$]=7,D.split("").forEach((function(k){C[k]=k})),O({},M)[$]!=7||f(O({},C)).join("")!=D}))?function(M,C){for(var $=b(M),D=arguments.length,k=1,B=h.f,F=v.f;D>k;)for(var I,V=w(arguments[k++]),z=B?S(f(V),B(V)):f(V),X=z.length,Y=0;X>Y;)I=z[Y++],i&&!l(F,V,I)||($[I]=V[I]);return $}:O},function(n,o,r){var i=r(7),a=r(15),l=r(56),s=r(33),f=r(35),h=r(98),v=i.Function,b=a([].concat),w=a([].join),O={},E=function(S,M,C){if(!f(O,M)){for(var $=[],D=0;D<M;D++)$[D]="a["+D+"]";O[M]=v("C,a","return new C("+w($,",")+")")}return O[M](S,C)};n.exports=v.bind||function(S){var M=l(this),C=M.prototype,$=h(arguments,1),D=function(){var k=b($,h(arguments));return this instanceof D?E(M,k.length,k):M.apply(S,k)};return s(C)&&(D.prototype=C),D}},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),l=r(39),s=/"/g,f=i("".replace);n.exports=function(h,v,b,w){var O=l(a(h)),E="<"+v;return b!==""&&(E+=" "+b+'="'+f(l(w),s,"&quot;")+'"'),E+">"+O+"</"+v+">"}},function(n,o,r){var i=r(18);n.exports=function(a){return i((function(){var l=""[a]('"');return l!==l.toLowerCase()||l.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,l,s,f=r(16),h=r(71),v=r(7),b=r(46),w=r(34),O=r(209),E=r(42),S=r(149),M=r(102),C=r(78),$=r(150),D=r(56),k=r(30),B=r(33),F=r(119),I=r(92),V=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),ke=r(95),De=r(28),ze=r(216),Ye=r(128),Be=r(70),Je=De("species"),gt="Promise",se=Ae.getterFor(gt),Ze=Ae.set,pe=Ae.getterFor(gt),le=O&&O.prototype,we=O,$e=le,rt=v.TypeError,pt=v.document,Lt=v.process,Jt=ie.f,en=Jt,zt=!!(pt&&pt.createEvent&&v.dispatchEvent),it=k(v.PromiseRejectionEvent),ae="unhandledrejection",re=!1,je=ke(gt,(function(){var Le=I(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&&ze&&!it})),vt=je||!z((function(Le){we.all(Le).catch((function(){}))})),q=function(Le){var dt;return!(!B(Le)||!k(dt=Le.then))&&dt},Pt=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,yo,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(),yo=!0)),ao===ho.promise?rr(rt("Promise-chain cycle")):(Lo=q(ao))?w(Lo,ao,qn,rr):qn(ao)):rr(Tt)}catch(vn){ut&&!yo&&ut.exit(),rr(vn)}}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){w(Y,v,(function(){var dt,At=Le.facade,Tt=Le.value;if(kn(Le)&&(dt=Se((function(){Ye?Lt.emit("unhandledRejection",Tt,At):Rt(ae,At,Tt)})),Le.rejection=Ye||kn(Le)?2:1,dt.error))throw dt.value}))},kn=function(Le){return Le.rejection!==1&&!Le.parent},qt=function(Le){w(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)}},Pe=function(Le,dt,At){Le.done||(Le.done=!0,At&&(Le=At),Le.value=dt,Le.state=2,Pt(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{w(Tt,dt,On(Ke,En,Le),On(Pe,En,Le))}catch(Zn){Pe(En,Zn,Le)}})):(Le.value=dt,Le.state=1,Pt(Le,!1))}catch(En){Pe({done:!1},En,Le)}}};if(je&&($e=(we=function(Le){F(this,$e),D(Le),w(i,this);var dt=se(this);try{Le(On(Ke,dt),On(Pe,dt))}catch(At){Pe(dt,At)}}).prototype,(i=function(Le){Ze(this,{type:gt,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=!k(Le)||Le,En.fail=k(dt)&&dt,En.domain=Ye?Lt.domain:void 0,At.parent=!0,Tt[Tt.length]=En,At.state!=0&&Pt(At,!1),En.promise},catch:function(Le){return this.then(void 0,Le)}}),a=function(){var Le=new i,dt=se(Le);this.promise=Le,this.resolve=On(Ke,dt),this.reject=On(Pe,dt)},ie.f=Jt=function(Le){return Le===we||Le===l?new a(Le):en(Le)},!h&&k(O)&&le!==Object.prototype)){s=le.then,re||(E(le,"then",(function(Le,dt){var At=this;return new we((function(Tt,En){w(s,At,Tt,En)})).then(Le,dt)}),{unsafe:!0}),E(le,"catch",$e.catch,{unsafe:!0}));try{delete le.constructor}catch{}M&&M(le,$e)}f({global:!0,wrap:!0,forced:je},{Promise:we}),C(we,gt,!1,!0),$(gt),l=b(gt),f({target:gt,stat:!0,forced:je},{reject:function(Le){var dt=Jt(this);return w(dt.reject,void 0,Le),dt.promise}}),f({target:gt,stat:!0,forced:h||je},{resolve:function(Le){return Q(h&&this===l?we:this,Le)}}),f({target:gt,stat:!0,forced:vt},{all:function(Le){var dt=this,At=Jt(dt),Tt=At.resolve,En=At.reject,Zn=Se((function(){var ao=D(dt.resolve),Lo=[],yo=0,ho=1;V(Le,(function(Nn){var qn=yo++,rr=!1;ho++,w(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=D(dt.resolve);V(Le,(function(ao){w(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,l,s,f,h,v,b,w=r(7),O=r(64),E=r(50).f,S=r(168).set,M=r(169),C=r(211),$=r(212),D=r(128),k=w.MutationObserver||w.WebKitMutationObserver,B=w.document,F=w.process,I=w.Promise,V=E(w,"queueMicrotask"),z=V&&V.value;z||(i=function(){var X,Y;for(D&&(X=F.domain)&&X.exit();a;){Y=a.fn,a=a.next;try{Y()}catch(W){throw a?s():l=void 0,W}}l=void 0,X&&X.enter()},M||D||$||!k||!B?!C&&I&&I.resolve?((v=I.resolve(void 0)).constructor=I,b=O(v.then,v),s=function(){b(i)}):D?s=function(){F.nextTick(i)}:(S=O(S,w),s=function(){S(i)}):(f=!0,h=B.createTextNode(""),new k(i).observe(h,{characterData:!0}),s=function(){h.data=f=!f})),n.exports=z||function(X){var Y={fn:X,next:void 0};l&&(l.next=Y),a||(a=Y,s()),l=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),l=r(170);n.exports=function(s,f){if(i(s),a(f)&&f.constructor===s)return f;var h=l.f(s);return(0,h.resolve)(f),h.promise}},function(n,o,r){var i=r(7);n.exports=function(a,l){var s=i.console;s&&s.error&&(arguments.length==1?s.error(a):s.error(a,l))}},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),l=r(45);n.exports=function(s){for(var f=i(this),h=l(f),v=arguments.length,b=a(v>1?arguments[1]:void 0,h),w=v>2?arguments[2]:void 0,O=w===void 0?h:a(w,h);O>b;)f[b++]=s;return f}},function(n,o,r){var i=r(16),a=r(7),l=r(15),s=r(59),f=r(160),h=r(219),v=r(18),b=a.RangeError,w=a.String,O=Math.floor,E=l(h),S=l("".slice),M=l(1 .toFixed),C=function(B,F,I){return F===0?I:F%2==1?C(B,F-1,I*B):C(B*B,F/2,I)},$=function(B,F,I){for(var V=-1,z=I;++V<6;)z+=F*B[V],B[V]=z%1e7,z=O(z/1e7)},D=function(B,F){for(var I=6,V=0;--I>=0;)V+=B[I],B[I]=O(V/F),V=V%F*1e7},k=function(B){for(var F=6,I="";--F>=0;)if(I!==""||F===0||B[F]!==0){var V=w(B[F]);I=I===""?V:I+E("0",7-V.length)+V}return I};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(B){var F,I,V,z,X=f(this),Y=s(B),W=[0,0,0,0,0,0],Q="",J="0";if(Y<0||Y>20)throw b("Incorrect fraction digits");if(X!=X)return"NaN";if(X<=-1e21||X>=1e21)return w(X);if(X<0&&(Q="-",X=-X),X>1e-21)if(I=(F=(function(ie){for(var Se=0,Ae=ie;Ae>=4096;)Se+=12,Ae/=4096;for(;Ae>=2;)Se+=1,Ae/=2;return Se})(X*C(2,69,1))-69)<0?X*C(2,-F,1):X/C(2,F,1),I*=4503599627370496,(F=52-F)>0){for($(W,0,I),V=Y;V>=7;)$(W,1e7,0),V-=7;for($(W,C(10,V,1),0),V=F-1;V>=23;)D(W,1<<23),V-=23;D(W,1<<V),$(W,1,1),D(W,2),J=k(W)}else $(W,0,I),$(W,1<<-F,0),J=k(W)+E("0",Y);return J=Y>0?Q+((z=J.length)<=Y?"0."+E("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),l=r(39),s=r(44),f=i.RangeError;n.exports=function(h){var v=l(s(this)),b="",w=a(h);if(w<0||w==1/0)throw f("Wrong number of repetitions");for(;w>0;(w>>>=1)&&(v+=v))1&w&&(b+=v);return b}},function(n,o,r){var i=r(36),a=r(15),l=r(77),s=r(41),f=a(r(84).f),h=a([].push),v=function(b){return function(w){for(var O,E=s(w),S=l(E),M=S.length,C=0,$=[];M>C;)O=S[C++],i&&!f(E,O)||h($,b?[O,E[O]]:E[O]);return $}};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 Lc})),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 ky})),r.d(o,"LineEdge",(function(){return xO})),r.d(o,"PolylineEdge",(function(){return TO})),r.d(o,"BezierEdge",(function(){return kO})),r.d(o,"Arrow",(function(){return VB})),r.d(o,"BaseEdgeModel",(function(){return Kp})),r.d(o,"BezierEdgeModel",(function(){return G1})),r.d(o,"LineEdgeModel",(function(){return xd})),r.d(o,"PolylineEdgeModel",(function(){return Ts})),r.d(o,"BaseNodeModel",(function(){return Xf})),r.d(o,"CircleNodeModel",(function(){return K1})),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 Mp})),r.d(o,"GraphModel",(function(){return sT})),r.d(o,"SnaplineModel",(function(){return GC})),r.d(o,"Keyboard",(function(){return NN})),r.d(o,"get",(function(){return NT})),r.d(o,"defaults",(function(){return kT})),r.d(o,"ElementState",(function(){return Io})),r.d(o,"ModelType",(function(){return so})),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 ts})),r.d(i,"refreshGraphId",(function(){return Sf})),r.d(i,"StepDrag",(function(){return Te})),r.d(i,"setupEdgeModel",(function(){return ln})),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 pn})),r.d(i,"pointDirection",(function(){return rn})),r.d(i,"getExpandedBBoxPoint",(function(){return Wt})),r.d(i,"mergeBBox",(function(){return lt})),r.d(i,"getBBoxOfPoints",(function(){return St})),r.d(i,"getPointsFromBBox",(function(){return sn})),r.d(i,"isPointOutsideBBox",(function(){return An})),r.d(i,"getBBoxXCrossPoints",(function(){return Xt})),r.d(i,"getBBoxYCrossPoints",(function(){return Pn})),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 fr})),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 Pi})),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 ki})),r.d(i,"getTextWidth",(function(){return Qi})),r.d(i,"getAppendAttributes",(function(){return sa})),r.d(i,"getBezierControlPoints",(function(){return zi})),r.d(i,"getBezierPoints",(function(){return di})),r.d(i,"getEndTangent",(function(){return la})),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 fl})),r.d(i,"getGridOffset",(function(){return wf})),r.d(i,"sampleCubic",(function(){return Ni})),r.d(i,"getThetaOfVector",(function(){return Jp})),r.d(i,"degrees",(function(){return gv})),r.d(i,"Vector",(function(){return ot})),r.d(i,"Point",(function(){return g})),r.d(i,"Matrix",(function(){return Fu})),r.d(i,"RotateMatrix",(function(){return Od})),r.d(i,"ScaleMatrix",(function(){return wy})),r.d(i,"TranslateMatrix",(function(){return eh}));var a=r(1),l=r(10);if(!l.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 s=r(43),f=Object(s.b)("observerBatching");function h(c){c()}var v=!1;function b(){return v}function w(c){return Object(a.t)(c)}var O,E=1e4,S=new Set;function M(){O===void 0&&(O=setTimeout(C,1e4))}function C(){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 $=!1,D=[],k={};function B(c){return"observer"+c}function F(c,u,d){u===void 0&&(u="observed"),d===void 0&&(d=k),b();var p,y=(function(U){return function(){$?D.push(U):U()}})((d.useForceUpdate||s.d)()),m=l.d.useRef(null);if(!m.current){var _=new a.c(B(u),(function(){A.mounted?y():(_.dispose(),m.current=null)})),A=(function(U){return{cleanAt:Date.now()+E,reaction:U}})(_);m.current=A,p=m,S.add(p),M()}var N=m.current.reaction;return l.d.useDebugValue(N,w),l.d.useEffect((function(){var U;return U=m,S.delete(U),m.current?m.current.mounted=!0:(m.current={reaction:new a.c(B(u),(function(){y()})),cleanAt:1/0},y()),function(){m.current.reaction.dispose(),m.current=null}}),[]),(function(U){$=!0,D=[];try{var H=U();$=!1;var oe=D.length>0?D:void 0;return l.d.useLayoutEffect((function(){oe&&oe.forEach((function(ue){return ue()}))}),[oe]),H}finally{$=!1}})((function(){var U,H;if(N.track((function(){try{U=c()}catch(oe){H=oe}})),H)throw H;return U}))}var I=function(){return I=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},I.apply(this,arguments)};function V(c,u){var d,p,y,m=I({forwardRef:!1},u),_=c.displayName||c.name,A=function(N,U){return F((function(){return c(N,U)}),_)};return A.displayName=_,d=m.forwardRef?Object(l.f)(Object(l.e)(A)):Object(l.f)(A),p=c,y=d,Object.keys(p).forEach((function(N){z[N]||Object.defineProperty(y,N,Object.getOwnPropertyDescriptor(p,N))})),d.displayName=_,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:F(p)}function Y(c,u,d,p,y){var m=u==="children"?"render":"children",_=typeof c[u]=="function",A=typeof c[m]=="function";return _&&A?new Error("MobX Observer: Do not use children and render in the same time in`"+d):_||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=l.g)||(W=h),Object(a.n)({reactionScheduler:W}),Object(s.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 ke(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"),ze=ie("patchedDefinition");function Ye(c,u){for(var d=this,p=arguments.length,y=new Array(p>2?p-2:0),m=2;m<p;m++)y[m-2]=arguments[m];u.locks++;try{var _;return c!=null&&(_=c.apply(this,y)),_}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 U=A[De]=A[De]||{},H=U[N]=U[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[ze]){var m=c[u],_=gt(c,u,y?y.enumerable:void 0,p,m);Object.defineProperty(c,u,_)}}function gt(c,u,d,p,y){var m,_=Be(y,p);return(m={})[ze]=!0,m.get=function(){return _},m.set=function(A){if(this===c)_=Be(A,p);else{var N=gt(this,u,d,p,A);Object.defineProperty(this,u,N)}},m.configurable=!0,m.enumerable=d,m}var se=a.a||"$mobx",Ze=ie("isMobXReactObserver"),pe=ie("isUnmounted"),le=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__!==l.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[se])===null||p===void 0||p.dispose(),this[pe]=!0,!this.render[se]&&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;ke(this,le,!1),ke(this,we,!1);var d=rt(this),p=c.bind(this),y=!1,m=new a.c(d+".render()",(function(){if(!y&&(y=!0,u[pe]!==!0)){var A=!0;try{ke(u,we,!0),u[le]||l.a.prototype.forceUpdate.call(u),A=!1}finally{ke(u,we,!1),A&&m.dispose()}}}));function _(){y=!1;var A=void 0,N=void 0;if(m.track((function(){try{N=Object(a.d)(!1,p)}catch(U){A=U}})),A)throw A;return N}return m.reactComponent=this,_[se]=m,this.render=_,_.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]||ke(this,p,Object(a.o)("reactive "+u)),this[p]}Object.defineProperty(c,u,{configurable:!0,enumerable:!0,get:function(){var m=!1;return a.f&&a.e&&(m=Object(a.f)(!0)),y.call(this).reportObserved(),a.f&&a.e&&Object(a.e)(m),this[d]},set:function(m){this[we]||Se(this[d],m)?ke(this,d,m):(ke(this,d,m),ke(this,le,!0),y.call(this).reportChanged(),ke(this,le,!1))}})}var en=typeof Symbol=="function"&&Symbol.for,zt=en?Symbol.for("react.forward_ref"):typeof l.e=="function"&&Object(l.e)((function(c){return null})).$$typeof,it=en?Symbol.for("react.memo"):typeof l.f=="function"&&Object(l.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(l.e)((function(){var d=arguments;return Object(l.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(l.a,c)?$e(c):V(c)}if(!l.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},Pt=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=Pt(u,c);return!(d<0)&&(d==u.length-1?u.pop():Rt.call(u,d,1),--this.size,!0)},kn=function(c){var u=this.__data__,d=Pt(u,c);return d<0?void 0:u[d][1]},qt=function(c){return Pt(this.__data__,c)>-1},On=function(c,u){var d=this.__data__,p=Pt(d,c);return p<0?(++this.size,d.push([c,u])):d[p][1]=u,this};function Pe(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])}}Pe.prototype.clear=vt,Pe.prototype.delete=Gt,Pe.prototype.get=kn,Pe.prototype.has=qt,Pe.prototype.set=On;var Ke=Pe,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,yo=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=yo.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,vn=function(c){return c==null?c===void 0?"[object Undefined]":"[object Null]":ut&&ut in Object(c)?Nn(c):rr(c)},In=function(c){var u=typeof c;return c!=null&&(u=="object"||u=="function")},lr,wo=function(c){if(!In(c))return!1;var u=vn(c);return u=="[object Function]"||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"},oo=En.a["__core-js_shared__"],ta=(lr=/[^.]+$/.exec(oo&&oo.keys&&oo.keys.IE_PROTO||""))?"Symbol(src)_1."+lr:"",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,Tl=Object.prototype,Oo=Sn.toString,el=Tl.hasOwnProperty,Ui=RegExp("^"+Oo.call(el).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=function(c){return!(!In(c)||Ca(c))&&(wo(c)?Ui:Ka).test(fa(c))},ms=function(c,u){return c==null?void 0:c[u]},pa=function(c,u){var d=ms(c,u);return gr(d)?d:void 0},qi=pa(En.a,"Map"),Na=pa(Object,"create"),as=function(){this.__data__=Na?Na(null):{},this.size=0},gs=function(c){var u=this.has(c)&&delete this.__data__[c];return this.size-=u?1:0,u},Cl=Object.prototype.hasOwnProperty,ys=function(c){var u=this.__data__;if(Na){var d=u[c];return d==="__lodash_hash_undefined__"?void 0:d}return Cl.call(u,c)?u[c]:void 0},tl=Object.prototype.hasOwnProperty,ve=function(c){var u=this.__data__;return Na?u[c]!==void 0:tl.call(u,c)},mt=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 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=as,cn.prototype.delete=gs,cn.prototype.get=ys,cn.prototype.has=ve,cn.prototype.set=mt;var Kn=cn,br=function(){this.size=0,this.__data__={hash:new Kn,map:new(qi||Ke),string:new Kn}},lo=function(c){var u=typeof c;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?c!=="__proto__":c===null},li=function(c,u){var d=c.__data__;return lo(u)?d[typeof u=="string"?"string":"hash"]:d.map},ye=function(c){var u=li(this,c).delete(c);return this.size-=u?1:0,u},ht=function(c){return li(this,c).get(c)},fn=function(c){return li(this,c).has(c)},Rn=function(c,u){var d=li(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=fn,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 sr=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 _s=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},Nl=function(c,u){return c.has(u)},Is=function(c,u,d,p,y,m){var _=1&d,A=c.length,N=u.length;if(A!=N&&!(_&&N>A))return!1;var U=m.get(c),H=m.get(u);if(U&&H)return U==u&&H==c;var oe=-1,ue=!0,Ce=2&d?new _s:void 0;for(m.set(c,u),m.set(u,c);++oe<A;){var Ve=c[oe],qe=u[oe];if(p)var Ot=_?p(qe,Ve,oe,u,c,m):p(Ve,qe,oe,c,u,m);if(Ot!==void 0){if(Ot)continue;ue=!1;break}if(Ce){if(!Vi(u,(function(xt,Ft){if(!Nl(Ce,Ft)&&(Ve===xt||y(Ve,xt,d,p,m)))return Ce.push(Ft)}))){ue=!1;break}}else if(Ve!==qe&&!y(Ve,qe,d,p,m)){ue=!1;break}}return m.delete(c),m.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},od=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,m,_){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||!m(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=od),c.size!=u.size&&!N)return!1;var U=_.get(c);if(U)return U==u;p|=2,_.set(c,u);var H=Is(A(c),A(u),p,y,m,_);return _.delete(c),H;case"[object Symbol]":if(Ia)return Ia.call(c)==Ia.call(u)}return!1},bs=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:bs(p,d(c))},Fa=function(c,u){for(var d=-1,p=c==null?0:c.length,y=0,m=[];++d<p;){var _=c[d];u(_,d,c)&&(m[y++]=_)}return m},gp=function(){return[]},yp=Object.prototype.propertyIsEnumerable,Ba=Object.getOwnPropertySymbols,Za=Ba?function(c){return c==null?[]:(c=Object(c),Fa(Ba(c),(function(u){return yp.call(c,u)})))}:gp,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)&&vn(c)=="[object Arguments]"},id=Object.prototype,_p=id.hasOwnProperty,of=id.propertyIsEnumerable,ad=oa((function(){return arguments})())?oa:function(c){return Mo(c)&&_p.call(c,"callee")&&!of.call(c,"callee")},nl=ad,$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},ws=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)&&ws(c.length)&&!!vo[vn(c)]},Fs=function(c){return function(u){return c(u)}},ha=r(49),wu=ha.a&&ha.a.isTypedArray,Kl=wu?Fs(wu):Ua,Bs=Object.prototype.hasOwnProperty,ui=function(c,u){var d=qo(c),p=!d&&nl(c),y=!d&&!p&&Object($a.a)(c),m=!d&&!p&&!y&&Kl(c),_=d||p||y||m,A=_?rf(c.length,String):[],N=A.length;for(var U in c)!u&&!Bs.call(c,U)||_&&(U=="length"||y&&(U=="offset"||U=="parent")||m&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||Ja(U,N))||A.push(U);return A},ic=Object.prototype,rl=function(c){var u=c&&c.constructor;return c===(typeof u=="function"&&u.prototype||ic)},Es=function(c,u){return function(d){return c(u(d))}},af=Es(Object.keys,Object),Vh=Object.prototype.hasOwnProperty,sf=function(c){if(!rl(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&&ws(c.length)&&!wo(c)},ac=function(c){return Wi(c)?ui(c):sf(c)},ol=function(c){return Uh(c,ac,Za)},Ki=Object.prototype.hasOwnProperty,lf=function(c,u,d,p,y,m){var _=1&d,A=ol(c),N=A.length;if(N!=ol(u).length&&!_)return!1;for(var U=N;U--;){var H=A[U];if(!(_?H in u:Ki.call(u,H)))return!1}var oe=m.get(c),ue=m.get(u);if(oe&&ue)return oe==u&&ue==c;var Ce=!0;m.set(c,u),m.set(u,c);for(var Ve=_;++U<N;){var qe=c[H=A[U]],Ot=u[H];if(p)var xt=_?p(Ot,qe,H,u,c,m):p(qe,Ot,H,c,u,m);if(!(xt===void 0?qe===Ot||y(qe,Ot,d,p,m):xt)){Ce=!1;break}Ve||(Ve=H=="constructor")}if(Ce&&!Ve){var Ft=c.constructor,hn=u.constructor;Ft==hn||!("constructor"in c)||!("constructor"in u)||typeof Ft=="function"&&Ft instanceof Ft&&typeof hn=="function"&&hn instanceof hn||(Ce=!1)}return m.delete(c),m.delete(u),Ce},ss=pa(En.a,"DataView"),xs=pa(En.a,"Promise"),sd=pa(En.a,"Set"),Va=pa(En.a,"WeakMap"),Qa="[object Map]",ia="[object Promise]",ls="[object Set]",Pa="[object WeakMap]",Ct="[object DataView]",un=fa(ss),dn=fa(qi),Gn=fa(xs),Wr=fa(sd),mo=fa(Va),ci=vn;(ss&&ci(new ss(new ArrayBuffer(1)))!=Ct||qi&&ci(new qi)!=Qa||xs&&ci(xs.resolve())!=ia||sd&&ci(new sd)!=ls||Va&&ci(new Va)!=Pa)&&(ci=function(c){var u=vn(c),d=u=="[object Object]"?c.constructor:void 0,p=d?fa(d):"";if(p)switch(p){case un:return Ct;case dn:return Qa;case Gn:return ia;case Wr:return ls;case mo:return Pa}return u});var R=ci,L="[object Arguments]",Z="[object Array]",fe="[object Object]",Re=Object.prototype.hasOwnProperty,st=function(c,u,d,p,y,m){var _=qo(c),A=qo(u),N=_?Z:R(c),U=A?Z:R(u),H=(N=N==L?fe:N)==fe,oe=(U=U==L?fe:U)==fe,ue=N==U;if(ue&&Object($a.a)(c)){if(!Object($a.a)(u))return!1;_=!0,H=!1}if(ue&&!H)return m||(m=new sr),_||Kl(c)?Is(c,u,d,p,y,m):ra(c,u,N,d,p,y,m);if(!(1&d)){var Ce=H&&Re.call(c,"__wrapped__"),Ve=oe&&Re.call(u,"__wrapped__");if(Ce||Ve){var qe=Ce?c.value():c,Ot=Ve?u.value():u;return m||(m=new sr),y(qe,Ot,d,p,m)}}return!!ue&&(m||(m=new sr),lf(c,u,d,p,y,m))},It=function c(u,d,p,y,m){return u===d||(u==null||d==null||!Mo(u)&&!Mo(d)?u!=u&&d!=d:st(u,d,p,y,c,m))},bn=function(c,u,d,p){var y=d.length,m=y;if(c==null)return!m;for(c=Object(c);y--;){var _=d[y];if(_[2]?_[1]!==c[_[0]]:!(_[0]in c))return!1}for(;++y<m;){var A=(_=d[y])[0],N=c[A],U=_[1];if(_[2]){if(N===void 0&&!(A in c))return!1}else{var H=new sr,oe;if(!(oe===void 0?It(U,N,3,p,H):oe))return!1}}return!0},Jn=function(c){return c==c&&!In(c)},no=function(c){for(var u=ac(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)&&vn(c)=="[object Symbol]"},So=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,us=/^\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))||us.test(c)||!So.test(c)||u!=null&&c in Object(u)};function es(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],m=d.cache;if(m.has(y))return m.get(y);var _=c.apply(this,p);return d.cache=m.set(y,_)||m,_};return d.cache=new(es.Cache||nr),d}es.Cache=nr;var Pl=es,kl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zl=/\\(\\)?/g,Eu=(function(c){var u=Pl(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(kl,(function(d,p,y,m){u.push(y?m.replace(Zl,"$1"):p||d)})),u})),il=Zn?Zn.prototype:void 0,xu=il?il.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},Jl=function(c){return c==null?"":Zi(c)},Rl=function(c,u){return qo(c)?c:wi(c,u)?[c]:Eu(Jl(c))},al=function(c){if(typeof c=="string"||Kr(c))return c;var u=c+"";return u=="0"&&1/c==-1/0?"-0":u},sl=function(c,u){for(var d=0,p=(u=Rl(u,c)).length;c!=null&&d<p;)c=c[al(u[d++])];return d&&d==p?c:void 0},sc=function(c,u,d){var p=c==null?void 0:sl(c,u);return p===void 0?d:p},fm=function(c,u){return c!=null&&u in Object(c)},pm=function(c,u,d){for(var p=-1,y=(u=Rl(u,c)).length,m=!1;++p<y;){var _=al(u[p]);if(!(m=c!=null&&d(c,_)))break;c=c[_]}return m||++p!=y?m:!!(y=c==null?0:c.length)&&ws(y)&&Ja(_,y)&&(qo(c)||nl(c))},Wh=function(c,u){return c!=null&&pm(c,u,fm)},uf=function(c,u){return wi(c)&&Jn(u)?$n(al(c),u):function(d){var p=sc(d,c);return p===void 0&&p===u?Wh(d,c):It(u,p,3)}},lc=function(c){return c},bp=function(c){return function(u){return u==null?void 0:u[c]}},hm=function(c){return function(u){return sl(u,c)}},uc=function(c){return wi(c)?bp(al(c)):hm(c)},cf=function(c){return typeof c=="function"?c:c==null?lc:typeof c=="object"?qo(c)?uf(c[0],c[1]):Do(c):uc(c)},wp=(function(c){return function(u,d,p){for(var y=-1,m=Object(u),_=p(u),A=_.length;A--;){var N=_[++y];if(d(m[N],N,m)===!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,m=-1,_=Object(d);++m<y&&p(_[m],m,_)!==!1;);return d}})((function(c,u){return c&&wp(c,u,ac)})),Wa=function(c,u){var d=-1,p=Wi(c)?Array(c.length):[];return ji(c,(function(y,m,_){p[++d]=u(y,m,_)})),p},Ep=function(c,u){return(qo(c)?je:Wa)(c,cf(u))};Object(a.n)({isolateGlobalState:!0});var xp=(function(){try{var c=pa(Object,"defineProperty");return c({},"",{}),c}catch{}})(),ld=function(c,u,d){u=="__proto__"&&xp?xp(c,u,{configurable:!0,enumerable:!0,value:d,writable:!0}):c[u]=d},dy=Object.prototype.hasOwnProperty,ud=function(c,u,d){var p=c[u];dy.call(c,u)&&q(p,d)&&(d!==void 0||u in c)||ld(c,u,d)},cd=function(c,u,d,p){var y=!d;d||(d={});for(var m=-1,_=u.length;++m<_;){var A=u[m],N=void 0;N===void 0&&(N=c[A]),y?ld(d,A,N):ud(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)},cc=Math.max,Ou=function(c,u,d){return u=cc(u===void 0?c.length-1:u,0),function(){for(var p=arguments,y=-1,m=cc(p.length-u,0),_=Array(m);++y<m;)_[y]=p[u+y];y=-1;for(var A=Array(u+1);++y<u;)A[y]=p[y];return A[u]=d(_),df(c,this,A)}},dd=function(c){return function(){return c}},ff=xp?function(c,u){return xp(c,"toString",{configurable:!0,enumerable:!1,value:dd(u),writable:!0})}:lc,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,lc),c+"")},hy=function(c,u,d){if(!In(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)},vm=function(c){return py((function(u,d){var p=-1,y=d.length,m=y>1?d[y-1]:void 0,_=y>2?d[2]:void 0;for(m=c.length>3&&typeof m=="function"?(y--,m):void 0,_&&hy(d[0],d[1],_)&&(m=y<3?void 0:m,y=1),u=Object(u);++p<y;){var A=d[p];A&&c(u,A,p,m)}return u}))},Op=Object.prototype.hasOwnProperty,ka=vm((function(c,u){if(rl(u)||Wi(u))cd(u,ac(u),c);else for(var d in u)Op.call(u,d)&&ud(c,d,u[d])})),mm=function(c,u,d,p){if(!In(c))return c;for(var y=-1,m=(u=Rl(u,c)).length,_=m-1,A=c;A!=null&&++y<m;){var N=al(u[y]),U=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return c;if(y!=_){var H=A[N];(U=void 0)==void 0&&(U=In(H)?H:Ja(u[y+1])?[]:{})}ud(A,N,U),A=A[N]}return c},he=function(c,u,d){for(var p=-1,y=u.length,m={};++p<y;){var _=u[p],A=sl(c,_);d(A,_)&&mm(m,Rl(_,c),A)}return m},dc=function(c,u){return he(c,u,(function(d,p){return Wh(c,p)}))},Ql=Zn?Zn.isConcatSpreadable:void 0,$s=function(c){return qo(c)||nl(c)||!!(Ql&&c&&c[Ql])},go=function(u,d,p,y,m){var _=-1,A=u.length;for(p||(p=$s),m||(m=[]);++_<A;){var N=u[_];p(N)?bs(m,N):m[m.length]=N}return m},ba=function(c){return c!=null&&c.length?go(c):[]},To,ll,eu,Os,Sp,Ap,Gh,gm,tu,Li,fd,zh,nu,ul,hf,Au,Ss,Hh,Xh,cl=(function(c){return pf(Ou(c,void 0,ba),c+"")})((function(c,u){return c==null?{}:dc(c,u)}));function mi(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 ym(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Io,Ji,so,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},Dl=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotation","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],Mp=(ll=Ii((To=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),mi(this,"isSilentMode",ll,this),mi(this,"stopZoomGraph",eu,this),mi(this,"stopScrollGraph",Os,this),mi(this,"stopMoveGraph",Sp,this),mi(this,"adjustEdge",Ap,this),mi(this,"adjustEdgeMiddle",Gh,this),mi(this,"adjustEdgeStartAndEnd",gm,this),mi(this,"adjustNodePosition",tu,this),mi(this,"hideAnchors",Li,this),mi(this,"allowRotation",fd,this),mi(this,"hoverOutline",zh,this),mi(this,"nodeSelectedOutline",nu,this),mi(this,"edgeSelectedOutline",ul,this),mi(this,"nodeTextEdit",hf,this),mi(this,"edgeTextEdit",Au,this),mi(this,"nodeTextDraggable",Ss,this),mi(this,"edgeTextDraggable",Hh,this),mi(this,"autoExpand",Xh,this),Yh(this,"multipleSelectKey",""),Yh(this,"defaultConfig",{}),ka(this,this.getConfigDetail(p))}var u,d;return u=c,(d=[{key:"updateEditConfig",value:function(p){var y=this.getConfigDetail(p);ka(this,y)}},{key:"getConfigDetail",value:function(p){var y=p.isSilentMode,m=p.textEdit,_={};if(y===!1&&ka(_,this.defaultConfig),y===!0&&y!==this.isSilentMode){var A=cl(vf,Dl);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},ka(_,A)}m===!1&&ka(_,{nodeTextEdit:!1,edgeTextEdit:!1});var N=cl(p,Dl);return ka(_,N)}},{key:"getConfig",value:function(){return cl(this,Dl)}}])&&ym(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}}),Os=Ii(To.prototype,"stopScrollGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sp=Ii(To.prototype,"stopMoveGraph",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ap=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}}),gm=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}}),fd=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}}),ul=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}}),Ss=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"})(so||(so={})),(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,mf,Ga,Tp,pd,Us;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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 Vs(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 _m(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 jl(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function As(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}(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),jl(this,"MINI_SCALE_SIZE",.2),jl(this,"MAX_SCALE_SIZE",16),Vs(this,"SCALE_X",qh,this),Vs(this,"SKEW_Y",Kh,this),Vs(this,"SKEW_X",mf,this),Vs(this,"SCALE_Y",Ga,this),Vs(this,"TRANSLATE_X",Tp,this),Vs(this,"TRANSLATE_Y",pd,this),Vs(this,"ZOOM_SIZE",Us,this),jl(this,"eventCenter",void 0),jl(this,"translateLimitMinX",void 0),jl(this,"translateLimitMinY",void 0),jl(this,"translateLimitMaxX",void 0),jl(this,"translateLimitMaxY",void 0),this.eventCenter=p;var m=y.stopMoveGraph,_=m!==void 0&&m;this.updateTranslateLimits(_)}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),m=y[0],_=y[1];return[(m-this.TRANSLATE_X)/this.SCALE_X,(_-this.TRANSLATE_Y)/this.SCALE_Y]}},{key:"CanvasPointToHtmlPoint",value:function(p){var y=Mu(p,2),m=y[0],_=y[1];return[m*this.SCALE_X+this.TRANSLATE_X,_*this.SCALE_Y+this.TRANSLATE_Y]}},{key:"moveCanvasPointByHtml",value:function(p,y,m){var _=Mu(p,2),A=_[0],N=_[1];return[A+y/this.SCALE_X,N+m/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,m=this.SCALE_X,_=this.SCALE_Y;return p===!0?(m+=this.ZOOM_SIZE,_+=this.ZOOM_SIZE):p===!1?(m-=this.ZOOM_SIZE,_-=this.ZOOM_SIZE):typeof p=="number"&&(m=p,_=p),m<this.MINI_SCALE_SIZE||m>this.MAX_SCALE_SIZE||(y&&(this.TRANSLATE_X-=(m-this.SCALE_X)*y[0],this.TRANSLATE_Y-=(_-this.SCALE_Y)*y[1]),this.SCALE_X=m,this.SCALE_Y=_,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,m,_){var A=Mu(this.CanvasPointToHtmlPoint([p,y]),2),N=m/2-A[0],U=_/2-A[1];this.TRANSLATE_X+=N,this.TRANSLATE_Y+=U,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&&_m(u.prototype,d),c})(),qh=As(Mi.prototype,"SCALE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Kh=As(Mi.prototype,"SKEW_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),mf=As(Mi.prototype,"SKEW_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Ga=As(Mi.prototype,"SCALE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Tp=As(Mi.prototype,"TRANSLATE_X",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),pd=As(Mi.prototype,"TRANSLATE_Y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Us=As(Mi.prototype,"ZOOM_SIZE",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return .04}}),As(Mi.prototype,"zoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"zoom"),Mi.prototype),As(Mi.prototype,"resetZoom",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"resetZoom"),Mi.prototype),As(Mi.prototype,"translate",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"translate"),Mi.prototype),As(Mi.prototype,"focusOn",[a.k],Object.getOwnPropertyDescriptor(Mi.prototype,"focusOn"),Mi.prototype),Mi),Cp=function(c,u){for(var d=-1,p=c==null?0:c.length;++d<p&&u(c[d],d,c)!==!1;);return c},bm=function(c){var u=[];if(c!=null)for(var d in Object(c))u.push(d);return u},wm=Object.prototype.hasOwnProperty,Em=function(c){if(!In(c))return bm(c);var u=rl(c),d=[];for(var p in c)(p!="constructor"||!u&&wm.call(c,p))&&d.push(p);return d},Np=function(c){return Wi(c)?ui(c,!0):Em(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},gf=Es(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},fc=function(c,u){var d=tv(c.buffer);return new c.constructor(d,c.byteOffset,c.byteLength)},yf=/\w*$/,my=function(c){var u=new c.constructor(c.source,yf.exec(c));return u.lastIndex=c.lastIndex,u},xm=Zn?Zn.prototype:void 0,Ms=xm?xm.valueOf:void 0,gy=function(c){return Ms?Object(Ms.call(c)):{}},_f=function(c,u){var d=u?tv(c.buffer):c.buffer;return new c.constructor(d,c.byteOffset,c.length)},Pp=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 fc(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 my(c);case"[object Symbol]":return gy(c)}},nv=Object.create,Om=(function(){function c(){}return function(u){if(!In(u))return{};if(nv)return nv(u);c.prototype=u;var d=new c;return c.prototype=void 0,d}})(),cs=function(c){return typeof c.constructor!="function"||rl(c)?{}:Om(gf(c))},Tu=function(c){return Mo(c)&&R(c)=="[object Map]"},kp=ha.a&&ha.a.isMap,pc=kp?Fs(kp):Tu,Rp=function(c){return Mo(c)&&R(c)=="[object Set]"},rv=ha.a&&ha.a.isSet,Dp=rv?Fs(rv):Rp,bf="[object Arguments]",jp="[object Function]",Lp="[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[jp]=jo["[object WeakMap]"]=!1;var yy=function c(u,d,p,y,m,_){var A,N=1&d;if(A!==void 0)return A;if(!In(u))return u;var U=qo(u);if(U)A=vy(u);else{var H=R(u),oe=H==jp||H=="[object GeneratorFunction]";if(Object($a.a)(u))return Object(Qh.a)(u,N);if(H==Lp||H==bf||oe&&!m)A=oe?{}:cs(u);else{if(!jo[H])return m?u:{};A=Pp(u,H,N)}}_||(_=new sr);var ue=_.get(u);if(ue)return ue;_.set(u,A),Dp(u)?u.forEach((function(Ve){A.add(c(Ve,d,p,Ve,u,_))})):pc(u)&&u.forEach((function(Ve,qe){A.set(qe,c(Ve,d,p,qe,u,_))}));var Ce=U?void 0:ol(u);return Cp(Ce||u,(function(Ve,qe){Ce&&(Ve=u[qe=Ve]),ud(A,qe,c(Ve,d,p,qe,u,_))})),A},Uo=function(c){return yy(c,5)},Ip=function(c,u,d){(d!==void 0&&!q(c[u],d)||d===void 0&&!(u in c))&&ld(c,u,d)},Sm=function(c){return Mo(c)&&Wi(c)},hc=Function.prototype,Am=Object.prototype,hd=hc.toString,Mm=Am.hasOwnProperty,vc=hd.call(Object),va=function(c){if(!Mo(c)||vn(c)!="[object Object]")return!1;var u=gf(c);if(u===null)return!0;var d=Mm.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&hd.call(d)==vc},dl=function(c,u){if((u!=="constructor"||typeof c[u]!="function")&&u!="__proto__")return c[u]},ou=function(c){return cd(c,Np(c))},mc=function(c,u,d,p,y,m,_){var A=dl(c,d),N=dl(u,d),U=_.get(N);if(U)Ip(c,d,U);else{var H=void 0,oe=H===void 0;if(oe){var ue=qo(N),Ce=!ue&&Object($a.a)(N),Ve=!ue&&!Ce&&Kl(N);H=N,ue||Ce||Ve?qo(A)?H=A:Sm(A)?H=ev(A):Ce?(oe=!1,H=Object(Qh.a)(N,!0)):Ve?(oe=!1,H=_f(N,!0)):H=[]:va(N)||nl(N)?(H=A,nl(A)?H=ou(A):In(A)&&!wo(A)||(H=cs(N))):oe=!1}oe&&(_.set(N,H),y(H,N,p,m,_),_.delete(N)),Ip(c,d,H)}},gc=function c(u,d,p,y,m){u!==d&&wp(d,(function(_,A){if(m||(m=new sr),In(_))mc(u,d,A,p,c,y,m);else{var N=void 0;N===void 0&&(N=_),Ip(u,A,N)}}),Np)},yc=vm((function(c,u,d){gc(c,u,d)})),Fp={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(Fp);return c&&(u=yc(u,c)),u};r(82),r(166);function _c(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 Bp=(function(){function c(){var p,y,m;(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,c),m={},(y="_events")in(p=this)?Object.defineProperty(p,y,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[y]=m}var u,d;return u=c,(d=[{key:"on",value:function(p,y,m){var _=this;return p==null||p.split(",").forEach((function(A){A=A.trim(),_._events[A]||(_._events[A]=[]),_._events[A].push({callback:y,once:!!m})})),this}},{key:"once",value:function(p,y){var m=this;p==null||p.split(",").forEach((function(_){return _=_.trim(),m.on(_,y,!0)}))}},{key:"emit",value:function(p,y){var m=this;p==null||p.split(",").forEach((function(_){var A=m._events[_]||[],N=m._events["*"]||[],U=function(H){for(var oe=H.length,ue=0;ue<oe;ue++)if(H[ue]){var Ce=H[ue],Ve=Ce.callback;Ce.once&&(H.splice(ue,1),H.length===0&&delete m._events[_],oe--,ue--),Ve.apply(m,[y])}};U(A),U(N)}))}},{key:"off",value:function(p,y){var m=this;return p||(this._events={}),p.split(",").forEach((function(_){if(y){for(var A=m._events[_]||[],N=A.length,U=0;U<N;U++)A[U].callback===y&&(A.splice(U,1),N--,U--);A.length===0&&delete m._events[_]}else delete m._events[_]})),this}},{key:"getEvents",value:function(){return this._events}}])&&_c(u.prototype,d),c})();function fl(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return vd(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 vd(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 vd(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],m=p[1],_=Ef(u,2),A=_[0],N=_[1],U=Ef(d,2),H=U[0],oe=U[1];return y>A&&y<H&&m>N&&m<oe},gd=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 $p=function(c){return function(u,d,p){var y=Object(u);if(!Wi(u)){var m=cf(d);u=ac(u),d=function(A){return m(y[A],A,y)}}var _=c(u,d,p);return _>-1?y[m?u[_]:_]:void 0}},yd=function(c,u,d,p){for(var y=c.length,m=d+-1;++m<y;)if(u(c[m],m,c))return m;return-1},ov=/\s/,Up=function(c){for(var u=c.length;u--&&ov.test(c.charAt(u)););return u},Tm=/^\s+/,iv=function(c){return c&&c.slice(0,Up(c)+1).replace(Tm,"")},pl=/^[-+]0x[0-9a-f]+$/i,av=/^0b[01]+$/i,sv=/^0o[0-7]+$/i,lv=parseInt,_d=function(c){if(typeof c=="number")return c;if(Kr(c))return NaN;if(In(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=In(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=iv(c);var d=av.test(c);return d||sv.test(c)?lv(c.slice(2),d?2:8):pl.test(c)?NaN:+c},Ll=1/0,xf=function(c){return c?(c=_d(c))===Ll||c===-1/0?17976931348623157e292*(c<0?-1:1):c==c?c:0:c===0?c:0},Vp=function(c){var u=xf(c),d=u%1;return u==u?d?u-d:u:0},Wp=Math.max,Cu,Nu=$p((function(c,u,d){var p=c==null?0:c.length;if(!p)return-1;var y=d==null?0:Vp(d);return y<0&&(y=Wp(p+y,0)),yd(c,cf(u),y)})),Rr=new Uint8Array(16);function bd(){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,hl=function(c){return typeof c=="string"&&Of.test(c)},aa=[],bc=0;bc<256;++bc)aa.push((bc+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(!hl(d))throw TypeError("Stringified UUID is invalid");return d},Pu=function(c,u,d){var p=(c=c||{}).random||(c.rng||bd)();return p[6]=15&p[6]|64,p[8]=63&p[8]|128,Ti(p)},ts=function(){return Pu()},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+Pu(),y.id=p[y.id],p}),{});return c.edges.forEach((function(p){p.id=u+Pu(),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,m=u.x,_=u.y,A=d.x,N=d.y,U=(N-_)/(A-m),H=_-U*m;return p>=m&&p<=A&&y>=_&&y<=N&&Math.abs(y-U*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 Il(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 Fl(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?Il(Object(d),!0).forEach((function(p){Gp(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):Il(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function Gp(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,wc,Af,Mf,ku,Ec,zp,uv,xc,Tf,Hp,cv,Bl,dv,vl,Ru,Xp,Cm,Nm,Pm,fv,Yp=function(c){return c.anchors},Cf=function(c,u){for(var d,p=u.nodes,y=p.length-1;y>=0;y--){var m=p[y];if(_y(c,m)){var _=m.getTargetAnchor(c);if(_){var A={node:m,anchorIndex:_.index,anchor:_.anchor};d&&!km(m,d.node,u)||(d=A)}}}return d},km=function(c,u,d){return c.zIndex>u.zIndex||d.nodesMap[c.id].index>d.nodesMap[u.id].index},ml=function(c,u,d,p){return Math.hypot(c-d,u-p)},Du=function(c,u){var d=!1,p=gi(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=gi(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},gi=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(_){var A=_,N=A.x,U=A.y,H=A.width,oe=A.height,ue=A.radius;return[{x:N-H/2+ue,y:U-oe/2+ue,r:ue},{x:N+H/2-ue,y:U-oe/2+ue,r:ue},{x:N-H/2+ue,y:U+oe/2-ue,r:ue},{x:N+H/2-ue,y:U+oe/2-ue,r:ue}]})(d),m=Number.MAX_SAFE_INTEGER;return y.forEach((function(_){var A=ml(c.x,c.y,_.x,_.y);A<m&&(m=A,p=_)})),Oc(c,u,p)},Oc=function(c,u,d){var p,y=d,m=y.x,_=y.y,A=y.r;if(u===ti.HORIZONTAL){var N=m-Math.sqrt(A*A-(c.y-_)*(c.y-_)),U=m+Math.sqrt(A*A-(c.y-_)*(c.y-_));p={x:Math.abs(N-c.x)<Math.abs(U-c.x)?N:U,y:c.y}}else if(u===ti.VERTICAL){var H=_-Math.sqrt(A*A-(c.x-m)*(c.x-m)),oe=_+Math.sqrt(A*A-(c.x-m)*(c.x-m)),ue=Math.abs(H-c.y)<Math.abs(oe-c.y)?H:oe;p={x:c.x,y:ue}}return p},Pf=function(c,u){var d=u,p=!1,y=d.x-d.width/2+d.radius,m=d.x+d.width/2-d.radius,_=d.y-d.height/2+d.radius,A=d.y+d.height/2-d.radius,N=d.x,U=d.y,H=d.width,oe=d.height;return c.y===U+oe/2||c.y===U-oe/2?p=c.x>y&&c.x<m:c.x!==N+H/2&&c.x!==N-H/2||(p=c.y>_&&c.y<A),p},wd=function(c,u,d){var p,y=d,m=y.x,_=y.y,A=y.rx,N=y.ry;if(u===ti.HORIZONTAL){var U=m-Math.sqrt(A*A-(c.y-_)*(c.y-_)*A*A/(N*N)),H=m+Math.sqrt(A*A-(c.y-_)*(c.y-_)*A*A/(N*N));p={x:Math.abs(U-c.x)<Math.abs(H-c.x)?U:H,y:c.y}}else if(u===ti.VERTICAL){var oe=_-Math.sqrt(N*N-(c.x-m)*(c.x-m)*N*N/(A*A)),ue=_+Math.sqrt(N*N-(c.x-m)*(c.x-m)*N*N/(A*A)),Ce=Math.abs(oe-c.y)<Math.abs(ue-c.y)?oe:ue;p={x:c.x,y:Ce}}return p},kf=function(c,u,d){for(var p,y=d.pointsPosition,m=Number.MAX_SAFE_INTEGER,_=[],A=0;A<y.length;A++)_.push({start:y[A],end:y[(A+1)%y.length]});return _.forEach((function(N){var U=N.start,H=N.end,oe=U,ue=H;U.x>H.x&&(oe=H,ue=U);var Ce={x:c.x,y:c.y};if(oe.x===ue.x&&u===ti.HORIZONTAL&&(Ce={x:oe.x,y:c.y}),oe.y===ue.y&&u===ti.VERTICAL&&(Ce={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?Ce={x:(c.y-qe)/Ve,y:c.y}:u===ti.VERTICAL&&(Ce={x:c.x,y:Ve*c.x+qe})}if(Ra(Ce,U,H)){var Ot=ml(Ce.x,Ce.y,c.x,c.y);Ot<m&&(m=Ot,p=Ce)}})),p},Rf=function(c,u,d,p){var y=c.x,m=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?m=c.y+p/2:u.y<c.y&&(m=c.y-p/2),{x:y,y:m}},Df=function(c){var u=c.rows,d=c.style,p=c.rowsLength,y=c.className,m=document.createElement("div");m.style.fontSize=d.fontSize,m.style.width=d.width,m.className=y,m.style.lineHeight=d.lineHeight,m.style.padding=d.padding,d.fontFamily&&(m.style.fontFamily=d.fontFamily),p>1?u.forEach((function(A){var N=document.createElement("div");N.textContent=A,m.appendChild(N)})):m.textContent=u,document.body.appendChild(m);var _=m.clientHeight;return document.body.removeChild(m),_},Sc=function(c){var u=c.rows,d=c.rowsLength,p=c.fontSize,y=0;return u&&u.forEach((function(m){var _=ki(m);y=_>y?_: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},ma=function(c){try{return JSON.parse(JSON.stringify(c))}catch{return c}},qp=1e3,jf=999,Ac=function(){return++qp};function Ed(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?Ed(Object(d),!0).forEach((function(p){za(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):Ed(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Kp=(Qt=(function(){function c(p,y){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),za(this,"id",""),xi(this,"type",wc,this),xi(this,"sourceNodeId",Af,this),xi(this,"targetNodeId",Mf,this),xi(this,"startPoint",ku,this),xi(this,"endPoint",Ec,this),xi(this,"text",zp,this),xi(this,"properties",uv,this),xi(this,"points",xc,this),xi(this,"pointsList",Tf,this),xi(this,"isSelected",Hp,this),xi(this,"isHovered",cv,this),xi(this,"isHitable",Bl,this),xi(this,"draggable",dv,this),xi(this,"visible",vl,this),za(this,"virtual",!1),xi(this,"isAnimation",Ru,this),xi(this,"isShowAdjustPoint",Xp,this),za(this,"graphModel",void 0),xi(this,"zIndex",Cm,this),za(this,"BaseType",ei.EDGE),za(this,"modelType",so.EDGE),xi(this,"state",Nm,this),za(this,"additionStateData",void 0),za(this,"sourceAnchorId",""),za(this,"targetAnchorId",""),za(this,"menu",void 0),za(this,"customTextPosition",!1),xi(this,"style",Pm,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,m=y&&y(p.type),_=this.createId();p.id=_||m||ts()}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,ka(this,cr(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Ac()),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(),m=this.graphModel.theme.arrow,_=this.isAnimation?y.stroke:p.stroke;return wa(wa({},p),{},{fill:_,stroke:_},m)}},{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,m){var _,A,N=Yp(p);return m&&(_=Nu(N,(function(U){return U.id===m})))||N.forEach((function(U){var H=Xr(U,y);(A===void 0||H<A)&&(A=H,_=U)})),_}},{key:"getEndAnchor",value:function(p,y){var m,_,A=this,N=Yp(p);return y&&(m=Nu(N,(function(U){return U.id===y})))||N.forEach((function(U){var H=Xr(U,A.startPoint);(_===void 0||H<_)&&(_=H,m=U)})),m}},{key:"getProperties",value:function(){return Object(a.I)(this.properties)}},{key:"getData",value:function(){var p=this.text,y=p.x,m=p.y,_=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 _&&(A.text={x:y,y:m,value:_}),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]=ma(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)),ma(p)),this.setAttributes()}},{key:"changeEdgeId",value:function(p){var y=this.arrowConfig,m=y.markerEnd,_=y.markerStart;_&&_==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(p,")")),m&&m==="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,ma(y)))}},{key:"setStyles",value:function(p){this.style=wa(wa({},this.style),ma(p))}},{key:"updateStyles",value:function(p){this.style=wa({},ma(p))}},{key:"formatText",value:function(p){var y=this.textPosition,m=y.x,_=y.y;p.text&&typeof p.text!="string"?Object.prototype.toString.call(p.text)==="[object Object]"&&(this.text={x:p.text.x||m,y:p.text.y||_,value:p.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:p.text||"",x:m,y:_,draggable:this.text.draggable,editable:this.text.editable}}},{key:"resetTextPosition",value:function(){var p=this.textPosition,y=p.x,m=p.y;this.text.x=y,this.text.y=m}},{key:"moveText",value:function(p,y){if(this.text){var m=this.text,_=m.x,A=m.y,N=m.value,U=m.draggable,H=m.editable;this.text={value:N,draggable:U,x:_+p,y:A+y,editable:H}}}},{key:"setText",value:function(p){p&&ka(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){ka(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,m=p.endPoint;this.updateStartPoint({x:y.x,y:y.y}),this.updateEndPoint({x:m.x,y:m.y})}}],d&&Lf(u.prototype,d),c})(),wc=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""}}),ku=wr(Qt.prototype,"startPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Ec=wr(Qt.prototype,"endPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),zp=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{}}}),xc=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[]}}),Hp=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}}),Bl=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}}),vl=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}}),Xp=wr(Qt.prototype,"isShowAdjustPoint",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Cm=wr(Qt.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Nm=wr(Qt.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Pm=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=Kp;function Zp(c){return Zp=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},Zp(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 Rm(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 Dm(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 Mc(){return Mc=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=jm(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Mc.apply(this,arguments)}function jm(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=su(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=su(c);if(u){var y=su(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return Lm(this,d)}}function Lm(c,u){if(u&&(Zp(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ws(c)}function Ws(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function su(c){return su=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},su(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,xd=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&hv(m,_)})(y,c);var u,d,p=Ff(y);function y(){var m;ju(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Lu(Ws(m=p.call.apply(p,[this].concat(A))),"modelType",so.LINE_EDGE),m}return u=y,(d=[{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.line;return Rm(Rm({},Mc(su(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}}}])&&Dm(u.prototype,d),y})(If);function lu(c){return lu=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},lu(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 gl(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?gl(Object(d),!0).forEach((function(p){mv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):gl(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ds(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 Gs(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=Tc(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 Tc(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=ns(c))!==null;);return c}function Jr(c,u){return Jr=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Jr(c,u)}function Im(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=ns(c);if(u){var y=ns(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return fs(this,d)}}function fs(c,u){if(u&&(lu(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 ns(c){return ns=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},ns(c)}function mv(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Ts=(Er=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Jr(m,_)})(y,c);var u,d,p=Im(y);function y(){var m;Gs(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return mv(Oi(m=p.call.apply(p,[this].concat(A))),"modelType",so.POLYLINE_EDGE),mv(Oi(m),"draggingPointList",void 0),ds(Oi(m),"dbClickPosition",vv,Oi(m)),m}return u=y,(d=[{key:"initEdgeData",value:function(m){this.offset=30,$f(ns(y.prototype),"initEdgeData",this).call(this,m)}},{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.polyline;return Ci(Ci({},$f(ns(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){var m,_=(m=this.text)===null||m===void 0?void 0:m.value;if(this.dbClickPosition&&!_){var A=this.dbClickPosition;return{x:A.x,y:A.y}}var N=jr(this.points),U=Bf(Or(N),2),H=U[0],oe=U[1];return{x:(H.x+oe.x)/2,y:(H.y+oe.y)/2}}},{key:"getAfterAnchor",value:function(m,_,A){var N,U;return A.forEach((function(H){var oe;m===ti.HORIZONTAL?oe=Math.abs(_.y-H.y):m===ti.VERTICAL&&(oe=Math.abs(_.x-H.x)),(!U||U>oe)&&(U=oe,N=H)})),N}},{key:"getCrossPoint",value:function(m,_,A){var N;return m===ti.HORIZONTAL?N={x:A.x,y:_.y}:m===ti.VERTICAL&&(N={x:_.x,y:A.y}),N}},{key:"removeCrossPoints",value:function(m,_,A){var N=A.map((function(xt){return xt}));if(m===1){var U=N[m],H=N[_],oe=N[m-1];if(Fr(oe,U,this.sourceNode)){if(Qr(U,H,this.sourceNode)){var ue=Pi(U,H,this.sourceNode);ue&&(N[m]=ue,N.splice(m-1,1),m--,_--)}}else this.sourceNode.anchors.forEach((function(xt){(xt.x===oe.x&&xt.x===U.x||xt.y===oe.y&&xt.y===U.y)&&ml(xt.x,xt.y,U.x,U.y)<ml(oe.x,oe.y,U.x,U.y)&&(N[m-1]=xt)}))}if(_===A.length-2){var Ce=N[m],Ve=N[_],qe=N[_+1];if(Fr(Ve,qe,this.targetNode)){if(Qr(Ce,Ve,this.targetNode)){var Ot=Pi(Ce,Ve,this.targetNode);Ot&&(N[_]=Ot,N.splice(_+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)&&ml(xt.x,xt.y,Ve.x,Ve.y)<ml(qe.x,qe.y,Ve.x,Ve.y)&&(N[_+1]=xt)}))}return N}},{key:"getDraggingPoints",value:function(m,_,A,N,U){var H=U.map((function(Ce){return Ce})),oe=this.getAfterAnchor(m,A,N),ue=this.getCrossPoint(m,A,oe);return _==="start"?(H.unshift(ue),H.unshift(oe)):(H.push(ue),H.push(oe)),H}},{key:"updateCrossPoints",value:function(m){var _=m.map((function(hn){return hn})),A=m[0],N=m[1],U=m[_.length-2],H=m[_.length-1],oe=this.sourceNode,ue=this.targetNode,Ce=oe.modelType,Ve=ue.modelType,qe=Si(A,N),Ot=_[0];switch(Ce){case so.RECT_NODE:oe.radius!==0&&(Pf(A,oe)||(Ot=Nf(A,qe,oe)));break;case so.CIRCLE_NODE:Ot=Oc(A,qe,oe);break;case so.ELLIPSE_NODE:Ot=wd(A,qe,oe);break;case so.DIAMOND_NODE:case so.POLYGON_NODE:Ot=kf(A,qe,oe)}Ot&&(_[0]=Ot);var xt=Si(U,H),Ft=_[_.length-1];switch(Ve){case so.RECT_NODE:ue.radius!==0&&(Pf(H,ue)||(Ft=Nf(H,xt,ue)));break;case so.CIRCLE_NODE:Ft=Oc(H,xt,ue);break;case so.ELLIPSE_NODE:Ft=wd(H,xt,ue);break;case so.DIAMOND_NODE:case so.POLYGON_NODE:Ft=kf(H,xt,ue)}return Ft&&(_[_.length-1]=Ft),_}},{key:"getData",value:function(){var m=$f(ns(y.prototype),"getData",this).call(this),_=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Object.assign({},m,{pointsList:_})}},{key:"initPoints",value:function(){this.pointsList.length>0?this.points=this.pointsList.map((function(m){return"".concat(m.x,",").concat(m.y)})).join(" "):this.updatePoints()}},{key:"updatePoints",value:function(){var m=$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=m,this.points=m.map((function(_){return"".concat(_.x,",").concat(_.y)})).join(" ")}},{key:"updateStartPoint",value:function(m){this.startPoint=Object.assign({},m),this.updatePoints()}},{key:"moveStartPoint",value:function(m,_){this.startPoint.x+=m,this.startPoint.y+=_,this.updatePoints()}},{key:"updateEndPoint",value:function(m){this.endPoint=Object.assign({},m),this.updatePoints()}},{key:"moveEndPoint",value:function(m,_){this.endPoint.x+=m,this.endPoint.y+=_,this.updatePoints()}},{key:"updatePointsList",value:function(m,_){this.pointsList.forEach((function(U){U.x+=m,U.y+=_}));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(m){return m}))}},{key:"dragAppendSimple",value:function(m,_){this.isDragging=!0;var A=m.start,N=m.end,U=m.startIndex,H=m.endIndex,oe=m.direction,ue=this.pointsList,Ce=ue;return oe===ti.HORIZONTAL?(ue[U]={x:A.x,y:A.y+_.y},ue[H]={x:N.x,y:N.y+_.y},Ce=this.pointsList.map((function(Ve){return Ve}))):oe===ti.VERTICAL&&(ue[U]={x:A.x+_.x,y:A.y},ue[H]={x:N.x+_.x,y:N.y},Ce=this.pointsList.map((function(Ve){return Ve}))),this.updatePointsAfterDrag(Ce),this.draggingPointList=Ce,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},ue[U]),end:Object.assign({},ue[H]),startIndex:U,endIndex:H,direction:oe}}},{key:"dragAppend",value:function(m,_){this.isDragging=!0;var A=m.start,N=m.end,U=m.startIndex,H=m.endIndex,oe=m.direction,ue=this.pointsList;if(oe===ti.HORIZONTAL){ue[U]={x:A.x,y:A.y+_.y},ue[H]={x:N.x,y:N.y+_.y};var Ce=this.pointsList.map((function(Vn){return Vn}));if(U!==0&&H!==this.pointsList.length-1&&(Ce=this.removeCrossPoints(U,H,Ce)),U===0){var Ve={x:A.x,y:A.y+_.y};if(!Du(Ve,this.sourceNode)){var qe=this.sourceNode.anchors;Ce=this.getDraggingPoints(oe,"start",Ve,qe,Ce)}}if(H===this.pointsList.length-1){var Ot={x:N.x,y:N.y+_.y};if(!Du(Ot,this.targetNode)){var xt=this.targetNode.anchors;Ce=this.getDraggingPoints(oe,"end",Ot,xt,Ce)}}this.updatePointsAfterDrag(Ce),this.draggingPointList=Ce}else if(oe===ti.VERTICAL){ue[U]={x:A.x+_.x,y:A.y},ue[H]={x:N.x+_.x,y:N.y};var Ft=this.pointsList.map((function(Vn){return Vn}));if(U!==0&&H!==this.pointsList.length-1&&(Ft=this.removeCrossPoints(U,H,Ft)),U===0){var hn={x:A.x+_.x,y:A.y};if(!Du(hn,this.sourceNode)){var Hn=this.sourceNode.anchors;Ft=this.getDraggingPoints(oe,"start",hn,Hn,Ft)}}if(H===this.pointsList.length-1){var zn={x:N.x+_.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[U]),end:Object.assign({},ue[H]),startIndex:U,endIndex:H,direction:oe}}},{key:"dragAppendEnd",value:function(){if(this.draggingPointList){var m=Un(jr(this.points));this.pointsList=m.map((function(N){return N})),this.draggingPointList=[];var _=m[0];this.startPoint=Object.assign({},_);var A=m[m.length-1];this.endPoint=Object.assign({},A)}this.isDragging=!1}},{key:"updatePointsAfterDrag",value:function(m){var _=this.updateCrossPoints(m);this.points=_.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 m=this.pointsList;return m[m.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(m){var _=m.startPoint,A=m.endPoint,N=m.sourceNode,U=m.targetNode,H=$r({x:_.x,y:_.y},{x:A.x,y:A.y},N,U,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),Cc=function(c){var u=c.start,d=c.end,p=c.offset,y=c.verticalLength,m=c.type,_={leftX:0,leftY:0,rightX:0,rightY:0},A=Math.atan((d.y-u.y)/(d.x-u.x)),N=Math.atan(p/y),U=Math.sqrt(y*y+p*p);return m==="start"?d.x>=u.x?(_.leftX=u.x+U*Math.sin(A+N),_.leftY=u.y-U*Math.cos(A+N),_.rightX=u.x-U*Math.sin(A-N),_.rightY=u.y+U*Math.cos(A-N)):(_.leftX=u.x-U*Math.sin(A+N),_.leftY=u.y+U*Math.cos(A+N),_.rightX=u.x+U*Math.sin(A-N),_.rightY=u.y-U*Math.cos(A-N)):m==="end"&&(d.x>=u.x?(_.leftX=d.x+U*Math.sin(A-N),_.leftY=d.y-U*Math.cos(A-N),_.rightX=d.x-U*Math.sin(A+N),_.rightY=d.y+U*Math.cos(A+N)):(_.leftX=d.x-U*Math.sin(A-N),_.leftY=d.y+U*Math.cos(A-N),_.rightX=d.x+U*Math.sin(A+N),_.rightY=d.y-U*Math.cos(A+N))),_},Uf={x:1,y:0,z:0};function Ni(c,u,d,p,y){for(var m=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)}},_=0,A=2,N=p.x,U=p.y,H=p;_<y&&A<50;){var oe=H=m(1-A/100),ue=oe.x,Ce=oe.y;_=ml(N,U,ue,Ce),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 Jp(c){return p=(function(m,_){return m.x*_.y-m.y*_.x})(u=Uf,d=c),y=Math.acos((function(m,_){var A=[m.x,m.y,m.z];return[_.x,_.y,_.z].reduce((function(N,U,H){return N+U*A[H]}))})(Bi(u),Bi(d))),p>=0?y:-y;var u,d,p,y}function gv(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 me(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 ln=function(c,u){var d;switch(c.type){case"line":default:d=new xd(c,u);break;case"polyline":d=new Ts(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)},pn=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}},lt=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),m=Math.max(c.maxY,u.maxY);return{centerX:(d+y)/2,centerY:(p+m)/2,minX:d,minY:p,maxX:y,maxY:m,height:m-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),m=Math.max.apply(Math,d),_=Math.min.apply(Math,p),A=Math.max.apply(Math,p),N=m-y,U=A-_;return u&&(N+=u,U+=u),{centerX:(y+m)/2,centerY:(_+A)/2,maxX:m,maxY:A,minX:y,minY:_,x:(y+m)/2,y:(_+A)/2,height:U,width:N}},sn=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}]},Pn=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(Pn(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,m){m||(m=0),u.unshift(d[y]),p[y]&&p[y]!==y&&m<=100&&c(u,d,p,p[y],m+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,m=u.y-c.y,_=p.x-d.x,A=p.y-d.y,N=(-m*(c.x-d.x)+y*(c.y-d.y))/(-_*m+y*A),U=(_*(c.y-d.y)-A*(c.x-d.x))/(-_*m+y*A);return N>=0&&N<=1&&U>=0&&U<=1},Zt=function(c,u,d){if(d.width===0&&d.height===0)return!1;var p=yt(sn(d),4),y=p[0],m=p[1],_=p[2],A=p[3];return on(c,u,y,m)||on(c,u,y,A)||on(c,u,m,_)||on(c,u,_,A)},Ht=function(c,u,d,p){var y=[];return c.forEach((function(m){m!==u&&(m.x!==u.x&&m.y!==u.y||Zt(m,u,d)||Zt(m,u,p)||y.push(m))})),Mt(y)},fr=function(c,u,d,p,y,m,_){var A=[],N=[u],U={},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 Ce=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,U,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 hn=oe[qe.id]+_n(qe,Ft);H[Ft.id]&&hn>=H[Ft.id]||(U[Ft.id]=qe.id,H[Ft.id]=hn,oe[Ft.id]=H[Ft.id]+xn(Ft,d,u,m,_))}}))};N.length;){var Ve=Ce();if(Dt(Ve)==="object")return Ve.v}return[u,d]},Dr=function(c){return gi(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 m=Dr(d),_=Dr(p),A=pn(m,y),N=pn(_,y),U=Wt(A,m,c),H=Wt(N,_,u);if(nn(A,N)){var oe=Gi(c,u,U,H);return[c,U].concat(wt(oe),[H,u])}var ue=St([U,H]),Ce=lt(A,ue),Ve=lt(N,ue),qe=[];qe=(qe=qe.concat(sn(Ce))).concat(sn(Ve));var Ot={x:(c.x+u.x)/2,y:(c.y+u.y)/2};[ue,Ce,Ve].forEach((function(Ft){qe=qe.concat(Kt(Ft,Ot).filter((function(hn){return An(hn,A)&&An(hn,N)})))})),[{x:U.x,y:H.y},{x:H.x,y:U.y}].forEach((function(Ft){An(Ft,A)&&An(Ft,N)&&qe.push(Ft)})),qe.unshift(U),qe.push(H),qe=Mt(qe);var xt=fr(qe,U,H,m,_,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=ml(d.x,d.y,p.x,p.y),m=1;m<c.length-1;m++){var _=c[m],A=c[m+1],N=ml(_.x,_.y,A.x,A.y);N>y&&(y=N,d=_,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)},Pi=function(c,u,d){for(var p,y,m=gi(d),_=sn(m),A=0;A<_.length;A++)on(c,u,_[A],_[(A+1)%_.length])&&(y=[_[A],_[(A+1)%_.length]]);return y&&(p=(function(N,U,H,oe){var ue=(U.y-N.y)*(oe.x-H.x)-(N.x-U.x)*(H.y-oe.y);if(ue===0)return!1;var Ce=((U.x-N.x)*(oe.x-H.x)*(H.y-N.y)+(U.y-N.y)*(oe.x-H.x)*N.x-(oe.y-H.y)*(U.x-N.x)*H.x)/ue,Ve=-((U.y-N.y)*(oe.y-H.y)*(H.x-N.x)+(U.x-N.x)*(oe.y-H.y)*N.y-(oe.x-H.x)*(U.y-N.y)*H.y)/ue;return(Ce-N.x)*(Ce-U.x)<=0&&(Ve-N.y)*(Ve-U.y)<=0&&(Ce-H.x)*(Ce-oe.x)<=0&&(Ve-H.y)*(Ve-oe.y)<=0&&{x:Ce,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),m=y[0],_=y[1];d.push({x:Number(m),y:Number(_)})})),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 m={x:d.x,y:p.y},_=Ra(m,c,d),A=Ra(m,u,p);if(_||A)m={x:p.x,y:d.y};else{var N=Ko(m,c,d),U=Ko(m,u,p);N&&U&&(m={x:p.x,y:d.y})}y.push(m)}return y},Ko=function(c,u,d){return c.x===u.x&&c.x===d.x||c.y===u.y&&c.y===d.y},ki=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},sa=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},m=Cc(me(me({},y),{},{type:"start"})),_=Cc(me(me({},y),{},{type:"end"}));u="M".concat(m.leftX," ").concat(m.leftY,`
L`).concat(m.rightX," ").concat(m.rightY,`
L`).concat(_.rightX," ").concat(_.rightY,`
L`).concat(_.leftX," ").concat(_.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,m=c.offset,_=gi(p),A=gi(y),N=pn(_,m),U=pn(A,m);return{sNext:Wt(N,_,u),ePre:Wt(U,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]}},la=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,m=jr(u),_=Number.MAX_SAFE_INTEGER,A=[],N=0;N<m.length;N++)A.push({start:m[N],end:m[(N+1)%m.length]});if(A.forEach((function(ue){var Ce=ue.start,Ve=ue.end;if(Ce.x===Ve.x){var qe={x:Ce.x,y};if(Ra(qe,Ce,Ve)){var Ot=Math.abs(Ce.x-p);Ot<_&&(_=Ot,d=qe)}}else if(Ce.y===Ve.y){var xt={x:p,y:Ce.y};if(Ra(xt,Ce,Ve)){var Ft=Math.abs(Ce.y-y);Ft<_&&(_=Ft,d=xt)}}})),!d){var U=A[0],H=U.start,oe=U.end;d={x:H.x+(oe.x-H.x)/2,y:H.y+(oe.y-H.y)/2}}return d},cr=function(c){return cl(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 m=u(d,p,y);return m?typeof m=="string"?Object.assign({},y,{type:m}):Object.assign({type:m},y):{type:c.edgeType}}}r(208);var fi=function(){};function $l(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 Te=(function(){function c(p){var y=this,m=p.onDragStart,_=m===void 0?fi:m,A=p.onDragging,N=A===void 0?fi:A,U=p.onDragEnd,H=U===void 0?fi:U,oe=p.eventType,ue=oe===void 0?"":oe,Ce=p.eventCenter,Ve=Ce===void 0?null:Ce,qe=p.step,Ot=qe===void 0?1:qe,xt=p.isStopPropagation,Ft=xt===void 0||xt,hn=p.model,Hn=hn===void 0?null:hn,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,ga=(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||ga}),y.onDragStart({event:Vn})),y.isDragging=!0,Promise.resolve().then((function(){var ya,Cs;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||ga}),(Cs=y.eventCenter)===null||Cs===void 0||Cs.emit(ur["".concat(y.eventType,"_DRAG")],{e:Vn,data:y.data||ga})}))}})),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=_,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}}])&&$l(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=Ge();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=Ge()?Reflect.construct:function(p,y,m){var _=[null];_.push.apply(_,y);var A=new(Function.bind.apply(p,_));return m&&Qe(A,m.prototype),A},Xe.apply(null,arguments)}function Ge(){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,m){var _;return _t(this,d),Ue(tt(_=u.call(this,3)),"x",void 0),Ue(tt(_),"y",void 0),Ue(tt(_),"z",void 0),_[0]=p,_[1]=y,_[2]=m,_.x=p,_.y=y,_.z=m,Object.setPrototypeOf(tt(_),d.prototype),_}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 g((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 g((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,m){var _;return _t(this,d),_=u.call(this,p,y,m??0),Object.setPrototypeOf(tt(_),d.prototype),_}return Gr(d,[{key:"toString",value:function(){return"Vector"}},{key:"dot",value:function(p){var y=this;return p.reduce((function(m,_,A){return m+_*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),m=Math.acos(this.normalize().dot(p.normalize()));return y>=0?m:-m}}]),d})(nt),g=(function(c){xe(d,c);var u=de(d);function d(p,y){var m;return _t(this,d),m=u.call(this,p,y,1),Object.setPrototypeOf(tt(m),d.prototype),m}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 T(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||te(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)||te(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 te(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,m){var _=[null];_.push.apply(_,y);var A=new(Function.bind.apply(p,_));return m&&Tn(A,m.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,zs,uu,Oa,Iu,Nc,Qp,yv,Fu=(function(c){jt(d,c);var u=Vt(d);function d(){var p;Oe(this,d);for(var y=arguments.length,m=new Array(y),_=0;_<y;_++)m[_]=arguments[_];return ir(Yn(p=u.call(this,m.length)),"rows",void 0),ir(Yn(p),"columns",void 0),p.fill(new Array(3)),m.forEach((function(A,N){p[N]=A})),p.columns=m[0].length,p.rows=m.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 m=0;m<this.rows;m++)for(var _=this.getRow(m),A=function(U){var H=p.getColumn(U);y[m][U]=_.reduce((function(oe,ue,Ce){return oe+ue*H[Ce]}),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 g(p[0],p[1])}))}},{key:"toString",value:function(){var p=T(this[0],2),y=p[0],m=p[1],_=T(this[1],2),A=_[0],N=_[1],U=T(this[2],2),H=U[0],oe=U[1];return"matrix(".concat(y," ").concat(m," ").concat(A," ").concat(N," ").concat(H," ").concat(oe,")")}},{key:"translate",value:function(p,y){return this.cross(new eh(p,y))}},{key:"rotate",value:function(p){return this.cross(new Od(p))}},{key:"scale",value:function(p,y){return this.cross(new wy(p,y))}}]),d})(Qn(Array)),Od=(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 m;return Oe(this,d),ir(Yn(m=u.call(this,new ot(p,0,0),new ot(0,y,0),new ot(0,0,1))),"sx",void 0),ir(Yn(m),"sy",void 0),m.sx=p,m.sy=y,Object.setPrototypeOf(Yn(m),d.prototype),m}return et(d,[{key:"inverse",value:function(){return new d(1/this.sx,1/this.sy)}}]),d})(Fu),eh=(function(c){jt(d,c);var u=Vt(d);function d(p,y){var m;return Oe(this,d),ir(Yn(m=u.call(this,new ot(1,0,0),new ot(0,1,0),new ot(p,y,1))),"tx",void 0),ir(Yn(m),"ty",void 0),m.tx=p,m.ty=y,Object.setPrototypeOf(Yn(m),d.prototype),m}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){kc(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 Pc(c){return(function(u){if(Array.isArray(u))return m1(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 m1(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)?m1(c,u):void 0}}function m1(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 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 kc(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var iT,aT=200,sT=(at=(function(){function c(p){(function(Ce,Ve){if(!(Ce instanceof Ve))throw new TypeError("Cannot call a class as a function")})(this,c),kc(this,"rootEl",void 0),Bu(this,"width",Yr,this),Bu(this,"height",Ao,this),kc(this,"theme",void 0),kc(this,"eventCenter",void 0),kc(this,"modelMap",new Map),kc(this,"topElement",void 0),kc(this,"animation",void 0),kc(this,"idGenerator",void 0),kc(this,"edgeGenerator",void 0),kc(this,"nodeMoveRules",[]),kc(this,"customTrajectory",void 0),Bu(this,"edgeType",Mr,this),Bu(this,"nodes",Ur,this),Bu(this,"edges",xa,this),Bu(this,"overlapMode",zs,this),Bu(this,"background",uu,this),Bu(this,"transformModel",Oa,this),Bu(this,"editConfigModel",Iu,this),Bu(this,"gridSize",Nc,this),Bu(this,"partial",Qp,this),Bu(this,"fakerNode",yv,this);var y,m=p.container,_=p.background,A=_===void 0?{}:_,N=p.grid,U=p.idGenerator,H=p.edgeGenerator,oe=p.animation,ue=p.customTrajectory;this.background=A,pb(N)==="object"&&(this.gridSize=N.size),this.rootEl=m,this.editConfigModel=new Mp(p),this.eventCenter=new Bp,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"?yc(Uo(_v),y):Uo(y===!0?Ey:_v),this.partial=p.partial,this.overlapMode=p.overlapMode||0,this.idGenerator=U,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=ts()}var u,d;return u=c,d=[{key:"nodesMap",get:function(){return this.nodes.reduce((function(p,y,m){return p[y.id]={index:m,model:y},p}),{})}},{key:"edgesMap",get:function(){return this.edges.reduce((function(p,y,m){return p[y.id]={index:m,model:y},p}),{})}},{key:"modelsMap",get:function(){return[].concat(Pc(this.nodes),Pc(this.edges)).reduce((function(p,y){return p[y.id]=y,p}),{})}},{key:"sortElements",get:function(){var p=[];this.nodes.forEach((function(U){return p.push(U)})),this.edges.forEach((function(U){return p.push(U)})),p=p.sort((function(U,H){return U.zIndex-H.zIndex}));for(var y=[],m=[-200,-200],_=[this.width+aT,this.height+aT],A=0;A<p.length;A++){var N=p[A];N.visible&&(!this.partial||N.isSelected||this.isElementInArea(N,m,_,!1,!1))&&y.push(N)}return y}},{key:"textEditElement",get:function(){var p=this.nodes.find((function(m){return m.state===Io.TEXT_EDIT})),y=this.edges.find((function(m){return m.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 m=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],_=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],A=arguments.length>4&&arguments[4]!==void 0&&arguments[4],N=[],U=[];this.nodes.forEach((function(ue){return U.push(ue)})),this.edges.forEach((function(ue){return U.push(ue)}));for(var H=0;H<U.length;H++){var oe=U[H];A&&!oe.visible||!this.isElementInArea(oe,p,y,m,_)||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,m=p.y,_=this.rootEl.getBoundingClientRect(),A={x:y-_.left,y:m-_.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,m){var _=!(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=gi(p=p),U=N.minX,H=N.minY,oe=N.maxX,ue=N.maxY,Ce=[{x:U,y:H},{x:oe,y:H},{x:oe,y:ue},{x:U,y:ue}],Ve=A,qe=0;qe<Ce.length;qe++){var Ot=Ce[qe],xt=Ot.x,Ft=Ot.y,hn=this.transformModel.CanvasPointToHtmlPoint([xt,Ft]),Hn=Wf(hn,2);if(xt=Hn[0],Ft=Hn[1],md([xt,Ft],y,m)!==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,m),Co=md(er,y,m);return _?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=Ep(p.nodes,(function(m){return y.getModelAfterSnapToGrid(m)})):this.nodes=[],p.edges?this.edges=Ep(p.edges,(function(m){var _=y.getModel(m.type);if(!_)throw new Error("找不到".concat(m.type,"对应的边。"));return new _(m,y)})):this.edges=[]}},{key:"modelToGraphData",value:function(){var p=[];this.edges.forEach((function(m){var _=m.getData();_&&!m.virtual&&p.push(_)}));var y=[];return this.nodes.forEach((function(m){var _=m.getData();_&&!m.virtual&&y.push(_)})),{nodes:y,edges:p}}},{key:"modelToHistoryData",value:function(){for(var p=!1,y=[],m=0;m<this.nodes.length;m++){var _=this.nodes[m];if(_.isDragging){p=!0;break}y.push(_.getHistoryData())}if(p)return!1;for(var A=!1,N=[],U=0;U<this.edges.length;U++){var H=this.edges[U];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=[],m=0;m<this.edges.length;m++){var _=this.edges[m],A=this.edges[m].sourceNodeId===p,N=this.edges[m].targetNodeId===p;(A||N)&&y.push(_)}return y}},{key:"getSelectElements",value:function(){var p=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],y=this.selectElements,m={nodes:[],edges:[]};return y.forEach((function(_){if(_.BaseType===ei.NODE&&m.nodes.push(_.getData()),_.BaseType===ei.EDGE){var A=_.getData(),N=y.get(A.sourceNodeId)&&y.get(A.targetNodeId);(p||N)&&m.edges.push(A)}})),m}},{key:"updateAttributes",value:function(p,y){this.getElement(p).updateAttributes(y)}},{key:"changeNodeId",value:function(p,y){return y||(y=ts()),this.nodesMap[y]?"":this.nodesMap[p]?(this.edges.forEach((function(m){m.sourceNodeId===p&&(m.sourceNodeId=y),m.targetNodeId===p&&(m.targetNodeId=y)})),this.nodesMap[p].model.id=y,this.nodesMap[y]=this.nodesMap[p],y):""}},{key:"changeEdgeId",value:function(p,y){return y||(y=ts()),this.edgesMap[y]?"":this.edgesMap[p]?(this.edges.forEach((function(m){m.id===p&&m.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,m,_,A=((y=this.nodesMap[p])===null||y===void 0?void 0:y.model)||((m=this.edgesMap[p])===null||m===void 0?void 0:m.model);A&&(this.overlapMode===Ei.DEFAULT&&((_=this.topElement)===null||_===void 0||_.setZIndex(),A.setZIndex(9999),this.topElement=A),this.overlapMode===Ei.INCREASE&&this.setElementZIndex(p,"top"))}},{key:"setElementZIndex",value:function(p,y){var m,_,A,N=((m=this.nodesMap[p])===null||m===void 0?void 0:m.model)||((_=this.edgesMap[p])===null||_===void 0?void 0:_.model);N&&(typeof y=="number"&&(A=y),y==="top"&&(A=Ac()),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,m=arguments.length>2?arguments[2]:void 0,_=ma(p);_.id&&this.nodesMap[p.id]&&delete _.id;var A=this.getModelAfterSnapToGrid(_);this.nodes.push(A);var N=A.getData(),U={data:N};return m&&(U.e=m),this.eventCenter.emit(y,U),A}},{key:"getModelAfterSnapToGrid",value:function(p){var y=this.getModel(p.type);if(!y)throw new Error("找不到".concat(p.type,"对应的节点,请确认是否已注册此类型节点。"));var m=p.x,_=p.y;return m&&_&&(p.x=fl(m,this.gridSize),p.y=fl(_,this.gridSize),pb(p.text)==="object"&&(p.text.x+=p.x-m,p.text.y+=p.y-_)),new y(p,this)}},{key:"cloneNode",value:function(p){var y=this.getNodeModelById(p),m=y.getData();m.x+=30,m.y+=30,delete m.id,m.text&&(m.text.x+=30,m.text.y+=30);var _=this.addNode(m);return _.setSelected(!0),y.setSelected(!1),_.getData()}},{key:"moveNode",value:function(p,y,m){var _=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,U=N.getMoveDistance(y,m,_),H=Wf(U,2);y=H[0],m=H[1],this.moveEdge(p,y,m)}}},{key:"moveNode2Coordinate",value:function(p,y,m){var _=arguments.length>3&&arguments[3]!==void 0&&arguments[3],A=this.nodesMap[p];if(A){var N=A.model,U=N.x,H=N.y,oe=y-U,ue=m-H;this.moveNode(p,oe,ue,_)}}},{key:"editText",value:function(p){this.setElementStateById(p,Io.TEXT_EDIT)}},{key:"addEdge",value:function(p){var y=ma(p),m=y.type;m||(m=this.edgeType),y.id&&this.edgesMap[y.id]&&delete y.id;var _=this.getModel(m);if(!_)throw new Error("找不到".concat(m,"对应的边,请确认是否已注册此类型边。"));var A=new _(Vf(Vf({},y),{},{type:m}),this),N=A.getData();return this.edges.push(A),this.eventCenter.emit(ur.EDGE_ADD,{data:N}),A}},{key:"moveEdge",value:function(p,y,m){for(var _=0;_<this.edges.length;_++){var A=this.edges[_],N=A.textPosition,U=N.x,H=N.y,oe=this.edges[_].sourceNodeId===p,ue=this.edges[_].targetNodeId===p;oe&&A.moveStartPoint(y,m),ue&&A.moveEndPoint(y,m),(oe||ue)&&this.handleEdgeTextMove(A,U,H)}}},{key:"handleEdgeTextMove",value:function(p,y,m){var _;if(p.customTextPosition===!0)p.resetTextPosition();else if(p.modelType===so.POLYLINE_EDGE&&(_=p.text)!==null&&_!==void 0&&_.value){var A=p.text,N=co(A,p.points);p.moveText(N.x-A.x,N.y-A.y)}else{var U=p.textPosition,H=U.x,oe=U.y;p.moveText(H-y,oe-m)}}},{key:"deleteEdgeBySourceAndTarget",value:function(p,y){for(var m=0;m<this.edges.length;m++)if(this.edges[m].sourceNodeId===p&&this.edges[m].targetNodeId===y){var _=this.edges[m].getData();this.edges.splice(m,1),m--,this.eventCenter.emit(ur.EDGE_DELETE,{data:_})}}},{key:"deleteEdgeById",value:function(p){if(this.edgesMap[p]){var y=this.edgesMap[p].index,m=this.edgesMap[p].model.getData();this.edges.splice(y,1),this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeBySource",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].sourceNodeId===p){var m=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"deleteEdgeByTarget",value:function(p){for(var y=0;y<this.edges.length;y++)if(this.edges[y].targetNodeId===p){var m=this.edges[y].getData();this.edges.splice(y,1),y--,this.eventCenter.emit(ur.EDGE_DELETE,{data:m})}}},{key:"setElementStateById",value:function(p,y,m){this.nodes.forEach((function(_){_.id===p?_.setElementState(y,m):_.setElementState(Io.DEFAULT)})),this.edges.forEach((function(_){_.id===p?_.setElementState(y,m):_.setElementState(Io.DEFAULT)}))}},{key:"updateText",value:function(p,y){this.nodes.forEach((function(m){m.id===p&&m.updateText(y)})),this.edges.forEach((function(m){m.id===p&&m.updateText(y)}))}},{key:"selectNodeById",value:function(p){var y,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];m||this.clearSelectElements();var _=(y=this.nodesMap[p])===null||y===void 0?void 0:y.model;_==null||_.setSelected(!0)}},{key:"selectEdgeById",value:function(p){var y,m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];m||this.clearSelectElements();var _=(y=this.edgesMap[p])===null||y===void 0?void 0:y.model;_==null||_.setSelected(!0)}},{key:"selectElementById",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0&&arguments[1];y||this.clearSelectElements();var m=this.getElement(p);m==null||m.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,m){for(var _=this,A=arguments.length>3&&arguments[3]!==void 0&&arguments[3],N=p.reduce((function(zn,Ar){var Vn=_.nodesMap[Ar].model.getMoveDistance(y,m,A);return zn[Ar]=Vn,zn}),{}),U=0;U<this.edges.length;U++){var H=this.edges[U],oe=H.textPosition,ue=oe.x,Ce=oe.y,Ve=N[H.sourceNodeId],qe=N[H.targetNodeId],Ot=void 0,xt=void 0;if(Ve&&qe&&H.modelType===so.POLYLINE_EDGE){var Ft=Wf(Ve,2);Ot=Ft[0],xt=Ft[1],H.updatePointsList(Ot,xt)}else{if(Ve){var hn=Wf(Ve,2);Ot=hn[0],xt=hn[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,Ce)}}},{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 m=this.getNodeModelById(p);if(m){var _=m.getData();_.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));var N=new A(_,this);this.nodes.splice(this.nodesMap[p].index,1,N),this.getNodeEdges(p).forEach((function(U){if(U.sourceNodeId===p){var H=Rf(N,U.startPoint,N.width,N.height);U.updateStartPoint(H)}if(U.targetNodeId===p){var oe=Rf(N,U.endPoint,N.width,N.height);U.updateEndPoint(oe)}}))}}},{key:"changeEdgeType",value:function(p,y){var m=this.getEdgeModelById(p);if(m&&m.type!==y){var _=m.getData();_.type=y;var A=this.getModel(y);if(!A)throw new Error("找不到".concat(y,"对应的节点,请确认是否已注册此类型节点。"));delete _.pointsList;var N=new A(_,this);this.edges.splice(this.edgesMap[p].index,1,N)}}},{key:"getNodeIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.targetNodeId===p&&y.push(m)})),y}},{key:"getNodeOutgoingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.sourceNodeId===p&&y.push(m)})),y}},{key:"getAnchorIncomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.targetAnchorId===p&&y.push(m)})),y}},{key:"getAnchorOutcomingEdge",value:function(p){var y=[];return this.edges.forEach((function(m){m.sourceAnchorId===p&&y.push(m)})),y}},{key:"getNodeIncomingNode",value:function(p){var y=this,m=[];return this.edges.forEach((function(_){_.targetNodeId===p&&m.push(y.nodesMap[_.sourceNodeId].model)})),m}},{key:"getNodeOutgoingNode",value:function(p){var y=this,m=[];return this.edges.forEach((function(_){_.sourceNodeId===p&&m.push(y.nodesMap[_.targetNodeId].model)})),m}},{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=[],m=[];p.forEach((function(oe){var ue=oe.x,Ce=oe.y,Ve=oe.width,qe=oe.height,Ot=oe.getNodeStyle().strokeWidth,xt=Ot===void 0?0:Ot,Ft=ue+Ve/2+xt,hn=ue-Ve/2-xt,Hn=Ce+qe/2+xt,zn=Ce-qe/2-xt;y=y.concat([Ft,hn].filter((function(Ar){return!Number.isNaN(Ar)}))),m=m.concat([Hn,zn].filter((function(Ar){return!Number.isNaN(Ar)})))}));var _=Math.min.apply(Math,Pc(y)),A=Math.max.apply(Math,Pc(y)),N=Math.min.apply(Math,Pc(m)),U=A-_||0,H=Math.max.apply(Math,Pc(m))-N||0;return{virtualRectWidth:U,virtualRectHeight:H,virtualRectCenterPositionX:_+U/2,virtualRectCenterPositionY:N+H/2}}},{key:"translateCenter",value:function(){var p=this.nodes,y=this.width,m=this.height,_=this.rootEl,A=this.transformModel;if(p.length){var N=y||_.clientWidth,U=m||_.clientHeight,H=this.getVirtualRectSize(),oe=H.virtualRectCenterPositionX,ue=H.virtualRectCenterPositionY;A.focusOn(oe,ue,N,U)}}},{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,m=this.nodes,_=this.width,A=this.height,N=this.rootEl,U=this.transformModel;if(m.length){var H=_||N.clientWidth,oe=A||N.clientHeight,ue=this.getVirtualRectSize(),Ce=ue.virtualRectWidth,Ve=ue.virtualRectHeight,qe=ue.virtualRectCenterPositionX,Ot=ue.virtualRectCenterPositionY,xt=(Ce+y)/H,Ft=(Ve+p)/oe,hn=0;hn=1/Math.max(xt,Ft);var Hn=[H/2,oe/2];U.zoom(hn,Hn),U.focusOn(qe,Ot,H,oe)}}},{key:"openEdgeAnimation",value:function(p){this.getEdgeModelById(p).openEdgeAnimation()}},{key:"closeEdgeAnimation",value:function(p){this.getEdgeModelById(p).closeEdgeAnimation()}}],d&&h5(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[]}}),zs=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}),Nc=Tr(at.prototype,"gridSize",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),Qp=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),v5=sT;function g1(c){return g1=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},g1(c)}function y1(){return y1=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},y1.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 _1(c,u){return _1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},_1(c,u)}function g5(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 y5(this,d)}}function y5(c,u){if(u&&(g1(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sd(c)}function Sd(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 lT,_5=Lc(iT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&_1(m,_)})(y,c);var u,d,p=g5(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Gf(Sd(_=p.call(this)),"stepDrag",void 0),Gf(Sd(_),"stepScrollX",0),Gf(Sd(_),"stepScrollY",0),Gf(Sd(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY;_.setState({isDragging:!0});var Ce=_.props.graphModel,Ve=Ce.transformModel;Ce.editConfigModel.stopMoveGraph!==!0&&Ve.translate(oe,ue)})),Gf(Sd(_),"onDragEnd",(function(){_.setState({isDragging:!1})})),Gf(Sd(_),"zoomHandler",(function(H){var oe=_.props,ue=oe.graphModel,Ce=ue.editConfigModel,Ve=ue.transformModel,qe=ue.gridSize,Ot=oe.graphModel,xt=H.deltaX,Ft=H.deltaY;if(Ce.stopScrollGraph||H.ctrlKey===!0){if(!Ce.stopZoomGraph){H.preventDefault();var hn=Ot.getPointByClient({x:H.clientX,y:H.clientY}).canvasOverlayPosition,Hn=hn.x,zn=hn.y;Ve.zoom(H.deltaY<0,[Hn,zn])}}else{if(H.preventDefault(),_.stepScrollX+=xt,_.stepScrollY+=Ft,Math.abs(_.stepScrollX)>=qe){var Ar=_.stepScrollX%qe,Vn=_.stepScrollX-Ar;Ve.translate(-Vn*Ve.SCALE_X,0),_.stepScrollX=Ar}if(Math.abs(_.stepScrollY)>=qe){var vr=_.stepScrollY%qe,er=_.stepScrollY-vr;Ve.translate(0,-er*Ve.SCALE_Y),_.stepScrollY=vr}}})),Gf(Sd(_),"clickHandler",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){var oe=_.props.graphModel;oe.selectElements.size>0&&oe.clearSelectElements(),oe.eventCenter.emit(ur.BLANK_CLICK,{e:H})}})),Gf(Sd(_),"handleContextMenu",(function(H){if(H.target.getAttribute("name")==="canvas-overlay"){H.preventDefault();var oe=_.props.graphModel,ue=oe.getPointByClient({x:H.clientX,y:H.clientY});oe.eventCenter.emit(ur.BLANK_CONTEXTMENU,{e:H,position:ue})}})),Gf(Sd(_),"mouseDownHandler",(function(H){var oe=_.props.graphModel,ue=oe.eventCenter,Ce=oe.editConfigModel,Ve=oe.transformModel.SCALE_X,qe=oe.gridSize,Ot=H.target,xt=!Ce.adjustEdge&&!Ce.adjustNodePosition;(Ot.getAttribute("name")==="canvas-overlay"||xt)&&(Ce.stopMoveGraph!==!0?(_.stepDrag.setStep(qe*Ve),_.stepDrag.handleMouseDown(H)):ue.emit(ur.BLANK_MOUSEDOWN,{e:H}),_.clickHandler(H))}));var A=m.graphModel,N=A.gridSize,U=A.eventCenter;return _.stepDrag=new Te({onDragging:_.onDragging,onDragEnd:_.onDragEnd,step:N,eventType:"BLANK",isStopPropagation:!1,eventCenter:U,model:null}),_.state={isDragging:!1},_}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel.transformModel.getTransformStyle().transform,_=this.props,A=_.children,N=_.dnd,U=this.state.isDragging;return Object(re.g)("svg",y1({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:U?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},N.eventMap()),Object(re.g)("g",{transform:m},A))}}])&&m5(u.prototype,d),y})(re.a))||iT;function b1(c){return b1=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},b1(c)}function b5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function w5(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 w1(c,u){return w1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},w1(c,u)}function E5(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 x5(this,d)}}function x5(c,u){if(u&&(b1(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 O5=Lc(lT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&w1(m,_)})(y,c);var u,d,p=E5(y);function y(){return b5(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 m=this.props,_=m.tool,A=m.graphModel,N=_.getTools().map((function(U){return Object(re.g)(U,{graphModel:A,logicFlow:_.instance})}));return _.components=N,N}},{key:"triggerToolRender",value:function(){var m=this.props,_=m.tool,A=m.graphModel,N=document.querySelector("#ToolOverlay_".concat(A.flowId)),U=_.getInstance();U.components.forEach((function(H){return H(U,N)})),U.components=[]}},{key:"render",value:function(){var m=this.props.graphModel;return Object(re.g)("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(m.flowId)},this.getTools())}}])&&w5(u.prototype,d),y})(re.a))||lT;function E1(c){return E1=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},E1(c)}function S5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function A5(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 x1(c,u){return x1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},x1(c,u)}function M5(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 T5(this,d)}}function T5(c,u){if(u&&(E1(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 mb(c){return mb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},mb(c)}var uT,C5=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&x1(m,_)})(y,c);var u,d,p=M5(y);function y(){return S5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.background;return Object(re.g)("div",{className:"lf-background"},Object(re.g)("div",{style:m,className:"lf-background-area"}))}}])&&A5(u.prototype,d),y})(re.a);function O1(c){return O1=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},O1(c)}function N5(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 S1(c,u){return S1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},S1(c,u)}function k5(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 R5(this,d)}}function R5(c,u){if(u&&(O1(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cT(c)}function cT(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function gb(c){return gb=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},gb(c)}function D5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var dT=Lc(uT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&S1(m,_)})(y,c);var u,d,p=k5(y);function y(){var m;N5(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return D5(cT(m=p.call.apply(p,[this].concat(A))),"id",ts()),m}return u=y,(d=[{key:"renderDot",value:function(){var m=this.props,_=m.config,A=_.color,N=_.thickness,U=N===void 0?2:N,H=m.size,oe=m.visible,ue=Math.min(Math.max(2,U),H/2),Ce=1;return oe||(Ce=0),Object(re.g)("rect",{width:ue,height:ue,rx:ue/2,ry:ue/2,fill:A,opacity:Ce})}},{key:"renderMesh",value:function(){var m=this.props,_=m.config,A=_.color,N=_.thickness,U=N===void 0?1:N,H=m.size,oe=m.visible,ue=Math.min(Math.max(1,U),H/2),Ce="M ".concat(H," 0 H0 M0 0 V0 ").concat(H),Ve=1;return oe||(Ve=0),Object(re.g)("path",{d:Ce,stroke:A,strokeWidth:ue,opacity:Ve})}},{key:"render",value:function(){var m=this.props,_=m.type,A=m.size,N=m.graphModel.transformModel,U=[N.SCALE_X,N.SKEW_Y,N.SKEW_X,N.SCALE_Y,N.TRANSLATE_X,N.TRANSLATE_Y].join(","),H="matrix(".concat(U,")");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},_==="dot"&&this.renderDot(),_==="mesh"&&this.renderMesh())),Object(re.g)("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})))}}])&&P5(u.prototype,d),y})(re.a))||uT;dT.defaultProps={size:20,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},r(53);function A1(c){return A1=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},A1(c)}function j5(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return fT(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 fT(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 fT(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 pT,Fm=function(c){var u={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(c).forEach((function(d){var p=j5(d,2),y=p[0],m=p[1];(y==="style"||A1(m)!=="object")&&(u[y]=m)})),Object(re.g)("line",u)};function M1(c){return M1=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},M1(c)}function hT(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?hT(Object(d),!0).forEach((function(p){L5(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function L5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function I5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function F5(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 T1(c,u){return T1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},T1(c,u)}function B5(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 $5(this,d)}}function $5(c,u){if(u&&(M1(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 vT,U5=Lc(pT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&T1(m,_)})(y,c);var u,d,p=B5(y);function y(){return I5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.snaplineModel,_=m.position,A=m.isShowHorizontal,N=m.isShowVertical,U=m.getStyle(),H=_.x,oe=H===void 0?0:H,ue=_.y,Ce=ue===void 0?0:ue,Ve=yb(yb({x1:-1e5,y1:Ce,x2:1e5,y2:Ce},U),{},{stroke:A?U.stroke:"none"}),qe=yb(yb({x1:oe,y1:-1e5,x2:oe,y2:1e5},U),{},{stroke:N?U.stroke:"none"});return Object(re.g)("g",{className:"lf-snapline"},Object(re.g)(Fm,Ve),Object(re.g)(Fm,qe))}}])&&F5(u.prototype,d),y})(re.a))||pT;function C1(c){return C1=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},C1(c)}function V5(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return mT(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 mT(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 mT(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 th(c){var u=c.x,d=c.y,p=c.width,y=c.height,m=c.className,_=c.radius,A=u-p/2,N=d-y/2,U={};return Object.entries(c).forEach((function(H){var oe=V5(H,2),ue=oe[0],Ce=oe[1];C1(Ce)!=="object"&&(U[ue]=Ce)})),U.className=m?"lf-basic-shape ".concat(m):"lf-basic-shape",_&&(U.rx=_,U.ry=_),U.x=A,U.y=N,Object(re.g)("rect",U)}function N1(c){return N1=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},N1(c)}function Bm(){return Bm=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},Bm.apply(this,arguments)}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 yT(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){W5(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 W5(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function G5(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function z5(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 P1(c,u){return P1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},P1(c,u)}function H5(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 X5(this,d)}}function X5(c,u){if(u&&(N1(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)}th.defaultProps={className:"",radius:""};var _T,Y5=Lc(vT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&P1(m,_)})(y,c);var u,d,p=H5(y);function y(){return G5(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getNodesOutline",value:function(){var m=this.props.graphModel,_=m.nodes,A=m.editConfigModel,N=A.hoverOutline,U=A.nodeSelectedOutline,H=[];return _.forEach((function(oe){if(oe.isHovered||oe.isSelected){var ue=oe.isHovered,Ce=oe.isSelected,Ve=oe.x,qe=oe.y,Ot=oe.width,xt=oe.height;if(U&&Ce||N&&ue){var Ft=oe.getOutlineStyle(),hn={};if(Object.keys(Ft).forEach((function(zn){zn!=="hover"&&(hn[zn]=Ft[zn])})),ue){var Hn=Ft.hover;hn=yT(yT({},hn),Hn)}H.push(Object(re.g)(th,Bm({transform:oe.transform,className:"lf-outline-node",x:Ve,y:qe,width:Ot+10,height:xt+10},hn)))}}})),H}},{key:"getEdgeOutline",value:function(){for(var m=this.props.graphModel,_=m.edges,A=m.editConfigModel,N=A.edgeSelectedOutline,U=A.hoverOutline,H=[],oe=0;oe<_.length;oe++){var ue=_[oe];(N&&ue.isSelected||U&&ue.isHovered)&&(ue.modelType===so.LINE_EDGE?H.push(this.getLineOutline(ue)):ue.modelType===so.POLYLINE_EDGE?H.push(this.getPolylineOutline(ue)):ue.modelType===so.BEZIER_EDGE&&H.push(this.getBezierOutline(ue)))}return H}},{key:"getLineOutline",value:function(m){var _=m.startPoint,A=m.endPoint,N=(_.x+A.x)/2,U=(_.y+A.y)/2,H=Math.abs(_.x-A.x)+10,oe=Math.abs(_.y-A.y)+10,ue=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline-edge",x:N,y:U,width:H,height:oe},ue))}},{key:"getPolylineOutline",value:function(m){var _=m.points,A=jr(_),N=St(A,8),U=N.x,H=N.y,oe=N.width,ue=N.height,Ce=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline",x:U,y:H,width:oe,height:ue},Ce))}},{key:"getBezierOutline",value:function(m){var _=m.path,A=di(_),N=St(A,8),U=N.x,H=N.y,oe=N.width,ue=N.height,Ce=m.getOutlineStyle();return Object(re.g)(th,Bm({className:"lf-outline",x:U,y:H,width:oe,height:ue},Ce))}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-outline"},this.getNodesOutline(),this.getEdgeOutline())}}])&&z5(u.prototype,d),y})(re.a))||vT;function k1(c){return k1=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},k1(c)}function q5(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return bT(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 bT(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 bT(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 $m(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.r,_=m===void 0?4:m,A=c.className,N={cx:d,cy:y,r:_,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(U){var H=q5(U,2),oe=H[0],ue=H[1];k1(ue)!=="object"&&(N[oe]=ue)})),N.className=A?"lf-basic-shape ".concat(A):"lf-basic-shape",Object(re.g)("circle",N)}function R1(c){return R1=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},R1(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return wT(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 wT(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 wT(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 ET(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Z5(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 xT(c,u,d){return u&&Z5(c.prototype,u),c}function OT(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&&D1(c,u)}function D1(c,u){return D1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},D1(c,u)}function ST(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 J5(this,d)}}function J5(c,u){if(u&&(R1(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 j1(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,MT=(function(c){OT(d,c);var u=ST(d);function d(){var p;return ET(this,d),j1(wb(p=u.call(this)),"dragHandler",void 0),j1(wb(p),"onDragging",(function(y){var m=y.event,_=p.props,A=_.graphModel,N=_.bezierModel,U=_.type,H=A.getPointByClient({x:m.clientX,y:m.clientY}).canvasOverlayPosition,oe=H.x,ue=H.y;N.updateAdjustAnchor({x:oe,y:ue},U),A.eventCenter.emit(ur.EDGE_ADJUST,{data:N.getData()})})),j1(wb(p),"onDragEnd",(function(){p.props.bezierModel.isDragging=!1})),p.dragHandler=new Te({onDragging:p.onDragging,onDragEnd:p.onDragEnd}),p}return xT(d,[{key:"render",value:function(){var p=this,y=this.props.position,m=y.x,_=y.y,A=this.props.bezierModel.getEdgeStyle().adjustAnchor;return Object(re.g)($m,xy({className:"lf-bezier-adjust-anchor",x:m,y:_},A,{onMouseDown:function(N){p.dragHandler.handleMouseDown(N)}}))}}]),d})(re.a),Q5=Lc(_T=(function(c){OT(d,c);var u=ST(d);function d(){return ET(this,d),u.apply(this,arguments)}return xT(d,[{key:"getBezierAdjust",value:function(p,y){var m=p.path,_=p.id,A=K5(di(m),4),N=A[0],U=A[1],H=A[2],oe=A[3],ue=p.getEdgeStyle().adjustLine,Ce=[];return Ce.push(Object(re.g)(Fm,xy({x1:N.x,y1:N.y,x2:U.x,y2:U.y},ue))),Ce.push(Object(re.g)(MT,{position:U,bezierModel:p,graphModel:y,key:"".concat(_,"_ePre"),type:"sNext"})),Ce.push(Object(re.g)(Fm,xy({x1:oe.x,y1:oe.y,x2:H.x,y2:H.y},ue))),Ce.push(Object(re.g)(MT,{position:H,bezierModel:p,graphModel:y,key:"".concat(_,"_sNext"),type:"ePre"})),Ce}},{key:"selectedBezierEdge",value:function(){for(var p=this.props.graphModel,y=p.edges,m=[],_=0;_<y.length;_++){var A=y[_];A.isSelected&&A.modelType===so.BEZIER_EDGE&&A.draggable&&m.push(this.getBezierAdjust(A,p))}return m}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-bezier-adjust"},this.selectedBezierEdge())}}]),d})(re.a))||_T;function L1(c){return L1=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},L1(c)}function e6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function t6(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 I1(c,u){return I1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},I1(c,u)}function n6(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 r6(this,d)}}function r6(c,u){if(u&&(L1(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 TT,o6=Lc(AT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&I1(m,_)})(y,c);var u,d,p=n6(y);function y(){return e6(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel.transformModel.getTransformStyle().transform,_=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:m},_))}}])&&t6(u.prototype,d),y})(re.a))||AT;function F1(c){return F1=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},F1(c)}function B1(){return B1=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},B1.apply(this,arguments)}function i6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function a6(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 $1(c,u){return $1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},$1(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 l6(this,d)}}function l6(c,u){if(u&&(F1(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 u6=Lc(TT=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&$1(m,_)})(y,c);var u,d,p=s6(y);function y(){return i6(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getComponent",value:function(m,_){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"canvas-overlay",N=this.props.getView,U=N(m.type);return Object(re.g)(U,{key:m.id,model:m,graphModel:_,overlay:A})}},{key:"render",value:function(){var m=this,_=this.props,A=_.graphModel,N=_.tool,U=_.options,H=_.dnd,oe=_.snaplineModel,ue={};U.width&&(ue.width="".concat(A.width,"px")),U.height&&(ue.height="".concat(A.height,"px"));var Ce=U.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)(_5,{graphModel:A,dnd:H},Object(re.g)("g",{className:"lf-base"},Ep(A.sortElements,(function(Ot){return m.getComponent(Ot,A)}))),Ve?this.getComponent(Ve,A):""),Object(re.g)(o6,{graphModel:A},Object(re.g)(Y5,{graphModel:A}),qe?Object(re.g)(Q5,{graphModel:A}):"",U.snapline!==!1?Object(re.g)(U5,{snaplineModel:oe}):""),Object(re.g)(O5,{graphModel:A,tool:N}),U.background&&Object(re.g)(C5,{background:U.background}),U.grid&&Object(re.g)(dT,B1({},Ce,{graphModel:A})))}}],d&&a6(u.prototype,d),y})(re.a))||TT,c6=u6;function CT(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?CT(Object(d),!0).forEach((function(p){zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):CT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function d6(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 f6=(function(){function c(p){var y=this;(function(_,A){if(!(_ 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(_){y.nodeConfig&&!y.fakerNode&&(y.fakerNode=y.lf.createFakerNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:_.clientX,y:_.clientY}))))})),zf(this,"onDragOver",(function(_){if(_.preventDefault(),y.fakerNode){var A=y.clientToLocalPoint({x:_.clientX,y:_.clientY}),N=A.x,U=A.y;y.fakerNode.moveTo(N,U);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(_){y.lf.graphModel&&_&&y.nodeConfig&&(y.lf.addNode(Sb(Sb({},y.nodeConfig),y.clientToLocalPoint({x:_.clientX,y:_.clientY})),ur.NODE_DND_ADD,_),_.preventDefault(),_.stopPropagation(),y.nodeConfig=null,y.lf.removeNodeSnapLine(),y.lf.graphModel.removeFakerNode(),y.fakerNode=null)}));var m=p.lf;this.lf=m}var u,d;return u=c,(d=[{key:"clientToLocalPoint",value:function(p){var y=p.x,m=p.y,_=sc(this.lf.options,["grid","size"]),A=this.lf.graphModel.getPointByClient({x:y,y:m}).canvasOverlayPosition,N=A.x,U=A.y;return{x:fl(N,_),y:fl(U,_)}}},{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}}}])&&d6(u.prototype,d),c})();function NT(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=yc({size:20,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}},d)),yc({},kT,c)}var Zo,PT,kT={background:!1,grid:!1,textEdit:!0,disabledTools:[]};function U1(c){return U1=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},U1(c)}function V1(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return RT(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 RT(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 RT(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 DT(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?DT(Object(d),!0).forEach((function(p){jT(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):DT(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function p6(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 v6(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=nh(c))!==null;);return c}function W1(c,u){return W1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},W1(c,u)}function g6(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=nh(c);if(u){var y=nh(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return y6(this,d)}}function y6(c,u){if(u&&(U1(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 nh(c){return nh=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},nh(c)}function jT(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Rc(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var G1=(Zo=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&W1(m,_)})(y,c);var u,d,p=g6(y);function y(){var m;h6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return jT(Mb(m=p.call.apply(p,[this].concat(A))),"modelType",so.BEZIER_EDGE),p6(Mb(m),"path",PT,Mb(m)),m}return u=y,(d=[{key:"initEdgeData",value:function(m){this.offset=100,Oy(nh(y.prototype),"initEdgeData",this).call(this,m)}},{key:"getEdgeStyle",value:function(){var m=this.graphModel.theme.bezier;return Ab(Ab({},Oy(nh(y.prototype),"getEdgeStyle",this).call(this)),Uo(m))}},{key:"getTextPosition",value:function(){if(this.pointsList&&this.pointsList.length>0){var m=0,_=0;return this.pointsList.forEach((function(A){var N=A.x,U=A.y;m+=N,_+=U})),{x:m/this.pointsList.length,y:_/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 m=Oy(nh(y.prototype),"getData",this).call(this),_=this.pointsList.map((function(A){return{x:A.x,y:A.y}}));return Ab(Ab({},m),{},{pointsList:_})}},{key:"getControls",value:function(){var m=this.startPoint,_=this.endPoint;return zi({start:m,end:_,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})}},{key:"getPath",value:function(m){var _=V1(m,4),A=_[0],N=_[1],U=_[2],H=_[3];return"M ".concat(A.x," ").concat(A.y,`
C `).concat(N.x," ").concat(N.y,`,
`).concat(U.x," ").concat(U.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 m=this.getControls(),_=m.sNext,A=m.ePre;this.updatePath(_,A)}},{key:"updatePath",value:function(m,_){m=Uo(m),_=Uo(_);var A={x:this.startPoint.x,y:this.startPoint.y},N={x:this.endPoint.x,y:this.endPoint.y};if(!m||!_){var U=this.getControls();m=U.sNext,_=U.ePre}this.pointsList=[A,m,_,N],this.path=this.getPath(this.pointsList)}},{key:"updateStartPoint",value:function(m){this.startPoint=Object.assign({},m),this.updatePoints()}},{key:"updateEndPoint",value:function(m){this.endPoint=Object.assign({},m),this.updatePoints()}},{key:"moveStartPoint",value:function(m,_){this.startPoint.x+=m,this.startPoint.y+=_;var A=V1(this.pointsList,3),N=A[1],U=A[2];N.x+=m,N.y+=_,this.updatePath(N,U)}},{key:"moveEndPoint",value:function(m,_){this.endPoint.x+=m,this.endPoint.y+=_;var A=V1(this.pointsList,3),N=A[1],U=A[2];U.x+=m,U.y+=_,this.updatePath(N,U)}},{key:"updateAdjustAnchor",value:function(m,_){_==="sNext"?this.pointsList[1]=m:_==="ePre"&&(this.pointsList[2]=m),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 m=this.pointsList;return m[m.length-1]||this.endPoint}},{key:"updateAfterAdjustStartAndEnd",value:function(m){var _=m.startPoint,A=m.endPoint,N=m.sourceNode,U=m.targetNode,H=zi({start:_,end:A,sourceNode:N,targetNode:U,offset:this.offset}),oe=H.sNext,ue=H.ePre;this.pointsList=[_,oe,ue,A],this.initPoints()}}])&&v6(u.prototype,d),y})(If),PT=Rc(Zo.prototype,"path",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Rc(Zo.prototype,"initPoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"initPoints"),Zo.prototype),Rc(Zo.prototype,"updatePoints",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updatePoints"),Zo.prototype),Rc(Zo.prototype,"updateStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateStartPoint"),Zo.prototype),Rc(Zo.prototype,"updateEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateEndPoint"),Zo.prototype),Rc(Zo.prototype,"moveStartPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveStartPoint"),Zo.prototype),Rc(Zo.prototype,"moveEndPoint",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"moveEndPoint"),Zo.prototype),Rc(Zo.prototype,"updateAdjustAnchor",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAdjustAnchor"),Zo.prototype),Rc(Zo.prototype,"getAdjustStart",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustStart"),Zo.prototype),Rc(Zo.prototype,"getAdjustEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"getAdjustEnd"),Zo.prototype),Rc(Zo.prototype,"updateAfterAdjustStartAndEnd",[a.k],Object.getOwnPropertyDescriptor(Zo.prototype,"updateAfterAdjustStartAndEnd"),Zo.prototype),Zo),Dn,LT,IT,FT,BT,$T,UT,VT,WT,GT,zT,HT,XT,YT,qT,KT,ZT,JT,QT,eC,tC,nC,rC,_6=function(c){return c==null};function b6(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||oC(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 z1(c){return z1=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},z1(c)}function oC(c,u){if(c){if(typeof c=="string")return iC(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)?iC(c,u):void 0}}function iC(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 aC(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 yl(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?aC(Object(d),!0).forEach((function(p){Ul(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):aC(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 w6(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 Ul(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Hf,sC,Xf=(Dn=(function(){function c(p,y){(function(m,_){if(!(m instanceof _))throw new TypeError("Cannot call a class as a function")})(this,c),Ul(this,"id",""),Sa(this,"type",LT,this),Sa(this,"x",IT,this),Sa(this,"y",FT,this),Sa(this,"text",BT,this),Sa(this,"properties",$T,this),Sa(this,"_width",UT,this),Sa(this,"_height",VT,this),Sa(this,"anchorsOffset",WT,this),Sa(this,"isSelected",GT,this),Sa(this,"isHovered",zT,this),Sa(this,"isShowAnchor",HT,this),Sa(this,"isDragging",XT,this),Sa(this,"isHitable",YT,this),Sa(this,"draggable",qT,this),Sa(this,"visible",KT,this),Sa(this,"enableRotate",ZT,this),Ul(this,"virtual",!1),Ul(this,"graphModel",void 0),Sa(this,"zIndex",JT,this),Sa(this,"state",QT,this),Sa(this,"autoToFront",eC,this),Sa(this,"style",tC,this),Sa(this,"transform",nC,this),Sa(this,"_rotate",rC,this),Ul(this,"BaseType",ei.NODE),Ul(this,"modelType",so.NODE),Ul(this,"additionStateData",void 0),Ul(this,"targetRules",[]),Ul(this,"sourceRules",[]),Ul(this,"moveRules",[]),Ul(this,"hasSetTargetRules",!1),Ul(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,m=y===void 0?0:y,_=this.y,A=_===void 0?0:_;this.transform=new eh(-m,-A).rotate(p).translate(m,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,m=y&&y(p.type),_=this.createId();p.id=_||m||ts()}this.formatText(p),ka(this,(function(A){return cl(A,["id","type","x","y","text","properties","virtual","rotate"])})(p)),this.graphModel.overlapMode===Ei.INCREASE&&(this.zIndex=p.zIndex||Ac())}},{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,m=p.y,_=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),_&&(N.text={x:y,y:m,value:_}),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 yl(yl({},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,m,_){var A=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var N,U=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,this,p,y,m,_)){U=!1,N=oe.message;break}}return{isAllPass:U,msg:N}}},{key:"getConnectedSourceRules",value:function(){return this.sourceRules}},{key:"isAllowConnectedAsTarget",value:function(p,y,m,_){var A=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var N,U=!0,H=0;H<A.length;H++){var oe=A[H];if(!oe.validate.call(this,p,this,y,m,_)){U=!1,N=oe.message;break}}return{isAllPass:U,msg:N}}},{key:"isAllowMoveNode",value:function(p,y){var m,_=!0,A=!0,N=(function(oe,ue){var Ce=typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(!Ce){if(Array.isArray(oe)||(Ce=oC(oe))||ue){Ce&&(oe=Ce);var Ve=0,qe=function(){};return{s:qe,n:function(){return Ve>=oe.length?{done:!0}:{done:!1,value:oe[Ve++]}},e:function(hn){throw hn},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(){Ce=Ce.call(oe)},n:function(){var hn=Ce.next();return xt=hn.done,hn},e:function(hn){Ft=!0,Ot=hn},f:function(){try{xt||Ce.return==null||Ce.return()}finally{if(Ft)throw Ot}}}})(this.moveRules.concat(this.graphModel.nodeMoveRules));try{for(N.s();!(m=N.n()).done;){var U=(0,m.value)(this,p,y);if(!U)return!1;if(z1(U)==="object"){var H=U;if(H.x===!1&&H.y===!1)return!1;_=_&&H.x,A=A&&H.y}}}catch(oe){N.e(oe)}finally{N.f()}return{x:_,y:A}}},{key:"getConnectedTargetRules",value:function(){return this.targetRules}},{key:"getAnchorsByOffset",value:function(){var p=this.anchorsOffset,y=this.id,m=this.x,_=this.y;return p&&p.length>0?p.map((function(A,N){return A.length?(A=A,{id:"".concat(y,"_").concat(N),x:m+A[0],y:_+A[1]}):yl(yl({},A=A),{},{x:m+A.x,y:_+A.y,id:A.id||"".concat(y,"_").concat(N)})})):this.getDefaultAnchor()}},{key:"getDefaultAnchor",value:function(){return[]}},{key:"getTargetAnchor",value:function(p){return(function(y,m){for(var _,A=Yp(m),N=Number.MAX_SAFE_INTEGER,U=0;U<A.length;U++){var H=ml(y.x,y.y,A[U].x,A[U].y);H<N&&(N=H,_={index:U,anchor:Fl(Fl({},A[U]),{},{x:A[U].x,y:A[U].y,id:A[U].id})})}return _})(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,m=this.y,_=this.rotate;return p.forEach((function(A){var N=A.x,U=A.y,H=b6(new Fu([N,U,1]).translate(-y,-m).rotate(_).translate(y,m)[0],2),oe=H[0],ue=H[1];A.x=oe,A.y=ue})),p}},{key:"getAnchorInfo",value:function(p){if(!_6(p))for(var y=0;y<this.anchors.length;y++){var m=this.anchors[y];if(m.id===p)return m}}},{key:"addNodeMoveRules",value:function(p){this.moveRules.includes(p)||this.moveRules.push(p)}},{key:"move",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=!1,A=!1;if(m)_=!0,A=!0;else{var N=this.isAllowMoveNode(p,y);typeof N=="boolean"?(_=N,A=N):(_=N.x,A=N.y)}if(_){var U=this.x+p;this.x=U,this.text&&this.moveText(p,0)}if(A){var H=this.y+y;this.y=H,this.text&&this.moveText(0,y)}return _||A}},{key:"getMoveDistance",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=!1,A=!1,N=0,U=0;if(m)_=!0,A=!0;else{var H=this.isAllowMoveNode(p,y);typeof H=="boolean"?(_=H,A=H):(_=H.x,A=H.y)}if(_&&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),U=y}return[N,U]}},{key:"moveTo",value:function(p,y){var m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],_=p-this.x,A=y-this.y;return!(!m&&!this.isAllowMoveNode(_,A)||(this.text&&this.text&&this.moveText(_,A),this.x=p,this.y=y,0))}},{key:"moveText",value:function(p,y){var m=this.text,_=m.x,A=m.y,N=m.value,U=m.draggable,H=m.editable;this.text={value:N,editable:H,draggable:U,x:_+p,y:A+y}}},{key:"updateText",value:function(p){this.text=yl(yl({},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=yl(yl({},Object(a.I)(this.properties)),{},Ul({},p,ma(y))),this.setAttributes()}},{key:"setProperties",value:function(p){this.properties=yl(yl({},Object(a.I)(this.properties)),ma(p)),this.setAttributes()}},{key:"deleteProperty",value:function(p){delete this.properties[p],this.setAttributes()}},{key:"setStyle",value:function(p,y){this.style=yl(yl({},this.style),{},Ul({},p,ma(y)))}},{key:"setStyles",value:function(p){this.style=yl(yl({},this.style),ma(p))}},{key:"updateStyles",value:function(p){this.style=yl({},ma(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){ka(this,p)}}],d&&w6(u.prototype,d),c})(),LT=fo(Dn.prototype,"type",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IT=fo(Dn.prototype,"x",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),FT=fo(Dn.prototype,"y",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),BT=fo(Dn.prototype,"text",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{value:"",x:0,y:0,draggable:!1,editable:!0}}}),$T=fo(Dn.prototype,"properties",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),UT=fo(Dn.prototype,"_width",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 100}}),VT=fo(Dn.prototype,"_height",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 80}}),WT=fo(Dn.prototype,"anchorsOffset",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),GT=fo(Dn.prototype,"isSelected",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),zT=fo(Dn.prototype,"isHovered",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),HT=fo(Dn.prototype,"isShowAnchor",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),XT=fo(Dn.prototype,"isDragging",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),YT=fo(Dn.prototype,"isHitable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),qT=fo(Dn.prototype,"draggable",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),KT=fo(Dn.prototype,"visible",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),ZT=fo(Dn.prototype,"enableRotate",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),JT=fo(Dn.prototype,"zIndex",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),QT=fo(Dn.prototype,"state",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 1}}),eC=fo(Dn.prototype,"autoToFront",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),tC=fo(Dn.prototype,"style",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),nC=fo(Dn.prototype,"transform",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),rC=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 H1(c){return H1=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},H1(c)}function lC(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 uC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?lC(Object(d),!0).forEach((function(p){cC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):lC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function E6(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 x6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function O6(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 X1(){return X1=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=S6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},X1.apply(this,arguments)}function S6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Um(c))!==null;);return c}function Y1(c,u){return Y1=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Y1(c,u)}function A6(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=Um(c);if(u){var y=Um(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return M6(this,d)}}function M6(c,u){if(u&&(H1(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 Um(c){return Um=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Um(c)}function cC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function q1(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Hs,dC,fC,K1=(Hf=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Y1(m,_)})(y,c);var u,d,p=A6(y);function y(){var m;x6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return cC(Tb(m=p.call.apply(p,[this].concat(A))),"modelType",so.CIRCLE_NODE),E6(Tb(m),"r",sC,Tb(m)),m}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 m=X1(Um(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.circle;return uC(uC({},m),Uo(_))}},{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.r;return[{x:m,y:_-A,id:"".concat(this.id,"_0")},{x:m+A,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+A,id:"".concat(this.id,"_2")},{x:m-A,y:_,id:"".concat(this.id,"_3")}]}}])&&O6(u.prototype,d),y})(Xf),sC=q1(Hf.prototype,"r",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),q1(Hf.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"width"),Hf.prototype),q1(Hf.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Hf.prototype,"height"),Hf.prototype),Hf);r(129);function Z1(c){return Z1=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},Z1(c)}function J1(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return pC(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 pC(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 pC(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 hC(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 vC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?hC(Object(d),!0).forEach((function(p){gC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function mC(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 T6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function C6(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 Q1(){return Q1=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=N6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},Q1.apply(this,arguments)}function N6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Wm(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=Wm(c);if(u){var y=Wm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return k6(this,d)}}function k6(c,u){if(u&&(Z1(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vm(c)}function Vm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Wm(c){return Wm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Wm(c)}function gC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Gm(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var Ad,yC,_C,tx=(Hs=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ex(m,_)})(y,c);var u,d,p=P6(y);function y(){var m;T6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return gC(Vm(m=p.call.apply(p,[this].concat(A))),"modelType",so.DIAMOND_NODE),mC(Vm(m),"rx",dC,Vm(m)),mC(Vm(m),"ry",fC,Vm(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=Q1(Wm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.diamond;return vC(vC({},m),Uo(_))}},{key:"points",get:function(){var m=this.x,_=this.y,A=this.rx,N=this.ry;return[[m,_-N],[m+A,_],[m,_+N],[m-A,_]]}},{key:"pointsPosition",get:function(){return this.points.map((function(m){return{x:m[0],y:m[1]}}))}},{key:"width",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=J1(A,1)[0];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"height",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=J1(A,2)[1];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"getDefaultAnchor",value:function(){var m=this;return this.points.map((function(_,A){var N=J1(_,2);return{x:N[0],y:N[1],id:"".concat(m.id,"_").concat(A)}}))}}])&&C6(u.prototype,d),y})(Xf),dC=Gm(Hs.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),fC=Gm(Hs.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 50}}),Gm(Hs.prototype,"points",[a.m],Object.getOwnPropertyDescriptor(Hs.prototype,"points"),Hs.prototype),Gm(Hs.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor(Hs.prototype,"pointsPosition"),Hs.prototype),Gm(Hs.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Hs.prototype,"width"),Hs.prototype),Gm(Hs.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Hs.prototype,"height"),Hs.prototype),Hs);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 bC(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 wC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?bC(Object(d),!0).forEach((function(p){xC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):bC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function EC(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 R6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function D6(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=j6(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 j6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Hm(c))!==null;);return c}function ox(c,u){return ox=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ox(c,u)}function L6(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=Hm(c);if(u){var y=Hm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return I6(this,d)}}function I6(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 zm(c)}function zm(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Hm(c){return Hm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Hm(c)}function xC(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var $u,OC,ix=(Ad=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ox(m,_)})(y,c);var u,d,p=L6(y);function y(){var m;R6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return xC(zm(m=p.call.apply(p,[this].concat(A))),"modelType",so.ELLIPSE_NODE),EC(zm(m),"rx",yC,zm(m)),EC(zm(m),"ry",_C,zm(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=rx(Hm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.ellipse;return wC(wC({},m),Uo(_))}},{key:"width",get:function(){return 2*this.rx}},{key:"height",get:function(){return 2*this.ry}},{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.rx,N=this.ry;return[{x:m,y:_-N,id:"".concat(this.id,"_0")},{x:m+A,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N,id:"".concat(this.id,"_2")},{x:m-A,y:_,id:"".concat(this.id,"_3")}]}}])&&D6(u.prototype,d),y})(Xf),yC=Cb(Ad.prototype,"rx",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 30}}),_C=Cb(Ad.prototype,"ry",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 45}}),Cb(Ad.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(Ad.prototype,"width"),Ad.prototype),Cb(Ad.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(Ad.prototype,"height"),Ad.prototype),Ad);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 sx(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return SC(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 SC(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 SC(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 AC(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?AC(Object(d),!0).forEach((function(p){TC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):AC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function F6(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 B6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function $6(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 lx(){return lx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=U6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},lx.apply(this,arguments)}function U6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Xm(c))!==null;);return c}function ux(c,u){return ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},ux(c,u)}function V6(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=Xm(c);if(u){var y=Xm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return W6(this,d)}}function W6(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 Xm(c){return Xm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Xm(c)}function TC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function Pb(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var cx,CC,dx=($u=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&ux(m,_)})(y,c);var u,d,p=V6(y);function y(){var m;B6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return TC(Nb(m=p.call.apply(p,[this].concat(A))),"modelType",so.POLYGON_NODE),F6(Nb(m),"points",OC,Nb(m)),m}return u=y,(d=[{key:"getNodeStyle",value:function(){var m=lx(Xm(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.polygon;return MC(MC({},m),Uo(_))}},{key:"pointsPosition",get:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return this.points.map((function(U){return{x:U[0]+m-A/2,y:U[1]+_-N/2}}))}},{key:"width",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=sx(A,1)[0];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"height",get:function(){var m=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(A){var N=sx(A,2)[1];N<m&&(m=N),N>_&&(_=N)})),_-m}},{key:"getDefaultAnchor",value:function(){var m=this,_=this.x,A=this.y,N=this.width,U=this.height;return this.points.map((function(H,oe){var ue=sx(H,2),Ce=ue[0],Ve=ue[1];return{x:_+Ce-N/2,y:A+Ve-U/2,id:"".concat(m.id,"_").concat(oe)}}))}}])&&$6(u.prototype,d),y})(Xf),OC=Pb($u.prototype,"points",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[[50,0],[100,50],[50,100],[0,50]]}}),Pb($u.prototype,"pointsPosition",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"pointsPosition"),$u.prototype),Pb($u.prototype,"width",[a.m],Object.getOwnPropertyDescriptor($u.prototype,"width"),$u.prototype),Pb($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 NC(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 PC(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?NC(Object(d),!0).forEach((function(p){kC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):NC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function G6(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 z6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function H6(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=X6(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 X6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=Ym(c))!==null;);return c}function hx(c,u){return hx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},hx(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=Ym(c);if(u){var y=Ym(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return q6(this,d)}}function q6(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 kb(c)}function kb(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function Ym(c){return Ym=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},Ym(c)}function kC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var rh,vx=(cx=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&hx(m,_)})(y,c);var u,d,p=Y6(y);function y(){var m;z6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return kC(kb(m=p.call.apply(p,[this].concat(A))),"modelType",so.RECT_NODE),G6(kb(m),"radius",CC,kb(m)),m}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return[{x:m,y:_-N/2,id:"".concat(this.id,"_0")},{x:m+A/2,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N/2,id:"".concat(this.id,"_2")},{x:m-A/2,y:_,id:"".concat(this.id,"_3")}]}},{key:"getNodeStyle",value:function(){var m=px(Ym(y.prototype),"getNodeStyle",this).call(this),_=this.graphModel.theme.rect;return PC(PC({},m),Uo(_))}}])&&H6(u.prototype,d),y})(Xf),CC=(function(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m})(cx.prototype,"radius",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),cx);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 RC(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?RC(Object(d),!0).forEach((function(p){LC(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):RC(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function K6(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function Z6(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 gx(){return gx=typeof Reflect<"u"&&Reflect.get?Reflect.get:function(c,u,d){var p=J6(c,u);if(p){var y=Object.getOwnPropertyDescriptor(p,u);return y.get?y.get.call(arguments.length<3?c:d):y.value}},gx.apply(this,arguments)}function J6(c,u){for(;!Object.prototype.hasOwnProperty.call(c,u)&&(c=qm(c))!==null;);return c}function yx(c,u){return yx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},yx(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=qm(c);if(u){var y=qm(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return eF(this,d)}}function eF(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 jC(c)}function jC(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function qm(c){return qm=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},qm(c)}function LC(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function IC(c,u,d,p,y){var m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var _x=(rh=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&yx(m,_)})(y,c);var u,d,p=Q6(y);function y(){var m;K6(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return LC(jC(m=p.call.apply(p,[this].concat(A))),"modelType",so.TEXT_NODE),m}return u=y,(d=[{key:"getTextStyle",value:function(){var m=gx(qm(y.prototype),"getTextStyle",this).call(this),_=this.graphModel.theme.text;return DC(DC({},m),Uo(_))}},{key:"width",get:function(){var m=String(this.text.value).split(/[\r\n]/g),_=this.getTextStyle().fontSize;return Sc({rows:m,fontSize:_,rowsLength:m.length}).width}},{key:"height",get:function(){var m=String(this.text.value).split(/[\r\n]/g),_=this.getTextStyle().fontSize;return Sc({rows:m,fontSize:_,rowsLength:m.length}).height}}])&&Z6(u.prototype,d),y})(Xf),IC(rh.prototype,"width",[a.m],Object.getOwnPropertyDescriptor(rh.prototype,"width"),rh.prototype),IC(rh.prototype,"height",[a.m],Object.getOwnPropertyDescriptor(rh.prototype,"height"),rh.prototype),rh);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 tF(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 wx(c,u){return wx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},wx(c,u)}function rF(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 oF(this,d)}}function oF(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 FC(c)}function FC(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 iF(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var Dc,BC,$C,UC,Ex=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&wx(m,_)})(y,c);var u,d,p=rF(y);function y(){var m;tF(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return iF(FC(m=p.call.apply(p,[this].concat(A))),"modelType",so.HTML_NODE),m}return u=y,(d=[{key:"getDefaultAnchor",value:function(){var m=this.x,_=this.y,A=this.width,N=this.height;return[{x:m,y:_-N/2,id:"".concat(this.id,"_0")},{x:m+A/2,y:_,id:"".concat(this.id,"_1")},{x:m,y:_+N/2,id:"".concat(this.id,"_2")},{x:m-A/2,y:_,id:"".concat(this.id,"_3")}]}}])&&nF(u.prototype,d),y})(Xf);function VC(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 aF(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 WC(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 m={};return Object.keys(p).forEach((function(_){m[_]=p[_]})),m.enumerable=!!m.enumerable,m.configurable=!!m.configurable,("value"in m||m.initializer)&&(m.writable=!0),m=d.slice().reverse().reduce((function(_,A){return A(c,u,_)||_}),m),y&&m.initializer!==void 0&&(m.value=m.initializer?m.initializer.call(y):void 0,m.initializer=void 0),m.initializer===void 0&&(Object.defineProperty(c,u,m),m=null),m}var GC=(Dc=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),WC(this,"graphModel",void 0),xx(this,"isShowHorizontal",BC,this),xx(this,"isShowVertical",$C,this),xx(this,"position",UC,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 m=arguments[y]!=null?arguments[y]:{};y%2?VC(Object(m),!0).forEach((function(_){WC(p,_,m[_])})):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):VC(Object(m)).forEach((function(_){Object.defineProperty(p,_,Object.getOwnPropertyDescriptor(m,_))}))}return p})({},this.graphModel.theme.snapline)}},{key:"getCenterSnapLine",value:function(p,y){for(var m=p.x,_=p.y,A=!1,N=!1,U=0;U<y.length;U++){var H=y[U];if(H.id!==p.id&&(m===H.x&&(A=!0),_===H.y&&(N=!0),A&&N))break}return{isShowVertical:A,isShowHorizontal:N,position:{x:m,y:_}}}},{key:"getHorizontalSnapline",value:function(p,y){var m,_,A=!1,N=p.id;if(N){var U=this.graphModel.fakerNode;if(U&&U.id===N)_=gi(U);else{var H=this.graphModel.getNodeModelById(N);_=gi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ce=gi(ue);if(Ce.minY===_.minY||Ce.maxY===_.minY){A=!0,m=_.minY;break}if(Ce.minY===_.maxY||Ce.maxY===_.maxY){A=!0,m=_.maxY;break}}}return ka({isShowHorizontal:A,position:{y:m}})}},{key:"getVerticalSnapline",value:function(p,y){var m,_,A=!1,N=p.id;if(N){var U=this.graphModel.fakerNode;if(U&&U.id===N)_=gi(U);else{var H=this.graphModel.getNodeModelById(N);_=gi(H)}}for(var oe=0;oe<y.length;oe++){var ue=y[oe];if(ue.id!==p.id){var Ce=gi(ue);if(Ce.minX===_.minX||Ce.maxX===_.minX){A=!0,m=_.minX;break}if(Ce.minX===_.maxX||Ce.maxX===_.maxX){A=!0,m=_.maxX;break}}}return ka({isShowVertical:A,position:{x:m}})}},{key:"getSnapLinePosition",value:function(p,y){var m=this.getCenterSnapLine(p,y),_=m.isShowHorizontal,A=m.isShowVertical;if(!_){var N=this.getHorizontalSnapline(p,y);N.isShowHorizontal&&(m.isShowHorizontal=N.isShowHorizontal,m.position.y=N.position.y)}if(!A){var U=this.getVerticalSnapline(p,y);U.isShowVertical&&(m.isShowVertical=U.isShowVertical,m.position.x=U.position.x)}return m}},{key:"setSnaplineInfo",value:function(p){var y=p.isShowHorizontal,m=p.isShowVertical,_=p.position;this.position=_,this.isShowHorizontal=y,this.isShowVertical=m}},{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,m=this.getSnapLinePosition(p,y);this.setSnaplineInfo(m)}}],d&&aF(u.prototype,d),c})(),BC=Sy(Dc.prototype,"isShowHorizontal",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),$C=Sy(Dc.prototype,"isShowVertical",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),UC=Sy(Dc.prototype,"position",[a.C],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sy(Dc.prototype,"clearSnapline",[a.k],Object.getOwnPropertyDescriptor(Dc.prototype,"clearSnapline"),Dc.prototype),Sy(Dc.prototype,"setNodeSnapLine",[a.k],Object.getOwnPropertyDescriptor(Dc.prototype,"setNodeSnapLine"),Dc.prototype),Dc),Ay=new Map,zC=function(c){var u=ts(),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 HC(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?HC(Object(d),!0).forEach((function(p){Td(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):HC(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return XC(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 XC(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 XC(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 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 Sx(c,u){return Sx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Sx(c,u)}function uF(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 cF(this,d)}}function cF(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 Md(c)}function Md(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 Td(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var dF=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Sx(m,_)})(y,c);var u,d,p=uF(y);function y(){var m;return(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Td(Md(m=p.call(this)),"preTargetNode",void 0),Td(Md(m),"sourceRuleResults",void 0),Td(Md(m),"targetRuleResults",void 0),Td(Md(m),"dragHandler",void 0),Td(Md(m),"t",void 0),Td(Md(m),"onDragStart",(function(_){var A=_.event,N=m.props,U=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:U,e:A,nodeModel:H}),m.setState({startX:U.x,startY:U.y,endX:U.x,endY:U.y})})),Td(Md(m),"onDragging",(function(_){var A=_.event,N=m.props,U=N.graphModel,H=N.nodeModel,oe=N.anchorData,ue=U.transformModel,Ce=U.eventCenter,Ve=U.width,qe=U.height,Ot=U.editConfigModel,xt=Ot.autoExpand,Ft=Ot.stopMoveGraph,hn=A.clientX,Hn=A.clientY,zn=U.getPointByClient({x:hn,y:Hn}),Ar=zn.domOverlayPosition,Vn=Ar.x,vr=Ar.y,er=zn.canvasOverlayPosition,Eo=er.x,Co=er.y;m.t&&Db(m.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]),m.setState({endX:Eo,endY:Co,dragging:!0}),m.moveAnchorEnd(Eo,Co),zr.length>0&&!Ft&&xt&&(m.t=zC((function(){var Fo=sF(zr,2),ga=Fo[0],ya=Fo[1];ue.translate(ga,ya);var Cs=m.state,fu=Cs.endX,pu=Cs.endY;m.setState({endX:fu-ga,endY:pu-ya}),m.moveAnchorEnd(fu-ga,pu-ya)}))),Ce.emit(ur.ANCHOR_DRAG,{data:oe,e:A,nodeModel:H})})),Td(Md(m),"onDragEnd",(function(_){var A=_.event;m.t&&Db(m.t);var N=m.checkEnd(A);m.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),m.sourceRuleResults.clear(),m.targetRuleResults.clear();var U=m.props,H=U.graphModel,oe=U.nodeModel,ue=U.anchorData;H.eventCenter.emit(ur.ANCHOR_DRAGEND,{data:ue,e:A,nodeModel:oe,edgeModel:N})})),Td(Md(m),"checkEnd",(function(_){var A=m.props,N=A.graphModel,U=A.nodeModel,H=A.anchorData,oe=H.x,ue=H.y,Ce=H.id,Ve=(N.edgeType,m.state),qe=Ve.endX,Ot=Ve.endY,xt=Ve.dragging,Ft=Cf({x:qe,y:Ot},N);if(m.preTargetNode&&m.preTargetNode.state!==Io.DEFAULT&&m.preTargetNode.setElementState(Io.DEFAULT),xt&&Ft&&Ft.node){var hn=Ft.node,Hn=Ft.anchor.id,zn="".concat(U.id,"_").concat(hn.id,"_").concat(Hn,"_").concat(Ce),Ar=m.sourceRuleResults.get(zn)||{},Vn=Ar.isAllPass,vr=Ar.msg,er=m.targetRuleResults.get(zn)||{},Eo=er.isAllPass,Co=er.msg;if(Vn&&Eo){hn.setElementState(Io.DEFAULT);var zr=N.edgeGenerator(U.getData(),N.getNodeModelById(Ft.node.id).getData()),Fo=N.addEdge(Ty(Ty({},zr),{},{sourceNodeId:U.id,sourceAnchorId:Ce,startPoint:{x:oe,y:ue},targetNodeId:Ft.node.id,targetAnchorId:Ft.anchor.id,endPoint:{x:Ft.anchor.x,y:Ft.anchor.y}})),ga=m.props.anchorData;return N.eventCenter.emit(ur.ANCHOR_DROP,{data:ga,e:_,nodeModel:U,edgeModel:Fo}),Fo}var ya=hn.getData();return N.eventCenter.emit(ur.CONNECTION_NOT_ALLOWED,{data:ya,msg:Co||vr||"不允许添加连线"}),null}})),m.sourceRuleResults=new Map,m.targetRuleResults=new Map,m.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},m.dragHandler=new Te({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd}),m}return u=y,(d=[{key:"getAnchorShape",value:function(){var m=this.props,_=m.anchorData,A=m.style,N=m.node.getAnchorShape(_);if(N)return N;var U=_.x,H=_.y,oe=Ty(Ty({},A),A.hover);return Object(re.g)("g",null,Object(re.g)($m,My({className:"lf-node-anchor-hover"},oe,{x:U,y:H})),Object(re.g)($m,My({className:"lf-node-anchor"},A,{x:U,y:H})))}},{key:"customTrajectory",get:function(){return this.props.graphModel.customTrajectory}},{key:"relateEdges",get:function(){var m=this.props,_=m.graphModel,A=_.getAnchorIncomingEdge,N=_.getAnchorOutcomingEdge,U=m.anchorData.id;return{incomingEdgeList:A(U),outcomingEdgeList:N(U)}}},{key:"moveAnchorEnd",value:function(m,_){var A=this.props,N=A.graphModel,U=A.nodeModel,H=A.anchorData,oe=Cf({x:m,y:_},N);if(oe){var ue=oe.node,Ce=oe.anchor.id;if(this.preTargetNode&&this.preTargetNode!==oe.node&&this.preTargetNode.setElementState(Io.DEFAULT),H.id===Ce)return;this.preTargetNode=ue;var Ve="".concat(U.id,"_").concat(ue.id,"_").concat(Ce,"_").concat(H.id);if(!this.targetRuleResults.has(Ve)){var qe=oe.anchor,Ot=U.isAllowConnectedAsSource(ue,H,qe),xt=ue.isAllowConnectedAsTarget(U,H,qe);this.sourceRuleResults.set(Ve,au(Ot)),this.targetRuleResults.set(Ve,au(xt))}var Ft=this.sourceRuleResults.get(Ve).isAllPass,hn=this.targetRuleResults.get(Ve).isAllPass;Ft&&hn?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 m=this.state,_=m.startX,A=m.startY,N=m.endX,U=m.endY;return ml(_,A,N,U)>10}},{key:"render",value:function(){var m=this,_=this.state,A=_.startX,N=_.startY,U=_.endX,H=_.endY,oe=this.props,ue=oe.anchorData.edgeAddable,Ce=oe.edgeStyle;return Object(re.g)("g",{className:"lf-anchor"},Object(re.g)("g",{onMouseDown:function(Ve){ue!==!1&&m.dragHandler.handleMouseDown(Ve)}},this.getAnchorShape()),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Ty({sourcePoint:{x:A,y:N},targetPoint:{x:U,y:H}},Ce)):Object(re.g)(Fm,My({x1:A,y1:N,x2:U,y2:H},Ce,{"pointer-events":"none"}))))}}])&&lF(u.prototype,d),y})(re.a);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 fF(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){pF(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 pF(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 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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 KC(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.value,_=c.fontSize,A=c.fill,N=A===void 0?"currentColor":A,U=c.overflowMode,H=U===void 0?"default":U,oe=c.textWidth,ue=oe===void 0?"":oe,Ce=c.model,Ve={textAnchor:"middle","dominant-baseline":"middle",x:d,y,fill:N};if(Object.entries(c).forEach((function(Hn){var zn=hF(Hn,2),Ar=zn[0],Vn=zn[1];Ax(Vn)!=="object"&&(Ve[Ar]=Vn)})),m){var qe=String(m).split(/[\r\n]/g),Ot=qe.length;if(H!=="default"){var xt=Ce.BaseType,Ft=Ce.modelType;if(xt===ei.NODE&&Ft!==so.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,ga=Hn.x,ya=Hn.y,Cs=Vn.width,fu=Vn.textHeight,pu=Hn.textWidth||Cs,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 ah=Fo==="ellipsis";return ah&&(Mv=Ar+2),Object(re.g)("g",null,Object(re.g)("foreignObject",{width:pu,height:Mv,x:ga-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:ah?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:ah?Pd.join(""):"",style:fF({},Hn)},Pd.map((function(sh){return Object(re.g)("div",{className:"lf-node-text--auto-wrap-inner"},sh)}))))))})(c)}if(Ot>1){var hn=qe.map((function(Hn,zn){var Ar=(zn-(Ot-1)/2)*(_+2);return Object(re.g)("tspan",{className:"lf-text-tspan",x:d,y:y+Ar},Hn)}));return Object(re.g)("text",Ve,hn)}return Object(re.g)("text",Ve,m)}}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 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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 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 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=Lb(c);if(u){var y=Lb(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return yF(this,d)}}function yF(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 oh(c)}function oh(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 JC=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Cx(m,_)})(y,c);var u,d,p=gF(y);function y(m){var _;(function(N,U){if(!(N instanceof U))throw new TypeError("Cannot call a class as a function")})(this,y),Ev(oh(_=p.call(this)),"dragHandler",void 0),Ev(oh(_),"sumDeltaX",0),Ev(oh(_),"sumDeltaY",0),Ev(oh(_),"stepDrag",void 0),Ev(oh(_),"onDragging",(function(N){var U=N.deltaX,H=N.deltaY,oe=_.props,ue=oe.model,Ce=vF(oe.graphModel.transformModel.fixDeltaXY(U,H),2),Ve=Ce[0],qe=Ce[1];ue.moveText(Ve,qe)})),Ev(oh(_),"dblClickHandler",(function(){_.props.editable&&_.props.model.setElementState(Io.TEXT_EDIT)})),Ev(oh(_),"mouseDownHandle",(function(N){var U=_.props,H=U.draggable,oe=U.model,ue=U.graphModel.editConfigModel.nodeTextDraggable;(H||ue)&&(_.stepDrag.model=oe,_.stepDrag.handleMouseDown(N))})),m.model;var A=m.draggable;return _.stepDrag=new Te({onDragging:_.onDragging,step:1,isStopPropagation:A}),_}return u=y,(d=[{key:"getShape",value:function(){var m=this.props,_=m.model,A=m.graphModel,N=_.text,U=A.editConfigModel,H=N.value,oe=N.x,ue=N.y,Ce=N.editable,Ve=N.draggable,qe={x:oe,y:ue,className:"",value:H};Ce?qe.className="lf-element-text":Ve||U.nodeTextDraggable?qe.className="lf-text-draggable":qe.className="lf-text-disabled";var Ot=_.getTextStyle();return Object(re.g)(KC,Tx({},qe,Ot,{model:_}))}},{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),_F=sc(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null,QC=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 Px(){return Px=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},Px.apply(this,arguments)}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 kx(c,u){return kx=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},kx(c,u)}function wF(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 EF(this,d)}}function EF(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 Km(c)}function Km(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 xF=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&kx(m,_)})(y,c);var u,d,p=wF(y);function y(m){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),Cy(Km(_=p.call(this,m)),"style",{}),Cy(Km(_),"defaultAngle",void 0),Cy(Km(_),"normal",void 0),Cy(Km(_),"stepperDrag",void 0),Cy(Km(_),"onDragging",(function(A){var N,U=A.event,H=_.props,oe=H.graphModel,ue=H.nodeModel,Ce=H.eventCenter,Ve=oe.selectNodes,qe=ue.x,Ot=ue.y,xt=U.clientX,Ft=U.clientY,hn=oe.getPointByClient({x:xt,y:Ft}).canvasOverlayPosition,Hn=hn.x,zn=hn.y,Ar=new ot(Hn-qe,zn-Ot),Vn=((N=_.normal)===null||N===void 0?void 0:N.angle(Ar))-_.defaultAngle,vr=new eh(-qe,-Ot).rotate(Vn).translate(qe,Ot).toString();ue.transform=vr,ue.rotate=Vn;var er=Object(QC.map)(Ve,(function(Co){return Co.id}));er.indexOf(ue.id)===-1&&(er=[ue.id]);var Eo=Object(QC.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 ga=oe.getNodeModelById(zr.targetNodeId).anchors.find((function(ya){return ya.id===zr.targetAnchorId}));zr.updateEndPoint(ga)}}))})),Ce.emit(ur.NODE_ROTATE,{e:U,nodeModel:ue})})),_.style=m.style,_.stepperDrag=new Te({onDragging:_.onDragging}),_}return u=y,(d=[{key:"render",value:function(){var m=this,_=this.props.nodeModel,A=_.x,N=_.y,U=A+_.width/2+20,H=N-_.height/2-20;return this.normal=new ot(1,0),this.defaultAngle=this.normal.angle(new ot(U-A,H-N)),_.defaultAngle=this.defaultAngle,Object(re.g)("g",{className:"lf-rotate-control"},Object(re.g)("g",{onMouseDown:function(oe){m.stepperDrag.handleMouseDown(oe)}},Object(re.g)($m,Px({},this.style,{cx:U,cy:H}))))}}])&&bF(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 OF=["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 SF(c,u){if(c==null)return{};var d,p,y=(function(_,A){if(_==null)return{};var N,U,H={},oe=Object.keys(_);for(U=0;U<oe.length;U++)N=oe[U],A.indexOf(N)>=0||(H[N]=_[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);for(p=0;p<m.length;p++)d=m[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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return eN(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 eN(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 eN(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 tN(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 AF(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 MF(this,d)}}function MF(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 rs(c)}function rs(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 ps(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(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),A&&Dx(_,A)})(m,c);var u,d,p,y=AF(m);function m(_){var A;(function(ue,Ce){if(!(ue instanceof Ce))throw new TypeError("Cannot call a class as a function")})(this,m),ps(rs(A=y.call(this)),"t",void 0),ps(rs(A),"moveOffset",void 0),ps(rs(A),"stepDrag",void 0),ps(rs(A),"contextMenuTime",void 0),ps(rs(A),"mouseUpDrag",void 0),ps(rs(A),"startTime",void 0),ps(rs(A),"clickTimer",void 0),ps(rs(A),"modelDisposer",void 0),ps(rs(A),"onDragStart",(function(ue){var Ce=ue.event,Ve=Ce.clientX,qe=Ce.clientY,Ot=A.props,xt=Ot.model,Ft=Ot.graphModel.getPointByClient({x:Ve,y:qe}).canvasOverlayPosition,hn=Ft.x,Hn=Ft.y;A.moveOffset={x:xt.x-hn,y:xt.y-Hn}})),ps(rs(A),"onDragging",(function(ue){var Ce=ue.event,Ve=A.props,qe=Ve.model,Ot=Ve.graphModel,xt=Ot.editConfigModel,Ft=xt.stopMoveGraph,hn=xt.autoExpand,Hn=Ot.transformModel,zn=Ot.selectNodes,Ar=Ot.width,Vn=Ot.height,vr=Ot.gridSize;qe.isDragging=!0;var er=Ce.clientX,Eo=Ce.clientY,Co=Ot.getPointByClient({x:er,y:Eo}).canvasOverlayPosition,zr=Co.x,Fo=Co.y,ga=Bb(Hn.CanvasPointToHtmlPoint([zr,Fo]),2),ya=ga[0],Cs=ga[1];if(zr+=A.moveOffset.x,Fo+=A.moveOffset.y,zr=fl(zr,vr),Fo=fl(Fo,vr),Ar&&Vn){if(!hn||Ft||!(ya<0||Cs<0||ya>Ar||Cs>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],ah=Math.max(vr,20),sh=[];pu<0?sh=[ah,0]:a0>Ot.width?sh=[-ah,0]:Pd<0?sh=[0,ah]:Mv>Ot.height&&(sh=[0,-ah]),A.t&&Db(A.t);var c$=new eh(-zr,-Fo).rotate(qe.rotate).translate(zr,Fo).toString();qe.transform=c$;var s0=zn.map((function(l0){return l0.id}));s0.indexOf(qe.id)===-1&&(s0=[qe.id]),sh.length>0&&!Ft&&hn?A.t=zC((function(){var l0=Bb(sh,2),jN=l0[0],LN=l0[1];Hn.translate(jN,LN);var d$=-jN/Hn.SCALE_X,f$=-LN/Hn.SCALE_X;Ot.moveNodes(s0,d$,f$)})):Ot.moveNodes(s0,zr-qe.x,Fo-qe.y)}}else Ot.moveNode2Coordinate(qe.id,zr,Fo)})),ps(rs(A),"onDragEnd",(function(){A.t&&Db(A.t),A.props.model.isDragging=!1})),ps(rs(A),"handleMouseUp",(function(){var ue=A.props.model;A.mouseUpDrag=ue.isDragging})),ps(rs(A),"handleClick",(function(ue){var Ce=A.mouseUpDrag===!1;if(A.startTime){var Ve=A.props,qe=Ve.model,Ot=Ve.graphModel;if(Ce){var xt={data:qe.getData(),e:ue,position:Ot.getPointByClient({x:ue.clientX,y:ue.clientY}),isSelected:!1,isMultiple:!1},Ft=ue.button===2,hn=ue.detail===2;if(!Ft){var Hn=Ot.editConfigModel,zn=gd(ue,Hn);xt.isMultiple=zn,qe.isSelected&&!hn&&zn?(xt.isSelected=!1,qe.setSelected(!1)):(Ot.selectNodeById(qe.id,zn),xt.isSelected=!0,A.toFront()),hn?(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))}}}})),ps(rs(A),"handleContextMenu",(function(ue){ue.preventDefault();var Ce=A.props,Ve=Ce.model,qe=Ce.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()})),ps(rs(A),"handleMouseDown",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel;A.startTime=new Date().getTime(),qe.editConfigModel.adjustNodePosition&&Ve.draggable&&A.stepDrag&&A.stepDrag.handleMouseDown(ue)})),ps(rs(A),"setHoverON",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel;if(!Ve.isHovered){var Ot=Ve.getData();Ve.setHovered(!0),qe.eventCenter.emit(ur.NODE_MOUSEENTER,{data:Ot,e:ue})}})),ps(rs(A),"setHoverOFF",(function(ue){var Ce=A.props,Ve=Ce.model,qe=Ce.graphModel,Ot=Ve.getData();Ve.isHovered&&(Ve.setHovered(!1),qe.eventCenter.emit(ur.NODE_MOUSELEAVE,{data:Ot,e:ue}))})),ps(rs(A),"onMouseOut",(function(ue){_F&&A.setHoverOFF(ue)}));var N=_.graphModel,U=N.gridSize,H=N.eventCenter,oe=_.model;return A.stepDrag=new Te({onDragStart:A.onDragStart,onDragging:A.onDragging,onDragEnd:A.onDragEnd,step:U,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=m,p=[{key:"getModel",value:function(_){return _}}],(d=[{key:"componentWillUnmount",value:function(){this.modelDisposer&&this.modelDisposer()}},{key:"getAnchorShape",value:function(_){return null}},{key:"getAnchors",value:function(){var _=this,A=this.props,N=A.model,U=A.graphModel,H=N.isSelected,oe=N.isHitable,ue=N.isDragging,Ce=N.isShowAnchor;return oe&&(H||Ce)&&!ue?Ep(N.anchors,(function(Ve,qe){var Ot=N.getAnchorLineStyle(Ve),xt=N.getAnchorStyle(Ve);return Object(re.g)(dF,{anchorData:Ve,node:_,style:xt,edgeStyle:Ot,anchorIndex:qe,nodeModel:N,graphModel:U,setHoverOFF:_.setHoverOFF})})):[]}},{key:"getRotateControl",value:function(){var _=this.props,A=_.model,N=_.graphModel,U=A.isSelected,H=A.isHitable,oe=A.enableRotate,ue=A.isHovered,Ce=A.getRotateControlStyle().style;if(H&&(U||ue)&&oe)return Object(re.g)(xF,{graphModel:N,nodeModel:A,eventCenter:N.eventCenter,style:Ce})}},{key:"getText",value:function(){var _=this.props,A=_.model,N=_.graphModel;if(A.state===Io.TEXT_EDIT)return"";if(A.text){var U=N.editConfigModel,H=!1;return(A.text.draggable||U.nodeTextDraggable)&&(H=!0),Object(re.g)(JC,{editable:U.nodeTextEdit&&A.text.editable,model:A,graphModel:N,draggable:H})}}},{key:"getStateClassName",value:function(){var _=this.props.model,A=_.state,N=_.isDragging,U=_.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"),U&&(H+=" lf-node-selected"),H}},{key:"toFront",value:function(){var _=this.props,A=_.model,N=_.graphModel;A.autoToFront&&N.toFront(A.id)}},{key:"render",value:function(){var _,A=this.props,N=A.model,U=A.graphModel,H=U.editConfigModel,oe=H.hideAnchors,ue=H.adjustNodePosition,Ce=H.allowRotation,Ve=U.gridSize,qe=U.transformModel.SCALE_X,Ot=N.isHitable,xt=N.draggable,Ft=N.transform,hn=N.getOuterGAttributes(),Hn=hn.className,zn=Hn===void 0?"":Hn,Ar=SF(hn,OF),Vn=Object(re.g)("g",{className:"lf-node-content"},Object(re.g)("g",{transform:Ft},this.getShape(),this.getText(),Ce&&this.getRotateControl()),!oe&&this.getAnchors());return Ot?(ue&&xt&&this.stepDrag.setStep(Ve*qe),_=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)):_=Object(re.g)("g",Fb({className:"".concat(this.getStateClassName()," ").concat(zn)},Ar),Vn),_}}])&&tN(u.prototype,d),p&&tN(u,p),m})(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 TF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function CF(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 NF(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Ix(m,_)})(y,c);var u,d,p=NF(y);function y(){return TF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)(th,Lx({},_,{x:m.x,y:m.y,width:m.width,height:m.height,radius:m.radius}))}}])&&CF(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 kF(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 Ux(c,u){return Ux=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},Ux(c,u)}function DF(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 jF(this,d)}}function jF(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Ux(m,_)})(y,c);var u,d,p=DF(y);function y(){return kF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.r,U=m.getNodeStyle();return Object(re.g)($m,$x({},U,{x:_,y:A,r:N}))}}])&&RF(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 LF(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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){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 m=LF(y,2),_=m[0],A=m[1];Wx(A)!=="object"&&(p[_]=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 IF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function FF(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 BF(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 $F(this,d)}}function $F(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Hx(m,_)})(y,c);var u,d,p=BF(y);function y(){return IF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.x,A=m.y,N=m.width,U=m.height,H=m.points,oe=m.getNodeStyle(),ue={transform:"matrix(1 0 0 1 ".concat(_-N/2," ").concat(A-U/2,")")};return Object(re.g)("g",ue,Object(re.g)(rN,zx({},oe,{points:H,x:_,y:A})))}}])&&FF(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 UF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function VF(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 WF(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 GF(this,d)}}function GF(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&Kx(m,_)})(y,c);var u,d,p=WF(y);function y(){return UF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)("g",null,Object(re.g)(rN,qx({},_,{points:m.points,x:m.x,y:m.y})))}}])&&VF(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 zF(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 HF(c){var u=c.x,d=u===void 0?0:u,p=c.y,y=p===void 0?0:p,m=c.rx,_=m===void 0?4:m,A=c.ry,N=A===void 0?4:A,U=c.className,H={cx:d,cy:y,rx:_,ry:N,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(c).forEach((function(oe){var ue=zF(oe,2),Ce=ue[0],Ve=ue[1];Jx(Ve)!=="object"&&(H[Ce]=Ve)})),H.className=U?"lf-basic-shape ".concat(U):"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 XF(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function YF(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 qF(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 KF(this,d)}}function KF(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&tO(m,_)})(y,c);var u,d,p=qF(y);function y(){return XF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getShape",value:function(){var m=this.props.model,_=m.getNodeStyle();return Object(re.g)(HF,eO({},_,{x:m.x,y:m.y,rx:m.rx,ry:m.ry}))}}])&&YF(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 iN(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 aN(c){for(var u=1;u<arguments.length;u++){var d=arguments[u]!=null?arguments[u]:{};u%2?iN(Object(d),!0).forEach((function(p){ZF(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):iN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return 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}function JF(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 oO(c,u){return oO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},oO(c,u)}function eB(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 tB(this,d)}}function tB(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&oO(m,_)})(y,c);var u,d,p=eB(y);function y(){return JF(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getBackground",value:function(){var m=this.props.model,_=m.getTextStyle(),A=m.width,N=m.height,U=m.x,H=m.y,oe=aN(aN({},_.background),{},{x:U,y:H-1,width:A,height:N});return Object(re.g)(th,oe)}},{key:"getShape",value:function(){return Object(re.g)("g",null,this.getBackground())}}])&&QF(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 sO(){return sO=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},sO.apply(this,arguments)}function nB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function rB(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 lO(c,u){return lO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},lO(c,u)}function oB(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 iB(this,d)}}function iB(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&lO(m,_)})(y,c);var u,d,p=oB(y);function y(){var m;nB(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Yb(Ny(m=p.call.apply(p,[this].concat(A))),"ref",void 0),Yb(Ny(m),"currentProperties",void 0),Yb(Ny(m),"preProperties",void 0),Yb(Ny(m),"setRef",(function(U){m.ref=U})),m}return u=y,(d=[{key:"rootEl",get:function(){return this.ref}},{key:"setHtml",value:function(m){m.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 m=this.props.model,_=m.x,A=m.y,N=m.height,U=m.width,H=m.getNodeStyle();return this.currentProperties=JSON.stringify(m.properties),Object(re.g)("foreignObject",sO({},H,{x:_-U/2,y:A-N/2,width:U,height:N,ref:this.setRef}))}}])&&rB(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 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 xv(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){hO(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 aB(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 lB(this,d)}}function lB(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 uB=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&fO(m,_)})(y,c);var u,d,p=sB(y);function y(m){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,y),hO(pO(_=p.call(this,m)),"setHoverON",(function(){_.setState({isHovered:!0})})),hO(pO(_),"setHoverOFF",(function(){_.setState({isHovered:!1})})),_.state={isHovered:!1},_}return u=y,(d=[{key:"getBackground",value:function(){var m=this.props.model,_=m.getTextStyle(),A=m.text,N=m.width,U=_.background||{};if(this.state.isHovered&&_.hover&&_.hover.background&&(U=xv(xv({},U),_.hover.background)),A&&A.value&&U.fill!=="transparent"){var H,oe=_.fontSize,ue=_.overflowMode,Ce=_.lineHeight,Ve=_.wrapPadding,qe=_.textWidth,Ot=A.value,xt=A.x,Ft=A.y,hn=String(Ot).split(/[\r\n]/g),Hn=hn.length;if(ue==="autoWrap"&&qe){var zn=Df({rows:hn,style:{fontSize:"".concat(oe,"px"),width:"".concat(qe,"px"),lineHeight:Ce,padding:Ve},rowsLength:Hn,className:"lf-get-text-height"});H=xv(xv({},U),{},{x:xt-1,y:Ft-1,width:qe,height:zn})}else{hn&&hn.forEach((function(Eo){ki(Eo)}));var Ar=Sc({rows:hn,fontSize:oe,rowsLength:Hn}),Vn=Ar.width,vr=Ar.height;if(ue==="ellipsis"&&(Vn=qe||N,vr=oe+2),typeof U.wrapPadding=="string"){var er=U.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({},U),{},{x:xt-1,y:Ft-1,width:Vn,height:vr})}return Object(re.g)(th,H)}}},{key:"getShape",value:function(){var m=this.props.model,_=m.text,A=_.value,N=_.x,U=_.y;if(A){var H=xv({x:N,y:U,className:"lf-element-text",value:A},m.getTextStyle());return Object(re.g)("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF},this.getBackground(),Object(re.g)(KC,dO({},H,{model:m})))}}}])&&aB(u.prototype,d),y})(JC);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 Cd,cB=["text","sourceAnchorId","targetAnchorId"];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 qf(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){du(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 dB(c,u){if(c==null)return{};var d,p,y=(function(_,A){if(_==null)return{};var N,U,H={},oe=Object.keys(_);for(U=0;U<oe.length;U++)N=oe[U],A.indexOf(N)>=0||(H[N]=_[N]);return H})(c,u);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);for(p=0;p<m.length;p++)d=m[p],u.indexOf(d)>=0||Object.prototype.propertyIsEnumerable.call(c,d)&&(y[d]=c[d])}return y}function fB(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return uN(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 uN(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 uN(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,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 hB(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 vB(this,d)}}function vB(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"})(Cd||(Cd={}));var cN=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&mO(m,_)})(y,c);var u,d,p=hB(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),du(cu(_=p.call(this)),"stepDragData",void 0),du(cu(_),"stepDrag",void 0),du(cu(_),"oldEdge",void 0),du(cu(_),"preTargetNode",void 0),du(cu(_),"targetRuleResults",void 0),du(cu(_),"sourceRuleResults",void 0),du(cu(_),"handleMouseDown",(function(H){_.stepDrag&&_.stepDrag.handleMouseDown(H)})),du(cu(_),"onDragStart",(function(){var H=_.props,oe=H.x,ue=H.y,Ce=H.edgeModel,Ve=Ce.startPoint,qe=Ce.endPoint,Ot=Ce.pointsList;_.oldEdge={startPoint:Ve,endPoint:qe,pointsList:Ot},_.setState({endX:oe,endY:ue,dragging:!0})})),du(cu(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ce=_.state,Ve=Ce.endX,qe=Ce.endY,Ot=_.props,xt=Ot.graphModel,Ft=Ot.type,hn=xt.transformModel,Hn=xt.editConfigModel,zn=fB(hn.moveCanvasPointByHtml([Ve,qe],oe,ue),2),Ar=zn[0],Vn=zn[1];_.setState({endX:Ar,endY:Vn,dragging:!0});var vr=_.props.edgeModel,er=Cf({x:Ve,y:qe},xt);if(er&&er.node&&_.isAllowAdjust(er).pass){var Eo,Co=vr.startPoint,zr=vr.endPoint,Fo=vr.sourceNode,ga=vr.targetNode;Ft===Cd.SOURCE?Eo={startPoint:{x:er.anchor.x,y:er.anchor.y},endPoint:{x:zr.x,y:zr.y},sourceNode:er.node,targetNode:ga}:Ft===Cd.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===Cd.SOURCE?vr.updateStartPoint({x:Ar,y:Vn}):Ft===Cd.TARGET&&vr.updateEndPoint({x:Ar,y:Vn});vr.text.value&&Hn.adjustEdge&&vr.setText(Object.assign({},vr.text,vr.textPosition))})),du(cu(_),"onDragEnd",(function(H){var oe=H.event;try{var ue;_.setState({dragging:!1});var Ce=_.props,Ve=Ce.graphModel,qe=Ce.edgeModel,Ot=Ce.type,xt=_.state,Ft=xt.endX,hn=xt.endY,Hn=xt.dragging,zn=Cf({x:Ft,y:hn},Ve);if(!Hn)return;var Ar,Vn=!1;if(zn&&zn.node){var vr=_.isAllowAdjust(zn),er=vr.pass,Eo=vr.msg,Co=vr.newTargetNode;if(er){var zr=qe.getData(),Fo=zr.text,ga=zr.sourceAnchorId,ya=ga===void 0?"":ga,Cs=zr.targetAnchorId;Ar=qf(qf({sourceAnchorId:ya,targetAnchorId:Cs===void 0?"":Cs},dB(zr,cB)),{},{text:(Fo==null?void 0:Fo.value)||""}),Ot===Cd.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===Cd.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)_.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=_.preTargetNode)===null||ue===void 0||ue.setElementState(Io.DEFAULT)}finally{_.props.graphModel.eventCenter.emit(ur.ADJUST_POINT_DRAGEND,{e:oe,data:_.stepDragData})}})),du(cu(_),"recoveryEdge",(function(){var H=_.props.edgeModel,oe=_.oldEdge,ue=oe.startPoint,Ce=oe.endPoint,Ve=oe.pointsList;H.updateStartPoint(ue),H.updateEndPoint(Ce),H.modelType!==so.LINE_EDGE&&(H.pointsList=Ve,H.initPoints())})),du(cu(_),"getAdjustPointStyle",(function(){var H=_.props,oe=H.graphModel.theme;return H.edgeModel,oe.edgeAdjust})),_.state={dragging:!1,endX:0,endY:0},_.targetRuleResults=new Map,_.sourceRuleResults=new Map;var A=m.type,N=m.edgeModel,U=m.graphModel.eventCenter;return _.stepDragData={type:A,edgeData:N.getData()},_.stepDrag=new Te({onDragStart:_.onDragStart,onDragging:_.onDragging,onDragEnd:_.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:U,data:_.stepDragData}),_}return u=y,(d=[{key:"isAllowAdjust",value:function(m){var _=this.props,A=_.edgeModel,N=A.id,U=A.sourceNode,H=A.targetNode,oe=A.sourceAnchorId,ue=A.targetAnchorId,Ce=_.type,Ve=null,qe=null,Ot=null,xt=null;if(Ce===Cd.SOURCE?(Ve=m.node,qe=H,Ot=m.anchor,xt=H.getAnchorInfo(ue)):(Ve=U,qe=m.node,xt=m.anchor,Ot=U.getAnchorInfo(oe)),this.preTargetNode&&this.preTargetNode!==m.node&&this.preTargetNode.setElementState(Io.DEFAULT),this.preTargetNode=m.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 hn=Ve.isAllowConnectedAsSource(qe,Ot,xt,N),Hn=qe.isAllowConnectedAsTarget(Ve,Ot,xt,N);this.sourceRuleResults.set(Ft,au(hn)),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 Ce===Cd.SOURCE?Ve.setElementState(Co):qe.setElementState(Co),{pass:Ar&&er,msg:Eo||Vn,newTargetNode:qe}}},{key:"render",value:function(){var m=this.props,_=m.x,A=m.y,N=m.getAdjustPointShape,U=m.edgeModel,H=this.state.dragging;return Object(re.g)("g",{pointerEvents:H?"none":"",onMouseDown:this.handleMouseDown},H?"":N(_,A,U))}}])&&pB(u.prototype,d),y})(re.a);function gO(c){return gO=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},gO(c)}function Py(){return Py=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},Py.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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 gB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function yB(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 _B(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 bB(this,d)}}function bB(c,u){if(u&&(gO(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jc(c)}function jc(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 Nd(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var ky=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&yO(m,_)})(y,c);var u,d,p=_B(y);function y(){var m;gB(this,y);for(var _=arguments.length,A=new Array(_),N=0;N<_;N++)A[N]=arguments[N];return Nd(jc(m=p.call.apply(p,[this].concat(A))),"startTime",void 0),Nd(jc(m),"contextMenuTime",void 0),Nd(jc(m),"clickTimer",void 0),Nd(jc(m),"textRef",Object(re.f)()),Nd(jc(m),"handleHover",(function(U,H){var oe=m.props,ue=oe.model,Ce=oe.graphModel.eventCenter;ue.setHovered(U);var Ve=U?ur.EDGE_MOUSEENTER:ur.EDGE_MOUSELEAVE,qe=ue.getData();Ce.emit(Ve,{data:qe,e:H})})),Nd(jc(m),"setHoverON",(function(U){m.props.model.isHovered||(m.textRef&&m.textRef.current&&m.textRef.current.setHoverON(),m.handleHover(!0,U))})),Nd(jc(m),"setHoverOFF",(function(U){m.props.model.isHovered&&(m.textRef&&m.textRef.current&&m.textRef.current.setHoverOFF(),m.handleHover(!1,U))})),Nd(jc(m),"handleContextMenu",(function(U){U.preventDefault(),m.contextMenuTime=new Date().getTime(),m.clickTimer&&clearTimeout(m.clickTimer);var H=m.props,oe=H.model,ue=H.graphModel,Ce=ue.getPointByClient({x:U.clientX,y:U.clientY});ue.setElementStateById(oe.id,Io.SHOW_MENU,Ce.domOverlayPosition),m.toFront(),oe.isSelected||ue.selectEdgeById(oe.id);var Ve=oe==null?void 0:oe.getData();ue.eventCenter.emit(ur.EDGE_CONTEXTMENU,{data:Ve,e:U,position:Ce})})),Nd(jc(m),"handleMouseDown",(function(U){U.stopPropagation(),m.startTime=new Date().getTime()})),Nd(jc(m),"handleMouseUp",(function(U){if(m.startTime&&!(new Date().getTime()-m.startTime>200||U.button===2)){var H=U.detail===2,oe=m.props,ue=oe.model,Ce=oe.graphModel,Ve=ue==null?void 0:ue.getData(),qe=Ce.getPointByClient({x:U.clientX,y:U.clientY});if(H){var Ot=Ce.editConfigModel,xt=Ce.textEditElement;if(xt&&xt.id===ue.id&&Ce.setElementStateById(ue.id,Io.DEFAULT),Ot.edgeTextEdit&&ue.text.editable&&Ce.setElementStateById(ue.id,Io.TEXT_EDIT),ue.modelType===so.POLYLINE_EDGE){var Ft=ue,hn=Ce.getPointByClient({x:U.x,y:U.y}).canvasOverlayPosition,Hn=hn.x,zn=hn.y,Ar=co({x:Hn,y:zn},Ft.points);Ft.dbClickPosition=Ar}Ce.eventCenter.emit(ur.EDGE_DBCLICK,{data:Ve,e:U,position:qe})}else Ce.eventCenter.emit(ur.ELEMENT_CLICK,{data:Ve,e:U,position:qe}),Ce.eventCenter.emit(ur.EDGE_CLICK,{data:Ve,e:U,position:qe});var Vn=Ce.editConfigModel;Ce.selectEdgeById(ue.id,gd(U,Vn)),m.toFront()}})),m}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 m=this.props,_=m.model,A=m.graphModel;if(_.state===Io.TEXT_EDIT)return null;var N=!1,U=A.editConfigModel;return(_.text.draggable||U.edgeTextDraggable)&&(N=!0),Object(re.g)(uB,{ref:this.textRef,editable:U.edgeTextEdit&&_.text.editable,model:_,graphModel:A,draggable:N})}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=m.isSelected;return{start:_,end:A,hover:this.state.hover,isSelected:N}}},{key:"getLastTwoPoints",value:function(){var m=this.props.model;return[m.startPoint,m.endPoint]}},{key:"getArrowStyle",value:function(){return null}},{key:"getArrow",value:function(){var m=this.props.model,_=m.id,A=m.getArrowStyle(),N=A.refY,U=N===void 0?0:N,H=A.refX,oe=H===void 0?2:H,ue=mB(this.getLastTwoPoints(),2),Ce=ue[0],Ve=ue[1],qe="auto";return Ce!==null&&Ve!==null&&(qe=gv(Jp({x:Ve.x-Ce.x,y:Ve.y-Ce.y,z:0}))),Object(re.g)("g",null,Object(re.g)("defs",null,Object(re.g)("marker",{id:"marker-start-".concat(_),refX:-oe,refY:U,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse"},this.getStartArrow()),Object(re.g)("marker",{id:"marker-end-".concat(_),refX:oe,refY:U,overflow:"visible",orient:qe,markerUnits:"userSpaceOnUse"},this.getEndArrow())))}},{key:"getStartArrow",value:function(){var m=this.props.model.getArrowStyle();return m.stroke,m.strokeWidth,m.offset,m.verticalLength,Object(re.g)("path",null)}},{key:"getEndArrow",value:function(){var m=this.props.model.getArrowStyle(),_=m.stroke,A=m.strokeWidth,N=m.offset,U=m.verticalLength;return Object(re.g)("path",{stroke:_,fill:_,strokeWidth:A,transform:"rotate(180)",d:"M 0 0 L ".concat(N," -").concat(U," L ").concat(N," ").concat(U," Z")})}},{key:"getAdjustPointShape",value:function(m,_,A){var N=A.getAdjustPointStyle();return Object(re.g)($m,Py({className:"lf-edge-adjust-point"},N,{x:m,y:_}))}},{key:"getAdjustPoints",value:function(){var m=this.props,_=m.model,A=m.graphModel,N=_.getAdjustStart(),U=_.getAdjustEnd();return Object(re.g)("g",null,Object(re.g)(cN,Py({type:"SOURCE"},N,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:_,graphModel:A})),Object(re.g)(cN,Py({type:"TARGET"},U,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:_,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 m=this.props,_=m.graphModel,A=m.model;_.toFront(A.id)}},{key:"render",value:function(){var m=this.props,_=m.model,A=_.isSelected,N=_.isHitable,U=_.isShowAdjustPoint;return m.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()),U&&A?this.getAdjustPoints():"")}}])&&yB(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 wB(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return fN(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 fN(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 fN(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=wB(d,2),y=p[0],m=p[1],_=_O(m);y!=="style"&&_==="object"||(u[y]=m)})),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 EB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function xB(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 OB(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 SB(this,d)}}function SB(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&EO(m,_)})(y,c);var u,d,p=OB(y);function y(){return EB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=m.isAnimation,U=m.arrowConfig,H=m.getEdgeStyle(),oe=m.getEdgeAnimationStyle(),ue=oe.strokeDasharray,Ce=oe.stroke,Ve=oe.strokeDashoffset,qe=oe.animationName,Ot=oe.animationDuration,xt=oe.animationIterationCount,Ft=oe.animationTimingFunction,hn=oe.animationDirection;return Object(re.g)(Fm,wO({},H,{x1:_.x,y1:_.y,x2:A.x,y2:A.y},U,N?{strokeDasharray:ue,stroke:Ce,style:{strokeDashoffset:Ve,animationName:qe,animationDuration:Ot,animationIterationCount:xt,animationTimingFunction:Ft,animationDirection:hn}}:{}))}},{key:"getAppendWidth",value:function(){var m=this.props.model,_=m.startPoint,A=m.endPoint,N=sa({start:_,end:A}),U=N.d,H=N.strokeWidth,oe=N.fill,ue=N.strokeDasharray,Ce=N.stroke;return Object(re.g)(Ry,{d:U,fill:oe,strokeWidth:H,stroke:Ce,strokeDasharray:ue})}}])&&xB(u.prototype,d),y})(ky);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 AB(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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}var MB=function(c){var u={points:"",fill:"none"};return Object.entries(c).forEach((function(d){var p=AB(d,2),y=p[0],m=p[1];(y==="style"||OO(m)!=="object")&&(u[y]=m)})),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 hN(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?hN(Object(d),!0).forEach((function(p){Zf(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):hN(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 TB(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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}function CB(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 NB(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(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&MO(m,_)})(y,c);var u,d,p=NB(y);function y(){var m;return(function(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")})(this,y),Zf(Kf(m=p.call(this)),"drag",void 0),Zf(Kf(m),"isDragging",void 0),Zf(Kf(m),"isShowAdjustPointTemp",void 0),Zf(Kf(m),"appendInfo",void 0),Zf(Kf(m),"onDragStart",(function(){var _=m.props.model;_.dragAppendStart(),m.isShowAdjustPointTemp=_.isShowAdjustPoint,_.isShowAdjustPoint=!1})),Zf(Kf(m),"onDragging",(function(_){var A=_.deltaX,N=_.deltaY,U=m.props,H=U.model,oe=U.graphModel;m.isDragging=!0;var ue=oe.transformModel,Ce=oe.editConfigModel,Ve=TB(ue.fixDeltaXY(A,N),2),qe=Ve[0],Ot=Ve[1],xt=H,Ft=Ce.adjustEdgeMiddle;m.appendInfo=Ft?xt.dragAppendSimple(m.appendInfo,{x:qe,y:Ot}):xt.dragAppend(m.appendInfo,{x:qe,y:Ot})})),Zf(Kf(m),"onDragEnd",(function(){var _=m.props,A=_.model,N=_.graphModel.eventCenter,U=A;U.dragAppendEnd(),m.isDragging=!1,U.isShowAdjustPoint=m.isShowAdjustPointTemp,m.appendInfo=void 0,N.emit(ur.EDGE_ADJUST,{data:U.getData()})})),Zf(Kf(m),"beforeDragStart",(function(_,A){A.dragAble&&m.drag.handleMouseDown(_),m.appendInfo=A})),m.drag=new Te({onDragStart:m.onDragStart,onDragging:m.onDragging,onDragEnd:m.onDragEnd,isStopPropagation:!1}),m}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.points,A=m.isAnimation,N=m.arrowConfig,U=m.getEdgeStyle(),H=m.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ce=H.strokeDashoffset,Ve=H.animationName,qe=H.animationDuration,Ot=H.animationIterationCount,xt=H.animationTimingFunction,Ft=H.animationDirection;return Object(re.g)(MB,AO({points:_},U,N,A?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ce,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=m.points,A=m.isSelected,N={start:null,end:null,hover:this.state.hover,isSelected:A},U=jr(_);return U.length>=2&&(N.start=U[U.length-2],N.end=U[U.length-1]),N}},{key:"getLastTwoPoints",value:function(){var m=this.props.model.points,_=jr(m);return _.length>=2?[_[_.length-2],_[_.length-1]]:[null,null]}},{key:"getAppendAttributes",value:function(m){var _,A=m.start,N=m.end;if(A.x===N.x&&A.y===N.y)_="";else{var U={start:A,end:N,offset:10,verticalLength:5},H=Cc(Qb(Qb({},U),{},{type:"start"})),oe=Cc(Qb(Qb({},U),{},{type:"end"}));_="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:_,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}}},{key:"getAppendShape",value:function(m){var _=this.getAppendAttributes(m),A=_.d,N=_.strokeWidth,U=_.fill,H=_.strokeDasharray,oe=_.stroke;return Object(re.g)(Ry,{d:A,fill:U,strokeWidth:N,stroke:oe,strokeDasharray:H})}},{key:"getAppendWidth",value:function(){for(var m=this,_=this.props,A=_.model,N=_.graphModel,U=A.pointsList,H=A.draggable,oe=[],ue=U.length,Ce=function(qe){var Ot="lf-polyline-append",xt={start:{x:U[qe].x,y:U[qe].y},end:{x:U[qe+1].x,y:U[qe+1].y},startIndex:qe,endIndex:qe+1,direction:"",dragAble:!0},Ft=Object(re.g)("g",{className:Ot},m.getAppendShape(xt)),hn=N.editConfigModel,Hn=hn.adjustEdge,zn=hn.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:m.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(er){return m.beforeDragStart(er,xt)}},Object(re.g)("g",{className:Ot},m.getAppendShape(xt)))}oe.push(Ft)},Ve=0;Ve<ue-1;Ve++)Ce(Ve);return Object(re.g)("g",null,oe)}}])&&CB(u.prototype,d),y})(ky);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 kB(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}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 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 RB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function DB(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 PO(c,u){return PO=Object.setPrototypeOf||function(d,p){return d.__proto__=p,d},PO(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=t0(c);if(u){var y=t0(this).constructor;d=Reflect.construct(p,arguments,y)}else d=p.apply(this,arguments);return LB(this,d)}}function LB(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 kO=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&PO(m,_)})(y,c);var u,d,p=jB(y);function y(){return RB(this,y),p.apply(this,arguments)}return u=y,(d=[{key:"getEdge",value:function(){var m=this.props.model,_=m.getEdgeStyle(),A=m.path,N=m.isAnimation,U=m.arrowConfig,H=m.getEdgeAnimationStyle(),oe=H.strokeDasharray,ue=H.stroke,Ce=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},_,U,N?{strokeDasharray:oe,stroke:ue,style:{strokeDashoffset:Ce,animationName:Ve,animationDuration:qe,animationIterationCount:Ot,animationTimingFunction:xt,animationDirection:Ft}}:{}))}},{key:"getAppendWidth",value:function(){var m=this.props.model.path;return Object(re.g)(Ry,{d:m,strokeWidth:10,stroke:"transparent",fill:"none"})}},{key:"getArrowInfo",value:function(){var m=this.props.model,_=this.state.hover,A=m.isSelected,N=m.getArrowStyle().offset,U=m.pointsList.map((function(oe){return{x:oe.x,y:oe.y}})),H=kB(la(U,N),2);return{start:H[0],end:H[1],hover:_,isSelected:A}}},{key:"getLastTwoPoints",value:function(){var m=this.props.model,_=m.getArrowStyle().offset,A=m.pointsList.map((function(N){return{x:N.x,y:N.y}}));return la(A,_)}}])&&DB(u.prototype,d),y})(ky);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 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 IB(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}function FB(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}function BB(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 $B(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 UB(this,d)}}function UB(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 VB=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&DO(m,_)})(y,c);var u,d,p=$B(y);function y(){return FB(this,y),p.apply(this,arguments)}return u=y,d=[{key:"getArrowAttributes",value:function(){var m=this.props,_=m.arrowInfo,A=m.style,N=_.start,U=_.end,H={start:N,end:U,offset:A.offset,verticalLength:A.verticalLength,type:"end"},oe=Cc(H),ue=oe.leftX,Ce=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?gN(Object(Ft),!0).forEach((function(hn){IB(Ot,hn,Ft[hn])})):Object.getOwnPropertyDescriptors?Object.defineProperties(Ot,Object.getOwnPropertyDescriptors(Ft)):gN(Object(Ft)).forEach((function(hn){Object.defineProperty(Ot,hn,Object.getOwnPropertyDescriptor(Ft,hn))}))}return Ot})({d:"M".concat(ue," ").concat(Ce," L").concat(U.x," ").concat(U.y," L").concat(Ve," ").concat(qe," z")},A)}},{key:"getShape",value:function(){var m=this.getArrowAttributes(),_=m.d,A=m.strokeWidth,N=m.stroke,U=m.fill;return Object(re.g)(Ry,{d:_,fill:U,strokeWidth:A,stroke:N})}},{key:"render",value:function(){return Object(re.g)("g",{className:"lf-arrow"},this.getShape())}}],d&&BB(u.prototype,d),y})(re.a),yN=function(c,u){return It(c,u)},WB=function(c){var u=c==null?0:c.length;return u?c[u-1]:void 0},jO=function(){return En.a.Date.now()},GB=Math.max,zB=Math.min,HB=function(c,u,d){var p,y,m,_,A,N,U=0,H=!1,oe=!1,ue=!0;if(typeof c!="function")throw new TypeError("Expected a function");function Ce(hn){var Hn=p,zn=y;return p=y=void 0,U=hn,_=c.apply(zn,Hn)}function Ve(hn){return U=hn,A=setTimeout(Ot,u),H?Ce(hn):_}function qe(hn){var Hn=hn-N;return N===void 0||Hn>=u||Hn<0||oe&&hn-U>=m}function Ot(){var hn=jO();if(qe(hn))return xt(hn);A=setTimeout(Ot,(function(Hn){var zn=u-(Hn-N);return oe?zB(zn,m-(Hn-U)):zn})(hn))}function xt(hn){return A=void 0,ue&&p?Ce(hn):(p=y=void 0,_)}function Ft(){var hn=jO(),Hn=qe(hn);if(p=arguments,y=this,N=hn,Hn){if(A===void 0)return Ve(N);if(oe)return clearTimeout(A),A=setTimeout(Ot,u),Ce(N)}return A===void 0&&(A=setTimeout(Ot,u)),_}return u=_d(u)||0,In(d)&&(H=!!d.leading,m=(oe="maxWait"in d)?GB(_d(d.maxWait)||0,u):m,ue="trailing"in d?!!d.trailing:ue),Ft.cancel=function(){A!==void 0&&clearTimeout(A),U=0,p=N=y=A=void 0},Ft.flush=function(){return A===void 0?_:xt(jO())},Ft},XB=r(172);function YB(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 ih(c,u,d){return u in c?Object.defineProperty(c,u,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[u]=d,c}var _N,bN,wN,qB=(function(){function c(p){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,c),ih(this,"undos",[]),ih(this,"redos",[]),ih(this,"callbacks",[]),ih(this,"stopWatch",null),ih(this,"curData",null),ih(this,"maxSize",50),ih(this,"waitTime",100),ih(this,"eventCenter",void 0),this.eventCenter=p}var u,d;return u=c,(d=[{key:"add",value:function(p){yN(WB(this.undos),p)||(this.undos.push(p),yN(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(XB.a)(p,HB((function(){var m=p.modelToHistoryData();m&&y.add(m)}),this.waitTime))}}])&&YB(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 KB(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||(function(d,p){if(d){if(typeof d=="string")return EN(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 EN(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 EN(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 xN(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?xN(Object(d),!0).forEach((function(p){Sv(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):xN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function ON(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 ZB(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 JB(this,d)}}function JB(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 Zm(c)}function Zm(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 SN,AN,MN,FO=Lc((wN=bN=(function(c){(function(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function");_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,writable:!0,configurable:!0}}),A&&IO(_,A)})(m,c);var u,d,p,y=ZB(m);function m(){var _;return(function(A,N){if(!(A instanceof N))throw new TypeError("Cannot call a class as a function")})(this,m),Sv(Zm(_=y.call(this)),"ref",Object(re.f)()),Sv(Zm(_),"__prevText",{type:"",text:"",id:""}),Sv(Zm(_),"keyupHandler",(function(A){var N=_.props.graphModel.textEditElement;A.key==="Enter"&&A.altKey&&N.setElementState(0)})),Sv(Zm(_),"inputHandler",(function(A){var N=A.target.innerText,U=_.props.graphModel.textEditElement;_.__prevText={type:U.type,text:N.replace(/(\r\n)+$|(\n)+$/,""),id:U.id}})),Sv(Zm(_),"keydownHandler",(function(A){A.stopPropagation()})),_.state={style:{left:0,top:0}},_}return u=m,p=[{key:"getDerivedStateFromProps",value:function(_){var A,N=_.graphModel,U=N.transformModel,H=N.theme,oe=H.inputText,ue=N.textEditElement;if(ue){var Ce;if((Ce=ue.text)===null||Ce===void 0||!Ce.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 hn=H.edgeText,Hn=hn.overflowMode,zn=hn.lineHeight,Ar=hn.wrapPadding,Vn=hn.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,ga=Fo.width,ya=Fo.modelType,Cs=Fo.textWidth||zr||ga;(ya!==so.TEXT_NODE&&er==="autoWrap"||ya===so.TEXT_NODE&&zr)&&(A=Ov(Ov({},Ft),{},{width:Cs,minWidth:Cs,lineHeight:Eo,padding:Co}))}var fu=ue.text,pu=fu.x,Pd=fu.y,Av=KB(U.CanvasPointToHtmlPoint([pu,Pd]),2);return{style:Ov(Ov({left:Av[0],top:Av[1]},A),oe)}}}}],(d=[{key:"componentDidUpdate",value:function(){var _=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,U=A.id;_.updateText(U,N),_.eventCenter.emit(ur.TEXT_UPDATE,Ov({},this.__prevText)),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}}},{key:"placeCaretAtEnd",value:function(_){if(window.getSelection!==void 0&&document.createRange!==void 0){var A=document.createRange();A.selectNodeContents(_),A.collapse(!1);var N=window.getSelection();N.removeAllRanges(),N.addRange(A)}}},{key:"render",value:function(){var _,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},(_=A.text)===null||_===void 0?void 0:_.value):null}}])&&ON(u.prototype,d),p&&ON(u,p),m})(re.a),Sv(bN,"toolName","textEdit"),_N=wN))||_N,QB=function(c){return c.modelType===so.LINE_EDGE?(function(u){var d=u.startPoint,p=u.endPoint,y=(d.x+p.x)/2,m=(d.y+p.y)/2,_=Math.abs(d.x-p.x)+10,A=Math.abs(d.y-p.y)+10;return{x:y-_/2,y:m-A/2,x1:y+_/2,y1:m+A/2}})(c):c.modelType===so.POLYLINE_EDGE?(function(u){var d=u.points,p=jr(d),y=St(p,8),m=y.x,_=y.y,A=y.width,N=y.height;return{x:m-A/2,y:_-N/2,x1:m+A/2,y1:_+N/2}})(c):c.modelType===so.BEZIER_EDGE?(function(u){var d=u.path,p=di(d),y=St(p,8),m=y.x,_=y.y,A=y.width,N=y.height;return{x:m-A/2,y:_-N/2,x1:m+A/2,y1:_+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 TN(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 m,_,A=[],N=!0,U=!1;try{for(y=y.call(d);!(N=(m=y.next()).done)&&(A.push(m.value),!p||A.length!==p);N=!0);}catch(H){U=!0,_=H}finally{try{N||y.return==null||y.return()}finally{if(U)throw _}}return A}})(c,u)||CN(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 e$(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)||CN(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 CN(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 t$(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 n$(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 r$(this,d)}}function r$(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 Jm(c)}function Jm(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 Qm(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=Lc((MN=AN=(function(c){(function(m,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(_&&_.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),_&&UO(m,_)})(y,c);var u,d,p=n$(y);function y(m){var _;(function(H,oe){if(!(H instanceof oe))throw new TypeError("Cannot call a class as a function")})(this,y),Qm(Jm(_=p.call(this)),"stepDrag",void 0),Qm(Jm(_),"handleMouseDown",(function(H){_.stepDrag.handleMouseDown(H)})),Qm(Jm(_),"handleWheelEvent",(function(H){var oe,ue;H.preventDefault();var Ce=H.deltaX,Ve=H.deltaY,qe=H.clientX,Ot=H.clientY,xt=H.ctrlKey,Ft=new WheelEvent("wheel",{deltaX:Ce,deltaY:Ve,clientX:qe,clientY:Ot,ctrlKey:xt});(oe=_.props.logicFlow.container)===null||oe===void 0||(ue=oe.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||ue===void 0||ue.dispatchEvent(Ft)})),Qm(Jm(_),"onDragging",(function(H){var oe=H.deltaX,ue=H.deltaY,Ce=_.props.graphModel,Ve=Ce.getSelectElements(!0);Ce.moveNodes(Ve.nodes.map((function(qe){return qe.id})),oe,ue)})),Qm(Jm(_),"handleContextMenu",(function(H){H.preventDefault();var oe=_.props,ue=oe.graphModel,Ce=oe.graphModel,Ve=Ce.eventCenter,qe=Ce.selectElements,Ot=ue.getPointByClient({x:H.clientX,y:H.clientY}),xt={nodes:[],edges:[]};e$(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=m.graphModel,N=A.gridSize,U=A.eventCenter;return _.stepDrag=new Te({onDragging:_.onDragging,step:N,eventType:"SELECTION",eventCenter:U}),_}return u=y,(d=[{key:"render",value:function(){var m=this.props.graphModel,_=m.selectElements,A=m.transformModel;if(!(_.size<=1)){var N=Number.MAX_SAFE_INTEGER,U=Number.MAX_SAFE_INTEGER,H=Number.MIN_SAFE_INTEGER,oe=Number.MIN_SAFE_INTEGER;_.forEach((function(qe){var Ot={x:0,y:0,x1:0,y1:0};qe.BaseType===ei.NODE&&(Ot=(function(xt){var Ft=xt.x,hn=xt.y,Hn=xt.width,zn=xt.height;return{x:Ft-Hn/2,y:hn-zn/2,x1:Ft+Hn/2,y1:hn+zn/2}})(qe)),qe.BaseType===ei.EDGE&&(Ot=QB(qe)),N=Math.min(N,Ot.x),U=Math.min(U,Ot.y),H=Math.max(H,Ot.x1),oe=Math.max(oe,Ot.y1)}));var ue=TN(A.CanvasPointToHtmlPoint([N,U]),2);N=ue[0],U=ue[1];var Ce=TN(A.CanvasPointToHtmlPoint([H,oe]),2);H=Ce[0],oe=Ce[1];var Ve={left:"".concat(N-10,"px"),top:"".concat(U-10,"px"),width:"".concat(H-N+20,"px"),height:"".concat(oe-U+20,"px")};return Object(re.g)("div",{className:"lf-multiple-select",style:Ve,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}}}])&&t$(u.prototype,d),y})(re.a),Qm(AN,"toolName","multipleSelect"),SN=MN))||SN;function o$(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 i$=(function(){function c(p){(function(m,_){if(!(m instanceof _))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 m=y.textEditElement,_=y.editConfigModel,A=_.edgeTextEdit,N=_.nodeTextEdit;(A||N)&&m&&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}}])&&o$(u.prototype,d),c})(),a$=r(173),s$=r.n(a$);function l$(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 NN=(function(){function c(p){(function(m,_){if(!(m instanceof _))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 U=N.keys,H=N.callback,oe=N.action;return p.on(U,H,oe)}));else{var m=y.keys,_=y.callback,A=y.action;this.on(m,_,A)}}},{key:"on",value:function(p,y,m){this.mousetrap.bind(this.getKeys(p),y,m)}},{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(m){return y.formatKey(m)}))}},{key:"formatKey",value:function(p){return p.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")}}])&&l$(u.prototype,d),c})(),u$=NN,Jf=null;function PN(c,u){return c.x+=u,c.y+=u,c.text&&(c.text.x+=u,c.text.y+=u),c}function kN(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 eg=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 RN(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?RN(Object(d),!0).forEach((function(p){ua(c,p,d[p])})):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):RN(Object(d)).forEach((function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(d,p))}))}return c}function DN(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 m,_,A=this;(function(N,U){if(!(N instanceof U))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=NT(y),this.options=y,this.container=this.initContainer(y.container),this.plugins=y.plugins,this.graphModel=new v5(Dy({},y)),this.tool=new i$(this),this.history=new qB(this.graphModel.eventCenter),this.dnd=new f6({lf:this}),this.keyboard=new u$({lf:this,keyboard:y.keyboard}),y.snapline!==!1&&(this.snaplineModel=new GC(this.graphModel),m=this.graphModel.eventCenter,_=this.snaplineModel,m.on("node:mousemove",(function(N){var U=N.data;_.setNodeSnapLine(U)})),m.on("node:mouseup",(function(){_.clearSnapline()}))),(function(N,U){var H=N.keyboard,oe=H.options.keyboard;H.on(["cmd + c","ctrl + c"],(function(){if(GO=eg,!oe.enabled||U.textEditElement)return!0;var ue=N.options.guards,Ce=U.getSelectElements(!1);return ue&&ue.beforeClone&&!ue.beforeClone(Ce)||Ce.nodes.length===0&&Ce.edges.length===0?(Jf=null,!0):((Jf=Ce).nodes.forEach((function(Ve){return PN(Ve,eg)})),Jf.edges.forEach((function(Ve){return kN(Ve,eg)})),!1)})),H.on(["cmd + v","ctrl + v"],(function(){if(!oe.enabled||U.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(Ce){return N.selectElementById(Ce.id,!0)})),ue.edges.forEach((function(Ce){return N.selectElementById(Ce.id,!0)})),Jf.nodes.forEach((function(Ce){return PN(Ce,eg)})),Jf.edges.forEach((function(Ce){return kN(Ce,eg)})),GO+=eg}return!1})),H.on(["cmd + z","ctrl + z"],(function(){return!oe.enabled||!!U.textEditElement||(N.undo(),!1)})),H.on(["cmd + y","ctrl + y"],(function(){return!oe.enabled||!!U.textEditElement||(N.redo(),!1)})),H.on(["backspace"],(function(){if(!oe.enabled||U.textEditElement)return!0;var ue=U.getSelectElements(!0);return N.clearSelectElements(),ue.edges.forEach((function(Ce){return N.deleteEdge(Ce.id)})),ue.nodes.forEach((function(Ce){return N.deleteNode(Ce.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,m){var _=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(typeof y=="string"){var A={BaseEdge:ky,BaseEdgeModel:Kp,BaseNode:Yf,BaseNodeModel:Xf,RectNode:Fx,RectNodeModel:vx,CircleNode:Vx,CircleNodeModel:K1,PolygonNode:Xx,PolygonNodeModel:dx,TextNode:iO,TextNodeModel:_x,LineEdge:xO,LineEdgeModel:xd,DiamondNode:Zx,DiamondNodeModel:tx,PolylineEdge:TO,PolylineEdgeModel:Ts,BezierEdge:kO,BezierEdgeModel:G1,EllipseNode:nO,EllipseNodeModel:ix,HtmlNode:uO,HtmlNodeModel:Ex,h:re.g,type:y};this.viewMap.forEach((function(ue){var Ce=ue.extendKey;Ce&&(A[Ce]=ue)})),this.graphModel.modelMap.forEach((function(ue){var Ce=ue.extendKey;Ce&&(A[Ce]=ue)}));var N=m(A),U=N.view,H=N.model,oe=U;_&&!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 m=y.view;y.isObserverView===!1||m.isObervered||(m.isObervered=!0,m=ae(m)),this.setView(y.type,m),this.graphModel.setModel(y.type,y.model)}},{key:"batchRegister",value:function(){var y=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];m.forEach((function(_){y.registerElement(_)}))}},{key:"defaultRegister",value:function(){this.registerElement({view:Fx,model:vx,type:"rect"}),this.registerElement({type:"circle",view:Vx,model:K1}),this.registerElement({type:"polygon",view:Xx,model:dx}),this.registerElement({type:"line",view:xO,model:xd}),this.registerElement({type:"polyline",view:TO,model:Ts}),this.registerElement({type:"bezier",view:kO,model:G1}),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 m=arguments.length>1&&arguments[1]!==void 0&&arguments[1],_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];this.graphModel.selectElementById(y,m),!m&&_&&this.graphModel.toFront(y)}},{key:"focusOn",value:function(y){var m=this.graphModel.transformModel,_=y.coordinate,A=y.id;if(!_){var N=this.getNodeModelById(A);N&&(_=N.getData());var U=this.getEdgeModelById(A);U&&(_=U.textPosition)}var H=_,oe=H.x,ue=H.y;m.focusOn(oe,ue,this.graphModel.width,this.graphModel.height)}},{key:"setTheme",value:function(y){this.graphModel.setTheme(y)}},{key:"resize",value:function(y,m){this.graphModel.resize(y,m),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,m){this.graphModel.updateText(y,m)}},{key:"deleteElement",value:function(y){var m,_,A,N=this.getModelById(y);return!!N&&(_=(A=(ua(m={},ei.NODE,this.deleteNode),ua(m,ei.EDGE,this.deleteEdge),m)[N.BaseType])===null||A===void 0?void 0:A.call(this,y))!==null&&_!==void 0&&_}},{key:"getModelById",value:function(y){return this.graphModel.getElement(y)}},{key:"getDataById",value:function(y){var m;return(m=this.graphModel.getElement(y))===null||m===void 0?void 0:m.getData()}},{key:"changeNodeType",value:function(y,m){this.graphModel.changeNodeType(y,m)}},{key:"changeEdgeType",value:function(y,m){this.graphModel.changeEdgeType(y,m)}},{key:"getNodeEdges",value:function(y){return this.graphModel.getNodeEdges(y)}},{key:"addNode",value:function(y){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ur.NODE_ADD,_=arguments.length>2?arguments[2]:void 0;return this.graphModel.addNode(y,m,_)}},{key:"deleteNode",value:function(y){var m=this.graphModel.getNodeModelById(y);if(!m)return!1;var _=m.getData(),A=this.options.guards,N=!A||!A.beforeDelete||A.beforeDelete(_);return N&&this.graphModel.deleteNode(y),N}},{key:"cloneNode",value:function(y){var m=this.graphModel.getNodeModelById(y).getData(),_=this.options.guards;if(!_||!_.beforeClone||_.beforeClone(m))return this.graphModel.cloneNode(y)}},{key:"changeNodeId",value:function(y,m){return this.graphModel.changeNodeId(y,m)}},{key:"getNodeModelById",value:function(y){return this.graphModel.getNodeModelById(y)}},{key:"getNodeDataById",value:function(y){var m;return(m=this.graphModel.getNodeModelById(y))===null||m===void 0?void 0:m.getData()}},{key:"addEdge",value:function(y){return this.graphModel.addEdge(y)}},{key:"deleteEdge",value:function(y){var m=this.options.guards,_=this.graphModel.edgesMap[y];if(!_)return!1;var A=_.model.getData(),N=!m||!m.beforeDelete||m.beforeDelete(A);return N&&this.graphModel.deleteEdgeById(y),N}},{key:"deleteEdgeByNodeId",value:function(y){var m=y.sourceNodeId,_=y.targetNodeId;m&&_?this.graphModel.deleteEdgeBySourceAndTarget(m,_):m?this.graphModel.deleteEdgeBySource(m):_&&this.graphModel.deleteEdgeByTarget(_)}},{key:"changeEdgeId",value:function(y,m){return this.graphModel.changeEdgeId(y,m)}},{key:"getEdgeModelById",value:function(y){var m;return(m=this.graphModel.edgesMap[y])===null||m===void 0?void 0:m.model}},{key:"getEdgeModels",value:function(y){var m=this.graphModel.edges,_=y.sourceNodeId,A=y.targetNodeId;if(_&&A){var N=[];return m.forEach((function(oe){oe.sourceNodeId===_&&oe.targetNodeId===A&&N.push(oe)})),N}if(_){var U=[];return m.forEach((function(oe){oe.sourceNodeId===_&&U.push(oe)})),U}if(A){var H=[];return m.forEach((function(oe){oe.targetNodeId===A&&H.push(oe)})),H}return[]}},{key:"getEdgeDataById",value:function(y){var m;return(m=this.getEdgeModelById(y))===null||m===void 0?void 0:m.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,m){var _;(_=this.graphModel.getElement(y))===null||_===void 0||_.setProperties(ma(m))}},{key:"deleteProperty",value:function(y,m){var _;(_=this.graphModel.getElement(y))===null||_===void 0||_.deleteProperty(m)}},{key:"getProperties",value:function(y){var m;return(m=this.graphModel.getElement(y))===null||m===void 0?void 0:m.getProperties()}},{key:"toFront",value:function(y){this.graphModel.toFront(y)}},{key:"setElementZIndex",value:function(y,m){return this.graphModel.setElementZIndex(y,m)}},{key:"addElements",value:function(y){for(var m=this,_=y.nodes,A=y.edges,N={},U={nodes:[],edges:[]},H=0;H<_.length;H++){var oe=_[H],ue=oe.id,Ce=this.addNode(oe);if(!Ce)return;ue&&(N[ue]=Ce.id),U.nodes.push(Ce)}return A.forEach((function(Ve){var qe=Ve.sourceNodeId,Ot=Ve.targetNodeId;N[qe]&&(qe=N[qe]),N[Ot]&&(Ot=N[Ot]);var xt=m.graphModel.addEdge(Dy(Dy({},Ve),{},{sourceNodeId:qe,targetNodeId:Ot}));U.edges.push(xt)})),U}},{key:"getAreaElement",value:function(y,m){var _=!(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,m,_,A,N).map((function(U){return U.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 m=arguments.length,_=new Array(m),A=0;A<m;A++)_[A]=arguments[A];return this.adapterOut.apply(this,[y].concat(_))}return y}},{key:"getGraphRawData",value:function(){return this.graphModel.modelToGraphData()}},{key:"clearData",value:function(){this.graphModel.clearData()}},{key:"updateEditConfig",value:function(y){var m=this.graphModel,_=m.editConfigModel,A=m.transformModel;_.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,m){return this.graphModel.getPointByClient({x:y,y:m})}},{key:"undo",value:function(){if(this.history.undoAble()){var y=ma(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"redo",value:function(){if(this.history.redoAble()){var y=ma(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(y)}}},{key:"zoom",value:function(y,m){return this.graphModel.transformModel.zoom(y,m)}},{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,m){this.graphModel.transformModel.translate(y,m)}},{key:"resetTranslate",value:function(){var y=this.graphModel.transformModel,m=y.TRANSLATE_X,_=y.TRANSLATE_Y;this.translate(-m,-_)}},{key:"translateCenter",value:function(){this.graphModel.translateCenter()}},{key:"fitView",value:function(y,m){m===void 0&&(m=y),this.graphModel.fitView(y,m)}},{key:"openEdgeAnimation",value:function(y){this.graphModel.openEdgeAnimation(y)}},{key:"closeEdgeAnimation",value:function(y){this.graphModel.closeEdgeAnimation(y)}},{key:"on",value:function(y,m){this.graphModel.eventCenter.on(y,m)}},{key:"off",value:function(y,m){this.graphModel.eventCenter.off(y,m)}},{key:"once",value:function(y,m){this.graphModel.eventCenter.once(y,m)}},{key:"emit",value:function(y,m){this.graphModel.eventCenter.emit(y,m)}},{key:"initContainer",value:function(y){var m=document.createElement("div");return m.style.position="relative",m.style.width="100%",m.style.height="100%",y.innerHTML="",y.appendChild(m),m}},{key:"installPlugins",value:function(){var y,m=this,_=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 U=null,H=null;N[HO]?(U=N.extension,H=N.props):U=N;var oe=U.pluginName||U.name;_.indexOf(oe)===-1&&m.installPlugin(U,H)}))}},{key:"installPlugin",value:function(y,m){if(zO(y)==="object"){var _=y.install,A=y.render;return _&&_.call(y,this,c),A&&this.components.push(A.bind(y)),void(this.extension[y.pluginName]=y)}var N=y,U=new N({lf:this,LogicFlow:c,options:this.options.pluginsOptions,props:m});U.render&&this.components.push(U.render.bind(U)),this.extension[N.pluginName]=U}},{key:"updateAttributes",value:function(y,m){this.graphModel.updateAttributes(y,m)}},{key:"createFakerNode",value:function(y){var m=this.graphModel.modelMap.get(y.type);if(m){var _=new m(Dy(Dy({},y),{},{virtual:!0}),this.graphModel);return this.graphModel.setFakerNode(_),_}}},{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,m){this.viewMap.set(y,m)}},{key:"renderRawData",value:function(y){this.graphModel.graphDataToModel(ma(y)),this.options.history!==!1&&this.history.watch(this.graphModel),Object(re.j)(Object(re.g)(c6,{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,m){var _,A,N=y.pluginName;N||(N=y.name);var U=(_=this.extensions.get(N))===null||_===void 0?void 0:_.extension;U&&U.destroy&&U.destroy(),this.extensions.set(N,(ua(A={},HO,HO),ua(A,"extension",y),ua(A,"props",m),A))}}],d&&DN(u.prototype,d),p&&DN(u,p),c})();function Lc(c){return ae(c)}ua(XO,"extensions",new Map),o.default=XO}])}))})(I0,I0.exports)),I0.exports}var Ud=Fne();const e8=Z_(Ud);let e1=!1;const Th=Rh({});function t8(t,e,n,o,r,i,a){i||(i=(l,s)=>({nodeModel:l,graph:s})),a||(a=(l,s)=>({getNode:()=>l,getGraph:()=>s})),e1&&(Th[t]=o7(_r({render:()=>Dg(i7,{to:n},[Dg(e,i(o,r))]),provide:()=>a(o,r)})))}function n8(t){e1&&delete Th[t]}function Bne(t){Object.keys(Th).forEach(e=>{e.startsWith(t)&&delete Th[e]})}function $ne(){Object.keys(Th).forEach(t=>{delete Th[t]})}function dE(){return e1}function Une(){return e1=!0,_r({props:{flowId:{type:String,required:!0}},setup(t){return()=>{const e=[];return Object.keys(Th).forEach(n=>{e.push(Th[n])}),Dg(Ir,{},e.map(n=>Dg(n)))}}})}class ai extends W3.view{constructor(n,o){super(n);hs(this,"isMounted");hs(this,"r");hs(this,"component");hs(this,"app");hs(this,"root");hs(this,"VueNode");hs(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 w7[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,l,s,f,h;const n=[];return this.props.model.type&&this.props.model.type==="start-node"&&(n.push({value:"global",label:kt("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:kt("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:(s=(l=this.props.model.properties)==null?void 0:l.node_data)==null?void 0:s.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((l,s)=>[...l,...s],[]),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){return super.getAnchorShape(n)}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(dE())t8(this.targetId(),this.component,n,o,r,void 0,(a,l)=>({getNode:()=>a,getGraph:()=>l,workflowMode:Qc.Application}));else{this.r=Dg(this.component,{properties:this.props.model.properties,nodeModel:this.props.model}),this.app=Lj({render(){return this.r},provide(){return{getNode:()=>o,getGraph:()=>r,workflowMode:Qc.Application}}}),this.app.use(a7,{locale:s7}),this.app.use(l7),this.app.use(u7),this.app.use(jj);for(const[a,l]of Object.entries(c7))this.app.component(a,l);(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(){dE()&&n8(this.targetId()),this.unmountVueComponent()}}class si extends W3.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){const n=super.getAnchorStyle(e);return e.type==="left"?(n.fill="red",n.hover&&(n.hover.fill="transparent",n.hover.stroke="transparent"),n.className="lf-hide-default"):n.fill="green",n}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}=jj.global;this.width=this.get_width();const n=(r,i)=>{const a=this.graphModel.getNodeIncomingNode(r);for(const l in a){const s=a[l];if(s.id===i)return!0;if(n(s.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,l)=>i.id==r.id?!1:!this.graphModel.getNodeIncomingEdge(i.id).find(h=>h.targetAnchorId==l.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,l)=>l.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!==Pr.Base.toString()&&([Pr.Start.toString(),Pr.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:si,view:Vne},r8=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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ja(),n=hr(()=>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=He(),i=hr({get:()=>(s.nodeModel.properties.node_data||Me.set(s.nodeModel.properties,"node_data",o),s.nodeModel.properties.node_data),set:h=>{Me.set(s.nodeModel.properties,"node_data",h)}});function a(h,v){const b=`${h}_list`;v?s.nodeModel.properties.node_data[b]||Me.set(s.nodeModel.properties.node_data,b,[]):delete s.nodeModel.properties.node_data[b]}const l=()=>{if(!s.nodeModel.properties.node_data.application_id){Me.set(s.nodeModel.properties,"status",500);return}oi({type:"application",systemType:n.value}).getApplicationDetail(s.nodeModel.properties.node_data.application_id).then(h=>{const v=Me.cloneDeep(s.nodeModel.properties.node_data.api_input_field_list),b=Me.cloneDeep(s.nodeModel.properties.node_data.user_input_field_list);if(j2(h.data.type)){const w=h.data.work_flow.nodes[0].properties.node_data,O=Me.cloneDeep(h.data.work_flow.nodes[0].properties.api_input_field_list),E=Me.cloneDeep(h.data.work_flow.nodes[0].properties.user_input_field_list),S=(O||[]).map(D=>{const k=v==null?void 0:v.find(B=>B.variable==D.variable);return k?{...D,value:k.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});Me.set(s.nodeModel.properties.node_data,"api_input_field_list",S);const M=(E||[]).map(D=>{const k=b==null?void 0:b.find(B=>B.field==D.field);return k?{...D,value:k.value,label:typeof D.label=="object"&&D.label!=null?D.label.label:D.label}:D});Me.set(s.nodeModel.properties.node_data,"user_input_field_list",M);const C=w.file_upload_enable,$=w.file_upload_setting;C?(a("document",$.document),a("image",$.image),a("audio",$.audio),a("video",$.video)):["document_list","image_list","audio_list","video_list"].forEach(D=>{delete s.nodeModel.properties.node_data[D]}),Me.set(s.nodeModel.properties,"status",h.data.id?200:500)}}).catch(h=>{console.log(h),Me.set(s.nodeModel.properties,"status",500)})},s=t,f=()=>{var h;return(h=r.value)==null?void 0:h.validate().catch(v=>Promise.reject({node:s.nodeModel,errMessage:v}))};return bo(()=>{l(),Me.set(s.nodeModel,"validate",f)}),(h,v)=>{const b=ne("el-form-item"),w=ne("AppIcon"),O=ne("el-tooltip"),E=ne("el-switch"),S=ne("el-form"),M=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Gne,_e(h.$t("views.applicationWorkflow.nodeSetting")),1),P(M,{shadow:"never",class:"card-never"},{default:j(()=>[P(S,{onSubmit:v[7]||(v[7]=gn(()=>{},["prevent"])),model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"applicationNodeFormRef",ref:r},{default:j(()=>[P(b,{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(()=>[P(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]=C=>i.value.question_reference_address=C)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),i.value.hasOwnProperty("document_list")||"document_list"in i.value?(Ne(),bt(b,{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(()=>[P(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]=C=>i.value.document_list=C)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("image_list")||"image_list"in i.value?(Ne(),bt(b,{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(()=>[P(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]=C=>i.value.image_list=C)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("audio_list")||"audio_list"in i.value?(Ne(),bt(b,{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(()=>[P(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]=C=>i.value.audio_list=C)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),i.value.hasOwnProperty("video_list")||"video_list"in i.value?(Ne(),bt(b,{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(()=>[P(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]=C=>i.value.video_list=C)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):Bn("",!0),(Ne(!0),mn(Ir,null,No(i.value.api_input_field_list,(C,$)=>(Ne(),mn("div",{key:"api-input-"+$},[P(b,{label:C.variable,prop:"api_input_field_list."+$+".value",rules:[{required:C.is_required,message:`${h.$t("common.inputPlaceholder")}${C.variable}`,trigger:"blur"}]},{default:j(()=>[P(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[$].value,"onUpdate:modelValue":D=>i.value.api_input_field_list[$].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),(Ne(!0),mn(Ir,null,No(i.value.user_input_field_list,(C,$)=>(Ne(),mn("div",{key:"user-input-"+$},[P(b,{label:C.label,prop:"user_input_field_list."+$+".value",rules:[{required:C.required,message:`${h.$t("common.inputPlaceholder")}${C.label}`,trigger:"blur"}]},{default:j(()=>[P(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[$].value,"onUpdate:modelValue":D=>i.value.user_input_field_list[$].value=D},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop","rules"])]))),128)),P(b,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[6]||(v[6]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",zne,[ee("div",Hne,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(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(()=>[P(w,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(E,{size:"small",modelValue:i.value.is_result,"onUpdate:modelValue":v[5]||(v[5]=C=>i.value.is_result=C)},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:si,view:Yne},o8=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 NR(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?NR(Object(n),!0).forEach(function(o){Kne(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):NR(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 up(){return up=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},up.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 hp=ap(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ab=ap(/Edge/i),PR=ap(/firefox/i),m_=ap(/safari/i)&&!ap(/chrome/i)&&!ap(/android/i),LM=ap(/iP(ad|od|hone)/i),i8=ap(/chrome/i)&&ap(/android/i),a8={capture:!1,passive:!1};function Vo(t,e,n){t.addEventListener(e,n,!hp&&a8)}function Bo(t,e,n){t.removeEventListener(e,n,!hp&&a8)}function fE(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 Wc(t,e,n,o){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&fE(t,e):fE(t,e))||o&&t===n)return t;if(t===n)break}while(t=s8(t))}return null}var kR=/\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(kR," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(kR," ")}}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 Ag(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 l8(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,l,s,f,h,v;if(t!==window&&t.parentNode&&t!==Hd()?(i=t.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,f=i.right,h=i.height,v=i.width):(a=0,l=0,s=window.innerHeight,f=window.innerWidth,h=window.innerHeight,v=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!hp))do if(r&&r.getBoundingClientRect&&(ro(r,"transform")!=="none"||n&&ro(r,"position")!=="static")){var b=r.getBoundingClientRect();a-=b.top+parseInt(ro(r,"border-top-width")),l-=b.left+parseInt(ro(r,"border-left-width")),s=a+i.height,f=l+i.width;break}while(r=r.parentNode);if(o&&t!==window){var w=Ag(r||t),O=w&&w.a,E=w&&w.d;w&&(a/=E,l/=O,v/=O,h/=E,s=a+h,f=l+v)}return{top:a,left:l,bottom:s,right:f,width:v,height:h}}}function RR(t,e,n){for(var o=_h(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=_h(o,!1)}return!1}function Xg(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)&&Wc(a[i],n.draggable,t,!1)){if(r===e)return a[i];r++}i++}return null}function IM(t,e){for(var n=t.lastElementChild;n&&(n===Zr.ghost||ro(n,"display")==="none"||e&&!fE(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||fE(t,e))&&n++;return n}function DR(t){var e=0,n=0,o=Hd();if(t)do{var r=Ag(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 _h(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 g_;function u8(t,e){return function(){if(!g_){var n=arguments,o=this;n.length===1?t.call(o,n[0]):t.apply(o,n),g_=setTimeout(function(){g_=void 0},e)}}}function nre(){clearTimeout(g_),g_=void 0}function c8(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function d8(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 f8(t,e,n){var o={};return Array.from(t.children).forEach(function(r){var i,a,l,s;if(!(!Wc(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((l=o.right)!==null&&l!==void 0?l:-1/0,f.right),o.bottom=Math.max((s=o.bottom)!==null&&s!==void 0?s:-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 zl="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=Ag(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(l){var s=0,f=l.target,h=f.fromRect,v=Ya(f),b=f.prevFromRect,w=f.prevToRect,O=l.rect,E=Ag(f,!0);E&&(v.top-=E.f,v.left-=E.e),f.toRect=v,f.thisAnimationDuration&&ES(b,v)&&!ES(h,v)&&(O.top-v.top)/(O.left-v.left)===(h.top-v.top)/(h.left-v.left)&&(s=ire(O,b,w,r.options)),ES(v,h)||(f.prevFromRect=h,f.prevToRect=v,s||(s=r.options.animation),r.animate(f,O,v,s)),s&&(i=!0,a=Math.max(a,s),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},s),f.thisAnimationDuration=s)}),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 l=Ag(this.el),s=l&&l.a,f=l&&l.d,h=(r.left-i.left)/(s||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 lg=[],xS={initializeByDefault:!0},sb={mount:function(e){for(var n in xS)xS.hasOwnProperty(n)&&!(n in e)&&(e[n]=xS[n]);lg.forEach(function(o){if(o.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),lg.push(e)},pluginEvent:function(e,n,o){var r=this;this.eventCanceled=!1,o.cancel=function(){r.eventCanceled=!0};var i=e+"Global";lg.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){lg.forEach(function(l){var s=l.pluginName;if(!(!e.options[s]&&!l.initializeByDefault)){var f=new l(e,n,e.options);f.sortable=e,f.options=e.options,e[s]=f,up(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 lg.forEach(function(r){typeof r.eventProperties=="function"&&up(o,r.eventProperties.call(n[r.pluginName],e))}),o},modifyOption:function(e,n,o){var r;return lg.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,l=t.fromEl,s=t.oldIndex,f=t.newIndex,h=t.oldDraggableIndex,v=t.newDraggableIndex,b=t.originalEvent,w=t.putSortable,O=t.extraEventProperties;if(e=e||n&&n[zl],!!e){var E,S=e.options,M="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!hp&&!ab?E=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(E=document.createEvent("Event"),E.initEvent(o,!0,!0)),E.to=a||n,E.from=l||n,E.item=r||n,E.clone=i,E.oldIndex=s,E.newIndex=f,E.oldDraggableIndex=h,E.newDraggableIndex=v,E.originalEvent=b,E.pullMode=w?w.lastPutMode:void 0;var C=Yd(Yd({},O),sb.getEventProperties(o,e));for(var $ in C)E[$]=C[$];n&&n.dispatchEvent(E),S[M]&&S[M].call(e,E)}}var sre=["evt"],Wl=function(e,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=o.evt,i=Jne(o,sre);sb.pluginEvent.bind(Zr)(e,n,Yd({dragEl:Xn,parentEl:Aa,ghostEl:po,rootEl:ca,nextEl:Dv,lastDownEl:nw,cloneEl:_a,cloneHidden:vh,dragStarted:Yy,putSortable:Rs,activeSortable:Zr.active,originalEvent:r,oldIndex:xg,oldDraggableIndex:y_,newIndex:mu,newDraggableIndex:hh,hideGhostForTarget:m8,unhideGhostForTarget:g8,cloneNowHidden:function(){vh=!0},cloneNowShown:function(){vh=!1},dispatchSortableEvent:function(l){_l({sortable:n,name:l,originalEvent:r})}},i))};function _l(t){are(Yd({putSortable:Rs,cloneEl:_a,targetEl:Xn,rootEl:ca,oldIndex:xg,oldDraggableIndex:y_,newIndex:mu,newDraggableIndex:hh},t))}var Xn,Aa,po,ca,Dv,nw,_a,vh,xg,mu,y_,hh,F0,Rs,hg=!1,pE=!1,hE=[],Pv,$c,OS,SS,jR,LR,Yy,ug,__,b_=!1,B0=!1,rw,Ys,AS=[],m2=!1,vE=[],t1=typeof document<"u",$0=LM,IR=ab||hp?"cssFloat":"float",lre=t1&&!i8&&!LM&&"draggable"in document.createElement("div"),p8=(function(){if(t1){if(hp)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}})(),h8=function(e,n){var o=ro(e),r=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),i=Xg(e,0,n),a=Xg(e,1,n),l=i&&ro(i),s=a&&ro(a),f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ya(i).width,h=s&&parseInt(s.marginLeft)+parseInt(s.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&&l.float&&l.float!=="none"){var v=l.float==="left"?"left":"right";return a&&(s.clear==="both"||s.clear===v)?"vertical":"horizontal"}return i&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||f>=r&&o[IR]==="none"||a&&o[IR]==="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,l=o?n.left:n.top,s=o?n.right:n.bottom,f=o?n.width:n.height;return r===l||i===s||r+a/2===l+f/2},cre=function(e,n){var o;return hE.some(function(r){var i=r[zl].options.emptyInsertThreshold;if(!(!i||IM(r))){var a=Ya(r),l=e>=a.left-i&&e<=a.right+i,s=n>=a.top-i&&n<=a.bottom+i;if(l&&s)return o=r}}),o},v8=function(e){function n(i,a){return function(l,s,f,h){var v=l.options.group.name&&s.options.group.name&&l.options.group.name===s.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(l,s,f,h),a)(l,s,f,h);var b=(a?l:s).options.group.name;return i===!0||typeof i=="string"&&i===b||i.join&&i.indexOf(b)>-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(){!p8&&po&&ro(po,"display","none")},g8=function(){!p8&&po&&ro(po,"display","")};t1&&!i8&&document.addEventListener("click",function(t){if(pE)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),pE=!1,!1},!0);var kv=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[zl]._onDragOver(o)}}},dre=function(e){Xn&&Xn.parentNode[zl]._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=up({},e),t[zl]=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 h8(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,l){a.setData("Text",l.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&&(!m_||LM),emptyInsertThreshold:5};sb.initializePlugins(this,t,n);for(var o in n)!(o in e)&&(e[o]=n[o]);v8(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:lre,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)),hE.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),up(this,rre())}Zr.prototype={constructor:Zr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ug=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,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,h=r.filter;if(_re(o),!Xn&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&m_&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Wc(s,r.draggable,o,!1),!(s&&s.animated)&&nw!==s)){if(xg=zu(s),y_=zu(s,r.draggable),typeof h=="function"){if(h.call(this,e,s,this)){_l({sortable:n,rootEl:f,name:"filter",targetEl:s,toEl:o,fromEl:o}),Wl("filter",n,{evt:e}),i&&e.preventDefault();return}}else if(h&&(h=h.split(",").some(function(v){if(v=Wc(f,v.trim(),o,!1),v)return _l({sortable:n,rootEl:v,name:"filter",targetEl:s,fromEl:o,toEl:o}),Wl("filter",n,{evt:e}),!0}),h)){i&&e.preventDefault();return}r.handle&&!Wc(f,r.handle,o,!1)||this._prepareDragStart(e,l,s)}}},_prepareDragStart:function(e,n,o){var r=this,i=r.el,a=r.options,l=i.ownerDocument,s;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,Pv={target:Xn,clientX:(n||e).clientX,clientY:(n||e).clientY},jR=Pv.clientX-f.left,LR=Pv.clientY-f.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,Xn.style["will-change"]="all",s=function(){if(Wl("delayEnded",r,{evt:e}),Zr.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!PR&&r.nativeDraggable&&(Xn.draggable=!0),r._triggerDragStart(e,n),_l({sortable:r,name:"choose",originalEvent:e}),vu(Xn,a.chosenClass,!0)},a.ignore.split(",").forEach(function(h){l8(Xn,h.trim(),MS)}),Vo(l,"dragover",kv),Vo(l,"mousemove",kv),Vo(l,"touchmove",kv),a.supportPointer?(Vo(l,"pointerup",r._onDrop),!this.nativeDraggable&&Vo(l,"pointercancel",r._onDrop)):(Vo(l,"mouseup",r._onDrop),Vo(l,"touchend",r._onDrop),Vo(l,"touchcancel",r._onDrop)),PR&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Xn.draggable=!0),Wl("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ab||hp))){if(Zr.eventCanceled){this._onDrop();return}a.supportPointer?(Vo(l,"pointerup",r._disableDelayedDrag),Vo(l,"pointercancel",r._disableDelayedDrag)):(Vo(l,"mouseup",r._disableDelayedDrag),Vo(l,"touchend",r._disableDelayedDrag),Vo(l,"touchcancel",r._disableDelayedDrag)),Vo(l,"mousemove",r._delayedDragTouchMoveHandler),Vo(l,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&Vo(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_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(hg=!1,ca&&Xn){Wl("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(),_l({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if($c){this._lastX=$c.clientX,this._lastY=$c.clientY,m8();for(var e=document.elementFromPoint($c.clientX,$c.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint($c.clientX,$c.clientY),e!==n);)n=e;if(Xn.parentNode[zl]._isOutsideThisEl(e),n)do{if(n[zl]){var o=void 0;if(o=n[zl]._onDragOver({clientX:$c.clientX,clientY:$c.clientY,target:e,rootEl:n}),o&&!this.options.dragoverBubble)break}e=n}while(n=s8(n));g8()}},_onTouchMove:function(e){if(Pv){var n=this.options,o=n.fallbackTolerance,r=n.fallbackOffset,i=e.touches?e.touches[0]:e,a=po&&Ag(po,!0),l=po&&a&&a.a,s=po&&a&&a.d,f=$0&&Ys&&DR(Ys),h=(i.clientX-Pv.clientX+r.x)/(l||1)+(f?f[0]-AS[0]:0)/(l||1),v=(i.clientY-Pv.clientY+r.y)/(s||1)+(f?f[1]-AS[1]:0)/(s||1);if(!Zr.active&&!hg){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 b="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");ro(po,"webkitTransform",b),ro(po,"mozTransform",b),ro(po,"msTransform",b),ro(po,"transform",b),OS=h,SS=v,$c=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(Ys=e;ro(Ys,"position")==="static"&&ro(Ys,"transform")==="none"&&Ys!==document;)Ys=Ys.parentNode;Ys!==document.body&&Ys!==document.documentElement?(Ys===document&&(Ys=Hd()),n.top+=Ys.scrollTop,n.left+=Ys.scrollLeft):Ys=Hd(),AS=DR(Ys)}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",jR/parseInt(po.style.width)*100+"% "+LR/parseInt(po.style.height)*100+"%")}},_onDragStart:function(e,n){var o=this,r=e.dataTransfer,i=o.options;if(Wl("dragStart",this,{evt:e}),Zr.eventCanceled){this._onDrop();return}Wl("setupClone",this),Zr.eventCanceled||(_a=d8(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(){Wl("clone",o),!Zr.eventCanceled&&(o.options.removeCloneOnHide||ca.insertBefore(_a,Xn),o._hideClone(),_l({sortable:o,name:"clone"}))}),!n&&vu(Xn,i.dragClass,!0),n?(pE=!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)")),hg=!0,o._dragStartId=ow(o._dragStarted.bind(o,n,e)),Vo(document,"selectstart",o),Yy=!0,window.getSelection().removeAllRanges(),m_&&ro(document.body,"user-select","none")},_onDragOver:function(e){var n=this.el,o=e.target,r,i,a,l=this.options,s=l.group,f=Zr.active,h=F0===s,v=l.sort,b=Rs||f,w,O=this,E=!1;if(m2)return;function S(Ae,ke){Wl(Ae,O,Yd({evt:e,isOwner:h,axis:w?"vertical":"horizontal",revert:a,dragRect:r,targetRect:i,canSort:v,fromSortable:b,target:o,completed:C,onMove:function(ze,Ye){return U0(ca,n,Xn,r,ze,Ya(ze),e,Ye)},changed:$},ke))}function M(){S("dragOverAnimationCapture"),O.captureAnimationState(),O!==b&&b.captureAnimationState()}function C(Ae){return S("dragOverCompleted",{insertion:Ae}),Ae&&(h?f._hideClone():f._showClone(O),O!==b&&(vu(Xn,Rs?Rs.options.ghostClass:f.options.ghostClass,!1),vu(Xn,l.ghostClass,!0)),Rs!==O&&O!==Zr.active?Rs=O:O===Zr.active&&Rs&&(Rs=null),b===O&&(O._ignoreWhileAnimating=o),O.animateAll(function(){S("dragOverAnimationComplete"),O._ignoreWhileAnimating=null}),O!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(o===Xn&&!Xn.animated||o===n&&!o.animated)&&(ug=null),!l.dragoverBubble&&!e.rootEl&&o!==document&&(Xn.parentNode[zl]._isOutsideThisEl(e.target),!Ae&&kv(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),E=!0}function $(){mu=zu(Xn),hh=zu(Xn,l.draggable),_l({sortable:O,name:"change",toEl:n,newIndex:mu,newDraggableIndex:hh,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),o=Wc(o,l.draggable,n,!0),S("dragOver"),Zr.eventCanceled)return E;if(Xn.contains(e.target)||o.animated&&o.animatingX&&o.animatingY||O._ignoreWhileAnimating===o)return C(!1);if(pE=!1,f&&!l.disabled&&(h?v||(a=Aa!==ca):Rs===this||(this.lastPutMode=F0.checkPull(this,f,Xn,e))&&s.checkPut(this,f,Xn,e))){if(w=this._getDirection(e,o)==="vertical",r=Ya(Xn),S("dragOverValid"),Zr.eventCanceled)return E;if(a)return Aa=ca,M(),this._hideClone(),S("revert"),Zr.eventCanceled||(Dv?ca.insertBefore(Xn,Dv):ca.appendChild(Xn)),C(!0);var D=IM(n,l.draggable);if(!D||vre(e,w,this)&&!D.animated){if(D===Xn)return C(!1);if(D&&n===e.target&&(o=D),o&&(i=Ya(o)),U0(ca,n,Xn,r,o,i,e,!!o)!==!1)return M(),D&&D.nextSibling?n.insertBefore(Xn,D.nextSibling):n.appendChild(Xn),Aa=n,$(),C(!0)}else if(D&&hre(e,w,this)){var k=Xg(n,0,l,!0);if(k===Xn)return C(!1);if(o=k,i=Ya(o),U0(ca,n,Xn,r,o,i,e,!1)!==!1)return M(),n.insertBefore(Xn,k),Aa=n,$(),C(!0)}else if(o.parentNode===n){i=Ya(o);var B=0,F,I=Xn.parentNode!==n,V=!ure(Xn.animated&&Xn.toRect||r,o.animated&&o.toRect||i,w),z=w?"top":"left",X=RR(o,"top","top")||RR(Xn,"top","top"),Y=X?X.scrollTop:void 0;ug!==o&&(F=i[z],b_=!1,B0=!V&&l.invertSwap||I),B=mre(e,o,i,w,V?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,B0,ug===o);var W;if(B!==0){var Q=zu(Xn);do Q-=B,W=Aa.children[Q];while(W&&(ro(W,"display")==="none"||W===po))}if(B===0||W===o)return C(!1);ug=o,__=B;var J=o.nextElementSibling,ie=!1;ie=B===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&&c8(X,0,Y-X.scrollTop),Aa=Xn.parentNode,F!==void 0&&!B0&&(rw=Math.abs(F-Ya(o)[z])),$(),C(!0)}if(n.contains(Xn))return C(!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",kv),Bo(document,"mousemove",kv),Bo(document,"touchmove",kv)},_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(mu=zu(Xn),hh=zu(Xn,o.draggable),Wl("drop",this,{evt:e}),Aa=Xn&&Xn.parentNode,mu=zu(Xn),hh=zu(Xn,o.draggable),Zr.eventCanceled){this._nulling();return}hg=!1,B0=!1,b_=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),g2(this.cloneId),g2(this._dragStartId),this.nativeDraggable&&(Bo(document,"drop",this),Bo(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),m_&&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||Rs&&Rs.lastPutMode!=="clone")&&_a&&_a.parentNode&&_a.parentNode.removeChild(_a),Xn&&(this.nativeDraggable&&Bo(Xn,"dragend",this),MS(Xn),Xn.style["will-change"]="",Yy&&!hg&&vu(Xn,Rs?Rs.options.ghostClass:this.options.ghostClass,!1),vu(Xn,this.options.chosenClass,!1),_l({sortable:this,name:"unchoose",toEl:Aa,newIndex:null,newDraggableIndex:null,originalEvent:e}),ca!==Aa?(mu>=0&&(_l({rootEl:Aa,name:"add",toEl:Aa,fromEl:ca,originalEvent:e}),_l({sortable:this,name:"remove",toEl:Aa,originalEvent:e}),_l({rootEl:Aa,name:"sort",toEl:Aa,fromEl:ca,originalEvent:e}),_l({sortable:this,name:"sort",toEl:Aa,originalEvent:e})),Rs&&Rs.save()):mu!==xg&&mu>=0&&(_l({sortable:this,name:"update",toEl:Aa,originalEvent:e}),_l({sortable:this,name:"sort",toEl:Aa,originalEvent:e})),Zr.active&&((mu==null||mu===-1)&&(mu=xg,hh=y_),_l({sortable:this,name:"end",toEl:Aa,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Wl("nulling",this),ca=Xn=Aa=po=Dv=_a=nw=vh=Pv=$c=Yy=mu=hh=xg=y_=ug=__=Rs=F0=Zr.dragged=Zr.ghost=Zr.clone=Zr.active=null,vE.forEach(function(e){e.checked=!0}),vE.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],Wc(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 l=r.children[a];Wc(l,this.options.draggable,r,!1)&&(o[i]=l)},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 Wc(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=sb.modifyOption(this,e,n);typeof r<"u"?o[e]=r:o[e]=n,e==="group"&&v8(o)},destroy:function(){Wl("destroy",this);var e=this.el;e[zl]=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(),hE.splice(hE.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!vh){if(Wl("hideClone",this),Zr.eventCanceled)return;ro(_a,"display","none"),this.options.removeCloneOnHide&&_a.parentNode&&_a.parentNode.removeChild(_a),vh=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(vh){if(Wl("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",""),vh=!1}}};function fre(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function U0(t,e,n,o,r,i,a,l){var s,f=t[zl],h=f.options.onMove,v;return window.CustomEvent&&!hp&&!ab?s=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(s=document.createEvent("Event"),s.initEvent("move",!0,!0)),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=r||e,s.relatedRect=i||Ya(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),h&&(v=h.call(f,s,a)),v}function MS(t){t.draggable=!1}function pre(){m2=!1}function hre(t,e,n){var o=Ya(Xg(n.el,0,n.options,!0)),r=f8(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(IM(n.el,n.options.draggable)),r=f8(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 mre(t,e,n,o,r,i,a,l){var s=o?t.clientY:t.clientX,f=o?n.height:n.width,h=o?n.top:n.left,v=o?n.bottom:n.right,b=!1;if(!a){if(l&&rw<f*r){if(!b_&&(__===1?s>h+f*i/2:s<v-f*i/2)&&(b_=!0),b_)b=!0;else if(__===1?s<h+rw:s>v-rw)return-__}else if(s>h+f*(1-r)/2&&s<v-f*(1-r)/2)return gre(e)}return b=b||a,b&&(s<h+f*i/2||s>v-f*i/2)?s>h+f/2?1:-1:0}function gre(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){vE.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&vE.push(o)}}function ow(t){return setTimeout(t,0)}function g2(t){return clearTimeout(t)}t1&&Vo(document,"touchmove",function(t){(Zr.active||hg)&&t.cancelable&&t.preventDefault()});Zr.utils={on:Vo,off:Bo,css:ro,find:l8,is:function(e,n){return!!Wc(e,n,e,!1)},extend:tre,throttle:u8,closest:Wc,toggleClass:vu,clone:d8,index:zu,nextTick:ow,cancelNextTick:g2,detectDirection:h8,getChild:Xg,expando:zl};Zr.get=function(t){return t[zl]};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)),sb.mount(o)})};Zr.create=function(t,e){return new Zr(t,e)};Zr.version=Qne;var Xa=[],qy,y2,_2=!1,TS,CS,mE,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)),FR(),iw(),nre()},nulling:function(){mE=y2=qy=_2=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,l=document.elementFromPoint(i,a);if(mE=n,o||this.options.forceAutoScrollFallback||ab||hp||m_){NS(n,this.options,l,o);var s=_h(l,!0);_2&&(!Ky||i!==TS||a!==CS)&&(Ky&&FR(),Ky=setInterval(function(){var f=_h(document.elementFromPoint(i,a),!0);f!==s&&(s=f,iw()),NS(n,r.options,f,o)},10),TS=i,CS=a)}else{if(!this.options.bubbleScroll||_h(l,!0)===Hd()){iw();return}NS(n,this.options,_h(l,!1),!1)}}},up(t,{pluginName:"scroll",initializeByDefault:!0})}function iw(){Xa.forEach(function(t){clearInterval(t.pid)}),Xa=[]}function FR(){clearInterval(Ky)}var NS=u8(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,l=e.scrollSpeed,s=Hd(),f=!1,h;y2!==n&&(y2=n,iw(),qy=e.scroll,h=e.scrollFn,qy===!0&&(qy=_h(n,!0)));var v=0,b=qy;do{var w=b,O=Ya(w),E=O.top,S=O.bottom,M=O.left,C=O.right,$=O.width,D=O.height,k=void 0,B=void 0,F=w.scrollWidth,I=w.scrollHeight,V=ro(w),z=w.scrollLeft,X=w.scrollTop;w===s?(k=$<F&&(V.overflowX==="auto"||V.overflowX==="scroll"||V.overflowX==="visible"),B=D<I&&(V.overflowY==="auto"||V.overflowY==="scroll"||V.overflowY==="visible")):(k=$<F&&(V.overflowX==="auto"||V.overflowX==="scroll"),B=D<I&&(V.overflowY==="auto"||V.overflowY==="scroll"));var Y=k&&(Math.abs(C-r)<=a&&z+$<F)-(Math.abs(M-r)<=a&&!!z),W=B&&(Math.abs(S-i)<=a&&X+D<I)-(Math.abs(E-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!==w)&&(Xa[v].el=w,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(mE);var J=Xa[this.layer].vy?Xa[this.layer].vy*l:0,ie=Xa[this.layer].vx?Xa[this.layer].vx*l:0;typeof h=="function"&&h.call(Zr.dragged.parentNode[zl],ie,J,t,mE,Xa[this.layer].el)!=="continue"||c8(Xa[this.layer].el,ie,J)}).bind({layer:v}),24))),v++}while(e.bubbleScroll&&b!==s&&(b=_h(b,!1)));_2=f}},30),y8=function(e){var n=e.originalEvent,o=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,l=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(n){var f=o||i;l();var h=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,v=document.elementFromPoint(h.clientX,h.clientY);s(),f&&!f.el.contains(v)&&(a("spill"),this.onSpill({dragEl:r,putSortable:o}))}};function FM(){}FM.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=Xg(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:y8};up(FM,{pluginName:"revertOnSpill"});function BM(){}BM.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:y8};up(BM,{pluginName:"removeOnSpill"});Zr.mount(new bre);Zr.mount(BM,FM);const wre={class:"dialog-footer"},Ere=_r({__name:"ApiFieldFormDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),l=He({name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""}),s=Rh({name:[{required:!0,message:kt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],variable:[{required:!0,message:kt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:kt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),f=He(!1);K_(f,w=>{w||(l.value={name:"",variable:"",type:"input",is_required:!0,assignment_method:"api_input",optionList:[""],default_value:"",desc:""},a.value=!1)});const h=w=>{w&&(l.value=Me.cloneDeep(w),a.value=!0),f.value=!0},v=()=>{f.value=!1,a.value=!1},b=async w=>{w&&await w.validate(O=>{O&&o("refresh",l.value)})};return e({open:h,close:v}),(w,O)=>{const E=ne("el-input"),S=ne("el-form-item"),M=ne("el-switch"),C=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?w.$t("common.param.editParam"):w.$t("common.param.addParam"),modelValue:f.value,"onUpdate:modelValue":O[10]||(O[10]=k=>f.value=k),"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,[P($,{onClick:O[8]||(O[8]=gn(k=>f.value=!1,["prevent"]))},{default:j(()=>[ft(_e(w.$t("common.cancel")),1)]),_:1}),P($,{type:"primary",onClick:O[9]||(O[9]=k=>b(r.value)),loading:i.value},{default:j(()=>[ft(_e(a.value?w.$t("common.save"):w.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(C,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:s,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[P(S,{label:w.$t("dynamicsForm.paramForm.field.label"),prop:"variable"},{default:j(()=>[P(E,{modelValue:l.value.variable,"onUpdate:modelValue":O[0]||(O[0]=k=>l.value.variable=k),placeholder:w.$t("dynamicsForm.paramForm.field.placeholder"),maxlength:"64","show-word-limit":"",onBlur:O[1]||(O[1]=k=>l.value.variable=l.value.variable.trim())},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),P(S,{label:w.$t("common.desc")},{default:j(()=>[P(E,{modelValue:l.value.desc,"onUpdate:modelValue":O[2]||(O[2]=k=>l.value.desc=k),placeholder:w.$t("common.descPlaceholder"),onBlur:O[3]||(O[3]=k=>l.value.name=l.value.name.trim()),maxlength:"64","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),P(S,{label:w.$t("dynamicsForm.paramForm.required.label"),onClick:O[5]||(O[5]=gn(()=>{},["prevent"]))},{default:j(()=>[P(M,{size:"small",modelValue:l.value.is_required,"onUpdate:modelValue":O[4]||(O[4]=k=>l.value.is_required=k)},null,8,["modelValue"])]),_:1},8,["label"]),P(S,{label:w.$t("dynamicsForm.default.label"),prop:"default_value",rules:{required:l.value.is_required,message:w.$t("dynamicsForm.default.placeholder"),trigger:"blur"}},{default:j(()=>[P(E,{modelValue:l.value.default_value,"onUpdate:modelValue":O[6]||(O[6]=k=>l.value.default_value=k),placeholder:w.$t("dynamicsForm.default.placeholder"),onBlur:O[7]||(O[7]=k=>l.value.name=l.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=_r({__name:"ApiInputFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(null),r=He(),i=He([]);function a(h,v){typeof v<"u"&&(o.value=v),r.value.open(h)}function l(h){i.value.splice(h,1),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),f()}function s(h){for(let b=0;b<i.value.length;b++)if(i.value[b].variable===h.variable&&o.value!==b){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+h.variable);return}const v=e.nodeModel.properties.user_input_field_list;for(let b=0;b<v.length;b++)if(v[b].field===h.variable){Xi(kt("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:b=>{if(b.oldIndex===void 0||b.newIndex===void 0)return;const w=Me.cloneDeep([...i.value]),[O]=w.splice(b.oldIndex,1);w.splice(b.newIndex,0,O),i.value=w,e.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return bo(()=>{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 C;const b=ne("AppIcon"),w=ne("el-button"),O=ne("el-table-column"),E=ne("el-switch"),S=ne("el-tooltip"),M=ne("el-table");return Ne(),mn(Ir,null,[ee("div",xre,[ee("h5",Ore,_e(h.$t("views.model.modelForm.title.apiParamPassing")),1),P(w,{link:"",type:"primary",onClick:v[0]||(v[0]=$=>a())},{default:j(()=>[P(b,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(h.$t("common.add")),1)]),_:1})]),((C=e.nodeModel.properties.api_input_field_list)==null?void 0:C.length)>0?(Ne(),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(()=>[P(O,{prop:"variable",label:h.$t("dynamicsForm.paramForm.field.label")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.variable},_e($.variable),9,Sre)]),_:1},8,["label"]),P(O,{prop:"desc",label:h.$t("common.desc")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.desc},_e($.desc),9,Are)]),_:1},8,["label"]),P(O,{prop:"default_value",label:h.$t("dynamicsForm.default.label")},{default:j(({row:$})=>[ee("span",{class:"ellipsis-1",title:$.default_value},_e($.default_value),9,Mre)]),_:1},8,["label"]),P(O,{label:h.$t("common.required")},{default:j(({row:$})=>[ee("div",{onClick:v[1]||(v[1]=gn(()=>{},["stop"]))},[P(E,{disabled:"",size:"small",modelValue:$.is_required,"onUpdate:modelValue":D=>$.is_required=D},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),P(O,{label:h.$t("common.operation"),align:"left",width:"90"},{default:j(({row:$,$index:D})=>[ee("span",Tre,[P(S,{effect:"dark",content:h.$t("common.modify"),placement:"top"},{default:j(()=>[P(w,{type:"primary",text:"",onClick:gn(k=>a($,D),["stop"])},{default:j(()=>[P(b,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(S,{effect:"dark",content:h.$t("common.delete"),placement:"top"},{default:j(()=>[P(w,{type:"primary",text:"",onClick:k=>l(D)},{default:j(()=>[P(b,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),P(Ere,{ref_key:"ApiFieldFormDialogRef",ref:r,onRefresh:s},null,512)],64)}}}),Nre={class:"dialog-footer"},Pre=_r({__name:"UserFieldFormDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),l=He(),s=(S,M)=>S.every(C=>d7.get(M,C,void 0)!==void 0),f=hr(()=>{if(l.value){const S=l.value;switch(S.type){case"input":return s(["field","input_type","label","required","attrs"],l.value)?l.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 s(["field","input_type","label","required","option_list"],l.value)?l.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 s(["field","input_type","label","required","attrs.format","attrs.value-format","attrs.type"],l.value)?l.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 l.value}}else return{input_type:"TextInput",required:!1,attrs:{maxlength:200,minlength:0},show_default_value:!0}}),h=He(null),v=He([{label:kt("dynamicsForm.input_type_list.TextInput"),value:"TextInputConstructor"},{label:kt("dynamicsForm.input_type_list.PasswordInput"),value:"PasswordInputConstructor"},{label:kt("dynamicsForm.input_type_list.SingleSelect"),value:"SingleSelectConstructor"},{label:kt("dynamicsForm.input_type_list.MultiSelect"),value:"MultiSelectConstructor"},{label:kt("dynamicsForm.input_type_list.RadioCard"),value:"RadioCardConstructor"},{label:kt("dynamicsForm.input_type_list.DatePicker"),value:"DatePickerConstructor"},{label:kt("dynamicsForm.input_type_list.SwitchInput"),value:"SwitchInputConstructor"}]),b=He(!1),w=(S,M)=>{b.value=!0,S?(a.value=!0,l.value=Me.cloneDeep(S),h.value=M):l.value=null},O=()=>{b.value=!1,a.value=!1,h.value=null,l.value=null},E=async()=>{const S=r.value;S&&await S.validate().then(()=>{o("refresh",S==null?void 0:S.getData(),h.value),a.value=!1,l.value=null,h.value=null})};return e({open:w,close:O}),(S,M)=>{const C=ne("el-button"),$=ne("el-dialog");return Ne(),bt($,{title:a.value?S.$t("common.param.editParam"):S.$t("common.param.addParam"),modelValue:b.value,"onUpdate:modelValue":M[2]||(M[2]=D=>b.value=D),"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,[P(C,{onClick:gn(O,["prevent"])},{default:j(()=>[ft(_e(S.$t("common.cancel")),1)]),_:1}),P(C,{type:"primary",onClick:M[1]||(M[1]=D=>E()),loading:i.value},{default:j(()=>[ft(_e(a.value?S.$t("common.save"):S.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(I2,{modelValue:f.value,"onUpdate:modelValue":M[0]||(M[0]=D=>f.value=D),"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"])}}}),kre={class:"dialog-footer"},Rre=_r({__name:"UserInputTitleDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He({title:kt("chat.userInput")}),l=Rh({title:[{required:!0,message:kt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}]}),s=He(!1),f=b=>{b&&(a.value=Me.cloneDeep(b)),s.value=!0},h=()=>{s.value=!1},v=async b=>{b&&await b.validate(w=>{w&&o("refresh",a.value)})};return e({open:f,close:h}),(b,w)=>{const O=ne("el-input"),E=ne("el-form-item"),S=ne("el-form"),M=ne("el-button"),C=ne("el-dialog");return Ne(),bt(C,{title:b.$t("common.setting"),modelValue:s.value,"onUpdate:modelValue":w[5]||(w[5]=$=>s.value=$),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":h,"append-to-body":""},{footer:j(()=>[ee("span",kre,[P(M,{onClick:w[3]||(w[3]=gn($=>s.value=!1,["prevent"]))},{default:j(()=>[ft(_e(b.$t("common.cancel")),1)]),_:1}),P(M,{type:"primary",onClick:w[4]||(w[4]=$=>v(r.value)),loading:i.value},{default:j(()=>[ft(_e(b.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(S,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:l,model:a.value,"require-asterisk-position":"right",onSubmit:w[2]||(w[2]=gn(()=>{},["prevent"]))},{default:j(()=>[P(E,{label:b.$t("common.title"),prop:"title"},{default:j(()=>[P(O,{modelValue:a.value.title,"onUpdate:modelValue":w[0]||(w[0]=$=>a.value.title=$),maxlength:"64","show-word-limit":"",onBlur:w[1]||(w[1]=$=>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=_r({__name:"UserInputFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He(),i=He([]),a=He({title:kt("chat.userInput")});function l(O,E){o.value.open(O,E)}function s(){r.value.open(a.value)}function f(O){i.value.splice(O,1),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),w()}function h(O,E){for(let M=0;M<i.value.length;M++)if(i.value[M].field===O.field&&E!==M){Xi(kt("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(kt("views.applicationWorkflow.tip.paramErrorMessage")+O.field);return}E!==null?i.value.splice(E,1,O):i.value.push(O),o.value.close(),e.nodeModel.graphModel.eventCenter.emit("refreshFieldList"),w()}function v(O){a.value=O,r.value.close()}const b=O=>{var E;if(O.input_type==="PasswordInput")return"******";if(O.default_value){const S=(E=O.option_list)==null?void 0:E.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 w(){if(!n.value)return;const E=n.value.$el.querySelector(".el-table__body-wrapper tbody");E&&Zr.create(E,{animation:150,ghostClass:"ghost-row",onEnd:S=>{if(S.oldIndex===void 0||S.newIndex===void 0)return;const M=Me.cloneDeep([...i.value]),[C]=M.splice(S.oldIndex,1);M.splice(S.newIndex,0,C),i.value=M,e.nodeModel.graphModel.eventCenter.emit("refreshFieldList")}})}return bo(()=>{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,E)=>{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),w()}),(O,E)=>{var F;const S=ne("AppIcon"),M=ne("el-button"),C=ne("el-table-column"),$=ne("el-tag"),D=ne("el-switch"),k=ne("el-tooltip"),B=ne("el-table");return Ne(),mn(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,[P(M,{type:"primary",link:"",onClick:s},{default:j(()=>[P(S,{iconName:"app-setting"})]),_:1}),ee("span",Lre,[P(M,{link:"",type:"primary",onClick:E[0]||(E[0]=I=>l())},{default:j(()=>[P(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(O.$t("common.add")),1)]),_:1})])])]),((F=e.nodeModel.properties.user_input_field_list)==null?void 0:F.length)>0?(Ne(),bt(B,{key:0,data:e.nodeModel.properties.user_input_field_list,class:"mb-16",ref_key:"tableRef",ref:n,"row-key":"field"},{default:j(()=>[P(C,{prop:"field",label:O.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:I})=>[ee("span",{title:I.field,class:"ellipsis-1"},_e(I.field),9,Ire)]),_:1},8,["label"]),P(C,{prop:"label",label:O.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:I})=>[I.label&&I.label.input_type==="TooltipLabel"?(Ne(),mn("span",Fre,[ee("span",{title:I.label.label,class:"ellipsis-1"},_e(I.label.label),9,Bre)])):(Ne(),mn("span",$re,[ee("span",{title:I.label,class:"ellipsis-1"},_e(I.label),9,Ure)]))]),_:1},8,["label"]),P(C,{label:O.$t("dynamicsForm.paramForm.input_type.label"),width:"95"},{default:j(({row:I})=>[I.input_type==="TextInput"?(Ne(),bt($,{key:0,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.TextInput")),1)]),_:1})):Bn("",!0),I.input_type==="PasswordInput"?(Ne(),bt($,{key:1,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.PasswordInput")),1)]),_:1})):Bn("",!0),I.input_type==="Slider"?(Ne(),bt($,{key:2,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.Slider")),1)]),_:1})):Bn("",!0),I.input_type==="SwitchInput"?(Ne(),bt($,{key:3,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SwitchInput")),1)]),_:1})):Bn("",!0),I.input_type==="SingleSelect"?(Ne(),bt($,{key:4,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.SingleSelect")),1)]),_:1})):Bn("",!0),I.input_type==="MultiSelect"?(Ne(),bt($,{key:5,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.MultiSelect")),1)]),_:1})):Bn("",!0),I.input_type==="RadioCard"?(Ne(),bt($,{key:6,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.RadioCard")),1)]),_:1})):Bn("",!0),I.input_type==="DatePicker"?(Ne(),bt($,{key:7,type:"info",class:"info-tag"},{default:j(()=>[ft(_e(O.$t("dynamicsForm.input_type_list.DatePicker")),1)]),_:1})):Bn("",!0)]),_:1},8,["label"]),P(C,{prop:"default_value",label:O.$t("dynamicsForm.default.label")},{default:j(({row:I})=>[ee("span",{title:I.default_value,class:"ellipsis-1"},_e(b(I)),9,Vre)]),_:1},8,["label"]),P(C,{label:O.$t("common.required")},{default:j(({row:I})=>[ee("div",{onClick:E[1]||(E[1]=gn(()=>{},["stop"]))},[P(D,{disabled:"",size:"small",modelValue:I.required,"onUpdate:modelValue":V=>I.required=V},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),P(C,{label:O.$t("common.operation"),align:"left",width:"90"},{default:j(({row:I,$index:V})=>[ee("span",Wre,[P(k,{effect:"dark",content:O.$t("common.modify"),placement:"top"},{default:j(()=>[P(M,{type:"primary",text:"",onClick:gn(z=>l(I,V),["stop"])},{default:j(()=>[P(S,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(k,{effect:"dark",content:O.$t("common.delete"),placement:"top"},{default:j(()=>[P(M,{type:"primary",text:"",onClick:z=>f(V)},{default:j(()=>[P(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),P(Pre,{ref_key:"UserFieldFormDialogRef",ref:o,onRefresh:h},null,512),P(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"},soe={class:"flex align-center"},loe={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=_r({__name:"FileUploadSettingDialog",props:{nodeModel:{}},emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=t,i=He(!1),a=He(!1),l=He(""),s=He(!1),f=He(),h=He(),v=["TXT","MD","DOCX","HTML","CSV","XLSX","XLS","PDF"],b=["JPG","JPEG","PNG","GIF"],w=["MP3","WAV","OGG","ACC","M4A"],O=["MP4","AVI","MKV","MOV","FLV","WMV"],E=He({maxFiles:3,fileLimit:50,document:!0,image:!1,audio:!1,video:!1,other:!1,otherExtensions:["PPT","DOC"]});function S(B){i.value=!0,xh(()=>{E.value={...E.value,...B}})}function M(){i.value=!1}const C=B=>{E.value.otherExtensions=E.value.otherExtensions.filter(F=>F!==B)},$=()=>{a.value=!0,xh(()=>{h.value.input.focus()})},D=()=>{if(l.value){if(l.value=l.value.toUpperCase(),E.value.otherExtensions.includes(l.value)||v.includes(l.value)||b.includes(l.value)||w.includes(l.value)){a.value=!1,l.value="",p7(kt("common.fileUpload.existingExtensionsTip"));return}E.value.otherExtensions.push(l.value)}a.value=!1,l.value=""};async function k(){const B=f.value;B&&await B.validate().then(()=>{const F=Me.cloneDeep(E.value);o("refresh",F),r.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig"),i.value=!1})}return e({open:S}),(B,F)=>{const I=ne("el-slider"),V=ne("el-form-item"),z=ne("el-text"),X=ne("el-checkbox"),Y=ne("el-card"),W=ne("el-tag"),Q=ne("el-input"),J=ne("el-button"),ie=ne("el-space"),Se=ne("el-form"),Ae=ne("el-scrollbar"),ke=ne("el-dialog");return Ne(),bt(ke,{title:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.title"),modelValue:i.value,"onUpdate:modelValue":F[19]||(F[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,[P(J,{onClick:gn(M,["prevent"])},{default:j(()=>[ft(_e(B.$t("common.cancel")),1)]),_:1}),P(J,{type:"primary",onClick:F[18]||(F[18]=De=>k()),loading:s.value},{default:j(()=>[ft(_e(B.$t("common.confirm")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(Ae,{"max-height":"550"},{default:j(()=>[ee("div",Kre,[P(Se,{"label-position":"top",ref_key:"fieldFormRef",ref:f,model:E.value,"require-asterisk-position":"right"},{default:j(()=>[P(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.maxFiles")},{default:j(()=>[P(I,{modelValue:E.value.maxFiles,"onUpdate:modelValue":F[0]||(F[0]=De=>E.value.maxFiles=De),"show-input":"","show-input-controls":!1,min:1,max:100},null,8,["modelValue"])]),_:1},8,["label"]),P(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileLimit")},{default:j(()=>[P(I,{modelValue:E.value.fileLimit,"onUpdate:modelValue":F[1]||(F[1]=De=>E.value.fileLimit=De),"show-input":"","show-input-controls":!1,min:1,max:1e3},null,8,["modelValue"])]),_:1},8,["label"]),P(V,{label:B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.label")},{default:j(()=>[P(Y,{shadow:"hover",class:Gl(["card-checkbox cursor w-full mb-8",E.value.document?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[4]||(F[4]=gn(De=>E.value.document=!E.value.document,["stop"]))},{default:j(()=>[ee("div",Zre,[ee("div",Jre,[F[20]||(F[20]=ee("img",{class:"mr-12",src:zre,alt:""},null,-1)),ee("div",null,[ee("p",Qre,[ft(_e(B.$t("common.fileUpload.document"))+" ",1),P(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.documentText")),1)]),_:1})]),ee("p",null,_e(v.join("、")),1)])]),P(X,{modelValue:E.value.document,"onUpdate:modelValue":F[2]||(F[2]=De=>E.value.document=De),onChange:F[3]||(F[3]=De=>E.value.document=!E.value.document)},null,8,["modelValue"])])]),_:1},8,["class"]),P(Y,{shadow:"hover",class:Gl(["card-checkbox cursor w-full mb-8",E.value.image?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[7]||(F[7]=gn(De=>E.value.image=!E.value.image,["stop"]))},{default:j(()=>[ee("div",eoe,[ee("div",toe,[F[21]||(F[21]=ee("img",{class:"mr-12",src:Hre,alt:""},null,-1)),ee("div",null,[ee("p",noe,[ft(_e(B.$t("common.fileUpload.image"))+" ",1),P(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.imageText")),1)]),_:1})]),ee("p",null,_e(b.join("、")),1)])]),P(X,{modelValue:E.value.image,"onUpdate:modelValue":F[5]||(F[5]=De=>E.value.image=De),onChange:F[6]||(F[6]=De=>E.value.image=!E.value.image)},null,8,["modelValue"])])]),_:1},8,["class"]),P(Y,{shadow:"hover",class:Gl(["card-checkbox cursor w-full mb-8",E.value.audio?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[10]||(F[10]=gn(De=>E.value.audio=!E.value.audio,["stop"]))},{default:j(()=>[ee("div",roe,[ee("div",ooe,[F[22]||(F[22]=ee("img",{class:"mr-12",src:Xre,alt:""},null,-1)),ee("div",null,[ee("p",ioe,[ft(_e(B.$t("common.fileUpload.audio"))+" ",1),P(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.audioText")),1)]),_:1})]),ee("p",null,_e(w.join("、")),1)])]),P(X,{modelValue:E.value.audio,"onUpdate:modelValue":F[8]||(F[8]=De=>E.value.audio=De),onChange:F[9]||(F[9]=De=>E.value.audio=!E.value.audio)},null,8,["modelValue"])])]),_:1},8,["class"]),P(Y,{shadow:"hover",class:Gl(["card-checkbox cursor w-full mb-8",E.value.video?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[13]||(F[13]=gn(De=>E.value.video=!E.value.video,["stop"]))},{default:j(()=>[ee("div",aoe,[ee("div",soe,[F[23]||(F[23]=ee("img",{class:"mr-12",width:"32",src:Yre,alt:""},null,-1)),ee("div",null,[ee("p",loe,[ft(_e(B.$t("common.fileUpload.video"))+" ",1),P(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.videoText")),1)]),_:1})]),ee("p",null,_e(O.join("、")),1)])]),P(X,{modelValue:E.value.video,"onUpdate:modelValue":F[11]||(F[11]=De=>E.value.video=De),onChange:F[12]||(F[12]=De=>E.value.video=!E.value.video)},null,8,["modelValue"])])]),_:1},8,["class"]),P(Y,{shadow:"hover",class:Gl(["card-checkbox cursor w-full mb-8",E.value.other?"active":""]),style:{"--el-card-padding":"8px 16px"},onClick:F[17]||(F[17]=gn(De=>E.value.other=!E.value.other,["stop"]))},{default:j(()=>[ee("div",uoe,[ee("div",coe,[F[24]||(F[24]=ee("img",{class:"mr-12",width:32,src:qre,alt:""},null,-1)),ee("div",null,[ee("p",doe,[ft(_e(B.$t("common.fileUpload.other"))+" ",1),P(z,{class:"color-secondary"},{default:j(()=>[ft(_e(B.$t("views.applicationWorkflow.nodes.baseNode.FileUploadSetting.fileUploadType.otherText")),1)]),_:1})]),P(ie,{wrap:"",size:2,class:"mt-4"},{default:j(()=>[(Ne(!0),mn(Ir,null,No(E.value.otherExtensions,De=>(Ne(),bt(W,{key:De,closable:"","disable-transitions":!1,onClose:ze=>C(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?(Ne(),bt(Q,{key:0,ref_key:"InputRef",ref:h,modelValue:l.value,"onUpdate:modelValue":F[14]||(F[14]=De=>l.value=De),size:"small",onKeyup:f7(D,["enter"]),onBlur:D},null,8,["modelValue"])):(Ne(),bt(J,{key:1,class:"button-new-tag",size:"small",onClick:gn($,["stop"])},{default:j(()=>[ft(" + "+_e(B.$t("common.fileUpload.addExtensions")),1)]),_:1}))]),_:1})])]),P(X,{modelValue:E.value.other,"onUpdate:modelValue":F[15]||(F[15]=De=>E.value.other=De),onChange:F[16]||(F[16]=De=>E.value.other=!E.value.other)},null,8,["modelValue"])])]),_:1},8,["class"])]),_:1},8,["label"])]),_:1},8,["model"])])]),_:1})]),_:1},8,["title","modelValue"])}}}),hoe={class:"dialog-footer"},voe=_r({__name:"ChatFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),l=He(null),s=He({field:"",label:""}),f=Rh({label:[{required:!0,message:kt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:kt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:kt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,E)=>{O&&(s.value=Me.cloneDeep(O),a.value=!0,l.value=E),h.value=!0},b=()=>{h.value=!1,a.value=!1,l.value=null,s.value={field:"",label:""}},w=async O=>{O&&await O.validate(E=>{E&&o("refresh",s.value,l.value)})};return e({open:v,close:b}),(O,E)=>{const S=ne("el-input"),M=ne("el-form-item"),C=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":E[3]||(E[3]=k=>h.value=k),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",hoe,[P($,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),P($,{type:"primary",onClick:E[2]||(E[2]=k=>w(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(()=>[P(C,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[P(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[P(S,{modelValue:s.value.field,"onUpdate:modelValue":E[0]||(E[0]=k=>s.value.field=k),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),P(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[P(S,{modelValue:s.value.label,"onUpdate:modelValue":E[1]||(E[1]=k=>s.value.label=k),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"])}}}),moe={class:"flex-between mb-16"},goe={class:"break-all ellipsis lighter",style:{"max-width":"80%"}},yoe={class:"ml-4"},_oe=["title"],boe=["title"],woe={class:"mr-4"},Eoe=_r({__name:"ChatFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(s,f){o.value.open(s,f)}function a(s){r.value.splice(s,1),e.nodeModel.graphModel.eventCenter.emit("chatFieldList")}function l(s,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===s.field&&f!==h){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+s.field);return}[void 0,null].includes(f)?r.value.push(s):r.value.splice(f,1,s),o.value.close(),e.nodeModel.graphModel.eventCenter.emit("chatFieldList")}return bo(()=>{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)}),(s,f)=>{var E;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),w=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",moe,[ee("h5",goe,_e(s.$t("views.applicationWorkflow.variable.chat")),1),ee("div",null,[ee("span",yoe,[P(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[P(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(s.$t("common.add")),1)]),_:1})])])]),((E=e.nodeModel.properties.chat_input_field_list)==null?void 0:E.length)>0?(Ne(),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(()=>[P(b,{prop:"field",label:s.$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"]),P(b,{prop:"label",label:s.$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"]),P(b,{label:s.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",woe,[P(w,{effect:"dark",content:s.$t("common.modify"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:gn(C=>i(S,M),["stop"])},{default:j(()=>[P(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(w,{effect:"dark",content:s.$t("common.delete"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:C=>a(M)},{default:j(()=>[P(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),P(voe,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:l},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"},Poe={class:"flex"},koe={class:"w-full"},Roe={class:"flex-between w-full"},Doe=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(null),s=He(),f=He(),h=He(),v=He(),b={name:"",desc:"",prologue:kt("views.application.form.defaultPrologue")},w=W=>W.ctrlKey===!0?(W.preventDefault(),!0):(W.stopPropagation(),!0);function O(W){Me.set(i.nodeModel.properties.node_data,"prologue",W)}const E=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:W=>{Me.set(i.nodeModel.properties,"node_data",W)}}),S=He(),M=()=>{var W;return E.value.tts_model_enable&&!E.value.tts_model_id&&E.value.tts_type==="TTS"?Promise.reject({node:i.nodeModel,errMessage:kt("views.application.form.voicePlay.requiredMessage")}):E.value.stt_model_enable&&!E.value.stt_model_id?Promise.reject({node:i.nodeModel,errMessage:kt("views.application.form.voiceInput.requiredMessage")}):(W=S.value)==null?void 0:W.validate().catch(Q=>Promise.reject({node:i.nodeModel,errMessage:Q}))},C=e();function $(){var Q;const W=r.value==="systemManage"?{model_type:"STT",workspace_id:(Q=C.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 D(){var Q;const W=r.value==="systemManage"?{model_type:"TTS",workspace_id:(Q=C.value)==null?void 0:Q.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(W).then(J=>{l.value=Me.groupBy(J==null?void 0:J.data,"provider")})}function k(){xh(()=>{var W;E.value.tts_model_id?(W=s.value)==null||W.reset_default(E.value.tts_model_id,o):V({})})}function B(){E.value.tts_model_enable||(E.value.tts_model_id="",E.value.tts_type="BROWSER")}function F(){E.value.stt_model_enable||(E.value.stt_model_id="")}const I=()=>{var Q;const W=E.value.tts_model_id;if(!W){Oh(kt("views.application.form.voicePlay.requiredMessage"));return}(Q=s.value)==null||Q.open(W,o,E.value.tts_model_params_setting)},V=W=>{E.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"]};E.value.file_upload_enable&&(E.value.file_upload_setting=E.value.file_upload_setting||W),i.nodeModel.graphModel.eventCenter.emit("refreshFileUploadConfig")},X=()=>{var W;(W=v.value)==null||W.open(E.value.file_upload_setting)},Y=W=>{E.value.file_upload_setting=W};return bo(()=>{Me.set(i.nodeModel,"validate",M),i.nodeModel.properties.node_data.tts_type||Me.set(i.nodeModel.properties.node_data,"tts_type","BROWSER"),D(),$()}),(W,Q)=>{const J=ne("el-input"),ie=ne("el-form-item"),Se=ne("MdEditorMagnify"),Ae=ne("AppIcon"),ke=ne("el-tooltip"),De=ne("el-button"),ze=ne("el-switch"),Ye=ne("el-checkbox"),Be=ne("ModelSelect"),Je=ne("el-radio"),gt=ne("el-radio-group"),se=ne("Operation"),Ze=ne("el-icon"),pe=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(pe,{onSubmit:Q[13]||(Q[13]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right",class:"mb-24","label-width":"auto",ref_key:"baseNodeFormRef",ref:S},{default:j(()=>[P(ie,{label:W.$t("views.applicationWorkflow.nodes.baseNode.appName.label"),prop:"name",rules:{message:Wn(kt)("views.application.form.appName.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[P(J,{modelValue:E.value.name,"onUpdate:modelValue":Q[0]||(Q[0]=le=>E.value.name=le),maxlength:"64",placeholder:Wn(kt)("views.application.form.appName.placeholder"),"show-word-limit":"",onBlur:Q[1]||(Q[1]=le=>{var we;return E.value.name=(we=E.value.name)==null?void 0:we.trim()})},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),P(ie,{label:W.$t("views.applicationWorkflow.nodes.baseNode.appDescription.label")},{default:j(()=>[P(J,{modelValue:E.value.desc,"onUpdate:modelValue":Q[2]||(Q[2]=le=>E.value.desc=le),placeholder:W.$t("views.application.form.appDescription.placeholder"),rows:3,type:"textarea",maxlength:"256","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),P(ie,{label:W.$t("views.application.form.prologue")},{default:j(()=>[P(Se,{onWheel:w,title:W.$t("views.application.form.prologue"),modelValue:E.value.prologue,"onUpdate:modelValue":Q[3]||(Q[3]=le=>E.value.prologue=le),style:{height:"150px"},onSubmitDialog:O},null,8,["title","modelValue"])]),_:1},8,["label"]),P(ie,null,{label:j(()=>[ee("div",xoe,[ee("div",Ooe,[ee("span",Soe,_e(W.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.label")),1),P(ke,{effect:"dark",content:W.$t("views.applicationWorkflow.nodes.baseNode.fileUpload.tooltip"),placement:"right"},{default:j(()=>[P(Ae,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])]),ee("div",null,[E.value.file_upload_enable?(Ne(),bt(De,{key:0,type:"primary",link:"",onClick:X,class:"mr-4"},{default:j(()=>[P(Ae,{iconName:"app-setting",class:"mr-4"})]),_:1})):Bn("",!0),P(ze,{size:"small",modelValue:E.value.file_upload_enable,"onUpdate:modelValue":Q[4]||(Q[4]=le=>E.value.file_upload_enable=le),onChange:z},null,8,["modelValue"])])])]),_:1}),P(Gre,{ref_key:"UserInputFieldTableFef",ref:f,"node-model":t.nodeModel},null,8,["node-model"]),P(Cre,{ref_key:"ApiInputFieldTableFef",ref:h,"node-model":t.nodeModel},null,8,["node-model"]),P(Eoe,{ref:"ChatFieldTeble","node-model":t.nodeModel},null,8,["node-model"]),P(ie,null,{label:j(()=>[ee("div",Aoe,[ee("span",Moe,_e(W.$t("views.application.form.voiceInput.label")),1),ee("div",Toe,[E.value.stt_model_enable?(Ne(),bt(Ye,{key:0,modelValue:E.value.stt_autosend,"onUpdate:modelValue":Q[5]||(Q[5]=le=>E.value.stt_autosend=le)},{default:j(()=>[ft(_e(W.$t("views.application.form.voiceInput.autoSend")),1)]),_:1},8,["modelValue"])):Bn("",!0),P(ze,{class:"ml-8",size:"small",modelValue:E.value.stt_model_enable,"onUpdate:modelValue":Q[6]||(Q[6]=le=>E.value.stt_model_enable=le),onChange:F},null,8,["modelValue"])])])]),default:j(()=>[Js(P(Be,{onWheel:w,modelValue:E.value.stt_model_id,"onUpdate:modelValue":Q[7]||(Q[7]=le=>E.value.stt_model_id=le),placeholder:W.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"]),[[Eh,E.value.stt_model_enable]])]),_:1}),P(ie,null,{label:j(()=>[ee("div",Coe,[ee("span",Noe,_e(W.$t("views.application.form.voicePlay.label")),1),ee("div",Poe,[E.value.tts_model_enable?(Ne(),bt(Ye,{key:0,modelValue:E.value.tts_autoplay,"onUpdate:modelValue":Q[8]||(Q[8]=le=>E.value.tts_autoplay=le)},{default:j(()=>[ft(_e(W.$t("views.application.form.voicePlay.autoPlay")),1)]),_:1},8,["modelValue"])):Bn("",!0),P(ze,{class:"ml-8",size:"small",modelValue:E.value.tts_model_enable,"onUpdate:modelValue":Q[9]||(Q[9]=le=>E.value.tts_model_enable=le),onChange:B},null,8,["modelValue"])])])]),default:j(()=>[ee("div",koe,[Js(P(gt,{modelValue:E.value.tts_type,"onUpdate:modelValue":Q[10]||(Q[10]=le=>E.value.tts_type=le)},{default:j(()=>[P(Je,{label:W.$t("views.application.form.voicePlay.browser"),value:"BROWSER"},null,8,["label"]),P(Je,{label:W.$t("views.application.form.voicePlay.tts"),value:"TTS"},null,8,["label"])]),_:1},8,["modelValue"]),[[Eh,E.value.tts_model_enable]])]),ee("div",Roe,[E.value.tts_type==="TTS"&&E.value.tts_model_enable?(Ne(),bt(Be,{key:0,onWheel:w,modelValue:E.value.tts_model_id,"onUpdate:modelValue":Q[11]||(Q[11]=le=>E.value.tts_model_id=le),placeholder:W.$t("views.application.form.voicePlay.placeholder"),options:l.value,onChange:Q[12]||(Q[12]=le=>k()),showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])):Bn("",!0),E.value.tts_type==="TTS"&&E.value.tts_model_enable?(Ne(),bt(De,{key:1,onClick:I,disabled:!E.value.tts_model_id,class:"ml-8"},{default:j(()=>[P(Ze,null,{default:j(()=>[P(Ze,null,{default:j(()=>[P(se)]),_:1})]),_:1})]),_:1},8,["disabled"])):Bn("",!0)])]),_:1})]),_:1},8,["model"]),P(Fj,{ref_key:"TTSModeParamSettingDialogRef",ref:s,onRefresh:V},null,512),P(poe,{ref_key:"FileUploadSettingDialogRef",ref:v,"node-model":t.nodeModel,onRefresh:Y},null,8,["node-model"])]),_:1},8,["nodeModel"])}}}),joe=kh(Doe,[["__scopeId","data-v-940d4dcd"]]);class Loe extends ai{constructor(e){super(e,joe)}}class Ioe extends si{constructor(e,n){super(e,n)}get_width(){return 600}}const Foe={type:"base-node",model:Ioe,view:Loe},_8=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=_r({__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=E=>E.ctrlKey===!0?(E.preventDefault(),!0):(E.stopPropagation(),!0),r=(E,S,M)=>{const $=Me.cloneDeep(e.nodeModel.properties.branch_condition_list?e.nodeModel.properties.branch_condition_list:[]).map(D=>D.id===S.id?{...D,height:E.height,index:M}:D);Me.set(e.nodeModel.properties,"branch_condition_list",$),v(e.nodeModel.properties.node_data.branch,!0)},i=hr({get:()=>(e.nodeModel.properties.node_data||(Me.set(e.nodeModel.properties,"node_data",n),v(n.branch,!0)),e.nodeModel.properties.node_data),set:E=>{Me.set(e.nodeModel.properties,"node_data",E)}}),a=He(),l=He(),s=()=>{var S;const E=[(S=a.value)==null?void 0:S.validate(),...l.value.map(M=>M.validate())];return Promise.all(E).catch(M=>Promise.reject({node:e.nodeModel,errMessage:M}))};function f(E){const{oldIndex:S,newIndex:M}=E;if(S===void 0||M===void 0)return;const C=Me.cloneDeep(e.nodeModel.properties.node_data.branch);if(S===C.length-1||M===C.length-1)return;const $={...C[S],type:C[M].type,id:C[M].id},D={...C[M],type:C[S].type,id:C[S].id};C[M]=$,C[S]=D,Me.set(e.nodeModel.properties.node_data,"branch",C)}function h(){const E=Me.cloneDeep(e.nodeModel.properties.node_data.branch),S={conditions:[{field:[],compare:"",value:""}],type:"ELSE IF "+(E.length-1),id:yu(),condition:"and"};E.splice(E.length-1,0,S),v(E,!0),Me.set(e.nodeModel.properties.node_data,"branch",E)}function v(E,S){const M=Me.cloneDeep(e.nodeModel.properties.branch_condition_list?e.nodeModel.properties.branch_condition_list:[]),C=E.map(($,D)=>{const k=M.find(B=>B.id===$.id);if(k)return{index:D,height:k.height,id:$.id};if(S)return{index:D,height:12,id:$.id}}).filter($=>$);Me.set(e.nodeModel.properties,"branch_condition_list",C),e.nodeModel.refreshBranch()}function b(E){const S=Me.cloneDeep(e.nodeModel.properties.node_data.branch);S[E].conditions.push({field:[],compare:"",value:""}),Me.set(e.nodeModel.properties.node_data,"branch",S)}function w(E,S){const M=Me.cloneDeep(e.nodeModel.properties.node_data.branch);if(M[E].conditions.splice(S,1),M[E].conditions.length===0){const $=M.splice(E,1).map(D=>e.nodeModel.id+"_"+D.id+"_right");e.nodeModel.graphModel.eventCenter.emit("delete_edge",e.nodeModel.outgoing.edges.filter(D=>$.includes(D.sourceAnchorId)).map(D=>D.id)),v(M,!1),M.forEach((D,k)=>{D.type==="ELSE IF "+(k+1)&&(D.type="ELSE IF "+k)})}Me.set(e.nodeModel.properties.node_data,"branch",M)}function O(E,S,M){if(["is_null","is_not_null","is_true","is_not_true"].includes(E)){const C=Me.cloneDeep(e.nodeModel.properties.node_data.branch);C[S].conditions[M].value=1,Me.set(e.nodeModel.properties.node_data,"branch",C)}}return bo(()=>{Me.set(e.nodeModel,"validate",s)}),(E,S)=>{const M=ne("el-option"),C=ne("el-select"),$=ne("el-form-item"),D=ne("el-col"),k=ne("el-input"),B=ne("AppIcon"),F=ne("el-button"),I=ne("el-row"),V=ne("el-card"),z=ne("el-form"),X=Rg("resize");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(z,{model:i.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ConditionNodeFormRef",ref:a,onSubmit:S[0]||(S[0]=gn(()=>{},["prevent"]))},{default:j(()=>[P(Wn(Xj),{ref:"el",modelValue:i.value.branch,disabled:i.value.branch.length===2,handle:".handle",animation:150,ghostClass:"ghost",onEnd:f},{default:j(()=>[(Ne(!0),mn(Ir,null,No(i.value.branch,(Y,W)=>Js((Ne(),bt(V,{key:Y.id,shadow:"never",class:Gl(["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:Yj,alt:"",height:"15",class:"handle-img mr-4"},null,-1)),ft(" "+_e(Y.type),1)]),Y.conditions.length>1?(Ne(),mn("div",Uoe,[ee("span",null,_e(E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),P(C,{teleported:!1,modelValue:Y.condition,"onUpdate:modelValue":Q=>Y.condition=Q,size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[P(M,{label:E.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),P(M,{label:E.$t("views.applicationWorkflow.condition.OR"),value:"or"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"]),ee("span",null,_e(E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)])):Bn("",!0)]),W!==i.value.branch.length-1?(Ne(),mn("div",Voe,[(Ne(!0),mn(Ir,null,No(Y.conditions,(Q,J)=>(Ne(),bt(I,{key:J,gutter:8},{default:j(()=>[P(D,{span:11},{default:j(()=>[P($,{prop:"branch."+W+".conditions."+J+".field",rules:{type:"array",required:!0,message:E.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[P(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:l,nodeModel:t.nodeModel,class:"w-full",placeholder:E.$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),P(D,{span:6},{default:j(()=>[P($,{prop:"branch."+W+".conditions."+J+".compare",rules:{required:!0,message:E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[P(C,{onWheel:o,teleported:!1,modelValue:Q.compare,"onUpdate:modelValue":ie=>Q.compare=ie,placeholder:E.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:"",onChange:ie=>O(ie,W,J)},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Wn($2),(ie,Se)=>(Ne(),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),P(D,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(Q.compare)?Bn("",!0):(Ne(),bt($,{key:0,prop:"branch."+W+".conditions."+J+".value",rules:{required:!0,message:E.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[P(k,{modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:E.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),P(D,{span:1},{default:j(()=>[P(F,{disabled:i.value.branch.length===2&&Y.conditions.length===1,link:"",type:"info",class:"mt-4",onClick:ie=>w(W,J)},{default:j(()=>[P(B,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024))),128))])):Bn("",!0),W!==i.value.branch.length-1?(Ne(),bt(F,{key:1,link:"",type:"primary",onClick:Q=>b(W)},{default:j(()=>[P(B,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(E.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1},8,["onClick"])):Bn("",!0)]),_:2},1032,["class"])),[[X,Q=>r(Q,Y,W)]])),128))]),_:1},8,["modelValue","disabled"]),P(F,{link:"",type:"primary",onClick:h},{default:j(()=>[P(B,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(E.$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 si{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 l=this.properties.showNode===void 0?!0:this.properties.showNode,s=[];s.push({x:n-r/2+10,y:l?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],b=zoe(f,h);s.push({x:n+r/2-10,y:l?o-i/2+75+b+(v.height||0)/2:o-15,id:`${e}_${v.id}_right`,type:"right"})}return s}}const Xoe={type:"condition-node",model:Hoe,view:Goe},b8=Object.freeze(Object.defineProperty({__proto__:null,default:Xoe},Symbol.toStringTag,{value:"Module"})),Yoe={class:"title-decoration-1 mb-8"},qoe=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={document_list:["start-node","document"]},o=hr({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=ne("el-form-item"),l=ne("el-form"),s=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Yoe,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),P(s,{shadow:"never",class:"card-never"},{default:j(()=>[P(l,{onSubmit:i[1]||(i[1]=gn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto"},{default:j(()=>[P(a,{label:r.$t("views.problem.relateParagraph.selectDocument"),rules:{type:"array",required:!0,message:r.$t("views.chatLog.documentPlaceholder"),trigger:"change"}},{default:j(()=>[P(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:si,view:Koe},w8=Object.freeze(Object.defineProperty({__proto__:null,default:Zoe},Symbol.toStringTag,{value:"Module"})),Joe={class:"dialog-footer"},Qoe=_r({__name:"AddFormCollect",props:{title:{default:kt("common.param.addParam")},addFormField:{}},emits:["submit"],setup(t,{expose:e,emit:n}){const o=t,r=He(!1),i=He(),a=He({}),l=He(!1),s=()=>{r.value=!0},f=()=>{r.value=!1,a.value={}},h=()=>{var v;(v=i.value)==null||v.validate().then(()=>{var b;o.addFormField((b=i.value)==null?void 0:b.getData()),f()})};return e({close:f,open:s}),(v,b)=>{const w=ne("el-button"),O=ne("el-dialog");return Ne(),bt(O,{title:t.title,modelValue:r.value,"onUpdate:modelValue":b[3]||(b[3]=E=>r.value=E),"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,[P(w,{onClick:b[1]||(b[1]=gn(E=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),P(w,{type:"primary",onClick:b[2]||(b[2]=E=>h()),loading:l.value},{default:j(()=>[ft(_e(v.$t("common.add")),1)]),_:1},8,["loading"])])]),default:j(()=>[b[4]||(b[4]=ft("l ",-1)),P(I2,{modelValue:a.value,"onUpdate:modelValue":b[0]||(b[0]=E=>a.value=E),"label-position":"top","require-asterisk-position":"right",ref_key:"dynamicsFormConstructorRef",ref:i},null,8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),eie={class:"dialog-footer"},tie=_r({__name:"EditFormCollect",props:{title:{default:kt("common.param.editParam")},editFormField:{}},emits:["submit"],setup(t,{expose:e,emit:n}){const o=t,r=He(!1),i=He(),a=He({}),l=He(0),s=He(!1),f=(b,w)=>{r.value=!0,a.value=b,l.value=w},h=()=>{r.value=!1,a.value={}},v=()=>{var b;(b=i.value)==null||b.validate().then(()=>{var w;o.editFormField((w=i.value)==null?void 0:w.getData(),l.value),h()})};return e({close:h,open:f}),(b,w)=>{const O=ne("el-button"),E=ne("el-dialog");return Ne(),bt(E,{title:t.title,modelValue:r.value,"onUpdate:modelValue":w[3]||(w[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,[P(O,{onClick:w[1]||(w[1]=gn(S=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(b.$t("common.cancel")),1)]),_:1}),P(O,{type:"primary",onClick:w[2]||(w[2]=S=>v()),loading:s.value},{default:j(()=>[ft(_e(b.$t("common.modify")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(I2,{modelValue:a.value,"onUpdate:modelValue":w[0]||(w[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"},sie=["title"],lie={key:0},uie=["title"],cie={key:1},die=["title"],fie=["title"],pie={class:"mr-4"},hie=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t;O_("getModel",()=>e.nodeModel);const n=He(),o=He(),r=(C,$)=>{const D=w.value.form_field_list.map((k,B)=>$===B?Me.cloneDeep(C):Me.cloneDeep(k));w.value.form_field_list=D,a()},i=C=>{if(w.value.form_field_list.some($=>$.field===C.field)){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+C.field);return}w.value.form_field_list=Me.cloneDeep([...w.value.form_field_list,C]),a()},a=()=>{const C=[{label:kt("views.applicationWorkflow.nodes.formNode.formAllContent"),value:"form_data"},...w.value.form_field_list.map($=>({value:$.field,label:typeof $.label=="string"?$.label:$.label.label}))];Me.set(e.nodeModel.properties.config,"fields",C),e.nodeModel.clear_next_node_field(!1),M()},l=He(),s=He(),f=()=>{var C;(C=l.value)==null||C.open()},h=(C,$)=>{var D;(D=s.value)==null||D.open(Me.cloneDeep(C),$)},v=C=>{w.value.form_field_list=w.value.form_field_list.filter($=>$.field!==C.field),a()},b=He({is_result:!0,form_content_format:`${kt("views.applicationWorkflow.nodes.formNode.form_content_format1")}
{{form}}
${kt("views.applicationWorkflow.nodes.formNode.form_content_format2")}`,form_field_list:[]}),w=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",b.value),e.nodeModel.properties.node_data),set:C=>{Me.set(e.nodeModel.properties,"node_data",C)}}),O=C=>{var $;if(C.default_value){const D=($=C.option_list)==null?void 0:$.filter(k=>C.default_value.indexOf(k.value)>-1).map(k=>k.label).join(",");return D||C.default_value}if(C.default_value!==void 0)return C.default_value},E=()=>{var C;return(C=n.value)==null?void 0:C.validate()};function S(C){Me.set(e.nodeModel.properties.node_data,"form_content_format",C)}function M(){if(!o.value)return;const $=o.value.$el.querySelector(".el-table__body-wrapper tbody");$&&Zr.create($,{animation:150,ghostClass:"ghost-row",onEnd:D=>{if(D.oldIndex===void 0||D.newIndex===void 0)return;const k=Me.cloneDeep([...w.value.form_field_list]),[B]=k.splice(D.oldIndex,1);k.splice(D.newIndex,0,B),w.value.form_field_list=k,a()}})}return bo(()=>{Me.set(e.nodeModel,"validate",E),a(),e.nodeModel.graphModel.eventCenter.emit("refresh_incoming_node_field")}),(C,$)=>{const D=ne("AppIcon"),k=ne("el-tooltip"),B=ne("MdEditorMagnify"),F=ne("el-form-item"),I=ne("el-button"),V=ne("el-table-column"),z=ne("el-tag"),X=ne("el-switch"),Y=ne("el-table"),W=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",nie,_e(C.$t("views.applicationWorkflow.nodeSetting")),1),P(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(W,{onSubmit:$[4]||($[4]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"formNodeFormRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[P(F,{label:C.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),prop:"form_content_format",rules:{required:!0,message:C.$t("views.applicationWorkflow.nodes.formNode.formContent.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",rie,[ee("div",oie,[ee("span",null,[ft(_e(C.$t("views.applicationWorkflow.nodes.formNode.formContent.label")),1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])]),P(k,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(C.$t("views.applicationWorkflow.nodes.formNode.formContent.tooltip",{form:"{ form }"})),1)]),default:j(()=>[P(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(B,{title:C.$t("views.applicationWorkflow.nodes.formNode.formContent.label"),modelValue:w.value.form_content_format,"onUpdate:modelValue":$[0]||($[0]=J=>w.value.form_content_format=J),style:{height:"150px"},onSubmitDialog:S},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),P(F,{label:C.$t("views.applicationWorkflow.nodes.formNode.formSetting"),onClick:$[3]||($[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",iie,[ee("h5",aie,_e(C.$t("views.applicationWorkflow.nodes.formNode.formSetting")),1),P(I,{link:"",type:"primary",onClick:$[1]||($[1]=J=>f())},{default:j(()=>[P(D,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(C.$t("common.add")),1)]),_:1})])]),default:j(()=>[w.value.form_field_list.length>0?(Ne(),bt(Y,{key:0,class:"border",data:w.value.form_field_list,ref_key:"tableRef",ref:o,"row-key":"field"},{default:j(()=>[P(V,{prop:"field",label:C.$t("dynamicsForm.paramForm.field.label"),width:"95"},{default:j(({row:J})=>[ee("span",{title:J.field,class:"ellipsis-1"},_e(J.field),9,sie)]),_:1},8,["label"]),P(V,{prop:"label",label:C.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:J})=>[J.label&&J.label.input_type==="TooltipLabel"?(Ne(),mn("span",lie,[ee("span",{title:J.label.label,class:"ellipsis-1"},_e(J.label.label),9,uie)])):(Ne(),mn("span",cie,[ee("span",{title:J.label,class:"ellipsis-1"},_e(J.label),9,die)]))]),_:1},8,["label"]),P(V,{label:C.$t("dynamicsForm.paramForm.input_type.label"),width:"110px"},{default:j(({row:J})=>[P(z,{type:"info",class:"info-tag"},{default:j(()=>{var ie;return[ft(_e((ie=Wn(h7).find(Se=>Se.value===J.input_type))==null?void 0:ie.label),1)]}),_:2},1024)]),_:1},8,["label"]),P(V,{prop:"default_value",label:C.$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"]),P(V,{label:C.$t("common.required"),width:"55"},{default:j(({row:J})=>[ee("div",{onClick:$[2]||($[2]=gn(()=>{},["stop"]))},[P(X,{disabled:"",size:"small",modelValue:J.required,"onUpdate:modelValue":ie=>J.required=ie},null,8,["modelValue","onUpdate:modelValue"])])]),_:1},8,["label"]),P(V,{label:C.$t("common.operation"),align:"left",width:"80"},{default:j(({row:J,$index:ie})=>[ee("span",pie,[P(k,{effect:"dark",content:C.$t("common.modify"),placement:"top"},{default:j(()=>[P(I,{type:"primary",text:"",onClick:gn(Se=>h(J,ie),["stop"])},{default:j(()=>[P(D,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(k,{effect:"dark",content:C.$t("common.delete"),placement:"top"},{default:j(()=>[P(I,{type:"primary",text:"",onClick:Se=>v(J)},{default:j(()=>[P(D,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0)]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(Qoe,{ref_key:"addFormCollectRef",ref:l,addFormField:i},null,512),P(tie,{ref_key:"editFormCollectRef",ref:s,editFormField:r},null,512)]),_:1},8,["nodeModel"])}}});class vie extends ai{constructor(e){super(e,hie)}getConfig(e){return e.model.properties.config}}const mie={type:"form-node",model:si,view:vie},E8=Object.freeze(Object.defineProperty({__proto__:null,default:mie},Symbol.toStringTag,{value:"Module"})),gie={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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(),s=He(),f=()=>{var k;return(k=s.value)==null?void 0:k.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=k=>k.ctrlKey===!0?(k.preventDefault(),!0):(k.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${kt("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"]},w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:k=>{Me.set(i.nodeModel.properties,"node_data",k)}}),O=e();function E(){var B;const k=r.value==="systemManage"?{model_type:"TTI",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTI"};oi({type:"model",systemType:r.value}).getSelectModelList(k).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var k;w.value.model_id?(k=l.value)==null||k.reset_default(w.value.model_id,o):C({})})},M=k=>{var B;k&&((B=l.value)==null||B.open(k,o,w.value.model_params_setting))};function C(k){Me.set(i.nodeModel.properties.node_data,"model_params_setting",k)}function $(k){Me.set(i.nodeModel.properties.node_data,"prompt",k)}function D(k){Me.set(i.nodeModel.properties.node_data,"negative_prompt",k)}return bo(()=>{E(),Me.set(i.nodeModel,"validate",f)}),(k,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",gie,_e(k.$t("views.applicationWorkflow.nodeSetting")),1),P(J,{shadow:"never",class:"card-never"},{default:j(()=>[P(Q,{onSubmit:B[6]||(B[6]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(z,{label:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label"),prop:"model_id",rules:{required:!0,message:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",yie,[ee("div",null,[ee("span",null,[ft(_e(k.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.label")),1),B[7]||(B[7]=ee("span",{class:"color-danger"},"*",-1))])]),P(I,{disabled:!w.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(w.value.model_id)),onRefreshForm:C},{default:j(()=>[P(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(V,{onChange:S,onWheel:h,teleported:!1,modelValue:w.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>w.value.model_id=ie),placeholder:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.model.requiredMessage"),options:a.value,showFooter:"",onFocus:E,"model-type":"TTI"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),prop:"prompt",rules:{required:!0,message:k.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",_ie,[ee("div",bie,[ee("span",null,[ft(_e(k.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:h,title:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.prompt.label"),modelValue:w.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>w.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:k.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",wie,[ee("div",Eie,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:h,title:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.label"),modelValue:w.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>w.value.negative_prompt=ie),placeholder:k.$t("views.applicationWorkflow.nodes.imageGenerateNode.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[5]||(B[5]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",xie,[ee("div",Oie,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(W,{size:"small",modelValue:w.value.is_result,"onUpdate:modelValue":B[4]||(B[4]=ie=>w.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:l,onRefresh:C},null,512)]),_:1},8,["node-model"])}}});let Aie=class extends ai{constructor(e){super(e,Sie)}};const Mie={type:"image-generate-node",model:si,view:Aie},x8=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"},Pie={class:"mr-4"},kie={class:"flex align-center"},Rie={class:"mr-4"},Die={class:"flex align-center"},jie={class:"mr-4"},Lie=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(),s=He(),f=()=>{var k;return(k=s.value)==null?void 0:k.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=k=>k.ctrlKey===!0?(k.preventDefault(),!0):(k.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${kt("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:[]},w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:k=>{Me.set(i.nodeModel.properties,"node_data",k)}}),O=e();function E(){var B;const k=r.value==="systemManage"?{model_type:"ITV",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"ITV"};oi({type:"model",systemType:r.value}).getSelectModelList(k).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var k;w.value.model_id?(k=l.value)==null||k.reset_default(w.value.model_id,o):C({})})},M=k=>{var B;k&&((B=l.value)==null||B.open(k,o,w.value.model_params_setting))};function C(k){Me.set(i.nodeModel.properties.node_data,"model_params_setting",k)}function $(k){Me.set(i.nodeModel.properties.node_data,"prompt",k)}function D(k){Me.set(i.nodeModel.properties.node_data,"negative_prompt",k)}return bo(()=>{E(),Me.set(i.nodeModel,"validate",f)}),(k,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Tie,_e(k.$t("views.applicationWorkflow.nodeSetting")),1),P(J,{shadow:"never",class:"card-never"},{default:j(()=>[P(Q,{onSubmit:B[8]||(B[8]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(z,{label:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Cie,[ee("div",null,[ee("span",null,[ft(_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.label")),1),B[9]||(B[9]=ee("span",{class:"color-danger"},"*",-1))])]),P(I,{disabled:!w.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(w.value.model_id)),onRefreshForm:C},{default:j(()=>[P(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(V,{onChange:S,onWheel:h,teleported:!1,modelValue:w.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>w.value.model_id=ie),onFocus:E,placeholder:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"ITV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:k.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Nie,[ee("div",Pie,[ee("span",null,[ft(_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label")),1),B[10]||(B[10]=ee("span",{class:"color-danger"},"*",-1))])]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:h,title:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.prompt.label"),modelValue:w.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>w.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:k.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",kie,[ee("div",Rie,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:h,title:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.label"),modelValue:w.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>w.value.negative_prompt=ie),placeholder:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label"),rules:{type:"array",required:!0,message:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.label")),1),B[11]||(B[11]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[P(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.first_frame.requiredMessage"),modelValue:w.value.first_frame_url,"onUpdate:modelValue":B[4]||(B[4]=ie=>w.value.first_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label"),rules:{type:"array",required:!1,message:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.label")),1)]),default:j(()=>[P(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:k.$t("views.applicationWorkflow.nodes.imageToVideoGenerate.last_frame.requiredMessage"),clearable:"",modelValue:w.value.last_frame_url,"onUpdate:modelValue":B[5]||(B[5]=ie=>w.value.last_frame_url=ie)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[7]||(B[7]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Die,[ee("div",jie,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(W,{size:"small",modelValue:w.value.is_result,"onUpdate:modelValue":B[6]||(B[6]=ie=>w.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:l,onRefresh:C},null,512)]),_:1},8,["node-model"])}}});class Iie extends ai{constructor(e){super(e,Lie)}}const Fie={type:"image-to-video-node",model:si,view:Iie},O8=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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(),s=He(),f=He(),h=()=>{var I;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(I=s.value)==null?void 0:I.validate()]).catch(V=>Promise.reject({node:i.nodeModel,errMessage:V}))},v=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),w={model_id:"",system:"",prompt:`{{${kt("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=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",w),i.nodeModel.properties.node_data),set:I=>{Me.set(i.nodeModel.properties,"node_data",I)}}),E=e();function S(){var V;const I=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=E.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(I).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(I){Me.set(i.nodeModel.properties.node_data,"system",I)}function C(I){Me.set(i.nodeModel.properties.node_data,"prompt",I)}const $=I=>{var V;I&&((V=l.value)==null||V.open(I,o,O.value.model_params_setting))};function D(I){Me.set(i.nodeModel.properties.node_data,"model_params_setting",I)}const k=He(),B=I=>{var V;I&&((V=k.value)==null||V.open(I,o))},F=I=>{Me.set(i.nodeModel.properties.node_data,"system",I)};return bo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(I,V)=>{const z=ne("AppIcon"),X=ne("el-button"),Y=ne("ModelSelect"),W=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("MdEditorMagnify"),ie=ne("el-option"),Se=ne("el-select"),Ae=ne("el-input-number"),ke=ne("el-switch"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Bie,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),P(ze,{shadow:"never",class:"card-never"},{default:j(()=>[P(De,{onSubmit:V[10]||(V[10]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(W,{label:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",$ie,[ee("div",null,[ee("span",null,[ft(_e(Wn(kt)("views.applicationWorkflow.nodes.imageUnderstandNode.model.label")),1),V[11]||(V[11]=ee("span",{class:"color-danger"},"*",-1))])]),P(X,{disabled:!O.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=Ye=>$(O.value.model_id)),onRefreshForm:D},{default:j(()=>[P(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(Y,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=Ye=>O.value.model_id=Ye),placeholder:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(W,null,{label:j(()=>[ee("div",Uie,[ee("div",Vie,[ee("span",null,_e(I.$t("views.application.form.roleSettings.label")),1),P(Q,{effect:"dark",content:I.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[P(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),P(X,{type:"primary",link:"",onClick:V[2]||(V[2]=Ye=>B(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[P(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[P(J,{title:I.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":V[3]||(V[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Wn(kt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),P(W,{label:I.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:I.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",Wie,[ee("div",Gie,[ee("span",null,[ft(_e(I.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=ee("span",{class:"color-danger"},"*",-1))])]),P(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[P(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(J,{onWheel:v,title:I.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:C,placeholder:`${Wn(kt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(W,null,{label:j(()=>[ee("div",zie,[ee("div",null,_e(I.$t("views.application.form.historyRecord.label")),1),P(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[P(ie,{label:I.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),P(ie,{label:I.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[P(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[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}),P(W,{label:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label"),rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.label")),1),V[13]||(V[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.nodes.imageUnderstandNode.image.requiredMessage"),modelValue:O.value.image_list,"onUpdate:modelValue":V[7]||(V[7]=Ye=>O.value.image_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(W,{label:I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:V[9]||(V[9]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Hie,[ee("div",Xie,[ee("span",null,_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(ke,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:l,onRefresh:D},null,512),P(U2,{onReplace:F,ref_key:"GeneratePromptDialogRef",ref:k},null,512)]),_:1},8,["node-model"])}}});let qie=class extends ai{constructor(e){super(e,Yie)}};const Kie={type:"image-understand-node",model:si,view:qie},S8=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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=He(),a=He();function l(){const B=Me.cloneDeep(S.nodeModel.properties.node_data.branch),F={id:yu(),content:"",isOther:!1};B.splice(B.length-1,0,F),f(B,!0),Me.set(S.nodeModel.properties.node_data,"branch",B),S.nodeModel.refreshBranch()}function s(B){var W;const F=Me.cloneDeep(S.nodeModel.properties.node_data.branch),I=F.find(Q=>Q.id===B);if(!I||I.isOther||F.filter(Q=>!Q.isOther).length<=1)return;const z=`${S.nodeModel.id}_${B}_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=F.filter(Q=>Q.id!==B);Me.set(S.nodeModel.properties.node_data,"branch",Y),f(Y,!1)}function f(B,F){const I=Me.cloneDeep(S.nodeModel.properties.branch_condition_list?S.nodeModel.properties.branch_condition_list:[]),V=B.map((z,X)=>{const Y=I.find(W=>W.id===z.id);if(Y)return{index:X,height:Y.height,id:z.id};if(F)return{index:X,height:12,id:z.id}}).filter(z=>z);Me.set(S.nodeModel.properties,"branch_condition_list",V),S.nodeModel.refreshBranch()}const h=B=>B.ctrlKey===!0?(B.preventDefault(),!0):(B.stopPropagation(),!0),v=B=>{var F;B?(F=a.value)==null||F.reset_default(B,o):w({})},b={model_id:"",branch:[{id:yu(),content:"",isOther:!1},{id:yu(),content:kt("views.applicationWorkflow.nodes.intentNode.other"),isOther:!0}],dialogue_number:1,content_list:[]};function w(B){Me.set(S.nodeModel.properties.node_data,"model_params_setting",B)}const O=B=>{var F;B&&((F=a.value)==null||F.open(B,o,E.value.model_params_setting))},E=hr({get:()=>(S.nodeModel.properties.node_data||(Me.set(S.nodeModel.properties,"node_data",b),f(b.branch,!0)),S.nodeModel.properties.node_data),set:B=>{Me.set(S.nodeModel.properties,"node_data",B)}}),S=t,M=He(),C=He(null),$=()=>{var B;return Promise.all([i.value?i.value.validate():Promise.resolve(""),(B=M.value)==null?void 0:B.validate()]).then(()=>{if(E.value.branch.length!=new Set(E.value.branch.map(F=>F.content)).size)throw kt("views.applicationWorkflow.nodes.intentNode.error2")}).catch(F=>Promise.reject({node:S.nodeModel,errMessage:F}))},D=e();function k(){var F;const B=r.value==="systemManage"?{model_type:"LLM",workspace_id:(F=D.value)==null?void 0:F.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(B).then(I=>{C.value=Me.groupBy(I==null?void 0:I.data,"provider")})}return bo(()=>{var B;k(),typeof((B=S.nodeModel.properties.node_data)==null?void 0:B.is_result)>"u"&&Qd(S.nodeModel)&&Me.set(S.nodeModel.properties.node_data,"is_result",!0),Me.set(S.nodeModel,"validate",$)}),(B,F)=>{const I=ne("AppIcon"),V=ne("el-button"),z=ne("ModelSelect"),X=ne("el-form-item"),Y=ne("el-input-number"),W=ne("el-input"),Q=ne("el-col"),J=ne("el-row"),ie=ne("el-form"),Se=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Zie,_e(B.$t("views.applicationWorkflow.nodeSetting")),1),P(Se,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(ie,{onSubmit:F[4]||(F[4]=gn(()=>{},["prevent"])),model:E.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"IntentClassifyNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[P(X,{label:B.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:B.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Jie,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.application.form.aiModel.label")),1),F[5]||(F[5]=ee("span",{class:"color-danger"},"*",-1))])]),P(V,{type:"primary",link:"",disabled:!E.value.model_id,onClick:F[0]||(F[0]=Ae=>O(E.value.model_id)),onRefreshForm:w},{default:j(()=>[P(I,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(z,{onChange:v,onWheel:h,teleported:!1,modelValue:E.value.model_id,"onUpdate:modelValue":F[1]||(F[1]=Ae=>E.value.model_id=Ae),placeholder:B.$t("views.application.form.aiModel.placeholder"),options:C.value,onSubmitModel:k,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(X,{prop:"content_list",label:B.$t("views.applicationWorkflow.nodes.intentNode.input.label"),rules:{message:B.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Qie,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.intentNode.input.label")),1),F[6]||(F[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:i,nodeModel:t.nodeModel,class:"w-full",placeholder:B.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:E.value.content_list,"onUpdate:modelValue":F[2]||(F[2]=Ae=>E.value.content_list=Ae)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(X,{label:B.$t("views.application.form.historyRecord.label")},{default:j(()=>[P(Y,{modelValue:E.value.dialogue_number,"onUpdate:modelValue":F[3]||(F[3]=Ae=>E.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"]),P(X,null,{label:j(()=>[ee("div",eae,[ee("div",null,[ee("span",null,[ft(_e(B.$t("views.applicationWorkflow.nodes.intentNode.classify.label")),1),F[7]||(F[7]=ee("span",{class:"color-danger"},"*",-1))])]),P(V,{onClick:l,type:"primary",size:"large",link:""},{default:j(()=>[P(I,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[ee("div",null,[(Ne(!0),mn(Ir,null,No(E.value.branch,(Ae,ke)=>(Ne(),mn("div",{key:Ae.id,class:"mb-8"},[P(X,{prop:`branch.${ke}.content`,rules:{message:B.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder"),trigger:"change",required:!0}},{default:j(()=>[P(J,{gutter:12,align:"middle"},{default:j(()=>[P(Q,{span:21},{default:j(()=>[P(W,{modelValue:Ae.content,"onUpdate:modelValue":De=>Ae.content=De,style:{width:"210px"},disabled:Ae.isOther,placeholder:B.$t("views.applicationWorkflow.nodes.intentNode.classify.placeholder")},null,8,["modelValue","onUpdate:modelValue","disabled","placeholder"])]),_:2},1024),P(Q,{span:3},{default:j(()=>[Ae.isOther?Bn("",!0):(Ne(),bt(V,{key:0,link:"",size:"large",disabled:E.value.branch.filter(De=>!De.isOther).length<=1,onClick:De=>s(Ae.id)},{default:j(()=>[P(I,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"]))]),_:2},1024)]),_:2},1024)]),_:2},1032,["prop","rules"])]))),128))])]),_:1})]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:a,onRefresh:w},null,512)]),_:1},8,["nodeModel"])}}});class nae extends ai{constructor(e){super(e,tae)}}class rae extends si{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 l=this.properties.showNode===void 0?!0:this.properties.showNode,s=[];s.push({x:n-r/2+10,y:l?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 b=f[v];s.push({x:n+r/2-10,y:l?o-i/2+397+v*41.36:o-15,id:`${e}_${b.id}_right`,type:"right"}),console.log(o-i/2+397+100/2)}return s}}const oae={type:"intent-node",model:rae,view:nae},A8=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"},sae=_r({__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=hr({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)},l=He(),s=()=>{var h;const f=[(h=l.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))};return bo(()=>{Me.set(e.nodeModel,"validate",s)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),w=ne("el-form-item"),O=ne("el-col"),E=ne("el-input"),S=ne("AppIcon"),M=ne("el-button"),C=ne("el-row"),$=ne("el-form"),D=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P($,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:l,onSubmit:h[1]||(h[1]=gn(()=>{},["prevent"]))},{default:j(()=>[ee("div",iae,[r.value.condition_list.length>1?(Ne(),mn("div",aae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),P(b,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=k=>r.value.condition=k),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[P(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),P(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)])):Bn("",!0)]),(Ne(!0),mn(Ir,null,No(r.value.condition_list,(k,B)=>(Ne(),bt(C,{key:B,gutter:8},{default:j(()=>[P(O,{span:11},{default:j(()=>[P(w,{prop:"condition_list."+B+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[P(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:k.field,"onUpdate:modelValue":F=>k.field=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),P(O,{span:6},{default:j(()=>[P(w,{prop:"condition_list."+B+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[P(b,{onWheel:o,teleported:!1,modelValue:k.compare,"onUpdate:modelValue":F=>k.compare=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Wn($2),(F,I)=>(Ne(),bt(v,{key:I,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),P(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(k.compare)?Bn("",!0):(Ne(),bt(w,{key:0,prop:"condition_list."+B+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[P(E,{modelValue:k.value,"onUpdate:modelValue":F=>k.value=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),P(O,{span:1},{default:j(()=>[P(M,{link:"",type:"info",class:"mt-4",onClick:F=>a(B)},{default:j(()=>[P(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),P(M,{link:"",type:"primary",onClick:h[2]||(h[2]=k=>i())},{default:j(()=>[P(S,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(f.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]),_:1})]),_:1},8,["nodeModel"])}}});class lae extends ai{constructor(e){super(e,sae)}}const uae={type:"loop-break-node",model:si,view:lae},M8=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=_r({__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=hr({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)},l=He(),s=()=>{var h;const f=[(h=l.value)==null?void 0:h.validate()];return Promise.all(f).catch(v=>Promise.reject({node:e.nodeModel,errMessage:v}))};return bo(()=>{Me.set(e.nodeModel,"validate",s)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),w=ne("el-form-item"),O=ne("el-col"),E=ne("el-input"),S=ne("AppIcon"),M=ne("el-button"),C=ne("el-row"),$=ne("el-form"),D=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(D,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P($,{model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"ContinueFromRef",ref:l,onSubmit:h[1]||(h[1]=gn(()=>{},["prevent"]))},{default:j(()=>[ee("div",cae,[r.value.condition_list.length>1?(Ne(),mn("div",dae,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1),P(b,{teleported:!1,modelValue:r.value.condition,"onUpdate:modelValue":h[0]||(h[0]=k=>r.value.condition=k),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[P(v,{label:f.$t("views.applicationWorkflow.condition.AND"),value:"and"},null,8,["label"]),P(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)])):Bn("",!0)]),(Ne(!0),mn(Ir,null,No(r.value.condition_list,(k,B)=>(Ne(),bt(C,{key:B,gutter:8},{default:j(()=>[P(O,{span:11},{default:j(()=>[P(w,{prop:"condition_list."+B+".field",rules:{type:"array",required:!0,message:f.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[P(Go,{ref_for:!0,ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:f.$t("views.applicationWorkflow.variable.placeholder"),modelValue:k.field,"onUpdate:modelValue":F=>k.field=F},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])]),_:2},1024),P(O,{span:6},{default:j(()=>[P(w,{prop:"condition_list."+B+".compare",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),trigger:"change"}},{default:j(()=>[P(b,{onWheel:o,teleported:!1,modelValue:k.compare,"onUpdate:modelValue":F=>k.compare=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.conditions.requiredMessage"),clearable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(Wn($2),(F,I)=>(Ne(),bt(v,{key:I,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"])]),_:2},1024),P(O,{span:6},{default:j(()=>[["is_null","is_not_null","is_true","is_not_true"].includes(k.compare)?Bn("",!0):(Ne(),bt(w,{key:0,prop:"condition_list."+B+".value",rules:{required:!0,message:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage"),trigger:"blur"}},{default:j(()=>[P(E,{modelValue:k.value,"onUpdate:modelValue":F=>k.value=F,placeholder:f.$t("views.applicationWorkflow.nodes.conditionNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["prop","rules"]))]),_:2},1024),P(O,{span:1},{default:j(()=>[P(M,{link:"",type:"info",class:"mt-4",onClick:F=>a(B)},{default:j(()=>[P(S,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["model"]),P(M,{link:"",type:"primary",onClick:h[2]||(h[2]=k=>i())},{default:j(()=>[P(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:si,view:pae},T8=Object.freeze(Object.defineProperty({__proto__:null,default:hae},Symbol.toStringTag,{value:"Module"})),vae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={loop_type:"ARRAY",array:[],number:1},o=hr({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=hr(()=>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(s,1e3)()});const i=He(),a=He(),l=()=>{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}))},s=()=>{const v=e.nodeModel.graphModel.getNodeOutgoingNode(e.nodeModel.id).find(b=>b.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:[E7],edges:[]},b=e.nodeModel.x,w=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&&(b=e.nodeModel.properties.node_data.loop.x,w=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:b,y:w});e.nodeModel.graphModel.addEdge({type:"loop-edge",sourceNodeId:e.nodeModel.id,sourceAnchorId:e.nodeModel.id+"_children",targetNodeId:O.id,virtual:!0})}};return bo(()=>{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",l),e.nodeModel.virtual||f()}),(h,v)=>{const b=ne("el-option"),w=ne("el-select"),O=ne("el-form-item"),E=ne("el-input-number"),S=ne("el-form"),M=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(M,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(S,{onSubmit:v[6]||(v[6]=gn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:i},{default:j(()=>[P(O,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.label"),onClick:v[1]||(v[1]=gn(()=>{},["prevent"])),prop:"loop_type",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.requiredMessage"),trigger:"change",required:!0}},{default:j(()=>[P(w,{modelValue:o.value.loop_type,"onUpdate:modelValue":v[0]||(v[0]=C=>o.value.loop_type=C),type:"small"},{default:j(()=>[P(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.arrayLoop"),value:"ARRAY"},null,8,["label"]),P(b,{label:h.$t("views.applicationWorkflow.nodes.loopNode.loopType.numberLoop"),value:"NUMBER"},null,8,["label"]),P(b,{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"?(Ne(),bt(O,{key:0,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.label"),onClick:v[3]||(v[3]=gn(()=>{},["prevent"])),prop:"array",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopArray.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[P(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]=C=>o.value.array=C)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"])):o.value.loop_type=="NUMBER"?(Ne(),bt(O,{key:1,label:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.label"),onClick:v[5]||(v[5]=gn(()=>{},["prevent"])),prop:"number",rules:{message:h.$t("views.applicationWorkflow.nodes.loopNode.loopNumber.requiredMessage"),trigger:"blur",required:!0}},{default:j(()=>[P(E,{modelValue:o.value.number,"onUpdate:modelValue":v[4]||(v[4]=C=>o.value.number=C),min:1},null,8,["modelValue"])]),_:1},8,["label","rules"])):Bn("",!0)]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class mae extends ai{constructor(e){const n=e.model.properties.config;super(e,vae),e.model.properties.config=n}}class gae extends si{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,l=[];return this.type&&this.type!==Pr.Base.toString()&&(this.type!==Pr.Start.toString()&&l.push({x:n-r/2+10,y:a?o:o-15,id:`${e}_left`,edgeAddable:!1,type:"left"}),l.push({x:n+r/2-10,y:a?o:o-15,id:`${e}_right`,type:"right"})),l.push({x:n,y:o+i/2-25,id:`${e}_children`,type:"children"}),l}}const yae={type:"loop-node",model:gae,view:mae},C8=Object.freeze(Object.defineProperty({__proto__:null,default:yae},Symbol.toStringTag,{value:"Module"})),_ae={class:"dialog-footer"},bae=_r({__name:"LoopFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),l=He(null),s=He({field:"",label:""}),f=Rh({label:[{required:!0,message:kt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:kt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:kt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,E)=>{O&&(s.value=Me.cloneDeep(O),a.value=!0,l.value=E),h.value=!0},b=()=>{h.value=!1,a.value=!1,l.value=null,s.value={field:"",label:""}},w=async O=>{O&&await O.validate(E=>{E&&o("refresh",s.value,l.value)})};return e({open:v,close:b}),(O,E)=>{const S=ne("el-input"),M=ne("el-form-item"),C=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("common.param.editParam"):O.$t("common.param.addParam"),modelValue:h.value,"onUpdate:modelValue":E[3]||(E[3]=k=>h.value=k),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",_ae,[P($,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),P($,{type:"primary",onClick:E[2]||(E[2]=k=>w(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(()=>[P(C,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[P(M,{label:O.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:f.field},{default:j(()=>[P(S,{modelValue:s.value.field,"onUpdate:modelValue":E[0]||(E[0]=k=>s.value.field=k),maxlength:64,placeholder:O.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),P(M,{label:O.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:f.label},{default:j(()=>[P(S,{modelValue:s.value.label,"onUpdate:modelValue":E[1]||(E[1]=k=>s.value.label=k),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=_r({__name:"LoopFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(s,f){o.value.open(s,f)}function a(s){r.value.splice(s,1)}function l(s,f){for(let h=0;h<r.value.length;h++)if(r.value[h].field===s.field&&f!==h){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+s.field);return}[void 0,null].includes(f)?r.value.push(s):r.value.splice(f,1,s),o.value.close()}return bo(()=>{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)}),(s,f)=>{var E;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),w=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",wae,[ee("h5",Eae,_e(s.$t("views.applicationWorkflow.variable.loop")),1),ee("div",null,[ee("span",xae,[P(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[P(h,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(s.$t("common.add")),1)]),_:1})])])]),((E=e.nodeModel.properties.loop_input_field_list)==null?void 0:E.length)>0?(Ne(),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(()=>[P(b,{prop:"field",label:s.$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"]),P(b,{prop:"label",label:s.$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"]),P(b,{label:s.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",Aae,[P(w,{effect:"dark",content:s.$t("common.modify"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:gn(C=>i(S,M),["stop"])},{default:j(()=>[P(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(w,{effect:"dark",content:s.$t("common.delete"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:C=>a(M)},{default:j(()=>[P(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),P(bae,{ref_key:"ChatFieldDialogRef",ref:o,onRefresh:l},null,512)],64)}}}),Tae={class:"title-decoration-1 mb-8"},Cae={class:"title-decoration-1 mb-8"},Nae={class:"break-all"},Pae=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=hr(()=>(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=He(!1);return bo(()=>{e.nodeModel.graphModel.refresh_loop_fields(Me.cloneDeep(n.value))}),(r,i)=>{const a=ne("AppIcon"),l=ne("el-button"),s=ne("el-tooltip");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>{var f;return[ee("h5",Tae,_e(r.$t("views.applicationWorkflow.nodeSetting")),1),P(Mae,{nodeModel:t.nodeModel},null,8,["nodeModel"]),(f=n.value)!=null&&f.length?(Ne(),mn(Ir,{key:0},[ee("h5",Cae,_e(r.$t("views.applicationWorkflow.variable.loop")),1),(Ne(!0),mn(Ir,null,No(n.value||[],(h,v)=>(Ne(),mn("div",{key:v,class:"flex-between border-r-6 p-8-12 mb-8 layout-bg lighter",onMouseenter:i[0]||(i[0]=b=>o.value=!0),onMouseleave:i[1]||(i[1]=b=>o.value=!1)},[ee("span",Nae,_e(h.label)+" "+_e("{"+h.value+"}"),1),o.value===!0?(Ne(),bt(s,{key:0,effect:"dark",content:r.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[P(l,{link:"",onClick:b=>Wn(x_)(`{{loop.${h.value}}}`),style:{padding:"0"}},{default:j(()=>[P(a,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128))],64)):Bn("",!0)]}),_:1},8,["nodeModel"])}}});class kae extends ai{constructor(e){super(e,Pae)}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:kt("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:si,view:kae},N8=Object.freeze(Object.defineProperty({__proto__:null,default:Rae},Symbol.toStringTag,{value:"Module"})),Dae={class:"dialog-footer"},jae=_r({__name:"McpServerInputDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(!1),i=He(!1),a=He(),l=He({}),s=He([]);function f(v){r.value=!0,s.value=v}const h=async v=>{v&&await v.validate(b=>{b&&(o("refresh",l.value),r.value=!1)})};return e({open:f}),(v,b)=>{const w=ne("el-input"),O=ne("el-form-item"),E=ne("el-form"),S=ne("el-button"),M=ne("el-dialog");return Ne(),bt(M,{width:"600",title:"设置变量",modelValue:r.value,"onUpdate:modelValue":b[2]||(b[2]=C=>r.value=C),"close-on-click-modal":!1,"close-on-press-escape":!1,"append-to-body":!0},{footer:j(()=>[ee("span",Dae,[P(S,{onClick:b[0]||(b[0]=gn(C=>r.value=!1,["prevent"]))},{default:j(()=>[ft(_e(v.$t("common.cancel")),1)]),_:1}),P(S,{type:"primary",onClick:b[1]||(b[1]=C=>h(a.value)),loading:i.value},{default:j(()=>[ft(_e(v.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(E,{"label-position":"top",ref_key:"formRef",ref:a,model:l.value,"require-asterisk-position":"right"},{default:j(()=>[(Ne(!0),mn(Ir,null,No(s.value,C=>(Ne(),bt(O,{label:C,key:C,prop:C,rules:{required:!0,message:v.$t("dynamicsForm.tip.requiredMessage"),trigger:"blur"}},{default:j(()=>[P(w,{modelValue:l.value[C],"onUpdate:modelValue":$=>l.value[C]=$},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"},ese=`{
"math": {
"url": "your_server",
"transport": "sse"
}
}`,tse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=ja(),{params:{id:o}}=n,i=Qs("getApplicationDetail")(),a=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),l=He(),s=He(!1),f=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.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=He([]);function b(I){Me.set(e.nodeModel.properties.node_data,"mcp_servers",I)}async function w(){const I=await oi({type:"tool",systemType:a.value}).getToolById(D.value.mcp_tool_id,s);D.value.mcp_servers=I.data.code}function O(){if(D.value.mcp_source==="referencing"&&!D.value.mcp_tool_id){Xi(kt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="referencing"&&D.value.mcp_tool_id&&!v.value.find(I=>I.id===D.value.mcp_tool_id)){Xi(kt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip"));return}if(D.value.mcp_source==="custom"&&!D.value.mcp_servers){Xi(kt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}try{JSON.parse(D.value.mcp_servers);const I=M(D.value.mcp_servers);if(I.length>0){S.value.open(I);return}}catch{Xi(kt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip"));return}E(D.value.mcp_servers)}function E(I){oi({type:"application",systemType:a.value}).getMcpTools(o,I,s).then(V=>{var z;D.value.mcp_tools=V.data,Oh(kt("views.applicationWorkflow.nodes.mcpNode.getToolsSuccess")),D.value.mcp_server=(z=D.value.mcp_tools.find(X=>X.name===D.value.mcp_tool))==null?void 0:z.server})}const S=He();function M(I){const V=/\{\{\s*([a-zA-Z_][\w.]*)\s*\}\}/g,z=new Set,X=Y=>{if(typeof Y=="string"){let W;for(;(W=V.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 I=="string")try{X(JSON.parse(I))}catch{X(I)}else X(I);return[...z]}function C(I){let V=D.value.mcp_servers;for(const z in I)V=V.replace(`{{${z}}}`,I[z]);E(V)}function $(){var V,z,X,Y,W,Q;D.value.mcp_server=(V=D.value.mcp_tools.find(J=>J.name===D.value.mcp_tool))==null?void 0:V.server;const I=(z=D.value.mcp_tools.find(J=>J.name===D.value.mcp_tool))==null?void 0:z.args_schema;D.value.tool_form_field=[];for(const J in I==null?void 0:I.properties){const ie=I==null?void 0:I.properties[J].properties;if(ie){D.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"),D.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=I.properties[J].required)==null?void 0:X.indexOf(Se))!==-1,props_info:{rules:[{required:((Y=I.properties[J].required)==null?void 0:Y.indexOf(Se))!==-1,message:kt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}else{D.value.params_nested="";let Se="TextInput";I.properties[J].type==="string"?Se="TextInput":I.properties[J].type==="number"?Se="NumberInput":I.properties[J].type==="boolean"?Se="SwitchInput":(I.properties[J].type==="array"||I.properties[J].type==="object")&&(Se="JsonInput"),D.value.tool_form_field.push({field:J,label:{input_type:"TooltipLabel",label:J,attrs:{tooltip:I.properties[J].description},props_info:{}},input_type:Se,source:"referencing",required:((W=I.required)==null?void 0:W.indexOf(J))!==-1,props_info:{rules:[{required:((Q=I.required)==null?void 0:Q.indexOf(J))!==-1,message:kt("dynamicsForm.tip.requiredMessage"),trigger:"blur"}]}})}}D.value.params_nested?D.value.tool_params={[D.value.params_nested]:{}}:D.value.tool_params={}}const D=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",h),e.nodeModel.properties.node_data),set:I=>{Me.set(e.nodeModel.properties,"node_data",I)}}),k=He(),B=async()=>{if(l.value){const I=D.value.tool_form_field.filter(V=>V.required).map(V=>V.label.label);if(I.length>0){for(const V of I)if(D.value.params_nested){if(!D.value.tool_params[D.value.params_nested][V])return Promise.reject({node:e.nodeModel,errMessage:V+kt("dynamicsForm.tip.requiredMessage")})}else if(!D.value.tool_params[V])return Promise.reject({node:e.nodeModel,errMessage:V+kt("dynamicsForm.tip.requiredMessage")})}}if(k.value){const I=Me.cloneDeep(D.value);if(!I.mcp_servers)return Promise.reject({node:e.nodeModel,errMessage:kt("views.applicationWorkflow.nodes.mcpNode.mcpServerTip")});if(!I.mcp_tool)return Promise.reject({node:e.nodeModel,errMessage:kt("views.applicationWorkflow.nodes.mcpNode.mcpToolTip")})}};function F(){var V;const I=a.value==="systemManage"?{scope:"WORKSPACE",tool_type:"MCP",workspace_id:(V=i.value)==null?void 0:V.workspace_id}:{scope:"WORKSPACE",tool_type:"MCP"};oi({type:"tool",systemType:a.value}).getAllToolList(I,s).then(z=>{v.value=[...z.data.shared_tools,...z.data.tools].filter(X=>X.is_active)})}return bo(()=>{var I;typeof((I=e.nodeModel.properties.node_data)==null?void 0:I.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"),F(),Me.set(e.nodeModel,"validate",B)}),(I,V)=>{const z=ne("el-option"),X=ne("el-select"),Y=ne("MdEditorMagnify"),W=ne("el-avatar"),Q=ne("ToolIcon"),J=ne("el-tag"),ie=ne("el-form-item"),Se=ne("AppIcon"),Ae=ne("el-button"),ke=ne("el-tooltip"),De=ne("el-form"),ze=ne("el-text"),Ye=ne("el-input"),Be=ne("el-input-number"),Je=ne("el-switch"),gt=Rg("loading");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Lae,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",Iae,[P(De,{onSubmit:V[5]||(V[5]=gn(()=>{},["prevent"])),model:D.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:k,"hide-required-asterisk":""},{default:j(()=>[P(ie,{label:"MCP Server Config"},{label:j(()=>[ee("div",Fae,[V[8]||(V[8]=ee("div",null,[ft(" MCP Server Config "),ee("span",{class:"color-danger"},"*")],-1)),P(X,{teleported:!1,modelValue:D.value.mcp_source,"onUpdate:modelValue":V[0]||(V[0]=se=>D.value.mcp_source=se),size:"small",style:{width:"85px"}},{default:j(()=>[P(z,{label:I.$t("views.applicationWorkflow.nodes.mcpNode.reference"),value:"referencing"},null,8,["label"]),P(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[D.value.mcp_source==="custom"?(Ne(),bt(Y,{key:0,onWheel:f,title:"MCP Server Config",modelValue:D.value.mcp_servers,"onUpdate:modelValue":V[1]||(V[1]=se=>D.value.mcp_servers=se),style:{height:"150px"},onSubmitDialog:b,placeholder:ese},null,8,["modelValue"])):(Ne(),bt(X,{key:1,modelValue:D.value.mcp_tool_id,"onUpdate:modelValue":V[2]||(V[2]=se=>D.value.mcp_tool_id=se),filterable:"",onChange:w},{default:j(()=>[(Ne(!0),mn(Ir,null,No(v.value,se=>(Ne(),bt(z,{key:se.id,label:se.name,value:se.id},{default:j(()=>[ee("div",Bae,[se!=null&&se.icon?(Ne(),bt(W,{key:0,shape:"square",size:20,style:{background:"none"},class:"mr-8"},{default:j(()=>[ee("img",{src:Wn(mh)(se==null?void 0:se.icon),alt:""},null,8,$ae)]),_:2},1024)):(Ne(),bt(Q,{key:1,size:20,type:se==null?void 0:se.tool_type,class:"mr-8"},null,8,["type"])),ee("span",null,_e(se.name),1),se.scope==="SHARED"?(Ne(),bt(J,{key:2,type:"info",class:"info-tag ml-8"},{default:j(()=>[ft(_e(Wn(kt)("views.shared.title")),1)]),_:1})):Bn("",!0)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"]))]),_:1}),P(ie,null,{label:j(()=>[ee("div",Uae,[ee("span",null,_e(I.$t("views.tool.title")),1),P(Ae,{type:"primary",link:"",onClick:V[3]||(V[3]=se=>O())},{default:j(()=>[P(Se,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(I.$t("views.applicationWorkflow.nodes.mcpNode.getTool")),1)]),_:1})])]),default:j(()=>[P(X,{modelValue:D.value.mcp_tool,"onUpdate:modelValue":V[4]||(V[4]=se=>D.value.mcp_tool=se),onChange:$,filterable:""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.mcp_tools,se=>(Ne(),bt(z,{key:se.value,label:se.name,value:se.name,class:"flex align-center"},{default:j(()=>[P(ke,{effect:"dark",content:se.description,placement:"top-start","popper-class":"max-w-350"},{default:j(()=>[P(Se,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"]),ee("span",Vae,_e(se.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),ee("h5",Wae,_e(I.$t("views.applicationWorkflow.nodes.mcpNode.toolParam")),1),D.value.tool_params[D.value.params_nested]?(Ne(),mn(Ir,{key:0},[D.value.mcp_tool?(Ne(),mn("div",zae,[D.value.mcp_tool?Js((Ne(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:l,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[6]||(V[6]=gn(()=>{},["prevent"]))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.tool_form_field,se=>(Ne(),bt(ie,{key:se.field,required:se.required},{label:j(()=>[ee("div",Hae,[ee("div",null,[se.label.attrs.tooltip?(Ne(),bt($N,{key:0,label:se.label,tooltip:se.label.attrs.tooltip},null,8,["label","tooltip"])):(Ne(),mn("span",Xae,_e(se.label.label),1)),se.required?(Ne(),mn("span",Yae,"*")):Bn("",!0)]),P(X,{teleported:!1,modelValue:se.source,"onUpdate:modelValue":Ze=>se.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>D.value.tool_params[D.value.params_nested][se.label.label]=""},{default:j(()=>[P(z,{label:I.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),P(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[se.source==="custom"&&se.input_type==="TextInput"?(Ne(),bt(Ye,{key:0,modelValue:D.value.tool_params[D.value.params_nested][se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][se.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):se.source==="custom"&&se.input_type==="NumberInput"?(Ne(),bt(Be,{key:1,modelValue:D.value.tool_params[D.value.params_nested][se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][se.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):se.source==="custom"&&se.input_type==="SwitchInput"?(Ne(),bt(Je,{key:2,modelValue:D.value.tool_params[D.value.params_nested][se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][se.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):se.source==="custom"&&se.input_type==="JsonInput"?(Ne(),bt(Ye,{key:3,modelValue:D.value.tool_params[D.value.params_nested][se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][se.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):Bn("",!0),se.source==="referencing"?(Ne(),bt(Go,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[D.value.params_nested][se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[D.value.params_nested][se.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):Bn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[gt,s.value]]):Bn("",!0)])):(Ne(),mn("div",Gae,[P(ze,{type:"info"},{default:j(()=>[ft(_e(I.$t("common.noData")),1)]),_:1})]))],64)):(Ne(),mn(Ir,{key:1},[D.value.mcp_tool?(Ne(),mn("div",Kae,[D.value.mcp_tool?Js((Ne(),bt(De,{key:0,ref_key:"dynamicsFormRef",ref:l,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":!0,onSubmit:V[7]||(V[7]=gn(()=>{},["prevent"]))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(D.value.tool_form_field,se=>(Ne(),bt(ie,{key:se.field,required:se.required},{label:j(()=>[ee("div",Zae,[ee("div",null,[se.label.attrs.tooltip?(Ne(),bt($N,{key:0,label:se.label,tooltip:se.label.attrs.tooltip},null,8,["label","tooltip"])):(Ne(),mn("span",Jae,_e(se.label.label),1)),se.required?(Ne(),mn("span",Qae,"*")):Bn("",!0)]),P(X,{teleported:!1,modelValue:se.source,"onUpdate:modelValue":Ze=>se.source=Ze,size:"small",style:{width:"85px"},onChange:Ze=>D.value.tool_params[se.label.label]=""},{default:j(()=>[P(z,{label:I.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),P(z,{label:I.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])])]),default:j(()=>[se.source==="custom"&&se.input_type==="TextInput"?(Ne(),bt(Ye,{key:0,modelValue:D.value.tool_params[se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[se.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):se.source==="custom"&&se.input_type==="NumberInput"?(Ne(),bt(Be,{key:1,modelValue:D.value.tool_params[se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[se.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):se.source==="custom"&&se.input_type==="SwitchInput"?(Ne(),bt(Je,{key:2,modelValue:D.value.tool_params[se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[se.label.label]=Ze},null,8,["modelValue","onUpdate:modelValue"])):se.source==="custom"&&se.input_type==="JsonInput"?(Ne(),bt(Ye,{key:3,modelValue:D.value.tool_params[se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[se.label.label]=Ze,type:"textarea"},null,8,["modelValue","onUpdate:modelValue"])):Bn("",!0),se.source==="referencing"?(Ne(),bt(Go,{key:4,ref_for:!0,ref:"nodeCascaderRef2",nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.variable.placeholder"),modelValue:D.value.tool_params[se.label.label],"onUpdate:modelValue":Ze=>D.value.tool_params[se.label.label]=Ze},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):Bn("",!0)]),_:2},1032,["required"]))),128))]),_:1})),[[gt,s.value]]):Bn("",!0)])):(Ne(),mn("div",qae,[P(ze,{type:"info"},{default:j(()=>[ft(_e(I.$t("common.noData")),1)]),_:1})]))],64)),P(jae,{ref_key:"mcpServerInputDialogRef",ref:S,onRefresh:C},null,512)]),_:1},8,["nodeModel"])}}});class nse extends ai{constructor(e){super(e,tse)}}const rse={type:"mcp-node",model:si,view:nse},P8=Object.freeze(Object.defineProperty({__proto__:null,default:rse},Symbol.toStringTag,{value:"Module"})),ose={class:"dialog-footer"},ise=_r({__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=He(),a=He(!1),l=He(!1),s=He(null),f=He({field:"",label:"",parameter_type:"",desc:""}),h=Rh({label:[{required:!0,message:kt("dynamicsForm.paramForm.name.requiredMessage"),trigger:"blur"}],field:[{required:!0,message:kt("dynamicsForm.paramForm.field.requiredMessage"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:kt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),v=He(!1),b=(E,S)=>{E&&(f.value=Me.cloneDeep(E),l.value=!0,s.value=S),v.value=!0},w=()=>{v.value=!1,l.value=!1,s.value=null,f.value={field:"",label:""}},O=async E=>{E&&await E.validate(S=>{S&&o("refresh",f.value,s.value)})};return e({open:b,close:w}),(E,S)=>{const M=ne("el-input"),C=ne("el-form-item"),$=ne("el-option"),D=ne("el-select"),k=ne("el-form"),B=ne("el-button"),F=ne("el-dialog");return Ne(),bt(F,{title:l.value?E.$t("common.param.editParam"):E.$t("common.param.addParam"),modelValue:v.value,"onUpdate:modelValue":S[5]||(S[5]=I=>v.value=I),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":w,"append-to-body":""},{footer:j(()=>[ee("span",ose,[P(B,{onClick:gn(w,["prevent"])},{default:j(()=>[ft(_e(E.$t("common.cancel")),1)]),_:1}),P(B,{type:"primary",onClick:S[4]||(S[4]=I=>O(i.value)),loading:a.value},{default:j(()=>[ft(_e(E.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(k,{"label-position":"top",ref_key:"fieldFormRef",ref:i,rules:h,model:f.value,"require-asterisk-position":"right"},{default:j(()=>[P(C,{label:E.$t("dynamicsForm.paramForm.field.label"),required:!0,prop:"field",rules:h.field},{default:j(()=>[P(M,{modelValue:f.value.field,"onUpdate:modelValue":S[0]||(S[0]=I=>f.value.field=I),maxlength:64,placeholder:E.$t("dynamicsForm.paramForm.field.placeholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),P(C,{label:E.$t("dynamicsForm.paramForm.name.label"),required:!0,prop:"label",rules:h.label},{default:j(()=>[P(M,{modelValue:f.value.label,"onUpdate:modelValue":S[1]||(S[1]=I=>f.value.label=I),maxlength:64,"show-word-limit":"",placeholder:E.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),P(C,{label:E.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),required:!0,prop:"parameter_type",rules:h.label},{default:j(()=>[P(D,{modelValue:f.value.parameter_type,"onUpdate:modelValue":S[2]||(S[2]=I=>f.value.parameter_type=I),placeholder:E.$t("common.selectPlaceholder")+E.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType"),style:{width:"100%"}},{default:j(()=>[(Ne(),mn(Ir,null,No(r,I=>P($,{key:I.value,label:I.label,value:I.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),P(C,{label:E.$t("common.desc"),prop:"desc"},{default:j(()=>[P(M,{modelValue:f.value.desc,"onUpdate:modelValue":S[3]||(S[3]=I=>f.value.desc=I),style:{width:"100%"},rows:2,type:"textarea",placeholder:E.$t("common.descPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1},8,["rules","model"])]),_:1},8,["title","modelValue"])}}}),ase={class:"flex-between w-full"},sse={class:"break-all lighter"},lse={class:"ml-4",style:{"margin-top":"-4px"}},use=["title"],cse=["title"],dse={class:"mr-4"},fse=_r({__name:"ParametersFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(s,f){o.value.open(s,f)}function a(s){r.value.splice(s,1);const f=[{label:kt("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 l(s,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===s.field&&f!==v){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+s.field);return}[void 0,null].includes(f)?r.value.push(s):r.value.splice(f,1,s),o.value.close();const h=[{label:kt("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 bo(()=>{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 s=[{label:kt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(e.nodeModel.properties.config,"fields",s)}),(s,f)=>{var S;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),w=ne("el-tag"),O=ne("el-tooltip"),E=ne("el-table");return Ne(),mn(Ir,null,[ee("div",ase,[ee("h5",sse,[ft(_e(s.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.label"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",lse,[P(v,{link:"",type:"primary",onClick:f[0]||(f[0]=M=>i())},{default:j(()=>[P(h,{iconName:"app-add-outlined",class:"mr-4"})]),_:1})])]),((S=e.nodeModel.properties.node_data.variable_list)==null?void 0:S.length)>0?(Ne(),bt(E,{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(()=>[P(b,{prop:"field",label:s.$t("dynamicsForm.paramForm.field.label"),width:"90"},{default:j(({row:M})=>[ee("span",{title:M.field,class:"ellipsis-1"},_e(M.field),9,use)]),_:1},8,["label"]),P(b,{prop:"label",label:s.$t("dynamicsForm.paramForm.name.label")},{default:j(({row:M})=>[ee("span",null,[ee("span",{title:M.label,class:"ellipsis-1"},_e(M.label),9,cse)])]),_:1},8,["label"]),P(b,{prop:"label",label:s.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.parameterType")},{default:j(({row:M})=>[P(w,{type:"info",class:"info-tag"},{default:j(()=>[ft(_e(M.parameter_type),1)]),_:2},1024)]),_:1},8,["label"]),P(b,{label:s.$t("common.operation"),align:"left",width:"80"},{default:j(({row:M,$index:C})=>[ee("span",dse,[P(O,{effect:"dark",content:s.$t("common.modify"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:gn($=>i(M,C),["stop"])},{default:j(()=>[P(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(O,{effect:"dark",content:s.$t("common.delete"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:$=>a(C)},{default:j(()=>[P(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),P(ise,{ref_key:"ParametersFieldDialogRef",ref:o,onRefresh:l},null,512)],64)}}}),pse={class:"title-decoration-1 mb-8"},hse={class:"flex-between w-full"},vse={class:"flex-between"},mse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=t,o=He(),r=ja(),{params:{id:i}}=r,a=C=>{var $;C&&(($=o.value)==null||$.open(C,i,O.value.model_params_setting))};function l(C){Me.set(n.nodeModel.properties.node_data,"model_params_setting",C)}const s=e(),f=He(null),h=C=>C.ctrlKey===!0?(C.preventDefault(),!0):(C.stopPropagation(),!0),v=hr(()=>r.path.includes("resource-management")?"systemManage":"workspace");function b(){var $;const C=v.value==="systemManage"?{model_type:"LLM",workspace_id:($=s.value)==null?void 0:$.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:v.value}).getSelectModelList(C).then(D=>{f.value=Me.groupBy(D==null?void 0:D.data,"provider")})}const w={input_variable:[],model_params_setting:{},model_id:"",variable_list:[]},O=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",w),n.nodeModel.properties.node_data),set:C=>{Me.set(n.nodeModel.properties,"node_data",C)}}),E=C=>{var $;C?($=o.value)==null||$.reset_default(C,i):l({})},S=He(),M=async()=>S.value.validate().catch(C=>Promise.reject({node:n.nodeModel,errMessage:C}));return bo(()=>{b(),Me.set(n.nodeModel,"validate",M)}),(C,$)=>{const D=ne("AppIcon"),k=ne("el-button"),B=ne("ModelSelect"),F=ne("el-form-item"),I=ne("el-form"),V=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",pse,_e(C.$t("views.applicationWorkflow.nodeSetting")),1),P(V,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(I,{onSubmit:$[3]||($[3]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[P(F,{label:C.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:C.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",hse,[ee("div",null,[ee("span",null,[ft(_e(C.$t("views.application.form.aiModel.label")),1),$[4]||($[4]=ee("span",{class:"color-danger ml-4"},"*",-1))])]),P(k,{disabled:!O.value.model_id,type:"primary",link:"",onClick:$[0]||($[0]=z=>a(O.value.model_id)),onRefreshForm:l},{default:j(()=>[P(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(B,{onChange:E,onWheel:h,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":$[1]||($[1]=z=>O.value.model_id=z),placeholder:C.$t("views.application.form.aiModel.placeholder"),options:f.value,onSubmitModel:b,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(F,{prop:"input_variable",rules:{message:C.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",vse,[ee("div",null,[ft(_e(C.$t("views.applicationWorkflow.nodes.variableSplittingNode.inputVariables"))+" ",1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[P(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:C.$t("views.applicationWorkflow.variable.placeholder"),modelValue:O.value.input_variable,"onUpdate:modelValue":$[2]||($[2]=z=>O.value.input_variable=z)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),P(F,{prop:"variable_list",rules:{message:C.$t("views.applicationWorkflow.nodes.parameterExtractionNode.extractParameters.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[P(fse,{ref:"ParametersFieldTableRef","node-model":t.nodeModel},null,8,["node-model"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:o,onRefresh:l},null,512)]),_:1},8,["nodeModel"])}}});class gse extends ai{constructor(e){super(e,mse)}getConfig(e){return e.model.properties.config}}const yse={type:"parameter-extraction-node",model:si,view:gse},k8=Object.freeze(Object.defineProperty({__proto__:null,default:yse},Symbol.toStringTag,{value:"Module"})),_se={class:"title-decoration-1 mb-8"},bse={class:"flex-between"},wse={class:"flex-between"},Ese={class:"flex align-center"},xse={class:"flex align-center"},Ose={class:"mr-4"},Sse={class:"flex align-center"},Ase={class:"mr-4"},Mse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=He(),a=k=>k.ctrlKey===!0?(k.preventDefault(),!0):(k.stopPropagation(),!0),l=k=>{var B;k?(B=i.value)==null||B.reset_default(k,o):b({})};function s(k){Me.set(E.nodeModel.properties.node_data,"prompt",k)}function f(k){Me.set(E.nodeModel.properties.node_data,"system",k)}const h=`{{${kt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,v={model_id:"",system:kt("views.applicationWorkflow.nodes.questionNode.systemDefault"),prompt:h,dialogue_number:1,is_result:!1};function b(k){Me.set(E.nodeModel.properties.node_data,"model_params_setting",k)}const w=k=>{var B;k&&((B=i.value)==null||B.open(k,o,O.value.model_params_setting))},O=hr({get:()=>(E.nodeModel.properties.node_data||Me.set(E.nodeModel.properties,"node_data",v),E.nodeModel.properties.node_data),set:k=>{Me.set(E.nodeModel.properties,"node_data",k)}}),E=t,S=He(),M=He(null),C=()=>{var k;return(k=S.value)==null?void 0:k.validate().catch(B=>Promise.reject({node:E.nodeModel,errMessage:B}))},$=e();function D(){var B;const k=r.value==="systemManage"?{model_type:"LLM",workspace_id:(B=$.value)==null?void 0:B.workspace_id}:{model_type:"LLM"};oi({type:"model",systemType:r.value}).getSelectModelList(k).then(F=>{M.value=Me.groupBy(F==null?void 0:F.data,"provider")})}return bo(()=>{var k;D(),typeof((k=E.nodeModel.properties.node_data)==null?void 0:k.is_result)>"u"&&Qd(E.nodeModel)&&Me.set(E.nodeModel.properties.node_data,"is_result",!0),Me.set(E.nodeModel,"validate",C)}),(k,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-input-number"),Q=ne("el-switch"),J=ne("el-form"),ie=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",_se,_e(k.$t("views.applicationWorkflow.nodeSetting")),1),P(ie,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(J,{onSubmit:B[7]||(B[7]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"questionNodeFormRef",ref:S,"hide-required-asterisk":""},{default:j(()=>[P(z,{label:k.$t("views.application.form.aiModel.label"),prop:"model_id",rules:{required:!0,message:k.$t("views.application.form.aiModel.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",bse,[ee("div",null,[ee("span",null,[ft(_e(k.$t("views.application.form.aiModel.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),P(I,{type:"primary",link:"",disabled:!O.value.model_id,onClick:B[0]||(B[0]=Se=>w(O.value.model_id)),onRefreshForm:b},{default:j(()=>[P(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(V,{onChange:l,onWheel:a,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=Se=>O.value.model_id=Se),placeholder:k.$t("views.application.form.aiModel.placeholder"),options:M.value,onSubmitModel:D,showFooter:"","model-type":"LLM"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(z,null,{label:j(()=>[ee("div",wse,[ee("div",Ese,[ee("span",null,_e(k.$t("views.application.form.roleSettings.label")),1),P(X,{effect:"dark",content:k.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])])]),default:j(()=>[P(Y,{title:k.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":B[2]||(B[2]=Se=>O.value.system=Se),style:{height:"100px"},onSubmitDialog:f,placeholder:`${Wn(kt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),P(z,{label:k.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:k.$t("views.application.form.prompt.tooltip"),trigger:"blur"}},{label:j(()=>[ee("div",xse,[ee("div",Ose,[ee("span",null,[ft(_e(k.$t("views.application.form.prompt.label")),1),B[9]||(B[9]=ee("span",{class:"color-danger"},"*",-1))])]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:a,title:k.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":B[3]||(B[3]=Se=>O.value.prompt=Se),style:{height:"150px"},onSubmitDialog:s,placeholder:`${Wn(kt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.application.form.historyRecord.label")},{default:j(()=>[P(W,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":B[4]||(B[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"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[6]||(B[6]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Sse,[ee("div",Ase,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Q,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":B[5]||(B[5]=Se=>O.value.is_result=Se)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:i,onRefresh:b},null,512)]),_:1},8,["nodeModel"])}}});class Tse extends ai{constructor(e){super(e,Mse)}}const Cse={type:"question-node",model:si,view:Tse},R8=Object.freeze(Object.defineProperty({__proto__:null,default:Cse},Symbol.toStringTag,{value:"Module"})),Nse={class:"flex-between"},Pse={class:"flex align-center"},kse={class:"mr-4"},Rse=_r({__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=hr({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=He(),l=He(),s=()=>{var f;return Promise.all([l.value?l.value.validate():Promise.resolve(""),(f=a.value)==null?void 0:f.validate()]).catch(h=>Promise.reject({node:e.nodeModel,errMessage:h}))};return bo(()=>{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",s)}),(f,h)=>{const v=ne("el-option"),b=ne("el-select"),w=ne("MdEditorMagnify"),O=ne("el-form-item"),E=ne("AppIcon"),S=ne("el-tooltip"),M=ne("el-switch"),C=ne("el-form"),$=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P($,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(C,{onSubmit:h[5]||(h[5]=gn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:a},{default:j(()=>[P(O,{label:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")},{label:j(()=>[ee("div",Nse,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.replyNode.replyContent")),1),P(b,{teleported:!1,modelValue:r.value.reply_type,"onUpdate:modelValue":h[0]||(h[0]=D=>r.value.reply_type=D),size:"small",style:{width:"85px"}},{default:j(()=>[P(v,{label:f.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),P(v,{label:f.$t("common.custom"),value:"content"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[r.value.reply_type==="content"?(Ne(),bt(w,{key:0,onWheel:n,title:f.$t("views.applicationWorkflow.nodes.replyNode.replyContent"),modelValue:r.value.content,"onUpdate:modelValue":h[1]||(h[1]=D=>r.value.content=D),style:{height:"150px"},onSubmitDialog:i},null,8,["title","modelValue"])):(Ne(),bt(Go,{key:1,ref_key:"nodeCascaderRef",ref:l,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]=D=>r.value.fields=D)},null,8,["nodeModel","placeholder","modelValue"]))]),_:1},8,["label"]),P(O,{label:f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:h[4]||(h[4]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Pse,[ee("div",kse,[ee("span",null,_e(f.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(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(()=>[P(E,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(M,{size:"small",modelValue:r.value.is_result,"onUpdate:modelValue":h[3]||(h[3]=D=>r.value.is_result=D)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1},8,["nodeModel"])}}});class Dse extends ai{constructor(e){super(e,Rse)}}const jse={type:"reply-node",model:si,view:Dse},D8=Object.freeze(Object.defineProperty({__proto__:null,default:jse},Symbol.toStringTag,{value:"Module"})),Lse={class:"flex align-center"},Ise={class:"mr-4"},Fse={class:"dialog-footer"},Bse=_r({__name:"ParamSettingDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He({top_n:3,similarity:0,max_paragraph_char_number:5e3}),a=He(!1),l=He(!1);K_(a,h=>{h||(i.value={top_n:3,similarity:0,max_paragraph_char_number:5e3})});const s=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,b)=>{v&&(o("refresh",Me.cloneDeep(i.value)),a.value=!1)})};return e({open:s}),(h,v)=>{const b=ne("AppIcon"),w=ne("el-tooltip"),O=ne("el-input-number"),E=ne("el-form-item"),S=ne("el-col"),M=ne("el-row"),C=ne("el-slider"),$=ne("el-form"),D=ne("el-button"),k=ne("el-dialog");return Ne(),bt(k,{"align-center":"",title:h.$t("common.paramSetting"),class:"param-dialog",modelValue:a.value,"onUpdate:modelValue":v[5]||(v[5]=B=>a.value=B),style:{width:"550px"},"append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},{footer:j(()=>[ee("span",Fse,[P(D,{onClick:v[3]||(v[3]=gn(B=>a.value=!1,["prevent"]))},{default:j(()=>[ft(_e(h.$t("common.cancel")),1)]),_:1}),P(D,{type:"primary",onClick:v[4]||(v[4]=B=>f()),loading:l.value},{default:j(()=>[ft(_e(h.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[P($,{"label-position":"top",ref_key:"paramFormRef",ref:r,model:i.value},{default:j(()=>[P(M,{gutter:12},{default:j(()=>[P(S,{span:12},{default:j(()=>[P(E,null,{label:j(()=>[ee("div",Lse,[ee("span",Ise,"Score "+_e(h.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1),P(w,{effect:"dark",content:h.$t("views.applicationWorkflow.nodes.rerankerNode.ScoreTooltip"),placement:"right"},{default:j(()=>[P(b,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[P(O,{modelValue:i.value.similarity,"onUpdate:modelValue":v[0]||(v[0]=B=>i.value.similarity=B),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}),P(S,{span:12},{default:j(()=>[P(E,{label:h.$t("views.application.dialog.topReferences")},{default:j(()=>[P(O,{modelValue:i.value.top_n,"onUpdate:modelValue":v[1]||(v[1]=B=>i.value.top_n=B),min:1,max:1e4,"value-on-clear":1,"controls-position":"right",class:"w-full"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),_:1}),P(E,{label:h.$t("views.application.dialog.maxCharacters")},{default:j(()=>[P(C,{modelValue:i.value.max_paragraph_char_number,"onUpdate:modelValue":v[2]||(v[2]=B=>i.value.max_paragraph_char_number=B),"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"])}}}),$se={class:"flex-between"},Use={class:"flex-between"},Vse={class:"w-full"},Wse={class:"flex-between"},Gse={class:"flex-between"},zse=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(),l={reranker_reference_list:[[]],reranker_model_id:"",question_reference_address:[],reranker_setting:{top_n:3,similarity:0,max_paragraph_char_number:5e3},show_knowledge:!1},s=He(null),f=()=>{var D;(D=a.value)==null||D.open(b.value.reranker_setting)},h=D=>{const k=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);k.splice(D,1),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",k)},v=D=>D.ctrlKey===!0?(D.preventDefault(),!0):(D.stopPropagation(),!0),b=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",l),i.nodeModel.properties.node_data),set:D=>{Me.set(i.nodeModel.properties,"node_data",D)}});function w(D){Me.set(i.nodeModel.properties.node_data,"reranker_setting",D)}const O=e();function E(){var k;const D=r.value==="systemManage"?{model_type:"RERANKER",workspace_id:(k=O.value)==null?void 0:k.workspace_id}:{model_type:"RERANKER"};oi({type:"model",systemType:r.value}).getSelectModelList(D).then(B=>{s.value=Me.groupBy(B==null?void 0:B.data,"provider")})}const S=()=>{const D=Me.cloneDeep(i.nodeModel.properties.node_data.reranker_reference_list);D.push([]),Me.set(i.nodeModel.properties.node_data,"reranker_reference_list",D)},M=He(),C=He(),$=()=>{var D;return Promise.all([C.value?C.value.validate():Promise.resolve(""),(D=M.value)==null?void 0:D.validate()]).catch(k=>Promise.reject({node:i.nodeModel,errMessage:k}))};return bo(()=>{E(),b.value.show_knowledge=b.value.show_knowledge?b.value.show_knowledge:!1,Me.set(i.nodeModel,"validate",$)}),(D,k)=>{const B=ne("AppIcon"),F=ne("el-button"),I=ne("el-form-item"),V=ne("el-col"),z=ne("el-row"),X=ne("ModelSelect"),Y=ne("el-switch"),W=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(Q,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(W,{onSubmit:k[4]||(k[4]=gn(()=>{},["prevent"])),model:b.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"rerankerNodeFormRef",ref:M,"hide-required-asterisk":""},{default:j(()=>[P(I,{label:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label"),prop:"reranker_reference_list",rules:{type:"array",message:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),trigger:"change",required:!0}},{label:j(()=>[ee("div",$se,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.label")),1),k[5]||(k[5]=ee("span",{class:"color-danger"},"*",-1))]),P(F,{onClick:S,link:"",type:"primary"},{default:j(()=>[P(B,{iconName:"app-add-outlined"})]),_:1})])]),default:j(()=>[(Ne(!0),mn(Ir,null,No(b.value.reranker_reference_list,(J,ie)=>(Ne(),bt(z,{gutter:8,style:{"margin-bottom":"8px"},key:ie,class:"w-full"},{default:j(()=>[P(V,{span:22},{default:j(()=>[P(I,{prop:"reranker_reference_list."+ie,rules:{type:"array",required:!0,message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[(Ne(),bt(Go,{key:ie,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.rerankerContent.requiredMessage"),modelValue:b.value.reranker_reference_list[ie],"onUpdate:modelValue":Se=>b.value.reranker_reference_list[ie]=Se},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"]))]),_:2},1032,["prop","rules"])]),_:2},1024),P(V,{span:2},{default:j(()=>[P(F,{link:"",type:"info",onClick:Se=>h(ie)},{default:j(()=>[P(B,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["label","rules"]),P(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",Use,[ee("span",null,_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),P(F,{type:"primary",link:"",onClick:f},{default:j(()=>[P(B,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",Vse,[P(z,null,{default:j(()=>[P(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(" Score "+_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.higher")),1)]),_:1}),P(V,{span:12,class:"lighter"},{default:j(()=>{var J;return[ft(_e((J=b.value.reranker_setting.similarity)==null?void 0:J.toFixed(3)),1)]}),_:1}),P(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(D.$t("chat.KnowledgeSource.referenceParagraph"))+" Top",1)]),_:1}),P(V,{span:12,class:"lighter"},{default:j(()=>[ft(_e(b.value.reranker_setting.top_n),1)]),_:1}),P(V,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.max_paragraph_char_number")),1)]),_:1}),P(V,{span:12,class:"lighter"},{default:j(()=>[ft(_e(b.value.reranker_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),P(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),prop:"question_reference_address",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Wse,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label")),1),k[6]||(k[6]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:C,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"),modelValue:b.value.question_reference_address,"onUpdate:modelValue":k[0]||(k[0]=J=>b.value.question_reference_address=J)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(I,{label:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label"),prop:"reranker_model_id",rules:{required:!0,message:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Gse,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.label")),1),k[7]||(k[7]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[P(X,{onWheel:v,teleported:!1,modelValue:b.value.reranker_model_id,"onUpdate:modelValue":k[1]||(k[1]=J=>b.value.reranker_model_id=J),placeholder:D.$t("views.applicationWorkflow.nodes.rerankerNode.reranker_model.placeholder"),options:s.value,onSubmitModel:E,showFooter:"","model-type":"RERANKER"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(I,{label:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.label"),prop:"show_knowledge",required:"",onClick:k[3]||(k[3]=gn(()=>{},["prevent"]))},{default:j(()=>[P(Y,{size:"small",modelValue:b.value.show_knowledge,"onUpdate:modelValue":k[2]||(k[2]=J=>b.value.show_knowledge=J)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(Bse,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:w},null,512)]),_:1},8,["nodeModel"])}}}),Hse=kh(zse,[["__scopeId","data-v-298ea2ea"]]);class Xse extends ai{constructor(e){super(e,Hse)}}const Yse={type:"reranker-node",model:si,view:Xse},j8=Object.freeze(Object.defineProperty({__proto__:null,default:Yse},Symbol.toStringTag,{value:"Module"})),qse={class:"title-decoration-1 mb-8"},Kse={class:"flex-between"},Zse={key:0,class:"w-full"},Jse={class:"flex align-center",style:{"line-height":"20px"}},Qse=["title"],ele={key:1,class:"w-full"},tle={class:"flex-between"},nle={class:"flex align-center"},rle={class:"flex align-center"},ole={class:"w-full"},ile={key:1},ale={class:"flex align-center mb-8"},sle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=ja(),n=t,o=He(),r=He(),i=[{value:"contain",label:kt("views.applicationWorkflow.compare.contain")},{value:"not_contain",label:kt("views.applicationWorkflow.compare.not_contain")},{value:"eq",label:kt("views.applicationWorkflow.compare.eq")}],a=hr(()=>e.path.includes("shared")?"systemShare":e.path.includes("resource-management")?"systemManage":e.path.includes("share/")?"workspaceShare":"workspace"),l={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:[]},s=hr({get:()=>(n.nodeModel.properties.node_data||Me.set(n.nodeModel.properties,"node_data",l),n.nodeModel.properties.node_data),set:D=>{Me.set(n.nodeModel.properties,"node_data",D)}}),f=He(),h=He(),v=He([]),b=He(!1);function w(D){const k=n.nodeModel.properties.node_data.knowledge_id_list.filter(B=>B!==D);Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",k)}function O(D){Me.set(n.nodeModel.properties.node_data,"knowledge_id_list",D.map(k=>k.id)),Me.set(n.nodeModel.properties.node_data,"knowledge_list",D),v.value=D}function E(){h.value&&h.value.open(s.value.knowledge_id_list)}function S(){const D=Me.cloneDeep(s.value.search_condition_list);D.push({key:"",compare:"contain",value:""}),Me.set(s.value,"search_condition_list",D)}function M(D){const k=Me.cloneDeep(s.value.search_condition_list);k.splice(D,1),Me.set(s.value,"search_condition_list",k)}function C(D){if(D.length===0){Me.set(s.value,"knowledge_tags",[]);return}oi({type:"knowledge",systemType:a.value}).getAllTags({knowledge_ids:D},{}).then(k=>{Me.set(s.value,"knowledge_tags",k.data)})}const $=()=>{var D,k,B;return Promise.all([(D=o.value)==null?void 0:D.validate(),(k=r.value)==null?void 0:k.validate(),(B=f.value)==null?void 0:B.validate()]).catch(F=>Promise.reject({node:n.nodeModel,errMessage:F}))};return bo(()=>{v.value=n.nodeModel.properties.node_data.knowledge_list,Me.set(n.nodeModel,"validate",$)}),(D,k)=>{const B=ne("el-button"),F=ne("el-option"),I=ne("el-select"),V=ne("el-text"),z=ne("KnowledgeIcon"),X=ne("Close"),Y=ne("el-icon"),W=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("el-radio"),ie=ne("el-radio-group"),Se=ne("el-col"),Ae=ne("el-input"),ke=ne("el-row"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",qse,_e(D.$t("views.applicationWorkflow.nodeSetting")),1),P(ze,{shadow:"never",class:"card-never"},{default:j(()=>[P(De,{onSubmit:k[8]||(k[8]=gn(()=>{},["prevent"])),model:s.value,"label-position":"top","hide-required-asterisk":"","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:f},{default:j(()=>[P(W,null,{label:j(()=>[ee("div",Kse,[ee("span",null,_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[s.value.search_scope_type==="custom"?(Ne(),bt(B,{key:0,type:"primary",link:"",onClick:E},{default:j(()=>[P(Lv,{iconName:"app-add-outlined"})]),_:1})):Bn("",!0),P(I,{teleported:!1,size:"small",modelValue:s.value.search_scope_type,"onUpdate:modelValue":k[0]||(k[0]=Ye=>s.value.search_scope_type=Ye),style:{width:"85px"}},{default:j(()=>[P(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),P(F,{label:D.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>{var Ye;return[s.value.search_scope_type==="custom"?(Ne(),mn("div",Zse,[((Ye=s.value.knowledge_id_list)==null?void 0:Ye.length)===0?(Ne(),bt(V,{key:0,type:"info"},{default:j(()=>[ft(_e(D.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Ne(!0),mn(Ir,{key:1},No(s.value.knowledge_id_list,(Be,Je)=>{var gt,se,Ze;return Ne(),mn("div",{key:Je,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",Jse,[P(z,{type:(gt=Wn(bl)(v.value,Be,"id"))==null?void 0:gt.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(se=Wn(bl)(v.value,Be,"id"))==null?void 0:se.name},_e((Ze=Wn(bl)(v.value,Be,"id"))==null?void 0:Ze.name),9,Qse)]),P(B,{text:"",onClick:pe=>w(Be)},{default:j(()=>[P(Y,null,{default:j(()=>[P(X)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Ne(),mn("div",ele,[P(W,{prop:"search_scope_reference",rules:{message:D.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",tle,[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.select_variable"))+" ",1),k[9]||(k[9]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",null,[P(I,{teleported:!1,size:"small",modelValue:s.value.search_scope_source,"onUpdate:modelValue":k[1]||(k[1]=Be=>s.value.search_scope_source=Be),style:{width:"95px"},onChange:k[2]||(k[2]=Be=>s.value.search_scope_reference=[])},{default:j(()=>[P(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),P(F,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:o,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.variable.placeholder"),modelValue:s.value.search_scope_reference,"onUpdate:modelValue":k[3]||(k[3]=Be=>s.value.search_scope_reference=Be)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])]))]}),_:1}),P(W,{label:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.searchSetting")},{default:j(()=>[P(ie,{modelValue:s.value.search_mode,"onUpdate:modelValue":k[4]||(k[4]=Ye=>s.value.search_mode=Ye)},{default:j(()=>[P(J,{value:"auto"},{default:j(()=>[ee("span",nle,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.auto"))+" ",1),P(Q,{content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.autoTooltip"),placement:"top"},{default:j(()=>[P(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1}),s.value.search_scope_type==="custom"?(Ne(),bt(J,{key:0,value:"custom"},{default:j(()=>[ee("span",rle,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"))+" ",1),P(Q,{c:"",content:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.customTooltip"),placement:"top"},{default:j(()=>[P(Lv,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])])]),_:1})):Bn("",!0)]),_:1},8,["modelValue"])]),_:1},8,["label"]),ee("div",ole,[s.value.search_mode==="auto"?(Ne(),bt(W,{key:0,prop:"question_reference",rules:{message:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("span",null,[ft(_e(D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.label"))+" ",1),k[10]||(k[10]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef2",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:D.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.placeholder"),modelValue:s.value.question_reference,"onUpdate:modelValue":k[5]||(k[5]=Ye=>s.value.question_reference=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"])):(Ne(),mn("div",ile,[ee("div",ale,[P(V,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.info")),1)]),_:1}),P(I,{modelValue:s.value.search_condition_type,"onUpdate:modelValue":k[6]||(k[6]=Ye=>s.value.search_condition_type=Ye),size:"small",style:{width:"60px",margin:"0 8px"}},{default:j(()=>[P(F,{label:D.$t("views.applicationWorkflow.condition.AND"),value:"AND"},null,8,["label"]),P(F,{label:D.$t("views.applicationWorkflow.condition.OR"),value:"OR"},null,8,["label"])]),_:1},8,["modelValue"]),P(V,{type:"info",class:"lighter",size:"small"},{default:j(()=>[ft(_e(D.$t("views.applicationWorkflow.nodes.conditionNode.conditions.label")),1)]),_:1})]),(Ne(!0),mn(Ir,null,No(s.value.search_condition_list,(Ye,Be)=>(Ne(),mn("div",{key:Be},[P(ke,{gutter:8,class:"mb-8"},{default:j(()=>[P(Se,{span:8},{default:j(()=>[P(I,{modelValue:Ye.key,"onUpdate:modelValue":Je=>Ye.key=Je,filterable:"",onFocus:k[7]||(k[7]=Je=>C(s.value.knowledge_id_list))},{default:j(()=>[(Ne(!0),mn(Ir,null,No(s.value.knowledge_tags,Je=>(Ne(),bt(F,{key:Je,label:Je.key,value:Je.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),P(Se,{span:7},{default:j(()=>[P(I,{modelValue:Ye.compare,"onUpdate:modelValue":Je=>Ye.compare=Je},{default:j(()=>[(Ne(),mn(Ir,null,No(i,Je=>P(F,{key:Je.value,value:Je.value,label:Je.label},null,8,["value","label"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1024),P(Se,{span:8},{default:j(()=>[P(Ae,{modelValue:Ye.value,"onUpdate:modelValue":Je=>Ye.value=Je,placeholder:D.$t("views.applicationWorkflow.nodes.searchDocumentNode.valueMessage")},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1024),P(Se,{span:1},{default:j(()=>[P(B,{link:"",onClick:Je=>M(Be),type:"info",class:"mt-4"},{default:j(()=>[P(Lv,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]))),128)),P(B,{link:"",type:"primary",onClick:S,class:"mt-8"},{default:j(()=>[P(Lv,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(D.$t("views.applicationWorkflow.nodes.conditionNode.addCondition")),1)]),_:1})]))])]),_:1},8,["model"])]),_:1}),P(Bj,{ref_key:"AddKnowledgeDialogRef",ref:h,onAddData:O,data:v.value,loading:b.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class lle extends ai{constructor(e){super(e,sle)}}const ule={type:"search-document-node",model:si,view:lle},L8=Object.freeze(Object.defineProperty({__proto__:null,default:ule},Symbol.toStringTag,{value:"Module"})),cle={class:"title-decoration-1 mb-8"},dle={class:"flex-between"},fle={key:0,class:"w-full"},ple={class:"flex align-center",style:{"line-height":"20px"}},hle=["title"],vle={key:1,class:"w-full"},mle={class:"flex-between"},gle={class:"flex-between"},yle={class:"w-full"},_le={class:"flex-between"},ble={class:"flex-between"},wle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=He(),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=hr({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=He(),a=He(),l=He(),s=He([]),f=He(!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 b(S){const M=e.nodeModel.properties.node_data.knowledge_id_list.filter(C=>C!==S);Me.set(e.nodeModel.properties.node_data,"knowledge_id_list",M)}function w(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),s.value=S}function O(){l.value&&l.value.open(r.value.knowledge_id_list)}const E=()=>{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 bo(()=>{s.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",E)}),(S,M)=>{const C=ne("el-button"),$=ne("el-option"),D=ne("el-select"),k=ne("el-text"),B=ne("KnowledgeIcon"),F=ne("Close"),I=ne("el-icon"),V=ne("el-form-item"),z=ne("el-col"),X=ne("el-row"),Y=ne("el-switch"),W=ne("el-form"),Q=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",cle,_e(S.$t("views.applicationWorkflow.nodeSetting")),1),P(Q,{shadow:"never",class:"card-never"},{default:j(()=>[P(W,{onSubmit:M[7]||(M[7]=gn(()=>{},["prevent"])),model:r.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"knowledgeNodeFormRef",ref:i,"hide-required-asterisk":""},{default:j(()=>[P(V,null,{label:j(()=>[ee("div",dle,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchDocumentNode.selectKnowledge")),1),ee("span",null,[r.value.search_scope_type==="custom"?(Ne(),bt(C,{key:0,type:"primary",link:"",onClick:O},{default:j(()=>[P(Lv,{iconName:"app-add-outlined"})]),_:1})):Bn("",!0),P(D,{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(()=>[P($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.custom"),value:"custom"},null,8,["label"]),P($,{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"?(Ne(),mn("div",fle,[((J=r.value.knowledge_id_list)==null?void 0:J.length)===0?(Ne(),bt(k,{key:0,type:"info"},{default:j(()=>[ft(_e(S.$t("views.application.form.relatedKnowledge.placeholder")),1)]),_:1})):(Ne(!0),mn(Ir,{key:1},No(r.value.knowledge_id_list,(ie,Se)=>{var Ae,ke,De;return Ne(),mn("div",{key:Se,class:"flex-between border border-r-6 white-bg mb-4",style:{padding:"5px 8px"}},[ee("div",ple,[P(B,{type:(Ae=Wn(bl)(s.value,ie,"id"))==null?void 0:Ae.type,class:"mr-8",size:20},null,8,["type"]),ee("div",{class:"ellipsis",title:(ke=Wn(bl)(s.value,ie,"id"))==null?void 0:ke.name},_e((De=Wn(bl)(s.value,ie,"id"))==null?void 0:De.name),9,hle)]),P(C,{text:"",onClick:ze=>b(ie)},{default:j(()=>[P(I,null,{default:j(()=>[P(F)]),_:1})]),_:1},8,["onClick"])])}),128))])):(Ne(),mn("div",vle,[P(V,{prop:"search_scope_reference",rules:{message:S.$t("views.applicationWorkflow.variable.placeholder"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",mle,[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,[P(D,{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(()=>[P($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.knowledge_list"),value:"knowledge"},null,8,["label"]),P($,{label:S.$t("views.applicationWorkflow.nodes.searchDocumentNode.document_list"),value:"document"},null,8,["label"])]),_:1},8,["modelValue"])])])]),default:j(()=>[P(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}),P(V,{label:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")},{label:j(()=>[ee("div",gle,[ee("span",null,_e(S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchParam")),1),P(C,{type:"primary",link:"",onClick:v},{default:j(()=>[P(Lv,{iconName:"app-setting"})]),_:1})])]),default:j(()=>[ee("div",yle,[P(X,null,{default:j(()=>[P(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.selectSearchMode")),1)]),_:1}),P(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(S.$t(Wn(v7)[r.value.knowledge_setting.search_mode])),1)]),_:1}),P(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.similarityThreshold")),1)]),_:1}),P(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}),P(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.topReferences")),1)]),_:1}),P(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.top_n),1)]),_:1}),P(z,{span:12,class:"color-secondary lighter"},{default:j(()=>[ft(_e(S.$t("views.application.dialog.maxCharacters")),1)]),_:1}),P(z,{span:12,class:"lighter"},{default:j(()=>[ft(_e(r.value.knowledge_setting.max_paragraph_char_number),1)]),_:1})]),_:1})])]),_:1},8,["label"]),P(V,{prop:"question_reference_address",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.searchQuestion.requiredMessage"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",_le,[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(()=>[P(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"]),P(V,{prop:"show_knowledge",rules:{message:S.$t("views.applicationWorkflow.nodes.searchKnowledgeNode.showKnowledge.requiredMessage"),trigger:"blur",required:!0},onClick:M[6]||(M[6]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",ble,[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(()=>[P(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}),P(A7,{ref_key:"ParamSettingDialogRef",ref:a,onRefresh:h},null,512),P(Bj,{ref_key:"AddknowledgeDialogRef",ref:l,onAddData:w,data:s.value,loading:f.value},null,8,["data","loading"])]),_:1},8,["nodeModel"])}}});class Ele extends ai{constructor(e){super(e,wle)}}const xle={type:"search-knowledge-node",model:si,view:Ele},I8=Object.freeze(Object.defineProperty({__proto__:null,default:xle},Symbol.toStringTag,{value:"Module"})),Ole={class:"title-decoration-1 mb-8"},Sle={class:"flex-between w-full"},Ale={class:"flex-between w-full"},Mle={class:"flex align-center"},Tle={class:"mr-4"},Cle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(),s=He(),f=He(),h=()=>{var $;return Promise.all([f.value?f.value.validate():Promise.resolve(""),($=s.value)==null?void 0:$.validate()]).catch(D=>Promise.reject({node:i.nodeModel,errMessage:D}))},v=$=>$.ctrlKey===!0?($.preventDefault(),!0):($.stopPropagation(),!0),b={stt_model_id:"",is_result:!0,audio_list:[],model_params_setting:{}},w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:$=>{Me.set(i.nodeModel.properties,"node_data",$)}}),O=()=>{var D;const $=w.value.stt_model_id;if(!$){Oh(kt("views.application.form.voiceInput.requiredMessage"));return}(D=l.value)==null||D.open($,o,w.value.model_params_setting)},E=$=>{Me.set(i.nodeModel.properties.node_data,"model_params_setting",$)};function S($){var D;$?(D=l.value)==null||D.reset_default($,o):E({})}const M=e();function C(){var D;const $=r.value==="systemManage"?{model_type:"STT",workspace_id:(D=M.value)==null?void 0:D.workspace_id}:{model_type:"STT"};oi({type:"model",systemType:r.value}).getSelectModelList($).then(k=>{a.value=Me.groupBy(k==null?void 0:k.data,"provider")})}return bo(()=>{C(),Me.set(i.nodeModel,"validate",h)}),($,D)=>{const k=ne("AppIcon"),B=ne("el-button"),F=ne("ModelSelect"),I=ne("el-form-item"),V=ne("el-tooltip"),z=ne("el-switch"),X=ne("el-form"),Y=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Ole,_e($.$t("views.applicationWorkflow.nodeSetting")),1),P(Y,{shadow:"never",class:"card-never"},{default:j(()=>[P(X,{onSubmit:D[4]||(D[4]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(I,{label:$.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label"),prop:"stt_model_id",rules:{required:!0,message:$.$t("views.application.form.voiceInput.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",Sle,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.speechToTextNode.stt_model.label")),1),D[5]||(D[5]=ee("span",{class:"color-danger"},"*",-1))])]),P(B,{type:"primary",link:"",onClick:O,disabled:!w.value.stt_model_id,class:"mr-4"},{default:j(()=>[P(k,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(F,{onWheel:v,teleported:!1,onChange:S,modelValue:w.value.stt_model_id,"onUpdate:modelValue":D[0]||(D[0]=W=>w.value.stt_model_id=W),placeholder:$.$t("views.application.form.voiceInput.placeholder"),options:a.value,showFooter:"","model-type":"STT"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(I,{label:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),prop:"audio_list",rules:{message:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label"),trigger:"change",required:!0}},{label:j(()=>[ee("div",Ale,[ee("div",null,[ee("span",null,[ft(_e($.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.label")),1),D[6]||(D[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:$.$t("views.applicationWorkflow.nodes.speechToTextNode.audio.placeholder"),modelValue:w.value.audio_list,"onUpdate:modelValue":D[1]||(D[1]=W=>w.value.audio_list=W)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(I,{label:$.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:D[3]||(D[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Mle,[ee("div",Tle,[ee("span",null,_e($.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(V,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e($.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(k,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(z,{size:"small",modelValue:w.value.is_result,"onUpdate:modelValue":D[2]||(D[2]=W=>w.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(M7,{ref_key:"STTModeParamSettingDialogRef",ref:l,onRefresh:E},null,512)]),_:1},8,["node-model"])}}});class Nle extends ai{constructor(e){super(e,Cle)}}const Ple={type:"speech-to-text-node",model:si,view:Nle},F8=Object.freeze(Object.defineProperty({__proto__:null,default:Ple},Symbol.toStringTag,{value:"Module"})),kle={class:"title-decoration-1 mb-8"},Rle={class:"break-all"},Dle={class:"title-decoration-1 mb-8"},jle={class:"break-all"},Lle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=He(!1),o=[{label:kt("views.applicationWorkflow.nodes.startNode.currentTime"),value:"time"},{label:kt("views.application.form.historyRecord.label"),value:"history_context"},{label:kt("chat.chatId"),value:"chat_id"},{label:kt("chat.chatUserId"),value:"chat_user_id"},{label:kt("chat.chatUserType"),value:"chat_user_type"},{label:kt("views.chatUser.title"),value:"chat_user"}],r=()=>{const s=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[...s,...f]},i=()=>{const s=r();Me.set(e.nodeModel.properties.config,"globalFields",[...o,...s])},a=()=>{const s=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",s)};e.nodeModel.graphModel.eventCenter.on("refreshFieldList",i),e.nodeModel.graphModel.eventCenter.on("chatFieldList",a);const l=()=>{let s=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(s=s.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",s);return}const h=[];f[0].document&&h.push({label:kt("common.fileUpload.document"),value:"document"}),f[0].image&&h.push({label:kt("common.fileUpload.image"),value:"image"}),f[0].audio&&h.push({label:kt("common.fileUpload.audio"),value:"audio"}),f[0].video&&h.push({label:kt("common.fileUpload.video"),value:"video"}),f[0].other&&h.push({label:kt("common.fileUpload.other"),value:"other"}),Me.set(e.nodeModel.properties.config,"fields",[...s,...h])};return e.nodeModel.graphModel.eventCenter.on("refreshFileUploadConfig",l),bo(()=>{a(),i(),l()}),(s,f)=>{const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-tooltip");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>{var w;return[ee("h5",kle,_e(s.$t("views.applicationWorkflow.variable.global")),1),(Ne(!0),mn(Ir,null,No(t.nodeModel.properties.config.globalFields,(O,E)=>(Ne(),mn("div",{key:E,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",Rle,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Ne(),bt(b,{key:0,effect:"dark",content:s.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[P(v,{link:"",onClick:S=>Wn(x_)(`{{global.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[P(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128)),(w=t.nodeModel.properties.config.chatFields)!=null&&w.length?(Ne(),mn(Ir,{key:0},[ee("h5",Dle,_e(s.$t("views.applicationWorkflow.variable.chat")),1),(Ne(!0),mn(Ir,null,No(t.nodeModel.properties.config.chatFields||[],(O,E)=>(Ne(),mn("div",{key:E,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",jle,_e(O.label)+" "+_e("{"+O.value+"}"),1),n.value===!0?(Ne(),bt(b,{key:0,effect:"dark",content:s.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[P(v,{link:"",onClick:S=>Wn(x_)(`{{chat.${O.value}}}`),style:{padding:"0"}},{default:j(()=>[P(h,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],32))),128))],64)):Bn("",!0)]}),_:1},8,["nodeModel"])}}});class Ile extends ai{constructor(e){super(e,Lle)}}const Fle={type:"start-node",model:si,view:Ile},B8=Object.freeze(Object.defineProperty({__proto__:null,default:Fle},Symbol.toStringTag,{value:"Module"})),Ble={class:"title-decoration-1 mb-8"},$le={class:"flex-between w-full"},Ule={class:"flex-between w-full"},Vle={class:"flex align-center"},Wle={class:"mr-4"},Gle=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(),l=He(null),s=He(),f=He(),h=()=>{var C;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(C=s.value)==null?void 0:C.validate()]).catch($=>Promise.reject({node:i.nodeModel,errMessage:$}))},v=C=>C.ctrlKey===!0?(C.preventDefault(),!0):(C.stopPropagation(),!0),b={tts_model_id:"",is_result:!0,content_list:[],model_params_setting:{}},w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:C=>{Me.set(i.nodeModel.properties,"node_data",C)}}),O=e();function E(){var $;const C=r.value==="systemManage"?{model_type:"TTS",workspace_id:($=O.value)==null?void 0:$.workspace_id}:{model_type:"TTS"};oi({type:"model",systemType:r.value}).getSelectModelList(C).then(D=>{l.value=Me.groupBy(D==null?void 0:D.data,"provider")})}const S=()=>{var $;const C=w.value.tts_model_id;if(!C){Oh(kt("views.application.form.voicePlay.requiredMessage"));return}($=a.value)==null||$.open(C,o,w.value.model_params_setting)},M=C=>{w.value.model_params_setting=C};return bo(()=>{E(),Me.set(i.nodeModel,"validate",h)}),(C,$)=>{const D=ne("AppIcon"),k=ne("el-button"),B=ne("ModelSelect"),F=ne("el-form-item"),I=ne("el-tooltip"),V=ne("el-switch"),z=ne("el-form"),X=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Ble,_e(C.$t("views.applicationWorkflow.nodeSetting")),1),P(X,{shadow:"never",class:"card-never"},{default:j(()=>[P(z,{onSubmit:$[4]||($[4]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(F,{label:C.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label"),prop:"tts_model_id",rules:{required:!0,message:C.$t("views.application.form.voicePlay.placeholder"),trigger:"change"}},{label:j(()=>[ee("div",$le,[ee("div",null,[ee("span",null,[ft(_e(C.$t("views.applicationWorkflow.nodes.textToSpeechNode.tts_model.label")),1),$[5]||($[5]=ee("span",{class:"color-danger"},"*",-1))])]),P(k,{type:"primary",link:"",onClick:S,disabled:!w.value.tts_model_id,class:"mr-4"},{default:j(()=>[P(D,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(B,{onWheel:v,teleported:!1,modelValue:w.value.tts_model_id,"onUpdate:modelValue":$[0]||($[0]=Y=>w.value.tts_model_id=Y),placeholder:C.$t("views.application.form.voicePlay.placeholder"),options:l.value,showFooter:"","model-type":"TTS"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(F,{prop:"content_list",label:C.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),rules:{message:C.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),trigger:"blur",required:!0}},{label:j(()=>[ee("div",Ule,[ee("div",null,[ee("span",null,[ft(_e(C.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label")),1),$[6]||($[6]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:C.$t("views.applicationWorkflow.nodes.textToSpeechNode.content.label"),modelValue:w.value.content_list,"onUpdate:modelValue":$[1]||($[1]=Y=>w.value.content_list=Y)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(F,{label:C.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:$[3]||($[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Vle,[ee("div",Wle,[ee("span",null,_e(C.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(I,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(C.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(D,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(V,{size:"small",modelValue:w.value.is_result,"onUpdate:modelValue":$[2]||($[2]=Y=>w.value.is_result=Y)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(Fj,{ref_key:"TTSModeParamSettingDialogRef",ref:a,onRefresh:M},null,512)]),_:1},8,["node-model"])}}});class zle extends ai{constructor(e){super(e,Gle)}}const Hle={type:"text-to-speech-node",model:si,view:zle},$8=Object.freeze(Object.defineProperty({__proto__:null,default:Hle},Symbol.toStringTag,{value:"Module"})),Xle={class:"title-decoration-1 mb-8"},Yle={class:"flex-between w-full"},qle={class:"flex align-center"},Kle={class:"mr-4"},Zle={class:"flex align-center"},Jle={class:"mr-4"},Qle={class:"flex align-center"},eue={class:"mr-4"},tue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(),s=He(),f=()=>{var k;return(k=s.value)==null?void 0:k.validate().catch(B=>Promise.reject({node:i.nodeModel,errMessage:B}))},h=k=>k.ctrlKey===!0?(k.preventDefault(),!0):(k.stopPropagation(),!0),b={model_id:"",system:"",prompt:`{{${kt("views.applicationWorkflow.nodes.startNode.label")}.question}}`,negative_prompt:"",dialogue_number:0,dialogue_type:"NODE",is_result:!0,temperature:null,max_tokens:null},w=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",b),i.nodeModel.properties.node_data),set:k=>{Me.set(i.nodeModel.properties,"node_data",k)}}),O=e();function E(){var B;const k=r.value==="systemManage"?{model_type:"TTV",workspace_id:(B=O.value)==null?void 0:B.workspace_id}:{model_type:"TTV"};oi({type:"model",systemType:r.value}).getSelectModelList(k).then(F=>{a.value=Me.groupBy(F==null?void 0:F.data,"provider")})}const S=()=>{xh(()=>{var k;w.value.model_id?(k=l.value)==null||k.reset_default(w.value.model_id,o):C({})})},M=k=>{var B;k&&((B=l.value)==null||B.open(k,o,w.value.model_params_setting))};function C(k){Me.set(i.nodeModel.properties.node_data,"model_params_setting",k)}function $(k){Me.set(i.nodeModel.properties.node_data,"prompt",k)}function D(k){Me.set(i.nodeModel.properties.node_data,"negative_prompt",k)}return bo(()=>{E(),Me.set(i.nodeModel,"validate",f)}),(k,B)=>{const F=ne("AppIcon"),I=ne("el-button"),V=ne("ModelSelect"),z=ne("el-form-item"),X=ne("el-tooltip"),Y=ne("MdEditorMagnify"),W=ne("el-switch"),Q=ne("el-form"),J=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",Xle,_e(k.$t("views.applicationWorkflow.nodeSetting")),1),P(J,{shadow:"never",class:"card-never"},{default:j(()=>[P(Q,{onSubmit:B[6]||(B[6]=gn(()=>{},["prevent"])),model:w.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(z,{label:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label"),prop:"model_id",rules:{required:!0,message:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",Yle,[ee("div",null,[ee("span",null,[ft(_e(k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.label")),1),B[7]||(B[7]=ee("span",{class:"color-danger"},"*",-1))])]),P(I,{disabled:!w.value.model_id,type:"primary",link:"",onClick:B[0]||(B[0]=ie=>M(w.value.model_id)),onRefreshForm:C},{default:j(()=>[P(F,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(V,{onChange:S,onWheel:h,onFocus:E,teleported:!1,modelValue:w.value.model_id,"onUpdate:modelValue":B[1]||(B[1]=ie=>w.value.model_id=ie),placeholder:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.model.requiredMessage"),options:a.value,showFooter:"","model-type":"TTV"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),prop:"prompt",rules:{required:!0,message:k.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",qle,[ee("div",Kle,[ee("span",null,[ft(_e(k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label")),1),B[8]||(B[8]=ee("span",{class:"color-danger"},"*",-1))])]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:h,title:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.prompt.label"),modelValue:w.value.prompt,"onUpdate:modelValue":B[2]||(B[2]=ie=>w.value.prompt=ie),style:{height:"150px"},onSubmitDialog:$},null,8,["title","modelValue"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),prop:"prompt",rules:{required:!1,message:k.$t("common.prompt.placeholder"),trigger:"blur"}},{label:j(()=>[ee("div",Zle,[ee("div",Jle,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(Y,{onWheel:h,title:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.label"),modelValue:w.value.negative_prompt,"onUpdate:modelValue":B[3]||(B[3]=ie=>w.value.negative_prompt=ie),placeholder:k.$t("views.applicationWorkflow.nodes.textToVideoGenerate.negative_prompt.placeholder"),style:{height:"150px"},onSubmitDialog:D},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(z,{label:k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:B[5]||(B[5]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Qle,[ee("div",eue,[ee("span",null,_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(X,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(k.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(F,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(W,{size:"small",modelValue:w.value.is_result,"onUpdate:modelValue":B[4]||(B[4]=ie=>w.value.is_result=ie)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:l,onRefresh:C},null,512)]),_:1},8,["node-model"])}}});class nue extends ai{constructor(e){super(e,tue)}}const rue={type:"text-to-video-node",model:si,view:nue},U8=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},sue={class:"flex-between"},lue={class:"flex align-center"},uue={class:"mr-4"},cue={key:1,class:"color-danger"},due={class:"flex align-center"},fue={class:"mr-4"},pue=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=ja(),o=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),r=He(),i={input_field_list:[],is_result:!1},a=hr({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)}}),l=He(),s=()=>{var h;return(h=l.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,b=h.data.input_field_list.map(w=>{const O=v.find(E=>E.name==w.name);return O&&O.source==w.source?{...w,value:JSON.parse(JSON.stringify(O.value))}:{...w,value:w.source=="reference"?[]:""}});Me.set(e.nodeModel.properties.node_data,"input_field_list",b),Me.set(e.nodeModel.properties,"status",h.data.is_active?200:500)}).catch(()=>{Me.set(e.nodeModel.properties,"status",500)})};return bo(()=>{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",s)}),(h,v)=>{const b=ne("auto-tooltip"),w=ne("AppIcon"),O=ne("el-tooltip"),E=ne("el-tag"),S=ne("el-input"),M=ne("el-form-item"),C=ne("el-text"),$=ne("el-card"),D=ne("el-switch"),k=ne("el-form");return Ne(),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),P(k,{onSubmit:v[2]||(v[2]=gn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:l,model:a.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[P($,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var B;return[((B=a.value.input_field_list)==null?void 0:B.length)>0?(Ne(),mn("div",aue,[(Ne(!0),mn(Ir,null,No(a.value.input_field_list,(F,I)=>(Ne(),bt(M,{key:F.name,label:F.name,prop:"input_field_list."+I+".value",rules:{required:F.is_required,message:F.source==="reference"?h.$t("views.tool.form.param.selectPlaceholder"):h.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",sue,[ee("div",lue,[ee("div",uue,[P(b,{content:F.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(F.name),1)]),_:2},1032,["content"])]),F.desc?(Ne(),bt(O,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(F.desc),1)]),default:j(()=>[P(w,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):Bn("",!0),F.is_required?(Ne(),mn("span",cue,"*")):Bn("",!0),P(E,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(F.type),1)]),_:2},1024)])])]),default:j(()=>[F.source==="reference"?(Ne(),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:F.value,"onUpdate:modelValue":V=>F.value=V},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Ne(),bt(S,{key:1,modelValue:F.value,"onUpdate:modelValue":V=>F.value=V,placeholder:h.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Ne(),bt(C,{key:1,type:"info"},{default:j(()=>[ft(_e(h.$t("common.noData")),1)]),_:1}))]}),_:1}),P(M,{label:h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:v[1]||(v[1]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",due,[ee("div",fue,[ee("span",null,_e(h.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(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(()=>[P(w,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(D,{size:"small",modelValue:a.value.is_result,"onUpdate:modelValue":v[0]||(v[0]=B=>a.value.is_result=B)},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:si,view:hue},V8=Object.freeze(Object.defineProperty({__proto__:null,default:vue},Symbol.toStringTag,{value:"Module"})),mue={class:"title-decoration-1 mb-16"},gue={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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=E=>E.ctrlKey===!0?(E.preventDefault(),!0):(E.stopPropagation(),!0),o=He(),r=He(),i={code:"",input_field_list:[],is_result:!1},a=He(null),l=He(!1),s=hr({get:()=>(e.nodeModel.properties.node_data||Me.set(e.nodeModel.properties,"node_data",i),e.nodeModel.properties.node_data),set:E=>{Me.set(e.nodeModel.properties,"node_data",E)}}),f=He(),h=()=>{var E;return(E=f.value)==null?void 0:E.validate().catch(S=>Promise.reject({node:e.nodeModel,errMessage:S}))};function v(E){Me.set(e.nodeModel.properties.node_data,"code",E)}function b(E,S){typeof S<"u"&&(a.value=S),o.value.open(E)}function w(E){const S=Me.cloneDeep(e.nodeModel.properties.node_data.input_field_list);S.splice(E,1),Me.set(e.nodeModel.properties.node_data,"input_field_list",S)}function O(E){const S=Me.cloneDeep(e.nodeModel.properties.node_data.input_field_list),M={...E,value:E.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 bo(()=>{var E;typeof((E=e.nodeModel.properties.node_data)==null?void 0:E.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",h),setTimeout(()=>{l.value=!0},100)}),(E,S)=>{const M=ne("AppIcon"),C=ne("el-button"),$=ne("auto-tooltip"),D=ne("el-tooltip"),k=ne("el-tag"),B=ne("el-input"),F=ne("el-form-item"),I=ne("el-text"),V=ne("el-card"),z=ne("CodemirrorEditor"),X=ne("el-switch"),Y=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",mue,_e(E.$t("views.applicationWorkflow.nodeSetting")),1),ee("div",gue,[ee("h5",yue,_e(E.$t("common.param.inputParam")),1),P(C,{link:"",type:"primary",onClick:S[0]||(S[0]=W=>b())},{default:j(()=>[P(M,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(E.$t("common.add")),1)]),_:1})]),P(Y,{onSubmit:S[4]||(S[4]=gn(()=>{},["prevent"])),ref_key:"ToolNodeFormRef",ref:f,model:s.value,"label-position":"top","require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[P(V,{shadow:"never",class:"card-never mb-16",style:{"--el-card-padding":"12px"}},{default:j(()=>{var W;return[((W=s.value.input_field_list)==null?void 0:W.length)>0?(Ne(),mn("div",_ue,[(Ne(!0),mn(Ir,null,No(s.value.input_field_list,(Q,J)=>(Ne(),bt(F,{key:J,label:Q.name,prop:"input_field_list."+J+".value",rules:{required:Q.is_required,message:Q.source==="reference"?E.$t("views.tool.form.param.selectPlaceholder"):E.$t("views.tool.form.param.inputPlaceholder"),trigger:"blur"}},{label:j(()=>[ee("div",bue,[ee("div",wue,[ee("div",Eue,[P($,{content:Q.name,style:{"max-width":"130px"}},{default:j(()=>[ft(_e(Q.name),1)]),_:2},1032,["content"])]),Q.desc?(Ne(),bt(D,{key:0,effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(Q.desc),1)]),default:j(()=>[P(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:2},1024)):Bn("",!0),Q.is_required?(Ne(),mn("span",xue,"*")):Bn("",!0),P(k,{type:"info",class:"info-tag ml-4"},{default:j(()=>[ft(_e(Q.type),1)]),_:2},1024)]),ee("div",null,[P(C,{text:"",onClick:gn(ie=>b(Q,J),["stop"])},{default:j(()=>[P(M,{iconName:"app-edit"})]),_:1},8,["onClick"]),P(C,{text:"",onClick:ie=>w(J),style:{"margin-left":"4px !important"}},{default:j(()=>[P(M,{iconName:"app-delete"})]),_:1},8,["onClick"])])])]),default:j(()=>[Q.source==="reference"?(Ne(),bt(Go,{key:0,ref_for:!0,ref_key:"nodeCascaderRef",ref:r,nodeModel:t.nodeModel,class:"w-full",placeholder:E.$t("views.tool.form.param.selectPlaceholder"),modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,width:100},null,8,["nodeModel","placeholder","modelValue","onUpdate:modelValue"])):(Ne(),bt(B,{key:1,modelValue:Q.value,"onUpdate:modelValue":ie=>Q.value=ie,placeholder:E.$t("views.tool.form.param.inputPlaceholder")},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label","prop","rules"]))),128))])):(Ne(),bt(I,{key:1,type:"info"},{default:j(()=>[ft(_e(E.$t("common.noData")),1)]),_:1}))]}),_:1}),ee("h5",Oue,_e(E.$t("views.tool.form.param.code")),1),l.value?(Ne(),mn("div",Sue,[P(z,{title:E.$t("views.tool.form.param.code"),modelValue:s.value.code,"onUpdate:modelValue":S[1]||(S[1]=W=>s.value.code=W),onWheel:n,style:{height:"130px !important"},onSubmitDialog:v},null,8,["title","modelValue"])])):Bn("",!0),P(F,{label:E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:S[3]||(S[3]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",Aue,[ee("div",Mue,[ee("span",null,_e(E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(D,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(E.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(M,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(X,{size:"small",modelValue:s.value.is_result,"onUpdate:modelValue":S[2]||(S[2]=W=>s.value.is_result=W)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"]),P(s9,{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:si,view:Cue},W8=Object.freeze(Object.defineProperty({__proto__:null,default:Nue},Symbol.toStringTag,{value:"Module"})),Pue={class:"dialog-footer"},kue=_r({__name:"GroupFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),l=He(null),s=He({field:"",label:""}),f=Rh({label:[{required:!0,message:kt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:kt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:kt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}]}),h=He(!1),v=(O,E)=>{O&&(s.value=Me.cloneDeep(O),a.value=!0,l.value=E),h.value=!0},b=()=>{h.value=!1,a.value=!1,l.value=null,s.value={field:"",label:""}},w=async O=>{O&&await O.validate(E=>{E&&o("refresh",s.value,l.value)})};return e({open:v,close:b}),(O,E)=>{const S=ne("el-input"),M=ne("el-form-item"),C=ne("el-form"),$=ne("el-button"),D=ne("el-dialog");return Ne(),bt(D,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableAggregationNode.editGroup"):O.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup"),modelValue:h.value,"onUpdate:modelValue":E[3]||(E[3]=k=>h.value=k),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",Pue,[P($,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),P($,{type:"primary",onClick:E[2]||(E[2]=k=>w(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(()=>[P(C,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:s.value,"require-asterisk-position":"right"},{default:j(()=>[P(M,{label:O.$t("common.variable"),prop:"field"},{default:j(()=>[P(S,{modelValue:s.value.field,"onUpdate:modelValue":E[0]||(E[0]=k=>s.value.field=k),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),P(M,{label:O.$t("dynamicsForm.paramForm.name.label"),prop:"label"},{default:j(()=>[P(S,{modelValue:s.value.label,"onUpdate:modelValue":E[1]||(E[1]=k=>s.value.label=k),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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He(),i={strategy:"first_non_null",group_list:[{id:yu(),label:"Group1",field:"Group1",variable_list:[{v_id:yu(),variable:[]}]}]},a=hr({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)}}),l=He([]);function s(M,C){let $=null;M&&C!==void 0&&($={field:M.field,label:M.label}),r.value.open($,C)}function f(M,C){for(let D=0;D<l.value.length;D++)if(l.value[D].field===M.field&&C!==D){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+M.field);return}[void 0,null].includes(C)?(l.value.push(M),O(M)):(l.value.splice(C,1,M),h(M,C)),r.value.close();const $=[...l.value.map(D=>({label:D.label,value:D.field}))];Me.set(e.nodeModel.properties.config,"fields",$)}const h=(M,C)=>{const $=Me.cloneDeep(a.value.group_list);$[C].field=M.field,$[C].label=M.label,a.value.group_list=$},v=M=>{const C=Me.cloneDeep(a.value.group_list);C.splice(M,1),a.value.group_list=C,l.value.splice(M,1);const $=C.map(D=>({label:D.label,value:D.field}));Me.set(e.nodeModel.properties.config,"fields",$)},b=M=>{const C=Me.cloneDeep(a.value.group_list);C[M].variable_list.push({v_id:yu(),variable:[]}),a.value.group_list=C},w=(M,C)=>{const $=Me.cloneDeep(a.value.group_list);$[M].variable_list.splice(C,1),a.value.group_list=$},O=M=>{const C=Me.cloneDeep(a.value.group_list);C.push({id:yu(),field:M.field,label:M.label,variable_list:[{v_id:yu(),variable:[]}]}),a.value.group_list=C},E=async()=>{var C;const M=[...o.value.map($=>$.validate()),(C=n.value)==null?void 0:C.validate()];return Promise.all(M).catch($=>Promise.reject({node:e.nodeModel,errMessage:$}))};function S(M,C){const{oldIndex:$,newIndex:D}=M;if($===void 0||D===void 0)return;const k=Me.cloneDeep(e.nodeModel.properties.node_data.group_list[C].variable_list),B={...k[$]},F={...k[D]};k[D]=B,k[$]=F,Me.set(e.nodeModel.properties.node_data.group_list[C],"variable_list",k)}return bo(()=>{var C;typeof((C=e.nodeModel.properties.node_data)==null?void 0:C.is_result)>"u"&&Qd(e.nodeModel)&&Me.set(e.nodeModel.properties.node_data,"is_result",!0),Me.set(e.nodeModel,"validate",E),e.nodeModel.properties.node_data.group_list&&(l.value=a.value.group_list.map($=>({label:$.label,field:$.field})));const M=a.value.group_list.map($=>({label:$.label,value:$.field}));Me.set(e.nodeModel.properties.config,"fields",M)}),(M,C)=>{const $=ne("el-option"),D=ne("el-select"),k=ne("el-form-item"),B=ne("EditPen"),F=ne("el-icon"),I=ne("el-button"),V=ne("AppIcon"),z=ne("el-col"),X=ne("el-row"),Y=ne("el-card"),W=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",Rue,_e(M.$t("views.applicationWorkflow.nodeSetting")),1),P(W,{onSubmit:C[2]||(C[2]=gn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableAggregationRef",ref:n,"hide-required-asterisk":""},{default:j(()=>[P(k,{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),C[3]||(C[3]=ee("span",{class:"color-danger"},"*",-1))])])])]),default:j(()=>[P(D,{modelValue:a.value.strategy,"onUpdate:modelValue":C[0]||(C[0]=Q=>a.value.strategy=Q)},{default:j(()=>[P($,{label:Wn(kt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder"),value:"first_non_null"},null,8,["label"]),P($,{label:Wn(kt)("views.applicationWorkflow.nodes.variableAggregationNode.placeholder1"),value:"variable_to_json"},null,8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["label"]),(Ne(!0),mn(Ir,null,No(a.value.group_list,(Q,J)=>(Ne(),mn("div",{key:Q.id,class:"mb-8"},[P(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,[P(I,{onClick:ie=>s(Q,J),link:""},{default:j(()=>[P(F,null,{default:j(()=>[P(B)]),_:1})]),_:1},8,["onClick"]),P(I,{onClick:ie=>v(J),link:"",disabled:a.value.group_list.length<=1},{default:j(()=>[P(V,{iconName:"app-delete"})]),_:1},8,["onClick","disabled"])])]),P(Wn(Xj),{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(()=>[(Ne(!0),mn(Ir,null,No(Q.variable_list,(ie,Se)=>(Ne(),mn("div",{key:ie.v_id,class:"drag-card"},[P(X,{class:"handle"},{default:j(()=>[P(z,{span:22,class:"flex"},{default:j(()=>[C[4]||(C[4]=ee("img",{src:Yj,alt:"",height:"15",class:"mr-4 mt-8"},null,-1)),P(k,{prop:`group_list.${J}.variable_list.${Se}.variable`,rules:{type:"array",required:!0,message:M.$t("views.applicationWorkflow.variable.placeholder"),trigger:"change"}},{default:j(()=>[P(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),P(z,{span:2},{default:j(()=>[P(I,{link:"",class:"mt-4 ml-4",disabled:Q.variable_list.length<=1,onClick:Ae=>w(J,Se)},{default:j(()=>[P(V,{iconName:"app-delete"})]),_:1},8,["disabled","onClick"])]),_:2},1024)]),_:2},1024)]))),128))]),_:2},1032,["modelValue","disabled","onEnd"]),P(I,{onClick:ie=>b(J),type:"primary",size:"large",link:""},{default:j(()=>[P(V,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("common.add")),1)]),_:1},8,["onClick"])]),_:2},1024)]))),128)),P(I,{onClick:C[1]||(C[1]=Q=>s()),type:"primary",size:"large",link:""},{default:j(()=>[P(V,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e(M.$t("views.applicationWorkflow.nodes.variableAggregationNode.addGroup")),1)]),_:1})]),_:1},8,["model"]),P(kue,{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:si,view:Bue},G8=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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("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:""}]};He(1);const a=hr({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)}}),l=He(),s=He(),f=He(),h=async()=>{var E;let O=[(E=l.value)==null?void 0:E.validate(),...s.value.map(S=>S.validate())];return f.value&&(O=[...O,...s.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),E={id:yu(),fields:[],value:null,reference:[],type:"string",source:"custom",name:""};O.push(E),Me.set(n.nodeModel.properties.node_data,"variable_list",O)}function b(O){const E=Me.cloneDeep(n.nodeModel.properties.node_data.variable_list);E.splice(O,1),Me.set(n.nodeModel.properties.node_data,"variable_list",E)}function w(O){(e==Qc.ApplicationLoop?[...n.nodeModel.graphModel.nodes,...n.nodeModel.graphModel.get_parent_nodes()]:n.nodeModel.graphModel.nodes).map(E=>{E.id==="start-node"&&(E.properties.config.globalFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)}),E.properties.config.chatFields.forEach(S=>{S.value===O.fields[1]&&(O.name=S.label)})),E.id==="loop-start-node"&&E.properties.loop_input_field_list.forEach(S=>{S.field===O.fields[1]&&(O.name=S.label)})})}return bo(()=>{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,E)=>{const S=ne("AppIcon"),M=ne("el-button"),C=ne("el-form-item"),$=ne("el-option"),D=ne("el-select"),k=ne("el-input"),B=ne("el-input-number"),F=ne("CodemirrorEditor"),I=ne("el-card"),V=ne("el-form");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[P(V,{onSubmit:E[0]||(E[0]=gn(()=>{},["prevent"])),model:a.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"replyNodeFormRef",ref:l,"hide-required-asterisk":""},{default:j(()=>[(Ne(!0),mn(Ir,null,No(a.value.variable_list,(z,X)=>(Ne(),bt(I,{key:z.id,shadow:"never",class:"card-never mb-8",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(C,null,{label:j(()=>[ee("div",Uue,[ee("div",null,[ft(_e(O.$t("common.variable"))+" ",1),E[1]||(E[1]=ee("span",{class:"color-danger"},"*",-1))]),a.value.variable_list.length>1?(Ne(),bt(M,{key:0,text:"",onClick:Y=>b(X)},{default:j(()=>[P(S,{iconName:"app-delete"})]),_:1},8,["onClick"])):Bn("",!0)])]),default:j(()=>[P(Go,{ref_for:!0,ref_key:"nodeCascaderRef",ref:s,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=>w(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),E[2]||(E[2]=ee("span",{class:"color-danger"},"*",-1))]),P(D,{teleported:!1,modelValue:z.source,"onUpdate:modelValue":Y=>z.source=Y,size:"small",style:{width:"85px"}},{default:j(()=>[P($,{label:O.$t("views.applicationWorkflow.variable.Referencing"),value:"referencing"},null,8,["label"]),P($,{label:O.$t("common.custom"),value:"custom"},null,8,["label"])]),_:1},8,["modelValue","onUpdate:modelValue"])]),z.source==="custom"?(Ne(),mn("div",Gue,[P(D,{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(()=>[(Ne(),mn(Ir,null,No(o,Y=>P($,{key:Y,label:Y,value:Y},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),z.type==="string"?(Ne(),bt(C,{key:0,prop:"variable_list."+X+".value",rules:{message:Wn(kt)("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[P(k,{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"?(Ne(),bt(C,{key:1,prop:"variable_list."+X+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[P(B,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):z.type==="json"?(Ne(),bt(C,{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(()=>[P(F,{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"?(Ne(),bt(C,{key:3,prop:"variable_list."+X+".value",rules:{message:O.$t("common.inputPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[P(D,{modelValue:z.value,"onUpdate:modelValue":Y=>z.value=Y,style:{width:"155px"}},{default:j(()=>[P($,{label:"true",value:!0}),P($,{label:"false",value:!1})]),_:1},8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop","rules"])):Bn("",!0)])):(Ne(),bt(C,{key:1},{default:j(()=>[P(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)),P(M,{link:"",type:"primary",onClick:v},{default:j(()=>[P(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:si,view:Hue},z8=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=_r({__name:"VariableFieldDialog",emits:["refresh"],setup(t,{expose:e,emit:n}){const o=n,r=He(),i=He(!1),a=He(!1),l=He(null),s=He({field:"",label:"",expression:""}),f=Rh({label:[{required:!0,message:kt("dynamicsForm.paramForm.name.placeholder"),trigger:"blur"}],field:[{required:!0,message:kt("views.applicationWorkflow.variable.inputPlaceholder"),trigger:"blur"},{pattern:/^[a-zA-Z0-9_]+$/,message:kt("dynamicsForm.paramForm.field.requiredMessage2"),trigger:"blur"}],expression:[{required:!0,message:kt("views.applicationWorkflow.nodes.variableSplittingNode.expression.placeholder"),trigger:"blur"}]}),h=He(!1),v=(O,E)=>{O&&(s.value=Me.cloneDeep(O),a.value=!0,l.value=E),h.value=!0},b=()=>{h.value=!1,a.value=!1,l.value=null,s.value={field:"",label:""}},w=async O=>{O&&await O.validate(E=>{E&&o("refresh",s.value,l.value)})};return e({open:v,close:b}),(O,E)=>{const S=ne("el-input"),M=ne("el-form-item"),C=ne("AppIcon"),$=ne("el-tooltip"),D=ne("el-form"),k=ne("el-button"),B=ne("el-dialog");return Ne(),bt(B,{title:a.value?O.$t("views.applicationWorkflow.nodes.variableSplittingNode.editVariables"):O.$t("views.applicationWorkflow.nodes.variableSplittingNode.addVariables"),modelValue:h.value,"onUpdate:modelValue":E[4]||(E[4]=F=>h.value=F),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"before-close":b,"append-to-body":""},{footer:j(()=>[ee("span",ece,[P(k,{onClick:gn(b,["prevent"])},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),P(k,{type:"primary",onClick:E[3]||(E[3]=F=>w(r.value)),loading:i.value},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1},8,["loading"])])]),default:j(()=>[P(D,{"label-position":"top",ref_key:"fieldFormRef",ref:r,rules:f,model:s.value,"require-asterisk-position":"right","hide-required-asterisk":""},{default:j(()=>[P(M,{prop:"field"},{label:j(()=>[ee("div",Yue,[ee("span",que,_e(O.$t("common.variable")),1),E[5]||(E[5]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[P(S,{modelValue:s.value.field,"onUpdate:modelValue":E[0]||(E[0]=F=>s.value.field=F),maxlength:64,placeholder:O.$t("views.applicationWorkflow.variable.inputPlaceholder"),"show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1}),P(M,{prop:"label"},{label:j(()=>[ee("div",Kue,[ee("span",Zue,_e(O.$t("dynamicsForm.paramForm.name.label")),1),E[6]||(E[6]=ee("span",{class:"color-danger"},"*",-1))])]),default:j(()=>[P(S,{modelValue:s.value.label,"onUpdate:modelValue":E[1]||(E[1]=F=>s.value.label=F),maxlength:64,"show-word-limit":"",placeholder:O.$t("dynamicsForm.paramForm.name.placeholder")},null,8,["modelValue","placeholder"])]),_:1}),P(M,{prop:"expression"},{label:j(()=>[ee("div",Jue,[ee("span",Que,[ft(_e(O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.label"))+" ",1),E[7]||(E[7]=ee("span",{class:"color-danger"},"*",-1))]),P($,{effect:"dark",content:O.$t("views.applicationWorkflow.nodes.variableSplittingNode.expression.tooltip"),placement:"right"},{default:j(()=>[P(C,{iconName:"app-warning",class:"app-warning-icon"})]),_:1},8,["content"])])]),default:j(()=>[P(S,{modelValue:s.value.expression,"onUpdate:modelValue":E[2]||(E[2]=F=>s.value.expression=F),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"],sce={class:"mr-4"},lce=_r({__name:"VariableFieldTable",props:{nodeModel:{}},setup(t){const e=t,n=He(),o=He(),r=He([]);function i(s,f){o.value.open(s,f)}function a(s){r.value.splice(s,1);const f=[{label:kt("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 l(s,f){for(let v=0;v<r.value.length;v++)if(r.value[v].field===s.field&&f!==v){Xi(kt("views.applicationWorkflow.tip.paramErrorMessage")+s.field);return}[void 0,null].includes(f)?r.value.push(s):r.value.splice(f,1,s),o.value.close();const h=[{label:kt("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 bo(()=>{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 s=[{label:kt("common.result"),value:"result"},...r.value.map(f=>({label:f.label,value:f.field}))];Me.set(e.nodeModel.properties.config,"fields",s)}),(s,f)=>{var E;const h=ne("AppIcon"),v=ne("el-button"),b=ne("el-table-column"),w=ne("el-tooltip"),O=ne("el-table");return Ne(),mn(Ir,null,[ee("div",nce,[ee("h5",rce,[ft(_e(s.$t("views.applicationWorkflow.nodes.variableSplittingNode.splitVariables"))+" ",1),f[1]||(f[1]=ee("span",{class:"color-danger"},"*",-1))]),ee("span",oce,[P(v,{link:"",type:"primary",onClick:f[0]||(f[0]=S=>i())},{default:j(()=>[P(h,{iconName:"app-add-outlined"})]),_:1})])]),((E=e.nodeModel.properties.node_data.variable_list)==null?void 0:E.length)>0?(Ne(),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(()=>[P(b,{prop:"field",label:s.$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"]),P(b,{prop:"label",label:s.$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"]),P(b,{label:s.$t("common.operation"),align:"left",width:"90"},{default:j(({row:S,$index:M})=>[ee("span",sce,[P(w,{effect:"dark",content:s.$t("common.modify"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:gn(C=>i(S,M),["stop"])},{default:j(()=>[P(h,{iconName:"app-edit"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),P(w,{effect:"dark",content:s.$t("common.delete"),placement:"top"},{default:j(()=>[P(v,{type:"primary",text:"",onClick:C=>a(M)},{default:j(()=>[P(h,{iconName:"app-delete"})]),_:1},8,["onClick"])]),_:2},1032,["content"])]),_:1},8,["label"])]),_:1},8,["data"])):Bn("",!0),P(tce,{ref_key:"VariableFieldDialogRef",ref:o,onRefresh:l},null,512)],64)}}}),uce={class:"title-decoration-1 mb-8"},cce={class:"flex-between"},dce=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=t,n={input_variable:[],variable_list:[]},o=hr({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=He(),i=async()=>r.value.validate().catch(a=>Promise.reject({node:e.nodeModel,errMessage:a}));return bo(()=>{Me.set(e.nodeModel,"validate",i)}),(a,l)=>{const s=ne("el-form-item"),f=ne("el-form"),h=ne("el-card");return Ne(),bt(hi,{nodeModel:t.nodeModel},{default:j(()=>[ee("h5",uce,_e(a.$t("views.applicationWorkflow.nodeSetting")),1),P(h,{shadow:"never",class:"card-never",style:{"--el-card-padding":"12px"}},{default:j(()=>[P(f,{onSubmit:l[1]||(l[1]=gn(()=>{},["prevent"])),model:o.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"VariableSplittingRef",ref:r,"hide-required-asterisk":""},{default:j(()=>[P(s,{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),l[2]||(l[2]=ee("span",{class:"color-danger"},"*",-1))])])]),default:j(()=>[P(Go,{ref:"nodeCascaderRef",nodeModel:t.nodeModel,class:"w-full",placeholder:a.$t("views.applicationWorkflow.variable.placeholder"),modelValue:o.value.input_variable,"onUpdate:modelValue":l[0]||(l[0]=v=>o.value.input_variable=v)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["rules"]),P(s,{prop:"variable_list",rules:{message:a.$t("views.applicationWorkflow.nodes.variableSplittingNode.variableListPlaceholder"),trigger:"blur",required:!0}},{default:j(()=>[P(lce,{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:si,view:fce},H8=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"},mce={class:"flex-between"},gce={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=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Qs("getApplicationDetail"),n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=t,a=He(null),l=He(),s=He(),f=He(),h=()=>{var I;return Promise.all([f.value?f.value.validate():Promise.resolve(""),(I=s.value)==null?void 0:I.validate()]).catch(V=>Promise.reject({node:i.nodeModel,errMessage:V}))},v=I=>I.ctrlKey===!0?(I.preventDefault(),!0):(I.stopPropagation(),!0),w={model_id:"",system:"",prompt:`{{${kt("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=hr({get:()=>(i.nodeModel.properties.node_data||Me.set(i.nodeModel.properties,"node_data",w),i.nodeModel.properties.node_data),set:I=>{Me.set(i.nodeModel.properties,"node_data",I)}}),E=e();function S(){var V;const I=r.value==="systemManage"?{model_type:"IMAGE",workspace_id:(V=E.value)==null?void 0:V.workspace_id}:{model_type:"IMAGE"};oi({type:"model",systemType:r.value}).getSelectModelList(I).then(z=>{a.value=Me.groupBy(z==null?void 0:z.data,"provider")})}function M(I){Me.set(i.nodeModel.properties.node_data,"system",I)}function C(I){Me.set(i.nodeModel.properties.node_data,"prompt",I)}const $=I=>{var V;I&&((V=l.value)==null||V.open(I,o,O.value.model_params_setting))},D=He(),k=I=>{var V;I&&((V=D.value)==null||V.open(I,o))},B=I=>{Me.set(i.nodeModel.properties.node_data,"system",I)};function F(I){Me.set(i.nodeModel.properties.node_data,"model_params_setting",I)}return bo(()=>{S(),Me.set(i.nodeModel,"validate",h)}),(I,V)=>{const z=ne("AppIcon"),X=ne("el-button"),Y=ne("ModelSelect"),W=ne("el-form-item"),Q=ne("el-tooltip"),J=ne("MdEditorMagnify"),ie=ne("el-option"),Se=ne("el-select"),Ae=ne("el-input-number"),ke=ne("el-switch"),De=ne("el-form"),ze=ne("el-card");return Ne(),bt(hi,{"node-model":t.nodeModel},{default:j(()=>[ee("h5",hce,_e(I.$t("views.applicationWorkflow.nodeSetting")),1),P(ze,{shadow:"never",class:"card-never"},{default:j(()=>[P(De,{onSubmit:V[10]||(V[10]=gn(()=>{},["prevent"])),model:O.value,"label-position":"top","require-asterisk-position":"right","label-width":"auto",ref_key:"aiChatNodeFormRef",ref:s,"hide-required-asterisk":""},{default:j(()=>[P(W,{label:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.label"),prop:"model_id",rules:{required:!0,message:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),trigger:"change"}},{label:j(()=>[ee("div",vce,[ee("div",null,[ee("span",null,[ft(_e(Wn(kt)("views.applicationWorkflow.nodes.videoUnderstandNode.model.label")),1),V[11]||(V[11]=ee("span",{class:"color-danger"},"*",-1))])]),P(X,{disabled:!O.value.model_id,type:"primary",link:"",onClick:V[0]||(V[0]=Ye=>$(O.value.model_id)),onRefreshForm:F},{default:j(()=>[P(z,{iconName:"app-setting"})]),_:1},8,["disabled"])])]),default:j(()=>[P(Y,{onWheel:v,teleported:!1,modelValue:O.value.model_id,"onUpdate:modelValue":V[1]||(V[1]=Ye=>O.value.model_id=Ye),placeholder:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.model.requiredMessage"),options:a.value,showFooter:"","model-type":"IMAGE"},null,8,["modelValue","placeholder","options"])]),_:1},8,["label","rules"]),P(W,null,{label:j(()=>[ee("div",mce,[ee("div",gce,[ee("span",null,_e(I.$t("views.application.form.roleSettings.label")),1),P(Q,{effect:"dark",content:I.$t("views.application.form.roleSettings.tooltip"),placement:"right"},{default:j(()=>[P(z,{iconName:"app-warning",class:"app-warning-icon ml-4"})]),_:1},8,["content"])]),P(X,{type:"primary",link:"",onClick:V[2]||(V[2]=Ye=>k(O.value.model_id)),disabled:!O.value.model_id},{default:j(()=>[P(z,{iconName:"app-generate-star"})]),_:1},8,["disabled"])])]),default:j(()=>[P(J,{title:I.$t("views.application.form.roleSettings.label"),modelValue:O.value.system,"onUpdate:modelValue":V[3]||(V[3]=Ye=>O.value.system=Ye),style:{height:"100px"},onSubmitDialog:M,placeholder:`${Wn(kt)("views.applicationWorkflow.SystemPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1}),P(W,{label:I.$t("views.application.form.prompt.label"),prop:"prompt",rules:{required:!0,message:I.$t("views.application.form.prompt.requiredMessage"),trigger:"blur"}},{label:j(()=>[ee("div",yce,[ee("div",_ce,[ee("span",null,[ft(_e(I.$t("views.application.form.prompt.label")),1),V[12]||(V[12]=ee("span",{class:"color-danger"},"*",-1))])]),P(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.application.form.prompt.tooltip")),1)]),default:j(()=>[P(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(J,{onWheel:v,title:I.$t("views.application.form.prompt.label"),modelValue:O.value.prompt,"onUpdate:modelValue":V[4]||(V[4]=Ye=>O.value.prompt=Ye),style:{height:"150px"},onSubmitDialog:C,placeholder:`${Wn(kt)("views.applicationWorkflow.UserPromptPlaceholder")}{{${Wn(kt)("views.applicationWorkflow.nodes.startNode.label")}.question}}`},null,8,["title","modelValue","placeholder"])]),_:1},8,["label","rules"]),P(W,null,{label:j(()=>[ee("div",bce,[ee("div",null,_e(I.$t("views.application.form.historyRecord.label")),1),P(Se,{modelValue:O.value.dialogue_type,"onUpdate:modelValue":V[5]||(V[5]=Ye=>O.value.dialogue_type=Ye),type:"small",style:{width:"100px"}},{default:j(()=>[P(ie,{label:I.$t("views.applicationWorkflow.node"),value:"NODE"},null,8,["label"]),P(ie,{label:I.$t("views.applicationWorkflow.workflow"),value:"WORKFLOW"},null,8,["label"])]),_:1},8,["modelValue"])])]),default:j(()=>[P(Ae,{modelValue:O.value.dialogue_number,"onUpdate:modelValue":V[6]||(V[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}),P(W,{label:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label"),rules:{type:"array",required:!0,message:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),trigger:"change"}},{label:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.label")),1),V[13]||(V[13]=ee("span",{class:"color-danger"},"*",-1))]),default:j(()=>[P(Go,{ref_key:"nodeCascaderRef",ref:f,nodeModel:t.nodeModel,class:"w-full",placeholder:I.$t("views.applicationWorkflow.nodes.videoUnderstandNode.image.requiredMessage"),modelValue:O.value.video_list,"onUpdate:modelValue":V[7]||(V[7]=Ye=>O.value.video_list=Ye)},null,8,["nodeModel","placeholder","modelValue"])]),_:1},8,["label","rules"]),P(W,{label:I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label"),onClick:V[9]||(V[9]=gn(()=>{},["prevent"]))},{label:j(()=>[ee("div",wce,[ee("div",Ece,[ee("span",null,_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.label")),1)]),P(Q,{effect:"dark",placement:"right","popper-class":"max-w-200"},{content:j(()=>[ft(_e(I.$t("views.applicationWorkflow.nodes.aiChatNode.returnContent.tooltip")),1)]),default:j(()=>[P(z,{iconName:"app-warning",class:"app-warning-icon"})]),_:1})])]),default:j(()=>[P(ke,{size:"small",modelValue:O.value.is_result,"onUpdate:modelValue":V[8]||(V[8]=Ye=>O.value.is_result=Ye)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),P(dp,{ref_key:"AIModeParamSettingDialogRef",ref:l,onRefresh:F},null,512),P(U2,{onReplace:B,ref_key:"GeneratePromptDialogRef",ref:D},null,512)]),_:1},8,["node-model"])}}});class Oce extends ai{constructor(e){super(e,xce)}}const Sce={type:"video-understand-node",model:si,view:Oce},X8=Object.freeze(Object.defineProperty({__proto__:null,default:Sce},Symbol.toStringTag,{value:"Module"})),BR=_r({__name:"CustomLine",props:{model:{}},setup(t){const e=t,n=()=>{e.model.graphModel.deleteEdgeById(e.model.id)};return(o,r)=>Js((Ne(),mn("div",{class:"custom-edge cursor",onMouseup:r[0]||(r[0]=gn(()=>{},["stop"])),onClick:r[1]||(r[1]=gn(()=>{},["stop"]))},[(Ne(),mn("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)),[[Eh,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 Ud.BezierEdge{constructor(){super();hs(this,"isMounted");hs(this,"customLineApp");hs(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&&(dE()?t8(this.targetId(),BR,n,this.props.model,o,(i,a)=>({model:i,graph:a})):(this.customLineApp=Lj({render:()=>Dg(BR,{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(),dE()&&n8(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:l,path:s,isAnimation:f,arrowConfig:h}=n,v=n.getEdgeAnimationStyle(),{strokeDasharray:b,stroke:w,strokeDashoffset:O,animationName:E,animationDuration:S,animationIterationCount:M,animationTimingFunction:C,animationDirection:$}=v,D={x:(a.x+l.x-r)/2,y:(a.y+l.y-i)/2,width:r,height:i},k=n.getEdgeStyle(),B={width:r,height:i};return setTimeout(()=>{const F=document.getElementById(o);F&&!this.isMounted&&(this.isMounted=!0,this.renderVueComponent(F))},0),delete k.stroke,Ud.h("g",{},[Ud.h("style",{type:"text/css"},".lf-edge{stroke:#afafaf}.lf-edge:hover{stroke: #3370FF;}"),Ud.h("path",{d:s,...k,...h,...f?{strokeDasharray:b,stroke:w,style:{strokeDashoffset:O,animationName:E,animationDuration:S,animationIterationCount:M,animationTimingFunction:C,animationDirection:$}}:{}}),Ud.h("foreignObject",{...D,y:D.y+5,x:D.x+5,style:{}},[Ud.h("div",{id:o,style:{...B},className:"lf-custom-edge-wrapper"})])])}}let Nce=class extends Ud.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 Y8={type:"app-edge",view:Cce,model:Nce};class Pce{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 kce=t=>typeof t=="string",$R=Array.isArray,gE=t=>typeof t=="number",q8=t=>t!==null&&typeof t=="object",yE=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=>yE(n))}if(typeof t=="object"&&Object.keys(t).length){const e=Object.assign({},t);return Object.keys(e).forEach(n=>{e[n]=yE(e[n])}),e}return t},cg=(t,e)=>{const n=t[e];return q8(n)?n.cell:n},UR=(t,e,n)=>{let o;return n?o=n:gE(t)?o=()=>t:o=()=>e,o},Rce=(t,e)=>{if(t!=="next"&&t!=="prev")return e},VR=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 VR(n),n}enqueue(e){const n=this.shortcut;e.prev&&e.next&&VR(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 Mg;(function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""})(Mg||(Mg={}));function WR(t,e){var n=t.get(e)||0;t.set(e,n+1)}function GR(t,e){var n=t.get(e);n!==void 0&&(n=n-1,n>0?t.set(e,n):t.delete(e))}function K8(t,e,n,o){var r=String(e),i=String(n);if(!t&&r>i){var a=r;r=i,i=a}return r+Mg.EDGE_KEY_DELIM+i+Mg.EDGE_KEY_DELIM+(o===void 0?Mg.DEFAULT_EDGE_NAME:o)}function zR(t,e,n,o){var r=String(e),i=String(n),a={v:e,w:n};if(!t&&r>i){var l=a.v;a.v=a.w,a.w=l}return o!==void 0&&(a.name=o),a}function PS(t,e){return K8(t,e.v,e.w,e.name)}function HR(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 lb(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 XR(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 YR(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XR(Object(n),!0).forEach(function(o){Bce(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XR(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},lb=(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=Mg.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 HR(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,l;e.checkCompound();for(var s=i===void 0?e.GRAPH_NODE:i,f=e.parent(s);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,s);var h=e.childrenMap.get(s);return h.set(r,!0),(l=e.childrenMap)===null||l===void 0||l.set(s,h),e},this.children=function(r){var i=r===void 0?e.GRAPH_NODE:r;if(e.isCompound()){var a,l=(a=e.childrenMap)===null||a===void 0?void 0:a.get(i);return l?Array.from(l.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,l=e.compound,s=new t({directed:i,multigraph:a,compound:l});if(s.setGraph(e.graph()),e.nodes().forEach(function(h){r(h)&&s.setNode(h,e.node(h))}),e.edges().forEach(function(h){s.hasNode(h.v)&&s.hasNode(h.w)&&s.setEdgeObj(h,e.edge(h))}),l){var f=function(v){for(var b=e.parent(v);b!==void 0&&!s.hasNode(b);)b=e.parent(b);return b};s.nodes().forEach(function(h){s.setParent(h,f(h))})}return s},this.setDefaultEdgeLabel=function(r){return HR(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,l){return e.setEdge(a,l,i),l}),e},this.edgeFromArgs=function(r,i,a){return e.edge({v:r,w:i,name:a})},this.edge=function(r){return e.edgesLabelsMap.get(PS(e.isDirected(),r))},this.hasEdge=function(r,i,a){return e.edgesLabelsMap.has(PS(e.isDirected(),{v:r,w:i,name:a}))},this.removeEdgeObj=function(r){var i=r.v,a=r.w,l=r.name;return e.removeEdge(i,a,l)},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(l){return!i||l.v===i})},this.outEdges=function(r,i){var a=e.outEdgesMap.get(r);if(a)return Array.from(a.values()).filter(function(l){return!i||l.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=YR(YR({},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,l=this.parentMap,s=this.childrenMap,f=this.inEdgesMap,h=this.outEdgesMap,v=this.predecessorsMap,b=this.successorsMap;if(r.has(n))return o!==void 0&&r.set(n,o),this;if(r.set(n,o||i(n)),a()){var w;l==null||l.set(n,this.GRAPH_NODE),s==null||s.set(n,new Map),s!=null&&s.has(this.GRAPH_NODE)||s==null||s.set(this.GRAPH_NODE,new Map),s==null||(w=s.get(this.GRAPH_NODE))===null||w===void 0||w.set(n,!0)}return[f,h,v,b].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,l=this.predecessorsMap,s=this.successorsMap,f=this.nodesLabelMap;if(this.isCompound()){var h,v,b;this.removeFromParentsChildList(n),(h=this.parentMap)===null||h===void 0||h.delete(n),(v=this.children(n))===null||v===void 0||v.forEach(function(E){return o.setParent(E)}),(b=this.childrenMap)===null||b===void 0||b.delete(n)}var w=i.get(n),O=a.get(n);Array.from(w.values()).forEach(function(E){return r(E)}),Array.from(O.values()).forEach(function(E){return r(E)}),f.delete(n),i.delete(n),a.delete(n),l.delete(n),s.delete(n),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(n,o,r,i){var a,l,s=zR(this.isDirected(),n,o,i),f=PS(this.isDirected(),s),h=s.v,v=s.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(s),this.edgesMap.set(f,s);var b=this.predecessorsMap.get(v),w=this.successorsMap.get(h);return WR(b,h),WR(w,v),(a=this.inEdgesMap.get(v))===null||a===void 0||a.set(f,s),(l=this.outEdgesMap.get(h))===null||l===void 0||l.set(f,s),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(n,o,r){var i=K8(this.isDirected(),n,o,r),a=this.edgesMap.get(i);if(a){var l=zR(this.isDirected(),n,o,r),s=l.v,f=l.w;this.edgesLabelsMap.delete(i),this.edgesMap.delete(i);var h=this.predecessorsMap.get(f),v=this.successorsMap.get(s);GR(h,s),GR(v,f),this.inEdgesMap.get(f).delete(i),this.outEdgesMap.get(s).delete(i),this.edgeCountNum-=1}return this}}]),t})();lb.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(l){return t(e,l,o,r,i,a)}),o&&a.push(n))},$M=function(e,n,o){var r=Array.isArray(n)?n:[n],i=function(f){return e.isDirected()?e.successors(f):e.neighbors(f)},a=[],l=[];return r.forEach(function(s){if(e.hasNode(s))Gce(e,s,o==="post",l,i,a);else throw new Error("Graph does not have node: "+s)}),a},zce=function(e,n){return $M(e,n,"post")},Hce=function(e,n){return $M(e,n,"pre")};const Xce=Object.freeze(Object.defineProperty({__proto__:null,dfs:$M,postorder:zce,preorder:Hce},Symbol.toStringTag,{value:"Module"}));class Yce extends Dce{}class qce extends lb{}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();)kS(t,e,n,a);for(;a=r.dequeue();)kS(t,e,n,a);if(t.nodeCount()){for(let l=e.length-2;l>0;--l)if(a=e[l].dequeue(),a){o=o.concat(kS(t,e,n,a,!0));break}}}return o},kS=(t,e,n,o,r)=>{var i,a;const l=[];return(i=t.inEdges(o.v))===null||i===void 0||i.forEach(s=>{const f=t.edge(s),h=t.node(s.v);r&&l.push({v:s.v,w:s.w,in:0,out:0}),h.out===void 0&&(h.out=0),h.out-=f,b2(e,n,h)}),(a=t.outEdges(o.v))===null||a===void 0||a.forEach(s=>{const f=t.edge(s),h=s.w,v=t.node(h);v.in===void 0&&(v.in=0),v.in-=f,b2(e,n,v)}),t.removeNode(o.v),r?l:void 0},Qce=(t,e)=>{const n=new qce;let o=0,r=0;t.nodes().forEach(s=>{n.setNode(s,{v:s,in:0,out:0})}),t.edges().forEach(s=>{const f=n.edge(s)||0,h=(e==null?void 0:e(s))||1,v=f+h;n.setEdge(s.v,s.w,v),r=Math.max(r,n.node(s.v).out+=h),o=Math.max(o,n.node(s.w).in+=h)});const i=[],a=r+o+3;for(let s=0;s<a;s++)i.push(new Yce);const l=o+1;return n.nodes().forEach(s=>{b2(i,l,n.node(s))}),{buckets:i,zeroIdx:l,graph:n}},b2=(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(l=>{n[l.w]?e.push(l):r(l.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)}})},qR={run:ede,undo:nde};class cp extends lb{}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 cp().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},Z8=t=>{const e=new cp({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),{}),KR=(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,l=Number(t.height)/2;if(!r&&!i)return{x:0,y:0};let s,f;return Math.abs(i)*a>Math.abs(r)*l?(i<0&&(l=-l),s=l*r/i,f=l):(r<0&&(a=-a),s=a,f=a*i/r),{x:n+s,y:o+f}},U_=t=>{const e=[],n=J8(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,l;return rde((a=t.node(r))===null||a===void 0?void 0:a.order,(l=t.node(i))===null||l===void 0?void 0:l.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)})},sde=t=>{const e=t.nodes(),n=e.filter(l=>{var s;return((s=t.node(l))===null||s===void 0?void 0:s.rank)!==void 0}).map(l=>t.node(l).rank),o=Math.min(...n),r=[];e.forEach(l=>{var s;const f=(((s=t.node(l))===null||s===void 0?void 0:s.rank)||0)-o;r[f]||(r[f]=[]),r[f].push(l)});let i=0;const a=t.graph().nodeRankFactor||0;for(let l=0;l<r.length;l++){const s=r[l];s===void 0?l%a!==0&&(i-=1):i&&(s==null||s.forEach(f=>{const h=t.node(f);h&&(h.rank=h.rank||0,h.rank+=i)}))}},ZR=(t,e,n,o)=>{const r={width:0,height:0};return gE(n)&&gE(o)&&(r.rank=n,r.order=o),uy(t,"border",r,e)},J8=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},lde=(t,e)=>{const n={lhs:[],rhs:[]};return t==null||t.forEach(o=>{e(o)?n.lhs.push(o):n.rhs.push(o)}),n},Q8=(t,e)=>{const n=Date.now();try{return e()}finally{console.log(`${t} time: ${Date.now()-n}ms`)}},e4=(t,e)=>e(),UM=(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,l=t.edge(e),s=l.labelRank;if(i===o+1)return;t.removeEdgeObj(e);const f=t.graph();let h,v,b;for(b=0,++o;o<i;++b,++o)l.points=[],v={edgeLabel:l,width:0,height:0,edgeObj:e,rank:o},h=uy(t,"edge",v,"_d"),o===s&&(v.width=l.width,v.height=l.height,v.dummy="edge-label",v.labelpos=l.labelpos),t.setEdge(n,h,{weight:l.weight},a),b===0&&(f.dummyChains||(f.dummyChains=[]),f.dummyChains.push(h)),n=h;t.setEdge(n,r,{weight:l.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)})},JR={run:ude,undo:dde},t4=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 l;return(i=t.outEdges(r))===null||i===void 0||i.forEach(s=>{const f=o(s.w),h=t.edge(s).minlen,v=f-h;v&&(l===void 0||v<l)&&(l=v)}),l||(l=0),a.rank=l,l};(e=t.sources())===null||e===void 0||e.forEach(r=>o(r))},fde=t=>{var e;const n={};let o;const r=l=>{var s;const f=t.node(l);if(!f)return 0;if(n[l])return f.rank;n[l]=!0;let h;return(s=t.outEdges(l))===null||s===void 0||s.forEach(v=>{const b=r(v.w),w=t.edge(v).minlen,O=b-w;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(l=>{t.node(l)&&r(l)}),o===void 0&&(o=0);const i={},a=(l,s)=>{var f;const h=t.node(l),v=isNaN(h.layer)?s:h.layer;(h.rank===void 0||h.rank<v)&&(h.rank=v),!i[l]&&(i[l]=!0,(f=t.outEdges(l))===null||f===void 0||f.map(b=>{a(b.w,v+t.edge(b).minlen)}))};t.nodes().forEach(l=>{const s=t.node(l);s&&(isNaN(s.layer)?s.rank-=o:a(l,s.layer))})},Ch=(t,e)=>t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen,pde=t=>{const e=new cp({directed:!1}),n=t.nodes()[0],o=t.nodeCount();e.setNode(n,{});let r,i;for(;hde(e,t)<o;)r=n4(e,t),i=e.hasNode(r.v)?Ch(t,r):-Ch(t,r),r4(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)&&!Ch(e,r)&&(t.setNode(a,{}),t.setEdge(o,a,{}),n(a))})};return t.nodes().forEach(n),t.nodeCount()},vde=t=>{const e=new cp({directed:!1}),n=t.nodes()[0],o=t.nodes().filter(a=>!!t.node(a)).length;e.setNode(n,{});let r,i;for(;mde(e,t)<o;)r=n4(e,t),i=e.hasNode(r.v)?Ch(t,r):-Ch(t,r),r4(e,t,i);return e},mde=(t,e)=>{const n=o=>{var r;(r=e.nodeEdges(o))===null||r===void 0||r.forEach(i=>{const a=i.v,l=o===a?i.w:a;!t.hasNode(l)&&(e.node(l).layer!==void 0||!Ch(e,i))&&(t.setNode(l,{}),t.setEdge(o,l,{}),n(l))})};return t.nodes().forEach(n),t.nodeCount()},n4=(t,e)=>UM(e.edges(),n=>t.hasNode(n.v)!==t.hasNode(n.w)?Ch(e,n):1/0),r4=(t,e,n)=>{t.nodes().forEach(o=>{e.node(o).rank||(e.node(o).rank=0),e.node(o).rank+=n})},{preorder:gde,postorder:yde}=Xce,_de=t=>{const e=ode(t);t4(e);const n=pde(e);i4(n),o4(n,e);let o,r;for(;o=Ede(n);)r=xde(n,e,o),Ode(n,e,o,r)},o4=(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,l=e.edgeFromArgs(n,i),s=0;return l||(a=!1,l=e.edgeFromArgs(i,n)),s=l.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 b=h===a,w=e.edge(f).weight;if(s+=b?w:-w,Ade(t,n,v)){const O=t.edgeFromArgs(n,v).cutvalue;s+=b?-O:O}}}),s},i4=(t,e=t.nodes()[0])=>{a4(t,{},1,e)},a4=(t,e,n,o,r)=>{var i;const a=n;let l=n;const s=t.node(o);return e[o]=!0,(i=t.neighbors(o))===null||i===void 0||i.forEach(f=>{e[f]||(l=a4(t,e,l,f,o))}),s.low=a,s.lim=l++,r?s.parent=r:delete s.parent,l},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 l=i,s=!1;i.lim>a.lim&&(l=a,s=!0);const f=e.edges().filter(h=>s===QR(t,t.node(h.v),l)&&s!==QR(t,t.node(h.w),l));return UM(f,h=>Ch(e,h))},Ode=(t,e,n,o)=>{const r=n.v,i=n.w;t.removeEdge(r,i),t.setEdge(o.v,o.w,{}),i4(t),o4(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=gde(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),l=!1;a||(a=e.edgeFromArgs(i,r),l=!0),e.node(r).rank=e.node(i).rank+(l?a.minlen:-a.minlen)})},Ade=(t,e,n)=>t.hasEdge(e,n),QR=(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":eD(t);break;case"longest-path":Tde(t);break;default:eD(t)}},Tde=t4,eD=t=>{fde(t),vde(t)},Cde=t=>{_de(t)},Nde=t=>{var e;const n={};let o=0;const r=i=>{var a;const l=o;(a=t.children(i))===null||a===void 0||a.forEach(r),n[i]={low:l,lim:o++}};return(e=t.children())===null||e===void 0||e.forEach(r),n},Pde=(t,e,n,o)=>{const r=[],i=[],a=Math.min(e[n].low,e[o].low),l=Math.max(e[n].lim,e[o].lim);let s,f;s=n;do s=t.parent(s),r.push(s);while(s&&(e[s].low>a||l>e[s].lim));for(f=s,s=o;s&&s!==f;)i.push(s),s=t.parent(s);return{lca:f,path:r.concat(i.reverse())}},kde=t=>{var e;const n=Nde(t);(e=t.graph().dummyChains)===null||e===void 0||e.forEach(o=>{var r,i;let a=o,l=t.node(a);const s=l.edgeObj;if(!s)return;const f=Pde(t,n,s.v,s.w),h=f.path,v=f.lca;let b=0,w=h[b],O=!0;for(;a!==s.w;){if(l=t.node(a),O){for(;w!==v&&((r=t.node(w))===null||r===void 0?void 0:r.maxRank)<l.rank;)b++,w=h[b];w===v&&(O=!1)}if(!O){for(;b<h.length-1&&((i=t.node(h[b+1]))===null||i===void 0?void 0:i.minRank)<=l.rank;)b++;w=h[b]}t.setParent(a,w),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(s=>{t.edge(s).minlen*=a});const l=jde(t)+1;(e=t.children())===null||e===void 0||e.forEach(s=>{s4(t,n,a,l,i,o,s)}),t.graph().nodeRankFactor=a},s4=(t,e,n,o,r,i,a)=>{const l=t.children(a);if(!(l!=null&&l.length)){a!==e&&t.setEdge(e,a,{weight:0,minlen:n});return}const s=ZR(t,"_bt"),f=ZR(t,"_bb"),h=t.node(a);t.setParent(s,a),h.borderTop=s,t.setParent(f,a),h.borderBottom=f,l==null||l.forEach(v=>{s4(t,e,n,o,r,i,v);const b=t.node(v),w=b.borderTop?b.borderTop:v,O=b.borderBottom?b.borderBottom:v,E=b.borderTop?o:2*o,S=w!==O?1:r-i[a]+1;t.setEdge(s,w,{minlen:S,weight:E,nestingEdge:!0}),t.setEdge(O,f,{minlen:S,weight:E,nestingEdge:!0})}),t.parent(a)||t.setEdge(e,s,{weight:0,minlen:r+i[a]})},Dde=t=>{var e;const n={},o=(r,i)=>{const a=t.children(r);a==null||a.forEach(l=>o(l,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)})},tD={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,l=i.maxRank+1;a<l;a+=1)nD(t,"borderLeft","_bl",o,i,a),nD(t,"borderRight","_br",o,i,a)}};(e=t.children())===null||e===void 0||e.forEach(o=>n(o))},nD=(t,e,n,o,r,i)=>{const a={rank:i,borderType:e,width:0,height:0},l=r[e][i-1],s=uy(t,"border",a,n);r[e][i]=s,t.setParent(s,o),l&&t.setEdge(l,s,{weight:1})},Fde=t=>{var e;const n=(e=t.graph().rankdir)===null||e===void 0?void 0:e.toLowerCase();(n==="lr"||n==="rl")&&l4(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),l4(t))},l4=t=>{t.nodes().forEach(e=>{rD(t.node(e))}),t.edges().forEach(e=>{rD(t.edge(e))})},rD=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},oD={adjust:Fde,undo:Bde};function Vde(t){return Array.isArray(t)}function w2(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 iD=(function(t){if(Vde(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])}),aD=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=w2(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 b=t.node(h);isNaN(b.rank)||i[b.rank].push(h),(v=t.successors(h))===null||v===void 0||v.forEach(w=>a(w))},l=n.sort((h,v)=>t.node(h).rank-t.node(v).rank),f=l.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}),l==null||l.forEach(a),i},Wde=(t,e,n)=>{const o=ide(n,n.map((h,v)=>v)),i=e.map(h=>{var v;const b=(v=t.outEdges(h))===null||v===void 0?void 0:v.map(w=>({pos:o[w.w]||0,weight:t.edge(w).weight}));return b==null?void 0:b.sort((w,O)=>w.pos-O.pos)}).flat().filter(h=>h!==void 0);let a=1;for(;a<n.length;)a<<=1;const l=2*a-1;a-=1;const s=Array(l).fill(0,0,l);let f=0;return i==null||i.forEach(h=>{if(h){let v=h.pos+a;s[v]+=h.weight;let b=0;for(;v>0;)v%2&&(b+=s[v+1]),v=v-1>>1,s[v]+=h.weight;f+=h.weight*b}}),f},sD=(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 cp({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>t.node(i));return t.nodes().forEach(i=>{var a;const l=t.node(i),s=t.parent(i);(l.rank===e||l.minRank<=e&&e<=l.maxRank)&&(r.setNode(i),r.setParent(i,s||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),b=v!==void 0?v.weight:0;r.setEdge(h,i,{weight:t.edge(f).weight+b})}),l.hasOwnProperty("minRank")&&r.setNode(i,{borderLeft:l.borderLeft[e],borderRight:l.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),l,s;for(;a;){if(l=t.parent(a),l?(s=o[l],o[l]=a):(s=r,r=a),s&&s!==a){e.setEdge(s,a);return}a=l}})},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),l=t.node(i.v);r.sum+=a.weight*l.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((l,s)=>{i[l.v]={i:s,indegree:0,in:[],out:[],vs:[l.v]};const f=i[l.v];l.barycenter!==void 0&&(f.barycenter=l.barycenter,f.weight=l.weight)}),(n=e.edges())===null||n===void 0||n.forEach(l=>{const s=i[l.v],f=i[l.w];s!==void 0&&f!==void 0&&(f.indegree++,s.out.push(i[l.w]))});const a=(r=(o=Object.values(i)).filter)===null||r===void 0?void 0:r.call(o,l=>!l.indegree);return qde(a)},qde=t=>{var e,n;const o=[],r=s=>f=>{f.merged||(f.barycenter===void 0||s.barycenter===void 0||f.barycenter>=s.barycenter)&&Kde(s,f)},i=s=>f=>{f.in.push(s),--f.indegree===0&&t.push(f)};for(;t!=null&&t.length;){const s=t.pop();o.push(s),(e=s.in.reverse())===null||e===void 0||e.forEach(f=>r(s)(f)),(n=s.out)===null||n===void 0||n.forEach(f=>i(s)(f))}const a=o.filter(s=>!s.merged),l=["vs","i","barycenter","weight"];return a.map(s=>{const f={};return l==null||l.forEach(h=>{s[h]!==void 0&&(f[h]=s[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=lde(t,b=>{const w=b.hasOwnProperty("fixorder")&&!isNaN(b.fixorder);return o?!w&&b.hasOwnProperty("barycenter"):w||b.hasOwnProperty("barycenter")}),i=r.lhs,a=r.rhs.sort((b,w)=>-b.i- -w.i),l=[];let s=0,f=0,h=0;i==null||i.sort(Jde(!!e,!!n)),h=lD(l,a,h),i==null||i.forEach(b=>{var w;h+=(w=b.vs)===null||w===void 0?void 0:w.length,l.push(b.vs),s+=b.barycenter*b.weight,f+=b.weight,h=lD(l,a,h)});const v={vs:l.flat()};return f&&(v.barycenter=s/f,v.weight=f),v},lD=(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},u4=(t,e,n,o,r,i)=>{var a,l,s,f;let h=t.children(e);const v=t.node(e),b=v?v.borderLeft:void 0,w=v?v.borderRight:void 0,O={};b&&(h=h==null?void 0:h.filter(C=>C!==b&&C!==w));const E=Xde(t,h||[]);E==null||E.forEach(C=>{var $;if(!(($=t.children(C.v))===null||$===void 0)&&$.length){const D=u4(t,C.v,n,o,i);O[C.v]=D,D.hasOwnProperty("barycenter")&&efe(C,D)}});const S=Yde(E,n);Qde(S,O),(a=S.filter(C=>C.vs.length>0))===null||a===void 0||a.forEach(C=>{const $=t.node(C.vs[0]);$&&(C.fixorder=$.fixorder,C.order=$.order)});const M=Zde(S,o,r,i);if(b&&(M.vs=[b,M.vs,w].flat(),!((l=t.predecessors(b))===null||l===void 0)&&l.length)){const C=t.node(((s=t.predecessors(b))===null||s===void 0?void 0:s[0])||""),$=t.node(((f=t.predecessors(w))===null||f===void 0?void 0:f[0])||"");M.hasOwnProperty("barycenter")||(M.barycenter=0,M.weight=0),M.barycenter=(M.barycenter*M.weight+C.order+$.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=J8(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=uD(t,o,"inEdges"),a=uD(t,r,"outEdges");let l=aD(t);jS(t,l);let s=Number.POSITIVE_INFINITY,f;for(let h=0,v=0;v<4;++h,++v){cD(h%2?i:a,h%4>=2,!1,e),l=U_(t);const b=sD(t,l);b<s&&(v=0,f=yE(l),s=b)}l=aD(t),jS(t,l);for(let h=0,v=0;v<4;++h,++v){cD(h%2?i:a,h%4>=2,!0,e),l=U_(t);const b=sD(t,l);b<s&&(v=0,f=yE(l),s=b)}jS(t,f)},uD=(t,e,n)=>e.map(o=>Gde(t,o,n)),cD=(t,e,n,o)=>{const r=new cp;t==null||t.forEach(i=>{var a;const l=i.graph().root,s=u4(i,l,r,e,n,o);for(let f=0;f<((a=s.vs)===null||a===void 0?void 0:a.length);f++){const h=i.node(s.vs[f]);h&&(h.order=f)}Hde(i,r,s.vs)})},jS=(t,e)=>{e==null||e.forEach(n=>{n==null||n.forEach((o,r)=>{t.node(o).order=r})})};class nfe extends lb{}const rfe=(t,e)=>{const n={},o=(r,i)=>{let a=0,l=0;const s=r.length,f=i==null?void 0:i[(i==null?void 0:i.length)-1];return i==null||i.forEach((h,v)=>{var b;const w=ife(t,h),O=w?t.node(w).order:s;(w||h===f)&&((b=i.slice(l,v+1))===null||b===void 0||b.forEach(E=>{var S;(S=t.predecessors(E))===null||S===void 0||S.forEach(M=>{var C;const $=t.node(M),D=$.order;(D<a||O<D)&&!($.dummy&&(!((C=t.node(E))===null||C===void 0)&&C.dummy))&&c4(n,M,E)})}),l=v+1,a=O)}),i};return e!=null&&e.length&&e.reduce(o),n},ofe=(t,e)=>{const n={};function o(l,s,f,h,v){var b,w;let O;for(let E=s;E<f;E++)O=l[E],!((b=t.node(O))===null||b===void 0)&&b.dummy&&((w=t.predecessors(O))===null||w===void 0||w.forEach(S=>{const M=t.node(S);M.dummy&&(M.order<h||M.order>v)&&c4(n,S,O)}))}function r(l){return JSON.stringify(l.slice(1))}function i(l,s){const f=r(l);s.get(f)||(o(...l),s.set(f,!0))}const a=(l,s)=>{let f=-1,h,v=0;const b=new Map;return s==null||s.forEach((w,O)=>{var E;if(((E=t.node(w))===null||E===void 0?void 0:E.dummy)==="border"){const S=t.predecessors(w)||[];S.length&&(h=t.node(S[0]).order,i([s,v,O,f,h],b),v=O,f=h)}i([s,v,s.length,h,l.length],b)}),s};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)},c4=(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]},sfe=(t,e,n,o)=>{const r={},i={},a={};return e==null||e.forEach(l=>{l==null||l.forEach((s,f)=>{r[s]=s,i[s]=s,a[s]=f})}),e==null||e.forEach(l=>{let s=-1;l==null||l.forEach(f=>{let h=o(f);if(h.length){h=h.sort((b,w)=>a[b]-a[w]);const v=(h.length-1)/2;for(let b=Math.floor(v),w=Math.ceil(v);b<=w;++b){const O=h[b];i[f]===f&&s<a[O]&&!afe(n,f,O)&&(i[O]=f,i[f]=r[f]=r[O],s=a[O])}}})}),{root:r,align:i}},lfe=(t,e,n,o,r)=>{var i;const a={},l=ufe(t,e,n,r),s=r?"borderLeft":"borderRight",f=(b,w)=>{let O=l.nodes(),E=O.pop();const S={};for(;E;)S[E]?b(E):(S[E]=!0,O.push(E),O=O.concat(w(E))),E=O.pop()},h=b=>{a[b]=(l.inEdges(b)||[]).reduce((w,O)=>Math.max(w,(a[O.v]||0)+l.edge(O)),0)},v=b=>{const w=(l.outEdges(b)||[]).reduce((E,S)=>Math.min(E,(a[S.w]||0)-l.edge(S)),Number.POSITIVE_INFINITY),O=t.node(b);w!==Number.POSITIVE_INFINITY&&O.borderType!==s&&(a[b]=Math.max(a[b],w))};return f(h,l.predecessors.bind(l)),f(v,l.successors.bind(l)),(i=Object.values(o))===null||i===void 0||i.forEach(b=>{a[b]=a[n[b]]}),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(l=>{let s;l==null||l.forEach(f=>{const h=n[f];if(r.setNode(h),s){const v=n[s],b=r.edgeFromArgs(v,h);r.setEdge(v,h,Math.max(a(t,f,s),b||0))}s=f})}),r},cfe=(t,e)=>UM(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 l=n[a],s=hfe(t,a)/2;r=Math.max(l+s,r),i=Math.min(l-s,i)}),r-i});function dfe(t,e){const n=Object.values(e),o=iD(n),r=w2(n);["u","d"].forEach(i=>{["l","r"].forEach(a=>{const l=i+a,s=t[l];let f;if(s===e)return;const h=Object.values(s);f=a==="l"?o-iD(h):r-w2(h),f&&(t[l]={},Object.keys(s).forEach(v=>{t[l][v]=s[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),l=o.node(i);let s=0,f;if(s+=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&&(s+=n?f:-f),f=0,s+=(a.dummy?e:t)/2,s+=(l.dummy?e:t)/2,s+=l.width/2,l.labelpos)switch((l.labelpos||"").toLowerCase()){case"l":f=l.width/2;break;case"r":f=-l.width/2;break}return f&&(s+=n?f:-f),f=0,s},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(l=>t.node(l).height),a=Math.max(...i,0);r==null||r.forEach(l=>{t.node(l).y=o+a/2}),o+=a+n})},mfe=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(l=>{l==="r"&&(r=r.map(v=>Object.values(v).reverse()));const s=(a==="u"?t.predecessors:t.successors).bind(t),f=sfe(t,r,n,s),h=lfe(t,r,f.root,f.align,l==="r");l==="r"&&Object.keys(h).forEach(v=>h[v]=-h[v]),o[a+l]=h})});const i=cfe(t,o);return i&&dfe(o,i),ffe(o,t.graph().align)},gfe=t=>{var e;const n=Z8(t);vfe(n);const o=mfe(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 l;return!(!((l=t.children(a))===null||l===void 0)&&l.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 l=t.node(a);!l||l!=null&&l.dummy||isNaN(l.rank)||(l.fixorder=i[l.rank].length,i[l.rank].push(a))})},_fe=(t,e)=>{const n=e&&e.debugTiming?Q8:e4;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",()=>{qR.run(t)}),e(" nestingGraph.run",()=>{tD.run(t)}),e(" rank",()=>{Mde(Z8(t))}),e(" injectEdgeLabelProxies",()=>{Pfe(t)}),e(" removeEmptyRanks",()=>{sde(t)}),e(" nestingGraph.cleanup",()=>{tD.cleanup(t)}),e(" normalizeRanks",()=>{ade(t)}),e(" assignRankMinMax",()=>{kfe(t)}),e(" removeEdgeLabelProxies",()=>{Rfe(t)}),e(" normalize.run",()=>{JR.run(t)}),e(" parentDummyChains",()=>{kde(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",()=>{oD.adjust(t)}),e(" position",()=>{gfe(t)}),e(" positionSelfEdges",()=>{Ufe(t)}),e(" removeBorderNodes",()=>{Ffe(t)}),e(" normalize.undo",()=>{JR.undo(t)}),e(" fixupEdgeLabelCoords",()=>{Lfe(t)}),e(" undoCoordinateSystem",()=>{oD.undo(t)}),e(" translateGraph",()=>{Dfe(t)}),e(" assignNodeIntersects",()=>{jfe(t)}),e(" reversePoints",()=>{Ife(t)}),e(" acyclic.undo",()=>{qR.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 cp({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),l=FS(a,Sfe);e.setNode(r,l),e.setParent(r,t.parent(r))}),t.edges().forEach(r=>{const i=BS(t.edge(r)),a={};IS==null||IS.forEach(l=>{i[l]!==void 0&&(a[l]=i[l])}),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)})},Pfe=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")}})},kfe=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,l=i.marginy||0,s=f=>{if(!f)return;const h=f.x,v=f.y,b=f.width,w=f.height;!isNaN(h)&&!isNaN(b)&&(e===void 0&&(e=h-b/2),e=Math.min(e,h-b/2),n=Math.max(n,h+b/2)),!isNaN(v)&&!isNaN(w)&&(o===void 0&&(o=v-w/2),o=Math.min(o,v-w/2),r=Math.max(r,v+w/2))};t.nodes().forEach(f=>{s(t.node(f))}),t.edges().forEach(f=>{const h=t.edge(f);h!=null&&h.hasOwnProperty("x")&&s(h)}),e-=a,o-=l,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(b=>{b.x-=e,b.y-=o}),v.hasOwnProperty("x")&&(v.x-=e),v.hasOwnProperty("y")&&(v.y-=o)}),i.width=n-e+a,i.height=r-o+l},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(KR(o,i)),n.points.push(KR(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),l=t.node(i.borderBottom),s=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)-(s==null?void 0:s.x))||10,i.height=Math.abs((l==null?void 0:l.y)-(a==null?void 0:a.y))||10,i.x=((s==null?void 0:s.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 l=t.node(r);l.order=i+o,(a=l.selfEdges)===null||a===void 0||a.forEach(s=>{uy(t,"selfedge",{width:s.label.width,height:s.label.height,rank:l.rank,order:i+ ++o,e:s.e,label:s.label},"_se")}),delete l.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,l=o.height/2;t.setEdgeObj(n.e,n.label),t.removeNode(e),n.label.points=[{x:r+2*a/3,y:i-l},{x:r+5*a/6,y:i-l},{y:i,x:r+a},{x:r+5*a/6,y:i+l},{x:r+2*a/3,y:i+l}],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:Q8,notime:e4}};class Wfe extends Pce{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:l,rankdir:s,combos:f,begin:h,radial:v,comboEdges:b=[],vedges:w=[]}=i;if(!a)return;const O=i.edges||[],E=new cp({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 C={};!((e=i.nodeOrder)===null||e===void 0)&&e.length?(i.nodeOrder.forEach(Y=>{C[Y]=!0,M.push(i.nodeMap[Y])}),a.forEach(Y=>{C[Y.id]||M.push(Y)})):M=a;let $;l?$R(l)?$=()=>l:$=()=>[l,l]:$=Y=>Y.size?$R(Y.size)?Y.size:q8(Y.size)?[Y.size.width||40,Y.size.height||40]:[Y.size,Y.size]:[40,40];const D=UR(i.ranksep,50,i.ranksepFunc),k=UR(i.nodesep,50,i.nodesepFunc);let B=k,F=D;(s==="LR"||s==="RL")&&(B=D,F=k),E.setDefaultEdgeLabel(()=>({})),E.setGraph(i);const I={};this.sortByCombo&&f&&f.forEach(Y=>{if(I[Y.id]=Y,Y.collapsed){const W=$(Y),Q=F(Y),J=B(Y),ie=W[0]+2*J,Se=W[1]+2*Q;E.setNode(Y.id,{width:ie,height:Se})}Y.parentId&&(I[Y.parentId]||E.setNode(Y.parentId,{}),E.setParent(Y.id,Y.parentId))}),M.filter(Y=>Y.layout!==!1).forEach(Y=>{const W=$(Y),Q=F(Y),J=B(Y),ie=W[0]+2*J,Se=W[1]+2*Q,Ae=Y.layer;gE(Ae)?E.setNode(Y.id,{width:ie,height:Se,layer:Ae}):E.setNode(Y.id,{width:ie,height:Se}),this.sortByCombo&&Y.comboId&&(I[Y.comboId]||(I[Y.comboId]={id:Y.comboId},E.setNode(Y.comboId,{})),E.setParent(Y.id,Y.comboId))}),O.forEach(Y=>{const W=cg(Y,"source"),Q=cg(Y,"target");this.layoutNode(W)&&this.layoutNode(Q)&&E.setEdge(W,Q,{weight:Y.weight||1})}),(n=b==null?void 0:b.concat(w||[]))===null||n===void 0||n.forEach(Y=>{var W,Q;const{source:J,target:ie}=Y,Se=!((W=I[J])===null||W===void 0)&&W.collapsed?[J]:S[J]||[J],Ae=!((Q=I[ie])===null||Q===void 0)&&Q.collapsed?[ie]:S[ie]||[ie];Se.forEach(ke=>{Ae.forEach(De=>{E.setEdge(ke,De,{weight:Y.weight||1})})})});let V;!((o=i.preset)===null||o===void 0)&&o.nodes&&(V=new cp({multigraph:!0,compound:!0}),i.preset.nodes.forEach(Y=>{V==null||V.setNode(Y.id,Y)})),Vfe.layout(E,{prevGraph:V,edgeLabelSpace:i.edgeLabelSpace,keepNodeOrder:!!i.nodeOrder,nodeOrder:i.nodeOrder});const z=[0,0];if(h){let Y=1/0,W=1/0;E.nodes().forEach(Q=>{const J=E.node(Q);Y>J.x&&(Y=J.x),W>J.y&&(W=J.y)}),E.edges().forEach(Q=>{var J;(J=E.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=s==="LR"||s==="RL";if(v){const{focusNode:Y,ranksep:W,getRadialPos:Q}=this,J=kce(Y)?Y:Y==null?void 0:Y.id,ie=J?(r=E.node(J))===null||r===void 0?void 0:r._rank:0,Se=[],Ae=X?"y":"x",ke=X?"height":"width";let De=1/0,ze=-1/0;E.nodes().forEach(le=>{const we=E.node(le);if(!i.nodeMap[le])return;const $e=k(i.nodeMap[le]);if(ie===0)Se[we._rank]||(Se[we._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),Se[we._rank].nodes.push(le),Se[we._rank].totalWidth+=$e*2+we[ke],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(le),Se[Lt].totalWidth+=$e*2+we[ke],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[ke],Se[Jt].maxSize<Math.max(we.width,we.height)&&(Se[Jt].maxSize=Math.max(we.width,we.height)),Lt<0?Se[Jt].left.push(le):Se[Jt].right.push(le)}}const rt=we[Ae]-we[ke]/2-$e,pt=we[Ae]+we[ke]/2+$e;rt<De&&(De=rt),pt>ze&&(ze=pt)});let Ye=W||50;const Be={},Je=(ze-De)/.9,gt=[(De+ze-Je)*.5,(De+ze+Je)*.5],se=(le,we,$e=-1/0,rt=[0,1])=>{let pt=$e;return le.forEach(Lt=>{const Jt=E.node(Lt);Be[Lt]=we;const{x:en,y:zt}=Q(Jt[Ae],gt,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=D(i.nodeMap[Lt]);pt<it&&(pt=it)}),pt};let Ze=!0;const pe=0;Se.forEach(le=>{var we,$e,rt,pt,Lt,Jt,en;if(!(!((we=le==null?void 0:le.nodes)===null||we===void 0)&&we.length)&&!(!(($e=le==null?void 0:le.left)===null||$e===void 0)&&$e.length)&&!(!((rt=le==null?void 0:le.right)===null||rt===void 0)&&rt.length))return;if(Ze&&le.nodes.length===1){const it=le.nodes[0];if(!i.nodeMap[it])return;i.nodeMap[it].x=z[0],i.nodeMap[it].y=z[1],Be[le.nodes[0]]=0,Ye=D(i.nodeMap[it]),Ze=!1;return}Ye=Math.max(Ye,le.totalWidth/(2*Math.PI));let zt=-1/0;if(ie===0||!((pt=le.nodes)===null||pt===void 0)&&pt.length)zt=se(le.nodes,Ye,zt,[0,1]);else{const it=((Lt=le.left)===null||Lt===void 0?void 0:Lt.length)/(((Jt=le.left)===null||Jt===void 0?void 0:Jt.length)+((en=le.right)===null||en===void 0?void 0:en.length));zt=se(le.left,Ye,zt,[0,it]),zt=se(le.right,Ye,zt,[it+.05,1])}Ye+=zt,Ze=!1,pe-le.maxSize}),E.edges().forEach(le=>{var we,$e,rt;const pt=E.edge(le),Lt=O.findIndex(Jt=>{const en=cg(Jt,"source"),zt=cg(Jt,"target");return en===le.v&&zt===le.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=E.node(le.v))===null||$e===void 0?void 0:$e[Jt],ae=it-((rt=E.node(le.w))===null||rt===void 0?void 0:rt[Jt]),re=Be[le.v],je=re-Be[le.w];en==null||en.forEach(vt=>{const q=(vt[Jt]-it)/ae*je+re,Pt=Q(vt[Ae],gt,Je,q);zt.push({x:Pt.x+z[0],y:Pt.y+z[1]})}),O[Lt].controlPoints=zt}})}else{const Y=new Set,Q=s==="BT"||s==="RL"?(Ae,ke)=>ke-Ae:(Ae,ke)=>Ae-ke;E.nodes().forEach(Ae=>{const ke=E.node(Ae);if(!ke)return;let De=this.nodeMap[Ae];De||(De=f==null?void 0:f.find(ze=>ze.id===Ae)),De&&(De.x=ke.x+z[0],De.y=ke.y+z[1],De._order=ke._order,Y.add(X?De.x:De.y))});const J=Array.from(Y).sort(Q),ie=X?(Ae,ke)=>Ae.x!==ke.x:(Ae,ke)=>Ae.y!==ke.y,Se=X?(Ae,ke,De)=>{const ze=Math.max(ke.y,De.y),Ye=Math.min(ke.y,De.y);return Ae.filter(Be=>Be.y<=ze&&Be.y>=Ye)}:(Ae,ke,De)=>{const ze=Math.max(ke.x,De.x),Ye=Math.min(ke.x,De.x);return Ae.filter(Be=>Be.x<=ze&&Be.x>=Ye)};E.edges().forEach(Ae=>{var ke;const De=E.edge(Ae),ze=O.findIndex(Ye=>{const Be=cg(Ye,"source"),Je=cg(Ye,"target");return Be===Ae.v&&Je===Ae.w});if(!(ze<=-1)&&i.edgeLabelSpace&&i.controlPoints&&O[ze].type!=="loop"){(ke=De==null?void 0:De.points)===null||ke===void 0||ke.forEach(Je=>{Je.x+=z[0],Je.y+=z[1]});const Ye=i.nodeMap[Ae.v],Be=i.nodeMap[Ae.w];O[ze].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 l=a*2*Math.PI;return{x:Math.cos(l)*r,y:Math.sin(l)*r}}getType(){return"dagre"}}const Gfe=(t,e,n,o,r,i,a)=>{let l=(t==null?void 0:t.slice(1,t.length-1))||[];if(e&&n){let{x:s,y:f}=e,{x:h,y:v}=n;if(r&&(s=e.y,f=e.x,h=n.y,v=n.x),v!==f&&s!==h){const b=o.indexOf(f),w=o[b+1];if(w){const S=l[0],M=r?{x:(f+w)/2,y:(S==null?void 0:S.y)||h}:{x:(S==null?void 0:S.x)||h,y:(f+w)/2};(!S||i(S,M))&&l.unshift(M)}const O=o.indexOf(v),E=Math.abs(O-b);if(E===1)l=a(l,e,n),l.length||l.push(r?{x:(f+v)/2,y:s}:{x:s,y:(f+v)/2});else if(E>1){const S=o[O-1];if(S){const M=l[l.length-1],C=r?{x:(v+S)/2,y:(M==null?void 0:M.y)||h}:{x:(M==null?void 0:M.x)||s,y:(v+S)/2};(!M||i(M,C))&&l.push(C)}}}}return l};var dD,fD,pD,hD;(function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"})(dD||(dD={})),(function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"})(fD||(fD={})),(function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"})(pD||(pD={})),(function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"})(hD||(hD={}));var V0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function VM(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},n1=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=n1(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=n1(e,t);return n<0?void 0:e[n][1]},qfe=function(t){return n1(this.__data__,t)>-1},Kfe=function(t,e){var n=this.__data__,o=n1(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function vg(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])}}vg.prototype.clear=zfe,vg.prototype.delete=Xfe,vg.prototype.get=Yfe,vg.prototype.has=qfe,vg.prototype.set=Kfe;var r1=vg,Zfe=function(){this.__data__=new r1,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)},d4=typeof V0=="object"&&V0&&V0.Object===Object&&V0,tpe=typeof self=="object"&&self&&self.Object===Object&&self,rd=d4||tpe||Function("return this")(),rc=rd.Symbol,f4=Object.prototype,npe=f4.hasOwnProperty,rpe=f4.toString,$y=rc?rc.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)},vD=rc?rc.toStringTag:void 0,Bh=function(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":vD&&vD in Object(t)?ope(t):ape(t)},Xl=function(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")},mD,ub=function(t){if(!Xl(t))return!1;var e=Bh(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},$S=rd["__core-js_shared__"],gD=(mD=/[^.]+$/.exec($S&&$S.keys&&$S.keys.IE_PROTO||""))?"Symbol(src)_1."+mD:"",spe=function(t){return!!gD&&gD in t},lpe=Function.prototype.toString,lm=function(t){if(t!=null){try{return lpe.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!(!Xl(t)||spe(t))&&(ub(t)?hpe:upe).test(lm(t))},mpe=function(t,e){return t==null?void 0:t[e]},um=function(t,e){var n=mpe(t,e);return vpe(n)?n:void 0},V_=um(rd,"Map"),W_=um(Object,"create"),gpe=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 mg(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])}}mg.prototype.clear=gpe,mg.prototype.delete=ype,mg.prototype.get=bpe,mg.prototype.has=Epe,mg.prototype.set=xpe;var yD=mg,Ope=function(){this.size=0,this.__data__={hash:new yD,map:new(V_||r1),string:new yD}},Spe=function(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null},o1=function(t,e){var n=t.__data__;return Spe(e)?n[typeof e=="string"?"string":"hash"]:n.map},Ape=function(t){var e=o1(this,t).delete(t);return this.size-=e?1:0,e},Mpe=function(t){return o1(this,t).get(t)},Tpe=function(t){return o1(this,t).has(t)},Cpe=function(t,e){var n=o1(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function gg(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])}}gg.prototype.clear=Ope,gg.prototype.delete=Ape,gg.prototype.get=Mpe,gg.prototype.has=Tpe,gg.prototype.set=Cpe;var i1=gg,Npe=function(t,e){var n=this.__data__;if(n instanceof r1){var o=n.__data__;if(!V_||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new i1(o)}return n.set(t,e),this.size=n.size,this};function yg(t){var e=this.__data__=new r1(t);this.size=e.size}yg.prototype.clear=Zfe,yg.prototype.delete=Jfe,yg.prototype.get=Qfe,yg.prototype.has=epe,yg.prototype.set=Npe;var Tg=yg,WM=function(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t},_E=(function(){try{var t=um(Object,"defineProperty");return t({},"",{}),t}catch{}})(),a1=function(t,e,n){e=="__proto__"&&_E?_E(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Ppe=Object.prototype.hasOwnProperty,s1=function(t,e,n){var o=t[e];Ppe.call(t,e)&&cy(o,n)&&(n!==void 0||e in t)||a1(t,e,n)},cb=function(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var l=e[i],s=void 0;s===void 0&&(s=t[l]),r?a1(n,l,s):s1(n,l,s)}return n},kpe=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},td=function(t){return t!=null&&typeof t=="object"},_D=function(t){return td(t)&&Bh(t)=="[object Arguments]"},p4=Object.prototype,Rpe=p4.hasOwnProperty,Dpe=p4.propertyIsEnumerable,Yg=_D((function(){return arguments})())?_D:function(t){return td(t)&&Rpe.call(t,"callee")&&!Dpe.call(t,"callee")},Ma=Array.isArray,jpe=function(){return!1},Jv=VM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n?rd.Buffer:void 0,i=(r?r.isBuffer:void 0)||jpe;t.exports=i})),Lpe=/^(?:0|[1-9]\d*)$/,l1=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},GM=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 td(t)&&GM(t.length)&&!!ea[Bh(t)]},u1=function(t){return function(e){return t(e)}},qg=VM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n&&d4.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})),bD=qg&&qg.isTypedArray,db=bD?u1(bD):Ipe,Fpe=Object.prototype.hasOwnProperty,h4=function(t,e){var n=Ma(t),o=!n&&Yg(t),r=!n&&!o&&Jv(t),i=!n&&!o&&!r&&db(t),a=n||o||r||i,l=a?kpe(t.length,String):[],s=l.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")||l1(f,s))||l.push(f);return l},Bpe=Object.prototype,c1=function(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||Bpe)},v4=function(t,e){return function(n){return t(e(n))}},$pe=v4(Object.keys,Object),Upe=Object.prototype.hasOwnProperty,zM=function(t){if(!c1(t))return $pe(t);var e=[];for(var n in Object(t))Upe.call(t,n)&&n!="constructor"&&e.push(n);return e},vp=function(t){return t!=null&&GM(t.length)&&!ub(t)},$h=function(t){return vp(t)?h4(t):zM(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(!Xl(t))return Wpe(t);var e=c1(t),n=[];for(var o in t)(o!="constructor"||!e&&Gpe.call(t,o))&&n.push(o);return n},cm=function(t){return vp(t)?h4(t,!0):zpe(t)},Hpe=function(t,e){return t&&cb(e,cm(e),t)},m4=VM((function(t,e){var n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,r=o&&o.exports===n?rd.Buffer:void 0,i=r?r.allocUnsafe:void 0;t.exports=function(a,l){if(l)return a.slice();var s=a.length,f=i?i(s):new a.constructor(s);return a.copy(f),f}})),g4=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},y4=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},_4=function(){return[]},Xpe=Object.prototype.propertyIsEnumerable,wD=Object.getOwnPropertySymbols,HM=wD?function(t){return t==null?[]:(t=Object(t),y4(wD(t),(function(e){return Xpe.call(t,e)})))}:_4,Ype=function(t,e){return cb(t,HM(t),e)},XM=function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t},d1=v4(Object.getPrototypeOf,Object),b4=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)XM(e,HM(t)),t=d1(t);return e}:_4,qpe=function(t,e){return cb(t,b4(t),e)},w4=function(t,e,n){var o=e(t);return Ma(t)?o:XM(o,n(t))},E2=function(t){return w4(t,$h,HM)},Kpe=function(t){return w4(t,cm,b4)},x2=um(rd,"DataView"),O2=um(rd,"Promise"),Cg=um(rd,"Set"),S2=um(rd,"WeakMap"),Zpe=lm(x2),Jpe=lm(V_),Qpe=lm(O2),ehe=lm(Cg),the=lm(S2),jv=Bh;(x2&&jv(new x2(new ArrayBuffer(1)))!="[object DataView]"||V_&&jv(new V_)!="[object Map]"||O2&&jv(O2.resolve())!="[object Promise]"||Cg&&jv(new Cg)!="[object Set]"||S2&&jv(new S2)!="[object WeakMap]")&&(jv=function(t){var e=Bh(t),n=e=="[object Object]"?t.constructor:void 0,o=n?lm(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},bE=rd.Uint8Array,YM=function(t){var e=new t.constructor(t.byteLength);return new bE(e).set(new bE(t)),e},ohe=function(t,e){var n=e?YM(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},ED=rc?rc.prototype:void 0,xD=ED?ED.valueOf:void 0,she=function(t){return xD?Object(xD.call(t)):{}},E4=function(t,e){var n=e?YM(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)},lhe=function(t,e,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return YM(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 E4(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 she(t)}},OD=Object.create,x4=(function(){function t(){}return function(e){if(!Xl(e))return{};if(OD)return OD(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})(),O4=function(t){return typeof t.constructor!="function"||c1(t)?{}:x4(d1(t))},uhe=function(t){return td(t)&&Qv(t)=="[object Map]"},SD=qg&&qg.isMap,che=SD?u1(SD):uhe,dhe=function(t){return td(t)&&Qv(t)=="[object Set]"},AD=qg&&qg.isSet,fhe=AD?u1(AD):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 S4=function t(e,n,o,r,i,a){var l,s=1&n,f=2&n,h=4&n;if(l!==void 0)return l;if(!Xl(e))return e;var v=Ma(e);if(v){if(l=rhe(e),!s)return g4(e,l)}else{var b=Qv(e),w=b=="[object Function]"||b=="[object GeneratorFunction]";if(Jv(e))return m4(e,s);if(b=="[object Object]"||b=="[object Arguments]"||w&&!i){if(l=f||w?{}:O4(e),!s)return f?qpe(e,Hpe(l,e)):Ype(e,Vpe(l,e))}else{if(!Hi[b])return i?e:{};l=lhe(e,b,s)}}a||(a=new Tg);var O=a.get(e);if(O)return O;a.set(e,l),fhe(e)?e.forEach((function(S){l.add(t(S,n,o,S,e,a))})):che(e)&&e.forEach((function(S,M){l.set(M,t(S,n,o,M,e,a))}));var E=v?void 0:(h?f?Kpe:E2:f?cm:$h)(e);return WM(E||e,(function(S,M){E&&(S=e[M=S]),s1(l,M,t(S,n,o,M,e,a))})),l},phe=function(t){return S4(t,4)},qM=function(t){return function(){return t}},KM=(function(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),l=a.length;l--;){var s=a[++r];if(n(i[s],s,i)===!1)break}return e}})(),ZM=function(t,e){return t&&KM(t,e,$h)},f1=(function(t,e){return function(n,o){if(n==null)return n;if(!vp(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}})(ZM),dm=function(t){return t},A4=function(t){return typeof t=="function"?t:dm},M4=function(t,e){return(Ma(t)?WM:f1)(t,A4(e))},T4=M4,hhe=function(t,e){var n=[];return f1(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},mhe=function(t){return this.__data__.has(t)};function aw(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new i1;++e<n;)this.add(t[e])}aw.prototype.add=aw.prototype.push=vhe,aw.prototype.has=mhe;var C4=aw,ghe=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},N4=function(t,e){return t.has(e)},P4=function(t,e,n,o,r,i){var a=1&n,l=t.length,s=e.length;if(l!=s&&!(a&&s>l))return!1;var f=i.get(t),h=i.get(e);if(f&&h)return f==e&&h==t;var v=-1,b=!0,w=2&n?new C4:void 0;for(i.set(t,e),i.set(e,t);++v<l;){var O=t[v],E=e[v];if(o)var S=a?o(E,O,v,e,t,i):o(O,E,v,t,e,i);if(S!==void 0){if(S)continue;b=!1;break}if(w){if(!ghe(e,(function(M,C){if(!N4(w,C)&&(O===M||r(O,M,n,o,i)))return w.push(C)}))){b=!1;break}}else if(O!==E&&!r(O,E,n,o,i)){b=!1;break}}return i.delete(t),i.delete(e),b},yhe=function(t){var e=-1,n=Array(t.size);return t.forEach((function(o,r){n[++e]=[r,o]})),n},JM=function(t){var e=-1,n=Array(t.size);return t.forEach((function(o){n[++e]=o})),n},MD=rc?rc.prototype:void 0,US=MD?MD.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 bE(t),new bE(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 l=yhe;case"[object Set]":var s=1&o;if(l||(l=JM),t.size!=e.size&&!s)return!1;var f=a.get(t);if(f)return f==e;o|=2,a.set(t,e);var h=P4(l(t),l(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,l=E2(t),s=l.length;if(s!=E2(e).length&&!a)return!1;for(var f=s;f--;){var h=l[f];if(!(a?h in e:bhe.call(e,h)))return!1}var v=i.get(t),b=i.get(e);if(v&&b)return v==e&&b==t;var w=!0;i.set(t,e),i.set(e,t);for(var O=a;++f<s;){var E=t[h=l[f]],S=e[h];if(o)var M=a?o(S,E,h,e,t,i):o(E,S,h,t,e,i);if(!(M===void 0?E===S||r(E,S,n,o,i):M)){w=!1;break}O||(O=h=="constructor")}if(w&&!O){var C=t.constructor,$=e.constructor;C==$||!("constructor"in t)||!("constructor"in e)||typeof C=="function"&&C instanceof C&&typeof $=="function"&&$ instanceof $||(w=!1)}return i.delete(t),i.delete(e),w},TD=Object.prototype.hasOwnProperty,Ehe=function(t,e,n,o,r,i){var a=Ma(t),l=Ma(e),s=a?"[object Array]":Qv(t),f=l?"[object Array]":Qv(e),h=(s=s=="[object Arguments]"?"[object Object]":s)=="[object Object]",v=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",b=s==f;if(b&&Jv(t)){if(!Jv(e))return!1;a=!0,h=!1}if(b&&!h)return i||(i=new Tg),a||db(t)?P4(t,e,n,o,r,i):_he(t,e,s,n,o,r,i);if(!(1&n)){var w=h&&TD.call(t,"__wrapped__"),O=v&&TD.call(e,"__wrapped__");if(w||O){var E=w?t.value():t,S=O?e.value():e;return i||(i=new Tg),r(E,S,n,o,i)}}return!!b&&(i||(i=new Tg),whe(t,e,n,o,r,i))},k4=function t(e,n,o,r,i){return e===n||(e==null||n==null||!td(e)&&!td(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 l=(a=n[r])[0],s=t[l],f=a[1];if(a[2]){if(s===void 0&&!(l in t))return!1}else{var h=new Tg,v;if(!(v===void 0?k4(f,s,3,o,h):v))return!1}}return!0},R4=function(t){return t==t&&!Xl(t)},Ohe=function(t){for(var e=$h(t),n=e.length;n--;){var o=e[n],r=t[o];e[n]=[o,r,R4(r)]}return e},D4=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]?D4(e[0][0],e[0][1]):function(n){return n===t||xhe(n,t,e)}},em=function(t){return typeof t=="symbol"||td(t)&&Bh(t)=="[object Symbol]"},Ahe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mhe=/^\w*$/,QM=function(t,e){if(Ma(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!em(t))||Mhe.test(t)||!Ahe.test(t)||e!=null&&t in Object(e)};function eT(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(eT.Cache||i1),n}eT.Cache=i1;var The=eT,Che=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nhe=/\\(\\)?/g,Phe=(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})),Ng=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},CD=rc?rc.prototype:void 0,ND=CD?CD.toString:void 0,khe=function t(e){if(typeof e=="string")return e;if(Ma(e))return Ng(e,t)+"";if(em(e))return ND?ND.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n},j4=function(t){return t==null?"":khe(t)},p1=function(t,e){return Ma(t)?t:QM(t,e)?[t]:Phe(j4(t))},fb=function(t){if(typeof t=="string"||em(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e},h1=function(t,e){for(var n=0,o=(e=p1(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:h1(t,e);return o===void 0?n:o},Dhe=function(t,e){return t!=null&&e in Object(t)},L4=function(t,e,n){for(var o=-1,r=(e=p1(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)&&GM(r)&&l1(a,r)&&(Ma(t)||Yg(t))},I4=function(t,e){return t!=null&&L4(t,e,Dhe)},jhe=function(t,e){return QM(t)&&R4(e)?D4(fb(t),e):function(n){var o=Rhe(n,t);return o===void 0&&o===e?I4(n,t):k4(e,o,3)}},F4=function(t){return function(e){return e==null?void 0:e[t]}},Lhe=function(t){return function(e){return h1(e,t)}},Ihe=function(t){return QM(t)?F4(fb(t)):Lhe(t)},mp=function(t){return typeof t=="function"?t:t==null?dm:typeof t=="object"?Ma(t)?jhe(t[0],t[1]):She(t):Ihe(t)},B4=function(t,e){return(Ma(t)?y4:hhe)(t,mp(e))},Fhe=Object.prototype.hasOwnProperty,Bhe=function(t,e){return t!=null&&Fhe.call(t,e)},$4=function(t,e){return t!=null&&L4(t,e,Bhe)},$he=Object.prototype.hasOwnProperty,Uhe=function(t){if(t==null)return!0;if(vp(t)&&(Ma(t)||typeof t=="string"||typeof t.splice=="function"||Jv(t)||db(t)||Yg(t)))return!t.length;var e=Qv(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(c1(t))return!zM(t).length;for(var n in t)if($he.call(t,n))return!1;return!0},U4=function(t){return t===void 0},V4=function(t,e){var n=-1,o=vp(t)?Array(t.length):[];return f1(t,(function(r,i,a){o[++n]=e(r,i,a)})),o},W4=function(t,e){return(Ma(t)?Ng:V4)(t,mp(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,l){n=o?(o=!1,i):e(n,i,a,l)})),n},G4=function(t,e,n){var o=Ma(t)?Vhe:Whe,r=arguments.length<3;return o(t,mp(e),n,r,f1)},Ghe=function(t){return typeof t=="string"||!Ma(t)&&td(t)&&Bh(t)=="[object String]"},zhe=F4("length"),Hhe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Xhe=function(t){return Hhe.test(t)},Yhe="[\\ud800-\\udfff]",A2="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",M2="\\ud83c[\\udffb-\\udfff]",z4="[^\\ud800-\\udfff]",H4="(?:\\ud83c[\\udde6-\\uddff]){2}",X4="[\\ud800-\\udbff][\\udc00-\\udfff]",PD="(?:"+A2+"|"+M2+")?",qhe="[\\ufe0e\\ufe0f]?"+PD+("(?:\\u200d(?:"+[z4,H4,X4].join("|")+")[\\ufe0e\\ufe0f]?"+PD+")*"),Khe="(?:"+[z4+A2+"?",A2,H4,X4,Yhe].join("|")+")",kD=RegExp(M2+"(?="+M2+")|"+Khe+qhe,"g"),Zhe=function(t){for(var e=kD.lastIndex=0;kD.test(t);)++e;return e},Jhe=function(t){return Xhe(t)?Zhe(t):zhe(t)},Qhe=function(t){if(t==null)return 0;if(vp(t))return Ghe(t)?Jhe(t):t.length;var e=Qv(t);return e=="[object Map]"||e=="[object Set]"?t.size:zM(t).length},eve=function(t,e,n){var o=Ma(t),r=o||Jv(t)||db(t);if(e=mp(e),n==null){var i=t&&t.constructor;n=r?o?new i:[]:Xl(t)&&ub(i)?x4(d1(t)):{}}return(r?WM:ZM)(t,(function(a,l,s){return e(n,a,l,s)})),n},RD=rc?rc.isConcatSpreadable:void 0,tve=function(t){return Ma(t)||Yg(t)||!!(RD&&t&&t[RD])},tT=function(e,n,o,r,i){var a=-1,l=e.length;for(o||(o=tve),i||(i=[]);++a<l;){var s=e[a];o(s)?XM(i,s):r||(i[i.length]=s)}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)},DD=Math.max,Y4=function(t,e,n){return e=DD(e===void 0?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=DD(o.length-e,0),a=Array(i);++r<i;)a[r]=o[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=o[r];return l[e]=n(a),nve(t,this,l)}},rve=_E?function(t,e){return _E(t,"toString",{configurable:!0,enumerable:!1,value:qM(e),writable:!0})}:dm,ove=Date.now,q4=(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),v1=function(t,e){return q4(Y4(t,e,dm),t+"")},K4=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},sve=function(t,e,n){return e==e?ave(t,e,n):K4(t,ive,n)},lve=function(t,e){return!!(t!=null&&t.length)&&sve(t,e,0)>-1},uve=function(){},cve=Cg&&1/JM(new Cg([,-0]))[1]==1/0?function(t){return new Cg(t)}:uve,dve=function(t,e,n){var o=-1,r=lve,i=t.length,a=!0,l=[],s=l;if(i>=200){var f=cve(t);if(f)return JM(f);a=!1,r=N4,s=new C4}else s=l;e:for(;++o<i;){var h=t[o],v=h;if(h=h!==0?h:0,a&&v==v){for(var b=s.length;b--;)if(s[b]===v)continue e;l.push(h)}else r(s,v,n)||(s!==l&&s.push(v),l.push(h))}return l},Z4=function(t){return td(t)&&vp(t)},fve=v1((function(t){return dve(tT(t,1,Z4,!0))})),pve=function(t,e){return Ng(e,(function(n){return t[n]}))},wE,J4=function(t){return t==null?[]:pve(t,$h(t))};try{wE={clone:phe,constant:qM,each:T4,filter:B4,has:$4,isArray:Ma,isEmpty:Uhe,isFunction:ub,isUndefined:U4,keys:$h,map:W4,reduce:G4,size:Qhe,transform:eve,union:fve,values:J4}}catch{}wE||(wE=window._);var tr=wE,nT=ko;function ko(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 jD(t,e){t[e]?t[e]++:t[e]=1}function LD(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 l={v:r,w:i};return o&&(l.name=o),l}function VS(t,e){return Zy(t,e.v,e.w,e.name)}ko.prototype._nodeCount=0,ko.prototype._edgeCount=0,ko.prototype.isDirected=function(){return this._isDirected},ko.prototype.isMultigraph=function(){return this._isMultigraph},ko.prototype.isCompound=function(){return this._isCompound},ko.prototype.setGraph=function(t){return this._label=t,this},ko.prototype.graph=function(){return this._label},ko.prototype.setDefaultNodeLabel=function(t){return tr.isFunction(t)||(t=tr.constant(t)),this._defaultNodeLabelFn=t,this},ko.prototype.nodeCount=function(){return this._nodeCount},ko.prototype.nodes=function(){return tr.keys(this._nodes)},ko.prototype.sources=function(){var t=this;return tr.filter(this.nodes(),(function(e){return tr.isEmpty(t._in[e])}))},ko.prototype.sinks=function(){var t=this;return tr.filter(this.nodes(),(function(e){return tr.isEmpty(t._out[e])}))},ko.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},ko.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)},ko.prototype.node=function(t){return this._nodes[t]},ko.prototype.hasNode=function(t){return tr.has(this._nodes,t)},ko.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},ko.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},ko.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},ko.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!=="\0")return e}},ko.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[]}},ko.prototype.predecessors=function(t){var e=this._preds[t];if(e)return tr.keys(e)},ko.prototype.successors=function(t){var e=this._sucs[t];if(e)return tr.keys(e)},ko.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return tr.union(e,this.successors(t))},ko.prototype.isLeaf=function(t){return(this.isDirected()?this.successors(t):this.neighbors(t)).length===0},ko.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},ko.prototype.setDefaultEdgeLabel=function(t){return tr.isFunction(t)||(t=tr.constant(t)),this._defaultEdgeLabelFn=t,this},ko.prototype.edgeCount=function(){return this._edgeCount},ko.prototype.edges=function(){return tr.values(this._edgeObjs)},ko.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},ko.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 l=hve(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[a]=l,jD(this._preds[e],t),jD(this._sucs[t],e),this._in[e][a]=l,this._out[t][a]=l,this._edgeCount++,this},ko.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]},ko.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)},ko.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],LD(this._preds[e],t),LD(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--),this},ko.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}},ko.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}},ko.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};var ID={Graph:nT,version:"2.1.8"},vve={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:mve(t),edges:gve(t)};return tr.isUndefined(t.graph())||(e.value=tr.clone(t.graph())),e},read:function(t){var e=new nT(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 mve(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 gve(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},Q4=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 e5=function(t,e,n,o){return(function(r,i,a,l){var s,f,h={},v=new Q4,b=function(w){var O=w.v!==s?w.v:w.w,E=h[O],S=a(w),M=f.distance+S;if(S<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+w+" Weight: "+S);M<E.distance&&(E.distance=M,E.predecessor=s,v.decrease(O,M))};for(r.nodes().forEach((function(w){var O=w===i?0:Number.POSITIVE_INFINITY;h[w]={distance:O},v.add(w,O)}));v.size()>0&&(s=v.removeMin(),(f=h[s]).distance!==Number.POSITIVE_INFINITY);)l(s).forEach(b);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]=e5(t,r,e,n)}),{})},t5=function(t){var e=0,n=[],o={},r=[];function i(a){var l=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&&(l.lowlink=Math.min(l.lowlink,o[h].index)):(i(h),l.lowlink=Math.min(l.lowlink,o[h].lowlink))})),l.lowlink===l.index){var s,f=[];do s=n.pop(),o[s].onStack=!1,f.push(s);while(a!==s);r.push(f)}}return t.nodes().forEach((function(a){tr.has(o,a)||i(a)})),r},wve=function(t){return tr.filter(t5(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={},l=o.nodes();return l.forEach((function(s){a[s]={},a[s][s]={distance:0},l.forEach((function(f){s!==f&&(a[s][f]={distance:Number.POSITIVE_INFINITY})})),i(s).forEach((function(f){var h=f.v===s?f.w:f.v,v=r(f);a[s][h]={distance:v,predecessor:s}}))})),l.forEach((function(s){var f=a[s];l.forEach((function(h){var v=a[h];l.forEach((function(b){var w=v[s],O=f[b],E=v[b],S=w.distance+O.distance;S<E.distance&&(E.distance=S,E.predecessor=O.predecessor)}))}))})),a})(t,e||xve,n||function(o){return t.outEdges(o)})},xve=tr.constant(1),WS=n5;function n5(t){var e={},n={},o=[];if(tr.each(t.sinks(),(function r(i){if(tr.has(n,i))throw new EE;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 EE;return o}function EE(){}n5.CycleException=EE,EE.prototype=new Error;var FD=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);r5(t,a,n==="post",i,o,r)})),r};function r5(t,e,n,o,r,i){tr.has(o,e)||(o[e]=!0,n||i.push(e),tr.each(r(e),(function(a){r5(t,a,n,o,r,i)})),n&&i.push(e))}var xE,Ove={Graph:ID.Graph,json:vve,alg:{components:yve,dijkstra:e5,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 FD(t,e,"post")},preorder:function(t,e){return FD(t,e,"pre")},prim:function(t,e){var n,o=new nT,r={},i=new Q4;function a(s){var f=s.v===n?s.w:s.v,h=i.priority(f);if(h!==void 0){var v=e(s);v<h&&(r[f]=n,i.decrease(f,v))}}if(t.nodeCount()===0)return o;tr.each(t.nodes(),(function(s){i.add(s,Number.POSITIVE_INFINITY),o.setNode(s)})),i.decrease(t.nodes()[0],0);for(var l=!1;i.size()>0;){if(n=i.removeMin(),tr.has(r,n))o.setEdge(n,r[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(a)}return o},tarjan:t5,topsort:WS},version:ID.version};try{xE=Ove}catch{}xE||(xE=window.graphlib);var nf=xE,Sve=function(t){return S4(t,5)},G_=function(t,e,n){if(!Xl(n))return!1;var o=typeof e;return!!(o=="number"?vp(n)&&l1(e,n.length):o=="string"&&e in n)&&cy(n[e],t)},o5=Object.prototype,Ave=o5.hasOwnProperty,Mve=v1((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=cm(i),l=-1,s=a.length;++l<s;){var f=a[l],h=t[f];(h===void 0||cy(h,o5[f])&&!Ave.call(t,f))&&(t[f]=i[f])}return t})),Tve=function(t){return function(e,n,o){var r=Object(e);if(!vp(e)){var i=mp(n);e=$h(e),n=function(l){return i(r[l],l,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,Pve=/^0b[01]+$/i,kve=/^0o[0-7]+$/i,Rve=parseInt,Dve=function(t){if(typeof t=="number")return t;if(em(t))return NaN;if(Xl(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Xl(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Cve,"");var n=Pve.test(t);return n||kve.test(t)?Rve(t.slice(2),n?2:8):Nve.test(t)?NaN:+t},sw=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=sw(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)),K4(t,mp(e),r)})),i5=function(t){return t!=null&&t.length?tT(t):[]},Fve=function(t,e){return t==null?t:KM(t,A4(e),cm)},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=mp(e),ZM(t,(function(o,r,i){a1(n,r,e(o,r,i))})),n},rT=function(t,e,n){for(var o=-1,r=t.length;++o<r;){var i=t[o],a=e(i);if(a!=null&&(l===void 0?a==a&&!em(a):n(a,l)))var l=a,s=i}return s},Uve=function(t,e){return t>e},Vve=function(t){return t&&t.length?rT(t,dm,Uve):void 0},T2=function(t,e,n){(n!==void 0&&!cy(t[e],n)||n===void 0&&!(e in t))&&a1(t,e,n)},Wve=Function.prototype,Gve=Object.prototype,a5=Wve.toString,zve=Gve.hasOwnProperty,Hve=a5.call(Object),Xve=function(t){if(!td(t)||Bh(t)!="[object Object]")return!1;var e=d1(t);if(e===null)return!0;var n=zve.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&a5.call(n)==Hve},BD=function(t,e){if((e!=="constructor"||typeof t[e]!="function")&&e!="__proto__")return t[e]},Yve=function(t){return cb(t,cm(t))},qve=function(t,e,n,o,r,i,a){var l=BD(t,n),s=BD(e,n),f=a.get(s);if(f)T2(t,n,f);else{var h=void 0,v=h===void 0;if(v){var b=Ma(s),w=!b&&Jv(s),O=!b&&!w&&db(s);h=s,b||w||O?Ma(l)?h=l:Z4(l)?h=g4(l):w?(v=!1,h=m4(s,!0)):O?(v=!1,h=E4(s,!0)):h=[]:Xve(s)||Yg(s)?(h=l,Yg(l)?h=Yve(l):Xl(l)&&!ub(l)||(h=O4(s))):v=!1}v&&(a.set(s,h),r(h,s,o,i,a),a.delete(s)),T2(t,n,h)}},Kve=function t(e,n,o,r,i){e!==n&&KM(n,(function(a,l){if(i||(i=new Tg),Xl(a))qve(e,n,l,o,t,r,i);else{var s=void 0;s===void 0&&(s=a),T2(e,l,s)}}),cm)},Zve=(function(t){return v1((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 l=n[o];l&&t(e,l,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?rT(t,dm,s5):void 0},Qve=function(t,e){return t&&t.length?rT(t,mp(e),s5):void 0},eme=function(){return rd.Date.now()},tme=function(t,e,n,o){if(!Xl(t))return t;for(var r=-1,i=(e=p1(e,t)).length,a=i-1,l=t;l!=null&&++r<i;){var s=fb(e[r]),f=n;if(s==="__proto__"||s==="constructor"||s==="prototype")return t;if(r!=a){var h=l[s];(f=void 0)==void 0&&(f=Xl(h)?h:l1(e[r+1])?[]:{})}s1(l,s,f),l=l[s]}return t},nme=function(t,e,n){for(var o=-1,r=e.length,i={};++o<r;){var a=e[o],l=h1(t,a);n(l,a)&&tme(i,p1(a,t),l)}return i},rme=function(t,e){return nme(t,e,(function(n,o){return I4(t,o)}))},ome=(function(t){return q4(Y4(t,void 0,i5),t+"")})((function(t,e){return t==null?{}:rme(t,e)})),ime=Math.ceil,ame=Math.max,sme=function(t,e,n,o){for(var r=-1,i=ame(ime((e-t)/(n||1)),0),a=Array(i);i--;)a[++r]=t,t+=n;return a},lme=(function(t){return function(e,n,o){return o&&typeof o!="number"&&G_(e,n,o)&&(n=o=void 0),e=sw(e),n===void 0?(n=e,e=0):n=sw(n),o=o===void 0?e<n?1:-1:sw(o),sme(e,n,o)}})(),ume=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t},cme=function(t,e){if(t!==e){var n=t!==void 0,o=t===null,r=t==t,i=em(t),a=e!==void 0,l=e===null,s=e==e,f=em(e);if(!l&&!f&&!i&&t>e||i&&a&&s&&!l&&!f||o&&a&&s||!n&&s||!r)return 1;if(!o&&!i&&!f&&t<e||f&&n&&r&&!o&&!i||l&&n&&r||!a&&r||!s)return-1}return 0},dme=function(t,e,n){for(var o=-1,r=t.criteria,i=e.criteria,a=r.length,l=n.length;++o<a;){var s=cme(r[o],i[o]);if(s)return o>=l?s:s*(n[o]=="desc"?-1:1)}return t.index-e.index},fme=function(t,e,n){e=e.length?Ng(e,(function(i){return Ma(i)?function(a){return h1(a,i.length===1?i[0]:i)}:i})):[dm];var o=-1;e=Ng(e,u1(mp));var r=V4(t,(function(i,a,l){return{criteria:Ng(e,(function(s){return s(i)})),index:++o,value:i}}));return ume(r,(function(i,a){return dme(i,a,n)}))},pme=v1((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]]),fme(t,tT(e),[])})),hme=0,vme=function(t){var e=++hme;return j4(t)+e},mme=function(t,e,n){for(var o=-1,r=t.length,i=e.length,a={};++o<r;){var l=o<i?e[o]:void 0;n(a,t[o],l)}return a},OE,gme=function(t,e){return mme(t||[],e||[],s1)};try{OE={cloneDeep:Sve,constant:qM,defaults:Mve,each:T4,filter:B4,find:Ive,flatten:i5,forEach:M4,forIn:Fve,has:$4,isUndefined:U4,last:Bve,map:W4,mapValues:$ve,max:Vve,merge:Zve,min:Jve,minBy:Qve,now:eme,pick:ome,range:lme,reduce:G4,sortBy:pme,uniqueId:vme,values:J4,zipObject:gme}}catch{}OE||(OE=window._);var yme=OE;nf.Graph;yme.constant(1);nf.Graph;nf.Graph;nf.alg.preorder;nf.alg.postorder;nf.Graph;nf.Graph;nf.Graph;nf.Graph;nf.Graph;var GS,$D;function _me(){if($D)return GS;$D=1;var t=9007199254740991;function e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=t}return GS=e,GS}var zS,UD;function bme(){if(UD)return zS;UD=1;var t=F2(),e=_me(),n=B2(),o="[object Arguments]",r="[object Array]",i="[object Boolean]",a="[object Date]",l="[object Error]",s="[object Function]",f="[object Map]",h="[object Number]",v="[object Object]",b="[object RegExp]",w="[object Set]",O="[object String]",E="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",C="[object Float32Array]",$="[object Float64Array]",D="[object Int8Array]",k="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",I="[object Uint8ClampedArray]",V="[object Uint16Array]",z="[object Uint32Array]",X={};X[C]=X[$]=X[D]=X[k]=X[B]=X[F]=X[I]=X[V]=X[z]=!0,X[o]=X[r]=X[S]=X[i]=X[M]=X[a]=X[l]=X[s]=X[f]=X[h]=X[v]=X[b]=X[w]=X[O]=X[E]=!1;function Y(W){return n(W)&&e(W.length)&&!!X[t(W)]}return zS=Y,zS}var HS,VD;function wme(){if(VD)return HS;VD=1;function t(e){return function(n){return e(n)}}return HS=t,HS}var Jy={exports:{}};Jy.exports;var WD;function Eme(){return WD||(WD=1,(function(t,e){var n=m7(),o=e&&!e.nodeType&&e,r=o&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===o,a=i&&n.process,l=(function(){try{var s=r&&r.require&&r.require("util").types;return s||a&&a.binding&&a.binding("util")}catch{}})();t.exports=l})(Jy,Jy.exports)),Jy.exports}var XS,GD;function xme(){if(GD)return XS;GD=1;var t=bme(),e=wme(),n=Eme(),o=n&&n.isTypedArray,r=o?e(o):t;return XS=r,XS}xme();var YS,zD;function Ome(){if(zD)return YS;zD=1;var t=F2(),e=B2(),n="[object Number]";function o(r){return typeof r=="number"||e(r)&&t(r)==n}return YS=o,YS}Ome();var qS={exports:{}},KS={exports:{}},HD;function l5(){return HD||(HD=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:{}},XD;function u5(){return XD||(XD=1,(function(t){function e(n,o,r,i){var a=Object.defineProperty;try{a({},"",{})}catch{a=0}t.exports=e=function(s,f,h,v){function b(w,O){e(s,w,function(E){return this._invoke(w,O,E)})}f?a?a(s,f,{value:h,enumerable:!v,configurable:!v,writable:!v}):s[f]=h:(b("next",0),b("throw",1),b("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 YD;function c5(){return YD||(YD=1,(function(t){var e=u5();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",l=i.toStringTag||"@@toStringTag";function s(S,M,C,$){var D=M&&M.prototype instanceof h?M:h,k=Object.create(D.prototype);return e(k,"_invoke",(function(B,F,I){var V,z,X,Y=0,W=I||[],Q=!1,J={p:0,n:0,v:o,a:ie,f:ie.bind(o,4),d:function(Ae,ke){return V=Ae,z=0,X=o,J.n=ke,f}};function ie(Se,Ae){for(z=Se,X=Ae,r=0;!Q&&Y&&!ke&&r<W.length;r++){var ke,De=W[r],ze=J.p,Ye=De[2];Se>3?(ke=Ye===Ae)&&(X=De[(z=De[4])?5:(z=3,3)],De[4]=De[5]=o):De[0]<=ze&&((ke=Se<2&&ze<De[1])?(z=0,J.v=Ae,J.n=De[1]):ze<Ye&&(ke=Se<3||De[0]>Ae||Ae>Ye)&&(De[4]=Se,De[5]=Ae,J.n=Ye,z=0))}if(ke||Se>1)return f;throw Q=!0,Ae}return function(Se,Ae,ke){if(Y>1)throw TypeError("Generator is already running");for(Q&&Ae===1&&ie(Ae,ke),z=Ae,X=ke;(r=z<2?o:X)||!Q;){V||(z?z<3?(z>1&&(J.n=-1),ie(z,X)):J.n=X:J.v=X);try{if(Y=2,V){if(z||(Se="next"),r=V[Se]){if(!(r=r.call(V,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=V.return)&&r.call(V),z<2&&(X=TypeError("The iterator does not provide a '"+Se+"' method"),z=1);V=o}else if((r=(Q=J.n<0)?X:B.call(F,J))!==f)break}catch(De){V=o,z=1,X=De}finally{Y=1}}return{value:r,done:Q}}})(S,C,$),!0),k}var f={};function h(){}function v(){}function b(){}r=Object.getPrototypeOf;var w=[][a]?r(r([][a]())):(e(r={},a,function(){return this}),r),O=b.prototype=h.prototype=Object.create(w);function E(S){return Object.setPrototypeOf?Object.setPrototypeOf(S,b):(S.__proto__=b,e(S,l,"GeneratorFunction")),S.prototype=Object.create(O),S}return v.prototype=b,e(O,"constructor",b),e(b,"constructor",v),v.displayName="GeneratorFunction",e(b,l,"GeneratorFunction"),e(O),e(O,l,"Generator"),e(O,a,function(){return this}),e(O,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:s,m:E}},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:{}},qD;function d5(){return qD||(qD=1,(function(t){var e=l5(),n=u5();function o(r,i){function a(s,f,h,v){try{var b=r[s](f),w=b.value;return w instanceof e?i.resolve(w.v).then(function(O){a("next",O,h,v)},function(O){a("throw",O,h,v)}):i.resolve(w).then(function(O){b.value=O,h(b)},function(O){return a("throw",O,h,v)})}catch(O){v(O)}}var l;this.next||(n(o.prototype),n(o.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(s,f,h){function v(){return new i(function(b,w){a(s,h,b,w)})}return l=l?l.then(v,v):v()},!0)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(tA)),tA.exports}var KD;function f5(){return KD||(KD=1,(function(t){var e=c5(),n=d5();function o(r,i,a,l,s){return new n(e().w(r,i,a,l),s||Promise)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})(eA)),eA.exports}var ZD;function Sme(){return ZD||(ZD=1,(function(t){var e=f5();function n(o,r,i,a,l){var s=e(o,r,i,a,l);return s.next().then(function(f){return f.done?f.value:s.next()})}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})(QS)),QS.exports}var nA={exports:{}},JD;function Ame(){return JD||(JD=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:{}},QD;function Mme(){return QD||(QD=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 ej;function Tme(){return ej||(ej=1,(function(t){var e=Mme().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 tj;function Cme(){return tj||(tj=1,(function(t){var e=l5(),n=c5(),o=Sme(),r=f5(),i=d5(),a=Ame(),l=Tme();function s(){var f=n(),h=f.m(s),v=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function b(E){var S=typeof E=="function"&&E.constructor;return!!S&&(S===v||(S.displayName||S.name)==="GeneratorFunction")}var w={throw:1,return:2,break:3,continue:3};function O(E){var S,M;return function(C){S||(S={stop:function(){return M(C.a,2)},catch:function(){return C.v},abrupt:function(D,k){return M(C.a,w[D],k)},delegateYield:function(D,k,B){return S.resultName=k,M(C.d,l(D),B)},finish:function(D){return M(C.f,D)}},M=function(D,k,B){C.p=S.prev,C.n=S.next;try{return D(k,B)}finally{S.next=C.n}}),S.resultName&&(S[S.resultName]=C.v,S.resultName=void 0),S.sent=C.v,S.next=C.n;try{return E.call(this,S)}finally{C.p=S.prev,C.n=S.next}}}return(t.exports=s=function(){return{wrap:function(M,C,$,D){return f.w(O(M),C,$,D&&D.reverse())},isGeneratorFunction:b,mark:f.m,awrap:function(M,C){return new e(M,C)},AsyncIterator:i,async:function(M,C,$,D,k){return(b(C)?r:o)(O(M),C,$,D,k)},keys:a,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports})(qS)),qS.exports}var iA,nj;function Nme(){if(nj)return iA;nj=1;var t=Cme()();iA=t;try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}return iA}Nme();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 rj;(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>[]"})(rj||(rj={}));var oj;(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"})(oj||(oj={}));var ij;(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"})(ij||(ij={}));var aj;(function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"})(aj||(aj={}));var lw={exports:{}},Pme=lw.exports,sj;function kme(){return sj||(sj=1,(function(t,e){(function(n,o){t.exports=o()})(Pme,(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,me){for(var Ie=Object.keys(me),wt=0;wt<Ie.length;++wt)K[Ie[wt]]=me[Ie[wt]];return K},r=`
`;function i(K){return typeof atob<"u"?atob(K):"base64:"+K}function a(K){var me=new Error("(regl) "+K);throw console.error(me),me}function l(K,me){K||a(me)}function s(K){return K?": "+K:""}function f(K,me,Ie){K in me||a("unknown parameter ("+K+")"+s(Ie)+". possible values: "+Object.keys(me).join())}function h(K,me){n(K)||a("invalid parameter type"+s(me)+". must be a typed array")}function v(K,me){switch(me){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 b(K,me,Ie){v(K,me)||a("invalid parameter type"+s(Ie)+". expected "+me+", got "+typeof K)}function w(K,me){K>=0&&(K|0)===K||a("invalid parameter type, ("+K+")"+s(me)+". must be a nonnegative integer")}function O(K,me,Ie){me.indexOf(K)<0&&a("invalid value"+s(Ie)+". must be one of: "+me)}var E=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function S(K){Object.keys(K).forEach(function(me){E.indexOf(me)<0&&a('invalid regl constructor argument "'+me+'". must be one of '+E)})}function M(K,me){for(K=K+"";K.length<me;)K=" "+K;return K}function C(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function $(K,me){this.number=K,this.line=me,this.errors=[]}function D(K,me,Ie){this.file=K,this.line=me,this.message=Ie}function k(){var K=new Error,me=(K.stack||K).toString(),Ie=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(me);if(Ie)return Ie[1];var wt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(me);return wt?wt[1]:"unknown"}function B(){var K=new Error,me=(K.stack||K).toString(),Ie=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(me);if(Ie)return Ie[1];var wt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(me);return wt?wt[1]:"unknown"}function F(K,me){var Ie=K.split(`
`),wt=1,Dt=0,yt={unknown:new C,0:new C};yt.unknown.name=yt[0].name=me||k(),yt.unknown.lines.push(new $(0,""));for(var Nt=0;Nt<Ie.length;++Nt){var tn=Ie[Nt],ln=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(tn);if(ln)switch(ln[1]){case"line":var nn=/(\d+)(\s+\d+)?/.exec(ln[2]);nn&&(wt=nn[1]|0,nn[2]&&(Dt=nn[2]|0,Dt in yt||(yt[Dt]=new C)));break;case"define":var Mt=/SHADER_NAME(_B64)?\s+(.*)$/.exec(ln[2]);Mt&&(yt[Dt].name=Mt[1]?i(Mt[2]):Mt[2]);break}yt[Dt].lines.push(new $(wt++,tn))}return Object.keys(yt).forEach(function(wn){var pn=yt[wn];pn.lines.forEach(function(rn){pn.index[rn.number]=rn})}),yt}function I(K){var me=[];return K.split(`
`).forEach(function(Ie){if(!(Ie.length<5)){var wt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(Ie);wt?me.push(new D(wt[1]|0,wt[2]|0,wt[3].trim())):Ie.length>0&&me.push(new D("unknown",0,Ie))}}),me}function V(K,me){me.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,me,Ie,wt,Dt){if(!K.getShaderParameter(me,K.COMPILE_STATUS)){var yt=K.getShaderInfoLog(me),Nt=wt===K.FRAGMENT_SHADER?"fragment":"vertex";Se(Ie,"string",Nt+" shader source must be a string",Dt);var tn=F(Ie,Dt),ln=I(yt);V(tn,ln),Object.keys(tn).forEach(function(nn){var Mt=tn[nn];if(!Mt.hasErrors)return;var wn=[""],pn=[""];function rn(Wt,lt){wn.push(Wt),pn.push(lt||"")}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 lt=0;Wt.errors.forEach(function(St){var sn=St.message,An=/^\s*'(.*)'\s*:\s*(.*)$/.exec(sn);if(An){var Xt=An[1];switch(sn=An[2],Xt){case"assign":Xt="=";break}lt=Math.max(Wt.line.indexOf(Xt,lt),0)}else lt=0;rn(M("| ",6)),rn(M("^^^",lt+3)+r,"font-weight:bold"),rn(M("| ",6)),rn(sn+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?(pn[0]=wn.join("%c"),console.log.apply(console,pn)):console.log(wn.join(""))}),l.raise("Error compiling "+Nt+" shader, "+tn[0].name)}}function X(K,me,Ie,wt,Dt){if(!K.getProgramParameter(me,K.LINK_STATUS)){var yt=K.getProgramInfoLog(me),Nt=F(Ie,Dt),tn=F(wt,Dt),ln='Error linking program with vertex shader, "'+tn[0].name+'", and fragment shader "'+Nt[0].name+'"';typeof document<"u"?console.log("%c"+ln+r+"%c"+yt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(ln+r+yt),l.raise(ln)}}function Y(K){K._commandRef=k()}function W(K,me,Ie,wt){Y(K);function Dt(ln){return ln?wt.id(ln):0}K._fragId=Dt(K.static.frag),K._vertId=Dt(K.static.vert);function yt(ln,nn){Object.keys(nn).forEach(function(Mt){ln[wt.id(Mt)]=!0})}var Nt=K._uniformSet={};yt(Nt,me.static),yt(Nt,me.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,me){var Ie=B();a(K+" in command "+(me||k())+(Ie==="unknown"?"":" called from "+Ie))}function J(K,me,Ie){K||Q(me,Ie||k())}function ie(K,me,Ie,wt){K in me||Q("unknown parameter ("+K+")"+s(Ie)+". possible values: "+Object.keys(me).join(),wt||k())}function Se(K,me,Ie,wt){v(K,me)||Q("invalid parameter type"+s(Ie)+". expected "+me+", got "+typeof K,wt||k())}function Ae(K){K()}function ke(K,me,Ie){K.texture?O(K.texture._texture.internalformat,me,"unsupported texture format for attachment"):O(K.renderbuffer._renderbuffer.format,Ie,"unsupported renderbuffer format for attachment")}var De=33071,ze=9728,Ye=9984,Be=9985,Je=9986,gt=9987,se=5120,Ze=5121,pe=5122,le=5123,we=5124,$e=5125,rt=5126,pt=32819,Lt=32820,Jt=33635,en=34042,zt=36193,it={};it[se]=it[Ze]=1,it[pe]=it[le]=it[zt]=it[Jt]=it[pt]=it[Lt]=2,it[we]=it[$e]=it[rt]=it[en]=4;function ae(K,me){return K===Lt||K===pt||K===Jt?2:K===en?4:it[K]*me}function re(K){return!(K&K-1)&&!!K}function je(K,me,Ie){var wt,Dt=me.width,yt=me.height,Nt=me.channels;l(Dt>0&&Dt<=Ie.maxTextureSize&&yt>0&&yt<=Ie.maxTextureSize,"invalid texture shape"),(K.wrapS!==De||K.wrapT!==De)&&l(re(Dt)&&re(yt),"incompatible wrap mode for texture, both width and height must be power of 2"),me.mipmask===1?Dt!==1&&yt!==1&&l(K.minFilter!==Ye&&K.minFilter!==Je&&K.minFilter!==Be&&K.minFilter!==gt,"min filter requires mipmap"):(l(re(Dt)&&re(yt),"texture must be a square power of 2 to support mipmapping"),l(me.mipmask===(Dt<<1)-1,"missing or incomplete mipmap data")),me.type===rt&&(Ie.extensions.indexOf("oes_texture_float_linear")<0&&l(K.minFilter===ze&&K.magFilter===ze,"filter not supported, must enable oes_texture_float_linear"),l(!K.genMipmaps,"mipmap generation not supported with float textures"));var tn=me.images;for(wt=0;wt<16;++wt)if(tn[wt]){var ln=Dt>>wt,nn=yt>>wt;l(me.mipmask&1<<wt,"missing mipmap data");var Mt=tn[wt];if(l(Mt.width===ln&&Mt.height===nn,"invalid shape for mip images"),l(Mt.format===me.format&&Mt.internalformat===me.internalformat&&Mt.type===me.type,"incompatible type for mip image"),!Mt.compressed)if(Mt.data){var wn=Math.ceil(ae(Mt.type,Nt)*ln/Mt.unpackAlignment)*Mt.unpackAlignment;l(Mt.data.byteLength===wn*nn,"invalid data for image, buffer size is inconsistent with image format")}else Mt.element||Mt.copy}else K.genMipmaps||l((me.mipmask&1<<wt)===0,"extra mipmap data");me.compressed&&l(!K.genMipmaps,"mipmap generation for compressed images not supported")}function vt(K,me,Ie,wt){var Dt=K.width,yt=K.height,Nt=K.channels;l(Dt>0&&Dt<=wt.maxTextureSize&&yt>0&&yt<=wt.maxTextureSize,"invalid texture shape"),l(Dt===yt,"cube map must be square"),l(me.wrapS===De&&me.wrapT===De,"wrap mode not supported by cube map");for(var tn=0;tn<Ie.length;++tn){var ln=Ie[tn];l(ln.width===Dt&&ln.height===yt,"inconsistent cube map face shape"),me.genMipmaps&&(l(!ln.compressed,"can not generate mipmap for compressed textures"),l(ln.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var nn=ln.images,Mt=0;Mt<16;++Mt){var wn=nn[Mt];if(wn){var pn=Dt>>Mt,rn=yt>>Mt;l(ln.mipmask&1<<Mt,"missing mipmap data"),l(wn.width===pn&&wn.height===rn,"invalid shape for mip images"),l(wn.format===K.format&&wn.internalformat===K.internalformat&&wn.type===K.type,"incompatible type for mip image"),wn.compressed||(wn.data?l(wn.data.byteLength===pn*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(l,{optional:Ae,raise:a,commandRaise:Q,command:J,parameter:f,commandParameter:ie,constructor:S,type:b,commandType:Se,isTypedArray:h,nni:w,oneOf:O,shaderError:z,linkError:X,callSite:B,saveCommandRef:Y,saveDrawInfo:W,framebufferFormat:ke,guessCommand:k,texture2D:je,textureCube:vt}),Pt=0,Rt=0,Gt=5,kn=6;function qt(K,me){this.id=Pt++,this.type=K,this.data=me}function On(K){return K.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Pe(K){if(K.length===0)return[];var me=K.charAt(0),Ie=K.charAt(K.length-1);if(K.length>1&&me===Ie&&(me==='"'||me==="'"))return['"'+On(K.substr(1,K.length-2))+'"'];var wt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(K);if(wt)return Pe(K.substr(0,wt.index)).concat(Pe(wt[1])).concat(Pe(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(Pe(Dt[Nt]));return yt}function Ke(K){return"["+Pe(K).join("][")+"]"}function Le(K,me){return new qt(K,Ke(me+""))}function dt(K){return typeof K=="function"&&!K._reglType||K instanceof qt}function At(K,me){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(kn,K.map((Ie,wt)=>At(Ie,me+"["+wt+"]")));if(K instanceof qt)return K;q(!1,"invalid option type in uniform "+me)}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},me=[""];return{id:function(Ie){var wt=K[Ie];return wt||(wt=K[Ie]=me.length,me.push(Ie),wt)},str:function(Ie){return me[Ie]}}}function Lo(K,me,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,ln=window.innerHeight;if(K!==document.body){var nn=K.getBoundingClientRect();tn=nn.right-nn.left,ln=nn.bottom-nn.top}wt.width=Ie*tn,wt.height=Ie*ln,o(wt.style,{width:tn+"px",height:ln+"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 yo(K,me){function Ie(wt){try{return K.getContext(wt,me)}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 me=K||{},Ie,wt,Dt,yt,Nt={},tn=[],ln=[],nn=typeof window>"u"?1:window.devicePixelRatio,Mt=!1,wn=function(Wt){Wt&&q.raise(Wt)},pn=function(){};if(typeof me=="string"?(q(typeof document<"u","selector queries only supported in DOM enviroments"),Ie=document.querySelector(me),q(Ie,"invalid query string for element")):typeof me=="object"?ho(me)?Ie=me:Nn(me)?(yt=me,Dt=yt.canvas):(q.constructor(me),"gl"in me?yt=me.gl:"canvas"in me?Dt=rr(me.canvas):"container"in me&&(wt=rr(me.container)),"attributes"in me&&(Nt=me.attributes,q.type(Nt,"object","invalid context attributes")),"extensions"in me&&(tn=qn(me.extensions)),"optionalExtensions"in me&&(ln=qn(me.optionalExtensions)),"onDone"in me&&(q.type(me.onDone,"function","invalid or missing onDone callback"),wn=me.onDone),"profile"in me&&(Mt=!!me.profile),"pixelRatio"in me&&(nn=+me.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,pn=rn.onDestroy}Nt.premultipliedAlpha===void 0&&(Nt.premultipliedAlpha=!0),yt=yo(Dt,Nt)}return yt?{gl:yt,canvas:Dt,container:wt,extensions:tn,optionalExtensions:ln,pixelRatio:nn,profile:Mt,onDone:wn,onDestroy:pn}:(pn(),wn("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function vn(K,me){var Ie={};function wt(Nt){q.type(Nt,"string","extension name must be string");var tn=Nt.toLowerCase(),ln;try{ln=Ie[tn]=K.getExtension(tn)}catch{}return!!ln}for(var Dt=0;Dt<me.extensions.length;++Dt){var yt=me.extensions[Dt];if(!wt(yt))return me.onDestroy(),me.onDone('"'+yt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return me.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 In(K,me){for(var Ie=Array(K),wt=0;wt<K;++wt)Ie[wt]=me(wt);return Ie}var lr=5120,wo=5121,oo=5122,ta=5123,Ca=5124,Yi=5125,fa=5126;function Ka(K){for(var me=16;me<=1<<28;me*=16)if(K<=me)return me;return 0}function Sn(K){var me,Ie;return me=(K>65535)<<4,K>>>=me,Ie=(K>255)<<3,K>>>=Ie,me|=Ie,Ie=(K>15)<<2,K>>>=Ie,me|=Ie,Ie=(K>3)<<1,K>>>=Ie,me|=Ie,me|K>>1}function Tl(){var K=In(8,function(){return[]});function me(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 lr:tn=new Int8Array(me(Nt),0,Nt);break;case wo:tn=new Uint8Array(me(Nt),0,Nt);break;case oo:tn=new Int16Array(me(2*Nt),0,Nt);break;case ta:tn=new Uint16Array(me(2*Nt),0,Nt);break;case Ca:tn=new Int32Array(me(4*Nt),0,Nt);break;case Yi:tn=new Uint32Array(me(4*Nt),0,Nt);break;case fa:tn=new Float32Array(me(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:me,free:Ie,allocType:wt,freeType:Dt}}var Oo=Tl();Oo.zero=Tl();var el=3408,Ui=3410,gr=3411,ms=3412,pa=3413,qi=3414,Na=3415,as=33901,gs=33902,Cl=3379,ys=3386,tl=34921,ve=36347,mt=36348,cn=35661,Kn=35660,br=34930,lo=36349,li=34076,ye=34024,ht=7936,fn=7937,Rn=7938,Cn=35724,nr=34047,Mn=36063,or=34852,sr=3553,qr=34067,na=34069,vi=33984,_s=6408,Vi=5126,Nl=5121,Is=36160,Ro=36053,La=36064,od=16384,_u=function(K,me){var Ie=1;me.ext_texture_filter_anisotropic&&(Ie=K.getParameter(nr));var wt=1,Dt=1;me.webgl_draw_buffers&&(wt=K.getParameter(or),Dt=K.getParameter(Mn));var yt=!!me.oes_texture_float;if(yt){var Nt=K.createTexture();K.bindTexture(sr,Nt),K.texImage2D(sr,0,_s,1,1,0,_s,Vi,null);var tn=K.createFramebuffer();if(K.bindFramebuffer(Is,tn),K.framebufferTexture2D(Is,La,sr,Nt,0),K.bindTexture(sr,null),K.checkFramebufferStatus(Is)!==Ro)yt=!1;else{K.viewport(0,0,1,1),K.clearColor(1,0,0,1),K.clear(od);var ln=Oo.allocType(Vi,4);K.readPixels(0,0,1,1,_s,Vi,ln),K.getError()?yt=!1:(K.deleteFramebuffer(tn),K.deleteTexture(Nt),yt=ln[0]===1),Oo.freeType(ln)}}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(),pn=Oo.allocType(Nl,36);K.activeTexture(vi),K.bindTexture(qr,wn),K.texImage2D(na,0,_s,3,3,0,_s,Nl,pn),Oo.freeType(pn),K.bindTexture(qr,null),K.deleteTexture(wn),Mt=!K.getError()}return{colorBits:[K.getParameter(Ui),K.getParameter(gr),K.getParameter(ms),K.getParameter(pa)],depthBits:K.getParameter(qi),stencilBits:K.getParameter(Na),subpixelBits:K.getParameter(el),extensions:Object.keys(me).filter(function(rn){return!!me[rn]}),maxAnisotropic:Ie,maxDrawbuffers:wt,maxColorAttachments:Dt,pointSizeDims:K.getParameter(as),lineWidthDims:K.getParameter(gs),maxViewportDims:K.getParameter(ys),maxCombinedTextureUnits:K.getParameter(cn),maxCubeMapSize:K.getParameter(li),maxRenderbufferSize:K.getParameter(ye),maxTextureUnits:K.getParameter(br),maxTextureSize:K.getParameter(Cl),maxAttributes:K.getParameter(tl),maxVertexUniforms:K.getParameter(ve),maxVertexTextureUnits:K.getParameter(Kn),maxVaryingVectors:K.getParameter(mt),maxFragmentUniforms:K.getParameter(lo),glsl:K.getParameter(Cn),renderer:K.getParameter(fn),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(me){return K[me]})},bs={shape:Ba,flatten:yp};function qo(K,me,Ie){for(var wt=0;wt<me;++wt)Ie[wt]=K[wt]}function Uh(K,me,Ie,wt){for(var Dt=0,yt=0;yt<me;++yt)for(var Nt=K[yt],tn=0;tn<Ie;++tn)wt[Dt++]=Nt[tn]}function Fa(K,me,Ie,wt,Dt,yt){for(var Nt=yt,tn=0;tn<me;++tn)for(var ln=K[tn],nn=0;nn<Ie;++nn)for(var Mt=ln[nn],wn=0;wn<wt;++wn)Dt[Nt++]=Mt[wn]}function gp(K,me,Ie,wt,Dt){for(var yt=1,Nt=Ie+1;Nt<me.length;++Nt)yt*=me[Nt];var tn=me[Ie];if(me.length-Ie===4){var ln=me[Ie+1],nn=me[Ie+2],Mt=me[Ie+3];for(Nt=0;Nt<tn;++Nt)Fa(K[Nt],ln,nn,Mt,wt,Dt),Dt+=yt}else for(Nt=0;Nt<tn;++Nt)gp(K[Nt],me,Ie+1,wt,Dt),Dt+=yt}function yp(K,me,Ie,wt){var Dt=1;if(me.length)for(var yt=0;yt<me.length;++yt)Dt*=me[yt];else Dt=0;var Nt=wt||Oo.allocType(Ie,Dt);switch(me.length){case 0:break;case 1:qo(K,me[0],Nt);break;case 2:Uh(K,me[0],me[1],Nt);break;case 3:Fa(K,me[0],me[1],me[2],Nt,0);break;default:gp(K,me,0,Nt,0)}return Nt}function Ba(K){for(var me=[],Ie=K;Ie.length;Ie=Ie[0])me.push(Ie.length);return me}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,id=5121,_p=5123,of=5125,ad=5126,nl=5126,$a={int8:rf,int16:Mo,int32:oa,uint8:id,uint16:_p,uint32:of,float:ad,float32:nl},bu=35048,Ja=35040,ws={dynamic:bu,stream:Ja,static:35044},vo=bs.flatten,Ua=bs.shape,Fs=35044,ha=35040,wu=5121,Kl=5126,Bs=[];Bs[5120]=1,Bs[5122]=2,Bs[5124]=4,Bs[5121]=1,Bs[5123]=2,Bs[5125]=4,Bs[5126]=4;function ui(K){return Za[Object.prototype.toString.call(K)]|0}function ic(K,me){for(var Ie=0;Ie<me.length;++Ie)K[Ie]=me[Ie]}function rl(K,me,Ie,wt,Dt,yt,Nt){for(var tn=0,ln=0;ln<Ie;++ln)for(var nn=0;nn<wt;++nn)K[tn++]=me[Dt*ln+yt*nn+Nt]}function Es(K,me,Ie,wt){var Dt=0,yt={};function Nt(lt){this.id=Dt++,this.buffer=K.createBuffer(),this.type=lt,this.usage=Fs,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(){pn(this)};var tn=[];function ln(lt,St){var sn=tn.pop();return sn||(sn=new Nt(lt)),sn.bind(),wn(sn,St,ha,0,1,!1),sn}function nn(lt){tn.push(lt)}function Mt(lt,St,sn){lt.byteLength=St.byteLength,K.bufferData(lt.type,St,sn)}function wn(lt,St,sn,An,Xt,Pn){var Kt;if(lt.usage=sn,Array.isArray(St)){if(lt.dtype=An||Kl,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];lt.dimension=Yt,_n=vo(St,Kt,lt.dtype),Mt(lt,_n,sn),Pn?lt.persistentData=_n:Oo.freeType(_n)}else if(typeof St[0]=="number"){lt.dimension=Xt;var ar=Oo.allocType(lt.dtype,St.length);ic(ar,St),Mt(lt,ar,sn),Pn?lt.persistentData=ar:Oo.freeType(ar)}else n(St[0])?(lt.dimension=St[0].length,lt.dtype=An||ui(St[0])||Kl,_n=vo(St,[St.length,St[0].length],lt.dtype),Mt(lt,_n,sn),Pn?lt.persistentData=_n:Oo.freeType(_n)):q.raise("invalid buffer data")}}else if(n(St))lt.dtype=An||ui(St),lt.dimension=Xt,Mt(lt,St,sn),Pn&&(lt.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,fr=0,Dr=0;Kt.length===1?(Zt=Kt[0],Ht=1,fr=xr[0],Dr=0):Kt.length===2?(Zt=Kt[0],Ht=Kt[1],fr=xr[0],Dr=xr[1]):q.raise("invalid shape"),lt.dtype=An||ui(St.data)||Kl,lt.dimension=Ht;var Un=Oo.allocType(lt.dtype,Zt*Ht);rl(Un,St.data,Zt,Ht,fr,Dr,on),Mt(lt,Un,sn),Pn?lt.persistentData=Un:Oo.freeType(Un)}else St instanceof ArrayBuffer?(lt.dtype=wu,lt.dimension=Xt,Mt(lt,St,sn),Pn&&(lt.persistentData=new Uint8Array(new Uint8Array(St)))):q.raise("invalid buffer data")}function pn(lt){me.bufferCount--,wt(lt);var St=lt.buffer;q(St,"buffer must not be deleted already"),K.deleteBuffer(St),lt.buffer=null,delete yt[lt.id]}function rn(lt,St,sn,An){me.bufferCount++;var Xt=new Nt(St);yt[Xt.id]=Xt;function Pn(Yt){var xn=Fs,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,ws,"invalid buffer usage"),xn=ws[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*Bs[Xt.dtype]),Pn}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);ic(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,fr=0,Dr=0,Un=0,$r=0;xr.length===1?(fr=xr[0],Dr=1,Un=Ht[0],$r=0):xr.length===2?(fr=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,fr*Dr);rl(Fr,Yt.data,fr,Dr,Un,$r,Yt.offset),Kt(Fr,ar),Oo.freeType(Fr)}else q.raise("invalid data for buffer subdata");return Pn}return sn||Pn(lt),Pn._reglType="buffer",Pn._buffer=Xt,Pn.subdata=_n,Ie.profile&&(Pn.stats=Xt.stats),Pn.destroy=function(){pn(Xt)},Pn}function Wt(){ra(yt).forEach(function(lt){lt.buffer=K.createBuffer(),K.bindBuffer(lt.type,lt.buffer),K.bufferData(lt.type,lt.persistentData||lt.byteLength,lt.usage)})}return Ie.profile&&(me.getTotalBufferSize=function(){var lt=0;return Object.keys(yt).forEach(function(St){lt+=yt[St].stats.size}),lt}),{create:rn,createStream:ln,destroyStream:nn,clear:function(){ra(yt).forEach(pn),tn.forEach(pn)},getBuffer:function(lt){return lt&&lt._buffer instanceof Nt?lt._buffer:null},restore:Wt,_initBuffer:wn}}var af=0,Vh=0,sf=1,Wi=1,ac=4,ol=4,Ki={points:af,point:Vh,lines:sf,line:Wi,triangles:ac,triangle:ol,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},lf=0,ss=1,xs=4,sd=5120,Va=5121,Qa=5122,ia=5123,ls=5124,Pa=5125,Ct=34963,un=35040,dn=35044;function Gn(K,me,Ie,wt){var Dt={},yt=0,Nt={uint8:Va,uint16:ia};me.oes_element_index_uint&&(Nt.uint32=Pa);function tn(Wt){this.id=yt++,Dt[this.id]=this,this.buffer=Wt,this.primType=xs,this.vertCount=0,this.type=0}tn.prototype.bind=function(){this.buffer.bind()};var ln=[];function nn(Wt){var lt=ln.pop();return lt||(lt=new tn(Ie.create(null,Ct,!0,!1)._buffer)),wn(lt,Wt,un,-1,-1,0,0),lt}function Mt(Wt){ln.push(Wt)}function wn(Wt,lt,St,sn,An,Xt,Pn){Wt.buffer.bind();var Kt;if(lt){var _n=Pn;!Pn&&(!n(lt)||Ia(lt)&&!n(lt.data))&&(_n=me.oes_element_index_uint?Pa:ia),Ie._initBuffer(Wt.buffer,lt,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=Pn,!Pn){switch(Wt.buffer.dtype){case Va:case sd:Kt=Va;break;case ia:case Qa:Kt=ia;break;case Pa:case ls:Kt=Pa;break;default:q.raise("unsupported type for element array")}Wt.buffer.dtype=Kt}Wt.type=Kt,q(Kt!==Pa||!!me.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===Pa&&(Yt>>=2)),Wt.vertCount=Yt;var xn=sn;if(sn<0){xn=xs;var ar=Wt.buffer.dimension;ar===1&&(xn=lf),ar===2&&(xn=ss),ar===3&&(xn=xs)}Wt.primType=xn}function pn(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,lt){var St=Ie.create(null,Ct,!0),sn=new tn(St._buffer);wt.elementsCount++;function An(Xt){if(!Xt)St(),sn.primType=xs,sn.vertCount=0,sn.type=Va;else if(typeof Xt=="number")St(Xt),sn.primType=xs,sn.vertCount=Xt|0,sn.type=Va;else{var Pn=null,Kt=dn,_n=-1,Yt=-1,xn=0,ar=0;Array.isArray(Xt)||n(Xt)||Ia(Xt)?Pn=Xt:(q.type(Xt,"object","invalid arguments for elements"),"data"in Xt&&(Pn=Xt.data,q(Array.isArray(Pn)||n(Pn)||Ia(Pn),"invalid data for element buffer")),"usage"in Xt&&(q.parameter(Xt.usage,ws,"invalid element buffer usage"),Kt=ws[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===Pa||ar===ls)&&(xn*=4))),wn(sn,Pn,Kt,_n,Yt,xn,ar)}return An}return An(Wt),An._reglType="elements",An._elements=sn,An.subdata=function(Xt,Pn){return St.subdata(Xt,Pn),An},An.destroy=function(){pn(sn)},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(pn)}}}var Wr=new Float32Array(1),mo=new Uint32Array(Wr.buffer),ci=5123;function R(K){for(var me=Oo.allocType(ci,K.length),Ie=0;Ie<K.length;++Ie)if(isNaN(K[Ie]))me[Ie]=65535;else if(K[Ie]===1/0)me[Ie]=31744;else if(K[Ie]===-1/0)me[Ie]=64512;else{Wr[0]=K[Ie];var wt=mo[0],Dt=wt>>>31<<15,yt=(wt<<1>>>24)-127,Nt=wt>>13&1023;if(yt<-24)me[Ie]=Dt;else if(yt<-14){var tn=-14-yt;me[Ie]=Dt+(Nt+1024>>tn)}else yt>15?me[Ie]=Dt+31744:me[Ie]=Dt+(yt+15<<10)+Nt}return me}function L(K){return Array.isArray(K)||n(K)}var Z=function(K){return!(K&K-1)&&!!K},fe=34467,Re=3553,st=34067,It=34069,bn=6408,Jn=6406,no=6407,$n=6409,Do=6410,Kr=32854,So=32855,us=36194,wi=32819,es=32820,Pl=33635,kl=34042,Zl=6402,Eu=34041,il=35904,xu=35906,Zi=36193,Jl=33776,Rl=33777,al=33778,sl=33779,sc=35986,fm=35987,pm=34798,Wh=35840,uf=35841,lc=35842,bp=35843,hm=36196,uc=5121,cf=5123,wp=5125,ji=5126,Wa=10242,Ep=10243,xp=10497,ld=33071,dy=33648,ud=10240,cd=10241,df=9728,cc=9729,Ou=9984,dd=9985,ff=9986,Su=9987,fy=33170,pf=4352,py=4353,hy=4354,vm=34046,Op=3317,ka=37440,mm=37441,he=37443,dc=37444,Ql=33984,$s=[Ou,ff,dd,Su],go=[0,$n,Do,no,bn],ba={};ba[$n]=ba[Jn]=ba[Zl]=1,ba[Eu]=ba[Do]=2,ba[no]=ba[il]=3,ba[bn]=ba[xu]=4;function To(K){return"[object "+K+"]"}var ll=To("HTMLCanvasElement"),eu=To("OffscreenCanvas"),Os=To("CanvasRenderingContext2D"),Sp=To("ImageBitmap"),Ap=To("HTMLImageElement"),Gh=To("HTMLVideoElement"),gm=Object.keys(Za).concat([ll,eu,Os,Sp,Ap,Gh]),tu=[];tu[uc]=1,tu[ji]=4,tu[Zi]=2,tu[cf]=2,tu[wp]=4;var Li=[];Li[Kr]=2,Li[So]=2,Li[us]=2,Li[Eu]=4,Li[Jl]=.5,Li[Rl]=.5,Li[al]=1,Li[sl]=1,Li[sc]=.5,Li[fm]=1,Li[pm]=1,Li[Wh]=.5,Li[uf]=.25,Li[lc]=.5,Li[bp]=.25,Li[hm]=.5;function fd(K){return Array.isArray(K)&&(K.length===0||typeof K[0]=="number")}function zh(K){if(!Array.isArray(K))return!1;var me=K.length;return!(me===0||!L(K[0]))}function nu(K){return Object.prototype.toString.call(K)}function ul(K){return nu(K)===ll}function hf(K){return nu(K)===eu}function Au(K){return nu(K)===Os}function Ss(K){return nu(K)===Sp}function Hh(K){return nu(K)===Ap}function Xh(K){return nu(K)===Gh}function cl(K){if(!K)return!1;var me=nu(K);return gm.indexOf(me)>=0?!0:fd(K)||zh(K)||Ia(K)}function mi(K){return Za[Object.prototype.toString.call(K)]|0}function ym(K,me){var Ie=me.length;switch(K.type){case uc:case cf:case wp:case ji:var wt=Oo.allocType(K.type,Ie);wt.set(me),K.data=wt;break;case Zi:K.data=R(me);break;default:q.raise("unsupported texture type, must specify a typed array")}}function Yh(K,me){return Oo.allocType(K.type===Zi?ji:K.type,me)}function Ii(K,me){K.type===Zi?(K.data=R(me),Oo.freeType(me)):K.data=me}function Io(K,me,Ie,wt,Dt,yt){for(var Nt=K.width,tn=K.height,ln=K.channels,nn=Nt*tn*ln,Mt=Yh(K,nn),wn=0,pn=0;pn<tn;++pn)for(var rn=0;rn<Nt;++rn)for(var Wt=0;Wt<ln;++Wt)Mt[wn++]=me[Ie*rn+wt*pn+Dt*Wt+yt];Ii(K,Mt)}function Ji(K,me,Ie,wt,Dt,yt){var Nt;if(typeof Li[K]<"u"?Nt=Li[K]:Nt=ba[K]*tu[me],yt&&(Nt*=6),Dt){for(var tn=0,ln=Ie;ln>=1;)tn+=Nt*ln*ln,ln/=2;return tn}else return Nt*Ie*wt}function so(K,me,Ie,wt,Dt,yt,Nt){var tn={"don't care":pf,"dont care":pf,nice:hy,fast:py},ln={repeat:xp,clamp:ld,mirror:dy},nn={nearest:df,linear:cc},Mt=o({mipmap:Su,"nearest mipmap nearest":Ou,"linear mipmap nearest":dd,"nearest mipmap linear":ff,"linear mipmap linear":Su},nn),wn={none:0,browser:dc},pn={uint8:uc,rgba4:wi,rgb565:Pl,"rgb5 a1":es},rn={alpha:Jn,luminance:$n,"luminance alpha":Do,rgb:no,rgba:bn,rgba4:Kr,"rgb5 a1":So,rgb565:us},Wt={};me.ext_srgb&&(rn.srgb=il,rn.srgba=xu),me.oes_texture_float&&(pn.float32=pn.float=ji),me.oes_texture_half_float&&(pn.float16=pn["half float"]=Zi),me.webgl_depth_texture&&(o(rn,{depth:Zl,"depth stencil":Eu}),o(pn,{uint16:cf,uint32:wp,"depth stencil":kl})),me.webgl_compressed_texture_s3tc&&o(Wt,{"rgb s3tc dxt1":Jl,"rgba s3tc dxt1":Rl,"rgba s3tc dxt3":al,"rgba s3tc dxt5":sl}),me.webgl_compressed_texture_atc&&o(Wt,{"rgb atc":sc,"rgba atc explicit alpha":fm,"rgba atc interpolated alpha":pm}),me.webgl_compressed_texture_pvrtc&&o(Wt,{"rgb pvrtc 4bppv1":Wh,"rgb pvrtc 2bppv1":uf,"rgba pvrtc 4bppv1":lc,"rgba pvrtc 2bppv1":bp}),me.webgl_compressed_texture_etc1&&(Wt["rgb etc1"]=hm);var lt=Array.prototype.slice.call(K.getParameter(fe));Object.keys(Wt).forEach(function(Te){var Et=Wt[Te];lt.indexOf(Et)>=0&&(rn[Te]=Et)});var St=Object.keys(rn);Ie.textureFormats=St;var sn=[];Object.keys(rn).forEach(function(Te){var Et=rn[Te];sn[Et]=Te});var An=[];Object.keys(pn).forEach(function(Te){var Et=pn[Te];An[Et]=Te});var Xt=[];Object.keys(nn).forEach(function(Te){var Et=nn[Te];Xt[Et]=Te});var Pn=[];Object.keys(Mt).forEach(function(Te){var Et=Mt[Te];Pn[Et]=Te});var Kt=[];Object.keys(ln).forEach(function(Te){var Et=ln[Te];Kt[Et]=Te});var _n=St.reduce(function(Te,Et){var _t=rn[Et];return _t===$n||_t===Jn||_t===$n||_t===Do||_t===Zl||_t===Eu||me.ext_srgb&&(_t===il||_t===xu)?Te[_t]=_t:_t===So||Et.indexOf("rgba")>=0?Te[_t]=bn:Te[_t]=no,Te},{});function Yt(){this.internalformat=bn,this.format=bn,this.type=uc,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=dc,this.width=0,this.height=0,this.channels=0}function xn(Te,Et){Te.internalformat=Et.internalformat,Te.format=Et.format,Te.type=Et.type,Te.compressed=Et.compressed,Te.premultiplyAlpha=Et.premultiplyAlpha,Te.flipY=Et.flipY,Te.unpackAlignment=Et.unpackAlignment,Te.colorSpace=Et.colorSpace,Te.width=Et.width,Te.height=Et.height,Te.channels=Et.channels}function ar(Te,Et){if(!(typeof Et!="object"||!Et)){if("premultiplyAlpha"in Et&&(q.type(Et.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),Te.premultiplyAlpha=Et.premultiplyAlpha),"flipY"in Et&&(q.type(Et.flipY,"boolean","invalid texture flip"),Te.flipY=Et.flipY),"alignment"in Et&&(q.oneOf(Et.alignment,[1,2,4,8],"invalid texture unpack alignment"),Te.unpackAlignment=Et.alignment),"colorSpace"in Et&&(q.parameter(Et.colorSpace,wn,"invalid colorSpace"),Te.colorSpace=wn[Et.colorSpace]),"type"in Et){var _t=Et.type;q(me.oes_texture_float||!(_t==="float"||_t==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),q(me.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(me.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,pn,"invalid texture type"),Te.type=pn[_t]}var Ln=Te.width,Gr=Te.height,xe=Te.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)),Te.width=Ln|0,Te.height=Gr|0,Te.channels=xe|0;var We=!1;if("format"in Et){var tt=Et.format;q(me.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=Te.internalformat=rn[tt];Te.format=_n[ct],tt in pn&&("type"in Et||(Te.type=pn[tt])),tt in Wt&&(Te.compressed=!0),We=!0}!de&&We?Te.channels=ba[Te.format]:de&&!We?Te.channels!==go[Te.format]&&(Te.format=Te.internalformat=go[Te.channels]):We&&de&&q(Te.channels===ba[Te.format],"number of channels inconsistent with specified format")}}function xr(Te){K.pixelStorei(ka,Te.flipY),K.pixelStorei(mm,Te.premultiplyAlpha),K.pixelStorei(he,Te.colorSpace),K.pixelStorei(Op,Te.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(Te,Et){var _t=null;if(cl(Et)?_t=Et:Et&&(q.type(Et,"object","invalid pixel data type"),ar(Te,Et),"x"in Et&&(Te.xOffset=Et.x|0),"y"in Et&&(Te.yOffset=Et.y|0),cl(Et.data)&&(_t=Et.data)),q(!Te.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;Te.width=Te.width||Ln-Te.xOffset,Te.height=Te.height||Gr-Te.yOffset,Te.needsCopy=!0,q(Te.xOffset>=0&&Te.xOffset<Ln&&Te.yOffset>=0&&Te.yOffset<Gr&&Te.width>0&&Te.width<=Ln&&Te.height>0&&Te.height<=Gr,"copy texture read out of bounds")}else if(!_t)Te.width=Te.width||1,Te.height=Te.height||1,Te.channels=Te.channels||4;else if(n(_t))Te.channels=Te.channels||4,Te.data=_t,!("type"in Et)&&Te.type===uc&&(Te.type=mi(_t));else if(fd(_t))Te.channels=Te.channels||4,ym(Te,_t),Te.alignment=1,Te.needsFree=!0;else if(Ia(_t)){var xe=_t.data;!Array.isArray(xe)&&Te.type===uc&&(Te.type=mi(xe));var de=_t.shape,We=_t.stride,tt,ct,Xe,Ge,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],Ge=We[0],Qe=We[1],Te.alignment=1,Te.width=tt,Te.height=ct,Te.channels=Xe,Te.format=Te.internalformat=go[Xe],Te.needsFree=!0,Io(Te,xe,Ge,Qe,Ee,_t.offset)}else if(ul(_t)||hf(_t)||Au(_t))ul(_t)||hf(_t)?Te.element=_t:Te.element=_t.canvas,Te.width=Te.element.width,Te.height=Te.element.height,Te.channels=4;else if(Ss(_t))Te.element=_t,Te.width=_t.width,Te.height=_t.height,Te.channels=4;else if(Hh(_t))Te.element=_t,Te.width=_t.naturalWidth,Te.height=_t.naturalHeight,Te.channels=4;else if(Xh(_t))Te.element=_t,Te.width=_t.videoWidth,Te.height=_t.videoHeight,Te.channels=4;else if(zh(_t)){var Ue=Te.width||_t[0].length,be=Te.height||_t.length,nt=Te.channels;L(_t[0][0])?nt=nt||_t[0][0].length:nt=nt||1;for(var ot=bs.shape(_t),g=1,x=0;x<ot.length;++x)g*=ot[x];var T=Yh(Te,g);bs.flatten(_t,ot,"",T),Ii(Te,T),Te.alignment=1,Te.width=Ue,Te.height=be,Te.channels=nt,Te.format=Te.internalformat=go[nt],Te.needsFree=!0}Te.type===ji?q(Ie.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):Te.type===Zi&&q(Ie.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Ht(Te,Et,_t){var Ln=Te.element,Gr=Te.data,xe=Te.internalformat,de=Te.format,We=Te.type,tt=Te.width,ct=Te.height;xr(Te),Ln?K.texImage2D(Et,_t,de,de,We,Ln):Te.compressed?K.compressedTexImage2D(Et,_t,xe,tt,ct,0,Gr):Te.needsCopy?(wt(),K.copyTexImage2D(Et,_t,de,Te.xOffset,Te.yOffset,tt,ct,0)):K.texImage2D(Et,_t,de,tt,ct,0,de,We,Gr||null)}function fr(Te,Et,_t,Ln,Gr){var xe=Te.element,de=Te.data,We=Te.internalformat,tt=Te.format,ct=Te.type,Xe=Te.width,Ge=Te.height;xr(Te),xe?K.texSubImage2D(Et,Gr,_t,Ln,tt,ct,xe):Te.compressed?K.compressedTexSubImage2D(Et,Gr,_t,Ln,We,Xe,Ge,de):Te.needsCopy?(wt(),K.copyTexSubImage2D(Et,Gr,_t,Ln,Te.xOffset,Te.yOffset,Xe,Ge)):K.texSubImage2D(Et,Gr,_t,Ln,Xe,Ge,tt,ct,de)}var Dr=[];function Un(){return Dr.pop()||new on}function $r(Te){Te.needsFree&&Oo.freeType(Te.data),on.call(Te),Dr.push(Te)}function Or(){Yt.call(this),this.genMipmaps=!1,this.mipmapHint=pf,this.mipmask=0,this.images=Array(16)}function Fr(Te,Et,_t){var Ln=Te.images[0]=Un();Te.mipmask=1,Ln.width=Te.width=Et,Ln.height=Te.height=_t,Ln.channels=Te.channels=4}function Qr(Te,Et){var _t=null;if(cl(Et))_t=Te.images[0]=Un(),xn(_t,Te),Zt(_t,Et),Te.mipmask=1;else if(ar(Te,Et),Array.isArray(Et.mipmap))for(var Ln=Et.mipmap,Gr=0;Gr<Ln.length;++Gr)_t=Te.images[Gr]=Un(),xn(_t,Te),_t.width>>=Gr,_t.height>>=Gr,Zt(_t,Ln[Gr]),Te.mipmask|=1<<Gr;else _t=Te.images[0]=Un(),xn(_t,Te),Zt(_t,Et),Te.mipmask=1;xn(Te,Te.images[0]),Te.compressed&&(Te.internalformat===Jl||Te.internalformat===Rl||Te.internalformat===al||Te.internalformat===sl)&&q(Te.width%4===0&&Te.height%4===0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function Pi(Te,Et){for(var _t=Te.images,Ln=0;Ln<_t.length;++Ln){if(!_t[Ln])return;Ht(_t[Ln],Et,Ln)}}var Si=[];function jr(){var Te=Si.pop()||new Or;Yt.call(Te),Te.mipmask=0;for(var Et=0;Et<16;++Et)Te.images[Et]=null;return Te}function Gi(Te){for(var Et=Te.images,_t=0;_t<Et.length;++_t)Et[_t]&&$r(Et[_t]),Et[_t]=null;Si.push(Te)}function Ko(){this.minFilter=df,this.magFilter=df,this.wrapS=ld,this.wrapT=ld,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=pf}function ki(Te,Et){if("min"in Et){var _t=Et.min;q.parameter(_t,Mt),Te.minFilter=Mt[_t],$s.indexOf(Te.minFilter)>=0&&!("faces"in Et)&&(Te.genMipmaps=!0)}if("mag"in Et){var Ln=Et.mag;q.parameter(Ln,nn),Te.magFilter=nn[Ln]}var Gr=Te.wrapS,xe=Te.wrapT;if("wrap"in Et){var de=Et.wrap;typeof de=="string"?(q.parameter(de,ln),Gr=xe=ln[de]):Array.isArray(de)&&(q.parameter(de[0],ln),q.parameter(de[1],ln),Gr=ln[de[0]],xe=ln[de[1]])}else{if("wrapS"in Et){var We=Et.wrapS;q.parameter(We,ln),Gr=ln[We]}if("wrapT"in Et){var tt=Et.wrapT;q.parameter(tt,ln),xe=ln[tt]}}if(Te.wrapS=Gr,Te.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 "),Te.anisotropic=Et.anisotropic}if("mipmap"in Et){var Xe=!1;switch(typeof Et.mipmap){case"string":q.parameter(Et.mipmap,tn,"invalid mipmap hint"),Te.mipmapHint=tn[Et.mipmap],Te.genMipmaps=!0,Xe=!0;break;case"boolean":Xe=Te.genMipmaps=Et.mipmap;break;case"object":q(Array.isArray(Et.mipmap),"invalid mipmap type"),Te.genMipmaps=!1,Xe=!0;break;default:q.raise("invalid mipmap type")}Xe&&!("min"in Et)&&(Te.minFilter=Ou)}}function $i(Te,Et){K.texParameteri(Et,cd,Te.minFilter),K.texParameteri(Et,ud,Te.magFilter),K.texParameteri(Et,Wa,Te.wrapS),K.texParameteri(Et,Ep,Te.wrapT),me.ext_texture_filter_anisotropic&&K.texParameteri(Et,vm,Te.anisotropic),Te.genMipmaps&&(K.hint(fy,Te.mipmapHint),K.generateMipmap(Et))}var Qi=0,sa={},zi=Ie.maxTextureUnits,di=Array(zi).map(function(){return null});function Cr(Te){Yt.call(this),this.mipmask=0,this.internalformat=bn,this.id=Qi++,this.refCount=1,this.target=Te,this.texture=K.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Ko,Nt.profile&&(this.stats={size:0})}function la(Te){K.activeTexture(Ql),K.bindTexture(Te.target,Te.texture)}function co(){var Te=di[0];Te?K.bindTexture(Te.target,Te.texture):K.bindTexture(Re,null)}function cr(Te){var Et=Te.texture;q(Et,"must not double destroy texture");var _t=Te.unit,Ln=Te.target;_t>=0&&(K.activeTexture(Ql+_t),K.bindTexture(Ln,null),di[_t]=null),K.deleteTexture(Et),Te.texture=null,Te.params=null,Te.pixels=null,Te.refCount=0,delete sa[Te.id],yt.textureCount--}o(Cr.prototype,{bind:function(){var Te=this;Te.bindCount+=1;var Et=Te.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]=Te,Et=_t;break}Et>=zi&&q.raise("insufficient number of texture units"),Nt.profile&&yt.maxTextureUnits<Et+1&&(yt.maxTextureUnits=Et+1),Te.unit=Et,K.activeTexture(Ql+Et),K.bindTexture(Te.target,Te.texture)}return Et},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&cr(this)}});function Xr(Te,Et){var _t=new Cr(Re);sa[_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"),ki(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,la(_t),Pi(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=sn[_t.internalformat],Ln.type=An[_t.type],Ln.mag=Xt[tt.magFilter],Ln.min=Pn[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,Ge=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)-Ge,q(_t.type===Ee.type&&_t.format===Ee.format&&_t.internalformat===Ee.internalformat,"incompatible format for texture.subimage"),q(Xe>=0&&Ge>=0&&Xe+Ee.width<=_t.width&&Ge+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"),la(_t),fr(Ee,Re,Xe,Ge,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,la(_t);for(var Xe=0;_t.mipmask>>Xe;++Xe){var Ge=tt>>Xe,Qe=ct>>Xe;if(!Ge||!Qe)break;K.texImage2D(Re,Xe,_t.format,Ge,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(Te,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(Te,Et,_t,Ln,Gr,xe){var de=new Cr(st);sa[de.id]=de,yt.cubeCount++;var We=new Array(6);function tt(Ge,Qe,Ee,Ue,be,nt){var ot,g=de.texInfo;for(Ko.call(g),ot=0;ot<6;++ot)We[ot]=jr();if(typeof Ge=="number"||!Ge){var x=Ge|0||1;for(ot=0;ot<6;++ot)Fr(We[ot],x,x)}else if(typeof Ge=="object")if(Qe)Qr(We[0],Ge),Qr(We[1],Qe),Qr(We[2],Ee),Qr(We[3],Ue),Qr(We[4],be),Qr(We[5],nt);else if(ki(g,Ge),ar(de,Ge),"faces"in Ge){var T=Ge.faces;for(q(Array.isArray(T)&&T.length===6,"cube faces must be a length 6 array"),ot=0;ot<6;++ot)q(typeof T[ot]=="object"&&!!T[ot],"invalid input for cube map face"),xn(We[ot],de),Qr(We[ot],T[ot])}else for(ot=0;ot<6;++ot)Qr(We[ot],Ge);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"),g.genMipmaps?de.mipmask=(We[0].width<<1)-1:de.mipmask=We[0].mipmask,q.textureCube(de,g,We,Ie),de.internalformat=We[0].internalformat,tt.width=We[0].width,tt.height=We[0].height,la(de),ot=0;ot<6;++ot)Pi(We[ot],It+ot);for($i(g,st),co(),Nt.profile&&(de.stats.size=Ji(de.internalformat,de.type,tt.width,tt.height,g.genMipmaps,!0)),tt.format=sn[de.internalformat],tt.type=An[de.type],tt.mag=Xt[g.magFilter],tt.min=Pn[g.minFilter],tt.wrapS=Kt[g.wrapS],tt.wrapT=Kt[g.wrapT],ot=0;ot<6;++ot)Gi(We[ot]);return tt}function ct(Ge,Qe,Ee,Ue,be){q(!!Qe,"must specify image data"),q(typeof Ge=="number"&&Ge===(Ge|0)&&Ge>=0&&Ge<6,"invalid face");var nt=Ee|0,ot=Ue|0,g=be|0,x=Un();return xn(x,de),x.width=0,x.height=0,Zt(x,Qe),x.width=x.width||(de.width>>g)-nt,x.height=x.height||(de.height>>g)-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<<g,"missing mipmap data"),q(x.data||x.element||x.needsCopy,"missing image data"),la(de),fr(x,It+Ge,nt,ot,g),co(),$r(x),tt}function Xe(Ge){var Qe=Ge|0;if(Qe!==de.width){tt.width=de.width=Qe,tt.height=de.height=Qe,la(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(Te,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 Te=0;Te<zi;++Te)K.activeTexture(Ql+Te),K.bindTexture(Re,null),di[Te]=null;ra(sa).forEach(cr),yt.cubeCount=0,yt.textureCount=0}Nt.profile&&(yt.getTotalTextureSize=function(){var Te=0;return Object.keys(sa).forEach(function(Et){Te+=sa[Et].stats.size}),Te});function $l(){for(var Te=0;Te<zi;++Te){var Et=di[Te];Et&&(Et.bindCount=0,Et.unit=-1,di[Te]=null)}ra(sa).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 Te=0;Te<zi;++Te){var Et=di[Te];Et&&(Et.bindCount=0,Et.unit=-1,di[Te]=null),K.activeTexture(Ql+Te),K.bindTexture(Re,null),K.bindTexture(st,null)}}return{create2D:Xr,createCube:Nr,clear:fi,getTexture:function(Te){return null},restore:$l,refresh:yi}}var ei=36161,ur=32854,ti=32855,vf=36194,Dl=33189,Mp=36168,Ei=34041,Mi=35907,qh=34836,Kh=34842,mf=34843,Ga=[];Ga[ur]=2,Ga[ti]=2,Ga[vf]=2,Ga[Dl]=2,Ga[Mp]=1,Ga[Ei]=4,Ga[Mi]=4,Ga[qh]=16,Ga[Kh]=8,Ga[mf]=6;function Tp(K,me,Ie){return Ga[K]*me*Ie}var pd=function(K,me,Ie,wt,Dt){var yt={rgba4:ur,rgb565:vf,"rgb5 a1":ti,depth:Dl,stencil:Mp,"depth stencil":Ei};me.ext_srgb&&(yt.srgba=Mi),me.ext_color_buffer_half_float&&(yt.rgba16f=Kh,yt.rgb16f=mf),me.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,ln={};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 ln[rn.id],wt.renderbufferCount--}function wn(rn,Wt){var lt=new nn(K.createRenderbuffer());ln[lt.id]=lt,wt.renderbufferCount++;function St(An,Xt){var Pn=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"),Pn=xn[0]|0,Kt=xn[1]|0}else"radius"in Yt&&(Pn=Kt=Yt.radius|0),"width"in Yt&&(Pn=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"?(Pn=An|0,typeof Xt=="number"?Kt=Xt|0:Kt=Pn):An?q.raise("invalid arguments to renderbuffer constructor"):Pn=Kt=1;if(q(Pn>0&&Kt>0&&Pn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),!(Pn===lt.width&&Kt===lt.height&&_n===lt.format))return St.width=lt.width=Pn,St.height=lt.height=Kt,lt.format=_n,K.bindRenderbuffer(ei,lt.renderbuffer),K.renderbufferStorage(ei,_n,Pn,Kt),q(K.getError()===0,"invalid render buffer format"),Dt.profile&&(lt.stats.size=Tp(lt.format,lt.width,lt.height)),St.format=Nt[lt.format],St}function sn(An,Xt){var Pn=An|0,Kt=Xt|0||Pn;return Pn===lt.width&&Kt===lt.height||(q(Pn>0&&Kt>0&&Pn<=Ie.maxRenderbufferSize&&Kt<=Ie.maxRenderbufferSize,"invalid renderbuffer size"),St.width=lt.width=Pn,St.height=lt.height=Kt,K.bindRenderbuffer(ei,lt.renderbuffer),K.renderbufferStorage(ei,lt.format,Pn,Kt),q(K.getError()===0,"invalid render buffer format"),Dt.profile&&(lt.stats.size=Tp(lt.format,lt.width,lt.height))),St}return St(rn,Wt),St.resize=sn,St._reglType="renderbuffer",St._renderbuffer=lt,Dt.profile&&(St.stats=lt.stats),St.destroy=function(){lt.decRef()},St}Dt.profile&&(wt.getTotalRenderbufferSize=function(){var rn=0;return Object.keys(ln).forEach(function(Wt){rn+=ln[Wt].stats.size}),rn});function pn(){ra(ln).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(ln).forEach(Mt)},restore:pn}},Us=36160,Mu=36161,ru=3553,Vs=34069,_m=36064,jl=36096,As=36128,Zh=33306,Jh=36053,Cp=36054,bm=36055,wm=36057,Em=36061,Np=36193,Qh=5121,ev=5126,gf=6407,uo=6408,vy=6402,tv=[gf,uo],fc=[];fc[uo]=4,fc[gf]=3;var yf=[];yf[Qh]=1,yf[ev]=4,yf[Np]=2;var my=32854,xm=32855,Ms=36194,gy=33189,_f=36168,Pp=34041,nv=35907,Om=34836,cs=34842,Tu=34843,kp=[my,xm,Ms,nv,cs,Tu,Om],pc={};pc[Jh]="complete",pc[Cp]="incomplete attachment",pc[wm]="incomplete dimensions",pc[bm]="incomplete, missing attachment",pc[Em]="unsupported";function Rp(K,me,Ie,wt,Dt,yt){var Nt={cur:null,next:null,dirty:!1,setFBO:null},tn=["rgba"],ln=["rgba4","rgb565","rgb5 a1"];me.ext_srgb&&ln.push("srgba"),me.ext_color_buffer_half_float&&ln.push("rgba16f","rgb16f"),me.webgl_color_buffer_float&&ln.push("rgba32f");var nn=["uint8"];me.oes_texture_half_float&&nn.push("half float","float16"),me.oes_texture_float&&nn.push("float","float32");function Mt(on,Zt,Ht){this.target=on,this.texture=Zt,this.renderbuffer=Ht;var fr=0,Dr=0;Zt?(fr=Zt.width,Dr=Zt.height):Ht&&(fr=Ht.width,Dr=Ht.height),this.width=fr,this.height=Dr}function wn(on){on&&(on.texture&&on.texture._texture.decRef(),on.renderbuffer&&on.renderbuffer._renderbuffer.decRef())}function pn(on,Zt,Ht){if(on)if(on.texture){var fr=on.texture._texture,Dr=Math.max(1,fr.width),Un=Math.max(1,fr.height);q(Dr===Zt&&Un===Ht,"inconsistent width/height for supplied texture"),fr.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(Us,on,Zt.target,Zt.texture._texture.texture,0):K.framebufferRenderbuffer(Us,on,Mu,Zt.renderbuffer._renderbuffer.renderbuffer))}function Wt(on){var Zt=ru,Ht=null,fr=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>=Vs&&Zt<Vs+6,"invalid cube map target")):Un==="renderbuffer"?(fr=Dr,Zt=Mu):q.raise("invalid regl object for attachment"),new Mt(Zt,Ht,fr)}function lt(on,Zt,Ht,fr,Dr){if(Ht){var Un=wt.create2D({width:on,height:Zt,format:fr,type:Dr});return Un._texture.refCount=0,new Mt(ru,Un,null)}else{var $r=Dt.create({width:on,height:Zt,format:fr});return $r._renderbuffer.refCount=0,new Mt(Mu,null,$r)}}function St(on){return on&&(on.texture||on.renderbuffer)}function sn(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 Pn(){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(Us,on.framebuffer);var Ht=on.colorAttachments;for(Zt=0;Zt<Ht.length;++Zt)rn(_m+Zt,Ht[Zt]);for(Zt=Ht.length;Zt<Ie.maxColorAttachments;++Zt)K.framebufferTexture2D(Us,_m+Zt,ru,null,0);K.framebufferTexture2D(Us,Zh,ru,null,0),K.framebufferTexture2D(Us,jl,ru,null,0),K.framebufferTexture2D(Us,As,ru,null,0),rn(jl,on.depthAttachment),rn(As,on.stencilAttachment),rn(Zh,on.depthStencilAttachment);var fr=K.checkFramebufferStatus(Us);!K.isContextLost()&&fr!==Jh&&q.raise("framebuffer configuration not supported, status = "+pc[fr]),K.bindFramebuffer(Us,Nt.next?Nt.next.framebuffer:null),Nt.cur=Nt.next,K.getError()}function xn(on,Zt){var Ht=new Pn;yt.framebufferCount++;function fr(Un,$r){var Or;q(Nt.next!==Ht,"can not update framebuffer which is currently in use");var Fr=0,Qr=0,Pi=!0,Si=!0,jr=null,Gi=!0,Ko="rgba",ki="uint8",$i=1,Qi=null,sa=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 la=Cr.shape;q(Array.isArray(la)&&la.length>=2,"invalid shape for framebuffer"),Fr=la[0],Qr=la[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||me.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&&(ki=Cr.colorType,Gi?(q(me.oes_texture_float||!(ki==="float"||ki==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),q(me.oes_texture_half_float||!(ki==="half float"||ki==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):ki==="half float"||ki==="float16"?(q(me.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),Ko="rgba16f"):(ki==="float"||ki==="float32")&&(q(me.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),Ko="rgba32f"),q.oneOf(ki,nn,"invalid color type")),"colorFormat"in Cr&&(Ko=Cr.colorFormat,tn.indexOf(Ko)>=0?Gi=!0:ln.indexOf(Ko)>=0?Gi=!1:Gi?q.oneOf(Cr.colorFormat,tn,"invalid color format for texture"):q.oneOf(Cr.colorFormat,ln,"invalid color format for renderbuffer"))),("depthTexture"in Cr||"depthStencilTexture"in Cr)&&(di=!!(Cr.depthTexture||Cr.depthStencilTexture),q(!di||me.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Cr&&(typeof Cr.depth=="boolean"?Pi=Cr.depth:(Qi=Cr.depth,Si=!1)),"stencil"in Cr&&(typeof Cr.stencil=="boolean"?Si=Cr.stencil:(sa=Cr.stencil,Pi=!1)),"depthStencil"in Cr&&(typeof Cr.depthStencil=="boolean"?Pi=Si=Cr.depthStencil:(zi=Cr.depthStencil,Pi=!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]=lt(Fr,Qr,Gi,Ko,ki);q(me.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):Pi&&!Si&&(cr=lt(Fr,Qr,di,"depth","uint32")),sa?Xr=Wt(sa):Si&&!Pi&&(Xr=lt(Fr,Qr,!1,"stencil","uint8")),zi?Nr=Wt(zi):!Qi&&!sa&&Si&&Pi&&(Nr=lt(Fr,Qr,di,"depth stencil","depth stencil")),q(!!Qi+!!sa+!!zi<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var fi=null;for(Or=0;Or<co.length;++Or)if(pn(co[Or],Fr,Qr),q(!co[Or]||co[Or].texture&&tv.indexOf(co[Or].texture._texture.format)>=0||co[Or].renderbuffer&&kp.indexOf(co[Or].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+Or+" is invalid"),co[Or]&&co[Or].texture){var $l=fc[co[Or].texture._texture.format]*yf[co[Or].texture._texture.type];fi===null?fi=$l:q(fi===$l,"all color attachments much have the same number of bits per pixel.")}return pn(cr,Fr,Qr),q(!cr||cr.texture&&cr.texture._texture.format===vy||cr.renderbuffer&&cr.renderbuffer._renderbuffer.format===gy,"invalid depth attachment for framebuffer object"),pn(Xr,Fr,Qr),q(!Xr||Xr.renderbuffer&&Xr.renderbuffer._renderbuffer.format===_f,"invalid stencil attachment for framebuffer object"),pn(Nr,Fr,Qr),q(!Nr||Nr.texture&&Nr.texture._texture.format===Pp||Nr.renderbuffer&&Nr.renderbuffer._renderbuffer.format===Pp,"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,fr.color=co.map(St),fr.depth=St(cr),fr.stencil=St(Xr),fr.depthStencil=St(Nr),fr.width=Ht.width,fr.height=Ht.height,Yt(Ht),fr}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 fr;for(var Qr=Ht.colorAttachments,Pi=0;Pi<Qr.length;++Pi)sn(Qr[Pi],Or,Fr);return sn(Ht.depthAttachment,Or,Fr),sn(Ht.stencilAttachment,Or,Fr),sn(Ht.depthStencilAttachment,Or,Fr),Ht.width=fr.width=Or,Ht.height=fr.height=Fr,Yt(Ht),fr}return fr(on,Zt),o(fr,{resize:Dr,_reglType:"framebuffer",_framebuffer:Ht,destroy:function(){_n(Ht),Kt(Ht)},use:function(Un){Nt.setFBO({framebuffer:fr},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",Pi="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||me.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"),Pi=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 ki={radius:Or,format:Qr,type:Pi};for(Un=0;Un<Si;++Un)Ko[Un]=wt.createCube(ki)}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:Vs,data:Ko[Un]}}for(Un=0;Un<6;++Un){for(var Qi=0;Qi<Ko.length;++Qi)$r.color[Qi].target=Vs+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 fr(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:fr,_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 Pn)return Zt}return null},create:xn,createCube:ar,clear:function(){ra(Xt).forEach(_n)},restore:xr})}var rv=5126,Dp=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 jp(K,me,Ie,wt,Dt){for(var yt=Ie.maxAttributes,Nt=new Array(yt),tn=0;tn<yt;++tn)Nt[tn]=new bf;var ln=0,nn={},Mt={Record:bf,scope:{},state:Nt,currentVAO:null,targetVAO:null,restore:pn()?Xt:function(){},createVAO:Pn,getVAO:Wt,destroyBuffer:wn,setVAO:pn()?lt:St,clear:pn()?sn: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 pn(){return me.oes_vertex_array_object}function rn(){return me.angle_instanced_arrays}function Wt(Kt){return typeof Kt=="function"&&Kt._vao?Kt._vao:null}function lt(Kt){if(Kt!==Mt.currentVAO){var _n=pn();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 sn(){ra(nn).forEach(function(Kt){Kt.destroy()})}function An(){this.id=++ln,this.attributes=[];var Kt=pn();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(Dp,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=pn();Kt&&(Kt.bindVertexArrayOES(this.vao),this.bindAttrs(),Mt.currentVAO=this)},An.prototype.destroy=function(){if(this.vao){var Kt=pn();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=pn();Kt&&ra(nn).forEach(function(_n){_n.refresh()})}function Pn(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,fr=Zt.data||Zt;if(Array.isArray(fr)||n(fr)||Ia(fr)){var Dr;_n.buffers[on]&&(Dr=_n.buffers[on],n(fr)&&Dr._buffer.byteLength>=fr.byteLength?Dr.subdata(fr):(Dr.destroy(),_n.buffers[on]=null)),_n.buffers[on]||(Dr=_n.buffers[on]=Dt.create(Zt,Dp,!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||!!me.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 Lp=35632,jo=35633,yy=35718,Uo=35721;function Ip(K,me,Ie,wt){var Dt={},yt={};function Nt(lt,St,sn,An){this.name=lt,this.id=St,this.location=sn,this.info=An}function tn(lt,St){for(var sn=0;sn<lt.length;++sn)if(lt[sn].id===St.id){lt[sn].location=St.location;return}lt.push(St)}function ln(lt,St,sn){var An=lt===Lp?Dt:yt,Xt=An[St];if(!Xt){var Pn=me.str(St);Xt=K.createShader(lt),K.shaderSource(Xt,Pn),K.compileShader(Xt),q.shaderError(K,Xt,Pn,lt,sn),An[St]=Xt}return Xt}var nn={},Mt=[],wn=0;function pn(lt,St){this.id=wn++,this.fragId=lt,this.vertId=St,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,wt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function rn(lt,St,sn){var An,Xt,Pn=ln(Lp,lt.fragId),Kt=ln(jo,lt.vertId),_n=lt.program=K.createProgram();if(K.attachShader(_n,Pn),K.attachShader(_n,Kt),sn)for(An=0;An<sn.length;++An){var Yt=sn[An];K.bindAttribLocation(_n,Yt[0],Yt[1])}K.linkProgram(_n),q.linkError(K,_n,me.str(lt.fragId),me.str(lt.vertId),St);var xn=K.getProgramParameter(_n,yy);wt.profile&&(lt.stats.uniformsCount=xn);var ar=lt.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,me.id(on),K.getUniformLocation(_n,on),Xt))}else tn(ar,new Nt(Xt.name,me.id(Xt.name),K.getUniformLocation(_n,Xt.name),Xt));var Zt=K.getProgramParameter(_n,Uo);wt.profile&&(lt.stats.attributesCount=Zt);var Ht=lt.attributes;for(An=0;An<Zt;++An)Xt=K.getActiveAttrib(_n,An),Xt&&tn(Ht,new Nt(Xt.name,me.id(Xt.name),K.getAttribLocation(_n,Xt.name),Xt))}wt.profile&&(Ie.getMaxUniformsCount=function(){var lt=0;return Mt.forEach(function(St){St.stats.uniformsCount>lt&&(lt=St.stats.uniformsCount)}),lt},Ie.getMaxAttributesCount=function(){var lt=0;return Mt.forEach(function(St){St.stats.attributesCount>lt&&(lt=St.stats.attributesCount)}),lt});function Wt(){Dt={},yt={};for(var lt=0;lt<Mt.length;++lt)rn(Mt[lt],null,Mt[lt].attributes.map(function(St){return[St.location,St.name]}))}return{clear:function(){var lt=K.deleteShader.bind(K);ra(Dt).forEach(lt),Dt={},ra(yt).forEach(lt),yt={},Mt.forEach(function(St){K.deleteProgram(St.program)}),Mt.length=0,nn={},Ie.shaderCount=0},program:function(lt,St,sn,An){q.command(lt>=0,"missing vertex shader",sn),q.command(St>=0,"missing fragment shader",sn);var Xt=nn[St];Xt||(Xt=nn[St]={});var Pn=Xt[lt];if(Pn&&(Pn.refCount++,!An))return Pn;var Kt=new pn(St,lt);return Ie.shaderCount++,rn(Kt,sn,An),Pn||(Xt[lt]=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:ln,frag:-1,vert:-1}}var Sm=6408,hc=5121,Am=3333,hd=5126;function Mm(K,me,Ie,wt,Dt,yt,Nt){function tn(Mt){var wn;me.next===null?(q(Dt.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),wn=hc):(q(me.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),wn=me.next.colorAttachments[0].texture._texture.type,yt.oes_texture_float?(q(wn===hc||wn===hd,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),wn===hd&&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===hc,"Reading from a framebuffer is only allowed for the type 'uint8'"));var pn=0,rn=0,Wt=wt.framebufferWidth,lt=wt.framebufferHeight,St=null;n(Mt)?St=Mt:Mt&&(q.type(Mt,"object","invalid arguments to regl.read()"),pn=Mt.x|0,rn=Mt.y|0,q(pn>=0&&pn<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-pn)|0,lt=(Mt.height||wt.framebufferHeight-rn)|0,St=Mt.data||null),St&&(wn===hc?q(St instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):wn===hd&&q(St instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),q(Wt>0&&Wt+pn<=wt.framebufferWidth,"invalid width for read pixels"),q(lt>0&&lt+rn<=wt.framebufferHeight,"invalid height for read pixels"),Ie();var sn=Wt*lt*4;return St||(wn===hc?St=new Uint8Array(sn):wn===hd&&(St=St||new Float32Array(sn))),q.isTypedArray(St,"data buffer for regl.read() must be a typedarray"),q(St.byteLength>=sn,"data buffer for regl.read() too small"),K.pixelStorei(Am,4),K.readPixels(pn,rn,Wt,lt,Sm,wn,St),St}function ln(Mt){var wn;return me.setFBO({framebuffer:Mt.framebuffer},function(){wn=tn(Mt)}),wn}function nn(Mt){return!Mt||!("framebuffer"in Mt)?tn(Mt):ln(Mt)}return nn}function vc(K){return Array.prototype.slice.call(K)}function va(K){return vc(K).join("")}function dl(){var K=0,me=[],Ie=[];function wt(wn){for(var pn=0;pn<Ie.length;++pn)if(Ie[pn]===wn)return me[pn];var rn="g"+K++;return me.push(rn),Ie.push(wn),rn}function Dt(){var wn=[];function pn(){wn.push.apply(wn,vc(arguments))}var rn=[];function Wt(){var lt="v"+K++;return rn.push(lt),arguments.length>0&&(wn.push(lt,"="),wn.push.apply(wn,vc(arguments)),wn.push(";")),lt}return o(pn,{def:Wt,toString:function(){return va([rn.length>0?"var "+rn.join(",")+";":"",va(wn)])}})}function yt(){var wn=Dt(),pn=Dt(),rn=wn.toString,Wt=pn.toString;function lt(St,sn){pn(St,sn,"=",wn.def(St,sn),";")}return o(function(){wn.apply(wn,vc(arguments))},{def:wn.def,entry:wn,exit:pn,save:lt,set:function(St,sn,An){lt(St,sn),wn(St,sn,"=",An,";")},toString:function(){return rn()+Wt()}})}function Nt(){var wn=va(arguments),pn=yt(),rn=yt(),Wt=pn.toString,lt=rn.toString;return o(pn,{then:function(){return pn.apply(pn,vc(arguments)),this},else:function(){return rn.apply(rn,vc(arguments)),this},toString:function(){var St=lt();return St&&(St="else{"+St+"}"),va(["if(",wn,"){",Wt(),"}",St])}})}var tn=Dt(),ln={};function nn(wn,pn){var rn=[];function Wt(){var Xt="a"+rn.length;return rn.push(Xt),Xt}pn=pn||0;for(var lt=0;lt<pn;++lt)Wt();var St=yt(),sn=St.toString,An=ln[wn]=o(St,{arg:Wt,toString:function(){return va(["function(",rn.join(),"){",sn(),"}"])}});return An}function Mt(){var wn=['"use strict";',tn,"return {"];Object.keys(ln).forEach(function(Wt){wn.push('"',Wt,'":',ln[Wt].toString(),",")}),wn.push("}");var pn=va(wn).replace(/;/g,`;
`).replace(/}/g,`}
`).replace(/{/g,`{
`),rn=Function.apply(null,me.concat(pn));return rn.apply(null,Ie)}return{global:tn,link:wt,block:Dt,proc:nn,scope:yt,cond:Nt,compile:Mt}}var ou="xyzw".split(""),mc=5121,gc=1,yc=2,Fp=0,iu=1,_c=2,Bp=3,fl=4,wf=5,Ef=6,vd="dither",md="blend.enable",gd="blend.color",$p="blend.equation",yd="blend.func",ov="depth.enable",Up="depth.func",Tm="depth.range",iv="depth.mask",pl="colorMask",av="cull.enable",sv="cull.face",lv="frontFace",_d="lineWidth",Ll="polygonOffset.enable",xf="polygonOffset.offset",Vp="sample.alpha",Wp="sample.enable",Cu="sample.coverage",Nu="stencil.enable",Rr="stencil.mask",bd="stencil.func",Of="stencil.opFront",hl="stencil.opBack",aa="scissor.enable",bc="scissor.box",Ti="viewport",Pu="profile",ts="framebuffer",Sf="vert",Ra="frag",Fi="elements",Il="primitive",Fl="count",Gp="offset",Qt="instances",wc="vao",Af="Width",Mf="Height",ku=ts+Af,Ec=ts+Mf,zp=Ti+Af,uv=Ti+Mf,xc="drawingBuffer",Tf=xc+Af,Hp=xc+Mf,cv=[yd,$p,bd,Of,hl,Cu,Ti,bc,xf],Bl=34962,dv=34963,vl=35632,Ru=35633,Xp=3553,Cm=34067,Nm=2884,Pm=3042,fv=3024,Yp=2960,Cf=2929,km=3089,ml=32823,Du=32926,_y=32928,gi=5126,Nf=35664,Oc=35665,Pf=35666,wd=5124,kf=35667,Rf=35668,Df=35669,Sc=35670,au=35671,ma=35672,qp=35673,jf=35674,Ac=35675,Ed=35676,wa=35678,xi=35680,Lf=4,za=1028,wr=1029,Kp=2304,If=2305,Zp=32775,pv=32776,Rm=519,ju=7680,Dm=0,Mc=1,jm=32774,hv=513,Ff=36160,Lm=36064,Ws={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},su=["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:vl,vert:Ru},xd={cw:Kp,ccw:If};function lu(K){return Array.isArray(K)||n(K)||Ia(K)}function Bf(K){return K.sort(function(me,Ie){return me===Ti?-1:Ie===Ti?1:me<Ie?-1:1})}function Ha(K,me,Ie,wt){this.thisDep=K,this.contextDep=me,this.propDep=Ie,this.append=wt}function gl(K){return K&&!(K.thisDep||K.contextDep||K.propDep)}function Ci(K){return new Ha(!1,!1,!1,K)}function ds(K,me){var Ie=K.type;if(Ie===Fp){var wt=K.data.length;return new Ha(!0,wt>=1,wt>=2,me)}else if(Ie===fl){var Dt=K.data;return new Ha(Dt.thisDep,Dt.contextDep,Dt.propDep,me)}else{if(Ie===wf)return new Ha(!1,!1,!1,me);if(Ie===Ef){for(var yt=!1,Nt=!1,tn=!1,ln=0;ln<K.data.length;++ln){var nn=K.data[ln];if(nn.type===iu)tn=!0;else if(nn.type===_c)Nt=!0;else if(nn.type===Bp)yt=!0;else if(nn.type===Fp){yt=!0;var Mt=nn.data;Mt>=1&&(Nt=!0),Mt>=2&&(tn=!0)}else nn.type===fl&&(yt=yt||nn.data.thisDep,Nt=Nt||nn.data.contextDep,tn=tn||nn.data.propDep)}return new Ha(yt,Nt,tn,me)}else return new Ha(Ie===Bp,Ie===_c,Ie===iu,me)}}var Gs=new Ha(!1,!1,!1,function(){});function by(K,me,Ie,wt,Dt,yt,Nt,tn,ln,nn,Mt,wn,pn,rn,Wt){var lt=nn.Record,St={add:32774,subtract:32778,"reverse subtract":32779};Ie.ext_blend_minmax&&(St.min=Zp,St.max=pv);var sn=Ie.angle_instanced_arrays,An=Ie.webgl_draw_buffers,Xt={dirty:!0,profile:Wt.profile},Pn={},Kt=[],_n={},Yt={};function xn(xe){return xe.replace(".","_")}function ar(xe,de,We){var tt=xn(xe);Kt.push(xe),Pn[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(),Pn[tt]=We.slice()):Xt[tt]=Pn[tt]=We,Yt[tt]=de}ar(vd,fv),ar(md,Pm),xr(gd,"blendColor",[0,0,0,0]),xr($p,"blendEquationSeparate",[jm,jm]),xr(yd,"blendFuncSeparate",[Mc,Dm,Mc,Dm]),ar(ov,Cf,!0),xr(Up,"depthFunc",hv),xr(Tm,"depthRange",[0,1]),xr(iv,"depthMask",!0),xr(pl,pl,[!0,!0,!0,!0]),ar(av,Nm),xr(sv,"cullFace",wr),xr(lv,lv,If),xr(_d,_d,1),ar(Ll,ml),xr(xf,"polygonOffset",[0,0]),ar(Vp,Du),ar(Wp,_y),xr(Cu,"sampleCoverage",[1,!1]),ar(Nu,Yp),xr(Rr,"stencilMask",-1),xr(bd,"stencilFunc",[Rm,0,-1]),xr(Of,"stencilOpSeparate",[za,ju,ju,ju]),xr(hl,"stencilOpSeparate",[wr,ju,ju,ju]),ar(aa,km),xr(bc,"scissor",[0,0,K.drawingBufferWidth,K.drawingBufferHeight]),xr(Ti,Ti,[0,0,K.drawingBufferWidth,K.drawingBufferHeight]);var on={gl:K,context:pn,strings:me,next:Pn,current:Xt,draw:wn,elements:yt,buffer:Dt,shader:Mt,attributes:nn.state,vao:nn,uniforms:ln,framebuffer:tn,extensions:Ie,timer:rn,isBufferArgs:lu},Zt={primTypes:Ki,compareFuncs:Lu,blendFuncs:Ws,blendEquations:St,stencilOps:Er,glTypes:$a,orientationType:xd};q.optional(function(){on.isArrayLike=L}),An&&(Zt.backBuffer=[wr],Zt.drawBuffer=In(wt.maxDrawbuffers,function(xe){return xe===0?[0]:In(xe,function(de){return Lm+de})}));var Ht=0;function fr(){var xe=dl(),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=su});var Xe=xe.next={},Ge=xe.current={};Object.keys(Yt).forEach(function(Ue){Array.isArray(Xt[Ue])&&(Xe[Ue]=We.def(ct.next,".",Ue),Ge[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 Fp: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 _c:return Ue.def(ct.context,be.data);case Bp:return Ue.def("this",be.data);case fl: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=me.id(Ue);if(be in Ee)return Ee[be];var nt=nn.scope[be];nt||(nt=nn.scope[be]=new lt);var ot=Ee[be]=de(nt);return ot},xe}function Dr(xe){var de=xe.static,We=xe.dynamic,tt;if(Pu in de){var ct=!!de[Pu];tt=Ci(function(Ge,Qe){return ct}),tt.enable=ct}else if(Pu in We){var Xe=We[Pu];tt=ds(Xe,function(Ge,Qe){return Ge.invoke(Qe,Xe)})}return tt}function Un(xe,de){var We=xe.static,tt=xe.dynamic;if(ts in We){var ct=We[ts];return ct?(ct=tn.getFramebuffer(ct),q.command(ct,"invalid framebuffer object"),Ci(function(Ge,Qe){var Ee=Ge.link(ct),Ue=Ge.shared;Qe.set(Ue.framebuffer,".next",Ee);var be=Ue.context;return Qe.set(be,"."+ku,Ee+".width"),Qe.set(be,"."+Ec,Ee+".height"),Ee})):Ci(function(Ge,Qe){var Ee=Ge.shared;Qe.set(Ee.framebuffer,".next","null");var Ue=Ee.context;return Qe.set(Ue,"."+ku,Ue+"."+Tf),Qe.set(Ue,"."+Ec,Ue+"."+Hp),"null"})}else if(ts in tt){var Xe=tt[ts];return ds(Xe,function(Ge,Qe){var Ee=Ge.invoke(Qe,Xe),Ue=Ge.shared,be=Ue.framebuffer,nt=Qe.def(be,".getFramebuffer(",Ee,")");q.optional(function(){Ge.assert(Qe,"!"+Ee+"||"+nt,"invalid framebuffer object")}),Qe.set(be,".next",nt);var ot=Ue.context;return Qe.set(ot,"."+ku,nt+"?"+nt+".width:"+ot+"."+Tf),Qe.set(ot,"."+Ec,nt+"?"+nt+".height:"+ot+"."+Hp),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,g,x;return"width"in Ue?(g=Ue.width|0,q.command(g>=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(te,ce){var Oe=te.shared.context,Fe=g;"width"in Ue||(Fe=ce.def(Oe,".",ku,"-",nt));var et=x;return"height"in Ue||(et=ce.def(Oe,".",Ec,"-",ot)),[nt,ot,Fe,et]})}else if(Ee in ct){var T=ct[Ee],G=ds(T,function(te,ce){var Oe=te.invoke(ce,T);q.optional(function(){te.assert(ce,Oe+"&&typeof "+Oe+'==="object"',"invalid "+Ee)});var Fe=te.shared.context,et=ce.def(Oe,".x|0"),jt=ce.def(Oe,".y|0"),Vt=ce.def('"width" in ',Oe,"?",Oe,".width|0:","(",Fe,".",ku,"-",et,")"),yn=ce.def('"height" in ',Oe,"?",Oe,".height|0:","(",Fe,".",Ec,"-",jt,")");return q.optional(function(){te.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(te,ce){var Oe=te.shared.context;return[0,0,ce.def(Oe,".",ku),ce.def(Oe,".",Ec)]}):null}var Ge=Xe(Ti);if(Ge){var Qe=Ge;Ge=new Ha(Ge.thisDep,Ge.contextDep,Ge.propDep,function(Ee,Ue){var be=Qe.append(Ee,Ue),nt=Ee.shared.context;return Ue.set(nt,"."+zp,be[2]),Ue.set(nt,"."+uv,be[3]),be})}return{viewport:Ge,scissor_box:Xe(bc)}}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 Ge=[],Qe=0;Qe<Xe.length;++Qe)q(typeof ct[Xe[Qe]]=="number","must specify all vertex attribute locations when using vaos"),Ge.push([ct[Xe[Qe]]|0,Xe[Qe]]);return Ge}}return null}function Fr(xe,de,We){var tt=xe.static,ct=xe.dynamic;function Xe(be){if(be in tt){var nt=me.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 g=ct[be];return ds(g,function(x,T){var G=x.invoke(T,g),te=T.def(x.shared.strings,".id(",G,")");return q.optional(function(){T(x.shared.shader,".shader(",vv[be],",",te,",",x.command,");")}),te})}return null}var Ge=Xe(Ra),Qe=Xe(Sf),Ee=null,Ue;return gl(Ge)&&gl(Qe)?(Ee=Mt.program(Qe.id,Ge.id,null,We),Ue=Ci(function(be,nt){return be.link(Ee)})):Ue=new Ha(Ge&&Ge.thisDep||Qe&&Qe.thisDep,Ge&&Ge.contextDep||Qe&&Qe.contextDep,Ge&&Ge.propDep||Qe&&Qe.propDep,function(be,nt){var ot=be.shared.shader,g;Ge?g=Ge.append(be,nt):g=nt.def(ot,".",Ra);var x;Qe?x=Qe.append(be,nt):x=nt.def(ot,".",Sf);var T=ot+".program("+x+","+g;return q.optional(function(){T+=","+be.command}),nt.def(T+")")}),{frag:Ge,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];lu(be)?be=yt.getElements(yt.create(be,!0)):be&&(be=yt.getElements(be),q.command(be,"invalid elements",de.commandStr));var nt=Ci(function(g,x){if(be){var T=g.link(be);return g.ELEMENTS=T,T}return g.ELEMENTS=null,null});return nt.value=be,nt}else if(Fi in tt){var ot=tt[Fi];return ds(ot,function(g,x){var T=g.shared,G=T.isBufferArgs,te=T.elements,ce=g.invoke(x,ot),Oe=x.def("null"),Fe=x.def(G,"(",ce,")"),et=g.cond(Fe).then(Oe,"=",te,".createStream(",ce,");").else(Oe,"=",te,".getElements(",ce,");");return q.optional(function(){g.assert(et.else,"!"+ce+"||"+Oe,"invalid elements")}),x.entry(et),x.exit(g.cond(Fe).then(te,".destroyStream(",Oe,");")),g.ELEMENTS=Oe,Oe})}return null}var Xe=ct();function Ge(){if(Il in We){var be=We[Il];return q.commandParameter(be,Ki,"invalid primitve",de.commandStr),Ci(function(ot,g){return Ki[be]})}else if(Il in tt){var nt=tt[Il];return ds(nt,function(ot,g){var x=ot.constants.primTypes,T=ot.invoke(g,nt);return q.optional(function(){ot.assert(g,T+" in "+x,"invalid primitive, must be one of "+Object.keys(Ki))}),g.def(x,"[",T,"]")})}else if(Xe)return gl(Xe)?Xe.value?Ci(function(ot,g){return g.def(ot.ELEMENTS,".primType")}):Ci(function(){return Lf}):new Ha(Xe.thisDep,Xe.contextDep,Xe.propDep,function(ot,g){var x=ot.ELEMENTS;return g.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,T){return nt&&(x.OFFSET=ot),ot})}else if(be in tt){var g=tt[be];return ds(g,function(x,T){var G=x.invoke(T,g);return nt&&(x.OFFSET=G,q.optional(function(){x.assert(T,G+">=0","invalid "+be)})),G})}else if(nt&&Xe)return Ci(function(x,T){return x.OFFSET="0",0});return null}var Ee=Qe(Gp,!0);function Ue(){if(Fl in We){var be=We[Fl]|0;return q.command(typeof be=="number"&&be>=0,"invalid vertex count",de.commandStr),Ci(function(){return be})}else if(Fl in tt){var nt=tt[Fl];return ds(nt,function(x,T){var G=x.invoke(T,nt);return q.optional(function(){x.assert(T,"typeof "+G+'==="number"&&'+G+">=0&&"+G+"===("+G+"|0)","invalid vertex count")}),G})}else if(Xe)if(gl(Xe)){if(Xe)return Ee?new Ha(Ee.thisDep,Ee.contextDep,Ee.propDep,function(x,T){var G=T.def(x.ELEMENTS,".vertCount-",x.OFFSET);return q.optional(function(){x.assert(T,G+">=0","invalid vertex offset/element buffer too small")}),G}):Ci(function(x,T){return T.def(x.ELEMENTS,".vertCount")});var ot=Ci(function(){return-1});return q.optional(function(){ot.MISSING=!0}),ot}else{var g=new Ha(Xe.thisDep||Ee.thisDep,Xe.contextDep||Ee.contextDep,Xe.propDep||Ee.propDep,function(x,T){var G=x.ELEMENTS;return x.OFFSET?T.def(G,"?",G,".vertCount-",x.OFFSET,":-1"):T.def(G,"?",G,".vertCount:-1")});return q.optional(function(){g.DYNAMIC=!0}),g}return null}return{elements:Xe,primitive:Ge(),count:Ue(),instances:Qe(Qt,!1),offset:Ee}}function Pi(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Kt.forEach(function(Xe){var Ge=xn(Xe);function Qe(Ee,Ue){if(Xe in We){var be=Ee(We[Xe]);ct[Ge]=Ci(function(){return be})}else if(Xe in tt){var nt=tt[Xe];ct[Ge]=ds(nt,function(ot,g){return Ue(ot,g,ot.invoke(g,nt))})}}switch(Xe){case av:case md:case vd:case Nu:case ov:case aa:case Ll:case Vp:case Wp: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 Up: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 Tm: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 yd: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,Ws,Ge+".srcRGB",de.commandStr),q.commandParameter(be,Ws,Ge+".srcAlpha",de.commandStr),q.commandParameter(nt,Ws,Ge+".dstRGB",de.commandStr),q.commandParameter(ot,Ws,Ge+".dstAlpha",de.commandStr),q.command(su.indexOf(Ue+", "+nt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+Ue+", "+nt+")",de.commandStr),[Ws[Ue],Ws[nt],Ws[be],Ws[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(Ws))}),et}var g=ot("src","RGB"),x=ot("dst","RGB");q.optional(function(){var Oe=Ee.constants.invalidBlendCombinations;Ee.assert(Ue,Oe+".indexOf("+g+'+", "+'+x+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var T=Ue.def(nt,"[",g,"]"),G=Ue.def(nt,"[",ot("src","Alpha"),"]"),te=Ue.def(nt,"[",x,"]"),ce=Ue.def(nt,"[",ot("dst","Alpha"),"]");return[T,te,G,ce]});case $p: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(),g=Ue.def(),x=Ee.cond("typeof ",be,'==="string"');return q.optional(function(){function T(G,te,ce){Ee.assert(G,ce+" in "+nt,"invalid "+te+", must be one of "+Object.keys(St))}T(x.then,Xe,be),Ee.assert(x.else,be+"&&typeof "+be+'==="object"',"invalid "+Xe),T(x.else,Xe+".rgb",be+".rgb"),T(x.else,Xe+".alpha",be+".alpha")}),x.then(ot,"=",g,"=",nt,"[",be,"];"),x.else(ot,"=",nt,"[",be,".rgb];",g,"=",nt,"[",be,".alpha];"),Ue(x),[ot,g]});case gd:return Qe(function(Ee){return q.command(L(Ee)&&Ee.length===4,"blend.color must be a 4d array",de.commandStr),In(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")}),In(4,function(nt){return Ue.def("+",be,"[",nt,"]")})});case Rr:return Qe(function(Ee){return q.commandType(Ee,"number",Ge,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 bd:return Qe(function(Ee){q.commandType(Ee,"object",Ge,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 T(){Ee.assert(Ue,Array.prototype.join.call(arguments,""),"invalid stencil.func")}T(be+"&&typeof ",be,'==="object"'),T('!("cmp" in ',be,")||(",be,".cmp in ",nt,")")});var ot=Ue.def('"cmp" in ',be,"?",nt,"[",be,".cmp]",":",ju),g=Ue.def(be,".ref|0"),x=Ue.def('"mask" in ',be,"?",be,".mask|0:-1");return[ot,g,x]});case Of:case hl:return Qe(function(Ee){q.commandType(Ee,"object",Ge,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===hl?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(g){return q.optional(function(){Ee.assert(Ue,'!("'+g+'" in '+be+")||("+be+"."+g+" in "+nt+")","invalid "+Xe+"."+g+", must be one of "+Object.keys(Er))}),Ue.def('"',g,'" in ',be,"?",nt,"[",be,".",g,"]:",ju)}return[Xe===hl?wr:za,ot("fail"),ot("zfail"),ot("zpass")]});case xf:return Qe(function(Ee){q.commandType(Ee,"object",Ge,de.commandStr);var Ue=Ee.factor|0,be=Ee.units|0;return q.commandType(Ue,"number",Ge+".factor",de.commandStr),q.commandType(be,"number",Ge+".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 sv:return Qe(function(Ee){var Ue=0;return Ee==="front"?Ue=za:Ee==="back"&&(Ue=wr),q.command(!!Ue,Ge,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 _d: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 lv:return Qe(function(Ee){return q.commandParameter(Ee,xd,Ge,de.commandStr),xd[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"?'+Kp+":"+If)});case pl: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")}),In(4,function(nt){return"!!"+be+"["+nt+"]"})});case Cu:return Qe(function(Ee){q.command(typeof Ee=="object"&&Ee,Ge,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 Ge=We[Xe],Qe;if(typeof Ge=="number"||typeof Ge=="boolean")Qe=Ci(function(){return Ge});else if(typeof Ge=="function"){var Ee=Ge._reglType;Ee==="texture2d"||Ee==="textureCube"?Qe=Ci(function(Ue){return Ue.link(Ge)}):Ee==="framebuffer"||Ee==="framebufferCube"?(q.command(Ge.color.length>0,'missing color attachment for framebuffer sent to uniform "'+Xe+'"',de.commandStr),Qe=Ci(function(Ue){return Ue.link(Ge.color[0])})):q.commandRaise('invalid data for uniform "'+Xe+'"',de.commandStr)}else L(Ge)?Qe=Ci(function(Ue){var be=Ue.global.def("[",In(Ge.length,function(nt){return q.command(typeof Ge[nt]=="number"||typeof Ge[nt]=="boolean","invalid uniform "+Xe,Ue.commandStr),Ge[nt]}),"]");return be}):q.commandRaise('invalid or missing data for uniform "'+Xe+'"',de.commandStr);Qe.value=Ge,ct[Xe]=Qe}),Object.keys(tt).forEach(function(Xe){var Ge=tt[Xe];ct[Xe]=ds(Ge,function(Qe,Ee){return Qe.invoke(Ee,Ge)})}),ct}function jr(xe,de){var We=xe.static,tt=xe.dynamic,ct={};return Object.keys(We).forEach(function(Xe){var Ge=We[Xe],Qe=me.id(Xe),Ee=new lt;if(lu(Ge))Ee.state=gc,Ee.buffer=Dt.getBuffer(Dt.create(Ge,Bl,!1,!0)),Ee.type=0;else{var Ue=Dt.getBuffer(Ge);if(Ue)Ee.state=gc,Ee.buffer=Ue,Ee.type=0;else if(q.command(typeof Ge=="object"&&Ge,"invalid data for attribute "+Xe,de.commandStr),"constant"in Ge){var be=Ge.constant;Ee.buffer="null",Ee.state=yc,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(te,ce){ce<be.length&&(Ee[te]=be[ce])}))}else{lu(Ge.buffer)?Ue=Dt.getBuffer(Dt.create(Ge.buffer,Bl,!1,!0)):Ue=Dt.getBuffer(Ge.buffer),q.command(!!Ue,'missing buffer for attribute "'+Xe+'"',de.commandStr);var nt=Ge.offset|0;q.command(nt>=0,'invalid offset for attribute "'+Xe+'"',de.commandStr);var ot=Ge.stride|0;q.command(ot>=0&&ot<256,'invalid stride for attribute "'+Xe+'", must be integer betweeen [0, 255]',de.commandStr);var g=Ge.size|0;q.command(!("size"in Ge)||g>0&&g<=4,'invalid size for attribute "'+Xe+'", must be 1,2,3,4',de.commandStr);var x=!!Ge.normalized,T=0;"type"in Ge&&(q.commandParameter(Ge.type,$a,"invalid type for attribute "+Xe,de.commandStr),T=$a[Ge.type]);var G=Ge.divisor|0;"divisor"in Ge&&(q.command(G===0||sn,'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 te=de.commandStr,ce=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(Ge).forEach(function(Oe){q.command(ce.indexOf(Oe)>=0,'unknown parameter "'+Oe+'" for attribute pointer "'+Xe+'" (valid parameters are '+ce+")",te)})}),Ee.buffer=Ue,Ee.state=gc,Ee.size=g,Ee.normalized=x,Ee.type=T||Ue.dtype,Ee.offset=nt,Ee.stride=ot,Ee.divisor=G}}ct[Xe]=Ci(function(te,ce){var Oe=te.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=te.link(Ee.buffer),Fe.type=Fe.type||Fe.buffer+".dtype"),Oe[Qe]=Fe,Fe})}),Object.keys(tt).forEach(function(Xe){var Ge=tt[Xe];function Qe(Ee,Ue){var be=Ee.invoke(Ue,Ge),nt=Ee.shared,ot=Ee.constants,g=nt.isBufferArgs,x=nt.buffer;q.optional(function(){Ee.assert(Ue,be+"&&(typeof "+be+'==="object"||typeof '+be+'==="function")&&('+g+"("+be+")||"+x+".getBuffer("+be+")||"+x+".getBuffer("+be+".buffer)||"+g+"("+be+'.buffer)||("constant" in '+be+"&&(typeof "+be+'.constant==="number"||'+nt.isArrayLike+"("+be+".constant))))",'invalid dynamic attribute "'+Xe+'"')});var T={isStream:Ue.def(!1)},G=new lt;G.state=gc,Object.keys(G).forEach(function(Fe){T[Fe]=Ue.def(""+G[Fe])});var te=T.buffer,ce=T.type;Ue("if(",g,"(",be,")){",T.isStream,"=true;",te,"=",x,".createStream(",Bl,",",be,");",ce,"=",te,".dtype;","}else{",te,"=",x,".getBuffer(",be,");","if(",te,"){",ce,"=",te,".dtype;",'}else if("constant" in ',be,"){",T.state,"=",yc,";","if(typeof "+be+'.constant === "number"){',T[ou[0]],"=",be,".constant;",ou.slice(1).map(function(Fe){return T[Fe]}).join("="),"=0;","}else{",ou.map(function(Fe,et){return T[Fe]+"="+be+".constant.length>"+et+"?"+be+".constant["+et+"]:0;"}).join(""),"}}else{","if(",g,"(",be,".buffer)){",te,"=",x,".createStream(",Bl,",",be,".buffer);","}else{",te,"=",x,".getBuffer(",be,".buffer);","}",ce,'="type" in ',be,"?",ot.glTypes,"[",be,".type]:",te,".dtype;",T.normalized,"=!!",be,".normalized;");function Oe(Fe){Ue(T[Fe],"=",be,".",Fe,"|0;")}return Oe("size"),Oe("offset"),Oe("stride"),Oe("divisor"),Ue("}}"),Ue.exit("if(",T.isStream,"){",x,".destroyStream(",te,");","}"),T}ct[Xe]=ds(Ge,Qe)}),ct}function Gi(xe,de){var We=xe.static,tt=xe.dynamic;if(wc in We){var ct=We[wc];return ct!==null&&nn.getVAO(ct)===null&&(ct=nn.createVAO(ct)),Ci(function(Ge){return Ge.link(nn.getVAO(ct))})}else if(wc in tt){var Xe=tt[wc];return ds(Xe,function(Ge,Qe){var Ee=Ge.invoke(Qe,Xe);return Qe.def(Ge.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(Ge,Qe){return typeof Xe=="number"||typeof Xe=="boolean"?""+Xe:Ge.link(Xe)})}),Object.keys(We).forEach(function(ct){var Xe=We[ct];tt[ct]=ds(Xe,function(Ge,Qe){return Ge.invoke(Qe,Xe)})}),tt}function ki(xe,de,We,tt,ct){var Xe=xe.static,Ge=xe.dynamic;q.optional(function(){var Oe=[ts,Sf,Ra,Fi,Il,Gp,Fl,Qt,Pu,wc].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(Ge)});var Qe=Or(xe,de),Ee=Un(xe),Ue=$r(xe,Ee,ct),be=Qr(xe,ct),nt=Pi(xe,ct),ot=Fr(xe,ct,Qe);function g(Oe){var Fe=Ue[Oe];Fe&&(nt[Oe]=Fe)}g(Ti),g(xn(bc));var x=Object.keys(nt).length>0,T={framebuffer:Ee,draw:be,shader:ot,state:nt,dirty:x,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(T.profile=Dr(xe),T.uniforms=Si(We,ct),T.drawVAO=T.scopeVAO=Gi(xe),!T.drawVAO&&ot.program&&!Qe&&Ie.angle_instanced_arrays){var G=!0,te=ot.program.attributes.map(function(Oe){var Fe=de.static[Oe];return G=G&&!!Fe,Fe});if(G&&te.length>0){var ce=nn.getVAO(nn.createVAO(te));T.drawVAO=new Ha(null,null,null,function(Oe,Fe){return Oe.link(ce)}),T.useVAO=!0}}return Qe?T.useVAO=!0:T.attributes=jr(de,ct),T.context=Ko(tt),T}function $i(xe,de,We){var tt=xe.shared,ct=tt.context,Xe=xe.scope();Object.keys(We).forEach(function(Ge){de.save(ct,"."+Ge);var Qe=We[Ge],Ee=Qe.append(xe,de);Array.isArray(Ee)?Xe(ct,".",Ge,"=[",Ee.join(),"];"):Xe(ct,".",Ge,"=",Ee,";")}),de(Xe)}function Qi(xe,de,We,tt){var ct=xe.shared,Xe=ct.gl,Ge=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(Ge,".next"),tt||de("if(",nt,"!==",Ge,".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("}",Ge,".cur=",nt,";"),tt||de("}")}function sa(xe,de,We){var tt=xe.shared,ct=tt.gl,Xe=xe.current,Ge=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,g;if(nt in Ge){ot=Ge[nt],g=Xe[nt];var x=In(Xt[nt].length,function(G){return Ue.def(ot,"[",G,"]")});Ue(xe.cond(x.map(function(G,te){return G+"!=="+g+"["+te+"]"}).join("||")).then(ct,".",Yt[nt],"(",x,");",x.map(function(G,te){return g+"["+te+"]="+G}).join(";"),";"))}else{ot=Ue.def(Ee,".",nt);var T=xe.cond(ot,"!==",Qe,".",nt);Ue(T),nt in _n?T(xe.cond(ot).then(ct,".enable(",_n[nt],");").else(ct,".disable(",_n[nt],");"),Qe,".",nt,"=",ot,";"):T(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,Ge=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];gl(Ue)?be?de(Qe,".enable(",nt,");"):de(Qe,".disable(",nt,");"):de(xe.cond(be).then(Qe,".enable(",nt,");").else(Qe,".disable(",nt,");")),de(Ge,".",Ee,"=",be,";")}else if(L(be)){var ot=Xe[Ee];de(Qe,".",Yt[Ee],"(",be,");",be.map(function(g,x){return ot+"["+x+"]="+g}).join(";"),";")}else de(Qe,".",Yt[Ee],"(",be,");",Ge,".",Ee,"=",be,";")}})}function di(xe,de){sn&&(xe.instancing=de.def(xe.shared.extensions,".angle_instanced_arrays"))}function Cr(xe,de,We,tt,ct){var Xe=xe.shared,Ge=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 g(Oe){nt=de.def(),Oe(nt,"=",be(),";"),typeof ct=="string"?Oe(Ge,".count+=",ct,";"):Oe(Ge,".count++;"),rn&&(tt?(ot=de.def(),Oe(ot,"=",Ee,".getNumPendingQueries();")):Oe(Ee,".beginQuery(",Ge,");"))}function x(Oe){Oe(Ge,".cpuTime+=",be(),"-",nt,";"),rn&&(tt?Oe(Ee,".pushScopeStats(",ot,",",Ee,".getNumPendingQueries(),",Ge,");"):Oe(Ee,".endQuery();"))}function T(Oe){var Fe=de.def(Qe,".profile");de(Qe,".profile=",Oe,";"),de.exit(Qe,".profile=",Fe,";")}var G;if(Ue){if(gl(Ue)){Ue.enable?(g(de),x(de.exit),T("true")):T("false");return}G=Ue.append(xe,de),T(G)}else G=de.def(Qe,".profile");var te=xe.block();g(te),de("if(",G,"){",te,"}");var ce=xe.block();x(ce),de.exit("if(",G,"){",ce,"}")}function la(xe,de,We,tt,ct){var Xe=xe.shared;function Ge(Ee){switch(Ee){case Nf:case kf:case au:return 2;case Oc:case Rf:case ma:return 3;case Pf:case Df:case qp:return 4;default:return 1}}function Qe(Ee,Ue,be){var nt=Xe.gl,ot=de.def(Ee,".location"),g=de.def(Xe.attributes,"[",ot,"]"),x=be.state,T=be.buffer,G=[be.x,be.y,be.z,be.w],te=["buffer","normalized","offset","stride"];function ce(){de("if(!",g,".buffer){",nt,".enableVertexAttribArray(",ot,");}");var Fe=be.type,et;if(be.size?et=de.def(be.size,"||",Ue):et=Ue,de("if(",g,".type!==",Fe,"||",g,".size!==",et,"||",te.map(function(Vt){return g+"."+Vt+"!=="+be[Vt]}).join("||"),"){",nt,".bindBuffer(",Bl,",",T,".buffer);",nt,".vertexAttribPointer(",[ot,et,Fe,be.normalized,be.stride,be.offset],");",g,".type=",Fe,";",g,".size=",et,";",te.map(function(Vt){return g+"."+Vt+"="+be[Vt]+";"}).join(""),"}"),sn){var jt=be.divisor;de("if(",g,".divisor!==",jt,"){",xe.instancing,".vertexAttribDivisorANGLE(",[ot,jt],");",g,".divisor=",jt,";}")}}function Oe(){de("if(",g,".buffer){",nt,".disableVertexAttribArray(",ot,");",g,".buffer=null;","}if(",ou.map(function(Fe,et){return g+"."+Fe+"!=="+G[et]}).join("||"),"){",nt,".vertexAttrib4f(",ot,",",G,");",ou.map(function(Fe,et){return g+"."+Fe+"="+G[et]+";"}).join(""),"}")}x===gc?ce():x===yc?Oe():(de("if(",x,"===",gc,"){"),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(Gs))return;var ot=xe.scopeAttrib(Ue);q.optional(function(){xe.assert(de,ot+".state","missing attribute "+Ue)}),nt={},Object.keys(new lt).forEach(function(g){nt[g]=de.def(ot,".",g)})}Qe(xe.link(Ee),Ge(Ee.info.type),nt)})}function co(xe,de,We,tt,ct){for(var Xe=xe.shared,Ge=Xe.gl,Qe,Ee=0;Ee<tt.length;++Ee){var Ue=tt[Ee],be=Ue.name,nt=Ue.info.type,ot=We.uniforms[be],g=xe.link(Ue),x=g+".location",T;if(ot){if(!ct(ot))continue;if(gl(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 te=xe.link(G._texture||G.color[0]._texture);de(Ge,".uniform1i(",x,",",te+".bind());"),de.exit(te,".unbind();")}else if(nt===jf||nt===Ac||nt===Ed){q.optional(function(){q.command(L(G),"invalid matrix for uniform "+be,xe.commandStr),q.command(nt===jf&&G.length===4||nt===Ac&&G.length===9||nt===Ed&&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===Ac?Oe=3:nt===Ed&&(Oe=4),de(Ge,".uniformMatrix",Oe,"fv(",x,",false,",ce,");")}else{switch(nt){case gi: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 Oc:q.command(L(G)&&G.length===3,"uniform "+be,xe.commandStr),Qe="3f";break;case Pf:q.command(L(G)&&G.length===4,"uniform "+be,xe.commandStr),Qe="4f";break;case Sc:q.commandType(G,"boolean","uniform "+be,xe.commandStr),Qe="1i";break;case wd: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 kf:q.command(L(G)&&G.length===2,"uniform "+be,xe.commandStr),Qe="2i";break;case ma: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 qp: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(Ge,".uniform",Qe,"(",x,",",L(G)?Array.prototype.slice.call(G):G,");")}continue}else T=ot.append(xe,de)}else{if(!ct(Gs))continue;T=de.def(Xe.uniforms,"[",me.id(be),"]")}nt===wa?(q(!Array.isArray(T),"must specify a scalar prop for textures"),de("if(",T,"&&",T,'._reglType==="framebuffer"){',T,"=",T,".color[0];","}")):nt===xi&&(q(!Array.isArray(T),"must specify a scalar prop for cube maps"),de("if(",T,"&&",T,'._reglType==="framebufferCube"){',T,"=",T,".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(T),"must not specify an array type for uniform"),yn("typeof "+T+'==="'+an+'"',"invalid type, expected "+an)}function Qn(an,Tn){Array.isArray(T)?q(T.length===an,"must have length "+an):yn(Xe.isArrayLike+"("+T+")&&"+T+".length==="+an,"invalid vector, should have length "+an,xe.commandStr)}function Sr(an){q(!Array.isArray(T),"must not specify a value type"),yn("typeof "+T+'==="function"&&'+T+'._reglType==="texture'+(an===Xp?"2d":"Cube")+'"',"invalid texture type",xe.commandStr)}switch(nt){case wd:Yn("number");break;case kf:Qn(2);break;case Rf:Qn(3);break;case Df:Qn(4);break;case gi:Yn("number");break;case Nf:Qn(2);break;case Oc:Qn(3);break;case Pf:Qn(4);break;case Sc:Yn("boolean");break;case au:Qn(2);break;case ma:Qn(3);break;case qp:Qn(4);break;case jf:Qn(4);break;case Ac:Qn(9);break;case Ed:Qn(16);break;case wa:Sr(Xp);break;case xi:Sr(Cm);break}});var Fe=1;switch(nt){case wa:case xi:var et=de.def(T,"._texture");de(Ge,".uniform1i(",x,",",et,".bind());"),de.exit(et,".unbind();");continue;case wd:case Sc:Qe="1i";break;case kf:case au:Qe="2i",Fe=2;break;case Rf:case ma:Qe="3i",Fe=3;break;case Df:case qp:Qe="4i",Fe=4;break;case gi:Qe="1f";break;case Nf:Qe="2f",Fe=2;break;case Oc:Qe="3f",Fe=3;break;case Pf:Qe="4f",Fe=4;break;case jf:Qe="Matrix2fv";break;case Ac:Qe="Matrix3fv";break;case Ed:Qe="Matrix4fv";break}if(de(Ge,".uniform",Qe,"(",x,","),Qe.charAt(0)==="M"){var jt=Math.pow(nt-jf+2,2),Vt=xe.global.def("new Float32Array(",jt,")");Array.isArray(T)?de("false,(",In(jt,function(yn){return Vt+"["+yn+"]="+T[yn]}),",",Vt,")"):de("false,(Array.isArray(",T,")||",T," instanceof Float32Array)?",T,":(",In(jt,function(yn){return Vt+"["+yn+"]="+T+"["+yn+"]"}),",",Vt,")")}else Fe>1?de(In(Fe,function(yn){return Array.isArray(T)?T[yn]:T+"["+yn+"]"})):(q(!Array.isArray(T),"uniform value must not be an array"),de(T));de(");")}}function cr(xe,de,We,tt){var ct=xe.shared,Xe=ct.gl,Ge=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(Ge,".",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(Ge,".",Fl),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(Ge,".",et)}var ot=nt(Il),g=nt(Gp),x=Ue();if(typeof x=="number"){if(x===0)return}else We("if(",x,"){"),We.exit("}");var T,G;sn&&(T=nt(Qt),G=xe.instancing);var te=be+".type",ce=Qe.elements&&gl(Qe.elements);function Oe(){function et(){We(G,".drawElementsInstancedANGLE(",[ot,x,te,g+"<<(("+te+"-"+mc+")>>1)",T],");")}function jt(){We(G,".drawArraysInstancedANGLE(",[ot,g,x,T],");")}be?ce?et():(We("if(",be,"){"),et(),We("}else{"),jt(),We("}")):jt()}function Fe(){function et(){We(Xe+".drawElements("+[ot,x,te,g+"<<(("+te+"-"+mc+")>>1)"]+");")}function jt(){We(Xe+".drawArrays("+[ot,g,x]+");")}be?ce?et():(We("if(",be,"){"),et(),We("}else{"),jt(),We("}")):jt()}sn&&(typeof T!="number"||T>=0)?typeof T=="string"?(We("if(",T,">0){"),Oe(),We("}else if(",T,"<0){"),Fe(),We("}")):Oe():Fe()}function Xr(xe,de,We,tt,ct){var Xe=fr(),Ge=Xe.proc("body",ct);return q.optional(function(){Xe.commandStr=de.commandStr,Xe.command=Xe.link(de.commandStr)}),sn&&(Xe.instancing=Ge.def(Xe.shared.extensions,".angle_instanced_arrays")),xe(Xe,Ge,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);"),la(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),sa(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"),Ge=We.def(ct,"[",Xe,"]");We(xe.cond(Ge).then(Ge,".call(this,a0);").else(Ge,"=",ct,"[",Xe,"]=",xe.link(function(Qe){return Xr(Nr,xe,de,Qe,1)}),"(",tt,");",Ge,".call(this,a0);"))}Object.keys(de.state).length>0&&We(xe.shared.current,".dirty=true;")}function $l(xe,de,We,tt){xe.batchId="a1",di(xe,de);function ct(){return!0}la(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(),Ge="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,"=",Ge,"[",Xe,"];",be,"}",Ue.exit);function nt(te){return te.contextDep&&ct||te.propDep}function ot(te){return!nt(te)}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);"),la(xe,Ue,We,tt.attributes,ot),la(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 g=xe.global.def("{}"),x=We.shader.progVar.append(xe,be),T=be.def(x,".id"),G=be.def(g,"[",T,"]");be(xe.shared.gl,".useProgram(",x,".program);","if(!",G,"){",G,"=",g,"[",T,"]=",xe.link(function(te){return Xr($l,xe,We,te,2)}),"(",x,");}",G,".call(this,a0[",Xe,"],",Xe,");")}}function Te(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(g){tt=tt||de.context[g].propDep}),tt||($i(xe,We,de.context),ct=!1);var Xe=de.framebuffer,Ge=!1;Xe?(Xe.propDep?tt=Ge=!0:Xe.contextDep&&tt&&(Ge=!0),Ge||Qi(xe,We,Xe)):Qi(xe,We,null),de.state.viewport&&de.state.viewport.propDep&&(tt=!0);function Qe(g){return g.contextDep&&tt||g.propDep}sa(xe,We,de),zi(xe,We,de.state,function(g){return!Qe(g)}),(!de.profile||!Qe(de.profile))&&Cr(xe,We,de,!1,"a1"),de.contextDep=tt,de.needsContext=ct,de.needsFramebuffer=Ge;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(g){return Xr(yi,xe,de,g,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(Ge){var Qe=de.state[Ge],Ee=Qe.append(xe,We);L(Ee)?Ee.forEach(function(Ue,be){We.set(xe.next[Ge],"["+be+"]",Ue)}):We.set(tt.next,"."+Ge,Ee)}),Cr(xe,We,de,!0,!0),[Fi,Gp,Fl,Qt,Il].forEach(function(Ge){var Qe=de.draw[Ge];Qe&&We.set(tt.draw,"."+Ge,""+Qe.append(xe,We))}),Object.keys(de.uniforms).forEach(function(Ge){var Qe=de.uniforms[Ge].append(xe,We);Array.isArray(Qe)&&(Qe="["+Qe.join()+"]"),We.set(tt.uniforms,"["+me.id(Ge)+"]",Qe)}),Object.keys(de.attributes).forEach(function(Ge){var Qe=de.attributes[Ge].append(xe,We),Ee=xe.scopeAttrib(Ge);Object.keys(new lt).forEach(function(Ue){We.set(Ee,"."+Ue,Qe[Ue])})}),de.scopeVAO&&We.set(tt.vao,".targetVAO",de.scopeVAO.append(xe,We));function Xe(Ge){var Qe=de.shader[Ge];Qe&&We.set(tt.shader,"."+Ge,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),Ge=!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 g=ds(ot,null);Ge=Ge||g.thisDep,Ee=Ee||g.propDep,Qe=Qe||g.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(g){var x=tt[g];if(Tt.isDynamic(x)){var T=nt.invoke(ot,x);ot(Ue,".",g,"=",T,";")}})}de.dynamic[We]=new Tt.DynamicVariable(fl,{thisDep:Ge,contextDep:Qe,propDep:Ee,ref:Ue,append:be}),delete de.static[We]}function Gr(xe,de,We,tt,ct){var Xe=fr();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 Ge=ki(xe,de,We,tt,Xe);return fi(Xe,Ge),Et(Xe,Ge),Te(Xe,Ge),o(Xe.compile(),{destroy:function(){Ge.shader.program.destroy()}})}return{next:Pn,current:Xt,procs:(function(){var xe=fr(),de=xe.proc("poll"),We=xe.proc("refresh"),tt=xe.block();de(tt),We(tt);var ct=xe.shared,Xe=ct.gl,Ge=ct.next,Qe=ct.current;tt(Qe,".dirty=false;"),Qi(xe,de),Qi(xe,We,null,!0);var Ee;sn&&(Ee=xe.link(sn)),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(",Bl,",",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),sn&&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 g=_n[ot],x=tt.def(Ge,".",ot),T=xe.block();T("if(",x,"){",Xe,".enable(",g,")}else{",Xe,".disable(",g,")}",Qe,".",ot,"=",x,";"),We(T),de("if(",x,"!==",Qe,".",ot,"){",T,"}")}),Object.keys(Yt).forEach(function(ot){var g=Yt[ot],x=Xt[ot],T,G,te=xe.block();if(te(Xe,".",g,"("),L(x)){var ce=x.length;T=xe.global.def(Ge,".",ot),G=xe.global.def(Qe,".",ot),te(In(ce,function(Oe){return T+"["+Oe+"]"}),");",In(ce,function(Oe){return G+"["+Oe+"]="+T+"["+Oe+"];"}).join("")),de("if(",In(ce,function(Oe){return T+"["+Oe+"]!=="+G+"["+Oe+"]"}).join("||"),"){",te,"}")}else T=tt.def(Ge,".",ot),G=tt.def(Qe,".",ot),te(T,");",Qe,".",ot,"=",T,";"),de("if(",T,"!==",G,"){",te,"}");We(te)}),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 Tc=34918,Jr=34919,Im=35007,fs=function(K,me){if(!me.ext_disjoint_timer_query)return null;var Ie=[];function wt(){return Ie.pop()||me.ext_disjoint_timer_query.createQueryEXT()}function Dt(sn){Ie.push(sn)}var yt=[];function Nt(sn){var An=wt();me.ext_disjoint_timer_query.beginQueryEXT(Im,An),yt.push(An),rn(yt.length-1,yt.length,sn)}function tn(){me.ext_disjoint_timer_query.endQueryEXT(Im)}function ln(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var nn=[];function Mt(){return nn.pop()||new ln}function wn(sn){nn.push(sn)}var pn=[];function rn(sn,An,Xt){var Pn=Mt();Pn.startQueryIndex=sn,Pn.endQueryIndex=An,Pn.sum=0,Pn.stats=Xt,pn.push(Pn)}var Wt=[],lt=[];function St(){var sn,An,Xt=yt.length;if(Xt!==0){lt.length=Math.max(lt.length,Xt+1),Wt.length=Math.max(Wt.length,Xt+1),Wt[0]=0,lt[0]=0;var Pn=0;for(sn=0,An=0;An<yt.length;++An){var Kt=yt[An];me.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Jr)?(Pn+=me.ext_disjoint_timer_query.getQueryObjectEXT(Kt,Tc),Dt(Kt)):yt[sn++]=Kt,Wt[An+1]=Pn,lt[An+1]=sn}for(yt.length=sn,sn=0,An=0;An<pn.length;++An){var _n=pn[An],Yt=_n.startQueryIndex,xn=_n.endQueryIndex;_n.sum+=Wt[xn]-Wt[Yt];var ar=lt[Yt],xr=lt[xn];xr===ar?(_n.stats.gpuTime+=_n.sum/1e6,wn(_n)):(_n.startQueryIndex=ar,_n.endQueryIndex=xr,pn[sn++]=_n)}pn.length=sn}}return{beginQuery:Nt,endQuery:tn,pushScopeStats:rn,update:St,getNumPendingQueries:function(){return yt.length},clear:function(){Ie.push.apply(Ie,yt);for(var sn=0;sn<Ie.length;sn++)me.ext_disjoint_timer_query.deleteQueryEXT(Ie[sn]);yt.length=0,Ie.length=0},restore:function(){yt.length=0,Ie.length=0}}},Oi=16384,ns=256,mv=1024,Ea=34962,Ts="webglcontextlost",Cc="webglcontextrestored",Uf=1,Ni=2,Bi=3;function Jp(K,me){for(var Ie=0;Ie<K.length;++Ie)if(K[Ie]===me)return Ie;return-1}function gv(K){var me=ut(K);if(!me)return null;var Ie=me.gl,wt=Ie.getContextAttributes(),Dt=Ie.isContextLost(),yt=vn(Ie,me);if(!yt)return null;var Nt=ao(),tn=$f(),ln=yt.extensions,nn=fs(Ie,ln),Mt=Zn(),wn=Ie.drawingBufferWidth,pn=Ie.drawingBufferHeight,rn={tick:0,time:0,viewportWidth:wn,viewportHeight:pn,framebufferWidth:wn,framebufferHeight:pn,drawingBufferWidth:wn,drawingBufferHeight:pn,pixelRatio:me.pixelRatio},Wt={},lt={elements:null,primitive:4,count:-1,offset:0,instances:-1},St=_u(Ie,ln),sn=Es(Ie,tn,me,Xt),An=jp(Ie,ln,St,tn,sn);function Xt(cr){return An.destroyBuffer(cr)}var Pn=Gn(Ie,ln,sn,tn),Kt=Ip(Ie,Nt,tn,me),_n=so(Ie,ln,St,function(){ar.procs.poll()},rn,tn,me),Yt=pd(Ie,ln,St,tn,me),xn=Rp(Ie,ln,St,_n,Yt,tn),ar=by(Ie,Nt,ln,St,sn,Pn,_n,xn,Wt,An,Kt,lt,rn,nn,me),xr=Mm(Ie,xn,ar.procs.poll,rn,wt,ln,St),on=ar.next,Zt=Ie.canvas,Ht=[],fr=[],Dr=[],Un=[me.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 Pi(cr){cr.preventDefault(),Dt=!0,Qr(),fr.forEach(function(Xr){Xr()})}function Si(cr){Ie.getError(),Dt=!1,yt.restore(),Kt.restore(),sn.restore(),_n.restore(),Yt.restore(),xn.restore(),An.restore(),nn&&nn.restore(),ar.procs.refresh(),Fr(),Dr.forEach(function(Xr){Xr()})}Zt&&(Zt.addEventListener(Ts,Pi,!1),Zt.addEventListener(Cc,Si,!1));function jr(){Ht.length=0,Qr(),Zt&&(Zt.removeEventListener(Ts,Pi),Zt.removeEventListener(Cc,Si)),Kt.clear(),xn.clear(),Yt.clear(),_n.clear(),Pn.clear(),sn.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 Ge(Qe){if(Qe in Xe){var Ee=Xe[Qe];delete Xe[Qe],Object.keys(Ee).forEach(function(Ue){Xe[Qe+"."+Ue]=Ee[Ue]})}}return Ge("blend"),Ge("depth"),Ge("cull"),Ge("stencil"),Ge("polygonOffset"),Ge("scissor"),Ge("sample"),"vao"in ct&&(Xe.vao=ct.vao),Xe}function Nr(ct,Xe){var Ge={},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}}Ge[Ee]=Ue}),{dynamic:Qe,static:Ge}}var fi=Nr(cr.context||{},!0),$l=Nr(cr.uniforms||{},!0),yi=Nr(cr.attributes||{},!1),Te=Nr(Xr(cr),!1),Et={gpuTime:0,cpuTime:0,count:0},_t=ar.compile(Te,yi,$l,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 Ge;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(Ge=0;Ge<ct;++Ge)xe.call(this,null,Xe,Ge);else if(Array.isArray(ct))for(Ge=0;Ge<ct.length;++Ge)xe.call(this,ct[Ge],Xe,Ge);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 ki(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|=ns),"stencil"in Xr&&(Ie.clearStencil(Xr.stencil|0),Nr|=mv),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),ki);else Ko(cr,ki);else ki(null,cr)}function Qi(cr){q.type(cr,"function","regl.frame() callback must be a function"),Ht.push(cr);function Xr(){var Nr=Jp(Ht,cr);q(Nr>=0,"cannot cancel a frame twice");function fi(){var $l=Jp(Ht,fi);Ht[$l]=Ht[Ht.length-1],Ht.length-=1,Ht.length<=0&&Qr()}Ht[Nr]=fi}return Fr(),{cancel:Xr}}function sa(){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(),sa(),ar.procs.poll()}function di(){_n.refresh(),sa(),ar.procs.refresh(),nn&&nn.update()}function Cr(){return(Zn()-Mt)/1e3}di();function la(cr,Xr){q.type(Xr,"function","listener callback must be a function");var Nr;switch(cr){case"frame":return Qi(Xr);case"lost":Nr=fr;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 sn.create(cr,Ea,!1,!1)},elements:function(cr){return Pn.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:la,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 me.onDone(null,co),co}return gv}))})(lw)),lw.exports}kme();var ep,Uy,tp,Wu,Vy,uh,Wy,W0,Dd,Rv,Ps,jd,Ld,G0;ep={},Fn(ep,jn.POINTS,"points"),Fn(ep,jn.LINES,"lines"),Fn(ep,jn.LINE_LOOP,"line loop"),Fn(ep,jn.LINE_STRIP,"line strip"),Fn(ep,jn.TRIANGLES,"triangles"),Fn(ep,jn.TRIANGLE_FAN,"triangle fan"),Fn(ep,jn.TRIANGLE_STRIP,"triangle strip");Uy={},Fn(Uy,jn.STATIC_DRAW,"static"),Fn(Uy,jn.DYNAMIC_DRAW,"dynamic"),Fn(Uy,jn.STREAM_DRAW,"stream");tp={},Fn(tp,jn.BYTE,"int8"),Fn(tp,jn.UNSIGNED_INT,"int16"),Fn(tp,jn.INT,"int32"),Fn(tp,jn.UNSIGNED_BYTE,"uint8"),Fn(tp,jn.UNSIGNED_SHORT,"uint16"),Fn(tp,jn.UNSIGNED_INT,"uint32"),Fn(tp,jn.FLOAT,"float");Wu={},Fn(Wu,jn.ALPHA,"alpha"),Fn(Wu,jn.LUMINANCE,"luminance"),Fn(Wu,jn.LUMINANCE_ALPHA,"luminance alpha"),Fn(Wu,jn.RGB,"rgb"),Fn(Wu,jn.RGBA,"rgba"),Fn(Wu,jn.RGBA4,"rgba4"),Fn(Wu,jn.RGB5_A1,"rgb5 a1"),Fn(Wu,jn.RGB565,"rgb565"),Fn(Wu,jn.DEPTH_COMPONENT,"depth"),Fn(Wu,jn.DEPTH_STENCIL,"depth stencil");Vy={},Fn(Vy,jn.DONT_CARE,"dont care"),Fn(Vy,jn.NICEST,"nice"),Fn(Vy,jn.FASTEST,"fast");uh={},Fn(uh,jn.NEAREST,"nearest"),Fn(uh,jn.LINEAR,"linear"),Fn(uh,jn.LINEAR_MIPMAP_LINEAR,"mipmap"),Fn(uh,jn.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),Fn(uh,jn.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),Fn(uh,jn.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest");Wy={},Fn(Wy,jn.REPEAT,"repeat"),Fn(Wy,jn.CLAMP_TO_EDGE,"clamp"),Fn(Wy,jn.MIRRORED_REPEAT,"mirror");W0={},Fn(W0,jn.NONE,"none"),Fn(W0,jn.BROWSER_DEFAULT_WEBGL,"browser");Dd={},Fn(Dd,jn.NEVER,"never"),Fn(Dd,jn.ALWAYS,"always"),Fn(Dd,jn.LESS,"less"),Fn(Dd,jn.LEQUAL,"lequal"),Fn(Dd,jn.GREATER,"greater"),Fn(Dd,jn.GEQUAL,"gequal"),Fn(Dd,jn.EQUAL,"equal"),Fn(Dd,jn.NOTEQUAL,"notequal");Rv={},Fn(Rv,jn.FUNC_ADD,"add"),Fn(Rv,jn.MIN_EXT,"min"),Fn(Rv,jn.MAX_EXT,"max"),Fn(Rv,jn.FUNC_SUBTRACT,"subtract"),Fn(Rv,jn.FUNC_REVERSE_SUBTRACT,"reverse subtract");Ps={},Fn(Ps,jn.ZERO,"zero"),Fn(Ps,jn.ONE,"one"),Fn(Ps,jn.SRC_COLOR,"src color"),Fn(Ps,jn.ONE_MINUS_SRC_COLOR,"one minus src color"),Fn(Ps,jn.SRC_ALPHA,"src alpha"),Fn(Ps,jn.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),Fn(Ps,jn.DST_COLOR,"dst color"),Fn(Ps,jn.ONE_MINUS_DST_COLOR,"one minus dst color"),Fn(Ps,jn.DST_ALPHA,"dst alpha"),Fn(Ps,jn.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),Fn(Ps,jn.CONSTANT_COLOR,"constant color"),Fn(Ps,jn.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),Fn(Ps,jn.CONSTANT_ALPHA,"constant alpha"),Fn(Ps,jn.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),Fn(Ps,jn.SRC_ALPHA_SATURATE,"src alpha saturate");jd={},Fn(jd,jn.NEVER,"never"),Fn(jd,jn.ALWAYS,"always"),Fn(jd,jn.LESS,"less"),Fn(jd,jn.LEQUAL,"lequal"),Fn(jd,jn.GREATER,"greater"),Fn(jd,jn.GEQUAL,"gequal"),Fn(jd,jn.EQUAL,"equal"),Fn(jd,jn.NOTEQUAL,"notequal");Ld={},Fn(Ld,jn.ZERO,"zero"),Fn(Ld,jn.KEEP,"keep"),Fn(Ld,jn.REPLACE,"replace"),Fn(Ld,jn.INVERT,"invert"),Fn(Ld,jn.INCR,"increment"),Fn(Ld,jn.DECR,"decrement"),Fn(Ld,jn.INCR_WRAP,"increment wrap"),Fn(Ld,jn.DECR_WRAP,"decrement wrap");G0={},Fn(G0,jn.FRONT,"front"),Fn(G0,jn.BACK,"back");var aA,lj;function Rme(){if(lj)return aA;lj=1;function t(e,n){return function(o){return e(n(o))}}return aA=t,aA}var sA,uj;function Dme(){if(uj)return sA;uj=1;var t=Rme(),e=t(Object.getPrototypeOf,Object);return sA=e,sA}var lA,cj;function jme(){if(cj)return lA;cj=1;var t=F2(),e=Dme(),n=B2(),o="[object Object]",r=Function.prototype,i=Object.prototype,a=r.toString,l=i.hasOwnProperty,s=a.call(Object);function f(h){if(!n(h)||t(h)!=o)return!1;var v=e(h);if(v===null)return!0;var b=l.call(v,"constructor")&&v.constructor;return typeof b=="function"&&b instanceof b&&a.call(b)==s}return lA=f,lA}jme();class oT{constructor(){hs(this,"lf");hs(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()}}hs(oT,"pluginName","dagre");let Id=null;function dj(t,e){return t.x+=e,t.y+=e,t.text&&(t.text.x+=e,t.text.y+=e),t}function fj(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 dg=40;let z0=40;function p5(t,e){const{keyboard:n}=t,{options:{keyboard:o}}=n,r=()=>{var v,b;if(z0=dg,!(o!=null&&o.enabled)||e.textEditElement)return!0;const{guards:l}=t.options,s=e.getSelectElements(!1);if(!(l&&l.beforeClone?l.beforeClone(s):!0)||s.nodes.length===0&&s.edges.length===0)return Id=null,!0;const h=s.nodes.filter(w=>w.type===Pr.Start||w.type===Pr.Base);if(h.length>0){Xi(((b=(v=h[0])==null?void 0:v.properties)==null?void 0:b.stepName)+kt("views.applicationWorkflow.tip.cannotCopy"));return}return Id=Me.cloneDeep(s),Id.nodes.forEach(w=>dj(w,dg)),Id.edges.forEach(w=>fj(w,dg)),Oh(kt("views.applicationWorkflow.tip.copyError")),!1},i=()=>{if(!(o!=null&&o.enabled)||e.textEditElement)return!0;if(Id&&(Id.nodes||Id.edges)){t.clearSelectElements();const l=t.addElements(Id,z0);if(!l)return!0;l.nodes.forEach(s=>t.selectElementById(s.id,!0)),l.edges.forEach(s=>t.selectElementById(s.id,!0)),Id.nodes.forEach(s=>dj(s,dg)),Id.edges.forEach(s=>fj(s,dg)),z0=z0+dg}return!1},a=()=>{var f;const l=e.getSelectElements(!0);if(t.clearSelectElements(),l.nodes.length==0&&l.edges.length==0)return;if(l.edges.length>0&&l.nodes.length==0){l.edges.filter(h=>!["loop-edge"].includes(h.type||"")).forEach(h=>t.deleteEdge(h.id));return}const s=l.nodes.filter(h=>["start-node","base-node","loop-body-node","loop-start-node"].includes(h.type));if(s.length>0){Xi(`${(f=s[0].properties)==null?void 0:f.stepName}${kt("views.applicationWorkflow.delete.deleteMessage")}`);return}return L2(kt("common.tip"),kt("views.applicationWorkflow.delete.confirmTitle"),{confirmButtonText:kt("common.confirm"),confirmButtonClass:"danger"}).then(()=>{if(!(o!=null&&o.enabled)||e.textEditElement)return!0;l.edges.forEach(h=>t.deleteEdge(h.id)),l.nodes.forEach(h=>{h.type==="loop-node"&&t.getNodeOutgoingNode(h.id).forEach(b=>{b.type==="loop-body-node"&&t.deleteNode(b.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 Lme={class:"flex-between"},Ime={class:"flex align-center"},Fme={class:"ellipsis-1 break-all"},Bme={class:"title-decoration-1 mb-8 mt-8"},$me=["onMouseenter"],Ume={class:"break-all"},Vme={class:"dialog-footer"},Wme=_r({__name:"LoopBodyContainer",props:{nodeModel:{}},setup(t){O_("workflowMode",Qc.ApplicationLoop);const e=He(),n=He(!1),o=He({title:""}),r=hr({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=hr(()=>h.nodeModel.properties.status?h.nodeModel.properties.status:200),a=async O=>{O&&await O.validate(E=>{var S;E&&((S=h.nodeModel.graphModel.nodes)!=null&&S.some(M=>M.properties.stepName===o.value.title)?g7.error(kt("views.applicationWorkflow.tip.repeatedNodeError")):(Me.set(h.nodeModel.properties,"stepName",o.value.title),n.value=!1,O.resetFields()))})},l=()=>{h.nodeModel.graphModel.clearSelectElements(),Me.set(h.nodeModel,"isSelected",!0),Me.set(h.nodeModel,"isHovered",!0),h.nodeModel.graphModel.toFront(h.nodeModel.id)},s=He(null),f=He(600),h=t,v=hr(()=>{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}}}`})):[]}),b=He(!1);function w(){if(b.value=!b.value,b.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,E)=>{var V;const S=ne("AppIcon"),M=ne("el-button"),C=ne("el-alert"),$=ne("el-tooltip"),D=ne("el-collapse-transition"),k=ne("el-input"),B=ne("el-form-item"),F=ne("el-form"),I=ne("el-dialog");return Ne(),mn("div",{onMousedown:l,class:"workflow-node-container p-16",style:{overflow:"visible"}},[ee("div",{class:Gl(["step-container app-card p-16",{isSelected:h.nodeModel.isSelected,error:i.value!==200}]),style:{overflow:"visible",background:"#fff"}},[ee("div",null,[ee("div",Lme,[ee("div",Ime,[(Ne(),bt(fw(Wn(pw)(`${t.nodeModel.type}-icon`)),{class:"mr-8",size:24,item:(V=t.nodeModel)==null?void 0:V.properties.node_data},null,8,["item"])),ee("h4",Fme,_e(t.nodeModel.properties.stepName),1)]),P(M,{link:"",onClick:w},{default:j(()=>[P(S,{iconName:b.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1})]),P(D,null,{default:j(()=>[Js(ee("div",{onMousedown:E[1]||(E[1]=gn(()=>{},["stop"])),onKeydown:E[2]||(E[2]=gn(()=>{},["stop"])),onClick:E[3]||(E[3]=gn(()=>{},["stop"])),class:"mt-16"},[i.value!=200?(Ne(),bt(C,{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"])):Bn("",!0),ee("div",{style:Rj(`height:${f.value}px`)},[Dj(O.$slots,"default",{},void 0,!0)],4),v.value.length>0?(Ne(),mn(Ir,{key:1},[ee("h5",Bme,_e(O.$t("common.param.outputParam")),1),(Ne(!0),mn(Ir,null,No(v.value,(z,X)=>(Ne(),mn("div",{key:X,class:"flex-between border-r-4 p-8-12 mb-8 layout-bg lighter",onMouseenter:Y=>s.value=X,onMouseleave:E[0]||(E[0]=Y=>s.value=null)},[ee("span",Ume,_e(z.label)+" "+_e("{"+z.value+"}"),1),s.value===X?(Ne(),bt($,{key:0,effect:"dark",content:O.$t("views.applicationWorkflow.setting.copyParam"),placement:"top"},{default:j(()=>[P(M,{link:"",onClick:Y=>Wn(x_)(z.globeLabel),style:{padding:"0"}},{default:j(()=>[P(S,{iconName:"app-copy"})]),_:1},8,["onClick"])]),_:2},1032,["content"])):Bn("",!0)],40,$me))),128))],64)):Bn("",!0)],544),[[Eh,r.value]])]),_:3})])],2),P(I,{title:O.$t("views.applicationWorkflow.nodeName"),modelValue:n.value,"onUpdate:modelValue":E[8]||(E[8]=z=>n.value=z),"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":!0,"append-to-body":"",onSubmit:E[9]||(E[9]=gn(()=>{},["prevent"]))},{footer:j(()=>[ee("span",Vme,[P(M,{onClick:E[6]||(E[6]=gn(z=>n.value=!1,["prevent"]))},{default:j(()=>[ft(_e(O.$t("common.cancel")),1)]),_:1}),P(M,{type:"primary",onClick:E[7]||(E[7]=z=>a(e.value))},{default:j(()=>[ft(_e(O.$t("common.save")),1)]),_:1})])]),default:j(()=>[P(F,{"label-position":"top",ref_key:"titleFormRef",ref:e,model:o.value},{default:j(()=>[P(B,{prop:"title",rules:[{required:!0,message:O.$t("common.inputPlaceholder"),trigger:"blur"}]},{default:j(()=>[P(k,{modelValue:o.value.title,"onUpdate:modelValue":E[4]||(E[4]=z=>o.value.title=z),onBlur:E[5]||(E[5]=z=>o.value.title=o.value.title.trim())},null,8,["modelValue"])]),_:1},8,["rules"])]),_:1},8,["model"])]),_:1},8,["title","modelValue"])],32)}}}),Gme=kh(Wme,[["__scopeId","data-v-cdf21a30"]]),zme=[Pr.AiChat,Pr.Reply,Pr.ToolLib,Pr.ToolLibCustom,Pr.ImageUnderstandNode,Pr.Application,Pr.SpeechToTextNode,Pr.TextToSpeechNode,Pr.ImageGenerateNode,Pr.ImageToVideoGenerateNode,Pr.TextToVideoGenerateNode,Pr.ImageGenerateNode,Pr.LoopBodyNode,Pr.LoopNode,Pr.LoopBreakNode,Pr.VideoUnderstandNode,Pr.VariableAssignNode],Hme=[Pr.AiChat,Pr.Reply,Pr.ToolLib,Pr.ToolLibCustom,Pr.ImageUnderstandNode,Pr.VideoUnderstandNode,Pr.Application,Pr.SpeechToTextNode,Pr.TextToSpeechNode,Pr.ImageGenerateNode,Pr.ImageToVideoGenerateNode,Pr.TextToVideoGenerateNode,Pr.ImageGenerateNode,Pr.LoopBodyNode,Pr.LoopNode,Pr.LoopBreakNode,Pr.VariableAssignNode],pj={[Qc.Application]:zme,[Qc.ApplicationLoop]:Hme};class C2{constructor(e,n){hs(this,"nodes");hs(this,"edges");hs(this,"workFlowNodes");hs(this,"workflowModel");this.nodes=e.nodes,this.edges=e.edges,this.workFlowNodes=[],this.workflowModel=n||Qc.Application}is_valid_start_node(){const e=this.nodes.filter(n=>[Pr.Start,Pr.LoopStartNode].includes(n.id));if(e.length==0)throw kt("views.applicationWorkflow.validate.startNodeRequired");if(e.length>1)throw kt("views.applicationWorkflow.validate.startNodeOnly")}is_valid_base_node(){const e=this.nodes.filter(n=>n.id===Pr.Base);if(e.length==0)throw kt("views.applicationWorkflow.validate.baseNodeRequired");if(e.length>1)throw kt("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=>[Pr.Start,Pr.LoopStartNode].includes(n.id))[0]}get_base_node(){return this.nodes.filter(n=>n.id===Pr.Base)[0]}exist_break_node(){return this.nodes.some(e=>e.type===Pr.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!==Pr.Start&&n.id!==Pr.Base).filter(n=>!this.workFlowNodes.includes(n));if(e.length>0)throw`${kt("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=pj[this.workflowModel];if(o.length==0&&!r.includes(e.type))throw kt("views.applicationWorkflow.validate.noNextNode");return o}is_valid_nodes(){for(const e of this.nodes)if(e.type!==Pr.Base&&e.type!==Pr.Start&&e.type!==Pr.LoopStartNode&&!this.edges.some(n=>n.targetNodeId===e.id))throw`${kt("views.applicationWorkflow.validate.notInWorkFlowNode")}:${e.properties.stepName}`}is_valid_node(e){if(e.properties.status&&e.properties.status===500)throw`${e.properties.stepName} ${kt("views.applicationWorkflow.validate.nodeUnavailable")}`;if(e.type===Pr.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} ${kt("views.applicationWorkflow.validate.needConnect1")}${o.type}${kt("views.applicationWorkflow.validate.needConnect2")}`}}else{const n=this.edges.filter(r=>r.sourceNodeId==e.id),o=pj[this.workflowModel];if(n.length==0&&!o.includes(e.type))throw`${e.properties.stepName} ${kt("views.applicationWorkflow.validate.cannotEndNode")}`}if(e.properties.status&&e.properties.status!==200)throw`${e.properties.stepName} ${kt("views.applicationWorkflow.validate.nodeUnavailable")}`}}const Xme=_r({__name:"index",props:{nodeModel:{}},setup(t){const e=Object.assign({"/src/workflow/nodes/ai-chat-node/index.ts":r8,"/src/workflow/nodes/application-node/index.ts":o8,"/src/workflow/nodes/base-node/index.ts":_8,"/src/workflow/nodes/condition-node/index.ts":b8,"/src/workflow/nodes/document-extract-node/index.ts":w8,"/src/workflow/nodes/form-node/index.ts":E8,"/src/workflow/nodes/image-generate/index.ts":x8,"/src/workflow/nodes/image-to-video/index.ts":O8,"/src/workflow/nodes/image-understand/index.ts":S8,"/src/workflow/nodes/intent-classify-node/index.ts":A8,"/src/workflow/nodes/loop-body-node/index.ts":qj,"/src/workflow/nodes/loop-break-node/index.ts":M8,"/src/workflow/nodes/loop-continue-node/index.ts":T8,"/src/workflow/nodes/loop-node/index.ts":C8,"/src/workflow/nodes/loop-start-node/index.ts":N8,"/src/workflow/nodes/mcp-node/index.ts":P8,"/src/workflow/nodes/parameter-extraction-node/index.ts":k8,"/src/workflow/nodes/question-node/index.ts":R8,"/src/workflow/nodes/reply-node/index.ts":D8,"/src/workflow/nodes/reranker-node/index.ts":j8,"/src/workflow/nodes/search-document-node/index.ts":L8,"/src/workflow/nodes/search-knowledge-node/index.ts":I8,"/src/workflow/nodes/speech-to-text-node/index.ts":F8,"/src/workflow/nodes/start-node/index.ts":B8,"/src/workflow/nodes/text-to-speech-node/index.ts":$8,"/src/workflow/nodes/text-to-video/index.ts":U8,"/src/workflow/nodes/tool-lib-node/index.ts":V8,"/src/workflow/nodes/tool-node/index.ts":W8,"/src/workflow/nodes/variable-aggregation-node/index.ts":G8,"/src/workflow/nodes/variable-assign-node/index.ts":z8,"/src/workflow/nodes/variable-splitting/index.ts":H8,"/src/workflow/nodes/video-understand/index.ts":X8}),n=t,o=He(),r=()=>{const f=new C2(l.value.getGraphData(),Qc.ApplicationLoop);return Promise.all(l.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:kt("views.applicationWorkflow.validate.loopNodeBreakNodeRequired")}):Promise.resolve({})}catch(b){return Promise.reject({node:v,errMessage:b})}}).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=l.value.getGraphData()},a=f=>{const h=n.nodeModel.properties.loop_node_id,v=n.nodeModel.graphModel.getNodeModelById(h);v&&(v.properties.config.fields=f)},l=He(),s=f=>{const h=o.value;if(h){let v=function(b){let w=l.value.graphModel.transformModel.SCALE_X,O=l.value.graphModel.transformModel.SCALE_Y,E=l.value.graphModel.transformModel.TRANSLATE_X,S=l.value.graphModel.transformModel.TRANSLATE_Y;const[M,C]=b;return n.nodeModel.graphModel.transformModel,w*=n.nodeModel.graphModel.transformModel.SCALE_X,O*=n.nodeModel.graphModel.transformModel.SCALE_Y,E*=n.nodeModel.graphModel.transformModel.SCALE_X,S*=n.nodeModel.graphModel.transformModel.SCALE_Y,[(M-E)/w,(C-S)/O]};l.value=new e8({plugins:[oT],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}),l.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),l.value.graphModel.transformModel.HtmlPointToCanvasPoint=v.bind(l.value.graphModel.transformModel),p5(l.value,l.value.graphModel),l.value.graphModel.refresh_loop_fields=a,l.value.graphModel.get_parent_nodes=()=>n.nodeModel.graphModel.nodes,l.value.graphModel.get_up_node_field_list=n.nodeModel.get_up_node_field_list,l.value.batchRegister([...Object.keys(e).map(b=>e[b].default),Y8]),l.value.setDefaultEdgeType("app-edge"),l.value.render(f||{}),l.value.graphModel.eventCenter.on("delete_edge",b=>{b.forEach(w=>{l.value.deleteEdge(w)})}),l.value.graphModel.eventCenter.on("anchor:drop",b=>{b.nodeModel.clear_next_node_field(!1)}),l.value.graphModel.eventCenter.on("anchor:drop",b=>{b.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var b;(b=l.value)==null||b.fitView()},500)}};return bo(()=>{s(Me.cloneDeep(n.nodeModel.properties.workflow)),Me.set(n.nodeModel,"validate",r),Me.set(n.nodeModel,"set_loop_body",i)}),Ij(()=>{Bne(l.value.graphModel.flowId),l.value=null}),(f,h)=>(Ne(),bt(Gme,{nodeModel:t.nodeModel},{default:j(()=>[ee("div",{ref_key:"containerRef",ref:o,onWheel:h[0]||(h[0]=gn(()=>{},["stop"])),style:{height:"100%",width:"100%"}},null,544)]),_:1},8,["nodeModel"]))}});class Yme extends ai{constructor(e){super(e,Xme)}getNodeName(){return kt("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 qme extends si{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 Kme={type:"loop-body-node",model:qme,view:Yme};class Zme extends Ud.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 Jme={type:"loop-edge",view:Ud.BezierEdge,model:Zme},Qme=_r({__name:"NodeControl",props:{lf:Object||String||null},setup(t){const e=t,n=He(!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,b;(h=e.lf)==null||h.resetZoom(),(v=e.lf)==null||v.resetTranslate(),(b=e.lf)==null||b.fitView()}const a=()=>{var h;(h=e.lf)==null||h.extension.dagre.layout()},l=()=>{var h;(h=e.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!1})},s=()=>{var h;(h=e.lf)==null||h.graphModel.nodes.forEach(v=>{v.properties.showNode=!0})},f=h=>{var b,w,O;const v=document.querySelector(".lf-drag-able");n.value=h,h?(v.style.cursor="default",(b=e.lf)==null||b.openSelectionSelect(),(w=e.lf)==null||w.extension.selectionSelect.setSelectionSense(!0,!1)):(v.style.cursor="pointer",(O=e.lf)==null||O.closeSelectionSelect())};return(h,v)=>{const b=ne("Position"),w=ne("el-icon"),O=ne("el-button"),E=ne("AppIcon"),S=ne("el-divider"),M=ne("ZoomOut"),C=ne("el-tooltip"),$=ne("ZoomIn"),D=ne("el-card");return Ne(),bt(D,{shadow:"always",style:{"--el-card-padding":"8px 12px","--el-card-border-radius":"8px"}},{default:j(()=>[P(O,{onClick:v[0]||(v[0]=k=>f(!0)),style:{border:"none",padding:"4px",height:"24px"},class:Gl({"is-drag-active":n.value})},{default:j(()=>[P(w,{size:16},{default:j(()=>[P(b)]),_:1})]),_:1},8,["class"]),P(O,{onClick:v[1]||(v[1]=k=>f(!1)),style:{border:"none",padding:"4px",height:"24px","margin-left":"8px"},class:Gl({"is-drag-active":!n.value})},{default:j(()=>[P(E,{iconName:"app-raisehand",size:16})]),_:1},8,["class"]),P(S,{direction:"vertical"}),P(O,{link:"",onClick:r,style:{border:"none"}},{default:j(()=>[P(C,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomOut"),placement:"top"},{default:j(()=>[P(w,{size:16,title:h.$t("views.applicationWorkflow.control.zoomOut")},{default:j(()=>[P(M)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),P(O,{link:"",onClick:o,style:{border:"none"}},{default:j(()=>[P(C,{effect:"dark",content:h.$t("views.applicationWorkflow.control.zoomIn"),placement:"top"},{default:j(()=>[P(w,{size:16,title:h.$t("views.applicationWorkflow.control.zoomIn")},{default:j(()=>[P($)]),_:1},8,["title"])]),_:1},8,["content"])]),_:1}),P(O,{link:"",onClick:i,style:{border:"none"}},{default:j(()=>[P(C,{effect:"dark",content:h.$t("views.applicationWorkflow.control.fitView"),placement:"top"},{default:j(()=>[P(E,{iconName:"app-fitview",title:h.$t("views.applicationWorkflow.control.fitView")},null,8,["title"])]),_:1},8,["content"])]),_:1}),P(S,{direction:"vertical"}),P(O,{link:"",onClick:l,style:{border:"none"}},{default:j(()=>[P(C,{effect:"dark",content:h.$t("views.applicationWorkflow.control.retract"),placement:"top"},{default:j(()=>[P(E,{style:{"font-size":"16px"},iconName:"app-retract",title:h.$t("views.applicationWorkflow.control.retract")},null,8,["title"])]),_:1},8,["content"])]),_:1}),P(O,{link:"",onClick:s,style:{border:"none"}},{default:j(()=>[P(C,{effect:"dark",content:h.$t("views.applicationWorkflow.control.extend"),placement:"top"},{default:j(()=>[P(E,{style:{"font-size":"16px"},iconName:"app-extend",title:h.$t("views.applicationWorkflow.control.extend")},null,8,["title"])]),_:1},8,["content"])]),_:1}),P(O,{link:"",onClick:a,style:{border:"none"}},{default:j(()=>[P(C,{effect:"dark",content:h.$t("views.applicationWorkflow.control.beautify"),placement:"top"},{default:j(()=>[P(E,{style:{"font-size":"16px"},iconName:"app-beautify",title:h.$t("views.applicationWorkflow.control.beautify")},null,8,["title"])]),_:1},8,["content"])]),_:1})]),_:1})}}}),ege=kh(Qme,[["__scopeId","data-v-510558f4"]]),tge=_r({name:"WorkFlow"}),nge=_r({...tge,props:{data:Object||null},setup(t,{expose:e}){const n=Object.assign({"./nodes/ai-chat-node/index.ts":r8,"./nodes/application-node/index.ts":o8,"./nodes/base-node/index.ts":_8,"./nodes/condition-node/index.ts":b8,"./nodes/document-extract-node/index.ts":w8,"./nodes/form-node/index.ts":E8,"./nodes/image-generate/index.ts":x8,"./nodes/image-to-video/index.ts":O8,"./nodes/image-understand/index.ts":S8,"./nodes/intent-classify-node/index.ts":A8,"./nodes/loop-body-node/index.ts":qj,"./nodes/loop-break-node/index.ts":M8,"./nodes/loop-continue-node/index.ts":T8,"./nodes/loop-node/index.ts":C8,"./nodes/loop-start-node/index.ts":N8,"./nodes/mcp-node/index.ts":P8,"./nodes/parameter-extraction-node/index.ts":k8,"./nodes/question-node/index.ts":R8,"./nodes/reply-node/index.ts":D8,"./nodes/reranker-node/index.ts":j8,"./nodes/search-document-node/index.ts":L8,"./nodes/search-knowledge-node/index.ts":I8,"./nodes/speech-to-text-node/index.ts":F8,"./nodes/start-node/index.ts":B8,"./nodes/text-to-speech-node/index.ts":$8,"./nodes/text-to-video/index.ts":U8,"./nodes/tool-lib-node/index.ts":V8,"./nodes/tool-node/index.ts":W8,"./nodes/variable-aggregation-node/index.ts":G8,"./nodes/variable-assign-node/index.ts":z8,"./nodes/variable-splitting/index.ts":H8,"./nodes/video-understand/index.ts":X8}),o=Une(),r=He(""),i=He();bo(()=>{l()}),Ij(()=>{$ne()});const a=w=>{i.value.render(w)},l=w=>{const O=document.querySelector("#container");O&&(i.value=new e8({plugins:[oT,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:O}),i.value.setTheme({bezier:{stroke:"#afafaf",strokeWidth:1}}),i.value.on("graph:rendered",()=>{r.value=i.value.graphModel.flowId}),p5(i.value,i.value.graphModel),i.value.batchRegister([...Object.keys(n).map(E=>n[E].default),Y8,Jme]),i.value.setDefaultEdgeType("app-edge"),i.value.render(w||{}),i.value.graphModel.eventCenter.on("delete_edge",E=>{E.forEach(S=>{i.value.deleteEdge(S)})}),i.value.graphModel.eventCenter.on("anchor:drop",E=>{E.nodeModel.clear_next_node_field(!1)}),setTimeout(()=>{var E;(E=i.value)==null||E.fitView()},500))};return e({onmousedown:w=>{w.type&&i.value.dnd.startDrag({type:w.type,properties:{...w.properties}}),w.callback&&w.callback(i.value)},validate:()=>Promise.all(i.value.graphModel.nodes.map(w=>{var O;return(O=w==null?void 0:w.validate)==null?void 0:O.call(w)})),getGraphData:()=>{const w=i.value.getGraphData();w.nodes.forEach(E=>{E.type==="loop-body-node"&&i.value.getNodeModelById(E.id).set_loop_body()});const O=i.value.getGraphData();return O.nodes=O.nodes.filter(E=>E.type!=="loop-body-node"),O.edges=w.edges.filter(E=>E.type!=="loop-edge"),O},addNode:w=>{i.value.clearSelectElements();const{virtualRectCenterPositionX:O,virtualRectCenterPositionY:E}=i.value.graphModel.getVirtualRectSize(),S=i.value.graphModel.addNode({type:w.type,properties:w.properties,x:O,y:E-i.value.graphModel.height/2});S.isSelected=!0,S.isHovered=!0,i.value.toFront(S.id)},clearGraphData:()=>i.value.clearData(),renderGraphData:l,render:a}),(w,O)=>(Ne(),mn(Ir,null,[O[0]||(O[0]=ee("div",{className:"workflow-app",id:"container"},null,-1)),i.value?(Ne(),bt(ege,{key:0,class:"workflow-control",lf:i.value},null,8,["lf"])):Bn("",!0),P(Wn(o),{"flow-id":r.value},null,8,["flow-id"])],64))}}),rge={class:"workflow-publish-history border-l white-bg"},oge={class:"border-b p-16-24"},ige={class:"list-height pt-0"},age={class:"p-8 pt-0"},sge={class:"flex-between"},lge={style:{"max-width":"80%"}},uge={class:"text-center"},cge=_r({__name:"PublishHistory",emits:["click","refreshVersion"],setup(t,{emit:e}){const n=ja(),{params:{id:o}}=n,r=hr(()=>n.path.includes("resource-management")?"systemManage":"workspace"),i=e,a=He(!1),l=He([]),s=He("");function f(S){s.value=S.id}function h(S){i("click",S)}function v(S){i("refreshVersion",S)}function b(S){S.writeStatus=!0}function w(S){S.writeStatus=!1}function O(S,M){if(S){const C={name:S};oi({type:"workflowVersion",systemType:r.value}).putWorkFlowVersion(o,M.id,C,a).then(()=>{Oh(kt("common.modifySuccess")),M.writeStatus=!1,E()})}else Xi(kt("views.applicationWorkflow.tip.nameMessage"))}function E(){oi({type:"workflowVersion",systemType:r.value}).getWorkFlowVersion(o,a).then(S=>{l.value=S.data})}return bo(()=>{E()}),(S,M)=>{const C=ne("ReadWrite"),$=ne("el-tag"),D=ne("UserFilled"),k=ne("el-icon"),B=ne("el-avatar"),F=ne("el-text"),I=ne("AppIcon"),V=ne("el-button"),z=ne("el-dropdown-item"),X=ne("RefreshLeft"),Y=ne("el-dropdown-menu"),W=ne("el-dropdown"),Q=ne("common-list"),J=ne("el-scrollbar"),ie=Rg("loading");return Ne(),mn("div",rge,[ee("h4",oge,_e(S.$t("views.applicationWorkflow.setting.releaseHistory")),1),ee("div",ige,[P(J,null,{default:j(()=>[ee("div",age,[Js((Ne(),bt(Q,{data:l.value,class:"mt-8",onClick:h,onMouseenter:f,onMouseleave:M[1]||(M[1]=Se=>s.value="")},{default:j(({row:Se,index:Ae})=>[ee("div",sge,[ee("div",lge,[ee("h5",{class:Gl([Ae===0?"primary":"","flex align-center"])},[P(C,{onChange:ke=>O(ke,Se),data:Se.name||Wn(dA)(Se.update_time),trigger:"manual",write:Se.writeStatus,onClose:ke=>w(Se)},null,8,["onChange","data","write","onClose"]),Ae===0?(Ne(),bt($,{key:0,class:"default-tag ml-4"},{default:j(()=>[ft(_e(S.$t("views.applicationWorkflow.setting.latestRelease")),1)]),_:1})):Bn("",!0)],2),P(F,{type:"info",class:"color-secondary flex align-center mt-8"},{default:j(()=>[P(B,{size:20,class:"avatar-grey mr-4"},{default:j(()=>[P(k,null,{default:j(()=>[P(D)]),_:1})]),_:1}),ft(" "+_e(Se.publish_user_name),1)]),_:2},1024)]),Js(ee("div",{onClick:M[0]||(M[0]=gn(()=>{},["stop"]))},[P(W,{trigger:"click",teleported:!1},{dropdown:j(()=>[P(Y,null,{default:j(()=>[P(z,{onClick:gn(ke=>b(Se),["stop"])},{default:j(()=>[P(I,{iconName:"app-edit",class:"color-secondary"}),ft(" "+_e(S.$t("common.edit")),1)]),_:1},8,["onClick"]),P(z,{onClick:ke=>v(Se)},{default:j(()=>[P(k,{class:"color-secondary"},{default:j(()=>[P(X)]),_:1}),ft(" "+_e(S.$t("views.applicationWorkflow.setting.restoreCurrentVersion")),1)]),_:1},8,["onClick"])]),_:2},1024)]),default:j(()=>[P(V,{text:""},{default:j(()=>[P(I,{iconName:"app-more"})]),_:1})]),_:2},1024)],512),[[Eh,s.value===Se.id]])])]),empty:j(()=>[ee("div",uge,[P(F,{type:"info"},{default:j(()=>[ft(_e(S.$t("chat.noHistory")),1)]),_:1})])]),_:1},8,["data"])),[[ie,a.value]])])]),_:1})])])}}}),dge=kh(cge,[["__scopeId","data-v-85be1165"]]),fge={class:"application-workflow"},pge={class:"header border-b flex-between p-12-24 white-bg"},hge={class:"flex align-center"},vge=["title"],mge={key:0},gge={key:0},yge={key:1},_ge=["href"],bge={class:"ml-4"},wge={class:"flex-between"},Ege={class:"flex align-center"},xge={class:"mr-12 ml-24 flex"},Oge=["src"],Sge=["title"],Age={class:"mr-16"},Mge={class:"scrollbar-height"},Xge=_r({__name:"index",setup(t){O_("getApplicationDetail",()=>w),O_("workflowMode",Qc.Application);const{theme:e}=Pj(),n=y7(),o=ja(),{params:{id:r,from:i}}=o,a=hr(()=>o.path.includes("resource-management")?"systemManage":"workspace"),l=hr(()=>kj.application[a.value]),s=hr(()=>e.isDefaultTheme());let f;const h=He(),v=He(),b=He(!1),w=He(null),O=He(!1),E=He(!1),S=He(!1),M=He(""),C=He(!1),$=He(!1),D=He(!1),k=He({}),B=He(null),F=He([]),I=hr(()=>UN(F.value)?"?"+UN(F.value):""),V=hr(()=>{var $e;return`${window.location.origin}/chat/`+(($e=w.value)==null?void 0:$e.access_token)+I.value});function z(){JSON.stringify(B.value)!==JSON.stringify(Be())?L2(kt("common.tip"),kt("views.applicationWorkflow.tip.saveMessage"),{confirmButtonText:kt("views.applicationWorkflow.setting.exitSave"),cancelButtonText:kt("views.applicationWorkflow.setting.exit"),distinguishCancelAndClose:!0}).then(()=>{gt(!0,!0)}).catch($e=>{$e==="cancel"&&se()}):se()}function X(){D.value||($.value=!1,D.value=!1)}function Y($e){$e&&Q($e),$.value=!1,D.value=!1}function W($e){D.value=!0,k.value=$e,Q($e),we()}function Q($e){var rt;$e.work_flow.nodes.map(pt=>{pt.properties.noRender=!0}),w.value.work_flow=$e.work_flow,M.value=$e==null?void 0:$e.update_time,(rt=h.value)==null||rt.clearGraphData(),xh(()=>{var pt;(pt=h.value)==null||pt.render($e.work_flow)})}function J(){Je(),C.value&&le(),$.value=!1,D.value=!1}function ie(){$.value=!0}function Se($e){$e?le():we(),localStorage.setItem("workflowAutoSave",$e.toString())}function Ae($e){O.value=!1}function ke($e){O.value=!1}function De(){O.value=!1}const ze=()=>{var $e;($e=h.value)==null||$e.validate().then(()=>{const rt=Be(),pt=new C2(rt);try{pt.is_valid()}catch(Lt){Xi(Lt.toString());return}oi({type:"application",systemType:a.value}).putApplication(r,{work_flow:rt},b).then(()=>oi({type:"application",systemType:a.value}).publish(r,{},b)).then(Lt=>{var Jt,en;w.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=>{F.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})):[]}),Oh(kt("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)+` ${kt("views.applicationWorkflow.node").toLowerCase()} `+en.toLowerCase());else{const je=Object.keys(en);Xi(((it=Jt.properties)==null?void 0:it.stepName)+` ${kt("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)+` ${kt("views.applicationWorkflow.node")}`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${kt("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 C2(rt);try{pt.is_valid(),w.value={...w.value,type:"WORK_FLOW",...(Lt=pt.get_base_node())==null?void 0:Lt.properties.node_data,work_flow:Be()},E.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)+` ${kt("views.applicationWorkflow.node")}`+Lt);else{const ae=Object.keys(Lt);Xi(((en=pt.properties)==null?void 0:en.stepName)+` ${kt("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}),w.value=$e.data,w.value.stt_model_id=$e.data.stt_model,w.value.tts_model_id=$e.data.tts_model,w.value.tts_type=$e.data.tts_type,M.value=(pt=$e.data)==null?void 0:pt.update_time,(Jt=(Lt=w.value.work_flow)==null?void 0:Lt.nodes)==null||Jt.filter(zt=>zt.id==="base-node").map(zt=>{F.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,b).then(zt=>{w.value={...w.value,...zt.data}}),(en=h.value)==null||en.clearGraphData(),xh(()=>{var zt;(zt=h.value)==null||zt.render(w.value.work_flow),B.value=Be()}),Qf([Vl.IS_EE,Vl.IS_PE],"OR")&&oi({type:"application",systemType:a.value}).getApplicationSetting(r).then(zt=>{w.value={...w.value,...zt.data}})})}function gt($e,rt){const pt={work_flow:Be()};b.value=rt||!1,oi({type:"application",systemType:a.value}).putApplication(r,pt).then(()=>{M.value=new Date,$e&&(B.value=Be(),Oh(kt("common.saveSuccess")),rt&&se())}).catch(()=>{b.value=!1})}const se=()=>o.path.includes("workspace")?n.push({path:pe()}):n.push({path:Ze()}),Ze=()=>Qf([Ic.ADMIN,Xs.RESOURCE_APPLICATION_OVERVIEW_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([Ic.ADMIN,Xs.RESOURCE_APPLICATION_ACCESS_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([Ic.ADMIN,Xs.RESOURCE_APPLICATION_CHAT_USER_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([Ic.ADMIN,Xs.RESOURCE_APPLICATION_CHAT_LOG_READ],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/system/resource-management/application",pe=()=>Qf([new lh([Ic.USER],[Xs.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Ic.WORKSPACE_MANAGE.getWorkspaceRole,Xs.APPLICATION_OVERVIEW_READ.getWorkspacePermissionWorkspaceManageRole,Xs.APPLICATION_OVERVIEW_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/overview`:Qf([new lh([Ic.USER],[Xs.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vl.IS_EE,Vl.IS_PE],"AND"),new lh([Ic.WORKSPACE_MANAGE.getWorkspaceRole],[Xs.APPLICATION_ACCESS_READ.getWorkspacePermissionWorkspaceManageRole],[Vl.IS_EE,Vl.IS_PE],"OR"),new lh([],[Xs.APPLICATION_ACCESS_READ.getApplicationWorkspaceResourcePermission(r)],[Vl.IS_EE,Vl.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/access`:Qf([new lh([Ic.USER],[Xs.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[Vl.IS_EE,Vl.IS_PE],"AND"),new lh([Ic.WORKSPACE_MANAGE.getWorkspaceRole],[Xs.APPLICATION_CHAT_USER_READ.getWorkspacePermissionWorkspaceManageRole],[Vl.IS_EE,Vl.IS_PE],"OR"),new lh([],[Xs.APPLICATION_CHAT_USER_READ.getApplicationWorkspaceResourcePermission(r)],[Vl.IS_EE,Vl.IS_PE],"OR")],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-user`:Qf([new lh([Ic.USER],[Xs.APPLICATION.getApplicationWorkspaceResourcePermission(r)],[],"AND"),Xs.APPLICATION_CHAT_LOG_READ.getWorkspacePermissionWorkspaceManageRole,Xs.APPLICATION_CHAT_LOG_READ.getApplicationWorkspaceResourcePermission(r)],"OR")?`/application/${i}/${r}/WORK_FLOW/chat-log`:"/application",le=()=>{f=setInterval(()=>{gt()},6e4)},we=()=>{f&&clearInterval(f)};return bo(()=>{Je();const $e=localStorage.getItem("workflowAutoSave");C.value=$e==="true",C.value&&le()}),_7(()=>{var $e;we(),($e=h.value)==null||$e.clearGraphData()}),($e,rt)=>{var Pe,Ke,Le;const pt=ne("back-button"),Lt=ne("el-text"),Jt=ne("el-button"),en=ne("el-divider"),zt=ne("Close"),it=ne("el-icon"),ae=ne("AppIcon"),re=ne("el-dropdown-item"),je=ne("el-switch"),vt=ne("el-dropdown-menu"),q=ne("el-dropdown"),Pt=ne("el-collapse-transition"),Rt=ne("el-avatar"),Gt=ne("LogoIcon"),kn=ne("AiChat"),qt=Rg("click-outside"),On=Rg("loading");return Js((Ne(),mn("div",fge,[ee("div",pge,[ee("div",hge,[P(pt,{onClick:z}),ee("h4",{class:"ellipsis",style:{"max-width":"300px"},title:(Pe=w.value)==null?void 0:Pe.name},_e((Ke=w.value)==null?void 0:Ke.name),9,vge),$.value&&D.value?(Ne(),mn("div",mge,[P(Lt,{type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.previewVersion"))+" "+_e(k.value.name||Wn(dA)(k.value.update_time)),1)]),_:1})])):M.value?(Ne(),bt(Lt,{key:1,type:"info",class:"ml-16 color-secondary"},{default:j(()=>[ft(_e($e.$t("views.applicationWorkflow.info.saveTime"))+_e(Wn(dA)(M.value)),1)]),_:1})):Bn("",!0)]),$.value&&D.value?(Ne(),mn("div",gge,[P(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}),P(en,{direction:"vertical"}),P(Jt,{text:"",onClick:J},{default:j(()=>[P(it,null,{default:j(()=>[P(zt)]),_:1})]),_:1})])):(Ne(),mn("div",yge,[P(Jt,{onClick:rt[1]||(rt[1]=dt=>O.value=!O.value)},{default:j(()=>[P(ae,{iconName:"app-add-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.addComponent")),1)]),_:1}),l.value.debug(Wn(r))?(Ne(),bt(Jt,{key:0,onClick:Ye,disabled:E.value},{default:j(()=>[P(ae,{iconName:"app-debug-outlined",class:"mr-4"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.debug")),1)]),_:1},8,["disabled"])):Bn("",!0),l.value.edit(Wn(r))?(Ne(),bt(Jt,{key:1,onClick:rt[2]||(rt[2]=dt=>gt(!0))},{default:j(()=>[P(ae,{iconName:"app-save-outlined",class:"mr-4"}),ft(" "+_e($e.$t("common.save")),1)]),_:1})):Bn("",!0),l.value.edit(Wn(r))?(Ne(),bt(Jt,{key:2,type:"primary",onClick:ze},{default:j(()=>[ft(_e($e.$t("views.application.operation.publish")),1)]),_:1})):Bn("",!0),P(q,{trigger:"click"},{dropdown:j(()=>[P(vt,null,{default:j(()=>[ee("a",{href:V.value,target:"_blank"},[P(re,null,{default:j(()=>[P(ae,{iconName:"app-create-chat",class:"color-secondary"}),ft(" "+_e($e.$t("views.application.operation.toChat")),1)]),_:1})],8,_ge),P(re,{onClick:ie},{default:j(()=>[P(ae,{iconName:"app-history-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.releaseHistory")),1)]),_:1}),P(re,null,{default:j(()=>[P(ae,{iconName:"app-save-outlined",class:"color-secondary"}),ft(" "+_e($e.$t("views.applicationWorkflow.setting.autoSave"))+" ",1),ee("div",bge,[P(je,{size:"small",modelValue:C.value,"onUpdate:modelValue":rt[4]||(rt[4]=dt=>C.value=dt),onChange:Se},null,8,["modelValue"])])]),_:1})]),_:1})]),default:j(()=>[P(Jt,{text:"",onClick:rt[3]||(rt[3]=gn(()=>{},["stop"])),class:"ml-8 mt-4"},{default:j(()=>[P(ae,{iconName:"app-more",class:"rotate-90"})]),_:1})]),_:1})]))]),P(Pt,null,{default:j(()=>[Js(P(gI,{show:O.value,id:Wn(r),onClickNodes:Ae,onOnmousedown:ke,workflowRef:h.value},null,8,["show","id","workflowRef"]),[[qt,De]])]),_:1}),ee("div",{class:"workflow-main",ref_key:"workflowMainRef",ref:v},[w.value?(Ne(),bt(nge,{key:0,ref_key:"workflowRef",ref:h,data:(Le=w.value)==null?void 0:Le.work_flow},null,8,["data"])):Bn("",!0)],512),P(Pt,null,{default:j(()=>{var dt,At,Tt;return[E.value?(Ne(),mn("div",{key:0,class:Gl(["workflow-debug-container",S.value?"enlarge":""])},[ee("div",{class:Gl(["workflow-debug-header",s.value?"":"custom-header"])},[ee("div",wge,[ee("div",Ege,[ee("div",xge,[Wn(cA)((dt=w.value)==null?void 0:dt.icon)?(Ne(),bt(Rt,{key:0,shape:"square",size:32,style:{background:"none"}},{default:j(()=>{var En;return[ee("img",{src:Wn(mh)((En=w.value)==null?void 0:En.icon),alt:""},null,8,Oge)]}),_:1})):(Ne(),bt(Gt,{key:1,height:"32px"}))]),ee("h4",{class:"ellipsis",style:{"max-width":"270px"},title:(At=w.value)==null?void 0:At.name},_e(((Tt=w.value)==null?void 0:Tt.name)||$e.$t("views.application.form.appName.label")),9,Sge)]),ee("div",Age,[P(Jt,{link:"",onClick:rt[5]||(rt[5]=En=>S.value=!S.value)},{default:j(()=>[P(ae,{iconName:S.value?"app-minify":"app-magnify",class:"color-secondary",style:{"font-size":"20px"}},null,8,["iconName"])]),_:1}),P(Jt,{link:"",onClick:rt[6]||(rt[6]=En=>E.value=!1)},{default:j(()=>[P(it,{size:20,class:"color-secondary"},{default:j(()=>[P(zt)]),_:1})]),_:1})])])],2),ee("div",Mge,[P(kn,{"application-details":w.value,type:"debug-ai-chat"},null,8,["application-details"])])],2)):Bn("",!0)]}),_:1}),$.value?Js((Ne(),bt(dge,{key:0,onClick:W,onRefreshVersion:Y},null,512)),[[qt,X]]):Bn("",!0)])),[[On,b.value]])}}});export{Xge as default};