import{L as Tu,U as mn,D as Ru}from"./NodeContainer-D9PNfjwh-CawrgSrv.js";import{o as Ou}from"./index-Crt100Db-CDbHzweT.js";import{P as ku}from"./propStore-Cl0CojEU-BjnqDV4W.js";import{e as rs,f as Qt,g as Mu,m as or,h as Pu,j as Lu,l as Du,n as Ge,r as Iu,o as Bu,p as Fu,q as ju,t as Xi,v as Hu,w as Wu,x as Ar,y as $u,_ as is,z as zu,i as ie,D as Gu,N as Oi,L as gn,T as os,E as pr,P as Uu,b as qu,F as Ur,O as ar,M as Ku,G as as,H as ss,I as Yi,J as Vi,K as ls,S as us,Q as gr,R as cs,U as Ve,V as ds,W as qr,X as Xu,Y as Yu,Z as Vu,$ as Zu,a0 as Ju,a1 as Qu,a2 as ec,a3 as ft,a4 as tc,a5 as Io,a6 as Bo,a7 as nc,a8 as rc,a9 as ic,aa as oc,ab as ac,ac as sc,ad as hs}from"./NodeStyle-Bo2gmgjj-CM4kHPNz.js";import{n as fs}from"./_commonjsHelpers-B52_cu2H-BG14nIm9.js";import lc from"./LoopIcon-BnGR9e2Y-QnRawAik.js";import{k as uc}from"./useNode-DryF6TH6-6dWLb65C.js";import{l as cc}from"./runStore-Oe6fP2qb-CrdxkpS7.js";import{j8 as Jt,j9 as It,ih as Ce,ja as Fo,ia as Gt,jb as sr,a3 as rn,jc as yn,is as ps,jd as Ot,ij as Ut,cD as We,je as dc,ib as qt,cO as hc,jf as fc,jg as lr,jh as kt,i4 as Kr,i7 as Zi,ji as en,i8 as Kt,bZ as Ji,jj as bn,ik as Bn,fO as Qi,cR as Re,jk as Xr,im as ur,ar as eo,jl as Fe,jm as Zt,jn as St,jo as Wt,jp as wn,jq as cr,cT as Et,cL as ot,aa as Ae,jr as to,js as pc,jt as Fn,ju as gs,iq as Bt,cS as at,jv as gc,jw as mc,ic as Yr,jx as xn,il as sn,jy as ms,jz as vc,jA as yc,io as jn,jB as Pn,i6 as dr,ii as Vr,jC as vs,jD as ys,jE as bs,jF as ws,jG as bc,cM as on,jH as Dn,jI as wc,jJ as xs,jK as Es,jL as Cs,jM as _s,jN as xc,jO as Ec,id as no,jP as Cc,jQ as _c,jR as Ac,jS as Sc,jT as $t,ie as Nc,jU as Tc,jV as Sr,jW as Rc,jX as Oc,jY as ro,jZ as As,j_ as Ss,j$ as Zr,k0 as En,k1 as Ns,k2 as Ts,k3 as io,k4 as kc,k5 as Rs,k6 as Mc,k7 as Os,k8 as ks,k9 as Pc,ka as Lc,kb as Dc,a9 as In,i9 as Ic,kc as Bc,kd as Fc,cY as jc,ke as Ms,j7 as Hc,ip as Wc,kf as $c,a4 as zc,kg as Gc,kh as Uc,aQ as ki,ki as qc,ir as Kc,i as Xc,kj as Yc,kk as Vc,kl as Zc,aL as Jc,dz as Mi,b2 as Qc,at as ed,bW as td,km as nd,kn as rd,ko as id}from"./index-X7Y8jykP.js";import{t as od}from"./throttle-De_jAmBh.js";import{b as Jr,d as ad}from"./difference-CGvbIcA7.js";import{f as sd}from"./fromPairs-Dx9PT-t0.js";import{u as ld}from"./uniqBy--vsL0WVB.js";import{e as ud,y as cd,w as dd,o as hd,z as fd,A as pd,Q as gd,T as md,r as yi,B as vd,u as jo,c as yd}from"./vue-vendor-DNhG1Cve.js";var bd=NaN;function Ho(t){return typeof t=="number"?t:Jt(t)?bd:+t}function Qr(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=It(n),r=It(r)):(n=Ho(n),r=Ho(r)),i=t(n,r)}return i}}var wd=Qr(function(t,e){return t+e},0),xd="Expected a function";function Ed(t,e){if(typeof e!="function")throw new TypeError(xd);return t=Ce(t),function(){if(--t<1)return e.apply(this,arguments)}}var Nr=Fo&&new Fo,Ps=Nr?function(t,e){return Nr.set(t,e),t}:Gt;function ir(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=sr(t.prototype),r=t.apply(n,e);return rn(r)?r:n}}var Cd=1;function _d(t,e,n){var r=e&Cd,i=ir(t);function o(){var s=this&&this!==yn&&this instanceof o?i:t;return s.apply(r?n:this,arguments)}return o}var Ad=Math.max;function Ls(t,e,n,r){for(var i=-1,o=t.length,s=n.length,l=-1,a=e.length,u=Ad(o-s,0),c=Array(a+u),d=!r;++l1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Id,`{ /* [wrapped with `+e+`] */ `)}var Fd=1,jd=2,Hd=8,Wd=16,$d=32,zd=64,Gd=128,Ud=256,qd=512,Kd=[["ary",Gd],["bind",Fd],["bindKey",jd],["curry",Hd],["curryRight",Wd],["flip",qd],["partial",$d],["partialRight",zd],["rearg",Ud]];function Xd(t,e){return qt(Kd,function(n){var r="_."+n[0];e&n[1]&&!hc(t,r)&&t.push(r)}),t.sort()}function Fs(t,e,n){var r=e+"";return fc(t,Bd(r,Xd(Dd(r),n)))}var Yd=4,Vd=8,Wo=32,$o=64;function js(t,e,n,r,i,o,s,l,a,u){var c=e&Vd,d=c?s:void 0,h=c?void 0:s,f=c?o:void 0,v=c?void 0:o;e|=c?Wo:$o,e&=~(c?$o:Wo),e&Yd||(e&=-4);var b=[t,e,i,f,d,v,h,l,a,u],w=n.apply(void 0,b);return Pi(t)&&Bs(w,b),w.placeholder=r,Fs(w,t,e)}function Hn(t){var e=t;return e.placeholder}var Zd=Math.min;function Jd(t,e){for(var n=t.length,r=Zd(e.length,n),i=Ot(t);r--;){var o=e[r];t[r]=lr(o,n)?i[o]:void 0}return t}var zo="__lodash_placeholder__";function an(t,e){for(var n=-1,r=t.length,i=0,o=[];++n1&&P.reverse(),c&&a0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Eh=1,Ch=32,ni=Re(function(t,e,n){var r=Eh;if(n.length){var i=an(n,Hn(ni));r|=Ch}return tn(t,r,e,n,i)});ni.placeholder={};var _h=bn(function(t,e){return qt(e,function(n){n=Xr(n),ur(t,n,ni(t[n],t))}),t}),Ah=1,Sh=2,Nh=32,lo=Re(function(t,e,n){var r=Ah|Sh;if(n.length){var i=an(n,Hn(lo));r|=Nh}return tn(e,r,t,n,i)});lo.placeholder={};function zs(t){return eo(Fe(t).toLowerCase())}function uo(t){return function(e){return t==null?void 0:t[e]}}var Th={À:"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"},Rh=uo(Th),Oh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kh="\\u0300-\\u036f",Mh="\\ufe20-\\ufe2f",Ph="\\u20d0-\\u20ff",Lh=kh+Mh+Ph,Dh="["+Lh+"]",Ih=RegExp(Dh,"g");function Gs(t){return t=Fe(t),t&&t.replace(Oh,Rh).replace(Ih,"")}var Bh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Fh(t){return t.match(Bh)||[]}var jh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Hh(t){return jh.test(t)}var Us="\\ud800-\\udfff",Wh="\\u0300-\\u036f",$h="\\ufe20-\\ufe2f",zh="\\u20d0-\\u20ff",Gh=Wh+$h+zh,qs="\\u2700-\\u27bf",Ks="a-z\\xdf-\\xf6\\xf8-\\xff",Uh="\\xac\\xb1\\xd7\\xf7",qh="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kh="\\u2000-\\u206f",Xh=" \\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",Xs="A-Z\\xc0-\\xd6\\xd8-\\xde",Yh="\\ufe0e\\ufe0f",Ys=Uh+qh+Kh+Xh,Vs="['’]",Jo="["+Ys+"]",Vh="["+Gh+"]",Zs="\\d+",Zh="["+qs+"]",Js="["+Ks+"]",Qs="[^"+Us+Ys+Zs+qs+Ks+Xs+"]",Jh="\\ud83c[\\udffb-\\udfff]",Qh="(?:"+Vh+"|"+Jh+")",ef="[^"+Us+"]",el="(?:\\ud83c[\\udde6-\\uddff]){2}",tl="[\\ud800-\\udbff][\\udc00-\\udfff]",kn="["+Xs+"]",tf="\\u200d",Qo="(?:"+Js+"|"+Qs+")",nf="(?:"+kn+"|"+Qs+")",ea="(?:"+Vs+"(?:d|ll|m|re|s|t|ve))?",ta="(?:"+Vs+"(?:D|LL|M|RE|S|T|VE))?",nl=Qh+"?",rl="["+Yh+"]?",rf="(?:"+tf+"(?:"+[ef,el,tl].join("|")+")"+rl+nl+")*",of="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",af="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sf=rl+nl+rf,lf="(?:"+[Zh,el,tl].join("|")+")"+sf,uf=RegExp([kn+"?"+Js+"+"+ea+"(?="+[Jo,kn,"$"].join("|")+")",nf+"+"+ta+"(?="+[Jo,kn+Qo,"$"].join("|")+")",kn+"?"+Qo+"+"+ea,kn+"+"+ta,af,of,Zs,lf].join("|"),"g");function cf(t){return t.match(uf)||[]}function il(t,e,n){return t=Fe(t),e=n?void 0:e,e===void 0?Hh(t)?cf(t):Fh(t):t.match(e)||[]}var df="['’]",hf=RegExp(df,"g");function Wn(t){return function(e){return rs(il(Gs(e).replace(hf,"")),t,"")}}var ff=Wn(function(t,e,n){return e=e.toLowerCase(),t+(n?zs(e):e)});function pf(){if(!arguments.length)return[];var t=arguments[0];return We(t)?t:[t]}var gf=yn.isFinite,mf=Math.min;function co(t){var e=Math[t];return function(n,r){if(n=Zt(n),r=r==null?0:mf(Ce(r),292),r&&gf(n)){var i=(Fe(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(Fe(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var vf=co("ceil");function ol(t){var e=p(t);return e.__chain__=!0,e}var yf=Math.ceil,bf=Math.max;function wf(t,e,n){(n?St(t,e,n):e===void 0)?e=1:e=bf(Ce(e),0);var r=t==null?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,s=Array(yf(r/e));i=e?t:e)),t}function xf(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=Zt(n),n=n===n?n:0),e!==void 0&&(e=Zt(e),e=e===e?e:0),Cn(Zt(t),e,n)}var Ef=4;function Cf(t){return wn(t,Ef)}var _f=1,Af=4;function Sf(t,e){return e=typeof e=="function"?e:void 0,wn(t,_f|Af,e)}var Nf=4;function Tf(t,e){return e=typeof e=="function"?e:void 0,wn(t,Nf,e)}function Rf(){return new Mt(this.value(),this.__chain__)}function Of(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e2?e[2]:void 0;for(i&&St(e[0],e[1],i)&&(r=1);++n=0&&t.slice(n,i)==e}var sp=Mu(en),lp={"&":"&","<":"<",">":">",'"':""","'":"'"},up=uo(lp),fl=/[&<>"']/g,cp=RegExp(fl.source);function pl(t){return t=Fe(t),t&&cp.test(t)?t.replace(fl,up):t}var gl=/[\\^$.*+?()[\]{}|]/g,dp=RegExp(gl.source);function hp(t){return t=Fe(t),t&&dp.test(t)?t.replace(gl,"\\$&"):t}function ml(t,e){for(var n=-1,r=t==null?0:t.length;++ni?0:i+n),r=r===void 0||r>i?i:Ce(r),r<0&&(r+=i),r=n>r?0:vl(r);ne}function oi(t){return function(e,n){return typeof e=="string"&&typeof n=="string"||(e=Zt(e),n=Zt(n)),t(e,n)}}var Vp=oi(go),Zp=oi(function(t,e){return t>=e}),Jp=Math.max,Qp=Math.min;function eg(t,e,n){return t>=Qp(e,n)&&t-1:!!i&&Vr(t,e,n)>-1}function og(t){var e=t==null?0:t.length;return e?Wt(t,0,-1):[]}var ag=Re(function(t){var e=Bt(t),n=ot(t,vs);return e===Bt(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?ys(n,Ae(e)):[]}),sg=Re(function(t){var e=Bt(t),n=ot(t,vs);return e=typeof e=="function"?e:void 0,e&&n.pop(),n.length&&n[0]===t[0]?ys(n,void 0,e):[]});function lg(t,e,n,r){return sn(t,function(i,o,s){e(r,n(i),o,s)}),r}function El(t,e){return function(n,r){return lg(n,t,e(r),{})}}var ug=Object.prototype,cg=ug.toString,dg=El(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=cg.call(e)),t[e]=n},bs(Gt)),Cl=Object.prototype,hg=Cl.hasOwnProperty,fg=Cl.toString,pg=El(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=fg.call(e)),hg.call(t,e)?t[e].push(n):t[e]=[n]},Ae);function hr(t,e,n){e=ws(e,t),t=bc(t,e);var r=t==null?t:t[Xr(Bt(e))];return r==null?void 0:kt(r,t,n)}var gg=Re(hr),mg=Re(function(t,e,n){var r=-1,i=typeof e=="function",o=dr(t)?Array(t.length):[];return Yr(t,function(s){o[++r]=i?kt(e,s,n):hr(s,e,n)}),o}),vg="[object ArrayBuffer]";function yg(t){return Ut(t)&&Bn(t)==vg}var na=Dn&&Dn.isArrayBuffer,bg=na?on(na):yg,wg="[object Date]";function xg(t){return Ut(t)&&Bn(t)==wg}var ra=Dn&&Dn.isDate,Eg=ra?on(ra):xg;function Cg(t){return Ut(t)&&t.nodeType===1&&!Qi(t)}function _g(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?wc(t,e,void 0,n):!!r}var Ag=yn.isFinite;function Sg(t){return typeof t=="number"&&Ag(t)}function _l(t){return typeof t=="number"&&t==Ce(t)}function Ng(t,e){return t===e||xs(t,e,Es(e))}function Tg(t,e,n){return n=typeof n=="function"?n:void 0,xs(t,e,Es(e),n)}function Rg(t){return Cs(t)&&t!=+t}var Og=xc?jn:_s,kg="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function Mg(t){if(Og(t))throw new Error(kg);return Ec(t)}function Pg(t){return t===null}var Lg="[object RegExp]";function Dg(t){return Ut(t)&&Bn(t)==Lg}var ia=Dn&&Dn.isRegExp,vo=ia?on(ia):Dg,oa=9007199254740991;function Ig(t){return _l(t)&&t>=-oa&&t<=oa}var Bg="[object WeakMap]";function Fg(t){return Ut(t)&&no(t)==Bg}var jg="[object WeakSet]";function Hg(t){return Ut(t)&&Bn(t)==jg}var Wg=1;function $g(t){return Ae(typeof t=="function"?t:wn(t,Wg))}var zg=Array.prototype,Gg=zg.join;function Ug(t,e){return t==null?"":Gg.call(t,e)}var qg=Wn(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),Kg=to(function(t,e,n){ur(t,n,e)});function Xg(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}var Yg=Math.max,Vg=Math.min;function Zg(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=r;return n!==void 0&&(i=Ce(n),i=i<0?Yg(r+i,0):Vg(i,r-1)),e===e?Xg(t,e,i):ms(t,Cc,i,!0)}var Jg=Wn(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Qg=_c("toLowerCase");function yo(t,e){return t=this.__values__.length,e=t?void 0:this.__values__[this.__index__++];return{done:t,value:e}}function Nl(t,e){var n=t.length;if(n)return e+=e<0?n:0,lr(e,n)?t[e]:void 0}function Cm(t,e){return t&&t.length?Nl(t,Ce(e)):void 0}function _m(t){return t=Ce(t),Re(function(e){return Nl(e,t)})}function Tl(t,e){if(t==null)return{};var n=ot(Rc(t),function(r){return[r]});return e=Ae(e),Oc(t,n,function(r,i){return e(r,i[0])})}function Am(t,e){return Tl(t,li(Ae(e)))}function Sm(t){return $s(2,t)}function Nm(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}function Rl(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,o=Jt(t),s=e!==void 0,l=e===null,a=e===e,u=Jt(e);if(!l&&!u&&!o&&t>e||o&&s&&a&&!l&&!u||r&&s&&a||!n&&a||!i)return 1;if(!r&&!o&&!u&&t=l)return a;var u=n[r];return a*(u=="desc"?-1:1)}}return t.index-e.index}function Ol(t,e,n){e.length?e=ot(e,function(o){return We(o)?function(s){return ro(s,o.length===1?o[0]:o)}:o}):e=[Gt];var r=-1;e=ot(e,on(Ae));var i=Pu(t,function(o,s,l){var a=ot(e,function(u){return u(o)});return{criteria:a,index:++r,value:o}});return Nm(i,function(o,s){return Tm(o,s,n)})}function Rm(t,e,n,r){return t==null?[]:(We(e)||(e=e==null?[]:[e]),n=r?void 0:n,We(n)||(n=n==null?[]:[n]),Ol(t,e,n))}function wo(t){return bn(function(e){return e=ot(e,on(Ae)),Re(function(n){var r=this;return t(e,function(i){return kt(i,r,n)})})})}var Om=wo(ot),km=Re,Mm=Math.min,Pm=km(function(t,e){e=e.length==1&&We(e[0])?ot(e[0],on(Ae)):ot(Et(e,1),on(Ae));var n=e.length;return Re(function(r){for(var i=-1,o=Mm(r.length,n);++iIm)return n;do e%2&&(n+=t),e=Bm(e/2),e&&(t+=t);while(e);return n}var Fm=Ss("length"),kl="\\ud800-\\udfff",jm="\\u0300-\\u036f",Hm="\\ufe20-\\ufe2f",Wm="\\u20d0-\\u20ff",$m=jm+Hm+Wm,zm="\\ufe0e\\ufe0f",Gm="["+kl+"]",Ii="["+$m+"]",Bi="\\ud83c[\\udffb-\\udfff]",Um="(?:"+Ii+"|"+Bi+")",Ml="[^"+kl+"]",Pl="(?:\\ud83c[\\udde6-\\uddff]){2}",Ll="[\\ud800-\\udbff][\\udc00-\\udfff]",qm="\\u200d",Dl=Um+"?",Il="["+zm+"]?",Km="(?:"+qm+"(?:"+[Ml,Pl,Ll].join("|")+")"+Il+Dl+")*",Xm=Il+Dl+Km,Ym="(?:"+[Ml+Ii+"?",Ii,Pl,Ll,Gm].join("|")+")",aa=RegExp(Bi+"(?="+Bi+")|"+Ym+Xm,"g");function Vm(t){for(var e=aa.lastIndex=0;aa.test(t);)++e;return e}function zn(t){return Zr(t)?Vm(t):Fm(t)}var Zm=Math.ceil;function Tr(t,e){e=e===void 0?" ":It(e);var n=e.length;if(n<2)return n?Di(e,t):e;var r=Di(e,Zm(t/zn(e)));return Zr(e)?En($t(r),0,t).join(""):r.slice(0,t)}var Jm=Math.ceil,Qm=Math.floor;function ev(t,e,n){t=Fe(t),e=Ce(e);var r=e?zn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Tr(Qm(i),n)+t+Tr(Jm(i),n)}function tv(t,e,n){t=Fe(t),e=Ce(e);var r=e?zn(t):0;return e&&r-1;)l!==t&&sa.call(l,a,1),sa.call(t,a,1);return t}function Bl(t,e){return t&&t.length&&e&&e.length?Eo(t,e):t}var hv=Re(Bl);function fv(t,e,n){return t&&t.length&&e&&e.length?Eo(t,e,Ae(n)):t}function pv(t,e,n){return t&&t.length&&e&&e.length?Eo(t,e,void 0,n):t}var gv=Array.prototype,mv=gv.splice;function Fl(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;lr(i)?mv.call(t,i,1):Ns(t,i)}}return t}var vv=bn(function(t,e){var n=t==null?0:t.length,r=ao(t,e);return Fl(t,ot(e,function(i){return lr(i,n)?+i:i}).sort(Rl)),r}),yv=Math.ceil,bv=Math.max;function wv(t,e,n,r){for(var i=-1,o=bv(yv((e-t)/(n||1)),0),s=Array(o);o--;)s[r?o:++i]=t,t+=n;return s}function jl(t){return function(e,n,r){return r&&typeof r!="number"&&St(e,n,r)&&(n=r=void 0),e=Pn(e),n===void 0?(n=e,e=0):n=Pn(n),r=r===void 0?e1&&St(t,e[0],e[1])?e=[]:n>2&&St(e[0],e[1],e[2])&&(e=[e[0]]),Ol(t,Et(e,1),[])}),Qv=4294967295,ey=Qv-1,ty=Math.floor,ny=Math.min;function Co(t,e,n,r){var i=0,o=t==null?0:t.length;if(o===0)return 0;e=n(e);for(var s=e!==e,l=e===null,a=Jt(e),u=e===void 0;i>>1;function di(t,e,n){var r=0,i=t==null?r:t.length;if(typeof e=="number"&&e===e&&i<=iy){for(;r>>1,s=t[o];s!==null&&!Jt(s)&&(n?s<=e:s>>0,n?(t=Fe(t),t&&(typeof e=="string"||e!=null&&!vo(e))&&(e=It(e),!e&&Zr(t))?En($t(t),0,n):t.split(e,n)):[]}var gy="Expected a function",my=Math.max;function vy(t,e){if(typeof t!="function")throw new TypeError(gy);return e=e==null?0:my(Ce(e),0),Re(function(n){var r=n[e],i=En(n,0,e);return r&&cr(i,r),kt(t,this,i)})}var yy=Wn(function(t,e,n){return t+(n?" ":"")+eo(e)});function by(t,e,n){return t=Fe(t),n=n==null?0:Cn(Ce(n),0,t.length),e=It(e),t.slice(n,n+e.length)==e}function wy(){return{}}function xy(){return""}function Ey(){return!0}var Cy=Qr(function(t,e){return t-e},0);function _y(t){return t&&t.length?bo(t,Gt):0}function Ay(t,e){return t&&t.length?bo(t,Ae(e)):0}function Sy(t){var e=t==null?0:t.length;return e?Wt(t,1,e):[]}function Ny(t,e,n){return t&&t.length?(e=n||e===void 0?1:Ce(e),Wt(t,0,e<0?0:e)):[]}function Ty(t,e,n){var r=t==null?0:t.length;return r?(e=n||e===void 0?1:Ce(e),e=r-e,Wt(t,e<0?0:e,r)):[]}function Ry(t,e){return t&&t.length?ri(t,Ae(e),!1,!0):[]}function Oy(t,e){return t&&t.length?ri(t,Ae(e)):[]}function ky(t,e){return e(t),t}var zl=Object.prototype,My=zl.hasOwnProperty;function la(t,e,n,r){return t===void 0||Fn(t,zl[n])&&!My.call(r,n)?e:t}var Py={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Ly(t){return"\\"+Py[t]}var Gl=/<%=([\s\S]+?)%>/g,Dy=/<%-([\s\S]+?)%>/g,Iy=/<%([\s\S]+?)%>/g,ji={escape:Dy,evaluate:Iy,interpolate:Gl,variable:"",imports:{_:{escape:pl}}},By="Invalid `variable` option passed into `_.template`",Fy=/\b__p \+= '';/g,jy=/\b(__p \+=) '' \+/g,Hy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wy=/[()=,{}\[\]\/\s]/,$y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mr=/($^)/,zy=/['\n\r\u2028\u2029\\]/g,Gy=Object.prototype,ua=Gy.hasOwnProperty;function Uy(t,e,n){var r=ji.imports._.templateSettings||ji;n&&St(t,e,n)&&(e=void 0),t=Fe(t),e=Li({},e,r,la);var i=Li({},e.imports,r.imports,la),o=Kt(i),s=mo(i,o),l,a,u=0,c=e.interpolate||mr,d="__p += '",h=RegExp((e.escape||mr).source+"|"+c.source+"|"+(c===Gl?$y:mr).source+"|"+(e.evaluate||mr).source+"|$","g"),f=ua.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+` `:"";t.replace(h,function(w,T,P,H,G,se){return P||(P=H),d+=t.slice(u,se).replace(zy,Ly),T&&(l=!0,d+=`' + __e(`+T+`) + '`),G&&(a=!0,d+=`'; `+G+`; __p += '`),P&&(d+=`' + ((__t = (`+P+`)) == null ? '' : __t) + '`),u=se+w.length,w}),d+=`'; `;var v=ua.call(e,"variable")&&e.variable;if(!v)d=`with (obj) { `+d+` } `;else if(Wy.test(v))throw new Error(By);d=(a?d.replace(Fy,""):d).replace(jy,"$1").replace(Hy,"$1;"),d="function("+(v||"obj")+`) { `+(v?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(a?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+d+`return __p }`;var b=Ws(function(){return Function(o,f+"return "+d).apply(void 0,s)});if(b.source=d,so(b))throw b;return b}function hi(t,e){return e(t)}var qy=9007199254740991,xi=4294967295,Ky=Math.min;function Xy(t,e){if(t=Ce(t),t<1||t>qy)return[];var n=xi,r=Ky(t,xi);e=Qt(e),t-=xi;for(var i=Rs(r,e);++n-1;);return n}function Kl(t,e){for(var n=-1,r=t.length;++n-1;);return n}function n0(t,e,n){if(t=Fe(t),t&&(n||e===void 0))return Lc(t);if(!t||!(e=It(e)))return t;var r=$t(t),i=$t(e),o=Kl(r,i),s=ql(r,i)+1;return En(r,o,s).join("")}function r0(t,e,n){if(t=Fe(t),t&&(n||e===void 0))return t.slice(0,Dc(t)+1);if(!t||!(e=It(e)))return t;var r=$t(t),i=ql(r,$t(e))+1;return En(r,0,i).join("")}var i0=/^\s+/;function o0(t,e,n){if(t=Fe(t),t&&(n||e===void 0))return t.replace(i0,"");if(!t||!(e=It(e)))return t;var r=$t(t),i=Kl(r,$t(e));return En(r,i).join("")}var a0=30,s0="...",l0=/\w*$/;function u0(t,e){var n=a0,r=s0;if(rn(e)){var i="separator"in e?e.separator:i;n="length"in e?Ce(e.length):n,r="omission"in e?It(e.omission):r}t=Fe(t);var o=t.length;if(Zr(t)){var s=$t(t);o=s.length}if(n>=o)return t;var l=n-zn(r);if(l<1)return r;var a=s?En(s,0,l).join(""):t.slice(0,l);if(i===void 0)return a+r;if(s&&(l+=a.length-l),vo(i)){if(t.slice(l).search(i)){var u,c=a;for(i.global||(i=RegExp(i.source,Fe(l0.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;a=a.slice(0,d===void 0?l:d)}}else if(t.indexOf(It(i),l)!=l){var h=a.lastIndexOf(i);h>-1&&(a=a.slice(0,h))}return a+r}function c0(t){return Hs(t,1)}var d0={"&":"&","<":"<",">":">",""":'"',"'":"'"},h0=uo(d0),Xl=/&(?:amp|lt|gt|quot|#39);/g,f0=RegExp(Xl.source);function p0(t){return t=Fe(t),t&&f0.test(t)?t.replace(Xl,h0):t}var g0=Re(function(t){return In(Et(t,1,at,!0))}),m0=Re(function(t){var e=Bt(t);return at(e)&&(e=void 0),In(Et(t,1,at,!0),Ae(e))}),v0=Re(function(t){var e=Bt(t);return e=typeof e=="function"?e:void 0,In(Et(t,1,at,!0),void 0,e)});function y0(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?In(t,void 0,e):[]}var b0=0;function w0(t){var e=++b0;return Fe(t)+e}function x0(t,e){return t==null?!0:Ns(t,e)}var E0=Math.max;function _o(t){if(!(t&&t.length))return[];var e=0;return t=xn(t,function(n){if(at(n))return e=E0(n.length,e),!0}),Rs(e,function(n){return ot(t,Ss(n))})}function Yl(t,e){if(!(t&&t.length))return[];var n=_o(t);return e==null?n:ot(n,function(r){return kt(e,void 0,r)})}function Vl(t,e,n,r){return io(t,e,n(ro(t,e)),r)}function C0(t,e,n){return t==null?t:Vl(t,e,Qt(n))}function _0(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:Vl(t,e,Qt(n),r)}var A0=Wn(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()});function S0(t){return t==null?[]:mo(t,en(t))}var N0=Re(function(t,e){return at(t)?Jr(t,e):[]});function T0(t,e){return ui(Qt(e),t)}var R0=bn(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(o){return ao(o,t)};return e>1||this.__actions__.length||!(r instanceof Te)||!lr(n)?this.thru(i):(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:hi,args:[i],thisArg:void 0}),new Mt(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(void 0),o}))});function O0(){return ol(this)}function k0(){var t=this.__wrapped__;if(t instanceof Te){var e=t;return this.__actions__.length&&(e=new Te(this)),e=e.reverse(),e.__actions__.push({func:hi,args:[Fi],thisArg:void 0}),new Mt(e,this.__chain__)}return this.thru(Fi)}function Ao(t,e,n){var r=t.length;if(r<2)return r?In(t[0]):[];for(var i=-1,o=Array(r);++i1?t[e-1]:void 0;return n=typeof n=="function"?(t.pop(),n):void 0,Yl(t,n)});const ee={chunk:wf,compact:Of,concat:kf,difference:ad,differenceBy:Zf,differenceWith:Jf,drop:ep,dropRight:tp,dropRightWhile:np,dropWhile:rp,fill:vp,findIndex:Ms,findLastIndex:wl,flatten:Bc,flattenDeep:Rp,flattenDepth:Op,fromPairs:sd,head:Cp,indexOf:Du,initial:og,intersection:Fc,intersectionBy:ag,intersectionWith:sg,join:Ug,lastIndexOf:Zg,nth:Cm,pull:hv,pullAll:Bl,pullAllBy:fv,pullAllWith:pv,pullAt:vv,remove:Tv,reverse:Fi,slice:Yv,sortedIndex:oy,sortedIndexBy:ay,sortedIndexOf:sy,sortedLastIndex:ly,sortedLastIndexBy:uy,sortedLastIndexOf:cy,sortedUniq:dy,sortedUniqBy:hy,tail:Sy,take:Ny,takeRight:Ty,takeRightWhile:Ry,takeWhile:Oy,union:g0,unionBy:m0,unionWith:v0,uniq:jc,uniqBy:ld,uniqWith:y0,unzip:_o,unzipWith:Yl,without:N0,xor:M0,xorBy:P0,xorWith:L0,zip:D0,zipObject:I0,zipObjectDeep:B0,zipWith:F0},je={countBy:Hf,every:pp,filter:Qn,find:Wc,findLast:xp,flatMap:_p,flatMapDeep:Sp,flatMapDepth:Np,forEach:Ge,forEachRight:op,groupBy:Yp,includes:ig,invokeMap:mg,keyBy:Kg,map:or,orderBy:Rm,partition:Hc,reduce:Iu,reduceRight:Sv,reject:Nv,sample:Fv,sampleSize:Wv,shuffle:Uv,size:Xv,some:Jv,sortBy:Wl},j0={now:$c},Ue={after:Ed,ary:Hs,before:$s,bind:ni,bindKey:lo,curry:ho,curryRight:fo,debounce:zc,defer:Yf,delay:Vf,flip:Mp,memoize:Gc,once:Sm,overArgs:Pm,partial:ui,partialRight:xo,rearg:_v,rest:Mv,spread:vy,throttle:od,unary:c0,wrap:T0},ue={castArray:pf,clone:Cf,cloneDeep:ki,cloneDeepWith:Sf,cloneWith:Tf,conformsTo:Bf,eq:Fn,gt:Vp,gte:Zp,isArguments:qc,isArrayBuffer:bg,isArrayLike:dr,isArrayLikeObject:at,isBoolean:Bu,isBuffer:Os,isDate:Eg,isElement:Cg,isEmpty:Kc,isEqual:Xc,isEqualWith:_g,isError:so,isFinite:Sg,isFunction:jn,isInteger:_l,isLength:Yc,isMap:Vc,isMatch:Ng,isMatchWith:Tg,isNaN:Rg,isNative:Mg,isNil:Fu,isNull:Pg,isNumber:Cs,isObjectLike:Ut,isPlainObject:Qi,isRegExp:vo,isSafeInteger:Ig,isSet:Zc,isString:ai,isSymbol:Jt,isTypedArray:ks,isUndefined:ju,isWeakMap:Fg,isWeakSet:Hg,lt:em,lte:tm,toArray:Sl,toFinite:Pn,toLength:vl,toNumber:Zt,toPlainObject:Uc,toSafeInteger:Qy,toString:Fe},gt={add:wd,ceil:vf,divide:Qf,floor:Pp,max:sm,maxBy:lm,mean:cm,meanBy:dm,min:pm,minBy:gm,multiply:vm,round:Iv,subtract:Cy,sum:_y,sumBy:Ay},So={clamp:xf,inRange:tg,random:Jc},ve={assign:Xi,assignIn:mh,assignInWith:Li,assignWith:vh,at:yh,create:Wf,defaults:qf,defaultsDeep:Kf,findKey:yp,findLastKey:Ep,forIn:Wp,forInRight:$p,forOwn:zp,forOwnRight:Gp,functions:Up,functionsIn:qp,get:Ji,has:Ar,hasIn:nd,invert:dg,invertBy:pg,invoke:gg,keysIn:en,mapKeys:Hu,mapValues:nm,merge:Mi,mergeWith:ul,omit:Qc,omitBy:Am,pick:ed,pickBy:Tl,result:Pv,set:td,setWith:$v,toPairs:Wu,toPairsIn:sp,transform:t0,unset:x0,update:C0,updateWith:_0,values:$n,valuesIn:S0},Xt={at:R0,chain:ol,commit:Rf,next:Em,plant:lv,reverse:k0,tap:ky,toIterator:Yy,value:Vy,wrapperChain:O0},Le={camelCase:ff,capitalize:zs,deburr:Gs,endsWith:ap,escape:pl,escapeRegExp:hp,kebabCase:qg,lowerCase:Jg,lowerFirst:Qg,pad:ev,padEnd:tv,padStart:nv,parseInt:ov,repeat:Rv,replace:Ov,snakeCase:Vv,split:py,startCase:yy,startsWith:by,template:Uy,templateSettings:ji,toLower:Zy,toUpper:e0,trim:n0,trimEnd:r0,trimStart:o0,truncate:u0,unescape:p0,upperCase:A0,upperFirst:eo,words:il},Ie={attempt:Ws,bindAll:_h,cond:Pf,conforms:If,constant:bs,defaultTo:Gf,flow:jp,flowRight:Hp,iteratee:$g,matches:im,matchesProperty:am,method:hm,methodOf:fm,noop:ps,nthArg:_m,over:Om,overEvery:Lm,overSome:Dm,property:rd,propertyOf:uv,range:xv,rangeRight:Ev,stubArray:id,stubFalse:_s,stubObject:wy,stubString:xy,stubTrue:Ey,times:Xy,toPath:Jy,uniqueId:w0};function H0(){var t=new Te(this.__wrapped__);return t.__actions__=Ot(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ot(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ot(this.__views__),t}function W0(){if(this.__filtered__){var t=new Te(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}var $0=Math.max,z0=Math.min;function G0(t,e,n){for(var r=-1,i=n.length;++r * Build: `lodash modularize exports="es" -o ./` * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var Y0="4.17.22",V0=2,Z0=1,J0=3,Jl=4294967295,Q0=Array.prototype,eb=Object.prototype,Ql=eb.hasOwnProperty,da=Sr?Sr.iterator:void 0,tb=Math.max,ha=Math.min,No=(function(t){return function(e,n,r){if(r==null){var i=rn(n),o=i&&Kt(n),s=o&&o.length&&ii(n,o);(s?s.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}})(mm);p.after=Ue.after;p.ary=Ue.ary;p.assign=ve.assign;p.assignIn=ve.assignIn;p.assignInWith=ve.assignInWith;p.assignWith=ve.assignWith;p.at=ve.at;p.before=Ue.before;p.bind=Ue.bind;p.bindAll=Ie.bindAll;p.bindKey=Ue.bindKey;p.castArray=ue.castArray;p.chain=Xt.chain;p.chunk=ee.chunk;p.compact=ee.compact;p.concat=ee.concat;p.cond=Ie.cond;p.conforms=Ie.conforms;p.constant=Ie.constant;p.countBy=je.countBy;p.create=ve.create;p.curry=Ue.curry;p.curryRight=Ue.curryRight;p.debounce=Ue.debounce;p.defaults=ve.defaults;p.defaultsDeep=ve.defaultsDeep;p.defer=Ue.defer;p.delay=Ue.delay;p.difference=ee.difference;p.differenceBy=ee.differenceBy;p.differenceWith=ee.differenceWith;p.drop=ee.drop;p.dropRight=ee.dropRight;p.dropRightWhile=ee.dropRightWhile;p.dropWhile=ee.dropWhile;p.fill=ee.fill;p.filter=je.filter;p.flatMap=je.flatMap;p.flatMapDeep=je.flatMapDeep;p.flatMapDepth=je.flatMapDepth;p.flatten=ee.flatten;p.flattenDeep=ee.flattenDeep;p.flattenDepth=ee.flattenDepth;p.flip=Ue.flip;p.flow=Ie.flow;p.flowRight=Ie.flowRight;p.fromPairs=ee.fromPairs;p.functions=ve.functions;p.functionsIn=ve.functionsIn;p.groupBy=je.groupBy;p.initial=ee.initial;p.intersection=ee.intersection;p.intersectionBy=ee.intersectionBy;p.intersectionWith=ee.intersectionWith;p.invert=ve.invert;p.invertBy=ve.invertBy;p.invokeMap=je.invokeMap;p.iteratee=Ie.iteratee;p.keyBy=je.keyBy;p.keys=Kt;p.keysIn=ve.keysIn;p.map=je.map;p.mapKeys=ve.mapKeys;p.mapValues=ve.mapValues;p.matches=Ie.matches;p.matchesProperty=Ie.matchesProperty;p.memoize=Ue.memoize;p.merge=ve.merge;p.mergeWith=ve.mergeWith;p.method=Ie.method;p.methodOf=Ie.methodOf;p.mixin=No;p.negate=li;p.nthArg=Ie.nthArg;p.omit=ve.omit;p.omitBy=ve.omitBy;p.once=Ue.once;p.orderBy=je.orderBy;p.over=Ie.over;p.overArgs=Ue.overArgs;p.overEvery=Ie.overEvery;p.overSome=Ie.overSome;p.partial=Ue.partial;p.partialRight=Ue.partialRight;p.partition=je.partition;p.pick=ve.pick;p.pickBy=ve.pickBy;p.property=Ie.property;p.propertyOf=Ie.propertyOf;p.pull=ee.pull;p.pullAll=ee.pullAll;p.pullAllBy=ee.pullAllBy;p.pullAllWith=ee.pullAllWith;p.pullAt=ee.pullAt;p.range=Ie.range;p.rangeRight=Ie.rangeRight;p.rearg=Ue.rearg;p.reject=je.reject;p.remove=ee.remove;p.rest=Ue.rest;p.reverse=ee.reverse;p.sampleSize=je.sampleSize;p.set=ve.set;p.setWith=ve.setWith;p.shuffle=je.shuffle;p.slice=ee.slice;p.sortBy=je.sortBy;p.sortedUniq=ee.sortedUniq;p.sortedUniqBy=ee.sortedUniqBy;p.split=Le.split;p.spread=Ue.spread;p.tail=ee.tail;p.take=ee.take;p.takeRight=ee.takeRight;p.takeRightWhile=ee.takeRightWhile;p.takeWhile=ee.takeWhile;p.tap=Xt.tap;p.throttle=Ue.throttle;p.thru=hi;p.toArray=ue.toArray;p.toPairs=ve.toPairs;p.toPairsIn=ve.toPairsIn;p.toPath=Ie.toPath;p.toPlainObject=ue.toPlainObject;p.transform=ve.transform;p.unary=Ue.unary;p.union=ee.union;p.unionBy=ee.unionBy;p.unionWith=ee.unionWith;p.uniq=ee.uniq;p.uniqBy=ee.uniqBy;p.uniqWith=ee.uniqWith;p.unset=ve.unset;p.unzip=ee.unzip;p.unzipWith=ee.unzipWith;p.update=ve.update;p.updateWith=ve.updateWith;p.values=ve.values;p.valuesIn=ve.valuesIn;p.without=ee.without;p.words=Le.words;p.wrap=Ue.wrap;p.xor=ee.xor;p.xorBy=ee.xorBy;p.xorWith=ee.xorWith;p.zip=ee.zip;p.zipObject=ee.zipObject;p.zipObjectDeep=ee.zipObjectDeep;p.zipWith=ee.zipWith;p.entries=ve.toPairs;p.entriesIn=ve.toPairsIn;p.extend=ve.assignIn;p.extendWith=ve.assignInWith;No(p,p);p.add=gt.add;p.attempt=Ie.attempt;p.camelCase=Le.camelCase;p.capitalize=Le.capitalize;p.ceil=gt.ceil;p.clamp=So.clamp;p.clone=ue.clone;p.cloneDeep=ue.cloneDeep;p.cloneDeepWith=ue.cloneDeepWith;p.cloneWith=ue.cloneWith;p.conformsTo=ue.conformsTo;p.deburr=Le.deburr;p.defaultTo=Ie.defaultTo;p.divide=gt.divide;p.endsWith=Le.endsWith;p.eq=ue.eq;p.escape=Le.escape;p.escapeRegExp=Le.escapeRegExp;p.every=je.every;p.find=je.find;p.findIndex=ee.findIndex;p.findKey=ve.findKey;p.findLast=je.findLast;p.findLastIndex=ee.findLastIndex;p.findLastKey=ve.findLastKey;p.floor=gt.floor;p.forEach=je.forEach;p.forEachRight=je.forEachRight;p.forIn=ve.forIn;p.forInRight=ve.forInRight;p.forOwn=ve.forOwn;p.forOwnRight=ve.forOwnRight;p.get=ve.get;p.gt=ue.gt;p.gte=ue.gte;p.has=ve.has;p.hasIn=ve.hasIn;p.head=ee.head;p.identity=Gt;p.includes=je.includes;p.indexOf=ee.indexOf;p.inRange=So.inRange;p.invoke=ve.invoke;p.isArguments=ue.isArguments;p.isArray=We;p.isArrayBuffer=ue.isArrayBuffer;p.isArrayLike=ue.isArrayLike;p.isArrayLikeObject=ue.isArrayLikeObject;p.isBoolean=ue.isBoolean;p.isBuffer=ue.isBuffer;p.isDate=ue.isDate;p.isElement=ue.isElement;p.isEmpty=ue.isEmpty;p.isEqual=ue.isEqual;p.isEqualWith=ue.isEqualWith;p.isError=ue.isError;p.isFinite=ue.isFinite;p.isFunction=ue.isFunction;p.isInteger=ue.isInteger;p.isLength=ue.isLength;p.isMap=ue.isMap;p.isMatch=ue.isMatch;p.isMatchWith=ue.isMatchWith;p.isNaN=ue.isNaN;p.isNative=ue.isNative;p.isNil=ue.isNil;p.isNull=ue.isNull;p.isNumber=ue.isNumber;p.isObject=rn;p.isObjectLike=ue.isObjectLike;p.isPlainObject=ue.isPlainObject;p.isRegExp=ue.isRegExp;p.isSafeInteger=ue.isSafeInteger;p.isSet=ue.isSet;p.isString=ue.isString;p.isSymbol=ue.isSymbol;p.isTypedArray=ue.isTypedArray;p.isUndefined=ue.isUndefined;p.isWeakMap=ue.isWeakMap;p.isWeakSet=ue.isWeakSet;p.join=ee.join;p.kebabCase=Le.kebabCase;p.last=Bt;p.lastIndexOf=ee.lastIndexOf;p.lowerCase=Le.lowerCase;p.lowerFirst=Le.lowerFirst;p.lt=ue.lt;p.lte=ue.lte;p.max=gt.max;p.maxBy=gt.maxBy;p.mean=gt.mean;p.meanBy=gt.meanBy;p.min=gt.min;p.minBy=gt.minBy;p.stubArray=Ie.stubArray;p.stubFalse=Ie.stubFalse;p.stubObject=Ie.stubObject;p.stubString=Ie.stubString;p.stubTrue=Ie.stubTrue;p.multiply=gt.multiply;p.nth=ee.nth;p.noop=Ie.noop;p.now=j0.now;p.pad=Le.pad;p.padEnd=Le.padEnd;p.padStart=Le.padStart;p.parseInt=Le.parseInt;p.random=So.random;p.reduce=je.reduce;p.reduceRight=je.reduceRight;p.repeat=Le.repeat;p.replace=Le.replace;p.result=ve.result;p.round=gt.round;p.sample=je.sample;p.size=je.size;p.snakeCase=Le.snakeCase;p.some=je.some;p.sortedIndex=ee.sortedIndex;p.sortedIndexBy=ee.sortedIndexBy;p.sortedIndexOf=ee.sortedIndexOf;p.sortedLastIndex=ee.sortedLastIndex;p.sortedLastIndexBy=ee.sortedLastIndexBy;p.sortedLastIndexOf=ee.sortedLastIndexOf;p.startCase=Le.startCase;p.startsWith=Le.startsWith;p.subtract=gt.subtract;p.sum=gt.sum;p.sumBy=gt.sumBy;p.template=Le.template;p.times=Ie.times;p.toFinite=ue.toFinite;p.toInteger=Ce;p.toLength=ue.toLength;p.toLower=Le.toLower;p.toNumber=ue.toNumber;p.toSafeInteger=ue.toSafeInteger;p.toString=ue.toString;p.toUpper=Le.toUpper;p.trim=Le.trim;p.trimEnd=Le.trimEnd;p.trimStart=Le.trimStart;p.truncate=Le.truncate;p.unescape=Le.unescape;p.uniqueId=Ie.uniqueId;p.upperCase=Le.upperCase;p.upperFirst=Le.upperFirst;p.each=je.forEach;p.eachRight=je.forEachRight;p.first=ee.head;No(p,(function(){var t={};return sn(p,function(e,n){Ql.call(p.prototype,n)||(t[n]=e)}),t})(),{chain:!1});p.VERSION=Y0;(p.templateSettings=Le.templateSettings).imports._=p;qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){p[t].placeholder=p});qt(["drop","take"],function(t,e){Te.prototype[t]=function(n){n=n===void 0?1:tb(Ce(n),0);var r=this.__filtered__&&!e?new Te(this):this.clone();return r.__filtered__?r.__takeCount__=ha(n,r.__takeCount__):r.__views__.push({size:ha(n,Jl),type:t+(r.__dir__<0?"Right":"")}),r},Te.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}});qt(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==Z0||n==J0;Te.prototype[t]=function(i){var o=this.clone();return o.__iteratees__.push({iteratee:Ae(i),type:n}),o.__filtered__=o.__filtered__||r,o}});qt(["head","last"],function(t,e){var n="take"+(e?"Right":"");Te.prototype[t]=function(){return this[n](1).value()[0]}});qt(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Te.prototype[t]=function(){return this.__filtered__?new Te(this):this[n](1)}});Te.prototype.compact=function(){return this.filter(Gt)};Te.prototype.find=function(t){return this.filter(t).head()};Te.prototype.findLast=function(t){return this.reverse().find(t)};Te.prototype.invokeMap=Re(function(t,e){return typeof t=="function"?new Te(this):this.map(function(n){return hr(n,t,e)})});Te.prototype.reject=function(t){return this.filter(li(Ae(t)))};Te.prototype.slice=function(t,e){t=Ce(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Te(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==void 0&&(e=Ce(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)};Te.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()};Te.prototype.toArray=function(){return this.take(Jl)};sn(Te.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=p[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(p.prototype[e]=function(){var s=this.__wrapped__,l=r?[1]:arguments,a=s instanceof Te,u=l[0],c=a||We(s),d=function(T){var P=i.apply(p,cr([T],l));return r&&h?P[0]:P};c&&n&&typeof u=="function"&&u.length!=1&&(a=c=!1);var h=this.__chain__,f=!!this.__actions__.length,v=o&&!h,b=a&&!f;if(!o&&c){s=b?s:new Te(this);var w=t.apply(s,l);return w.__actions__.push({func:hi,args:[d],thisArg:void 0}),new Mt(w,h)}return v&&b?t.apply(this,l):(w=this.thru(d),v?r?w.value()[0]:w.value():w)})});qt(["pop","push","shift","sort","splice","unshift"],function(t){var e=Q0[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);p.prototype[t]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(We(o)?o:[],i)}return this[n](function(s){return e.apply(We(s)?s:[],i)})}});sn(Te.prototype,function(t,e){var n=p[e];if(n){var r=n.name+"";Ql.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:e,func:n})}});Ln[ti(void 0,V0).name]=[{name:"wrapper",func:void 0}];Te.prototype.clone=H0;Te.prototype.reverse=W0;Te.prototype.value=X0;p.prototype.at=Xt.at;p.prototype.chain=Xt.wrapperChain;p.prototype.commit=Xt.commit;p.prototype.next=Xt.next;p.prototype.plant=Xt.plant;p.prototype.reverse=Xt.reverse;p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Xt.value;p.prototype.first=p.prototype.head;da&&(p.prototype[da]=Xt.toIterator);var nb=Object.defineProperty,rb=Object.defineProperties,ib=Object.getOwnPropertyDescriptors,fa=Object.getOwnPropertySymbols,ob=Object.prototype.hasOwnProperty,ab=Object.prototype.propertyIsEnumerable,pa=(t,e,n)=>e in t?nb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,To=(t,e)=>{for(var n in e||(e={}))ob.call(e,n)&&pa(t,n,e[n]);if(fa)for(var n of fa(e))ab.call(e,n)&&pa(t,n,e[n]);return t},Ro=(t,e)=>rb(t,ib(e)),ga={width:40,height:40},ma={width:40,height:40},va={width:40,height:40},ya={width:100,height:80},ba={width:100,height:80},sb=(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,r=e==="x"?n:n&3|8;return r.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})(),lb=(globalThis==null?void 0:globalThis._ids)||new sb;function Gn(){return lb.next()}var eu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();(function(t){eu(e,t);function e(n,r){return n.id||(n.id="Event_".concat(Gn())),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,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(){return!1}};return n.push(r),n},e.extendKey="StartEventModel",e})(as);(function(t){eu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.extendKey="StartEventNode",e})(ss);var tu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Rr=function(){return Rr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n/g,">").replace(/"/g,""").replace(/'/g,"'")}function hb(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(kr(t)).replace(/"/g,"'")}return Mr(String(e))}var hn=` `;function Er(t,e,n){var r=db(n);if(t!==0&&t!==!1&&!t)return hn+r+"<".concat(e," />");var i="";if(e==="#text")return hn+r+Mr(String(t));if(e==="#cdata-section")return hn+r+"";if(e==="#comment")return hn+r+"";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+hb(t)+'"';if(Array.isArray(t))t.forEach(function(a){i+=Er(a,e,n+1)});else if(au(t)==="[object Object]"){var o=Object.keys(t),s="",l="";i+=(n===0?"":hn+r)+"<"+e,o.forEach(function(a){a.charAt(0)==="-"?s+=Er(t[a],a,n+1):l+=Er(t[a],a,n+1)}),i+=s+(l!==""?">".concat(l).concat(hn+r,""):" />")}else i+=hn+r+"<".concat(e,">").concat(Mr(String(t)),"");return i}function fb(t){var e="";for(var n in t)e+=Er(t[n],n,0);return e}var mt=function(){};mt.ObjTree=function(){return this};mt.ObjTree.VERSION="0.23";mt.ObjTree.prototype.xmlDecl=` `;mt.ObjTree.prototype.attr_prefix="-";mt.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)};mt.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody=="undefined"&&typeof r.postbody=="undefined"&&typeof r.parameters=="undefined"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,s=n,l=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),s(d,c),l&&l(c)}}else r.asynchronous=!1;var a;if(typeof HTTP!="undefined"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(a=u.transport)}else if(typeof Ajax!="undefined"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(a=u.transport)}if(n)return a;if(a&&a.responseXML&&a.responseXML.documentElement)return this.parseDOM(a.responseXML.documentElement)};mt.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e":typeof o=="object"&&o.constructor==Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var s=r.join(""),l=n.join("");return typeof t=="undefined"||t==null||(n.length>0?l.match(/\n/)?l="<"+t+s+`> `+l+" `:l="<"+t+s+">"+l+" `:l="<"+t+s+` /> `),l};mt.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r":typeof i=="object"&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")};mt.ObjTree.prototype.scalar_to_xml=function(t,e){return t=="#text"?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+" `};mt.ObjTree.prototype.xml_escape=Mr;var pb=function(t){return new mt.ObjTree().parseXML(t)},gb=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wi=function(){return Wi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},zt;(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"})(zt||(zt={}));var su=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],xa=["properties","startPoint","endPoint","pointsList"],lu=function(t){return String(t||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function Ea(t){var e=t?xa.concat(t):xa;return function(n){function r(i){var o={};return typeof i=="string"?i:Array.isArray(i)?i.map(function(s){return r(s)}):(Object.entries(i).forEach(function(s){var l=fi(s,2),a=l[0],u=l[1];typeof u!="object"?a.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(a)?o[a]=u:o["-".concat(a)]=u:e.includes(a)?o["-".concat(a)]=r(u):o[a]=r(u)}),o)}return r(n)}}function Pr(t){var e={};return Object.entries(t).forEach(function(n){var r=fi(n,2),i=r[0],o=r[1];i.indexOf("-")===0?e[i.substring(1)]=kr(o):typeof o=="string"?e[i]=o:Object.prototype.toString.call(o)==="[object Object]"?e[i]=Pr(o):Array.isArray(o)?e[i]=o.map(function(s){return Pr(s)}):e[i]=o}),e}function mb(t,e,n){var r=new Map;e.nodes.forEach(function(o){var s,l={"-id":o.id};if(!((s=o.text)===null||s===void 0)&&s.value&&(l["-name"]=o.text.value),o.properties){var a=Ea(n)(o.properties);Object.assign(l,a)}r.set(o.id,l),t[o.type]?Array.isArray(t[o.type])?t[o.type].push(l):t[o.type]=[t[o.type],l]:t[o.type]=l});var i=e.edges.map(function(o){var s,l,a=r.get(o.targetNodeId);a["bpmn:incoming"]?Array.isArray(a["bpmn:incoming"])?a["bpmn:incoming"].push(o.id):a["bpmn:incoming"]=[a["bpmn:incoming"],o.id]:a["bpmn:incoming"]=o.id;var u={"-id":o.id,"-sourceRef":o.sourceNodeId,"-targetRef":o.targetNodeId};if(!((s=o.text)===null||s===void 0)&&s.value&&(u["-name"]=(l=o.text)===null||l===void 0?void 0:l.value),o.properties){var c=Ea(n)(o.properties);Object.assign(u,c)}return u});e.edges.forEach(function(o){var s=r.get(o.sourceNodeId);s["bpmn:outgoing"]?Array.isArray(s["bpmn:outgoing"])?s["bpmn:outgoing"].push(o.id):s["bpmn:outgoing"]=[s["bpmn:outgoing"],o.id]:s["bpmn:outgoing"]=o.id}),t[zt.FLOW]=i}function vb(t,e){t["bpmndi:BPMNEdge"]=e.edges.map(function(n){var r,i=n.id,o=n.pointsList.map(function(l){var a=l.x,u=l.y;return{"-x":a,"-y":u}}),s={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=n.text)===null||r===void 0)&&r.value&&(s["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}}),s}),t["bpmndi:BPMNShape"]=e.nodes.map(function(n){var r,i=n.id,o=100,s=80,l=n.x,a=n.y,u=ln.shapeConfigMap.get(n.type);u&&(o=u.width,s=u.height),l-=o/2,a-=s/2;var c={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":l,"-y":a,"-width":o,"-height":s}};return!((r=n.text)===null||r===void 0)&&r.value&&(c["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}}),c})}function yb(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"],o=r["bpmndi:BPMNDiagram"],s=o==null?void 0:o["bpmndi:BPMNPlane"];if(!i||!s)return{nodes:e,edges:n};Object.keys(i).forEach(function(l){if(l.indexOf("bpmn:")===0){var a=i[l];if(l===zt.FLOW){var u=s["bpmndi:BPMNEdge"],c=u;n=wb(a,c)}else{var d=s["bpmndi:BPMNShape"],h=d;e=e.concat(bb(a,h,l))}}})}return{nodes:e,edges:n}}function bb(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(s){var l;Array.isArray(e)?l=e.find(function(u){return u["-bpmnElement"]===s["-id"]}):l=e;var a=Ca(l,n,s);r.push(a)});else{var i=void 0;Array.isArray(e)?i=e.find(function(s){return s["-bpmnElement"]===t["-id"]}):i=e;var o=Ca(i,n,t);r.push(o)}return r}function Ca(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=lu(n["-name"]),s=ln.shapeConfigMap.get(e);s&&(r+=s.width/2,i+=s.height/2);var l;Object.entries(n).forEach(function(d){var h=fi(d,2),f=h[0],v=h[1];su.indexOf(f)===-1&&(l||(l={}),l[f]=v)}),l&&(l=Pr(l));var a;if(o&&(a={x:r,y:i,value:o},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];a.x=Number(u["-x"])+Number(u["-width"])/2,a.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return a&&(c.text=a),c}function wb(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(s){return s["-bpmnElement"]===i["-id"]}):o=e,n.push(_a(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(_a(r,t))}return n}function _a(t,e){var n,r=e["-name"]?lu("".concat(e["-name"])):"";if(r){var i=void 0;t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"]&&(i=t["bpmndi:BPMNLabel"]["dc:Bounds"]);var o=0;if(r.split(` `).forEach(function(f){o/g,">");return'name="'.concat(o,'"')})},e.pluginName="bpmnXmlAdapter",e})(ln);var xb=(function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(n){var r=Math.random()*16|0,i=n==="x"?r:r&3|8;return i.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})(),Eb=(globalThis==null?void 0:globalThis._ids)||new xb;function Cb(){return Eb.next()}ie("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"}),ie("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;"});ie("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);"});ie("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 _b=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),vn=function(){return vn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Sb=cs,Nb=(function(t){_b(e,t);function e(n){var r=t.call(this)||this;return r.updatePosition=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.x,u=l.y;r.nodeModel.x=a+o/2,r.nodeModel.y=u+s/2,r.nodeModel.moveText(o/2,s/2)},r.getResize=function(i){var o=i.index,s=i.deltaX,l=i.deltaY,a=i.width,u=i.height,c=i.PCTResizeInfo,d=i.pct,h=d===void 0?1:d,f=i.freezeWidth,v=f===void 0?!1:f,b=i.freezeHeight,w=b===void 0?!1:b,T={width:a,height:u,deltaX:s,deltaY:l};if(c){var P=4,H=0,G=0;switch(o){case 0:G=(s*-1-l)/P;break;case 1:G=(s-l)/P;break;case 2:G=(s+l)/P;break;case 3:G=(s*-1+l)/P;break}G!==0&&(H=Math.round(G/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+H,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+H,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var se=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),U=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(o){case 0:s=a-se,l=u-U;break;case 1:s=se-a,l=u-U;break;case 2:s=se-a,l=U-u;break;case 3:s=a-se,l=U-u;break}return T.width=se,T.height=U,T.deltaX=s/h,T.deltaY=l/h,T}switch(o){case 0:T.width=v?a:a-s*h,T.height=w?u:u-l*h;break;case 1:T.width=v?a:a+s*h,T.height=w?u:u-l*h;break;case 2:T.width=v?a:a+s*h,T.height=w?u:u+l*h;break;case 3:T.width=v?a:a-s*h,T.height=w?u:u+l*h;break}return T},r.updateEdgePointByAnchors=function(){var i=r.nodeModel,o=i.id,s=i.anchors,l=r.getNodeEdges(o);l.sourceEdges.forEach(function(a){var u=s.find(function(c){return c.id===a.sourceAnchorId});u&&a.updateStartPoint({x:u.x,y:u.y})}),l.targetEdges.forEach(function(a){var u=s.find(function(c){return c.id===a.targetAnchorId});u&&a.updateEndPoint({x:u.x,y:u.y})})},r.updateRect=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.x,u=l.y,c=l.width,d=l.height,h=l.radius,f=l.PCTResizeInfo,v=r.nodeModel,b=v.minWidth,w=v.minHeight,T=v.maxWidth,P=v.maxHeight,H=r.index,G=b===T,se=w===P,U=r.getResize({index:H,deltaX:o,deltaY:s,width:c,height:d,PCTResizeInfo:f,pct:1,freezeWidth:G,freezeHeight:se});if(U.widthT||U.heightP){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:G?0:U.deltaX,deltaY:se?0:U.deltaY}),r.nodeModel.width=U.width,r.nodeModel.height=U.height,r.nodeModel.setProperties({nodeSize:{width:U.width,height:U.height}});var D={x:a,y:u,width:c,height:d,radius:h},he={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:h};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:s,beforeNode:D,afterNode:he})},r.updateEllipse=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.rx,u=l.ry,c=l.x,d=l.y,h=l.PCTResizeInfo,f=r.index,v=r.nodeModel,b=v.minWidth,w=v.minHeight,T=v.maxWidth,P=v.maxHeight,H=b===T,G=w===P,se=a,U=u,D=r.getResize({index:f,deltaX:o,deltaY:s,width:se,height:U,PCTResizeInfo:h,pct:1/2,freezeWidth:H,freezeHeight:G});if(D.widthT/2||D.heightP/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:H?0:D.deltaX,deltaY:G?0:D.deltaY}),r.nodeModel.rx=D.width,r.nodeModel.ry=D.height,r.nodeModel.setProperties({nodeSize:{rx:D.width,ry:D.height}});var he={x:c,y:d},Q={rx:D.width,ry:D.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:s,beforeNode:vn(vn({},he),{rx:a,ry:u}),afterNode:Q})},r.updateDiamond=function(i){var o=i.deltaX,s=i.deltaY,l=r.nodeModel,a=l.rx,u=l.ry,c=l.x,d=l.y,h=l.PCTResizeInfo,f=r.index,v=r.nodeModel,b=v.minWidth,w=v.minHeight,T=v.maxWidth,P=v.maxHeight,H=b===T,G=w===P,se=a,U=u,D=r.getResize({index:f,deltaX:o,deltaY:s,width:se,height:U,PCTResizeInfo:h,pct:1/2,freezeWidth:H,freezeHeight:G});if(D.widthT/2||D.heightP/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:H?0:D.deltaX,deltaY:G?0:D.deltaY}),r.nodeModel.rx=D.width,r.nodeModel.ry=D.height,r.nodeModel.setProperties({nodeSize:{rx:D.width,ry:D.height}});var he={x:c,y:d,rx:a,ry:u},Q={rx:D.width,ry:D.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:s,beforeNode:he,afterNode:Q})},r.eventEmit=function(i){var o=i.deltaX,s=i.deltaY,l=i.beforeNode,a=i.afterNode,u=r.nodeModel,c=u.id,d=u.modelType,h=u.type,f=vn({id:c,modelType:d,type:h},l),v=vn({id:c,modelType:d,type:h},a);r.graphModel.eventCenter.emit("node:resize",{preData:f,data:v,deltaX:o,deltaY:s,index:r.index,model:r.nodeModel})},r.onDragging=function(i){var o,s=i.deltaX,l=i.deltaY,a=r.graphModel.transformModel,u=r.nodeModel.modelType;o=Ab(a.fixDeltaXY(s,l),2),s=o[0],l=o[1],u===gr.RECT_NODE||u===gr.HTML_NODE?r.updateRect({deltaX:s,deltaY:l}):u===gr.ELLIPSE_NODE?r.updateEllipse({deltaX:s,deltaY:l}):u===gr.DIAMOND_NODE&&r.updateDiamond({deltaX:s,deltaY:l})},r.onDragEnd=function(){var i=r.graphModel.gridSize,o=i===void 0?1:i,s=o*Math.round(r.nodeModel.x/o),l=o*Math.round(r.nodeModel.y/o);r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new Sb({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return e.prototype.getNodeEdges=function(n){for(var r=this.graphModel,i=r.edges,o=[],s=[],l=0;l0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},pn=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r=this.x-this.width/2&&o<=this.x+this.width/2&&i>=this.y-this.height/2&&s<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(n){var r=n.minX,i=n.minY,o=n.maxX,s=n.maxY;return{x:r>=this.x-this.width/2&&o<=this.x+this.width/2,y:i>=this.y-this.height/2&&s<=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,r=t.prototype.getData.call(this);r.children=[],this.children.forEach(function(o){var s=n.graphModel.getNodeModelById(o);s&&!s.virtual&&r.children.push(o)});var i=r.properties;return i==null||delete i.groupAddable,i==null||delete i.isFolded,r},e.prototype.getHistoryData=function(){var n=t.prototype.getData.call(this);n.children=pn([],fn(this.children),!1),n.isGroup=!0;var r=n.properties;return r==null||delete r.groupAddable,r!=null&&r.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!0},e.prototype.toBack=function(){this.zIndex--},e})(Rb);(function(t){fu(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var n=this.props.model,r=n.resizable,i=n.properties;return r&&!i.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var n=this.props.model,r=n.width,i=n.height,o=n.x,s=n.y,l=n.radius,a=n.properties,u=n.getAddableOutlineStyle;if(!a.groupAddable)return null;var c=this.props.model.getNodeStyle().strokeWidth,d=c===void 0?0:c,h=u(),f=r+d+8,v=i+d+8;return ie("rect",Dr(Dr({},h),{width:f,height:v,x:o-f/2,y:s-v/2,rx:l,ry:l}))},e.prototype.getFoldIcon=function(){var n=this.props.model,r=n.x-n.width/2+5,i=n.y-n.height/2+5;if(!n.foldable)return null;var o=ie("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:n.properties.isFolded?"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," M").concat(r+7,",").concat(i+2," ").concat(r+7,",").concat(i+10):"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," ")});return ie("g",{},[ie("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)}}),o])},e.prototype.getResizeShape=function(){return ie("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(Ob);var Na=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),tr=function(){return tr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n `;vt.ObjTree.prototype.attr_prefix="-";vt.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(t),e=n.documentElement);if(e){var i=this.parseDOM(e);return i}};vt.ObjTree.prototype.parseHTTP=function(t,e,n){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody=="undefined"&&typeof r.postbody=="undefined"&&typeof r.parameters=="undefined"?r.method="get":r.method="post"),n){r.asynchronous=!0;var o=this,s=n,l=r.onComplete;r.onComplete=function(c){var d;c&&c.responseXML&&c.responseXML.documentElement&&(d=o.parseDOM(c.responseXML.documentElement)),s(d,c),l&&l(c)}}else r.asynchronous=!1;var a;if(typeof HTTP!="undefined"&&HTTP.Request){r.uri=t;var u=new HTTP.Request(r);u&&(a=u.transport)}else if(typeof Ajax!="undefined"&&Ajax.Request){var u=new Ajax.Request(t,r);u&&(a=u.transport)}if(n)return a;if(a&&a.responseXML&&a.responseXML.documentElement)return this.parseDOM(a.responseXML.documentElement)};vt.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e"):typeof o=="object"&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):typeof o=="object"?n[n.length]=this.hash_to_xml(i,o):n[n.length]=this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var s=r.join(""),l=n.join("");return typeof t=="undefined"||t==null||(n.length>0?l.match(/\n/)?l="<".concat(t).concat(s,`> `).concat(l," `):l="<".concat(t).concat(s,">").concat(l," `):l="<".concat(t).concat(s,` /> `)),l};vt.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r"):typeof i=="object"&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):typeof i=="object"?n[n.length]=this.hash_to_xml(t,i):n[n.length]=this.scalar_to_xml(t,i)}return n.join("")};vt.ObjTree.prototype.scalar_to_xml=function(t,e){return t==="#text"?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e)," `)};vt.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,'"')};var Pb=function(t){return new vt.ObjTree().parseXML(t)};function pu(t){return Object.prototype.toString.call(t)}function Ba(t){return" ".repeat(t)}function Br(t){return pu(t)==="[object Object]"?Object.keys(t).reduce(function(e,n){var r=n;return n.charAt(0)==="-"&&(r=n.substring(1)),e[r]=Br(t[n]),e},{}):Array.isArray(t)?t.map(function(e){return Br(e)}):t}function Lb(t){var e=t;try{typeof e!="string"&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(Br(t)).replace(/"/g,"'")}return e}var Fa=` `;function Cr(t,e,n){var r=Ba(n),i="",o=Fa+r;if(e==="-json")return"";if(e==="#text")return o+t;if(e==="#cdata-section")return"".concat(o,"");if(e==="#comment")return"".concat(o,"");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(Lb(t),'"');if(Array.isArray(t))i+=t.map(function(u){return Cr(u,e,n+1)}).join("");else if(pu(t)==="[object Object]"){var s=Object.keys(t),l="",a=t["-json"]?Fa+Ba(n+1)+t["-json"]:"";i+="".concat(n===0?"":o,"<").concat(e),s.forEach(function(u){u.charAt(0)==="-"?l+=Cr(t[u],u,n+1):a+=Cr(t[u],u,n+1)}),i+=l+(a!==""?">".concat(a).concat(o,""):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"");return i}function Db(t){var e="";for(var n in t)e+=Cr(t[n],n,0);return e}var Ib=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),zi=function(){return zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Dt=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r")}:{json:''.concat(r,"")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId,o=function(){return"').concat(r,"")};return{json:'".concat(o(),""):"/>")}},in:function(t,e){var n,r,i,o,s=t,l=e["-id"],a="",u="";try{for(var c=Oo(Object.keys(e)),d=c.next();!d.done;d=c.next()){var h=d.value;h.includes("bpmn:")&&(i=lt(h.split(":"),2),a=i[1],u=(o=e[h])===null||o===void 0?void 0:o["#text"])}}catch(f){n={error:f}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return{"-definitionId":l,"-definitionType":s,"-timerType":a,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=((n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||n===void 0?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function Fb(t){var e=t!=null?t:{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(Dt(Dt([],lt(Bb),!1),lt(n||[]),!1)),s={in:new Set(Dt(Dt([],lt(Fr.in),!1),lt((r==null?void 0:r.in)||[]),!1)),out:new Set(Dt(Dt([],lt(Fr.out),!1),lt((r==null?void 0:r.out)||[]),!1))};return Rt=mu(Rt,i),function(l){var a=l.nodes,u=l.edges;function c(d,h){var f,v;if((d==null?void 0:d.flag)!==1){var b;if((b=Rt[d.type])&&b.out){var w=b.out(d),T=Object.keys(w);T.length>0&&T.forEach(function(Q){d[Q]=w[Q]})}d!=null&&d.children&&(d.children=d.children.map(function(Q){var Ze=a.find(function(Xe){return Xe.id===Q})||u.find(function(Xe){return Xe.id===Q});return Ze||{}}));var P={};if(typeof d=="string")return d;if(Array.isArray(d))return d.map(function(Q){return c(Q,"")}).filter(function(Q){return Q!=null});try{for(var H=Oo(Object.entries(d)),G=H.next();!G.done;G=H.next()){var se=lt(G.value,2),U=se[0],D=se[1];if((D==null?void 0:D.flag)===1)return;var he=[h,U].filter(function(Q){return Q}).join(".");s.out.has(he)||(typeof D!="object"?U.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(U)?P[U]=D:P["-".concat(U)]=D:o.has(he)?P["-".concat(U)]=c(D,he):P[U]=c(D,he))}}catch(Q){f={error:Q}}finally{try{G&&!G.done&&(v=H.return)&&v.call(H)}finally{if(f)throw f.error}}return P}}return c(l,"")}}function jr(t){var e,n,r={};try{for(var i=Oo(Object.entries(t)),o=i.next();!o.done;o=i.next()){var s=lt(o.value,2),l=s[0],a=s[1];l.indexOf("-")===0?r[l.substring(1)]=Br(a):typeof a=="string"?r[l]=a:Object.prototype.toString.call(a)==="[object Object]"?r[l]=jr(a):Array.isArray(a)?r[l]=a.map(function(u){return jr(u)}):r[l]=a}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function jb(t,e,n){var r,i=new Map,o=Fb(n)(e);o.nodes.forEach(function(l){var a=l["-id"],u=l["-type"],c=l.text,d=l.children,h=ja(l,["-id","-type","text","children"]),f={"-id":a};c!=null&&c["-value"]&&(f["-name"]=c["-value"]),h["-json"]&&(f["-json"]=h["-json"]),h["-properties"]&&Object.assign(f,h["-properties"]),d&&(f.children=d),t[u]||(t[u]=[]),t[u].push(f),i.set(a,f)});var s=o.edges.map(function(l){var a=l["-id"],u=l["-sourceNodeId"],c=l["-targetNodeId"],d=l.text,h=ja(l,["-id","-sourceNodeId","-targetNodeId","text"]),f=i.get(c);f["bpmn:incoming"]||(f["bpmn:incoming"]=[]),f["bpmn:incoming"].push(a);var v={"-id":a,"-sourceRef":u,"-targetRef":c};return d!=null&&d["-value"]&&(v["-name"]=d["-value"]),h["-json"]&&(v["-json"]=h["-json"]),h["-properties"]&&Object.assign(v,h["-properties"]),v});return e.edges.forEach(function(l){var a=l.sourceNodeId,u=l.id,c=i.get(a);c["bpmn:outgoing"]||(c["bpmn:outgoing"]=[]),c["bpmn:outgoing"].push(u)}),(r=t["bpmn:subProcess"])===null||r===void 0||r.forEach(function(l){var a={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},u=[];l.children.forEach(function(b){var w,T=i.get(b["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(H){T[H]&&T[H].forEach(function(G){a[H].add(G)})});var P=(w=t[b["-type"]])===null||w===void 0?void 0:w.findIndex(function(H){return H["-id"]===b["-id"]});P>=0&&t[b["-type"]].splice(P,1),i.delete(b["-id"]),l[b["-type"]]||(l[b["-type"]]=[]),l[b["-type"]].push(T)});var c=a["bpmn:incoming"],d=a["bpmn:outgoing"];d.forEach(function(b){c.has(b)&&u.push(b)});for(var h=function(b){var w=s.findIndex(function(T){return T["-id"]===u[b]});w>=0?(l["bpmn:sequenceFlow"]||(l["bpmn:sequenceFlow"]=[]),l["bpmn:sequenceFlow"].push(s[w]),s.splice(w,1)):b++,f=b},f,v=0;v0&&G.forEach(function(se){Reflect.set(b,se,H[se])})}})};function v(b){i.set(b["-id"],b),Array.isArray(b)?b.forEach(function(w){v(w)}):typeof b=="object"&&f(b)}v(c[h])},function(h){if(h.indexOf("bpmn:")===0){var f=c[h];if(h==="bpmn:sequenceFlow"){var v=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=Gb(f,v)}else{var b=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(h==="bpmn:boundaryEvent"){var w=c[h],T=function(P){var H=P["-attachedToRef"],G=i.get(H);G["-boundaryEvents"]||(G["-boundaryEvents"]=[]),G["-boundaryEvents"].push(P["-id"])};Array.isArray(w)?w.forEach(function(P){T(P)}):T(w)}n=n.concat(zb(f,b,h))}}}])}var d=function(h,f,v){Object.keys(h).forEach(function(b){var w=v?"".concat(v,".").concat(b):b;f.has(w)?delete h[b]:typeof h[b]=="object"&&d(h[b],f,w)})};return n.forEach(function(h){var f,v;if(!((f=e==null?void 0:e.mapping)===null||f===void 0)&&f.in){var b=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,w=h.type;b[w]&&(h.type=b[w])}d(h,a.in,"")}),r.forEach(function(h){var f,v;if(!((f=e==null?void 0:e.mapping)===null||f===void 0)&&f.in){var b=(v=e==null?void 0:e.mapping)===null||v===void 0?void 0:v.in,w=h.type;b[w]&&(h.type=b[w])}d(h,a.in,"")}),{nodes:n,edges:r}}function zb(t,e,n){var r=[];if(Array.isArray(t))t.forEach(function(s){var l;Array.isArray(e)?l=e.find(function(u){return u["-bpmnElement"]===s["-id"]}):l=e;var a=Ha(l,n,s);r.push(a)});else{var i=void 0;Array.isArray(e)?i=e.find(function(s){return s["-bpmnElement"]===t["-id"]}):i=e;var o=Ha(i,n,t);r.push(o)}return r}function Ha(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],s=n["-name"],l=Ct.shapeConfigMap.get(e);l&&(r+=l.width/2,i+=l.height/2);var a={};Object.entries(n).forEach(function(h){var f=lt(h,2),v=f[0],b=f[1];gu.includes(v)||(a[v]=b)}),a=jr(a);var u;if(s&&(u={x:r,y:i,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(c["-x"])+Number(c["-width"])/2,u.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:a};return o&&(d.children=o),u&&(d.text=u),d}function Gb(t,e){var n=[];if(Array.isArray(t))t.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(s){return s["-bpmnElement"]===i["-id"]}):o=e,n.push(Wa(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===t["-id"]}):r=e,n.push(Wa(r,t))}return n}function Wa(t,e){var n,r=e["-name"]?"".concat(e["-name"]):"";if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split(` `).forEach(function(u){o0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Xb=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Tn=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Zn=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r=s-a/2&&i<=s+a/2&&r>=l-u/2&&o<=l+u/2}function i1(t,e,n,r){var i=t.minX,o=t.minY,s=t.maxX,l=t.maxY,a=e.x,u=e.y,c=e.width,d=e.height,h=i+c/2,f=o+d/2,v=s-c/2,b=l-d/2;return{x:a+n>=h&&a+n<=v,y:u+r>=f&&u+r<=b}}var $r=function(){return $r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},On=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;ro1){var c=i.lf.graphModel.nodes;i.topGroupZIndex=vr;var d=Wl(Qn(c,function(w){return!!w.isGroup}),"zIndex"),h=0;Ge(d,function(w){w.zIndex!==h&&(i.topGroupZIndex++,h=w.zIndex),w.setZIndex(i.topGroupZIndex)})}if(l&&a)if(u!=null&&u.isGroup){var f=u.children;Ge(Array.from(f),function(w){var T=i.lf.getNodeModelById(w);T==null||T.setSelected(!1)})}else{var v=i.nodeGroupMap.get(s.id);if(v){var b=i.lf.getNodeModelById(v);b!=null&&b.isSelected&&(u==null||u.setSelected(!1))}}},this.onNodeMove=function(o){var s=o.deltaX,l=o.deltaY,a=o.data,u=a.id,c=a.x,d=a.y,h=a.properties;if(h){var f=h.width,v=h.height,b=i.nodeGroupMap.get(u);if(b){var w=i.lf.getNodeModelById(b);if(!(!w||!w.isRestrict||!w.autoResize)){var T=c+s/2,P=d+l/2,H=T-f/2,G=P-v/2,se=T+f/2,U=P+v/2,D=!1,he=w.getBounds(),Q=Object.assign({},he);if(HQ.maxX&&(Q.maxX=se,D=!0),U>Q.maxY&&(Q.maxY=U,D=!0),!!D){var Ze=Q.minX+(Q.maxX-Q.minX)/2,Xe=Q.minY+(Q.maxY-Q.minY)/2,yt=Q.maxX-Q.minX,x=Q.maxY-Q.minY;w.moveTo(Ze,Xe),w.width=yt,w.height=x}}}}},this.onGraphRendered=function(o){var s=o.data;Ge(s.nodes,function(l){l.children&&Ge(l.children,function(a){i.nodeGroupMap.set(a,l.id)})}),i.calibrateTopGroupZIndex(s.nodes)},n.register(ko),this.lf=n,Xi(this,r),this.init()}return t.prototype.getGroupByNodeId=function(e){var n=this.nodeGroupMap.get(e);if(n)return this.lf.getNodeModelById(n)},t.prototype.getGroupByBounds=function(e,n){var r=this.lf.graphModel.nodes,i=Qn(r,function(a){return!!a.isGroup&&r1(e,a)&&a.id!==n.id}),o=i.length;if(o<=1)return i[0];for(var s=i[o-1],l=o-2;l>=0;l--)i[l].zIndex>s.zIndex&&(s=i[l]);return s},t.prototype.sendNodeToFront=function(e){var n=this;if(!(!e||!e.isGroup)&&(this.topGroupZIndex++,e.setZIndex(this.topGroupZIndex),e.children)){var r=e.children;Ge(Array.from(r),function(i){var o=n.lf.getNodeModelById(i);n.sendNodeToFront(o)})}},t.prototype.getMaxZIndex=function(e){var n=this,r=vr;if(e.isGroup&&(r=Math.max(r,e.zIndex)),e.children){var i=e.children;Ge(Array.from(i),function(o){var s=n.lf.getNodeModelById(o);if(s!=null&&s.isGroup){var l=n.getMaxZIndex(s);r=Math.max(r,l)}})}return r},t.prototype.calibrateTopGroupZIndex=function(e){var n=this,r=vr;if(Ge(e,function(l){var a=n.lf.getNodeModelById(l.id);if(a){var u=n.getMaxZIndex(a);u>r&&(r=u)}}),!(this.topGroupZIndex>=r)){var i=this.lf.graphModel.nodes,o=Qn(i,function(l){return!!l.isGroup}),s=this.topGroupZIndex;Ge(o,function(l){l.zIndex>s&&(s=l.zIndex)}),this.topGroupZIndex=s}},t.prototype.removeChildrenInGroupNodeData=function(e){var n,r=ki(e);return delete r.children,!((n=r.properties)===null||n===void 0)&&n.children&&delete r.properties.children,r},t.prototype.initGroupChildNodes=function(e,n,r,i){var o=this,s=[],l=[],a=[];Ge(Array.from(n),function(d){var h=o.lf.getNodeModelById(d);if(h){var f=h.children,v=h.getData(),b=ac.NODE_GROUP_COPY||"node:group-copy-add",w=sc(o.removeChildrenInGroupNodeData(v),i),T=o.lf.addNode(w,b);if(r.addChild(T.id),e[d]=T.id,s.push(T),a.push.apply(a,On([],Rn(On(On([],Rn(T.incoming.edges),!1),Rn(T.outgoing.edges),!1)),!1)),f instanceof Set){var P=o.initGroupChildNodes(e,f,T,i),H=P.childNodes,G=P.edgesData;s.push.apply(s,On([],Rn(H),!1)),l.push.apply(l,On([],Rn(G),!1))}}});var u=Qn(a,function(d){return Ar(e,d.sourceNodeId)&&Ar(e,d.targetNodeId)}),c=or(u,function(d){return d.getData()});return{childNodes:s,edgesData:l.concat(c)}},t.prototype.createEdge=function(e,n,r){var i,o,s=e.sourceNodeId,l=e.targetNodeId,a=(i=n[s])!==null&&i!==void 0?i:s,u=(o=n[l])!==null&&o!==void 0?o:l,c=ki(e);return e.id&&typeof e.text=="object"&&e.text!==null&&(c=Ku(e,r)),this.lf.graphModel.addEdge($r($r({},c),{sourceNodeId:a,targetNodeId:u}))},t.prototype.checkGroupBoundsWithChildren=function(e,n,r,i,o){if(e.children)for(var s=e.children,l=e.x,a=e.y,u=l+n/2,c=a+r/2,d=u-i/2,h=c-o/2,f=u+i/2,v=c+o/2,b=Array.from(s),w=0;w=U&&v>=D;if(!he)return!1}}return!0},t.prototype.init=function(){var e=this,n=this.lf,r=n.graphModel;r.addNodeMoveRules(function(i,o,s){if(i.isGroup)return!0;var l=e.nodeGroupMap.get(i.id),a=e.lf.getNodeModelById(l);if(a&&a.isRestrict){if(a.autoResize)return!0;var u=a.getBounds();return i1(u,i,o,s)}return!0}),r.addNodeResizeRules(function(i,o,s,l,a){return i.isGroup&&i.isRestrict?e.checkGroupBoundsWithChildren(i,o,s,l,a):!0}),r.dynamicGroup=this,n.on("node:add,node:drop,node:dnd-add",this.onNodeAddOrDrop),n.on("selection:drop",this.onSelectionDrop),n.on("node:delete",this.removeNodeFromGroup),n.on("node:drag,node:dnd-drag",this.onNodeDrag),n.on("selection:drag",this.onSelectionDrag),n.on("node:click",this.onNodeSelect),n.on("node:mousemove",this.onNodeMove),n.on("graph:rendered",this.onGraphRendered),n.on("group:add-node",this.onGroupAddNode),n.addElements=function(i,o){var s=i.nodes,l=i.edges;o===void 0&&(o=40);var a={},u={nodes:[],edges:[]},c=[];return Ge(s,function(d){var h,f,v=d.id,b=(f=(h=d.properties)===null||h===void 0?void 0:h.children)!==null&&f!==void 0?f:d.children,w=n.addNode(e.removeChildrenInGroupNodeData(d));if(v&&(a[v]=w.id),u.nodes.push(w),w.isGroup){var T=e.initGroupChildNodes(a,b,w,o).edgesData;c.push.apply(c,On([],Rn(T),!1))}}),Ge(c,function(d){e.createEdge(d,a,o)}),Ge(l,function(d){u.edges.push(e.createEdge(d,a,o))}),u},this.render()},t.prototype.render=function(){},t.prototype.destroy=function(){this.lf.off("node:add,node:drop,node:dnd-add",this.onNodeAddOrDrop),this.lf.off("selection:drop",this.onSelectionDrop),this.lf.off("node:delete",this.removeNodeFromGroup),this.lf.off("node:drag,node:dnd-drag",this.onNodeDrag),this.lf.off("selection:drag",this.onSelectionDrag),this.lf.off("node:click",this.onNodeSelect),this.lf.off("node:mousemove",this.onNodeMove),this.lf.off("graph:rendered",this.onGraphRendered),this.lf.off("group:add-node",this.onGroupAddNode)},t.pluginName="dynamicGroup",t})(),$a;(function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"})($a||($a={}));var a1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),nr=function(){return nr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},l1=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},u1=(function(t){a1(e,t);function e(n){var r=t.call(this,n)||this;r.textRef=tc(),r.setHoverOn=function(){var a=r.props.element;a.isDragging||r.state.isHovered||(r.setState({isHovered:!0}),a.setHovered(!0))},r.setHoverOff=function(){var a=r.props.element;r.state.isHovered&&(r.setState({isHovered:!1}),a.setHovered(!1))},r.handleMouseDown=function(a){var u,c=r.props,d=c.label,h=c.graphModel,f=h.editConfigModel.nodeTextDraggable;((u=d.draggable)!==null&&u!==void 0?u:f)&&!r.state.isDragging&&!r.state.isEditing&&r.stepDrag.handleMouseDown(a)},r.handleMouseUp=function(a){r.state.isDragging&&r.stepDrag.handleMouseUp(a)},r.handleDragging=function(a){var u=a.deltaX,c=a.deltaY;r.state.isDragging||r.setState({isDragging:!0});var d=r.props,h=d.label,f=d.graphModel,v=f.transformModel,b=l1(v.fixDeltaXY(u,c),2),w=b[0],T=b[1];r.setElementModelLabelInfo({x:h.x+w,y:h.y+T}),f.eventCenter.emit("label:drag",{data:h.getData(),model:h})},r.handleDragEnd=function(){r.setState({isDragging:!1})},r.handleClick=function(a){var u=r.props,c=u.label,d=u.element,h=u.graphModel;d.setSelected(!r.state.isSelected),r.setState({isSelected:!r.state.isSelected}),r.setElementModelLabelInfo({isSelected:!0}),h.eventCenter.emit("label:click",{data:c.getData(),e:a,model:d})},r.handleDbClick=function(a){var u=r.props,c=u.label,d=u.element,h=u.graphModel;if(h.eventCenter.emit("label:dblclick",{data:c.getData(),e:a,model:d}),!c.editable){d.setSelected(!0);return}if(d.setSelected(),d.setElementState(Io.TEXT_EDIT),r.setState({isEditing:!0}),r.textRef.current){r.textRef.current.contentEditable="true",r.textRef.current.focus();var f=document.createRange(),v=window.getSelection();f.selectNodeContents(r.textRef.current),f.collapse(!1),v==null||v.removeAllRanges(),v==null||v.addRange(f)}},r.handleBlur=function(a){var u=r.props,c=u.label,d=u.element,h=u.graphModel.eventCenter;h.emit("label:blur",{e:a,model:d,data:c.getData(),element:r.textRef.current}),r.setState({isDragging:!1,isHovered:!1,isSelected:!1})},r.handleInput=function(a){var u=r.props,c=u.label,d=u.graphModel;d.eventCenter.emit("label:input",{e:a,data:c.getData()})},r.reCalcLabelSize=function(){};var i=n.label,o=n.graphModel,s=o.gridSize,l=o.eventCenter;return r.stepDrag=new cs({onDragging:r.handleDragging,onDragEnd:r.handleDragEnd,step:s,eventType:"LABEL",model:i,eventCenter:l}),r.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},r}return e.prototype.setElementModelLabelInfo=function(n){var r=this.props,i=r.label,o=r.element,s=r.graphModel,l=o.properties._label,a=l,u=Ms(a,function(h){return h.id===i.id}),c=a[u];a[u]=nr(nr({},c),n);var d=s.getElement(o.id);d==null||d.setProperty("_label",a)},e.prototype.componentDidMount=function(){var n=this,r=this.props,i=r.label,o=r.element,s=r.graphModel;s.eventCenter.on("blank:click,node:click,edge:click,label:click",function(l){var a,u,c,d,h=l.data;if(((h==null?void 0:h.type)!=="label"||h.type==="label"&&h.id!==i.id||n.state.isSelected)&&n.setState({isSelected:!1}),((h==null?void 0:h.type)!=="label"||h.type=="label"&&h.id!==i.id)&&n.state.isEditing){n.setState({isEditing:!1});var f=(u=(a=n.textRef.current)===null||a===void 0?void 0:a.innerText)!==null&&u!==void 0?u:"",v=(d=(c=n.textRef.current)===null||c===void 0?void 0:c.innerHTML)!==null&&d!==void 0?d:"";n.setElementModelLabelInfo({value:f,content:v,isSelected:!1}),o.setElementState(Io.DEFAULT)}((h==null?void 0:h.type)!=="label"||h.type=="label"&&h.id!==i.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,r=this.props,i=r.label,o=r.element,s=r.graphModel,l=this.state,a=l.isDragging,u=l.isHovered,c=l.isSelected,d=l.isEditing,h=s.transformModel,f=h.getTransformStyle().transform,v=i.id,b=i.x,w=i.y,T=i.zIndex,P=i.vertical,H=i.style,G=i.rotate,se=i.content,U=i.labelWidth,D=i.textOverflowMode,he=U!=null?U:o.BaseType==="node"?o.width-20:80,Q={left:"".concat(b-he/2,"px"),top:"".concat(w-10,"px"),width:"".concat(he,"px"),height:"20px",zIndex:T!=null?T:1,transform:G?"".concat(f," rotate(").concat(G,"deg)"):"".concat(f," rotate(").concat(P?-.25:0,"turn)")};return Ve("div",{id:"element-container-".concat(v),className:Bo("lf-label-editor-container"),style:Q,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:Ve("div",{ref:this.textRef,id:"editor-container-".concat(v),className:Bo("lf-label-editor",(n={"lf-label-editor-dragging":a,"lf-label-editor-editing":d,"lf-label-editor-hover":!d&&(u||c)},n["lf-label-editor-".concat(D)]=!d,n)),onInput:this.handleInput,style:nr({maxWidth:"".concat(he,"px"),boxSizing:"border-box",display:"inline-block",background:d||o.BaseType==="edge"?"#fff":"transparent"},H),dangerouslySetInnerHTML:{__html:se}})})},e=s1([hs],e),e})(qr),Tt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},c1=rc,d1=(function(){function t(e,n,r){var i;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=r,this.id=(i=e.id)!==null&&i!==void 0?i:c1(),this.initLabelData(e)}return t.prototype.initLabelData=function(e){Xi(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:nc(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},Tt([ft],t.prototype,"x",void 0),Tt([ft],t.prototype,"y",void 0),Tt([ft],t.prototype,"content",void 0),Tt([ft],t.prototype,"value",void 0),Tt([ft],t.prototype,"rotate",void 0),Tt([ft],t.prototype,"style",void 0),Tt([ft],t.prototype,"zIndex",void 0),Tt([ft],t.prototype,"vertical",void 0),Tt([ft],t.prototype,"editable",void 0),Tt([ft],t.prototype,"draggable",void 0),Tt([ft],t.prototype,"labelWidth",void 0),Tt([ft],t.prototype,"textOverflowMode",void 0),t})(),Gi={exports:{}},Ci=Gi.exports,za;function h1(){return za||(za=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",r="prototype",i=e.Element[r],o=Object,s=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},l=Array[r].indexOf||function(v){for(var b=0,w=this.length;b1?he:this.data.length),Q,this.encoding)},u.toString=function(){return"[object Blob]"},u.close=function(){this.size=0,delete this.data},s})(e);e.Blob=function(i,o){var s=o&&o.type||"",l=new n;if(i)for(var a=0,u=i.length;a-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(a){return!!(l.isMac&&a.metaKey||!l.isMac&&a.ctrlKey)},isKey:function(a,u){var c=l.getKeyCode(a);return Array.isArray(u)===!1?c===u:u.indexOf(c)!==-1},getKeyCode:function(a){var u=a.which;return u===null&&(u=a.charCode!==null?a.charCode:a.keyCode),u},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 a=[!0].concat(Array.prototype.slice.call(arguments));return r.apply(this,a)},defaults:function(){var a=[!1].concat(Array.prototype.slice.call(arguments));return r.apply(this,a)},createLink:function(a,u,c,d){var h=a.createElement("a");return l.moveTextRangeIntoElement(u[0],u[u.length-1],h),h.setAttribute("href",c),d&&(d==="_blank"&&h.setAttribute("rel","noopener noreferrer"),h.setAttribute("target",d)),h},findOrCreateMatchingTextNodes:function(a,u,c){for(var d=a.createTreeWalker(u,NodeFilter.SHOW_ALL,null,!1),h=[],f=0,v=!1,b=null,w=null;(b=d.nextNode())!==null;)if(!(b.nodeType>3))if(b.nodeType===3){if(!v&&c.startc.end+1)throw new Error("PerformLinking overshot the target!");v&&h.push(w||b),f+=b.nodeValue.length,w!==null&&(f+=w.nodeValue.length,d.nextNode()),w=null}else b.tagName.toLowerCase()==="img"&&(!v&&c.start<=f&&(v=!0),v&&h.push(b));return h},splitStartNodeIfNeeded:function(a,u,c){return u!==c?a.splitText(u-c):null},splitEndNodeIfNeeded:function(a,u,c,d){var h,f;h=d+a.nodeValue.length+(u?u.nodeValue.length:0)-1,f=c-d-(u?a.nodeValue.length:0),h>=c&&d!==h&&f!==0&&(u||a).splitText(f)},splitByBlockElements:function(a){if(a.nodeType!==3&&a.nodeType!==1)return[];var u=[],c=e.util.blockContainerElementNames.join(",");if(a.nodeType===3||a.querySelectorAll(c).length===0)return[a];for(var d=0;d0)break;h=f.nextNode()}return h},findPreviousSibling:function(a){if(!a||l.isMediumEditorElement(a))return!1;for(var u=a.previousSibling;!u&&!l.isMediumEditorElement(a.parentNode);)a=a.parentNode,u=a.previousSibling;return u},isDescendant:function(a,u,c){if(!a||!u)return!1;if(a===u)return!!c;if(a.nodeType!==1)return!1;if(i||u.nodeType!==3)return a.contains(u);for(var d=u.parentNode;d!==null;){if(d===a)return!0;d=d.parentNode}return!1},isElement:function(a){return!!(a&&a.nodeType===1)},throttle:function(a,u){var c=50,d,h,f,v=null,b=0,w=function(){b=Date.now(),v=null,f=a.apply(d,h),v||(d=h=null)};return!u&&u!==0&&(u=c),function(){var T=Date.now(),P=u-(T-b);return d=this,h=arguments,P<=0||P>u?(v&&(clearTimeout(v),v=null),b=T,f=a.apply(d,h),v||(d=h=null)):v||(v=setTimeout(w,P)),f}},traverseUp:function(a,u){if(!a)return!1;do{if(a.nodeType===1){if(u(a))return a;if(l.isMediumEditorElement(a))return!1}a=a.parentNode}while(a);return!1},htmlEntities:function(a){return String(a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},insertHTMLCommand:function(a,u){var c,d,h,f,v,b,w,T=!1,P=["insertHTML",!1,u];if(!e.util.isEdge&&a.queryCommandSupported("insertHTML"))try{return a.execCommand.apply(a,P)}catch(H){}if(c=a.getSelection(),c.rangeCount){if(d=c.getRangeAt(0),w=d.commonAncestorContainer,l.isMediumEditorElement(w)&&!w.firstChild)d.selectNode(w.appendChild(a.createTextNode("")));else if(w.nodeType===3&&d.startOffset===0&&d.endOffset===w.nodeValue.length||w.nodeType!==3&&w.innerHTML===d.toString()){for(;!l.isMediumEditorElement(w)&&w.parentNode&&w.parentNode.childNodes.length===1&&!l.isMediumEditorElement(w.parentNode);)w=w.parentNode;d.selectNode(w)}for(d.deleteContents(),h=a.createElement("div"),h.innerHTML=u,f=a.createDocumentFragment();h.firstChild;)v=h.firstChild,b=f.appendChild(v);d.insertNode(f),b&&(d=d.cloneRange(),d.setStartAfter(b),d.collapse(!0),e.selection.selectRange(a,d)),T=!0}return a.execCommand.callListeners&&a.execCommand.callListeners(P,T),T},execFormatBlock:function(a,u){var c=l.getTopBlockContainer(e.selection.getSelectionStart(a)),d;if(u==="blockquote"){if(c&&(d=Array.prototype.slice.call(c.childNodes),d.some(function(h){return l.isBlockContainer(h)})))return a.execCommand("outdent",!1,null);if(l.isIE)return a.execCommand("indent",!1,u)}if(c&&u===c.nodeName.toLowerCase()&&(u="p"),l.isIE&&(u="<"+u+">"),c&&c.nodeName.toLowerCase()==="blockquote"){if(l.isIE&&u==="

")return a.execCommand("outdent",!1,u);if((l.isFF||l.isEdge)&&u==="p")return d=Array.prototype.slice.call(c.childNodes),d.some(function(h){return!l.isBlockContainer(h)})&&a.execCommand("formatBlock",!1,u),a.execCommand("outdent",!1,u)}return a.execCommand("formatBlock",!1,u)},setTargetBlank:function(a,u){var c,d=u||!1;if(a.nodeName.toLowerCase()==="a")a.target="_blank",a.rel="noopener noreferrer";else for(a=a.getElementsByTagName("a"),c=0;cd?(h=h.parentNode,c-=1):(f=f.parentNode,d-=1);for(;h!==f;)h=h.parentNode,f=f.parentNode;return h},isElementAtBeginningOfBlock:function(a){for(var u,c;!l.isBlockContainer(a)&&!l.isMediumEditorElement(a);){for(c=a;c=c.previousSibling;)if(u=c.nodeType===3?c.nodeValue:c.textContent,u.length>0)return!1;a=a.parentNode}return!0},isMediumEditorElement:function(a){return a&&a.getAttribute&&!!a.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(a){return l.traverseUp(a,function(u){return l.isMediumEditorElement(u)})},isBlockContainer:function(a){return a&&a.nodeType!==3&&l.blockContainerElementNames.indexOf(a.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(a){return l.traverseUp(a,function(u){return l.isBlockContainer(u)||l.isMediumEditorElement(u)})},getTopBlockContainer:function(a){var u=l.isBlockContainer(a)?a:!1;return l.traverseUp(a,function(c){return l.isBlockContainer(c)&&(u=c),!u&&l.isMediumEditorElement(c)?(u=c,!0):!1}),u},getFirstSelectableLeafNode:function(a){for(;a&&a.firstChild;)a=a.firstChild;if(a=l.traverseUp(a,function(c){return l.emptyElementNames.indexOf(c.nodeName.toLowerCase())===-1}),a.nodeName.toLowerCase()==="table"){var u=a.querySelector("th, td");u&&(a=u)}return a},getFirstTextNode:function(a){return l.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),l._getFirstTextNode(a)},_getFirstTextNode:function(a){if(a.nodeType===3)return a;for(var u=0;u0){var a=l.getRangeAt(0),u=a.cloneRange(),c;u.selectNodeContents(i),u.setEnd(a.startContainer,a.startOffset),c=u.toString().length,s={start:c,end:c+a.toString().length},this.doesRangeStartWithImages(a,o)&&(s.startsWithImage=!0);var d=this.getTrailingImageCount(i,s,a.endContainer,a.endOffset);if(d&&(s.trailingImageCount=d),c!==0){var h=this.getIndexRelativeToAdjacentEmptyBlocks(o,i,a.startContainer,a.startOffset);h!==-1&&(s.emptyBlocksIndex=h)}}return s},importSelection:function(i,o,s,l){if(!(!i||!o)){var a=s.createRange();a.setStart(o,0),a.collapse(!0);var u=o,c=[],d=0,h=!1,f=!1,v=0,b=!1,w,T=!1,P=null;for((l||i.startsWithImage||typeof i.emptyBlocksIndex!="undefined")&&(T=!0);!b&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!f)w=d+u.length,!h&&i.start>=d&&i.start<=w&&(T||i.start=d&&i.end<=w&&(i.trailingImageCount?f=!0:(a.setEnd(u,i.end-d),b=!0)),d=w;else{if(i.trailingImageCount&&f&&(u.nodeName.toLowerCase()==="img"&&v++,v===i.trailingImageCount)){for(var H=0;u.parentNode.childNodes[H]!==u;)H++;a.setEnd(u.parentNode,H+1),b=!0}if(!b&&u.nodeType===1)for(var G=u.childNodes.length-1;G>=0;)c.push(u.childNodes[G]),G-=1}b||(u=c.pop())}!h&&P&&(a.setStart(P,P.length),a.setEnd(P,P.length)),typeof i.emptyBlocksIndex!="undefined"&&(a=this.importSelectionMoveCursorPastBlocks(s,o,i.emptyBlocksIndex,a)),l&&(a=this.importSelectionMoveCursorPastAnchor(i,a)),this.selectRange(s,a)}},importSelectionMoveCursorPastAnchor:function(i,o){var s=function(d){return d.nodeName.toLowerCase()==="a"};if(i.start===i.end&&o.startContainer.nodeType===3&&o.startOffset===o.startContainer.nodeValue.length&&e.util.traverseUp(o.startContainer,s)){for(var l=o.startContainer,a=o.startContainer.parentNode;a!==null&&a.nodeName.toLowerCase()!=="a";)a.childNodes[a.childNodes.length-1]!==l?a=null:(l=a,a=a.parentNode);if(a!==null&&a.nodeName.toLowerCase()==="a"){for(var u=null,c=0;u===null&&c0)break;return d||(d=c),l.setStart(e.util.getFirstSelectableLeafNode(d),0),l},getIndexRelativeToAdjacentEmptyBlocks:function(i,o,s,l){if(s.textContent.length>0&&l>0)return-1;var a=s;if(a.nodeType!==3&&(a=s.childNodes[l]),a){if(!e.util.isElementAtBeginningOfBlock(a))return-1;var u=e.util.findPreviousSibling(a);if(u){if(u.nodeValue)return-1}else return-1}for(var c=e.util.getClosestBlockContainer(s),d=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,n,!1),h=0;d.nextNode();){var f=d.currentNode.textContent==="";if((f||h>0)&&(h+=1),d.currentNode===c)return h;f||(h=0)}return h},doesRangeStartWithImages:function(i,o){if(i.startOffset!==0||i.startContainer.nodeType!==1)return!1;if(i.startContainer.nodeName.toLowerCase()==="img")return!0;var s=i.startContainer.querySelector("img");if(!s)return!1;for(var l=o.createTreeWalker(i.startContainer,NodeFilter.SHOW_ALL,null,!1);l.nextNode();){var a=l.currentNode;if(a===s)break;if(a.nodeValue)return!1}return!0},getTrailingImageCount:function(i,o,s,l){if(l===0||s.nodeType!==1||s.nodeName.toLowerCase()!=="img"&&!s.querySelector("img"))return 0;for(var a=s.childNodes[l-1];a.hasChildNodes();)a=a.lastChild;for(var u=i,c=[],d=0,h=!1,f=!1,v=!1,b,w=0;!v&&u;){if(u.nodeType>3){u=c.pop();continue}if(u.nodeType===3&&!f)w=0,b=d+u.length,!h&&o.start>=d&&o.start<=b&&(h=!0),h&&o.end>=d&&o.end<=b&&(f=!0),d=b;else if(u.nodeName.toLowerCase()==="img"&&w++,u===a)v=!0;else if(u.nodeType===1)for(var T=u.childNodes.length-1;T>=0;)c.push(u.childNodes[T]),T-=1;v||(u=c.pop())}return w},selectionContainsContent:function(i){var o=i.getSelection();if(!o||o.isCollapsed||!o.rangeCount)return!1;if(o.toString().trim()!=="")return!0;var s=this.getSelectedParentElement(o.getRangeAt(0));return!!(s&&(s.nodeName.toLowerCase()==="img"||s.nodeType===1&&s.querySelector("img")))},selectionInContentEditableFalse:function(i){var o,s=this.findMatchingSelectionParent(function(l){var a=l&&l.getAttribute("contenteditable");return a==="true"&&(o=!0),l.nodeName!=="#text"&&a==="false"},i);return!o&&s},getSelectionHtml:function(i){var o,s="",l=i.getSelection(),a,u;if(l.rangeCount){for(u=i.createElement("div"),o=0,a=l.rangeCount;o-1?[i]:i,Array.prototype.forEach.call(i,function(c){c.addEventListener(o,s,l),this.events.push([c,o,s,l])}.bind(this))},detachDOMEvent:function(i,o,s,l){var a,u,c=this.base.options.contentWindow,d=this.base.options.ownerDocument;i&&(i=e.util.isElement(i)||[c,d].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,function(h){a=this.indexOfListener(h,o,s,l),a!==-1&&(u=this.events.splice(a,1)[0],u[0].removeEventListener(u[1],u[2],u[3]))}.bind(this)))},indexOfListener:function(i,o,s,l){var a,u,c;for(a=0,u=this.events.length;a0&&(i=o.indexOf(r.nodeName.toLowerCase())!==-1),!i&&this.style&&(s=this.style.value.split("|"),l=this.window.getComputedStyle(r,null).getPropertyValue(this.style.prop),s.forEach(function(a){this.knownState||(i=l.indexOf(a)!==-1,(i||this.style.prop!=="text-decoration")&&(this.knownState=i))},this)),i)}});n.isBuiltInButton=function(r){return typeof r=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(r)},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",contentFA:''},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"I",contentFA:''},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"U",contentFA:''},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"A",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"html",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}})(),(function(){var n=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.hideToolbarDefaultActions()},setToolbarPosition:function(){var r=this.base.getExtensionByName("toolbar");r&&r.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:"#",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=e.selection.getSelectionRange(this.document);return i.startContainer.nodeName.toLowerCase()==="a"||i.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(i),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(r){e.util.isKey(r,e.util.keyCode.K)&&e.util.isMetaCtrlKey(r)&&!r.shiftKey&&this.handleClick(r)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var r=[''];return r.push('',this.getEditorOption("buttonLabels")==="fontawesome"?'':this.formSaveLabel,""),r.push('',this.getEditorOption("buttonLabels")==="fontawesome"?'':this.formCloseLabel,""),this.targetCheckbox&&r.push('

','','","
"),this.customClassOption&&r.push('
','',"","
"),r.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(r){var i=this.getInput(),o=this.getAnchorTargetCheckbox(),s=this.getAnchorButtonCheckbox();if(r=r||{value:""},typeof r=="string"&&(r={value:r}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),i.value=r.value,i.focus(),o&&(o.checked=r.target==="_blank"),s){var l=r.buttonClass?r.buttonClass.split(" "):[];s.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 r=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox(),o={value:this.getInput().value.trim()};return this.linkValidation&&(o.value=this.checkLinkFormat(o.value)),o.target="_self",r&&r.checked&&(o.target="_blank"),i&&i.checked&&(o.buttonClass=this.customClassOption),o},doFormSave:function(){var r=this.getFormOpts();this.completeFormSave(r)},completeFormSave:function(r){this.base.restoreSelection(),this.execAction(this.action,r),this.base.checkSelection()},ensureEncodedUri:function(r){return r===decodeURI(r)?encodeURI(r):r},ensureEncodedUriComponent:function(r){return r===decodeURIComponent(r)?encodeURIComponent(r):r},ensureEncodedParam:function(r){var i=r.split("="),o=i[0],s=i[1];return o+(s===void 0?"":"="+this.ensureEncodedUriComponent(s))},ensureEncodedQuery:function(r){return r.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(r){var i=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,o=i.test(r),s="",l=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,a=r.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),u=a[1],c=a[2],d=a[3];if(l.test(r))return"tel:"+r;if(!o){var h=u.split("/")[0];(h.match(/.+(\.|:).+/)||h==="localhost")&&(s="http://")}return s+this.ensureEncodedUri(u)+(c===void 0?"":"?"+this.ensureEncodedQuery(c))+(d===void 0?"":"#"+d)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(r){var i=r.querySelector(".medium-editor-toolbar-close"),o=r.querySelector(".medium-editor-toolbar-save"),s=r.querySelector(".medium-editor-toolbar-input");this.on(r,"click",this.handleFormClick.bind(this)),this.on(s,"keyup",this.handleTextboxKeyup.bind(this)),this.on(i,"click",this.handleCloseClick.bind(this)),this.on(o,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var r=this.document,i=r.createElement("div");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),i.innerHTML=this.getTemplate(),this.attachFormEvents(i),i},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(r){if(r.keyCode===e.util.keyCode.ENTER){r.preventDefault(),this.doFormSave();return}r.keyCode===e.util.keyCode.ESCAPE&&(r.preventDefault(),this.doFormCancel())},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.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 r=this.document.createElement("div");return r.id="medium-editor-anchor-preview-"+this.getEditorId(),r.className="medium-editor-anchor-preview",r.innerHTML=this.getTemplate(),this.on(r,"click",this.handleClick.bind(this)),r},getTemplate:function(){return'
'},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(r){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||r.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=r.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=r.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=r,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(r){r=r||this.activeAnchor;var i=this.window.innerWidth,o=this.anchorPreview.offsetHeight,s=r.getBoundingClientRect(),l=this.diffLeft,a=this.diffTop,u=this.getEditorOption("elementsContainer"),c=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,d={},h,f,v,b,w;h=this.anchorPreview.offsetWidth/2;var T=this.base.getExtensionByName("toolbar");T&&(l=T.diffLeft,a=T.diffTop),f=l-h,c?(b=u.getBoundingClientRect(),["top","left"].forEach(function(P){d[P]=s[P]-b[P]}),d.width=s.width,d.height=s.height,s=d,i=b.width,w=u.scrollTop):w=this.window.pageYOffset,v=s.left+s.width/2,w+=o+s.top+s.height-a-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(w)+"px",this.anchorPreview.style.right="initial",vthis.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,r,i,o,s;n=[" "," ",` `,"\r"," "," "," "," "," ","\u2028","\u2029"],r="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",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i"),s=new RegExp(i,"gi");function l(u){return!e.util.getClosestTag(u,"a")}var a=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 u=0,c=0;c0&&b!==null;)f=d.currentNode,v=f.nodeValue,v.length>c?(b=f.splitText(v.length-c),c=0):(b=d.previousNode(),c-=v.length);return b},performLinkingWithinElement:function(u){for(var c=this.findLinkableText(u),d=!1,h=0;h1;)h.appendChild(d.childNodes[1])}});e.extensions.autoLink=a})(),(function(){var n="medium-editor-dragover";function r(o){var s=e.util.getContainerEditorElement(o),l=Array.prototype.slice.call(s.parentElement.querySelectorAll("."+n));l.forEach(function(a){a.classList.remove(n)})}var i=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(o){o.preventDefault(),o.dataTransfer.dropEffect="copy";var s=o.target.classList?o.target:o.target.parentElement;r(s),o.type==="dragover"&&s.classList.add(n)},handleDrop:function(o){o.preventDefault(),o.stopPropagation(),this.base.selectElement(o.target);var s=this.base.exportSelection();s.start=s.end,this.base.importSelection(s),o.dataTransfer.files&&Array.prototype.slice.call(o.dataTransfer.files).forEach(function(l){this.isAllowedFile(l)&&l.type.match("image")&&this.insertImageFile(l)},this),r(o.target)},isAllowedFile:function(o){return this.allowedTypes.some(function(s){return!!o.type.match(s)})},insertImageFile:function(o){if(typeof FileReader=="function"){var s=new FileReader;s.readAsDataURL(o),s.addEventListener("load",function(l){var a=this.document.createElement("img");a.src=l.target.result,e.util.insertHTMLCommand(this.document,a.outerHTML)}.bind(this))}}});e.extensions.fileDragging=i})(),(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(r){var i=r.key.charCodeAt(0);this.keys[i]||(this.keys[i]=[]),this.keys[i].push(r)},this)},handleKeydown:function(r){var i=e.util.getKeyCode(r);if(this.keys[i]){var o=e.util.isMetaCtrlKey(r),s=!!r.shiftKey,l=!!r.altKey;this.keys[i].forEach(function(a){a.meta===o&&a.shift===s&&(a.alt===l||a.alt===void 0)&&(r.preventDefault(),r.stopPropagation(),typeof a.command=="function"?a.command.apply(this):a.command!==!1&&this.execAction(a.command))},this)}}});e.extensions.keyboardCommands=n})(),(function(){var n=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontName")+"";this.showForm(i)}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(r){var i=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.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 r=this.document,i=r.createElement("div"),o=r.createElement("select"),s=r.createElement("a"),l=r.createElement("a"),a;i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this));for(var u=0;u
':"✓",i.appendChild(l),this.on(l,"click",this.handleSaveClick.bind(this),!0),s.setAttribute("href","#"),s.className="medium-editor-toobar-close",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"×",i.appendChild(s),this.on(s,"click",this.handleCloseClick.bind(this)),i},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("face")&&r.removeAttribute("face")})},handleFontChange:function(){var r=this.getSelect().value;r===""?this.clearFontName():this.execAction("fontName",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontName=n})(),(function(){var n=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontSize")+"";this.showForm(i)}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(r){var i=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.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 r=this.document,i=r.createElement("div"),o=r.createElement("input"),s=r.createElement("a"),l=r.createElement("a");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this)),o.setAttribute("type","range"),o.setAttribute("min","1"),o.setAttribute("max","7"),o.className="medium-editor-toolbar-input",i.appendChild(o),this.on(o,"change",this.handleSliderChange.bind(this)),l.setAttribute("href","#"),l.className="medium-editor-toobar-save",l.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"✓",i.appendChild(l),this.on(l,"click",this.handleSaveClick.bind(this),!0),s.setAttribute("href","#"),s.className="medium-editor-toobar-close",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'':"×",i.appendChild(s),this.on(s,"click",this.handleCloseClick.bind(this)),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("size")&&r.removeAttribute("size")})},handleSliderChange:function(){var r=this.getInput().value;r==="4"?this.clearFontSize():this.execAction("fontSize",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=n})(),(function(){var n="%ME_PASTEBIN%",r=null,i=null,o=function(u){u.stopPropagation()};function s(){return[[new RegExp(/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/|/g),""],[new RegExp(/
$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(]*>)?$/gi),""],[new RegExp(/\s+<\/span>/g)," "],[new RegExp(/
/g),"
"],[new RegExp(/]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),''],[new RegExp(/]*font-style:italic[^>]*>/gi),''],[new RegExp(/]*font-weight:(bold|700)[^>]*>/gi),''],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),''],[new RegExp(/<\/p>\n+/gi),"

"],[new RegExp(/\n+

/gi),""],[new RegExp(/(((?!/gi),"$1"]]}function l(u,c,d){var h=u.clipboardData||c.clipboardData||d.dataTransfer,f={};if(!h)return f;if(h.getData){var v=h.getData("Text");v&&v.length>0&&(f["text/plain"]=v)}if(h.types)for(var b=0;b1)for(v=0;v"+e.util.htmlEntities(h[v])+"

");else f=e.util.htmlEntities(h[0]);e.util.insertHTMLCommand(this.document,f)}},handlePasteBinPaste:function(u){if(u.defaultPrevented){this.removePasteBin();return}var c=l(u,this.window,this.document),d=c["text/html"],h=c["text/plain"],f=i;if(!this.cleanPastedHTML||d){u.preventDefault(),this.removePasteBin(),this.doPaste(d,h,f),this.trigger("editablePaste",{currentTarget:f,target:f},f);return}setTimeout(function(){this.cleanPastedHTML&&(d=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(d,h,f),this.trigger("editablePaste",{currentTarget:f,target:f},f)}.bind(this),0)},handleKeydown:function(u,c){e.util.isKey(u,e.util.keyCode.V)&&e.util.isMetaCtrlKey(u)&&(u.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(c))},createPasteBin:function(u){var c,d=e.selection.getSelectionRange(this.document),h=this.window.pageYOffset;i=u,d&&(c=d.getClientRects(),c.length?h+=c[0].top:d.startContainer.getBoundingClientRect!==void 0?h+=d.startContainer.getBoundingClientRect().top:h+=d.getBoundingClientRect().top),r=d;var f=this.document.createElement("div");f.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),f.setAttribute("style","border: 1px red solid; position: absolute; top: "+h+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),f.setAttribute("contentEditable",!0),f.innerHTML=n,this.document.body.appendChild(f),this.on(f,"focus",o),this.on(f,"focusin",o),this.on(f,"focusout",o),f.focus(),e.selection.selectNode(f,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(f,"paste",this.boundHandlePaste)},removePasteBin:function(){r!==null&&(e.selection.selectRange(this.document,r),r=null),i!==null&&(i=null);var u=this.getPasteBin();u&&u&&(this.off(u,"focus",o),this.off(u,"focusin",o),this.off(u,"focusout",o),this.off(u,"paste",this.boundHandlePaste),u.parentElement.removeChild(u))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var u=this.getPasteBin();if(!u||u.firstChild&&u.firstChild.id==="mcepastebin")return!1;var c=u.innerHTML;return!c||c===n?!1:c},cleanPaste:function(u){var c,d,h,f,v=/"+u.split("

").join("

")+"

",d=h.querySelectorAll("a,p,div,br"),c=0;c"+d.innerHTML+"
":h.innerHTML=d.innerHTML,d.parentNode.replaceChild(h,d);for(f=u.querySelectorAll("span"),c=0;c0&&(s[0].classList.add(this.firstButtonClass),s[s.length-1].classList.add(this.lastButtonClass)),r},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(r){if(r&&r.target&&e.util.isDescendant(this.getToolbarElement(),r.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(r){r.hasForm&&r.isDisplayed()&&r.hideForm()})},multipleBlockElementsSelected:function(){var r=/<[^\/>][^>]*><\/[^>]+>/gim,i=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),o=e.selection.getSelectionHtml(this.document).replace(r,""),s=o.match(i);return!!s&&s.length>1},modifySelection:function(){var r=this.window.getSelection(),i=r.getRangeAt(0);if(this.standardizeSelectionStart&&i.startContainer.nodeValue&&i.startOffset===i.startContainer.nodeValue.length){var o=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),i.startContainer,this.document);if(o){for(var s=0;o.nodeValue.substr(s,1).trim().length===0;)s=s+1;i=e.selection.select(this.document,o,s,i.endContainer,i.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var r=e.selection.getSelectionElement(this.window);if(!r||this.getEditorElements().indexOf(r)===-1||r.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(r){typeof r.isActive=="function"&&typeof r.setInactive=="function"&&r.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var r=[],i=null,o=e.selection.getSelectionRange(this.document),s,l=function(a){typeof a.checkState=="function"?a.checkState(s):typeof a.isActive=="function"&&typeof a.isAlreadyApplied=="function"&&typeof a.setActive=="function"&&!a.isActive()&&a.isAlreadyApplied(s)&&a.setActive()};if(o&&(this.forEachExtension(function(a){if(typeof a.queryCommandState=="function"&&(i=a.queryCommandState(),i!==null)){i&&typeof a.setActive=="function"&&a.setActive();return}r.push(a)}),s=e.selection.getSelectedParentElement(o),!!this.getEditorElements().some(function(a){return e.util.isDescendant(a,s,!0)})))for(;s&&(r.forEach(l),!e.util.isMediumEditorElement(s));)s=s.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var r=this.base.getFocusedElement(),i=this.window.getSelection();if(!r)return this;(this.static||!i.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(r):this.positionToolbar(i)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(r){this.getToolbarElement().style.left="0";var i=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,s=this.getToolbarElement(),l=r.getBoundingClientRect(),a=l.top+i,u=l.left+l.width/2,c=s.offsetHeight,d=s.offsetWidth,h=d/2,f;switch(this.sticky?i>a+r.offsetHeight-c-this.stickyTopOffset?(s.style.top=a+r.offsetHeight-c+"px",s.classList.remove("medium-editor-sticky-toolbar")):i>a-c-this.stickyTopOffset?(s.classList.add("medium-editor-sticky-toolbar"),s.style.top=this.stickyTopOffset+"px"):(s.classList.remove("medium-editor-sticky-toolbar"),s.style.top=a-c+"px"):s.style.top=a-c+"px",this.align){case"left":f=l.left;break;case"right":f=l.right-d;break;case"center":f=u-h;break}f<0?f=0:f+d>o&&(f=o-Math.ceil(d)-1),s.style.left=f+"px"},positionToolbar:function(r){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var i=r.getRangeAt(0),o=i.getBoundingClientRect();(!o||o.height===0&&o.width===0&&i.startContainer===i.endContainer)&&(i.startContainer.nodeType===1&&i.startContainer.querySelector("img")?o=i.startContainer.querySelector("img").getBoundingClientRect():o=i.startContainer.getBoundingClientRect());var s=this.window.innerWidth,l=this.getToolbarElement(),a=l.offsetHeight,u=l.offsetWidth,c=u/2,d=50,h=this.diffLeft-c,f=this.getEditorOption("elementsContainer"),v=["absolute","fixed"].indexOf(window.getComputedStyle(f).getPropertyValue("position"))>-1,b={},w={},T,P;v?(P=f.getBoundingClientRect(),["top","left"].forEach(function(H){w[H]=o[H]-P[H]}),w.width=o.width,w.height=o.height,o=w,s=P.width,b.top=f.scrollTop):b.top=this.window.pageYOffset,T=o.left+o.width/2,b.top+=o.top-a,o.top'),l.onload=function(){var u=this.document.getElementById(a);u&&(u.removeAttribute("id"),u.removeAttribute("class"),u.src=l.result)}.bind(this)}}.bind(this))),r.target.classList.remove(i)}});e.extensions.imageDragging=n})(),(function(){function n(x){var O=e.selection.getSelectionStart(this.options.ownerDocument),R=O.textContent,q=e.selection.getCaretOffsets(O);(R[q.left-1]===void 0||R[q.left-1].trim()===""||R[q.left]!==void 0&&R[q.left].trim()==="")&&x.preventDefault()}function r(x,O){if(this.options.disableReturn||O.getAttribute("data-disable-return"))x.preventDefault();else if(this.options.disableDoubleReturn||O.getAttribute("data-disable-double-return")){var R=e.selection.getSelectionStart(this.options.ownerDocument);(R&&R.textContent.trim()===""&&R.nodeName.toLowerCase()!=="li"||R.previousElementSibling&&R.previousElementSibling.nodeName.toLowerCase()!=="br"&&R.previousElementSibling.textContent.trim()==="")&&x.preventDefault()}}function i(x){var O=e.selection.getSelectionStart(this.options.ownerDocument),R=O&&O.nodeName.toLowerCase();R==="pre"&&(x.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(O)&&(x.preventDefault(),x.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(x){var O,R=e.selection.getSelectionStart(this.options.ownerDocument),q=R.nodeName.toLowerCase(),me=/^(\s+|)?$/i,we=/h\d/i;e.util.isKey(x,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&R.previousElementSibling&&we.test(q)&&e.selection.getCaretOffsets(R).left===0?e.util.isKey(x,e.util.keyCode.BACKSPACE)&&me.test(R.previousElementSibling.innerHTML)?(R.previousElementSibling.parentNode.removeChild(R.previousElementSibling),x.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(x,e.util.keyCode.ENTER)&&(O=this.options.ownerDocument.createElement("p"),O.innerHTML="
",R.previousElementSibling.parentNode.insertBefore(O,R),x.preventDefault()):e.util.isKey(x,e.util.keyCode.DELETE)&&R.nextElementSibling&&R.previousElementSibling&&!we.test(q)&&me.test(R.innerHTML)&&we.test(R.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,R.nextElementSibling),R.previousElementSibling.parentNode.removeChild(R),x.preventDefault()):e.util.isKey(x,e.util.keyCode.BACKSPACE)&&q==="li"&&me.test(R.innerHTML)&&!R.previousElementSibling&&!R.parentElement.previousElementSibling&&R.nextElementSibling&&R.nextElementSibling.nodeName.toLowerCase()==="li"?(O=this.options.ownerDocument.createElement("p"),O.innerHTML="
",R.parentElement.parentElement.insertBefore(O,R.parentElement),e.selection.moveCursor(this.options.ownerDocument,O),R.parentElement.removeChild(R),x.preventDefault()):e.util.isKey(x,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(R,"blockquote")!==!1&&e.selection.getCaretOffsets(R).left===0?(x.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(x,e.util.keyCode.ENTER)&&e.util.getClosestTag(R,"blockquote")!==!1&&e.selection.getCaretOffsets(R).right===0?(O=this.options.ownerDocument.createElement("p"),O.innerHTML="
",R.parentElement.insertBefore(O,R.nextSibling),e.selection.moveCursor(this.options.ownerDocument,O),x.preventDefault()):e.util.isKey(x,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(R.parentElement)&&!R.previousElementSibling&&R.nextElementSibling&&me.test(R.innerHTML)&&(x.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,R.nextSibling),R.parentElement.removeChild(R))}function s(x){var O=e.selection.getSelectionStart(this.options.ownerDocument),R;O&&(e.util.isMediumEditorElement(O)&&O.children.length===0&&!e.util.isBlockContainer(O)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(x,e.util.keyCode.ENTER)&&!e.util.isListItem(O)&&!e.util.isBlockContainer(O)&&(R=O.nodeName.toLowerCase(),R==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!x.shiftKey&&!x.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function l(x,O){var R=O.parentNode.querySelector('textarea[medium-editor-textarea-id="'+O.getAttribute("medium-editor-textarea-id")+'"]');R&&(R.value=O.innerHTML.trim())}function a(x){x._mediumEditors||(x._mediumEditors=[null]),this.id||(this.id=x._mediumEditors.length),x._mediumEditors[this.id]=this}function u(x){!x._mediumEditors||!x._mediumEditors[this.id]||(x._mediumEditors[this.id]=null)}function c(x,O,R){var q=[];if(x||(x=[]),typeof x=="string"&&(x=O.querySelectorAll(x)),e.util.isElement(x)&&(x=[x]),R)for(var me=0;me=0&&(R=e.selection.exportSelection(x,this.options.ownerDocument)),R!==null&&O!==0&&(R.editableElementIndex=O),R},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(x,O){if(x){var R=this.elements[x.editableElementIndex||0];e.selection.importSelection(x,R,this.options.ownerDocument,O)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(x){var O=e.selection.getSelectionElement(this.options.contentWindow),R={},q;if(this.elements.indexOf(O)!==-1){try{if(this.events.disableCustomEvent("editableInput"),x.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),q=x.url||x.value,q&&q.trim().length>0){var me=this.options.contentWindow.getSelection();if(me){var we=me.getRangeAt(0),et=we.commonAncestorContainer,Ye,Pt,Ft,Yt;if(we.endContainer.nodeType===3&&we.startContainer.nodeType!==3&&we.startOffset===0&&we.startContainer.firstChild===we.endContainer&&(et=we.endContainer),Pt=e.util.getClosestBlockContainer(we.startContainer),Ft=e.util.getClosestBlockContainer(we.endContainer),et.nodeType!==3&&et.textContent.length!==0&&Pt===Ft){var ut=Pt||O,bt=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),Ye=this.exportSelection(),bt.appendChild(ut.cloneNode(!0)),O===ut?e.selection.select(this.options.ownerDocument,ut.firstChild,0,ut.lastChild,ut.lastChild.nodeType===3?ut.lastChild.nodeValue.length:ut.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,ut,0,ut,ut.childNodes.length);var N=this.exportSelection();Yt=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,bt,{start:Ye.start-N.start,end:Ye.end-N.start,editableElementIndex:Ye.editableElementIndex}),Yt.length===0&&(bt=this.options.ownerDocument.createDocumentFragment(),bt.appendChild(et.cloneNode(!0)),Yt=[bt.firstChild.firstChild,bt.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,Yt,q.trim());var W=(bt.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,bt.firstChild.innerHTML.replace(/^\s+/,"")),Ye.start-=W,Ye.end-=W,this.importSelection(Ye)}else this.options.ownerDocument.execCommand("createLink",!1,q);this.options.targetBlank||x.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),q):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),q),x.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),x.buttonClass)}}if(this.options.targetBlank||x.target==="_blank"||x.buttonClass){R=this.options.ownerDocument.createEvent("HTMLEvents"),R.initEvent("input",!0,!0,this.options.contentWindow);for(var F=0,V=this.elements.length;F1?r[1]:"";return{major:parseInt(i[0],10),minor:parseInt(i[1],10),revision:parseInt(i[2],10),preRelease:o,toString:function(){return[i[0],i[1],i[2]].join(".")+(o?"-"+o:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Gi)),Gi.exports}var f1=h1();const yr=fs(f1);/*! * 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 Mo=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Po=(function(){function t(e,n){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:1,n=e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString();return n||"0"}var g1=(function(){function t(e,n,r,i){Mo(this,t);var o=this;function s(a){if(a.startsWith("hsl")){var u=a.match(/([\-\d\.e]+)/g).map(Number),c=br(u,4),d=c[0],h=c[1],f=c[2],v=c[3];v===void 0&&(v=1),d/=360,h/=100,f/=100,o.hsla=[d,h,f,v]}else if(a.startsWith("rgb")){var b=a.match(/([\-\d\.e]+)/g).map(Number),w=br(b,4),T=w[0],P=w[1],H=w[2],G=w[3];G===void 0&&(G=1),o.rgba=[T,P,H,G]}else a.startsWith("#")?o.rgba=t.hexToRgb(a):o.rgba=t.nameToRgb(a)||t.hexToRgb(a)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(r===void 0){var l=e&&""+e;l&&s(l.toLowerCase())}else this.rgba=[e,n,r,i===void 0?1:i]}return Po(t,[{key:"printRGB",value:function(e){var n=e?this.rgba:this.rgba.slice(0,3),r=n.map(function(i,o){return Ga(i,o===3?3:0)});return e?"rgba("+r+")":"rgb("+r+")"}},{key:"printHSL",value:function(e){var n=[360,100,100,1],r=["","%","%",""],i=e?this.hsla:this.hsla.slice(0,3),o=i.map(function(s,l){return Ga(s*n[l],l===3?3:1)+r[l]});return e?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(e){var n=this.hex;return e?n:n.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(e){e.length===3&&(e[3]=1),this._rgba=e,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(e){e.length===3&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var e=this.rgba,n=e.map(function(r,i){return i<3?r.toString(16):Math.round(r*255).toString(16)});return"#"+n.map(function(r){return r.padStart(2,"0")}).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(e){var n=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!n.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var r=n.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(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),r=p1[n];return r===void 0?r:t.hexToRgb(r.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var n=br(e,4),r=n[0],i=n[1],o=n[2],s=n[3];r/=255,i/=255,o/=255;var l=Math.max(r,i,o),a=Math.min(r,i,o),u=void 0,c=void 0,d=(l+a)/2;if(l===a)u=c=0;else{var h=l-a;switch(c=d>.5?h/(2-l-a):h/(l+a),l){case r:u=(i-o)/h+(i1&&(w-=1),w<.16666666666666666?v+(b-v)*6*w:w<.5?b:w<.6666666666666666?v+(b-v)*(.6666666666666666-w)*6:v},d=o<.5?o*(1+i):o+i-o*i,h=2*o-d;l=c(h,d,r+1/3),a=c(h,d,r),u=c(h,d,r-1/3)}var f=[l*255,a*255,u*255].map(Math.round);return f[3]=s,f}}]),t})(),m1=(function(){function t(){Mo(this,t),this._events=[]}return Po(t,[{key:"add",value:function(e,n,r){e.addEventListener(n,r,!1),this._events.push({target:e,type:n,handler:r})}},{key:"remove",value:function(e,n,r){this._events=this._events.filter(function(i){var o=!0;return e&&e!==i.target&&(o=!1),n&&n!==i.type&&(o=!1),r&&r!==i.handler&&(o=!1),o&&t._doRemove(i.target,i.type,i.handler),!o})}},{key:"destroy",value:function(){this._events.forEach(function(e){return t._doRemove(e.target,e.type,e.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(e,n,r){e.removeEventListener(n,r,!1)}}]),t})();function v1(t){var e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}function _i(t,e,n){var r=!1;function i(a,u,c){return Math.max(u,Math.min(a,c))}function o(a,u,c){if(c&&(r=!0),!!r){a.preventDefault();var d=e.getBoundingClientRect(),h=d.width,f=d.height,v=u.clientX,b=u.clientY,w=i(v-d.left,0,h),T=i(b-d.top,0,f);n(w/h,T/f)}}function s(a,u){var c=a.buttons===void 0?a.which:a.buttons;c===1?o(a,a,u):r=!1}function l(a,u){a.touches.length===1?o(a,a.touches[0],u):r=!1}t.add(e,"mousedown",function(a){s(a,!0)}),t.add(e,"touchstart",function(a){l(a,!0)}),t.add(window,"mousemove",s),t.add(e,"touchmove",l),t.add(window,"mouseup",function(a){r=!1}),t.add(e,"touchend",function(a){r=!1}),t.add(e,"touchcancel",function(a){r=!1})}var y1=`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`,b1=360,vu="keydown",wr="mousedown",Ai="focusin";function Ht(t,e){return(e||document).querySelector(t)}function w1(t){t.preventDefault(),t.stopPropagation()}function Si(t,e,n,r,i){t.add(e,vu,function(o){n.indexOf(o.key)>=0&&r(o)})}var yu=(function(){function t(e){Mo(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new m1,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return Po(t,[{key:"setOptions",value:function(e){var n=this;if(!e)return;var r=this.settings;function i(a,u,c){for(var d in a)u[d]=a[d]}if(e instanceof HTMLElement)r.parent=e;else{r.parent&&e.parent&&r.parent!==e.parent&&(this._events.remove(r.parent),this._popupInited=!1),i(e,r),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var o=e.color||e.colour;o&&this._setColor(o)}var s=r.parent;if(s&&r.popup&&!this._popupInited){var l=function(a){return n.openHandler(a)};this._events.add(s,"click",l),Si(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else e.parent&&!r.popup&&this.show()}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var n=e&&e.type===vu?this._domEdit:this.domElement;setTimeout(function(){return n.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var n=e&&e.type,r=!1;if(!e)r=!0;else if(n===wr||n===Ai){var i=(this.__containedEvent||0)+100;e.timeStamp>i&&(r=!0)}else w1(e),r=!0;r&&this.hide()&&(this.settings.parent.style.pointerEvents="",n!==wr&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,n){this.closeHandler(),this.setOptions(e),n&&this.openHandler()}},{key:"setColor",value:function(e,n){this._setColor(e,{silent:n})}},{key:"_setColor",value:function(e,n){if(typeof e=="string"&&(e=e.trim()),!!e){n=n||{};var r=void 0;try{r=new g1(e)}catch(o){if(n.failSilently)return;throw o}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,n)}}},{key:"setColour",value:function(e,n){this.setColor(e,n)}},{key:"show",value:function(){var e=this.settings.parent;if(!e)return!1;if(this.domElement){var n=this._toggleDOM(!0);return this._setPosition(),n}var r=this.settings.template||'
',i=v1(r);return this.domElement=i,this._domH=Ht(".picker_hue",i),this._domSL=Ht(".picker_sl",i),this._domA=Ht(".picker_alpha",i),this._domEdit=Ht(".picker_editor input",i),this._domSample=Ht(".picker_sample",i),this._domOkay=Ht(".picker_done button",i),this._domCancel=Ht(".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 e=this,n=this,r=this.domElement,i=this._events;function o(a,u,c){i.add(a,u,c)}o(r,"click",function(a){return a.preventDefault()}),_i(i,this._domH,function(a,u){return n._setHSLA(a)}),_i(i,this._domSL,function(a,u){return n._setHSLA(null,a,1-u)}),this.settings.alpha&&_i(i,this._domA,function(a,u){return n._setHSLA(null,null,null,1-u)});var s=this._domEdit;o(s,"input",function(a){n._setColor(this.value,{fromEditor:!0,failSilently:!0})}),o(s,"focus",function(a){var u=this;u.selectionStart===u.selectionEnd&&u.select()}),this._ifPopup(function(){var a=function(c){return e.closeHandler(c)};o(window,wr,a),o(window,Ai,a),Si(i,r,["Esc","Escape"],a);var u=function(c){e.__containedEvent=c.timeStamp};o(r,wr,u),o(r,Ai,u),o(e._domCancel,"click",a)});var l=function(a){e._ifPopup(function(){return e.closeHandler(a)}),e.onDone&&e.onDone(e.colour)};o(this._domOkay,"click",l),Si(i,r,["Enter"],l)}},{key:"_setPosition",value:function(){var e=this.settings.parent,n=this.domElement;e!==n.parentNode&&e.appendChild(n),this._ifPopup(function(r){getComputedStyle(e).position==="static"&&(e.style.position="relative");var i=r===!0?"popup_right":"popup_"+r;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(o){o===i?n.classList.add(o):n.classList.remove(o)}),n.classList.add(i)})}},{key:"_setHSLA",value:function(e,n,r,i,o){o=o||{};var s=this.colour,l=s.hsla;[e,n,r,i].forEach(function(a,u){(a||a===0)&&(l[u]=a)}),s.hsla=l,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(s)}},{key:"_updateUI",value:function(e){if(!this.domElement)return;e=e||{};var n=this.colour,r=n.hsla,i="hsl("+r[0]*b1+", 100%, 50%)",o=n.hslString,s=n.hslaString,l=this._domH,a=this._domSL,u=this._domA,c=Ht(".picker_selector",l),d=Ht(".picker_selector",a),h=Ht(".picker_selector",u);function f(se,U,D){U.style.left=D*100+"%"}function v(se,U,D){U.style.top=D*100+"%"}f(l,c,r[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,f(a,d,r[1]),v(a,d,1-r[2]),a.style.color=o,v(u,h,1-r[3]);var b=o,w=b.replace("hsl","hsla").replace(")",", 0)"),T="linear-gradient("+[b,w]+")";if(this._domA.style.background=T+", "+y1,!e.fromEditor){var P=this.settings.editorFormat,H=this.settings.alpha,G=void 0;switch(P){case"rgb":G=n.printRGB(H);break;case"hsl":G=n.printHSL(H);break;default:G=n.printHex(H)}this._domEdit.value=G}this._domSample.style.color=s}},{key:"_ifPopup",value:function(e,n){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):n&&n()}},{key:"_toggleDOM",value:function(e){var n=this.domElement;if(!n)return!1;var r=e?"":"none",i=n.style.display!==r;return i&&(n.style.display=r),i}}]),t})();{var Ni=document.createElement("style");Ni.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(Ni),yu.StyleElement=Ni}var Ua={exports:{}},qa;function bu(){return qa||(qa=1,(function(t,e){(function(n,r){t.exports=n()})(function(){var n="object",r="function",i="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],s=["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"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u(N,W){var F=typeof N[W];return F==r||!!(F==n&&N[W])||F=="unknown"}function c(N,W){return!!(typeof N[W]==n&&N[W])}function d(N,W){return typeof N[W]!=i}function h(N){return function(W,F){for(var V=F.length;V--;)if(!N(W,F[V]))return!1;return!0}}var f=h(u),v=h(c),b=h(d);function w(N){return N&&f(N,a)&&b(N,l)}function T(N){return c(N,"body")?N.body:N.getElementsByTagName("body")[0]}var P=[].forEach?function(N,W){N.forEach(W)}:function(N,W){for(var F=0,V=N.length;FX?(Pe.node=le,Pe.offset-=X):Pe.node==k.parentNode&&Pe.offset>Me(k)&&++Pe.offset;return le}function $(k){if(k.nodeType==9)return k;if(typeof k.ownerDocument!=F)return k.ownerDocument;if(typeof k.document!=F)return k.document;if(k.parentNode)return $(k.parentNode);throw W.createError("getDocument: no document found for node")}function ce(k){var X=$(k);if(typeof X.defaultView!=F)return X.defaultView;if(typeof X.parentWindow!=F)return X.parentWindow;throw W.createError("Cannot get a window object for node")}function re(k){if(typeof k.contentDocument!=F)return k.contentDocument;if(typeof k.contentWindow!=F)return k.contentWindow.document;throw W.createError("getIframeDocument: No Document object found for iframe element")}function Y(k){if(typeof k.contentWindow!=F)return k.contentWindow;if(typeof k.contentDocument!=F)return k.contentDocument.defaultView;throw W.createError("getIframeWindow: No Window object found for iframe element")}function Ne(k){return k&&V.isHostMethod(k,"setTimeout")&&V.isHostObject(k,"document")}function xe(k,X,ye){var le;if(k?V.isHostProperty(k,"nodeType")?le=k.nodeType==1&&k.tagName.toLowerCase()=="iframe"?re(k):$(k):Ne(k)&&(le=k.document):le=document,!le)throw X.createError(ye+"(): Parameter must be a Window object or DOM node");return le}function _e(k){for(var X;X=k.parentNode;)k=X;return k}function nt(k,X,ye,le){var $e,Pe,Lt,At,dt;if(k==ye)return X===le?0:X",Z=oe(X),N.features.crashyTextNodes=Z})();function Oe(k){if(!k)return"[No node]";if(Z&&oe(k))return"[Broken node]";if(M(k))return'"'+k.data+'"';if(k.nodeType==1){var X=k.id?' id="'+k.id+'"':"";return"<"+k.nodeName+X+">[index:"+Me(k)+",length:"+k.childNodes.length+"]["+(k.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return k.nodeName}function Be(k){for(var X=$(k).createDocumentFragment(),ye;ye=k.firstChild;)X.appendChild(ye);return X}var qe;typeof window.getComputedStyle!=F?qe=function(k,X){return ce(k).getComputedStyle(k,null)[X]}:typeof document.documentElement.currentStyle!=F?qe=function(k,X){return k.currentStyle?k.currentStyle[X]:""}:W.fail("No means of obtaining computed style properties found");function _t(k,X,ye){var le=ne(k),$e=k.createElement("div");$e.contentEditable=""+!!ye,X&&($e.innerHTML=X);var Pe=le.firstChild;return Pe?le.insertBefore($e,Pe):le.appendChild($e),$e}function ct(k){return k.parentNode.removeChild(k)}function rt(k){this.root=k,this._next=k}rt.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var k=this._current=this._next,X,ye;if(this._current)if(X=k.firstChild,X)this._next=X;else{for(ye=null;k!==this.root&&!(ye=k.nextSibling);)k=k.parentNode;this._next=ye}return this._current},detach:function(){this._current=this._next=this.root=null}};function it(k){return new rt(k)}function st(k,X){this.node=k,this.offset=X}st.prototype={equals:function(k){return!!k&&this.node===k.node&&this.offset==k.offset},inspect:function(){return"[DomPosition("+Oe(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function wt(k){this.code=this[k],this.codeName=k,this.message="DOMException: "+this.codeName}wt.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},wt.prototype.toString=function(){return this.message},N.dom={arrayContains:He,isHtmlNamespace:ze,parentElement:Je,getNodeIndex:Me,getNodeLength:Qe,getCommonAncestor:tt,isAncestorOf:y,isOrIsAncestorOf:E,getClosestAncestorIn:C,isCharacterDataNode:M,isTextOrCommentNode:_,insertAfter:j,splitDataNode:I,getDocument:$,getWindow:ce,getIframeWindow:Y,getIframeDocument:re,getBody:ne,isWindow:Ne,getContentDocument:xe,getRootContainer:_e,comparePoints:nt,isBrokenNode:oe,inspectNode:Oe,getComputedStyleProperty:qe,createTestElement:_t,removeNode:ct,fragmentFromNodeChildren:Be,createIterator:it,DomPosition:st},N.DOMException=wt}),U.createCoreModule("DomRange",["DomUtil"],function(N,W){var F=N.dom,V=N.util,ne=F.DomPosition,fe=N.DOMException,pe=F.isCharacterDataNode,He=F.getNodeIndex,ze=F.isOrIsAncestorOf,Je=F.getDocument,Me=F.comparePoints,Qe=F.splitDataNode,tt=F.getClosestAncestorIn,y=F.getNodeLength,E=F.arrayContains,C=F.getRootContainer,M=N.features.crashyTextNodes,_=F.removeNode;function j(m,A){return m.nodeType!=3&&(ze(m,A.startContainer)||ze(m,A.endContainer))}function I(m){return m.document||Je(m.startContainer)}function $(m){return C(m.startContainer)}function ce(m){return new ne(m.parentNode,He(m))}function re(m){return new ne(m.parentNode,He(m)+1)}function Y(m,A,L){var K=m.nodeType==11?m.firstChild:m;return pe(A)?L==A.length?F.insertAfter(m,A):A.parentNode.insertBefore(m,L==0?A:Qe(A,L)):L>=A.childNodes.length?A.appendChild(m):A.insertBefore(m,A.childNodes[L]),K}function Ne(m,A,L){if(De(m),De(A),I(A)!=I(m))throw new fe("WRONG_DOCUMENT_ERR");var K=Me(m.startContainer,m.startOffset,A.endContainer,A.endOffset),ae=Me(m.endContainer,m.endOffset,A.startContainer,A.startOffset);return L?K<=0&&ae>=0:K<0&&ae>0}function xe(m){for(var A,L,K=I(m.range).createDocumentFragment(),ae;L=m.next();){if(A=m.isPartiallySelectedSubtree(),L=L.cloneNode(!A),A&&(ae=m.getSubtreeIterator(),L.appendChild(xe(ae)),ae.detach()),L.nodeType==10)throw new fe("HIERARCHY_REQUEST_ERR");K.appendChild(L)}return K}function _e(m,A,L){var K,ae;L=L||{stop:!1};for(var Se,z;Se=m.next();)if(m.isPartiallySelectedSubtree()){if(A(Se)===!1){L.stop=!0;return}else if(z=m.getSubtreeIterator(),_e(z,A,L),z.detach(),L.stop)return}else for(K=F.createIterator(Se);ae=K.next();)if(A(ae)===!1){L.stop=!0;return}}function nt(m){for(var A;m.next();)m.isPartiallySelectedSubtree()?(A=m.getSubtreeIterator(),nt(A),A.detach()):m.remove()}function Z(m){for(var A,L=I(m.range).createDocumentFragment(),K;A=m.next();){if(m.isPartiallySelectedSubtree()?(A=A.cloneNode(!1),K=m.getSubtreeIterator(),A.appendChild(Z(K)),K.detach()):m.remove(),A.nodeType==10)throw new fe("HIERARCHY_REQUEST_ERR");L.appendChild(A)}return L}function oe(m,A,L){var K=!!(A&&A.length),ae,Se=!!L;K&&(ae=new RegExp("^("+A.join("|")+")$"));var z=[];return _e(new Be(m,!1),function(te){if(!(K&&!ae.test(te.nodeType))&&!(Se&&!L(te))){var de=m.startContainer;if(!(te==de&&pe(de)&&m.startOffset==de.length)){var Ee=m.endContainer;te==Ee&&pe(Ee)&&m.endOffset==0||z.push(te)}}}),z}function Oe(m){var A=typeof m.getName=="undefined"?"Range":m.getName();return"["+A+"("+F.inspectNode(m.startContainer)+":"+m.startOffset+", "+F.inspectNode(m.endContainer)+":"+m.endOffset+")]"}function Be(m,A){if(this.range=m,this.clonePartiallySelectedTextNodes=A,!m.collapsed){this.sc=m.startContainer,this.so=m.startOffset,this.ec=m.endContainer,this.eo=m.endOffset;var L=m.commonAncestorContainer;this.sc===this.ec&&pe(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===L&&!pe(this.sc)?this.sc.childNodes[this.so]:tt(this.sc,L,!0),this._last=this.ec===L&&!pe(this.ec)?this.ec.childNodes[this.eo-1]:tt(this.ec,L,!0))}}Be.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 m=this._current=this._next;return m&&(this._next=m!==this._last?m.nextSibling:null,pe(m)&&this.clonePartiallySelectedTextNodes&&(m===this.ec&&(m=m.cloneNode(!0)).deleteData(this.eo,m.length-this.eo),this._current===this.sc&&(m=m.cloneNode(!0)).deleteData(0,this.so))),m},remove:function(){var m=this._current,A,L;pe(m)&&(m===this.sc||m===this.ec)?(A=m===this.sc?this.so:0,L=m===this.ec?this.eo:m.length,A!=L&&m.deleteData(A,L-A)):m.parentNode&&_(m)},isPartiallySelectedSubtree:function(){var m=this._current;return j(m,this.range)},getSubtreeIterator:function(){var m;if(this.isSingleCharacterDataNode)m=this.range.cloneRange(),m.collapse(!1);else{m=new Ke(I(this.range));var A=this._current,L=A,K=0,ae=A,Se=y(A);ze(A,this.sc)&&(L=this.sc,K=this.so),ze(A,this.ec)&&(ae=this.ec,Se=this.eo),ke(m,L,K,ae,Se)}return new Be(m,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var qe=[1,3,4,5,7,8,10],_t=[2,9,11],ct=[5,6,10,12],rt=[1,3,4,5,7,8,10,11],it=[1,3,4,5,7,8];function st(m){return function(A,L){for(var K,ae=L?A:A.parentNode;ae;){if(K=ae.nodeType,E(m,K))return ae;ae=ae.parentNode}return null}}var wt=st([9,11]),k=st(ct),X=st([6,10,12]),ye=st([1]);function le(m,A){if(X(m,A))throw new fe("INVALID_NODE_TYPE_ERR")}function $e(m,A){if(!E(A,m.nodeType))throw new fe("INVALID_NODE_TYPE_ERR")}function Pe(m,A){if(A<0||A>(pe(m)?m.length:m.childNodes.length))throw new fe("INDEX_SIZE_ERR")}function Lt(m,A){if(wt(m,!0)!==wt(A,!0))throw new fe("WRONG_DOCUMENT_ERR")}function At(m){if(k(m,!0))throw new fe("NO_MODIFICATION_ALLOWED_ERR")}function dt(m,A){if(!m)throw new fe(A)}function Un(m,A){return A<=(pe(m)?m.length:m.childNodes.length)}function un(m){return!!m.startContainer&&!!m.endContainer&&!(M&&(F.isBrokenNode(m.startContainer)||F.isBrokenNode(m.endContainer)))&&C(m.startContainer)==C(m.endContainer)&&Un(m.startContainer,m.startOffset)&&Un(m.endContainer,m.endOffset)}function De(m){if(!un(m))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+m.inspect()+")")}var qn=document.createElement("style"),Vt=!1;try{qn.innerHTML="x",Vt=qn.firstChild.nodeType==3}catch(m){}N.features.htmlParsingConforms=Vt;var Kn=Vt?(function(m){var A=this.startContainer,L=Je(A);if(!A)throw new fe("INVALID_STATE_ERR");var K=null;return A.nodeType==1?K=A:pe(A)&&(K=F.parentElement(A)),K===null||K.nodeName=="HTML"&&F.isHtmlNamespace(Je(K).documentElement)&&F.isHtmlNamespace(K)?K=L.createElement("body"):K=K.cloneNode(!1),K.innerHTML=m,F.fragmentFromNodeChildren(K)}):(function(m){var A=I(this),L=A.createElement("body");return L.innerHTML=m,F.fragmentFromNodeChildren(L)});function _n(m,A){De(m);var L=m.startContainer,K=m.startOffset,ae=m.endContainer,Se=m.endOffset,z=L===ae;pe(ae)&&Se>0&&Se0&&K=He(L)&&Se++,K=0),m.setStartAndEnd(L,K,ae,Se)}function be(m){De(m);var A=m.commonAncestorContainer.parentNode.cloneNode(!1);return A.appendChild(m.cloneContents()),A.innerHTML}var An=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],Sn=0,cn=1,fr=2,nn=3,dn=0,Xn=1,Yn=2,Nn=3;V.extend(N.rangePrototype,{compareBoundaryPoints:function(m,A){De(this),Lt(this.startContainer,A.startContainer);var L,K,ae,Se,z=m==nn||m==Sn?"start":"end",te=m==cn||m==Sn?"start":"end";return L=this[z+"Container"],K=this[z+"Offset"],ae=A[te+"Container"],Se=A[te+"Offset"],Me(L,K,ae,Se)},insertNode:function(m){if(De(this),$e(m,rt),At(this.startContainer),ze(m,this.startContainer))throw new fe("HIERARCHY_REQUEST_ERR");var A=Y(m,this.startContainer,this.startOffset);this.setStartBefore(A)},cloneContents:function(){De(this);var m,A;if(this.collapsed)return I(this).createDocumentFragment();if(this.startContainer===this.endContainer&&pe(this.startContainer))return m=this.startContainer.cloneNode(!0),m.data=m.data.slice(this.startOffset,this.endOffset),A=I(this).createDocumentFragment(),A.appendChild(m),A;var L=new Be(this,!0);return m=xe(L),L.detach(),m},canSurroundContents:function(){De(this),At(this.startContainer),At(this.endContainer);var m=new Be(this,!0),A=m._first&&j(m._first,this)||m._last&&j(m._last,this);return m.detach(),!A},surroundContents:function(m){if($e(m,it),!this.canSurroundContents())throw new fe("INVALID_STATE_ERR");var A=this.extractContents();if(m.hasChildNodes())for(;m.lastChild;)m.removeChild(m.lastChild);Y(m,this.startContainer,this.startOffset),m.appendChild(A),this.selectNode(m)},cloneRange:function(){De(this);for(var m=new Ke(I(this)),A=An.length,L;A--;)L=An[A],m[L]=this[L];return m},toString:function(){De(this);var m=this.startContainer;if(m===this.endContainer&&pe(m))return m.nodeType==3||m.nodeType==4?m.data.slice(this.startOffset,this.endOffset):"";var A=[],L=new Be(this,!0);return _e(L,function(K){(K.nodeType==3||K.nodeType==4)&&A.push(K.data)}),L.detach(),A.join("")},compareNode:function(m){De(this);var A=m.parentNode,L=He(m);if(!A)throw new fe("NOT_FOUND_ERR");var K=this.comparePoint(A,L),ae=this.comparePoint(A,L+1);return K<0?ae>0?Yn:dn:ae>0?Xn:Nn},comparePoint:function(m,A){return De(this),dt(m,"HIERARCHY_REQUEST_ERR"),Lt(m,this.startContainer),Me(m,A,this.startContainer,this.startOffset)<0?-1:Me(m,A,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Kn,toHtml:function(){return be(this)},intersectsNode:function(m,A){if(De(this),C(m)!=$(this))return!1;var L=m.parentNode,K=He(m);if(!L)return!0;var ae=Me(L,K,this.endContainer,this.endOffset),Se=Me(L,K+1,this.startContainer,this.startOffset);return A?ae<=0&&Se>=0:ae<0&&Se>0},isPointInRange:function(m,A){return De(this),dt(m,"HIERARCHY_REQUEST_ERR"),Lt(m,this.startContainer),Me(m,A,this.startContainer,this.startOffset)>=0&&Me(m,A,this.endContainer,this.endOffset)<=0},intersectsRange:function(m){return Ne(this,m,!1)},intersectsOrTouchesRange:function(m){return Ne(this,m,!0)},intersection:function(m){if(this.intersectsRange(m)){var A=Me(this.startContainer,this.startOffset,m.startContainer,m.startOffset),L=Me(this.endContainer,this.endOffset,m.endContainer,m.endOffset),K=this.cloneRange();return A==-1&&K.setStart(m.startContainer,m.startOffset),L==1&&K.setEnd(m.endContainer,m.endOffset),K}return null},union:function(m){if(this.intersectsOrTouchesRange(m)){var A=this.cloneRange();return Me(m.startContainer,m.startOffset,this.startContainer,this.startOffset)==-1&&A.setStart(m.startContainer,m.startOffset),Me(m.endContainer,m.endOffset,this.endContainer,this.endOffset)==1&&A.setEnd(m.endContainer,m.endOffset),A}else throw new fe("Ranges do not intersect")},containsNode:function(m,A){return A?this.intersectsNode(m,!1):this.compareNode(m)==Nn},containsNodeContents:function(m){return this.comparePoint(m,0)>=0&&this.comparePoint(m,y(m))<=0},containsRange:function(m){var A=this.intersection(m);return A!==null&&m.equals(A)},containsNodeText:function(m){var A=this.cloneRange();A.selectNode(m);var L=A.getNodes([3]);if(L.length>0){A.setStart(L[0],0);var K=L.pop();return A.setEnd(K,K.length),this.containsRange(A)}else return this.containsNodeContents(m)},getNodes:function(m,A){return De(this),oe(this,m,A)},getDocument:function(){return I(this)},collapseBefore:function(m){this.setEndBefore(m),this.collapse(!1)},collapseAfter:function(m){this.setStartAfter(m),this.collapse(!0)},getBookmark:function(m){var A=I(this),L=N.createRange(A);m=m||F.getBody(A),L.selectNodeContents(m);var K=this.intersection(L),ae=0,Se=0;return K&&(L.setEnd(K.startContainer,K.startOffset),ae=L.toString().length,Se=ae+K.toString().length),{start:ae,end:Se,containerNode:m}},moveToBookmark:function(m){var A=m.containerNode,L=0;this.setStart(A,0),this.collapse(!0);for(var K=[A],ae,Se=!1,z=!1,te,de,Ee;!z&&(ae=K.pop());)if(ae.nodeType==3)te=L+ae.length,!Se&&m.start>=L&&m.start<=te&&(this.setStart(ae,m.start-L),Se=!0),Se&&m.end>=L&&m.end<=te&&(this.setEnd(ae,m.end-L),z=!0),L=te;else for(Ee=ae.childNodes,de=Ee.length;de--;)K.push(Ee[de])},getName:function(){return"DomRange"},equals:function(m){return Ke.rangesEqual(this,m)},isValid:function(){return un(this)},inspect:function(){return Oe(this)},detach:function(){}});function g(m){m.START_TO_START=Sn,m.START_TO_END=cn,m.END_TO_END=fr,m.END_TO_START=nn,m.NODE_BEFORE=dn,m.NODE_AFTER=Xn,m.NODE_BEFORE_AND_AFTER=Yn,m.NODE_INSIDE=Nn}function S(m){g(m),g(m.prototype)}function B(m,A){return function(){De(this);var L=this.startContainer,K=this.startOffset,ae=this.commonAncestorContainer,Se=new Be(this,!0),z,te;L!==ae&&(z=tt(L,ae,!0),te=re(z),L=te.node,K=te.offset),_e(Se,At),Se.reset();var de=m(Se);return Se.detach(),A(this,L,K,L,K),de}}function J(m,A){function L(z,te){return function(de){$e(de,qe),$e(C(de),_t);var Ee=(z?ce:re)(de);(te?K:ae)(this,Ee.node,Ee.offset)}}function K(z,te,de){var Ee=z.endContainer,ht=z.endOffset;(te!==z.startContainer||de!==z.startOffset)&&((C(te)!=C(Ee)||Me(te,de,Ee,ht)==1)&&(Ee=te,ht=de),A(z,te,de,Ee,ht))}function ae(z,te,de){var Ee=z.startContainer,ht=z.startOffset;(te!==z.endContainer||de!==z.endOffset)&&((C(te)!=C(Ee)||Me(te,de,Ee,ht)==-1)&&(Ee=te,ht=de),A(z,Ee,ht,te,de))}var Se=function(){};Se.prototype=N.rangePrototype,m.prototype=new Se,V.extend(m.prototype,{setStart:function(z,te){le(z,!0),Pe(z,te),K(this,z,te)},setEnd:function(z,te){le(z,!0),Pe(z,te),ae(this,z,te)},setStartAndEnd:function(){var z=arguments,te=z[0],de=z[1],Ee=te,ht=de;switch(z.length){case 3:ht=z[2];break;case 4:Ee=z[2],ht=z[3];break}le(te,!0),Pe(te,de),le(Ee,!0),Pe(Ee,ht),A(this,te,de,Ee,ht)},setBoundary:function(z,te,de){this["set"+(de?"Start":"End")](z,te)},setStartBefore:L(!0,!0),setStartAfter:L(!1,!0),setEndBefore:L(!0,!1),setEndAfter:L(!1,!1),collapse:function(z){De(this),z?A(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):A(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(z){le(z,!0),A(this,z,0,z,y(z))},selectNode:function(z){le(z,!1),$e(z,qe);var te=ce(z),de=re(z);A(this,te.node,te.offset,de.node,de.offset)},extractContents:B(Z,A),deleteContents:B(nt,A),canSurroundContents:function(){De(this),At(this.startContainer),At(this.endContainer);var z=new Be(this,!0),te=z._first&&j(z._first,this)||z._last&&j(z._last,this);return z.detach(),!te},splitBoundaries:function(){_n(this)},splitBoundariesPreservingPositions:function(z){_n(this,z)},normalizeBoundaries:function(){De(this);var z=this.startContainer,te=this.startOffset,de=this.endContainer,Ee=this.endOffset,ht=function(xt){var jt=xt.nextSibling;jt&&jt.nodeType==xt.nodeType&&(de=xt,Ee=xt.length,xt.appendData(jt.data),_(jt))},Lo=function(xt){var jt=xt.previousSibling;if(jt&&jt.nodeType==xt.nodeType){z=xt;var Nu=xt.length;if(te=jt.length,xt.insertData(0,jt.data),_(jt),z==de)Ee+=te,de=z;else if(de==xt.parentNode){var Do=He(xt);Ee==Do?(de=xt,Ee=Nu):Ee>Do&&Ee--}}},gi=!0,Nt;if(pe(de))Ee==de.length?ht(de):Ee==0&&(Nt=de.previousSibling,Nt&&Nt.nodeType==de.nodeType&&(Ee=Nt.length,z==de&&(gi=!1),Nt.appendData(de.data),_(de),de=Nt));else{if(Ee>0){var mi=de.childNodes[Ee-1];mi&&pe(mi)&&ht(mi)}gi=!this.collapsed}if(gi){if(pe(z))te==0?Lo(z):te==z.length&&(Nt=z.nextSibling,Nt&&Nt.nodeType==z.nodeType&&(de==Nt&&(de=z,Ee+=z.length),z.appendData(Nt.data),_(Nt)));else if(te1,J=[],ge=re(g),ke=0;ke=36)_t=!1;else{var K=A.cloneRange();A.setStart(m,0),K.setEnd(m,3),K.setStart(m,2),g.addRange(A),g.addRange(K),_t=g.rangeCount==2}}for(ne.removeNode(Ke),g.removeAllRanges(),ke=0;ke1)An(this,g);else{this.removeAllRanges();for(var S=0,B=g.length;S1?An(this,g):S&&this.addRange(g[0])};else return W.fail("No means of selecting a Range or TextRange was found"),!1;be.getRangeAt=function(g){if(g<0||g>=this.rangeCount)throw new Je("INDEX_SIZE_ERR");return this._ranges[g].cloneRange()};var cn;if(xe)cn=function(g){var S;N.isSelectionValid(g.win)?S=g.docSelection.createRange():(S=M(g.win.document).createTextRange(),S.collapse(!0)),g.docSelection.type==E?dt(g):Lt(S)?At(g,S):X(g)};else if(pe(_e,"getRangeAt")&&typeof _e.rangeCount==V)cn=function(g){if(it&&Ne&&g.docSelection.type==E)dt(g);else if(g._ranges.length=g.rangeCount=g.nativeSelection.rangeCount,g.rangeCount){for(var S=0,B=g.rangeCount;S(ne.isCharacterDataNode(g)?g.length:g.childNodes.length))throw new Je("INDEX_SIZE_ERR")}be.collapse=function(g,S){dn(this,g);var B=N.createRange(g);B.collapseToPoint(g,S),this.setSingleRange(B),this.isCollapsed=!0},be.collapseToStart=function(){if(this.rangeCount){var g=this._ranges[0];this.collapse(g.startContainer,g.startOffset)}else throw new Je("INVALID_STATE_ERR")},be.collapseToEnd=function(){if(this.rangeCount){var g=this._ranges[this.rangeCount-1];this.collapse(g.endContainer,g.endOffset)}else throw new Je("INVALID_STATE_ERR")},be.selectAllChildren=function(g){dn(this,g);var S=N.createRange(g);S.selectNodeContents(g),this.setSingleRange(S)},Be?be.setBaseAndExtent=function(g,S,B,J){this.nativeSelection.setBaseAndExtent(g,S,B,J),this.refresh()}:Oe&&(be.setBaseAndExtent=function(g,S,B,J){Xn(g,S),Xn(B,J),dn(this,g),dn(this,B);var ge=N.createRange(node),ke=ne.comparePoints(g,S,B,J)==-1;ke?ge.setStartAndEnd(B,J,g,S):ge.setStartAndEnd(g,S,B,J),this.setSingleRange(ge,ke)}),be.deleteFromDocument=function(){if(it&&Ne&&this.docSelection.type==E){for(var g=this.docSelection.createRange(),S;g.length;)S=g.item(0),g.remove(S),ne.removeNode(S);this.refresh()}else if(this.rangeCount){var B=this.getAllRanges();if(B.length){this.removeAllRanges();for(var J=0,ge=B.length;J0)return N.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw W.createError("getNativeTextRange: selection contains no range")}});function Nn(g){var S=[],B=new Me(g.anchorNode,g.anchorOffset),J=new Me(g.focusNode,g.focusOffset),ge=typeof g.getName=="function"?g.getName():"Selection";if(typeof g.rangeCount!="undefined")for(var ke=0,Ke=g.rangeCount;ke_&&++ce,j==E&&(I==C||I==C+1)&&($=M,ce+=_-C),j==E&&I>C+1&&--ce,y.node=$,y.offset=ce}function Q(y,E,C){y.node==E&&y.offset>C&&--y.offset}function Ze(y,E,C,M){C==-1&&(C=E.childNodes.length);var _=y.parentNode,j=o.getNodeIndex(y);u(M,function(I){he(I,_,j,E,C)}),E.childNodes.length==C?E.appendChild(y):E.insertBefore(y,E.childNodes[C])}function Xe(y,E){var C=y.parentNode,M=o.getNodeIndex(y);u(E,function(_){Q(_,C,M)}),o.removeNode(y)}function yt(y,E,C,M,_){for(var j,I=[];j=y.firstChild;)Ze(j,E,C++,_),I.push(j);return Xe(y,_),I}function x(y,E){return yt(y,y.parentNode,o.getNodeIndex(y),!0,E)}function O(y,E){var C=y.cloneRange();C.selectNodeContents(E);var M=C.intersection(y),_=M?M.toString():"";return _!=""}function R(y){for(var E=y.getNodes([3]),C=0,M;(M=E[C])&&!O(y,M);)++C;for(var _=E.length-1;(M=E[_])&&!O(y,M);)--_;return E.slice(C,_+1)}function q(y,E){if(y.attributes.length!=E.attributes.length)return!1;for(var C=0,M=y.attributes.length,_,j,I;C0&&E1){var M=o.getNodeIndex(C),_=[],j=0,I;u(E,function($,ce){I=$.parentNode,ce>0&&(I.removeChild($),I.hasChildNodes()||o.removeNode(I),y&&u(y,function(re){re.node==$&&(re.node=C,re.offset+=j),re.node==I&&re.offset>M&&(--re.offset,re.offset==M+1&&ceColor
",aria:"Color Picker",action:"colorPicker",init:function(){var s=this,l,a;try{Ka.init()}catch(u){}try{(a=(l=r==null?void 0:r.prototype)===null||l===void 0?void 0:l.init)===null||a===void 0||a.call(this)}catch(u){}this.colorPicker=new yu({parent:this.button||void 0,color:"#000",onDone:function(u){var c,d,h,f,v;try{s.coloredText&&!((d=(c=s.coloredText).isAppliedToSelection)===null||d===void 0)&&d.call(c)&&s.coloredText.undoToSelection(),s.coloredText=Ka.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:u.hex}},normalize:!0}),s.coloredText.toggleSelection(),(f=(h=s.base)===null||h===void 0?void 0:h.checkContentChanged)===null||f===void 0||f.call(h),(v=s.setInactive)===null||v===void 0||v.call(s)}catch(b){}}})},getButton:function(){return this.button},handleClick:function(){var s,l,a;(s=this.setActive)===null||s===void 0||s.call(this),(a=(l=this.colorPicker)===null||l===void 0?void 0:l.show)===null||a===void 0||a.call(l)},isAlreadyApplied:function(s){var l,a;return((a=(l=s==null?void 0:s.nodeName)===null||l===void 0?void 0:l.toLowerCase)===null||a===void 0?void 0:a.call(l))==="mark"},isActive:function(){var s,l;return(l=(s=this.button)===null||s===void 0?void 0:s.classList)===null||l===void 0?void 0:l.contains("medium-editor-button-active")},setInactive:function(){var s,l;(l=(s=this.button)===null||s===void 0?void 0:s.classList)===null||l===void 0||l.remove("medium-editor-button-active")},setActive:function(){var s,l;(l=(s=this.button)===null||s===void 0?void 0:s.classList)===null||l===void 0||l.add("medium-editor-button-active")}}):(function(){function s(){}return s})()}var C1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),_1=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Ja=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Qa=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r0?this.editor.addElements(".lf-label-editor"):((n=this.editor)===null||n===void 0||n.destroy(),this.editor=new yr(".lf-label-editor",Mi(Va,{autoLink:!0,extensions:{colorPicker:new(Za(yr))}})))},e.prototype.componentWillUnmount=function(){var n;(n=this.editor)===null||n===void 0||n.destroy()},e.prototype.getLabels=function(){var n=this,r=this.props,i=r.lf.extension,o=r.graphModel,s=Qa(Qa([],Ja(o.nodes),!1),Ja(o.edges),!1),l=i.label;if(l){var a=[];return Ge(s,function(u){var c,d,h=u.getData(),f=(d=(c=h.properties)===null||c===void 0?void 0:c._label)!==null&&d!==void 0?d:[];Ge(f,function(v){var b=n.labelMap,w=new d1(v,u,o);b.set(w.id,w),a.push(Ve(u1,{label:w,element:u,graphModel:o},w.id))})}),a}return null},e.prototype.render=function(){return Ve("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=_1([hs],e),e})(qr);var wu=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Mn=function(){return Mn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},A1={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function S1(t){for(var e=t,n=1;ne[1]?"t":"b":Math.abs(t[1]-e[1])<=o&&(s=t[0]>e[0]?"l":"r"),Math.abs(e[0]-n[0])<=o?l=e[1]>n[1]?"t":"b":Math.abs(e[1]-n[1])<=o&&(l=e[0]>n[0]?"l":"r");var a=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||1/5*r,u="".concat(s).concat(l),c=A1[u]||"-",d="L ".concat(t[0]," ").concat(t[1]);if(c==="-")d+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var h=rr(N1(e,u,c,a),2),f=h[0],v=h[1];f&&v&&(d+="L ".concat(f[0]," ").concat(f[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(v[0]," ").concat(v[1]),i=rr(v,2),e[0]=i[0],e[1]=i[1])}return d}function R1(t,e){var n=0,r="";if(t.length===2)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+10)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},ts=function(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r1&&setTimeout(function(){var i;n.updatePointsByNodes(((i=n.properties)===null||i===void 0?void 0:i.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 r=n.x,i=n.y;this.x=r,this.y=i},e.prototype.updatePointsByNodes=function(n){var r=this,i=[],o=1/0,s=1/0,l=-1/0,a=-1/0;n.forEach(function(u){var c=r.graphModel.getNodeModelById(u);if(c){var d=c.width,h=c.height,f=c.x,v=c.y;o=Math.min(o,f-d/2-r.d),s=Math.min(s,v-h/2-r.d),l=Math.max(l,f+d/2+r.d),a=Math.max(a,v+h/2+r.d)}}),i.push([o,s],[l,s],[l,a],[o,a]),![o,s,l,a].some(function(u){return Math.abs(u)===1/0})&&(this.updatePoints(i),this.updateCoordinate({x:(l+o)/2,y:(a+s)/2}))},e.prototype.resize=function(n){var r;this.isResize=!0;for(var i=n.width,o=n.height,s={x:i/this.width,y:o/this.height},l=(this.properties.node_selection_ids||[]).slice(),a=[],u=new Set;l.length;){var c=l.shift(),d=(r=this.graphModel.nodesMap[c])===null||r===void 0?void 0:r.model;if(d){if(!_r(d)){a.push(d);continue}u.has(d.id)||(u.add(d.id),l.push.apply(l,ts([],es(d.properties.node_selection_ids||[]),!1)))}}var h={x:this.x-this.width/2,y:this.y-this.height/2},f=t.prototype.resize.call(this,n),v={x:this.x-this.width/2,y:this.y-this.height/2};return a.forEach(function(b){b.width=b.width*s.x,b.height=b.height*s.y;var w=(b.x-h.x)*s.x+v.x-b.x,T=(b.y-h.y)*s.y+v.y-b.y;b.move(w,T,!0)}),this.isResize=!1,f},e})(ls),Ui="node-selection";(function(){function t(e){var n=e.lf;this.selectNodes=[],this.d=10,this.lf=n,n.register({type:Ui,view:O1,model:k1})}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,r=this.lf.getGraphRawData(),i=n.filter(function(o){return o!==e.currentClickNode.id});return r.nodes.find(function(o){if(o.type==="node-selection"){var s=Ji(o,"properties.node_selection_ids",[]);return i.every(function(l){return s.includes(l)})}return!1})},t.prototype.onNodeChange=function(e,n){var r=e.graphModel.nodes.filter(function(i){if(!_r(i))return!1;var o=i.properties.node_selection_ids||[];return o.includes(n.id)});Promise.resolve().then(function(){r.forEach(function(i){i.updatePointsByNodes(i.properties.node_selection_ids||[])})})},t.prototype.render=function(e){var n=this;this.lf=e,e.on("node:click",function(r){var i;if(!(!r.e.shiftKey||r.data.type===Ui)){n.currentClickNode=r.data;var o=!1;n.selectNodesIds.includes(r.data.id)&&((i=n.lf.getNodeModelById(r.data.id))===null||i===void 0||i.setSelected(!1),o=!0);var s=e.getSelectElements(!0).nodes;n.selectNodes=s,n.selectNodes.length===1?o?n.updateNodeSelection():n.addNodeSelection():n.selectNodes.length>1&&n.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(r,i,o){if(n.onNodeChange(e,r),_r(r)&&!r.isResize){var s=r.properties.node_selection_ids||[];return e.graphModel.moveNodes(s,i,o,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(r){return _r(r)||n.onNodeChange(e,r),!0})},t.pluginName="node-selection",t})();var _r=function(t){return!!(t&&t.type===Ui)},M1=(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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 r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Gr=function(){return Gr=Object.assign||function(t){for(var e,n=1,r=arguments.length;n `,P1=` `,qi=18,L1=qi/2;class D1 extends Gu{constructor(e){super(e)}setHtml(e){const n=document.createElement("div");n.className=`${Oi}-content`,n.dataset.nodeId=this.props.model.id,this.root=n,e.appendChild(n),super.renderVueComponent()}confirmUpdate(e){}getAnchorShape(e){const{x:n,y:r,type:i,allowAdd:o}=e,s=i==="top",l=i==="left",a=typeof o=="boolean"?o:i==="right",u=(()=>{const d=l?"targetAnchorId":"sourceAnchorId";return this.props.graphModel.edges.some(h=>h[d]===e.id)})(),c=a?d=>{d.preventDefault(),d.stopPropagation(),this.props.graphModel.$J.doAction("toggle-add-node-drawer",{event:d,node:this.props.model,anchor:e})}:void 0;return ie("foreignObject",Ro(To({},e),{width:qi,height:qi,x:l||s?n-10:n-8,y:r-L1,style:{"pointer-events":a?void 0:"none"}}),[ie("div",{className:[`${Oi}-anchor`,`${l?"left":"right"}`,`${u?"has-edge":""}`,`${a?"has-add":""}`].join(" "),onClick:c,dangerouslySetInnerHTML:{__html:`${P1}${a?Cu:""}`}})])}}function I1(t){const e={getActionRender:r.bind(t),getActionShape:n.bind(t)};function n(){if(this.props.model.isDisabled)return ie("g",{});const{startPoint:i,endPoint:o,pointsList:s}=this.props.model;let l,a;if(s&&s.length===4){const[u,c,d,h]=s;l=.125*u.x+.375*c.x+.375*d.x+.125*h.x,a=.125*u.y+.375*c.y+.375*d.y+.125*h.y}else l=(i.x+o.x)/2,a=(i.y+o.y)/2;return ie("foreignObject",{style:{},x:l-pr/2,y:a-pr/2,width:pr,height:pr},e.getActionRender())}function r(){const{isSilentMode:i}=this.props.graphModel.editConfigModel,o=i?!1:this.props.model.isHovered;return ie("div",{className:`${Oi}-edge-action ${o?"hover":""}`,onClick:s=>{s.preventDefault(),s.stopPropagation(),this.props.graphModel.deleteEdgeById(this.props.model.id),this.props.graphModel.$J.repaintGraph()},dangerouslySetInnerHTML:{__html:Cu}})}return e}class B1 extends zu{constructor(){super(),this.$hook=I1(this)}getEdge(){const e=super.getEdge(),n=this.props.model.isHovered,{isSilentMode:r}=this.props.graphModel.editConfigModel;return!r&&n&&(e.props.stroke="#1890ff"),e}getAppendWidth(){const e=this.$hook;return ie("g",{},super.getAppendWidth(),e.getActionShape())}getStartArrow(){return ie("g",{})}getEndArrow(){return ie("g",{})}toFront(){}}class F1 extends $u{get isDisabled(){var e,n;return(n=(e=this.properties)==null?void 0:e.disabled)!=null?n:!1}initEdgeData(e){e.id||(e.id=is()),super.initEdgeData(e)}getData(){return{id:this.id,type:this.type,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,pointsList:this.pointsList,properties:this.properties}}getEdgeStyle(){const e=super.getEdgeStyle();return e.stroke="#afafaf",e.strokeWidth=2,e}getOutlineStyle(){const e=super.getOutlineStyle();return e.stroke="none",e.hover&&(e.hover.stroke="none"),e}getEdgeAnimationStyle(){var e;const n=super.getEdgeAnimationStyle(),r=(e=this.properties)==null?void 0:e.runStatus;return r==="running"?n.stroke="#67b7ff":r==="success"?n.stroke="#52c41a":r==="fail"&&(n.stroke="#f5222d"),n}}const j1={type:"base-line-edge",view:B1,model:F1};class H1 extends ko.view{constructor(e){super(e),this.$super=new D1(e)}getOperateIcon(){return ie("g",{})}get ref(){return this.$super.ref}set ref(e){this.$super.ref=e}get currentProperties(){return this.$super.currentProperties}set currentProperties(e){this.$super.currentProperties=e}get preProperties(){return this.$super.preProperties}set preProperties(e){this.$super.preProperties=e}get rootEl(){return this.$super.rootEl}setHtml(e){this.$super.setHtml.call(this,e)}shouldUpdate(){return this.$super.shouldUpdate.call(this)}componentDidMount(){this.$super.componentDidMount.call(this)}componentDidUpdate(){this.$super.componentDidUpdate.call(this)}componentWillUnmount(){this.$super.componentWillUnmount.call(this)}getShape(){return ie("g",{},[this.getAppendAreaShape(),this.$super.getShape.call(this),this.getOperateIcon()])}confirmUpdate(e){this.$super.confirmUpdate.call(this,e)}getAnchorShape(e){return this.$super.getAnchorShape.call(this,e)}get root(){return this.$super.root}set root(e){this.$super.root=e}get vm(){return this.$super.vm}set vm(e){this.$super.vm=e}getComponentContainer(){return this.$super.getComponentContainer.call(this)}targetId(){return this.$super.targetId.call(this)}renderVueComponent(){this.$super.renderVueComponent.call(this)}unmountVueComponent(){this.$super.unmountVueComponent.call(this)}unmount(){this.$super.unmount.call(this)}}const Ki=new Map;function Jn(t){let e=Ki.get(t);return e||(e={},Ki.set(t,e)),e}function W1(t){var e;return t.id||(t.id=is()),t.properties=Ro(To({},t.properties),{collapsible:!1,autoToFront:!1,transformWithContainer:!1,isRestrict:!0,autoResize:!0,children:(e=t.properties.children)!=null?e:[]}),t}class $1 extends ko.model{constructor(e,n){super(W1(e),n),this.$super=new qu(e,n),this.sourceRules.push(...this.$super.sourceRules),this.targetRules.push(...this.$super.targetRules),this.setTempData()}get $children(){var e,n,r;return(r=(n=(e=this.$super)==null?void 0:e.properties)==null?void 0:n.children)!=null?r:[]}isAllowAppendIn(e){return this.$children.includes(e.id)}getOutlineStyle(){const e=super.getOutlineStyle();return e.stroke="none",e.hover&&(e.hover.stroke="none"),e}addChild(e){super.addChild(e);const n=[...this.$children];n.push(e),this.$super.properties.children=n,this.graphModel.$J.$groupUtils.recalcGroupSize(this.id)}removeChild(e){super.removeChild(e);const n=[...this.$children];this.$super.properties.children=n.filter(r=>r!==e),this.graphModel.$J.$groupUtils.recalcGroupSize(this.id)}getAddableOutlineStyle(){return{stroke:"none",fill:"transparent"}}get width(){var e,n;const r=Jn(this);return(n=(e=this.$super)==null?void 0:e.width)!=null?n:r.width}set width(e){if(!this.$super){const n=Jn(this);n.width=e;return}this.$super.width=e}get height(){var e,n;const r=Jn(this);return(n=(e=this.$super)==null?void 0:e.height)!=null?n:r.height}set height(e){if(!this.$super){const n=Jn(this);n.height=e;return}this.$super.height=e}get nodeConfig(){var e;return(e=this.$super)==null?void 0:e.nodeConfig}getDefaultAnchor(){return this.$super.getDefaultAnchor.call(this)}getAnchorLineStyle(...e){return this.$super.getAnchorLineStyle.call(this,...e)}setAttributes(){var e,n;return((n=(e=this.$super)==null?void 0:e.setAttributes)!=null?n:super.setAttributes).call(this)}getNodeStyle(){var e,n;return((n=(e=this.$super)==null?void 0:e.getNodeStyle)!=null?n:super.getNodeStyle).call(this)}setTempData(){const e=Jn(this);Object.keys(e).forEach(n=>{this[n]=e[n]}),Ki.delete(this)}}const Ti=320,Ri=240,_u=ud({__name:"LoopBodyNode",props:{node:{},graph:{}},setup(t){const e=t,n=yi(),r=cc(),i=yi(Ti),o=yi(Ri),{containerRef:s,containerProps:l,$node:a,runStatus:u}=uc(e,{hideAction:!0,addNodeDialogConfig:{addPayload:{edgeType:j1.type},offset:{showTop:0,showRight:300}},updateHeightImmediate:!1,disableResizeListener:!0,listenForeignObjectResize:!0,onParentResize(h){i.value=h.width,i.valueq1(h)}),c=yd(()=>{var h;return Su((h=a.value)==null?void 0:h.id)});function d(){return r.nodeSteps.find(h=>h.node.id===c.value)}return dd(()=>{const{graph:h,node:f}=e,v=h.getNodeEdges(f.id),b=u.value[0];for(const w of v)b&&b!=="waiting"?w.openEdgeAnimation():w.closeEdgeAnimation()}),hd(()=>{}),(h,f)=>(fd(),cd(jo(Tu),vd({ref_key:"containerRef",ref:s,class:"loop-body-node",width:i.value,runGetStepFn:d},jo(l)),{default:pd(()=>[gd("div",{ref_key:"contentRef",ref:n,style:md({width:"100%",height:o.value-50-16+"px",backgroundColor:"transparent",position:"relative",borderRadius:"8px",pointerEvents:"none"})},null,4)]),_:1},16,["width"]))}});class z1 extends H1{}class G1 extends $1{}const ns={type:mn.LOOP_BODY,label:"循环体",components:{icon:lc,setting:Ru},lfNode:{type:mn.LOOP_BODY,view:z1,model:G1,component:_u},params:{width:320,height:240},methods:{createNode:Au,getDefaultAnchor(t){const e=t.find(r=>r.type==="left"),n=t.find(r=>r.type==="right");return[{id:`${this.id}_${gn.LINK_LOOP}`,type:gn.LINK_LOOP,x:this.x,y:this.y-this.height/2},{id:`${this.id}_${gn.LOOP_START}`,type:gn.LOOP_START,allowAdd:!0,x:e.x+30,y:this.y+25},{id:`${this.id}_${gn.LOOP_END}`,type:gn.LOOP_END,allowAdd:!1,x:n.x-30,y:this.y+25}]}},hooks:{beforeRemoveNode(){return!1}}};function Au(t){var e;const{loopNodeId:n}=t;return{id:n+os,type:ns.type,x:t.x,y:t.y,properties:{text:(e=t.text)!=null?e:ns.label,options:{},inputParams:[],outputParams:[]}}}const U1=ku();function q1(t){return t===mn.LOOP||t===mn.END?!1:t===mn.LOOP_CONTINUE||t===mn.LOOP_BREAK||t===mn.SET_LOOP_VAR?!0:Ou.isShow(t)}function uw(t){const e=U1.nodeGroupMap.get(t);return Su(e)}function Su(t){if(t)return t.slice(0,-os.length)}const K1=320;function cw(t,e){if(!t||!e)return;const n=t.id,r={x:t.x,y:t.y+t.height+K1},i=Au(Ro(To({},r),{loopNodeId:n})),o=e.addNode(i),s=`${n}_${Uu.LINK_BODY}`,l=`${o.id}_${gn.LINK_LOOP}`;setTimeout(()=>{e.addEdge({sourceNodeId:n,sourceAnchorId:s,targetNodeId:o.id,targetAnchorId:l,properties:{disabled:!0}})},50)}const dw=Object.freeze(Object.defineProperty({__proto__:null,default:_u},Symbol.toStringTag,{value:"Module"}));export{lw as B,q1 as E,cw as F,uw as H,dw as L,I1 as c,D1 as d,ns as n,j1 as p,m0 as u};