@aloudata/ink-flow 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -13,7 +13,7 @@ S=C,function(){var n={}.hasOwnProperty;function t(){for(var n="",t=0;t<arguments
|
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the MIT license found in the
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/I.exports=function(){if(O)return P;O=1;var t=n,e=L(),r="function"==typeof Object.is?Object.is:function(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t},o=e.useSyncExternalStore,i=t.useRef,u=t.useEffect,a=t.useMemo,c=t.useDebugValue;return P.useSyncExternalStoreWithSelector=function(n,t,e,l,s){var f=i(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=a((function(){function n(n){if(!u){if(u=!0,o=n,n=l(n),void 0!==s&&d.hasValue){var t=d.value;if(s(t,n))return i=t}return i=n}if(t=i,r(o,n))return t;var e=l(n);return void 0!==s&&s(t,e)?t:(o=n,i=e)}var o,i,u=!1,a=void 0===e?null:e;return[function(){return n(t())},null===a?void 0:function(){return n(a())}]}),[t,e,l,s]);var h=o(n,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),c(h),h},P}();var T=b(I.exports);const B=n=>{let t;const e=new Set,r=(n,r)=>{const o="function"==typeof n?n(t):n;if(!Object.is(o,t)){const n=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),e.forEach((e=>e(t,n)))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>u,subscribe:n=>(e.add(n),()=>e.delete(n)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),e.clear()}},u=t=n(r,o,i);return i},{useDebugValue:D}=n,{useSyncExternalStoreWithSelector:R}=T,V=n=>n;function H(n,t=V,e){const r=R(n.subscribe,n.getState,n.getServerState||n.getInitialState,t,e);return D(r),r}const Y=(n,t)=>{const e=(n=>n?B(n):B)(n),r=(n,r=t)=>H(e,n,r);return Object.assign(r,e),r};var Z=t(null),X=Z.Provider,U=function(){return U=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},U.apply(this,arguments)};function F(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function $(n,t,e){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var G,q,K,Q,J,nn,tn,en,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,wn,bn,_n,xn,En,Sn,kn,Cn,Nn,Mn,On,jn,In,Pn,An,zn,Ln,Tn,Bn,Dn,Rn,Vn,Hn,Yn,Zn,Xn,Un,Fn,Wn,$n,Gn,qn,Kn,Qn,Jn,nt,tt,et,rt,ot,it,ut,at,ct,lt,st,ft,dt,ht,vt,pt,gt,yt,mt,wt,bt,_t,xt,Et,St,kt,Ct,Nt,Mt,Ot,jt,It,Pt,At,zt,Lt,Tt,Bt,Dt,Rt,Vt,Ht,Yt,Zt,Xt,Ut,Ft,Wt,$t,Gt,qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Kt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Qt(){return Q?K:(Q=1,K=function(n,t){return n===t||n!=n&&t!=t})}function Jt(){if(nn)return J;nn=1;var n=Qt();return J=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1},J}function ne(){if(fn)return sn;fn=1;var n=q?G:(q=1,G=function(){this.__data__=[],this.size=0}),t=function(){if(en)return tn;en=1;var n=Jt(),t=Array.prototype.splice;return tn=function(e){var r=this.__data__,o=n(r,e);return!(o<0||(o==r.length-1?r.pop():t.call(r,o,1),--this.size,0))}}(),e=function(){if(on)return rn;on=1;var n=Jt();return rn=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}}(),r=function(){if(an)return un;an=1;var n=Jt();return un=function(t){return n(this.__data__,t)>-1}}(),o=function(){if(ln)return cn;ln=1;var n=Jt();return cn=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,sn=i}function te(){if(_n)return bn;_n=1;var n="object"==typeof qt&&qt&&qt.Object===Object&&qt;return bn=n}function ee(){if(En)return xn;En=1;var n=te(),t="object"==typeof self&&self&&self.Object===Object&&self,e=n||t||Function("return this")();return xn=e}function re(){if(kn)return Sn;kn=1;var n=ee().Symbol;return Sn=n}function oe(){if(In)return jn;In=1;var n=re(),t=function(){if(Nn)return Cn;Nn=1;var n=re(),t=Object.prototype,e=t.hasOwnProperty,r=t.toString,o=n?n.toStringTag:void 0;return Cn=function(n){var t=e.call(n,o),i=n[o];try{n[o]=void 0;var u=!0}catch(n){}var a=r.call(n);return u&&(t?n[o]=i:delete n[o]),a}}(),e=function(){if(On)return Mn;On=1;var n=Object.prototype.toString;return Mn=function(t){return n.call(t)}}(),r=n?n.toStringTag:void 0;return jn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?t(n):e(n)}}function ie(){return An?Pn:(An=1,Pn=function(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)})}function ue(){if(Ln)return zn;Ln=1;var n=oe(),t=ie();return zn=function(e){if(!t(e))return!1;var r=n(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function ae(){if(Hn)return Vn;Hn=1;var n=Function.prototype.toString;return Vn=function(t){if(null!=t){try{return n.call(t)}catch(n){}try{return t+""}catch(n){}}return""}}function ce(){if(Wn)return Fn;Wn=1;var n=function(){if(Zn)return Yn;Zn=1;var n=ue(),t=function(){if(Rn)return Dn;Rn=1;var n,t=function(){if(Bn)return Tn;Bn=1;var n=ee()["__core-js_shared__"];return Tn=n}(),e=(n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Dn=function(n){return!!e&&e in n}}(),e=ie(),r=ae(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,c=u.hasOwnProperty,l=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Yn=function(i){return!(!e(i)||t(i))&&(n(i)?l:o).test(r(i))}}(),t=Un?Xn:(Un=1,Xn=function(n,t){return null==n?void 0:n[t]});return Fn=function(e,r){var o=t(e,r);return n(o)?o:void 0}}function le(){if(Gn)return $n;Gn=1;var n=ce()(ee(),"Map");return $n=n}function se(){if(Kn)return qn;Kn=1;var n=ce()(Object,"create");return qn=n}function fe(){if(pt)return vt;pt=1;var n=ht?dt:(ht=1,dt=function(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n});return vt=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}}function de(){if(kt)return St;kt=1;var n=function(){if(ft)return st;ft=1;var n=function(){if(lt)return ct;lt=1;var n=function(){if(Jn)return Qn;Jn=1;var n=se();return Qn=function(){this.__data__=n?n(null):{},this.size=0}}(),t=tt?nt:(tt=1,nt=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}),e=function(){if(rt)return et;rt=1;var n=se(),t=Object.prototype.hasOwnProperty;return et=function(e){var r=this.__data__;if(n){var o=r[e];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(r,e)?r[e]:void 0}}(),r=function(){if(it)return ot;it=1;var n=se(),t=Object.prototype.hasOwnProperty;return ot=function(e){var r=this.__data__;return n?void 0!==r[e]:t.call(r,e)}}(),o=function(){if(at)return ut;at=1;var n=se();return ut=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,ct=i}(),t=ne(),e=le();return st=function(){this.size=0,this.__data__={hash:new n,map:new(e||t),string:new n}}}(),t=function(){if(yt)return gt;yt=1;var n=fe();return gt=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}}(),e=function(){if(wt)return mt;wt=1;var n=fe();return mt=function(t){return n(this,t).get(t)}}(),r=function(){if(_t)return bt;_t=1;var n=fe();return bt=function(t){return n(this,t).has(t)}}(),o=function(){if(Et)return xt;Et=1;var n=fe();return xt=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,St=i}function he(){if(Ot)return Mt;Ot=1;var n=ne(),t=function(){if(hn)return dn;hn=1;var n=ne();return dn=function(){this.__data__=new n,this.size=0}}(),e=pn?vn:(pn=1,vn=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}),r=yn?gn:(yn=1,gn=function(n){return this.__data__.get(n)}),o=wn?mn:(wn=1,mn=function(n){return this.__data__.has(n)}),i=function(){if(Nt)return Ct;Nt=1;var n=ne(),t=le(),e=de();return Ct=function(r,o){var i=this.__data__;if(i instanceof n){var u=i.__data__;if(!t||u.length<199)return u.push([r,o]),this.size=++i.size,this;i=this.__data__=new e(u)}return i.set(r,o),this.size=i.size,this}}();function u(t){var e=this.__data__=new n(t);this.size=e.size}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=r,u.prototype.has=o,u.prototype.set=i,Mt=u}function ve(){return It||(It=1,jt=function(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&!1!==t(n[e],e,n););return n}),jt}function pe(){if(At)return Pt;At=1;var n=ce(),t=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(n){}}();return Pt=t}function ge(){if(Lt)return zt;Lt=1;var n=pe();return zt=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}}function ye(){if(Bt)return Tt;Bt=1;var n=ge(),t=Qt(),e=Object.prototype.hasOwnProperty;return Tt=function(r,o,i){var u=r[o];e.call(r,o)&&t(u,i)&&(void 0!==i||o in r)||n(r,o,i)}}function me(){if(Rt)return Dt;Rt=1;var n=ye(),t=ge();return Dt=function(e,r,o,i){var u=!o;o||(o={});for(var a=-1,c=r.length;++a<c;){var l=r[a],s=i?i(o[l],e[l],l,o,e):void 0;void 0===s&&(s=e[l]),u?t(o,l,s):n(o,l,s)}return o}}function we(){return Zt?Yt:(Zt=1,Yt=function(n){return null!=n&&"object"==typeof n})}function be(){if(Wt)return Ft;Wt=1;var n=function(){if(Ut)return Xt;Ut=1;var n=oe(),t=we();return Xt=function(e){return t(e)&&"[object Arguments]"==n(e)}}(),t=we(),e=Object.prototype,r=e.hasOwnProperty,o=e.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return t(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return Ft=i}function _e(){if(Gt)return $t;Gt=1;var n=Array.isArray;return $t=n}var xe,Ee,Se,ke,Ce,Ne,Me,Oe,je,Ie,Pe,Ae={exports:{}};function ze(){return Se||(Se=1,function(n,t){var e=ee(),r=Ee?xe:(Ee=1,xe=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&n&&!n.nodeType&&n,u=i&&i.exports===o?e.Buffer:void 0,a=(u?u.isBuffer:void 0)||r;n.exports=a}(Ae,Ae.exports)),Ae.exports}function Le(){if(Ce)return ke;Ce=1;var n=/^(?:0|[1-9]\d*)$/;return ke=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}}function Te(){return Me?Ne:(Me=1,Ne=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Be(){return Pe?Ie:(Pe=1,Ie=function(n){return function(t){return n(t)}})}var De,Re,Ve,He,Ye,Ze,Xe,Ue,Fe,We,$e,Ge,qe,Ke,Qe,Je,nr,tr,er,rr,or,ir,ur,ar,cr,lr,sr,fr={exports:{}};function dr(){return De||(De=1,n=fr,t=fr.exports,e=te(),r=t&&!t.nodeType&&t,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r&&e.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(n){}}(),n.exports=u),fr.exports;var n,t,e,r,o,i,u}function hr(){if(Ve)return Re;Ve=1;var n=function(){if(je)return Oe;je=1;var n=oe(),t=Te(),e=we(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,Oe=function(o){return e(o)&&t(o.length)&&!!r[n(o)]}}(),t=Be(),e=dr(),r=e&&e.isTypedArray,o=r?t(r):n;return Re=o}function vr(){if(Ye)return He;Ye=1;var n=Ht?Vt:(Ht=1,Vt=function(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}),t=be(),e=_e(),r=ze(),o=Le(),i=hr(),u=Object.prototype.hasOwnProperty;return He=function(a,c){var l=e(a),s=!l&&t(a),f=!l&&!s&&r(a),d=!l&&!s&&!f&&i(a),h=l||s||f||d,v=h?n(a.length,String):[],p=v.length;for(var g in a)!c&&!u.call(a,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,p))||v.push(g);return v}}function pr(){if(Xe)return Ze;Xe=1;var n=Object.prototype;return Ze=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}}function gr(){return Fe||(Fe=1,Ue=function(n,t){return function(e){return n(t(e))}}),Ue}function yr(){if(qe)return Ge;qe=1;var n=pr(),t=function(){if($e)return We;$e=1;var n=gr()(Object.keys,Object);return We=n}(),e=Object.prototype.hasOwnProperty;return Ge=function(r){if(!n(r))return t(r);var o=[];for(var i in Object(r))e.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function mr(){if(Qe)return Ke;Qe=1;var n=ue(),t=Te();return Ke=function(e){return null!=e&&t(e.length)&&!n(e)}}function wr(){if(nr)return Je;nr=1;var n=vr(),t=yr(),e=mr();return Je=function(r){return e(r)?n(r):t(r)}}function br(){if(cr)return ar;cr=1;var n=vr(),t=function(){if(ur)return ir;ur=1;var n=ie(),t=pr(),e=or?rr:(or=1,rr=function(n){var t=[];if(null!=n)for(var e in Object(n))t.push(e);return t}),r=Object.prototype.hasOwnProperty;return ir=function(o){if(!n(o))return e(o);var i=t(o),u=[];for(var a in o)("constructor"!=a||!i&&r.call(o,a))&&u.push(a);return u}}(),e=mr();return ar=function(r){return e(r)?n(r,!0):t(r)}}var _r,xr,Er,Sr,kr,Cr,Nr,Mr,Or,jr,Ir,Pr,Ar,zr,Lr,Tr,Br,Dr,Rr,Vr,Hr,Yr,Zr,Xr,Ur,Fr,Wr,$r,Gr,qr,Kr,Qr,Jr,no,to,eo,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,bo,_o,xo,Eo,So,ko,Co,No,Mo,Oo,jo,Io,Po,Ao,zo,Lo,To,Bo,Do,Ro,Vo,Ho,Yo,Zo,Xo,Uo,Fo,Wo,$o,Go,qo,Ko,Qo,Jo,ni,ti,ei,ri,oi,ii,ui,ai,ci,li,si,fi,di,hi,vi,pi,gi,yi,mi,wi,bi,_i,xi,Ei,Si,ki,Ci,Ni,Mi,Oi,ji,Ii,Pi,Ai,zi,Li,Ti,Bi,Di,Ri,Vi,Hi,Yi,Zi,Xi,Ui,Fi,Wi,$i,Gi,qi,Ki,Qi,Ji,nu,tu,eu,ru,ou,iu,uu,au,cu,lu,su,fu,du,hu,vu,pu,gu,yu,mu,wu,bu,_u,xu,Eu,Su,ku,Cu,Nu,Mu,Ou,ju,Iu,Pu,Au,zu,Lu,Tu,Bu,Du,Ru,Vu,Hu,Yu,Zu,Xu,Uu,Fu,Wu,$u,Gu,qu,Ku,Qu,Ju,na,ta,ea,ra,oa,ia,ua,aa,ca,la,sa,fa,da,ha,va,pa,ga,ya,ma,wa,ba,_a,xa,Ea,Sa,ka,Ca,Na,Ma,Oa,ja,Ia,Pa,Aa,za,La,Ta,Ba,Da,Ra,Va,Ha,Ya,Za,Xa,Ua,Fa,Wa,$a,Ga,qa,Ka,Qa,Ja,nc,tc,ec,rc,oc,ic,uc,ac,cc,lc,sc,fc,dc,hc,vc,pc,gc,yc,mc,wc,bc,_c,xc,Ec,Sc,kc,Cc,Nc,Mc,Oc,jc,Ic,Pc={exports:{}};function Ac(){return _r||(_r=1,function(n,t){var e=ee(),r=t&&!t.nodeType&&t,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?e.Buffer:void 0,u=i?i.allocUnsafe:void 0;n.exports=function(n,t){if(t)return n.slice();var e=n.length,r=u?u(e):new n.constructor(e);return n.copy(r),r}}(Pc,Pc.exports)),Pc.exports}function zc(){return Er||(Er=1,xr=function(n,t){var e=-1,r=n.length;for(t||(t=Array(r));++e<r;)t[e]=n[e];return t}),xr}function Lc(){return kr||(kr=1,Sr=function(n,t){for(var e=-1,r=null==n?0:n.length,o=0,i=[];++e<r;){var u=n[e];t(u,e,n)&&(i[o++]=u)}return i}),Sr}function Tc(){return Nr?Cr:(Nr=1,Cr=function(){return[]})}function Bc(){if(Or)return Mr;Or=1;var n=Lc(),t=Tc(),e=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Mr=r?function(t){return null==t?[]:(t=Object(t),n(r(t),(function(n){return e.call(t,n)})))}:t}function Dc(){return Ar||(Ar=1,Pr=function(n,t){for(var e=-1,r=t.length,o=n.length;++e<r;)n[o+e]=t[e];return n}),Pr}function Rc(){if(Lr)return zr;Lr=1;var n=gr()(Object.getPrototypeOf,Object);return zr=n}function Vc(){if(Br)return Tr;Br=1;var n=Dc(),t=Rc(),e=Bc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)n(o,e(r)),r=t(r);return o}:r}function Hc(){if(Hr)return Vr;Hr=1;var n=Dc(),t=_e();return Vr=function(e,r,o){var i=r(e);return t(e)?i:n(i,o(e))}}function Yc(){if(Zr)return Yr;Zr=1;var n=Hc(),t=Bc(),e=wr();return Yr=function(r){return n(r,e,t)}}function Zc(){if(Kr)return qr;Kr=1;var n=ce()(ee(),"Set");return qr=n}function Xc(){if(to)return no;to=1;var n=function(){if(Wr)return Fr;Wr=1;var n=ce()(ee(),"DataView");return Fr=n}(),t=le(),e=function(){if(Gr)return $r;Gr=1;var n=ce()(ee(),"Promise");return $r=n}(),r=Zc(),o=function(){if(Jr)return Qr;Jr=1;var n=ce()(ee(),"WeakMap");return Qr=n}(),i=oe(),u=ae(),a="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",d=u(n),h=u(t),v=u(e),p=u(r),g=u(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=f||t&&y(new t)!=a||e&&y(e.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var t=i(n),e="[object Object]"==t?n.constructor:void 0,r=e?u(e):"";if(r)switch(r){case d:return f;case h:return a;case v:return c;case p:return l;case g:return s}return t}),no=y}function Uc(){if(io)return oo;io=1;var n=ee().Uint8Array;return oo=n}function Fc(){if(ao)return uo;ao=1;var n=Uc();return uo=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}}function Wc(){if(go)return po;go=1;var n=Fc();return po=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}}function $c(){if(bo)return wo;bo=1;var n=ie(),t=Object.create,e=function(){function e(){}return function(r){if(!n(r))return{};if(t)return t(r);e.prototype=r;var o=new e;return e.prototype=void 0,o}}();return wo=e}function Gc(){if(xo)return _o;xo=1;var n=$c(),t=Rc(),e=pr();return _o=function(r){return"function"!=typeof r.constructor||e(r)?{}:n(t(r))}}function qc(){if(Po)return Io;Po=1;var n=he(),t=ve(),e=ye(),r=function(){if(er)return tr;er=1;var n=me(),t=wr();return tr=function(e,r){return e&&n(r,t(r),e)}}(),o=function(){if(sr)return lr;sr=1;var n=me(),t=br();return lr=function(e,r){return e&&n(r,t(r),e)}}(),i=Ac(),u=zc(),a=function(){if(Ir)return jr;Ir=1;var n=me(),t=Bc();return jr=function(e,r){return n(e,t(e),r)}}(),c=function(){if(Rr)return Dr;Rr=1;var n=me(),t=Vc();return Dr=function(e,r){return n(e,t(e),r)}}(),l=Yc(),s=function(){if(Ur)return Xr;Ur=1;var n=Hc(),t=Vc(),e=br();return Xr=function(r){return n(r,e,t)}}(),f=Xc(),d=function(){if(ro)return eo;ro=1;var n=Object.prototype.hasOwnProperty;return eo=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r},eo}(),h=function(){if(mo)return yo;mo=1;var n=Fc(),t=function(){if(lo)return co;lo=1;var n=Fc();return co=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}}(),e=function(){if(fo)return so;fo=1;var n=/\w*$/;return so=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}}(),r=function(){if(vo)return ho;vo=1;var n=re(),t=n?n.prototype:void 0,e=t?t.valueOf:void 0;return ho=function(n){return e?Object(e.call(n)):{}}}(),o=Wc();return yo=function(i,u,a){var c=i.constructor;switch(u){case"[object ArrayBuffer]":return n(i);case"[object Boolean]":case"[object Date]":return new c(+i);case"[object DataView]":return t(i,a);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,a);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(i);case"[object RegExp]":return e(i);case"[object Symbol]":return r(i)}}}(),v=Gc(),p=_e(),g=ze(),y=function(){if(Co)return ko;Co=1;var n=function(){if(So)return Eo;So=1;var n=Xc(),t=we();return Eo=function(e){return t(e)&&"[object Map]"==n(e)}}(),t=Be(),e=dr(),r=e&&e.isMap,o=r?t(r):n;return ko=o}(),m=ie(),w=function(){if(jo)return Oo;jo=1;var n=function(){if(Mo)return No;Mo=1;var n=Xc(),t=we();return No=function(e){return t(e)&&"[object Set]"==n(e)}}(),t=Be(),e=dr(),r=e&&e.isSet,o=r?t(r):n;return Oo=o}(),b=wr(),_=br(),x="[object Arguments]",E="[object Function]",S="[object Object]",k={};return k[x]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[S]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[E]=k["[object WeakMap]"]=!1,Io=function C(N,M,O,j,I,P){var A,z=1&M,L=2&M,T=4&M;if(O&&(A=I?O(N,j,I,P):O(N)),void 0!==A)return A;if(!m(N))return N;var B=p(N);if(B){if(A=d(N),!z)return u(N,A)}else{var D=f(N),R=D==E||"[object GeneratorFunction]"==D;if(g(N))return i(N,z);if(D==S||D==x||R&&!I){if(A=L||R?{}:v(N),!z)return L?c(N,o(A,N)):a(N,r(A,N))}else{if(!k[D])return I?N:{};A=h(N,D,z)}}P||(P=new n);var V=P.get(N);if(V)return V;P.set(N,A),w(N)?N.forEach((function(n){A.add(C(n,M,O,n,N,P))})):y(N)&&N.forEach((function(n,t){A.set(t,C(n,M,O,t,N,P))}));var H=B?void 0:(T?L?s:l:L?_:b)(N);return t(H||N,(function(n,t){H&&(n=N[t=n]),e(A,t,C(n,M,O,t,N,P))})),A},Io}function Kc(){if(zo)return Ao;zo=1;var n=qc();return Ao=function(t){return n(t,4)}}function Qc(){return To?Lo:(To=1,Lo=function(n){return function(){return n}})}function Jc(){if(Vo)return Ro;Vo=1;var n=(Do?Bo:(Do=1,Bo=function(n){return function(t,e,r){for(var o=-1,i=Object(t),u=r(t),a=u.length;a--;){var c=u[n?a:++o];if(!1===e(i[c],c,i))break}return t}}))();return Ro=n}function nl(){if(Yo)return Ho;Yo=1;var n=Jc(),t=wr();return Ho=function(e,r){return e&&n(e,r,t)}}function tl(){if(Fo)return Uo;Fo=1;var n=nl(),t=function(){if(Xo)return Zo;Xo=1;var n=mr();return Zo=function(t,e){return function(r,o){if(null==r)return r;if(!n(r))return t(r,o);for(var i=r.length,u=e?i:-1,a=Object(r);(e?u--:++u<i)&&!1!==o(a[u],u,a););return r}}}()(n);return Uo=t}function el(){return $o?Wo:($o=1,Wo=function(n){return n})}function rl(){if(qo)return Go;qo=1;var n=el();return Go=function(t){return"function"==typeof t?t:n}}function ol(){if(Qo)return Ko;Qo=1;var n=ve(),t=tl(),e=rl(),r=_e();return Ko=function(o,i){return(r(o)?n:t)(o,e(i))}}function il(){return ni?Jo:(ni=1,Jo=ol())}function ul(){if(ci)return ai;ci=1;var n=de(),t=oi?ri:(oi=1,ri=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),e=ui?ii:(ui=1,ii=function(n){return this.__data__.has(n)});function r(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}return r.prototype.add=r.prototype.push=t,r.prototype.has=e,ai=r}function al(){return di?fi:(di=1,fi=function(n,t){return n.has(t)})}function cl(){if(vi)return hi;vi=1;var n=ul(),t=(si||(si=1,li=function(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}),li),e=al();return hi=function(r,o,i,u,a,c){var l=1&i,s=r.length,f=o.length;if(s!=f&&!(l&&f>s))return!1;var d=c.get(r),h=c.get(o);if(d&&h)return d==o&&h==r;var v=-1,p=!0,g=2&i?new n:void 0;for(c.set(r,o),c.set(o,r);++v<s;){var y=r[v],m=o[v];if(u)var w=l?u(m,y,v,o,r,c):u(y,m,v,r,o,c);if(void 0!==w){if(w)continue;p=!1;break}if(g){if(!t(o,(function(n,t){if(!e(g,t)&&(y===n||a(y,n,i,u,c)))return g.push(t)}))){p=!1;break}}else if(y!==m&&!a(y,m,i,u,c)){p=!1;break}}return c.delete(r),c.delete(o),p},hi}function ll(){return mi||(mi=1,yi=function(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=n})),e}),yi}function sl(){if(Si)return Ei;Si=1;var n=he(),t=cl(),e=function(){if(bi)return wi;bi=1;var n=re(),t=Uc(),e=Qt(),r=cl(),o=gi?pi:(gi=1,pi=function(n){var t=-1,e=Array(n.size);return n.forEach((function(n,r){e[++t]=[r,n]})),e}),i=ll(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return wi=function(n,u,c,l,s,f,d){switch(c){case"[object DataView]":if(n.byteLength!=u.byteLength||n.byteOffset!=u.byteOffset)return!1;n=n.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=u.byteLength||!f(new t(n),new t(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return e(+n,+u);case"[object Error]":return n.name==u.name&&n.message==u.message;case"[object RegExp]":case"[object String]":return n==u+"";case"[object Map]":var h=o;case"[object Set]":var v=1&l;if(h||(h=i),n.size!=u.size&&!v)return!1;var p=d.get(n);if(p)return p==u;l|=2,d.set(n,u);var g=r(h(n),h(u),l,s,f,d);return d.delete(n),g;case"[object Symbol]":if(a)return a.call(n)==a.call(u)}return!1}}(),r=function(){if(xi)return _i;xi=1;var n=Yc(),t=Object.prototype.hasOwnProperty;return _i=function(e,r,o,i,u,a){var c=1&o,l=n(e),s=l.length;if(s!=n(r).length&&!c)return!1;for(var f=s;f--;){var d=l[f];if(!(c?d in r:t.call(r,d)))return!1}var h=a.get(e),v=a.get(r);if(h&&v)return h==r&&v==e;var p=!0;a.set(e,r),a.set(r,e);for(var g=c;++f<s;){var y=e[d=l[f]],m=r[d];if(i)var w=c?i(m,y,d,r,e,a):i(y,m,d,e,r,a);if(!(void 0===w?y===m||u(y,m,o,i,a):w)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,_=r.constructor;b==_||!("constructor"in e)||!("constructor"in r)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(e),a.delete(r),p}}(),o=Xc(),i=_e(),u=ze(),a=hr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return Ei=function(d,h,v,p,g,y){var m=i(d),w=i(h),b=m?l:o(d),_=w?l:o(h),x=(b=b==c?s:b)==s,E=(_=_==c?s:_)==s,S=b==_;if(S&&u(d)){if(!u(h))return!1;m=!0,x=!1}if(S&&!x)return y||(y=new n),m||a(d)?t(d,h,v,p,g,y):e(d,h,b,v,p,g,y);if(!(1&v)){var k=x&&f.call(d,"__wrapped__"),C=E&&f.call(h,"__wrapped__");if(k||C){var N=k?d.value():d,M=C?h.value():h;return y||(y=new n),g(N,M,v,p,y)}}return!!S&&(y||(y=new n),r(d,h,v,p,g,y))}}function fl(){if(Ci)return ki;Ci=1;var n=sl(),t=we();return ki=function e(r,o,i,u,a){return r===o||(null==r||null==o||!t(r)&&!t(o)?r!=r&&o!=o:n(r,o,i,u,e,a))},ki}function dl(){if(ji)return Oi;ji=1;var n=ie();return Oi=function(t){return t==t&&!n(t)}}function hl(){return zi?Ai:(zi=1,Ai=function(n,t){return function(e){return null!=e&&e[n]===t&&(void 0!==t||n in Object(e))}})}function vl(){if(Di)return Bi;Di=1;var n=oe(),t=we();return Bi=function(e){return"symbol"==typeof e||t(e)&&"[object Symbol]"==n(e)}}function pl(){if(Vi)return Ri;Vi=1;var n=_e(),t=vl(),e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Ri=function(o,i){if(n(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||r.test(o)||!e.test(o)||null!=i&&o in Object(i)}}function gl(){return $i||($i=1,Wi=function(n,t){for(var e=-1,r=null==n?0:n.length,o=Array(r);++e<r;)o[e]=t(n[e],e,n);return o}),Wi}function yl(){if(Qi)return Ki;Qi=1;var n=function(){if(qi)return Gi;qi=1;var n=re(),t=gl(),e=_e(),r=vl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return Gi=function n(o){if("string"==typeof o)return o;if(e(o))return t(o,n)+"";if(r(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},Gi}();return Ki=function(t){return null==t?"":n(t)}}function ml(){if(nu)return Ji;nu=1;var n=_e(),t=pl(),e=function(){if(Fi)return Ui;Fi=1;var n=function(){if(Xi)return Zi;Xi=1;var n=function(){if(Yi)return Hi;Yi=1;var n=de();function t(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,t=r?r.apply(this,n):n[0],i=o.cache;if(i.has(t))return i.get(t);var u=e.apply(this,n);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||n),o}return t.Cache=n,Hi=t}();return Zi=function(t){var e=n(t,(function(n){return 500===r.size&&r.clear(),n})),r=e.cache;return e}}(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(t,(function(n,t,o,i){r.push(o?i.replace(e,"$1"):t||n)})),r}));return Ui=r}(),r=yl();return Ji=function(o,i){return n(o)?o:t(o,i)?[o]:e(r(o))}}function wl(){if(eu)return tu;eu=1;var n=vl();return tu=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}}function bl(){if(ou)return ru;ou=1;var n=ml(),t=wl();return ru=function(e,r){for(var o=0,i=(r=n(r,e)).length;null!=e&&o<i;)e=e[t(r[o++])];return o&&o==i?e:void 0}}function _l(){if(su)return lu;su=1;var n=ml(),t=be(),e=_e(),r=Le(),o=Te(),i=wl();return lu=function(u,a,c){for(var l=-1,s=(a=n(a,u)).length,f=!1;++l<s;){var d=i(a[l]);if(!(f=null!=u&&c(u,d)))break;u=u[d]}return f||++l!=s?f:!!(s=null==u?0:u.length)&&o(s)&&r(d,s)&&(e(u)||t(u))}}function xl(){if(du)return fu;du=1;var n=cu?au:(cu=1,au=function(n,t){return null!=n&&t in Object(n)}),t=_l();return fu=function(e,r){return null!=e&&t(e,r,n)}}function El(){return gu?pu:(gu=1,pu=function(n){return function(t){return null==t?void 0:t[n]}})}function Sl(){if(xu)return _u;xu=1;var n=function(){if(Ti)return Li;Ti=1;var n=function(){if(Mi)return Ni;Mi=1;var n=he(),t=fl();return Ni=function(e,r,o,i){var u=o.length,a=u,c=!i;if(null==e)return!a;for(e=Object(e);u--;){var l=o[u];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++u<a;){var s=(l=o[u])[0],f=e[s],d=l[1];if(c&&l[2]){if(void 0===f&&!(s in e))return!1}else{var h=new n;if(i)var v=i(f,d,s,e,r,h);if(!(void 0===v?t(d,f,3,i,h):v))return!1}}return!0}}(),t=function(){if(Pi)return Ii;Pi=1;var n=dl(),t=wr();return Ii=function(e){for(var r=t(e),o=r.length;o--;){var i=r[o],u=e[i];r[o]=[i,u,n(u)]}return r}}(),e=hl();return Li=function(r){var o=t(r);return 1==o.length&&o[0][2]?e(o[0][0],o[0][1]):function(t){return t===r||n(t,r,o)}}}(),t=function(){if(vu)return hu;vu=1;var n=fl(),t=function(){if(uu)return iu;uu=1;var n=bl();return iu=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}}(),e=xl(),r=pl(),o=dl(),i=hl(),u=wl();return hu=function(a,c){return r(a)&&o(c)?i(u(a),c):function(r){var o=t(r,a);return void 0===o&&o===c?e(r,a):n(c,o,3)}}}(),e=el(),r=_e(),o=function(){if(bu)return wu;bu=1;var n=El(),t=function(){if(mu)return yu;mu=1;var n=bl();return yu=function(t){return function(e){return n(e,t)}}}(),e=pl(),r=wl();return wu=function(o){return e(o)?n(r(o)):t(o)}}();return _u=function(i){return"function"==typeof i?i:null==i?e:"object"==typeof i?r(i)?t(i[0],i[1]):n(i):o(i)}}function kl(){if(Su)return Eu;Su=1;var n=Lc(),t=function(){if(ei)return ti;ei=1;var n=tl();return ti=function(t,e){var r=[];return n(t,(function(n,t,o){e(n,t,o)&&r.push(n)})),r}}(),e=Sl(),r=_e();return Eu=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function Cl(){if(Mu)return Nu;Mu=1;var n=function(){if(Cu)return ku;Cu=1;var n=Object.prototype.hasOwnProperty;return ku=function(t,e){return null!=t&&n.call(t,e)}}(),t=_l();return Nu=function(e,r){return null!=e&&t(e,r,n)}}function Nl(){if(ju)return Ou;ju=1;var n=yr(),t=Xc(),e=be(),r=_e(),o=mr(),i=ze(),u=pr(),a=hr(),c=Object.prototype.hasOwnProperty;return Ou=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||a(l)||e(l)))return!l.length;var s=t(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(u(l))return!n(l).length;for(var f in l)if(c.call(l,f))return!1;return!0}}function Ml(){return Pu?Iu:(Pu=1,Iu=function(n){return void 0===n})}function Ol(){if(zu)return Au;zu=1;var n=tl(),t=mr();return Au=function(e,r){var o=-1,i=t(e)?Array(e.length):[];return n(e,(function(n,t,e){i[++o]=r(n,t,e)})),i}}function jl(){if(Tu)return Lu;Tu=1;var n=gl(),t=Sl(),e=Ol(),r=_e();return Lu=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function Il(){if(Yu)return Hu;Yu=1;var n=(Du||(Du=1,Bu=function(n,t,e,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);return e}),Bu),t=tl(),e=Sl(),r=Vu?Ru:(Vu=1,Ru=function(n,t,e,r,o){return o(n,(function(n,o,i){e=r?(r=!1,n):t(e,n,o,i)})),e}),o=_e();return Hu=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,e(u,4),a,l,t)},Hu}function Pl(){if(na)return Ju;na=1;var n=yr(),t=Xc(),e=mr(),r=function(){if(Xu)return Zu;Xu=1;var n=oe(),t=_e(),e=we();return Zu=function(r){return"string"==typeof r||!t(r)&&e(r)&&"[object String]"==n(r)}}(),o=function(){if(Qu)return Ku;Qu=1;var n=function(){if(Fu)return Uu;Fu=1;var n=El()("length");return Uu=n}(),t=function(){if($u)return Wu;$u=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Wu=function(t){return n.test(t)}}(),e=function(){if(qu)return Gu;qu=1;var n="\\ud800-\\udfff",t="["+n+"]",e="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+e+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+c+a+")*",s="(?:"+[o+e+"?",e,i,u,t].join("|")+")",f=RegExp(r+"(?="+r+")|"+s+l,"g");return Gu=function(n){for(var t=f.lastIndex=0;f.test(n);)++t;return t}}();return Ku=function(r){return t(r)?e(r):n(r)}}();return Ju=function(i){if(null==i)return 0;if(e(i))return r(i)?o(i):i.length;var u=t(i);return"[object Map]"==u||"[object Set]"==u?i.size:n(i).length}}function Al(){if(ea)return ta;ea=1;var n=ve(),t=$c(),e=nl(),r=Sl(),o=Rc(),i=_e(),u=ze(),a=ue(),c=ie(),l=hr();return ta=function(s,f,d){var h=i(s),v=h||u(s)||l(s);if(f=r(f,4),null==d){var p=s&&s.constructor;d=v?h?new p:[]:c(s)&&a(p)?t(o(s)):{}}return(v?n:e)(s,(function(n,t,e){return f(d,n,t,e)})),d}}function zl(){if(ua)return ia;ua=1;var n=Dc(),t=function(){if(oa)return ra;oa=1;var n=re(),t=be(),e=_e(),r=n?n.isConcatSpreadable:void 0;return ra=function(n){return e(n)||t(n)||!!(r&&n&&n[r])}}();return ia=function e(r,o,i,u,a){var c=-1,l=r.length;for(i||(i=t),a||(a=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?e(s,o-1,i,u,a):n(a,s):u||(a[a.length]=s)}return a},ia}function Ll(){if(sa)return la;sa=1;var n=ca?aa:(ca=1,aa=function(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}),t=Math.max;return la=function(e,r,o){return r=t(void 0===r?e.length-1:r,0),function(){for(var i=arguments,u=-1,a=t(i.length-r,0),c=Array(a);++u<a;)c[u]=i[r+u];u=-1;for(var l=Array(r+1);++u<r;)l[u]=i[u];return l[r]=o(c),n(e,this,l)}},la}function Tl(){if(ga)return pa;ga=1;var n=function(){if(da)return fa;da=1;var n=Qc(),t=pe(),e=el();return fa=t?function(e,r){return t(e,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:e}(),t=function(){if(va)return ha;va=1;var n=Date.now;return ha=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},ha}(),e=t(n);return pa=e}function Bl(){if(ma)return ya;ma=1;var n=el(),t=Ll(),e=Tl();return ya=function(r,o){return e(t(r,o,n),r+"")},ya}function Dl(){return ba||(ba=1,wa=function(n,t,e,r){for(var o=n.length,i=e+(r?1:-1);r?i--:++i<o;)if(t(n[i],i,n))return i;return-1}),wa}function Rl(){if(Ta)return La;Ta=1;var n=ul(),t=function(){if(Ma)return Na;Ma=1;var n=function(){if(Ca)return ka;Ca=1;var n=Dl(),t=xa?_a:(xa=1,_a=function(n){return n!=n}),e=(Sa||(Sa=1,Ea=function(n,t,e){for(var r=e-1,o=n.length;++r<o;)if(n[r]===t)return r;return-1}),Ea);return ka=function(r,o,i){return o==o?e(r,o,i):n(r,t,i)},ka}();return Na=function(t,e){return!(null==t||!t.length)&&n(t,e,0)>-1},Na}(),e=(ja||(ja=1,Oa=function(n,t,e){for(var r=-1,o=null==n?0:n.length;++r<o;)if(e(t,n[r]))return!0;return!1}),Oa),r=al(),o=function(){if(za)return Aa;za=1;var n=Zc(),t=Pa?Ia:(Pa=1,Ia=function(){}),e=ll(),r=n&&1/e(new n([,-0]))[1]==1/0?function(t){return new n(t)}:t;return Aa=r}(),i=ll();return La=function(u,a,c){var l=-1,s=t,f=u.length,d=!0,h=[],v=h;if(c)d=!1,s=e;else if(f>=200){var p=a?null:o(u);if(p)return i(p);d=!1,s=r,v=new n}else v=a?[]:h;n:for(;++l<f;){var g=u[l],y=a?a(g):g;if(g=c||0!==g?g:0,d&&y==y){for(var m=v.length;m--;)if(v[m]===y)continue n;a&&v.push(y),h.push(g)}else s(v,y,c)||(v!==h&&v.push(y),h.push(g))}return h},La}function Vl(){if(Da)return Ba;Da=1;var n=mr(),t=we();return Ba=function(e){return t(e)&&n(e)}}function Hl(){if(Va)return Ra;Va=1;var n=zl(),t=Bl(),e=Rl(),r=Vl(),o=t((function(t){return e(n(t,1,r,!0))}));return Ra=o}function Yl(){if(Xa)return Za;Xa=1;var n=function(){if(Ya)return Ha;Ya=1;var n=gl();return Ha=function(t,e){return n(e,(function(n){return t[n]}))}}(),t=wr();return Za=function(e){return null==e?[]:n(e,t(e))}}function Zl(){if(Fa)return Ua;var n;Fa=1;try{n={clone:Kc(),constant:Qc(),each:il(),filter:kl(),has:Cl(),isArray:_e(),isEmpty:Nl(),isFunction:ue(),isUndefined:Ml(),keys:wr(),map:jl(),reduce:Il(),size:Pl(),transform:Al(),union:Hl(),values:Yl()}}catch(n){}return n||(n=window._),Ua=n}function Xl(){if($a)return Wa;$a=1;var n=Zl();Wa=e;var t="\0";function e(e){this._isDirected=!n.has(e,"directed")||e.directed,this._isMultigraph=!!n.has(e,"multigraph")&&e.multigraph,this._isCompound=!!n.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(n,t){n[t]?n[t]++:n[t]=1}function o(n,t){--n[t]||delete n[t]}function i(t,e,r,o){var i=""+e,u=""+r;if(!t&&i>u){var a=i;i=u,u=a}return i+""+u+""+(n.isUndefined(o)?"\0":o)}function u(n,t){return i(n,t.v,t.w,t.name)}return e.prototype._nodeCount=0,e.prototype._edgeCount=0,e.prototype.isDirected=function(){return this._isDirected},e.prototype.isMultigraph=function(){return this._isMultigraph},e.prototype.isCompound=function(){return this._isCompound},e.prototype.setGraph=function(n){return this._label=n,this},e.prototype.graph=function(){return this._label},e.prototype.setDefaultNodeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultNodeLabelFn=t,this},e.prototype.nodeCount=function(){return this._nodeCount},e.prototype.nodes=function(){return n.keys(this._nodes)},e.prototype.sources=function(){var t=this;return n.filter(this.nodes(),(function(e){return n.isEmpty(t._in[e])}))},e.prototype.sinks=function(){var t=this;return n.filter(this.nodes(),(function(e){return n.isEmpty(t._out[e])}))},e.prototype.setNodes=function(t,e){var r=arguments,o=this;return n.each(t,(function(n){r.length>1?o.setNode(n,e):o.setNode(n)})),this},e.prototype.setNode=function(e,r){return n.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=t,this._children[e]={},this._children[t][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},e.prototype.node=function(n){return this._nodes[n]},e.prototype.hasNode=function(t){return n.has(this._nodes,t)},e.prototype.removeNode=function(t){var e=this;if(n.has(this._nodes,t)){var r=function(n){e.removeEdge(e._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],n.each(this.children(t),(function(n){e.setParent(n)})),delete this._children[t]),n.each(n.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],n.each(n.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},e.prototype.setParent=function(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(r))r=t;else{for(var o=r+="";!n.isUndefined(o);o=this.parent(o))if(o===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this},e.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},e.prototype.parent=function(n){if(this._isCompound){var e=this._parent[n];if(e!==t)return e}},e.prototype.children=function(e){if(n.isUndefined(e)&&(e=t),this._isCompound){var r=this._children[e];if(r)return n.keys(r)}else{if(e===t)return this.nodes();if(this.hasNode(e))return[]}},e.prototype.predecessors=function(t){var e=this._preds[t];if(e)return n.keys(e)},e.prototype.successors=function(t){var e=this._sucs[t];if(e)return n.keys(e)},e.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return n.union(e,this.successors(t))},e.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},e.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),n.each(this._edgeObjs,(function(n){e.hasNode(n.v)&&e.hasNode(n.w)&&e.setEdge(n,r.edge(n))}));var o={};function i(n){var t=r.parent(n);return void 0===t||e.hasNode(t)?(o[n]=t,t):t in o?o[t]:i(t)}return this._isCompound&&n.each(e.nodes(),(function(n){e.setParent(n,i(n))})),e},e.prototype.setDefaultEdgeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultEdgeLabelFn=t,this},e.prototype.edgeCount=function(){return this._edgeCount},e.prototype.edges=function(){return n.values(this._edgeObjs)},e.prototype.setPath=function(t,e){var r=this,o=arguments;return n.reduce(t,(function(n,t){return o.length>1?r.setEdge(n,t,e):r.setEdge(n,t),t})),this},e.prototype.setEdge=function(){var t,e,o,u,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,o=c.name,2===arguments.length&&(u=arguments[1],a=!0)):(t=c,e=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),t=""+t,e=""+e,n.isUndefined(o)||(o=""+o);var l=i(this._isDirected,t,e,o);if(n.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=u),this;if(!n.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=a?u:this._defaultEdgeLabelFn(t,e,o);var s=function(n,t,e,r){var o=""+t,i=""+e;if(!n&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};return r&&(a.name=r),a}(this._isDirected,t,e,o);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[l]=s,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=s,this._out[t][l]=s,this._edgeCount++,this},e.prototype.edge=function(n,t,e){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,t,e);return this._edgeLabels[r]},e.prototype.hasEdge=function(t,e,r){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,t,e,r);return n.has(this._edgeLabels,o)},e.prototype.removeEdge=function(n,t,e){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,t,e),a=this._edgeObjs[r];return a&&(n=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[t],n),o(this._sucs[n],t),delete this._in[t][r],delete this._out[n][r],this._edgeCount--),this},e.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var o=n.values(r);return e?n.filter(o,(function(n){return n.v===e})):o}},e.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var o=n.values(r);return e?n.filter(o,(function(n){return n.w===e})):o}},e.prototype.nodeEdges=function(n,t){var e=this.inEdges(n,t);if(e)return e.concat(this.outEdges(n,t))},Wa}function Ul(){if(nc)return Ja;nc=1;var n=Zl(),t=Xl();function e(t){return n.map(t.nodes(),(function(e){var r=t.node(e),o=t.parent(e),i={v:e};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(t){return n.map(t.edges(),(function(e){var r=t.edge(e),o={v:e.v,w:e.w};return n.isUndefined(e.name)||(o.name=e.name),n.isUndefined(r)||(o.value=r),o}))}return Ja={write:function(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:e(t),edges:r(t)};return n.isUndefined(t.graph())||(o.value=n.clone(t.graph())),o},read:function(e){var r=new t(e.options).setGraph(e.value);return n.each(e.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(e.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Fl(){if(ec)return tc;ec=1;var n=Zl();return tc=function(t){var e,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,e.push(o),n.each(t.successors(o),i),n.each(t.predecessors(o),i))}return n.each(t.nodes(),(function(n){e=[],i(n),e.length&&o.push(e)})),o},tc}function Wl(){if(oc)return rc;oc=1;var n=Zl();function t(){this._arr=[],this._keyIndices={}}return rc=t,t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},t.prototype.has=function(t){return n.has(this._keyIndices,t)},t.prototype.priority=function(n){var t=this._keyIndices[n];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!n.has(r,t)){var o=this._arr,i=o.length;return r[t]=i,o.push({key:t,priority:e}),this._decrease(i),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,t){var e=this._keyIndices[n];if(t>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[e].priority+" New: "+t);this._arr[e].priority=t,this._decrease(e)},t.prototype._heapify=function(n){var t=this._arr,e=2*n,r=e+1,o=n;e<t.length&&(o=t[e].priority<t[o].priority?e:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},t.prototype._decrease=function(n){for(var t,e=this._arr,r=e[n].priority;0!==n&&!(e[t=n>>1].priority<r);)this._swap(n,t),n=t},t.prototype._swap=function(n,t){var e=this._arr,r=this._keyIndices,o=e[n],i=e[t];e[n]=i,e[t]=o,r[i.key]=n,r[o.key]=t},rc}function $l(){if(uc)return ic;uc=1;var n=Zl(),t=Wl();ic=function(n,r,o,i){return function(n,e,r,o){var i,u,a={},c=new t,l=function(n){var t=n.v!==i?n.v:n.w,e=a[t],o=r(n),l=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+n+" Weight: "+o);l<e.distance&&(e.distance=l,e.predecessor=i,c.decrease(t,l))};for(n.nodes().forEach((function(n){var t=n===e?0:Number.POSITIVE_INFINITY;a[n]={distance:t},c.add(n,t)}));c.size()>0&&(i=c.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return a}(n,String(r),o||e,i||function(t){return n.outEdges(t)})};var e=n.constant(1);return ic}function Gl(){if(cc)return ac;cc=1;var n=$l(),t=Zl();return ac=function(e,r,o){return t.transform(e.nodes(),(function(t,i){t[i]=n(e,i,r,o)}),{})}}function ql(){if(sc)return lc;sc=1;var n=Zl();return lc=function(t){var e=0,r=[],o={},i=[];function u(a){var c=o[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach((function(t){n.has(o,t)?o[t].onStack&&(c.lowlink=Math.min(c.lowlink,o[t].index)):(u(t),c.lowlink=Math.min(c.lowlink,o[t].lowlink))})),c.lowlink===c.index){var l,s=[];do{l=r.pop(),o[l].onStack=!1,s.push(l)}while(a!==l);i.push(s)}}return t.nodes().forEach((function(t){n.has(o,t)||u(t)})),i},lc}function Kl(){if(dc)return fc;dc=1;var n=Zl(),t=ql();return fc=function(e){return n.filter(t(e),(function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])}))}}function Ql(){if(vc)return hc;vc=1;var n=Zl();hc=function(n,e,r){return function(n,t,e){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(t){n!==t&&(r[n][t]={distance:Number.POSITIVE_INFINITY})})),e(n).forEach((function(e){var o=e.v===n?e.w:e.v,i=t(e);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var t=r[n];o.forEach((function(e){var i=r[e];o.forEach((function(e){var r=i[n],o=t[e],u=i[e],a=r.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)}))}))})),r}(n,e||t,r||function(t){return n.outEdges(t)})};var t=n.constant(1);return hc}function Jl(){if(gc)return pc;gc=1;var n=Zl();function t(t){var r={},o={},i=[];if(n.each(t.sinks(),(function u(a){if(n.has(o,a))throw new e;n.has(r,a)||(o[a]=!0,r[a]=!0,n.each(t.predecessors(a),u),delete o[a],i.push(a))})),n.size(r)!==t.nodeCount())throw new e;return i}function e(){}return pc=t,t.CycleException=e,e.prototype=new Error,pc}function ns(){if(mc)return yc;mc=1;var n=Jl();return yc=function(t){try{n(t)}catch(t){if(t instanceof n.CycleException)return!1;throw t}return!0}}function ts(){if(bc)return wc;bc=1;var n=Zl();function t(e,r,o,i,u,a){n.has(i,r)||(i[r]=!0,o||a.push(r),n.each(u(r),(function(n){t(e,n,o,i,u,a)})),o&&a.push(r))}return wc=function(e,r,o){n.isArray(r)||(r=[r]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),u=[],a={};return n.each(r,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);t(e,n,"post"===o,a,i,u)})),u},wc}function es(){if(xc)return _c;xc=1;var n=ts();return _c=function(t,e){return n(t,e,"post")}}function rs(){if(Sc)return Ec;Sc=1;var n=ts();return Ec=function(t,e){return n(t,e,"pre")}}function os(){if(Cc)return kc;Cc=1;var n=Zl(),t=Xl(),e=Wl();return kc=function(r,o){var i,u=new t,a={},c=new e;function l(n){var t=n.v===i?n.w:n.v,e=c.priority(t);if(void 0!==e){var r=o(n);r<e&&(a[t]=i,c.decrease(t,r))}}if(0===r.nodeCount())return u;n.each(r.nodes(),(function(n){c.add(n,Number.POSITIVE_INFINITY),u.setNode(n)})),c.decrease(r.nodes()[0],0);for(var s=!1;c.size()>0;){if(i=c.removeMin(),n.has(a,i))u.setEdge(i,a[i]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(i).forEach(l)}return u},kc}try{Ic=function(){if(jc)return Oc;jc=1;var n=Qa?Ka:(Qa=1,Ka={Graph:Xl(),version:qa?Ga:(qa=1,Ga="2.1.8")});return Oc={Graph:n.Graph,json:Ul(),alg:Mc?Nc:(Mc=1,Nc={components:Fl(),dijkstra:$l(),dijkstraAll:Gl(),findCycles:Kl(),floydWarshall:Ql(),isAcyclic:ns(),postorder:es(),preorder:rs(),prim:os(),tarjan:ql(),topsort:Jl()}),version:n.version}}()}catch(U){}Ic||(Ic=window.graphlib);var is,us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,ws,bs,_s,xs,Es,Ss,ks,Cs,Ns,Ms,Os,js,Is,Ps,As,zs,Ls,Ts,Bs,Ds,Rs,Vs,Hs,Ys,Zs,Xs,Us,Fs,Ws,$s,Gs,qs,Ks,Qs,Js,nf,tf,ef,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,wf,bf,_f,xf,Ef,Sf,kf,Cf,Nf,Mf,Of,jf,If,Pf,Af,zf,Lf,Tf,Bf,Df,Rf,Vf,Hf,Yf,Zf,Xf,Uf=Ic;function Ff(){if(cs)return as;cs=1;var n=Qt(),t=mr(),e=Le(),r=ie();return as=function(o,i,u){if(!r(u))return!1;var a=typeof i;return!!("number"==a?t(u)&&e(i,u.length):"string"==a&&i in u)&&n(u[i],o)}}function Wf(){if(bs)return ws;bs=1;var n=function(){if(ms)return ys;ms=1;var n=function(){if(gs)return ps;gs=1;var n=function(){if(vs)return hs;vs=1;var n=/\s/;return hs=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}}(),t=/^\s+/;return ps=function(e){return e?e.slice(0,n(e)+1).replace(t,""):e}}(),t=ie(),e=vl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return ys=function(a){if("number"==typeof a)return a;if(e(a))return NaN;if(t(a)){var c="function"==typeof a.valueOf?a.valueOf():a;a=t(c)?c+"":c}if("string"!=typeof a)return 0===a?a:+a;a=n(a);var l=o.test(a);return l||i.test(a)?u(a.slice(2),l?2:8):r.test(a)?NaN:+a}}(),t=1/0;return ws=function(e){return e?(e=n(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}function $f(){if(Ms)return Ns;Ms=1;var n=zl();return Ns=function(t){return null!=t&&t.length?n(t,1):[]}}function Gf(){if(Ts)return Ls;Ts=1;var n=vl();return Ls=function(t,e,r){for(var o=-1,i=t.length;++o<i;){var u=t[o],a=e(u);if(null!=a&&(void 0===c?a==a&&!n(a):r(a,c)))var c=a,l=u}return l},Ls}function qf(){if(Ys)return Hs;Ys=1;var n=ge(),t=Qt();return Hs=function(e,r,o){(void 0!==o&&!t(e[r],o)||void 0===o&&!(r in e))&&n(e,r,o)}}function Kf(){return Fs?Us:(Fs=1,Us=function(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]})}function Qf(){return of?rf:(of=1,rf=function(n,t){return n<t})}function Jf(){if(Lf)return zf;Lf=1;var n=gl(),t=bl(),e=Sl(),r=Ol(),o=(Of||(Of=1,Mf=function(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}),Mf),i=Be(),u=function(){if(Af)return Pf;Af=1;var n=function(){if(If)return jf;If=1;var n=vl();return jf=function(t,e){if(t!==e){var r=void 0!==t,o=null===t,i=t==t,u=n(t),a=void 0!==e,c=null===e,l=e==e,s=n(e);if(!c&&!s&&!u&&t>e||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&t<e||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}}();return Pf=function(t,e,r){for(var o=-1,i=t.criteria,u=e.criteria,a=i.length,c=r.length;++o<a;){var l=n(i[o],u[o]);if(l)return o>=c?l:l*("desc"==r[o]?-1:1)}return t.index-e.index}}(),a=el(),c=_e();return zf=function(l,s,f){s=s.length?n(s,(function(n){return c(n)?function(e){return t(e,1===n.length?n[0]:n)}:n})):[a];var d=-1;s=n(s,i(e));var h=r(l,(function(t,e,r){return{criteria:n(s,(function(n){return n(t)})),index:++d,value:t}}));return o(h,(function(n,t){return u(n,t,f)}))}}try{Xf={cloneDeep:function(){if(us)return is;us=1;var n=qc();return is=function(t){return n(t,5)}}(),constant:Qc(),defaults:function(){if(ss)return ls;ss=1;var n=Bl(),t=Qt(),e=Ff(),r=br(),o=Object.prototype,i=o.hasOwnProperty,u=n((function(n,u){n=Object(n);var a=-1,c=u.length,l=c>2?u[2]:void 0;for(l&&e(u[0],u[1],l)&&(c=1);++a<c;)for(var s=u[a],f=r(s),d=-1,h=f.length;++d<h;){var v=f[d],p=n[v];(void 0===p||t(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return ls=u}(),each:il(),filter:kl(),find:function(){if(Cs)return ks;Cs=1;var n=function(){if(ds)return fs;ds=1;var n=Sl(),t=mr(),e=wr();return fs=function(r){return function(o,i,u){var a=Object(o);if(!t(o)){var c=n(i,3);o=e(o),i=function(n){return c(a[n],n,a)}}var l=r(o,i,u);return l>-1?a[c?o[l]:l]:void 0}}}()(function(){if(Ss)return Es;Ss=1;var n=Dl(),t=Sl(),e=function(){if(xs)return _s;xs=1;var n=Wf();return _s=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}}(),r=Math.max;return Es=function(o,i,u){var a=null==o?0:o.length;if(!a)return-1;var c=null==u?0:e(u);return c<0&&(c=r(a+c,0)),n(o,t(i,3),c)},Es}());return ks=n}(),flatten:$f(),forEach:ol(),forIn:function(){if(js)return Os;js=1;var n=Jc(),t=rl(),e=br();return Os=function(r,o){return null==r?r:n(r,t(o),e)}}(),has:Cl(),isUndefined:Ml(),last:(Ps||(Ps=1,Is=function(n){var t=null==n?0:n.length;return t?n[t-1]:void 0}),Is),map:jl(),mapValues:function(){if(zs)return As;zs=1;var n=ge(),t=nl(),e=Sl();return As=function(r,o){var i={};return o=e(o,3),t(r,(function(t,e,r){n(i,e,o(t,e,r))})),i}}(),max:function(){if(Vs)return Rs;Vs=1;var n=Gf(),t=Ds?Bs:(Ds=1,Bs=function(n,t){return n>t}),e=el();return Rs=function(r){return r&&r.length?n(r,e,t):void 0},Rs}(),merge:function(){if(ef)return tf;ef=1;var n=function(){if(Qs)return Ks;Qs=1;var n=he(),t=qf(),e=Jc(),r=function(){if(qs)return Gs;qs=1;var n=qf(),t=Ac(),e=Wc(),r=zc(),o=Gc(),i=be(),u=_e(),a=Vl(),c=ze(),l=ue(),s=ie(),f=function(){if(Xs)return Zs;Xs=1;var n=oe(),t=Rc(),e=we(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return Zs=function(r){if(!e(r)||"[object Object]"!=n(r))return!1;var o=t(r);if(null===o)return!0;var c=u.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==a}}(),d=hr(),h=Kf(),v=function(){if($s)return Ws;$s=1;var n=me(),t=br();return Ws=function(e){return n(e,t(e))}}();return Gs=function(p,g,y,m,w,b,_){var x=h(p,y),E=h(g,y),S=_.get(E);if(S)n(p,y,S);else{var k=b?b(x,E,y+"",p,g,_):void 0,C=void 0===k;if(C){var N=u(E),M=!N&&c(E),O=!N&&!M&&d(E);k=E,N||M||O?u(x)?k=x:a(x)?k=r(x):M?(C=!1,k=t(E,!0)):O?(C=!1,k=e(E,!0)):k=[]:f(E)||i(E)?(k=x,i(x)?k=v(x):s(x)&&!l(x)||(k=o(E))):C=!1}C&&(_.set(E,k),w(k,E,m,b,_),_.delete(E)),n(p,y,k)}}}(),o=ie(),i=br(),u=Kf();return Ks=function a(c,l,s,f,d){c!==l&&e(l,(function(e,i){if(d||(d=new n),o(e))r(c,l,i,s,a,f,d);else{var h=f?f(u(c,i),e,i+"",c,l,d):void 0;void 0===h&&(h=e),t(c,i,h)}}),i)},Ks}(),t=function(){if(nf)return Js;nf=1;var n=Bl(),t=Ff();return Js=function(e){return n((function(n,r){var o=-1,i=r.length,u=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(u=e.length>3&&"function"==typeof u?(i--,u):void 0,a&&t(r[0],r[1],a)&&(u=i<3?void 0:u,i=1),n=Object(n);++o<i;){var c=r[o];c&&e(n,c,o,u)}return n}))}}()((function(t,e,r){n(t,e,r)}));return tf=t}(),min:function(){if(af)return uf;af=1;var n=Gf(),t=Qf(),e=el();return uf=function(r){return r&&r.length?n(r,e,t):void 0},uf}(),minBy:function(){if(lf)return cf;lf=1;var n=Gf(),t=Sl(),e=Qf();return cf=function(r,o){return r&&r.length?n(r,t(o,2),e):void 0},cf}(),now:function(){if(ff)return sf;ff=1;var n=ee();return sf=function(){return n.Date.now()}}(),pick:function(){if(_f)return bf;_f=1;var n=function(){if(yf)return gf;yf=1;var n=function(){if(pf)return vf;pf=1;var n=bl(),t=function(){if(hf)return df;hf=1;var n=ye(),t=ml(),e=Le(),r=ie(),o=wl();return df=function(i,u,a,c){if(!r(i))return i;for(var l=-1,s=(u=t(u,i)).length,f=s-1,d=i;null!=d&&++l<s;){var h=o(u[l]),v=a;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(l!=f){var p=d[h];void 0===(v=c?c(p,h,d):void 0)&&(v=r(p)?p:e(u[l+1])?[]:{})}n(d,h,v),d=d[h]}return i}}(),e=ml();return vf=function(r,o,i){for(var u=-1,a=o.length,c={};++u<a;){var l=o[u],s=n(r,l);i(s,l)&&t(c,e(l,r),s)}return c}}(),t=xl();return gf=function(e,r){return n(e,r,(function(n,r){return t(e,r)}))}}(),t=function(){if(wf)return mf;wf=1;var n=$f(),t=Ll(),e=Tl();return mf=function(r){return e(t(r,void 0,n),r+"")}}()((function(t,e){return null==t?{}:n(t,e)}));return bf=t}(),range:function(){if(Nf)return Cf;Nf=1;var n=function(){if(kf)return Sf;kf=1;var n=function(){if(Ef)return xf;Ef=1;var n=Math.ceil,t=Math.max;return xf=function(e,r,o,i){for(var u=-1,a=t(n((r-e)/(o||1)),0),c=Array(a);a--;)c[i?a:++u]=e,e+=o;return c},xf}(),t=Ff(),e=Wf();return Sf=function(r){return function(o,i,u){return u&&"number"!=typeof u&&t(o,i,u)&&(i=u=void 0),o=e(o),void 0===i?(i=o,o=0):i=e(i),u=void 0===u?o<i?1:-1:e(u),n(o,i,u,r)}},Sf}()();return Cf=n}(),reduce:Il(),sortBy:function(){if(Bf)return Tf;Bf=1;var n=zl(),t=Jf(),e=Bl(),r=Ff(),o=e((function(e,o){if(null==e)return[];var i=o.length;return i>1&&r(e,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(e,n(o,1),[])}));return Tf=o}(),uniqueId:function(){if(Rf)return Df;Rf=1;var n=yl(),t=0;return Df=function(e){var r=++t;return n(e)+r},Df}(),values:Yl(),zipObject:function(){if(Zf)return Yf;Zf=1;var n=ye(),t=Hf?Vf:(Hf=1,Vf=function(n,t,e){for(var r=-1,o=n.length,i=t.length,u={};++r<o;){var a=r<i?t[r]:void 0;e(u,n[r],a)}return u});return Yf=function(e,r){return t(e||[],r||[],n)}}()}}catch(U){}Xf||(Xf=window._);var nd=Xf,td=ed;function ed(){var n={};n._next=n._prev=n,this._sentinel=n}function rd(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function od(n,t){if("_next"!==n&&"_prev"!==n)return t}ed.prototype.dequeue=function(){var n=this._sentinel,t=n._prev;if(t!==n)return rd(t),t},ed.prototype.enqueue=function(n){var t=this._sentinel;n._prev&&n._next&&rd(n),n._next=t._next,t._next._prev=n,t._next=n,n._prev=t},ed.prototype.toString=function(){for(var n=[],t=this._sentinel,e=t._prev;e!==t;)n.push(JSON.stringify(e,od)),e=e._prev;return"["+n.join(", ")+"]"};var id=nd,ud=Uf.Graph,ad=td,cd=id.constant(1);function ld(n,t,e,r,o){var i=o?[]:void 0;return id.forEach(n.inEdges(r.v),(function(r){var u=n.edge(r),a=n.node(r.v);o&&i.push({v:r.v,w:r.w}),a.out-=u,sd(t,e,a)})),id.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,sd(t,e,u)})),n.removeNode(r.v),i}function sd(n,t,e){e.out?e.in?n[e.out-e.in+t].enqueue(e):n[n.length-1].enqueue(e):n[0].enqueue(e)}var fd=nd,dd=function(n,t){if(n.nodeCount()<=1)return[];var e=function(n,t){var e=new ud,r=0,o=0;id.forEach(n.nodes(),(function(n){e.setNode(n,{v:n,in:0,out:0})})),id.forEach(n.edges(),(function(n){var i=e.edge(n.v,n.w)||0,u=t(n),a=i+u;e.setEdge(n.v,n.w,a),o=Math.max(o,e.node(n.v).out+=u),r=Math.max(r,e.node(n.w).in+=u)}));var i=id.range(o+r+3).map((function(){return new ad})),u=r+1;return id.forEach(e.nodes(),(function(n){sd(i,u,e.node(n))})),{graph:e,buckets:i,zeroIdx:u}}(n,t||cd),r=function(n,t,e){for(var r,o=[],i=t[t.length-1],u=t[0];n.nodeCount();){for(;r=u.dequeue();)ld(n,t,e,r);for(;r=i.dequeue();)ld(n,t,e,r);if(n.nodeCount())for(var a=t.length-2;a>0;--a)if(r=t[a].dequeue()){o=o.concat(ld(n,t,e,r,!0));break}}return o}(e.graph,e.buckets,e.zeroIdx);return id.flatten(id.map(r,(function(t){return n.outEdges(t.v,t.w)})),!0)},hd={run:function(n){var t="greedy"===n.graph().acyclicer?dd(n,function(n){return function(t){return n.edge(t).weight}}(n)):function(n){var t=[],e={},r={};return fd.forEach(n.nodes(),(function o(i){fd.has(r,i)||(r[i]=!0,e[i]=!0,fd.forEach(n.outEdges(i),(function(n){fd.has(e,n.w)?t.push(n):o(n.w)})),delete e[i])})),t}(n);fd.forEach(t,(function(t){var e=n.edge(t);n.removeEdge(t),e.forwardName=t.name,e.reversed=!0,n.setEdge(t.w,t.v,e,fd.uniqueId("rev"))}))},undo:function(n){fd.forEach(n.edges(),(function(t){var e=n.edge(t);if(e.reversed){n.removeEdge(t);var r=e.forwardName;delete e.reversed,delete e.forwardName,n.setEdge(t.w,t.v,e,r)}}))}},vd=nd,pd=Uf.Graph,gd={addDummyNode:yd,simplify:function(n){var t=(new pd).setGraph(n.graph());return vd.forEach(n.nodes(),(function(e){t.setNode(e,n.node(e))})),vd.forEach(n.edges(),(function(e){var r=t.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);t.setEdge(e.v,e.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),t},asNonCompoundGraph:function(n){var t=new pd({multigraph:n.isMultigraph()}).setGraph(n.graph());return vd.forEach(n.nodes(),(function(e){n.children(e).length||t.setNode(e,n.node(e))})),vd.forEach(n.edges(),(function(e){t.setEdge(e,n.edge(e))})),t},successorWeights:function(n){var t=vd.map(n.nodes(),(function(t){var e={};return vd.forEach(n.outEdges(t),(function(t){e[t.w]=(e[t.w]||0)+n.edge(t).weight})),e}));return vd.zipObject(n.nodes(),t)},predecessorWeights:function(n){var t=vd.map(n.nodes(),(function(t){var e={};return vd.forEach(n.inEdges(t),(function(t){e[t.v]=(e[t.v]||0)+n.edge(t).weight})),e}));return vd.zipObject(n.nodes(),t)},intersectRect:function(n,t){var e,r,o=n.x,i=n.y,u=t.x-o,a=t.y-i,c=n.width/2,l=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*c>Math.abs(u)*l?(a<0&&(l=-l),e=l*u/a,r=l):(u<0&&(c=-c),e=c,r=c*a/u),{x:o+e,y:i+r}},buildLayerMatrix:function(n){var t=vd.map(vd.range(md(n)+1),(function(){return[]}));return vd.forEach(n.nodes(),(function(e){var r=n.node(e),o=r.rank;vd.isUndefined(o)||(t[o][r.order]=e)})),t},normalizeRanks:function(n){var t=vd.min(vd.map(n.nodes(),(function(t){return n.node(t).rank})));vd.forEach(n.nodes(),(function(e){var r=n.node(e);vd.has(r,"rank")&&(r.rank-=t)}))},removeEmptyRanks:function(n){var t=vd.min(vd.map(n.nodes(),(function(t){return n.node(t).rank}))),e=[];vd.forEach(n.nodes(),(function(r){var o=n.node(r).rank-t;e[o]||(e[o]=[]),e[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;vd.forEach(e,(function(t,e){vd.isUndefined(t)&&e%o!=0?--r:r&&vd.forEach(t,(function(t){n.node(t).rank+=r}))}))},addBorderNode:function(n,t,e,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=r),yd(n,"border",o,t)},maxRank:md,partition:function(n,t){var e={lhs:[],rhs:[]};return vd.forEach(n,(function(n){t(n)?e.lhs.push(n):e.rhs.push(n)})),e},time:function(n,t){var e=vd.now();try{return t()}finally{console.log(n+" time: "+(vd.now()-e)+"ms")}},notime:function(n,t){return t()}};function yd(n,t,e,r){var o;do{o=vd.uniqueId(r)}while(n.hasNode(o));return e.dummy=t,n.setNode(o,e),o}function md(n){return vd.max(vd.map(n.nodes(),(function(t){var e=n.node(t).rank;if(!vd.isUndefined(e))return e})))}var wd=nd,bd=gd,_d={run:function(n){n.graph().dummyChains=[],wd.forEach(n.edges(),(function(t){!function(n,t){var e,r,o,i=t.v,u=n.node(i).rank,a=t.w,c=n.node(a).rank,l=t.name,s=n.edge(t),f=s.labelRank;if(c!==u+1){for(n.removeEdge(t),o=0,++u;u<c;++o,++u)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:t,rank:u},e=bd.addDummyNode(n,"edge",r,"_d"),u===f&&(r.width=s.width,r.height=s.height,r.dummy="edge-label",r.labelpos=s.labelpos),n.setEdge(i,e,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(e),i=e;n.setEdge(i,a,{weight:s.weight},l)}}(n,t)}))},undo:function(n){wd.forEach(n.graph().dummyChains,(function(t){var e,r=n.node(t),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)e=n.successors(t)[0],n.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=e,r=n.node(t)}))}},xd=nd,Ed=function(n){var t={};xd.forEach(n.sources(),(function e(r){var o=n.node(r);if(xd.has(t,r))return o.rank;t[r]=!0;var i=xd.min(xd.map(n.outEdges(r),(function(t){return e(t.w)-n.edge(t).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},Sd=function(n,t){return n.node(t.w).rank-n.node(t.v).rank-n.edge(t).minlen},kd=nd,Cd=Uf.Graph,Nd=Sd,Md=function(n){var t,e,r=new Cd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Od(r,n)<i;)t=jd(r,n),e=r.hasNode(t.v)?Nd(n,t):-Nd(n,t),Id(r,n,e);return r};function Od(n,t){return kd.forEach(n.nodes(),(function e(r){kd.forEach(t.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||Nd(t,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),e(u))}))})),n.nodeCount()}function jd(n,t){return kd.minBy(t.edges(),(function(e){if(n.hasNode(e.v)!==n.hasNode(e.w))return Nd(t,e)}))}function Id(n,t,e){kd.forEach(n.nodes(),(function(n){t.node(n).rank+=e}))}var Pd=nd,Ad=Md,zd=Sd,Ld=Ed,Td=Uf.alg.preorder,Bd=Uf.alg.postorder,Dd=gd.simplify,Rd=Vd;function Vd(n){n=Dd(n),Ld(n);var t,e=Ad(n);for(Zd(e),Hd(e,n);t=Ud(e);)Wd(e,n,t,Fd(e,n,t))}function Hd(n,t){var e=Bd(n,n.nodes());e=e.slice(0,e.length-1),Pd.forEach(e,(function(e){!function(n,t,e){var r=n.node(e).parent;n.edge(e,r).cutvalue=Yd(n,t,e)}(n,t,e)}))}function Yd(n,t,e){var r=n.node(e).parent,o=!0,i=t.edge(e,r),u=0;return i||(o=!1,i=t.edge(r,e)),u=i.weight,Pd.forEach(t.nodeEdges(e),(function(i){var a,c,l=i.v===e,s=l?i.w:i.v;if(s!==r){var f=l===o,d=t.edge(i).weight;if(u+=f?d:-d,a=e,c=s,n.hasEdge(a,c)){var h=n.edge(e,s).cutvalue;u+=f?-h:h}}})),u}function Zd(n,t){arguments.length<2&&(t=n.nodes()[0]),Xd(n,{},1,t)}function Xd(n,t,e,r,o){var i=e,u=n.node(r);return t[r]=!0,Pd.forEach(n.neighbors(r),(function(o){Pd.has(t,o)||(e=Xd(n,t,e,o,r))})),u.low=i,u.lim=e++,o?u.parent=o:delete u.parent,e}function Ud(n){return Pd.find(n.edges(),(function(t){return n.edge(t).cutvalue<0}))}function Fd(n,t,e){var r=e.v,o=e.w;t.hasEdge(r,o)||(r=e.w,o=e.v);var i=n.node(r),u=n.node(o),a=i,c=!1;i.lim>u.lim&&(a=u,c=!0);var l=Pd.filter(t.edges(),(function(t){return c===$d(n,n.node(t.v),a)&&c!==$d(n,n.node(t.w),a)}));return Pd.minBy(l,(function(n){return zd(t,n)}))}function Wd(n,t,e,r){var o=e.v,i=e.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Zd(n),Hd(n,t),function(n,t){var e=Pd.find(n.nodes(),(function(n){return!t.node(n).parent})),r=Td(n,e);r=r.slice(1),Pd.forEach(r,(function(e){var r=n.node(e).parent,o=t.edge(e,r),i=!1;o||(o=t.edge(r,e),i=!0),t.node(e).rank=t.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,t)}function $d(n,t,e){return e.low<=t.lim&&t.lim<=e.lim}Vd.initLowLimValues=Zd,Vd.initCutValues=Hd,Vd.calcCutValue=Yd,Vd.leaveEdge=Ud,Vd.enterEdge=Fd,Vd.exchangeEdges=Wd;var Gd=Ed,qd=Md,Kd=Rd,Qd=Gd;var Jd=nd,nh=nd,th=gd,eh={run:function(n){var t=th.addDummyNode(n,"root",{},"_root"),e=function(n){var t={};function e(r,o){var i=n.children(r);i&&i.length&&nh.forEach(i,(function(n){e(n,o+1)})),t[r]=o}return nh.forEach(n.children(),(function(n){e(n,1)})),t}(n),r=nh.max(nh.values(e))-1,o=2*r+1;n.graph().nestingRoot=t,nh.forEach(n.edges(),(function(t){n.edge(t).minlen*=o}));var i=function(n){return nh.reduce(n.edges(),(function(t,e){return t+n.edge(e).weight}),0)}(n)+1;nh.forEach(n.children(),(function(u){rh(n,t,o,i,r,e,u)})),n.graph().nodeRankFactor=o},cleanup:function(n){var t=n.graph();n.removeNode(t.nestingRoot),delete t.nestingRoot,nh.forEach(n.edges(),(function(t){n.edge(t).nestingEdge&&n.removeEdge(t)}))}};function rh(n,t,e,r,o,i,u){var a=n.children(u);if(a.length){var c=th.addBorderNode(n,"_bt"),l=th.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(c,u),s.borderTop=c,n.setParent(l,u),s.borderBottom=l,nh.forEach(a,(function(a){rh(n,t,e,r,o,i,a);var s=n.node(a),f=s.borderTop?s.borderTop:a,d=s.borderBottom?s.borderBottom:a,h=s.borderTop?r:2*r,v=f!==d?1:o-i[u]+1;n.setEdge(c,f,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(d,l,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(u)||n.setEdge(t,c,{weight:0,minlen:o+i[u]})}else u!==t&&n.setEdge(t,u,{weight:0,minlen:e})}var oh=nd,ih=gd;function uh(n,t,e,r,o,i){var u={width:0,height:0,rank:i,borderType:t},a=o[t][i-1],c=ih.addDummyNode(n,"border",u,e);o[t][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var ah=nd,ch={adjust:function(n){var t=n.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||lh(n)},undo:function(n){var t=n.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(n){ah.forEach(n.nodes(),(function(t){fh(n.node(t))})),ah.forEach(n.edges(),(function(t){var e=n.edge(t);ah.forEach(e.points,fh),ah.has(e,"y")&&fh(e)}))}(n),"lr"!==t&&"rl"!==t||(function(n){ah.forEach(n.nodes(),(function(t){dh(n.node(t))})),ah.forEach(n.edges(),(function(t){var e=n.edge(t);ah.forEach(e.points,dh),ah.has(e,"x")&&dh(e)}))}(n),lh(n))}};function lh(n){ah.forEach(n.nodes(),(function(t){sh(n.node(t))})),ah.forEach(n.edges(),(function(t){sh(n.edge(t))}))}function sh(n){var t=n.width;n.width=n.height,n.height=t}function fh(n){n.y=-n.y}function dh(n){var t=n.x;n.x=n.y,n.y=t}var hh=nd,vh=nd;function ph(n,t,e){for(var r=vh.zipObject(e,vh.map(e,(function(n,t){return t}))),o=vh.flatten(vh.map(t,(function(t){return vh.sortBy(vh.map(n.outEdges(t),(function(t){return{pos:r[t.w],weight:n.edge(t).weight}})),"pos")})),!0),i=1;i<e.length;)i<<=1;var u=2*i-1;i-=1;var a=vh.map(new Array(u),(function(){return 0})),c=0;return vh.forEach(o.forEach((function(n){var t=n.pos+i;a[t]+=n.weight;for(var e=0;t>0;)t%2&&(e+=a[t+1]),a[t=t-1>>1]+=n.weight;c+=n.weight*e}))),c}var gh=nd,yh=nd,mh=nd,wh=gd;function bh(n,t,e){for(var r;t.length&&(r=mh.last(t)).i<=e;)t.pop(),n.push(r.vs),e++;return e}var _h=nd,xh=nd,Eh=Uf.Graph,Sh=nd,kh=nd,Ch=function(n){var t={},e=hh.filter(n.nodes(),(function(t){return!n.children(t).length})),r=hh.max(hh.map(e,(function(t){return n.node(t).rank}))),o=hh.map(hh.range(r+1),(function(){return[]}));var i=hh.sortBy(e,(function(t){return n.node(t).rank}));return hh.forEach(i,(function e(r){if(!hh.has(t,r)){t[r]=!0;var i=n.node(r);o[i.rank].push(r),hh.forEach(n.successors(r),e)}})),o},Nh=function(n,t){for(var e=0,r=1;r<t.length;++r)e+=ph(n,t[r-1],t[r]);return e},Mh=function n(t,e,r,o){var i=t.children(e),u=t.node(e),a=u?u.borderLeft:void 0,c=u?u.borderRight:void 0,l={};a&&(i=_h.filter(i,(function(n){return n!==a&&n!==c})));var s=function(n,t){return gh.map(t,(function(t){var e=n.inEdges(t);if(e.length){var r=gh.reduce(e,(function(t,e){var r=n.edge(e),o=n.node(e.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}}))}(t,i);_h.forEach(s,(function(e){if(t.children(e.v).length){var i=n(t,e.v,r,o);l[e.v]=i,_h.has(i,"barycenter")&&(u=e,a=i,_h.isUndefined(u.barycenter)?(u.barycenter=a.barycenter,u.weight=a.weight):(u.barycenter=(u.barycenter*u.weight+a.barycenter*a.weight)/(u.weight+a.weight),u.weight+=a.weight))}var u,a}));var f=function(n,t){var e={};return yh.forEach(n,(function(n,t){var r=e[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:t};yh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),yh.forEach(t.edges(),(function(n){var t=e[n.v],r=e[n.w];yh.isUndefined(t)||yh.isUndefined(r)||(r.indegree++,t.out.push(e[n.w]))})),function(n){var t=[];function e(n){return function(t){t.merged||(yh.isUndefined(t.barycenter)||yh.isUndefined(n.barycenter)||t.barycenter>=n.barycenter)&&function(n,t){var e=0,r=0;n.weight&&(e+=n.barycenter*n.weight,r+=n.weight),t.weight&&(e+=t.barycenter*t.weight,r+=t.weight),n.vs=t.vs.concat(n.vs),n.barycenter=e/r,n.weight=r,n.i=Math.min(t.i,n.i),t.merged=!0}(n,t)}}function r(t){return function(e){e.in.push(t),0==--e.indegree&&n.push(e)}}for(;n.length;){var o=n.pop();t.push(o),yh.forEach(o.in.reverse(),e(o)),yh.forEach(o.out,r(o))}return yh.map(yh.filter(t,(function(n){return!n.merged})),(function(n){return yh.pick(n,["vs","i","barycenter","weight"])}))}(yh.filter(e,(function(n){return!n.indegree})))}(s,r);!function(n,t){_h.forEach(n,(function(n){n.vs=_h.flatten(n.vs.map((function(n){return t[n]?t[n].vs:n})),!0)}))}(f,l);var d=function(n,t){var e,r=wh.partition(n,(function(n){return mh.has(n,"barycenter")})),o=r.lhs,i=mh.sortBy(r.rhs,(function(n){return-n.i})),u=[],a=0,c=0,l=0;o.sort((e=!!t,function(n,t){return n.barycenter<t.barycenter?-1:n.barycenter>t.barycenter?1:e?t.i-n.i:n.i-t.i})),l=bh(u,i,l),mh.forEach(o,(function(n){l+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,c+=n.weight,l=bh(u,i,l)}));var s={vs:mh.flatten(u,!0)};return c&&(s.barycenter=a/c,s.weight=c),s}(f,o);if(a&&(d.vs=_h.flatten([a,d.vs,c],!0),t.predecessors(a).length)){var h=t.node(t.predecessors(a)[0]),v=t.node(t.predecessors(c)[0]);_h.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+v.order)/(d.weight+2),d.weight+=2}return d},Oh=function(n,t,e){var r=function(n){for(var t;n.hasNode(t=xh.uniqueId("_root")););return t}(n),o=new Eh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(t){return n.node(t)}));return xh.forEach(n.nodes(),(function(i){var u=n.node(i),a=n.parent(i);(u.rank===t||u.minRank<=t&&t<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||r),xh.forEach(n[e](i),(function(t){var e=t.v===i?t.w:t.v,r=o.edge(e,i),u=xh.isUndefined(r)?0:r.weight;o.setEdge(e,i,{weight:n.edge(t).weight+u})})),xh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[t],borderRight:u.borderRight[t]}))})),o},jh=Uf.Graph,Ih=gd;function Ph(n,t,e){return kh.map(t,(function(t){return Oh(n,t,e)}))}function Ah(n,t){var e=new jh;kh.forEach(n,(function(n){var r=n.graph().root,o=Mh(n,r,e,t);kh.forEach(o.vs,(function(t,e){n.node(t).order=e})),function(n,t,e){var r,o={};Sh.forEach(e,(function(e){for(var i,u,a=n.parent(e);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=r,r=a),u&&u!==a)return void t.setEdge(u,a);a=i}}))}(n,e,o.vs)}))}function zh(n,t){kh.forEach(t,(function(t){kh.forEach(t,(function(t,e){n.node(t).order=e}))}))}var Lh=nd,Th=Uf.Graph,Bh=gd;function Dh(n,t,e){if(t>e){var r=t;t=e,e=r}var o=n[t];o||(n[t]=o={}),o[e]=!0}function Rh(n,t,e){if(t>e){var r=t;t=e,e=r}return Lh.has(n[t],e)}var Vh=nd,Hh=gd,Yh=function(n){var t,e=Bh.buildLayerMatrix(n),r=Lh.merge(function(n,t){var e={};return Lh.reduce(t,(function(t,r){var o=0,i=0,u=t.length,a=Lh.last(r);return Lh.forEach(r,(function(t,c){var l=function(n,t){if(n.node(t).dummy)return Lh.find(n.predecessors(t),(function(t){return n.node(t).dummy}))}(n,t),s=l?n.node(l).order:u;(l||t===a)&&(Lh.forEach(r.slice(i,c+1),(function(t){Lh.forEach(n.predecessors(t),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(t).dummy||Dh(e,r,t)}))})),i=c+1,o=s)})),r})),e}(n,e),function(n,t){var e={};function r(t,r,o,i,u){var a;Lh.forEach(Lh.range(r,o),(function(r){a=t[r],n.node(a).dummy&&Lh.forEach(n.predecessors(a),(function(t){var r=n.node(t);r.dummy&&(r.order<i||r.order>u)&&Dh(e,t,a)}))}))}return Lh.reduce(t,(function(t,e){var o,i=-1,u=0;return Lh.forEach(e,(function(a,c){if("border"===n.node(a).dummy){var l=n.predecessors(a);l.length&&(o=n.node(l[0]).order,r(e,u,c,i,o),u=c,i=o)}r(e,u,e.length,o,t.length)})),e})),e}(n,e)),o={};Lh.forEach(["u","d"],(function(i){t="u"===i?e:Lh.values(e).reverse(),Lh.forEach(["l","r"],(function(e){"r"===e&&(t=Lh.map(t,(function(n){return Lh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,t,e,r){var o={},i={},u={};return Lh.forEach(t,(function(n){Lh.forEach(n,(function(n,t){o[n]=n,i[n]=n,u[n]=t}))})),Lh.forEach(t,(function(n){var t=-1;Lh.forEach(n,(function(n){var a=r(n);if(a.length){a=Lh.sortBy(a,(function(n){return u[n]}));for(var c=(a.length-1)/2,l=Math.floor(c),s=Math.ceil(c);l<=s;++l){var f=a[l];i[n]===n&&t<u[f]&&!Rh(e,n,f)&&(i[f]=n,i[n]=o[n]=o[f],t=u[f])}}}))})),{root:o,align:i}}(0,t,r,u),c=function(n,t,e,r,o){var i={},u=function(n,t,e,r){var o=new Th,i=n.graph(),u=function(n,t,e){return function(r,o,i){var u,a=r.node(o),c=r.node(i),l=0;if(l+=a.width/2,Lh.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(l+=e?u:-u),u=0,l+=(a.dummy?t:n)/2,l+=(c.dummy?t:n)/2,l+=c.width/2,Lh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(l+=e?u:-u),u=0,l}}(i.nodesep,i.edgesep,r);return Lh.forEach(t,(function(t){var r;Lh.forEach(t,(function(t){var i=e[t];if(o.setNode(i),r){var a=e[r],c=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,t,r),c||0))}r=t}))})),o}(n,t,e,o),a=o?"borderLeft":"borderRight";function c(n,t){for(var e=u.nodes(),r=e.pop(),o={};r;)o[r]?n(r):(o[r]=!0,e.push(r),e=e.concat(t(r))),r=e.pop()}return c((function(n){i[n]=u.inEdges(n).reduce((function(n,t){return Math.max(n,i[t.v]+u.edge(t))}),0)}),u.predecessors.bind(u)),c((function(t){var e=u.outEdges(t).reduce((function(n,t){return Math.min(n,i[t.w]-u.edge(t))}),Number.POSITIVE_INFINITY),r=n.node(t);e!==Number.POSITIVE_INFINITY&&r.borderType!==a&&(i[t]=Math.max(i[t],e))}),u.successors.bind(u)),Lh.forEach(r,(function(n){i[n]=i[e[n]]})),i}(n,t,a.root,a.align,"r"===e);"r"===e&&(c=Lh.mapValues(c,(function(n){return-n}))),o[i+e]=c}))}));var i=function(n,t){return Lh.minBy(Lh.values(t),(function(t){var e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Lh.forIn(t,(function(t,o){var i=function(n,t){return n.node(t).width}(n,o)/2;e=Math.max(t+i,e),r=Math.min(t-i,r)})),e-r}))}(n,o);return function(n,t){var e=Lh.values(t),r=Lh.min(e),o=Lh.max(e);Lh.forEach(["u","d"],(function(e){Lh.forEach(["l","r"],(function(i){var u,a=e+i,c=n[a];if(c!==t){var l=Lh.values(c);(u="l"===i?r-Lh.min(l):o-Lh.max(l))&&(n[a]=Lh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,t){return Lh.mapValues(n.ul,(function(e,r){if(t)return n[t.toLowerCase()][r];var o=Lh.sortBy(Lh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Zh=nd,Xh=hd,Uh=_d,Fh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Kd(n)}(n);break;case"tight-tree":!function(n){Gd(n),qd(n)}(n);break;case"longest-path":Qd(n)}},Wh=gd.normalizeRanks,$h=function(n){var t=function(n){var t={},e=0;return Jd.forEach(n.children(),(function r(o){var i=e;Jd.forEach(n.children(o),r),t[o]={low:i,lim:e++}})),t}(n);Jd.forEach(n.graph().dummyChains,(function(e){for(var r=n.node(e),o=r.edgeObj,i=function(n,t,e,r){var o,i,u=[],a=[],c=Math.min(t[e].low,t[r].low),l=Math.max(t[e].lim,t[r].lim);o=e;do{o=n.parent(o),u.push(o)}while(o&&(t[o].low>c||l>t[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,t,o.v,o.w),u=i.path,a=i.lca,c=0,l=u[c],s=!0;e!==o.w;){if(r=n.node(e),s){for(;(l=u[c])!==a&&n.node(l).maxRank<r.rank;)c++;l===a&&(s=!1)}if(!s){for(;c<u.length-1&&n.node(l=u[c+1]).minRank<=r.rank;)c++;l=u[c]}n.setParent(e,l),e=n.successors(e)[0]}}))},Gh=gd.removeEmptyRanks,qh=eh,Kh=function(n){oh.forEach(n.children(),(function t(e){var r=n.children(e),o=n.node(e);if(r.length&&oh.forEach(r,t),oh.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)uh(n,"borderLeft","_bl",e,o,i),uh(n,"borderRight","_br",e,o,i)}}))},Qh=ch,Jh=function(n){var t=Ih.maxRank(n),e=Ph(n,kh.range(1,t+1),"inEdges"),r=Ph(n,kh.range(t-1,-1,-1),"outEdges"),o=Ch(n);zh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Ah(a%2?e:r,a%4>=2),o=Ih.buildLayerMatrix(n);var l=Nh(n,o);l<u&&(c=0,i=kh.cloneDeep(o),u=l)}zh(n,i)},nv=function(n){(function(n){var t=Hh.buildLayerMatrix(n),e=n.graph().ranksep,r=0;Vh.forEach(t,(function(t){var o=Vh.max(Vh.map(t,(function(t){return n.node(t).height})));Vh.forEach(t,(function(t){n.node(t).y=r+o/2})),r+=o+e}))})(n=Hh.asNonCompoundGraph(n)),Vh.forEach(Yh(n),(function(t,e){n.node(e).x=t}))},tv=gd,ev=Uf.Graph,rv=["nodesep","edgesep","ranksep","marginx","marginy"],ov={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},iv=["acyclicer","ranker","rankdir","align"],uv=["width","height"],av={width:0,height:0},cv=["minlen","weight","width","height","labeloffset"],lv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sv=["labelpos"];function fv(n,t){return Zh.mapValues(Zh.pick(n,t),Number)}function dv(n){var t={};return Zh.forEach(n,(function(n,e){t[e.toLowerCase()]=n})),t}var hv=nd,vv=gd,pv=Uf.Graph,gv={debugOrdering:function(n){var t=vv.buildLayerMatrix(n),e=new pv({compound:!0,multigraph:!0}).setGraph({});return hv.forEach(n.nodes(),(function(t){e.setNode(t,{label:t}),e.setParent(t,"layer"+n.node(t).rank)})),hv.forEach(n.edges(),(function(n){e.setEdge(n.v,n.w,{},n.name)})),hv.forEach(t,(function(n,t){var r="layer"+t;e.setNode(r,{rank:"same"}),hv.reduce(n,(function(n,t){return e.setEdge(n,t,{style:"invis"}),t}))})),e}},yv=Kt({graphlib:Uf,layout:function(n,t){var e=t&&t.debugTiming?tv.time:tv.notime;e("layout",(function(){var t=e(" buildLayoutGraph",(function(){return function(n){var t=new ev({multigraph:!0,compound:!0}),e=dv(n.graph());return t.setGraph(Zh.merge({},ov,fv(e,rv),Zh.pick(e,iv))),Zh.forEach(n.nodes(),(function(e){var r=dv(n.node(e));t.setNode(e,Zh.defaults(fv(r,uv),av)),t.setParent(e,n.parent(e))})),Zh.forEach(n.edges(),(function(e){var r=dv(n.edge(e));t.setEdge(e,Zh.merge({},lv,fv(r,cv),Zh.pick(r,sv)))})),t}(n)}));e(" runLayout",(function(){!function(n,t){t(" makeSpaceForEdgeLabels",(function(){!function(n){var t=n.graph();t.ranksep/=2,Zh.forEach(n.edges(),(function(e){var r=n.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),t(" removeSelfEdges",(function(){!function(n){Zh.forEach(n.edges(),(function(t){if(t.v===t.w){var e=n.node(t.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:t,label:n.edge(t)}),n.removeEdge(t)}}))}(n)})),t(" acyclic",(function(){Xh.run(n)})),t(" nestingGraph.run",(function(){qh.run(n)})),t(" rank",(function(){Fh(tv.asNonCompoundGraph(n))})),t(" injectEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);if(e.width&&e.height){var r=n.node(t.v),o={rank:(n.node(t.w).rank-r.rank)/2+r.rank,e:t};tv.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),t(" removeEmptyRanks",(function(){Gh(n)})),t(" nestingGraph.cleanup",(function(){qh.cleanup(n)})),t(" normalizeRanks",(function(){Wh(n)})),t(" assignRankMinMax",(function(){!function(n){var t=0;Zh.forEach(n.nodes(),(function(e){var r=n.node(e);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,t=Zh.max(t,r.maxRank))})),n.graph().maxRank=t}(n)})),t(" removeEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){var e=n.node(t);"edge-proxy"===e.dummy&&(n.edge(e.e).labelRank=e.rank,n.removeNode(t))}))}(n)})),t(" normalize.run",(function(){Uh.run(n)})),t(" parentDummyChains",(function(){$h(n)})),t(" addBorderSegments",(function(){Kh(n)})),t(" order",(function(){Jh(n)})),t(" insertSelfEdges",(function(){!function(n){var t=tv.buildLayerMatrix(n);Zh.forEach(t,(function(t){var e=0;Zh.forEach(t,(function(t,r){var o=n.node(t);o.order=r+e,Zh.forEach(o.selfEdges,(function(t){tv.addDummyNode(n,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:r+ ++e,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(n)})),t(" adjustCoordinateSystem",(function(){Qh.adjust(n)})),t(" position",(function(){nv(n)})),t(" positionSelfEdges",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){var e=n.node(t);if("selfedge"===e.dummy){var r=n.node(e.e.v),o=r.x+r.width/2,i=r.y,u=e.x-o,a=r.height/2;n.setEdge(e.e,e.label),n.removeNode(t),e.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],e.label.x=e.x,e.label.y=e.y}}))}(n)})),t(" removeBorderNodes",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){if(n.children(t).length){var e=n.node(t),r=n.node(e.borderTop),o=n.node(e.borderBottom),i=n.node(Zh.last(e.borderLeft)),u=n.node(Zh.last(e.borderRight));e.width=Math.abs(u.x-i.x),e.height=Math.abs(o.y-r.y),e.x=i.x+e.width/2,e.y=r.y+e.height/2}})),Zh.forEach(n.nodes(),(function(t){"border"===n.node(t).dummy&&n.removeNode(t)}))}(n)})),t(" normalize.undo",(function(){Uh.undo(n)})),t(" fixupEdgeLabelCoords",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);if(Zh.has(e,"x"))switch("l"!==e.labelpos&&"r"!==e.labelpos||(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset}}))}(n)})),t(" undoCoordinateSystem",(function(){Qh.undo(n)})),t(" translateGraph",(function(){!function(n){var t=Number.POSITIVE_INFINITY,e=0,r=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function c(n){var i=n.x,u=n.y,a=n.width,c=n.height;t=Math.min(t,i-a/2),e=Math.max(e,i+a/2),r=Math.min(r,u-c/2),o=Math.max(o,u+c/2)}Zh.forEach(n.nodes(),(function(t){c(n.node(t))})),Zh.forEach(n.edges(),(function(t){var e=n.edge(t);Zh.has(e,"x")&&c(e)})),t-=u,r-=a,Zh.forEach(n.nodes(),(function(e){var o=n.node(e);o.x-=t,o.y-=r})),Zh.forEach(n.edges(),(function(e){var o=n.edge(e);Zh.forEach(o.points,(function(n){n.x-=t,n.y-=r})),Zh.has(o,"x")&&(o.x-=t),Zh.has(o,"y")&&(o.y-=r)})),i.width=e-t+u,i.height=o-r+a}(n)})),t(" assignNodeIntersects",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e,r,o=n.edge(t),i=n.node(t.v),u=n.node(t.w);o.points?(e=o.points[0],r=o.points[o.points.length-1]):(o.points=[],e=u,r=i),o.points.unshift(tv.intersectRect(i,e)),o.points.push(tv.intersectRect(u,r))}))}(n)})),t(" reversePoints",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);e.reversed&&e.points.reverse()}))}(n)})),t(" acyclic.undo",(function(){Xh.undo(n)}))}(t,e)})),e(" updateInputGraph",(function(){!function(n,t){Zh.forEach(n.nodes(),(function(e){var r=n.node(e),o=t.node(e);r&&(r.x=o.x,r.y=o.y,t.children(e).length&&(r.width=o.width,r.height=o.height))})),Zh.forEach(n.edges(),(function(e){var r=n.edge(e),o=t.edge(e);r.points=o.points,Zh.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=t.graph().width,n.graph().height=t.graph().height}(n,t)}))}))},debug:gv,util:{time:gd.time,notime:gd.notime},version:"0.8.5"}),mv=function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},wv=function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},bv=function(){return"The Ink Flow parent container needs a width and a height to render the graph."},_v=function(){return"Only child nodes can use a parent extent."},xv=function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},Ev=function(n,t){var e=t.id,r=t.sourceHandle,o=t.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(e,".")},Sv=function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},kv=function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},Cv=function(n){return'Node with id "'.concat(n,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},Nv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mv=["Enter"," ","Escape"],Ov=.5,jv=2,Iv=[0,0],Pv=function(n,t,e){if(!n.id)return[];var r=new Set;return e.forEach((function(t){t.source===n.id&&r.add(t.target)})),t.filter((function(n){return r.has(n.id)}))},Av=function(n,t,e){if(!n.id)return[];var r=new Set;return e.forEach((function(t){t.target===n.id&&r.add(t.source)})),t.filter((function(n){return r.has(n.id)}))},zv=function(n,t){void 0===t&&(t=[0,0]);var e=Kv(n),r=e.width,o=e.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||t,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},Lv=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var e=n.reduce((function(n,e){var r=Xv(e,t.nodeOrigin);return Yv(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zv(e)},Tv=function(n,t){var e=new Set;return n.forEach((function(n){e.add(n.id)})),t.filter((function(n){return e.has(n.source)||e.has(n.target)}))};function Bv(n){var t=n.nodeId,e=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(t),l=c.parentId?r.get(c.parentId):void 0,s=l?zv(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,t){var e,r,o,i;return t&&"parent"!==t?[t[0],[t[1][0]-(null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:0),t[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:t}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&qv(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,w=f+v*m[0],b=d+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==a||a("005",_v());var _=qv(h)?Rv(e,h):e;return{position:{x:_.x-f,y:_.y-d},positionAbsolute:_}}var Dv=function(n,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),Math.min(Math.max(n,t),e)},Rv=function(n,t){return void 0===n&&(n={x:0,y:0}),{x:Dv(n.x,t[0][0],t[1][0]),y:Dv(n.y,t[0][1],t[1][1])}},Vv=function(n,t,e){return n<t?Dv(Math.abs(n-t),1,50)/50:n>e?-Dv(Math.abs(n-e),1,50)/50:0},Hv=function(n,t){return[20*Vv(n.x,35,t.width-35),20*Vv(n.y,35,t.height-35)]},Yv=function(n,t){return{x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x2,t.x2),y2:Math.max(n.y2,t.y2)}},Zv=function(n){var t=n.x,e=n.y;return{x:t,y:e,width:n.x2-t,height:n.y2-e}},Xv=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=zv(n,t).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}},Uv=function(n,t){return void 0===t&&(t=[1,1]),{x:t[0]*Math.round(n.x/t[0]),y:t[1]*Math.round(n.y/t[1])}},Fv=function(n,t,e,r){var o=n.x,i=n.y,u=W(t,3),a=u[0],c=u[1],l=u[2];void 0===e&&(e=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return e?Uv(s,r):s},Wv=function(n,t){var e=n.x,r=n.y,o=W(t,3),i=o[0],u=o[1],a=o[2];return{x:e*a+i,y:r*a+u}},$v=function(n,t,e,r,o,i){var u=t/(n.width*(1+i)),a=e/(n.height*(1+i)),c=Math.min(u,a),l=Dv(c,r,o);return{x:t/2-(n.x+n.width/2)*l,y:e/2-(n.y+n.height/2)*l,zoom:l}},Gv=function(){var n;return"undefined"!=typeof navigator&&(null===(n=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===n?void 0:n.indexOf("Mac"))>=0};function qv(n){return void 0!==n&&"parent"!==n}function Kv(n){var t,e,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var Qv={x:0,y:0};function Jv(n,t){var e=t.snapGrid,r=void 0===e?[0,0]:e,o=t.snapToGrid,i=void 0!==o&&o,u=t.transform,a=up(n),c=a.x,l=a.y,s=Fv({x:c,y:l},u),f=i?Uv(s,r):s,d=f.x,h=f.y;return U({xSnapped:d,ySnapped:h},s)}var np,tp,ep,rp,op,ip,up=function(n,t){var e,r,o,i,u=function(n){return"clientX"in n}(n),a=u?n.clientX:null===(e=n.touches)||void 0===e?void 0:e[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==t?void 0:t.left)&&void 0!==o?o:0),y:c-(null!==(i=null==t?void 0:t.top)&&void 0!==i?i:0)}};function ap(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*t+.375*i+.375*n.targetControlX+.125*r,c=.125*e+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-t),Math.abs(c-e)]}function cp(n,t){return n>=0?.5*n:25*t*Math.sqrt(-n)}function lp(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(t){case ip.Left:return[e-cp(e-o,u),r];case ip.Right:return[e+cp(o-e,u),r];case ip.Top:return[e,r-cp(r-i,u)];case ip.Bottom:return[e,r+cp(i-r,u)]}}function sp(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.curvature,s=void 0===l?.25:l,f=W(lp({pos:o,x1:t,y1:e,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=W(lp({pos:c,x1:i,y1:u,x2:t,y2:e,c:s}),2),p=v[0],g=v[1],y=W(ap({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],b=y[2],_=y[3];return["M".concat(t,",").concat(e," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),m,w,b,_]}function fp(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-t)/2,u=r<t?r+i:r-i,a=Math.abs(o-e)/2;return[u,o<e?o+a:o-a,i,a]}!function(n){n.Strict="strict",n.Loose="loose"}(np||(np={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(tp||(tp={})),function(n){n.Partial="partial",n.Full="full"}(ep||(ep={})),function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(rp||(rp={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(op||(op={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(ip||(ip={}));var dp,hp=function(n){var t=n.source,e=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(t).concat(e||"","-").concat(r).concat(o||"")},vp=function(n,t){return n.source&&n.target?function(n,t){return t.some((function(t){return!(t.source!==n.source||t.target!==n.target||t.sourceHandle!==n.sourceHandle&&(t.sourceHandle||n.sourceHandle)||t.targetHandle!==n.targetHandle&&(t.targetHandle||n.targetHandle))}))}(e=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?U({},n):U(U({},n),{id:hp(n)}),t)?t:(null===e.sourceHandle&&delete e.sourceHandle,null===e.targetHandle&&delete e.targetHandle,t.concat(e)):t;var e},pp=function(n,t,e,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(e[r[o]]=n[r[o]])}return e}(n,["id"]);if(!t.source||!t.target)return e;if(!e.find((function(t){return t.id===n.id})))return e;var u=U(U({},i),{id:r.shouldReplaceId?hp(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle});return e.filter((function(n){return n.id!==o})).concat(u)};function gp(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=W(fp({sourceX:t,sourceY:e,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(t,",").concat(e,"L ").concat(r,",").concat(o),u,a,c,l]}var yp=((dp={})[ip.Left]={x:-1,y:0},dp[ip.Right]={x:1,y:0},dp[ip.Top]={x:0,y:-1},dp[ip.Bottom]={x:0,y:1},dp),mp=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};function wp(n){var t,e,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?ip.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?ip.Top:l,f=n.center,d=n.offset,h=yp[a],v=yp[s],p={x:i.x+h.x*d,y:i.y+h.y*d},g={x:c.x+v.x*d,y:c.y+v.y*d},y=function(n){var t=n.source,e=n.sourcePosition,r=void 0===e?ip.Bottom:e,o=n.target;return r===ip.Left||r===ip.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),m=0!==y.x?"x":"y",w=y[m],b=[],_={x:0,y:0},x={x:0,y:0},E=W(fp({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],C=E[2],N=E[3];if(h[m]*v[m]==-1){r=null!==(t=f.x)&&void 0!==t?t:S,o=null!==(e=f.y)&&void 0!==e?e:k;var M=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];b=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var j=[{x:p.x,y:g.y}],I=[{x:g.x,y:p.y}];if(b="x"===m?h.x===w?I:j:h.y===w?j:I,a===s){var P=Math.abs(i[m]-c[m]);if(P<=d){var A=Math.min(d-1,d-P);h[m]===w?_[m]=(p[m]>i[m]?-1:1)*A:x[m]=(g[m]>c[m]?-1:1)*A}}if(a!==s){var z="x"===m?"y":"x",L=h[m]===v[z],T=p[z]>g[z],B=p[z]<g[z];(1===h[m]&&(!L&&T||L&&B)||1!==h[m]&&(!L&&B||L&&T))&&(b="x"===m?j:I)}var D={x:p.x+_.x,y:p.y+_.y},R={x:g.x+x.x,y:g.y+x.y};Math.max(Math.abs(D.x-b[0].x),Math.abs(R.x-b[0].x))>=Math.max(Math.abs(D.y-b[0].y),Math.abs(R.y-b[0].y))?(r=(D.x+R.x)/2,o=b[0].y):(r=b[0].x,o=(D.y+R.y)/2)}return[$($([i,{x:p.x+_.x,y:p.y+_.y}],W(b),!1),[{x:g.x+x.x,y:g.y+x.y},c],!1),r,o,C,N]}function bp(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=W(wp({source:{x:t,y:e},sourcePosition:o,target:{x:i,y:u},targetPosition:c,center:{x:f,y:d},offset:void 0===h?20:h}),5),p=v[0],g=v[1],y=v[2],m=v[3],w=v[4];return[p.reduce((function(n,t,e){return n+(e>0&&e<p.length-1?function(n,t,e,r){var o=Math.min(mp(n,t)/2,mp(t,e)/2,r),i=t.x,u=t.y;if(n.x===i&&i===e.x||n.y===u&&u===e.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<e.x?-1:1,c=n.y<e.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<e.x?1:-1,s=n.y<e.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[e-1],t,p[e+1],s):"".concat(0===e?"M":"L").concat(t.x," ").concat(t.y))}),""),g,y,m,w]}function _p(n,t,e){var r=(null==e?void 0:e.rankdir)||"TB",o=new yv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(U({rankdir:r},e));var i=n.map((function(n){return U({},n)}));i.forEach((function(n){var t,e;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(t=n.data)||void 0===t?void 0:t.width)||200,i=(null===(e=n.data)||void 0===e?void 0:e.height)||56;o.setNode(n.id,{width:r,height:i})})),t.forEach((function(n){o.setEdge(n.source,n.target)})),yv.layout(o),i.forEach((function(n){var t=o.node(n.id),e="bottom",i="top";switch(r){case"TB":default:e="bottom",i="top";break;case"BT":e="top",i="bottom";break;case"LR":e="right",i="left";break;case"RL":e="left",i="right"}n.targetPosition=i,n.sourcePosition=e,n.position={x:t.x-t.width/2,y:t.y-t.height/2}}));var u=function(n){var t=n.centerNodeId,e=n.containerHeight,r=void 0===e?0:e,o=n.containerWidth,i=void 0===o?0:o,u=n.centerByBBox,a=n.nodes,c=n.nodeOrigin,l=void 0===c?Iv:c;if(!t&&!u||!r||!i)return Qv;if(null==t?void 0:t.trim()){var s=null==a?void 0:a.find((function(n){return n.id===(null==t?void 0:t.trim())}));if(s){var f=function(n,t){if(!n)return Qv;var e=Kv(n),r=e.width,o=e.height,i=r*t[0],u=o*t[1];return{x:n.position.x+r/2-i,y:n.position.y+o/2-u}}(s,l);return{x:i/2-f.x,y:r/2-f.y}}}return u?(f=function(n,t){if(!(null==n?void 0:n.length))return Qv;var e=Lv(n,{nodeOrigin:t}),r=e.x,o=e.y;return{x:r+e.width/2,y:o+e.height/2}}(a,l),{x:i/2-f.x,y:r/2-f.y}):Qv}({centerByBBox:null==e?void 0:e.centerByBBox,centerNodeId:null==e?void 0:e.centerNodeId,nodes:i,containerWidth:null==e?void 0:e.width,containerHeight:null==e?void 0:e.height,nodeOrigin:null==e?void 0:e.nodeOrigin}),a=u.x,c=void 0===a?0:a,l=u.y,s=void 0===l?0:l;i.forEach((function(n){n.position={x:n.position.x+c,y:n.position.y+s}}));var f={overflowBoundary:!1,transform:{x:0,y:0,zoom:1}};return(null==e?void 0:e.width)&&(null==e?void 0:e.height)&&e.fitViewOptions&&(f=function(n,t){var e=t||{},r=e.minZoom,o=void 0===r?Ov:r,i=e.maxZoom,u=void 0===i?jv:i,a=e.padding,c=void 0===a?.1:a,l=e.nodeOrigin,s=void 0===l?Iv:l,f=e.width,d=e.height,h=Lv(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:$v(h,f,d,o,u,c),overflowBoundary:v}}(i,U({width:e.width,height:e.height,nodeOrigin:e.nodeOrigin},e.fitViewOptions))),{nodes:i,edges:t,transform:f.transform,overflowBoundary:f.overflowBoundary}}var xp={assign:Object.assign,getHeight:function(n,t,e,r){return void 0===r&&(r="height"),"center"===e?(n[r]+t[r])/2:n.height}},Ep=xp,Sp={getId:function(n){return n.id||n.name},getPreH:function(n){return n.preH||0},getPreV:function(n){return n.preV||0},getHGap:function(n){return n.hgap||18},getVGap:function(n){return n.vgap||18},getChildren:function(n){return n.children},getHeight:function(n){return n.height||36},getWidth:function(n){var t=n.label||" ";return n.width||18*t.split("").length}};function kp(n,t){var e=this;if(e.vgap=e.hgap=0,n instanceof kp)return n;e.data=n;var r=t.getHGap(n),o=t.getVGap(n);return e.preH=t.getPreH(n),e.preV=t.getPreV(n),e.width=t.getWidth(n),e.height=t.getHeight(n),e.width+=e.preH,e.height+=e.preV,e.id=t.getId(n),e.x=e.y=0,e.depth=0,e.children||(e.children=[]),e.addGap(r,o),e}Ep.assign(kp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,t){var e=this;e.hgap+=n,e.vgap+=t,e.width+=2*n,e.height+=2*t},eachNode:function(n){for(var t,e=[this];t=e.shift();)n(t),e=t.children.concat(e)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var t,e=[this];t=e.shift();)n(t),e=e.concat(t.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(t){n.left=Math.min(n.left,t.x),n.top=Math.min(n.top,t.y),n.width=Math.max(n.width,t.x+t.width),n.height=Math.max(n.height,t.y+t.height)})),n},translate:function(n,t){void 0===n&&(n=0),void 0===t&&(t=0),this.eachNode((function(e){e.x+=n,e.y+=t,e.x+=e.preH,e.y+=e.preV}))},right2left:function(){var n=this,t=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-t.left)-n.width})),n.translate(t.width,0)},bottom2top:function(){var n=this,t=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-t.top)-n.height})),n.translate(0,t.height)}});var Cp=function(n,t,e){void 0===t&&(t={});var r,o=new kp(n,t=Ep.assign({},Sp,t)),i=[o];if(!e&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var u=t.getChildren(r.data),a=u?u.length:0;if(r.children=new Array(a),u&&a)for(var c=0;c<a;c++){var l=new kp(u[c],t);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Np=Cp,Mp=function(){function n(n,t){void 0===t&&(t={}),this.options=t,this.rootNode=Np(n,t)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),Op=Mp;function jp(n,t,e,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=t||0,o.y=e||0,o.x=0,o.c=r||[],o.cs=r.length,o.prelim=0,o.mod=0,o.shift=0,o.change=0,o.tl=null,o.tr=null,o.el=null,o.er=null,o.msel=0,o.mser=0}function Ip(n,t,e){e?n.y+=t:n.x+=t,n.children.forEach((function(n){Ip(n,t,e)}))}function Pp(n,t){var e=t?n.y:n.x;return n.children.forEach((function(n){e=Math.min(Pp(n,t),e)})),e}function Ap(n,t){Ip(n,-Pp(n,t),t)}function zp(n,t,e){e?t.y=n.x:t.x=n.x,n.c.forEach((function(n,r){zp(n,t.children[r],e)}))}function Lp(n,t,e){void 0===e&&(e=0),t?(n.x=e,e+=n.width):(n.y=e,e+=n.height),n.children.forEach((function(n){Lp(n,t,e)}))}jp.fromNode=function(n,t){if(!n)return null;var e=[];return n.children.forEach((function(n){e.push(jp.fromNode(n,t))})),t?new jp(n.height,n.width,n.x,e):new jp(n.width,n.height,n.y,e)};var Tp=Cp,Bp=function(n,t){for(var e=Tp(n.data,t,!0),r=Tp(n.data,t,!0),o=n.children.length,i=Math.round(o/2),u=t.getSide||function(n,t){return t<i?"right":"left"},a=0;a<o;a++){var c=n.children[a];"right"===u(c,a)?r.children.push(c):e.children.push(c)}return e.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:e,right:r}},Dp=Bp,Rp=["LR","RL","TB","BT","H","V"],Vp=["LR","RL","H"],Hp=Rp[0],Yp=function(n,t,e){var r=t.direction||Hp;if(t.isHorizontal=function(n){return Vp.indexOf(n)>-1}(r),r&&-1===Rp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Rp[0])e(n,t);else if(r===Rp[1])e(n,t),n.right2left();else if(r===Rp[2])e(n,t);else if(r===Rp[3])e(n,t),n.bottom2top();else if(r===Rp[4]||r===Rp[5]){var o=Dp(n,t),i=o.left,u=o.right;e(i,t),e(u,t),t.isHorizontal?i.right2left():i.bottom2top(),u.translate(i.x-u.x,i.y-u.y),n.x=i.x,n.y=u.y;var a=n.getBoundingBox();t.isHorizontal?a.top<0&&n.translate(0,-a.top):a.left<0&&n.translate(-a.left,0)}var c=t.fixedRoot;return void 0===c&&(c=!0),c&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),function(n,t){if(t.radial){var e=t.isHorizontal?["x","y"]:["y","x"],r=e[0],o=e[1],i={x:1/0,y:1/0},u={x:-1/0,y:-1/0},a=0;n.DFTraverse((function(n){a++;var t=n.x,e=n.y;i.x=Math.min(i.x,t),i.y=Math.min(i.y,e),u.x=Math.max(u.x,t),u.y=Math.max(u.y,e)}));var c=u[o]-i[o];if(0===c)return;var l=2*Math.PI/a;n.DFTraverse((function(t){var e=(t[o]-i[o])/c*(2*Math.PI-l)+l,u=t[r]-n[r];t.x=Math.cos(e)*u,t.y=Math.sin(e)*u}))}}(n,t),n};function Zp(n,t){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Zp(n,t)}var Xp=function(n,t){void 0===t&&(t={});var e=t.isHorizontal;function r(n){0===n.cs?(n.el=n,n.er=n,n.msel=n.mser=0):(n.el=n.c[0].el,n.msel=n.c[0].msel,n.er=n.c[n.cs-1].er,n.mser=n.c[n.cs-1].mser)}function o(n,t,e){for(var r=n.c[t-1],o=r.mod,l=n.c[t],s=l.mod;null!==r&&null!==l;){c(r)>e.low&&(e=e.nxt);var f=o+r.prelim+r.w-(s+l.prelim);f>0&&(s+=f,i(n,t,e.index,f));var d=c(r),h=c(l);d<=h&&null!==(r=a(r))&&(o+=r.mod),d>=h&&null!==(l=u(l))&&(s+=l.mod)}!r&&l?function(n,t,e,r){var o=n.c[0].el;o.tl=e;var i=r-e.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[t].el,n.c[0].msel=n.c[t].msel}(n,t,l,s):r&&!l&&function(n,t,e,r){var o=n.c[t].er;o.tr=e;var i=r-e.mod-n.c[t].mser;o.mod+=i,o.prelim-=i,n.c[t].er=n.c[t-1].er,n.c[t].mser=n.c[t-1].mser}(n,t,r,o)}function i(n,t,e,r){n.c[t].mod+=r,n.c[t].msel+=r,n.c[t].mser+=r,function(n,t,e,r){if(e!==t-1){var o=t-e;n.c[e+1].shift+=r/o,n.c[t].shift-=r/o,n.c[t].change-=r-r/o}}(n,t,e,r)}function u(n){return 0===n.cs?n.tl:n.c[0]}function a(n){return 0===n.cs?n.tr:n.c[n.cs-1]}function c(n){return n.y+n.h}function l(n,t,e){for(;null!==e&&n>=e.low;)e=e.nxt;return{low:n,index:t,nxt:e}}Lp(n,e);var s=jp.fromNode(n,e);return function n(t){if(0!==t.cs){n(t.c[0]);for(var e=l(c(t.c[0].el),0,null),i=1;i<t.cs;++i){n(t.c[i]);var u=c(t.c[i].er);o(t,i,e),e=l(u,i,e)}!function(n){n.prelim=(n.c[0].prelim+n.c[0].mod+n.c[n.cs-1].mod+n.c[n.cs-1].prelim+n.c[n.cs-1].w)/2-n.w/2}(t),r(t)}else r(t)}(s),function n(t,e){e+=t.mod,t.x=t.prelim+e,function(n){for(var t=0,e=0,r=0;r<n.cs;r++)e+=(t+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=e}(t);for(var r=0;r<t.cs;r++)n(t.c[r],e)}(s,0),zp(s,n,e),Ap(n,e),n},Up=Yp,Fp=xp,Wp=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,Zp(e,r),t.prototype.execute=function(){return Up(this.rootNode,this.options,Xp)},t}(Op),$p={},Gp=xp;function qp(n,t){void 0===t&&(t=[]);var e=this;e.x=e.y=0,e.leftChild=e.rightChild=null,e.height=0,e.children=t}var Kp={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Qp(n,t,e){e?(t.x=n.x,t.y=n.y):(t.x=n.y,t.y=n.x),n.children.forEach((function(n,r){Qp(n,t.children[r],e)}))}function Jp(n,t){return Jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Jp(n,t)}var ng=function(n,t){void 0===t&&(t={}),t=Gp.assign({},Kp,t);var e,r=0,o=function n(t){if(!t)return null;t.width=0,t.depth&&t.depth>r&&(r=t.depth);var e=t.children,o=e.length,i=new qp(t.height,[]);return e.forEach((function(t,e){var r=n(t);i.children.push(r),0===e&&(i.leftChild=r),e===o-1&&(i.rightChild=r)})),i.originNode=t,i.isLeaf=t.isLeaf(),i}(n);return function n(t){if(t.isLeaf||0===t.children.length)t.drawingDepth=r;else{var e=t.children.map((function(t){return n(t)})),o=Math.min.apply(null,e);t.drawingDepth=o-1}return t.drawingDepth}(o),function n(r){r.x=r.drawingDepth*t.rankSep,r.isLeaf?(r.y=0,e&&(r.y=e.y+e.height+t.nodeSep,r.originNode.parent!==e.originNode.parent&&(r.y+=t.subTreeSep)),e=r):(r.children.forEach((function(t){n(t)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Qp(o,n,t.isHorizontal),n},tg=Yp,eg=xp,rg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,Jp(e,r),t.prototype.execute=function(){var n=this;return n.rootNode.width=0,tg(n.rootNode,n.options,ng)},t}(Op),og={},ig=xp;function ug(n,t){return ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},ug(n,t)}var ag=Op,cg=function(n,t,e,r){var o=null;n.eachNode((function(n){!function(n,t,e,r,o){var i=("function"==typeof e?e(n):e)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=t?t.y:0)}catch(n){}if(n.x+=i,t){if(n.y=t.y+ig.getHeight(t,n,o),t.parent&&n.parent.id!==t.parent.id){var u=t.parent,a=u.y+ig.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,t,e,r),o=n}))},lg=Bp,sg=xp,fg=["LR","RL","H"],dg=fg[0],hg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,ug(e,r),t.prototype.execute=function(){var n=this.options,t=this.rootNode;n.isHorizontal=!0;var e=n.indent,r=void 0===e?20:e,o=n.dropCap,i=void 0===o||o,u=n.direction,a=void 0===u?dg:u,c=n.align;if(a&&-1===fg.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===fg[0])cg(t,r,i,c);else if(a===fg[1])cg(t,r,i,c),t.right2left();else if(a===fg[2]){var l=lg(t,n),s=l.left,f=l.right;cg(s,r,i,c),s.right2left(),cg(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),t.x=f.x-t.width/2}return t},t}(ag),vg={},pg=xp;function gg(n,t){var e=0;return n.children.length?n.children.forEach((function(n){e+=gg(n,t)})):e=n.height,n._subTreeSep=t.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,e)+2*n._subTreeSep,n.totalHeight}function yg(n){var t=n.children,e=t.length;if(e){t.forEach((function(n){yg(n)}));var r=t[0],o=t[e-1],i=o.y-r.y+o.height,u=0;if(t.forEach((function(n){u+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==t.length||n.height>u){var a=n.y+(n.height-i)/2-r.y;t.forEach((function(n){n.translate(0,a)}))}else n.y=(r.y+r.height/2+o.y+o.height/2)/2-n.height/2}}var mg={getSubTreeSep:function(){return 0}};function wg(n,t){return wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},wg(n,t)}var bg=function(n,t){void 0===t&&(t={}),t=pg.assign({},mg,t),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse((function(n){n.x=n.parent.x+n.parent.width})),n.parent=null,gg(n,t),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var t=n.children,e=t.length;if(e){var r=t[0];if(r.startY=n.startY+n._subTreeSep,1===e)r.y=n.y+n.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var o=1;o<e;o++){var i=t[o];i.startY=t[o-1].startY+t[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),yg(n)},_g=Yp,xg=xp,Eg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,wg(e,r),t.prototype.execute=function(){return _g(this.rootNode,this.options,bg)},t}(Op),Sg={};Kt({compactBox:function(n,t){return t=Fp.assign({},$p,t),new Wp(n,t).execute()},dendrogram:function(n,t){return t=eg.assign({},og,t),new rg(n,t).execute()},indented:function(n,t){return t=sg.assign({},vg,t),new hg(n,t).execute()},mindmap:function(n,t){return t=xg.assign({},Sg,t),new Eg(n,t).execute()}});var kg={value:()=>{}};function Cg(){for(var n,t=0,e=arguments.length,r={};t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Ng(r)}function Ng(n){this._=n}function Mg(n,t){for(var e,r=0,o=n.length;r<o;++r)if((e=n[r]).name===t)return e.value}function Og(n,t,e){for(var r=0,o=n.length;r<o;++r)if(n[r].name===t){n[r]=kg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=e&&n.push({name:t,value:e}),n}Ng.prototype=Cg.prototype={constructor:Ng,on:function(n,t){var e,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var t="",e=n.indexOf(".");if(e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}}))),u=-1,a=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++u<a;)if(e=(n=i[u]).type)o[e]=Og(o[e],n.name,t);else if(null==t)for(e in o)o[e]=Og(o[e],n.name,null);return this}for(;++u<a;)if((e=(n=i[u]).type)&&(e=Mg(o[e],n.name)))return e},copy:function(){var n={},t=this._;for(var e in t)n[e]=t[e].slice();return new Ng(n)},call:function(n,t){if((e=arguments.length-2)>0)for(var e,r,o=new Array(e),i=0;i<e;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,e=(r=this._[n]).length;i<e;++i)r[i].value.apply(t,o)},apply:function(n,t,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],o=0,i=r.length;o<i;++o)r[o].value.apply(t,e)}};var jg="http://www.w3.org/1999/xhtml",Ig={svg:"http://www.w3.org/2000/svg",xhtml:jg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pg(n){var t=n+="",e=t.indexOf(":");return e>=0&&"xmlns"!==(t=n.slice(0,e))&&(n=n.slice(e+1)),Ig.hasOwnProperty(t)?{space:Ig[t],local:n}:n}function Ag(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===jg&&t.documentElement.namespaceURI===jg?t.createElement(n):t.createElementNS(e,n)}}function zg(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Lg(n){var t=Pg(n);return(t.local?zg:Ag)(t)}function Tg(){}function Bg(n){return null==n?Tg:function(){return this.querySelector(n)}}function Dg(){return[]}function Rg(n){return null==n?Dg:function(){return this.querySelectorAll(n)}}function Vg(n){return function(){return this.matches(n)}}function Hg(n){return function(t){return t.matches(n)}}var Yg=Array.prototype.find;function Zg(){return this.firstElementChild}var Xg=Array.prototype.filter;function Ug(){return Array.from(this.children)}function Fg(n){return new Array(n.length)}function Wg(n,t){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=t}function $g(n,t,e,r,o,i){for(var u,a=0,c=t.length,l=i.length;a<l;++a)(u=t[a])?(u.__data__=i[a],r[a]=u):e[a]=new Wg(n,i[a]);for(;a<c;++a)(u=t[a])&&(o[a]=u)}function Gg(n,t,e,r,o,i,u){var a,c,l,s=new Map,f=t.length,d=i.length,h=new Array(f);for(a=0;a<f;++a)(c=t[a])&&(h[a]=l=u.call(c,c.__data__,a,t)+"",s.has(l)?o[a]=c:s.set(l,c));for(a=0;a<d;++a)l=u.call(n,i[a],a,i)+"",(c=s.get(l))?(r[a]=c,c.__data__=i[a],s.delete(l)):e[a]=new Wg(n,i[a]);for(a=0;a<f;++a)(c=t[a])&&s.get(h[a])===c&&(o[a]=c)}function qg(n){return n.__data__}function Kg(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function Qg(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function Jg(n){return function(){this.removeAttribute(n)}}function ny(n){return function(){this.removeAttributeNS(n.space,n.local)}}function ty(n,t){return function(){this.setAttribute(n,t)}}function ey(n,t){return function(){this.setAttributeNS(n.space,n.local,t)}}function ry(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}}function oy(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}function iy(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function uy(n){return function(){this.style.removeProperty(n)}}function ay(n,t,e){return function(){this.style.setProperty(n,t,e)}}function cy(n,t,e){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}}function ly(n,t){return n.style.getPropertyValue(t)||iy(n).getComputedStyle(n,null).getPropertyValue(t)}function sy(n){return function(){delete this[n]}}function fy(n,t){return function(){this[n]=t}}function dy(n,t){return function(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}}function hy(n){return n.trim().split(/^|\s+/)}function vy(n){return n.classList||new py(n)}function py(n){this._node=n,this._names=hy(n.getAttribute("class")||"")}function gy(n,t){for(var e=vy(n),r=-1,o=t.length;++r<o;)e.add(t[r])}function yy(n,t){for(var e=vy(n),r=-1,o=t.length;++r<o;)e.remove(t[r])}function my(n){return function(){gy(this,n)}}function wy(n){return function(){yy(this,n)}}function by(n,t){return function(){(t.apply(this,arguments)?gy:yy)(this,n)}}function _y(){this.textContent=""}function xy(n){return function(){this.textContent=n}}function Ey(n){return function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}}function Sy(){this.innerHTML=""}function ky(n){return function(){this.innerHTML=n}}function Cy(n){return function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ny(){this.nextSibling&&this.parentNode.appendChild(this)}function My(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oy(){return null}function jy(){var n=this.parentNode;n&&n.removeChild(this)}function Iy(){var n=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function Py(){var n=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function Ay(n){return function(){var t=this.__on;if(t){for(var e,r=0,o=-1,i=t.length;r<i;++r)e=t[r],n.type&&e.type!==n.type||e.name!==n.name?t[++o]=e:this.removeEventListener(e.type,e.listener,e.options);++o?t.length=o:delete this.__on}}}function zy(n,t,e){return function(){var r,o=this.__on,i=function(n){return function(t){n.call(this,t,this.__data__)}}(t);if(o)for(var u=0,a=o.length;u<a;++u)if((r=o[u]).type===n.type&&r.name===n.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=e),void(r.value=t);this.addEventListener(n.type,i,e),r={type:n.type,name:n.name,value:t,listener:i,options:e},o?o.push(r):this.__on=[r]}}function Ly(n,t,e){var r=iy(n),o=r.CustomEvent;"function"==typeof o?o=new o(t,e):(o=r.document.createEvent("Event"),e?(o.initEvent(t,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(t,!1,!1)),n.dispatchEvent(o)}function Ty(n,t){return function(){return Ly(this,n,t)}}function By(n,t){return function(){return Ly(this,n,t.apply(this,arguments))}}Wg.prototype={constructor:Wg,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,t){return this._parent.insertBefore(n,t)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},py.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var Dy=[null];function Ry(n,t){this._groups=n,this._parents=t}function Vy(){return new Ry([[document.documentElement]],Dy)}function Hy(n){return"string"==typeof n?new Ry([[document.querySelector(n)]],[document.documentElement]):new Ry([[n]],Dy)}function Yy(n,t){if(n=function(n){let t;for(;t=n.sourceEvent;)n=t;return n}(n),void 0===t&&(t=n.currentTarget),t){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}}return[n.pageX,n.pageY]}Ry.prototype=Vy.prototype={constructor:Ry,select:function(n){"function"!=typeof n&&(n=Bg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u,a=t[o],c=a.length,l=r[o]=new Array(c),s=0;s<c;++s)(i=a[s])&&(u=n.call(i,i.__data__,s,a))&&("__data__"in i&&(u.__data__=i.__data__),l[s]=u);return new Ry(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(t=n.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(n):Rg(n);for(var t=this._groups,e=t.length,r=[],o=[],i=0;i<e;++i)for(var u,a=t[i],c=a.length,l=0;l<c;++l)(u=a[l])&&(r.push(n.call(u,u.__data__,l,a)),o.push(u));return new Ry(r,o)},selectChild:function(n){return this.select(null==n?Zg:function(n){return function(){return Yg.call(this.children,n)}}("function"==typeof n?n:Hg(n)))},selectChildren:function(n){return this.selectAll(null==n?Ug:function(n){return function(){return Xg.call(this.children,n)}}("function"==typeof n?n:Hg(n)))},filter:function(n){"function"!=typeof n&&(n=Vg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u=t[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new Ry(r,this._parents)},data:function(n,t){if(!arguments.length)return Array.from(this,qg);var e,r=t?Gg:$g,o=this._parents,i=this._groups;"function"!=typeof n&&(e=n,n=function(){return e});for(var u=i.length,a=new Array(u),c=new Array(u),l=new Array(u),s=0;s<u;++s){var f=o[s],d=i[s],h=d.length,v=Kg(n.call(f,f&&f.__data__,s,o)),p=v.length,g=c[s]=new Array(p),y=a[s]=new Array(p);r(f,d,g,y,l[s]=new Array(h),v,t);for(var m,w,b=0,_=0;b<p;++b)if(m=g[b]){for(b>=_&&(_=b+1);!(w=y[_])&&++_<p;);m._next=w||null}}return(a=new Ry(a,o))._enter=c,a._exit=l,a},enter:function(){return new Ry(this._enter||this._groups.map(Fg),this._parents)},exit:function(){return new Ry(this._exit||this._groups.map(Fg),this._parents)},join:function(n,t,e){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=t&&(o=t(o))&&(o=o.selection()),null==e?i.remove():e(i),r&&o?r.merge(o).order():o},merge:function(n){for(var t=n.selection?n.selection():n,e=this._groups,r=t._groups,o=e.length,i=r.length,u=Math.min(o,i),a=new Array(o),c=0;c<u;++c)for(var l,s=e[c],f=r[c],d=s.length,h=a[c]=new Array(d),v=0;v<d;++v)(l=s[v]||f[v])&&(h[v]=l);for(;c<o;++c)a[c]=e[c];return new Ry(a,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,t=-1,e=n.length;++t<e;)for(var r,o=n[t],i=o.length-1,u=o[i];--i>=0;)(r=o[i])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(n){function t(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}n||(n=Qg);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i){for(var u,a=e[i],c=a.length,l=o[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(l[s]=u);l.sort(t)}return new Ry(o,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var r=n[t],o=0,i=r.length;o<i;++o){var u=r[o];if(u)return u}return null},size:function(){let n=0;for(const t of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var o,i=t[e],u=0,a=i.length;u<a;++u)(o=i[u])&&n.call(o,o.__data__,u,i);return this},attr:function(n,t){var e=Pg(n);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==t?e.local?ny:Jg:"function"==typeof t?e.local?oy:ry:e.local?ey:ty)(e,t))},style:function(n,t,e){return arguments.length>1?this.each((null==t?uy:"function"==typeof t?cy:ay)(n,t,null==e?"":e)):ly(this.node(),n)},property:function(n,t){return arguments.length>1?this.each((null==t?sy:"function"==typeof t?dy:fy)(n,t)):this.node()[n]},classed:function(n,t){var e=hy(n+"");if(arguments.length<2){for(var r=vy(this.node()),o=-1,i=e.length;++o<i;)if(!r.contains(e[o]))return!1;return!0}return this.each(("function"==typeof t?by:t?my:wy)(e,t))},text:function(n){return arguments.length?this.each(null==n?_y:("function"==typeof n?Ey:xy)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Sy:("function"==typeof n?Cy:ky)(n)):this.node().innerHTML},raise:function(){return this.each(Ny)},lower:function(){return this.each(My)},append:function(n){var t="function"==typeof n?n:Lg(n);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(n,t){var e="function"==typeof n?n:Lg(n),r=null==t?Oy:"function"==typeof t?t:Bg(t);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(jy)},clone:function(n){return this.select(n?Py:Iy)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,t,e){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var t="",e=n.indexOf(".");return e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),{type:n,name:t}}))}(n+""),u=i.length;if(!(arguments.length<2)){for(a=t?zy:Ay,r=0;r<u;++r)this.each(a(i[r],t,e));return this}var a=this.node().__on;if(a)for(var c,l=0,s=a.length;l<s;++l)for(r=0,c=a[l];r<u;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(n,t){return this.each(("function"==typeof t?By:Ty)(n,t))},[Symbol.iterator]:function*(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var r,o=n[t],i=0,u=o.length;i<u;++i)(r=o[i])&&(yield r)}};const Zy={passive:!1},Xy={capture:!0,passive:!1};function Uy(n){n.stopImmediatePropagation()}function Fy(n){n.preventDefault(),n.stopImmediatePropagation()}function Wy(n){var t=n.document.documentElement,e=Hy(n).on("dragstart.drag",Fy,Xy);"onselectstart"in t?e.on("selectstart.drag",Fy,Xy):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $y(n,t){var e=n.document.documentElement,r=Hy(n).on("dragstart.drag",null);t&&(r.on("click.drag",Fy,Xy),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Gy=n=>()=>n;function qy(n,{sourceEvent:t,subject:e,target:r,identifier:o,active:i,x:u,y:a,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function Ky(n){return!n.ctrlKey&&!n.button}function Qy(){return this.parentNode}function Jy(n,t){return null==t?{x:n.x,y:n.y}:t}function nm(){return navigator.maxTouchPoints||"ontouchstart"in this}function tm(n,t){if(!n.parentId)return!1;var e=t.get(n.parentId);return!!e&&(!!e.selected||tm(e,t))}function em(n,t,e){var r=n;do{if(null==r?void 0:r.matches(t))return!0;if(r===e)return!1;r=r.parentElement}while(r);return!1}function rm(n){var t,e,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=F(u),s=l.next();!s.done;s=l.next()){var f=W(s.value,2),d=f[0],h=f[1],v=null===(r=a.get(d))||void 0===r?void 0:r.internals.userNode;v&&c.push(U(U({},v),{position:h.position}))}}catch(n){t={error:n}}finally{try{s&&!s.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}if(!i)return[c[0],c];var p=a.get(i).internals.userNode;return[U(U({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function om(n){var t=n.onNodeMouseDown,e=n.getStoreItems,r=n.onDragStart,o=n.onDrag,i=n.onDragStop,u={x:null,y:null},a=0,c=new Map,l=!1,s={x:0,y:0},f=null,d=!1,h=null;return{update:function(n){var v=n.noDragClassName,p=n.handleSelector,g=n.domNode,y=n.isSelectable,m=n.nodeId;function w(n,t){var r,i,a=n.x,l=n.y,s=e(),f=s.nodeLookup,d=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,w=s.onError,b=s.updateNodePositions;u={x:a,y:l};var _=!1,x={x:0,y:0,x2:0,y2:0};if(c.size>1&&d){var E=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var e={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==t.filter||t.filter(n)){var r=Xv(n,t.nodeOrigin);e=Yv(e,r)}})),Zv(e)}(c,{nodeOrigin:p});x=function(n){var t=n.x,e=n.y;return{x:t,y:e,x2:t+n.width,y2:e+n.height}}(E)}try{for(var S=F(c),k=S.next();!k.done;k=S.next()){var C=W(k.value,2),N=C[0],M=C[1],O={x:a-M.distance.x,y:l-M.distance.y};v&&(O=Uv(O,h));var j=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!M.extent){var I=M.internals.positionAbsolute,P=I.x-x.x+d[0][0],A=I.x+M.measured.width-x.x2+d[1][0];j=[[P,I.y-x.y+d[0][1]],[A,I.y+M.measured.height-x.y2+d[1][1]]]}var z=Bv({nodeId:N,nextPosition:O,nodeLookup:f,nodeExtent:j,nodeOrigin:p,onError:w}),L=z.position,T=z.positionAbsolute;_=_||M.position.x!==L.x||M.position.y!==L.y,M.position=L,M.internals.positionAbsolute=T}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(_&&(b(c,!0),t&&(o||g||!m&&y))){var B=W(rm({nodeId:m,dragItems:c,nodeLookup:f}),2),D=B[0],R=B[1];null==o||o(t,c,D,R),null==g||g(t,D,R),m||null==y||y(t,R)}}function b(){var n,t;if(f){var r=W(Hv(s,f),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=e(),l=c.transform,d=c.panBy;u.x=(null!==(n=u.x)&&void 0!==n?n:0)-o/l[2],u.y=(null!==(t=u.y)&&void 0!==t?t:0)-i/l[2],d({x:o,y:i})&&w(u,null)}a=requestAnimationFrame(b)}}function _(n){var o,i=e(),a=i.nodeLookup,l=i.multiSelectionActive,s=i.nodesDraggable,f=i.transform,h=i.snapGrid,v=i.snapToGrid,p=i.selectNodesOnDrag,g=i.onNodeDragStart,w=i.onSelectionDragStart,b=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||b(),y&&p&&m&&(null==t||t(m));var _=Jv(n.sourceEvent,{transform:f,snapGrid:h,snapToGrid:v});if(u=_,c=function(n,t,e,r){var o,i,u,a,c=new Map;try{for(var l=F(n),s=l.next();!s.done;s=l.next()){var f=W(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!tm(h,n))&&(h.draggable||t&&void 0===h.draggable)){var v=n.get(d);v&&c.set(d,{id:d,position:v.position||{x:0,y:0},distance:{x:e.x-v.internals.positionAbsolute.x,y:e.y-v.internals.positionAbsolute.y},extent:v.extent,parentId:v.parentId,origin:v.origin,expandParent:v.expandParent,internals:{positionAbsolute:v.internals.positionAbsolute||{x:0,y:0}},measured:{width:null!==(u=v.measured.width)&&void 0!==u?u:0,height:null!==(a=v.measured.height)&&void 0!==a?a:0}})}}}catch(n){o={error:n}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return c}(a,s,_,m),c.size>0&&(r||g||!m&&w)){var x=W(rm({nodeId:m,dragItems:c,nodeLookup:a}),2),E=x[0],S=x[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==w||w(n.sourceEvent,S)}}h=Hy(g);var x=function(){var n,t,e,r,o=Ky,i=Qy,u=Jy,a=nm,c={},l=Cg("start","drag","end"),s=0,f=0;function d(n){n.on("mousedown.drag",h).filter(a).on("touchstart.drag",g).on("touchmove.drag",y,Zy).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(u,a){if(!r&&o.call(this,u,a)){var c=w(this,i.call(this,u,a),u,a,"mouse");c&&(Hy(u.view).on("mousemove.drag",v,Xy).on("mouseup.drag",p,Xy),Wy(u.view),Uy(u),e=!1,n=u.clientX,t=u.clientY,c("start",u))}}function v(r){if(Fy(r),!e){var o=r.clientX-n,i=r.clientY-t;e=o*o+i*i>f}c.mouse("drag",r)}function p(n){Hy(n.view).on("mousemove.drag mouseup.drag",null),$y(n.view,e),Fy(n),c.mouse("end",n)}function g(n,t){if(o.call(this,n,t)){var e,r,u=n.changedTouches,a=i.call(this,n,t),c=u.length;for(e=0;e<c;++e)(r=w(this,a,n,t,u[e].identifier,u[e]))&&(Uy(n),r("start",n,u[e]))}}function y(n){var t,e,r=n.changedTouches,o=r.length;for(t=0;t<o;++t)(e=c[r[t].identifier])&&(Fy(n),e("drag",n,r[t]))}function m(n){var t,e,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=c[o[t].identifier])&&(Uy(n),e("end",n,o[t]))}function w(n,t,e,r,o,i){var a,f,h,v=l.copy(),p=Yy(i||e,t);if(null!=(h=u.call(n,new qy("beforestart",{sourceEvent:e,target:d,identifier:o,active:s,x:p[0],y:p[1],dx:0,dy:0,dispatch:v}),r)))return a=h.x-p[0]||0,f=h.y-p[1]||0,function e(i,u,l){var g,y=p;switch(i){case"start":c[o]=e,g=s++;break;case"end":delete c[o],--s;case"drag":p=Yy(l||u,t),g=s}v.call(i,n,new qy(i,{sourceEvent:u,subject:h,target:d,identifier:o,active:g,x:p[0]+a,y:p[1]+f,dx:p[0]-y[0],dy:p[1]-y[1],dispatch:v}),r)}}return d.filter=function(n){return arguments.length?(o="function"==typeof n?n:Gy(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:Gy(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:Gy(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:Gy(!!n),d):a},d.on=function(){var n=l.on.apply(l,arguments);return n===l?d:n},d.clickDistance=function(n){return arguments.length?(f=(n=+n)*n,d):Math.sqrt(f)},d}().on("start",(function(n){var t=e(),r=t.domNode,o=t.nodeDragThreshold,i=t.transform,a=t.snapGrid,c=t.snapToGrid;0===o&&_(n);var l=Jv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=up(n.sourceEvent,f)})).on("drag",(function(n){var t,r,o=e(),i=o.autoPanOnNodeDrag,a=o.transform,h=o.snapGrid,v=o.snapToGrid,p=o.nodeDragThreshold,g=Jv(n.sourceEvent,{transform:a,snapGrid:h,snapToGrid:v});if(!l&&i&&d&&(l=!0,b()),!d){var y=g.xSnapped-(null!==(t=u.x)&&void 0!==t?t:0),m=g.ySnapped-(null!==(r=u.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&_(n)}(u.x!==g.xSnapped||u.y!==g.ySnapped)&&c&&d&&(s=up(n.sourceEvent,f),w(g,n.sourceEvent))})).on("end",(function(n){if(d&&(l=!1,d=!1,cancelAnimationFrame(a),c.size>0)){var t=e(),r=t.nodeLookup,o=t.updateNodePositions,u=t.onNodeDragStop,s=t.onSelectionDragStop;if(o(c,!1),i||u||!m&&s){var f=W(rm({nodeId:m,dragItems:c,nodeLookup:r}),2),h=f[0],v=f[1];null==i||i(n.sourceEvent,c,h,v),null==u||u(n.sourceEvent,h,v),m||null==s||s(n.sourceEvent,v)}}})).filter((function(n){var t=n.target;return!n.button&&(!v||!em(t,".".concat(v),g))&&(!p||em(t,p,g))}));h.call(x)},destroy:function(){null==h||h.on(".drag",null)}}}function im(n,t,e,r){return(t[e]||[]).reduce((function(t,o){return"".concat(n.id,"-").concat(o.id,"-").concat(e)!==r&&t.push({id:o.id||null,type:e,nodeId:n.id,x:n.internals.positionAbsolute.x+o.x+o.width/2,y:n.internals.positionAbsolute.y+o.y+o.height/2}),t}),[])}function um(n,t){return n||((null==t?void 0:t.classList.contains("target"))?"target":(null==t?void 0:t.classList.contains("source"))?"source":null)}qy.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var am=function(){return!0},cm=null;function lm(n,t){var e=t.handle,r=t.connectionMode,o=t.fromNodeId,i=t.fromHandleId,u=t.fromType,a=t.doc,c=t.lib,l=t.flowId,s=t.isValidConnection,f=void 0===s?am:s,d="target"===u,h=e?a.querySelector(".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==e?void 0:e.nodeId,"-").concat(null==e?void 0:e.id,"-").concat(null==e?void 0:e.type,'"]')):null,v=up(n),p=v.x,g=v.y,y=a.elementFromPoint(p,g),m=(null==y?void 0:y.classList.contains("".concat(c,"-flow__handle")))?y:h,w={handleDomNode:m,isValid:!1,connection:null,endHandle:null};if(m){var b=um(void 0,m),_=m.getAttribute("data-nodeid"),x=m.getAttribute("data-handleid"),E=m.classList.contains("connectable"),S=m.classList.contains("connectableend");if(!_)return w;var k={source:d?_:o,sourceHandle:d?x:i,target:d?o:_,targetHandle:d?i:x};w.connection=k,E&&S&&(r===np.Strict?d&&"source"===b||!d&&"target"===b:_!==o||x!==i)&&(w.endHandle={nodeId:_,handleId:x,type:b},w.isValid=f(k))}return w}var sm={onPointerDown:function(n,t){var e,r=t.connectionMode,o=t.connectionRadius,i=t.handleId,u=t.nodeId,a=t.edgeUpdaterType,c=t.isTarget,l=t.domNode,s=t.nodeLookup,f=t.lib,d=t.autoPanOnConnect,h=t.flowId,v=t.panBy,p=t.cancelConnection,g=t.onConnectStart,y=t.onConnect,m=t.onConnectEnd,w=t.isValidConnection,b=void 0===w?am:w,_=t.onEdgeUpdateEnd,x=t.updateConnection,E=t.getTransform,S=t.getConnectionStartHandle,k=function(n){var t;return(null===(t=n.getRootNode)||void 0===t?void 0:t.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),C=0,N=up(n),M=N.x,O=N.y,j=null==k?void 0:k.elementFromPoint(M,O),I=um(a,j),P=null==l?void 0:l.getBoundingClientRect();if(P&&I){var A=up(n,P),z=!1,L=null,T=!1,B=null,D=function(n){var t,e,r=n.nodeLookup,o=n.nodeId,i=n.handleId,u=n.handleType,a=[];try{for(var c=F(r),l=c.next();!l.done;l=c.next()){var s=W(l.value,2)[1];if(s.internals.handleBounds){var f="".concat(o,"-").concat(i,"-").concat(u),d=im(s,s.internals.handleBounds,"source",f),h=im(s,s.internals.handleBounds,"target",f);a.push.apply(a,$($([],W(d),!1),W(h),!1))}}}catch(n){t={error:n}}finally{try{l&&!l.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}return a}({nodeLookup:s,nodeId:u,handleId:i,handleType:I});x({connectionPosition:A,connectionStatus:null,connectionStartHandle:cm={nodeId:u,handleId:i,type:I},connectionEndHandle:null}),null==g||g(n,{nodeId:u,handleId:i,handleType:I}),k.addEventListener("mousemove",V),k.addEventListener("mouseup",H),k.addEventListener("touchmove",V),k.addEventListener("touchend",H)}function R(){if(d&&P){var n=W(Hv(A,P),2),t=n[0],e=n[1];v({x:t,y:e}),C=requestAnimationFrame(R)}}function V(n){S()||H(n);var t=E();A=up(n,P),e=function(n,t,e){var r,o,i=[],u=1/0;try{for(var a=F(e),c=a.next();!c.done;c=a.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));s<=t&&(s<u?i=[l]:s===u&&i.push(l),u=s)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i.length?1===i.length?i[0]:i.find((function(n){return"target"===n.type}))||i[0]:null}(Fv(A,t,!1,[1,1]),o,D),z||(R(),z=!0);var a,l,s,d=lm(n,{handle:e,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:b,doc:k,lib:f,flowId:h});B=d.handleDomNode,L=d.connection,T=d.isValid,x({connectionStartHandle:cm,connectionPosition:e&&T?Wv({x:e.x,y:e.y},t):A,connectionStatus:(a=!!e,l=T,s=null,l?s="valid":a&&!l&&(s="invalid"),s),connectionEndHandle:d.endHandle})}function H(n){(e||B)&&L&&T&&(null==y||y(L)),null==m||m(n),a&&(null==_||_(n)),p(),cancelAnimationFrame(C),z=!1,T=!1,L=null,B=null,cm=null,k.removeEventListener("mousemove",V),k.removeEventListener("mouseup",H),k.removeEventListener("touchmove",V),k.removeEventListener("touchend",H)}},isValid:lm};function fm(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function dm(n,t){var e=Object.create(n.prototype);for(var r in t)e[r]=t[r];return e}function hm(){}var vm=.7,pm=1/vm,gm="\\s*([+-]?\\d+)\\s*",ym="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wm=/^#([0-9a-f]{3,8})$/,bm=new RegExp(`^rgb\\(${gm},${gm},${gm}\\)$`),_m=new RegExp(`^rgb\\(${mm},${mm},${mm}\\)$`),xm=new RegExp(`^rgba\\(${gm},${gm},${gm},${ym}\\)$`),Em=new RegExp(`^rgba\\(${mm},${mm},${mm},${ym}\\)$`),Sm=new RegExp(`^hsl\\(${ym},${mm},${mm}\\)$`),km=new RegExp(`^hsla\\(${ym},${mm},${mm},${ym}\\)$`),Cm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Nm(){return this.rgb().formatHex()}function Mm(){return this.rgb().formatRgb()}function Om(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=wm.exec(n))?(e=t[1].length,t=parseInt(t[1],16),6===e?jm(t):3===e?new Am(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===e?Im(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===e?Im(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=bm.exec(n))?new Am(t[1],t[2],t[3],1):(t=_m.exec(n))?new Am(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=xm.exec(n))?Im(t[1],t[2],t[3],t[4]):(t=Em.exec(n))?Im(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Sm.exec(n))?Rm(t[1],t[2]/100,t[3]/100,1):(t=km.exec(n))?Rm(t[1],t[2]/100,t[3]/100,t[4]):Cm.hasOwnProperty(n)?jm(Cm[n]):"transparent"===n?new Am(NaN,NaN,NaN,0):null}function jm(n){return new Am(n>>16&255,n>>8&255,255&n,1)}function Im(n,t,e,r){return r<=0&&(n=t=e=NaN),new Am(n,t,e,r)}function Pm(n,t,e,r){return 1===arguments.length?((o=n)instanceof hm||(o=Om(o)),o?new Am((o=o.rgb()).r,o.g,o.b,o.opacity):new Am):new Am(n,t,e,null==r?1:r);var o}function Am(n,t,e,r){this.r=+n,this.g=+t,this.b=+e,this.opacity=+r}function zm(){return`#${Dm(this.r)}${Dm(this.g)}${Dm(this.b)}`}function Lm(){const n=Tm(this.opacity);return`${1===n?"rgb(":"rgba("}${Bm(this.r)}, ${Bm(this.g)}, ${Bm(this.b)}${1===n?")":`, ${n})`}`}function Tm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Bm(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Dm(n){return((n=Bm(n))<16?"0":"")+n.toString(16)}function Rm(n,t,e,r){return r<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new Hm(n,t,e,r)}function Vm(n){if(n instanceof Hm)return new Hm(n.h,n.s,n.l,n.opacity);if(n instanceof hm||(n=Om(n)),!n)return new Hm;if(n instanceof Hm)return n;var t=(n=n.rgb()).r/255,e=n.g/255,r=n.b/255,o=Math.min(t,e,r),i=Math.max(t,e,r),u=NaN,a=i-o,c=(i+o)/2;return a?(u=t===i?(e-r)/a+6*(e<r):e===i?(r-t)/a+2:(t-e)/a+4,a/=c<.5?i+o:2-i-o,u*=60):a=c>0&&c<1?0:u,new Hm(u,a,c,n.opacity)}function Hm(n,t,e,r){this.h=+n,this.s=+t,this.l=+e,this.opacity=+r}function Ym(n){return(n=(n||0)%360)<0?n+360:n}function Zm(n){return Math.max(0,Math.min(1,n||0))}function Xm(n,t,e){return 255*(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)}fm(hm,Om,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Nm,formatHex:Nm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Vm(this).formatHsl()},formatRgb:Mm,toString:Mm}),fm(Am,Pm,dm(hm,{brighter(n){return n=null==n?pm:Math.pow(pm,n),new Am(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?vm:Math.pow(vm,n),new Am(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Am(Bm(this.r),Bm(this.g),Bm(this.b),Tm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zm,formatHex:zm,formatHex8:function(){return`#${Dm(this.r)}${Dm(this.g)}${Dm(this.b)}${Dm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Lm,toString:Lm})),fm(Hm,(function(n,t,e,r){return 1===arguments.length?Vm(n):new Hm(n,t,e,null==r?1:r)}),dm(hm,{brighter(n){return n=null==n?pm:Math.pow(pm,n),new Hm(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?vm:Math.pow(vm,n),new Hm(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,o=2*e-r;return new Am(Xm(n>=240?n-240:n+120,o,r),Xm(n,o,r),Xm(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new Hm(Ym(this.h),Zm(this.s),Zm(this.l),Tm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=Tm(this.opacity);return`${1===n?"hsl(":"hsla("}${Ym(this.h)}, ${100*Zm(this.s)}%, ${100*Zm(this.l)}%${1===n?")":`, ${n})`}`}}));var Um=n=>()=>n;function Fm(n,t){var e=t-n;return e?function(n,t){return function(e){return n+e*t}}(n,e):Um(isNaN(n)?t:n)}var Wm=function n(t){var e=function(n){return 1==(n=+n)?Fm:function(t,e){return e-t?function(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(r){return Math.pow(n+r*t,e)}}(t,e,n):Um(isNaN(t)?e:t)}}(t);function r(n,t){var r=e((n=Pm(n)).r,(t=Pm(t)).r),o=e(n.g,t.g),i=e(n.b,t.b),u=Fm(n.opacity,t.opacity);return function(t){return n.r=r(t),n.g=o(t),n.b=i(t),n.opacity=u(t),n+""}}return r.gamma=n,r}(1);function $m(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}var Gm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qm=new RegExp(Gm.source,"g");function Km(n,t){var e,r,o,i=Gm.lastIndex=qm.lastIndex=0,u=-1,a=[],c=[];for(n+="",t+="";(e=Gm.exec(n))&&(r=qm.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),a[u]?a[u]+=o:a[++u]=o),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:$m(e,r)})),i=qm.lastIndex;return i<t.length&&(o=t.slice(i),a[u]?a[u]+=o:a[++u]=o),a.length<2?c[0]?function(n){return function(t){return n(t)+""}}(c[0].x):function(n){return function(){return n}}(t):(t=c.length,function(n){for(var e,r=0;r<t;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}var Qm,Jm=180/Math.PI,nw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tw(n,t,e,r,o,i){var u,a,c;return(u=Math.sqrt(n*n+t*t))&&(n/=u,t/=u),(c=n*e+t*r)&&(e-=n*c,r-=t*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),n*r<t*e&&(n=-n,t=-t,c=-c,u=-u),{translateX:o,translateY:i,rotate:Math.atan2(t,n)*Jm,skewX:Math.atan(c)*Jm,scaleX:u,scaleY:a}}function ew(n,t,e,r){function o(n){return n.length?n.pop()+" ":""}return function(i,u){var a=[],c=[];return i=n(i),u=n(u),function(n,r,o,i,u,a){if(n!==o||r!==i){var c=u.push("translate(",null,t,null,e);a.push({i:c-4,x:$m(n,o)},{i:c-2,x:$m(r,i)})}else(o||i)&&u.push("translate("+o+t+i+e)}(i.translateX,i.translateY,u.translateX,u.translateY,a,c),function(n,t,e,i){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:$m(n,t)})):t&&e.push(o(e)+"rotate("+t+r)}(i.rotate,u.rotate,a,c),function(n,t,e,i){n!==t?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:$m(n,t)}):t&&e.push(o(e)+"skewX("+t+r)}(i.skewX,u.skewX,a,c),function(n,t,e,r,i,u){if(n!==e||t!==r){var a=i.push(o(i)+"scale(",null,",",null,")");u.push({i:a-4,x:$m(n,e)},{i:a-2,x:$m(t,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,u.scaleX,u.scaleY,a,c),i=u=null,function(n){for(var t,e=-1,r=c.length;++e<r;)a[(t=c[e]).i]=t.x(n);return a.join("")}}}var rw=ew((function(n){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return t.isIdentity?nw:tw(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),ow=ew((function(n){return null==n?nw:(Qm||(Qm=document.createElementNS("http://www.w3.org/2000/svg","g")),Qm.setAttribute("transform",n),(n=Qm.transform.baseVal.consolidate())?tw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):nw)}),", ",")",")");function iw(n){return((n=Math.exp(n))+1/n)/2}var uw,aw,cw=function n(t,e,r){function o(n,o){var i,u,a=n[0],c=n[1],l=n[2],s=o[0],f=o[1],d=o[2],h=s-a,v=f-c,p=h*h+v*v;if(p<1e-12)u=Math.log(d/l)/t,i=function(n){return[a+n*h,c+n*v,l*Math.exp(t*n*u)]};else{var g=Math.sqrt(p),y=(d*d-l*l+r*p)/(2*l*e*g),m=(d*d-l*l-r*p)/(2*d*e*g),w=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(m*m+1)-m);u=(b-w)/t,i=function(n){var r,o=n*u,i=iw(w),s=l/(e*g)*(i*(r=t*o+w,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(w));return[a+s*h,c+s*v,l*i/iw(t*o+w)]}}return i.duration=1e3*u*t/Math.SQRT2,i}return o.rho=function(t){var e=Math.max(.001,+t),r=e*e;return n(e,r,r*r)},o}(Math.SQRT2,2,4),lw=0,sw=0,fw=0,dw=0,hw=0,vw=0,pw="object"==typeof performance&&performance.now?performance:Date,gw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function yw(){return hw||(gw(mw),hw=pw.now()+vw)}function mw(){hw=0}function ww(){this._call=this._time=this._next=null}function bw(n,t,e){var r=new ww;return r.restart(n,t,e),r}function _w(){hw=(dw=pw.now())+vw,lw=sw=0;try{!function(){yw(),++lw;for(var n,t=uw;t;)(n=hw-t._time)>=0&&t._call.call(void 0,n),t=t._next;--lw}()}finally{lw=0,function(){for(var n,t,e=uw,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:uw=t);aw=n,Ew(r)}(),hw=0}}function xw(){var n=pw.now(),t=n-dw;t>1e3&&(vw-=t,dw=n)}function Ew(n){lw||(sw&&(sw=clearTimeout(sw)),n-hw>24?(n<1/0&&(sw=setTimeout(_w,n-pw.now()-vw)),fw&&(fw=clearInterval(fw))):(fw||(dw=pw.now(),fw=setInterval(xw,1e3)),lw=1,gw(_w)))}function Sw(n,t,e){var r=new ww;return t=null==t?0:+t,r.restart((e=>{r.stop(),n(e+t)}),t,e),r}ww.prototype=bw.prototype={constructor:ww,restart:function(n,t,e){if("function"!=typeof n)throw new TypeError("callback is not a function");e=(null==e?yw():+e)+(null==t?0:+t),this._next||aw===this||(aw?aw._next=this:uw=this,aw=this),this._call=n,this._time=e,Ew()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ew())}};var kw=Cg("start","end","cancel","interrupt"),Cw=[];function Nw(n,t,e,r,o,i){var u=n.__transition;if(u){if(e in u)return}else n.__transition={};!function(n,t,e){var r,o=n.__transition;function i(c){var l,s,f,d;if(1!==e.state)return a();for(l in o)if((d=o[l]).name===e.name){if(3===d.state)return Sw(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",n,n.__data__,d.index,d.group),delete o[l]):+l<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",n,n.__data__,d.index,d.group),delete o[l])}if(Sw((function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(c))})),e.state=2,e.on.call("start",n,n.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(f=e.tween.length),l=0,s=-1;l<f;++l)(d=e.tween[l].value.call(n,n.__data__,e.index,e.group))&&(r[++s]=d);r.length=s+1}}function u(t){for(var o=t<e.duration?e.ease.call(null,t/e.duration):(e.timer.restart(a),e.state=5,1),i=-1,u=r.length;++i<u;)r[i].call(n,o);5===e.state&&(e.on.call("end",n,n.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete o[t],o)return;delete n.__transition}o[t]=e,e.timer=bw((function(n){e.state=1,e.timer.restart(i,e.delay,e.time),e.delay<=n&&i(n-e.delay)}),0,e.time)}(n,e,{name:t,index:r,group:o,on:kw,tween:Cw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Mw(n,t){var e=jw(n,t);if(e.state>0)throw new Error("too late; already scheduled");return e}function Ow(n,t){var e=jw(n,t);if(e.state>3)throw new Error("too late; already running");return e}function jw(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Iw(n,t){var e,r,o,i=n.__transition,u=!0;if(i){for(o in t=null==t?null:t+"",i)(e=i[o]).name===t?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",n,n.__data__,e.index,e.group),delete i[o]):u=!1;u&&delete n.__transition}}function Pw(n,t){var e,r;return function(){var o=Ow(this,n),i=o.tween;if(i!==e)for(var u=0,a=(r=e=i).length;u<a;++u)if(r[u].name===t){(r=r.slice()).splice(u,1);break}o.tween=r}}function Aw(n,t,e){var r,o;if("function"!=typeof e)throw new Error;return function(){var i=Ow(this,n),u=i.tween;if(u!==r){o=(r=u).slice();for(var a={name:t,value:e},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function zw(n,t,e){var r=n._id;return n.each((function(){var n=Ow(this,r);(n.value||(n.value={}))[t]=e.apply(this,arguments)})),function(n){return jw(n,r).value[t]}}function Lw(n,t){var e;return("number"==typeof t?$m:t instanceof Om?Wm:(e=Om(t))?(t=e,Wm):Km)(n,t)}function Tw(n){return function(){this.removeAttribute(n)}}function Bw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Dw(n,t,e){var r,o,i=e+"";return function(){var u=this.getAttribute(n);return u===i?null:u===r?o:o=t(r=u,e)}}function Rw(n,t,e){var r,o,i=e+"";return function(){var u=this.getAttributeNS(n.space,n.local);return u===i?null:u===r?o:o=t(r=u,e)}}function Vw(n,t,e){var r,o,i;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttribute(n))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=t(r=u,c));this.removeAttribute(n)}}function Hw(n,t,e){var r,o,i;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttributeNS(n.space,n.local))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=t(r=u,c));this.removeAttributeNS(n.space,n.local)}}function Yw(n,t){var e,r;function o(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&function(n,t){return function(e){this.setAttributeNS(n.space,n.local,t.call(this,e))}}(n,o)),e}return o._value=t,o}function Zw(n,t){var e,r;function o(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&function(n,t){return function(e){this.setAttribute(n,t.call(this,e))}}(n,o)),e}return o._value=t,o}function Xw(n,t){return function(){Mw(this,n).delay=+t.apply(this,arguments)}}function Uw(n,t){return t=+t,function(){Mw(this,n).delay=t}}function Fw(n,t){return function(){Ow(this,n).duration=+t.apply(this,arguments)}}function Ww(n,t){return t=+t,function(){Ow(this,n).duration=t}}var $w=Vy.prototype.constructor;function Gw(n){return function(){this.style.removeProperty(n)}}var qw=0;function Kw(n,t,e,r){this._groups=n,this._parents=t,this._name=e,this._id=r}function Qw(){return++qw}var Jw=Vy.prototype;Kw.prototype={constructor:Kw,select:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=Bg(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var a,c,l=r[u],s=l.length,f=i[u]=new Array(s),d=0;d<s;++d)(a=l[d])&&(c=n.call(a,a.__data__,d,l))&&("__data__"in a&&(c.__data__=a.__data__),f[d]=c,Nw(f[d],t,e,d,f,jw(a,e)));return new Kw(i,this._parents,t,e)},selectAll:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=Rg(n));for(var r=this._groups,o=r.length,i=[],u=[],a=0;a<o;++a)for(var c,l=r[a],s=l.length,f=0;f<s;++f)if(c=l[f]){for(var d,h=n.call(c,c.__data__,f,l),v=jw(c,e),p=0,g=h.length;p<g;++p)(d=h[p])&&Nw(d,t,e,p,h,v);i.push(h),u.push(c)}return new Kw(i,u,t,e)},selectChild:Jw.selectChild,selectChildren:Jw.selectChildren,filter:function(n){"function"!=typeof n&&(n=Vg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u=t[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new Kw(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var t=this._groups,e=n._groups,r=t.length,o=e.length,i=Math.min(r,o),u=new Array(r),a=0;a<i;++a)for(var c,l=t[a],s=e[a],f=l.length,d=u[a]=new Array(f),h=0;h<f;++h)(c=l[h]||s[h])&&(d[h]=c);for(;a<r;++a)u[a]=t[a];return new Kw(u,this._parents,this._name,this._id)},selection:function(){return new $w(this._groups,this._parents)},transition:function(){for(var n=this._name,t=this._id,e=Qw(),r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)if(u=a[l]){var s=jw(u,t);Nw(u,n,e,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Kw(r,this._parents,n,e)},call:Jw.call,nodes:Jw.nodes,node:Jw.node,size:Jw.size,empty:Jw.empty,each:Jw.each,on:function(n,t){var e=this._id;return arguments.length<2?jw(this.node(),e).on.on(n):this.each(function(n,t,e){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var t=n.indexOf(".");return t>=0&&(n=n.slice(0,t)),!n||"start"===n}))}(t)?Mw:Ow;return function(){var u=i(this,n),a=u.on;a!==r&&(o=(r=a).copy()).on(t,e),u.on=o}}(e,n,t))},attr:function(n,t){var e=Pg(n),r="transform"===e?ow:Lw;return this.attrTween(n,"function"==typeof t?(e.local?Hw:Vw)(e,r,zw(this,"attr."+n,t)):null==t?(e.local?Bw:Tw)(e):(e.local?Rw:Dw)(e,r,t))},attrTween:function(n,t){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;var r=Pg(n);return this.tween(e,(r.local?Yw:Zw)(r,t))},style:function(n,t,e){var r="transform"==(n+="")?rw:Lw;return null==t?this.styleTween(n,function(n,t){var e,r,o;return function(){var i=ly(this,n),u=(this.style.removeProperty(n),ly(this,n));return i===u?null:i===e&&u===r?o:o=t(e=i,r=u)}}(n,r)).on("end.style."+n,Gw(n)):"function"==typeof t?this.styleTween(n,function(n,t,e){var r,o,i;return function(){var u=ly(this,n),a=e(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=ly(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=t(r=u,a))}}(n,r,zw(this,"style."+n,t))).each(function(n,t){var e,r,o,i,u="style."+t,a="end."+u;return function(){var c=Ow(this,n),l=c.on,s=null==c.value[u]?i||(i=Gw(t)):void 0;l===e&&o===s||(r=(e=l).copy()).on(a,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,t,e){var r,o,i=e+"";return function(){var u=ly(this,n);return u===i?null:u===r?o:o=t(r=u,e)}}(n,r,t),e).on("end.style."+n,null)},styleTween:function(n,t,e){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(n,t,e){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,t,e){return function(r){this.style.setProperty(n,t.call(this,r),e)}}(n,i,e)),r}return i._value=t,i}(n,t,null==e?"":e))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var t=n(this);this.textContent=null==t?"":t}}(zw(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==n)return this.tween(t,null);if("function"!=typeof n)throw new Error;return this.tween(t,function(n){var t,e;function r(){var r=n.apply(this,arguments);return r!==e&&(t=(e=r)&&function(n){return function(t){this.textContent=n.call(this,t)}}(r)),t}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}(this._id))},tween:function(n,t){var e=this._id;if(n+="",arguments.length<2){for(var r,o=jw(this.node(),e).tween,i=0,u=o.length;i<u;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==t?Pw:Aw)(e,n,t))},delay:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?Xw:Uw)(t,n)):jw(this.node(),t).delay},duration:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?Fw:Ww)(t,n)):jw(this.node(),t).duration},ease:function(n){var t=this._id;return arguments.length?this.each(function(n,t){if("function"!=typeof t)throw new Error;return function(){Ow(this,n).ease=t}}(t,n)):jw(this.node(),t).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,t){return function(){var e=t.apply(this,arguments);if("function"!=typeof e)throw new Error;Ow(this,n).ease=e}}(this._id,n))},end:function(){var n,t,e=this,r=e._id,o=e.size();return new Promise((function(i,u){var a={value:u},c={value:function(){0==--o&&i()}};e.each((function(){var e=Ow(this,r),o=e.on;o!==n&&((t=(n=o).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),e.on=t})),0===o&&i()}))},[Symbol.iterator]:Jw[Symbol.iterator]};var nb={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function tb(n,t){for(var e;!(e=n.__transition)||!(e=e[t]);)if(!(n=n.parentNode))throw new Error(`transition ${t} not found`);return e}Vy.prototype.interrupt=function(n){return this.each((function(){Iw(this,n)}))},Vy.prototype.transition=function(n){var t,e;n instanceof Kw?(t=n._id,n=n._name):(t=Qw(),(e=nb).time=yw(),n=null==n?null:n+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)(u=a[l])&&Nw(u,n,t,l,a,e||tb(u,t));return new Kw(r,this._parents,n,t)};var eb=n=>()=>n;function rb(n,{sourceEvent:t,target:e,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function ob(n,t,e){this.k=n,this.x=t,this.y=e}ob.prototype={constructor:ob,scale:function(n){return 1===n?this:new ob(this.k*n,this.x,this.y)},translate:function(n,t){return 0===n&0===t?this:new ob(this.k,this.x+this.k*n,this.y+this.k*t)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ib=new ob(1,0,0);function ub(n){for(;!n.__zoom;)if(!(n=n.parentNode))return ib;return n.__zoom}function ab(n){n.stopImmediatePropagation()}function cb(n){n.preventDefault(),n.stopImmediatePropagation()}function lb(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function sb(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n).hasAttribute("viewBox")?[[(n=n.viewBox.baseVal).x,n.y],[n.x+n.width,n.y+n.height]]:[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]:[[0,0],[n.clientWidth,n.clientHeight]]}function fb(){return this.__zoom||ib}function db(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function hb(){return navigator.maxTouchPoints||"ontouchstart"in this}function vb(n,t,e){var r=n.invertX(t[0][0])-e[0][0],o=n.invertX(t[1][0])-e[1][0],i=n.invertY(t[0][1])-e[0][1],u=n.invertY(t[1][1])-e[1][1];return n.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),u>i?(i+u)/2:Math.min(0,i)||Math.max(0,u))}ub.prototype=ob.prototype;var pb,gb=function(n){return{x:n.x,y:n.y,zoom:n.k}},yb=function(n){var t=n.x,e=n.y,r=n.zoom;return ib.translate(t,e).scale(r)},mb=function(n,t){return n.target.closest(".".concat(t))},wb=function(n,t){return 2===t&&Array.isArray(n)&&n.includes(2)},bb=function(n,t){return void 0===t&&(t=0),"number"==typeof t&&t>0?n.transition().duration(t):n},_b=function(n){var t=n.ctrlKey&&Gv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*t};function xb(n){var t=n.domNode,e=n.minZoom,r=n.maxZoom,o=n.translateExtent,i=n.viewport,u=n.onPanZoom,a=n.onPanZoomStart,c=n.onPanZoomEnd,l=n.onTransformChange,s=n.onDraggingChange,f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=t.getBoundingClientRect(),h=function(){var n,t,e,r=lb,o=sb,i=vb,u=db,a=hb,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=cw,d=Cg("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",fb).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(n,t){return(t=Math.max(c[0],Math.min(c[1],t)))===n.k?n:new ob(t,n.x,n.y)}function y(n,t,e){var r=t[0]-e[0]*n.k,o=t[1]-e[1]*n.k;return r===n.x&&o===n.y?n:new ob(n.k,r,o)}function m(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function w(n,t,e,r){n.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=b(n,i).event(r),a=o.apply(n,i),c=null==e?m(a):"function"==typeof e?e.apply(n,i):e,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=n.__zoom,d="function"==typeof t?t.apply(n,i):t,h=f(s.invert(c).concat(l/s.k),d.invert(c).concat(l/d.k));return function(n){if(1===n)n=d;else{var t=h(n),e=l/t[2];n=new ob(e,c[0]-t[0]*e,c[1]-t[1]*e)}u.zoom(null,n)}}))}function b(n,t,e){return!e&&n.__zooming||new _(n,t)}function _(n,t){this.that=n,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,t),this.taps=0}function x(n,...t){if(r.apply(this,arguments)){var e=b(this,t).event(n),o=this.__zoom,a=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,u.apply(this,arguments)))),s=Yy(n);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=o.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(o.k===a)return;e.mouse=[s,o.invert(s)],Iw(this),e.start()}cb(n),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),150),e.zoom("mouse",i(y(g(o,a),e.mouse[0],e.mouse[1]),e.extent,l))}}function E(n,...t){if(!e&&r.apply(this,arguments)){var o=n.currentTarget,u=b(this,t,!0).event(n),a=Hy(n.view).on("mousemove.zoom",(function(n){if(cb(n),!u.moved){var t=n.clientX-s,e=n.clientY-f;u.moved=t*t+e*e>h}u.event(n).zoom("mouse",i(y(u.that.__zoom,u.mouse[0]=Yy(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),$y(n.view,u.moved),cb(n),u.event(n).end()}),!0),c=Yy(n,o),s=n.clientX,f=n.clientY;Wy(n.view),ab(n),u.mouse=[c,this.__zoom.invert(c)],Iw(this),u.start()}}function S(n,...t){if(r.apply(this,arguments)){var e=this.__zoom,u=Yy(n.changedTouches?n.changedTouches[0]:n,this),a=e.invert(u),c=e.k*(n.shiftKey?.5:2),f=i(y(g(e,c),u,a),o.apply(this,t),l);cb(n),s>0?Hy(this).transition().duration(s).call(w,f,u,n):Hy(this).call(p.transform,f,u,n)}}function k(e,...o){if(r.apply(this,arguments)){var i,u,a,c,l=e.touches,s=l.length,f=b(this,o,e.changedTouches.length===s).event(e);for(ab(e),u=0;u<s;++u)c=[c=Yy(a=l[u],this),this.__zoom.invert(c),a.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!n);n&&(n=clearTimeout(n)),i&&(f.taps<2&&(t=c[0],n=setTimeout((function(){n=null}),500)),Iw(this),f.start())}}function C(n,...t){if(this.__zooming){var e,r,o,u,a=b(this,t).event(n),c=n.changedTouches,s=c.length;for(cb(n),e=0;e<s;++e)o=Yy(r=c[e],this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=o:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=o);if(r=a.that.__zoom,a.touch1){var f=a.touch0[0],d=a.touch0[1],h=a.touch1[0],v=a.touch1[1],p=(p=h[0]-f[0])*p+(p=h[1]-f[1])*p,m=(m=v[0]-d[0])*m+(m=v[1]-d[1])*m;r=g(r,Math.sqrt(p/m)),o=[(f[0]+h[0])/2,(f[1]+h[1])/2],u=[(d[0]+v[0])/2,(d[1]+v[1])/2]}else{if(!a.touch0)return;o=a.touch0[0],u=a.touch0[1]}a.zoom("touch",i(y(r,o,u),a.extent,l))}}function N(n,...r){if(this.__zooming){var o,i,u=b(this,r).event(n),a=n.changedTouches,c=a.length;for(ab(n),e&&clearTimeout(e),e=setTimeout((function(){e=null}),500),o=0;o<c;++o)i=a[o],u.touch0&&u.touch0[2]===i.identifier?delete u.touch0:u.touch1&&u.touch1[2]===i.identifier&&delete u.touch1;if(u.touch1&&!u.touch0&&(u.touch0=u.touch1,delete u.touch1),u.touch0)u.touch0[1]=this.__zoom.invert(u.touch0[0]);else if(u.end(),2===u.taps&&(i=Yy(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<v)){var l=Hy(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return p.transform=function(n,t,e,r){var o=n.selection?n.selection():n;o.property("__zoom",fb),n!==o?w(n,t,e,r):o.interrupt().each((function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},p.scaleBy=function(n,t,e,r){p.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),e,r)},p.scaleTo=function(n,t,e,r){p.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,u=null==e?m(n):"function"==typeof e?e.apply(this,arguments):e,a=r.invert(u),c="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,c),u,a),n,l)}),e,r)},p.translateBy=function(n,t,e,r){p.transform(n,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof e?e.apply(this,arguments):e),o.apply(this,arguments),l)}),null,r)},p.translateTo=function(n,t,e,r,u){p.transform(n,(function(){var n=o.apply(this,arguments),u=this.__zoom,a=null==r?m(n):"function"==typeof r?r.apply(this,arguments):r;return i(ib.translate(a[0],a[1]).scale(u.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof e?-e.apply(this,arguments):-e),n,l)}),r,u)},_.prototype={event:function(n){return n&&(this.sourceEvent=n),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(n,t){return this.mouse&&"mouse"!==n&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var t=Hy(this.that).datum();d.call(n,this.that,new rb(n,{sourceEvent:this.sourceEvent,target:p,type:n,transform:this.that.__zoom,dispatch:d}),t)}},p.wheelDelta=function(n){return arguments.length?(u="function"==typeof n?n:eb(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:eb(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:eb(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:eb([[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]]),p):o},p.scaleExtent=function(n){return arguments.length?(c[0]=+n[0],c[1]=+n[1],p):[c[0],c[1]]},p.translateExtent=function(n){return arguments.length?(l[0][0]=+n[0][0],l[1][0]=+n[1][0],l[0][1]=+n[0][1],l[1][1]=+n[1][1],p):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},p.constrain=function(n){return arguments.length?(i=n,p):i},p.duration=function(n){return arguments.length?(s=+n,p):s},p.interpolate=function(n){return arguments.length?(f=n,p):f},p.on=function(){var n=d.on.apply(d,arguments);return n===d?p:n},p.clickDistance=function(n){return arguments.length?(h=(n=+n)*n,p):Math.sqrt(h)},p.tapDistance=function(n){return arguments.length?(v=+n,p):v},p}().scaleExtent([e,r]).translateExtent(o),v=Hy(t).call(h);w({x:i.x,y:i.y,zoom:Dv(i.zoom,e,r)},[[0,0],[d.width,d.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,t){v&&(null==h||h.transform(bb(v,null==t?void 0:t.duration),n))}function m(){h.on("zoom",null)}function w(n,t,e){var r=yb(n),o=null==h?void 0:h.constrain()(r,t,e);return o&&y(o),o}return h.wheelDelta(_b),{update:function(n){var t=n.noWheelClassName,e=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,d=n.panOnDrag,y=n.panOnScrollMode,w=n.panOnScrollSpeed,b=n.preventScrolling,_=n.zoomOnPinch,x=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!f.isZoomingOrPanning&&m();var C=!i||S||o?function(n){var t=n.noWheelClassName,e=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!e&&"wheel"===n.type&&!n.ctrlKey||mb(n,t))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:t,preventScrolling:b,d3ZoomHandler:p}):function(n){var t=n.zoomPanValues,e=n.noWheelClassName,r=n.d3Selection,o=n.d3Zoom,i=n.panOnScrollMode,u=n.panOnScrollSpeed,a=n.zoomOnPinch,c=n.onPanZoomStart,l=n.onPanZoom,s=n.onPanZoomEnd;return function(n){if(mb(n,e))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=Yy(n),h=_b(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===tp.Vertical?0:n.deltaX*p,y=i===tp.Horizontal?0:n.deltaY*p;!Gv()&&n.shiftKey&&i!==tp.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=gb(r.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling||(t.isPanScrolling=!0,null==c||c(n,m)),t.isPanScrolling&&(null==l||l(n,m),t.panScrollTimeout=setTimeout((function(){null==s||s(n,m),t.isPanScrolling=!1}),150))}}}({zoomPanValues:f,noWheelClassName:t,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:w,zoomOnPinch:_,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var N=function(n){var t=n.zoomPanValues,e=n.onDraggingChange,r=n.onPanZoomStart;return function(n){var o,i,u;if(!(null===(o=n.sourceEvent)||void 0===o?void 0:o.internal)){var a=gb(n.transform);t.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,"mousedown"===(null===(u=n.sourceEvent)||void 0===u?void 0:u.type)&&e(!0),r&&(null==r||r(n.sourceEvent,a))}}}({zoomPanValues:f,onDraggingChange:s,onPanZoomStart:a});h.on("start",N);var M=function(n){var t=n.zoomPanValues,e=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var u,a,c;t.usedRightMouseButton=!(!r||!wb(e,null!==(u=t.mouseButton)&&void 0!==u?u:0)),(null===(a=n.sourceEvent)||void 0===a?void 0:a.sync)||o([n.transform.x,n.transform.y,n.transform.k]),i&&!(null===(c=n.sourceEvent)||void 0===c?void 0:c.internal)&&(null==i||i(n.sourceEvent,gb(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",M);var O=function(n){var t=n.zoomPanValues,e=n.panOnDrag,r=n.panOnScroll,o=n.onDraggingChange,i=n.onPanZoomEnd,u=n.onPaneContextMenu;return function(n){var a,c,l,s;if(!(null===(a=n.sourceEvent)||void 0===a?void 0:a.internal)&&(t.isZoomingOrPanning=!1,u&&wb(e,null!==(c=t.mouseButton)&&void 0!==c?c:0)&&!t.usedRightMouseButton&&n.sourceEvent&&u(n.sourceEvent),t.usedRightMouseButton=!1,o(!1),i&&(l=t.prevViewport,s=n.transform,l.x!==s.x||l.y!==s.y||l.zoom!==s.k))){var f=gb(n.transform);t.prevViewport=f,clearTimeout(t.timerId),t.timerId=setTimeout((function(){null==i||i(n.sourceEvent,f)}),r?150:0)}}}({zoomPanValues:f,panOnDrag:d,panOnScroll:i,onPaneContextMenu:r,onPanZoomEnd:c,onDraggingChange:s});h.on("end",O)}var j=function(n){var t=n.zoomActivationKeyPressed,e=n.zoomOnScroll,r=n.zoomOnPinch,o=n.panOnDrag,i=n.panOnScroll,u=n.zoomOnDoubleClick,a=n.userSelectionActive,c=n.noWheelClassName,l=n.noPanClassName,s=n.lib;return function(n){var f=t||e,d=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(mb(n,"".concat(s,"-flow__node"))||mb(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(mb(n,c)&&"wheel"===n.type)return!1;if(mb(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!t))return!1;if(!r&&n.ctrlKey&&"wheel"===n.type)return!1;if(!f&&!i&&!d&&"wheel"===n.type)return!1;if(!o&&("mousedown"===n.type||"touchstart"===n.type))return!1;if(Array.isArray(o)&&!o.includes(n.button)&&"mousedown"===n.type)return!1;var h=Array.isArray(o)&&o.includes(n.button)||!n.button||n.button<=1;return(!n.ctrlKey||"wheel"===n.type)&&h}}({zoomActivationKeyPressed:S,panOnDrag:d,zoomOnScroll:x,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:_,userSelectionActive:o,noPanClassName:e,noWheelClassName:t,lib:k});h.filter(j),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,t){var e=yb(n);return y(e,t),e},setViewportConstrained:w,getViewport:function(){var n=v?ub(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,t){v&&(null==h||h.scaleTo(bb(v,null==t?void 0:t.duration),n))},scaleBy:function(n,t){v&&(null==h||h.scaleBy(bb(v,null==t?void 0:t.duration),n))},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var t=yb(n),e=v.property("__zoom");e.k===n.zoom&&e.x===n.x&&e.y===n.y||null==h||h.transform(v,t,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(pb||(pb={}));U(U({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var Eb=mv();function Sb(n,t){var r=e(Z);if(null===r)throw new Error(Eb);return H(r,n,t)}function kb(){var n=e(Z);if(null===n)throw new Error(Eb);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}function Cb(n,t){var e,r,o;void 0===t&&(t={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var i=(null==t?void 0:t.elevateNodesOnSelect)?1e3:0;try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=c.parentId;if(l){if(!n.has(l))throw new Error("Parent node ".concat(l," not found"));var s=n.get(l),f=Nb(c,n,d(d({},c.position),{z:(Lb(c.zIndex)?c.zIndex:0)+(c.selected?i:0)}),null!==(o=null==s?void 0:s.origin)&&void 0!==o?o:t.nodeOrigin),h=f.x,v=f.y,p=f.z,m=c.internals.positionAbsolute,w=h!==m.x||v!==m.y;(w||p!==c.internals.z)&&(c.internals=d(d({},c.internals),{positionAbsolute:w?{x:h,y:v}:m,z:p}))}}}catch(n){e={error:n}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}function Nb(n,t,e,r){var o,i,u,a,c,l;if(void 0===r&&(r=[0,0]),!n.parentId)return e;var s=t.get(n.parentId),f=Mb(s,r).position;return Nb(s,t,{x:(null!==(o=e.x)&&void 0!==o?o:0)+f.x,y:(null!==(i=e.y)&&void 0!==i?i:0)+f.y,z:(null!==(u=s.internals.z)&&void 0!==u?u:0)>(null!==(a=e.z)&&void 0!==a?a:0)?null!==(c=s.internals.z)&&void 0!==c?c:0:null!==(l=e.z)&&void 0!==l?l:0},s.origin||r)}var Mb=function(n,t){void 0===t&&(t=[0,0]);var e=zb(n),r=e.width,o=e.height,i=("internals"in n?n.internals.positionAbsolute:n.position)||{x:0,y:0},u=n.origin||t,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}};function Ob(n,t,e){var r,o;n.clear(),t.clear();try{for(var i=g(e),u=i.next();!u.done;u=i.next()){var a=u.value,c=a.source,l=a.target,s=a.sourceHandle,f=void 0===s?null:s,d=a.targetHandle,h=void 0===d?null:d,v="".concat(c,"-source-").concat(f),p="".concat(l,"-target-").concat(h),y=n.get(v)||new Map,m=n.get(p)||new Map,w={edgeId:a.id,source:c,target:l,sourceHandle:f,targetHandle:h};t.set(a.id,a),n.set(v,y.set("".concat(l,"-").concat(h),w)),n.set(p,m.set("".concat(c,"-").concat(f),w))}}catch(n){r={error:n}}finally{try{u&&!u.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}function jb(n,t,e,r){void 0===r&&(r={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var o=new Map(t);t.clear(),e.clear();var i=(null==r?void 0:r.elevateNodesOnSelect)?1e3:0;n.forEach((function(n){var u,a,c,l,s=o.get(n.id);if(r.checkEquality&&n===(null==s?void 0:s.internals.userNode)||(s=d(d(d({},r.defaults),n),{measured:{width:null!==(a=null===(u=n.measured)||void 0===u?void 0:u.width)&&void 0!==a?a:0,height:null!==(l=null===(c=n.measured)||void 0===c?void 0:c.height)&&void 0!==l?l:0},internals:{positionAbsolute:n.position||{x:0,y:0},handleBounds:null==s?void 0:s.internals.handleBounds,z:(Lb(n.zIndex)?n.zIndex:0)+(n.selected?i:0),userNode:n}})),t.set(n.id,s),n.parentId){var f=e.get(n.parentId);f?f.push(s):e.set(n.parentId,[s])}})),e.size>0&&Cb(t,r)}function Ib(n,t,e,r){var o,i,u,a,c,l=[],s=new Map;try{for(var f=g(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=t.get(h.parentId);if(v){var p=null!==(a=null===(u=s.get(h.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:Db(v,null!==(c=v.origin)&&void 0!==c?c:r),y=Yb(p,h.rect);s.set(h.parentId,{expandedRect:y,parent:v})}}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return s.size>0&&s.forEach((function(t,r){var o=t.expandedRect,i=t.parent,u=Mb(i,i.origin).position,a=zb(i),c=o.x<u.x?Math.round(Math.abs(u.x-o.x)):0,s=o.y<u.y?Math.round(Math.abs(u.y-o.y)):0;if(c>0||s>0){l.push({id:r,type:"position",position:{x:u.x-c,y:u.y-s}});var f=e.get(r);null==f||f.forEach((function(t){n.some((function(n){return n.id===t.id}))||l.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+s}})}))}(a.width<o.width||a.height<o.height)&&l.push({id:r,type:"dimensions",setAttributes:!0,dimensions:{width:Math.max(a.width,Math.round(o.width)),height:Math.max(a.height,Math.round(o.height))}})})),l}var Pb=function(n,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),Math.min(Math.max(n,t),e)},Ab=function(n,t){return void 0===n&&(n={x:0,y:0}),{x:Pb(n.x,t[0][0],t[1][0]),y:Pb(n.y,t[0][1],t[1][1])}};function zb(n){var t,e,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var Lb=function(n){return!isNaN(n)&&isFinite(n)},Tb=function(n,t){return void 0===t&&(t=[1,1]),{x:t[0]*Math.round(n.x/t[0]),y:t[1]*Math.round(n.y/t[1])}},Bb=function(n,t,e,r){var o=n.x,i=n.y,u=y(t,3),a=u[0],c=u[1],l=u[2];void 0===e&&(e=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return e?Tb(s,r):s},Db=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=Mb(n,t).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0,height:null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0}},Rb=function(n,t){return{x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x2,t.x2),y2:Math.max(n.y2,t.y2)}},Vb=function(n){var t=n.x,e=n.y;return{x:t,y:e,x2:t+n.width,y2:e+n.height}},Hb=function(n){var t=n.x,e=n.y;return{x:t,y:e,width:n.x2-t,height:n.y2-e}},Yb=function(n,t){return Hb(Rb(Vb(n),Vb(t)))};function Zb(n){return o(n)}var Xb=function(n,t){var e=Math.max(0,Math.min(n.x+n.width,t.x+t.width)-Math.max(n.x,t.x)),r=Math.max(0,Math.min(n.y+n.height,t.y+t.height)-Math.max(n.y,t.y));return Math.ceil(e*r)},Ub=function(n,t,e,r,o,i){var u=t/(n.width*(1+i)),a=e/(n.height*(1+i)),c=Math.min(u,a),l=Pb(c,r,o);return{x:t/2-(n.x+n.width/2)*l,y:e/2-(n.y+n.height/2)*l,zoom:l}};function Fb(n){return void 0!==n&&"parent"!==n}var Wb=function(n){return $b(n)},$b=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};var Gb=function(n){return Lb(n.width)&&Lb(n.height)&&Lb(n.x)&&Lb(n.y)},qb=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},Kb=["INPUT","SELECT","TEXTAREA"];function Qb(n){var t,e,r=(null===(e=null===(t=n.composedPath)||void 0===t?void 0:t.call(n))||void 0===e?void 0:e[0])||n.target;return Kb.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var Jb=function(n){return"clientX"in n},n_=function(n,t){var e,r,o,i,u=Jb(n),a=u?n.clientX:null===(e=n.touches)||void 0===e?void 0:e[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==t?void 0:t.left)&&void 0!==o?o:0),y:c-(null!==(i=null==t?void 0:t.top)&&void 0!==i?i:0)}},t_=function(n,t,e,r){void 0===r&&(r=[0,0]);var o=t.querySelectorAll(n);if(!o||!o.length)return null;var i=Array.from(o),u=t.getBoundingClientRect(),a=u.width*r[0],c=u.height*r[1];return i.map((function(n){var t=n.getBoundingClientRect();return d({id:n.getAttribute("data-handleid"),position:n.getAttribute("data-handlepos"),x:(t.left-u.left-a)/e,y:(t.top-u.top-c)/e},qb(n))}))},e_="undefined"!=typeof document?document:null;function r_(n,t){void 0===n&&(n=null),void 0===t&&(t={target:e_,actInsideInputWithModifier:!0});var e=y(i(!1),2),o=e[0],c=e[1],l=u(!1),s=u(new Set([])),f=y(r((function(){if(null!==n){var t=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),e=t.reduce((function(n,t){return n.concat.apply(n,m([],y(t),!1))}),[]);return[t,e]}return[[],[]]}),[n]),2),d=f[0],h=f[1];return a((function(){var e=(null==t?void 0:t.target)||e_;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!t.actInsideInputWithModifier)&&Qb(n))return!1;var e=i_(n.code,h);s.current.add(n[e]),o_(d,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!t.actInsideInputWithModifier)&&Qb(n))return!1;var e=i_(n.code,h);o_(d,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[e]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==e||e.addEventListener("keydown",r),null==e||e.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==e||e.removeEventListener("keydown",r),null==e||e.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function o_(n,t,e){return n.filter((function(n){return e||n.length===t.size})).some((function(n){return n.every((function(n){return t.has(n)}))}))}function i_(n,t){return t.includes(n)?"code":"key"}function u_(n,t){if(Object.is(n,t))return!0;if("object"!=typeof n||null===n||"object"!=typeof t||null===t)return!1;if(n instanceof Map&&t instanceof Map){if(n.size!==t.size)return!1;for(const[e,r]of n)if(!Object.is(r,t.get(e)))return!1;return!0}if(n instanceof Set&&t instanceof Set){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}const e=Object.keys(n);if(e.length!==Object.keys(t).length)return!1;for(const r of e)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(n[r],t[r]))return!1;return!0}var a_={position:"absolute",width:"100%",height:"100%",top:0,left:0};var c_=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function l_(n){var t=n.onPaneContextMenu,e=n.zoomOnScroll,r=void 0===e||e,o=n.zoomOnPinch,i=void 0===o||o,c=n.panOnScroll,l=void 0!==c&&c,s=n.panOnScrollSpeed,f=void 0===s?.5:s,d=n.panOnScrollMode,h=void 0===d?tp.Free:d,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,b=n.zoomActivationKeyCode,_=n.preventScrolling,x=void 0===_||_,E=n.children,S=n.noWheelClassName,C=n.noPanClassName,N=n.onViewportChange,M=n.isControlledViewport,O=kb(),j=u(null),I=Sb(c_,u_),P=I.userSelectionActive,A=I.lib,z=r_(b),L=u();return function(n){var t=kb();a((function(){var e=function(){var e,r;if(!n.current)return!1;var o=qb(n.current);0!==o.height&&0!==o.width||null===(r=(e=t.getState()).onError)||void 0===r||r.call(e,"004",bv()),t.setState({width:o.width||500,height:o.height||500})};if(n.current){e(),window.addEventListener("resize",e);var r=new ResizeObserver((function(){return e()}));return r.observe(n.current),function(){window.removeEventListener("resize",e),r&&n.current&&r.unobserve(n.current)}}}),[])}(j),a((function(){if(j.current){var n=O.getState();L.current=xb({domNode:j.current,minZoom:n.minZoom,maxZoom:n.maxZoom,translateExtent:w,viewport:m,onTransformChange:function(n){null==N||N({x:n[0],y:n[1],zoom:n[2]}),M||O.setState({transform:n})},onDraggingChange:function(n){return O.setState({paneDragging:n})},onPanZoomStart:function(n,t){var e=O.getState(),r=e.onViewportChangeStart,o=e.onMoveStart;null==o||o(n,t),null==r||r(t)},onPanZoom:function(n,t){var e=O.getState(),r=e.onViewportChange,o=e.onMove;null==o||o(n,t),null==r||r(t)},onPanZoomEnd:function(n,t){var e=O.getState(),r=e.onViewportChangeEnd,o=e.onMoveEnd;null==o||o(n,t),null==r||r(t)}});var t=L.current.getViewport(),e=t.x,r=t.y,o=t.zoom;return O.setState({panZoom:L.current,transform:[e,r,o],domNode:j.current.closest(".ink-flow")}),function(){var n;null===(n=L.current)||void 0===n||n.destroy()}}}),[]),a((function(){var n;null===(n=L.current)||void 0===n||n.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:f,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:x,noPanClassName:C,userSelectionActive:P,noWheelClassName:S,lib:A})}),[t,r,i,l,f,h,p,y,z,x,C,P,S,A]),k.jsx("div",{className:"ink-flow__renderer",ref:j,style:a_,children:E})}var s_={actInsideInputWithModifier:!1};function f_(n,t){switch(n.type){case"select":t.selected=n.selected;break;case"position":void 0!==n.position&&(t.position=n.position),void 0!==n.dragging&&(t.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(t.measured={width:n.dimensions.width,height:n.dimensions.height},n.setAttributes&&(t.width=n.dimensions.width,t.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(t.resizing=n.resizing)}}function d_(n,t){var e,r,o,i,u,a,c=[],l=new Map;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){if("add"!==(x=f.value).type)if("remove"===x.type||"replace"===x.type)l.set(x.id,[x]);else{var h=l.get(x.id);h?h.push(x):l.set(x.id,[x])}else c.push(x.item)}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}try{for(var v=g(t),p=v.next();!p.done;p=v.next()){var y=p.value,m=l.get(y.id);if(m){if("remove"!==m[0].type)if("replace"!==m[0].type){var w=d({},y);try{for(var b=(u=void 0,g(m)),_=b.next();!_.done;_=b.next()){var x;f_(x=_.value,w)}}catch(n){u={error:n}}finally{try{_&&!_.done&&(a=b.return)&&a.call(b)}finally{if(u)throw u.error}}c.push(w)}else c.push(d({},m[0].item))}else c.push(y)}}catch(n){o={error:n}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return c}function h_(n,t){return{id:n,type:"select",selected:t}}function v_(n,t,e){var r,o;void 0===t&&(t=new Set),void 0===e&&(e=!1);var i=[];try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2),l=c[0],s=c[1],f=t.has(l);void 0===s.selected&&!f||s.selected===f||(e&&(s.selected=f),i.push(h_(s.id,f)))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i}function p_(n){var t,e,r,o,i,u,a=n.items,c=void 0===a?[]:a,l=n.lookup,s=[],f=new Map(c.map((function(n){return[n.id,n]})));try{for(var d=g(c),h=d.next();!h.done;h=d.next()){var v=h.value,p=l.get(v.id),m=null!==(u=null===(i=null==p?void 0:p.internals)||void 0===i?void 0:i.userNode)&&void 0!==u?u:p;void 0!==m&&m!==v&&s.push({id:v.id,item:v,type:"replace"}),void 0===m&&s.push({item:v,type:"add"})}}catch(n){t={error:n}}finally{try{h&&!h.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}try{for(var w=g(l),b=w.next();!b.done;b=w.next()){var _=y(b.value,1)[0];void 0===f.get(_)&&s.push({id:_,type:"remove"})}}catch(n){r={error:n}}finally{try{b&&!b.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}function g_(n){return{id:n.id,type:"remove"}}var y_=function(n,t){void 0===t&&(t=[0,0]);var e=zb(n),r=e.width,o=e.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||t,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},m_=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var e=n.reduce((function(n,e){var r=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=Mb(n,t).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}}(e,t.nodeOrigin);return Rb(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hb(e)},w_=function(n,t,e,r,o,i){var u,a,c,l,s,f,h,v,p=y(void 0===e?[0,0,1]:e,3),m=p[0],w=p[1],b=p[2];void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=[0,0]);var _=d(d({},Bb(t,[m,w,b])),{width:t.width/b,height:t.height/b}),x=[];try{for(var E=g(n),S=E.next();!S.done;S=E.next()){var k=y(S.value,2)[1],C=k.measured,N=k.selectable,M=void 0===N||N,O=k.hidden,j=void 0!==O&&O,I=null!==(s=null!==(l=null!==(c=C.width)&&void 0!==c?c:k.width)&&void 0!==l?l:k.initialWidth)&&void 0!==s?s:null,P=null!==(v=null!==(h=null!==(f=C.height)&&void 0!==f?f:k.height)&&void 0!==h?h:k.initialHeight)&&void 0!==v?v:null;if(!(o&&!M||j)){var A=Xb(_,Db(k,i));(null===I||null===P||r&&A>0||A>=(null!=I?I:0)*(null!=P?P:0)||k.dragging)&&x.push(k)}}}catch(n){u={error:n}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(u)throw u.error}}return x};function b_(n,t){var e,r,o,i=n.nodeLookup,u=n.width,a=n.height,c=n.panZoom,l=n.minZoom,s=n.maxZoom,f=n.nodeOrigin,d=void 0===f?[0,0]:f,h=[],v=(null==t?void 0:t.nodes)?new Set(t.nodes.map((function(n){return n.id}))):null;if(i.forEach((function(n){!(n.measured.width&&n.measured.height&&((null==t?void 0:t.includeHiddenNodes)||!n.hidden))||v&&!v.has(n.id)||h.push(n)})),h.length>0){var p=m_(h,{nodeOrigin:d}),g=p.width>=u||p.height>=a;if("overflow"===(null==t?void 0:t.when)&&!g)return!0;var y=Ub(p,u,a,null!==(e=null==t?void 0:t.minZoom)&&void 0!==e?e:l,null!==(r=null==t?void 0:t.maxZoom)&&void 0!==r?r:s,null!==(o=null==t?void 0:t.padding)&&void 0!==o?o:.1);return c.setViewport(y,{duration:null==t?void 0:t.duration}),!0}return!1}function __(n){var t=n.nodeId,e=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(t),l=c.parentId?r.get(c.parentId):void 0,s=l?y_(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,t){var e,r,o,i;return t&&"parent"!==t?[t[0],[t[1][0]-(null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:0),t[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:t}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Fb(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,w=f+v*m[0],b=d+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==a||a("005",_v());var _=Fb(h)?Ab(e,h):e;return{position:{x:_.x-f,y:_.y-d},positionAbsolute:_}}function x_(n){return v(this,arguments,void 0,(function(n){var t,e,r,o,i,u,a,c,l,s,f,d,h,v,y,m,w,b,_,x=n.nodesToRemove,E=void 0===x?[]:x,S=n.edgesToRemove,k=void 0===S?[]:S,C=n.nodes,N=n.edges,M=n.onBeforeDelete;return p(this,(function(n){switch(n.label){case 0:t=new Set(E.map((function(n){return n.id}))),e=[],r=function(n){if(!1===n.deletable)return"continue";var r=t.has(n.id),o=!r&&n.parentId&&e.find((function(t){return t.id===n.parentId}));(r||o)&&e.push(n)};try{for(o=g(C),i=o.next();!i.done;i=o.next())u=i.value,r(u)}catch(n){m={error:n}}finally{try{i&&!i.done&&(w=o.return)&&w.call(o)}finally{if(m)throw m.error}}a=new Set(k.map((function(n){return n.id}))),c=N.filter((function(n){return!1!==n.deletable})),l=function(n,t){var e=new Set;return n.forEach((function(n){e.add(n.id)})),t.filter((function(n){return e.has(n.source)||e.has(n.target)}))}(e,c),s=l,f=function(n){a.has(n.id)&&!s.find((function(t){return t.id===n.id}))&&s.push(n)};try{for(d=g(c),h=d.next();!h.done;h=d.next())v=h.value,f(v)}catch(n){b={error:n}}finally{try{h&&!h.done&&(_=d.return)&&_.call(d)}finally{if(b)throw b.error}}return M?[4,M({nodes:e,edges:s})]:[2,{edges:s,nodes:e}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:e}:{edges:[],nodes:[]}]:[2,y]}}))}))}var E_=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function S_(){var n=Sb(E_,u_),t=n.userSelectionActive,e=n.userSelectionRect;return t&&e?k.jsx("div",{className:"ink-flow__selection ink-flow__container",style:{width:e.width,height:e.height,transform:"translate(".concat(e.x,"px, ").concat(e.y,"px)")}}):null}var k_=function(n,t){return function(e){e.target===t.current&&(null==n||n(e))}},C_=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function N_(n){var t=n.isSelecting;n.selectionMode;var e=n.panOnDrag,r=n.onSelectionStart,o=n.onSelectionEnd,i=n.onPaneClick,a=n.onPaneContextMenu,c=n.onPaneScroll,l=n.onPaneMouseEnter,s=n.onPaneMouseMove,f=n.onPaneMouseLeave,d=n.children,h=u(null),v=kb(),p=u(0),m=u(0),w=u(),b=u(new Map),_=Sb(C_,u_),x=_.userSelectionActive,E=_.elementsSelectable,S=_.dragging,C=function(){v.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},N=function(n){null==i||i(n),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},M=c?function(n){return c(n)}:void 0,O=E&&(t||x);return k.jsxs("div",{className:j(["ink-flow__pane",{draggable:e,dragging:S,selection:t}]),onClick:O?void 0:k_(N,h),onContextMenu:k_((function(n){Array.isArray(e)&&(null==e?void 0:e.includes(2))?n.preventDefault():null==a||a(n)}),h),onWheel:k_(M,h),onMouseEnter:O?void 0:l,onMouseDown:O?function(n){var e,o,i,u,a=v.getState(),c=a.resetSelectedElements,l=a.domNode,s=a.edgeLookup;if(w.current=null==l?void 0:l.getBoundingClientRect(),E&&t&&0===n.button&&n.target===h.current&&w.current){b.current=new Map;try{for(var f=g(s),d=f.next();!d.done;d=f.next()){var p=y(d.value,2),m=p[0],_=p[1];b.current.set(_.source,(null===(i=b.current.get(_.source))||void 0===i?void 0:i.add(m))||new Set([m])),b.current.set(_.target,(null===(u=b.current.get(_.target))||void 0===u?void 0:u.add(m))||new Set([m]))}}catch(n){e={error:n}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(e)throw e.error}}var x=n_(n.nativeEvent,w.current),S=x.x,k=x.y;c(),v.setState({userSelectionRect:{width:0,height:0,startX:S,startY:k,x:S,y:k}}),null==r||r(n)}}:void 0,onMouseMove:O?function(n){var e,r,o,i,u=v.getState(),a=u.userSelectionRect,c=u.edgeLookup,l=u.transform,s=u.nodeOrigin,f=u.nodeLookup,d=u.triggerNodeChanges,h=u.triggerEdgeChanges;if(t&&w.current&&a){var y=n_(n.nativeEvent,w.current),_=y.x,x=y.y,E=a.startX,S=a.startY,k={startX:E,startY:S,x:_<E?_:E,y:x<S?x:S,width:Math.abs(_-E),height:Math.abs(x-S)},C=w_(f,k,l,!1,!0,s),N=new Set,M=new Set;try{for(var O=g(C),j=O.next();!j.done;j=O.next()){var I=j.value;M.add(I.id);var P=b.current.get(I.id);if(P)try{for(var A=(o=void 0,g(P)),z=A.next();!z.done;z=A.next()){var L=z.value;N.add(L)}}catch(n){o={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(n){e={error:n}}finally{try{j&&!j.done&&(r=O.return)&&r.call(O)}finally{if(e)throw e.error}}if(p.current!==M.size)p.current=M.size,d(v_(f,M,!0));if(m.current!==N.size)m.current=N.size,h(v_(c,N));v.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:s,onMouseUp:O?function(n){if(0===n.button){var t=v.getState().userSelectionRect;!x&&t&&n.target===h.current&&(null==N||N(n)),v.setState({nodesSelectionActive:p.current>0}),C(),null==o||o(n)}}:void 0,onMouseLeave:O?function(n){x&&(v.setState({nodesSelectionActive:p.current>0}),null==o||o(n)),C()}:f,ref:h,style:a_,children:[d,k.jsx(S_,{})]})}var M_=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function O_(n){var t=n.children,e=n.onPaneClick,r=n.onPaneMouseEnter,o=n.onPaneMouseMove,i=n.onPaneMouseLeave,u=n.onPaneContextMenu,c=n.onPaneScroll,l=n.deleteKeyCode,s=n.selectionKeyCode,f=n.selectionOnDrag,d=n.selectionMode,h=n.onSelectionStart,v=n.onSelectionEnd,p=n.multiSelectionKeyCode,g=n.panActivationKeyCode,y=n.zoomActivationKeyCode,m=n.elementsSelectable,w=n.zoomOnScroll,b=n.zoomOnPinch,_=n.panOnScroll,x=n.panOnScrollSpeed,E=n.panOnScrollMode,S=n.zoomOnDoubleClick,C=n.panOnDrag,N=n.defaultViewport,M=n.translateExtent,O=n.minZoom,j=n.maxZoom,I=n.preventScrolling;n.onSelectionContextMenu;var P=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,L=n.isControlledViewport,T=Sb(M_);T.nodesSelectionActive;var B=T.userSelectionActive,D=r_(s),R=r_(g),V=R||C,H=R||_,Y=D||B||f&&!0!==V;return function(n){var t=n.deleteKeyCode,e=n.multiSelectionKeyCode,r=kb(),o=r_(t,s_),i=r_(e);a((function(){if(o){var n=r.getState();n.edges,n.nodes,r.setState({nodesSelectionActive:!1})}}),[o]),a((function(){r.setState({multiSelectionActive:i})}),[i])}({deleteKeyCode:l,multiSelectionKeyCode:p}),k.jsx(l_,{onPaneContextMenu:u,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:x,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!D&&V,defaultViewport:N,translateExtent:M,minZoom:O,maxZoom:j,zoomActivationKeyCode:y,preventScrolling:I,noWheelClassName:P,noPanClassName:A,onViewportChange:z,isControlledViewport:L,children:k.jsx(N_,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:d,children:t})})}O_.displayName="FlowRenderer";var j_=c(O_);function I_(n){var t=y(i(n),2);return[t[0],t[1]]}function P_(n){var t=y(i(n),2);return[t[0],t[1]]}var A_="undefined"!=typeof window?l:a;function z_(n){var t=y(i(!1),2),e=t[0],r=t[1],o=y(i((function(){return function(n){var t=[];return{get:function(){return t},reset:function(){t=[]},push:function(e){t.push(e),n()}}}((function(){return r(!0)}))})),1),u=o[0];return A_((function(){if(e){var t=u.get();t.length&&(n(t),u.reset()),r(!1)}else u.reset()}),[e]),u}var L_=t(null);function T_(n){var t=n.children,e=kb(),o=s((function(n){var t,r,o=e.getState(),i=o.nodes,u=void 0===i?[]:i,a=o.onNodesChange,c=o.nodeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}a&&a({changes:p_({items:l,lookup:c}),userNodes:l})}),[]),i=z_(o),u=s((function(n){var t,r,o=e.getState(),i=o.edges,u=void 0===i?[]:i,a=o.onEdgesChange,c=o.edgeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}a&&a({changes:p_({items:l,lookup:c}),userEdges:l})}),[]),a=z_(u),c=r((function(){return{nodeQueue:i,edgeQueue:a}}),[]);return k.jsx(L_.Provider,{value:c,children:t})}var B_=function(){var n=kb();return r((function(){return{zoomIn:function(t){var e;return null===(e=n.getState().panZoom)||void 0===e?void 0:e.scaleBy(1.2,{duration:null==t?void 0:t.duration})},zoomOut:function(t){var e;return null===(e=n.getState().panZoom)||void 0===e?void 0:e.scaleBy(1/1.2,{duration:null==t?void 0:t.duration})},zoomTo:function(t,e){var r;return null===(r=n.getState().panZoom)||void 0===r?void 0:r.scaleTo(t,{duration:null==e?void 0:e.duration})},getZoom:function(){return n.getState().transform[2]},setViewport:function(t,e){var r,o,i,u=n.getState(),a=y(u.transform,3),c=a[0],l=a[1],s=a[2],f=u.panZoom;null==f||f.setViewport({x:null!==(r=t.x)&&void 0!==r?r:c,y:null!==(o=t.y)&&void 0!==o?o:l,zoom:null!==(i=t.zoom)&&void 0!==i?i:s},{duration:null==e?void 0:e.duration})},getViewport:function(){var t=y(n.getState().transform,3);return{x:t[0],y:t[1],zoom:t[2]}},fitView:function(t){var e=n.getState(),r=e.nodeLookup,o=e.width,i=e.height,u=e.nodeOrigin,a=e.minZoom,c=e.maxZoom,l=e.panZoom;return!!l&&b_({nodeLookup:r,width:o,height:i,nodeOrigin:u,minZoom:a,maxZoom:c,panZoom:l},t)},setCenter:function(t,e,r){var o=n.getState(),i=o.width,u=o.height,a=o.panZoom,c=o.transform,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:c[2],s=i/2-t*l,f=u/2-e*l;null==a||a.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(t,e){var r,o=n.getState(),i=o.width,u=o.height,a=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Ub(t,i,u,a,c,null!==(r=null==e?void 0:e.padding)&&void 0!==r?r:.1);null==l||l.setViewport(s,{duration:null==e?void 0:e.duration})},screenToFlowPosition:function(t,e){void 0===e&&(e={snapToGrid:!0});var r=n.getState(),o=r.transform,i=r.snapGrid,u=r.domNode;if(!u)return t;var a=u.getBoundingClientRect(),c=a.x,l=a.y,s={x:t.x-c,y:t.y-l};return Bb(s,o,e.snapToGrid,i)},flowToScreenPosition:function(t){var e=n.getState(),r=e.transform,o=e.domNode;if(!o)return t;var i=o.getBoundingClientRect(),u=i.x,a=i.y,c=function(n,t){var e=n.x,r=n.y,o=y(t,3),i=o[0],u=o[1],a=o[2];return{x:e*a+i,y:r*a+u}}(t,r);return{x:c.x+u,y:c.y+a}}}}),[])},D_=function(n){return!!n.panZoom};function R_(){var n=this,t=B_(),o=kb(),i=function(){var n=e(L_);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),u=Sb(D_);console.log("yk store",o.getState());var a=r((function(){var t=function(n){return o.getState().nodeLookup.get(n)},e=function(n){i.nodeQueue.push(n)},r=function(n){var t,e,r,i,u=o.getState(),a=u.nodeLookup,c=u.nodeOrigin,l=Wb(n)?n:a.get(n.id),s=l.parentId?function(n,t,e,r){var o,i;void 0===r&&(r=[0,0]);for(var u=t,a=d({},n);u;){var c=e.get(t);if(u=null==c?void 0:c.parentId,c){var l=c.origin||r,s=(null!==(o=c.measured.width)&&void 0!==o?o:0)*l[0],f=(null!==(i=c.measured.height)&&void 0!==i?i:0)*l[1];a.x+=c.position.x-s,a.y+=c.position.y-f}}return a}(l.position,l.parentId,a,c):l.position,f={id:l.id,position:s,width:null!==(e=null===(t=l.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:l.width,height:null!==(i=null===(r=l.measured)||void 0===r?void 0:r.height)&&void 0!==i?i:l.height,data:l.data};return Db(f)},u=function(n,t,r){void 0===r&&(r={replace:!1}),e((function(e){return e.map((function(e){if(e.id===n){var o="function"==typeof t?t(e):t;return r.replace&&Wb(o)?o:d(d({},e),o)}return e}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var e;return null===(e=t(n))||void 0===e?void 0:e.internals.userNode},getInternalNode:t,getEdges:function(){var n=o.getState().edges;return(void 0===n?[]:n).map((function(n){return d({},n)}))},getEdge:function(n){return o.getState().edgeLookup.get(n)},setNodes:e,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var t=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return m(m([],y(n),!1),y(t),!1)}))},addEdges:function(n){var t=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return m(m([],y(n),!1),y(t),!1)}))},toObject:function(){var n=o.getState(),t=n.nodes,e=void 0===t?[]:t,r=n.edges,i=void 0===r?[]:r,u=y(n.transform,3),a=u[0],c=u[1],l=u[2];return{nodes:e.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:a,y:c,zoom:l}}},deleteElements:function(t){return v(n,[t],void 0,(function(n){var t,e,r,i,u,a,c,l,s,f,d,h,v,g,y,m,w=n.nodes,b=void 0===w?[]:w,_=n.edges,x=void 0===_?[]:_;return p(this,(function(n){switch(n.label){case 0:return t=o.getState(),e=t.nodes,r=t.edges,i=t.onNodesDelete,u=t.onEdgesDelete,a=t.triggerNodeChanges,c=t.triggerEdgeChanges,l=t.onDelete,s=t.onBeforeDelete,[4,x_({nodesToRemove:b,edgesToRemove:x,nodes:e,edges:r,onBeforeDelete:s})];case 1:return f=n.sent(),d=f.nodes,h=f.edges,v=h.length>0,g=d.length>0,v&&(y=h.map(g_),null==u||u(h),c(y)),g&&(m=d.map(g_),null==i||i(d),a(m)),(g||v)&&(null==l||l({nodes:d,edges:h})),[2,{deletedNodes:d,deletedEdges:h}]}}))}))},getIntersectingNodes:function(n,t,e){void 0===t&&(t=!0);var i=Gb(n),u=i?n:r(n),a=void 0!==e;return u?(e||o.getState().nodes).filter((function(e){var r=o.getState().nodeLookup.get(e.id);if(r&&!i&&(e.id===n.id||!r.internals.positionAbsolute))return!1;var c=Db(a?e:r),l=Xb(c,u);return t&&l>0||l>=u.width*u.height})):[]},isNodeIntersecting:function(n,t,e){void 0===e&&(e=!0);var o=Gb(n)?n:r(n);if(!o)return!1;var i=Xb(o,t);return e&&i>0||i>=o.width*o.height},updateNode:u,updateNodeData:function(n,t,e){void 0===e&&(e={replace:!1}),u(n,(function(n){var r="function"==typeof t?t(n):t;return e.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),e)},setLayoutAnchorId:function(n){o.getState().setLayoutAnchorId(n)}}}),[]);return r((function(){return d(d(d({},a),t),{viewportInitialized:u})}),[u])}var V_=function(n){return n.updateNodeInternals};function H_(n){var t=Sb(s(function(n){return function(t){return n?w_(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map((function(n){return n.id})):Array.from(t.nodeLookup.keys())}}(n),[n]),u_);return t}var Y_=t(null),Z_=Y_.Provider;Y_.Consumer;function X_(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*t+.375*i+.375*n.targetControlX+.125*r,c=.125*e+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-t),Math.abs(c-e)]}function U_(n,t){return n>=0?.5*n:25*t*Math.sqrt(-n)}function F_(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(t){case ip.Left:return[e-U_(e-o,u),r];case ip.Right:return[e+U_(o-e,u),r];case ip.Top:return[e,r-U_(r-i,u)];case ip.Bottom:return[e,r+U_(i-r,u)]}}function W_(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-t)/2,u=r<t?r+i:r-i,a=Math.abs(o-e)/2;return[u,o<e?o+a:o-a,i,a]}var $_,G_=function(n){var t=n.source,e=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(t).concat(e||"","-").concat(r).concat(o||"")};var q_=(($_={})[ip.Left]={x:-1,y:0},$_[ip.Right]={x:1,y:0},$_[ip.Top]={x:0,y:-1},$_[ip.Bottom]={x:0,y:1},$_),K_=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};function Q_(n){var t,e,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?ip.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?ip.Top:l,f=n.center,d=n.offset,h=q_[a],v=q_[s],p={x:i.x+h.x*d,y:i.y+h.y*d},g={x:c.x+v.x*d,y:c.y+v.y*d},w=function(n){var t=n.source,e=n.sourcePosition,r=void 0===e?ip.Bottom:e,o=n.target;return r===ip.Left||r===ip.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),b=0!==w.x?"x":"y",_=w[b],x=[],E={x:0,y:0},S={x:0,y:0},k=y(W_({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),C=k[0],N=k[1],M=k[2],O=k[3];if(h[b]*v[b]==-1){r=null!==(t=f.x)&&void 0!==t?t:C,o=null!==(e=f.y)&&void 0!==e?e:N;var j=[{x:r,y:p.y},{x:r,y:g.y}],I=[{x:p.x,y:o},{x:g.x,y:o}];x=h[b]===_?"x"===b?j:I:"x"===b?I:j}else{var P=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(x="x"===b?h.x===_?A:P:h.y===_?P:A,a===s){var z=Math.abs(i[b]-c[b]);if(z<=d){var L=Math.min(d-1,d-z);h[b]===_?E[b]=(p[b]>i[b]?-1:1)*L:S[b]=(g[b]>c[b]?-1:1)*L}}if(a!==s){var T="x"===b?"y":"x",B=h[b]===v[T],D=p[T]>g[T],R=p[T]<g[T];(1===h[b]&&(!B&&D||B&&R)||1!==h[b]&&(!B&&R||B&&D))&&(x="x"===b?P:A)}var V={x:p.x+E.x,y:p.y+E.y},H={x:g.x+S.x,y:g.y+S.y};Math.max(Math.abs(V.x-x[0].x),Math.abs(H.x-x[0].x))>=Math.max(Math.abs(V.y-x[0].y),Math.abs(H.y-x[0].y))?(r=(V.x+H.x)/2,o=x[0].y):(r=x[0].x,o=(V.y+H.y)/2)}return[m(m([i,{x:p.x+E.x,y:p.y+E.y}],y(x),!1),[{x:g.x+S.x,y:g.y+S.y},c],!1),r,o,M,O]}function J_(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=y(Q_({source:{x:t,y:e},sourcePosition:o,target:{x:i,y:u},targetPosition:c,center:{x:f,y:d},offset:void 0===h?20:h}),5),p=v[0],g=v[1],m=v[2],w=v[3],b=v[4],_=p.reduce((function(n,t,e){var r="";return r=e>0&&e<p.length-1?function(n,t,e,r){var o=Math.min(K_(n,t)/2,K_(t,e)/2,r),i=t.x,u=t.y;if(n.x===i&&i===e.x||n.y===u&&u===e.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<e.x?-1:1,c=n.y<e.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<e.x?1:-1,s=n.y<e.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[e-1],t,p[e+1],s):"".concat(0===e?"M":"L").concat(t.x," ").concat(t.y),n+=r}),"");return[_,g,m,w,b]}var nx=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var tx=c(Zb((function(n,t){var r,o,i=n.type,u=void 0===i?"source":i,a=n.position,c=void 0===a?ip.Top:a,l=n.isValidConnection,s=n.isConnectable,f=void 0===s||s,v=n.isConnectableStart,p=void 0===v||v,g=n.isConnectableEnd,y=void 0===g||g,m=n.id,w=n.onConnect,b=n.children,_=n.className,x=n.onMouseDown,E=n.onTouchStart,S=h(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),C=m||null,N="target"===u,M=kb(),O=e(Y_),I=Sb(nx,u_),P=I.connectOnClick,A=I.noPanClassName,z=I.rfId,L=Sb(function(n,t,e){return function(r){var o=r.connectionStartHandle,i=r.connectionEndHandle,u=r.connectionClickStartHandle,a=r.connectionMode,c=r.connectionStatus,l=(null==i?void 0:i.nodeId)===n&&(null==i?void 0:i.handleId)===t&&(null==i?void 0:i.type)===e;return{connectingFrom:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.handleId)===t&&(null==o?void 0:o.type)===e,connectingTo:l,clickConnecting:(null==u?void 0:u.nodeId)===n&&(null==u?void 0:u.handleId)===t&&(null==u?void 0:u.type)===e,isPossibleEndHandle:a===np.Strict?(null==o?void 0:o.type)!==e:n!==(null==o?void 0:o.nodeId)||t!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(O,C,u),u_),T=L.connectingFrom,B=L.connectingTo,D=L.clickConnecting,R=L.isPossibleEndHandle,V=L.connectionInProcess,H=L.valid;O||null===(o=(r=M.getState()).onError)||void 0===o||o.call(r,"010",Sv());var Y=function(n){var t=M.getState(),e=t.defaultEdgeOptions,r=t.onConnect,o=t.hasDefaultEdges,i=d(d({},e),n);if(o){var u=M.getState(),a=u.edges;(0,u.setEdges)(function(n,t){return n.source&&n.target?function(n,t){return t.some((function(t){return!(t.source!==n.source||t.target!==n.target||t.sourceHandle!==n.sourceHandle&&(t.sourceHandle||n.sourceHandle)||t.targetHandle!==n.targetHandle&&(t.targetHandle||n.targetHandle))}))}(e="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:G_(n)}),t)?t:(null===e.sourceHandle&&delete e.sourceHandle,null===e.targetHandle&&delete e.targetHandle,t.concat(e)):t;var e,r}(i,a))}null==r||r(i),null==w||w(i)},Z=function(n){if(O){var t=Jb(n.nativeEvent);if(p&&(t&&0===n.button||!t)){var e=M.getState();sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:e.autoPanOnConnect,connectionMode:e.connectionMode,connectionRadius:e.connectionRadius,domNode:e.domNode,nodeLookup:e.nodeLookup,lib:e.lib,isTarget:N,handleId:C,nodeId:O,flowId:e.rfId,panBy:e.panBy,cancelConnection:e.cancelConnection,onConnectStart:e.onConnectStart,onConnectEnd:e.onConnectEnd,updateConnection:e.updateConnection,onConnect:Y,isValidConnection:l||e.isValidConnection,getTransform:function(){return M.getState().transform},getConnectionStartHandle:function(){return M.getState().connectionStartHandle}})}t?null==x||x(n):null==E||E(n)}};return k.jsx("div",d({"data-handleid":C,"data-nodeid":O,"data-handlepos":c,"data-id":"".concat(z,"-").concat(O,"-").concat(C,"-").concat(u),className:j(["ink-flow__handle","ink-flow__handle-".concat(c),"nodrag",A,_,{source:!N,target:N,connectable:f,connectablestart:p,connectableend:y,clickconnecting:D,connectingfrom:T,connectingto:B,valid:H,connectionindicator:f&&(!V||R)&&(V?y:p)}]),onMouseDown:Z,onTouchStart:Z,onClick:P?function(n){var t=M.getState(),e=t.onClickConnectStart,r=t.onClickConnectEnd,o=t.connectionClickStartHandle,i=t.connectionMode,a=t.isValidConnection,c=t.lib,s=t.rfId;if(O&&(o||p)){if(!o)return null==e||e(n.nativeEvent,{nodeId:O,handleId:C,handleType:u}),void M.setState({connectionClickStartHandle:{nodeId:O,type:u,handleId:C}});var f=function(n){var t;return(null===(t=n.getRootNode)||void 0===t?void 0:t.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),d=l||a,h=sm.isValid(n.nativeEvent,{handle:{nodeId:O,id:C,type:u},connectionMode:i,fromNodeId:o.nodeId,fromHandleId:o.handleId||null,fromType:o.type,isValidConnection:d,flowId:s,doc:f,lib:c}),v=h.connection;h.isValid&&v&&Y(v),null==r||r(n),M.setState({connectionClickStartHandle:null})}}:void 0,ref:t},S,{children:b}))})));var ex={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rx={input:function(n){var t=n.data,e=n.isConnectable,r=n.sourcePosition,o=void 0===r?ip.Bottom:r;return k.jsxs(k.Fragment,{children:[null==t?void 0:t.label,k.jsx(tx,{type:"source",position:o,isConnectable:e})]})},default:function(n){var t=n.data,e=n.isConnectable,r=n.targetPosition,o=void 0===r?ip.Top:r,i=n.sourcePosition,u=void 0===i?ip.Bottom:i;return k.jsxs(k.Fragment,{children:[k.jsx(tx,{type:"target",position:o,isConnectable:e}),null==t?void 0:t.label,k.jsx(tx,{type:"source",position:u,isConnectable:e})]})},output:function(n){var t=n.data,e=n.isConnectable,r=n.targetPosition,o=void 0===r?ip.Top:r;return k.jsxs(k.Fragment,{children:[k.jsx(tx,{type:"target",position:o,isConnectable:e}),null==t?void 0:t.label]})},group:function(){return null}};function ox(n){var t=n.id,e=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,u=e.getState(),a=u.addSelectedNodes,c=u.unselectNodesAndEdges,l=u.multiSelectionActive,s=u.nodeLookup,f=u.onError,d=s.get(t);d?(e.setState({nodesSelectionActive:!1}),d.selected?(o||d.selected&&l)&&(c({nodes:[d],edges:[]}),requestAnimationFrame((function(){var n;return null===(n=null==i?void 0:i.current)||void 0===n?void 0:n.blur()}))):a([t])):null==f||f("012",Cv(t))}function ix(n){var t,e=n.id,r=n.onClick,o=n.onMouseEnter,c=n.onMouseMove,l=n.onMouseLeave,f=n.onContextMenu,h=n.onDoubleClick,v=n.nodesDraggable,p=n.elementsSelectable,m=n.nodesConnectable,w=n.nodesFocusable,b=n.resizeObserver,_=n.noDragClassName,x=n.noPanClassName,E=n.disableKeyboardA11y,S=n.rfId,C=n.nodeTypes,N=n.nodeExtent,M=n.nodeOrigin,O=n.onError,I=Sb((function(n){var t=n.nodeLookup.get(e),r=n.parentLookup.has(e);return{node:t,internals:t.internals,isParent:r}}),u_),P=I.node,A=I.internals,z=I.isParent,L=P.type||"default",T=(null==C?void 0:C[L])||rx[L];void 0===T&&(null==O||O("003",wv(L)),L="default",T=rx.default);var B=!!(P.draggable||v&&void 0===P.draggable),D=!!(P.selectable||p&&void 0===P.selectable),R=!!(P.connectable||m&&void 0===P.connectable),V=!!(P.focusable||w&&void 0===P.focusable),H=kb(),Y=function(n){var t,e,r,o,i,u;return void 0!==(null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==(null!==(u=null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:n.height)&&void 0!==u?u:n.initialHeight)}(P),Z=function(n){var t=n.node,e=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=kb(),c=u(null),l=u(null),s=u(t.sourcePosition),f=u(t.targetPosition),d=u(e),h=r&&!!t.internals.handleBounds&&!t.hidden;return a((function(){!c.current||h&&l.current===c.current||(l.current&&(null==o||o.unobserve(l.current)),null==o||o.observe(c.current),l.current=c.current)}),[h]),a((function(){return function(){l.current&&(null==o||o.unobserve(l.current),l.current=null)}}),[]),a((function(){if(c.current){var n=d.current!==e,r=s.current!==t.sourcePosition,o=f.current!==t.targetPosition;(n||r||o)&&(d.current=e,s.current=t.sourcePosition,f.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}}),[t.id,e,t.sourcePosition,t.targetPosition]),c}({node:P,nodeType:L,hasDimensions:Y,resizeObserver:b}),X=function(n){var t=n.nodeRef,e=n.disabled,r=void 0!==e&&e,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,f=kb(),d=y(i(!1),2),h=d[0],v=d[1],p=u();return a((function(){p.current=om({getStoreItems:function(){return f.getState()},onNodeMouseDown:function(n){ox({id:n,store:f,nodeRef:t})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),a((function(){var n,e;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(t.current)return null===(e=p.current)||void 0===e||e.update({noDragClassName:o,handleSelector:c,domNode:t.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,t,l]),h}({nodeRef:Z,disabled:P.hidden||!B,noDragClassName:_,handleSelector:P.dragHandle,nodeId:e,isSelectable:D}),U=function(){var n=kb(),t=s((function(t){var e,r,o=n.getState(),i=o.nodeExtent,u=o.snapToGrid,a=o.snapGrid,c=o.nodesDraggable,l=o.onError,s=o.updateNodePositions,f=o.nodeLookup,d=o.nodeOrigin,h=new Map,v=function(n){return function(t){return t.selected&&(t.draggable||n&&void 0===t.draggable)}}(c),p=u?a[0]:5,m=u?a[1]:5,w=t.direction.x*p*t.factor,b=t.direction.y*m*t.factor;try{for(var _=g(f),x=_.next();!x.done;x=_.next()){var E=y(x.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+b};u&&(S=Tb(S,a));var k=__({nodeId:E.id,nextPosition:S,nodeLookup:f,nodeExtent:i,nodeOrigin:d,onError:l}),C=k.position,N=k.positionAbsolute;E.position=C,E.internals.positionAbsolute=N,h.set(E.id,E)}}}catch(n){e={error:n}}finally{try{x&&!x.done&&(r=_.return)&&r.call(_)}finally{if(e)throw e.error}}s(h)}),[]);return t}();if(P.hidden)return null;var F=zb(P),W=function(n){var t,e,r,o,i,u,a,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(e=null!==(t=n.width)&&void 0!==t?t:n.initialWidth)&&void 0!==e?e:null===(r=n.style)||void 0===r?void 0:r.width,height:null!==(i=null!==(o=n.height)&&void 0!==o?o:n.initialHeight)&&void 0!==i?i:null===(u=n.style)||void 0===u?void 0:u.height}:{width:null!==(a=n.width)&&void 0!==a?a:null===(c=n.style)||void 0===c?void 0:c.width,height:null!==(l=n.height)&&void 0!==l?l:null===(s=n.style)||void 0===s?void 0:s.height}}(P),$=(N?Ab(A.positionAbsolute,N):A.positionAbsolute)||{x:0,y:0},G=function(n){var t=n.x,e=n.y,r=n.width,o=n.height,i=n.origin,u=void 0===i?[0,0]:i;return!r||!o||u[0]<0||u[1]<0||u[0]>1||u[1]>1?{x:t,y:e}:{x:t-r*u[0],y:e-o*u[1]}}(d(d(d({},$),F),{origin:P.origin||M})),q=D||B||r||o||c||l,K=o?function(n){return o(n,d({},A.userNode))}:void 0,Q=c?function(n){return c(n,d({},A.userNode))}:void 0,J=l?function(n){return l(n,d({},A.userNode))}:void 0,nn=f?function(n){return f(n,d({},A.userNode))}:void 0,tn=h?function(n){return h(n,d({},A.userNode))}:void 0;return k.jsx("div",{className:j(["ink-flow__node","ink-flow__node-".concat(L),(t={},t[x]=B,t),P.className,{selected:P.selected,selectable:D,parent:z,draggable:B,dragging:X}]),ref:Z,style:d(d({zIndex:A.z,transform:"translate(".concat(G.x,"px,").concat(G.y,"px)"),pointerEvents:q?"all":"none",visibility:Y?"visible":"hidden"},P.style),W),"data-id":e,"data-testid":"rf__node-".concat(e),onMouseEnter:K,onMouseMove:Q,onMouseLeave:J,onContextMenu:nn,onClick:function(n){var t=H.getState(),o=t.selectNodesOnDrag,i=t.nodeDragThreshold;D&&(!o||!B||i>0)&&ox({id:e,store:H,nodeRef:Z}),r&&r(n,d({},A.userNode))},onDoubleClick:tn,onKeyDown:V?function(n){if(!Qb(n.nativeEvent)&&!E)if(Mv.includes(n.key)&&D){var t="Escape"===n.key;ox({id:e,store:H,unselect:t,nodeRef:Z})}else B&&P.selected&&Object.prototype.hasOwnProperty.call(ex,n.key)&&(H.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~$.x,", y: ").concat(~~$.y)}),U({direction:ex[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:V?0:void 0,role:V?"button":void 0,"aria-describedby":E?void 0:"".concat("ink-flow__node-desc","-").concat(S),"aria-label":P.ariaLabel,children:k.jsx(Z_,{value:e,children:k.jsx(T,d({id:e,data:P.data,type:L,positionAbsoluteX:$.x,positionAbsoluteY:$.y,selected:P.selected,isConnectable:R,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:X,dragHandle:P.dragHandle,zIndex:A.z},F))})})}var ux=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function ax(n){var t=Sb(ux,u_),e=t.nodesDraggable,r=t.nodesConnectable,o=t.nodesFocusable,u=t.elementsSelectable,c=t.onError,l=H_(!1),s=function(){var n=Sb(V_),t=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(t){var e=new Map;t.forEach((function(n){var t=n.target.getAttribute("data-id");e.set(t,{id:t,nodeElement:n.target})})),n(e)}))})),1),e=t[0];return a((function(){return function(){null==e||e.disconnect()}}),[e]),e}();return k.jsx("div",{className:"ink-flow__nodes",style:a_,children:l.map((function(t){return k.jsx(ix,{id:t,nodeTypes:n.nodeTypes,nodeOrigin:n.nodeOrigin,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e,nodesConnectable:r,nodesFocusable:o,elementsSelectable:u,onError:c},t)}))})}ax.displayName="NodeRenderer";var cx,lx=c(ax),sx=((cx={})[op.Arrow]=function(n){var t=n.color,e=void 0===t?"none":t,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},cx[op.ArrowClosed]=function(n){var t=n.color,e=void 0===t?"none":t,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cx);function fx(n,t){if(!n)return"";if("string"==typeof n)return n;var e=t?"".concat(t,"__"):"";return"".concat(e).concat(Object.keys(n).sort().map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"))}var dx=function(n){var t=n.id,e=n.type,o=n.color,i=n.width,u=void 0===i?12.5:i,a=n.height,c=void 0===a?12.5:a,l=n.markerUnits,s=void 0===l?"strokeWidth":l,f=n.strokeWidth,d=n.orient,h=void 0===d?"auto-start-reverse":d,v=function(n){var t=kb(),e=r((function(){var e,r;return Object.prototype.hasOwnProperty.call(sx,n)?sx[n]:(null===(r=(e=t.getState()).onError)||void 0===r||r.call(e,"009",xv(n)),null)}),[n]);return e}(e);return v?k.jsx("marker",{className:"ink-flow__arrowhead",id:t,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:k.jsx(v,{color:o,strokeWidth:f})}):null},hx=function(n){var t=n.defaultColor,e=n.rfId,o=Sb((function(n){return n.edges})),i=Sb((function(n){return n.defaultEdgeOptions})),u=r((function(){var n=function(n,t){var e=t.id,r=t.defaultColor,o=t.defaultMarkerStart,i=t.defaultMarkerEnd,u=new Set;return n.reduce((function(n,t){return[t.markerStart||o,t.markerEnd||i].forEach((function(t){if(t&&"object"==typeof t){var o=fx(t,e);u.has(o)||(n.push(d({id:o,color:t.color||r},t)),u.add(o))}})),n}),[]).sort((function(n,t){return n.id.localeCompare(t.id)}))}(o,{id:e,defaultColor:t,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,e,t]);return u.length?k.jsx("svg",{className:"ink-flow__marker",children:k.jsx("defs",{children:u.map((function(n){return k.jsx(dx,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id)}))})}):null};hx.displayName="MarkerDefinitions";var vx=c(hx);function px(n){var t=n.x,e=n.y,r=n.label,o=n.labelStyle,u=void 0===o?{}:o,a=n.labelShowBg,c=void 0===a||a,l=n.labelBgStyle,f=void 0===l?{}:l,v=n.labelBgPadding,p=void 0===v?[2,4]:v,g=n.labelBgBorderRadius,m=void 0===g?2:g,w=n.children,b=n.className,_=h(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),x=y(i({x:1,y:0,width:0,height:0}),2),E=x[0],S=x[1],C=j(["ink-flow__edge-textwrapper",b]),N=s((function(n){if(null!==n){var t=n.getBBox();S({x:t.x,y:t.y,width:t.width,height:t.height})}}),[]);return void 0!==r&&r?k.jsxs("g",d({transform:"translate(".concat(t-E.width/2," ").concat(e-E.height/2,")"),className:C,visibility:E.width?"visible":"hidden"},_,{children:[c&&k.jsx("rect",{width:E.width+2*p[0],x:-p[0],y:-p[1],height:E.height+2*p[1],className:"ink-flow__edge-textbg",style:f,rx:m,ry:m}),k.jsx("text",{className:"ink-flow__edge-text",y:E.height/2,dy:"0.3em",ref:N,style:u,children:r}),w]})):null}px.displayName="EdgeText";var gx=c(px);function yx(n){var t=n.id,e=n.path,r=n.labelX,o=n.labelY,i=n.label,u=n.labelStyle,a=n.labelShowBg,c=n.labelBgStyle,l=n.labelBgPadding,s=n.labelBgBorderRadius,f=n.style,d=n.markerEnd,h=n.markerStart,v=n.className,p=n.interactionWidth,g=void 0===p?20:p;return k.jsxs(k.Fragment,{children:[k.jsx("path",{id:t,style:f,d:e,fill:"none",className:j(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),g&&k.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&Lb(r)&&Lb(o)?k.jsx(gx,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function mx(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2;return t===ip.Left||t===ip.Right?[.5*(e+o),r]:[e,.5*(r+i)]}function wx(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=y(mx({pos:o,x1:t,y1:e,x2:i,y2:u}),2),s=l[0],f=l[1],d=y(mx({pos:c,x1:i,y1:u,x2:t,y2:e}),2),h=d[0],v=d[1],p=y(X_({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:s,sourceControlY:f,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],b=p[3];return["M".concat(t,",").concat(e," C").concat(s,",").concat(f," ").concat(h,",").concat(v," ").concat(i,",").concat(u),g,m,w,b]}function bx(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.sourcePosition,c=void 0===a?ip.Bottom:a,l=t.targetPosition,s=void 0===l?ip.Top:l,f=t.label,d=t.labelStyle,h=t.labelShowBg,v=t.labelBgStyle,p=t.labelBgPadding,g=t.labelBgBorderRadius,m=t.style,w=t.markerEnd,b=t.markerStart,_=t.interactionWidth,x=y(wx({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s}),3),E=x[0],S=x[1],C=x[2],N=n.isInternal?void 0:e;return k.jsx(yx,{id:N,path:E,labelX:S,labelY:C,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:b,interactionWidth:_})}))}var _x=bx({isInternal:!1}),xx=bx({isInternal:!0});function Ex(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.label,c=t.labelStyle,l=t.labelShowBg,s=t.labelBgStyle,f=t.labelBgPadding,d=t.labelBgBorderRadius,h=t.style,v=t.sourcePosition,p=void 0===v?ip.Bottom:v,g=t.targetPosition,m=void 0===g?ip.Top:g,w=t.markerEnd,b=t.markerStart,_=t.pathOptions,x=t.interactionWidth,E=y(J_({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:u,targetPosition:m,borderRadius:null==_?void 0:_.borderRadius,offset:null==_?void 0:_.offset}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:e;return k.jsx(yx,{id:M,path:S,labelX:C,labelY:N,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:w,markerStart:b,interactionWidth:x})}))}_x.displayName="SimpleBezierEdge",xx.displayName="SimpleBezierEdgeInternal";var Sx=Ex({isInternal:!1}),kx=Ex({isInternal:!0});function Cx(n){return c((function(t){var e,o=t.id,i=h(t,["id"]),u=n.isInternal?void 0:o;return k.jsx(Sx,d({},i,{id:u,pathOptions:r((function(){var n;return{borderRadius:0,offset:null===(n=i.pathOptions)||void 0===n?void 0:n.offset}}),[null===(e=i.pathOptions)||void 0===e?void 0:e.offset])}))}))}Sx.displayName="SmoothStepEdge",kx.displayName="SmoothStepEdgeInternal";var Nx=Cx({isInternal:!1}),Mx=Cx({isInternal:!0});function Ox(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.label,c=t.labelStyle,l=t.labelShowBg,s=t.labelBgStyle,f=t.labelBgPadding,d=t.labelBgBorderRadius,h=t.style,v=t.markerEnd,p=t.markerStart,g=t.interactionWidth,m=y(function(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=y(W_({sourceX:t,sourceY:e,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(t,",").concat(e,"L ").concat(r,",").concat(o),u,a,c,l]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=m[0],b=m[1],_=m[2],x=n.isInternal?void 0:e;return k.jsx(yx,{id:x,path:w,labelX:b,labelY:_,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}Nx.displayName="StepEdge",Mx.displayName="StepEdgeInternal";var jx=Ox({isInternal:!1}),Ix=Ox({isInternal:!0});function Px(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.sourcePosition,c=void 0===a?ip.Bottom:a,l=t.targetPosition,s=void 0===l?ip.Top:l,f=t.label,d=t.labelStyle,h=t.labelShowBg,v=t.labelBgStyle,p=t.labelBgPadding,g=t.labelBgBorderRadius,m=t.style,w=t.markerEnd,b=t.markerStart,_=t.pathOptions,x=t.interactionWidth,E=y(function(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.curvature,s=void 0===l?.25:l,f=y(F_({pos:o,x1:t,y1:e,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=y(F_({pos:c,x1:i,y1:u,x2:t,y2:e,c:s}),2),p=v[0],g=v[1],m=y(X_({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],b=m[1],_=m[2],x=m[3];return["M".concat(t,",").concat(e," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),w,b,_,x]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s,curvature:null==_?void 0:_.curvature}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:e;return k.jsx(yx,{id:M,path:S,labelX:C,labelY:N,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:b,interactionWidth:x})}))}jx.displayName="StraightEdge",Ix.displayName="StraightEdgeInternal";var Ax=Px({isInternal:!1}),zx=Px({isInternal:!0});Ax.displayName="BezierEdge",zx.displayName="BezierEdgeInternal";var Lx={default:zx,straight:Ix,step:Mx,smoothstep:kx,simplebezier:xx},Tx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Bx=function(n,t,e){return e===ip.Left?n-t:e===ip.Right?n+t:n},Dx=function(n,t,e){return e===ip.Top?n-t:e===ip.Bottom?n+t:n},Rx="ink-flow__edgeupdater";function Vx(n){var t=n.position,e=n.centerX,r=n.centerY,o=n.radius,i=void 0===o?10:o,u=n.onMouseDown,a=n.onMouseEnter,c=n.onMouseOut,l=n.type;return k.jsx("circle",{onMouseDown:u,onMouseEnter:a,onMouseOut:c,className:j([Rx,"".concat(Rx,"-").concat(l)]),cx:Bx(e,i,t),cy:Dx(r,i,t),r:i,stroke:"transparent",fill:"transparent"})}function Hx(n){var t=n.isUpdatable,e=n.edgeUpdaterRadius,r=n.edge,o=n.targetHandleId,i=n.sourceHandleId,u=n.sourceX,a=n.sourceY,c=n.targetX,l=n.targetY,s=n.sourcePosition,f=n.targetPosition,d=n.onEdgeUpdate,h=n.onEdgeUpdateStart,v=n.onEdgeUpdateEnd,p=n.setUpdating,g=n.setUpdateHover,y=kb(),m=function(n,t){if(0===n.button){var e=y.getState(),u=e.autoPanOnConnect,a=e.domNode,c=e.isValidConnection,l=e.connectionMode,s=e.connectionRadius,f=e.lib,g=e.onConnectStart,m=e.onConnectEnd,w=e.cancelConnection,b=e.nodeLookup,_=e.rfId,x=e.panBy,E=e.updateConnection,S=t?r.target:r.source,k=(t?o:i)||null,C=t?"target":"source",N=t;p(!0),null==h||h(n,r,C);sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:u,connectionMode:l,connectionRadius:s,domNode:a,handleId:k,nodeId:S,nodeLookup:b,isTarget:N,edgeUpdaterType:C,lib:f,flowId:_,cancelConnection:w,panBy:x,isValidConnection:c,onConnect:function(n){return null==d?void 0:d(r,n)},onConnectStart:g,onConnectEnd:m,onEdgeUpdateEnd:function(n){p(!1),null==v||v(n,r,C)},updateConnection:E,getTransform:function(){return y.getState().transform},getConnectionStartHandle:function(){return y.getState().connectionStartHandle}})}},w=function(){return g(!0)},b=function(){return g(!1)};return k.jsxs(k.Fragment,{children:[("source"===t||!0===t)&&k.jsx(Vx,{position:s,centerX:u,centerY:a,radius:e,onMouseDown:function(n){return m(n,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===t||!0===t)&&k.jsx(Vx,{position:f,centerX:c,centerY:l,radius:e,onMouseDown:function(n){return m(n,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function Yx(n){var t;return n&&!(!n.internals.handleBounds&&!(null===(t=n.handles)||void 0===t?void 0:t.length))&&!!(n.measured.width||n.width||n.initialWidth)}function Zx(n){var t,e,r,o;if(!n)return null;var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.width=null!==(r=l.width)&&void 0!==r?r:1,l.height=null!==(o=l.height)&&void 0!==o?o:1,"source"===l.type?i.push(l):"target"===l.type&&u.push(l)}}catch(n){t={error:n}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{source:i,target:u}}function Xx(n,t,e){var r,o;void 0===e&&(e=null);var i=(null!==(r=null==e?void 0:e.x)&&void 0!==r?r:0)+t.internals.positionAbsolute.x,u=(null!==(o=null==e?void 0:e.y)&&void 0!==o?o:0)+t.internals.positionAbsolute.y,a=null!=e?e:zb(t),c=a.width,l=a.height;switch(n){case ip.Top:return[i+c/2,u];case ip.Right:return[i+c,u+l/2];case ip.Bottom:return[i+c/2,u+l];case ip.Left:return[i,u+l/2]}}function Ux(n,t){return n&&(t?n.find((function(n){return n.id===t})):n[0])||null}function Fx(n){var t=n.id,e=n.edgesFocusable,o=n.edgesUpdatable,a=n.elementsSelectable,c=n.onClick,l=n.onDoubleClick,f=n.onContextMenu,h=n.onMouseEnter,v=n.onMouseMove,p=n.onMouseLeave,g=n.edgeUpdaterRadius,m=n.onEdgeUpdate,w=n.onEdgeUpdateStart,b=n.onEdgeUpdateEnd,_=n.rfId,x=n.edgeTypes,E=n.noPanClassName,S=n.onError,C=n.disableKeyboardA11y,N=Sb((function(n){return n.edgeLookup.get(t)})),M=Sb((function(n){return n.defaultEdgeOptions})),O=(N=M?d(d({},M),N):N).type||"default",I=(null==x?void 0:x[O])||Lx[O];void 0===I&&(null==S||S("011",kv(O)),O="default",I=Lx.default);var P=!!(N.focusable||e&&void 0===N.focusable),A=void 0!==m&&(N.updatable||o&&void 0===N.updatable),z=!!(N.selectable||a&&void 0===N.selectable),L=u(null),T=y(i(!1),2),B=T[0],D=T[1],R=y(i(!1),2),V=R[0],H=R[1],Y=kb(),Z=Sb(s((function(n){var e=n.nodeLookup.get(N.source),r=n.nodeLookup.get(N.target);if(!e||!r)return d({zIndex:N.zIndex},Tx);var o=function(n){var t,e,r,o,i,u=n.sourceNode,a=n.targetNode;if(!Yx(u)||!Yx(a))return null;var c=u.internals.handleBounds||Zx(u.handles),l=a.internals.handleBounds||Zx(a.handles),s=Ux(null!==(t=null==c?void 0:c.source)&&void 0!==t?t:[],n.sourceHandle),f=Ux(n.connectionMode===np.Strict?null!==(e=null==l?void 0:l.target)&&void 0!==e?e:[]:(null!==(r=null==l?void 0:l.target)&&void 0!==r?r:[]).concat(null!==(o=null==l?void 0:l.source)&&void 0!==o?o:[]),n.targetHandle),d=(null==s?void 0:s.position)||ip.Bottom,h=(null==f?void 0:f.position)||ip.Top;if(!s||!f)return null===(i=n.onError)||void 0===i||i.call(n,"008",Ev(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=y(Xx(d,u,s),2),p=v[0],g=v[1],m=y(Xx(h,a,f),2);return{sourceX:p,sourceY:g,targetX:m[0],targetY:m[1],sourcePosition:d,targetPosition:h}}({id:t,sourceNode:e,targetNode:r,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:n.connectionMode,onError:S}),i=function(n){var t=n.sourceNode,e=n.targetNode,r=n.selected,o=void 0!==r&&r,i=n.zIndex,u=void 0===i?0:i,a=n.elevateOnSelect;if(void 0===a||!a)return u;var c=o||e.selected||t.selected,l=Math.max(t.internals.z||0,e.internals.z||0,1e3);return u+(c?l:0)}({selected:N.selected,zIndex:N.zIndex,sourceNode:e,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||Tx)}),[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),u_),X=Z.zIndex,U=Z.sourceX,F=Z.sourceY,W=Z.targetX,$=Z.targetY,G=Z.sourcePosition,q=Z.targetPosition,K=r((function(){return N.markerStart?"url('#".concat(fx(N.markerStart,_),"')"):void 0}),[N.markerStart,_]),Q=r((function(){return N.markerEnd?"url('#".concat(fx(N.markerEnd,_),"')"):void 0}),[N.markerEnd,_]);if(N.hidden||null===U||null===F||null===W||null===$)return null;var J=l?function(n){l(n,d({},N))}:void 0,nn=f?function(n){f(n,d({},N))}:void 0,tn=h?function(n){h(n,d({},N))}:void 0,en=v?function(n){v(n,d({},N))}:void 0,rn=p?function(n){p(n,d({},N))}:void 0;return k.jsx("svg",{style:{zIndex:X},children:k.jsxs("g",{className:j(["ink-flow__edge","ink-flow__edge-".concat(O),N.className,E,{selected:N.selected,animated:N.animated,inactive:!z&&!c,updating:B,selectable:z}]),onClick:function(n){var e,r=Y.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,u=r.multiSelectionActive;z&&(Y.setState({nodesSelectionActive:!1}),N.selected&&u?(i({nodes:[],edges:[N]}),null===(e=L.current)||void 0===e||e.blur()):o([t])),c&&c(n,N)},onDoubleClick:J,onContextMenu:nn,onMouseEnter:tn,onMouseMove:en,onMouseLeave:rn,onKeyDown:P?function(n){var e;if(!C&&Mv.includes(n.key)&&z){var r=Y.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(e=L.current)||void 0===e||e.blur(),o({edges:[N]})):i([t])}}:void 0,tabIndex:P?0:void 0,role:P?"button":"img","data-id":t,"data-testid":"rf__edge-".concat(t),"aria-label":null===N.ariaLabel?void 0:N.ariaLabel||"Edge from ".concat(N.source," to ").concat(N.target),"aria-describedby":P?"".concat("ink-flow__edge-desc","-").concat(_):void 0,ref:L,children:[!V&&k.jsx(I,{id:t,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:U,sourceY:F,targetX:W,targetY:$,sourcePosition:G,targetPosition:q,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:K,markerEnd:Q,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),A&&k.jsx(Hx,{edge:N,isUpdatable:A,edgeUpdaterRadius:g,onEdgeUpdate:m,onEdgeUpdateStart:w,onEdgeUpdateEnd:b,sourceX:U,sourceY:F,targetX:W,targetY:$,sourcePosition:G,targetPosition:q,setUpdateHover:D,setUpdating:H,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle})]})})}var Wx=function(n){return{width:n.width,height:n.height,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function $x(n){var t=n.defaultMarkerColor,e=n.rfId,r=n.noPanClassName,o=n.onEdgeUpdate,i=n.onEdgeContextMenu,u=n.onEdgeMouseEnter,a=n.onEdgeMouseMove,c=n.onEdgeMouseLeave,l=n.onEdgeClick,f=n.edgeTypes,d=Sb(Wx,u_),h=d.edgesFocusable,v=d.edgesUpdatable,p=d.elementsSelectable,g=d.onError,y=function(n){var t=Sb(s((function(n){return n.edges.map((function(n){return n.id}))}),[n]),u_);return t}(!1);return k.jsxs("div",{className:"ink-flow__edges",children:[k.jsx(vx,{defaultColor:t,rfId:e}),y.map((function(n){return k.jsx(Fx,{id:n,edgesFocusable:h,edgesUpdatable:v,elementsSelectable:p,noPanClassName:r,onEdgeUpdate:o,onContextMenu:i,onMouseEnter:u,onMouseMove:a,onMouseLeave:c,onClick:l,rfId:e,onError:g,edgeTypes:f},n)}))]})}$x.displayName="EdgeRenderer";var Gx,qx=c($x),Kx=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function Qx(n){var t=n.children,e=Sb(Kx);return k.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:e},children:t})}var Jx=((Gx={})[ip.Left]=ip.Right,Gx[ip.Right]=ip.Left,Gx[ip.Top]=ip.Bottom,Gx[ip.Bottom]=ip.Top,Gx),nE=function(n){var t,e,r=n.nodeId,o=n.handleType,i=n.style,u=n.type,a=void 0===u?rp.Bezier:u,c=n.CustomComponent,l=n.connectionStatus,f=Sb(s((function(n){var t;return{fromNode:n.nodeLookup.get(r),handleId:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.handleId,toX:(n.connectionPosition.x-n.transform[0])/n.transform[2],toY:(n.connectionPosition.y-n.transform[1])/n.transform[2],connectionMode:n.connectionMode}}),[r]),u_),h=f.fromNode,v=f.handleId,p=f.toX,g=f.toY,m=f.connectionMode,w=null==h?void 0:h.internals.handleBounds,b=null==w?void 0:w[o];if(m===np.Loose&&(b=b||(null==w?void 0:w["source"===o?"target":"source"])),!h||!b)return null;var _=v?b.find((function(n){return n.id===v})):b[0],x=_?_.x+_.width/2:(null!==(t=h.measured.width)&&void 0!==t?t:0)/2,E=_?_.y+_.height/2:null!==(e=h.measured.height)&&void 0!==e?e:0,S=h.internals.positionAbsolute.x+x,C=h.internals.positionAbsolute.y+E,N=null==_?void 0:_.position,M=N?Jx[N]:null;if(!N||!M)return null;if(c)return k.jsx(c,{connectionLineType:a,connectionLineStyle:i,fromNode:h,fromHandle:_,fromX:S,fromY:C,toX:p,toY:g,fromPosition:N,toPosition:M,connectionStatus:l});var O="",j={sourceX:S,sourceY:C,sourcePosition:N,targetX:p,targetY:g,targetPosition:M};return O=a===rp.Bezier?y(sp(j),1)[0]:a===rp.Step?y(bp(d(d({},j),{borderRadius:0})),1)[0]:a===rp.SmoothStep?y(bp(j),1)[0]:a===rp.SimpleBezier?y(wx(j),1)[0]:"M".concat(S,",").concat(C," ").concat(p,",").concat(g),k.jsx("path",{d:O,fill:"none",className:"react-flow__connection-path",style:i})};nE.displayName="ConnectionLine";var tE=function(n){var t,e;return{nodeId:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.nodeId,handleType:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.type,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height}};function eE(n){var t=n.containerStyle,e=n.style,r=n.type,o=n.component,i=Sb(tE,u_),u=i.nodeId,a=i.handleType,c=i.nodesConnectable,l=i.width,s=i.height,f=i.connectionStatus;return!!(u&&a&&l&&c)?k.jsx("svg",{style:t,width:l,height:s,className:"react-flow__connectionline react-flow__container",children:k.jsx("g",{className:j(["react-flow__connection",f]),children:k.jsx(nE,{nodeId:u,handleType:a,style:e,type:r,CustomComponent:o,connectionStatus:f})})}):null}function rE(n){var t=n.onNodeClick,e=n.onNodeDoubleClick,r=n.onNodeMouseEnter,o=n.onNodeMouseMove,i=n.onNodeMouseLeave,u=n.onNodeContextMenu,a=n.onEdgeClick,c=n.onEdgeDoubleClick,l=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeContextMenu,h=n.rfId,v=n.minZoom,p=n.maxZoom,g=n.noPanClassName,y=n.noDragClassName,m=n.nodeOrigin,w=n.viewport,b=n.disableKeyboardA11y,_=n.translateExtent,x=n.defaultViewport,E=n.nodeTypes,S=n.edgeTypes,C=n.elementsSelectable,N=n.defaultMarkerColor,M=n.connectionLineType,O=n.connectionLineStyle,j=n.connectionLineComponent,I=n.connectionLineContainerStyle,P=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,T=n.onPaneMouseLeave,B=n.onPaneScroll;return k.jsx(j_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:b,translateExtent:_,defaultViewport:x,elementsSelectable:C,onPaneClick:P,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:T,onPaneScroll:B,children:k.jsxs(Qx,{children:[k.jsx(qx,{rfId:h,edgeTypes:S,noPanClassName:g,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,onEdgeContextMenu:d,defaultMarkerColor:N}),k.jsx(eE,{style:O,type:M,component:j,containerStyle:I}),k.jsx("div",{className:"ink-flow__edgelabel-renderer"}),k.jsx(lx,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:t,onNodeDoubleClick:e,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),k.jsx("div",{className:"ink-flow__viewport-portal"})]})})}rE.displayName="GraphView";var oE=c(rE),iE={x:0,y:0,zoom:1},uE={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},aE=function(n){var t,e,r=void 0===n?{}:n,o=r.nodes,i=r.edges,u=r.defaultNodes,a=r.defaultEdges;r.width,r.height,r.fitView;var c=new Map,l=new Map,s=new Map,f=new Map,d=null!==(t=null!=a?a:i)&&void 0!==t?t:[],h=null!==(e=null!=u?u:o)&&void 0!==e?e:[];Ob(s,f,d),jb(h,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:h,nodeLookup:c,parentLookup:l,edges:d,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Nv,nodeExtent:Nv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:np.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:uE,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"react",debug:!1}},cE={dagre:_p};var lE={exports:{}};
|
|
16
|
+
*/I.exports=function(){if(O)return P;O=1;var t=n,e=L(),r="function"==typeof Object.is?Object.is:function(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t},o=e.useSyncExternalStore,i=t.useRef,u=t.useEffect,a=t.useMemo,c=t.useDebugValue;return P.useSyncExternalStoreWithSelector=function(n,t,e,l,s){var f=i(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=a((function(){function n(n){if(!u){if(u=!0,o=n,n=l(n),void 0!==s&&d.hasValue){var t=d.value;if(s(t,n))return i=t}return i=n}if(t=i,r(o,n))return t;var e=l(n);return void 0!==s&&s(t,e)?t:(o=n,i=e)}var o,i,u=!1,a=void 0===e?null:e;return[function(){return n(t())},null===a?void 0:function(){return n(a())}]}),[t,e,l,s]);var h=o(n,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),c(h),h},P}();var T=b(I.exports);const B=n=>{let t;const e=new Set,r=(n,r)=>{const o="function"==typeof n?n(t):n;if(!Object.is(o,t)){const n=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),e.forEach((e=>e(t,n)))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>u,subscribe:n=>(e.add(n),()=>e.delete(n)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),e.clear()}},u=t=n(r,o,i);return i},{useDebugValue:D}=n,{useSyncExternalStoreWithSelector:R}=T,V=n=>n;function H(n,t=V,e){const r=R(n.subscribe,n.getState,n.getServerState||n.getInitialState,t,e);return D(r),r}const Y=(n,t)=>{const e=(n=>n?B(n):B)(n),r=(n,r=t)=>H(e,n,r);return Object.assign(r,e),r};var Z=t(null),X=Z.Provider,U=function(){return U=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},U.apply(this,arguments)};function F(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function $(n,t,e){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return n.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var G,q,K,Q,J,nn,tn,en,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,wn,bn,_n,xn,En,Sn,kn,Cn,Nn,Mn,On,jn,In,Pn,An,zn,Ln,Tn,Bn,Dn,Rn,Vn,Hn,Yn,Zn,Xn,Un,Fn,Wn,$n,Gn,qn,Kn,Qn,Jn,nt,tt,et,rt,ot,it,ut,at,ct,lt,st,ft,dt,ht,vt,pt,gt,yt,mt,wt,bt,_t,xt,Et,St,kt,Ct,Nt,Mt,Ot,jt,It,Pt,At,zt,Lt,Tt,Bt,Dt,Rt,Vt,Ht,Yt,Zt,Xt,Ut,Ft,Wt,$t,Gt,qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Kt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Qt(){return Q?K:(Q=1,K=function(n,t){return n===t||n!=n&&t!=t})}function Jt(){if(nn)return J;nn=1;var n=Qt();return J=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1},J}function ne(){if(fn)return sn;fn=1;var n=q?G:(q=1,G=function(){this.__data__=[],this.size=0}),t=function(){if(en)return tn;en=1;var n=Jt(),t=Array.prototype.splice;return tn=function(e){var r=this.__data__,o=n(r,e);return!(o<0||(o==r.length-1?r.pop():t.call(r,o,1),--this.size,0))}}(),e=function(){if(on)return rn;on=1;var n=Jt();return rn=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}}(),r=function(){if(an)return un;an=1;var n=Jt();return un=function(t){return n(this.__data__,t)>-1}}(),o=function(){if(ln)return cn;ln=1;var n=Jt();return cn=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,sn=i}function te(){if(_n)return bn;_n=1;var n="object"==typeof qt&&qt&&qt.Object===Object&&qt;return bn=n}function ee(){if(En)return xn;En=1;var n=te(),t="object"==typeof self&&self&&self.Object===Object&&self,e=n||t||Function("return this")();return xn=e}function re(){if(kn)return Sn;kn=1;var n=ee().Symbol;return Sn=n}function oe(){if(In)return jn;In=1;var n=re(),t=function(){if(Nn)return Cn;Nn=1;var n=re(),t=Object.prototype,e=t.hasOwnProperty,r=t.toString,o=n?n.toStringTag:void 0;return Cn=function(n){var t=e.call(n,o),i=n[o];try{n[o]=void 0;var u=!0}catch(n){}var a=r.call(n);return u&&(t?n[o]=i:delete n[o]),a}}(),e=function(){if(On)return Mn;On=1;var n=Object.prototype.toString;return Mn=function(t){return n.call(t)}}(),r=n?n.toStringTag:void 0;return jn=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":r&&r in Object(n)?t(n):e(n)}}function ie(){return An?Pn:(An=1,Pn=function(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)})}function ue(){if(Ln)return zn;Ln=1;var n=oe(),t=ie();return zn=function(e){if(!t(e))return!1;var r=n(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function ae(){if(Hn)return Vn;Hn=1;var n=Function.prototype.toString;return Vn=function(t){if(null!=t){try{return n.call(t)}catch(n){}try{return t+""}catch(n){}}return""}}function ce(){if(Wn)return Fn;Wn=1;var n=function(){if(Zn)return Yn;Zn=1;var n=ue(),t=function(){if(Rn)return Dn;Rn=1;var n,t=function(){if(Bn)return Tn;Bn=1;var n=ee()["__core-js_shared__"];return Tn=n}(),e=(n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Dn=function(n){return!!e&&e in n}}(),e=ie(),r=ae(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,u=Object.prototype,a=i.toString,c=u.hasOwnProperty,l=RegExp("^"+a.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Yn=function(i){return!(!e(i)||t(i))&&(n(i)?l:o).test(r(i))}}(),t=Un?Xn:(Un=1,Xn=function(n,t){return null==n?void 0:n[t]});return Fn=function(e,r){var o=t(e,r);return n(o)?o:void 0}}function le(){if(Gn)return $n;Gn=1;var n=ce()(ee(),"Map");return $n=n}function se(){if(Kn)return qn;Kn=1;var n=ce()(Object,"create");return qn=n}function fe(){if(pt)return vt;pt=1;var n=ht?dt:(ht=1,dt=function(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n});return vt=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}}function de(){if(kt)return St;kt=1;var n=function(){if(ft)return st;ft=1;var n=function(){if(lt)return ct;lt=1;var n=function(){if(Jn)return Qn;Jn=1;var n=se();return Qn=function(){this.__data__=n?n(null):{},this.size=0}}(),t=tt?nt:(tt=1,nt=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}),e=function(){if(rt)return et;rt=1;var n=se(),t=Object.prototype.hasOwnProperty;return et=function(e){var r=this.__data__;if(n){var o=r[e];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(r,e)?r[e]:void 0}}(),r=function(){if(it)return ot;it=1;var n=se(),t=Object.prototype.hasOwnProperty;return ot=function(e){var r=this.__data__;return n?void 0!==r[e]:t.call(r,e)}}(),o=function(){if(at)return ut;at=1;var n=se();return ut=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,ct=i}(),t=ne(),e=le();return st=function(){this.size=0,this.__data__={hash:new n,map:new(e||t),string:new n}}}(),t=function(){if(yt)return gt;yt=1;var n=fe();return gt=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}}(),e=function(){if(wt)return mt;wt=1;var n=fe();return mt=function(t){return n(this,t).get(t)}}(),r=function(){if(_t)return bt;_t=1;var n=fe();return bt=function(t){return n(this,t).has(t)}}(),o=function(){if(Et)return xt;Et=1;var n=fe();return xt=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}}();function i(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=t,i.prototype.get=e,i.prototype.has=r,i.prototype.set=o,St=i}function he(){if(Ot)return Mt;Ot=1;var n=ne(),t=function(){if(hn)return dn;hn=1;var n=ne();return dn=function(){this.__data__=new n,this.size=0}}(),e=pn?vn:(pn=1,vn=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e}),r=yn?gn:(yn=1,gn=function(n){return this.__data__.get(n)}),o=wn?mn:(wn=1,mn=function(n){return this.__data__.has(n)}),i=function(){if(Nt)return Ct;Nt=1;var n=ne(),t=le(),e=de();return Ct=function(r,o){var i=this.__data__;if(i instanceof n){var u=i.__data__;if(!t||u.length<199)return u.push([r,o]),this.size=++i.size,this;i=this.__data__=new e(u)}return i.set(r,o),this.size=i.size,this}}();function u(t){var e=this.__data__=new n(t);this.size=e.size}return u.prototype.clear=t,u.prototype.delete=e,u.prototype.get=r,u.prototype.has=o,u.prototype.set=i,Mt=u}function ve(){return It||(It=1,jt=function(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&!1!==t(n[e],e,n););return n}),jt}function pe(){if(At)return Pt;At=1;var n=ce(),t=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(n){}}();return Pt=t}function ge(){if(Lt)return zt;Lt=1;var n=pe();return zt=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}}function ye(){if(Bt)return Tt;Bt=1;var n=ge(),t=Qt(),e=Object.prototype.hasOwnProperty;return Tt=function(r,o,i){var u=r[o];e.call(r,o)&&t(u,i)&&(void 0!==i||o in r)||n(r,o,i)}}function me(){if(Rt)return Dt;Rt=1;var n=ye(),t=ge();return Dt=function(e,r,o,i){var u=!o;o||(o={});for(var a=-1,c=r.length;++a<c;){var l=r[a],s=i?i(o[l],e[l],l,o,e):void 0;void 0===s&&(s=e[l]),u?t(o,l,s):n(o,l,s)}return o}}function we(){return Zt?Yt:(Zt=1,Yt=function(n){return null!=n&&"object"==typeof n})}function be(){if(Wt)return Ft;Wt=1;var n=function(){if(Ut)return Xt;Ut=1;var n=oe(),t=we();return Xt=function(e){return t(e)&&"[object Arguments]"==n(e)}}(),t=we(),e=Object.prototype,r=e.hasOwnProperty,o=e.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return t(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return Ft=i}function _e(){if(Gt)return $t;Gt=1;var n=Array.isArray;return $t=n}var xe,Ee,Se,ke,Ce,Ne,Me,Oe,je,Ie,Pe,Ae={exports:{}};function ze(){return Se||(Se=1,function(n,t){var e=ee(),r=Ee?xe:(Ee=1,xe=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&n&&!n.nodeType&&n,u=i&&i.exports===o?e.Buffer:void 0,a=(u?u.isBuffer:void 0)||r;n.exports=a}(Ae,Ae.exports)),Ae.exports}function Le(){if(Ce)return ke;Ce=1;var n=/^(?:0|[1-9]\d*)$/;return ke=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}}function Te(){return Me?Ne:(Me=1,Ne=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Be(){return Pe?Ie:(Pe=1,Ie=function(n){return function(t){return n(t)}})}var De,Re,Ve,He,Ye,Ze,Xe,Ue,Fe,We,$e,Ge,qe,Ke,Qe,Je,nr,tr,er,rr,or,ir,ur,ar,cr,lr,sr,fr={exports:{}};function dr(){return De||(De=1,n=fr,t=fr.exports,e=te(),r=t&&!t.nodeType&&t,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r&&e.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(n){}}(),n.exports=u),fr.exports;var n,t,e,r,o,i,u}function hr(){if(Ve)return Re;Ve=1;var n=function(){if(je)return Oe;je=1;var n=oe(),t=Te(),e=we(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,Oe=function(o){return e(o)&&t(o.length)&&!!r[n(o)]}}(),t=Be(),e=dr(),r=e&&e.isTypedArray,o=r?t(r):n;return Re=o}function vr(){if(Ye)return He;Ye=1;var n=Ht?Vt:(Ht=1,Vt=function(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}),t=be(),e=_e(),r=ze(),o=Le(),i=hr(),u=Object.prototype.hasOwnProperty;return He=function(a,c){var l=e(a),s=!l&&t(a),f=!l&&!s&&r(a),d=!l&&!s&&!f&&i(a),h=l||s||f||d,v=h?n(a.length,String):[],p=v.length;for(var g in a)!c&&!u.call(a,g)||h&&("length"==g||f&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,p))||v.push(g);return v}}function pr(){if(Xe)return Ze;Xe=1;var n=Object.prototype;return Ze=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}}function gr(){return Fe||(Fe=1,Ue=function(n,t){return function(e){return n(t(e))}}),Ue}function yr(){if(qe)return Ge;qe=1;var n=pr(),t=function(){if($e)return We;$e=1;var n=gr()(Object.keys,Object);return We=n}(),e=Object.prototype.hasOwnProperty;return Ge=function(r){if(!n(r))return t(r);var o=[];for(var i in Object(r))e.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function mr(){if(Qe)return Ke;Qe=1;var n=ue(),t=Te();return Ke=function(e){return null!=e&&t(e.length)&&!n(e)}}function wr(){if(nr)return Je;nr=1;var n=vr(),t=yr(),e=mr();return Je=function(r){return e(r)?n(r):t(r)}}function br(){if(cr)return ar;cr=1;var n=vr(),t=function(){if(ur)return ir;ur=1;var n=ie(),t=pr(),e=or?rr:(or=1,rr=function(n){var t=[];if(null!=n)for(var e in Object(n))t.push(e);return t}),r=Object.prototype.hasOwnProperty;return ir=function(o){if(!n(o))return e(o);var i=t(o),u=[];for(var a in o)("constructor"!=a||!i&&r.call(o,a))&&u.push(a);return u}}(),e=mr();return ar=function(r){return e(r)?n(r,!0):t(r)}}var _r,xr,Er,Sr,kr,Cr,Nr,Mr,Or,jr,Ir,Pr,Ar,zr,Lr,Tr,Br,Dr,Rr,Vr,Hr,Yr,Zr,Xr,Ur,Fr,Wr,$r,Gr,qr,Kr,Qr,Jr,no,to,eo,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,bo,_o,xo,Eo,So,ko,Co,No,Mo,Oo,jo,Io,Po,Ao,zo,Lo,To,Bo,Do,Ro,Vo,Ho,Yo,Zo,Xo,Uo,Fo,Wo,$o,Go,qo,Ko,Qo,Jo,ni,ti,ei,ri,oi,ii,ui,ai,ci,li,si,fi,di,hi,vi,pi,gi,yi,mi,wi,bi,_i,xi,Ei,Si,ki,Ci,Ni,Mi,Oi,ji,Ii,Pi,Ai,zi,Li,Ti,Bi,Di,Ri,Vi,Hi,Yi,Zi,Xi,Ui,Fi,Wi,$i,Gi,qi,Ki,Qi,Ji,nu,tu,eu,ru,ou,iu,uu,au,cu,lu,su,fu,du,hu,vu,pu,gu,yu,mu,wu,bu,_u,xu,Eu,Su,ku,Cu,Nu,Mu,Ou,ju,Iu,Pu,Au,zu,Lu,Tu,Bu,Du,Ru,Vu,Hu,Yu,Zu,Xu,Uu,Fu,Wu,$u,Gu,qu,Ku,Qu,Ju,na,ta,ea,ra,oa,ia,ua,aa,ca,la,sa,fa,da,ha,va,pa,ga,ya,ma,wa,ba,_a,xa,Ea,Sa,ka,Ca,Na,Ma,Oa,ja,Ia,Pa,Aa,za,La,Ta,Ba,Da,Ra,Va,Ha,Ya,Za,Xa,Ua,Fa,Wa,$a,Ga,qa,Ka,Qa,Ja,nc,tc,ec,rc,oc,ic,uc,ac,cc,lc,sc,fc,dc,hc,vc,pc,gc,yc,mc,wc,bc,_c,xc,Ec,Sc,kc,Cc,Nc,Mc,Oc,jc,Ic,Pc={exports:{}};function Ac(){return _r||(_r=1,function(n,t){var e=ee(),r=t&&!t.nodeType&&t,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?e.Buffer:void 0,u=i?i.allocUnsafe:void 0;n.exports=function(n,t){if(t)return n.slice();var e=n.length,r=u?u(e):new n.constructor(e);return n.copy(r),r}}(Pc,Pc.exports)),Pc.exports}function zc(){return Er||(Er=1,xr=function(n,t){var e=-1,r=n.length;for(t||(t=Array(r));++e<r;)t[e]=n[e];return t}),xr}function Lc(){return kr||(kr=1,Sr=function(n,t){for(var e=-1,r=null==n?0:n.length,o=0,i=[];++e<r;){var u=n[e];t(u,e,n)&&(i[o++]=u)}return i}),Sr}function Tc(){return Nr?Cr:(Nr=1,Cr=function(){return[]})}function Bc(){if(Or)return Mr;Or=1;var n=Lc(),t=Tc(),e=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Mr=r?function(t){return null==t?[]:(t=Object(t),n(r(t),(function(n){return e.call(t,n)})))}:t}function Dc(){return Ar||(Ar=1,Pr=function(n,t){for(var e=-1,r=t.length,o=n.length;++e<r;)n[o+e]=t[e];return n}),Pr}function Rc(){if(Lr)return zr;Lr=1;var n=gr()(Object.getPrototypeOf,Object);return zr=n}function Vc(){if(Br)return Tr;Br=1;var n=Dc(),t=Rc(),e=Bc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)n(o,e(r)),r=t(r);return o}:r}function Hc(){if(Hr)return Vr;Hr=1;var n=Dc(),t=_e();return Vr=function(e,r,o){var i=r(e);return t(e)?i:n(i,o(e))}}function Yc(){if(Zr)return Yr;Zr=1;var n=Hc(),t=Bc(),e=wr();return Yr=function(r){return n(r,e,t)}}function Zc(){if(Kr)return qr;Kr=1;var n=ce()(ee(),"Set");return qr=n}function Xc(){if(to)return no;to=1;var n=function(){if(Wr)return Fr;Wr=1;var n=ce()(ee(),"DataView");return Fr=n}(),t=le(),e=function(){if(Gr)return $r;Gr=1;var n=ce()(ee(),"Promise");return $r=n}(),r=Zc(),o=function(){if(Jr)return Qr;Jr=1;var n=ce()(ee(),"WeakMap");return Qr=n}(),i=oe(),u=ae(),a="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",d=u(n),h=u(t),v=u(e),p=u(r),g=u(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=f||t&&y(new t)!=a||e&&y(e.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var t=i(n),e="[object Object]"==t?n.constructor:void 0,r=e?u(e):"";if(r)switch(r){case d:return f;case h:return a;case v:return c;case p:return l;case g:return s}return t}),no=y}function Uc(){if(io)return oo;io=1;var n=ee().Uint8Array;return oo=n}function Fc(){if(ao)return uo;ao=1;var n=Uc();return uo=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}}function Wc(){if(go)return po;go=1;var n=Fc();return po=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}}function $c(){if(bo)return wo;bo=1;var n=ie(),t=Object.create,e=function(){function e(){}return function(r){if(!n(r))return{};if(t)return t(r);e.prototype=r;var o=new e;return e.prototype=void 0,o}}();return wo=e}function Gc(){if(xo)return _o;xo=1;var n=$c(),t=Rc(),e=pr();return _o=function(r){return"function"!=typeof r.constructor||e(r)?{}:n(t(r))}}function qc(){if(Po)return Io;Po=1;var n=he(),t=ve(),e=ye(),r=function(){if(er)return tr;er=1;var n=me(),t=wr();return tr=function(e,r){return e&&n(r,t(r),e)}}(),o=function(){if(sr)return lr;sr=1;var n=me(),t=br();return lr=function(e,r){return e&&n(r,t(r),e)}}(),i=Ac(),u=zc(),a=function(){if(Ir)return jr;Ir=1;var n=me(),t=Bc();return jr=function(e,r){return n(e,t(e),r)}}(),c=function(){if(Rr)return Dr;Rr=1;var n=me(),t=Vc();return Dr=function(e,r){return n(e,t(e),r)}}(),l=Yc(),s=function(){if(Ur)return Xr;Ur=1;var n=Hc(),t=Vc(),e=br();return Xr=function(r){return n(r,e,t)}}(),f=Xc(),d=function(){if(ro)return eo;ro=1;var n=Object.prototype.hasOwnProperty;return eo=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r},eo}(),h=function(){if(mo)return yo;mo=1;var n=Fc(),t=function(){if(lo)return co;lo=1;var n=Fc();return co=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}}(),e=function(){if(fo)return so;fo=1;var n=/\w*$/;return so=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}}(),r=function(){if(vo)return ho;vo=1;var n=re(),t=n?n.prototype:void 0,e=t?t.valueOf:void 0;return ho=function(n){return e?Object(e.call(n)):{}}}(),o=Wc();return yo=function(i,u,a){var c=i.constructor;switch(u){case"[object ArrayBuffer]":return n(i);case"[object Boolean]":case"[object Date]":return new c(+i);case"[object DataView]":return t(i,a);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,a);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(i);case"[object RegExp]":return e(i);case"[object Symbol]":return r(i)}}}(),v=Gc(),p=_e(),g=ze(),y=function(){if(Co)return ko;Co=1;var n=function(){if(So)return Eo;So=1;var n=Xc(),t=we();return Eo=function(e){return t(e)&&"[object Map]"==n(e)}}(),t=Be(),e=dr(),r=e&&e.isMap,o=r?t(r):n;return ko=o}(),m=ie(),w=function(){if(jo)return Oo;jo=1;var n=function(){if(Mo)return No;Mo=1;var n=Xc(),t=we();return No=function(e){return t(e)&&"[object Set]"==n(e)}}(),t=Be(),e=dr(),r=e&&e.isSet,o=r?t(r):n;return Oo=o}(),b=wr(),_=br(),x="[object Arguments]",E="[object Function]",S="[object Object]",k={};return k[x]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[S]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[E]=k["[object WeakMap]"]=!1,Io=function C(N,M,O,j,I,P){var A,z=1&M,L=2&M,T=4&M;if(O&&(A=I?O(N,j,I,P):O(N)),void 0!==A)return A;if(!m(N))return N;var B=p(N);if(B){if(A=d(N),!z)return u(N,A)}else{var D=f(N),R=D==E||"[object GeneratorFunction]"==D;if(g(N))return i(N,z);if(D==S||D==x||R&&!I){if(A=L||R?{}:v(N),!z)return L?c(N,o(A,N)):a(N,r(A,N))}else{if(!k[D])return I?N:{};A=h(N,D,z)}}P||(P=new n);var V=P.get(N);if(V)return V;P.set(N,A),w(N)?N.forEach((function(n){A.add(C(n,M,O,n,N,P))})):y(N)&&N.forEach((function(n,t){A.set(t,C(n,M,O,t,N,P))}));var H=B?void 0:(T?L?s:l:L?_:b)(N);return t(H||N,(function(n,t){H&&(n=N[t=n]),e(A,t,C(n,M,O,t,N,P))})),A},Io}function Kc(){if(zo)return Ao;zo=1;var n=qc();return Ao=function(t){return n(t,4)}}function Qc(){return To?Lo:(To=1,Lo=function(n){return function(){return n}})}function Jc(){if(Vo)return Ro;Vo=1;var n=(Do?Bo:(Do=1,Bo=function(n){return function(t,e,r){for(var o=-1,i=Object(t),u=r(t),a=u.length;a--;){var c=u[n?a:++o];if(!1===e(i[c],c,i))break}return t}}))();return Ro=n}function nl(){if(Yo)return Ho;Yo=1;var n=Jc(),t=wr();return Ho=function(e,r){return e&&n(e,r,t)}}function tl(){if(Fo)return Uo;Fo=1;var n=nl(),t=function(){if(Xo)return Zo;Xo=1;var n=mr();return Zo=function(t,e){return function(r,o){if(null==r)return r;if(!n(r))return t(r,o);for(var i=r.length,u=e?i:-1,a=Object(r);(e?u--:++u<i)&&!1!==o(a[u],u,a););return r}}}()(n);return Uo=t}function el(){return $o?Wo:($o=1,Wo=function(n){return n})}function rl(){if(qo)return Go;qo=1;var n=el();return Go=function(t){return"function"==typeof t?t:n}}function ol(){if(Qo)return Ko;Qo=1;var n=ve(),t=tl(),e=rl(),r=_e();return Ko=function(o,i){return(r(o)?n:t)(o,e(i))}}function il(){return ni?Jo:(ni=1,Jo=ol())}function ul(){if(ci)return ai;ci=1;var n=de(),t=oi?ri:(oi=1,ri=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),e=ui?ii:(ui=1,ii=function(n){return this.__data__.has(n)});function r(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new n;++e<r;)this.add(t[e])}return r.prototype.add=r.prototype.push=t,r.prototype.has=e,ai=r}function al(){return di?fi:(di=1,fi=function(n,t){return n.has(t)})}function cl(){if(vi)return hi;vi=1;var n=ul(),t=(si||(si=1,li=function(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}),li),e=al();return hi=function(r,o,i,u,a,c){var l=1&i,s=r.length,f=o.length;if(s!=f&&!(l&&f>s))return!1;var d=c.get(r),h=c.get(o);if(d&&h)return d==o&&h==r;var v=-1,p=!0,g=2&i?new n:void 0;for(c.set(r,o),c.set(o,r);++v<s;){var y=r[v],m=o[v];if(u)var w=l?u(m,y,v,o,r,c):u(y,m,v,r,o,c);if(void 0!==w){if(w)continue;p=!1;break}if(g){if(!t(o,(function(n,t){if(!e(g,t)&&(y===n||a(y,n,i,u,c)))return g.push(t)}))){p=!1;break}}else if(y!==m&&!a(y,m,i,u,c)){p=!1;break}}return c.delete(r),c.delete(o),p},hi}function ll(){return mi||(mi=1,yi=function(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=n})),e}),yi}function sl(){if(Si)return Ei;Si=1;var n=he(),t=cl(),e=function(){if(bi)return wi;bi=1;var n=re(),t=Uc(),e=Qt(),r=cl(),o=gi?pi:(gi=1,pi=function(n){var t=-1,e=Array(n.size);return n.forEach((function(n,r){e[++t]=[r,n]})),e}),i=ll(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return wi=function(n,u,c,l,s,f,d){switch(c){case"[object DataView]":if(n.byteLength!=u.byteLength||n.byteOffset!=u.byteOffset)return!1;n=n.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=u.byteLength||!f(new t(n),new t(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return e(+n,+u);case"[object Error]":return n.name==u.name&&n.message==u.message;case"[object RegExp]":case"[object String]":return n==u+"";case"[object Map]":var h=o;case"[object Set]":var v=1&l;if(h||(h=i),n.size!=u.size&&!v)return!1;var p=d.get(n);if(p)return p==u;l|=2,d.set(n,u);var g=r(h(n),h(u),l,s,f,d);return d.delete(n),g;case"[object Symbol]":if(a)return a.call(n)==a.call(u)}return!1}}(),r=function(){if(xi)return _i;xi=1;var n=Yc(),t=Object.prototype.hasOwnProperty;return _i=function(e,r,o,i,u,a){var c=1&o,l=n(e),s=l.length;if(s!=n(r).length&&!c)return!1;for(var f=s;f--;){var d=l[f];if(!(c?d in r:t.call(r,d)))return!1}var h=a.get(e),v=a.get(r);if(h&&v)return h==r&&v==e;var p=!0;a.set(e,r),a.set(r,e);for(var g=c;++f<s;){var y=e[d=l[f]],m=r[d];if(i)var w=c?i(m,y,d,r,e,a):i(y,m,d,e,r,a);if(!(void 0===w?y===m||u(y,m,o,i,a):w)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,_=r.constructor;b==_||!("constructor"in e)||!("constructor"in r)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(e),a.delete(r),p}}(),o=Xc(),i=_e(),u=ze(),a=hr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return Ei=function(d,h,v,p,g,y){var m=i(d),w=i(h),b=m?l:o(d),_=w?l:o(h),x=(b=b==c?s:b)==s,E=(_=_==c?s:_)==s,S=b==_;if(S&&u(d)){if(!u(h))return!1;m=!0,x=!1}if(S&&!x)return y||(y=new n),m||a(d)?t(d,h,v,p,g,y):e(d,h,b,v,p,g,y);if(!(1&v)){var k=x&&f.call(d,"__wrapped__"),C=E&&f.call(h,"__wrapped__");if(k||C){var N=k?d.value():d,M=C?h.value():h;return y||(y=new n),g(N,M,v,p,y)}}return!!S&&(y||(y=new n),r(d,h,v,p,g,y))}}function fl(){if(Ci)return ki;Ci=1;var n=sl(),t=we();return ki=function e(r,o,i,u,a){return r===o||(null==r||null==o||!t(r)&&!t(o)?r!=r&&o!=o:n(r,o,i,u,e,a))},ki}function dl(){if(ji)return Oi;ji=1;var n=ie();return Oi=function(t){return t==t&&!n(t)}}function hl(){return zi?Ai:(zi=1,Ai=function(n,t){return function(e){return null!=e&&e[n]===t&&(void 0!==t||n in Object(e))}})}function vl(){if(Di)return Bi;Di=1;var n=oe(),t=we();return Bi=function(e){return"symbol"==typeof e||t(e)&&"[object Symbol]"==n(e)}}function pl(){if(Vi)return Ri;Vi=1;var n=_e(),t=vl(),e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Ri=function(o,i){if(n(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!t(o))||r.test(o)||!e.test(o)||null!=i&&o in Object(i)}}function gl(){return $i||($i=1,Wi=function(n,t){for(var e=-1,r=null==n?0:n.length,o=Array(r);++e<r;)o[e]=t(n[e],e,n);return o}),Wi}function yl(){if(Qi)return Ki;Qi=1;var n=function(){if(qi)return Gi;qi=1;var n=re(),t=gl(),e=_e(),r=vl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return Gi=function n(o){if("string"==typeof o)return o;if(e(o))return t(o,n)+"";if(r(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},Gi}();return Ki=function(t){return null==t?"":n(t)}}function ml(){if(nu)return Ji;nu=1;var n=_e(),t=pl(),e=function(){if(Fi)return Ui;Fi=1;var n=function(){if(Xi)return Zi;Xi=1;var n=function(){if(Yi)return Hi;Yi=1;var n=de();function t(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,t=r?r.apply(this,n):n[0],i=o.cache;if(i.has(t))return i.get(t);var u=e.apply(this,n);return o.cache=i.set(t,u)||i,u};return o.cache=new(t.Cache||n),o}return t.Cache=n,Hi=t}();return Zi=function(t){var e=n(t,(function(n){return 500===r.size&&r.clear(),n})),r=e.cache;return e}}(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(t,(function(n,t,o,i){r.push(o?i.replace(e,"$1"):t||n)})),r}));return Ui=r}(),r=yl();return Ji=function(o,i){return n(o)?o:t(o,i)?[o]:e(r(o))}}function wl(){if(eu)return tu;eu=1;var n=vl();return tu=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}}function bl(){if(ou)return ru;ou=1;var n=ml(),t=wl();return ru=function(e,r){for(var o=0,i=(r=n(r,e)).length;null!=e&&o<i;)e=e[t(r[o++])];return o&&o==i?e:void 0}}function _l(){if(su)return lu;su=1;var n=ml(),t=be(),e=_e(),r=Le(),o=Te(),i=wl();return lu=function(u,a,c){for(var l=-1,s=(a=n(a,u)).length,f=!1;++l<s;){var d=i(a[l]);if(!(f=null!=u&&c(u,d)))break;u=u[d]}return f||++l!=s?f:!!(s=null==u?0:u.length)&&o(s)&&r(d,s)&&(e(u)||t(u))}}function xl(){if(du)return fu;du=1;var n=cu?au:(cu=1,au=function(n,t){return null!=n&&t in Object(n)}),t=_l();return fu=function(e,r){return null!=e&&t(e,r,n)}}function El(){return gu?pu:(gu=1,pu=function(n){return function(t){return null==t?void 0:t[n]}})}function Sl(){if(xu)return _u;xu=1;var n=function(){if(Ti)return Li;Ti=1;var n=function(){if(Mi)return Ni;Mi=1;var n=he(),t=fl();return Ni=function(e,r,o,i){var u=o.length,a=u,c=!i;if(null==e)return!a;for(e=Object(e);u--;){var l=o[u];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++u<a;){var s=(l=o[u])[0],f=e[s],d=l[1];if(c&&l[2]){if(void 0===f&&!(s in e))return!1}else{var h=new n;if(i)var v=i(f,d,s,e,r,h);if(!(void 0===v?t(d,f,3,i,h):v))return!1}}return!0}}(),t=function(){if(Pi)return Ii;Pi=1;var n=dl(),t=wr();return Ii=function(e){for(var r=t(e),o=r.length;o--;){var i=r[o],u=e[i];r[o]=[i,u,n(u)]}return r}}(),e=hl();return Li=function(r){var o=t(r);return 1==o.length&&o[0][2]?e(o[0][0],o[0][1]):function(t){return t===r||n(t,r,o)}}}(),t=function(){if(vu)return hu;vu=1;var n=fl(),t=function(){if(uu)return iu;uu=1;var n=bl();return iu=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}}(),e=xl(),r=pl(),o=dl(),i=hl(),u=wl();return hu=function(a,c){return r(a)&&o(c)?i(u(a),c):function(r){var o=t(r,a);return void 0===o&&o===c?e(r,a):n(c,o,3)}}}(),e=el(),r=_e(),o=function(){if(bu)return wu;bu=1;var n=El(),t=function(){if(mu)return yu;mu=1;var n=bl();return yu=function(t){return function(e){return n(e,t)}}}(),e=pl(),r=wl();return wu=function(o){return e(o)?n(r(o)):t(o)}}();return _u=function(i){return"function"==typeof i?i:null==i?e:"object"==typeof i?r(i)?t(i[0],i[1]):n(i):o(i)}}function kl(){if(Su)return Eu;Su=1;var n=Lc(),t=function(){if(ei)return ti;ei=1;var n=tl();return ti=function(t,e){var r=[];return n(t,(function(n,t,o){e(n,t,o)&&r.push(n)})),r}}(),e=Sl(),r=_e();return Eu=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function Cl(){if(Mu)return Nu;Mu=1;var n=function(){if(Cu)return ku;Cu=1;var n=Object.prototype.hasOwnProperty;return ku=function(t,e){return null!=t&&n.call(t,e)}}(),t=_l();return Nu=function(e,r){return null!=e&&t(e,r,n)}}function Nl(){if(ju)return Ou;ju=1;var n=yr(),t=Xc(),e=be(),r=_e(),o=mr(),i=ze(),u=pr(),a=hr(),c=Object.prototype.hasOwnProperty;return Ou=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||a(l)||e(l)))return!l.length;var s=t(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(u(l))return!n(l).length;for(var f in l)if(c.call(l,f))return!1;return!0}}function Ml(){return Pu?Iu:(Pu=1,Iu=function(n){return void 0===n})}function Ol(){if(zu)return Au;zu=1;var n=tl(),t=mr();return Au=function(e,r){var o=-1,i=t(e)?Array(e.length):[];return n(e,(function(n,t,e){i[++o]=r(n,t,e)})),i}}function jl(){if(Tu)return Lu;Tu=1;var n=gl(),t=Sl(),e=Ol(),r=_e();return Lu=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function Il(){if(Yu)return Hu;Yu=1;var n=(Du||(Du=1,Bu=function(n,t,e,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);return e}),Bu),t=tl(),e=Sl(),r=Vu?Ru:(Vu=1,Ru=function(n,t,e,r,o){return o(n,(function(n,o,i){e=r?(r=!1,n):t(e,n,o,i)})),e}),o=_e();return Hu=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,e(u,4),a,l,t)},Hu}function Pl(){if(na)return Ju;na=1;var n=yr(),t=Xc(),e=mr(),r=function(){if(Xu)return Zu;Xu=1;var n=oe(),t=_e(),e=we();return Zu=function(r){return"string"==typeof r||!t(r)&&e(r)&&"[object String]"==n(r)}}(),o=function(){if(Qu)return Ku;Qu=1;var n=function(){if(Fu)return Uu;Fu=1;var n=El()("length");return Uu=n}(),t=function(){if($u)return Wu;$u=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Wu=function(t){return n.test(t)}}(),e=function(){if(qu)return Gu;qu=1;var n="\\ud800-\\udfff",t="["+n+"]",e="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+e+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+c+a+")*",s="(?:"+[o+e+"?",e,i,u,t].join("|")+")",f=RegExp(r+"(?="+r+")|"+s+l,"g");return Gu=function(n){for(var t=f.lastIndex=0;f.test(n);)++t;return t}}();return Ku=function(r){return t(r)?e(r):n(r)}}();return Ju=function(i){if(null==i)return 0;if(e(i))return r(i)?o(i):i.length;var u=t(i);return"[object Map]"==u||"[object Set]"==u?i.size:n(i).length}}function Al(){if(ea)return ta;ea=1;var n=ve(),t=$c(),e=nl(),r=Sl(),o=Rc(),i=_e(),u=ze(),a=ue(),c=ie(),l=hr();return ta=function(s,f,d){var h=i(s),v=h||u(s)||l(s);if(f=r(f,4),null==d){var p=s&&s.constructor;d=v?h?new p:[]:c(s)&&a(p)?t(o(s)):{}}return(v?n:e)(s,(function(n,t,e){return f(d,n,t,e)})),d}}function zl(){if(ua)return ia;ua=1;var n=Dc(),t=function(){if(oa)return ra;oa=1;var n=re(),t=be(),e=_e(),r=n?n.isConcatSpreadable:void 0;return ra=function(n){return e(n)||t(n)||!!(r&&n&&n[r])}}();return ia=function e(r,o,i,u,a){var c=-1,l=r.length;for(i||(i=t),a||(a=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?e(s,o-1,i,u,a):n(a,s):u||(a[a.length]=s)}return a},ia}function Ll(){if(sa)return la;sa=1;var n=ca?aa:(ca=1,aa=function(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}),t=Math.max;return la=function(e,r,o){return r=t(void 0===r?e.length-1:r,0),function(){for(var i=arguments,u=-1,a=t(i.length-r,0),c=Array(a);++u<a;)c[u]=i[r+u];u=-1;for(var l=Array(r+1);++u<r;)l[u]=i[u];return l[r]=o(c),n(e,this,l)}},la}function Tl(){if(ga)return pa;ga=1;var n=function(){if(da)return fa;da=1;var n=Qc(),t=pe(),e=el();return fa=t?function(e,r){return t(e,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:e}(),t=function(){if(va)return ha;va=1;var n=Date.now;return ha=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},ha}(),e=t(n);return pa=e}function Bl(){if(ma)return ya;ma=1;var n=el(),t=Ll(),e=Tl();return ya=function(r,o){return e(t(r,o,n),r+"")},ya}function Dl(){return ba||(ba=1,wa=function(n,t,e,r){for(var o=n.length,i=e+(r?1:-1);r?i--:++i<o;)if(t(n[i],i,n))return i;return-1}),wa}function Rl(){if(Ta)return La;Ta=1;var n=ul(),t=function(){if(Ma)return Na;Ma=1;var n=function(){if(Ca)return ka;Ca=1;var n=Dl(),t=xa?_a:(xa=1,_a=function(n){return n!=n}),e=(Sa||(Sa=1,Ea=function(n,t,e){for(var r=e-1,o=n.length;++r<o;)if(n[r]===t)return r;return-1}),Ea);return ka=function(r,o,i){return o==o?e(r,o,i):n(r,t,i)},ka}();return Na=function(t,e){return!(null==t||!t.length)&&n(t,e,0)>-1},Na}(),e=(ja||(ja=1,Oa=function(n,t,e){for(var r=-1,o=null==n?0:n.length;++r<o;)if(e(t,n[r]))return!0;return!1}),Oa),r=al(),o=function(){if(za)return Aa;za=1;var n=Zc(),t=Pa?Ia:(Pa=1,Ia=function(){}),e=ll(),r=n&&1/e(new n([,-0]))[1]==1/0?function(t){return new n(t)}:t;return Aa=r}(),i=ll();return La=function(u,a,c){var l=-1,s=t,f=u.length,d=!0,h=[],v=h;if(c)d=!1,s=e;else if(f>=200){var p=a?null:o(u);if(p)return i(p);d=!1,s=r,v=new n}else v=a?[]:h;n:for(;++l<f;){var g=u[l],y=a?a(g):g;if(g=c||0!==g?g:0,d&&y==y){for(var m=v.length;m--;)if(v[m]===y)continue n;a&&v.push(y),h.push(g)}else s(v,y,c)||(v!==h&&v.push(y),h.push(g))}return h},La}function Vl(){if(Da)return Ba;Da=1;var n=mr(),t=we();return Ba=function(e){return t(e)&&n(e)}}function Hl(){if(Va)return Ra;Va=1;var n=zl(),t=Bl(),e=Rl(),r=Vl(),o=t((function(t){return e(n(t,1,r,!0))}));return Ra=o}function Yl(){if(Xa)return Za;Xa=1;var n=function(){if(Ya)return Ha;Ya=1;var n=gl();return Ha=function(t,e){return n(e,(function(n){return t[n]}))}}(),t=wr();return Za=function(e){return null==e?[]:n(e,t(e))}}function Zl(){if(Fa)return Ua;var n;Fa=1;try{n={clone:Kc(),constant:Qc(),each:il(),filter:kl(),has:Cl(),isArray:_e(),isEmpty:Nl(),isFunction:ue(),isUndefined:Ml(),keys:wr(),map:jl(),reduce:Il(),size:Pl(),transform:Al(),union:Hl(),values:Yl()}}catch(n){}return n||(n=window._),Ua=n}function Xl(){if($a)return Wa;$a=1;var n=Zl();Wa=e;var t="\0";function e(e){this._isDirected=!n.has(e,"directed")||e.directed,this._isMultigraph=!!n.has(e,"multigraph")&&e.multigraph,this._isCompound=!!n.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(n,t){n[t]?n[t]++:n[t]=1}function o(n,t){--n[t]||delete n[t]}function i(t,e,r,o){var i=""+e,u=""+r;if(!t&&i>u){var a=i;i=u,u=a}return i+""+u+""+(n.isUndefined(o)?"\0":o)}function u(n,t){return i(n,t.v,t.w,t.name)}return e.prototype._nodeCount=0,e.prototype._edgeCount=0,e.prototype.isDirected=function(){return this._isDirected},e.prototype.isMultigraph=function(){return this._isMultigraph},e.prototype.isCompound=function(){return this._isCompound},e.prototype.setGraph=function(n){return this._label=n,this},e.prototype.graph=function(){return this._label},e.prototype.setDefaultNodeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultNodeLabelFn=t,this},e.prototype.nodeCount=function(){return this._nodeCount},e.prototype.nodes=function(){return n.keys(this._nodes)},e.prototype.sources=function(){var t=this;return n.filter(this.nodes(),(function(e){return n.isEmpty(t._in[e])}))},e.prototype.sinks=function(){var t=this;return n.filter(this.nodes(),(function(e){return n.isEmpty(t._out[e])}))},e.prototype.setNodes=function(t,e){var r=arguments,o=this;return n.each(t,(function(n){r.length>1?o.setNode(n,e):o.setNode(n)})),this},e.prototype.setNode=function(e,r){return n.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=t,this._children[e]={},this._children[t][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},e.prototype.node=function(n){return this._nodes[n]},e.prototype.hasNode=function(t){return n.has(this._nodes,t)},e.prototype.removeNode=function(t){var e=this;if(n.has(this._nodes,t)){var r=function(n){e.removeEdge(e._edgeObjs[n])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],n.each(this.children(t),(function(n){e.setParent(n)})),delete this._children[t]),n.each(n.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],n.each(n.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},e.prototype.setParent=function(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(r))r=t;else{for(var o=r+="";!n.isUndefined(o);o=this.parent(o))if(o===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this},e.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},e.prototype.parent=function(n){if(this._isCompound){var e=this._parent[n];if(e!==t)return e}},e.prototype.children=function(e){if(n.isUndefined(e)&&(e=t),this._isCompound){var r=this._children[e];if(r)return n.keys(r)}else{if(e===t)return this.nodes();if(this.hasNode(e))return[]}},e.prototype.predecessors=function(t){var e=this._preds[t];if(e)return n.keys(e)},e.prototype.successors=function(t){var e=this._sucs[t];if(e)return n.keys(e)},e.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return n.union(e,this.successors(t))},e.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},e.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),n.each(this._edgeObjs,(function(n){e.hasNode(n.v)&&e.hasNode(n.w)&&e.setEdge(n,r.edge(n))}));var o={};function i(n){var t=r.parent(n);return void 0===t||e.hasNode(t)?(o[n]=t,t):t in o?o[t]:i(t)}return this._isCompound&&n.each(e.nodes(),(function(n){e.setParent(n,i(n))})),e},e.prototype.setDefaultEdgeLabel=function(t){return n.isFunction(t)||(t=n.constant(t)),this._defaultEdgeLabelFn=t,this},e.prototype.edgeCount=function(){return this._edgeCount},e.prototype.edges=function(){return n.values(this._edgeObjs)},e.prototype.setPath=function(t,e){var r=this,o=arguments;return n.reduce(t,(function(n,t){return o.length>1?r.setEdge(n,t,e):r.setEdge(n,t),t})),this},e.prototype.setEdge=function(){var t,e,o,u,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(t=c.v,e=c.w,o=c.name,2===arguments.length&&(u=arguments[1],a=!0)):(t=c,e=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),t=""+t,e=""+e,n.isUndefined(o)||(o=""+o);var l=i(this._isDirected,t,e,o);if(n.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=u),this;if(!n.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=a?u:this._defaultEdgeLabelFn(t,e,o);var s=function(n,t,e,r){var o=""+t,i=""+e;if(!n&&o>i){var u=o;o=i,i=u}var a={v:o,w:i};return r&&(a.name=r),a}(this._isDirected,t,e,o);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[l]=s,r(this._preds[e],t),r(this._sucs[t],e),this._in[e][l]=s,this._out[t][l]=s,this._edgeCount++,this},e.prototype.edge=function(n,t,e){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,t,e);return this._edgeLabels[r]},e.prototype.hasEdge=function(t,e,r){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,t,e,r);return n.has(this._edgeLabels,o)},e.prototype.removeEdge=function(n,t,e){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,t,e),a=this._edgeObjs[r];return a&&(n=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[t],n),o(this._sucs[n],t),delete this._in[t][r],delete this._out[n][r],this._edgeCount--),this},e.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var o=n.values(r);return e?n.filter(o,(function(n){return n.v===e})):o}},e.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var o=n.values(r);return e?n.filter(o,(function(n){return n.w===e})):o}},e.prototype.nodeEdges=function(n,t){var e=this.inEdges(n,t);if(e)return e.concat(this.outEdges(n,t))},Wa}function Ul(){if(nc)return Ja;nc=1;var n=Zl(),t=Xl();function e(t){return n.map(t.nodes(),(function(e){var r=t.node(e),o=t.parent(e),i={v:e};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(t){return n.map(t.edges(),(function(e){var r=t.edge(e),o={v:e.v,w:e.w};return n.isUndefined(e.name)||(o.name=e.name),n.isUndefined(r)||(o.value=r),o}))}return Ja={write:function(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:e(t),edges:r(t)};return n.isUndefined(t.graph())||(o.value=n.clone(t.graph())),o},read:function(e){var r=new t(e.options).setGraph(e.value);return n.each(e.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(e.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Fl(){if(ec)return tc;ec=1;var n=Zl();return tc=function(t){var e,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,e.push(o),n.each(t.successors(o),i),n.each(t.predecessors(o),i))}return n.each(t.nodes(),(function(n){e=[],i(n),e.length&&o.push(e)})),o},tc}function Wl(){if(oc)return rc;oc=1;var n=Zl();function t(){this._arr=[],this._keyIndices={}}return rc=t,t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},t.prototype.has=function(t){return n.has(this._keyIndices,t)},t.prototype.priority=function(n){var t=this._keyIndices[n];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!n.has(r,t)){var o=this._arr,i=o.length;return r[t]=i,o.push({key:t,priority:e}),this._decrease(i),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,t){var e=this._keyIndices[n];if(t>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[e].priority+" New: "+t);this._arr[e].priority=t,this._decrease(e)},t.prototype._heapify=function(n){var t=this._arr,e=2*n,r=e+1,o=n;e<t.length&&(o=t[e].priority<t[o].priority?e:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},t.prototype._decrease=function(n){for(var t,e=this._arr,r=e[n].priority;0!==n&&!(e[t=n>>1].priority<r);)this._swap(n,t),n=t},t.prototype._swap=function(n,t){var e=this._arr,r=this._keyIndices,o=e[n],i=e[t];e[n]=i,e[t]=o,r[i.key]=n,r[o.key]=t},rc}function $l(){if(uc)return ic;uc=1;var n=Zl(),t=Wl();ic=function(n,r,o,i){return function(n,e,r,o){var i,u,a={},c=new t,l=function(n){var t=n.v!==i?n.v:n.w,e=a[t],o=r(n),l=u.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+n+" Weight: "+o);l<e.distance&&(e.distance=l,e.predecessor=i,c.decrease(t,l))};for(n.nodes().forEach((function(n){var t=n===e?0:Number.POSITIVE_INFINITY;a[n]={distance:t},c.add(n,t)}));c.size()>0&&(i=c.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return a}(n,String(r),o||e,i||function(t){return n.outEdges(t)})};var e=n.constant(1);return ic}function Gl(){if(cc)return ac;cc=1;var n=$l(),t=Zl();return ac=function(e,r,o){return t.transform(e.nodes(),(function(t,i){t[i]=n(e,i,r,o)}),{})}}function ql(){if(sc)return lc;sc=1;var n=Zl();return lc=function(t){var e=0,r=[],o={},i=[];function u(a){var c=o[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach((function(t){n.has(o,t)?o[t].onStack&&(c.lowlink=Math.min(c.lowlink,o[t].index)):(u(t),c.lowlink=Math.min(c.lowlink,o[t].lowlink))})),c.lowlink===c.index){var l,s=[];do{l=r.pop(),o[l].onStack=!1,s.push(l)}while(a!==l);i.push(s)}}return t.nodes().forEach((function(t){n.has(o,t)||u(t)})),i},lc}function Kl(){if(dc)return fc;dc=1;var n=Zl(),t=ql();return fc=function(e){return n.filter(t(e),(function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])}))}}function Ql(){if(vc)return hc;vc=1;var n=Zl();hc=function(n,e,r){return function(n,t,e){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(t){n!==t&&(r[n][t]={distance:Number.POSITIVE_INFINITY})})),e(n).forEach((function(e){var o=e.v===n?e.w:e.v,i=t(e);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var t=r[n];o.forEach((function(e){var i=r[e];o.forEach((function(e){var r=i[n],o=t[e],u=i[e],a=r.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)}))}))})),r}(n,e||t,r||function(t){return n.outEdges(t)})};var t=n.constant(1);return hc}function Jl(){if(gc)return pc;gc=1;var n=Zl();function t(t){var r={},o={},i=[];if(n.each(t.sinks(),(function u(a){if(n.has(o,a))throw new e;n.has(r,a)||(o[a]=!0,r[a]=!0,n.each(t.predecessors(a),u),delete o[a],i.push(a))})),n.size(r)!==t.nodeCount())throw new e;return i}function e(){}return pc=t,t.CycleException=e,e.prototype=new Error,pc}function ns(){if(mc)return yc;mc=1;var n=Jl();return yc=function(t){try{n(t)}catch(t){if(t instanceof n.CycleException)return!1;throw t}return!0}}function ts(){if(bc)return wc;bc=1;var n=Zl();function t(e,r,o,i,u,a){n.has(i,r)||(i[r]=!0,o||a.push(r),n.each(u(r),(function(n){t(e,n,o,i,u,a)})),o&&a.push(r))}return wc=function(e,r,o){n.isArray(r)||(r=[r]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),u=[],a={};return n.each(r,(function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);t(e,n,"post"===o,a,i,u)})),u},wc}function es(){if(xc)return _c;xc=1;var n=ts();return _c=function(t,e){return n(t,e,"post")}}function rs(){if(Sc)return Ec;Sc=1;var n=ts();return Ec=function(t,e){return n(t,e,"pre")}}function os(){if(Cc)return kc;Cc=1;var n=Zl(),t=Xl(),e=Wl();return kc=function(r,o){var i,u=new t,a={},c=new e;function l(n){var t=n.v===i?n.w:n.v,e=c.priority(t);if(void 0!==e){var r=o(n);r<e&&(a[t]=i,c.decrease(t,r))}}if(0===r.nodeCount())return u;n.each(r.nodes(),(function(n){c.add(n,Number.POSITIVE_INFINITY),u.setNode(n)})),c.decrease(r.nodes()[0],0);for(var s=!1;c.size()>0;){if(i=c.removeMin(),n.has(a,i))u.setEdge(i,a[i]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(i).forEach(l)}return u},kc}try{Ic=function(){if(jc)return Oc;jc=1;var n=Qa?Ka:(Qa=1,Ka={Graph:Xl(),version:qa?Ga:(qa=1,Ga="2.1.8")});return Oc={Graph:n.Graph,json:Ul(),alg:Mc?Nc:(Mc=1,Nc={components:Fl(),dijkstra:$l(),dijkstraAll:Gl(),findCycles:Kl(),floydWarshall:Ql(),isAcyclic:ns(),postorder:es(),preorder:rs(),prim:os(),tarjan:ql(),topsort:Jl()}),version:n.version}}()}catch(U){}Ic||(Ic=window.graphlib);var is,us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,ws,bs,_s,xs,Es,Ss,ks,Cs,Ns,Ms,Os,js,Is,Ps,As,zs,Ls,Ts,Bs,Ds,Rs,Vs,Hs,Ys,Zs,Xs,Us,Fs,Ws,$s,Gs,qs,Ks,Qs,Js,nf,tf,ef,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,wf,bf,_f,xf,Ef,Sf,kf,Cf,Nf,Mf,Of,jf,If,Pf,Af,zf,Lf,Tf,Bf,Df,Rf,Vf,Hf,Yf,Zf,Xf,Uf=Ic;function Ff(){if(cs)return as;cs=1;var n=Qt(),t=mr(),e=Le(),r=ie();return as=function(o,i,u){if(!r(u))return!1;var a=typeof i;return!!("number"==a?t(u)&&e(i,u.length):"string"==a&&i in u)&&n(u[i],o)}}function Wf(){if(bs)return ws;bs=1;var n=function(){if(ms)return ys;ms=1;var n=function(){if(gs)return ps;gs=1;var n=function(){if(vs)return hs;vs=1;var n=/\s/;return hs=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}}(),t=/^\s+/;return ps=function(e){return e?e.slice(0,n(e)+1).replace(t,""):e}}(),t=ie(),e=vl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return ys=function(a){if("number"==typeof a)return a;if(e(a))return NaN;if(t(a)){var c="function"==typeof a.valueOf?a.valueOf():a;a=t(c)?c+"":c}if("string"!=typeof a)return 0===a?a:+a;a=n(a);var l=o.test(a);return l||i.test(a)?u(a.slice(2),l?2:8):r.test(a)?NaN:+a}}(),t=1/0;return ws=function(e){return e?(e=n(e))===t||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}}function $f(){if(Ms)return Ns;Ms=1;var n=zl();return Ns=function(t){return null!=t&&t.length?n(t,1):[]}}function Gf(){if(Ts)return Ls;Ts=1;var n=vl();return Ls=function(t,e,r){for(var o=-1,i=t.length;++o<i;){var u=t[o],a=e(u);if(null!=a&&(void 0===c?a==a&&!n(a):r(a,c)))var c=a,l=u}return l},Ls}function qf(){if(Ys)return Hs;Ys=1;var n=ge(),t=Qt();return Hs=function(e,r,o){(void 0!==o&&!t(e[r],o)||void 0===o&&!(r in e))&&n(e,r,o)}}function Kf(){return Fs?Us:(Fs=1,Us=function(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]})}function Qf(){return of?rf:(of=1,rf=function(n,t){return n<t})}function Jf(){if(Lf)return zf;Lf=1;var n=gl(),t=bl(),e=Sl(),r=Ol(),o=(Of||(Of=1,Mf=function(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}),Mf),i=Be(),u=function(){if(Af)return Pf;Af=1;var n=function(){if(If)return jf;If=1;var n=vl();return jf=function(t,e){if(t!==e){var r=void 0!==t,o=null===t,i=t==t,u=n(t),a=void 0!==e,c=null===e,l=e==e,s=n(e);if(!c&&!s&&!u&&t>e||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&t<e||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}}();return Pf=function(t,e,r){for(var o=-1,i=t.criteria,u=e.criteria,a=i.length,c=r.length;++o<a;){var l=n(i[o],u[o]);if(l)return o>=c?l:l*("desc"==r[o]?-1:1)}return t.index-e.index}}(),a=el(),c=_e();return zf=function(l,s,f){s=s.length?n(s,(function(n){return c(n)?function(e){return t(e,1===n.length?n[0]:n)}:n})):[a];var d=-1;s=n(s,i(e));var h=r(l,(function(t,e,r){return{criteria:n(s,(function(n){return n(t)})),index:++d,value:t}}));return o(h,(function(n,t){return u(n,t,f)}))}}try{Xf={cloneDeep:function(){if(us)return is;us=1;var n=qc();return is=function(t){return n(t,5)}}(),constant:Qc(),defaults:function(){if(ss)return ls;ss=1;var n=Bl(),t=Qt(),e=Ff(),r=br(),o=Object.prototype,i=o.hasOwnProperty,u=n((function(n,u){n=Object(n);var a=-1,c=u.length,l=c>2?u[2]:void 0;for(l&&e(u[0],u[1],l)&&(c=1);++a<c;)for(var s=u[a],f=r(s),d=-1,h=f.length;++d<h;){var v=f[d],p=n[v];(void 0===p||t(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return ls=u}(),each:il(),filter:kl(),find:function(){if(Cs)return ks;Cs=1;var n=function(){if(ds)return fs;ds=1;var n=Sl(),t=mr(),e=wr();return fs=function(r){return function(o,i,u){var a=Object(o);if(!t(o)){var c=n(i,3);o=e(o),i=function(n){return c(a[n],n,a)}}var l=r(o,i,u);return l>-1?a[c?o[l]:l]:void 0}}}()(function(){if(Ss)return Es;Ss=1;var n=Dl(),t=Sl(),e=function(){if(xs)return _s;xs=1;var n=Wf();return _s=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}}(),r=Math.max;return Es=function(o,i,u){var a=null==o?0:o.length;if(!a)return-1;var c=null==u?0:e(u);return c<0&&(c=r(a+c,0)),n(o,t(i,3),c)},Es}());return ks=n}(),flatten:$f(),forEach:ol(),forIn:function(){if(js)return Os;js=1;var n=Jc(),t=rl(),e=br();return Os=function(r,o){return null==r?r:n(r,t(o),e)}}(),has:Cl(),isUndefined:Ml(),last:(Ps||(Ps=1,Is=function(n){var t=null==n?0:n.length;return t?n[t-1]:void 0}),Is),map:jl(),mapValues:function(){if(zs)return As;zs=1;var n=ge(),t=nl(),e=Sl();return As=function(r,o){var i={};return o=e(o,3),t(r,(function(t,e,r){n(i,e,o(t,e,r))})),i}}(),max:function(){if(Vs)return Rs;Vs=1;var n=Gf(),t=Ds?Bs:(Ds=1,Bs=function(n,t){return n>t}),e=el();return Rs=function(r){return r&&r.length?n(r,e,t):void 0},Rs}(),merge:function(){if(ef)return tf;ef=1;var n=function(){if(Qs)return Ks;Qs=1;var n=he(),t=qf(),e=Jc(),r=function(){if(qs)return Gs;qs=1;var n=qf(),t=Ac(),e=Wc(),r=zc(),o=Gc(),i=be(),u=_e(),a=Vl(),c=ze(),l=ue(),s=ie(),f=function(){if(Xs)return Zs;Xs=1;var n=oe(),t=Rc(),e=we(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return Zs=function(r){if(!e(r)||"[object Object]"!=n(r))return!1;var o=t(r);if(null===o)return!0;var c=u.call(o,"constructor")&&o.constructor;return"function"==typeof c&&c instanceof c&&i.call(c)==a}}(),d=hr(),h=Kf(),v=function(){if($s)return Ws;$s=1;var n=me(),t=br();return Ws=function(e){return n(e,t(e))}}();return Gs=function(p,g,y,m,w,b,_){var x=h(p,y),E=h(g,y),S=_.get(E);if(S)n(p,y,S);else{var k=b?b(x,E,y+"",p,g,_):void 0,C=void 0===k;if(C){var N=u(E),M=!N&&c(E),O=!N&&!M&&d(E);k=E,N||M||O?u(x)?k=x:a(x)?k=r(x):M?(C=!1,k=t(E,!0)):O?(C=!1,k=e(E,!0)):k=[]:f(E)||i(E)?(k=x,i(x)?k=v(x):s(x)&&!l(x)||(k=o(E))):C=!1}C&&(_.set(E,k),w(k,E,m,b,_),_.delete(E)),n(p,y,k)}}}(),o=ie(),i=br(),u=Kf();return Ks=function a(c,l,s,f,d){c!==l&&e(l,(function(e,i){if(d||(d=new n),o(e))r(c,l,i,s,a,f,d);else{var h=f?f(u(c,i),e,i+"",c,l,d):void 0;void 0===h&&(h=e),t(c,i,h)}}),i)},Ks}(),t=function(){if(nf)return Js;nf=1;var n=Bl(),t=Ff();return Js=function(e){return n((function(n,r){var o=-1,i=r.length,u=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(u=e.length>3&&"function"==typeof u?(i--,u):void 0,a&&t(r[0],r[1],a)&&(u=i<3?void 0:u,i=1),n=Object(n);++o<i;){var c=r[o];c&&e(n,c,o,u)}return n}))}}()((function(t,e,r){n(t,e,r)}));return tf=t}(),min:function(){if(af)return uf;af=1;var n=Gf(),t=Qf(),e=el();return uf=function(r){return r&&r.length?n(r,e,t):void 0},uf}(),minBy:function(){if(lf)return cf;lf=1;var n=Gf(),t=Sl(),e=Qf();return cf=function(r,o){return r&&r.length?n(r,t(o,2),e):void 0},cf}(),now:function(){if(ff)return sf;ff=1;var n=ee();return sf=function(){return n.Date.now()}}(),pick:function(){if(_f)return bf;_f=1;var n=function(){if(yf)return gf;yf=1;var n=function(){if(pf)return vf;pf=1;var n=bl(),t=function(){if(hf)return df;hf=1;var n=ye(),t=ml(),e=Le(),r=ie(),o=wl();return df=function(i,u,a,c){if(!r(i))return i;for(var l=-1,s=(u=t(u,i)).length,f=s-1,d=i;null!=d&&++l<s;){var h=o(u[l]),v=a;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(l!=f){var p=d[h];void 0===(v=c?c(p,h,d):void 0)&&(v=r(p)?p:e(u[l+1])?[]:{})}n(d,h,v),d=d[h]}return i}}(),e=ml();return vf=function(r,o,i){for(var u=-1,a=o.length,c={};++u<a;){var l=o[u],s=n(r,l);i(s,l)&&t(c,e(l,r),s)}return c}}(),t=xl();return gf=function(e,r){return n(e,r,(function(n,r){return t(e,r)}))}}(),t=function(){if(wf)return mf;wf=1;var n=$f(),t=Ll(),e=Tl();return mf=function(r){return e(t(r,void 0,n),r+"")}}()((function(t,e){return null==t?{}:n(t,e)}));return bf=t}(),range:function(){if(Nf)return Cf;Nf=1;var n=function(){if(kf)return Sf;kf=1;var n=function(){if(Ef)return xf;Ef=1;var n=Math.ceil,t=Math.max;return xf=function(e,r,o,i){for(var u=-1,a=t(n((r-e)/(o||1)),0),c=Array(a);a--;)c[i?a:++u]=e,e+=o;return c},xf}(),t=Ff(),e=Wf();return Sf=function(r){return function(o,i,u){return u&&"number"!=typeof u&&t(o,i,u)&&(i=u=void 0),o=e(o),void 0===i?(i=o,o=0):i=e(i),u=void 0===u?o<i?1:-1:e(u),n(o,i,u,r)}},Sf}()();return Cf=n}(),reduce:Il(),sortBy:function(){if(Bf)return Tf;Bf=1;var n=zl(),t=Jf(),e=Bl(),r=Ff(),o=e((function(e,o){if(null==e)return[];var i=o.length;return i>1&&r(e,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(e,n(o,1),[])}));return Tf=o}(),uniqueId:function(){if(Rf)return Df;Rf=1;var n=yl(),t=0;return Df=function(e){var r=++t;return n(e)+r},Df}(),values:Yl(),zipObject:function(){if(Zf)return Yf;Zf=1;var n=ye(),t=Hf?Vf:(Hf=1,Vf=function(n,t,e){for(var r=-1,o=n.length,i=t.length,u={};++r<o;){var a=r<i?t[r]:void 0;e(u,n[r],a)}return u});return Yf=function(e,r){return t(e||[],r||[],n)}}()}}catch(U){}Xf||(Xf=window._);var nd=Xf,td=ed;function ed(){var n={};n._next=n._prev=n,this._sentinel=n}function rd(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function od(n,t){if("_next"!==n&&"_prev"!==n)return t}ed.prototype.dequeue=function(){var n=this._sentinel,t=n._prev;if(t!==n)return rd(t),t},ed.prototype.enqueue=function(n){var t=this._sentinel;n._prev&&n._next&&rd(n),n._next=t._next,t._next._prev=n,t._next=n,n._prev=t},ed.prototype.toString=function(){for(var n=[],t=this._sentinel,e=t._prev;e!==t;)n.push(JSON.stringify(e,od)),e=e._prev;return"["+n.join(", ")+"]"};var id=nd,ud=Uf.Graph,ad=td,cd=id.constant(1);function ld(n,t,e,r,o){var i=o?[]:void 0;return id.forEach(n.inEdges(r.v),(function(r){var u=n.edge(r),a=n.node(r.v);o&&i.push({v:r.v,w:r.w}),a.out-=u,sd(t,e,a)})),id.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,sd(t,e,u)})),n.removeNode(r.v),i}function sd(n,t,e){e.out?e.in?n[e.out-e.in+t].enqueue(e):n[n.length-1].enqueue(e):n[0].enqueue(e)}var fd=nd,dd=function(n,t){if(n.nodeCount()<=1)return[];var e=function(n,t){var e=new ud,r=0,o=0;id.forEach(n.nodes(),(function(n){e.setNode(n,{v:n,in:0,out:0})})),id.forEach(n.edges(),(function(n){var i=e.edge(n.v,n.w)||0,u=t(n),a=i+u;e.setEdge(n.v,n.w,a),o=Math.max(o,e.node(n.v).out+=u),r=Math.max(r,e.node(n.w).in+=u)}));var i=id.range(o+r+3).map((function(){return new ad})),u=r+1;return id.forEach(e.nodes(),(function(n){sd(i,u,e.node(n))})),{graph:e,buckets:i,zeroIdx:u}}(n,t||cd),r=function(n,t,e){for(var r,o=[],i=t[t.length-1],u=t[0];n.nodeCount();){for(;r=u.dequeue();)ld(n,t,e,r);for(;r=i.dequeue();)ld(n,t,e,r);if(n.nodeCount())for(var a=t.length-2;a>0;--a)if(r=t[a].dequeue()){o=o.concat(ld(n,t,e,r,!0));break}}return o}(e.graph,e.buckets,e.zeroIdx);return id.flatten(id.map(r,(function(t){return n.outEdges(t.v,t.w)})),!0)},hd={run:function(n){var t="greedy"===n.graph().acyclicer?dd(n,function(n){return function(t){return n.edge(t).weight}}(n)):function(n){var t=[],e={},r={};return fd.forEach(n.nodes(),(function o(i){fd.has(r,i)||(r[i]=!0,e[i]=!0,fd.forEach(n.outEdges(i),(function(n){fd.has(e,n.w)?t.push(n):o(n.w)})),delete e[i])})),t}(n);fd.forEach(t,(function(t){var e=n.edge(t);n.removeEdge(t),e.forwardName=t.name,e.reversed=!0,n.setEdge(t.w,t.v,e,fd.uniqueId("rev"))}))},undo:function(n){fd.forEach(n.edges(),(function(t){var e=n.edge(t);if(e.reversed){n.removeEdge(t);var r=e.forwardName;delete e.reversed,delete e.forwardName,n.setEdge(t.w,t.v,e,r)}}))}},vd=nd,pd=Uf.Graph,gd={addDummyNode:yd,simplify:function(n){var t=(new pd).setGraph(n.graph());return vd.forEach(n.nodes(),(function(e){t.setNode(e,n.node(e))})),vd.forEach(n.edges(),(function(e){var r=t.edge(e.v,e.w)||{weight:0,minlen:1},o=n.edge(e);t.setEdge(e.v,e.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),t},asNonCompoundGraph:function(n){var t=new pd({multigraph:n.isMultigraph()}).setGraph(n.graph());return vd.forEach(n.nodes(),(function(e){n.children(e).length||t.setNode(e,n.node(e))})),vd.forEach(n.edges(),(function(e){t.setEdge(e,n.edge(e))})),t},successorWeights:function(n){var t=vd.map(n.nodes(),(function(t){var e={};return vd.forEach(n.outEdges(t),(function(t){e[t.w]=(e[t.w]||0)+n.edge(t).weight})),e}));return vd.zipObject(n.nodes(),t)},predecessorWeights:function(n){var t=vd.map(n.nodes(),(function(t){var e={};return vd.forEach(n.inEdges(t),(function(t){e[t.v]=(e[t.v]||0)+n.edge(t).weight})),e}));return vd.zipObject(n.nodes(),t)},intersectRect:function(n,t){var e,r,o=n.x,i=n.y,u=t.x-o,a=t.y-i,c=n.width/2,l=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*c>Math.abs(u)*l?(a<0&&(l=-l),e=l*u/a,r=l):(u<0&&(c=-c),e=c,r=c*a/u),{x:o+e,y:i+r}},buildLayerMatrix:function(n){var t=vd.map(vd.range(md(n)+1),(function(){return[]}));return vd.forEach(n.nodes(),(function(e){var r=n.node(e),o=r.rank;vd.isUndefined(o)||(t[o][r.order]=e)})),t},normalizeRanks:function(n){var t=vd.min(vd.map(n.nodes(),(function(t){return n.node(t).rank})));vd.forEach(n.nodes(),(function(e){var r=n.node(e);vd.has(r,"rank")&&(r.rank-=t)}))},removeEmptyRanks:function(n){var t=vd.min(vd.map(n.nodes(),(function(t){return n.node(t).rank}))),e=[];vd.forEach(n.nodes(),(function(r){var o=n.node(r).rank-t;e[o]||(e[o]=[]),e[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;vd.forEach(e,(function(t,e){vd.isUndefined(t)&&e%o!=0?--r:r&&vd.forEach(t,(function(t){n.node(t).rank+=r}))}))},addBorderNode:function(n,t,e,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=r),yd(n,"border",o,t)},maxRank:md,partition:function(n,t){var e={lhs:[],rhs:[]};return vd.forEach(n,(function(n){t(n)?e.lhs.push(n):e.rhs.push(n)})),e},time:function(n,t){var e=vd.now();try{return t()}finally{console.log(n+" time: "+(vd.now()-e)+"ms")}},notime:function(n,t){return t()}};function yd(n,t,e,r){var o;do{o=vd.uniqueId(r)}while(n.hasNode(o));return e.dummy=t,n.setNode(o,e),o}function md(n){return vd.max(vd.map(n.nodes(),(function(t){var e=n.node(t).rank;if(!vd.isUndefined(e))return e})))}var wd=nd,bd=gd,_d={run:function(n){n.graph().dummyChains=[],wd.forEach(n.edges(),(function(t){!function(n,t){var e,r,o,i=t.v,u=n.node(i).rank,a=t.w,c=n.node(a).rank,l=t.name,s=n.edge(t),f=s.labelRank;if(c!==u+1){for(n.removeEdge(t),o=0,++u;u<c;++o,++u)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:t,rank:u},e=bd.addDummyNode(n,"edge",r,"_d"),u===f&&(r.width=s.width,r.height=s.height,r.dummy="edge-label",r.labelpos=s.labelpos),n.setEdge(i,e,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(e),i=e;n.setEdge(i,a,{weight:s.weight},l)}}(n,t)}))},undo:function(n){wd.forEach(n.graph().dummyChains,(function(t){var e,r=n.node(t),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)e=n.successors(t)[0],n.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=e,r=n.node(t)}))}},xd=nd,Ed=function(n){var t={};xd.forEach(n.sources(),(function e(r){var o=n.node(r);if(xd.has(t,r))return o.rank;t[r]=!0;var i=xd.min(xd.map(n.outEdges(r),(function(t){return e(t.w)-n.edge(t).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},Sd=function(n,t){return n.node(t.w).rank-n.node(t.v).rank-n.edge(t).minlen},kd=nd,Cd=Uf.Graph,Nd=Sd,Md=function(n){var t,e,r=new Cd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Od(r,n)<i;)t=jd(r,n),e=r.hasNode(t.v)?Nd(n,t):-Nd(n,t),Id(r,n,e);return r};function Od(n,t){return kd.forEach(n.nodes(),(function e(r){kd.forEach(t.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||Nd(t,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),e(u))}))})),n.nodeCount()}function jd(n,t){return kd.minBy(t.edges(),(function(e){if(n.hasNode(e.v)!==n.hasNode(e.w))return Nd(t,e)}))}function Id(n,t,e){kd.forEach(n.nodes(),(function(n){t.node(n).rank+=e}))}var Pd=nd,Ad=Md,zd=Sd,Ld=Ed,Td=Uf.alg.preorder,Bd=Uf.alg.postorder,Dd=gd.simplify,Rd=Vd;function Vd(n){n=Dd(n),Ld(n);var t,e=Ad(n);for(Zd(e),Hd(e,n);t=Ud(e);)Wd(e,n,t,Fd(e,n,t))}function Hd(n,t){var e=Bd(n,n.nodes());e=e.slice(0,e.length-1),Pd.forEach(e,(function(e){!function(n,t,e){var r=n.node(e).parent;n.edge(e,r).cutvalue=Yd(n,t,e)}(n,t,e)}))}function Yd(n,t,e){var r=n.node(e).parent,o=!0,i=t.edge(e,r),u=0;return i||(o=!1,i=t.edge(r,e)),u=i.weight,Pd.forEach(t.nodeEdges(e),(function(i){var a,c,l=i.v===e,s=l?i.w:i.v;if(s!==r){var f=l===o,d=t.edge(i).weight;if(u+=f?d:-d,a=e,c=s,n.hasEdge(a,c)){var h=n.edge(e,s).cutvalue;u+=f?-h:h}}})),u}function Zd(n,t){arguments.length<2&&(t=n.nodes()[0]),Xd(n,{},1,t)}function Xd(n,t,e,r,o){var i=e,u=n.node(r);return t[r]=!0,Pd.forEach(n.neighbors(r),(function(o){Pd.has(t,o)||(e=Xd(n,t,e,o,r))})),u.low=i,u.lim=e++,o?u.parent=o:delete u.parent,e}function Ud(n){return Pd.find(n.edges(),(function(t){return n.edge(t).cutvalue<0}))}function Fd(n,t,e){var r=e.v,o=e.w;t.hasEdge(r,o)||(r=e.w,o=e.v);var i=n.node(r),u=n.node(o),a=i,c=!1;i.lim>u.lim&&(a=u,c=!0);var l=Pd.filter(t.edges(),(function(t){return c===$d(n,n.node(t.v),a)&&c!==$d(n,n.node(t.w),a)}));return Pd.minBy(l,(function(n){return zd(t,n)}))}function Wd(n,t,e,r){var o=e.v,i=e.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Zd(n),Hd(n,t),function(n,t){var e=Pd.find(n.nodes(),(function(n){return!t.node(n).parent})),r=Td(n,e);r=r.slice(1),Pd.forEach(r,(function(e){var r=n.node(e).parent,o=t.edge(e,r),i=!1;o||(o=t.edge(r,e),i=!0),t.node(e).rank=t.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,t)}function $d(n,t,e){return e.low<=t.lim&&t.lim<=e.lim}Vd.initLowLimValues=Zd,Vd.initCutValues=Hd,Vd.calcCutValue=Yd,Vd.leaveEdge=Ud,Vd.enterEdge=Fd,Vd.exchangeEdges=Wd;var Gd=Ed,qd=Md,Kd=Rd,Qd=Gd;var Jd=nd,nh=nd,th=gd,eh={run:function(n){var t=th.addDummyNode(n,"root",{},"_root"),e=function(n){var t={};function e(r,o){var i=n.children(r);i&&i.length&&nh.forEach(i,(function(n){e(n,o+1)})),t[r]=o}return nh.forEach(n.children(),(function(n){e(n,1)})),t}(n),r=nh.max(nh.values(e))-1,o=2*r+1;n.graph().nestingRoot=t,nh.forEach(n.edges(),(function(t){n.edge(t).minlen*=o}));var i=function(n){return nh.reduce(n.edges(),(function(t,e){return t+n.edge(e).weight}),0)}(n)+1;nh.forEach(n.children(),(function(u){rh(n,t,o,i,r,e,u)})),n.graph().nodeRankFactor=o},cleanup:function(n){var t=n.graph();n.removeNode(t.nestingRoot),delete t.nestingRoot,nh.forEach(n.edges(),(function(t){n.edge(t).nestingEdge&&n.removeEdge(t)}))}};function rh(n,t,e,r,o,i,u){var a=n.children(u);if(a.length){var c=th.addBorderNode(n,"_bt"),l=th.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(c,u),s.borderTop=c,n.setParent(l,u),s.borderBottom=l,nh.forEach(a,(function(a){rh(n,t,e,r,o,i,a);var s=n.node(a),f=s.borderTop?s.borderTop:a,d=s.borderBottom?s.borderBottom:a,h=s.borderTop?r:2*r,v=f!==d?1:o-i[u]+1;n.setEdge(c,f,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(d,l,{weight:h,minlen:v,nestingEdge:!0})})),n.parent(u)||n.setEdge(t,c,{weight:0,minlen:o+i[u]})}else u!==t&&n.setEdge(t,u,{weight:0,minlen:e})}var oh=nd,ih=gd;function uh(n,t,e,r,o,i){var u={width:0,height:0,rank:i,borderType:t},a=o[t][i-1],c=ih.addDummyNode(n,"border",u,e);o[t][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var ah=nd,ch={adjust:function(n){var t=n.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||lh(n)},undo:function(n){var t=n.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(n){ah.forEach(n.nodes(),(function(t){fh(n.node(t))})),ah.forEach(n.edges(),(function(t){var e=n.edge(t);ah.forEach(e.points,fh),ah.has(e,"y")&&fh(e)}))}(n),"lr"!==t&&"rl"!==t||(function(n){ah.forEach(n.nodes(),(function(t){dh(n.node(t))})),ah.forEach(n.edges(),(function(t){var e=n.edge(t);ah.forEach(e.points,dh),ah.has(e,"x")&&dh(e)}))}(n),lh(n))}};function lh(n){ah.forEach(n.nodes(),(function(t){sh(n.node(t))})),ah.forEach(n.edges(),(function(t){sh(n.edge(t))}))}function sh(n){var t=n.width;n.width=n.height,n.height=t}function fh(n){n.y=-n.y}function dh(n){var t=n.x;n.x=n.y,n.y=t}var hh=nd,vh=nd;function ph(n,t,e){for(var r=vh.zipObject(e,vh.map(e,(function(n,t){return t}))),o=vh.flatten(vh.map(t,(function(t){return vh.sortBy(vh.map(n.outEdges(t),(function(t){return{pos:r[t.w],weight:n.edge(t).weight}})),"pos")})),!0),i=1;i<e.length;)i<<=1;var u=2*i-1;i-=1;var a=vh.map(new Array(u),(function(){return 0})),c=0;return vh.forEach(o.forEach((function(n){var t=n.pos+i;a[t]+=n.weight;for(var e=0;t>0;)t%2&&(e+=a[t+1]),a[t=t-1>>1]+=n.weight;c+=n.weight*e}))),c}var gh=nd,yh=nd,mh=nd,wh=gd;function bh(n,t,e){for(var r;t.length&&(r=mh.last(t)).i<=e;)t.pop(),n.push(r.vs),e++;return e}var _h=nd,xh=nd,Eh=Uf.Graph,Sh=nd,kh=nd,Ch=function(n){var t={},e=hh.filter(n.nodes(),(function(t){return!n.children(t).length})),r=hh.max(hh.map(e,(function(t){return n.node(t).rank}))),o=hh.map(hh.range(r+1),(function(){return[]}));var i=hh.sortBy(e,(function(t){return n.node(t).rank}));return hh.forEach(i,(function e(r){if(!hh.has(t,r)){t[r]=!0;var i=n.node(r);o[i.rank].push(r),hh.forEach(n.successors(r),e)}})),o},Nh=function(n,t){for(var e=0,r=1;r<t.length;++r)e+=ph(n,t[r-1],t[r]);return e},Mh=function n(t,e,r,o){var i=t.children(e),u=t.node(e),a=u?u.borderLeft:void 0,c=u?u.borderRight:void 0,l={};a&&(i=_h.filter(i,(function(n){return n!==a&&n!==c})));var s=function(n,t){return gh.map(t,(function(t){var e=n.inEdges(t);if(e.length){var r=gh.reduce(e,(function(t,e){var r=n.edge(e),o=n.node(e.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}}))}(t,i);_h.forEach(s,(function(e){if(t.children(e.v).length){var i=n(t,e.v,r,o);l[e.v]=i,_h.has(i,"barycenter")&&(u=e,a=i,_h.isUndefined(u.barycenter)?(u.barycenter=a.barycenter,u.weight=a.weight):(u.barycenter=(u.barycenter*u.weight+a.barycenter*a.weight)/(u.weight+a.weight),u.weight+=a.weight))}var u,a}));var f=function(n,t){var e={};return yh.forEach(n,(function(n,t){var r=e[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:t};yh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),yh.forEach(t.edges(),(function(n){var t=e[n.v],r=e[n.w];yh.isUndefined(t)||yh.isUndefined(r)||(r.indegree++,t.out.push(e[n.w]))})),function(n){var t=[];function e(n){return function(t){t.merged||(yh.isUndefined(t.barycenter)||yh.isUndefined(n.barycenter)||t.barycenter>=n.barycenter)&&function(n,t){var e=0,r=0;n.weight&&(e+=n.barycenter*n.weight,r+=n.weight),t.weight&&(e+=t.barycenter*t.weight,r+=t.weight),n.vs=t.vs.concat(n.vs),n.barycenter=e/r,n.weight=r,n.i=Math.min(t.i,n.i),t.merged=!0}(n,t)}}function r(t){return function(e){e.in.push(t),0==--e.indegree&&n.push(e)}}for(;n.length;){var o=n.pop();t.push(o),yh.forEach(o.in.reverse(),e(o)),yh.forEach(o.out,r(o))}return yh.map(yh.filter(t,(function(n){return!n.merged})),(function(n){return yh.pick(n,["vs","i","barycenter","weight"])}))}(yh.filter(e,(function(n){return!n.indegree})))}(s,r);!function(n,t){_h.forEach(n,(function(n){n.vs=_h.flatten(n.vs.map((function(n){return t[n]?t[n].vs:n})),!0)}))}(f,l);var d=function(n,t){var e,r=wh.partition(n,(function(n){return mh.has(n,"barycenter")})),o=r.lhs,i=mh.sortBy(r.rhs,(function(n){return-n.i})),u=[],a=0,c=0,l=0;o.sort((e=!!t,function(n,t){return n.barycenter<t.barycenter?-1:n.barycenter>t.barycenter?1:e?t.i-n.i:n.i-t.i})),l=bh(u,i,l),mh.forEach(o,(function(n){l+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,c+=n.weight,l=bh(u,i,l)}));var s={vs:mh.flatten(u,!0)};return c&&(s.barycenter=a/c,s.weight=c),s}(f,o);if(a&&(d.vs=_h.flatten([a,d.vs,c],!0),t.predecessors(a).length)){var h=t.node(t.predecessors(a)[0]),v=t.node(t.predecessors(c)[0]);_h.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+v.order)/(d.weight+2),d.weight+=2}return d},Oh=function(n,t,e){var r=function(n){for(var t;n.hasNode(t=xh.uniqueId("_root")););return t}(n),o=new Eh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(t){return n.node(t)}));return xh.forEach(n.nodes(),(function(i){var u=n.node(i),a=n.parent(i);(u.rank===t||u.minRank<=t&&t<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||r),xh.forEach(n[e](i),(function(t){var e=t.v===i?t.w:t.v,r=o.edge(e,i),u=xh.isUndefined(r)?0:r.weight;o.setEdge(e,i,{weight:n.edge(t).weight+u})})),xh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[t],borderRight:u.borderRight[t]}))})),o},jh=Uf.Graph,Ih=gd;function Ph(n,t,e){return kh.map(t,(function(t){return Oh(n,t,e)}))}function Ah(n,t){var e=new jh;kh.forEach(n,(function(n){var r=n.graph().root,o=Mh(n,r,e,t);kh.forEach(o.vs,(function(t,e){n.node(t).order=e})),function(n,t,e){var r,o={};Sh.forEach(e,(function(e){for(var i,u,a=n.parent(e);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=r,r=a),u&&u!==a)return void t.setEdge(u,a);a=i}}))}(n,e,o.vs)}))}function zh(n,t){kh.forEach(t,(function(t){kh.forEach(t,(function(t,e){n.node(t).order=e}))}))}var Lh=nd,Th=Uf.Graph,Bh=gd;function Dh(n,t,e){if(t>e){var r=t;t=e,e=r}var o=n[t];o||(n[t]=o={}),o[e]=!0}function Rh(n,t,e){if(t>e){var r=t;t=e,e=r}return Lh.has(n[t],e)}var Vh=nd,Hh=gd,Yh=function(n){var t,e=Bh.buildLayerMatrix(n),r=Lh.merge(function(n,t){var e={};return Lh.reduce(t,(function(t,r){var o=0,i=0,u=t.length,a=Lh.last(r);return Lh.forEach(r,(function(t,c){var l=function(n,t){if(n.node(t).dummy)return Lh.find(n.predecessors(t),(function(t){return n.node(t).dummy}))}(n,t),s=l?n.node(l).order:u;(l||t===a)&&(Lh.forEach(r.slice(i,c+1),(function(t){Lh.forEach(n.predecessors(t),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(t).dummy||Dh(e,r,t)}))})),i=c+1,o=s)})),r})),e}(n,e),function(n,t){var e={};function r(t,r,o,i,u){var a;Lh.forEach(Lh.range(r,o),(function(r){a=t[r],n.node(a).dummy&&Lh.forEach(n.predecessors(a),(function(t){var r=n.node(t);r.dummy&&(r.order<i||r.order>u)&&Dh(e,t,a)}))}))}return Lh.reduce(t,(function(t,e){var o,i=-1,u=0;return Lh.forEach(e,(function(a,c){if("border"===n.node(a).dummy){var l=n.predecessors(a);l.length&&(o=n.node(l[0]).order,r(e,u,c,i,o),u=c,i=o)}r(e,u,e.length,o,t.length)})),e})),e}(n,e)),o={};Lh.forEach(["u","d"],(function(i){t="u"===i?e:Lh.values(e).reverse(),Lh.forEach(["l","r"],(function(e){"r"===e&&(t=Lh.map(t,(function(n){return Lh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,t,e,r){var o={},i={},u={};return Lh.forEach(t,(function(n){Lh.forEach(n,(function(n,t){o[n]=n,i[n]=n,u[n]=t}))})),Lh.forEach(t,(function(n){var t=-1;Lh.forEach(n,(function(n){var a=r(n);if(a.length){a=Lh.sortBy(a,(function(n){return u[n]}));for(var c=(a.length-1)/2,l=Math.floor(c),s=Math.ceil(c);l<=s;++l){var f=a[l];i[n]===n&&t<u[f]&&!Rh(e,n,f)&&(i[f]=n,i[n]=o[n]=o[f],t=u[f])}}}))})),{root:o,align:i}}(0,t,r,u),c=function(n,t,e,r,o){var i={},u=function(n,t,e,r){var o=new Th,i=n.graph(),u=function(n,t,e){return function(r,o,i){var u,a=r.node(o),c=r.node(i),l=0;if(l+=a.width/2,Lh.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(l+=e?u:-u),u=0,l+=(a.dummy?t:n)/2,l+=(c.dummy?t:n)/2,l+=c.width/2,Lh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(l+=e?u:-u),u=0,l}}(i.nodesep,i.edgesep,r);return Lh.forEach(t,(function(t){var r;Lh.forEach(t,(function(t){var i=e[t];if(o.setNode(i),r){var a=e[r],c=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,t,r),c||0))}r=t}))})),o}(n,t,e,o),a=o?"borderLeft":"borderRight";function c(n,t){for(var e=u.nodes(),r=e.pop(),o={};r;)o[r]?n(r):(o[r]=!0,e.push(r),e=e.concat(t(r))),r=e.pop()}return c((function(n){i[n]=u.inEdges(n).reduce((function(n,t){return Math.max(n,i[t.v]+u.edge(t))}),0)}),u.predecessors.bind(u)),c((function(t){var e=u.outEdges(t).reduce((function(n,t){return Math.min(n,i[t.w]-u.edge(t))}),Number.POSITIVE_INFINITY),r=n.node(t);e!==Number.POSITIVE_INFINITY&&r.borderType!==a&&(i[t]=Math.max(i[t],e))}),u.successors.bind(u)),Lh.forEach(r,(function(n){i[n]=i[e[n]]})),i}(n,t,a.root,a.align,"r"===e);"r"===e&&(c=Lh.mapValues(c,(function(n){return-n}))),o[i+e]=c}))}));var i=function(n,t){return Lh.minBy(Lh.values(t),(function(t){var e=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Lh.forIn(t,(function(t,o){var i=function(n,t){return n.node(t).width}(n,o)/2;e=Math.max(t+i,e),r=Math.min(t-i,r)})),e-r}))}(n,o);return function(n,t){var e=Lh.values(t),r=Lh.min(e),o=Lh.max(e);Lh.forEach(["u","d"],(function(e){Lh.forEach(["l","r"],(function(i){var u,a=e+i,c=n[a];if(c!==t){var l=Lh.values(c);(u="l"===i?r-Lh.min(l):o-Lh.max(l))&&(n[a]=Lh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,t){return Lh.mapValues(n.ul,(function(e,r){if(t)return n[t.toLowerCase()][r];var o=Lh.sortBy(Lh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Zh=nd,Xh=hd,Uh=_d,Fh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Kd(n)}(n);break;case"tight-tree":!function(n){Gd(n),qd(n)}(n);break;case"longest-path":Qd(n)}},Wh=gd.normalizeRanks,$h=function(n){var t=function(n){var t={},e=0;return Jd.forEach(n.children(),(function r(o){var i=e;Jd.forEach(n.children(o),r),t[o]={low:i,lim:e++}})),t}(n);Jd.forEach(n.graph().dummyChains,(function(e){for(var r=n.node(e),o=r.edgeObj,i=function(n,t,e,r){var o,i,u=[],a=[],c=Math.min(t[e].low,t[r].low),l=Math.max(t[e].lim,t[r].lim);o=e;do{o=n.parent(o),u.push(o)}while(o&&(t[o].low>c||l>t[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,t,o.v,o.w),u=i.path,a=i.lca,c=0,l=u[c],s=!0;e!==o.w;){if(r=n.node(e),s){for(;(l=u[c])!==a&&n.node(l).maxRank<r.rank;)c++;l===a&&(s=!1)}if(!s){for(;c<u.length-1&&n.node(l=u[c+1]).minRank<=r.rank;)c++;l=u[c]}n.setParent(e,l),e=n.successors(e)[0]}}))},Gh=gd.removeEmptyRanks,qh=eh,Kh=function(n){oh.forEach(n.children(),(function t(e){var r=n.children(e),o=n.node(e);if(r.length&&oh.forEach(r,t),oh.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)uh(n,"borderLeft","_bl",e,o,i),uh(n,"borderRight","_br",e,o,i)}}))},Qh=ch,Jh=function(n){var t=Ih.maxRank(n),e=Ph(n,kh.range(1,t+1),"inEdges"),r=Ph(n,kh.range(t-1,-1,-1),"outEdges"),o=Ch(n);zh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){Ah(a%2?e:r,a%4>=2),o=Ih.buildLayerMatrix(n);var l=Nh(n,o);l<u&&(c=0,i=kh.cloneDeep(o),u=l)}zh(n,i)},nv=function(n){(function(n){var t=Hh.buildLayerMatrix(n),e=n.graph().ranksep,r=0;Vh.forEach(t,(function(t){var o=Vh.max(Vh.map(t,(function(t){return n.node(t).height})));Vh.forEach(t,(function(t){n.node(t).y=r+o/2})),r+=o+e}))})(n=Hh.asNonCompoundGraph(n)),Vh.forEach(Yh(n),(function(t,e){n.node(e).x=t}))},tv=gd,ev=Uf.Graph,rv=["nodesep","edgesep","ranksep","marginx","marginy"],ov={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},iv=["acyclicer","ranker","rankdir","align"],uv=["width","height"],av={width:0,height:0},cv=["minlen","weight","width","height","labeloffset"],lv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},sv=["labelpos"];function fv(n,t){return Zh.mapValues(Zh.pick(n,t),Number)}function dv(n){var t={};return Zh.forEach(n,(function(n,e){t[e.toLowerCase()]=n})),t}var hv=nd,vv=gd,pv=Uf.Graph,gv={debugOrdering:function(n){var t=vv.buildLayerMatrix(n),e=new pv({compound:!0,multigraph:!0}).setGraph({});return hv.forEach(n.nodes(),(function(t){e.setNode(t,{label:t}),e.setParent(t,"layer"+n.node(t).rank)})),hv.forEach(n.edges(),(function(n){e.setEdge(n.v,n.w,{},n.name)})),hv.forEach(t,(function(n,t){var r="layer"+t;e.setNode(r,{rank:"same"}),hv.reduce(n,(function(n,t){return e.setEdge(n,t,{style:"invis"}),t}))})),e}},yv=Kt({graphlib:Uf,layout:function(n,t){var e=t&&t.debugTiming?tv.time:tv.notime;e("layout",(function(){var t=e(" buildLayoutGraph",(function(){return function(n){var t=new ev({multigraph:!0,compound:!0}),e=dv(n.graph());return t.setGraph(Zh.merge({},ov,fv(e,rv),Zh.pick(e,iv))),Zh.forEach(n.nodes(),(function(e){var r=dv(n.node(e));t.setNode(e,Zh.defaults(fv(r,uv),av)),t.setParent(e,n.parent(e))})),Zh.forEach(n.edges(),(function(e){var r=dv(n.edge(e));t.setEdge(e,Zh.merge({},lv,fv(r,cv),Zh.pick(r,sv)))})),t}(n)}));e(" runLayout",(function(){!function(n,t){t(" makeSpaceForEdgeLabels",(function(){!function(n){var t=n.graph();t.ranksep/=2,Zh.forEach(n.edges(),(function(e){var r=n.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),t(" removeSelfEdges",(function(){!function(n){Zh.forEach(n.edges(),(function(t){if(t.v===t.w){var e=n.node(t.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:t,label:n.edge(t)}),n.removeEdge(t)}}))}(n)})),t(" acyclic",(function(){Xh.run(n)})),t(" nestingGraph.run",(function(){qh.run(n)})),t(" rank",(function(){Fh(tv.asNonCompoundGraph(n))})),t(" injectEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);if(e.width&&e.height){var r=n.node(t.v),o={rank:(n.node(t.w).rank-r.rank)/2+r.rank,e:t};tv.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),t(" removeEmptyRanks",(function(){Gh(n)})),t(" nestingGraph.cleanup",(function(){qh.cleanup(n)})),t(" normalizeRanks",(function(){Wh(n)})),t(" assignRankMinMax",(function(){!function(n){var t=0;Zh.forEach(n.nodes(),(function(e){var r=n.node(e);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,t=Zh.max(t,r.maxRank))})),n.graph().maxRank=t}(n)})),t(" removeEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){var e=n.node(t);"edge-proxy"===e.dummy&&(n.edge(e.e).labelRank=e.rank,n.removeNode(t))}))}(n)})),t(" normalize.run",(function(){Uh.run(n)})),t(" parentDummyChains",(function(){$h(n)})),t(" addBorderSegments",(function(){Kh(n)})),t(" order",(function(){Jh(n)})),t(" insertSelfEdges",(function(){!function(n){var t=tv.buildLayerMatrix(n);Zh.forEach(t,(function(t){var e=0;Zh.forEach(t,(function(t,r){var o=n.node(t);o.order=r+e,Zh.forEach(o.selfEdges,(function(t){tv.addDummyNode(n,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:r+ ++e,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(n)})),t(" adjustCoordinateSystem",(function(){Qh.adjust(n)})),t(" position",(function(){nv(n)})),t(" positionSelfEdges",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){var e=n.node(t);if("selfedge"===e.dummy){var r=n.node(e.e.v),o=r.x+r.width/2,i=r.y,u=e.x-o,a=r.height/2;n.setEdge(e.e,e.label),n.removeNode(t),e.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],e.label.x=e.x,e.label.y=e.y}}))}(n)})),t(" removeBorderNodes",(function(){!function(n){Zh.forEach(n.nodes(),(function(t){if(n.children(t).length){var e=n.node(t),r=n.node(e.borderTop),o=n.node(e.borderBottom),i=n.node(Zh.last(e.borderLeft)),u=n.node(Zh.last(e.borderRight));e.width=Math.abs(u.x-i.x),e.height=Math.abs(o.y-r.y),e.x=i.x+e.width/2,e.y=r.y+e.height/2}})),Zh.forEach(n.nodes(),(function(t){"border"===n.node(t).dummy&&n.removeNode(t)}))}(n)})),t(" normalize.undo",(function(){Uh.undo(n)})),t(" fixupEdgeLabelCoords",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);if(Zh.has(e,"x"))switch("l"!==e.labelpos&&"r"!==e.labelpos||(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset}}))}(n)})),t(" undoCoordinateSystem",(function(){Qh.undo(n)})),t(" translateGraph",(function(){!function(n){var t=Number.POSITIVE_INFINITY,e=0,r=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function c(n){var i=n.x,u=n.y,a=n.width,c=n.height;t=Math.min(t,i-a/2),e=Math.max(e,i+a/2),r=Math.min(r,u-c/2),o=Math.max(o,u+c/2)}Zh.forEach(n.nodes(),(function(t){c(n.node(t))})),Zh.forEach(n.edges(),(function(t){var e=n.edge(t);Zh.has(e,"x")&&c(e)})),t-=u,r-=a,Zh.forEach(n.nodes(),(function(e){var o=n.node(e);o.x-=t,o.y-=r})),Zh.forEach(n.edges(),(function(e){var o=n.edge(e);Zh.forEach(o.points,(function(n){n.x-=t,n.y-=r})),Zh.has(o,"x")&&(o.x-=t),Zh.has(o,"y")&&(o.y-=r)})),i.width=e-t+u,i.height=o-r+a}(n)})),t(" assignNodeIntersects",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e,r,o=n.edge(t),i=n.node(t.v),u=n.node(t.w);o.points?(e=o.points[0],r=o.points[o.points.length-1]):(o.points=[],e=u,r=i),o.points.unshift(tv.intersectRect(i,e)),o.points.push(tv.intersectRect(u,r))}))}(n)})),t(" reversePoints",(function(){!function(n){Zh.forEach(n.edges(),(function(t){var e=n.edge(t);e.reversed&&e.points.reverse()}))}(n)})),t(" acyclic.undo",(function(){Xh.undo(n)}))}(t,e)})),e(" updateInputGraph",(function(){!function(n,t){Zh.forEach(n.nodes(),(function(e){var r=n.node(e),o=t.node(e);r&&(r.x=o.x,r.y=o.y,t.children(e).length&&(r.width=o.width,r.height=o.height))})),Zh.forEach(n.edges(),(function(e){var r=n.edge(e),o=t.edge(e);r.points=o.points,Zh.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=t.graph().width,n.graph().height=t.graph().height}(n,t)}))}))},debug:gv,util:{time:gd.time,notime:gd.notime},version:"0.8.5"}),mv=function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},wv=function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},bv=function(){return"The Ink Flow parent container needs a width and a height to render the graph."},_v=function(){return"Only child nodes can use a parent extent."},xv=function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},Ev=function(n,t){var e=t.id,r=t.sourceHandle,o=t.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(e,".")},Sv=function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},kv=function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},Cv=function(n){return'Node with id "'.concat(n,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},Nv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mv=["Enter"," ","Escape"],Ov=.5,jv=2,Iv=[0,0],Pv=function(n,t,e){if(!n.id)return[];var r=new Set;return e.forEach((function(t){t.source===n.id&&r.add(t.target)})),t.filter((function(n){return r.has(n.id)}))},Av=function(n,t,e){if(!n.id)return[];var r=new Set;return e.forEach((function(t){t.target===n.id&&r.add(t.source)})),t.filter((function(n){return r.has(n.id)}))},zv=function(n,t){void 0===t&&(t=[0,0]);var e=Kv(n),r=e.width,o=e.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||t,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},Lv=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var e=n.reduce((function(n,e){var r=Xv(e,t.nodeOrigin);return Yv(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Zv(e)},Tv=function(n,t){var e=new Set;return n.forEach((function(n){e.add(n.id)})),t.filter((function(n){return e.has(n.source)||e.has(n.target)}))};function Bv(n){var t=n.nodeId,e=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(t),l=c.parentId?r.get(c.parentId):void 0,s=l?zv(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,t){var e,r,o,i;return t&&"parent"!==t?[t[0],[t[1][0]-(null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:0),t[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:t}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&qv(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,w=f+v*m[0],b=d+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==a||a("005",_v());var _=qv(h)?Rv(e,h):e;return{position:{x:_.x-f,y:_.y-d},positionAbsolute:_}}var Dv=function(n,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),Math.min(Math.max(n,t),e)},Rv=function(n,t){return void 0===n&&(n={x:0,y:0}),{x:Dv(n.x,t[0][0],t[1][0]),y:Dv(n.y,t[0][1],t[1][1])}},Vv=function(n,t,e){return n<t?Dv(Math.abs(n-t),1,50)/50:n>e?-Dv(Math.abs(n-e),1,50)/50:0},Hv=function(n,t){return[20*Vv(n.x,35,t.width-35),20*Vv(n.y,35,t.height-35)]},Yv=function(n,t){return{x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x2,t.x2),y2:Math.max(n.y2,t.y2)}},Zv=function(n){var t=n.x,e=n.y;return{x:t,y:e,width:n.x2-t,height:n.y2-e}},Xv=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=zv(n,t).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}},Uv=function(n,t){return void 0===t&&(t=[1,1]),{x:t[0]*Math.round(n.x/t[0]),y:t[1]*Math.round(n.y/t[1])}},Fv=function(n,t,e,r){var o=n.x,i=n.y,u=W(t,3),a=u[0],c=u[1],l=u[2];void 0===e&&(e=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return e?Uv(s,r):s},Wv=function(n,t){var e=n.x,r=n.y,o=W(t,3),i=o[0],u=o[1],a=o[2];return{x:e*a+i,y:r*a+u}},$v=function(n,t,e,r,o,i){var u=t/(n.width*(1+i)),a=e/(n.height*(1+i)),c=Math.min(u,a),l=Dv(c,r,o);return{x:t/2-(n.x+n.width/2)*l,y:e/2-(n.y+n.height/2)*l,zoom:l}},Gv=function(){var n;return"undefined"!=typeof navigator&&(null===(n=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===n?void 0:n.indexOf("Mac"))>=0};function qv(n){return void 0!==n&&"parent"!==n}function Kv(n){var t,e,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var Qv={x:0,y:0};function Jv(n,t){var e=t.snapGrid,r=void 0===e?[0,0]:e,o=t.snapToGrid,i=void 0!==o&&o,u=t.transform,a=up(n),c=a.x,l=a.y,s=Fv({x:c,y:l},u),f=i?Uv(s,r):s,d=f.x,h=f.y;return U({xSnapped:d,ySnapped:h},s)}var np,tp,ep,rp,op,ip,up=function(n,t){var e,r,o,i,u=function(n){return"clientX"in n}(n),a=u?n.clientX:null===(e=n.touches)||void 0===e?void 0:e[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==t?void 0:t.left)&&void 0!==o?o:0),y:c-(null!==(i=null==t?void 0:t.top)&&void 0!==i?i:0)}};function ap(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*t+.375*i+.375*n.targetControlX+.125*r,c=.125*e+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-t),Math.abs(c-e)]}function cp(n,t){return n>=0?.5*n:25*t*Math.sqrt(-n)}function lp(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(t){case ip.Left:return[e-cp(e-o,u),r];case ip.Right:return[e+cp(o-e,u),r];case ip.Top:return[e,r-cp(r-i,u)];case ip.Bottom:return[e,r+cp(i-r,u)]}}function sp(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.curvature,s=void 0===l?.25:l,f=W(lp({pos:o,x1:t,y1:e,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=W(lp({pos:c,x1:i,y1:u,x2:t,y2:e,c:s}),2),p=v[0],g=v[1],y=W(ap({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],b=y[2],_=y[3];return["M".concat(t,",").concat(e," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),m,w,b,_]}function fp(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-t)/2,u=r<t?r+i:r-i,a=Math.abs(o-e)/2;return[u,o<e?o+a:o-a,i,a]}!function(n){n.Strict="strict",n.Loose="loose"}(np||(np={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(tp||(tp={})),function(n){n.Partial="partial",n.Full="full"}(ep||(ep={})),function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(rp||(rp={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(op||(op={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(ip||(ip={}));var dp,hp=function(n){var t=n.source,e=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(t).concat(e||"","-").concat(r).concat(o||"")},vp=function(n,t){return n.source&&n.target?function(n,t){return t.some((function(t){return!(t.source!==n.source||t.target!==n.target||t.sourceHandle!==n.sourceHandle&&(t.sourceHandle||n.sourceHandle)||t.targetHandle!==n.targetHandle&&(t.targetHandle||n.targetHandle))}))}(e=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?U({},n):U(U({},n),{id:hp(n)}),t)?t:(null===e.sourceHandle&&delete e.sourceHandle,null===e.targetHandle&&delete e.targetHandle,t.concat(e)):t;var e},pp=function(n,t,e,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(e[r[o]]=n[r[o]])}return e}(n,["id"]);if(!t.source||!t.target)return e;if(!e.find((function(t){return t.id===n.id})))return e;var u=U(U({},i),{id:r.shouldReplaceId?hp(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle});return e.filter((function(n){return n.id!==o})).concat(u)};function gp(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=W(fp({sourceX:t,sourceY:e,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(t,",").concat(e,"L ").concat(r,",").concat(o),u,a,c,l]}var yp=((dp={})[ip.Left]={x:-1,y:0},dp[ip.Right]={x:1,y:0},dp[ip.Top]={x:0,y:-1},dp[ip.Bottom]={x:0,y:1},dp),mp=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};function wp(n){var t,e,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?ip.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?ip.Top:l,f=n.center,d=n.offset,h=yp[a],v=yp[s],p={x:i.x+h.x*d,y:i.y+h.y*d},g={x:c.x+v.x*d,y:c.y+v.y*d},y=function(n){var t=n.source,e=n.sourcePosition,r=void 0===e?ip.Bottom:e,o=n.target;return r===ip.Left||r===ip.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),m=0!==y.x?"x":"y",w=y[m],b=[],_={x:0,y:0},x={x:0,y:0},E=W(fp({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),S=E[0],k=E[1],C=E[2],N=E[3];if(h[m]*v[m]==-1){r=null!==(t=f.x)&&void 0!==t?t:S,o=null!==(e=f.y)&&void 0!==e?e:k;var M=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];b=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var j=[{x:p.x,y:g.y}],I=[{x:g.x,y:p.y}];if(b="x"===m?h.x===w?I:j:h.y===w?j:I,a===s){var P=Math.abs(i[m]-c[m]);if(P<=d){var A=Math.min(d-1,d-P);h[m]===w?_[m]=(p[m]>i[m]?-1:1)*A:x[m]=(g[m]>c[m]?-1:1)*A}}if(a!==s){var z="x"===m?"y":"x",L=h[m]===v[z],T=p[z]>g[z],B=p[z]<g[z];(1===h[m]&&(!L&&T||L&&B)||1!==h[m]&&(!L&&B||L&&T))&&(b="x"===m?j:I)}var D={x:p.x+_.x,y:p.y+_.y},R={x:g.x+x.x,y:g.y+x.y};Math.max(Math.abs(D.x-b[0].x),Math.abs(R.x-b[0].x))>=Math.max(Math.abs(D.y-b[0].y),Math.abs(R.y-b[0].y))?(r=(D.x+R.x)/2,o=b[0].y):(r=b[0].x,o=(D.y+R.y)/2)}return[$($([i,{x:p.x+_.x,y:p.y+_.y}],W(b),!1),[{x:g.x+x.x,y:g.y+x.y},c],!1),r,o,C,N]}function bp(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=W(wp({source:{x:t,y:e},sourcePosition:o,target:{x:i,y:u},targetPosition:c,center:{x:f,y:d},offset:void 0===h?20:h}),5),p=v[0],g=v[1],y=v[2],m=v[3],w=v[4];return[p.reduce((function(n,t,e){return n+(e>0&&e<p.length-1?function(n,t,e,r){var o=Math.min(mp(n,t)/2,mp(t,e)/2,r),i=t.x,u=t.y;if(n.x===i&&i===e.x||n.y===u&&u===e.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<e.x?-1:1,c=n.y<e.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<e.x?1:-1,s=n.y<e.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[e-1],t,p[e+1],s):"".concat(0===e?"M":"L").concat(t.x," ").concat(t.y))}),""),g,y,m,w]}function _p(n,t,e){var r=(null==e?void 0:e.rankdir)||"TB",o=new yv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(U({rankdir:r},e));var i=n.map((function(n){return U({},n)}));i.forEach((function(n){var t,e;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(t=n.data)||void 0===t?void 0:t.width)||200,i=(null===(e=n.data)||void 0===e?void 0:e.height)||56;o.setNode(n.id,{width:r,height:i})})),t.forEach((function(n){o.setEdge(n.source,n.target)})),yv.layout(o),i.forEach((function(n){var t=o.node(n.id),e="bottom",i="top";switch(r){case"TB":default:e="bottom",i="top";break;case"BT":e="top",i="bottom";break;case"LR":e="right",i="left";break;case"RL":e="left",i="right"}n.targetPosition=i,n.sourcePosition=e,n.position={x:t.x-t.width/2,y:t.y-t.height/2}}));var u=function(n){var t=n.centerNodeId,e=n.containerHeight,r=void 0===e?0:e,o=n.containerWidth,i=void 0===o?0:o,u=n.centerByBBox,a=n.nodes,c=n.nodeOrigin,l=void 0===c?Iv:c;if(!t&&!u||!r||!i)return Qv;if(null==t?void 0:t.trim()){var s=null==a?void 0:a.find((function(n){return n.id===(null==t?void 0:t.trim())}));if(s){var f=function(n,t){if(!n)return Qv;var e=Kv(n),r=e.width,o=e.height,i=r*t[0],u=o*t[1];return{x:n.position.x+r/2-i,y:n.position.y+o/2-u}}(s,l);return{x:i/2-f.x,y:r/2-f.y}}}return u?(f=function(n,t){if(!(null==n?void 0:n.length))return Qv;var e=Lv(n,{nodeOrigin:t}),r=e.x,o=e.y;return{x:r+e.width/2,y:o+e.height/2}}(a,l),{x:i/2-f.x,y:r/2-f.y}):Qv}({centerByBBox:null==e?void 0:e.centerByBBox,centerNodeId:null==e?void 0:e.centerNodeId,nodes:i,containerWidth:null==e?void 0:e.width,containerHeight:null==e?void 0:e.height,nodeOrigin:null==e?void 0:e.nodeOrigin}),a=u.x,c=void 0===a?0:a,l=u.y,s=void 0===l?0:l;i.forEach((function(n){n.position={x:n.position.x+c,y:n.position.y+s}}));var f={overflowBoundary:!1,transform:{x:0,y:0,zoom:1}};return(null==e?void 0:e.width)&&(null==e?void 0:e.height)&&e.fitViewOptions&&(f=function(n,t){var e=t||{},r=e.minZoom,o=void 0===r?Ov:r,i=e.maxZoom,u=void 0===i?jv:i,a=e.padding,c=void 0===a?.1:a,l=e.nodeOrigin,s=void 0===l?Iv:l,f=e.width,d=e.height,h=Lv(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:$v(h,f,d,o,u,c),overflowBoundary:v}}(i,U({width:e.width,height:e.height,nodeOrigin:e.nodeOrigin},e.fitViewOptions))),{nodes:i,edges:t,transform:f.transform,overflowBoundary:f.overflowBoundary}}var xp={assign:Object.assign,getHeight:function(n,t,e,r){return void 0===r&&(r="height"),"center"===e?(n[r]+t[r])/2:n.height}},Ep=xp,Sp={getId:function(n){return n.id||n.name},getPreH:function(n){return n.preH||0},getPreV:function(n){return n.preV||0},getHGap:function(n){return n.hgap||18},getVGap:function(n){return n.vgap||18},getChildren:function(n){return n.children},getHeight:function(n){return n.height||36},getWidth:function(n){var t=n.label||" ";return n.width||18*t.split("").length}};function kp(n,t){var e=this;if(e.vgap=e.hgap=0,n instanceof kp)return n;e.data=n;var r=t.getHGap(n),o=t.getVGap(n);return e.preH=t.getPreH(n),e.preV=t.getPreV(n),e.width=t.getWidth(n),e.height=t.getHeight(n),e.width+=e.preH,e.height+=e.preV,e.id=t.getId(n),e.x=e.y=0,e.depth=0,e.children||(e.children=[]),e.addGap(r,o),e}Ep.assign(kp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,t){var e=this;e.hgap+=n,e.vgap+=t,e.width+=2*n,e.height+=2*t},eachNode:function(n){for(var t,e=[this];t=e.shift();)n(t),e=t.children.concat(e)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var t,e=[this];t=e.shift();)n(t),e=e.concat(t.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(t){n.left=Math.min(n.left,t.x),n.top=Math.min(n.top,t.y),n.width=Math.max(n.width,t.x+t.width),n.height=Math.max(n.height,t.y+t.height)})),n},translate:function(n,t){void 0===n&&(n=0),void 0===t&&(t=0),this.eachNode((function(e){e.x+=n,e.y+=t,e.x+=e.preH,e.y+=e.preV}))},right2left:function(){var n=this,t=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-t.left)-n.width})),n.translate(t.width,0)},bottom2top:function(){var n=this,t=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-t.top)-n.height})),n.translate(0,t.height)}});var Cp=function(n,t,e){void 0===t&&(t={});var r,o=new kp(n,t=Ep.assign({},Sp,t)),i=[o];if(!e&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var u=t.getChildren(r.data),a=u?u.length:0;if(r.children=new Array(a),u&&a)for(var c=0;c<a;c++){var l=new kp(u[c],t);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Np=Cp,Mp=function(){function n(n,t){void 0===t&&(t={}),this.options=t,this.rootNode=Np(n,t)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),Op=Mp;function jp(n,t,e,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=t||0,o.y=e||0,o.x=0,o.c=r||[],o.cs=r.length,o.prelim=0,o.mod=0,o.shift=0,o.change=0,o.tl=null,o.tr=null,o.el=null,o.er=null,o.msel=0,o.mser=0}function Ip(n,t,e){e?n.y+=t:n.x+=t,n.children.forEach((function(n){Ip(n,t,e)}))}function Pp(n,t){var e=t?n.y:n.x;return n.children.forEach((function(n){e=Math.min(Pp(n,t),e)})),e}function Ap(n,t){Ip(n,-Pp(n,t),t)}function zp(n,t,e){e?t.y=n.x:t.x=n.x,n.c.forEach((function(n,r){zp(n,t.children[r],e)}))}function Lp(n,t,e){void 0===e&&(e=0),t?(n.x=e,e+=n.width):(n.y=e,e+=n.height),n.children.forEach((function(n){Lp(n,t,e)}))}jp.fromNode=function(n,t){if(!n)return null;var e=[];return n.children.forEach((function(n){e.push(jp.fromNode(n,t))})),t?new jp(n.height,n.width,n.x,e):new jp(n.width,n.height,n.y,e)};var Tp=Cp,Bp=function(n,t){for(var e=Tp(n.data,t,!0),r=Tp(n.data,t,!0),o=n.children.length,i=Math.round(o/2),u=t.getSide||function(n,t){return t<i?"right":"left"},a=0;a<o;a++){var c=n.children[a];"right"===u(c,a)?r.children.push(c):e.children.push(c)}return e.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:e,right:r}},Dp=Bp,Rp=["LR","RL","TB","BT","H","V"],Vp=["LR","RL","H"],Hp=Rp[0],Yp=function(n,t,e){var r=t.direction||Hp;if(t.isHorizontal=function(n){return Vp.indexOf(n)>-1}(r),r&&-1===Rp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Rp[0])e(n,t);else if(r===Rp[1])e(n,t),n.right2left();else if(r===Rp[2])e(n,t);else if(r===Rp[3])e(n,t),n.bottom2top();else if(r===Rp[4]||r===Rp[5]){var o=Dp(n,t),i=o.left,u=o.right;e(i,t),e(u,t),t.isHorizontal?i.right2left():i.bottom2top(),u.translate(i.x-u.x,i.y-u.y),n.x=i.x,n.y=u.y;var a=n.getBoundingBox();t.isHorizontal?a.top<0&&n.translate(0,-a.top):a.left<0&&n.translate(-a.left,0)}var c=t.fixedRoot;return void 0===c&&(c=!0),c&&n.translate(-(n.x+n.width/2+n.hgap),-(n.y+n.height/2+n.vgap)),function(n,t){if(t.radial){var e=t.isHorizontal?["x","y"]:["y","x"],r=e[0],o=e[1],i={x:1/0,y:1/0},u={x:-1/0,y:-1/0},a=0;n.DFTraverse((function(n){a++;var t=n.x,e=n.y;i.x=Math.min(i.x,t),i.y=Math.min(i.y,e),u.x=Math.max(u.x,t),u.y=Math.max(u.y,e)}));var c=u[o]-i[o];if(0===c)return;var l=2*Math.PI/a;n.DFTraverse((function(t){var e=(t[o]-i[o])/c*(2*Math.PI-l)+l,u=t[r]-n[r];t.x=Math.cos(e)*u,t.y=Math.sin(e)*u}))}}(n,t),n};function Zp(n,t){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Zp(n,t)}var Xp=function(n,t){void 0===t&&(t={});var e=t.isHorizontal;function r(n){0===n.cs?(n.el=n,n.er=n,n.msel=n.mser=0):(n.el=n.c[0].el,n.msel=n.c[0].msel,n.er=n.c[n.cs-1].er,n.mser=n.c[n.cs-1].mser)}function o(n,t,e){for(var r=n.c[t-1],o=r.mod,l=n.c[t],s=l.mod;null!==r&&null!==l;){c(r)>e.low&&(e=e.nxt);var f=o+r.prelim+r.w-(s+l.prelim);f>0&&(s+=f,i(n,t,e.index,f));var d=c(r),h=c(l);d<=h&&null!==(r=a(r))&&(o+=r.mod),d>=h&&null!==(l=u(l))&&(s+=l.mod)}!r&&l?function(n,t,e,r){var o=n.c[0].el;o.tl=e;var i=r-e.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[t].el,n.c[0].msel=n.c[t].msel}(n,t,l,s):r&&!l&&function(n,t,e,r){var o=n.c[t].er;o.tr=e;var i=r-e.mod-n.c[t].mser;o.mod+=i,o.prelim-=i,n.c[t].er=n.c[t-1].er,n.c[t].mser=n.c[t-1].mser}(n,t,r,o)}function i(n,t,e,r){n.c[t].mod+=r,n.c[t].msel+=r,n.c[t].mser+=r,function(n,t,e,r){if(e!==t-1){var o=t-e;n.c[e+1].shift+=r/o,n.c[t].shift-=r/o,n.c[t].change-=r-r/o}}(n,t,e,r)}function u(n){return 0===n.cs?n.tl:n.c[0]}function a(n){return 0===n.cs?n.tr:n.c[n.cs-1]}function c(n){return n.y+n.h}function l(n,t,e){for(;null!==e&&n>=e.low;)e=e.nxt;return{low:n,index:t,nxt:e}}Lp(n,e);var s=jp.fromNode(n,e);return function n(t){if(0!==t.cs){n(t.c[0]);for(var e=l(c(t.c[0].el),0,null),i=1;i<t.cs;++i){n(t.c[i]);var u=c(t.c[i].er);o(t,i,e),e=l(u,i,e)}!function(n){n.prelim=(n.c[0].prelim+n.c[0].mod+n.c[n.cs-1].mod+n.c[n.cs-1].prelim+n.c[n.cs-1].w)/2-n.w/2}(t),r(t)}else r(t)}(s),function n(t,e){e+=t.mod,t.x=t.prelim+e,function(n){for(var t=0,e=0,r=0;r<n.cs;r++)e+=(t+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=e}(t);for(var r=0;r<t.cs;r++)n(t.c[r],e)}(s,0),zp(s,n,e),Ap(n,e),n},Up=Yp,Fp=xp,Wp=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,Zp(e,r),t.prototype.execute=function(){return Up(this.rootNode,this.options,Xp)},t}(Op),$p={},Gp=xp;function qp(n,t){void 0===t&&(t=[]);var e=this;e.x=e.y=0,e.leftChild=e.rightChild=null,e.height=0,e.children=t}var Kp={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function Qp(n,t,e){e?(t.x=n.x,t.y=n.y):(t.x=n.y,t.y=n.x),n.children.forEach((function(n,r){Qp(n,t.children[r],e)}))}function Jp(n,t){return Jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},Jp(n,t)}var ng=function(n,t){void 0===t&&(t={}),t=Gp.assign({},Kp,t);var e,r=0,o=function n(t){if(!t)return null;t.width=0,t.depth&&t.depth>r&&(r=t.depth);var e=t.children,o=e.length,i=new qp(t.height,[]);return e.forEach((function(t,e){var r=n(t);i.children.push(r),0===e&&(i.leftChild=r),e===o-1&&(i.rightChild=r)})),i.originNode=t,i.isLeaf=t.isLeaf(),i}(n);return function n(t){if(t.isLeaf||0===t.children.length)t.drawingDepth=r;else{var e=t.children.map((function(t){return n(t)})),o=Math.min.apply(null,e);t.drawingDepth=o-1}return t.drawingDepth}(o),function n(r){r.x=r.drawingDepth*t.rankSep,r.isLeaf?(r.y=0,e&&(r.y=e.y+e.height+t.nodeSep,r.originNode.parent!==e.originNode.parent&&(r.y+=t.subTreeSep)),e=r):(r.children.forEach((function(t){n(t)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),Qp(o,n,t.isHorizontal),n},tg=Yp,eg=xp,rg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,Jp(e,r),t.prototype.execute=function(){var n=this;return n.rootNode.width=0,tg(n.rootNode,n.options,ng)},t}(Op),og={},ig=xp;function ug(n,t){return ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},ug(n,t)}var ag=Op,cg=function(n,t,e,r){var o=null;n.eachNode((function(n){!function(n,t,e,r,o){var i=("function"==typeof e?e(n):e)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=t?t.y:0)}catch(n){}if(n.x+=i,t){if(n.y=t.y+ig.getHeight(t,n,o),t.parent&&n.parent.id!==t.parent.id){var u=t.parent,a=u.y+ig.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,t,e,r),o=n}))},lg=Bp,sg=xp,fg=["LR","RL","H"],dg=fg[0],hg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,ug(e,r),t.prototype.execute=function(){var n=this.options,t=this.rootNode;n.isHorizontal=!0;var e=n.indent,r=void 0===e?20:e,o=n.dropCap,i=void 0===o||o,u=n.direction,a=void 0===u?dg:u,c=n.align;if(a&&-1===fg.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===fg[0])cg(t,r,i,c);else if(a===fg[1])cg(t,r,i,c),t.right2left();else if(a===fg[2]){var l=lg(t,n),s=l.left,f=l.right;cg(s,r,i,c),s.right2left(),cg(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),t.x=f.x-t.width/2}return t},t}(ag),vg={},pg=xp;function gg(n,t){var e=0;return n.children.length?n.children.forEach((function(n){e+=gg(n,t)})):e=n.height,n._subTreeSep=t.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,e)+2*n._subTreeSep,n.totalHeight}function yg(n){var t=n.children,e=t.length;if(e){t.forEach((function(n){yg(n)}));var r=t[0],o=t[e-1],i=o.y-r.y+o.height,u=0;if(t.forEach((function(n){u+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==t.length||n.height>u){var a=n.y+(n.height-i)/2-r.y;t.forEach((function(n){n.translate(0,a)}))}else n.y=(r.y+r.height/2+o.y+o.height/2)/2-n.height/2}}var mg={getSubTreeSep:function(){return 0}};function wg(n,t){return wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},wg(n,t)}var bg=function(n,t){void 0===t&&(t={}),t=pg.assign({},mg,t),n.parent={x:0,width:0,height:0,y:0},n.BFTraverse((function(n){n.x=n.parent.x+n.parent.width})),n.parent=null,gg(n,t),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var t=n.children,e=t.length;if(e){var r=t[0];if(r.startY=n.startY+n._subTreeSep,1===e)r.y=n.y+n.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var o=1;o<e;o++){var i=t[o];i.startY=t[o-1].startY+t[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),yg(n)},_g=Yp,xg=xp,Eg=function(n){function t(){return n.apply(this,arguments)||this}var e,r;return r=n,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,wg(e,r),t.prototype.execute=function(){return _g(this.rootNode,this.options,bg)},t}(Op),Sg={};Kt({compactBox:function(n,t){return t=Fp.assign({},$p,t),new Wp(n,t).execute()},dendrogram:function(n,t){return t=eg.assign({},og,t),new rg(n,t).execute()},indented:function(n,t){return t=sg.assign({},vg,t),new hg(n,t).execute()},mindmap:function(n,t){return t=xg.assign({},Sg,t),new Eg(n,t).execute()}});var kg={value:()=>{}};function Cg(){for(var n,t=0,e=arguments.length,r={};t<e;++t){if(!(n=arguments[t]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Ng(r)}function Ng(n){this._=n}function Mg(n,t){for(var e,r=0,o=n.length;r<o;++r)if((e=n[r]).name===t)return e.value}function Og(n,t,e){for(var r=0,o=n.length;r<o;++r)if(n[r].name===t){n[r]=kg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=e&&n.push({name:t,value:e}),n}Ng.prototype=Cg.prototype={constructor:Ng,on:function(n,t){var e,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var t="",e=n.indexOf(".");if(e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}}))),u=-1,a=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++u<a;)if(e=(n=i[u]).type)o[e]=Og(o[e],n.name,t);else if(null==t)for(e in o)o[e]=Og(o[e],n.name,null);return this}for(;++u<a;)if((e=(n=i[u]).type)&&(e=Mg(o[e],n.name)))return e},copy:function(){var n={},t=this._;for(var e in t)n[e]=t[e].slice();return new Ng(n)},call:function(n,t){if((e=arguments.length-2)>0)for(var e,r,o=new Array(e),i=0;i<e;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,e=(r=this._[n]).length;i<e;++i)r[i].value.apply(t,o)},apply:function(n,t,e){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],o=0,i=r.length;o<i;++o)r[o].value.apply(t,e)}};var jg="http://www.w3.org/1999/xhtml",Ig={svg:"http://www.w3.org/2000/svg",xhtml:jg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pg(n){var t=n+="",e=t.indexOf(":");return e>=0&&"xmlns"!==(t=n.slice(0,e))&&(n=n.slice(e+1)),Ig.hasOwnProperty(t)?{space:Ig[t],local:n}:n}function Ag(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===jg&&t.documentElement.namespaceURI===jg?t.createElement(n):t.createElementNS(e,n)}}function zg(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Lg(n){var t=Pg(n);return(t.local?zg:Ag)(t)}function Tg(){}function Bg(n){return null==n?Tg:function(){return this.querySelector(n)}}function Dg(){return[]}function Rg(n){return null==n?Dg:function(){return this.querySelectorAll(n)}}function Vg(n){return function(){return this.matches(n)}}function Hg(n){return function(t){return t.matches(n)}}var Yg=Array.prototype.find;function Zg(){return this.firstElementChild}var Xg=Array.prototype.filter;function Ug(){return Array.from(this.children)}function Fg(n){return new Array(n.length)}function Wg(n,t){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=t}function $g(n,t,e,r,o,i){for(var u,a=0,c=t.length,l=i.length;a<l;++a)(u=t[a])?(u.__data__=i[a],r[a]=u):e[a]=new Wg(n,i[a]);for(;a<c;++a)(u=t[a])&&(o[a]=u)}function Gg(n,t,e,r,o,i,u){var a,c,l,s=new Map,f=t.length,d=i.length,h=new Array(f);for(a=0;a<f;++a)(c=t[a])&&(h[a]=l=u.call(c,c.__data__,a,t)+"",s.has(l)?o[a]=c:s.set(l,c));for(a=0;a<d;++a)l=u.call(n,i[a],a,i)+"",(c=s.get(l))?(r[a]=c,c.__data__=i[a],s.delete(l)):e[a]=new Wg(n,i[a]);for(a=0;a<f;++a)(c=t[a])&&s.get(h[a])===c&&(o[a]=c)}function qg(n){return n.__data__}function Kg(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function Qg(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function Jg(n){return function(){this.removeAttribute(n)}}function ny(n){return function(){this.removeAttributeNS(n.space,n.local)}}function ty(n,t){return function(){this.setAttribute(n,t)}}function ey(n,t){return function(){this.setAttributeNS(n.space,n.local,t)}}function ry(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}}function oy(n,t){return function(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}}function iy(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function uy(n){return function(){this.style.removeProperty(n)}}function ay(n,t,e){return function(){this.style.setProperty(n,t,e)}}function cy(n,t,e){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}}function ly(n,t){return n.style.getPropertyValue(t)||iy(n).getComputedStyle(n,null).getPropertyValue(t)}function sy(n){return function(){delete this[n]}}function fy(n,t){return function(){this[n]=t}}function dy(n,t){return function(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}}function hy(n){return n.trim().split(/^|\s+/)}function vy(n){return n.classList||new py(n)}function py(n){this._node=n,this._names=hy(n.getAttribute("class")||"")}function gy(n,t){for(var e=vy(n),r=-1,o=t.length;++r<o;)e.add(t[r])}function yy(n,t){for(var e=vy(n),r=-1,o=t.length;++r<o;)e.remove(t[r])}function my(n){return function(){gy(this,n)}}function wy(n){return function(){yy(this,n)}}function by(n,t){return function(){(t.apply(this,arguments)?gy:yy)(this,n)}}function _y(){this.textContent=""}function xy(n){return function(){this.textContent=n}}function Ey(n){return function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}}function Sy(){this.innerHTML=""}function ky(n){return function(){this.innerHTML=n}}function Cy(n){return function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ny(){this.nextSibling&&this.parentNode.appendChild(this)}function My(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oy(){return null}function jy(){var n=this.parentNode;n&&n.removeChild(this)}function Iy(){var n=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function Py(){var n=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(n,this.nextSibling):n}function Ay(n){return function(){var t=this.__on;if(t){for(var e,r=0,o=-1,i=t.length;r<i;++r)e=t[r],n.type&&e.type!==n.type||e.name!==n.name?t[++o]=e:this.removeEventListener(e.type,e.listener,e.options);++o?t.length=o:delete this.__on}}}function zy(n,t,e){return function(){var r,o=this.__on,i=function(n){return function(t){n.call(this,t,this.__data__)}}(t);if(o)for(var u=0,a=o.length;u<a;++u)if((r=o[u]).type===n.type&&r.name===n.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=e),void(r.value=t);this.addEventListener(n.type,i,e),r={type:n.type,name:n.name,value:t,listener:i,options:e},o?o.push(r):this.__on=[r]}}function Ly(n,t,e){var r=iy(n),o=r.CustomEvent;"function"==typeof o?o=new o(t,e):(o=r.document.createEvent("Event"),e?(o.initEvent(t,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(t,!1,!1)),n.dispatchEvent(o)}function Ty(n,t){return function(){return Ly(this,n,t)}}function By(n,t){return function(){return Ly(this,n,t.apply(this,arguments))}}Wg.prototype={constructor:Wg,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,t){return this._parent.insertBefore(n,t)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},py.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var Dy=[null];function Ry(n,t){this._groups=n,this._parents=t}function Vy(){return new Ry([[document.documentElement]],Dy)}function Hy(n){return"string"==typeof n?new Ry([[document.querySelector(n)]],[document.documentElement]):new Ry([[n]],Dy)}function Yy(n,t){if(n=function(n){let t;for(;t=n.sourceEvent;)n=t;return n}(n),void 0===t&&(t=n.currentTarget),t){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}}return[n.pageX,n.pageY]}Ry.prototype=Vy.prototype={constructor:Ry,select:function(n){"function"!=typeof n&&(n=Bg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u,a=t[o],c=a.length,l=r[o]=new Array(c),s=0;s<c;++s)(i=a[s])&&(u=n.call(i,i.__data__,s,a))&&("__data__"in i&&(u.__data__=i.__data__),l[s]=u);return new Ry(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(t=n.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(n):Rg(n);for(var t=this._groups,e=t.length,r=[],o=[],i=0;i<e;++i)for(var u,a=t[i],c=a.length,l=0;l<c;++l)(u=a[l])&&(r.push(n.call(u,u.__data__,l,a)),o.push(u));return new Ry(r,o)},selectChild:function(n){return this.select(null==n?Zg:function(n){return function(){return Yg.call(this.children,n)}}("function"==typeof n?n:Hg(n)))},selectChildren:function(n){return this.selectAll(null==n?Ug:function(n){return function(){return Xg.call(this.children,n)}}("function"==typeof n?n:Hg(n)))},filter:function(n){"function"!=typeof n&&(n=Vg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u=t[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new Ry(r,this._parents)},data:function(n,t){if(!arguments.length)return Array.from(this,qg);var e,r=t?Gg:$g,o=this._parents,i=this._groups;"function"!=typeof n&&(e=n,n=function(){return e});for(var u=i.length,a=new Array(u),c=new Array(u),l=new Array(u),s=0;s<u;++s){var f=o[s],d=i[s],h=d.length,v=Kg(n.call(f,f&&f.__data__,s,o)),p=v.length,g=c[s]=new Array(p),y=a[s]=new Array(p);r(f,d,g,y,l[s]=new Array(h),v,t);for(var m,w,b=0,_=0;b<p;++b)if(m=g[b]){for(b>=_&&(_=b+1);!(w=y[_])&&++_<p;);m._next=w||null}}return(a=new Ry(a,o))._enter=c,a._exit=l,a},enter:function(){return new Ry(this._enter||this._groups.map(Fg),this._parents)},exit:function(){return new Ry(this._exit||this._groups.map(Fg),this._parents)},join:function(n,t,e){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=t&&(o=t(o))&&(o=o.selection()),null==e?i.remove():e(i),r&&o?r.merge(o).order():o},merge:function(n){for(var t=n.selection?n.selection():n,e=this._groups,r=t._groups,o=e.length,i=r.length,u=Math.min(o,i),a=new Array(o),c=0;c<u;++c)for(var l,s=e[c],f=r[c],d=s.length,h=a[c]=new Array(d),v=0;v<d;++v)(l=s[v]||f[v])&&(h[v]=l);for(;c<o;++c)a[c]=e[c];return new Ry(a,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,t=-1,e=n.length;++t<e;)for(var r,o=n[t],i=o.length-1,u=o[i];--i>=0;)(r=o[i])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(n){function t(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}n||(n=Qg);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i){for(var u,a=e[i],c=a.length,l=o[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(l[s]=u);l.sort(t)}return new Ry(o,this._parents).order()},call:function(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var r=n[t],o=0,i=r.length;o<i;++o){var u=r[o];if(u)return u}return null},size:function(){let n=0;for(const t of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var o,i=t[e],u=0,a=i.length;u<a;++u)(o=i[u])&&n.call(o,o.__data__,u,i);return this},attr:function(n,t){var e=Pg(n);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==t?e.local?ny:Jg:"function"==typeof t?e.local?oy:ry:e.local?ey:ty)(e,t))},style:function(n,t,e){return arguments.length>1?this.each((null==t?uy:"function"==typeof t?cy:ay)(n,t,null==e?"":e)):ly(this.node(),n)},property:function(n,t){return arguments.length>1?this.each((null==t?sy:"function"==typeof t?dy:fy)(n,t)):this.node()[n]},classed:function(n,t){var e=hy(n+"");if(arguments.length<2){for(var r=vy(this.node()),o=-1,i=e.length;++o<i;)if(!r.contains(e[o]))return!1;return!0}return this.each(("function"==typeof t?by:t?my:wy)(e,t))},text:function(n){return arguments.length?this.each(null==n?_y:("function"==typeof n?Ey:xy)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Sy:("function"==typeof n?Cy:ky)(n)):this.node().innerHTML},raise:function(){return this.each(Ny)},lower:function(){return this.each(My)},append:function(n){var t="function"==typeof n?n:Lg(n);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(n,t){var e="function"==typeof n?n:Lg(n),r=null==t?Oy:"function"==typeof t?t:Bg(t);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(jy)},clone:function(n){return this.select(n?Py:Iy)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,t,e){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var t="",e=n.indexOf(".");return e>=0&&(t=n.slice(e+1),n=n.slice(0,e)),{type:n,name:t}}))}(n+""),u=i.length;if(!(arguments.length<2)){for(a=t?zy:Ay,r=0;r<u;++r)this.each(a(i[r],t,e));return this}var a=this.node().__on;if(a)for(var c,l=0,s=a.length;l<s;++l)for(r=0,c=a[l];r<u;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(n,t){return this.each(("function"==typeof t?By:Ty)(n,t))},[Symbol.iterator]:function*(){for(var n=this._groups,t=0,e=n.length;t<e;++t)for(var r,o=n[t],i=0,u=o.length;i<u;++i)(r=o[i])&&(yield r)}};const Zy={passive:!1},Xy={capture:!0,passive:!1};function Uy(n){n.stopImmediatePropagation()}function Fy(n){n.preventDefault(),n.stopImmediatePropagation()}function Wy(n){var t=n.document.documentElement,e=Hy(n).on("dragstart.drag",Fy,Xy);"onselectstart"in t?e.on("selectstart.drag",Fy,Xy):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $y(n,t){var e=n.document.documentElement,r=Hy(n).on("dragstart.drag",null);t&&(r.on("click.drag",Fy,Xy),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Gy=n=>()=>n;function qy(n,{sourceEvent:t,subject:e,target:r,identifier:o,active:i,x:u,y:a,dx:c,dy:l,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:s}})}function Ky(n){return!n.ctrlKey&&!n.button}function Qy(){return this.parentNode}function Jy(n,t){return null==t?{x:n.x,y:n.y}:t}function nm(){return navigator.maxTouchPoints||"ontouchstart"in this}function tm(n,t){if(!n.parentId)return!1;var e=t.get(n.parentId);return!!e&&(!!e.selected||tm(e,t))}function em(n,t,e){var r=n;do{if(null==r?void 0:r.matches(t))return!0;if(r===e)return!1;r=r.parentElement}while(r);return!1}function rm(n){var t,e,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=F(u),s=l.next();!s.done;s=l.next()){var f=W(s.value,2),d=f[0],h=f[1],v=null===(r=a.get(d))||void 0===r?void 0:r.internals.userNode;v&&c.push(U(U({},v),{position:h.position}))}}catch(n){t={error:n}}finally{try{s&&!s.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}if(!i)return[c[0],c];var p=a.get(i).internals.userNode;return[U(U({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function om(n){var t=n.onNodeMouseDown,e=n.getStoreItems,r=n.onDragStart,o=n.onDrag,i=n.onDragStop,u={x:null,y:null},a=0,c=new Map,l=!1,s={x:0,y:0},f=null,d=!1,h=null;return{update:function(n){var v=n.noDragClassName,p=n.handleSelector,g=n.domNode,y=n.isSelectable,m=n.nodeId;function w(n,t){var r,i,a=n.x,l=n.y,s=e(),f=s.nodeLookup,d=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,w=s.onError,b=s.updateNodePositions;u={x:a,y:l};var _=!1,x={x:0,y:0,x2:0,y2:0};if(c.size>1&&d){var E=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var e={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==t.filter||t.filter(n)){var r=Xv(n,t.nodeOrigin);e=Yv(e,r)}})),Zv(e)}(c,{nodeOrigin:p});x=function(n){var t=n.x,e=n.y;return{x:t,y:e,x2:t+n.width,y2:e+n.height}}(E)}try{for(var S=F(c),k=S.next();!k.done;k=S.next()){var C=W(k.value,2),N=C[0],M=C[1],O={x:a-M.distance.x,y:l-M.distance.y};v&&(O=Uv(O,h));var j=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!M.extent){var I=M.internals.positionAbsolute,P=I.x-x.x+d[0][0],A=I.x+M.measured.width-x.x2+d[1][0];j=[[P,I.y-x.y+d[0][1]],[A,I.y+M.measured.height-x.y2+d[1][1]]]}var z=Bv({nodeId:N,nextPosition:O,nodeLookup:f,nodeExtent:j,nodeOrigin:p,onError:w}),L=z.position,T=z.positionAbsolute;_=_||M.position.x!==L.x||M.position.y!==L.y,M.position=L,M.internals.positionAbsolute=T}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(_&&(b(c,!0),t&&(o||g||!m&&y))){var B=W(rm({nodeId:m,dragItems:c,nodeLookup:f}),2),D=B[0],R=B[1];null==o||o(t,c,D,R),null==g||g(t,D,R),m||null==y||y(t,R)}}function b(){var n,t;if(f){var r=W(Hv(s,f),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=e(),l=c.transform,d=c.panBy;u.x=(null!==(n=u.x)&&void 0!==n?n:0)-o/l[2],u.y=(null!==(t=u.y)&&void 0!==t?t:0)-i/l[2],d({x:o,y:i})&&w(u,null)}a=requestAnimationFrame(b)}}function _(n){var o,i=e(),a=i.nodeLookup,l=i.multiSelectionActive,s=i.nodesDraggable,f=i.transform,h=i.snapGrid,v=i.snapToGrid,p=i.selectNodesOnDrag,g=i.onNodeDragStart,w=i.onSelectionDragStart,b=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||b(),y&&p&&m&&(null==t||t(m));var _=Jv(n.sourceEvent,{transform:f,snapGrid:h,snapToGrid:v});if(u=_,c=function(n,t,e,r){var o,i,u,a,c=new Map;try{for(var l=F(n),s=l.next();!s.done;s=l.next()){var f=W(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!tm(h,n))&&(h.draggable||t&&void 0===h.draggable)){var v=n.get(d);v&&c.set(d,{id:d,position:v.position||{x:0,y:0},distance:{x:e.x-v.internals.positionAbsolute.x,y:e.y-v.internals.positionAbsolute.y},extent:v.extent,parentId:v.parentId,origin:v.origin,expandParent:v.expandParent,internals:{positionAbsolute:v.internals.positionAbsolute||{x:0,y:0}},measured:{width:null!==(u=v.measured.width)&&void 0!==u?u:0,height:null!==(a=v.measured.height)&&void 0!==a?a:0}})}}}catch(n){o={error:n}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return c}(a,s,_,m),c.size>0&&(r||g||!m&&w)){var x=W(rm({nodeId:m,dragItems:c,nodeLookup:a}),2),E=x[0],S=x[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==w||w(n.sourceEvent,S)}}h=Hy(g);var x=function(){var n,t,e,r,o=Ky,i=Qy,u=Jy,a=nm,c={},l=Cg("start","drag","end"),s=0,f=0;function d(n){n.on("mousedown.drag",h).filter(a).on("touchstart.drag",g).on("touchmove.drag",y,Zy).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(u,a){if(!r&&o.call(this,u,a)){var c=w(this,i.call(this,u,a),u,a,"mouse");c&&(Hy(u.view).on("mousemove.drag",v,Xy).on("mouseup.drag",p,Xy),Wy(u.view),Uy(u),e=!1,n=u.clientX,t=u.clientY,c("start",u))}}function v(r){if(Fy(r),!e){var o=r.clientX-n,i=r.clientY-t;e=o*o+i*i>f}c.mouse("drag",r)}function p(n){Hy(n.view).on("mousemove.drag mouseup.drag",null),$y(n.view,e),Fy(n),c.mouse("end",n)}function g(n,t){if(o.call(this,n,t)){var e,r,u=n.changedTouches,a=i.call(this,n,t),c=u.length;for(e=0;e<c;++e)(r=w(this,a,n,t,u[e].identifier,u[e]))&&(Uy(n),r("start",n,u[e]))}}function y(n){var t,e,r=n.changedTouches,o=r.length;for(t=0;t<o;++t)(e=c[r[t].identifier])&&(Fy(n),e("drag",n,r[t]))}function m(n){var t,e,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=c[o[t].identifier])&&(Uy(n),e("end",n,o[t]))}function w(n,t,e,r,o,i){var a,f,h,v=l.copy(),p=Yy(i||e,t);if(null!=(h=u.call(n,new qy("beforestart",{sourceEvent:e,target:d,identifier:o,active:s,x:p[0],y:p[1],dx:0,dy:0,dispatch:v}),r)))return a=h.x-p[0]||0,f=h.y-p[1]||0,function e(i,u,l){var g,y=p;switch(i){case"start":c[o]=e,g=s++;break;case"end":delete c[o],--s;case"drag":p=Yy(l||u,t),g=s}v.call(i,n,new qy(i,{sourceEvent:u,subject:h,target:d,identifier:o,active:g,x:p[0]+a,y:p[1]+f,dx:p[0]-y[0],dy:p[1]-y[1],dispatch:v}),r)}}return d.filter=function(n){return arguments.length?(o="function"==typeof n?n:Gy(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:Gy(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:Gy(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:Gy(!!n),d):a},d.on=function(){var n=l.on.apply(l,arguments);return n===l?d:n},d.clickDistance=function(n){return arguments.length?(f=(n=+n)*n,d):Math.sqrt(f)},d}().on("start",(function(n){var t=e(),r=t.domNode,o=t.nodeDragThreshold,i=t.transform,a=t.snapGrid,c=t.snapToGrid;0===o&&_(n);var l=Jv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=up(n.sourceEvent,f)})).on("drag",(function(n){var t,r,o=e(),i=o.autoPanOnNodeDrag,a=o.transform,h=o.snapGrid,v=o.snapToGrid,p=o.nodeDragThreshold,g=Jv(n.sourceEvent,{transform:a,snapGrid:h,snapToGrid:v});if(!l&&i&&d&&(l=!0,b()),!d){var y=g.xSnapped-(null!==(t=u.x)&&void 0!==t?t:0),m=g.ySnapped-(null!==(r=u.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&_(n)}(u.x!==g.xSnapped||u.y!==g.ySnapped)&&c&&d&&(s=up(n.sourceEvent,f),w(g,n.sourceEvent))})).on("end",(function(n){if(d&&(l=!1,d=!1,cancelAnimationFrame(a),c.size>0)){var t=e(),r=t.nodeLookup,o=t.updateNodePositions,u=t.onNodeDragStop,s=t.onSelectionDragStop;if(o(c,!1),i||u||!m&&s){var f=W(rm({nodeId:m,dragItems:c,nodeLookup:r}),2),h=f[0],v=f[1];null==i||i(n.sourceEvent,c,h,v),null==u||u(n.sourceEvent,h,v),m||null==s||s(n.sourceEvent,v)}}})).filter((function(n){var t=n.target;return!n.button&&(!v||!em(t,".".concat(v),g))&&(!p||em(t,p,g))}));h.call(x)},destroy:function(){null==h||h.on(".drag",null)}}}function im(n,t,e,r){return(t[e]||[]).reduce((function(t,o){return"".concat(n.id,"-").concat(o.id,"-").concat(e)!==r&&t.push({id:o.id||null,type:e,nodeId:n.id,x:n.internals.positionAbsolute.x+o.x+o.width/2,y:n.internals.positionAbsolute.y+o.y+o.height/2}),t}),[])}function um(n,t){return n||((null==t?void 0:t.classList.contains("target"))?"target":(null==t?void 0:t.classList.contains("source"))?"source":null)}qy.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var am=function(){return!0},cm=null;function lm(n,t){var e=t.handle,r=t.connectionMode,o=t.fromNodeId,i=t.fromHandleId,u=t.fromType,a=t.doc,c=t.lib,l=t.flowId,s=t.isValidConnection,f=void 0===s?am:s,d="target"===u,h=e?a.querySelector(".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==e?void 0:e.nodeId,"-").concat(null==e?void 0:e.id,"-").concat(null==e?void 0:e.type,'"]')):null,v=up(n),p=v.x,g=v.y,y=a.elementFromPoint(p,g),m=(null==y?void 0:y.classList.contains("".concat(c,"-flow__handle")))?y:h,w={handleDomNode:m,isValid:!1,connection:null,endHandle:null};if(m){var b=um(void 0,m),_=m.getAttribute("data-nodeid"),x=m.getAttribute("data-handleid"),E=m.classList.contains("connectable"),S=m.classList.contains("connectableend");if(!_)return w;var k={source:d?_:o,sourceHandle:d?x:i,target:d?o:_,targetHandle:d?i:x};w.connection=k,E&&S&&(r===np.Strict?d&&"source"===b||!d&&"target"===b:_!==o||x!==i)&&(w.endHandle={nodeId:_,handleId:x,type:b},w.isValid=f(k))}return w}var sm={onPointerDown:function(n,t){var e,r=t.connectionMode,o=t.connectionRadius,i=t.handleId,u=t.nodeId,a=t.edgeUpdaterType,c=t.isTarget,l=t.domNode,s=t.nodeLookup,f=t.lib,d=t.autoPanOnConnect,h=t.flowId,v=t.panBy,p=t.cancelConnection,g=t.onConnectStart,y=t.onConnect,m=t.onConnectEnd,w=t.isValidConnection,b=void 0===w?am:w,_=t.onEdgeUpdateEnd,x=t.updateConnection,E=t.getTransform,S=t.getConnectionStartHandle,k=function(n){var t;return(null===(t=n.getRootNode)||void 0===t?void 0:t.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),C=0,N=up(n),M=N.x,O=N.y,j=null==k?void 0:k.elementFromPoint(M,O),I=um(a,j),P=null==l?void 0:l.getBoundingClientRect();if(P&&I){var A=up(n,P),z=!1,L=null,T=!1,B=null,D=function(n){var t,e,r=n.nodeLookup,o=n.nodeId,i=n.handleId,u=n.handleType,a=[];try{for(var c=F(r),l=c.next();!l.done;l=c.next()){var s=W(l.value,2)[1];if(s.internals.handleBounds){var f="".concat(o,"-").concat(i,"-").concat(u),d=im(s,s.internals.handleBounds,"source",f),h=im(s,s.internals.handleBounds,"target",f);a.push.apply(a,$($([],W(d),!1),W(h),!1))}}}catch(n){t={error:n}}finally{try{l&&!l.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}return a}({nodeLookup:s,nodeId:u,handleId:i,handleType:I});x({connectionPosition:A,connectionStatus:null,connectionStartHandle:cm={nodeId:u,handleId:i,type:I},connectionEndHandle:null}),null==g||g(n,{nodeId:u,handleId:i,handleType:I}),k.addEventListener("mousemove",V),k.addEventListener("mouseup",H),k.addEventListener("touchmove",V),k.addEventListener("touchend",H)}function R(){if(d&&P){var n=W(Hv(A,P),2),t=n[0],e=n[1];v({x:t,y:e}),C=requestAnimationFrame(R)}}function V(n){S()||H(n);var t=E();A=up(n,P),e=function(n,t,e){var r,o,i=[],u=1/0;try{for(var a=F(e),c=a.next();!c.done;c=a.next()){var l=c.value,s=Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));s<=t&&(s<u?i=[l]:s===u&&i.push(l),u=s)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i.length?1===i.length?i[0]:i.find((function(n){return"target"===n.type}))||i[0]:null}(Fv(A,t,!1,[1,1]),o,D),z||(R(),z=!0);var a,l,s,d=lm(n,{handle:e,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:b,doc:k,lib:f,flowId:h});B=d.handleDomNode,L=d.connection,T=d.isValid,x({connectionStartHandle:cm,connectionPosition:e&&T?Wv({x:e.x,y:e.y},t):A,connectionStatus:(a=!!e,l=T,s=null,l?s="valid":a&&!l&&(s="invalid"),s),connectionEndHandle:d.endHandle})}function H(n){(e||B)&&L&&T&&(null==y||y(L)),null==m||m(n),a&&(null==_||_(n)),p(),cancelAnimationFrame(C),z=!1,T=!1,L=null,B=null,cm=null,k.removeEventListener("mousemove",V),k.removeEventListener("mouseup",H),k.removeEventListener("touchmove",V),k.removeEventListener("touchend",H)}},isValid:lm};function fm(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function dm(n,t){var e=Object.create(n.prototype);for(var r in t)e[r]=t[r];return e}function hm(){}var vm=.7,pm=1/vm,gm="\\s*([+-]?\\d+)\\s*",ym="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wm=/^#([0-9a-f]{3,8})$/,bm=new RegExp(`^rgb\\(${gm},${gm},${gm}\\)$`),_m=new RegExp(`^rgb\\(${mm},${mm},${mm}\\)$`),xm=new RegExp(`^rgba\\(${gm},${gm},${gm},${ym}\\)$`),Em=new RegExp(`^rgba\\(${mm},${mm},${mm},${ym}\\)$`),Sm=new RegExp(`^hsl\\(${ym},${mm},${mm}\\)$`),km=new RegExp(`^hsla\\(${ym},${mm},${mm},${ym}\\)$`),Cm={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Nm(){return this.rgb().formatHex()}function Mm(){return this.rgb().formatRgb()}function Om(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=wm.exec(n))?(e=t[1].length,t=parseInt(t[1],16),6===e?jm(t):3===e?new Am(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===e?Im(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===e?Im(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=bm.exec(n))?new Am(t[1],t[2],t[3],1):(t=_m.exec(n))?new Am(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=xm.exec(n))?Im(t[1],t[2],t[3],t[4]):(t=Em.exec(n))?Im(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Sm.exec(n))?Rm(t[1],t[2]/100,t[3]/100,1):(t=km.exec(n))?Rm(t[1],t[2]/100,t[3]/100,t[4]):Cm.hasOwnProperty(n)?jm(Cm[n]):"transparent"===n?new Am(NaN,NaN,NaN,0):null}function jm(n){return new Am(n>>16&255,n>>8&255,255&n,1)}function Im(n,t,e,r){return r<=0&&(n=t=e=NaN),new Am(n,t,e,r)}function Pm(n,t,e,r){return 1===arguments.length?((o=n)instanceof hm||(o=Om(o)),o?new Am((o=o.rgb()).r,o.g,o.b,o.opacity):new Am):new Am(n,t,e,null==r?1:r);var o}function Am(n,t,e,r){this.r=+n,this.g=+t,this.b=+e,this.opacity=+r}function zm(){return`#${Dm(this.r)}${Dm(this.g)}${Dm(this.b)}`}function Lm(){const n=Tm(this.opacity);return`${1===n?"rgb(":"rgba("}${Bm(this.r)}, ${Bm(this.g)}, ${Bm(this.b)}${1===n?")":`, ${n})`}`}function Tm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Bm(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Dm(n){return((n=Bm(n))<16?"0":"")+n.toString(16)}function Rm(n,t,e,r){return r<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new Hm(n,t,e,r)}function Vm(n){if(n instanceof Hm)return new Hm(n.h,n.s,n.l,n.opacity);if(n instanceof hm||(n=Om(n)),!n)return new Hm;if(n instanceof Hm)return n;var t=(n=n.rgb()).r/255,e=n.g/255,r=n.b/255,o=Math.min(t,e,r),i=Math.max(t,e,r),u=NaN,a=i-o,c=(i+o)/2;return a?(u=t===i?(e-r)/a+6*(e<r):e===i?(r-t)/a+2:(t-e)/a+4,a/=c<.5?i+o:2-i-o,u*=60):a=c>0&&c<1?0:u,new Hm(u,a,c,n.opacity)}function Hm(n,t,e,r){this.h=+n,this.s=+t,this.l=+e,this.opacity=+r}function Ym(n){return(n=(n||0)%360)<0?n+360:n}function Zm(n){return Math.max(0,Math.min(1,n||0))}function Xm(n,t,e){return 255*(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)}fm(hm,Om,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Nm,formatHex:Nm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Vm(this).formatHsl()},formatRgb:Mm,toString:Mm}),fm(Am,Pm,dm(hm,{brighter(n){return n=null==n?pm:Math.pow(pm,n),new Am(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?vm:Math.pow(vm,n),new Am(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Am(Bm(this.r),Bm(this.g),Bm(this.b),Tm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zm,formatHex:zm,formatHex8:function(){return`#${Dm(this.r)}${Dm(this.g)}${Dm(this.b)}${Dm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Lm,toString:Lm})),fm(Hm,(function(n,t,e,r){return 1===arguments.length?Vm(n):new Hm(n,t,e,null==r?1:r)}),dm(hm,{brighter(n){return n=null==n?pm:Math.pow(pm,n),new Hm(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?vm:Math.pow(vm,n),new Hm(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,o=2*e-r;return new Am(Xm(n>=240?n-240:n+120,o,r),Xm(n,o,r),Xm(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new Hm(Ym(this.h),Zm(this.s),Zm(this.l),Tm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=Tm(this.opacity);return`${1===n?"hsl(":"hsla("}${Ym(this.h)}, ${100*Zm(this.s)}%, ${100*Zm(this.l)}%${1===n?")":`, ${n})`}`}}));var Um=n=>()=>n;function Fm(n,t){var e=t-n;return e?function(n,t){return function(e){return n+e*t}}(n,e):Um(isNaN(n)?t:n)}var Wm=function n(t){var e=function(n){return 1==(n=+n)?Fm:function(t,e){return e-t?function(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(r){return Math.pow(n+r*t,e)}}(t,e,n):Um(isNaN(t)?e:t)}}(t);function r(n,t){var r=e((n=Pm(n)).r,(t=Pm(t)).r),o=e(n.g,t.g),i=e(n.b,t.b),u=Fm(n.opacity,t.opacity);return function(t){return n.r=r(t),n.g=o(t),n.b=i(t),n.opacity=u(t),n+""}}return r.gamma=n,r}(1);function $m(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}var Gm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qm=new RegExp(Gm.source,"g");function Km(n,t){var e,r,o,i=Gm.lastIndex=qm.lastIndex=0,u=-1,a=[],c=[];for(n+="",t+="";(e=Gm.exec(n))&&(r=qm.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),a[u]?a[u]+=o:a[++u]=o),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:$m(e,r)})),i=qm.lastIndex;return i<t.length&&(o=t.slice(i),a[u]?a[u]+=o:a[++u]=o),a.length<2?c[0]?function(n){return function(t){return n(t)+""}}(c[0].x):function(n){return function(){return n}}(t):(t=c.length,function(n){for(var e,r=0;r<t;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}var Qm,Jm=180/Math.PI,nw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tw(n,t,e,r,o,i){var u,a,c;return(u=Math.sqrt(n*n+t*t))&&(n/=u,t/=u),(c=n*e+t*r)&&(e-=n*c,r-=t*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),n*r<t*e&&(n=-n,t=-t,c=-c,u=-u),{translateX:o,translateY:i,rotate:Math.atan2(t,n)*Jm,skewX:Math.atan(c)*Jm,scaleX:u,scaleY:a}}function ew(n,t,e,r){function o(n){return n.length?n.pop()+" ":""}return function(i,u){var a=[],c=[];return i=n(i),u=n(u),function(n,r,o,i,u,a){if(n!==o||r!==i){var c=u.push("translate(",null,t,null,e);a.push({i:c-4,x:$m(n,o)},{i:c-2,x:$m(r,i)})}else(o||i)&&u.push("translate("+o+t+i+e)}(i.translateX,i.translateY,u.translateX,u.translateY,a,c),function(n,t,e,i){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:$m(n,t)})):t&&e.push(o(e)+"rotate("+t+r)}(i.rotate,u.rotate,a,c),function(n,t,e,i){n!==t?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:$m(n,t)}):t&&e.push(o(e)+"skewX("+t+r)}(i.skewX,u.skewX,a,c),function(n,t,e,r,i,u){if(n!==e||t!==r){var a=i.push(o(i)+"scale(",null,",",null,")");u.push({i:a-4,x:$m(n,e)},{i:a-2,x:$m(t,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,u.scaleX,u.scaleY,a,c),i=u=null,function(n){for(var t,e=-1,r=c.length;++e<r;)a[(t=c[e]).i]=t.x(n);return a.join("")}}}var rw=ew((function(n){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return t.isIdentity?nw:tw(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),ow=ew((function(n){return null==n?nw:(Qm||(Qm=document.createElementNS("http://www.w3.org/2000/svg","g")),Qm.setAttribute("transform",n),(n=Qm.transform.baseVal.consolidate())?tw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):nw)}),", ",")",")");function iw(n){return((n=Math.exp(n))+1/n)/2}var uw,aw,cw=function n(t,e,r){function o(n,o){var i,u,a=n[0],c=n[1],l=n[2],s=o[0],f=o[1],d=o[2],h=s-a,v=f-c,p=h*h+v*v;if(p<1e-12)u=Math.log(d/l)/t,i=function(n){return[a+n*h,c+n*v,l*Math.exp(t*n*u)]};else{var g=Math.sqrt(p),y=(d*d-l*l+r*p)/(2*l*e*g),m=(d*d-l*l-r*p)/(2*d*e*g),w=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(m*m+1)-m);u=(b-w)/t,i=function(n){var r,o=n*u,i=iw(w),s=l/(e*g)*(i*(r=t*o+w,((r=Math.exp(2*r))-1)/(r+1))-function(n){return((n=Math.exp(n))-1/n)/2}(w));return[a+s*h,c+s*v,l*i/iw(t*o+w)]}}return i.duration=1e3*u*t/Math.SQRT2,i}return o.rho=function(t){var e=Math.max(.001,+t),r=e*e;return n(e,r,r*r)},o}(Math.SQRT2,2,4),lw=0,sw=0,fw=0,dw=0,hw=0,vw=0,pw="object"==typeof performance&&performance.now?performance:Date,gw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function yw(){return hw||(gw(mw),hw=pw.now()+vw)}function mw(){hw=0}function ww(){this._call=this._time=this._next=null}function bw(n,t,e){var r=new ww;return r.restart(n,t,e),r}function _w(){hw=(dw=pw.now())+vw,lw=sw=0;try{!function(){yw(),++lw;for(var n,t=uw;t;)(n=hw-t._time)>=0&&t._call.call(void 0,n),t=t._next;--lw}()}finally{lw=0,function(){for(var n,t,e=uw,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:uw=t);aw=n,Ew(r)}(),hw=0}}function xw(){var n=pw.now(),t=n-dw;t>1e3&&(vw-=t,dw=n)}function Ew(n){lw||(sw&&(sw=clearTimeout(sw)),n-hw>24?(n<1/0&&(sw=setTimeout(_w,n-pw.now()-vw)),fw&&(fw=clearInterval(fw))):(fw||(dw=pw.now(),fw=setInterval(xw,1e3)),lw=1,gw(_w)))}function Sw(n,t,e){var r=new ww;return t=null==t?0:+t,r.restart((e=>{r.stop(),n(e+t)}),t,e),r}ww.prototype=bw.prototype={constructor:ww,restart:function(n,t,e){if("function"!=typeof n)throw new TypeError("callback is not a function");e=(null==e?yw():+e)+(null==t?0:+t),this._next||aw===this||(aw?aw._next=this:uw=this,aw=this),this._call=n,this._time=e,Ew()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ew())}};var kw=Cg("start","end","cancel","interrupt"),Cw=[];function Nw(n,t,e,r,o,i){var u=n.__transition;if(u){if(e in u)return}else n.__transition={};!function(n,t,e){var r,o=n.__transition;function i(c){var l,s,f,d;if(1!==e.state)return a();for(l in o)if((d=o[l]).name===e.name){if(3===d.state)return Sw(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",n,n.__data__,d.index,d.group),delete o[l]):+l<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",n,n.__data__,d.index,d.group),delete o[l])}if(Sw((function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(c))})),e.state=2,e.on.call("start",n,n.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(f=e.tween.length),l=0,s=-1;l<f;++l)(d=e.tween[l].value.call(n,n.__data__,e.index,e.group))&&(r[++s]=d);r.length=s+1}}function u(t){for(var o=t<e.duration?e.ease.call(null,t/e.duration):(e.timer.restart(a),e.state=5,1),i=-1,u=r.length;++i<u;)r[i].call(n,o);5===e.state&&(e.on.call("end",n,n.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete o[t],o)return;delete n.__transition}o[t]=e,e.timer=bw((function(n){e.state=1,e.timer.restart(i,e.delay,e.time),e.delay<=n&&i(n-e.delay)}),0,e.time)}(n,e,{name:t,index:r,group:o,on:kw,tween:Cw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Mw(n,t){var e=jw(n,t);if(e.state>0)throw new Error("too late; already scheduled");return e}function Ow(n,t){var e=jw(n,t);if(e.state>3)throw new Error("too late; already running");return e}function jw(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Iw(n,t){var e,r,o,i=n.__transition,u=!0;if(i){for(o in t=null==t?null:t+"",i)(e=i[o]).name===t?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",n,n.__data__,e.index,e.group),delete i[o]):u=!1;u&&delete n.__transition}}function Pw(n,t){var e,r;return function(){var o=Ow(this,n),i=o.tween;if(i!==e)for(var u=0,a=(r=e=i).length;u<a;++u)if(r[u].name===t){(r=r.slice()).splice(u,1);break}o.tween=r}}function Aw(n,t,e){var r,o;if("function"!=typeof e)throw new Error;return function(){var i=Ow(this,n),u=i.tween;if(u!==r){o=(r=u).slice();for(var a={name:t,value:e},c=0,l=o.length;c<l;++c)if(o[c].name===t){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function zw(n,t,e){var r=n._id;return n.each((function(){var n=Ow(this,r);(n.value||(n.value={}))[t]=e.apply(this,arguments)})),function(n){return jw(n,r).value[t]}}function Lw(n,t){var e;return("number"==typeof t?$m:t instanceof Om?Wm:(e=Om(t))?(t=e,Wm):Km)(n,t)}function Tw(n){return function(){this.removeAttribute(n)}}function Bw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Dw(n,t,e){var r,o,i=e+"";return function(){var u=this.getAttribute(n);return u===i?null:u===r?o:o=t(r=u,e)}}function Rw(n,t,e){var r,o,i=e+"";return function(){var u=this.getAttributeNS(n.space,n.local);return u===i?null:u===r?o:o=t(r=u,e)}}function Vw(n,t,e){var r,o,i;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttribute(n))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=t(r=u,c));this.removeAttribute(n)}}function Hw(n,t,e){var r,o,i;return function(){var u,a,c=e(this);if(null!=c)return(u=this.getAttributeNS(n.space,n.local))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=t(r=u,c));this.removeAttributeNS(n.space,n.local)}}function Yw(n,t){var e,r;function o(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&function(n,t){return function(e){this.setAttributeNS(n.space,n.local,t.call(this,e))}}(n,o)),e}return o._value=t,o}function Zw(n,t){var e,r;function o(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&function(n,t){return function(e){this.setAttribute(n,t.call(this,e))}}(n,o)),e}return o._value=t,o}function Xw(n,t){return function(){Mw(this,n).delay=+t.apply(this,arguments)}}function Uw(n,t){return t=+t,function(){Mw(this,n).delay=t}}function Fw(n,t){return function(){Ow(this,n).duration=+t.apply(this,arguments)}}function Ww(n,t){return t=+t,function(){Ow(this,n).duration=t}}var $w=Vy.prototype.constructor;function Gw(n){return function(){this.style.removeProperty(n)}}var qw=0;function Kw(n,t,e,r){this._groups=n,this._parents=t,this._name=e,this._id=r}function Qw(){return++qw}var Jw=Vy.prototype;Kw.prototype={constructor:Kw,select:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=Bg(n));for(var r=this._groups,o=r.length,i=new Array(o),u=0;u<o;++u)for(var a,c,l=r[u],s=l.length,f=i[u]=new Array(s),d=0;d<s;++d)(a=l[d])&&(c=n.call(a,a.__data__,d,l))&&("__data__"in a&&(c.__data__=a.__data__),f[d]=c,Nw(f[d],t,e,d,f,jw(a,e)));return new Kw(i,this._parents,t,e)},selectAll:function(n){var t=this._name,e=this._id;"function"!=typeof n&&(n=Rg(n));for(var r=this._groups,o=r.length,i=[],u=[],a=0;a<o;++a)for(var c,l=r[a],s=l.length,f=0;f<s;++f)if(c=l[f]){for(var d,h=n.call(c,c.__data__,f,l),v=jw(c,e),p=0,g=h.length;p<g;++p)(d=h[p])&&Nw(d,t,e,p,h,v);i.push(h),u.push(c)}return new Kw(i,u,t,e)},selectChild:Jw.selectChild,selectChildren:Jw.selectChildren,filter:function(n){"function"!=typeof n&&(n=Vg(n));for(var t=this._groups,e=t.length,r=new Array(e),o=0;o<e;++o)for(var i,u=t[o],a=u.length,c=r[o]=[],l=0;l<a;++l)(i=u[l])&&n.call(i,i.__data__,l,u)&&c.push(i);return new Kw(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var t=this._groups,e=n._groups,r=t.length,o=e.length,i=Math.min(r,o),u=new Array(r),a=0;a<i;++a)for(var c,l=t[a],s=e[a],f=l.length,d=u[a]=new Array(f),h=0;h<f;++h)(c=l[h]||s[h])&&(d[h]=c);for(;a<r;++a)u[a]=t[a];return new Kw(u,this._parents,this._name,this._id)},selection:function(){return new $w(this._groups,this._parents)},transition:function(){for(var n=this._name,t=this._id,e=Qw(),r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)if(u=a[l]){var s=jw(u,t);Nw(u,n,e,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Kw(r,this._parents,n,e)},call:Jw.call,nodes:Jw.nodes,node:Jw.node,size:Jw.size,empty:Jw.empty,each:Jw.each,on:function(n,t){var e=this._id;return arguments.length<2?jw(this.node(),e).on.on(n):this.each(function(n,t,e){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var t=n.indexOf(".");return t>=0&&(n=n.slice(0,t)),!n||"start"===n}))}(t)?Mw:Ow;return function(){var u=i(this,n),a=u.on;a!==r&&(o=(r=a).copy()).on(t,e),u.on=o}}(e,n,t))},attr:function(n,t){var e=Pg(n),r="transform"===e?ow:Lw;return this.attrTween(n,"function"==typeof t?(e.local?Hw:Vw)(e,r,zw(this,"attr."+n,t)):null==t?(e.local?Bw:Tw)(e):(e.local?Rw:Dw)(e,r,t))},attrTween:function(n,t){var e="attr."+n;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;var r=Pg(n);return this.tween(e,(r.local?Yw:Zw)(r,t))},style:function(n,t,e){var r="transform"==(n+="")?rw:Lw;return null==t?this.styleTween(n,function(n,t){var e,r,o;return function(){var i=ly(this,n),u=(this.style.removeProperty(n),ly(this,n));return i===u?null:i===e&&u===r?o:o=t(e=i,r=u)}}(n,r)).on("end.style."+n,Gw(n)):"function"==typeof t?this.styleTween(n,function(n,t,e){var r,o,i;return function(){var u=ly(this,n),a=e(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=ly(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=t(r=u,a))}}(n,r,zw(this,"style."+n,t))).each(function(n,t){var e,r,o,i,u="style."+t,a="end."+u;return function(){var c=Ow(this,n),l=c.on,s=null==c.value[u]?i||(i=Gw(t)):void 0;l===e&&o===s||(r=(e=l).copy()).on(a,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,t,e){var r,o,i=e+"";return function(){var u=ly(this,n);return u===i?null:u===r?o:o=t(r=u,e)}}(n,r,t),e).on("end.style."+n,null)},styleTween:function(n,t,e){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(n,t,e){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,t,e){return function(r){this.style.setProperty(n,t.call(this,r),e)}}(n,i,e)),r}return i._value=t,i}(n,t,null==e?"":e))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var t=n(this);this.textContent=null==t?"":t}}(zw(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==n)return this.tween(t,null);if("function"!=typeof n)throw new Error;return this.tween(t,function(n){var t,e;function r(){var r=n.apply(this,arguments);return r!==e&&(t=(e=r)&&function(n){return function(t){this.textContent=n.call(this,t)}}(r)),t}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}(this._id))},tween:function(n,t){var e=this._id;if(n+="",arguments.length<2){for(var r,o=jw(this.node(),e).tween,i=0,u=o.length;i<u;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==t?Pw:Aw)(e,n,t))},delay:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?Xw:Uw)(t,n)):jw(this.node(),t).delay},duration:function(n){var t=this._id;return arguments.length?this.each(("function"==typeof n?Fw:Ww)(t,n)):jw(this.node(),t).duration},ease:function(n){var t=this._id;return arguments.length?this.each(function(n,t){if("function"!=typeof t)throw new Error;return function(){Ow(this,n).ease=t}}(t,n)):jw(this.node(),t).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,t){return function(){var e=t.apply(this,arguments);if("function"!=typeof e)throw new Error;Ow(this,n).ease=e}}(this._id,n))},end:function(){var n,t,e=this,r=e._id,o=e.size();return new Promise((function(i,u){var a={value:u},c={value:function(){0==--o&&i()}};e.each((function(){var e=Ow(this,r),o=e.on;o!==n&&((t=(n=o).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),e.on=t})),0===o&&i()}))},[Symbol.iterator]:Jw[Symbol.iterator]};var nb={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function tb(n,t){for(var e;!(e=n.__transition)||!(e=e[t]);)if(!(n=n.parentNode))throw new Error(`transition ${t} not found`);return e}Vy.prototype.interrupt=function(n){return this.each((function(){Iw(this,n)}))},Vy.prototype.transition=function(n){var t,e;n instanceof Kw?(t=n._id,n=n._name):(t=Qw(),(e=nb).time=yw(),n=null==n?null:n+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var u,a=r[i],c=a.length,l=0;l<c;++l)(u=a[l])&&Nw(u,n,t,l,a,e||tb(u,t));return new Kw(r,this._parents,n,t)};var eb=n=>()=>n;function rb(n,{sourceEvent:t,target:e,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function ob(n,t,e){this.k=n,this.x=t,this.y=e}ob.prototype={constructor:ob,scale:function(n){return 1===n?this:new ob(this.k*n,this.x,this.y)},translate:function(n,t){return 0===n&0===t?this:new ob(this.k,this.x+this.k*n,this.y+this.k*t)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ib=new ob(1,0,0);function ub(n){for(;!n.__zoom;)if(!(n=n.parentNode))return ib;return n.__zoom}function ab(n){n.stopImmediatePropagation()}function cb(n){n.preventDefault(),n.stopImmediatePropagation()}function lb(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function sb(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n).hasAttribute("viewBox")?[[(n=n.viewBox.baseVal).x,n.y],[n.x+n.width,n.y+n.height]]:[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]:[[0,0],[n.clientWidth,n.clientHeight]]}function fb(){return this.__zoom||ib}function db(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function hb(){return navigator.maxTouchPoints||"ontouchstart"in this}function vb(n,t,e){var r=n.invertX(t[0][0])-e[0][0],o=n.invertX(t[1][0])-e[1][0],i=n.invertY(t[0][1])-e[0][1],u=n.invertY(t[1][1])-e[1][1];return n.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),u>i?(i+u)/2:Math.min(0,i)||Math.max(0,u))}ub.prototype=ob.prototype;var pb,gb=function(n){return{x:n.x,y:n.y,zoom:n.k}},yb=function(n){var t=n.x,e=n.y,r=n.zoom;return ib.translate(t,e).scale(r)},mb=function(n,t){return n.target.closest(".".concat(t))},wb=function(n,t){return 2===t&&Array.isArray(n)&&n.includes(2)},bb=function(n,t){return void 0===t&&(t=0),"number"==typeof t&&t>0?n.transition().duration(t):n},_b=function(n){var t=n.ctrlKey&&Gv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*t};function xb(n){var t=n.domNode,e=n.minZoom,r=n.maxZoom,o=n.translateExtent,i=n.viewport,u=n.onPanZoom,a=n.onPanZoomStart,c=n.onPanZoomEnd,l=n.onTransformChange,s=n.onDraggingChange,f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=t.getBoundingClientRect(),h=function(){var n,t,e,r=lb,o=sb,i=vb,u=db,a=hb,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=cw,d=Cg("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",fb).on("wheel.zoom",x,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",S).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(n,t){return(t=Math.max(c[0],Math.min(c[1],t)))===n.k?n:new ob(t,n.x,n.y)}function y(n,t,e){var r=t[0]-e[0]*n.k,o=t[1]-e[1]*n.k;return r===n.x&&o===n.y?n:new ob(n.k,r,o)}function m(n){return[(+n[0][0]+ +n[1][0])/2,(+n[0][1]+ +n[1][1])/2]}function w(n,t,e,r){n.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=b(n,i).event(r),a=o.apply(n,i),c=null==e?m(a):"function"==typeof e?e.apply(n,i):e,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=n.__zoom,d="function"==typeof t?t.apply(n,i):t,h=f(s.invert(c).concat(l/s.k),d.invert(c).concat(l/d.k));return function(n){if(1===n)n=d;else{var t=h(n),e=l/t[2];n=new ob(e,c[0]-t[0]*e,c[1]-t[1]*e)}u.zoom(null,n)}}))}function b(n,t,e){return!e&&n.__zooming||new _(n,t)}function _(n,t){this.that=n,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,t),this.taps=0}function x(n,...t){if(r.apply(this,arguments)){var e=b(this,t).event(n),o=this.__zoom,a=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,u.apply(this,arguments)))),s=Yy(n);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=o.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(o.k===a)return;e.mouse=[s,o.invert(s)],Iw(this),e.start()}cb(n),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),150),e.zoom("mouse",i(y(g(o,a),e.mouse[0],e.mouse[1]),e.extent,l))}}function E(n,...t){if(!e&&r.apply(this,arguments)){var o=n.currentTarget,u=b(this,t,!0).event(n),a=Hy(n.view).on("mousemove.zoom",(function(n){if(cb(n),!u.moved){var t=n.clientX-s,e=n.clientY-f;u.moved=t*t+e*e>h}u.event(n).zoom("mouse",i(y(u.that.__zoom,u.mouse[0]=Yy(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),$y(n.view,u.moved),cb(n),u.event(n).end()}),!0),c=Yy(n,o),s=n.clientX,f=n.clientY;Wy(n.view),ab(n),u.mouse=[c,this.__zoom.invert(c)],Iw(this),u.start()}}function S(n,...t){if(r.apply(this,arguments)){var e=this.__zoom,u=Yy(n.changedTouches?n.changedTouches[0]:n,this),a=e.invert(u),c=e.k*(n.shiftKey?.5:2),f=i(y(g(e,c),u,a),o.apply(this,t),l);cb(n),s>0?Hy(this).transition().duration(s).call(w,f,u,n):Hy(this).call(p.transform,f,u,n)}}function k(e,...o){if(r.apply(this,arguments)){var i,u,a,c,l=e.touches,s=l.length,f=b(this,o,e.changedTouches.length===s).event(e);for(ab(e),u=0;u<s;++u)c=[c=Yy(a=l[u],this),this.__zoom.invert(c),a.identifier],f.touch0?f.touch1||f.touch0[2]===c[2]||(f.touch1=c,f.taps=0):(f.touch0=c,i=!0,f.taps=1+!!n);n&&(n=clearTimeout(n)),i&&(f.taps<2&&(t=c[0],n=setTimeout((function(){n=null}),500)),Iw(this),f.start())}}function C(n,...t){if(this.__zooming){var e,r,o,u,a=b(this,t).event(n),c=n.changedTouches,s=c.length;for(cb(n),e=0;e<s;++e)o=Yy(r=c[e],this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=o:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=o);if(r=a.that.__zoom,a.touch1){var f=a.touch0[0],d=a.touch0[1],h=a.touch1[0],v=a.touch1[1],p=(p=h[0]-f[0])*p+(p=h[1]-f[1])*p,m=(m=v[0]-d[0])*m+(m=v[1]-d[1])*m;r=g(r,Math.sqrt(p/m)),o=[(f[0]+h[0])/2,(f[1]+h[1])/2],u=[(d[0]+v[0])/2,(d[1]+v[1])/2]}else{if(!a.touch0)return;o=a.touch0[0],u=a.touch0[1]}a.zoom("touch",i(y(r,o,u),a.extent,l))}}function N(n,...r){if(this.__zooming){var o,i,u=b(this,r).event(n),a=n.changedTouches,c=a.length;for(ab(n),e&&clearTimeout(e),e=setTimeout((function(){e=null}),500),o=0;o<c;++o)i=a[o],u.touch0&&u.touch0[2]===i.identifier?delete u.touch0:u.touch1&&u.touch1[2]===i.identifier&&delete u.touch1;if(u.touch1&&!u.touch0&&(u.touch0=u.touch1,delete u.touch1),u.touch0)u.touch0[1]=this.__zoom.invert(u.touch0[0]);else if(u.end(),2===u.taps&&(i=Yy(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<v)){var l=Hy(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return p.transform=function(n,t,e,r){var o=n.selection?n.selection():n;o.property("__zoom",fb),n!==o?w(n,t,e,r):o.interrupt().each((function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},p.scaleBy=function(n,t,e,r){p.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),e,r)},p.scaleTo=function(n,t,e,r){p.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,u=null==e?m(n):"function"==typeof e?e.apply(this,arguments):e,a=r.invert(u),c="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,c),u,a),n,l)}),e,r)},p.translateBy=function(n,t,e,r){p.transform(n,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof e?e.apply(this,arguments):e),o.apply(this,arguments),l)}),null,r)},p.translateTo=function(n,t,e,r,u){p.transform(n,(function(){var n=o.apply(this,arguments),u=this.__zoom,a=null==r?m(n):"function"==typeof r?r.apply(this,arguments):r;return i(ib.translate(a[0],a[1]).scale(u.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof e?-e.apply(this,arguments):-e),n,l)}),r,u)},_.prototype={event:function(n){return n&&(this.sourceEvent=n),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(n,t){return this.mouse&&"mouse"!==n&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var t=Hy(this.that).datum();d.call(n,this.that,new rb(n,{sourceEvent:this.sourceEvent,target:p,type:n,transform:this.that.__zoom,dispatch:d}),t)}},p.wheelDelta=function(n){return arguments.length?(u="function"==typeof n?n:eb(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:eb(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:eb(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:eb([[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]]),p):o},p.scaleExtent=function(n){return arguments.length?(c[0]=+n[0],c[1]=+n[1],p):[c[0],c[1]]},p.translateExtent=function(n){return arguments.length?(l[0][0]=+n[0][0],l[1][0]=+n[1][0],l[0][1]=+n[0][1],l[1][1]=+n[1][1],p):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},p.constrain=function(n){return arguments.length?(i=n,p):i},p.duration=function(n){return arguments.length?(s=+n,p):s},p.interpolate=function(n){return arguments.length?(f=n,p):f},p.on=function(){var n=d.on.apply(d,arguments);return n===d?p:n},p.clickDistance=function(n){return arguments.length?(h=(n=+n)*n,p):Math.sqrt(h)},p.tapDistance=function(n){return arguments.length?(v=+n,p):v},p}().scaleExtent([e,r]).translateExtent(o),v=Hy(t).call(h);w({x:i.x,y:i.y,zoom:Dv(i.zoom,e,r)},[[0,0],[d.width,d.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,t){v&&(null==h||h.transform(bb(v,null==t?void 0:t.duration),n))}function m(){h.on("zoom",null)}function w(n,t,e){var r=yb(n),o=null==h?void 0:h.constrain()(r,t,e);return o&&y(o),o}return h.wheelDelta(_b),{update:function(n){var t=n.noWheelClassName,e=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,d=n.panOnDrag,y=n.panOnScrollMode,w=n.panOnScrollSpeed,b=n.preventScrolling,_=n.zoomOnPinch,x=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!f.isZoomingOrPanning&&m();var C=!i||S||o?function(n){var t=n.noWheelClassName,e=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!e&&"wheel"===n.type&&!n.ctrlKey||mb(n,t))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:t,preventScrolling:b,d3ZoomHandler:p}):function(n){var t=n.zoomPanValues,e=n.noWheelClassName,r=n.d3Selection,o=n.d3Zoom,i=n.panOnScrollMode,u=n.panOnScrollSpeed,a=n.zoomOnPinch,c=n.onPanZoomStart,l=n.onPanZoom,s=n.onPanZoomEnd;return function(n){if(mb(n,e))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=Yy(n),h=_b(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===tp.Vertical?0:n.deltaX*p,y=i===tp.Horizontal?0:n.deltaY*p;!Gv()&&n.shiftKey&&i!==tp.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=gb(r.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling||(t.isPanScrolling=!0,null==c||c(n,m)),t.isPanScrolling&&(null==l||l(n,m),t.panScrollTimeout=setTimeout((function(){null==s||s(n,m),t.isPanScrolling=!1}),150))}}}({zoomPanValues:f,noWheelClassName:t,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:w,zoomOnPinch:_,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var N=function(n){var t=n.zoomPanValues,e=n.onDraggingChange,r=n.onPanZoomStart;return function(n){var o,i,u;if(!(null===(o=n.sourceEvent)||void 0===o?void 0:o.internal)){var a=gb(n.transform);t.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,"mousedown"===(null===(u=n.sourceEvent)||void 0===u?void 0:u.type)&&e(!0),r&&(null==r||r(n.sourceEvent,a))}}}({zoomPanValues:f,onDraggingChange:s,onPanZoomStart:a});h.on("start",N);var M=function(n){var t=n.zoomPanValues,e=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var u,a,c;t.usedRightMouseButton=!(!r||!wb(e,null!==(u=t.mouseButton)&&void 0!==u?u:0)),(null===(a=n.sourceEvent)||void 0===a?void 0:a.sync)||o([n.transform.x,n.transform.y,n.transform.k]),i&&!(null===(c=n.sourceEvent)||void 0===c?void 0:c.internal)&&(null==i||i(n.sourceEvent,gb(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",M);var O=function(n){var t=n.zoomPanValues,e=n.panOnDrag,r=n.panOnScroll,o=n.onDraggingChange,i=n.onPanZoomEnd,u=n.onPaneContextMenu;return function(n){var a,c,l,s;if(!(null===(a=n.sourceEvent)||void 0===a?void 0:a.internal)&&(t.isZoomingOrPanning=!1,u&&wb(e,null!==(c=t.mouseButton)&&void 0!==c?c:0)&&!t.usedRightMouseButton&&n.sourceEvent&&u(n.sourceEvent),t.usedRightMouseButton=!1,o(!1),i&&(l=t.prevViewport,s=n.transform,l.x!==s.x||l.y!==s.y||l.zoom!==s.k))){var f=gb(n.transform);t.prevViewport=f,clearTimeout(t.timerId),t.timerId=setTimeout((function(){null==i||i(n.sourceEvent,f)}),r?150:0)}}}({zoomPanValues:f,panOnDrag:d,panOnScroll:i,onPaneContextMenu:r,onPanZoomEnd:c,onDraggingChange:s});h.on("end",O)}var j=function(n){var t=n.zoomActivationKeyPressed,e=n.zoomOnScroll,r=n.zoomOnPinch,o=n.panOnDrag,i=n.panOnScroll,u=n.zoomOnDoubleClick,a=n.userSelectionActive,c=n.noWheelClassName,l=n.noPanClassName,s=n.lib;return function(n){var f=t||e,d=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(mb(n,"".concat(s,"-flow__node"))||mb(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(mb(n,c)&&"wheel"===n.type)return!1;if(mb(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!t))return!1;if(!r&&n.ctrlKey&&"wheel"===n.type)return!1;if(!f&&!i&&!d&&"wheel"===n.type)return!1;if(!o&&("mousedown"===n.type||"touchstart"===n.type))return!1;if(Array.isArray(o)&&!o.includes(n.button)&&"mousedown"===n.type)return!1;var h=Array.isArray(o)&&o.includes(n.button)||!n.button||n.button<=1;return(!n.ctrlKey||"wheel"===n.type)&&h}}({zoomActivationKeyPressed:S,panOnDrag:d,zoomOnScroll:x,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:_,userSelectionActive:o,noPanClassName:e,noWheelClassName:t,lib:k});h.filter(j),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,t){var e=yb(n);return y(e,t),e},setViewportConstrained:w,getViewport:function(){var n=v?ub(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,t){v&&(null==h||h.scaleTo(bb(v,null==t?void 0:t.duration),n))},scaleBy:function(n,t){v&&(null==h||h.scaleBy(bb(v,null==t?void 0:t.duration),n))},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var t=yb(n),e=v.property("__zoom");e.k===n.zoom&&e.x===n.x&&e.y===n.y||null==h||h.transform(v,t,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(pb||(pb={}));U(U({},{width:0,height:0,x:0,y:0}),{pointerX:0,pointerY:0,aspectRatio:1});var Eb=mv();function Sb(n,t){var r=e(Z);if(null===r)throw new Error(Eb);return H(r,n,t)}function kb(){var n=e(Z);if(null===n)throw new Error(Eb);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}function Cb(n,t){var e,r,o;void 0===t&&(t={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{}});var i=(null==t?void 0:t.elevateNodesOnSelect)?1e3:0;try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=c.parentId;if(l){if(!n.has(l))throw new Error("Parent node ".concat(l," not found"));var s=n.get(l),f=Nb(c,n,d(d({},c.position),{z:(Lb(c.zIndex)?c.zIndex:0)+(c.selected?i:0)}),null!==(o=null==s?void 0:s.origin)&&void 0!==o?o:t.nodeOrigin),h=f.x,v=f.y,p=f.z,m=c.internals.positionAbsolute,w=h!==m.x||v!==m.y;(w||p!==c.internals.z)&&(c.internals=d(d({},c.internals),{positionAbsolute:w?{x:h,y:v}:m,z:p}))}}}catch(n){e={error:n}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}function Nb(n,t,e,r){var o,i,u,a,c,l;if(void 0===r&&(r=[0,0]),!n.parentId)return e;var s=t.get(n.parentId),f=Mb(s,r).position;return Nb(s,t,{x:(null!==(o=e.x)&&void 0!==o?o:0)+f.x,y:(null!==(i=e.y)&&void 0!==i?i:0)+f.y,z:(null!==(u=s.internals.z)&&void 0!==u?u:0)>(null!==(a=e.z)&&void 0!==a?a:0)?null!==(c=s.internals.z)&&void 0!==c?c:0:null!==(l=e.z)&&void 0!==l?l:0},s.origin||r)}var Mb=function(n,t){void 0===t&&(t=[0,0]);var e=zb(n),r=e.width,o=e.height,i=("internals"in n?n.internals.positionAbsolute:n.position)||{x:0,y:0},u=n.origin||t,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}};function Ob(n,t,e){var r,o;n.clear(),t.clear();try{for(var i=g(e),u=i.next();!u.done;u=i.next()){var a=u.value,c=a.source,l=a.target,s=a.sourceHandle,f=void 0===s?null:s,d=a.targetHandle,h=void 0===d?null:d,v="".concat(c,"-source-").concat(f),p="".concat(l,"-target-").concat(h),y=n.get(v)||new Map,m=n.get(p)||new Map,w={edgeId:a.id,source:c,target:l,sourceHandle:f,targetHandle:h};t.set(a.id,a),n.set(v,y.set("".concat(l,"-").concat(h),w)),n.set(p,m.set("".concat(c,"-").concat(f),w))}}catch(n){r={error:n}}finally{try{u&&!u.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}}function jb(n,t,e,r){void 0===r&&(r={nodeOrigin:[0,0],elevateNodesOnSelect:!0,defaults:{},checkEquality:!0});var o=new Map(t);t.clear(),e.clear();var i=(null==r?void 0:r.elevateNodesOnSelect)?1e3:0;n.forEach((function(n){var u,a,c,l,s=o.get(n.id);if(r.checkEquality&&n===(null==s?void 0:s.internals.userNode)||(s=d(d(d({},r.defaults),n),{measured:{width:null!==(a=null===(u=n.measured)||void 0===u?void 0:u.width)&&void 0!==a?a:0,height:null!==(l=null===(c=n.measured)||void 0===c?void 0:c.height)&&void 0!==l?l:0},internals:{positionAbsolute:n.position||{x:0,y:0},handleBounds:null==s?void 0:s.internals.handleBounds,z:(Lb(n.zIndex)?n.zIndex:0)+(n.selected?i:0),userNode:n}})),t.set(n.id,s),n.parentId){var f=e.get(n.parentId);f?f.push(s):e.set(n.parentId,[s])}})),e.size>0&&Cb(t,r)}function Ib(n,t,e,r){var o,i,u,a,c,l=[],s=new Map;try{for(var f=g(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=t.get(h.parentId);if(v){var p=null!==(a=null===(u=s.get(h.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:Db(v,null!==(c=v.origin)&&void 0!==c?c:r),y=Yb(p,h.rect);s.set(h.parentId,{expandedRect:y,parent:v})}}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return s.size>0&&s.forEach((function(t,r){var o=t.expandedRect,i=t.parent,u=Mb(i,i.origin).position,a=zb(i),c=o.x<u.x?Math.round(Math.abs(u.x-o.x)):0,s=o.y<u.y?Math.round(Math.abs(u.y-o.y)):0;if(c>0||s>0){l.push({id:r,type:"position",position:{x:u.x-c,y:u.y-s}});var f=e.get(r);null==f||f.forEach((function(t){n.some((function(n){return n.id===t.id}))||l.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+s}})}))}(a.width<o.width||a.height<o.height)&&l.push({id:r,type:"dimensions",setAttributes:!0,dimensions:{width:Math.max(a.width,Math.round(o.width)),height:Math.max(a.height,Math.round(o.height))}})})),l}var Pb=function(n,t,e){return void 0===t&&(t=0),void 0===e&&(e=1),Math.min(Math.max(n,t),e)},Ab=function(n,t){return void 0===n&&(n={x:0,y:0}),{x:Pb(n.x,t[0][0],t[1][0]),y:Pb(n.y,t[0][1],t[1][1])}};function zb(n){var t,e,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==o?o:0,height:null!==(c=null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:n.initialHeight)&&void 0!==c?c:0}}var Lb=function(n){return!isNaN(n)&&isFinite(n)},Tb=function(n,t){return void 0===t&&(t=[1,1]),{x:t[0]*Math.round(n.x/t[0]),y:t[1]*Math.round(n.y/t[1])}},Bb=function(n,t,e,r){var o=n.x,i=n.y,u=y(t,3),a=u[0],c=u[1],l=u[2];void 0===e&&(e=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return e?Tb(s,r):s},Db=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=Mb(n,t).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0,height:null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0}},Rb=function(n,t){return{x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x2,t.x2),y2:Math.max(n.y2,t.y2)}},Vb=function(n){var t=n.x,e=n.y;return{x:t,y:e,x2:t+n.width,y2:e+n.height}},Hb=function(n){var t=n.x,e=n.y;return{x:t,y:e,width:n.x2-t,height:n.y2-e}},Yb=function(n,t){return Hb(Rb(Vb(n),Vb(t)))};function Zb(n){return o(n)}var Xb=function(n,t){var e=Math.max(0,Math.min(n.x+n.width,t.x+t.width)-Math.max(n.x,t.x)),r=Math.max(0,Math.min(n.y+n.height,t.y+t.height)-Math.max(n.y,t.y));return Math.ceil(e*r)},Ub=function(n,t,e,r,o,i){var u=t/(n.width*(1+i)),a=e/(n.height*(1+i)),c=Math.min(u,a),l=Pb(c,r,o);return{x:t/2-(n.x+n.width/2)*l,y:e/2-(n.y+n.height/2)*l,zoom:l}};function Fb(n){return void 0!==n&&"parent"!==n}var Wb=function(n){return $b(n)},$b=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};var Gb=function(n){return Lb(n.width)&&Lb(n.height)&&Lb(n.x)&&Lb(n.y)},qb=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},Kb=["INPUT","SELECT","TEXTAREA"];function Qb(n){var t,e,r=(null===(e=null===(t=n.composedPath)||void 0===t?void 0:t.call(n))||void 0===e?void 0:e[0])||n.target;return Kb.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var Jb=function(n){return"clientX"in n},n_=function(n,t){var e,r,o,i,u=Jb(n),a=u?n.clientX:null===(e=n.touches)||void 0===e?void 0:e[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==t?void 0:t.left)&&void 0!==o?o:0),y:c-(null!==(i=null==t?void 0:t.top)&&void 0!==i?i:0)}},t_=function(n,t,e,r){void 0===r&&(r=[0,0]);var o=t.querySelectorAll(n);if(!o||!o.length)return null;var i=Array.from(o),u=t.getBoundingClientRect(),a=u.width*r[0],c=u.height*r[1];return i.map((function(n){var t=n.getBoundingClientRect();return d({id:n.getAttribute("data-handleid"),position:n.getAttribute("data-handlepos"),x:(t.left-u.left-a)/e,y:(t.top-u.top-c)/e},qb(n))}))},e_="undefined"!=typeof document?document:null;function r_(n,t){void 0===n&&(n=null),void 0===t&&(t={target:e_,actInsideInputWithModifier:!0});var e=y(i(!1),2),o=e[0],c=e[1],l=u(!1),s=u(new Set([])),f=y(r((function(){if(null!==n){var t=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),e=t.reduce((function(n,t){return n.concat.apply(n,m([],y(t),!1))}),[]);return[t,e]}return[[],[]]}),[n]),2),d=f[0],h=f[1];return a((function(){var e=(null==t?void 0:t.target)||e_;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!t.actInsideInputWithModifier)&&Qb(n))return!1;var e=i_(n.code,h);s.current.add(n[e]),o_(d,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!t.actInsideInputWithModifier)&&Qb(n))return!1;var e=i_(n.code,h);o_(d,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[e]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==e||e.addEventListener("keydown",r),null==e||e.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==e||e.removeEventListener("keydown",r),null==e||e.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function o_(n,t,e){return n.filter((function(n){return e||n.length===t.size})).some((function(n){return n.every((function(n){return t.has(n)}))}))}function i_(n,t){return t.includes(n)?"code":"key"}function u_(n,t){if(Object.is(n,t))return!0;if("object"!=typeof n||null===n||"object"!=typeof t||null===t)return!1;if(n instanceof Map&&t instanceof Map){if(n.size!==t.size)return!1;for(const[e,r]of n)if(!Object.is(r,t.get(e)))return!1;return!0}if(n instanceof Set&&t instanceof Set){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}const e=Object.keys(n);if(e.length!==Object.keys(t).length)return!1;for(const r of e)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(n[r],t[r]))return!1;return!0}var a_={position:"absolute",width:"100%",height:"100%",top:0,left:0};var c_=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function l_(n){var t=n.onPaneContextMenu,e=n.zoomOnScroll,r=void 0===e||e,o=n.zoomOnPinch,i=void 0===o||o,c=n.panOnScroll,l=void 0!==c&&c,s=n.panOnScrollSpeed,f=void 0===s?.5:s,d=n.panOnScrollMode,h=void 0===d?tp.Free:d,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,b=n.zoomActivationKeyCode,_=n.preventScrolling,x=void 0===_||_,E=n.children,S=n.noWheelClassName,C=n.noPanClassName,N=n.onViewportChange,M=n.isControlledViewport,O=kb(),j=u(null),I=Sb(c_,u_),P=I.userSelectionActive,A=I.lib,z=r_(b),L=u();return function(n){var t=kb();a((function(){var e=function(){var e,r;if(!n.current)return!1;var o=qb(n.current);0!==o.height&&0!==o.width||null===(r=(e=t.getState()).onError)||void 0===r||r.call(e,"004",bv()),t.setState({width:o.width||500,height:o.height||500})};if(n.current){e(),window.addEventListener("resize",e);var r=new ResizeObserver((function(){return e()}));return r.observe(n.current),function(){window.removeEventListener("resize",e),r&&n.current&&r.unobserve(n.current)}}}),[])}(j),a((function(){if(j.current){var n=O.getState();L.current=xb({domNode:j.current,minZoom:n.minZoom,maxZoom:n.maxZoom,translateExtent:w,viewport:m,onTransformChange:function(n){null==N||N({x:n[0],y:n[1],zoom:n[2]}),M||O.setState({transform:n})},onDraggingChange:function(n){return O.setState({paneDragging:n})},onPanZoomStart:function(n,t){var e=O.getState(),r=e.onViewportChangeStart,o=e.onMoveStart;null==o||o(n,t),null==r||r(t)},onPanZoom:function(n,t){var e=O.getState(),r=e.onViewportChange,o=e.onMove;null==o||o(n,t),null==r||r(t)},onPanZoomEnd:function(n,t){var e=O.getState(),r=e.onViewportChangeEnd,o=e.onMoveEnd;null==o||o(n,t),null==r||r(t)}});var t=L.current.getViewport(),e=t.x,r=t.y,o=t.zoom;return O.setState({panZoom:L.current,transform:[e,r,o],domNode:j.current.closest(".ink-flow")}),function(){var n;null===(n=L.current)||void 0===n||n.destroy()}}}),[]),a((function(){var n;null===(n=L.current)||void 0===n||n.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:f,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:x,noPanClassName:C,userSelectionActive:P,noWheelClassName:S,lib:A})}),[t,r,i,l,f,h,p,y,z,x,C,P,S,A]),k.jsx("div",{className:"ink-flow__renderer",ref:j,style:a_,children:E})}var s_={actInsideInputWithModifier:!1};function f_(n,t){switch(n.type){case"select":t.selected=n.selected;break;case"position":void 0!==n.position&&(t.position=n.position),void 0!==n.dragging&&(t.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(t.measured={width:n.dimensions.width,height:n.dimensions.height},n.setAttributes&&(t.width=n.dimensions.width,t.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(t.resizing=n.resizing)}}function d_(n,t){var e,r,o,i,u,a,c=[],l=new Map;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){if("add"!==(x=f.value).type)if("remove"===x.type||"replace"===x.type)l.set(x.id,[x]);else{var h=l.get(x.id);h?h.push(x):l.set(x.id,[x])}else c.push(x.item)}}catch(n){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}try{for(var v=g(t),p=v.next();!p.done;p=v.next()){var y=p.value,m=l.get(y.id);if(m){if("remove"!==m[0].type)if("replace"!==m[0].type){var w=d({},y);try{for(var b=(u=void 0,g(m)),_=b.next();!_.done;_=b.next()){var x;f_(x=_.value,w)}}catch(n){u={error:n}}finally{try{_&&!_.done&&(a=b.return)&&a.call(b)}finally{if(u)throw u.error}}c.push(w)}else c.push(d({},m[0].item))}else c.push(y)}}catch(n){o={error:n}}finally{try{p&&!p.done&&(i=v.return)&&i.call(v)}finally{if(o)throw o.error}}return c}function h_(n,t){return{id:n,type:"select",selected:t}}function v_(n,t,e){var r,o;void 0===t&&(t=new Set),void 0===e&&(e=!1);var i=[];try{for(var u=g(n),a=u.next();!a.done;a=u.next()){var c=y(a.value,2),l=c[0],s=c[1],f=t.has(l);void 0===s.selected&&!f||s.selected===f||(e&&(s.selected=f),i.push(h_(s.id,f)))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i}function p_(n){var t,e,r,o,i,u,a=n.items,c=void 0===a?[]:a,l=n.lookup,s=[],f=new Map(c.map((function(n){return[n.id,n]})));try{for(var d=g(c),h=d.next();!h.done;h=d.next()){var v=h.value,p=l.get(v.id),m=null!==(u=null===(i=null==p?void 0:p.internals)||void 0===i?void 0:i.userNode)&&void 0!==u?u:p;void 0!==m&&m!==v&&s.push({id:v.id,item:v,type:"replace"}),void 0===m&&s.push({item:v,type:"add"})}}catch(n){t={error:n}}finally{try{h&&!h.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}try{for(var w=g(l),b=w.next();!b.done;b=w.next()){var _=y(b.value,1)[0];void 0===f.get(_)&&s.push({id:_,type:"remove"})}}catch(n){r={error:n}}finally{try{b&&!b.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}function g_(n){return{id:n.id,type:"remove"}}var y_=function(n,t){void 0===t&&(t=[0,0]);var e=zb(n),r=e.width,o=e.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||t,a=r*u[0],c=o*u[1];return{position:{x:n.position.x-a,y:n.position.y-c},positionAbsolute:{x:i.x-a,y:i.y-c}}},m_=function(n,t){if(void 0===t&&(t={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var e=n.reduce((function(n,e){var r=function(n,t){var e,r,o,i,u,a;void 0===t&&(t=[0,0]);var c=Mb(n,t).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:n.width)&&void 0!==o?o:0),y2:s+(null!==(a=null!==(u=null===(i=n.measured)||void 0===i?void 0:i.height)&&void 0!==u?u:n.height)&&void 0!==a?a:0)}}(e,t.nodeOrigin);return Rb(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hb(e)},w_=function(n,t,e,r,o,i){var u,a,c,l,s,f,h,v,p=y(void 0===e?[0,0,1]:e,3),m=p[0],w=p[1],b=p[2];void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=[0,0]);var _=d(d({},Bb(t,[m,w,b])),{width:t.width/b,height:t.height/b}),x=[];try{for(var E=g(n),S=E.next();!S.done;S=E.next()){var k=y(S.value,2)[1],C=k.measured,N=k.selectable,M=void 0===N||N,O=k.hidden,j=void 0!==O&&O,I=null!==(s=null!==(l=null!==(c=C.width)&&void 0!==c?c:k.width)&&void 0!==l?l:k.initialWidth)&&void 0!==s?s:null,P=null!==(v=null!==(h=null!==(f=C.height)&&void 0!==f?f:k.height)&&void 0!==h?h:k.initialHeight)&&void 0!==v?v:null;if(!(o&&!M||j)){var A=Xb(_,Db(k,i));(null===I||null===P||r&&A>0||A>=(null!=I?I:0)*(null!=P?P:0)||k.dragging)&&x.push(k)}}}catch(n){u={error:n}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(u)throw u.error}}return x};function b_(n,t){var e,r,o,i=n.nodeLookup,u=n.width,a=n.height,c=n.panZoom,l=n.minZoom,s=n.maxZoom,f=n.nodeOrigin,d=void 0===f?[0,0]:f,h=[],v=(null==t?void 0:t.nodes)?new Set(t.nodes.map((function(n){return n.id}))):null;if(i.forEach((function(n){!(n.measured.width&&n.measured.height&&((null==t?void 0:t.includeHiddenNodes)||!n.hidden))||v&&!v.has(n.id)||h.push(n)})),h.length>0){var p=m_(h,{nodeOrigin:d}),g=p.width>=u||p.height>=a;if("overflow"===(null==t?void 0:t.when)&&!g)return!0;var y=Ub(p,u,a,null!==(e=null==t?void 0:t.minZoom)&&void 0!==e?e:l,null!==(r=null==t?void 0:t.maxZoom)&&void 0!==r?r:s,null!==(o=null==t?void 0:t.padding)&&void 0!==o?o:.1);return c.setViewport(y,{duration:null==t?void 0:t.duration}),!0}return!1}function __(n){var t=n.nodeId,e=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(t),l=c.parentId?r.get(c.parentId):void 0,s=l?y_(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,t){var e,r,o,i;return t&&"parent"!==t?[t[0],[t[1][0]-(null!==(r=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==r?r:0),t[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:t}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&Fb(c.extent)&&(h=[[c.extent[0][0]+f,c.extent[0][1]+d],[c.extent[1][0]+f,c.extent[1][1]+d]]);else if(l){var v=c.measured.width,p=c.measured.height,g=l.measured.width,y=l.measured.height;if(v&&p&&g&&y){var m=c.origin||i,w=f+v*m[0],b=d+p*m[1];h=[[w,b],[w+g-v,b+y-p]]}}else null==a||a("005",_v());var _=Fb(h)?Ab(e,h):e;return{position:{x:_.x-f,y:_.y-d},positionAbsolute:_}}function x_(n){return v(this,arguments,void 0,(function(n){var t,e,r,o,i,u,a,c,l,s,f,d,h,v,y,m,w,b,_,x=n.nodesToRemove,E=void 0===x?[]:x,S=n.edgesToRemove,k=void 0===S?[]:S,C=n.nodes,N=n.edges,M=n.onBeforeDelete;return p(this,(function(n){switch(n.label){case 0:t=new Set(E.map((function(n){return n.id}))),e=[],r=function(n){if(!1===n.deletable)return"continue";var r=t.has(n.id),o=!r&&n.parentId&&e.find((function(t){return t.id===n.parentId}));(r||o)&&e.push(n)};try{for(o=g(C),i=o.next();!i.done;i=o.next())u=i.value,r(u)}catch(n){m={error:n}}finally{try{i&&!i.done&&(w=o.return)&&w.call(o)}finally{if(m)throw m.error}}a=new Set(k.map((function(n){return n.id}))),c=N.filter((function(n){return!1!==n.deletable})),l=function(n,t){var e=new Set;return n.forEach((function(n){e.add(n.id)})),t.filter((function(n){return e.has(n.source)||e.has(n.target)}))}(e,c),s=l,f=function(n){a.has(n.id)&&!s.find((function(t){return t.id===n.id}))&&s.push(n)};try{for(d=g(c),h=d.next();!h.done;h=d.next())v=h.value,f(v)}catch(n){b={error:n}}finally{try{h&&!h.done&&(_=d.return)&&_.call(d)}finally{if(b)throw b.error}}return M?[4,M({nodes:e,edges:s})]:[2,{edges:s,nodes:e}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:e}:{edges:[],nodes:[]}]:[2,y]}}))}))}var E_=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function S_(){var n=Sb(E_,u_),t=n.userSelectionActive,e=n.userSelectionRect;return t&&e?k.jsx("div",{className:"ink-flow__selection ink-flow__container",style:{width:e.width,height:e.height,transform:"translate(".concat(e.x,"px, ").concat(e.y,"px)")}}):null}var k_=function(n,t){return function(e){e.target===t.current&&(null==n||n(e))}},C_=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function N_(n){var t=n.isSelecting;n.selectionMode;var e=n.panOnDrag,r=n.onSelectionStart,o=n.onSelectionEnd,i=n.onPaneClick,a=n.onPaneContextMenu,c=n.onPaneScroll,l=n.onPaneMouseEnter,s=n.onPaneMouseMove,f=n.onPaneMouseLeave,d=n.children,h=u(null),v=kb(),p=u(0),m=u(0),w=u(),b=u(new Map),_=Sb(C_,u_),x=_.userSelectionActive,E=_.elementsSelectable,S=_.dragging,C=function(){v.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},N=function(n){null==i||i(n),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},M=c?function(n){return c(n)}:void 0,O=E&&(t||x);return k.jsxs("div",{className:j(["ink-flow__pane",{draggable:e,dragging:S,selection:t}]),onClick:O?void 0:k_(N,h),onContextMenu:k_((function(n){Array.isArray(e)&&(null==e?void 0:e.includes(2))?n.preventDefault():null==a||a(n)}),h),onWheel:k_(M,h),onMouseEnter:O?void 0:l,onMouseDown:O?function(n){var e,o,i,u,a=v.getState(),c=a.resetSelectedElements,l=a.domNode,s=a.edgeLookup;if(w.current=null==l?void 0:l.getBoundingClientRect(),E&&t&&0===n.button&&n.target===h.current&&w.current){b.current=new Map;try{for(var f=g(s),d=f.next();!d.done;d=f.next()){var p=y(d.value,2),m=p[0],_=p[1];b.current.set(_.source,(null===(i=b.current.get(_.source))||void 0===i?void 0:i.add(m))||new Set([m])),b.current.set(_.target,(null===(u=b.current.get(_.target))||void 0===u?void 0:u.add(m))||new Set([m]))}}catch(n){e={error:n}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(e)throw e.error}}var x=n_(n.nativeEvent,w.current),S=x.x,k=x.y;c(),v.setState({userSelectionRect:{width:0,height:0,startX:S,startY:k,x:S,y:k}}),null==r||r(n)}}:void 0,onMouseMove:O?function(n){var e,r,o,i,u=v.getState(),a=u.userSelectionRect,c=u.edgeLookup,l=u.transform,s=u.nodeOrigin,f=u.nodeLookup,d=u.triggerNodeChanges,h=u.triggerEdgeChanges;if(t&&w.current&&a){var y=n_(n.nativeEvent,w.current),_=y.x,x=y.y,E=a.startX,S=a.startY,k={startX:E,startY:S,x:_<E?_:E,y:x<S?x:S,width:Math.abs(_-E),height:Math.abs(x-S)},C=w_(f,k,l,!1,!0,s),N=new Set,M=new Set;try{for(var O=g(C),j=O.next();!j.done;j=O.next()){var I=j.value;M.add(I.id);var P=b.current.get(I.id);if(P)try{for(var A=(o=void 0,g(P)),z=A.next();!z.done;z=A.next()){var L=z.value;N.add(L)}}catch(n){o={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(o)throw o.error}}}}catch(n){e={error:n}}finally{try{j&&!j.done&&(r=O.return)&&r.call(O)}finally{if(e)throw e.error}}if(p.current!==M.size)p.current=M.size,d(v_(f,M,!0));if(m.current!==N.size)m.current=N.size,h(v_(c,N));v.setState({userSelectionRect:k,userSelectionActive:!0,nodesSelectionActive:!1})}}:s,onMouseUp:O?function(n){if(0===n.button){var t=v.getState().userSelectionRect;!x&&t&&n.target===h.current&&(null==N||N(n)),v.setState({nodesSelectionActive:p.current>0}),C(),null==o||o(n)}}:void 0,onMouseLeave:O?function(n){x&&(v.setState({nodesSelectionActive:p.current>0}),null==o||o(n)),C()}:f,ref:h,style:a_,children:[d,k.jsx(S_,{})]})}var M_=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function O_(n){var t=n.children,e=n.onPaneClick,r=n.onPaneMouseEnter,o=n.onPaneMouseMove,i=n.onPaneMouseLeave,u=n.onPaneContextMenu,c=n.onPaneScroll,l=n.deleteKeyCode,s=n.selectionKeyCode,f=n.selectionOnDrag,d=n.selectionMode,h=n.onSelectionStart,v=n.onSelectionEnd,p=n.multiSelectionKeyCode,g=n.panActivationKeyCode,y=n.zoomActivationKeyCode,m=n.elementsSelectable,w=n.zoomOnScroll,b=n.zoomOnPinch,_=n.panOnScroll,x=n.panOnScrollSpeed,E=n.panOnScrollMode,S=n.zoomOnDoubleClick,C=n.panOnDrag,N=n.defaultViewport,M=n.translateExtent,O=n.minZoom,j=n.maxZoom,I=n.preventScrolling;n.onSelectionContextMenu;var P=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,L=n.isControlledViewport,T=Sb(M_);T.nodesSelectionActive;var B=T.userSelectionActive,D=r_(s),R=r_(g),V=R||C,H=R||_,Y=D||B||f&&!0!==V;return function(n){var t=n.deleteKeyCode,e=n.multiSelectionKeyCode,r=kb(),o=r_(t,s_),i=r_(e);a((function(){if(o){var n=r.getState();n.edges,n.nodes,r.setState({nodesSelectionActive:!1})}}),[o]),a((function(){r.setState({multiSelectionActive:i})}),[i])}({deleteKeyCode:l,multiSelectionKeyCode:p}),k.jsx(l_,{onPaneContextMenu:u,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:H,panOnScrollSpeed:x,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!D&&V,defaultViewport:N,translateExtent:M,minZoom:O,maxZoom:j,zoomActivationKeyCode:y,preventScrolling:I,noWheelClassName:P,noPanClassName:A,onViewportChange:z,isControlledViewport:L,children:k.jsx(N_,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:V,isSelecting:!!Y,selectionMode:d,children:t})})}O_.displayName="FlowRenderer";var j_=c(O_);function I_(n){var t=y(i(n),2);return[t[0],t[1]]}function P_(n){var t=y(i(n),2);return[t[0],t[1]]}var A_="undefined"!=typeof window?l:a;function z_(n){var t=y(i(!1),2),e=t[0],r=t[1],o=y(i((function(){return function(n){var t=[];return{get:function(){return t},reset:function(){t=[]},push:function(e){t.push(e),n()}}}((function(){return r(!0)}))})),1),u=o[0];return A_((function(){if(e){var t=u.get();t.length&&(n(t),u.reset()),r(!1)}else u.reset()}),[e]),u}var L_=t(null);function T_(n){var t=n.children,e=kb(),o=s((function(n){var t,r,o=e.getState(),i=o.nodes,u=void 0===i?[]:i,a=o.onNodesChange,c=o.nodeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}a&&a({changes:p_({items:l,lookup:c}),userNodes:l})}),[]),i=z_(o),u=s((function(n){var t,r,o=e.getState(),i=o.edges,u=void 0===i?[]:i,a=o.onEdgesChange,c=o.edgeLookup,l=u;try{for(var s=g(n),f=s.next();!f.done;f=s.next()){var d=f.value;l="function"==typeof d?d(l):d}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}a&&a({changes:p_({items:l,lookup:c}),userEdges:l})}),[]),a=z_(u),c=r((function(){return{nodeQueue:i,edgeQueue:a}}),[]);return k.jsx(L_.Provider,{value:c,children:t})}var B_=function(){var n=kb();return r((function(){return{zoomIn:function(t){var e;return null===(e=n.getState().panZoom)||void 0===e?void 0:e.scaleBy(1.2,{duration:null==t?void 0:t.duration})},zoomOut:function(t){var e;return null===(e=n.getState().panZoom)||void 0===e?void 0:e.scaleBy(1/1.2,{duration:null==t?void 0:t.duration})},zoomTo:function(t,e){var r;return null===(r=n.getState().panZoom)||void 0===r?void 0:r.scaleTo(t,{duration:null==e?void 0:e.duration})},getZoom:function(){return n.getState().transform[2]},setViewport:function(t,e){var r,o,i,u=n.getState(),a=y(u.transform,3),c=a[0],l=a[1],s=a[2],f=u.panZoom;null==f||f.setViewport({x:null!==(r=t.x)&&void 0!==r?r:c,y:null!==(o=t.y)&&void 0!==o?o:l,zoom:null!==(i=t.zoom)&&void 0!==i?i:s},{duration:null==e?void 0:e.duration})},getViewport:function(){var t=y(n.getState().transform,3);return{x:t[0],y:t[1],zoom:t[2]}},fitView:function(t){var e=n.getState(),r=e.nodeLookup,o=e.width,i=e.height,u=e.nodeOrigin,a=e.minZoom,c=e.maxZoom,l=e.panZoom;return!!l&&b_({nodeLookup:r,width:o,height:i,nodeOrigin:u,minZoom:a,maxZoom:c,panZoom:l},t)},setCenter:function(t,e,r){var o=n.getState(),i=o.width,u=o.height,a=o.panZoom,c=o.transform,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:c[2],s=i/2-t*l,f=u/2-e*l;null==a||a.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})},fitBounds:function(t,e){var r,o=n.getState(),i=o.width,u=o.height,a=o.minZoom,c=o.maxZoom,l=o.panZoom,s=Ub(t,i,u,a,c,null!==(r=null==e?void 0:e.padding)&&void 0!==r?r:.1);null==l||l.setViewport(s,{duration:null==e?void 0:e.duration})},screenToFlowPosition:function(t,e){void 0===e&&(e={snapToGrid:!0});var r=n.getState(),o=r.transform,i=r.snapGrid,u=r.domNode;if(!u)return t;var a=u.getBoundingClientRect(),c=a.x,l=a.y,s={x:t.x-c,y:t.y-l};return Bb(s,o,e.snapToGrid,i)},flowToScreenPosition:function(t){var e=n.getState(),r=e.transform,o=e.domNode;if(!o)return t;var i=o.getBoundingClientRect(),u=i.x,a=i.y,c=function(n,t){var e=n.x,r=n.y,o=y(t,3),i=o[0],u=o[1],a=o[2];return{x:e*a+i,y:r*a+u}}(t,r);return{x:c.x+u,y:c.y+a}}}}),[])},D_=function(n){return!!n.panZoom};function R_(){var n=this,t=B_(),o=kb(),i=function(){var n=e(L_);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),u=Sb(D_);a((function(){window.inkFlowStoreState=o.getState()}),[o]);var c=r((function(){var t=function(n){return o.getState().nodeLookup.get(n)},e=function(n){i.nodeQueue.push(n)},r=function(n){var t,e,r,i,u=o.getState(),a=u.nodeLookup,c=u.nodeOrigin,l=Wb(n)?n:a.get(n.id),s=l.parentId?function(n,t,e,r){var o,i;void 0===r&&(r=[0,0]);for(var u=t,a=d({},n);u;){var c=e.get(t);if(u=null==c?void 0:c.parentId,c){var l=c.origin||r,s=(null!==(o=c.measured.width)&&void 0!==o?o:0)*l[0],f=(null!==(i=c.measured.height)&&void 0!==i?i:0)*l[1];a.x+=c.position.x-s,a.y+=c.position.y-f}}return a}(l.position,l.parentId,a,c):l.position,f={id:l.id,position:s,width:null!==(e=null===(t=l.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:l.width,height:null!==(i=null===(r=l.measured)||void 0===r?void 0:r.height)&&void 0!==i?i:l.height,data:l.data};return Db(f)},u=function(n,t,r){void 0===r&&(r={replace:!1}),e((function(e){return e.map((function(e){if(e.id===n){var o="function"==typeof t?t(e):t;return r.replace&&Wb(o)?o:d(d({},e),o)}return e}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var e;return null===(e=t(n))||void 0===e?void 0:e.internals.userNode},getInternalNode:t,getEdges:function(){var n=o.getState().edges;return(void 0===n?[]:n).map((function(n){return d({},n)}))},getEdge:function(n){return o.getState().edgeLookup.get(n)},setNodes:e,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var t=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return m(m([],y(n),!1),y(t),!1)}))},addEdges:function(n){var t=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return m(m([],y(n),!1),y(t),!1)}))},toObject:function(){var n=o.getState(),t=n.nodes,e=void 0===t?[]:t,r=n.edges,i=void 0===r?[]:r,u=y(n.transform,3),a=u[0],c=u[1],l=u[2];return{nodes:e.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:a,y:c,zoom:l}}},deleteElements:function(t){return v(n,[t],void 0,(function(n){var t,e,r,i,u,a,c,l,s,f,d,h,v,g,y,m,w=n.nodes,b=void 0===w?[]:w,_=n.edges,x=void 0===_?[]:_;return p(this,(function(n){switch(n.label){case 0:return t=o.getState(),e=t.nodes,r=t.edges,i=t.onNodesDelete,u=t.onEdgesDelete,a=t.triggerNodeChanges,c=t.triggerEdgeChanges,l=t.onDelete,s=t.onBeforeDelete,[4,x_({nodesToRemove:b,edgesToRemove:x,nodes:e,edges:r,onBeforeDelete:s})];case 1:return f=n.sent(),d=f.nodes,h=f.edges,v=h.length>0,g=d.length>0,v&&(y=h.map(g_),null==u||u(h),c(y)),g&&(m=d.map(g_),null==i||i(d),a(m)),(g||v)&&(null==l||l({nodes:d,edges:h})),[2,{deletedNodes:d,deletedEdges:h}]}}))}))},getIntersectingNodes:function(n,t,e){void 0===t&&(t=!0);var i=Gb(n),u=i?n:r(n),a=void 0!==e;return u?(e||o.getState().nodes).filter((function(e){var r=o.getState().nodeLookup.get(e.id);if(r&&!i&&(e.id===n.id||!r.internals.positionAbsolute))return!1;var c=Db(a?e:r),l=Xb(c,u);return t&&l>0||l>=u.width*u.height})):[]},isNodeIntersecting:function(n,t,e){void 0===e&&(e=!0);var o=Gb(n)?n:r(n);if(!o)return!1;var i=Xb(o,t);return e&&i>0||i>=o.width*o.height},updateNode:u,updateNodeData:function(n,t,e){void 0===e&&(e={replace:!1}),u(n,(function(n){var r="function"==typeof t?t(n):t;return e.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),e)},setLayoutAnchorId:function(n){o.getState().setLayoutAnchorId(n)}}}),[]);return r((function(){return d(d(d({},c),t),{viewportInitialized:u})}),[u])}var V_=function(n){return n.updateNodeInternals};function H_(n){var t=Sb(s(function(n){return function(t){return n?w_(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map((function(n){return n.id})):Array.from(t.nodeLookup.keys())}}(n),[n]),u_);return t}var Y_=t(null),Z_=Y_.Provider;Y_.Consumer;function X_(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*t+.375*i+.375*n.targetControlX+.125*r,c=.125*e+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-t),Math.abs(c-e)]}function U_(n,t){return n>=0?.5*n:25*t*Math.sqrt(-n)}function F_(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(t){case ip.Left:return[e-U_(e-o,u),r];case ip.Right:return[e+U_(o-e,u),r];case ip.Top:return[e,r-U_(r-i,u)];case ip.Bottom:return[e,r+U_(i-r,u)]}}function W_(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-t)/2,u=r<t?r+i:r-i,a=Math.abs(o-e)/2;return[u,o<e?o+a:o-a,i,a]}var $_,G_=function(n){var t=n.source,e=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(t).concat(e||"","-").concat(r).concat(o||"")};var q_=(($_={})[ip.Left]={x:-1,y:0},$_[ip.Right]={x:1,y:0},$_[ip.Top]={x:0,y:-1},$_[ip.Bottom]={x:0,y:1},$_),K_=function(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))};function Q_(n){var t,e,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?ip.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?ip.Top:l,f=n.center,d=n.offset,h=q_[a],v=q_[s],p={x:i.x+h.x*d,y:i.y+h.y*d},g={x:c.x+v.x*d,y:c.y+v.y*d},w=function(n){var t=n.source,e=n.sourcePosition,r=void 0===e?ip.Bottom:e,o=n.target;return r===ip.Left||r===ip.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),b=0!==w.x?"x":"y",_=w[b],x=[],E={x:0,y:0},S={x:0,y:0},k=y(W_({sourceX:i.x,sourceY:i.y,targetX:c.x,targetY:c.y}),4),C=k[0],N=k[1],M=k[2],O=k[3];if(h[b]*v[b]==-1){r=null!==(t=f.x)&&void 0!==t?t:C,o=null!==(e=f.y)&&void 0!==e?e:N;var j=[{x:r,y:p.y},{x:r,y:g.y}],I=[{x:p.x,y:o},{x:g.x,y:o}];x=h[b]===_?"x"===b?j:I:"x"===b?I:j}else{var P=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(x="x"===b?h.x===_?A:P:h.y===_?P:A,a===s){var z=Math.abs(i[b]-c[b]);if(z<=d){var L=Math.min(d-1,d-z);h[b]===_?E[b]=(p[b]>i[b]?-1:1)*L:S[b]=(g[b]>c[b]?-1:1)*L}}if(a!==s){var T="x"===b?"y":"x",B=h[b]===v[T],D=p[T]>g[T],R=p[T]<g[T];(1===h[b]&&(!B&&D||B&&R)||1!==h[b]&&(!B&&R||B&&D))&&(x="x"===b?P:A)}var V={x:p.x+E.x,y:p.y+E.y},H={x:g.x+S.x,y:g.y+S.y};Math.max(Math.abs(V.x-x[0].x),Math.abs(H.x-x[0].x))>=Math.max(Math.abs(V.y-x[0].y),Math.abs(H.y-x[0].y))?(r=(V.x+H.x)/2,o=x[0].y):(r=x[0].x,o=(V.y+H.y)/2)}return[m(m([i,{x:p.x+E.x,y:p.y+E.y}],y(x),!1),[{x:g.x+S.x,y:g.y+S.y},c],!1),r,o,M,O]}function J_(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=y(Q_({source:{x:t,y:e},sourcePosition:o,target:{x:i,y:u},targetPosition:c,center:{x:f,y:d},offset:void 0===h?20:h}),5),p=v[0],g=v[1],m=v[2],w=v[3],b=v[4],_=p.reduce((function(n,t,e){var r="";return r=e>0&&e<p.length-1?function(n,t,e,r){var o=Math.min(K_(n,t)/2,K_(t,e)/2,r),i=t.x,u=t.y;if(n.x===i&&i===e.x||n.y===u&&u===e.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<e.x?-1:1,c=n.y<e.y?1:-1;return"L ".concat(i+o*a,",").concat(u,"Q ").concat(i,",").concat(u," ").concat(i,",").concat(u+o*c)}var l=n.x<e.x?1:-1,s=n.y<e.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[e-1],t,p[e+1],s):"".concat(0===e?"M":"L").concat(t.x," ").concat(t.y),n+=r}),"");return[_,g,m,w,b]}var nx=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var tx=c(Zb((function(n,t){var r,o,i=n.type,u=void 0===i?"source":i,a=n.position,c=void 0===a?ip.Top:a,l=n.isValidConnection,s=n.isConnectable,f=void 0===s||s,v=n.isConnectableStart,p=void 0===v||v,g=n.isConnectableEnd,y=void 0===g||g,m=n.id,w=n.onConnect,b=n.children,_=n.className,x=n.onMouseDown,E=n.onTouchStart,S=h(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),C=m||null,N="target"===u,M=kb(),O=e(Y_),I=Sb(nx,u_),P=I.connectOnClick,A=I.noPanClassName,z=I.rfId,L=Sb(function(n,t,e){return function(r){var o=r.connectionStartHandle,i=r.connectionEndHandle,u=r.connectionClickStartHandle,a=r.connectionMode,c=r.connectionStatus,l=(null==i?void 0:i.nodeId)===n&&(null==i?void 0:i.handleId)===t&&(null==i?void 0:i.type)===e;return{connectingFrom:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.handleId)===t&&(null==o?void 0:o.type)===e,connectingTo:l,clickConnecting:(null==u?void 0:u.nodeId)===n&&(null==u?void 0:u.handleId)===t&&(null==u?void 0:u.type)===e,isPossibleEndHandle:a===np.Strict?(null==o?void 0:o.type)!==e:n!==(null==o?void 0:o.nodeId)||t!==(null==o?void 0:o.handleId),connectionInProcess:!!o,valid:l&&"valid"===c}}}(O,C,u),u_),T=L.connectingFrom,B=L.connectingTo,D=L.clickConnecting,R=L.isPossibleEndHandle,V=L.connectionInProcess,H=L.valid;O||null===(o=(r=M.getState()).onError)||void 0===o||o.call(r,"010",Sv());var Y=function(n){var t=M.getState(),e=t.defaultEdgeOptions,r=t.onConnect,o=t.hasDefaultEdges,i=d(d({},e),n);if(o){var u=M.getState(),a=u.edges;(0,u.setEdges)(function(n,t){return n.source&&n.target?function(n,t){return t.some((function(t){return!(t.source!==n.source||t.target!==n.target||t.sourceHandle!==n.sourceHandle&&(t.sourceHandle||n.sourceHandle)||t.targetHandle!==n.targetHandle&&(t.targetHandle||n.targetHandle))}))}(e="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:G_(n)}),t)?t:(null===e.sourceHandle&&delete e.sourceHandle,null===e.targetHandle&&delete e.targetHandle,t.concat(e)):t;var e,r}(i,a))}null==r||r(i),null==w||w(i)},Z=function(n){if(O){var t=Jb(n.nativeEvent);if(p&&(t&&0===n.button||!t)){var e=M.getState();sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:e.autoPanOnConnect,connectionMode:e.connectionMode,connectionRadius:e.connectionRadius,domNode:e.domNode,nodeLookup:e.nodeLookup,lib:e.lib,isTarget:N,handleId:C,nodeId:O,flowId:e.rfId,panBy:e.panBy,cancelConnection:e.cancelConnection,onConnectStart:e.onConnectStart,onConnectEnd:e.onConnectEnd,updateConnection:e.updateConnection,onConnect:Y,isValidConnection:l||e.isValidConnection,getTransform:function(){return M.getState().transform},getConnectionStartHandle:function(){return M.getState().connectionStartHandle}})}t?null==x||x(n):null==E||E(n)}};return k.jsx("div",d({"data-handleid":C,"data-nodeid":O,"data-handlepos":c,"data-id":"".concat(z,"-").concat(O,"-").concat(C,"-").concat(u),className:j(["ink-flow__handle","ink-flow__handle-".concat(c),"nodrag",A,_,{source:!N,target:N,connectable:f,connectablestart:p,connectableend:y,clickconnecting:D,connectingfrom:T,connectingto:B,valid:H,connectionindicator:f&&(!V||R)&&(V?y:p)}]),onMouseDown:Z,onTouchStart:Z,onClick:P?function(n){var t=M.getState(),e=t.onClickConnectStart,r=t.onClickConnectEnd,o=t.connectionClickStartHandle,i=t.connectionMode,a=t.isValidConnection,c=t.lib,s=t.rfId;if(O&&(o||p)){if(!o)return null==e||e(n.nativeEvent,{nodeId:O,handleId:C,handleType:u}),void M.setState({connectionClickStartHandle:{nodeId:O,type:u,handleId:C}});var f=function(n){var t;return(null===(t=n.getRootNode)||void 0===t?void 0:t.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),d=l||a,h=sm.isValid(n.nativeEvent,{handle:{nodeId:O,id:C,type:u},connectionMode:i,fromNodeId:o.nodeId,fromHandleId:o.handleId||null,fromType:o.type,isValidConnection:d,flowId:s,doc:f,lib:c}),v=h.connection;h.isValid&&v&&Y(v),null==r||r(n),M.setState({connectionClickStartHandle:null})}}:void 0,ref:t},S,{children:b}))})));var ex={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},rx={input:function(n){var t=n.data,e=n.isConnectable,r=n.sourcePosition,o=void 0===r?ip.Bottom:r;return k.jsxs(k.Fragment,{children:[null==t?void 0:t.label,k.jsx(tx,{type:"source",position:o,isConnectable:e})]})},default:function(n){var t=n.data,e=n.isConnectable,r=n.targetPosition,o=void 0===r?ip.Top:r,i=n.sourcePosition,u=void 0===i?ip.Bottom:i;return k.jsxs(k.Fragment,{children:[k.jsx(tx,{type:"target",position:o,isConnectable:e}),null==t?void 0:t.label,k.jsx(tx,{type:"source",position:u,isConnectable:e})]})},output:function(n){var t=n.data,e=n.isConnectable,r=n.targetPosition,o=void 0===r?ip.Top:r;return k.jsxs(k.Fragment,{children:[k.jsx(tx,{type:"target",position:o,isConnectable:e}),null==t?void 0:t.label]})},group:function(){return null}};function ox(n){var t=n.id,e=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,u=e.getState(),a=u.addSelectedNodes,c=u.unselectNodesAndEdges,l=u.multiSelectionActive,s=u.nodeLookup,f=u.onError,d=s.get(t);d?(e.setState({nodesSelectionActive:!1}),d.selected?(o||d.selected&&l)&&(c({nodes:[d],edges:[]}),requestAnimationFrame((function(){var n;return null===(n=null==i?void 0:i.current)||void 0===n?void 0:n.blur()}))):a([t])):null==f||f("012",Cv(t))}function ix(n){var t,e=n.id,r=n.onClick,o=n.onMouseEnter,c=n.onMouseMove,l=n.onMouseLeave,f=n.onContextMenu,h=n.onDoubleClick,v=n.nodesDraggable,p=n.elementsSelectable,m=n.nodesConnectable,w=n.nodesFocusable,b=n.resizeObserver,_=n.noDragClassName,x=n.noPanClassName,E=n.disableKeyboardA11y,S=n.rfId,C=n.nodeTypes,N=n.nodeExtent,M=n.nodeOrigin,O=n.onError,I=Sb((function(n){var t=n.nodeLookup.get(e),r=n.parentLookup.has(e);return{node:t,internals:t.internals,isParent:r}}),u_),P=I.node,A=I.internals,z=I.isParent,L=P.type||"default",T=(null==C?void 0:C[L])||rx[L];void 0===T&&(null==O||O("003",wv(L)),L="default",T=rx.default);var B=!!(P.draggable||v&&void 0===P.draggable),D=!!(P.selectable||p&&void 0===P.selectable),R=!!(P.connectable||m&&void 0===P.connectable),V=!!(P.focusable||w&&void 0===P.focusable),H=kb(),Y=function(n){var t,e,r,o,i,u;return void 0!==(null!==(r=null!==(e=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==e?e:n.width)&&void 0!==r?r:n.initialWidth)&&void 0!==(null!==(u=null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:n.height)&&void 0!==u?u:n.initialHeight)}(P),Z=function(n){var t=n.node,e=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=kb(),c=u(null),l=u(null),s=u(t.sourcePosition),f=u(t.targetPosition),d=u(e),h=r&&!!t.internals.handleBounds&&!t.hidden;return a((function(){!c.current||h&&l.current===c.current||(l.current&&(null==o||o.unobserve(l.current)),null==o||o.observe(c.current),l.current=c.current)}),[h]),a((function(){return function(){l.current&&(null==o||o.unobserve(l.current),l.current=null)}}),[]),a((function(){if(c.current){var n=d.current!==e,r=s.current!==t.sourcePosition,o=f.current!==t.targetPosition;(n||r||o)&&(d.current=e,s.current=t.sourcePosition,f.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}}),[t.id,e,t.sourcePosition,t.targetPosition]),c}({node:P,nodeType:L,hasDimensions:Y,resizeObserver:b}),X=function(n){var t=n.nodeRef,e=n.disabled,r=void 0!==e&&e,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,f=kb(),d=y(i(!1),2),h=d[0],v=d[1],p=u();return a((function(){p.current=om({getStoreItems:function(){return f.getState()},onNodeMouseDown:function(n){ox({id:n,store:f,nodeRef:t})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),a((function(){var n,e;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(t.current)return null===(e=p.current)||void 0===e||e.update({noDragClassName:o,handleSelector:c,domNode:t.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,t,l]),h}({nodeRef:Z,disabled:P.hidden||!B,noDragClassName:_,handleSelector:P.dragHandle,nodeId:e,isSelectable:D}),U=function(){var n=kb(),t=s((function(t){var e,r,o=n.getState(),i=o.nodeExtent,u=o.snapToGrid,a=o.snapGrid,c=o.nodesDraggable,l=o.onError,s=o.updateNodePositions,f=o.nodeLookup,d=o.nodeOrigin,h=new Map,v=function(n){return function(t){return t.selected&&(t.draggable||n&&void 0===t.draggable)}}(c),p=u?a[0]:5,m=u?a[1]:5,w=t.direction.x*p*t.factor,b=t.direction.y*m*t.factor;try{for(var _=g(f),x=_.next();!x.done;x=_.next()){var E=y(x.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+b};u&&(S=Tb(S,a));var k=__({nodeId:E.id,nextPosition:S,nodeLookup:f,nodeExtent:i,nodeOrigin:d,onError:l}),C=k.position,N=k.positionAbsolute;E.position=C,E.internals.positionAbsolute=N,h.set(E.id,E)}}}catch(n){e={error:n}}finally{try{x&&!x.done&&(r=_.return)&&r.call(_)}finally{if(e)throw e.error}}s(h)}),[]);return t}();if(P.hidden)return null;var F=zb(P),W=function(n){var t,e,r,o,i,u,a,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(e=null!==(t=n.width)&&void 0!==t?t:n.initialWidth)&&void 0!==e?e:null===(r=n.style)||void 0===r?void 0:r.width,height:null!==(i=null!==(o=n.height)&&void 0!==o?o:n.initialHeight)&&void 0!==i?i:null===(u=n.style)||void 0===u?void 0:u.height}:{width:null!==(a=n.width)&&void 0!==a?a:null===(c=n.style)||void 0===c?void 0:c.width,height:null!==(l=n.height)&&void 0!==l?l:null===(s=n.style)||void 0===s?void 0:s.height}}(P),$=(N?Ab(A.positionAbsolute,N):A.positionAbsolute)||{x:0,y:0},G=function(n){var t=n.x,e=n.y,r=n.width,o=n.height,i=n.origin,u=void 0===i?[0,0]:i;return!r||!o||u[0]<0||u[1]<0||u[0]>1||u[1]>1?{x:t,y:e}:{x:t-r*u[0],y:e-o*u[1]}}(d(d(d({},$),F),{origin:P.origin||M})),q=D||B||r||o||c||l,K=o?function(n){return o(n,d({},A.userNode))}:void 0,Q=c?function(n){return c(n,d({},A.userNode))}:void 0,J=l?function(n){return l(n,d({},A.userNode))}:void 0,nn=f?function(n){return f(n,d({},A.userNode))}:void 0,tn=h?function(n){return h(n,d({},A.userNode))}:void 0;return k.jsx("div",{className:j(["ink-flow__node","ink-flow__node-".concat(L),(t={},t[x]=B,t),P.className,{selected:P.selected,selectable:D,parent:z,draggable:B,dragging:X}]),ref:Z,style:d(d({zIndex:A.z,transform:"translate(".concat(G.x,"px,").concat(G.y,"px)"),pointerEvents:q?"all":"none",visibility:Y?"visible":"hidden"},P.style),W),"data-id":e,"data-testid":"rf__node-".concat(e),onMouseEnter:K,onMouseMove:Q,onMouseLeave:J,onContextMenu:nn,onClick:function(n){var t=H.getState(),o=t.selectNodesOnDrag,i=t.nodeDragThreshold;D&&(!o||!B||i>0)&&ox({id:e,store:H,nodeRef:Z}),r&&r(n,d({},A.userNode))},onDoubleClick:tn,onKeyDown:V?function(n){if(!Qb(n.nativeEvent)&&!E)if(Mv.includes(n.key)&&D){var t="Escape"===n.key;ox({id:e,store:H,unselect:t,nodeRef:Z})}else B&&P.selected&&Object.prototype.hasOwnProperty.call(ex,n.key)&&(H.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~$.x,", y: ").concat(~~$.y)}),U({direction:ex[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:V?0:void 0,role:V?"button":void 0,"aria-describedby":E?void 0:"".concat("ink-flow__node-desc","-").concat(S),"aria-label":P.ariaLabel,children:k.jsx(Z_,{value:e,children:k.jsx(T,d({id:e,data:P.data,type:L,positionAbsoluteX:$.x,positionAbsoluteY:$.y,selected:P.selected,isConnectable:R,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:X,dragHandle:P.dragHandle,zIndex:A.z},F))})})}var ux=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function ax(n){var t=Sb(ux,u_),e=t.nodesDraggable,r=t.nodesConnectable,o=t.nodesFocusable,u=t.elementsSelectable,c=t.onError,l=H_(!1),s=function(){var n=Sb(V_),t=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(t){var e=new Map;t.forEach((function(n){var t=n.target.getAttribute("data-id");e.set(t,{id:t,nodeElement:n.target})})),n(e)}))})),1),e=t[0];return a((function(){return function(){null==e||e.disconnect()}}),[e]),e}();return k.jsx("div",{className:"ink-flow__nodes",style:a_,children:l.map((function(t){return k.jsx(ix,{id:t,nodeTypes:n.nodeTypes,nodeOrigin:n.nodeOrigin,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e,nodesConnectable:r,nodesFocusable:o,elementsSelectable:u,onError:c},t)}))})}ax.displayName="NodeRenderer";var cx,lx=c(ax),sx=((cx={})[op.Arrow]=function(n){var t=n.color,e=void 0===t?"none":t,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},cx[op.ArrowClosed]=function(n){var t=n.color,e=void 0===t?"none":t,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cx);function fx(n,t){if(!n)return"";if("string"==typeof n)return n;var e=t?"".concat(t,"__"):"";return"".concat(e).concat(Object.keys(n).sort().map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"))}var dx=function(n){var t=n.id,e=n.type,o=n.color,i=n.width,u=void 0===i?12.5:i,a=n.height,c=void 0===a?12.5:a,l=n.markerUnits,s=void 0===l?"strokeWidth":l,f=n.strokeWidth,d=n.orient,h=void 0===d?"auto-start-reverse":d,v=function(n){var t=kb(),e=r((function(){var e,r;return Object.prototype.hasOwnProperty.call(sx,n)?sx[n]:(null===(r=(e=t.getState()).onError)||void 0===r||r.call(e,"009",xv(n)),null)}),[n]);return e}(e);return v?k.jsx("marker",{className:"ink-flow__arrowhead",id:t,markerWidth:"".concat(u),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:s,orient:h,refX:"0",refY:"0",children:k.jsx(v,{color:o,strokeWidth:f})}):null},hx=function(n){var t=n.defaultColor,e=n.rfId,o=Sb((function(n){return n.edges})),i=Sb((function(n){return n.defaultEdgeOptions})),u=r((function(){var n=function(n,t){var e=t.id,r=t.defaultColor,o=t.defaultMarkerStart,i=t.defaultMarkerEnd,u=new Set;return n.reduce((function(n,t){return[t.markerStart||o,t.markerEnd||i].forEach((function(t){if(t&&"object"==typeof t){var o=fx(t,e);u.has(o)||(n.push(d({id:o,color:t.color||r},t)),u.add(o))}})),n}),[]).sort((function(n,t){return n.id.localeCompare(t.id)}))}(o,{id:e,defaultColor:t,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,e,t]);return u.length?k.jsx("svg",{className:"ink-flow__marker",children:k.jsx("defs",{children:u.map((function(n){return k.jsx(dx,{id:n.id,type:n.type,color:n.color,width:n.width,height:n.height,markerUnits:n.markerUnits,strokeWidth:n.strokeWidth,orient:n.orient},n.id)}))})}):null};hx.displayName="MarkerDefinitions";var vx=c(hx);function px(n){var t=n.x,e=n.y,r=n.label,o=n.labelStyle,u=void 0===o?{}:o,a=n.labelShowBg,c=void 0===a||a,l=n.labelBgStyle,f=void 0===l?{}:l,v=n.labelBgPadding,p=void 0===v?[2,4]:v,g=n.labelBgBorderRadius,m=void 0===g?2:g,w=n.children,b=n.className,_=h(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),x=y(i({x:1,y:0,width:0,height:0}),2),E=x[0],S=x[1],C=j(["ink-flow__edge-textwrapper",b]),N=s((function(n){if(null!==n){var t=n.getBBox();S({x:t.x,y:t.y,width:t.width,height:t.height})}}),[]);return void 0!==r&&r?k.jsxs("g",d({transform:"translate(".concat(t-E.width/2," ").concat(e-E.height/2,")"),className:C,visibility:E.width?"visible":"hidden"},_,{children:[c&&k.jsx("rect",{width:E.width+2*p[0],x:-p[0],y:-p[1],height:E.height+2*p[1],className:"ink-flow__edge-textbg",style:f,rx:m,ry:m}),k.jsx("text",{className:"ink-flow__edge-text",y:E.height/2,dy:"0.3em",ref:N,style:u,children:r}),w]})):null}px.displayName="EdgeText";var gx=c(px);function yx(n){var t=n.id,e=n.path,r=n.labelX,o=n.labelY,i=n.label,u=n.labelStyle,a=n.labelShowBg,c=n.labelBgStyle,l=n.labelBgPadding,s=n.labelBgBorderRadius,f=n.style,d=n.markerEnd,h=n.markerStart,v=n.className,p=n.interactionWidth,g=void 0===p?20:p;return k.jsxs(k.Fragment,{children:[k.jsx("path",{id:t,style:f,d:e,fill:"none",className:j(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),g&&k.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&Lb(r)&&Lb(o)?k.jsx(gx,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function mx(n){var t=n.pos,e=n.x1,r=n.y1,o=n.x2,i=n.y2;return t===ip.Left||t===ip.Right?[.5*(e+o),r]:[e,.5*(r+i)]}function wx(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=y(mx({pos:o,x1:t,y1:e,x2:i,y2:u}),2),s=l[0],f=l[1],d=y(mx({pos:c,x1:i,y1:u,x2:t,y2:e}),2),h=d[0],v=d[1],p=y(X_({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:s,sourceControlY:f,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],b=p[3];return["M".concat(t,",").concat(e," C").concat(s,",").concat(f," ").concat(h,",").concat(v," ").concat(i,",").concat(u),g,m,w,b]}function bx(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.sourcePosition,c=void 0===a?ip.Bottom:a,l=t.targetPosition,s=void 0===l?ip.Top:l,f=t.label,d=t.labelStyle,h=t.labelShowBg,v=t.labelBgStyle,p=t.labelBgPadding,g=t.labelBgBorderRadius,m=t.style,w=t.markerEnd,b=t.markerStart,_=t.interactionWidth,x=y(wx({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s}),3),E=x[0],S=x[1],C=x[2],N=n.isInternal?void 0:e;return k.jsx(yx,{id:N,path:E,labelX:S,labelY:C,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:b,interactionWidth:_})}))}var _x=bx({isInternal:!1}),xx=bx({isInternal:!0});function Ex(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.label,c=t.labelStyle,l=t.labelShowBg,s=t.labelBgStyle,f=t.labelBgPadding,d=t.labelBgBorderRadius,h=t.style,v=t.sourcePosition,p=void 0===v?ip.Bottom:v,g=t.targetPosition,m=void 0===g?ip.Top:g,w=t.markerEnd,b=t.markerStart,_=t.pathOptions,x=t.interactionWidth,E=y(J_({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:u,targetPosition:m,borderRadius:null==_?void 0:_.borderRadius,offset:null==_?void 0:_.offset}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:e;return k.jsx(yx,{id:M,path:S,labelX:C,labelY:N,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:w,markerStart:b,interactionWidth:x})}))}_x.displayName="SimpleBezierEdge",xx.displayName="SimpleBezierEdgeInternal";var Sx=Ex({isInternal:!1}),kx=Ex({isInternal:!0});function Cx(n){return c((function(t){var e,o=t.id,i=h(t,["id"]),u=n.isInternal?void 0:o;return k.jsx(Sx,d({},i,{id:u,pathOptions:r((function(){var n;return{borderRadius:0,offset:null===(n=i.pathOptions)||void 0===n?void 0:n.offset}}),[null===(e=i.pathOptions)||void 0===e?void 0:e.offset])}))}))}Sx.displayName="SmoothStepEdge",kx.displayName="SmoothStepEdgeInternal";var Nx=Cx({isInternal:!1}),Mx=Cx({isInternal:!0});function Ox(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.label,c=t.labelStyle,l=t.labelShowBg,s=t.labelBgStyle,f=t.labelBgPadding,d=t.labelBgBorderRadius,h=t.style,v=t.markerEnd,p=t.markerStart,g=t.interactionWidth,m=y(function(n){var t=n.sourceX,e=n.sourceY,r=n.targetX,o=n.targetY,i=y(W_({sourceX:t,sourceY:e,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(t,",").concat(e,"L ").concat(r,",").concat(o),u,a,c,l]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=m[0],b=m[1],_=m[2],x=n.isInternal?void 0:e;return k.jsx(yx,{id:x,path:w,labelX:b,labelY:_,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}Nx.displayName="StepEdge",Mx.displayName="StepEdgeInternal";var jx=Ox({isInternal:!1}),Ix=Ox({isInternal:!0});function Px(n){return c((function(t){var e=t.id,r=t.sourceX,o=t.sourceY,i=t.targetX,u=t.targetY,a=t.sourcePosition,c=void 0===a?ip.Bottom:a,l=t.targetPosition,s=void 0===l?ip.Top:l,f=t.label,d=t.labelStyle,h=t.labelShowBg,v=t.labelBgStyle,p=t.labelBgPadding,g=t.labelBgBorderRadius,m=t.style,w=t.markerEnd,b=t.markerStart,_=t.pathOptions,x=t.interactionWidth,E=y(function(n){var t=n.sourceX,e=n.sourceY,r=n.sourcePosition,o=void 0===r?ip.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?ip.Top:a,l=n.curvature,s=void 0===l?.25:l,f=y(F_({pos:o,x1:t,y1:e,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=y(F_({pos:c,x1:i,y1:u,x2:t,y2:e,c:s}),2),p=v[0],g=v[1],m=y(X_({sourceX:t,sourceY:e,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],b=m[1],_=m[2],x=m[3];return["M".concat(t,",").concat(e," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),w,b,_,x]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s,curvature:null==_?void 0:_.curvature}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:e;return k.jsx(yx,{id:M,path:S,labelX:C,labelY:N,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:g,style:m,markerEnd:w,markerStart:b,interactionWidth:x})}))}jx.displayName="StraightEdge",Ix.displayName="StraightEdgeInternal";var Ax=Px({isInternal:!1}),zx=Px({isInternal:!0});Ax.displayName="BezierEdge",zx.displayName="BezierEdgeInternal";var Lx={default:zx,straight:Ix,step:Mx,smoothstep:kx,simplebezier:xx},Tx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Bx=function(n,t,e){return e===ip.Left?n-t:e===ip.Right?n+t:n},Dx=function(n,t,e){return e===ip.Top?n-t:e===ip.Bottom?n+t:n},Rx="ink-flow__edgeupdater";function Vx(n){var t=n.position,e=n.centerX,r=n.centerY,o=n.radius,i=void 0===o?10:o,u=n.onMouseDown,a=n.onMouseEnter,c=n.onMouseOut,l=n.type;return k.jsx("circle",{onMouseDown:u,onMouseEnter:a,onMouseOut:c,className:j([Rx,"".concat(Rx,"-").concat(l)]),cx:Bx(e,i,t),cy:Dx(r,i,t),r:i,stroke:"transparent",fill:"transparent"})}function Hx(n){var t=n.isUpdatable,e=n.edgeUpdaterRadius,r=n.edge,o=n.targetHandleId,i=n.sourceHandleId,u=n.sourceX,a=n.sourceY,c=n.targetX,l=n.targetY,s=n.sourcePosition,f=n.targetPosition,d=n.onEdgeUpdate,h=n.onEdgeUpdateStart,v=n.onEdgeUpdateEnd,p=n.setUpdating,g=n.setUpdateHover,y=kb(),m=function(n,t){if(0===n.button){var e=y.getState(),u=e.autoPanOnConnect,a=e.domNode,c=e.isValidConnection,l=e.connectionMode,s=e.connectionRadius,f=e.lib,g=e.onConnectStart,m=e.onConnectEnd,w=e.cancelConnection,b=e.nodeLookup,_=e.rfId,x=e.panBy,E=e.updateConnection,S=t?r.target:r.source,k=(t?o:i)||null,C=t?"target":"source",N=t;p(!0),null==h||h(n,r,C);sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:u,connectionMode:l,connectionRadius:s,domNode:a,handleId:k,nodeId:S,nodeLookup:b,isTarget:N,edgeUpdaterType:C,lib:f,flowId:_,cancelConnection:w,panBy:x,isValidConnection:c,onConnect:function(n){return null==d?void 0:d(r,n)},onConnectStart:g,onConnectEnd:m,onEdgeUpdateEnd:function(n){p(!1),null==v||v(n,r,C)},updateConnection:E,getTransform:function(){return y.getState().transform},getConnectionStartHandle:function(){return y.getState().connectionStartHandle}})}},w=function(){return g(!0)},b=function(){return g(!1)};return k.jsxs(k.Fragment,{children:[("source"===t||!0===t)&&k.jsx(Vx,{position:s,centerX:u,centerY:a,radius:e,onMouseDown:function(n){return m(n,!0)},onMouseEnter:w,onMouseOut:b,type:"source"}),("target"===t||!0===t)&&k.jsx(Vx,{position:f,centerX:c,centerY:l,radius:e,onMouseDown:function(n){return m(n,!1)},onMouseEnter:w,onMouseOut:b,type:"target"})]})}function Yx(n){var t;return n&&!(!n.internals.handleBounds&&!(null===(t=n.handles)||void 0===t?void 0:t.length))&&!!(n.measured.width||n.width||n.initialWidth)}function Zx(n){var t,e,r,o;if(!n)return null;var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.width=null!==(r=l.width)&&void 0!==r?r:1,l.height=null!==(o=l.height)&&void 0!==o?o:1,"source"===l.type?i.push(l):"target"===l.type&&u.push(l)}}catch(n){t={error:n}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return{source:i,target:u}}function Xx(n,t,e){var r,o;void 0===e&&(e=null);var i=(null!==(r=null==e?void 0:e.x)&&void 0!==r?r:0)+t.internals.positionAbsolute.x,u=(null!==(o=null==e?void 0:e.y)&&void 0!==o?o:0)+t.internals.positionAbsolute.y,a=null!=e?e:zb(t),c=a.width,l=a.height;switch(n){case ip.Top:return[i+c/2,u];case ip.Right:return[i+c,u+l/2];case ip.Bottom:return[i+c/2,u+l];case ip.Left:return[i,u+l/2]}}function Ux(n,t){return n&&(t?n.find((function(n){return n.id===t})):n[0])||null}function Fx(n){var t=n.id,e=n.edgesFocusable,o=n.edgesUpdatable,a=n.elementsSelectable,c=n.onClick,l=n.onDoubleClick,f=n.onContextMenu,h=n.onMouseEnter,v=n.onMouseMove,p=n.onMouseLeave,g=n.edgeUpdaterRadius,m=n.onEdgeUpdate,w=n.onEdgeUpdateStart,b=n.onEdgeUpdateEnd,_=n.rfId,x=n.edgeTypes,E=n.noPanClassName,S=n.onError,C=n.disableKeyboardA11y,N=Sb((function(n){return n.edgeLookup.get(t)})),M=Sb((function(n){return n.defaultEdgeOptions})),O=(N=M?d(d({},M),N):N).type||"default",I=(null==x?void 0:x[O])||Lx[O];void 0===I&&(null==S||S("011",kv(O)),O="default",I=Lx.default);var P=!!(N.focusable||e&&void 0===N.focusable),A=void 0!==m&&(N.updatable||o&&void 0===N.updatable),z=!!(N.selectable||a&&void 0===N.selectable),L=u(null),T=y(i(!1),2),B=T[0],D=T[1],R=y(i(!1),2),V=R[0],H=R[1],Y=kb(),Z=Sb(s((function(n){var e=n.nodeLookup.get(N.source),r=n.nodeLookup.get(N.target);if(!e||!r)return d({zIndex:N.zIndex},Tx);var o=function(n){var t,e,r,o,i,u=n.sourceNode,a=n.targetNode;if(!Yx(u)||!Yx(a))return null;var c=u.internals.handleBounds||Zx(u.handles),l=a.internals.handleBounds||Zx(a.handles),s=Ux(null!==(t=null==c?void 0:c.source)&&void 0!==t?t:[],n.sourceHandle),f=Ux(n.connectionMode===np.Strict?null!==(e=null==l?void 0:l.target)&&void 0!==e?e:[]:(null!==(r=null==l?void 0:l.target)&&void 0!==r?r:[]).concat(null!==(o=null==l?void 0:l.source)&&void 0!==o?o:[]),n.targetHandle),d=(null==s?void 0:s.position)||ip.Bottom,h=(null==f?void 0:f.position)||ip.Top;if(!s||!f)return null===(i=n.onError)||void 0===i||i.call(n,"008",Ev(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=y(Xx(d,u,s),2),p=v[0],g=v[1],m=y(Xx(h,a,f),2);return{sourceX:p,sourceY:g,targetX:m[0],targetY:m[1],sourcePosition:d,targetPosition:h}}({id:t,sourceNode:e,targetNode:r,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:n.connectionMode,onError:S}),i=function(n){var t=n.sourceNode,e=n.targetNode,r=n.selected,o=void 0!==r&&r,i=n.zIndex,u=void 0===i?0:i,a=n.elevateOnSelect;if(void 0===a||!a)return u;var c=o||e.selected||t.selected,l=Math.max(t.internals.z||0,e.internals.z||0,1e3);return u+(c?l:0)}({selected:N.selected,zIndex:N.zIndex,sourceNode:e,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||Tx)}),[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),u_),X=Z.zIndex,U=Z.sourceX,F=Z.sourceY,W=Z.targetX,$=Z.targetY,G=Z.sourcePosition,q=Z.targetPosition,K=r((function(){return N.markerStart?"url('#".concat(fx(N.markerStart,_),"')"):void 0}),[N.markerStart,_]),Q=r((function(){return N.markerEnd?"url('#".concat(fx(N.markerEnd,_),"')"):void 0}),[N.markerEnd,_]);if(N.hidden||null===U||null===F||null===W||null===$)return null;var J=l?function(n){l(n,d({},N))}:void 0,nn=f?function(n){f(n,d({},N))}:void 0,tn=h?function(n){h(n,d({},N))}:void 0,en=v?function(n){v(n,d({},N))}:void 0,rn=p?function(n){p(n,d({},N))}:void 0;return k.jsx("svg",{style:{zIndex:X},children:k.jsxs("g",{className:j(["ink-flow__edge","ink-flow__edge-".concat(O),N.className,E,{selected:N.selected,animated:N.animated,inactive:!z&&!c,updating:B,selectable:z}]),onClick:function(n){var e,r=Y.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,u=r.multiSelectionActive;z&&(Y.setState({nodesSelectionActive:!1}),N.selected&&u?(i({nodes:[],edges:[N]}),null===(e=L.current)||void 0===e||e.blur()):o([t])),c&&c(n,N)},onDoubleClick:J,onContextMenu:nn,onMouseEnter:tn,onMouseMove:en,onMouseLeave:rn,onKeyDown:P?function(n){var e;if(!C&&Mv.includes(n.key)&&z){var r=Y.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(e=L.current)||void 0===e||e.blur(),o({edges:[N]})):i([t])}}:void 0,tabIndex:P?0:void 0,role:P?"button":"img","data-id":t,"data-testid":"rf__edge-".concat(t),"aria-label":null===N.ariaLabel?void 0:N.ariaLabel||"Edge from ".concat(N.source," to ").concat(N.target),"aria-describedby":P?"".concat("ink-flow__edge-desc","-").concat(_):void 0,ref:L,children:[!V&&k.jsx(I,{id:t,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:U,sourceY:F,targetX:W,targetY:$,sourcePosition:G,targetPosition:q,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:K,markerEnd:Q,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),A&&k.jsx(Hx,{edge:N,isUpdatable:A,edgeUpdaterRadius:g,onEdgeUpdate:m,onEdgeUpdateStart:w,onEdgeUpdateEnd:b,sourceX:U,sourceY:F,targetX:W,targetY:$,sourcePosition:G,targetPosition:q,setUpdateHover:D,setUpdating:H,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle})]})})}var Wx=function(n){return{width:n.width,height:n.height,edgesFocusable:n.edgesFocusable,edgesUpdatable:n.edgesUpdatable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function $x(n){var t=n.defaultMarkerColor,e=n.rfId,r=n.noPanClassName,o=n.onEdgeUpdate,i=n.onEdgeContextMenu,u=n.onEdgeMouseEnter,a=n.onEdgeMouseMove,c=n.onEdgeMouseLeave,l=n.onEdgeClick,f=n.edgeTypes,d=Sb(Wx,u_),h=d.edgesFocusable,v=d.edgesUpdatable,p=d.elementsSelectable,g=d.onError,y=function(n){var t=Sb(s((function(n){return n.edges.map((function(n){return n.id}))}),[n]),u_);return t}(!1);return k.jsxs("div",{className:"ink-flow__edges",children:[k.jsx(vx,{defaultColor:t,rfId:e}),y.map((function(n){return k.jsx(Fx,{id:n,edgesFocusable:h,edgesUpdatable:v,elementsSelectable:p,noPanClassName:r,onEdgeUpdate:o,onContextMenu:i,onMouseEnter:u,onMouseMove:a,onMouseLeave:c,onClick:l,rfId:e,onError:g,edgeTypes:f},n)}))]})}$x.displayName="EdgeRenderer";var Gx,qx=c($x),Kx=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function Qx(n){var t=n.children,e=Sb(Kx);return k.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:e},children:t})}var Jx=((Gx={})[ip.Left]=ip.Right,Gx[ip.Right]=ip.Left,Gx[ip.Top]=ip.Bottom,Gx[ip.Bottom]=ip.Top,Gx),nE=function(n){var t,e,r=n.nodeId,o=n.handleType,i=n.style,u=n.type,a=void 0===u?rp.Bezier:u,c=n.CustomComponent,l=n.connectionStatus,f=Sb(s((function(n){var t;return{fromNode:n.nodeLookup.get(r),handleId:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.handleId,toX:(n.connectionPosition.x-n.transform[0])/n.transform[2],toY:(n.connectionPosition.y-n.transform[1])/n.transform[2],connectionMode:n.connectionMode}}),[r]),u_),h=f.fromNode,v=f.handleId,p=f.toX,g=f.toY,m=f.connectionMode,w=null==h?void 0:h.internals.handleBounds,b=null==w?void 0:w[o];if(m===np.Loose&&(b=b||(null==w?void 0:w["source"===o?"target":"source"])),!h||!b)return null;var _=v?b.find((function(n){return n.id===v})):b[0],x=_?_.x+_.width/2:(null!==(t=h.measured.width)&&void 0!==t?t:0)/2,E=_?_.y+_.height/2:null!==(e=h.measured.height)&&void 0!==e?e:0,S=h.internals.positionAbsolute.x+x,C=h.internals.positionAbsolute.y+E,N=null==_?void 0:_.position,M=N?Jx[N]:null;if(!N||!M)return null;if(c)return k.jsx(c,{connectionLineType:a,connectionLineStyle:i,fromNode:h,fromHandle:_,fromX:S,fromY:C,toX:p,toY:g,fromPosition:N,toPosition:M,connectionStatus:l});var O="",j={sourceX:S,sourceY:C,sourcePosition:N,targetX:p,targetY:g,targetPosition:M};return O=a===rp.Bezier?y(sp(j),1)[0]:a===rp.Step?y(bp(d(d({},j),{borderRadius:0})),1)[0]:a===rp.SmoothStep?y(bp(j),1)[0]:a===rp.SimpleBezier?y(wx(j),1)[0]:"M".concat(S,",").concat(C," ").concat(p,",").concat(g),k.jsx("path",{d:O,fill:"none",className:"react-flow__connection-path",style:i})};nE.displayName="ConnectionLine";var tE=function(n){var t,e;return{nodeId:null===(t=n.connectionStartHandle)||void 0===t?void 0:t.nodeId,handleType:null===(e=n.connectionStartHandle)||void 0===e?void 0:e.type,nodesConnectable:n.nodesConnectable,connectionStatus:n.connectionStatus,width:n.width,height:n.height}};function eE(n){var t=n.containerStyle,e=n.style,r=n.type,o=n.component,i=Sb(tE,u_),u=i.nodeId,a=i.handleType,c=i.nodesConnectable,l=i.width,s=i.height,f=i.connectionStatus;return!!(u&&a&&l&&c)?k.jsx("svg",{style:t,width:l,height:s,className:"react-flow__connectionline react-flow__container",children:k.jsx("g",{className:j(["react-flow__connection",f]),children:k.jsx(nE,{nodeId:u,handleType:a,style:e,type:r,CustomComponent:o,connectionStatus:f})})}):null}function rE(n){var t=n.onNodeClick,e=n.onNodeDoubleClick,r=n.onNodeMouseEnter,o=n.onNodeMouseMove,i=n.onNodeMouseLeave,u=n.onNodeContextMenu,a=n.onEdgeClick,c=n.onEdgeDoubleClick,l=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeContextMenu,h=n.rfId,v=n.minZoom,p=n.maxZoom,g=n.noPanClassName,y=n.noDragClassName,m=n.nodeOrigin,w=n.viewport,b=n.disableKeyboardA11y,_=n.translateExtent,x=n.defaultViewport,E=n.nodeTypes,S=n.edgeTypes,C=n.elementsSelectable,N=n.defaultMarkerColor,M=n.connectionLineType,O=n.connectionLineStyle,j=n.connectionLineComponent,I=n.connectionLineContainerStyle,P=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,T=n.onPaneMouseLeave,B=n.onPaneScroll;return k.jsx(j_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:b,translateExtent:_,defaultViewport:x,elementsSelectable:C,onPaneClick:P,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:T,onPaneScroll:B,children:k.jsxs(Qx,{children:[k.jsx(qx,{rfId:h,edgeTypes:S,noPanClassName:g,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,onEdgeContextMenu:d,defaultMarkerColor:N}),k.jsx(eE,{style:O,type:M,component:j,containerStyle:I}),k.jsx("div",{className:"ink-flow__edgelabel-renderer"}),k.jsx(lx,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:t,onNodeDoubleClick:e,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),k.jsx("div",{className:"ink-flow__viewport-portal"})]})})}rE.displayName="GraphView";var oE=c(rE),iE={x:0,y:0,zoom:1},uE={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},aE=function(n){var t,e,r=void 0===n?{}:n,o=r.nodes,i=r.edges,u=r.defaultNodes,a=r.defaultEdges;r.width,r.height,r.fitView;var c=new Map,l=new Map,s=new Map,f=new Map,d=null!==(t=null!=a?a:i)&&void 0!==t?t:[],h=null!==(e=null!=u?u:o)&&void 0!==e?e:[];Ob(s,f,d),jb(h,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:h,nodeLookup:c,parentLookup:l,edges:d,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Nv,nodeExtent:Nv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:np.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:uE,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"react",debug:!1}},cE={dagre:_p};var lE={exports:{}};
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Lodash <https://lodash.com/>
|
|
@@ -21,5 +21,5 @@ S=C,function(){var n={}.hasOwnProperty;function t(){for(var n="",t=0;t<arguments
|
|
|
21
21
|
* Released under MIT license <https://lodash.com/license>
|
|
22
22
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
23
23
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
24
|
-
*/!function(n,t){(function(){var e,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",u=16,a=32,c=64,l=128,s=256,f=1/0,d=9007199254740991,h=NaN,v=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",a],["partialRight",c],["rearg",s]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",b="[object Date]",_="[object Error]",x="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",N="[object Promise]",M="[object RegExp]",O="[object Set]",j="[object String]",I="[object Symbol]",P="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",T="[object Float64Array]",B="[object Int8Array]",D="[object Int16Array]",R="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",Z="[object Uint32Array]",X=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(W.source),q=RegExp($.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,on=RegExp(rn.source),un=/^\s+/,an=/\s/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,sn=/,? & /,fn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dn=/[()=,{}\[\]\/\s]/,hn=/\\(\\)?/g,vn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pn=/\w*$/,gn=/^[-+]0x[0-9a-f]+$/i,yn=/^0b[01]+$/i,mn=/^\[object .+?Constructor\]$/,wn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xn=/($^)/,En=/['\n\r\u2028\u2029\\]/g,Sn="\\ud800-\\udfff",kn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Cn="\\u2700-\\u27bf",Nn="a-z\\xdf-\\xf6\\xf8-\\xff",Mn="A-Z\\xc0-\\xd6\\xd8-\\xde",On="\\ufe0e\\ufe0f",jn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",In="['’]",Pn="["+Sn+"]",An="["+jn+"]",zn="["+kn+"]",Ln="\\d+",Tn="["+Cn+"]",Bn="["+Nn+"]",Dn="[^"+Sn+jn+Ln+Cn+Nn+Mn+"]",Rn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+Mn+"]",Xn="\\u200d",Un="(?:"+Bn+"|"+Dn+")",Fn="(?:"+Zn+"|"+Dn+")",Wn="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Rn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Xn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Tn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,Pn].join("|")+")",nt=RegExp(In,"g"),tt=RegExp(zn,"g"),et=RegExp(Rn+"(?="+Rn+")|"+Jn+Kn,"g"),rt=RegExp([Zn+"?"+Bn+"+"+Wn+"(?="+[An,Zn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Zn+Un,"$"].join("|")+")",Zn+"?"+Un+"+"+Wn,Zn+"+"+$n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ln,Qn].join("|"),"g"),ot=RegExp("["+Xn+Sn+kn+On+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ut=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,ct={};ct[L]=ct[T]=ct[B]=ct[D]=ct[R]=ct[V]=ct[H]=ct[Y]=ct[Z]=!0,ct[g]=ct[y]=ct[A]=ct[m]=ct[z]=ct[b]=ct[_]=ct[x]=ct[S]=ct[k]=ct[C]=ct[M]=ct[O]=ct[j]=ct[P]=!1;var lt={};lt[g]=lt[y]=lt[A]=lt[z]=lt[m]=lt[b]=lt[L]=lt[T]=lt[B]=lt[D]=lt[R]=lt[S]=lt[k]=lt[C]=lt[M]=lt[O]=lt[j]=lt[I]=lt[V]=lt[H]=lt[Y]=lt[Z]=!0,lt[_]=lt[x]=lt[P]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,ht="object"==typeof w&&w&&w.Object===Object&&w,vt="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||vt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&n&&!n.nodeType&&n,mt=yt&&yt.exports===gt,wt=mt&&ht.process,bt=function(){try{var n=yt&&yt.require&&yt.require("util").types;return n||wt&&wt.binding&&wt.binding("util")}catch(n){}}(),_t=bt&&bt.isArrayBuffer,xt=bt&&bt.isDate,Et=bt&&bt.isMap,St=bt&&bt.isRegExp,kt=bt&&bt.isSet,Ct=bt&&bt.isTypedArray;function Nt(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Mt(n,t,e,r){for(var o=-1,i=null==n?0:n.length;++o<i;){var u=n[o];t(r,u,e(u),n)}return r}function Ot(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&!1!==t(n[e],e,n););return n}function jt(n,t){for(var e=null==n?0:n.length;e--&&!1!==t(n[e],e,n););return n}function It(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(!t(n[e],e,n))return!1;return!0}function Pt(n,t){for(var e=-1,r=null==n?0:n.length,o=0,i=[];++e<r;){var u=n[e];t(u,e,n)&&(i[o++]=u)}return i}function At(n,t){return!!(null==n?0:n.length)&&Zt(n,t,0)>-1}function zt(n,t,e){for(var r=-1,o=null==n?0:n.length;++r<o;)if(e(t,n[r]))return!0;return!1}function Lt(n,t){for(var e=-1,r=null==n?0:n.length,o=Array(r);++e<r;)o[e]=t(n[e],e,n);return o}function Tt(n,t){for(var e=-1,r=t.length,o=n.length;++e<r;)n[o+e]=t[e];return n}function Bt(n,t,e,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);return e}function Dt(n,t,e,r){var o=null==n?0:n.length;for(r&&o&&(e=n[--o]);o--;)e=t(e,n[o],o,n);return e}function Rt(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}var Vt=Wt("length");function Ht(n,t,e){var r;return e(n,(function(n,e,o){if(t(n,e,o))return r=e,!1})),r}function Yt(n,t,e,r){for(var o=n.length,i=e+(r?1:-1);r?i--:++i<o;)if(t(n[i],i,n))return i;return-1}function Zt(n,t,e){return t==t?function(n,t,e){var r=e-1,o=n.length;for(;++r<o;)if(n[r]===t)return r;return-1}(n,t,e):Yt(n,Ut,e)}function Xt(n,t,e,r){for(var o=e-1,i=n.length;++o<i;)if(r(n[o],t))return o;return-1}function Ut(n){return n!=n}function Ft(n,t){var e=null==n?0:n.length;return e?qt(n,t)/e:h}function Wt(n){return function(t){return null==t?e:t[n]}}function $t(n){return function(t){return null==n?e:n[t]}}function Gt(n,t,e,r,o){return o(n,(function(n,o,i){e=r?(r=!1,n):t(e,n,o,i)})),e}function qt(n,t){for(var r,o=-1,i=n.length;++o<i;){var u=t(n[o]);u!==e&&(r=r===e?u:r+u)}return r}function Kt(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}function Qt(n){return n?n.slice(0,pe(n)+1).replace(un,""):n}function Jt(n){return function(t){return n(t)}}function ne(n,t){return Lt(t,(function(t){return n[t]}))}function te(n,t){return n.has(t)}function ee(n,t){for(var e=-1,r=n.length;++e<r&&Zt(t,n[e],0)>-1;);return e}function re(n,t){for(var e=n.length;e--&&Zt(t,n[e],0)>-1;);return e}var oe=$t({"À":"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"}),ie=$t({"&":"&","<":"<",">":">",'"':""","'":"'"});function ue(n){return"\\"+st[n]}function ae(n){return ot.test(n)}function ce(n){var t=-1,e=Array(n.size);return n.forEach((function(n,r){e[++t]=[r,n]})),e}function le(n,t){return function(e){return n(t(e))}}function se(n,t){for(var e=-1,r=n.length,o=0,u=[];++e<r;){var a=n[e];a!==t&&a!==i||(n[e]=i,u[o++]=e)}return u}function fe(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=n})),e}function de(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=[n,n]})),e}function he(n){return ae(n)?function(n){var t=et.lastIndex=0;for(;et.test(n);)++t;return t}(n):Vt(n)}function ve(n){return ae(n)?function(n){return n.match(et)||[]}(n):function(n){return n.split("")}(n)}function pe(n){for(var t=n.length;t--&&an.test(n.charAt(t)););return t}var ge=$t({"&":"&","<":"<",">":">",""":'"',"'":"'"});var ye=function n(t){var w,an=(t=null==t?pt:ye.defaults(pt.Object(),t,ye.pick(pt,ut))).Array,Sn=t.Date,kn=t.Error,Cn=t.Function,Nn=t.Math,Mn=t.Object,On=t.RegExp,jn=t.String,In=t.TypeError,Pn=an.prototype,An=Cn.prototype,zn=Mn.prototype,Ln=t["__core-js_shared__"],Tn=An.toString,Bn=zn.hasOwnProperty,Dn=0,Rn=(w=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Vn=zn.toString,Hn=Tn.call(Mn),Yn=pt._,Zn=On("^"+Tn.call(Bn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xn=mt?t.Buffer:e,Un=t.Symbol,Fn=t.Uint8Array,Wn=Xn?Xn.allocUnsafe:e,$n=le(Mn.getPrototypeOf,Mn),Gn=Mn.create,qn=zn.propertyIsEnumerable,Kn=Pn.splice,Qn=Un?Un.isConcatSpreadable:e,Jn=Un?Un.iterator:e,et=Un?Un.toStringTag:e,ot=function(){try{var n=hi(Mn,"defineProperty");return n({},"",{}),n}catch(n){}}(),st=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Sn&&Sn.now!==pt.Date.now&&Sn.now,vt=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Nn.ceil,yt=Nn.floor,wt=Mn.getOwnPropertySymbols,bt=Xn?Xn.isBuffer:e,Vt=t.isFinite,$t=Pn.join,me=le(Mn.keys,Mn),we=Nn.max,be=Nn.min,_e=Sn.now,xe=t.parseInt,Ee=Nn.random,Se=Pn.reverse,ke=hi(t,"DataView"),Ce=hi(t,"Map"),Ne=hi(t,"Promise"),Me=hi(t,"Set"),Oe=hi(t,"WeakMap"),je=hi(Mn,"create"),Ie=Oe&&new Oe,Pe={},Ae=Ri(ke),ze=Ri(Ce),Le=Ri(Ne),Te=Ri(Me),Be=Ri(Oe),De=Un?Un.prototype:e,Re=De?De.valueOf:e,Ve=De?De.toString:e;function He(n){if(ea(n)&&!Uu(n)&&!(n instanceof Ue)){if(n instanceof Xe)return n;if(Bn.call(n,"__wrapped__"))return Vi(n)}return new Xe(n)}var Ye=function(){function n(){}return function(t){if(!ta(t))return{};if(Gn)return Gn(t);n.prototype=t;var r=new n;return n.prototype=e,r}}();function Ze(){}function Xe(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=e}function Ue(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Fe(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function We(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function $e(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function Ge(n){var t=-1,e=null==n?0:n.length;for(this.__data__=new $e;++t<e;)this.add(n[t])}function qe(n){var t=this.__data__=new We(n);this.size=t.size}function Ke(n,t){var e=Uu(n),r=!e&&Xu(n),o=!e&&!r&&Gu(n),i=!e&&!r&&!o&&sa(n),u=e||r||o||i,a=u?Kt(n.length,jn):[],c=a.length;for(var l in n)!t&&!Bn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||bi(l,c))||a.push(l);return a}function Qe(n){var t=n.length;return t?n[Gr(0,t-1)]:e}function Je(n,t){return Ti(Io(n),cr(t,0,n.length))}function nr(n){return Ti(Io(n))}function tr(n,t,r){(r!==e&&!Hu(n[t],r)||r===e&&!(t in n))&&ur(n,t,r)}function er(n,t,r){var o=n[t];Bn.call(n,t)&&Hu(o,r)&&(r!==e||t in n)||ur(n,t,r)}function rr(n,t){for(var e=n.length;e--;)if(Hu(n[e][0],t))return e;return-1}function or(n,t,e,r){return hr(n,(function(n,o,i){t(r,n,e(n),i)})),r}function ir(n,t){return n&&Po(t,Pa(t),n)}function ur(n,t,e){"__proto__"==t&&ot?ot(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function ar(n,t){for(var r=-1,o=t.length,i=an(o),u=null==n;++r<o;)i[r]=u?e:Na(n,t[r]);return i}function cr(n,t,r){return n==n&&(r!==e&&(n=n<=r?n:r),t!==e&&(n=n>=t?n:t)),n}function lr(n,t,r,o,i,u){var a,c=1&t,l=2&t,s=4&t;if(r&&(a=i?r(n,o,i,u):r(n)),a!==e)return a;if(!ta(n))return n;var f=Uu(n);if(f){if(a=function(n){var t=n.length,e=new n.constructor(t);t&&"string"==typeof n[0]&&Bn.call(n,"index")&&(e.index=n.index,e.input=n.input);return e}(n),!c)return Io(n,a)}else{var d=gi(n),h=d==x||d==E;if(Gu(n))return ko(n,c);if(d==C||d==g||h&&!i){if(a=l||h?{}:mi(n),!c)return l?function(n,t){return Po(n,pi(n),t)}(n,function(n,t){return n&&Po(t,Aa(t),n)}(a,n)):function(n,t){return Po(n,vi(n),t)}(n,ir(a,n))}else{if(!lt[d])return i?n:{};a=function(n,t,e){var r=n.constructor;switch(t){case A:return Co(n);case m:case b:return new r(+n);case z:return function(n,t){var e=t?Co(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}(n,e);case L:case T:case B:case D:case R:case V:case H:case Y:case Z:return No(n,e);case S:return new r;case k:case j:return new r(n);case M:return function(n){var t=new n.constructor(n.source,pn.exec(n));return t.lastIndex=n.lastIndex,t}(n);case O:return new r;case I:return o=n,Re?Mn(Re.call(o)):{}}var o}(n,d,c)}}u||(u=new qe);var v=u.get(n);if(v)return v;u.set(n,a),aa(n)?n.forEach((function(e){a.add(lr(e,t,r,e,n,u))})):ra(n)&&n.forEach((function(e,o){a.set(o,lr(e,t,r,o,n,u))}));var p=f?e:(s?l?ui:ii:l?Aa:Pa)(n);return Ot(p||n,(function(e,o){p&&(e=n[o=e]),er(a,o,lr(e,t,r,o,n,u))})),a}function sr(n,t,r){var o=r.length;if(null==n)return!o;for(n=Mn(n);o--;){var i=r[o],u=t[i],a=n[i];if(a===e&&!(i in n)||!u(a))return!1}return!0}function fr(n,t,o){if("function"!=typeof n)throw new In(r);return Pi((function(){n.apply(e,o)}),t)}function dr(n,t,e,r){var o=-1,i=At,u=!0,a=n.length,c=[],l=t.length;if(!a)return c;e&&(t=Lt(t,Jt(e))),r?(i=zt,u=!1):t.length>=200&&(i=te,u=!1,t=new Ge(t));n:for(;++o<a;){var s=n[o],f=null==e?s:e(s);if(s=r||0!==s?s:0,u&&f==f){for(var d=l;d--;)if(t[d]===f)continue n;c.push(s)}else i(t,f,r)||c.push(s)}return c}He.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:He}},He.prototype=Ze.prototype,He.prototype.constructor=He,Xe.prototype=Ye(Ze.prototype),Xe.prototype.constructor=Xe,Ue.prototype=Ye(Ze.prototype),Ue.prototype.constructor=Ue,Fe.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Fe.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Fe.prototype.get=function(n){var t=this.__data__;if(je){var r=t[n];return r===o?e:r}return Bn.call(t,n)?t[n]:e},Fe.prototype.has=function(n){var t=this.__data__;return je?t[n]!==e:Bn.call(t,n)},Fe.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=je&&t===e?o:t,this},We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(n){var t=this.__data__,e=rr(t,n);return!(e<0)&&(e==t.length-1?t.pop():Kn.call(t,e,1),--this.size,!0)},We.prototype.get=function(n){var t=this.__data__,r=rr(t,n);return r<0?e:t[r][1]},We.prototype.has=function(n){return rr(this.__data__,n)>-1},We.prototype.set=function(n,t){var e=this.__data__,r=rr(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this},$e.prototype.clear=function(){this.size=0,this.__data__={hash:new Fe,map:new(Ce||We),string:new Fe}},$e.prototype.delete=function(n){var t=fi(this,n).delete(n);return this.size-=t?1:0,t},$e.prototype.get=function(n){return fi(this,n).get(n)},$e.prototype.has=function(n){return fi(this,n).has(n)},$e.prototype.set=function(n,t){var e=fi(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this},Ge.prototype.add=Ge.prototype.push=function(n){return this.__data__.set(n,o),this},Ge.prototype.has=function(n){return this.__data__.has(n)},qe.prototype.clear=function(){this.__data__=new We,this.size=0},qe.prototype.delete=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e},qe.prototype.get=function(n){return this.__data__.get(n)},qe.prototype.has=function(n){return this.__data__.has(n)},qe.prototype.set=function(n,t){var e=this.__data__;if(e instanceof We){var r=e.__data__;if(!Ce||r.length<199)return r.push([n,t]),this.size=++e.size,this;e=this.__data__=new $e(r)}return e.set(n,t),this.size=e.size,this};var hr=Lo(_r),vr=Lo(xr,!0);function pr(n,t){var e=!0;return hr(n,(function(n,r,o){return e=!!t(n,r,o)})),e}function gr(n,t,r){for(var o=-1,i=n.length;++o<i;){var u=n[o],a=t(u);if(null!=a&&(c===e?a==a&&!la(a):r(a,c)))var c=a,l=u}return l}function yr(n,t){var e=[];return hr(n,(function(n,r,o){t(n,r,o)&&e.push(n)})),e}function mr(n,t,e,r,o){var i=-1,u=n.length;for(e||(e=wi),o||(o=[]);++i<u;){var a=n[i];t>0&&e(a)?t>1?mr(a,t-1,e,r,o):Tt(o,a):r||(o[o.length]=a)}return o}var wr=To(),br=To(!0);function _r(n,t){return n&&wr(n,t,Pa)}function xr(n,t){return n&&br(n,t,Pa)}function Er(n,t){return Pt(t,(function(t){return Qu(n[t])}))}function Sr(n,t){for(var r=0,o=(t=_o(t,n)).length;null!=n&&r<o;)n=n[Di(t[r++])];return r&&r==o?n:e}function kr(n,t,e){var r=t(n);return Uu(n)?r:Tt(r,e(n))}function Cr(n){return null==n?n===e?"[object Undefined]":"[object Null]":et&&et in Mn(n)?function(n){var t=Bn.call(n,et),r=n[et];try{n[et]=e;var o=!0}catch(n){}var i=Vn.call(n);o&&(t?n[et]=r:delete n[et]);return i}(n):function(n){return Vn.call(n)}(n)}function Nr(n,t){return n>t}function Mr(n,t){return null!=n&&Bn.call(n,t)}function Or(n,t){return null!=n&&t in Mn(n)}function jr(n,t,r){for(var o=r?zt:At,i=n[0].length,u=n.length,a=u,c=an(u),l=1/0,s=[];a--;){var f=n[a];a&&t&&(f=Lt(f,Jt(t))),l=be(f.length,l),c[a]=!r&&(t||i>=120&&f.length>=120)?new Ge(a&&f):e}f=n[0];var d=-1,h=c[0];n:for(;++d<i&&s.length<l;){var v=f[d],p=t?t(v):v;if(v=r||0!==v?v:0,!(h?te(h,p):o(s,p,r))){for(a=u;--a;){var g=c[a];if(!(g?te(g,p):o(n[a],p,r)))continue n}h&&h.push(p),s.push(v)}}return s}function Ir(n,t,r){var o=null==(n=Oi(n,t=_o(t,n)))?n:n[Di(Ki(t))];return null==o?e:Nt(o,n,r)}function Pr(n){return ea(n)&&Cr(n)==g}function Ar(n,t,r,o,i){return n===t||(null==n||null==t||!ea(n)&&!ea(t)?n!=n&&t!=t:function(n,t,r,o,i,u){var a=Uu(n),c=Uu(t),l=a?y:gi(n),s=c?y:gi(t),f=(l=l==g?C:l)==C,d=(s=s==g?C:s)==C,h=l==s;if(h&&Gu(n)){if(!Gu(t))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new qe),a||sa(n)?ri(n,t,r,o,i,u):function(n,t,e,r,o,i,u){switch(e){case z:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case A:return!(n.byteLength!=t.byteLength||!i(new Fn(n),new Fn(t)));case m:case b:case k:return Hu(+n,+t);case _:return n.name==t.name&&n.message==t.message;case M:case j:return n==t+"";case S:var a=ce;case O:var c=1&r;if(a||(a=fe),n.size!=t.size&&!c)return!1;var l=u.get(n);if(l)return l==t;r|=2,u.set(n,t);var s=ri(a(n),a(t),r,o,i,u);return u.delete(n),s;case I:if(Re)return Re.call(n)==Re.call(t)}return!1}(n,t,l,r,o,i,u);if(!(1&r)){var v=f&&Bn.call(n,"__wrapped__"),p=d&&Bn.call(t,"__wrapped__");if(v||p){var w=v?n.value():n,x=p?t.value():t;return u||(u=new qe),i(w,x,r,o,u)}}if(!h)return!1;return u||(u=new qe),function(n,t,r,o,i,u){var a=1&r,c=ii(n),l=c.length,s=ii(t),f=s.length;if(l!=f&&!a)return!1;var d=l;for(;d--;){var h=c[d];if(!(a?h in t:Bn.call(t,h)))return!1}var v=u.get(n),p=u.get(t);if(v&&p)return v==t&&p==n;var g=!0;u.set(n,t),u.set(t,n);var y=a;for(;++d<l;){var m=n[h=c[d]],w=t[h];if(o)var b=a?o(w,m,h,t,n,u):o(m,w,h,n,t,u);if(!(b===e?m===w||i(m,w,r,o,u):b)){g=!1;break}y||(y="constructor"==h)}if(g&&!y){var _=n.constructor,x=t.constructor;_==x||!("constructor"in n)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(g=!1)}return u.delete(n),u.delete(t),g}(n,t,r,o,i,u)}(n,t,r,o,Ar,i))}function zr(n,t,r,o){var i=r.length,u=i,a=!o;if(null==n)return!u;for(n=Mn(n);i--;){var c=r[i];if(a&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++i<u;){var l=(c=r[i])[0],s=n[l],f=c[1];if(a&&c[2]){if(s===e&&!(l in n))return!1}else{var d=new qe;if(o)var h=o(s,f,l,n,t,d);if(!(h===e?Ar(f,s,3,o,d):h))return!1}}return!0}function Lr(n){return!(!ta(n)||(t=n,Rn&&Rn in t))&&(Qu(n)?Zn:mn).test(Ri(n));var t}function Tr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Uu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Br(n){if(!ki(n))return me(n);var t=[];for(var e in Mn(n))Bn.call(n,e)&&"constructor"!=e&&t.push(e);return t}function Dr(n){if(!ta(n))return function(n){var t=[];if(null!=n)for(var e in Mn(n))t.push(e);return t}(n);var t=ki(n),e=[];for(var r in n)("constructor"!=r||!t&&Bn.call(n,r))&&e.push(r);return e}function Rr(n,t){return n<t}function Vr(n,t){var e=-1,r=Wu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++e]=t(n,o,i)})),r}function Hr(n){var t=di(n);return 1==t.length&&t[0][2]?Ni(t[0][0],t[0][1]):function(e){return e===n||zr(e,n,t)}}function Yr(n,t){return xi(n)&&Ci(t)?Ni(Di(n),t):function(r){var o=Na(r,n);return o===e&&o===t?Ma(r,n):Ar(t,o,3)}}function Zr(n,t,r,o,i){n!==t&&wr(t,(function(u,a){if(i||(i=new qe),ta(u))!function(n,t,r,o,i,u,a){var c=ji(n,r),l=ji(t,r),s=a.get(l);if(s)return void tr(n,r,s);var f=u?u(c,l,r+"",n,t,a):e,d=f===e;if(d){var h=Uu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Uu(c)?f=c:$u(c)?f=Io(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=No(l,!0)):f=[]:ia(l)||Xu(l)?(f=c,Xu(c)?f=ma(c):ta(c)&&!Qu(c)||(f=mi(l))):d=!1}d&&(a.set(l,f),i(f,l,o,u,a),a.delete(l));tr(n,r,f)}(n,t,a,r,Zr,o,i);else{var c=o?o(ji(n,a),u,a+"",n,t,i):e;c===e&&(c=u),tr(n,a,c)}}),Aa)}function Xr(n,t){var r=n.length;if(r)return bi(t+=t<0?r:0,r)?n[t]:e}function Ur(n,t,e){t=t.length?Lt(t,(function(n){return Uu(n)?function(t){return Sr(t,1===n.length?n[0]:n)}:n})):[oc];var r=-1;t=Lt(t,Jt(si()));var o=Vr(n,(function(n,e,o){var i=Lt(t,(function(t){return t(n)}));return{criteria:i,index:++r,value:n}}));return function(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}(o,(function(n,t){return function(n,t,e){var r=-1,o=n.criteria,i=t.criteria,u=o.length,a=e.length;for(;++r<u;){var c=Mo(o[r],i[r]);if(c)return r>=a?c:c*("desc"==e[r]?-1:1)}return n.index-t.index}(n,t,e)}))}function Fr(n,t,e){for(var r=-1,o=t.length,i={};++r<o;){var u=t[r],a=Sr(n,u);e(a,u)&&no(i,_o(u,n),a)}return i}function Wr(n,t,e,r){var o=r?Xt:Zt,i=-1,u=t.length,a=n;for(n===t&&(t=Io(t)),e&&(a=Lt(n,Jt(e)));++i<u;)for(var c=0,l=t[i],s=e?e(l):l;(c=o(a,s,c,r))>-1;)a!==n&&Kn.call(a,c,1),Kn.call(n,c,1);return n}function $r(n,t){for(var e=n?t.length:0,r=e-1;e--;){var o=t[e];if(e==r||o!==i){var i=o;bi(o)?Kn.call(n,o,1):ho(n,o)}}return n}function Gr(n,t){return n+yt(Ee()*(t-n+1))}function qr(n,t){var e="";if(!n||t<1||t>d)return e;do{t%2&&(e+=n),(t=yt(t/2))&&(n+=n)}while(t);return e}function Kr(n,t){return Ai(Mi(n,t,oc),n+"")}function Qr(n){return Qe(Ha(n))}function Jr(n,t){var e=Ha(n);return Ti(e,cr(t,0,e.length))}function no(n,t,r,o){if(!ta(n))return n;for(var i=-1,u=(t=_o(t,n)).length,a=u-1,c=n;null!=c&&++i<u;){var l=Di(t[i]),s=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return n;if(i!=a){var f=c[l];(s=o?o(f,l,c):e)===e&&(s=ta(f)?f:bi(t[i+1])?[]:{})}er(c,l,s),c=c[l]}return n}var to=Ie?function(n,t){return Ie.set(n,t),n}:oc,eo=ot?function(n,t){return ot(n,"toString",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:oc;function ro(n){return Ti(Ha(n))}function oo(n,t,e){var r=-1,o=n.length;t<0&&(t=-t>o?0:o+t),(e=e>o?o:e)<0&&(e+=o),o=t>e?0:e-t>>>0,t>>>=0;for(var i=an(o);++r<o;)i[r]=n[r+t];return i}function io(n,t){var e;return hr(n,(function(n,r,o){return!(e=t(n,r,o))})),!!e}function uo(n,t,e){var r=0,o=null==n?r:n.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=n[i];null!==u&&!la(u)&&(e?u<=t:u<t)?r=i+1:o=i}return o}return ao(n,t,oc,e)}function ao(n,t,r,o){var i=0,u=null==n?0:n.length;if(0===u)return 0;for(var a=(t=r(t))!=t,c=null===t,l=la(t),s=t===e;i<u;){var f=yt((i+u)/2),d=r(n[f]),h=d!==e,v=null===d,p=d==d,g=la(d);if(a)var y=o||p;else y=s?p&&(o||h):c?p&&h&&(o||!v):l?p&&h&&!v&&(o||!g):!v&&!g&&(o?d<=t:d<t);y?i=f+1:u=f}return be(u,4294967294)}function co(n,t){for(var e=-1,r=n.length,o=0,i=[];++e<r;){var u=n[e],a=t?t(u):u;if(!e||!Hu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function lo(n){return"number"==typeof n?n:la(n)?h:+n}function so(n){if("string"==typeof n)return n;if(Uu(n))return Lt(n,so)+"";if(la(n))return Ve?Ve.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function fo(n,t,e){var r=-1,o=At,i=n.length,u=!0,a=[],c=a;if(e)u=!1,o=zt;else if(i>=200){var l=t?null:Ko(n);if(l)return fe(l);u=!1,o=te,c=new Ge}else c=t?[]:a;n:for(;++r<i;){var s=n[r],f=t?t(s):s;if(s=e||0!==s?s:0,u&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue n;t&&c.push(f),a.push(s)}else o(c,f,e)||(c!==a&&c.push(f),a.push(s))}return a}function ho(n,t){return null==(n=Oi(n,t=_o(t,n)))||delete n[Di(Ki(t))]}function vo(n,t,e,r){return no(n,t,e(Sr(n,t)),r)}function po(n,t,e,r){for(var o=n.length,i=r?o:-1;(r?i--:++i<o)&&t(n[i],i,n););return e?oo(n,r?0:i,r?i+1:o):oo(n,r?i+1:0,r?o:i)}function go(n,t){var e=n;return e instanceof Ue&&(e=e.value()),Bt(t,(function(n,t){return t.func.apply(t.thisArg,Tt([n],t.args))}),e)}function yo(n,t,e){var r=n.length;if(r<2)return r?fo(n[0]):[];for(var o=-1,i=an(r);++o<r;)for(var u=n[o],a=-1;++a<r;)a!=o&&(i[o]=dr(i[o]||u,n[a],t,e));return fo(mr(i,1),t,e)}function mo(n,t,r){for(var o=-1,i=n.length,u=t.length,a={};++o<i;){var c=o<u?t[o]:e;r(a,n[o],c)}return a}function wo(n){return $u(n)?n:[]}function bo(n){return"function"==typeof n?n:oc}function _o(n,t){return Uu(n)?n:xi(n,t)?[n]:Bi(wa(n))}var xo=Kr;function Eo(n,t,r){var o=n.length;return r=r===e?o:r,!t&&r>=o?n:oo(n,t,r)}var So=st||function(n){return pt.clearTimeout(n)};function ko(n,t){if(t)return n.slice();var e=n.length,r=Wn?Wn(e):new n.constructor(e);return n.copy(r),r}function Co(n){var t=new n.constructor(n.byteLength);return new Fn(t).set(new Fn(n)),t}function No(n,t){var e=t?Co(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Mo(n,t){if(n!==t){var r=n!==e,o=null===n,i=n==n,u=la(n),a=t!==e,c=null===t,l=t==t,s=la(t);if(!c&&!s&&!u&&n>t||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&n<t||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}function Oo(n,t,e,r){for(var o=-1,i=n.length,u=e.length,a=-1,c=t.length,l=we(i-u,0),s=an(c+l),f=!r;++a<c;)s[a]=t[a];for(;++o<u;)(f||o<i)&&(s[e[o]]=n[o]);for(;l--;)s[a++]=n[o++];return s}function jo(n,t,e,r){for(var o=-1,i=n.length,u=-1,a=e.length,c=-1,l=t.length,s=we(i-a,0),f=an(s+l),d=!r;++o<s;)f[o]=n[o];for(var h=o;++c<l;)f[h+c]=t[c];for(;++u<a;)(d||o<i)&&(f[h+e[u]]=n[o++]);return f}function Io(n,t){var e=-1,r=n.length;for(t||(t=an(r));++e<r;)t[e]=n[e];return t}function Po(n,t,r,o){var i=!r;r||(r={});for(var u=-1,a=t.length;++u<a;){var c=t[u],l=o?o(r[c],n[c],c,r,n):e;l===e&&(l=n[c]),i?ur(r,c,l):er(r,c,l)}return r}function Ao(n,t){return function(e,r){var o=Uu(e)?Mt:or,i=t?t():{};return o(e,n,si(r,2),i)}}function zo(n){return Kr((function(t,r){var o=-1,i=r.length,u=i>1?r[i-1]:e,a=i>2?r[2]:e;for(u=n.length>3&&"function"==typeof u?(i--,u):e,a&&_i(r[0],r[1],a)&&(u=i<3?e:u,i=1),t=Mn(t);++o<i;){var c=r[o];c&&n(t,c,o,u)}return t}))}function Lo(n,t){return function(e,r){if(null==e)return e;if(!Wu(e))return n(e,r);for(var o=e.length,i=t?o:-1,u=Mn(e);(t?i--:++i<o)&&!1!==r(u[i],i,u););return e}}function To(n){return function(t,e,r){for(var o=-1,i=Mn(t),u=r(t),a=u.length;a--;){var c=u[n?a:++o];if(!1===e(i[c],c,i))break}return t}}function Bo(n){return function(t){var r=ae(t=wa(t))?ve(t):e,o=r?r[0]:t.charAt(0),i=r?Eo(r,1).join(""):t.slice(1);return o[n]()+i}}function Do(n){return function(t){return Bt(Qa(Xa(t).replace(nt,"")),n,"")}}function Ro(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var e=Ye(n.prototype),r=n.apply(e,t);return ta(r)?r:e}}function Vo(n){return function(t,r,o){var i=Mn(t);if(!Wu(t)){var u=si(r,3);t=Pa(t),r=function(n){return u(i[n],n,i)}}var a=n(t,r,o);return a>-1?i[u?t[a]:a]:e}}function Ho(n){return oi((function(t){var o=t.length,i=o,u=Xe.prototype.thru;for(n&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new In(r);if(u&&!c&&"wrapper"==ci(a))var c=new Xe([],!0)}for(i=c?i:o;++i<o;){var l=ci(a=t[i]),s="wrapper"==l?ai(a):e;c=s&&Ei(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[ci(s[0])].apply(c,s[3]):1==a.length&&Ei(a)?c[l]():c.thru(a)}return function(){var n=arguments,e=n[0];if(c&&1==n.length&&Uu(e))return c.plant(e).value();for(var r=0,i=o?t[r].apply(this,n):e;++r<o;)i=t[r].call(this,i);return i}}))}function Yo(n,t,r,o,i,u,a,c,s,f){var d=t&l,h=1&t,v=2&t,p=24&t,g=512&t,y=v?e:Ro(n);return function l(){for(var m=arguments.length,w=an(m),b=m;b--;)w[b]=arguments[b];if(p)var _=li(l),x=function(n,t){for(var e=n.length,r=0;e--;)n[e]===t&&++r;return r}(w,_);if(o&&(w=Oo(w,o,i,p)),u&&(w=jo(w,u,a,p)),m-=x,p&&m<f){var E=se(w,_);return Go(n,t,Yo,l.placeholder,r,w,E,c,s,f-m)}var S=h?r:this,k=v?S[n]:n;return m=w.length,c?w=function(n,t){var r=n.length,o=be(t.length,r),i=Io(n);for(;o--;){var u=t[o];n[o]=bi(u,r)?i[u]:e}return n}(w,c):g&&m>1&&w.reverse(),d&&s<m&&(w.length=s),this&&this!==pt&&this instanceof l&&(k=y||Ro(k)),k.apply(S,w)}}function Zo(n,t){return function(e,r){return function(n,t,e,r){return _r(n,(function(n,o,i){t(r,e(n),o,i)})),r}(e,n,t(r),{})}}function Xo(n,t){return function(r,o){var i;if(r===e&&o===e)return t;if(r!==e&&(i=r),o!==e){if(i===e)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=lo(r),o=lo(o)),i=n(r,o)}return i}}function Uo(n){return oi((function(t){return t=Lt(t,Jt(si())),Kr((function(e){var r=this;return n(t,(function(n){return Nt(n,r,e)}))}))}))}function Fo(n,t){var r=(t=t===e?" ":so(t)).length;if(r<2)return r?qr(t,n):t;var o=qr(t,gt(n/he(t)));return ae(t)?Eo(ve(o),0,n).join(""):o.slice(0,n)}function Wo(n){return function(t,r,o){return o&&"number"!=typeof o&&_i(t,r,o)&&(r=o=e),t=va(t),r===e?(r=t,t=0):r=va(r),function(n,t,e,r){for(var o=-1,i=we(gt((t-n)/(e||1)),0),u=an(i);i--;)u[r?i:++o]=n,n+=e;return u}(t,r,o=o===e?t<r?1:-1:va(o),n)}}function $o(n){return function(t,e){return"string"==typeof t&&"string"==typeof e||(t=ya(t),e=ya(e)),n(t,e)}}function Go(n,t,r,o,i,u,l,s,f,d){var h=8&t;t|=h?a:c,4&(t&=~(h?c:a))||(t&=-4);var v=[n,t,i,h?u:e,h?l:e,h?e:u,h?e:l,s,f,d],p=r.apply(e,v);return Ei(n)&&Ii(p,v),p.placeholder=o,zi(p,n,t)}function qo(n){var t=Nn[n];return function(n,e){if(n=ya(n),(e=null==e?0:be(pa(e),292))&&Vt(n)){var r=(wa(n)+"e").split("e");return+((r=(wa(t(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return t(n)}}var Ko=Me&&1/fe(new Me([,-0]))[1]==f?function(n){return new Me(n)}:lc;function Qo(n){return function(t){var e=gi(t);return e==S?ce(t):e==O?de(t):function(n,t){return Lt(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function Jo(n,t,o,f,d,h,v,p){var g=2&t;if(!g&&"function"!=typeof n)throw new In(r);var y=f?f.length:0;if(y||(t&=-97,f=d=e),v=v===e?v:we(pa(v),0),p=p===e?p:pa(p),y-=d?d.length:0,t&c){var m=f,w=d;f=d=e}var b=g?e:ai(n),_=[n,t,o,f,d,m,w,h,v,p];if(b&&function(n,t){var e=n[1],r=t[1],o=e|r,u=o<131,a=r==l&&8==e||r==l&&e==s&&n[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==e;if(!u&&!a)return n;1&r&&(n[2]=t[2],o|=1&e?0:4);var c=t[3];if(c){var f=n[3];n[3]=f?Oo(f,c,t[4]):c,n[4]=f?se(n[3],i):t[4]}(c=t[5])&&(f=n[5],n[5]=f?jo(f,c,t[6]):c,n[6]=f?se(n[5],i):t[6]);(c=t[7])&&(n[7]=c);r&l&&(n[8]=null==n[8]?t[8]:be(n[8],t[8]));null==n[9]&&(n[9]=t[9]);n[0]=t[0],n[1]=o}(_,b),n=_[0],t=_[1],o=_[2],f=_[3],d=_[4],!(p=_[9]=_[9]===e?g?0:n.length:we(_[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||t==u?function(n,t,r){var o=Ro(n);return function i(){for(var u=arguments.length,a=an(u),c=u,l=li(i);c--;)a[c]=arguments[c];var s=u<3&&a[0]!==l&&a[u-1]!==l?[]:se(a,l);return(u-=s.length)<r?Go(n,t,Yo,i.placeholder,e,a,s,e,e,r-u):Nt(this&&this!==pt&&this instanceof i?o:n,this,a)}}(n,t,p):t!=a&&33!=t||d.length?Yo.apply(e,_):function(n,t,e,r){var o=1&t,i=Ro(n);return function t(){for(var u=-1,a=arguments.length,c=-1,l=r.length,s=an(l+a),f=this&&this!==pt&&this instanceof t?i:n;++c<l;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Nt(f,o?e:this,s)}}(n,t,o,f);else var x=function(n,t,e){var r=1&t,o=Ro(n);return function t(){return(this&&this!==pt&&this instanceof t?o:n).apply(r?e:this,arguments)}}(n,t,o);return zi((b?to:Ii)(x,_),n,t)}function ni(n,t,r,o){return n===e||Hu(n,zn[r])&&!Bn.call(o,r)?t:n}function ti(n,t,r,o,i,u){return ta(n)&&ta(t)&&(u.set(t,n),Zr(n,t,e,ti,u),u.delete(t)),n}function ei(n){return ia(n)?e:n}function ri(n,t,r,o,i,u){var a=1&r,c=n.length,l=t.length;if(c!=l&&!(a&&l>c))return!1;var s=u.get(n),f=u.get(t);if(s&&f)return s==t&&f==n;var d=-1,h=!0,v=2&r?new Ge:e;for(u.set(n,t),u.set(t,n);++d<c;){var p=n[d],g=t[d];if(o)var y=a?o(g,p,d,t,n,u):o(p,g,d,n,t,u);if(y!==e){if(y)continue;h=!1;break}if(v){if(!Rt(t,(function(n,t){if(!te(v,t)&&(p===n||i(p,n,r,o,u)))return v.push(t)}))){h=!1;break}}else if(p!==g&&!i(p,g,r,o,u)){h=!1;break}}return u.delete(n),u.delete(t),h}function oi(n){return Ai(Mi(n,e,Fi),n+"")}function ii(n){return kr(n,Pa,vi)}function ui(n){return kr(n,Aa,pi)}var ai=Ie?function(n){return Ie.get(n)}:lc;function ci(n){for(var t=n.name+"",e=Pe[t],r=Bn.call(Pe,t)?e.length:0;r--;){var o=e[r],i=o.func;if(null==i||i==n)return o.name}return t}function li(n){return(Bn.call(He,"placeholder")?He:n).placeholder}function si(){var n=He.iteratee||ic;return n=n===ic?Tr:n,arguments.length?n(arguments[0],arguments[1]):n}function fi(n,t){var e,r,o=n.__data__;return("string"==(r=typeof(e=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?o["string"==typeof t?"string":"hash"]:o.map}function di(n){for(var t=Pa(n),e=t.length;e--;){var r=t[e],o=n[r];t[e]=[r,o,Ci(o)]}return t}function hi(n,t){var r=function(n,t){return null==n?e:n[t]}(n,t);return Lr(r)?r:e}var vi=wt?function(n){return null==n?[]:(n=Mn(n),Pt(wt(n),(function(t){return qn.call(n,t)})))}:gc,pi=wt?function(n){for(var t=[];n;)Tt(t,vi(n)),n=$n(n);return t}:gc,gi=Cr;function yi(n,t,e){for(var r=-1,o=(t=_o(t,n)).length,i=!1;++r<o;){var u=Di(t[r]);if(!(i=null!=n&&e(n,u)))break;n=n[u]}return i||++r!=o?i:!!(o=null==n?0:n.length)&&na(o)&&bi(u,o)&&(Uu(n)||Xu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Ye($n(n))}function wi(n){return Uu(n)||Xu(n)||!!(Qn&&n&&n[Qn])}function bi(n,t){var e=typeof n;return!!(t=null==t?d:t)&&("number"==e||"symbol"!=e&&bn.test(n))&&n>-1&&n%1==0&&n<t}function _i(n,t,e){if(!ta(e))return!1;var r=typeof t;return!!("number"==r?Wu(e)&&bi(t,e.length):"string"==r&&t in e)&&Hu(e[t],n)}function xi(n,t){if(Uu(n))return!1;var e=typeof n;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=n&&!la(n))||(tn.test(n)||!nn.test(n)||null!=t&&n in Mn(t))}function Ei(n){var t=ci(n),e=He[t];if("function"!=typeof e||!(t in Ue.prototype))return!1;if(n===e)return!0;var r=ai(e);return!!r&&n===r[0]}(ke&&gi(new ke(new ArrayBuffer(1)))!=z||Ce&&gi(new Ce)!=S||Ne&&gi(Ne.resolve())!=N||Me&&gi(new Me)!=O||Oe&&gi(new Oe)!=P)&&(gi=function(n){var t=Cr(n),r=t==C?n.constructor:e,o=r?Ri(r):"";if(o)switch(o){case Ae:return z;case ze:return S;case Le:return N;case Te:return O;case Be:return P}return t});var Si=Ln?Qu:yc;function ki(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||zn)}function Ci(n){return n==n&&!ta(n)}function Ni(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==e||n in Mn(r)))}}function Mi(n,t,r){return t=we(t===e?n.length-1:t,0),function(){for(var e=arguments,o=-1,i=we(e.length-t,0),u=an(i);++o<i;)u[o]=e[t+o];o=-1;for(var a=an(t+1);++o<t;)a[o]=e[o];return a[t]=r(u),Nt(n,this,a)}}function Oi(n,t){return t.length<2?n:Sr(n,oo(t,0,-1))}function ji(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Ii=Li(to),Pi=vt||function(n,t){return pt.setTimeout(n,t)},Ai=Li(eo);function zi(n,t,e){var r=t+"";return Ai(n,function(n,t){var e=t.length;if(!e)return n;var r=e-1;return t[r]=(e>1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+t+"] */\n")}(r,function(n,t){return Ot(p,(function(e){var r="_."+e[0];t&e[1]&&!At(n,r)&&n.push(r)})),n.sort()}(function(n){var t=n.match(ln);return t?t[1].split(sn):[]}(r),e)))}function Li(n){var t=0,r=0;return function(){var o=_e(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(e,arguments)}}function Ti(n,t){var r=-1,o=n.length,i=o-1;for(t=t===e?o:t;++r<t;){var u=Gr(r,i),a=n[u];n[u]=n[r],n[r]=a}return n.length=t,n}var Bi=function(n){var t=Lu(n,(function(n){return 500===e.size&&e.clear(),n})),e=t.cache;return t}((function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(en,(function(n,e,r,o){t.push(r?o.replace(hn,"$1"):e||n)})),t}));function Di(n){if("string"==typeof n||la(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ri(n){if(null!=n){try{return Tn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Ue)return n.clone();var t=new Xe(n.__wrapped__,n.__chain__);return t.__actions__=Io(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var Hi=Kr((function(n,t){return $u(n)?dr(n,mr(t,1,$u,!0)):[]})),Yi=Kr((function(n,t){var r=Ki(t);return $u(r)&&(r=e),$u(n)?dr(n,mr(t,1,$u,!0),si(r,2)):[]})),Zi=Kr((function(n,t){var r=Ki(t);return $u(r)&&(r=e),$u(n)?dr(n,mr(t,1,$u,!0),e,r):[]}));function Xi(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var o=null==e?0:pa(e);return o<0&&(o=we(r+o,0)),Yt(n,si(t,3),o)}function Ui(n,t,r){var o=null==n?0:n.length;if(!o)return-1;var i=o-1;return r!==e&&(i=pa(r),i=r<0?we(o+i,0):be(i,o-1)),Yt(n,si(t,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Wi(n){return n&&n.length?n[0]:e}var $i=Kr((function(n){var t=Lt(n,wo);return t.length&&t[0]===n[0]?jr(t):[]})),Gi=Kr((function(n){var t=Ki(n),r=Lt(n,wo);return t===Ki(r)?t=e:r.pop(),r.length&&r[0]===n[0]?jr(r,si(t,2)):[]})),qi=Kr((function(n){var t=Ki(n),r=Lt(n,wo);return(t="function"==typeof t?t:e)&&r.pop(),r.length&&r[0]===n[0]?jr(r,e,t):[]}));function Ki(n){var t=null==n?0:n.length;return t?n[t-1]:e}var Qi=Kr(Ji);function Ji(n,t){return n&&n.length&&t&&t.length?Wr(n,t):n}var nu=oi((function(n,t){var e=null==n?0:n.length,r=ar(n,t);return $r(n,Lt(t,(function(n){return bi(n,e)?+n:n})).sort(Mo)),r}));function tu(n){return null==n?n:Se.call(n)}var eu=Kr((function(n){return fo(mr(n,1,$u,!0))})),ru=Kr((function(n){var t=Ki(n);return $u(t)&&(t=e),fo(mr(n,1,$u,!0),si(t,2))})),ou=Kr((function(n){var t=Ki(n);return t="function"==typeof t?t:e,fo(mr(n,1,$u,!0),e,t)}));function iu(n){if(!n||!n.length)return[];var t=0;return n=Pt(n,(function(n){if($u(n))return t=we(n.length,t),!0})),Kt(t,(function(t){return Lt(n,Wt(t))}))}function uu(n,t){if(!n||!n.length)return[];var r=iu(n);return null==t?r:Lt(r,(function(n){return Nt(t,e,n)}))}var au=Kr((function(n,t){return $u(n)?dr(n,t):[]})),cu=Kr((function(n){return yo(Pt(n,$u))})),lu=Kr((function(n){var t=Ki(n);return $u(t)&&(t=e),yo(Pt(n,$u),si(t,2))})),su=Kr((function(n){var t=Ki(n);return t="function"==typeof t?t:e,yo(Pt(n,$u),e,t)})),fu=Kr(iu);var du=Kr((function(n){var t=n.length,r=t>1?n[t-1]:e;return r="function"==typeof r?(n.pop(),r):e,uu(n,r)}));function hu(n){var t=He(n);return t.__chain__=!0,t}function vu(n,t){return t(n)}var pu=oi((function(n){var t=n.length,r=t?n[0]:0,o=this.__wrapped__,i=function(t){return ar(t,n)};return!(t>1||this.__actions__.length)&&o instanceof Ue&&bi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:vu,args:[i],thisArg:e}),new Xe(o,this.__chain__).thru((function(n){return t&&!n.length&&n.push(e),n}))):this.thru(i)}));var gu=Ao((function(n,t,e){Bn.call(n,e)?++n[e]:ur(n,e,1)}));var yu=Vo(Xi),mu=Vo(Ui);function wu(n,t){return(Uu(n)?Ot:hr)(n,si(t,3))}function bu(n,t){return(Uu(n)?jt:vr)(n,si(t,3))}var _u=Ao((function(n,t,e){Bn.call(n,e)?n[e].push(t):ur(n,e,[t])}));var xu=Kr((function(n,t,e){var r=-1,o="function"==typeof t,i=Wu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Nt(t,n,e):Ir(n,t,e)})),i})),Eu=Ao((function(n,t,e){ur(n,e,t)}));function Su(n,t){return(Uu(n)?Lt:Vr)(n,si(t,3))}var ku=Ao((function(n,t,e){n[e?0:1].push(t)}),(function(){return[[],[]]}));var Cu=Kr((function(n,t){if(null==n)return[];var e=t.length;return e>1&&_i(n,t[0],t[1])?t=[]:e>2&&_i(t[0],t[1],t[2])&&(t=[t[0]]),Ur(n,mr(t,1),[])})),Nu=ht||function(){return pt.Date.now()};function Mu(n,t,r){return t=r?e:t,t=n&&null==t?n.length:t,Jo(n,l,e,e,e,e,t)}function Ou(n,t){var o;if("function"!=typeof t)throw new In(r);return n=pa(n),function(){return--n>0&&(o=t.apply(this,arguments)),n<=1&&(t=e),o}}var ju=Kr((function(n,t,e){var r=1;if(e.length){var o=se(e,li(ju));r|=a}return Jo(n,r,t,e,o)})),Iu=Kr((function(n,t,e){var r=3;if(e.length){var o=se(e,li(Iu));r|=a}return Jo(t,r,n,e,o)}));function Pu(n,t,o){var i,u,a,c,l,s,f=0,d=!1,h=!1,v=!0;if("function"!=typeof n)throw new In(r);function p(t){var r=i,o=u;return i=u=e,f=t,c=n.apply(o,r)}function g(n){var r=n-s;return s===e||r>=t||r<0||h&&n-f>=a}function y(){var n=Nu();if(g(n))return m(n);l=Pi(y,function(n){var e=t-(n-s);return h?be(e,a-(n-f)):e}(n))}function m(n){return l=e,v&&i?p(n):(i=u=e,c)}function w(){var n=Nu(),r=g(n);if(i=arguments,u=this,s=n,r){if(l===e)return function(n){return f=n,l=Pi(y,t),d?p(n):c}(s);if(h)return So(l),l=Pi(y,t),p(s)}return l===e&&(l=Pi(y,t)),c}return t=ya(t)||0,ta(o)&&(d=!!o.leading,a=(h="maxWait"in o)?we(ya(o.maxWait)||0,t):a,v="trailing"in o?!!o.trailing:v),w.cancel=function(){l!==e&&So(l),f=0,i=s=u=l=e},w.flush=function(){return l===e?c:m(Nu())},w}var Au=Kr((function(n,t){return fr(n,1,t)})),zu=Kr((function(n,t,e){return fr(n,ya(t)||0,e)}));function Lu(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new In(r);var e=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=e.cache;if(i.has(o))return i.get(o);var u=n.apply(this,r);return e.cache=i.set(o,u)||i,u};return e.cache=new(Lu.Cache||$e),e}function Tu(n){if("function"!=typeof n)throw new In(r);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Lu.Cache=$e;var Bu=xo((function(n,t){var e=(t=1==t.length&&Uu(t[0])?Lt(t[0],Jt(si())):Lt(mr(t,1),Jt(si()))).length;return Kr((function(r){for(var o=-1,i=be(r.length,e);++o<i;)r[o]=t[o].call(this,r[o]);return Nt(n,this,r)}))})),Du=Kr((function(n,t){var r=se(t,li(Du));return Jo(n,a,e,t,r)})),Ru=Kr((function(n,t){var r=se(t,li(Ru));return Jo(n,c,e,t,r)})),Vu=oi((function(n,t){return Jo(n,s,e,e,e,t)}));function Hu(n,t){return n===t||n!=n&&t!=t}var Yu=$o(Nr),Zu=$o((function(n,t){return n>=t})),Xu=Pr(function(){return arguments}())?Pr:function(n){return ea(n)&&Bn.call(n,"callee")&&!qn.call(n,"callee")},Uu=an.isArray,Fu=_t?Jt(_t):function(n){return ea(n)&&Cr(n)==A};function Wu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ea(n)&&Wu(n)}var Gu=bt||yc,qu=xt?Jt(xt):function(n){return ea(n)&&Cr(n)==b};function Ku(n){if(!ea(n))return!1;var t=Cr(n);return t==_||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qu(n){if(!ta(n))return!1;var t=Cr(n);return t==x||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ju(n){return"number"==typeof n&&n==pa(n)}function na(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=d}function ta(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function ea(n){return null!=n&&"object"==typeof n}var ra=Et?Jt(Et):function(n){return ea(n)&&gi(n)==S};function oa(n){return"number"==typeof n||ea(n)&&Cr(n)==k}function ia(n){if(!ea(n)||Cr(n)!=C)return!1;var t=$n(n);if(null===t)return!0;var e=Bn.call(t,"constructor")&&t.constructor;return"function"==typeof e&&e instanceof e&&Tn.call(e)==Hn}var ua=St?Jt(St):function(n){return ea(n)&&Cr(n)==M};var aa=kt?Jt(kt):function(n){return ea(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Uu(n)&&ea(n)&&Cr(n)==j}function la(n){return"symbol"==typeof n||ea(n)&&Cr(n)==I}var sa=Ct?Jt(Ct):function(n){return ea(n)&&na(n.length)&&!!ct[Cr(n)]};var fa=$o(Rr),da=$o((function(n,t){return n<=t}));function ha(n){if(!n)return[];if(Wu(n))return ca(n)?ve(n):Io(n);if(Jn&&n[Jn])return function(n){for(var t,e=[];!(t=n.next()).done;)e.push(t.value);return e}(n[Jn]());var t=gi(n);return(t==S?ce:t==O?fe:Ha)(n)}function va(n){return n?(n=ya(n))===f||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function pa(n){var t=va(n),e=t%1;return t==t?e?t-e:t:0}function ga(n){return n?cr(pa(n),0,v):0}function ya(n){if("number"==typeof n)return n;if(la(n))return h;if(ta(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ta(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Qt(n);var e=yn.test(n);return e||wn.test(n)?dt(n.slice(2),e?2:8):gn.test(n)?h:+n}function ma(n){return Po(n,Aa(n))}function wa(n){return null==n?"":so(n)}var ba=zo((function(n,t){if(ki(t)||Wu(t))Po(t,Pa(t),n);else for(var e in t)Bn.call(t,e)&&er(n,e,t[e])})),_a=zo((function(n,t){Po(t,Aa(t),n)})),xa=zo((function(n,t,e,r){Po(t,Aa(t),n,r)})),Ea=zo((function(n,t,e,r){Po(t,Pa(t),n,r)})),Sa=oi(ar);var ka=Kr((function(n,t){n=Mn(n);var r=-1,o=t.length,i=o>2?t[2]:e;for(i&&_i(t[0],t[1],i)&&(o=1);++r<o;)for(var u=t[r],a=Aa(u),c=-1,l=a.length;++c<l;){var s=a[c],f=n[s];(f===e||Hu(f,zn[s])&&!Bn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(e,ti),Nt(La,e,n)}));function Na(n,t,r){var o=null==n?e:Sr(n,t);return o===e?r:o}function Ma(n,t){return null!=n&&yi(n,t,Or)}var Oa=Zo((function(n,t,e){null!=t&&"function"!=typeof t.toString&&(t=Vn.call(t)),n[t]=e}),tc(oc)),ja=Zo((function(n,t,e){null!=t&&"function"!=typeof t.toString&&(t=Vn.call(t)),Bn.call(n,t)?n[t].push(e):n[t]=[e]}),si),Ia=Kr(Ir);function Pa(n){return Wu(n)?Ke(n):Br(n)}function Aa(n){return Wu(n)?Ke(n,!0):Dr(n)}var za=zo((function(n,t,e){Zr(n,t,e)})),La=zo((function(n,t,e,r){Zr(n,t,e,r)})),Ta=oi((function(n,t){var e={};if(null==n)return e;var r=!1;t=Lt(t,(function(t){return t=_o(t,n),r||(r=t.length>1),t})),Po(n,ui(n),e),r&&(e=lr(e,7,ei));for(var o=t.length;o--;)ho(e,t[o]);return e}));var Ba=oi((function(n,t){return null==n?{}:function(n,t){return Fr(n,t,(function(t,e){return Ma(n,e)}))}(n,t)}));function Da(n,t){if(null==n)return{};var e=Lt(ui(n),(function(n){return[n]}));return t=si(t),Fr(n,e,(function(n,e){return t(n,e[0])}))}var Ra=Qo(Pa),Va=Qo(Aa);function Ha(n){return null==n?[]:ne(n,Pa(n))}var Ya=Do((function(n,t,e){return t=t.toLowerCase(),n+(e?Za(t):t)}));function Za(n){return Ka(wa(n).toLowerCase())}function Xa(n){return(n=wa(n))&&n.replace(_n,oe).replace(tt,"")}var Ua=Do((function(n,t,e){return n+(e?"-":"")+t.toLowerCase()})),Fa=Do((function(n,t,e){return n+(e?" ":"")+t.toLowerCase()})),Wa=Bo("toLowerCase");var $a=Do((function(n,t,e){return n+(e?"_":"")+t.toLowerCase()}));var Ga=Do((function(n,t,e){return n+(e?" ":"")+Ka(t)}));var qa=Do((function(n,t,e){return n+(e?" ":"")+t.toUpperCase()})),Ka=Bo("toUpperCase");function Qa(n,t,r){return n=wa(n),(t=r?e:t)===e?function(n){return it.test(n)}(n)?function(n){return n.match(rt)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(t)||[]}var Ja=Kr((function(n,t){try{return Nt(n,e,t)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,t){return Ot(t,(function(t){t=Di(t),ur(n,t,ju(n[t],n))})),n}));function tc(n){return function(){return n}}var ec=Ho(),rc=Ho(!0);function oc(n){return n}function ic(n){return Tr("function"==typeof n?n:lr(n,1))}var uc=Kr((function(n,t){return function(e){return Ir(e,n,t)}})),ac=Kr((function(n,t){return function(e){return Ir(n,e,t)}}));function cc(n,t,e){var r=Pa(t),o=Er(t,r);null!=e||ta(t)&&(o.length||!r.length)||(e=t,t=n,n=this,o=Er(t,Pa(t)));var i=!(ta(e)&&"chain"in e&&!e.chain),u=Qu(n);return Ot(o,(function(e){var r=t[e];n[e]=r,u&&(n.prototype[e]=function(){var t=this.__chain__;if(i||t){var e=n(this.__wrapped__);return(e.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:n}),e.__chain__=t,e}return r.apply(n,Tt([this.value()],arguments))})})),n}function lc(){}var sc=Uo(Lt),fc=Uo(It),dc=Uo(Rt);function hc(n){return xi(n)?Wt(Di(n)):function(n){return function(t){return Sr(t,n)}}(n)}var vc=Wo(),pc=Wo(!0);function gc(){return[]}function yc(){return!1}var mc=Xo((function(n,t){return n+t}),0),wc=qo("ceil"),bc=Xo((function(n,t){return n/t}),1),_c=qo("floor");var xc,Ec=Xo((function(n,t){return n*t}),1),Sc=qo("round"),kc=Xo((function(n,t){return n-t}),0);return He.after=function(n,t){if("function"!=typeof t)throw new In(r);return n=pa(n),function(){if(--n<1)return t.apply(this,arguments)}},He.ary=Mu,He.assign=ba,He.assignIn=_a,He.assignInWith=xa,He.assignWith=Ea,He.at=Sa,He.before=Ou,He.bind=ju,He.bindAll=nc,He.bindKey=Iu,He.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Uu(n)?n:[n]},He.chain=hu,He.chunk=function(n,t,r){t=(r?_i(n,t,r):t===e)?1:we(pa(t),0);var o=null==n?0:n.length;if(!o||t<1)return[];for(var i=0,u=0,a=an(gt(o/t));i<o;)a[u++]=oo(n,i,i+=t);return a},He.compact=function(n){for(var t=-1,e=null==n?0:n.length,r=0,o=[];++t<e;){var i=n[t];i&&(o[r++]=i)}return o},He.concat=function(){var n=arguments.length;if(!n)return[];for(var t=an(n-1),e=arguments[0],r=n;r--;)t[r-1]=arguments[r];return Tt(Uu(e)?Io(e):[e],mr(t,1))},He.cond=function(n){var t=null==n?0:n.length,e=si();return n=t?Lt(n,(function(n){if("function"!=typeof n[1])throw new In(r);return[e(n[0]),n[1]]})):[],Kr((function(e){for(var r=-1;++r<t;){var o=n[r];if(Nt(o[0],this,e))return Nt(o[1],this,e)}}))},He.conforms=function(n){return function(n){var t=Pa(n);return function(e){return sr(e,n,t)}}(lr(n,1))},He.constant=tc,He.countBy=gu,He.create=function(n,t){var e=Ye(n);return null==t?e:ir(e,t)},He.curry=function n(t,r,o){var i=Jo(t,8,e,e,e,e,e,r=o?e:r);return i.placeholder=n.placeholder,i},He.curryRight=function n(t,r,o){var i=Jo(t,u,e,e,e,e,e,r=o?e:r);return i.placeholder=n.placeholder,i},He.debounce=Pu,He.defaults=ka,He.defaultsDeep=Ca,He.defer=Au,He.delay=zu,He.difference=Hi,He.differenceBy=Yi,He.differenceWith=Zi,He.drop=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,(t=r||t===e?1:pa(t))<0?0:t,o):[]},He.dropRight=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,0,(t=o-(t=r||t===e?1:pa(t)))<0?0:t):[]},He.dropRightWhile=function(n,t){return n&&n.length?po(n,si(t,3),!0,!0):[]},He.dropWhile=function(n,t){return n&&n.length?po(n,si(t,3),!0):[]},He.fill=function(n,t,r,o){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&_i(n,t,r)&&(r=0,o=i),function(n,t,r,o){var i=n.length;for((r=pa(r))<0&&(r=-r>i?0:i+r),(o=o===e||o>i?i:pa(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)n[r++]=t;return n}(n,t,r,o)):[]},He.filter=function(n,t){return(Uu(n)?Pt:yr)(n,si(t,3))},He.flatMap=function(n,t){return mr(Su(n,t),1)},He.flatMapDeep=function(n,t){return mr(Su(n,t),f)},He.flatMapDepth=function(n,t,r){return r=r===e?1:pa(r),mr(Su(n,t),r)},He.flatten=Fi,He.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,f):[]},He.flattenDepth=function(n,t){return(null==n?0:n.length)?mr(n,t=t===e?1:pa(t)):[]},He.flip=function(n){return Jo(n,512)},He.flow=ec,He.flowRight=rc,He.fromPairs=function(n){for(var t=-1,e=null==n?0:n.length,r={};++t<e;){var o=n[t];r[o[0]]=o[1]}return r},He.functions=function(n){return null==n?[]:Er(n,Pa(n))},He.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},He.groupBy=_u,He.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},He.intersection=$i,He.intersectionBy=Gi,He.intersectionWith=qi,He.invert=Oa,He.invertBy=ja,He.invokeMap=xu,He.iteratee=ic,He.keyBy=Eu,He.keys=Pa,He.keysIn=Aa,He.map=Su,He.mapKeys=function(n,t){var e={};return t=si(t,3),_r(n,(function(n,r,o){ur(e,t(n,r,o),n)})),e},He.mapValues=function(n,t){var e={};return t=si(t,3),_r(n,(function(n,r,o){ur(e,r,t(n,r,o))})),e},He.matches=function(n){return Hr(lr(n,1))},He.matchesProperty=function(n,t){return Yr(n,lr(t,1))},He.memoize=Lu,He.merge=za,He.mergeWith=La,He.method=uc,He.methodOf=ac,He.mixin=cc,He.negate=Tu,He.nthArg=function(n){return n=pa(n),Kr((function(t){return Xr(t,n)}))},He.omit=Ta,He.omitBy=function(n,t){return Da(n,Tu(si(t)))},He.once=function(n){return Ou(2,n)},He.orderBy=function(n,t,r,o){return null==n?[]:(Uu(t)||(t=null==t?[]:[t]),Uu(r=o?e:r)||(r=null==r?[]:[r]),Ur(n,t,r))},He.over=sc,He.overArgs=Bu,He.overEvery=fc,He.overSome=dc,He.partial=Du,He.partialRight=Ru,He.partition=ku,He.pick=Ba,He.pickBy=Da,He.property=hc,He.propertyOf=function(n){return function(t){return null==n?e:Sr(n,t)}},He.pull=Qi,He.pullAll=Ji,He.pullAllBy=function(n,t,e){return n&&n.length&&t&&t.length?Wr(n,t,si(e,2)):n},He.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Wr(n,t,e,r):n},He.pullAt=nu,He.range=vc,He.rangeRight=pc,He.rearg=Vu,He.reject=function(n,t){return(Uu(n)?Pt:yr)(n,Tu(si(t,3)))},He.remove=function(n,t){var e=[];if(!n||!n.length)return e;var r=-1,o=[],i=n.length;for(t=si(t,3);++r<i;){var u=n[r];t(u,r,n)&&(e.push(u),o.push(r))}return $r(n,o),e},He.rest=function(n,t){if("function"!=typeof n)throw new In(r);return Kr(n,t=t===e?t:pa(t))},He.reverse=tu,He.sampleSize=function(n,t,r){return t=(r?_i(n,t,r):t===e)?1:pa(t),(Uu(n)?Je:Jr)(n,t)},He.set=function(n,t,e){return null==n?n:no(n,t,e)},He.setWith=function(n,t,r,o){return o="function"==typeof o?o:e,null==n?n:no(n,t,r,o)},He.shuffle=function(n){return(Uu(n)?nr:ro)(n)},He.slice=function(n,t,r){var o=null==n?0:n.length;return o?(r&&"number"!=typeof r&&_i(n,t,r)?(t=0,r=o):(t=null==t?0:pa(t),r=r===e?o:pa(r)),oo(n,t,r)):[]},He.sortBy=Cu,He.sortedUniq=function(n){return n&&n.length?co(n):[]},He.sortedUniqBy=function(n,t){return n&&n.length?co(n,si(t,2)):[]},He.split=function(n,t,r){return r&&"number"!=typeof r&&_i(n,t,r)&&(t=r=e),(r=r===e?v:r>>>0)?(n=wa(n))&&("string"==typeof t||null!=t&&!ua(t))&&!(t=so(t))&&ae(n)?Eo(ve(n),0,r):n.split(t,r):[]},He.spread=function(n,t){if("function"!=typeof n)throw new In(r);return t=null==t?0:we(pa(t),0),Kr((function(e){var r=e[t],o=Eo(e,0,t);return r&&Tt(o,r),Nt(n,this,o)}))},He.tail=function(n){var t=null==n?0:n.length;return t?oo(n,1,t):[]},He.take=function(n,t,r){return n&&n.length?oo(n,0,(t=r||t===e?1:pa(t))<0?0:t):[]},He.takeRight=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,(t=o-(t=r||t===e?1:pa(t)))<0?0:t,o):[]},He.takeRightWhile=function(n,t){return n&&n.length?po(n,si(t,3),!1,!0):[]},He.takeWhile=function(n,t){return n&&n.length?po(n,si(t,3)):[]},He.tap=function(n,t){return t(n),n},He.throttle=function(n,t,e){var o=!0,i=!0;if("function"!=typeof n)throw new In(r);return ta(e)&&(o="leading"in e?!!e.leading:o,i="trailing"in e?!!e.trailing:i),Pu(n,t,{leading:o,maxWait:t,trailing:i})},He.thru=vu,He.toArray=ha,He.toPairs=Ra,He.toPairsIn=Va,He.toPath=function(n){return Uu(n)?Lt(n,Di):la(n)?[n]:Io(Bi(wa(n)))},He.toPlainObject=ma,He.transform=function(n,t,e){var r=Uu(n),o=r||Gu(n)||sa(n);if(t=si(t,4),null==e){var i=n&&n.constructor;e=o?r?new i:[]:ta(n)&&Qu(i)?Ye($n(n)):{}}return(o?Ot:_r)(n,(function(n,r,o){return t(e,n,r,o)})),e},He.unary=function(n){return Mu(n,1)},He.union=eu,He.unionBy=ru,He.unionWith=ou,He.uniq=function(n){return n&&n.length?fo(n):[]},He.uniqBy=function(n,t){return n&&n.length?fo(n,si(t,2)):[]},He.uniqWith=function(n,t){return t="function"==typeof t?t:e,n&&n.length?fo(n,e,t):[]},He.unset=function(n,t){return null==n||ho(n,t)},He.unzip=iu,He.unzipWith=uu,He.update=function(n,t,e){return null==n?n:vo(n,t,bo(e))},He.updateWith=function(n,t,r,o){return o="function"==typeof o?o:e,null==n?n:vo(n,t,bo(r),o)},He.values=Ha,He.valuesIn=function(n){return null==n?[]:ne(n,Aa(n))},He.without=au,He.words=Qa,He.wrap=function(n,t){return Du(bo(t),n)},He.xor=cu,He.xorBy=lu,He.xorWith=su,He.zip=fu,He.zipObject=function(n,t){return mo(n||[],t||[],er)},He.zipObjectDeep=function(n,t){return mo(n||[],t||[],no)},He.zipWith=du,He.entries=Ra,He.entriesIn=Va,He.extend=_a,He.extendWith=xa,cc(He,He),He.add=mc,He.attempt=Ja,He.camelCase=Ya,He.capitalize=Za,He.ceil=wc,He.clamp=function(n,t,r){return r===e&&(r=t,t=e),r!==e&&(r=(r=ya(r))==r?r:0),t!==e&&(t=(t=ya(t))==t?t:0),cr(ya(n),t,r)},He.clone=function(n){return lr(n,4)},He.cloneDeep=function(n){return lr(n,5)},He.cloneDeepWith=function(n,t){return lr(n,5,t="function"==typeof t?t:e)},He.cloneWith=function(n,t){return lr(n,4,t="function"==typeof t?t:e)},He.conformsTo=function(n,t){return null==t||sr(n,t,Pa(t))},He.deburr=Xa,He.defaultTo=function(n,t){return null==n||n!=n?t:n},He.divide=bc,He.endsWith=function(n,t,r){n=wa(n),t=so(t);var o=n.length,i=r=r===e?o:cr(pa(r),0,o);return(r-=t.length)>=0&&n.slice(r,i)==t},He.eq=Hu,He.escape=function(n){return(n=wa(n))&&q.test(n)?n.replace($,ie):n},He.escapeRegExp=function(n){return(n=wa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},He.every=function(n,t,r){var o=Uu(n)?It:pr;return r&&_i(n,t,r)&&(t=e),o(n,si(t,3))},He.find=yu,He.findIndex=Xi,He.findKey=function(n,t){return Ht(n,si(t,3),_r)},He.findLast=mu,He.findLastIndex=Ui,He.findLastKey=function(n,t){return Ht(n,si(t,3),xr)},He.floor=_c,He.forEach=wu,He.forEachRight=bu,He.forIn=function(n,t){return null==n?n:wr(n,si(t,3),Aa)},He.forInRight=function(n,t){return null==n?n:br(n,si(t,3),Aa)},He.forOwn=function(n,t){return n&&_r(n,si(t,3))},He.forOwnRight=function(n,t){return n&&xr(n,si(t,3))},He.get=Na,He.gt=Yu,He.gte=Zu,He.has=function(n,t){return null!=n&&yi(n,t,Mr)},He.hasIn=Ma,He.head=Wi,He.identity=oc,He.includes=function(n,t,e,r){n=Wu(n)?n:Ha(n),e=e&&!r?pa(e):0;var o=n.length;return e<0&&(e=we(o+e,0)),ca(n)?e<=o&&n.indexOf(t,e)>-1:!!o&&Zt(n,t,e)>-1},He.indexOf=function(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var o=null==e?0:pa(e);return o<0&&(o=we(r+o,0)),Zt(n,t,o)},He.inRange=function(n,t,r){return t=va(t),r===e?(r=t,t=0):r=va(r),function(n,t,e){return n>=be(t,e)&&n<we(t,e)}(n=ya(n),t,r)},He.invoke=Ia,He.isArguments=Xu,He.isArray=Uu,He.isArrayBuffer=Fu,He.isArrayLike=Wu,He.isArrayLikeObject=$u,He.isBoolean=function(n){return!0===n||!1===n||ea(n)&&Cr(n)==m},He.isBuffer=Gu,He.isDate=qu,He.isElement=function(n){return ea(n)&&1===n.nodeType&&!ia(n)},He.isEmpty=function(n){if(null==n)return!0;if(Wu(n)&&(Uu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Xu(n)))return!n.length;var t=gi(n);if(t==S||t==O)return!n.size;if(ki(n))return!Br(n).length;for(var e in n)if(Bn.call(n,e))return!1;return!0},He.isEqual=function(n,t){return Ar(n,t)},He.isEqualWith=function(n,t,r){var o=(r="function"==typeof r?r:e)?r(n,t):e;return o===e?Ar(n,t,e,r):!!o},He.isError=Ku,He.isFinite=function(n){return"number"==typeof n&&Vt(n)},He.isFunction=Qu,He.isInteger=Ju,He.isLength=na,He.isMap=ra,He.isMatch=function(n,t){return n===t||zr(n,t,di(t))},He.isMatchWith=function(n,t,r){return r="function"==typeof r?r:e,zr(n,t,di(t),r)},He.isNaN=function(n){return oa(n)&&n!=+n},He.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},He.isNil=function(n){return null==n},He.isNull=function(n){return null===n},He.isNumber=oa,He.isObject=ta,He.isObjectLike=ea,He.isPlainObject=ia,He.isRegExp=ua,He.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=d},He.isSet=aa,He.isString=ca,He.isSymbol=la,He.isTypedArray=sa,He.isUndefined=function(n){return n===e},He.isWeakMap=function(n){return ea(n)&&gi(n)==P},He.isWeakSet=function(n){return ea(n)&&"[object WeakSet]"==Cr(n)},He.join=function(n,t){return null==n?"":$t.call(n,t)},He.kebabCase=Ua,He.last=Ki,He.lastIndexOf=function(n,t,r){var o=null==n?0:n.length;if(!o)return-1;var i=o;return r!==e&&(i=(i=pa(r))<0?we(o+i,0):be(i,o-1)),t==t?function(n,t,e){for(var r=e+1;r--;)if(n[r]===t)return r;return r}(n,t,i):Yt(n,Ut,i,!0)},He.lowerCase=Fa,He.lowerFirst=Wa,He.lt=fa,He.lte=da,He.max=function(n){return n&&n.length?gr(n,oc,Nr):e},He.maxBy=function(n,t){return n&&n.length?gr(n,si(t,2),Nr):e},He.mean=function(n){return Ft(n,oc)},He.meanBy=function(n,t){return Ft(n,si(t,2))},He.min=function(n){return n&&n.length?gr(n,oc,Rr):e},He.minBy=function(n,t){return n&&n.length?gr(n,si(t,2),Rr):e},He.stubArray=gc,He.stubFalse=yc,He.stubObject=function(){return{}},He.stubString=function(){return""},He.stubTrue=function(){return!0},He.multiply=Ec,He.nth=function(n,t){return n&&n.length?Xr(n,pa(t)):e},He.noConflict=function(){return pt._===this&&(pt._=Yn),this},He.noop=lc,He.now=Nu,He.pad=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;if(!t||r>=t)return n;var o=(t-r)/2;return Fo(yt(o),e)+n+Fo(gt(o),e)},He.padEnd=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;return t&&r<t?n+Fo(t-r,e):n},He.padStart=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;return t&&r<t?Fo(t-r,e)+n:n},He.parseInt=function(n,t,e){return e||null==t?t=0:t&&(t=+t),xe(wa(n).replace(un,""),t||0)},He.random=function(n,t,r){if(r&&"boolean"!=typeof r&&_i(n,t,r)&&(t=r=e),r===e&&("boolean"==typeof t?(r=t,t=e):"boolean"==typeof n&&(r=n,n=e)),n===e&&t===e?(n=0,t=1):(n=va(n),t===e?(t=n,n=0):t=va(t)),n>t){var o=n;n=t,t=o}if(r||n%1||t%1){var i=Ee();return be(n+i*(t-n+ft("1e-"+((i+"").length-1))),t)}return Gr(n,t)},He.reduce=function(n,t,e){var r=Uu(n)?Bt:Gt,o=arguments.length<3;return r(n,si(t,4),e,o,hr)},He.reduceRight=function(n,t,e){var r=Uu(n)?Dt:Gt,o=arguments.length<3;return r(n,si(t,4),e,o,vr)},He.repeat=function(n,t,r){return t=(r?_i(n,t,r):t===e)?1:pa(t),qr(wa(n),t)},He.replace=function(){var n=arguments,t=wa(n[0]);return n.length<3?t:t.replace(n[1],n[2])},He.result=function(n,t,r){var o=-1,i=(t=_o(t,n)).length;for(i||(i=1,n=e);++o<i;){var u=null==n?e:n[Di(t[o])];u===e&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},He.round=Sc,He.runInContext=n,He.sample=function(n){return(Uu(n)?Qe:Qr)(n)},He.size=function(n){if(null==n)return 0;if(Wu(n))return ca(n)?he(n):n.length;var t=gi(n);return t==S||t==O?n.size:Br(n).length},He.snakeCase=$a,He.some=function(n,t,r){var o=Uu(n)?Rt:io;return r&&_i(n,t,r)&&(t=e),o(n,si(t,3))},He.sortedIndex=function(n,t){return uo(n,t)},He.sortedIndexBy=function(n,t,e){return ao(n,t,si(e,2))},He.sortedIndexOf=function(n,t){var e=null==n?0:n.length;if(e){var r=uo(n,t);if(r<e&&Hu(n[r],t))return r}return-1},He.sortedLastIndex=function(n,t){return uo(n,t,!0)},He.sortedLastIndexBy=function(n,t,e){return ao(n,t,si(e,2),!0)},He.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var e=uo(n,t,!0)-1;if(Hu(n[e],t))return e}return-1},He.startCase=Ga,He.startsWith=function(n,t,e){return n=wa(n),e=null==e?0:cr(pa(e),0,n.length),t=so(t),n.slice(e,e+t.length)==t},He.subtract=kc,He.sum=function(n){return n&&n.length?qt(n,oc):0},He.sumBy=function(n,t){return n&&n.length?qt(n,si(t,2)):0},He.template=function(n,t,r){var o=He.templateSettings;r&&_i(n,t,r)&&(t=e),n=wa(n),t=xa({},t,o,ni);var i,u,a=xa({},t.imports,o.imports,ni),c=Pa(a),l=ne(a,c),s=0,f=t.interpolate||xn,d="__p += '",h=On((t.escape||xn).source+"|"+f.source+"|"+(f===J?vn:xn).source+"|"+(t.evaluate||xn).source+"|$","g"),v="//# sourceURL="+(Bn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";n.replace(h,(function(t,e,r,o,a,c){return r||(r=o),d+=n.slice(s,c).replace(En,ue),e&&(i=!0,d+="' +\n__e("+e+") +\n'"),a&&(u=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t})),d+="';\n";var p=Bn.call(t,"variable")&&t.variable;if(p){if(dn.test(p))throw new kn("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(u?d.replace(X,""):d).replace(U,"$1").replace(F,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Cn(c,v+"return "+d).apply(e,l)}));if(g.source=d,Ku(g))throw g;return g},He.times=function(n,t){if((n=pa(n))<1||n>d)return[];var e=v,r=be(n,v);t=si(t),n-=v;for(var o=Kt(r,t);++e<n;)t(e);return o},He.toFinite=va,He.toInteger=pa,He.toLength=ga,He.toLower=function(n){return wa(n).toLowerCase()},He.toNumber=ya,He.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,d):0===n?n:0},He.toString=wa,He.toUpper=function(n){return wa(n).toUpperCase()},He.trim=function(n,t,r){if((n=wa(n))&&(r||t===e))return Qt(n);if(!n||!(t=so(t)))return n;var o=ve(n),i=ve(t);return Eo(o,ee(o,i),re(o,i)+1).join("")},He.trimEnd=function(n,t,r){if((n=wa(n))&&(r||t===e))return n.slice(0,pe(n)+1);if(!n||!(t=so(t)))return n;var o=ve(n);return Eo(o,0,re(o,ve(t))+1).join("")},He.trimStart=function(n,t,r){if((n=wa(n))&&(r||t===e))return n.replace(un,"");if(!n||!(t=so(t)))return n;var o=ve(n);return Eo(o,ee(o,ve(t))).join("")},He.truncate=function(n,t){var r=30,o="...";if(ta(t)){var i="separator"in t?t.separator:i;r="length"in t?pa(t.length):r,o="omission"in t?so(t.omission):o}var u=(n=wa(n)).length;if(ae(n)){var a=ve(n);u=a.length}if(r>=u)return n;var c=r-he(o);if(c<1)return o;var l=a?Eo(a,0,c).join(""):n.slice(0,c);if(i===e)return l+o;if(a&&(c+=l.length-c),ua(i)){if(n.slice(c).search(i)){var s,f=l;for(i.global||(i=On(i.source,wa(pn.exec(i))+"g")),i.lastIndex=0;s=i.exec(f);)var d=s.index;l=l.slice(0,d===e?c:d)}}else if(n.indexOf(so(i),c)!=c){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},He.unescape=function(n){return(n=wa(n))&&G.test(n)?n.replace(W,ge):n},He.uniqueId=function(n){var t=++Dn;return wa(n)+t},He.upperCase=qa,He.upperFirst=Ka,He.each=wu,He.eachRight=bu,He.first=Wi,cc(He,(xc={},_r(He,(function(n,t){Bn.call(He.prototype,t)||(xc[t]=n)})),xc),{chain:!1}),He.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){He[n].placeholder=He})),Ot(["drop","take"],(function(n,t){Ue.prototype[n]=function(r){r=r===e?1:we(pa(r),0);var o=this.__filtered__&&!t?new Ue(this):this.clone();return o.__filtered__?o.__takeCount__=be(r,o.__takeCount__):o.__views__.push({size:be(r,v),type:n+(o.__dir__<0?"Right":"")}),o},Ue.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(n,t){var e=t+1,r=1==e||3==e;Ue.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:si(n,3),type:e}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(n,t){var e="take"+(t?"Right":"");Ue.prototype[n]=function(){return this[e](1).value()[0]}})),Ot(["initial","tail"],(function(n,t){var e="drop"+(t?"":"Right");Ue.prototype[n]=function(){return this.__filtered__?new Ue(this):this[e](1)}})),Ue.prototype.compact=function(){return this.filter(oc)},Ue.prototype.find=function(n){return this.filter(n).head()},Ue.prototype.findLast=function(n){return this.reverse().find(n)},Ue.prototype.invokeMap=Kr((function(n,t){return"function"==typeof n?new Ue(this):this.map((function(e){return Ir(e,n,t)}))})),Ue.prototype.reject=function(n){return this.filter(Tu(si(n)))},Ue.prototype.slice=function(n,t){n=pa(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ue(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==e&&(r=(t=pa(t))<0?r.dropRight(-t):r.take(t-n)),r)},Ue.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ue.prototype.toArray=function(){return this.take(v)},_r(Ue.prototype,(function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=He[o?"take"+("last"==t?"Right":""):t],u=o||/^find/.test(t);i&&(He.prototype[t]=function(){var t=this.__wrapped__,a=o?[1]:arguments,c=t instanceof Ue,l=a[0],s=c||Uu(t),f=function(n){var t=i.apply(He,Tt([n],a));return o&&d?t[0]:t};s&&r&&"function"==typeof l&&1!=l.length&&(c=s=!1);var d=this.__chain__,h=!!this.__actions__.length,v=u&&!d,p=c&&!h;if(!u&&s){t=p?t:new Ue(this);var g=n.apply(t,a);return g.__actions__.push({func:vu,args:[f],thisArg:e}),new Xe(g,d)}return v&&p?n.apply(this,a):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(n){var t=Pn[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);He.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Uu(o)?o:[],n)}return this[e]((function(e){return t.apply(Uu(e)?e:[],n)}))}})),_r(Ue.prototype,(function(n,t){var e=He[t];if(e){var r=e.name+"";Bn.call(Pe,r)||(Pe[r]=[]),Pe[r].push({name:t,func:e})}})),Pe[Yo(e,2).name]=[{name:"wrapper",func:e}],Ue.prototype.clone=function(){var n=new Ue(this.__wrapped__);return n.__actions__=Io(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Io(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Io(this.__views__),n},Ue.prototype.reverse=function(){if(this.__filtered__){var n=new Ue(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ue.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,e=Uu(n),r=t<0,o=e?n.length:0,i=function(n,t,e){var r=-1,o=e.length;for(;++r<o;){var i=e[r],u=i.size;switch(i.type){case"drop":n+=u;break;case"dropRight":t-=u;break;case"take":t=be(t,n+u);break;case"takeRight":n=we(n,t-u)}}return{start:n,end:t}}(0,o,this.__views__),u=i.start,a=i.end,c=a-u,l=r?a:u-1,s=this.__iteratees__,f=s.length,d=0,h=be(c,this.__takeCount__);if(!e||!r&&o==c&&h==c)return go(n,this.__actions__);var v=[];n:for(;c--&&d<h;){for(var p=-1,g=n[l+=t];++p<f;){var y=s[p],m=y.iteratee,w=y.type,b=m(g);if(2==w)g=b;else if(!b){if(1==w)continue n;break n}}v[d++]=g}return v},He.prototype.at=pu,He.prototype.chain=function(){return hu(this)},He.prototype.commit=function(){return new Xe(this.value(),this.__chain__)},He.prototype.next=function(){this.__values__===e&&(this.__values__=ha(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?e:this.__values__[this.__index__++]}},He.prototype.plant=function(n){for(var t,r=this;r instanceof Ze;){var o=Vi(r);o.__index__=0,o.__values__=e,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,t},He.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ue){var t=n;return this.__actions__.length&&(t=new Ue(this)),(t=t.reverse()).__actions__.push({func:vu,args:[tu],thisArg:e}),new Xe(t,this.__chain__)}return this.thru(tu)},He.prototype.toJSON=He.prototype.valueOf=He.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},He.prototype.first=He.prototype.head,Jn&&(He.prototype[Jn]=function(){return this}),He}();yt?((yt.exports=ye)._=ye,gt._=ye):pt._=ye}).call(w)}(lE,lE.exports);var sE=b(lE.exports);function fE(n){var t=n.layoutTypes,e=n.layoutConfig,r=void 0===e?uE:e,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=t[null==r?void 0:r.type]||cE[null==r?void 0:r.type];return function(n){return n.every((function(n){var t,e;return(null===(t=n.measured)||void 0===t?void 0:t.width)&&(null===(e=n.measured)||void 0===e?void 0:e.height)}))}(u)&&c?function(n){var t=n.layoutConfig,e=void 0===t?uE:t,r=n.edges,o=n.nodeOrigin,i=n.nodes,u=n.container,a=n.layoutFn,c=sE.cloneDeep(i);c.forEach((function(n){n.data&&(n.data.width=n.measured.width,n.data.height=n.measured.height)}));var l=a(c,r,d({nodeOrigin:o,width:u.width,height:u.height},null==e?void 0:e.options)),s=l.nodes,f=l.edges;return{nodes:s,edges:f,layoutComplete:!0}}({layoutConfig:r,container:a,nodeOrigin:i,nodes:u,layoutFn:c,edges:o}):{nodes:u,edges:o,layoutComplete:!1}}function dE(n){var t=n.centerConfig,e=n.width,r=n.height,o=n.transform,i=n.panZoom,u=n.nodeOrigin,a=n.nodes;if(t&&i){var c=a.find((function(n){return n.id===t.centerNodeId}));return c?(function(n){var t=n.node,e=n.height,r=n.width,o=n.zoom,i=void 0===o?1:o,u=n.panZoom,a=n.nodeOrigin,c=zb(t),l=Mb(t,a).positionAbsolute,s={x:r/2-(l.x+c.width/2)*i,y:e/2-(l.y+c.height/2)*i};u.setViewport({x:s.x,y:s.y,zoom:i})}({node:c,width:e,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0):(t.centerByBBox&&function(n){var t=n.nodes,e=n.nodeOrigin,r=n.height,o=n.width,i=n.zoom,u=void 0===i?1:i,a=n.panZoom,c=m_(t,{nodeOrigin:e}),l={x:o/2-(c.x+c.width/2)*u,y:r/2-(c.y+c.height/2)*u};a.setViewport({x:l.x,y:l.y,zoom:u})}({nodes:a,width:e,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var hE=function(n){var t,e,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return t=function(n,t){return d(d({},aE({nodes:r,edges:o,width:a,height:c,fitView:l,defaultNodes:i,defaultEdges:u})),{setNodes:function(t){n({nodes:t})},setEdges:function(t){n({edges:t})},setDefaultNodesAndEdges:function(e,r){e&&((0,t().onNodesChange)({changes:[],userNodes:e}),n({hasDefaultNodes:!0})),r&&((0,t().onEdgesChange)({userEdges:r}),n({hasDefaultEdges:!0}))},updateNodeInternals:function(e){var r=t(),o=r.triggerNodeChanges,i=r.nodeLookup,u=r.parentLookup,a=r.domNode,c=r.nodeOrigin,l=r.debug,s=function(n,t,e,r,o){var i=null==r?void 0:r.querySelector(".xyflow__viewport"),u=!1;if(!i)return{changes:[],updatedInternals:u};var a=[],c=window.getComputedStyle(i),l=new window.DOMMatrixReadOnly(c.transform).m22,s=[];if(n.forEach((function(n){var e=t.get(n.id);if(null==e?void 0:e.hidden)t.set(e.id,d(d({},e),{internals:d(d({},e.internals),{handleBounds:void 0})})),u=!0;else if(e){var r=qb(n.nodeElement),i=e.measured.width!==r.width||e.measured.height!==r.height;if(r.width&&r.height&&(i||!e.internals.handleBounds||n.force)){var c=d(d({},e),{measured:r,internals:d(d({},e.internals),{handleBounds:{source:t_(".source",n.nodeElement,l,e.origin||o),target:t_(".target",n.nodeElement,l,e.origin||o)}})});t.set(e.id,c),u=!0,i&&(a.push({id:c.id,type:"dimensions",dimensions:r}),c.expandParent&&c.parentId&&s.push({id:c.id,parentId:c.parentId,rect:Db(c,c.origin||o)}))}}})),s.length>0){var f=Ib(s,t,e,o);a.push.apply(a,m([],y(f),!1))}return{changes:a,updatedInternals:u}}(e,i,u,a,c),f=s.changes;if(s.updatedInternals){var h=sE.cloneDeep(i);n({nodeLookup:h}),Cb(i,{nodeOrigin:c}),(null==f?void 0:f.length)>0&&(l&&console.log("Ink Flow: trigger node changes",f),null==o||o(f))}},updateNodePositions:function(n,e){var r,o;void 0===e&&(e=!1);var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=y(c.value,2),s=l[0],f=l[1],h={id:s,type:"position",position:f.position,dragging:e};(null==f?void 0:f.expandParent)&&(null==f?void 0:f.parentId)&&h.position&&(i.push({id:s,parentId:f.parentId,rect:d(d({},f.internals.positionAbsolute),{width:f.measured.width,height:f.measured.height})}),h.position.x=Math.max(0,h.position.x),h.position.y=Math.max(0,h.position.y)),u.push(h)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}if(i.length>0){var v=t(),p=Ib(i,v.nodeLookup,v.parentLookup);u.push.apply(u,m([],y(p),!1))}t().triggerNodeChanges(u)},triggerNodeChanges:function(n){var e=t(),r=e.onNodesChange,o=e.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger node changes",n),r({changes:n}))},triggerEdgeChanges:function(n){var e=t(),r=e.onEdgesChange,o=e.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger edge changes",n),null==r||r({changes:n}))},addSelectedNodes:function(n){var e=t(),r=e.multiSelectionActive,o=e.edgeLookup,i=e.nodeLookup,u=e.triggerNodeChanges,a=e.triggerEdgeChanges;r?u(n.map((function(n){return h_(n,!0)}))):(u(v_(i,new Set(m([],y(n),!1)),!0)),a(v_(o)))},addSelectedEdges:function(n){var e=t(),r=e.multiSelectionActive,o=e.edgeLookup,i=e.nodeLookup,u=e.triggerNodeChanges,a=e.triggerEdgeChanges;r?a(n.map((function(n){return h_(n,!0)}))):(a(v_(o,new Set(m([],y(n),!1)))),u(v_(i,new Set,!0)))},unselectNodesAndEdges:function(n){var e=void 0===n?{}:n,r=e.nodes,o=e.edges,i=t(),u=i.edges,a=i.nodes,c=i.triggerNodeChanges,l=i.triggerEdgeChanges,s=o||u,f=(r||a).map((function(n){return n.selected=!1,h_(n.id,!1)})),d=s.map((function(n){return h_(n.id,!1)}));c(f),l(d)},setMinZoom:function(e){var r=t(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([e,i]),n({minZoom:e})},setMaxZoom:function(e){var r=t(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,e]),n({maxZoom:e})},setTranslateExtent:function(e){var r;null===(r=t().panZoom)||void 0===r||r.setTranslateExtent(e),n({translateExtent:e})},resetSelectedElements:function(){var n=t(),e=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,u=r.reduce((function(n,t){return t.selected?m(m([],y(n),!1),[h_(t.id,!1)],!1):n}),[]),a=e.reduce((function(n,t){return t.selected?m(m([],y(n),!1),[h_(t.id,!1)],!1):n}),[]);o(u),i(a)},setNodeExtent:function(e){var r,o,i=t().nodeLookup;try{for(var u=g(i),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=Ab(c.position,e);i.set(c.id,d(d({},c),{internals:d(d({},c.internals),{positionAbsolute:l})}))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}n({nodeExtent:e})},panBy:function(n){var e=t(),r=e.transform,o=e.width,i=e.height;return function(n){var t=n.delta,e=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,u=n.height;if(!e||!t.x&&!t.y)return!1;var a=e.setViewportConstrained({x:r[0]+t.x,y:r[1]+t.y,zoom:r[2]},[[0,0],[i,u]],o);return!!a&&(a.x!==r[0]||a.y!==r[1]||a.k!==r[2])}({delta:n,panZoom:e.panZoom,transform:r,translateExtent:e.translateExtent,width:o,height:i})},cancelConnection:function(){return n({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(e){var r,o=t().connectionPosition,i=d(d({},e),{connectionPosition:null!==(r=e.connectionPosition)&&void 0!==r?r:o});n(i)},reset:function(){return n(d({},aE()))},updateLayout:function(e){var r,o=e.config,i=e.nodes,u=e.force,a=t(),c=a.width,l=a.height,s=a.edges,f=a.layoutTypes,d=a.layoutConfig,h=a.panZoom,v=a.nodeOrigin,p=a.nodeLookup,g=a.parentLookup,y=a.elevateNodesOnSelect,m=a.nodes,w=a.fitViewOnInit,b=a.minZoom,_=a.maxZoom,x=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,N=a.centered,M=a.layoutAnchorId,O=i||Array.from(p.values());if(O.length){var j=O.find((function(n){return n.id===M})),I=fE({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||uE});if(I.layoutComplete&&(jb(I.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:I.layoutComplete}),h&&I.layoutComplete&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){if(M&&j){var P=I.nodes.find((function(n){return n.id===M}));if(!P)return;return function(n){var t=n.position,e=n.targetPosition,r=n.panZoom,o=n.transform,i=o[2],u=(e.x-t.x)*i,a=(e.y-t.y)*i;r.setViewport({x:o[0]+u,y:o[1]+a,zoom:i})}({targetPosition:Mb(j,v).position,panZoom:h,position:Mb(P,v).position,transform:E}),void n({layoutAnchorId:void 0})}if(u||!(k||N||C))if(d.offsetConfig){var A=function(n){var t=n.offsetConfig,e=n.width,r=n.height,o=n.panZoom,i=n.nodeOrigin,u=n.nodes,a=n.layoutDirection,c=u.find((function(n){return n.id===(null==t?void 0:t.nodeId)}));if(!a||!c)return!1;var l=y_(c,i).positionAbsolute,s=zb(c),f=e/2,d=r/2,h={x:0,y:0};switch(a){case"BT":h={x:f-l.x-s.width/2,y:r-l.y-t.offset-s.height};break;case"LR":h={x:t.offset-l.x,y:d-l.y-s.height/2};break;case"RL":h={x:e-l.x-t.offset-s.width,y:d-l.y-s.height/2};break;default:h={x:f-l.x-s.width/2,y:t.offset-l.y}}return o.setViewport({x:h.x,y:h.y,zoom:1}),!0}({offsetConfig:d.offsetConfig,width:c,height:l,nodes:Array.from(p.values()),nodeOrigin:v,transform:E,panZoom:h,layoutDirection:null===(r=d.options)||void 0===r?void 0:r.rankdir});n({offsetDone:A})}else{if(w)return b_({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:w,minZoom:b,maxZoom:_,fitViewOnInitOptions:x,nodeLookup:p}),void n({fitViewDone:!0});S&&(dE({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var e=n.changes,r=n.userNodes;if(e||r){var o=t(),i=o.setNodes,u=o.nodeLookup,a=o.parentLookup,c=o.elevateNodesOnSelect,l=o.nodeOrigin,s=o.nodes,f=o.autoLayout,h=o.updateLayout,v=!(null==e?void 0:e.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(e||[]),g=[];g=v?(r||[]).map((function(n){var t=u.get(n.id),e=d(d({},t||{}),n);return(null==t?void 0:t.position)&&(e.position=t.position),e})):function(n,t){return d_(n,t)}(e,Array.from(u.values())),!v&&p||jb(g,u,a,{nodeOrigin:l,elevateNodesOnSelect:c,checkEquality:!0}),f&&(p||r&&r!==s)&&h({nodes:v?Array.from(u.values()):g}),i(r||s)}},onEdgesChange:function(n){var e=n.changes,r=void 0===e?[]:e,o=n.userEdges,i=t(),u=i.connectionLookup,a=i.edgeLookup,c=i.setEdges,l=i.edges,s=!(null==r?void 0:r.length),f=[];f=s?o.map((function(n){var t=a.get(n.id)||{};return d(d({},t),n)})):function(n,t){return d_(n,t)}(r,Array.from(a.values())),Ob(u,a,f),o&&c(s?o||[]:l)},updateLayoutConfig:function(e){var r=t(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;sE.isEqual(e,u)||(n({layoutConfig:e}),o&&i({config:e,force:!0}))},setLayoutAnchorId:function(t){n({layoutAnchorId:t})}})},e=Object.is,t?Y(t,e):Y};function vE(n){var t=n.initialNodes,e=n.initialEdges,r=n.defaultNodes,o=n.defaultEdges,u=n.initialWidth,a=n.initialHeight,c=n.fitView,l=n.children,s=y(i((function(){return hE({nodes:t,edges:e,defaultNodes:r,defaultEdges:o,width:u,height:a,fitView:c})})),1)[0];return k.jsx(X,{value:s,children:k.jsx(T_,{children:l})})}function pE(n){var t=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return e(Z)?k.jsx(k.Fragment,{children:t}):k.jsx(vE,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:t})}var gE=m(m([],y(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions","nodeOrigin","autoLayout","centerConfig","layoutTypes"]),!1),["rfId"],!1),yE=function(n){return{setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,onNodesChange:n.onNodesChange,onEdgesChange:n.onEdgesChange,updateLayoutConfig:n.updateLayoutConfig}},mE={translateExtent:Nv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wE(n){var t=Sb(yE,u_),e=t.setMinZoom,r=t.setMaxZoom,o=t.setTranslateExtent,i=t.setNodeExtent,c=t.reset,l=t.setDefaultNodesAndEdges,s=t.onNodesChange,f=t.onEdgesChange,h=t.updateLayoutConfig,v=kb();a((function(){return l(n.defaultNodes,n.defaultEdges),function(){p.current=mE,c()}}),[]);var p=u(mE);return a((function(){var t,u,a,c;try{for(var l=g(gE),y=l.next();!y.done;y=l.next()){var m=y.value,w=n[m];if(w!==p.current[m]&&void 0!==n[m])if("nodes"===m)s({userNodes:w});else if("edges"===m)f({userEdges:w});else if("minZoom"===m)e(w);else if("maxZoom"===m)r(w);else if("translateExtent"===m)o(w);else if("nodeExtent"===m)i(w);else if("fitView"===m)v.setState({fitViewOnInit:w});else if("fitViewOptions"===m)v.setState({fitViewOnInitOptions:w});else if("layoutConfig"===m){var b=w||{},_=d(d({},b),{options:d(d({},b.options||{}),{rankdir:(null===(c=b.options)||void 0===c?void 0:c.rankdir)||"TB"})});h(_)}else v.setState(((a={})[m]=w,a))}}catch(n){t={error:n}}finally{try{y&&!y.done&&(u=l.return)&&u.call(l)}finally{if(t)throw t.error}}p.current=n}),gE.map((function(t){return n[t]}))),null}var bE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var _E=Zb((function(n,t){var e=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?Nv:o,u=n.defaultViewport,a=void 0===u?iE:u,c=n.minZoom,l=void 0===c?.5:c,s=n.maxZoom,f=void 0===s?2:s,v=n.defaultMarkerColor,p=void 0===v?"#b1b1b7":v,g=n.nodeOrigin,y=n.noDragClassName,m=n.noPanClassName,w=n.disableKeyboardA11y,b=n.nodeTypes,_=n.edgeTypes;n.connectionMode;var x=n.connectionLineType,E=void 0===x?rp.Bezier:x,S=n.connectionLineStyle,C=n.connectionLineComponent,N=n.connectionLineContainerStyle,M=n.onNodeClick,O=n.onNodeDoubleClick,I=n.onNodeMouseEnter,P=n.onNodeMouseMove,A=n.onNodeMouseLeave,z=n.onNodeContextMenu,L=n.onEdgeClick,T=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,D=n.onEdgeMouseLeave,R=n.onEdgeContextMenu,V=n.onEdgeDoubleClick,H=n.fitView,Y=n.fitViewOptions,Z=n.nodeExtent,X=n.nodesDraggable,U=n.children,F=n.id,W=n.width,$=n.height,G=n.onPaneClick,q=n.onPaneContextMenu,K=n.onPaneMouseEnter,Q=n.onPaneMouseMove,J=n.onPaneMouseLeave,nn=n.onPaneScroll,tn=n.elementsSelectable,en=void 0===tn||tn,rn=n.autoLayout,on=void 0===rn||rn,un=n.layoutConfig,an=void 0===un?uE:un,cn=n.centerConfig,ln=void 0===cn?{}:cn,sn=n.layoutTypes,fn=void 0===sn?{}:sn,dn=h(n,["nodes","edges","translateExtent","defaultViewport","minZoom","maxZoom","defaultMarkerColor","nodeOrigin","noDragClassName","noPanClassName","disableKeyboardA11y","nodeTypes","edgeTypes","connectionMode","connectionLineType","connectionLineStyle","connectionLineComponent","connectionLineContainerStyle","onNodeClick","onNodeDoubleClick","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onEdgeClick","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","onEdgeContextMenu","onEdgeDoubleClick","fitView","fitViewOptions","nodeExtent","nodesDraggable","children","id","width","height","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoLayout","layoutConfig","centerConfig","layoutTypes"]),hn=F||"1";return k.jsx("div",d({},dn,{ref:t,style:d({},bE),className:j(["ink-flow"]),"data-testid":"rf__wrapper",id:F,children:k.jsxs(pE,{nodes:e,edges:r,width:W,height:$,fitView:H,children:[k.jsx(oE,{onNodeClick:M,onNodeMouseEnter:I,onNodeMouseMove:P,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:O,onEdgeClick:L,onEdgeMouseEnter:T,onEdgeMouseMove:B,onEdgeMouseLeave:D,onEdgeContextMenu:R,onEdgeDoubleClick:V,rfId:hn,nodeTypes:b,edgeTypes:_,minZoom:l,maxZoom:f,nodeOrigin:g,noDragClassName:y,noPanClassName:m,disableKeyboardA11y:w,translateExtent:i,defaultMarkerColor:p,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:C,connectionLineContainerStyle:N,defaultViewport:a,onPaneClick:G,onPaneContextMenu:q,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:J,onPaneScroll:nn}),k.jsx(wE,{nodes:e,edges:r,rfId:hn,fitView:H,fitViewOptions:Y,nodeExtent:Z,nodesDraggable:X,elementsSelectable:en,minZoom:l,maxZoom:f,nodeOrigin:g,autoLayout:on,layoutConfig:an,layoutTypes:fn,centerConfig:ln}),U]})}))}));function xE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4.375C10.3452 4.375 10.625 4.65482 10.625 5V9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H10.625V15C10.625 15.3452 10.3452 15.625 10 15.625C9.65482 15.625 9.375 15.3452 9.375 15V10.625H5C4.65482 10.625 4.375 10.3452 4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H9.375V5C9.375 4.65482 9.65482 4.375 10 4.375Z",fill:"#6B7280"})})}function EE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H5C4.65482 10.625 4.375 10.3452 4.375 10Z",fill:"#6B7280"})})}function SE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1.875C10.3452 1.875 10.625 2.15482 10.625 2.5V3.57152C13.6929 3.86613 16.1339 6.30708 16.4285 9.375H17.5C17.8452 9.375 18.125 9.65482 18.125 10C18.125 10.3452 17.8452 10.625 17.5 10.625H16.4285C16.1339 13.6929 13.6929 16.1339 10.625 16.4285V17.5C10.625 17.8452 10.3452 18.125 10 18.125C9.65482 18.125 9.375 17.8452 9.375 17.5V16.4285C6.30708 16.1339 3.86613 13.6929 3.57152 10.625H2.5C2.15482 10.625 1.875 10.3452 1.875 10C1.875 9.65482 2.15482 9.375 2.5 9.375H3.57152C3.86613 6.30708 6.30708 3.86613 9.375 3.57152V2.5C9.375 2.15482 9.65482 1.875 10 1.875ZM4.82878 10.625H5.83333C6.17851 10.625 6.45833 10.3452 6.45833 10C6.45833 9.65482 6.17851 9.375 5.83333 9.375H4.82878C5.11304 6.99811 6.99811 5.11304 9.375 4.82878V5.83333C9.375 6.17851 9.65482 6.45833 10 6.45833C10.3452 6.45833 10.625 6.17851 10.625 5.83333V4.82878C13.0019 5.11304 14.887 6.99811 15.1712 9.375H14.1667C13.8215 9.375 13.5417 9.65482 13.5417 10C13.5417 10.3452 13.8215 10.625 14.1667 10.625H15.1712C14.887 13.0019 13.0019 14.887 10.625 15.1712V14.1667C10.625 13.8215 10.3452 13.5417 10 13.5417C9.65482 13.5417 9.375 13.8215 9.375 14.1667V15.1712C6.99811 14.887 5.11304 13.0019 4.82878 10.625Z",fill:"#6B7280"})})}function kE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function CE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function NE(n){var t=n.children,e=n.className,r=h(n,["children","className"]);return k.jsx("button",d({type:"button",className:j(["ink-flow__controls-button",e])},r,{children:t}))}var ME=function(n){return n.userSelectionActive?"none":"all"};function OE(n){var t=n.position,e=void 0===t?"top-left":t,r=n.children,o=n.className,i=n.style,u=h(n,["position","children","className","style"]),a=Sb(ME),c="".concat(e).split("-");return k.jsx("div",d({className:j(m(["ink-flow__panel",o],y(c),!1)),style:d(d({},i),{pointerEvents:a})},u,{children:r}))}var jE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function IE(n){var t=n.style,e=n.showZoom,r=void 0===e||e,o=n.showFitView,i=void 0===o||o,u=n.showInteractive,a=void 0===u||u,c=n.fitViewOptions,l=n.onZoomIn,s=n.onZoomOut,f=n.onFitView,d=n.onInteractiveChange,h=n.className,v=n.children,p=n.position,g=void 0===p?"bottom-left":p,y=n.orientation,m=void 0===y?"vertical":y,w=n["aria-label"],b=void 0===w?"Ink Flow controls":w,_=kb(),x=Sb(jE,u_),E=x.isInteractive,S=x.minZoomReached,C=x.maxZoomReached,N=R_(),M=N.zoomIn,O=N.zoomOut,I=N.fitView,P="horizontal"===m?"horizontal":"vertical";return k.jsxs(OE,{className:j(["ink-flow__controls",P,h]),position:g,style:t,"data-testid":"rf__controls","aria-label":b,children:[i&&k.jsx(NE,{className:"ink-flow__controls-fitview",onClick:function(){I(c),null==f||f()},"aria-label":"fit view",children:k.jsx(SE,{})}),r&&k.jsxs("div",{className:"ink-flow__controls-zoom",children:[k.jsx(NE,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:C,children:k.jsx(xE,{})}),k.jsx(NE,{onClick:function(){O(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:S,children:k.jsx(EE,{})})]}),a&&k.jsx(NE,{className:"ink-flow__controls-interactive",onClick:function(){_.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==d||d(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?k.jsx(CE,{}):k.jsx(kE,{})}),v]})}IE.displayName="Controls";var PE,AE,zE=c(IE);function LE(n){var t=n.dimensions,e=n.lineWidth,r=n.variant,o=n.className;return k.jsx("path",{strokeWidth:e,d:"M".concat(t[0]/2," 0 V").concat(t[1]," M0 ").concat(t[1]/2," H").concat(t[0]),className:j(["react-flow__background-pattern",r,o])})}function TE(n){var t=n.radius,e=n.className;return k.jsx("circle",{cx:t,cy:t,r:t,className:j(["react-flow__background-pattern","dots",e])})}!function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"}(PE||(PE={}));var BE=((AE={})[PE.Dots]=1,AE[PE.Lines]=1,AE[PE.Cross]=6,AE),DE=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function RE(n){var t=n.id,e=n.variant,r=void 0===e?PE.Dots:e,o=n.gap,i=void 0===o?20:o,a=n.size,c=n.lineWidth,l=void 0===c?1:c,s=n.offset,f=void 0===s?2:s,h=n.color,v=n.bgColor,p=n.style,g=n.className,y=n.patternClassName,m=u(null),w=Sb(DE,u_),b=w.transform,_=w.patternId,x=a||BE[r],E=r===PE.Dots,S=r===PE.Cross,C=Array.isArray(i)?i:[i,i],N=[C[0]*b[2]||1,C[1]*b[2]||1],M=x*b[2],O=S?[M,M]:N,I=E?[M/f,M/f]:[O[0]/f,O[1]/f],P="".concat(_).concat(t||"");return k.jsxs("svg",{className:j(["ink-flow__background",g]),style:d(d(d({},p),a_),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[k.jsx("pattern",{id:P,x:b[0]%N[0],y:b[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(I[0],",-").concat(I[1],")"),children:E?k.jsx(TE,{radius:M/f,className:y}):k.jsx(LE,{dimensions:O,lineWidth:l,variant:r,className:y})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(P,")")})]})}RE.displayName="Background";var VE=c(RE),HE=function(n){var t;return null===(t=n.domNode)||void 0===t?void 0:t.querySelector(".ink-flow__edgelabel-renderer")};function YE(n){var t=n.children,e=Sb(HE);return e?f(t,e):null}export{VE as Background,PE as BackgroundVariant,yx as BaseEdge,rp as ConnectionLineType,np as ConnectionMode,NE as ControlButton,zE as Controls,YE as EdgeLabelRenderer,tx as Handle,vE as InkFlowProvider,op as MarkerType,tp as PanOnScrollMode,ip as Position,ep as SelectionMode,Sx as SmoothStepEdge,Nx as StepEdge,vp as addEdge,_p as dagreLayout,_E as default,ap as getBezierEdgeCenter,sp as getBezierPath,Tv as getConnectedEdges,fp as getEdgeCenter,Av as getIncomers,Lv as getNodesBounds,Pv as getOutgoers,bp as getSmoothStepPath,gp as getStraightPath,$v as getViewportForBounds,pp as updateEdge,I_ as useEdgesState,R_ as useInkFlow,P_ as useNodesState,Sb as useStore,kb as useStoreApi};
|
|
24
|
+
*/!function(n,t){(function(){var e,r="Expected a function",o="__lodash_hash_undefined__",i="__lodash_placeholder__",u=16,a=32,c=64,l=128,s=256,f=1/0,d=9007199254740991,h=NaN,v=4294967295,p=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",a],["partialRight",c],["rearg",s]],g="[object Arguments]",y="[object Array]",m="[object Boolean]",b="[object Date]",_="[object Error]",x="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",N="[object Promise]",M="[object RegExp]",O="[object Set]",j="[object String]",I="[object Symbol]",P="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",T="[object Float64Array]",B="[object Int8Array]",D="[object Int16Array]",R="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",Z="[object Uint32Array]",X=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(W.source),q=RegExp($.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,on=RegExp(rn.source),un=/^\s+/,an=/\s/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ln=/\{\n\/\* \[wrapped with (.+)\] \*/,sn=/,? & /,fn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dn=/[()=,{}\[\]\/\s]/,hn=/\\(\\)?/g,vn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pn=/\w*$/,gn=/^[-+]0x[0-9a-f]+$/i,yn=/^0b[01]+$/i,mn=/^\[object .+?Constructor\]$/,wn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xn=/($^)/,En=/['\n\r\u2028\u2029\\]/g,Sn="\\ud800-\\udfff",kn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Cn="\\u2700-\\u27bf",Nn="a-z\\xdf-\\xf6\\xf8-\\xff",Mn="A-Z\\xc0-\\xd6\\xd8-\\xde",On="\\ufe0e\\ufe0f",jn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",In="['’]",Pn="["+Sn+"]",An="["+jn+"]",zn="["+kn+"]",Ln="\\d+",Tn="["+Cn+"]",Bn="["+Nn+"]",Dn="[^"+Sn+jn+Ln+Cn+Nn+Mn+"]",Rn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Zn="["+Mn+"]",Xn="\\u200d",Un="(?:"+Bn+"|"+Dn+")",Fn="(?:"+Zn+"|"+Dn+")",Wn="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Rn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Xn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Tn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,Pn].join("|")+")",nt=RegExp(In,"g"),tt=RegExp(zn,"g"),et=RegExp(Rn+"(?="+Rn+")|"+Jn+Kn,"g"),rt=RegExp([Zn+"?"+Bn+"+"+Wn+"(?="+[An,Zn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Zn+Un,"$"].join("|")+")",Zn+"?"+Un+"+"+Wn,Zn+"+"+$n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ln,Qn].join("|"),"g"),ot=RegExp("["+Xn+Sn+kn+On+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ut=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,ct={};ct[L]=ct[T]=ct[B]=ct[D]=ct[R]=ct[V]=ct[H]=ct[Y]=ct[Z]=!0,ct[g]=ct[y]=ct[A]=ct[m]=ct[z]=ct[b]=ct[_]=ct[x]=ct[S]=ct[k]=ct[C]=ct[M]=ct[O]=ct[j]=ct[P]=!1;var lt={};lt[g]=lt[y]=lt[A]=lt[z]=lt[m]=lt[b]=lt[L]=lt[T]=lt[B]=lt[D]=lt[R]=lt[S]=lt[k]=lt[C]=lt[M]=lt[O]=lt[j]=lt[I]=lt[V]=lt[H]=lt[Y]=lt[Z]=!0,lt[_]=lt[x]=lt[P]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,ht="object"==typeof w&&w&&w.Object===Object&&w,vt="object"==typeof self&&self&&self.Object===Object&&self,pt=ht||vt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&n&&!n.nodeType&&n,mt=yt&&yt.exports===gt,wt=mt&&ht.process,bt=function(){try{var n=yt&&yt.require&&yt.require("util").types;return n||wt&&wt.binding&&wt.binding("util")}catch(n){}}(),_t=bt&&bt.isArrayBuffer,xt=bt&&bt.isDate,Et=bt&&bt.isMap,St=bt&&bt.isRegExp,kt=bt&&bt.isSet,Ct=bt&&bt.isTypedArray;function Nt(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function Mt(n,t,e,r){for(var o=-1,i=null==n?0:n.length;++o<i;){var u=n[o];t(r,u,e(u),n)}return r}function Ot(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&!1!==t(n[e],e,n););return n}function jt(n,t){for(var e=null==n?0:n.length;e--&&!1!==t(n[e],e,n););return n}function It(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(!t(n[e],e,n))return!1;return!0}function Pt(n,t){for(var e=-1,r=null==n?0:n.length,o=0,i=[];++e<r;){var u=n[e];t(u,e,n)&&(i[o++]=u)}return i}function At(n,t){return!!(null==n?0:n.length)&&Zt(n,t,0)>-1}function zt(n,t,e){for(var r=-1,o=null==n?0:n.length;++r<o;)if(e(t,n[r]))return!0;return!1}function Lt(n,t){for(var e=-1,r=null==n?0:n.length,o=Array(r);++e<r;)o[e]=t(n[e],e,n);return o}function Tt(n,t){for(var e=-1,r=t.length,o=n.length;++e<r;)n[o+e]=t[e];return n}function Bt(n,t,e,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);return e}function Dt(n,t,e,r){var o=null==n?0:n.length;for(r&&o&&(e=n[--o]);o--;)e=t(e,n[o],o,n);return e}function Rt(n,t){for(var e=-1,r=null==n?0:n.length;++e<r;)if(t(n[e],e,n))return!0;return!1}var Vt=Wt("length");function Ht(n,t,e){var r;return e(n,(function(n,e,o){if(t(n,e,o))return r=e,!1})),r}function Yt(n,t,e,r){for(var o=n.length,i=e+(r?1:-1);r?i--:++i<o;)if(t(n[i],i,n))return i;return-1}function Zt(n,t,e){return t==t?function(n,t,e){var r=e-1,o=n.length;for(;++r<o;)if(n[r]===t)return r;return-1}(n,t,e):Yt(n,Ut,e)}function Xt(n,t,e,r){for(var o=e-1,i=n.length;++o<i;)if(r(n[o],t))return o;return-1}function Ut(n){return n!=n}function Ft(n,t){var e=null==n?0:n.length;return e?qt(n,t)/e:h}function Wt(n){return function(t){return null==t?e:t[n]}}function $t(n){return function(t){return null==n?e:n[t]}}function Gt(n,t,e,r,o){return o(n,(function(n,o,i){e=r?(r=!1,n):t(e,n,o,i)})),e}function qt(n,t){for(var r,o=-1,i=n.length;++o<i;){var u=t(n[o]);u!==e&&(r=r===e?u:r+u)}return r}function Kt(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}function Qt(n){return n?n.slice(0,pe(n)+1).replace(un,""):n}function Jt(n){return function(t){return n(t)}}function ne(n,t){return Lt(t,(function(t){return n[t]}))}function te(n,t){return n.has(t)}function ee(n,t){for(var e=-1,r=n.length;++e<r&&Zt(t,n[e],0)>-1;);return e}function re(n,t){for(var e=n.length;e--&&Zt(t,n[e],0)>-1;);return e}var oe=$t({"À":"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"}),ie=$t({"&":"&","<":"<",">":">",'"':""","'":"'"});function ue(n){return"\\"+st[n]}function ae(n){return ot.test(n)}function ce(n){var t=-1,e=Array(n.size);return n.forEach((function(n,r){e[++t]=[r,n]})),e}function le(n,t){return function(e){return n(t(e))}}function se(n,t){for(var e=-1,r=n.length,o=0,u=[];++e<r;){var a=n[e];a!==t&&a!==i||(n[e]=i,u[o++]=e)}return u}function fe(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=n})),e}function de(n){var t=-1,e=Array(n.size);return n.forEach((function(n){e[++t]=[n,n]})),e}function he(n){return ae(n)?function(n){var t=et.lastIndex=0;for(;et.test(n);)++t;return t}(n):Vt(n)}function ve(n){return ae(n)?function(n){return n.match(et)||[]}(n):function(n){return n.split("")}(n)}function pe(n){for(var t=n.length;t--&&an.test(n.charAt(t)););return t}var ge=$t({"&":"&","<":"<",">":">",""":'"',"'":"'"});var ye=function n(t){var w,an=(t=null==t?pt:ye.defaults(pt.Object(),t,ye.pick(pt,ut))).Array,Sn=t.Date,kn=t.Error,Cn=t.Function,Nn=t.Math,Mn=t.Object,On=t.RegExp,jn=t.String,In=t.TypeError,Pn=an.prototype,An=Cn.prototype,zn=Mn.prototype,Ln=t["__core-js_shared__"],Tn=An.toString,Bn=zn.hasOwnProperty,Dn=0,Rn=(w=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Vn=zn.toString,Hn=Tn.call(Mn),Yn=pt._,Zn=On("^"+Tn.call(Bn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xn=mt?t.Buffer:e,Un=t.Symbol,Fn=t.Uint8Array,Wn=Xn?Xn.allocUnsafe:e,$n=le(Mn.getPrototypeOf,Mn),Gn=Mn.create,qn=zn.propertyIsEnumerable,Kn=Pn.splice,Qn=Un?Un.isConcatSpreadable:e,Jn=Un?Un.iterator:e,et=Un?Un.toStringTag:e,ot=function(){try{var n=hi(Mn,"defineProperty");return n({},"",{}),n}catch(n){}}(),st=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=Sn&&Sn.now!==pt.Date.now&&Sn.now,vt=t.setTimeout!==pt.setTimeout&&t.setTimeout,gt=Nn.ceil,yt=Nn.floor,wt=Mn.getOwnPropertySymbols,bt=Xn?Xn.isBuffer:e,Vt=t.isFinite,$t=Pn.join,me=le(Mn.keys,Mn),we=Nn.max,be=Nn.min,_e=Sn.now,xe=t.parseInt,Ee=Nn.random,Se=Pn.reverse,ke=hi(t,"DataView"),Ce=hi(t,"Map"),Ne=hi(t,"Promise"),Me=hi(t,"Set"),Oe=hi(t,"WeakMap"),je=hi(Mn,"create"),Ie=Oe&&new Oe,Pe={},Ae=Ri(ke),ze=Ri(Ce),Le=Ri(Ne),Te=Ri(Me),Be=Ri(Oe),De=Un?Un.prototype:e,Re=De?De.valueOf:e,Ve=De?De.toString:e;function He(n){if(ea(n)&&!Uu(n)&&!(n instanceof Ue)){if(n instanceof Xe)return n;if(Bn.call(n,"__wrapped__"))return Vi(n)}return new Xe(n)}var Ye=function(){function n(){}return function(t){if(!ta(t))return{};if(Gn)return Gn(t);n.prototype=t;var r=new n;return n.prototype=e,r}}();function Ze(){}function Xe(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=e}function Ue(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Fe(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function We(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function $e(n){var t=-1,e=null==n?0:n.length;for(this.clear();++t<e;){var r=n[t];this.set(r[0],r[1])}}function Ge(n){var t=-1,e=null==n?0:n.length;for(this.__data__=new $e;++t<e;)this.add(n[t])}function qe(n){var t=this.__data__=new We(n);this.size=t.size}function Ke(n,t){var e=Uu(n),r=!e&&Xu(n),o=!e&&!r&&Gu(n),i=!e&&!r&&!o&&sa(n),u=e||r||o||i,a=u?Kt(n.length,jn):[],c=a.length;for(var l in n)!t&&!Bn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||bi(l,c))||a.push(l);return a}function Qe(n){var t=n.length;return t?n[Gr(0,t-1)]:e}function Je(n,t){return Ti(Io(n),cr(t,0,n.length))}function nr(n){return Ti(Io(n))}function tr(n,t,r){(r!==e&&!Hu(n[t],r)||r===e&&!(t in n))&&ur(n,t,r)}function er(n,t,r){var o=n[t];Bn.call(n,t)&&Hu(o,r)&&(r!==e||t in n)||ur(n,t,r)}function rr(n,t){for(var e=n.length;e--;)if(Hu(n[e][0],t))return e;return-1}function or(n,t,e,r){return hr(n,(function(n,o,i){t(r,n,e(n),i)})),r}function ir(n,t){return n&&Po(t,Pa(t),n)}function ur(n,t,e){"__proto__"==t&&ot?ot(n,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):n[t]=e}function ar(n,t){for(var r=-1,o=t.length,i=an(o),u=null==n;++r<o;)i[r]=u?e:Na(n,t[r]);return i}function cr(n,t,r){return n==n&&(r!==e&&(n=n<=r?n:r),t!==e&&(n=n>=t?n:t)),n}function lr(n,t,r,o,i,u){var a,c=1&t,l=2&t,s=4&t;if(r&&(a=i?r(n,o,i,u):r(n)),a!==e)return a;if(!ta(n))return n;var f=Uu(n);if(f){if(a=function(n){var t=n.length,e=new n.constructor(t);t&&"string"==typeof n[0]&&Bn.call(n,"index")&&(e.index=n.index,e.input=n.input);return e}(n),!c)return Io(n,a)}else{var d=gi(n),h=d==x||d==E;if(Gu(n))return ko(n,c);if(d==C||d==g||h&&!i){if(a=l||h?{}:mi(n),!c)return l?function(n,t){return Po(n,pi(n),t)}(n,function(n,t){return n&&Po(t,Aa(t),n)}(a,n)):function(n,t){return Po(n,vi(n),t)}(n,ir(a,n))}else{if(!lt[d])return i?n:{};a=function(n,t,e){var r=n.constructor;switch(t){case A:return Co(n);case m:case b:return new r(+n);case z:return function(n,t){var e=t?Co(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}(n,e);case L:case T:case B:case D:case R:case V:case H:case Y:case Z:return No(n,e);case S:return new r;case k:case j:return new r(n);case M:return function(n){var t=new n.constructor(n.source,pn.exec(n));return t.lastIndex=n.lastIndex,t}(n);case O:return new r;case I:return o=n,Re?Mn(Re.call(o)):{}}var o}(n,d,c)}}u||(u=new qe);var v=u.get(n);if(v)return v;u.set(n,a),aa(n)?n.forEach((function(e){a.add(lr(e,t,r,e,n,u))})):ra(n)&&n.forEach((function(e,o){a.set(o,lr(e,t,r,o,n,u))}));var p=f?e:(s?l?ui:ii:l?Aa:Pa)(n);return Ot(p||n,(function(e,o){p&&(e=n[o=e]),er(a,o,lr(e,t,r,o,n,u))})),a}function sr(n,t,r){var o=r.length;if(null==n)return!o;for(n=Mn(n);o--;){var i=r[o],u=t[i],a=n[i];if(a===e&&!(i in n)||!u(a))return!1}return!0}function fr(n,t,o){if("function"!=typeof n)throw new In(r);return Pi((function(){n.apply(e,o)}),t)}function dr(n,t,e,r){var o=-1,i=At,u=!0,a=n.length,c=[],l=t.length;if(!a)return c;e&&(t=Lt(t,Jt(e))),r?(i=zt,u=!1):t.length>=200&&(i=te,u=!1,t=new Ge(t));n:for(;++o<a;){var s=n[o],f=null==e?s:e(s);if(s=r||0!==s?s:0,u&&f==f){for(var d=l;d--;)if(t[d]===f)continue n;c.push(s)}else i(t,f,r)||c.push(s)}return c}He.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:He}},He.prototype=Ze.prototype,He.prototype.constructor=He,Xe.prototype=Ye(Ze.prototype),Xe.prototype.constructor=Xe,Ue.prototype=Ye(Ze.prototype),Ue.prototype.constructor=Ue,Fe.prototype.clear=function(){this.__data__=je?je(null):{},this.size=0},Fe.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Fe.prototype.get=function(n){var t=this.__data__;if(je){var r=t[n];return r===o?e:r}return Bn.call(t,n)?t[n]:e},Fe.prototype.has=function(n){var t=this.__data__;return je?t[n]!==e:Bn.call(t,n)},Fe.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=je&&t===e?o:t,this},We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(n){var t=this.__data__,e=rr(t,n);return!(e<0)&&(e==t.length-1?t.pop():Kn.call(t,e,1),--this.size,!0)},We.prototype.get=function(n){var t=this.__data__,r=rr(t,n);return r<0?e:t[r][1]},We.prototype.has=function(n){return rr(this.__data__,n)>-1},We.prototype.set=function(n,t){var e=this.__data__,r=rr(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this},$e.prototype.clear=function(){this.size=0,this.__data__={hash:new Fe,map:new(Ce||We),string:new Fe}},$e.prototype.delete=function(n){var t=fi(this,n).delete(n);return this.size-=t?1:0,t},$e.prototype.get=function(n){return fi(this,n).get(n)},$e.prototype.has=function(n){return fi(this,n).has(n)},$e.prototype.set=function(n,t){var e=fi(this,n),r=e.size;return e.set(n,t),this.size+=e.size==r?0:1,this},Ge.prototype.add=Ge.prototype.push=function(n){return this.__data__.set(n,o),this},Ge.prototype.has=function(n){return this.__data__.has(n)},qe.prototype.clear=function(){this.__data__=new We,this.size=0},qe.prototype.delete=function(n){var t=this.__data__,e=t.delete(n);return this.size=t.size,e},qe.prototype.get=function(n){return this.__data__.get(n)},qe.prototype.has=function(n){return this.__data__.has(n)},qe.prototype.set=function(n,t){var e=this.__data__;if(e instanceof We){var r=e.__data__;if(!Ce||r.length<199)return r.push([n,t]),this.size=++e.size,this;e=this.__data__=new $e(r)}return e.set(n,t),this.size=e.size,this};var hr=Lo(_r),vr=Lo(xr,!0);function pr(n,t){var e=!0;return hr(n,(function(n,r,o){return e=!!t(n,r,o)})),e}function gr(n,t,r){for(var o=-1,i=n.length;++o<i;){var u=n[o],a=t(u);if(null!=a&&(c===e?a==a&&!la(a):r(a,c)))var c=a,l=u}return l}function yr(n,t){var e=[];return hr(n,(function(n,r,o){t(n,r,o)&&e.push(n)})),e}function mr(n,t,e,r,o){var i=-1,u=n.length;for(e||(e=wi),o||(o=[]);++i<u;){var a=n[i];t>0&&e(a)?t>1?mr(a,t-1,e,r,o):Tt(o,a):r||(o[o.length]=a)}return o}var wr=To(),br=To(!0);function _r(n,t){return n&&wr(n,t,Pa)}function xr(n,t){return n&&br(n,t,Pa)}function Er(n,t){return Pt(t,(function(t){return Qu(n[t])}))}function Sr(n,t){for(var r=0,o=(t=_o(t,n)).length;null!=n&&r<o;)n=n[Di(t[r++])];return r&&r==o?n:e}function kr(n,t,e){var r=t(n);return Uu(n)?r:Tt(r,e(n))}function Cr(n){return null==n?n===e?"[object Undefined]":"[object Null]":et&&et in Mn(n)?function(n){var t=Bn.call(n,et),r=n[et];try{n[et]=e;var o=!0}catch(n){}var i=Vn.call(n);o&&(t?n[et]=r:delete n[et]);return i}(n):function(n){return Vn.call(n)}(n)}function Nr(n,t){return n>t}function Mr(n,t){return null!=n&&Bn.call(n,t)}function Or(n,t){return null!=n&&t in Mn(n)}function jr(n,t,r){for(var o=r?zt:At,i=n[0].length,u=n.length,a=u,c=an(u),l=1/0,s=[];a--;){var f=n[a];a&&t&&(f=Lt(f,Jt(t))),l=be(f.length,l),c[a]=!r&&(t||i>=120&&f.length>=120)?new Ge(a&&f):e}f=n[0];var d=-1,h=c[0];n:for(;++d<i&&s.length<l;){var v=f[d],p=t?t(v):v;if(v=r||0!==v?v:0,!(h?te(h,p):o(s,p,r))){for(a=u;--a;){var g=c[a];if(!(g?te(g,p):o(n[a],p,r)))continue n}h&&h.push(p),s.push(v)}}return s}function Ir(n,t,r){var o=null==(n=Oi(n,t=_o(t,n)))?n:n[Di(Ki(t))];return null==o?e:Nt(o,n,r)}function Pr(n){return ea(n)&&Cr(n)==g}function Ar(n,t,r,o,i){return n===t||(null==n||null==t||!ea(n)&&!ea(t)?n!=n&&t!=t:function(n,t,r,o,i,u){var a=Uu(n),c=Uu(t),l=a?y:gi(n),s=c?y:gi(t),f=(l=l==g?C:l)==C,d=(s=s==g?C:s)==C,h=l==s;if(h&&Gu(n)){if(!Gu(t))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new qe),a||sa(n)?ri(n,t,r,o,i,u):function(n,t,e,r,o,i,u){switch(e){case z:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case A:return!(n.byteLength!=t.byteLength||!i(new Fn(n),new Fn(t)));case m:case b:case k:return Hu(+n,+t);case _:return n.name==t.name&&n.message==t.message;case M:case j:return n==t+"";case S:var a=ce;case O:var c=1&r;if(a||(a=fe),n.size!=t.size&&!c)return!1;var l=u.get(n);if(l)return l==t;r|=2,u.set(n,t);var s=ri(a(n),a(t),r,o,i,u);return u.delete(n),s;case I:if(Re)return Re.call(n)==Re.call(t)}return!1}(n,t,l,r,o,i,u);if(!(1&r)){var v=f&&Bn.call(n,"__wrapped__"),p=d&&Bn.call(t,"__wrapped__");if(v||p){var w=v?n.value():n,x=p?t.value():t;return u||(u=new qe),i(w,x,r,o,u)}}if(!h)return!1;return u||(u=new qe),function(n,t,r,o,i,u){var a=1&r,c=ii(n),l=c.length,s=ii(t),f=s.length;if(l!=f&&!a)return!1;var d=l;for(;d--;){var h=c[d];if(!(a?h in t:Bn.call(t,h)))return!1}var v=u.get(n),p=u.get(t);if(v&&p)return v==t&&p==n;var g=!0;u.set(n,t),u.set(t,n);var y=a;for(;++d<l;){var m=n[h=c[d]],w=t[h];if(o)var b=a?o(w,m,h,t,n,u):o(m,w,h,n,t,u);if(!(b===e?m===w||i(m,w,r,o,u):b)){g=!1;break}y||(y="constructor"==h)}if(g&&!y){var _=n.constructor,x=t.constructor;_==x||!("constructor"in n)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof x&&x instanceof x||(g=!1)}return u.delete(n),u.delete(t),g}(n,t,r,o,i,u)}(n,t,r,o,Ar,i))}function zr(n,t,r,o){var i=r.length,u=i,a=!o;if(null==n)return!u;for(n=Mn(n);i--;){var c=r[i];if(a&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++i<u;){var l=(c=r[i])[0],s=n[l],f=c[1];if(a&&c[2]){if(s===e&&!(l in n))return!1}else{var d=new qe;if(o)var h=o(s,f,l,n,t,d);if(!(h===e?Ar(f,s,3,o,d):h))return!1}}return!0}function Lr(n){return!(!ta(n)||(t=n,Rn&&Rn in t))&&(Qu(n)?Zn:mn).test(Ri(n));var t}function Tr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Uu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Br(n){if(!ki(n))return me(n);var t=[];for(var e in Mn(n))Bn.call(n,e)&&"constructor"!=e&&t.push(e);return t}function Dr(n){if(!ta(n))return function(n){var t=[];if(null!=n)for(var e in Mn(n))t.push(e);return t}(n);var t=ki(n),e=[];for(var r in n)("constructor"!=r||!t&&Bn.call(n,r))&&e.push(r);return e}function Rr(n,t){return n<t}function Vr(n,t){var e=-1,r=Wu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++e]=t(n,o,i)})),r}function Hr(n){var t=di(n);return 1==t.length&&t[0][2]?Ni(t[0][0],t[0][1]):function(e){return e===n||zr(e,n,t)}}function Yr(n,t){return xi(n)&&Ci(t)?Ni(Di(n),t):function(r){var o=Na(r,n);return o===e&&o===t?Ma(r,n):Ar(t,o,3)}}function Zr(n,t,r,o,i){n!==t&&wr(t,(function(u,a){if(i||(i=new qe),ta(u))!function(n,t,r,o,i,u,a){var c=ji(n,r),l=ji(t,r),s=a.get(l);if(s)return void tr(n,r,s);var f=u?u(c,l,r+"",n,t,a):e,d=f===e;if(d){var h=Uu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Uu(c)?f=c:$u(c)?f=Io(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=No(l,!0)):f=[]:ia(l)||Xu(l)?(f=c,Xu(c)?f=ma(c):ta(c)&&!Qu(c)||(f=mi(l))):d=!1}d&&(a.set(l,f),i(f,l,o,u,a),a.delete(l));tr(n,r,f)}(n,t,a,r,Zr,o,i);else{var c=o?o(ji(n,a),u,a+"",n,t,i):e;c===e&&(c=u),tr(n,a,c)}}),Aa)}function Xr(n,t){var r=n.length;if(r)return bi(t+=t<0?r:0,r)?n[t]:e}function Ur(n,t,e){t=t.length?Lt(t,(function(n){return Uu(n)?function(t){return Sr(t,1===n.length?n[0]:n)}:n})):[oc];var r=-1;t=Lt(t,Jt(si()));var o=Vr(n,(function(n,e,o){var i=Lt(t,(function(t){return t(n)}));return{criteria:i,index:++r,value:n}}));return function(n,t){var e=n.length;for(n.sort(t);e--;)n[e]=n[e].value;return n}(o,(function(n,t){return function(n,t,e){var r=-1,o=n.criteria,i=t.criteria,u=o.length,a=e.length;for(;++r<u;){var c=Mo(o[r],i[r]);if(c)return r>=a?c:c*("desc"==e[r]?-1:1)}return n.index-t.index}(n,t,e)}))}function Fr(n,t,e){for(var r=-1,o=t.length,i={};++r<o;){var u=t[r],a=Sr(n,u);e(a,u)&&no(i,_o(u,n),a)}return i}function Wr(n,t,e,r){var o=r?Xt:Zt,i=-1,u=t.length,a=n;for(n===t&&(t=Io(t)),e&&(a=Lt(n,Jt(e)));++i<u;)for(var c=0,l=t[i],s=e?e(l):l;(c=o(a,s,c,r))>-1;)a!==n&&Kn.call(a,c,1),Kn.call(n,c,1);return n}function $r(n,t){for(var e=n?t.length:0,r=e-1;e--;){var o=t[e];if(e==r||o!==i){var i=o;bi(o)?Kn.call(n,o,1):ho(n,o)}}return n}function Gr(n,t){return n+yt(Ee()*(t-n+1))}function qr(n,t){var e="";if(!n||t<1||t>d)return e;do{t%2&&(e+=n),(t=yt(t/2))&&(n+=n)}while(t);return e}function Kr(n,t){return Ai(Mi(n,t,oc),n+"")}function Qr(n){return Qe(Ha(n))}function Jr(n,t){var e=Ha(n);return Ti(e,cr(t,0,e.length))}function no(n,t,r,o){if(!ta(n))return n;for(var i=-1,u=(t=_o(t,n)).length,a=u-1,c=n;null!=c&&++i<u;){var l=Di(t[i]),s=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return n;if(i!=a){var f=c[l];(s=o?o(f,l,c):e)===e&&(s=ta(f)?f:bi(t[i+1])?[]:{})}er(c,l,s),c=c[l]}return n}var to=Ie?function(n,t){return Ie.set(n,t),n}:oc,eo=ot?function(n,t){return ot(n,"toString",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:oc;function ro(n){return Ti(Ha(n))}function oo(n,t,e){var r=-1,o=n.length;t<0&&(t=-t>o?0:o+t),(e=e>o?o:e)<0&&(e+=o),o=t>e?0:e-t>>>0,t>>>=0;for(var i=an(o);++r<o;)i[r]=n[r+t];return i}function io(n,t){var e;return hr(n,(function(n,r,o){return!(e=t(n,r,o))})),!!e}function uo(n,t,e){var r=0,o=null==n?r:n.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=n[i];null!==u&&!la(u)&&(e?u<=t:u<t)?r=i+1:o=i}return o}return ao(n,t,oc,e)}function ao(n,t,r,o){var i=0,u=null==n?0:n.length;if(0===u)return 0;for(var a=(t=r(t))!=t,c=null===t,l=la(t),s=t===e;i<u;){var f=yt((i+u)/2),d=r(n[f]),h=d!==e,v=null===d,p=d==d,g=la(d);if(a)var y=o||p;else y=s?p&&(o||h):c?p&&h&&(o||!v):l?p&&h&&!v&&(o||!g):!v&&!g&&(o?d<=t:d<t);y?i=f+1:u=f}return be(u,4294967294)}function co(n,t){for(var e=-1,r=n.length,o=0,i=[];++e<r;){var u=n[e],a=t?t(u):u;if(!e||!Hu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function lo(n){return"number"==typeof n?n:la(n)?h:+n}function so(n){if("string"==typeof n)return n;if(Uu(n))return Lt(n,so)+"";if(la(n))return Ve?Ve.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function fo(n,t,e){var r=-1,o=At,i=n.length,u=!0,a=[],c=a;if(e)u=!1,o=zt;else if(i>=200){var l=t?null:Ko(n);if(l)return fe(l);u=!1,o=te,c=new Ge}else c=t?[]:a;n:for(;++r<i;){var s=n[r],f=t?t(s):s;if(s=e||0!==s?s:0,u&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue n;t&&c.push(f),a.push(s)}else o(c,f,e)||(c!==a&&c.push(f),a.push(s))}return a}function ho(n,t){return null==(n=Oi(n,t=_o(t,n)))||delete n[Di(Ki(t))]}function vo(n,t,e,r){return no(n,t,e(Sr(n,t)),r)}function po(n,t,e,r){for(var o=n.length,i=r?o:-1;(r?i--:++i<o)&&t(n[i],i,n););return e?oo(n,r?0:i,r?i+1:o):oo(n,r?i+1:0,r?o:i)}function go(n,t){var e=n;return e instanceof Ue&&(e=e.value()),Bt(t,(function(n,t){return t.func.apply(t.thisArg,Tt([n],t.args))}),e)}function yo(n,t,e){var r=n.length;if(r<2)return r?fo(n[0]):[];for(var o=-1,i=an(r);++o<r;)for(var u=n[o],a=-1;++a<r;)a!=o&&(i[o]=dr(i[o]||u,n[a],t,e));return fo(mr(i,1),t,e)}function mo(n,t,r){for(var o=-1,i=n.length,u=t.length,a={};++o<i;){var c=o<u?t[o]:e;r(a,n[o],c)}return a}function wo(n){return $u(n)?n:[]}function bo(n){return"function"==typeof n?n:oc}function _o(n,t){return Uu(n)?n:xi(n,t)?[n]:Bi(wa(n))}var xo=Kr;function Eo(n,t,r){var o=n.length;return r=r===e?o:r,!t&&r>=o?n:oo(n,t,r)}var So=st||function(n){return pt.clearTimeout(n)};function ko(n,t){if(t)return n.slice();var e=n.length,r=Wn?Wn(e):new n.constructor(e);return n.copy(r),r}function Co(n){var t=new n.constructor(n.byteLength);return new Fn(t).set(new Fn(n)),t}function No(n,t){var e=t?Co(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Mo(n,t){if(n!==t){var r=n!==e,o=null===n,i=n==n,u=la(n),a=t!==e,c=null===t,l=t==t,s=la(t);if(!c&&!s&&!u&&n>t||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&n<t||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}function Oo(n,t,e,r){for(var o=-1,i=n.length,u=e.length,a=-1,c=t.length,l=we(i-u,0),s=an(c+l),f=!r;++a<c;)s[a]=t[a];for(;++o<u;)(f||o<i)&&(s[e[o]]=n[o]);for(;l--;)s[a++]=n[o++];return s}function jo(n,t,e,r){for(var o=-1,i=n.length,u=-1,a=e.length,c=-1,l=t.length,s=we(i-a,0),f=an(s+l),d=!r;++o<s;)f[o]=n[o];for(var h=o;++c<l;)f[h+c]=t[c];for(;++u<a;)(d||o<i)&&(f[h+e[u]]=n[o++]);return f}function Io(n,t){var e=-1,r=n.length;for(t||(t=an(r));++e<r;)t[e]=n[e];return t}function Po(n,t,r,o){var i=!r;r||(r={});for(var u=-1,a=t.length;++u<a;){var c=t[u],l=o?o(r[c],n[c],c,r,n):e;l===e&&(l=n[c]),i?ur(r,c,l):er(r,c,l)}return r}function Ao(n,t){return function(e,r){var o=Uu(e)?Mt:or,i=t?t():{};return o(e,n,si(r,2),i)}}function zo(n){return Kr((function(t,r){var o=-1,i=r.length,u=i>1?r[i-1]:e,a=i>2?r[2]:e;for(u=n.length>3&&"function"==typeof u?(i--,u):e,a&&_i(r[0],r[1],a)&&(u=i<3?e:u,i=1),t=Mn(t);++o<i;){var c=r[o];c&&n(t,c,o,u)}return t}))}function Lo(n,t){return function(e,r){if(null==e)return e;if(!Wu(e))return n(e,r);for(var o=e.length,i=t?o:-1,u=Mn(e);(t?i--:++i<o)&&!1!==r(u[i],i,u););return e}}function To(n){return function(t,e,r){for(var o=-1,i=Mn(t),u=r(t),a=u.length;a--;){var c=u[n?a:++o];if(!1===e(i[c],c,i))break}return t}}function Bo(n){return function(t){var r=ae(t=wa(t))?ve(t):e,o=r?r[0]:t.charAt(0),i=r?Eo(r,1).join(""):t.slice(1);return o[n]()+i}}function Do(n){return function(t){return Bt(Qa(Xa(t).replace(nt,"")),n,"")}}function Ro(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var e=Ye(n.prototype),r=n.apply(e,t);return ta(r)?r:e}}function Vo(n){return function(t,r,o){var i=Mn(t);if(!Wu(t)){var u=si(r,3);t=Pa(t),r=function(n){return u(i[n],n,i)}}var a=n(t,r,o);return a>-1?i[u?t[a]:a]:e}}function Ho(n){return oi((function(t){var o=t.length,i=o,u=Xe.prototype.thru;for(n&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new In(r);if(u&&!c&&"wrapper"==ci(a))var c=new Xe([],!0)}for(i=c?i:o;++i<o;){var l=ci(a=t[i]),s="wrapper"==l?ai(a):e;c=s&&Ei(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[ci(s[0])].apply(c,s[3]):1==a.length&&Ei(a)?c[l]():c.thru(a)}return function(){var n=arguments,e=n[0];if(c&&1==n.length&&Uu(e))return c.plant(e).value();for(var r=0,i=o?t[r].apply(this,n):e;++r<o;)i=t[r].call(this,i);return i}}))}function Yo(n,t,r,o,i,u,a,c,s,f){var d=t&l,h=1&t,v=2&t,p=24&t,g=512&t,y=v?e:Ro(n);return function l(){for(var m=arguments.length,w=an(m),b=m;b--;)w[b]=arguments[b];if(p)var _=li(l),x=function(n,t){for(var e=n.length,r=0;e--;)n[e]===t&&++r;return r}(w,_);if(o&&(w=Oo(w,o,i,p)),u&&(w=jo(w,u,a,p)),m-=x,p&&m<f){var E=se(w,_);return Go(n,t,Yo,l.placeholder,r,w,E,c,s,f-m)}var S=h?r:this,k=v?S[n]:n;return m=w.length,c?w=function(n,t){var r=n.length,o=be(t.length,r),i=Io(n);for(;o--;){var u=t[o];n[o]=bi(u,r)?i[u]:e}return n}(w,c):g&&m>1&&w.reverse(),d&&s<m&&(w.length=s),this&&this!==pt&&this instanceof l&&(k=y||Ro(k)),k.apply(S,w)}}function Zo(n,t){return function(e,r){return function(n,t,e,r){return _r(n,(function(n,o,i){t(r,e(n),o,i)})),r}(e,n,t(r),{})}}function Xo(n,t){return function(r,o){var i;if(r===e&&o===e)return t;if(r!==e&&(i=r),o!==e){if(i===e)return o;"string"==typeof r||"string"==typeof o?(r=so(r),o=so(o)):(r=lo(r),o=lo(o)),i=n(r,o)}return i}}function Uo(n){return oi((function(t){return t=Lt(t,Jt(si())),Kr((function(e){var r=this;return n(t,(function(n){return Nt(n,r,e)}))}))}))}function Fo(n,t){var r=(t=t===e?" ":so(t)).length;if(r<2)return r?qr(t,n):t;var o=qr(t,gt(n/he(t)));return ae(t)?Eo(ve(o),0,n).join(""):o.slice(0,n)}function Wo(n){return function(t,r,o){return o&&"number"!=typeof o&&_i(t,r,o)&&(r=o=e),t=va(t),r===e?(r=t,t=0):r=va(r),function(n,t,e,r){for(var o=-1,i=we(gt((t-n)/(e||1)),0),u=an(i);i--;)u[r?i:++o]=n,n+=e;return u}(t,r,o=o===e?t<r?1:-1:va(o),n)}}function $o(n){return function(t,e){return"string"==typeof t&&"string"==typeof e||(t=ya(t),e=ya(e)),n(t,e)}}function Go(n,t,r,o,i,u,l,s,f,d){var h=8&t;t|=h?a:c,4&(t&=~(h?c:a))||(t&=-4);var v=[n,t,i,h?u:e,h?l:e,h?e:u,h?e:l,s,f,d],p=r.apply(e,v);return Ei(n)&&Ii(p,v),p.placeholder=o,zi(p,n,t)}function qo(n){var t=Nn[n];return function(n,e){if(n=ya(n),(e=null==e?0:be(pa(e),292))&&Vt(n)){var r=(wa(n)+"e").split("e");return+((r=(wa(t(r[0]+"e"+(+r[1]+e)))+"e").split("e"))[0]+"e"+(+r[1]-e))}return t(n)}}var Ko=Me&&1/fe(new Me([,-0]))[1]==f?function(n){return new Me(n)}:lc;function Qo(n){return function(t){var e=gi(t);return e==S?ce(t):e==O?de(t):function(n,t){return Lt(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function Jo(n,t,o,f,d,h,v,p){var g=2&t;if(!g&&"function"!=typeof n)throw new In(r);var y=f?f.length:0;if(y||(t&=-97,f=d=e),v=v===e?v:we(pa(v),0),p=p===e?p:pa(p),y-=d?d.length:0,t&c){var m=f,w=d;f=d=e}var b=g?e:ai(n),_=[n,t,o,f,d,m,w,h,v,p];if(b&&function(n,t){var e=n[1],r=t[1],o=e|r,u=o<131,a=r==l&&8==e||r==l&&e==s&&n[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==e;if(!u&&!a)return n;1&r&&(n[2]=t[2],o|=1&e?0:4);var c=t[3];if(c){var f=n[3];n[3]=f?Oo(f,c,t[4]):c,n[4]=f?se(n[3],i):t[4]}(c=t[5])&&(f=n[5],n[5]=f?jo(f,c,t[6]):c,n[6]=f?se(n[5],i):t[6]);(c=t[7])&&(n[7]=c);r&l&&(n[8]=null==n[8]?t[8]:be(n[8],t[8]));null==n[9]&&(n[9]=t[9]);n[0]=t[0],n[1]=o}(_,b),n=_[0],t=_[1],o=_[2],f=_[3],d=_[4],!(p=_[9]=_[9]===e?g?0:n.length:we(_[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||t==u?function(n,t,r){var o=Ro(n);return function i(){for(var u=arguments.length,a=an(u),c=u,l=li(i);c--;)a[c]=arguments[c];var s=u<3&&a[0]!==l&&a[u-1]!==l?[]:se(a,l);return(u-=s.length)<r?Go(n,t,Yo,i.placeholder,e,a,s,e,e,r-u):Nt(this&&this!==pt&&this instanceof i?o:n,this,a)}}(n,t,p):t!=a&&33!=t||d.length?Yo.apply(e,_):function(n,t,e,r){var o=1&t,i=Ro(n);return function t(){for(var u=-1,a=arguments.length,c=-1,l=r.length,s=an(l+a),f=this&&this!==pt&&this instanceof t?i:n;++c<l;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Nt(f,o?e:this,s)}}(n,t,o,f);else var x=function(n,t,e){var r=1&t,o=Ro(n);return function t(){return(this&&this!==pt&&this instanceof t?o:n).apply(r?e:this,arguments)}}(n,t,o);return zi((b?to:Ii)(x,_),n,t)}function ni(n,t,r,o){return n===e||Hu(n,zn[r])&&!Bn.call(o,r)?t:n}function ti(n,t,r,o,i,u){return ta(n)&&ta(t)&&(u.set(t,n),Zr(n,t,e,ti,u),u.delete(t)),n}function ei(n){return ia(n)?e:n}function ri(n,t,r,o,i,u){var a=1&r,c=n.length,l=t.length;if(c!=l&&!(a&&l>c))return!1;var s=u.get(n),f=u.get(t);if(s&&f)return s==t&&f==n;var d=-1,h=!0,v=2&r?new Ge:e;for(u.set(n,t),u.set(t,n);++d<c;){var p=n[d],g=t[d];if(o)var y=a?o(g,p,d,t,n,u):o(p,g,d,n,t,u);if(y!==e){if(y)continue;h=!1;break}if(v){if(!Rt(t,(function(n,t){if(!te(v,t)&&(p===n||i(p,n,r,o,u)))return v.push(t)}))){h=!1;break}}else if(p!==g&&!i(p,g,r,o,u)){h=!1;break}}return u.delete(n),u.delete(t),h}function oi(n){return Ai(Mi(n,e,Fi),n+"")}function ii(n){return kr(n,Pa,vi)}function ui(n){return kr(n,Aa,pi)}var ai=Ie?function(n){return Ie.get(n)}:lc;function ci(n){for(var t=n.name+"",e=Pe[t],r=Bn.call(Pe,t)?e.length:0;r--;){var o=e[r],i=o.func;if(null==i||i==n)return o.name}return t}function li(n){return(Bn.call(He,"placeholder")?He:n).placeholder}function si(){var n=He.iteratee||ic;return n=n===ic?Tr:n,arguments.length?n(arguments[0],arguments[1]):n}function fi(n,t){var e,r,o=n.__data__;return("string"==(r=typeof(e=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e)?o["string"==typeof t?"string":"hash"]:o.map}function di(n){for(var t=Pa(n),e=t.length;e--;){var r=t[e],o=n[r];t[e]=[r,o,Ci(o)]}return t}function hi(n,t){var r=function(n,t){return null==n?e:n[t]}(n,t);return Lr(r)?r:e}var vi=wt?function(n){return null==n?[]:(n=Mn(n),Pt(wt(n),(function(t){return qn.call(n,t)})))}:gc,pi=wt?function(n){for(var t=[];n;)Tt(t,vi(n)),n=$n(n);return t}:gc,gi=Cr;function yi(n,t,e){for(var r=-1,o=(t=_o(t,n)).length,i=!1;++r<o;){var u=Di(t[r]);if(!(i=null!=n&&e(n,u)))break;n=n[u]}return i||++r!=o?i:!!(o=null==n?0:n.length)&&na(o)&&bi(u,o)&&(Uu(n)||Xu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Ye($n(n))}function wi(n){return Uu(n)||Xu(n)||!!(Qn&&n&&n[Qn])}function bi(n,t){var e=typeof n;return!!(t=null==t?d:t)&&("number"==e||"symbol"!=e&&bn.test(n))&&n>-1&&n%1==0&&n<t}function _i(n,t,e){if(!ta(e))return!1;var r=typeof t;return!!("number"==r?Wu(e)&&bi(t,e.length):"string"==r&&t in e)&&Hu(e[t],n)}function xi(n,t){if(Uu(n))return!1;var e=typeof n;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=n&&!la(n))||(tn.test(n)||!nn.test(n)||null!=t&&n in Mn(t))}function Ei(n){var t=ci(n),e=He[t];if("function"!=typeof e||!(t in Ue.prototype))return!1;if(n===e)return!0;var r=ai(e);return!!r&&n===r[0]}(ke&&gi(new ke(new ArrayBuffer(1)))!=z||Ce&&gi(new Ce)!=S||Ne&&gi(Ne.resolve())!=N||Me&&gi(new Me)!=O||Oe&&gi(new Oe)!=P)&&(gi=function(n){var t=Cr(n),r=t==C?n.constructor:e,o=r?Ri(r):"";if(o)switch(o){case Ae:return z;case ze:return S;case Le:return N;case Te:return O;case Be:return P}return t});var Si=Ln?Qu:yc;function ki(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||zn)}function Ci(n){return n==n&&!ta(n)}function Ni(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==e||n in Mn(r)))}}function Mi(n,t,r){return t=we(t===e?n.length-1:t,0),function(){for(var e=arguments,o=-1,i=we(e.length-t,0),u=an(i);++o<i;)u[o]=e[t+o];o=-1;for(var a=an(t+1);++o<t;)a[o]=e[o];return a[t]=r(u),Nt(n,this,a)}}function Oi(n,t){return t.length<2?n:Sr(n,oo(t,0,-1))}function ji(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Ii=Li(to),Pi=vt||function(n,t){return pt.setTimeout(n,t)},Ai=Li(eo);function zi(n,t,e){var r=t+"";return Ai(n,function(n,t){var e=t.length;if(!e)return n;var r=e-1;return t[r]=(e>1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+t+"] */\n")}(r,function(n,t){return Ot(p,(function(e){var r="_."+e[0];t&e[1]&&!At(n,r)&&n.push(r)})),n.sort()}(function(n){var t=n.match(ln);return t?t[1].split(sn):[]}(r),e)))}function Li(n){var t=0,r=0;return function(){var o=_e(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(e,arguments)}}function Ti(n,t){var r=-1,o=n.length,i=o-1;for(t=t===e?o:t;++r<t;){var u=Gr(r,i),a=n[u];n[u]=n[r],n[r]=a}return n.length=t,n}var Bi=function(n){var t=Lu(n,(function(n){return 500===e.size&&e.clear(),n})),e=t.cache;return t}((function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(en,(function(n,e,r,o){t.push(r?o.replace(hn,"$1"):e||n)})),t}));function Di(n){if("string"==typeof n||la(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ri(n){if(null!=n){try{return Tn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Ue)return n.clone();var t=new Xe(n.__wrapped__,n.__chain__);return t.__actions__=Io(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var Hi=Kr((function(n,t){return $u(n)?dr(n,mr(t,1,$u,!0)):[]})),Yi=Kr((function(n,t){var r=Ki(t);return $u(r)&&(r=e),$u(n)?dr(n,mr(t,1,$u,!0),si(r,2)):[]})),Zi=Kr((function(n,t){var r=Ki(t);return $u(r)&&(r=e),$u(n)?dr(n,mr(t,1,$u,!0),e,r):[]}));function Xi(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var o=null==e?0:pa(e);return o<0&&(o=we(r+o,0)),Yt(n,si(t,3),o)}function Ui(n,t,r){var o=null==n?0:n.length;if(!o)return-1;var i=o-1;return r!==e&&(i=pa(r),i=r<0?we(o+i,0):be(i,o-1)),Yt(n,si(t,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Wi(n){return n&&n.length?n[0]:e}var $i=Kr((function(n){var t=Lt(n,wo);return t.length&&t[0]===n[0]?jr(t):[]})),Gi=Kr((function(n){var t=Ki(n),r=Lt(n,wo);return t===Ki(r)?t=e:r.pop(),r.length&&r[0]===n[0]?jr(r,si(t,2)):[]})),qi=Kr((function(n){var t=Ki(n),r=Lt(n,wo);return(t="function"==typeof t?t:e)&&r.pop(),r.length&&r[0]===n[0]?jr(r,e,t):[]}));function Ki(n){var t=null==n?0:n.length;return t?n[t-1]:e}var Qi=Kr(Ji);function Ji(n,t){return n&&n.length&&t&&t.length?Wr(n,t):n}var nu=oi((function(n,t){var e=null==n?0:n.length,r=ar(n,t);return $r(n,Lt(t,(function(n){return bi(n,e)?+n:n})).sort(Mo)),r}));function tu(n){return null==n?n:Se.call(n)}var eu=Kr((function(n){return fo(mr(n,1,$u,!0))})),ru=Kr((function(n){var t=Ki(n);return $u(t)&&(t=e),fo(mr(n,1,$u,!0),si(t,2))})),ou=Kr((function(n){var t=Ki(n);return t="function"==typeof t?t:e,fo(mr(n,1,$u,!0),e,t)}));function iu(n){if(!n||!n.length)return[];var t=0;return n=Pt(n,(function(n){if($u(n))return t=we(n.length,t),!0})),Kt(t,(function(t){return Lt(n,Wt(t))}))}function uu(n,t){if(!n||!n.length)return[];var r=iu(n);return null==t?r:Lt(r,(function(n){return Nt(t,e,n)}))}var au=Kr((function(n,t){return $u(n)?dr(n,t):[]})),cu=Kr((function(n){return yo(Pt(n,$u))})),lu=Kr((function(n){var t=Ki(n);return $u(t)&&(t=e),yo(Pt(n,$u),si(t,2))})),su=Kr((function(n){var t=Ki(n);return t="function"==typeof t?t:e,yo(Pt(n,$u),e,t)})),fu=Kr(iu);var du=Kr((function(n){var t=n.length,r=t>1?n[t-1]:e;return r="function"==typeof r?(n.pop(),r):e,uu(n,r)}));function hu(n){var t=He(n);return t.__chain__=!0,t}function vu(n,t){return t(n)}var pu=oi((function(n){var t=n.length,r=t?n[0]:0,o=this.__wrapped__,i=function(t){return ar(t,n)};return!(t>1||this.__actions__.length)&&o instanceof Ue&&bi(r)?((o=o.slice(r,+r+(t?1:0))).__actions__.push({func:vu,args:[i],thisArg:e}),new Xe(o,this.__chain__).thru((function(n){return t&&!n.length&&n.push(e),n}))):this.thru(i)}));var gu=Ao((function(n,t,e){Bn.call(n,e)?++n[e]:ur(n,e,1)}));var yu=Vo(Xi),mu=Vo(Ui);function wu(n,t){return(Uu(n)?Ot:hr)(n,si(t,3))}function bu(n,t){return(Uu(n)?jt:vr)(n,si(t,3))}var _u=Ao((function(n,t,e){Bn.call(n,e)?n[e].push(t):ur(n,e,[t])}));var xu=Kr((function(n,t,e){var r=-1,o="function"==typeof t,i=Wu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Nt(t,n,e):Ir(n,t,e)})),i})),Eu=Ao((function(n,t,e){ur(n,e,t)}));function Su(n,t){return(Uu(n)?Lt:Vr)(n,si(t,3))}var ku=Ao((function(n,t,e){n[e?0:1].push(t)}),(function(){return[[],[]]}));var Cu=Kr((function(n,t){if(null==n)return[];var e=t.length;return e>1&&_i(n,t[0],t[1])?t=[]:e>2&&_i(t[0],t[1],t[2])&&(t=[t[0]]),Ur(n,mr(t,1),[])})),Nu=ht||function(){return pt.Date.now()};function Mu(n,t,r){return t=r?e:t,t=n&&null==t?n.length:t,Jo(n,l,e,e,e,e,t)}function Ou(n,t){var o;if("function"!=typeof t)throw new In(r);return n=pa(n),function(){return--n>0&&(o=t.apply(this,arguments)),n<=1&&(t=e),o}}var ju=Kr((function(n,t,e){var r=1;if(e.length){var o=se(e,li(ju));r|=a}return Jo(n,r,t,e,o)})),Iu=Kr((function(n,t,e){var r=3;if(e.length){var o=se(e,li(Iu));r|=a}return Jo(t,r,n,e,o)}));function Pu(n,t,o){var i,u,a,c,l,s,f=0,d=!1,h=!1,v=!0;if("function"!=typeof n)throw new In(r);function p(t){var r=i,o=u;return i=u=e,f=t,c=n.apply(o,r)}function g(n){var r=n-s;return s===e||r>=t||r<0||h&&n-f>=a}function y(){var n=Nu();if(g(n))return m(n);l=Pi(y,function(n){var e=t-(n-s);return h?be(e,a-(n-f)):e}(n))}function m(n){return l=e,v&&i?p(n):(i=u=e,c)}function w(){var n=Nu(),r=g(n);if(i=arguments,u=this,s=n,r){if(l===e)return function(n){return f=n,l=Pi(y,t),d?p(n):c}(s);if(h)return So(l),l=Pi(y,t),p(s)}return l===e&&(l=Pi(y,t)),c}return t=ya(t)||0,ta(o)&&(d=!!o.leading,a=(h="maxWait"in o)?we(ya(o.maxWait)||0,t):a,v="trailing"in o?!!o.trailing:v),w.cancel=function(){l!==e&&So(l),f=0,i=s=u=l=e},w.flush=function(){return l===e?c:m(Nu())},w}var Au=Kr((function(n,t){return fr(n,1,t)})),zu=Kr((function(n,t,e){return fr(n,ya(t)||0,e)}));function Lu(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new In(r);var e=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=e.cache;if(i.has(o))return i.get(o);var u=n.apply(this,r);return e.cache=i.set(o,u)||i,u};return e.cache=new(Lu.Cache||$e),e}function Tu(n){if("function"!=typeof n)throw new In(r);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Lu.Cache=$e;var Bu=xo((function(n,t){var e=(t=1==t.length&&Uu(t[0])?Lt(t[0],Jt(si())):Lt(mr(t,1),Jt(si()))).length;return Kr((function(r){for(var o=-1,i=be(r.length,e);++o<i;)r[o]=t[o].call(this,r[o]);return Nt(n,this,r)}))})),Du=Kr((function(n,t){var r=se(t,li(Du));return Jo(n,a,e,t,r)})),Ru=Kr((function(n,t){var r=se(t,li(Ru));return Jo(n,c,e,t,r)})),Vu=oi((function(n,t){return Jo(n,s,e,e,e,t)}));function Hu(n,t){return n===t||n!=n&&t!=t}var Yu=$o(Nr),Zu=$o((function(n,t){return n>=t})),Xu=Pr(function(){return arguments}())?Pr:function(n){return ea(n)&&Bn.call(n,"callee")&&!qn.call(n,"callee")},Uu=an.isArray,Fu=_t?Jt(_t):function(n){return ea(n)&&Cr(n)==A};function Wu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ea(n)&&Wu(n)}var Gu=bt||yc,qu=xt?Jt(xt):function(n){return ea(n)&&Cr(n)==b};function Ku(n){if(!ea(n))return!1;var t=Cr(n);return t==_||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qu(n){if(!ta(n))return!1;var t=Cr(n);return t==x||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ju(n){return"number"==typeof n&&n==pa(n)}function na(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=d}function ta(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function ea(n){return null!=n&&"object"==typeof n}var ra=Et?Jt(Et):function(n){return ea(n)&&gi(n)==S};function oa(n){return"number"==typeof n||ea(n)&&Cr(n)==k}function ia(n){if(!ea(n)||Cr(n)!=C)return!1;var t=$n(n);if(null===t)return!0;var e=Bn.call(t,"constructor")&&t.constructor;return"function"==typeof e&&e instanceof e&&Tn.call(e)==Hn}var ua=St?Jt(St):function(n){return ea(n)&&Cr(n)==M};var aa=kt?Jt(kt):function(n){return ea(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Uu(n)&&ea(n)&&Cr(n)==j}function la(n){return"symbol"==typeof n||ea(n)&&Cr(n)==I}var sa=Ct?Jt(Ct):function(n){return ea(n)&&na(n.length)&&!!ct[Cr(n)]};var fa=$o(Rr),da=$o((function(n,t){return n<=t}));function ha(n){if(!n)return[];if(Wu(n))return ca(n)?ve(n):Io(n);if(Jn&&n[Jn])return function(n){for(var t,e=[];!(t=n.next()).done;)e.push(t.value);return e}(n[Jn]());var t=gi(n);return(t==S?ce:t==O?fe:Ha)(n)}function va(n){return n?(n=ya(n))===f||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function pa(n){var t=va(n),e=t%1;return t==t?e?t-e:t:0}function ga(n){return n?cr(pa(n),0,v):0}function ya(n){if("number"==typeof n)return n;if(la(n))return h;if(ta(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ta(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Qt(n);var e=yn.test(n);return e||wn.test(n)?dt(n.slice(2),e?2:8):gn.test(n)?h:+n}function ma(n){return Po(n,Aa(n))}function wa(n){return null==n?"":so(n)}var ba=zo((function(n,t){if(ki(t)||Wu(t))Po(t,Pa(t),n);else for(var e in t)Bn.call(t,e)&&er(n,e,t[e])})),_a=zo((function(n,t){Po(t,Aa(t),n)})),xa=zo((function(n,t,e,r){Po(t,Aa(t),n,r)})),Ea=zo((function(n,t,e,r){Po(t,Pa(t),n,r)})),Sa=oi(ar);var ka=Kr((function(n,t){n=Mn(n);var r=-1,o=t.length,i=o>2?t[2]:e;for(i&&_i(t[0],t[1],i)&&(o=1);++r<o;)for(var u=t[r],a=Aa(u),c=-1,l=a.length;++c<l;){var s=a[c],f=n[s];(f===e||Hu(f,zn[s])&&!Bn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(e,ti),Nt(La,e,n)}));function Na(n,t,r){var o=null==n?e:Sr(n,t);return o===e?r:o}function Ma(n,t){return null!=n&&yi(n,t,Or)}var Oa=Zo((function(n,t,e){null!=t&&"function"!=typeof t.toString&&(t=Vn.call(t)),n[t]=e}),tc(oc)),ja=Zo((function(n,t,e){null!=t&&"function"!=typeof t.toString&&(t=Vn.call(t)),Bn.call(n,t)?n[t].push(e):n[t]=[e]}),si),Ia=Kr(Ir);function Pa(n){return Wu(n)?Ke(n):Br(n)}function Aa(n){return Wu(n)?Ke(n,!0):Dr(n)}var za=zo((function(n,t,e){Zr(n,t,e)})),La=zo((function(n,t,e,r){Zr(n,t,e,r)})),Ta=oi((function(n,t){var e={};if(null==n)return e;var r=!1;t=Lt(t,(function(t){return t=_o(t,n),r||(r=t.length>1),t})),Po(n,ui(n),e),r&&(e=lr(e,7,ei));for(var o=t.length;o--;)ho(e,t[o]);return e}));var Ba=oi((function(n,t){return null==n?{}:function(n,t){return Fr(n,t,(function(t,e){return Ma(n,e)}))}(n,t)}));function Da(n,t){if(null==n)return{};var e=Lt(ui(n),(function(n){return[n]}));return t=si(t),Fr(n,e,(function(n,e){return t(n,e[0])}))}var Ra=Qo(Pa),Va=Qo(Aa);function Ha(n){return null==n?[]:ne(n,Pa(n))}var Ya=Do((function(n,t,e){return t=t.toLowerCase(),n+(e?Za(t):t)}));function Za(n){return Ka(wa(n).toLowerCase())}function Xa(n){return(n=wa(n))&&n.replace(_n,oe).replace(tt,"")}var Ua=Do((function(n,t,e){return n+(e?"-":"")+t.toLowerCase()})),Fa=Do((function(n,t,e){return n+(e?" ":"")+t.toLowerCase()})),Wa=Bo("toLowerCase");var $a=Do((function(n,t,e){return n+(e?"_":"")+t.toLowerCase()}));var Ga=Do((function(n,t,e){return n+(e?" ":"")+Ka(t)}));var qa=Do((function(n,t,e){return n+(e?" ":"")+t.toUpperCase()})),Ka=Bo("toUpperCase");function Qa(n,t,r){return n=wa(n),(t=r?e:t)===e?function(n){return it.test(n)}(n)?function(n){return n.match(rt)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(t)||[]}var Ja=Kr((function(n,t){try{return Nt(n,e,t)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,t){return Ot(t,(function(t){t=Di(t),ur(n,t,ju(n[t],n))})),n}));function tc(n){return function(){return n}}var ec=Ho(),rc=Ho(!0);function oc(n){return n}function ic(n){return Tr("function"==typeof n?n:lr(n,1))}var uc=Kr((function(n,t){return function(e){return Ir(e,n,t)}})),ac=Kr((function(n,t){return function(e){return Ir(n,e,t)}}));function cc(n,t,e){var r=Pa(t),o=Er(t,r);null!=e||ta(t)&&(o.length||!r.length)||(e=t,t=n,n=this,o=Er(t,Pa(t)));var i=!(ta(e)&&"chain"in e&&!e.chain),u=Qu(n);return Ot(o,(function(e){var r=t[e];n[e]=r,u&&(n.prototype[e]=function(){var t=this.__chain__;if(i||t){var e=n(this.__wrapped__);return(e.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:n}),e.__chain__=t,e}return r.apply(n,Tt([this.value()],arguments))})})),n}function lc(){}var sc=Uo(Lt),fc=Uo(It),dc=Uo(Rt);function hc(n){return xi(n)?Wt(Di(n)):function(n){return function(t){return Sr(t,n)}}(n)}var vc=Wo(),pc=Wo(!0);function gc(){return[]}function yc(){return!1}var mc=Xo((function(n,t){return n+t}),0),wc=qo("ceil"),bc=Xo((function(n,t){return n/t}),1),_c=qo("floor");var xc,Ec=Xo((function(n,t){return n*t}),1),Sc=qo("round"),kc=Xo((function(n,t){return n-t}),0);return He.after=function(n,t){if("function"!=typeof t)throw new In(r);return n=pa(n),function(){if(--n<1)return t.apply(this,arguments)}},He.ary=Mu,He.assign=ba,He.assignIn=_a,He.assignInWith=xa,He.assignWith=Ea,He.at=Sa,He.before=Ou,He.bind=ju,He.bindAll=nc,He.bindKey=Iu,He.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Uu(n)?n:[n]},He.chain=hu,He.chunk=function(n,t,r){t=(r?_i(n,t,r):t===e)?1:we(pa(t),0);var o=null==n?0:n.length;if(!o||t<1)return[];for(var i=0,u=0,a=an(gt(o/t));i<o;)a[u++]=oo(n,i,i+=t);return a},He.compact=function(n){for(var t=-1,e=null==n?0:n.length,r=0,o=[];++t<e;){var i=n[t];i&&(o[r++]=i)}return o},He.concat=function(){var n=arguments.length;if(!n)return[];for(var t=an(n-1),e=arguments[0],r=n;r--;)t[r-1]=arguments[r];return Tt(Uu(e)?Io(e):[e],mr(t,1))},He.cond=function(n){var t=null==n?0:n.length,e=si();return n=t?Lt(n,(function(n){if("function"!=typeof n[1])throw new In(r);return[e(n[0]),n[1]]})):[],Kr((function(e){for(var r=-1;++r<t;){var o=n[r];if(Nt(o[0],this,e))return Nt(o[1],this,e)}}))},He.conforms=function(n){return function(n){var t=Pa(n);return function(e){return sr(e,n,t)}}(lr(n,1))},He.constant=tc,He.countBy=gu,He.create=function(n,t){var e=Ye(n);return null==t?e:ir(e,t)},He.curry=function n(t,r,o){var i=Jo(t,8,e,e,e,e,e,r=o?e:r);return i.placeholder=n.placeholder,i},He.curryRight=function n(t,r,o){var i=Jo(t,u,e,e,e,e,e,r=o?e:r);return i.placeholder=n.placeholder,i},He.debounce=Pu,He.defaults=ka,He.defaultsDeep=Ca,He.defer=Au,He.delay=zu,He.difference=Hi,He.differenceBy=Yi,He.differenceWith=Zi,He.drop=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,(t=r||t===e?1:pa(t))<0?0:t,o):[]},He.dropRight=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,0,(t=o-(t=r||t===e?1:pa(t)))<0?0:t):[]},He.dropRightWhile=function(n,t){return n&&n.length?po(n,si(t,3),!0,!0):[]},He.dropWhile=function(n,t){return n&&n.length?po(n,si(t,3),!0):[]},He.fill=function(n,t,r,o){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&_i(n,t,r)&&(r=0,o=i),function(n,t,r,o){var i=n.length;for((r=pa(r))<0&&(r=-r>i?0:i+r),(o=o===e||o>i?i:pa(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)n[r++]=t;return n}(n,t,r,o)):[]},He.filter=function(n,t){return(Uu(n)?Pt:yr)(n,si(t,3))},He.flatMap=function(n,t){return mr(Su(n,t),1)},He.flatMapDeep=function(n,t){return mr(Su(n,t),f)},He.flatMapDepth=function(n,t,r){return r=r===e?1:pa(r),mr(Su(n,t),r)},He.flatten=Fi,He.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,f):[]},He.flattenDepth=function(n,t){return(null==n?0:n.length)?mr(n,t=t===e?1:pa(t)):[]},He.flip=function(n){return Jo(n,512)},He.flow=ec,He.flowRight=rc,He.fromPairs=function(n){for(var t=-1,e=null==n?0:n.length,r={};++t<e;){var o=n[t];r[o[0]]=o[1]}return r},He.functions=function(n){return null==n?[]:Er(n,Pa(n))},He.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},He.groupBy=_u,He.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},He.intersection=$i,He.intersectionBy=Gi,He.intersectionWith=qi,He.invert=Oa,He.invertBy=ja,He.invokeMap=xu,He.iteratee=ic,He.keyBy=Eu,He.keys=Pa,He.keysIn=Aa,He.map=Su,He.mapKeys=function(n,t){var e={};return t=si(t,3),_r(n,(function(n,r,o){ur(e,t(n,r,o),n)})),e},He.mapValues=function(n,t){var e={};return t=si(t,3),_r(n,(function(n,r,o){ur(e,r,t(n,r,o))})),e},He.matches=function(n){return Hr(lr(n,1))},He.matchesProperty=function(n,t){return Yr(n,lr(t,1))},He.memoize=Lu,He.merge=za,He.mergeWith=La,He.method=uc,He.methodOf=ac,He.mixin=cc,He.negate=Tu,He.nthArg=function(n){return n=pa(n),Kr((function(t){return Xr(t,n)}))},He.omit=Ta,He.omitBy=function(n,t){return Da(n,Tu(si(t)))},He.once=function(n){return Ou(2,n)},He.orderBy=function(n,t,r,o){return null==n?[]:(Uu(t)||(t=null==t?[]:[t]),Uu(r=o?e:r)||(r=null==r?[]:[r]),Ur(n,t,r))},He.over=sc,He.overArgs=Bu,He.overEvery=fc,He.overSome=dc,He.partial=Du,He.partialRight=Ru,He.partition=ku,He.pick=Ba,He.pickBy=Da,He.property=hc,He.propertyOf=function(n){return function(t){return null==n?e:Sr(n,t)}},He.pull=Qi,He.pullAll=Ji,He.pullAllBy=function(n,t,e){return n&&n.length&&t&&t.length?Wr(n,t,si(e,2)):n},He.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Wr(n,t,e,r):n},He.pullAt=nu,He.range=vc,He.rangeRight=pc,He.rearg=Vu,He.reject=function(n,t){return(Uu(n)?Pt:yr)(n,Tu(si(t,3)))},He.remove=function(n,t){var e=[];if(!n||!n.length)return e;var r=-1,o=[],i=n.length;for(t=si(t,3);++r<i;){var u=n[r];t(u,r,n)&&(e.push(u),o.push(r))}return $r(n,o),e},He.rest=function(n,t){if("function"!=typeof n)throw new In(r);return Kr(n,t=t===e?t:pa(t))},He.reverse=tu,He.sampleSize=function(n,t,r){return t=(r?_i(n,t,r):t===e)?1:pa(t),(Uu(n)?Je:Jr)(n,t)},He.set=function(n,t,e){return null==n?n:no(n,t,e)},He.setWith=function(n,t,r,o){return o="function"==typeof o?o:e,null==n?n:no(n,t,r,o)},He.shuffle=function(n){return(Uu(n)?nr:ro)(n)},He.slice=function(n,t,r){var o=null==n?0:n.length;return o?(r&&"number"!=typeof r&&_i(n,t,r)?(t=0,r=o):(t=null==t?0:pa(t),r=r===e?o:pa(r)),oo(n,t,r)):[]},He.sortBy=Cu,He.sortedUniq=function(n){return n&&n.length?co(n):[]},He.sortedUniqBy=function(n,t){return n&&n.length?co(n,si(t,2)):[]},He.split=function(n,t,r){return r&&"number"!=typeof r&&_i(n,t,r)&&(t=r=e),(r=r===e?v:r>>>0)?(n=wa(n))&&("string"==typeof t||null!=t&&!ua(t))&&!(t=so(t))&&ae(n)?Eo(ve(n),0,r):n.split(t,r):[]},He.spread=function(n,t){if("function"!=typeof n)throw new In(r);return t=null==t?0:we(pa(t),0),Kr((function(e){var r=e[t],o=Eo(e,0,t);return r&&Tt(o,r),Nt(n,this,o)}))},He.tail=function(n){var t=null==n?0:n.length;return t?oo(n,1,t):[]},He.take=function(n,t,r){return n&&n.length?oo(n,0,(t=r||t===e?1:pa(t))<0?0:t):[]},He.takeRight=function(n,t,r){var o=null==n?0:n.length;return o?oo(n,(t=o-(t=r||t===e?1:pa(t)))<0?0:t,o):[]},He.takeRightWhile=function(n,t){return n&&n.length?po(n,si(t,3),!1,!0):[]},He.takeWhile=function(n,t){return n&&n.length?po(n,si(t,3)):[]},He.tap=function(n,t){return t(n),n},He.throttle=function(n,t,e){var o=!0,i=!0;if("function"!=typeof n)throw new In(r);return ta(e)&&(o="leading"in e?!!e.leading:o,i="trailing"in e?!!e.trailing:i),Pu(n,t,{leading:o,maxWait:t,trailing:i})},He.thru=vu,He.toArray=ha,He.toPairs=Ra,He.toPairsIn=Va,He.toPath=function(n){return Uu(n)?Lt(n,Di):la(n)?[n]:Io(Bi(wa(n)))},He.toPlainObject=ma,He.transform=function(n,t,e){var r=Uu(n),o=r||Gu(n)||sa(n);if(t=si(t,4),null==e){var i=n&&n.constructor;e=o?r?new i:[]:ta(n)&&Qu(i)?Ye($n(n)):{}}return(o?Ot:_r)(n,(function(n,r,o){return t(e,n,r,o)})),e},He.unary=function(n){return Mu(n,1)},He.union=eu,He.unionBy=ru,He.unionWith=ou,He.uniq=function(n){return n&&n.length?fo(n):[]},He.uniqBy=function(n,t){return n&&n.length?fo(n,si(t,2)):[]},He.uniqWith=function(n,t){return t="function"==typeof t?t:e,n&&n.length?fo(n,e,t):[]},He.unset=function(n,t){return null==n||ho(n,t)},He.unzip=iu,He.unzipWith=uu,He.update=function(n,t,e){return null==n?n:vo(n,t,bo(e))},He.updateWith=function(n,t,r,o){return o="function"==typeof o?o:e,null==n?n:vo(n,t,bo(r),o)},He.values=Ha,He.valuesIn=function(n){return null==n?[]:ne(n,Aa(n))},He.without=au,He.words=Qa,He.wrap=function(n,t){return Du(bo(t),n)},He.xor=cu,He.xorBy=lu,He.xorWith=su,He.zip=fu,He.zipObject=function(n,t){return mo(n||[],t||[],er)},He.zipObjectDeep=function(n,t){return mo(n||[],t||[],no)},He.zipWith=du,He.entries=Ra,He.entriesIn=Va,He.extend=_a,He.extendWith=xa,cc(He,He),He.add=mc,He.attempt=Ja,He.camelCase=Ya,He.capitalize=Za,He.ceil=wc,He.clamp=function(n,t,r){return r===e&&(r=t,t=e),r!==e&&(r=(r=ya(r))==r?r:0),t!==e&&(t=(t=ya(t))==t?t:0),cr(ya(n),t,r)},He.clone=function(n){return lr(n,4)},He.cloneDeep=function(n){return lr(n,5)},He.cloneDeepWith=function(n,t){return lr(n,5,t="function"==typeof t?t:e)},He.cloneWith=function(n,t){return lr(n,4,t="function"==typeof t?t:e)},He.conformsTo=function(n,t){return null==t||sr(n,t,Pa(t))},He.deburr=Xa,He.defaultTo=function(n,t){return null==n||n!=n?t:n},He.divide=bc,He.endsWith=function(n,t,r){n=wa(n),t=so(t);var o=n.length,i=r=r===e?o:cr(pa(r),0,o);return(r-=t.length)>=0&&n.slice(r,i)==t},He.eq=Hu,He.escape=function(n){return(n=wa(n))&&q.test(n)?n.replace($,ie):n},He.escapeRegExp=function(n){return(n=wa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},He.every=function(n,t,r){var o=Uu(n)?It:pr;return r&&_i(n,t,r)&&(t=e),o(n,si(t,3))},He.find=yu,He.findIndex=Xi,He.findKey=function(n,t){return Ht(n,si(t,3),_r)},He.findLast=mu,He.findLastIndex=Ui,He.findLastKey=function(n,t){return Ht(n,si(t,3),xr)},He.floor=_c,He.forEach=wu,He.forEachRight=bu,He.forIn=function(n,t){return null==n?n:wr(n,si(t,3),Aa)},He.forInRight=function(n,t){return null==n?n:br(n,si(t,3),Aa)},He.forOwn=function(n,t){return n&&_r(n,si(t,3))},He.forOwnRight=function(n,t){return n&&xr(n,si(t,3))},He.get=Na,He.gt=Yu,He.gte=Zu,He.has=function(n,t){return null!=n&&yi(n,t,Mr)},He.hasIn=Ma,He.head=Wi,He.identity=oc,He.includes=function(n,t,e,r){n=Wu(n)?n:Ha(n),e=e&&!r?pa(e):0;var o=n.length;return e<0&&(e=we(o+e,0)),ca(n)?e<=o&&n.indexOf(t,e)>-1:!!o&&Zt(n,t,e)>-1},He.indexOf=function(n,t,e){var r=null==n?0:n.length;if(!r)return-1;var o=null==e?0:pa(e);return o<0&&(o=we(r+o,0)),Zt(n,t,o)},He.inRange=function(n,t,r){return t=va(t),r===e?(r=t,t=0):r=va(r),function(n,t,e){return n>=be(t,e)&&n<we(t,e)}(n=ya(n),t,r)},He.invoke=Ia,He.isArguments=Xu,He.isArray=Uu,He.isArrayBuffer=Fu,He.isArrayLike=Wu,He.isArrayLikeObject=$u,He.isBoolean=function(n){return!0===n||!1===n||ea(n)&&Cr(n)==m},He.isBuffer=Gu,He.isDate=qu,He.isElement=function(n){return ea(n)&&1===n.nodeType&&!ia(n)},He.isEmpty=function(n){if(null==n)return!0;if(Wu(n)&&(Uu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Xu(n)))return!n.length;var t=gi(n);if(t==S||t==O)return!n.size;if(ki(n))return!Br(n).length;for(var e in n)if(Bn.call(n,e))return!1;return!0},He.isEqual=function(n,t){return Ar(n,t)},He.isEqualWith=function(n,t,r){var o=(r="function"==typeof r?r:e)?r(n,t):e;return o===e?Ar(n,t,e,r):!!o},He.isError=Ku,He.isFinite=function(n){return"number"==typeof n&&Vt(n)},He.isFunction=Qu,He.isInteger=Ju,He.isLength=na,He.isMap=ra,He.isMatch=function(n,t){return n===t||zr(n,t,di(t))},He.isMatchWith=function(n,t,r){return r="function"==typeof r?r:e,zr(n,t,di(t),r)},He.isNaN=function(n){return oa(n)&&n!=+n},He.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},He.isNil=function(n){return null==n},He.isNull=function(n){return null===n},He.isNumber=oa,He.isObject=ta,He.isObjectLike=ea,He.isPlainObject=ia,He.isRegExp=ua,He.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=d},He.isSet=aa,He.isString=ca,He.isSymbol=la,He.isTypedArray=sa,He.isUndefined=function(n){return n===e},He.isWeakMap=function(n){return ea(n)&&gi(n)==P},He.isWeakSet=function(n){return ea(n)&&"[object WeakSet]"==Cr(n)},He.join=function(n,t){return null==n?"":$t.call(n,t)},He.kebabCase=Ua,He.last=Ki,He.lastIndexOf=function(n,t,r){var o=null==n?0:n.length;if(!o)return-1;var i=o;return r!==e&&(i=(i=pa(r))<0?we(o+i,0):be(i,o-1)),t==t?function(n,t,e){for(var r=e+1;r--;)if(n[r]===t)return r;return r}(n,t,i):Yt(n,Ut,i,!0)},He.lowerCase=Fa,He.lowerFirst=Wa,He.lt=fa,He.lte=da,He.max=function(n){return n&&n.length?gr(n,oc,Nr):e},He.maxBy=function(n,t){return n&&n.length?gr(n,si(t,2),Nr):e},He.mean=function(n){return Ft(n,oc)},He.meanBy=function(n,t){return Ft(n,si(t,2))},He.min=function(n){return n&&n.length?gr(n,oc,Rr):e},He.minBy=function(n,t){return n&&n.length?gr(n,si(t,2),Rr):e},He.stubArray=gc,He.stubFalse=yc,He.stubObject=function(){return{}},He.stubString=function(){return""},He.stubTrue=function(){return!0},He.multiply=Ec,He.nth=function(n,t){return n&&n.length?Xr(n,pa(t)):e},He.noConflict=function(){return pt._===this&&(pt._=Yn),this},He.noop=lc,He.now=Nu,He.pad=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;if(!t||r>=t)return n;var o=(t-r)/2;return Fo(yt(o),e)+n+Fo(gt(o),e)},He.padEnd=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;return t&&r<t?n+Fo(t-r,e):n},He.padStart=function(n,t,e){n=wa(n);var r=(t=pa(t))?he(n):0;return t&&r<t?Fo(t-r,e)+n:n},He.parseInt=function(n,t,e){return e||null==t?t=0:t&&(t=+t),xe(wa(n).replace(un,""),t||0)},He.random=function(n,t,r){if(r&&"boolean"!=typeof r&&_i(n,t,r)&&(t=r=e),r===e&&("boolean"==typeof t?(r=t,t=e):"boolean"==typeof n&&(r=n,n=e)),n===e&&t===e?(n=0,t=1):(n=va(n),t===e?(t=n,n=0):t=va(t)),n>t){var o=n;n=t,t=o}if(r||n%1||t%1){var i=Ee();return be(n+i*(t-n+ft("1e-"+((i+"").length-1))),t)}return Gr(n,t)},He.reduce=function(n,t,e){var r=Uu(n)?Bt:Gt,o=arguments.length<3;return r(n,si(t,4),e,o,hr)},He.reduceRight=function(n,t,e){var r=Uu(n)?Dt:Gt,o=arguments.length<3;return r(n,si(t,4),e,o,vr)},He.repeat=function(n,t,r){return t=(r?_i(n,t,r):t===e)?1:pa(t),qr(wa(n),t)},He.replace=function(){var n=arguments,t=wa(n[0]);return n.length<3?t:t.replace(n[1],n[2])},He.result=function(n,t,r){var o=-1,i=(t=_o(t,n)).length;for(i||(i=1,n=e);++o<i;){var u=null==n?e:n[Di(t[o])];u===e&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},He.round=Sc,He.runInContext=n,He.sample=function(n){return(Uu(n)?Qe:Qr)(n)},He.size=function(n){if(null==n)return 0;if(Wu(n))return ca(n)?he(n):n.length;var t=gi(n);return t==S||t==O?n.size:Br(n).length},He.snakeCase=$a,He.some=function(n,t,r){var o=Uu(n)?Rt:io;return r&&_i(n,t,r)&&(t=e),o(n,si(t,3))},He.sortedIndex=function(n,t){return uo(n,t)},He.sortedIndexBy=function(n,t,e){return ao(n,t,si(e,2))},He.sortedIndexOf=function(n,t){var e=null==n?0:n.length;if(e){var r=uo(n,t);if(r<e&&Hu(n[r],t))return r}return-1},He.sortedLastIndex=function(n,t){return uo(n,t,!0)},He.sortedLastIndexBy=function(n,t,e){return ao(n,t,si(e,2),!0)},He.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var e=uo(n,t,!0)-1;if(Hu(n[e],t))return e}return-1},He.startCase=Ga,He.startsWith=function(n,t,e){return n=wa(n),e=null==e?0:cr(pa(e),0,n.length),t=so(t),n.slice(e,e+t.length)==t},He.subtract=kc,He.sum=function(n){return n&&n.length?qt(n,oc):0},He.sumBy=function(n,t){return n&&n.length?qt(n,si(t,2)):0},He.template=function(n,t,r){var o=He.templateSettings;r&&_i(n,t,r)&&(t=e),n=wa(n),t=xa({},t,o,ni);var i,u,a=xa({},t.imports,o.imports,ni),c=Pa(a),l=ne(a,c),s=0,f=t.interpolate||xn,d="__p += '",h=On((t.escape||xn).source+"|"+f.source+"|"+(f===J?vn:xn).source+"|"+(t.evaluate||xn).source+"|$","g"),v="//# sourceURL="+(Bn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";n.replace(h,(function(t,e,r,o,a,c){return r||(r=o),d+=n.slice(s,c).replace(En,ue),e&&(i=!0,d+="' +\n__e("+e+") +\n'"),a&&(u=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t})),d+="';\n";var p=Bn.call(t,"variable")&&t.variable;if(p){if(dn.test(p))throw new kn("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(u?d.replace(X,""):d).replace(U,"$1").replace(F,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Ja((function(){return Cn(c,v+"return "+d).apply(e,l)}));if(g.source=d,Ku(g))throw g;return g},He.times=function(n,t){if((n=pa(n))<1||n>d)return[];var e=v,r=be(n,v);t=si(t),n-=v;for(var o=Kt(r,t);++e<n;)t(e);return o},He.toFinite=va,He.toInteger=pa,He.toLength=ga,He.toLower=function(n){return wa(n).toLowerCase()},He.toNumber=ya,He.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,d):0===n?n:0},He.toString=wa,He.toUpper=function(n){return wa(n).toUpperCase()},He.trim=function(n,t,r){if((n=wa(n))&&(r||t===e))return Qt(n);if(!n||!(t=so(t)))return n;var o=ve(n),i=ve(t);return Eo(o,ee(o,i),re(o,i)+1).join("")},He.trimEnd=function(n,t,r){if((n=wa(n))&&(r||t===e))return n.slice(0,pe(n)+1);if(!n||!(t=so(t)))return n;var o=ve(n);return Eo(o,0,re(o,ve(t))+1).join("")},He.trimStart=function(n,t,r){if((n=wa(n))&&(r||t===e))return n.replace(un,"");if(!n||!(t=so(t)))return n;var o=ve(n);return Eo(o,ee(o,ve(t))).join("")},He.truncate=function(n,t){var r=30,o="...";if(ta(t)){var i="separator"in t?t.separator:i;r="length"in t?pa(t.length):r,o="omission"in t?so(t.omission):o}var u=(n=wa(n)).length;if(ae(n)){var a=ve(n);u=a.length}if(r>=u)return n;var c=r-he(o);if(c<1)return o;var l=a?Eo(a,0,c).join(""):n.slice(0,c);if(i===e)return l+o;if(a&&(c+=l.length-c),ua(i)){if(n.slice(c).search(i)){var s,f=l;for(i.global||(i=On(i.source,wa(pn.exec(i))+"g")),i.lastIndex=0;s=i.exec(f);)var d=s.index;l=l.slice(0,d===e?c:d)}}else if(n.indexOf(so(i),c)!=c){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+o},He.unescape=function(n){return(n=wa(n))&&G.test(n)?n.replace(W,ge):n},He.uniqueId=function(n){var t=++Dn;return wa(n)+t},He.upperCase=qa,He.upperFirst=Ka,He.each=wu,He.eachRight=bu,He.first=Wi,cc(He,(xc={},_r(He,(function(n,t){Bn.call(He.prototype,t)||(xc[t]=n)})),xc),{chain:!1}),He.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){He[n].placeholder=He})),Ot(["drop","take"],(function(n,t){Ue.prototype[n]=function(r){r=r===e?1:we(pa(r),0);var o=this.__filtered__&&!t?new Ue(this):this.clone();return o.__filtered__?o.__takeCount__=be(r,o.__takeCount__):o.__views__.push({size:be(r,v),type:n+(o.__dir__<0?"Right":"")}),o},Ue.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(n,t){var e=t+1,r=1==e||3==e;Ue.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:si(n,3),type:e}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(n,t){var e="take"+(t?"Right":"");Ue.prototype[n]=function(){return this[e](1).value()[0]}})),Ot(["initial","tail"],(function(n,t){var e="drop"+(t?"":"Right");Ue.prototype[n]=function(){return this.__filtered__?new Ue(this):this[e](1)}})),Ue.prototype.compact=function(){return this.filter(oc)},Ue.prototype.find=function(n){return this.filter(n).head()},Ue.prototype.findLast=function(n){return this.reverse().find(n)},Ue.prototype.invokeMap=Kr((function(n,t){return"function"==typeof n?new Ue(this):this.map((function(e){return Ir(e,n,t)}))})),Ue.prototype.reject=function(n){return this.filter(Tu(si(n)))},Ue.prototype.slice=function(n,t){n=pa(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Ue(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==e&&(r=(t=pa(t))<0?r.dropRight(-t):r.take(t-n)),r)},Ue.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ue.prototype.toArray=function(){return this.take(v)},_r(Ue.prototype,(function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),i=He[o?"take"+("last"==t?"Right":""):t],u=o||/^find/.test(t);i&&(He.prototype[t]=function(){var t=this.__wrapped__,a=o?[1]:arguments,c=t instanceof Ue,l=a[0],s=c||Uu(t),f=function(n){var t=i.apply(He,Tt([n],a));return o&&d?t[0]:t};s&&r&&"function"==typeof l&&1!=l.length&&(c=s=!1);var d=this.__chain__,h=!!this.__actions__.length,v=u&&!d,p=c&&!h;if(!u&&s){t=p?t:new Ue(this);var g=n.apply(t,a);return g.__actions__.push({func:vu,args:[f],thisArg:e}),new Xe(g,d)}return v&&p?n.apply(this,a):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(n){var t=Pn[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);He.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Uu(o)?o:[],n)}return this[e]((function(e){return t.apply(Uu(e)?e:[],n)}))}})),_r(Ue.prototype,(function(n,t){var e=He[t];if(e){var r=e.name+"";Bn.call(Pe,r)||(Pe[r]=[]),Pe[r].push({name:t,func:e})}})),Pe[Yo(e,2).name]=[{name:"wrapper",func:e}],Ue.prototype.clone=function(){var n=new Ue(this.__wrapped__);return n.__actions__=Io(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Io(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Io(this.__views__),n},Ue.prototype.reverse=function(){if(this.__filtered__){var n=new Ue(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Ue.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,e=Uu(n),r=t<0,o=e?n.length:0,i=function(n,t,e){var r=-1,o=e.length;for(;++r<o;){var i=e[r],u=i.size;switch(i.type){case"drop":n+=u;break;case"dropRight":t-=u;break;case"take":t=be(t,n+u);break;case"takeRight":n=we(n,t-u)}}return{start:n,end:t}}(0,o,this.__views__),u=i.start,a=i.end,c=a-u,l=r?a:u-1,s=this.__iteratees__,f=s.length,d=0,h=be(c,this.__takeCount__);if(!e||!r&&o==c&&h==c)return go(n,this.__actions__);var v=[];n:for(;c--&&d<h;){for(var p=-1,g=n[l+=t];++p<f;){var y=s[p],m=y.iteratee,w=y.type,b=m(g);if(2==w)g=b;else if(!b){if(1==w)continue n;break n}}v[d++]=g}return v},He.prototype.at=pu,He.prototype.chain=function(){return hu(this)},He.prototype.commit=function(){return new Xe(this.value(),this.__chain__)},He.prototype.next=function(){this.__values__===e&&(this.__values__=ha(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?e:this.__values__[this.__index__++]}},He.prototype.plant=function(n){for(var t,r=this;r instanceof Ze;){var o=Vi(r);o.__index__=0,o.__values__=e,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,t},He.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Ue){var t=n;return this.__actions__.length&&(t=new Ue(this)),(t=t.reverse()).__actions__.push({func:vu,args:[tu],thisArg:e}),new Xe(t,this.__chain__)}return this.thru(tu)},He.prototype.toJSON=He.prototype.valueOf=He.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},He.prototype.first=He.prototype.head,Jn&&(He.prototype[Jn]=function(){return this}),He}();yt?((yt.exports=ye)._=ye,gt._=ye):pt._=ye}).call(w)}(lE,lE.exports);var sE=b(lE.exports);function fE(n){var t=n.layoutTypes,e=n.layoutConfig,r=void 0===e?uE:e,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=t[null==r?void 0:r.type]||cE[null==r?void 0:r.type];return function(n){return n.every((function(n){var t,e;return(null===(t=n.measured)||void 0===t?void 0:t.width)&&(null===(e=n.measured)||void 0===e?void 0:e.height)}))}(u)&&c?function(n){var t=n.layoutConfig,e=void 0===t?uE:t,r=n.edges,o=n.nodeOrigin,i=n.nodes,u=n.container,a=n.layoutFn,c=sE.cloneDeep(i);c.forEach((function(n){n.data&&(n.data.width=n.measured.width,n.data.height=n.measured.height)}));var l=a(c,r,d({nodeOrigin:o,width:u.width,height:u.height},null==e?void 0:e.options)),s=l.nodes,f=l.edges;return console.log("布局完成"),{nodes:s,edges:f,layoutComplete:!0}}({layoutConfig:r,container:a,nodeOrigin:i,nodes:u,layoutFn:c,edges:o}):{nodes:u,edges:o,layoutComplete:!1}}function dE(n){var t=n.centerConfig,e=n.width,r=n.height,o=n.transform,i=n.panZoom,u=n.nodeOrigin,a=n.nodes;if(t&&i){var c=a.find((function(n){return n.id===t.centerNodeId}));return c?(function(n){var t=n.node,e=n.height,r=n.width,o=n.zoom,i=void 0===o?1:o,u=n.panZoom,a=n.nodeOrigin,c=zb(t),l=Mb(t,a).positionAbsolute,s={x:r/2-(l.x+c.width/2)*i,y:e/2-(l.y+c.height/2)*i};u.setViewport({x:s.x,y:s.y,zoom:i})}({node:c,width:e,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0):(t.centerByBBox&&function(n){var t=n.nodes,e=n.nodeOrigin,r=n.height,o=n.width,i=n.zoom,u=void 0===i?1:i,a=n.panZoom,c=m_(t,{nodeOrigin:e}),l={x:o/2-(c.x+c.width/2)*u,y:r/2-(c.y+c.height/2)*u};a.setViewport({x:l.x,y:l.y,zoom:u})}({nodes:a,width:e,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var hE=function(n){var t,e,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return t=function(n,t){return d(d({},aE({nodes:r,edges:o,width:a,height:c,fitView:l,defaultNodes:i,defaultEdges:u})),{setNodes:function(t){n({nodes:t})},setEdges:function(t){n({edges:t})},setDefaultNodesAndEdges:function(e,r){e&&((0,t().onNodesChange)({changes:[],userNodes:e}),n({hasDefaultNodes:!0})),r&&((0,t().onEdgesChange)({userEdges:r}),n({hasDefaultEdges:!0}))},updateNodeInternals:function(e){var r=t(),o=r.triggerNodeChanges,i=r.nodeLookup,u=r.parentLookup,a=r.domNode,c=r.nodeOrigin,l=r.debug,s=function(n,t,e,r,o){var i=null==r?void 0:r.querySelector(".xyflow__viewport"),u=!1;if(!i)return{changes:[],updatedInternals:u};var a=[],c=window.getComputedStyle(i),l=new window.DOMMatrixReadOnly(c.transform).m22,s=[];if(n.forEach((function(n){var e=t.get(n.id);if(null==e?void 0:e.hidden)t.set(e.id,d(d({},e),{internals:d(d({},e.internals),{handleBounds:void 0})})),u=!0;else if(e){var r=qb(n.nodeElement),i=e.measured.width!==r.width||e.measured.height!==r.height;if(r.width&&r.height&&(i||!e.internals.handleBounds||n.force)){var c=d(d({},e),{measured:r,internals:d(d({},e.internals),{handleBounds:{source:t_(".source",n.nodeElement,l,e.origin||o),target:t_(".target",n.nodeElement,l,e.origin||o)}})});t.set(e.id,c),u=!0,i&&(a.push({id:c.id,type:"dimensions",dimensions:r}),c.expandParent&&c.parentId&&s.push({id:c.id,parentId:c.parentId,rect:Db(c,c.origin||o)}))}}})),s.length>0){var f=Ib(s,t,e,o);a.push.apply(a,m([],y(f),!1))}return{changes:a,updatedInternals:u}}(e,i,u,a,c),f=s.changes;if(s.updatedInternals){var h=sE.cloneDeep(i);n({nodeLookup:h}),Cb(i,{nodeOrigin:c}),(null==f?void 0:f.length)>0&&(l&&console.log("Ink Flow: trigger node changes",f),null==o||o(f))}},updateNodePositions:function(n,e){var r,o;void 0===e&&(e=!1);var i=[],u=[];try{for(var a=g(n),c=a.next();!c.done;c=a.next()){var l=y(c.value,2),s=l[0],f=l[1],h={id:s,type:"position",position:f.position,dragging:e};(null==f?void 0:f.expandParent)&&(null==f?void 0:f.parentId)&&h.position&&(i.push({id:s,parentId:f.parentId,rect:d(d({},f.internals.positionAbsolute),{width:f.measured.width,height:f.measured.height})}),h.position.x=Math.max(0,h.position.x),h.position.y=Math.max(0,h.position.y)),u.push(h)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}if(i.length>0){var v=t(),p=Ib(i,v.nodeLookup,v.parentLookup);u.push.apply(u,m([],y(p),!1))}t().triggerNodeChanges(u)},triggerNodeChanges:function(n){var e=t(),r=e.onNodesChange,o=e.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger node changes",n),r({changes:n}))},triggerEdgeChanges:function(n){var e=t(),r=e.onEdgesChange,o=e.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger edge changes",n),null==r||r({changes:n}))},addSelectedNodes:function(n){var e=t(),r=e.multiSelectionActive,o=e.edgeLookup,i=e.nodeLookup,u=e.triggerNodeChanges,a=e.triggerEdgeChanges;r?u(n.map((function(n){return h_(n,!0)}))):(u(v_(i,new Set(m([],y(n),!1)),!0)),a(v_(o)))},addSelectedEdges:function(n){var e=t(),r=e.multiSelectionActive,o=e.edgeLookup,i=e.nodeLookup,u=e.triggerNodeChanges,a=e.triggerEdgeChanges;r?a(n.map((function(n){return h_(n,!0)}))):(a(v_(o,new Set(m([],y(n),!1)))),u(v_(i,new Set,!0)))},unselectNodesAndEdges:function(n){var e=void 0===n?{}:n,r=e.nodes,o=e.edges,i=t(),u=i.edges,a=i.nodes,c=i.triggerNodeChanges,l=i.triggerEdgeChanges,s=o||u,f=(r||a).map((function(n){return n.selected=!1,h_(n.id,!1)})),d=s.map((function(n){return h_(n.id,!1)}));c(f),l(d)},setMinZoom:function(e){var r=t(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([e,i]),n({minZoom:e})},setMaxZoom:function(e){var r=t(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,e]),n({maxZoom:e})},setTranslateExtent:function(e){var r;null===(r=t().panZoom)||void 0===r||r.setTranslateExtent(e),n({translateExtent:e})},resetSelectedElements:function(){var n=t(),e=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,u=r.reduce((function(n,t){return t.selected?m(m([],y(n),!1),[h_(t.id,!1)],!1):n}),[]),a=e.reduce((function(n,t){return t.selected?m(m([],y(n),!1),[h_(t.id,!1)],!1):n}),[]);o(u),i(a)},setNodeExtent:function(e){var r,o,i=t().nodeLookup;try{for(var u=g(i),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=Ab(c.position,e);i.set(c.id,d(d({},c),{internals:d(d({},c.internals),{positionAbsolute:l})}))}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}n({nodeExtent:e})},panBy:function(n){var e=t(),r=e.transform,o=e.width,i=e.height;return function(n){var t=n.delta,e=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,u=n.height;if(!e||!t.x&&!t.y)return!1;var a=e.setViewportConstrained({x:r[0]+t.x,y:r[1]+t.y,zoom:r[2]},[[0,0],[i,u]],o);return!!a&&(a.x!==r[0]||a.y!==r[1]||a.k!==r[2])}({delta:n,panZoom:e.panZoom,transform:r,translateExtent:e.translateExtent,width:o,height:i})},cancelConnection:function(){return n({connectionStatus:null,connectionStartHandle:null,connectionEndHandle:null})},updateConnection:function(e){var r,o=t().connectionPosition,i=d(d({},e),{connectionPosition:null!==(r=e.connectionPosition)&&void 0!==r?r:o});n(i)},reset:function(){return n(d({},aE()))},updateLayout:function(e){var r,o=e.config,i=e.nodes,u=e.force,a=t(),c=a.width,l=a.height,s=a.edges,f=a.layoutTypes,d=a.layoutConfig,h=a.panZoom,v=a.nodeOrigin,p=a.nodeLookup,g=a.parentLookup,y=a.elevateNodesOnSelect,m=a.nodes,w=a.fitViewOnInit,b=a.minZoom,_=a.maxZoom,x=a.fitViewOnInitOptions,E=a.transform,S=a.centerConfig,k=a.offsetDone,C=a.fitViewDone,N=a.centered,M=a.layoutAnchorId,O=i||Array.from(p.values());if(O.length){var j=O.find((function(n){return n.id===M})),I=fE({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||uE});if(I.layoutComplete&&(jb(I.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:I.layoutComplete}),h&&I.layoutComplete&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){if(M&&j){var P=I.nodes.find((function(n){return n.id===M}));if(!P)return;return function(n){var t=n.position,e=n.targetPosition,r=n.panZoom,o=n.transform,i=o[2],u=(e.x-t.x)*i,a=(e.y-t.y)*i;r.setViewport({x:o[0]+u,y:o[1]+a,zoom:i})}({targetPosition:Mb(j,v).position,panZoom:h,position:Mb(P,v).position,transform:E}),void n({layoutAnchorId:void 0})}if(u||!(k||N||C))if(d.offsetConfig){var A=function(n){var t=n.offsetConfig,e=n.width,r=n.height,o=n.panZoom,i=n.nodeOrigin,u=n.nodes,a=n.layoutDirection,c=u.find((function(n){return n.id===(null==t?void 0:t.nodeId)}));if(!a||!c)return!1;var l=y_(c,i).positionAbsolute,s=zb(c),f=e/2,d=r/2,h={x:0,y:0};switch(a){case"BT":h={x:f-l.x-s.width/2,y:r-l.y-t.offset-s.height};break;case"LR":h={x:t.offset-l.x,y:d-l.y-s.height/2};break;case"RL":h={x:e-l.x-t.offset-s.width,y:d-l.y-s.height/2};break;default:h={x:f-l.x-s.width/2,y:t.offset-l.y}}return o.setViewport({x:h.x,y:h.y,zoom:1}),!0}({offsetConfig:d.offsetConfig,width:c,height:l,nodes:Array.from(p.values()),nodeOrigin:v,transform:E,panZoom:h,layoutDirection:null===(r=d.options)||void 0===r?void 0:r.rankdir});n({offsetDone:A})}else{if(w)return b_({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:w,minZoom:b,maxZoom:_,fitViewOnInitOptions:x,nodeLookup:p}),void n({fitViewDone:!0});S&&(dE({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var e=n.changes,r=n.userNodes;if(e||r){var o=t(),i=o.setNodes,u=o.nodeLookup,a=o.parentLookup,c=o.elevateNodesOnSelect,l=o.nodeOrigin,s=o.nodes,f=o.autoLayout,h=o.updateLayout,v=!(null==e?void 0:e.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(e||[]),g=[];g=v?(r||[]).map((function(n){var t=u.get(n.id),e=d(d({},t||{}),n);return(null==t?void 0:t.position)&&(e.position=t.position),e})):function(n,t){return d_(n,t)}(e,Array.from(u.values())),!v&&p||jb(g,u,a,{nodeOrigin:l,elevateNodesOnSelect:c,checkEquality:!0}),f&&(p||r&&r!==s)&&h({nodes:v?Array.from(u.values()):g}),i(r||s)}},onEdgesChange:function(n){var e=n.changes,r=void 0===e?[]:e,o=n.userEdges,i=t(),u=i.connectionLookup,a=i.edgeLookup,c=i.setEdges,l=i.edges,s=!(null==r?void 0:r.length),f=[];f=s?o.map((function(n){var t=a.get(n.id)||{};return d(d({},t),n)})):function(n,t){return d_(n,t)}(r,Array.from(a.values())),Ob(u,a,f),o&&c(s?o||[]:l)},updateLayoutConfig:function(e){var r=t(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;sE.isEqual(e,u)||(n({layoutConfig:e}),o&&i({config:e,force:!0}))},setLayoutAnchorId:function(t){n({layoutAnchorId:t})}})},e=Object.is,t?Y(t,e):Y};function vE(n){var t=n.initialNodes,e=n.initialEdges,r=n.defaultNodes,o=n.defaultEdges,u=n.initialWidth,a=n.initialHeight,c=n.fitView,l=n.children,s=y(i((function(){return hE({nodes:t,edges:e,defaultNodes:r,defaultEdges:o,width:u,height:a,fitView:c})})),1)[0];return k.jsx(X,{value:s,children:k.jsx(T_,{children:l})})}function pE(n){var t=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return e(Z)?k.jsx(k.Fragment,{children:t}):k.jsx(vE,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:t})}var gE=m(m([],y(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","nodesDraggable","minZoom","maxZoom","nodeExtent","elementsSelectable","translateExtent","defaultEdgeOptions","fitView","fitViewOptions","nodeOrigin","autoLayout","centerConfig","layoutTypes"]),!1),["rfId"],!1),yE=function(n){return{setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges,onNodesChange:n.onNodesChange,onEdgesChange:n.onEdgesChange,updateLayoutConfig:n.updateLayoutConfig}},mE={translateExtent:Nv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wE(n){var t=Sb(yE,u_),e=t.setMinZoom,r=t.setMaxZoom,o=t.setTranslateExtent,i=t.setNodeExtent,c=t.reset,l=t.setDefaultNodesAndEdges,s=t.onNodesChange,f=t.onEdgesChange,h=t.updateLayoutConfig,v=kb();a((function(){return l(n.defaultNodes,n.defaultEdges),function(){p.current=mE,c()}}),[]);var p=u(mE);return a((function(){var t,u,a,c;try{for(var l=g(gE),y=l.next();!y.done;y=l.next()){var m=y.value,w=n[m];if(w!==p.current[m]&&void 0!==n[m])if("nodes"===m)s({userNodes:w});else if("edges"===m)f({userEdges:w});else if("minZoom"===m)e(w);else if("maxZoom"===m)r(w);else if("translateExtent"===m)o(w);else if("nodeExtent"===m)i(w);else if("fitView"===m)v.setState({fitViewOnInit:w});else if("fitViewOptions"===m)v.setState({fitViewOnInitOptions:w});else if("layoutConfig"===m){var b=w||{},_=d(d({},b),{options:d(d({},b.options||{}),{rankdir:(null===(c=b.options)||void 0===c?void 0:c.rankdir)||"TB"})});h(_)}else v.setState(((a={})[m]=w,a))}}catch(n){t={error:n}}finally{try{y&&!y.done&&(u=l.return)&&u.call(l)}finally{if(t)throw t.error}}p.current=n}),gE.map((function(t){return n[t]}))),null}var bE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var _E=Zb((function(n,t){var e=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?Nv:o,u=n.defaultViewport,a=void 0===u?iE:u,c=n.minZoom,l=void 0===c?.5:c,s=n.maxZoom,f=void 0===s?2:s,v=n.defaultMarkerColor,p=void 0===v?"#b1b1b7":v,g=n.nodeOrigin,y=n.noDragClassName,m=n.noPanClassName,w=n.disableKeyboardA11y,b=n.nodeTypes,_=n.edgeTypes;n.connectionMode;var x=n.connectionLineType,E=void 0===x?rp.Bezier:x,S=n.connectionLineStyle,C=n.connectionLineComponent,N=n.connectionLineContainerStyle,M=n.onNodeClick,O=n.onNodeDoubleClick,I=n.onNodeMouseEnter,P=n.onNodeMouseMove,A=n.onNodeMouseLeave,z=n.onNodeContextMenu,L=n.onEdgeClick,T=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,D=n.onEdgeMouseLeave,R=n.onEdgeContextMenu,V=n.onEdgeDoubleClick,H=n.fitView,Y=n.fitViewOptions,Z=n.nodeExtent,X=n.nodesDraggable,U=n.children,F=n.id,W=n.width,$=n.height,G=n.onPaneClick,q=n.onPaneContextMenu,K=n.onPaneMouseEnter,Q=n.onPaneMouseMove,J=n.onPaneMouseLeave,nn=n.onPaneScroll,tn=n.elementsSelectable,en=void 0===tn||tn,rn=n.autoLayout,on=void 0===rn||rn,un=n.layoutConfig,an=void 0===un?uE:un,cn=n.centerConfig,ln=void 0===cn?{}:cn,sn=n.layoutTypes,fn=void 0===sn?{}:sn,dn=h(n,["nodes","edges","translateExtent","defaultViewport","minZoom","maxZoom","defaultMarkerColor","nodeOrigin","noDragClassName","noPanClassName","disableKeyboardA11y","nodeTypes","edgeTypes","connectionMode","connectionLineType","connectionLineStyle","connectionLineComponent","connectionLineContainerStyle","onNodeClick","onNodeDoubleClick","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onEdgeClick","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","onEdgeContextMenu","onEdgeDoubleClick","fitView","fitViewOptions","nodeExtent","nodesDraggable","children","id","width","height","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoLayout","layoutConfig","centerConfig","layoutTypes"]),hn=F||"1";return k.jsx("div",d({},dn,{ref:t,style:d({},bE),className:j(["ink-flow"]),"data-testid":"rf__wrapper",id:F,children:k.jsxs(pE,{nodes:e,edges:r,width:W,height:$,fitView:H,children:[k.jsx(oE,{onNodeClick:M,onNodeMouseEnter:I,onNodeMouseMove:P,onNodeMouseLeave:A,onNodeContextMenu:z,onNodeDoubleClick:O,onEdgeClick:L,onEdgeMouseEnter:T,onEdgeMouseMove:B,onEdgeMouseLeave:D,onEdgeContextMenu:R,onEdgeDoubleClick:V,rfId:hn,nodeTypes:b,edgeTypes:_,minZoom:l,maxZoom:f,nodeOrigin:g,noDragClassName:y,noPanClassName:m,disableKeyboardA11y:w,translateExtent:i,defaultMarkerColor:p,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:C,connectionLineContainerStyle:N,defaultViewport:a,onPaneClick:G,onPaneContextMenu:q,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:J,onPaneScroll:nn}),k.jsx(wE,{nodes:e,edges:r,rfId:hn,fitView:H,fitViewOptions:Y,nodeExtent:Z,nodesDraggable:X,elementsSelectable:en,minZoom:l,maxZoom:f,nodeOrigin:g,autoLayout:on,layoutConfig:an,layoutTypes:fn,centerConfig:ln}),U]})}))}));function xE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4.375C10.3452 4.375 10.625 4.65482 10.625 5V9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H10.625V15C10.625 15.3452 10.3452 15.625 10 15.625C9.65482 15.625 9.375 15.3452 9.375 15V10.625H5C4.65482 10.625 4.375 10.3452 4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H9.375V5C9.375 4.65482 9.65482 4.375 10 4.375Z",fill:"#6B7280"})})}function EE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.375 10C4.375 9.65482 4.65482 9.375 5 9.375H15C15.3452 9.375 15.625 9.65482 15.625 10C15.625 10.3452 15.3452 10.625 15 10.625H5C4.65482 10.625 4.375 10.3452 4.375 10Z",fill:"#6B7280"})})}function SE(){return k.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:k.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 1.875C10.3452 1.875 10.625 2.15482 10.625 2.5V3.57152C13.6929 3.86613 16.1339 6.30708 16.4285 9.375H17.5C17.8452 9.375 18.125 9.65482 18.125 10C18.125 10.3452 17.8452 10.625 17.5 10.625H16.4285C16.1339 13.6929 13.6929 16.1339 10.625 16.4285V17.5C10.625 17.8452 10.3452 18.125 10 18.125C9.65482 18.125 9.375 17.8452 9.375 17.5V16.4285C6.30708 16.1339 3.86613 13.6929 3.57152 10.625H2.5C2.15482 10.625 1.875 10.3452 1.875 10C1.875 9.65482 2.15482 9.375 2.5 9.375H3.57152C3.86613 6.30708 6.30708 3.86613 9.375 3.57152V2.5C9.375 2.15482 9.65482 1.875 10 1.875ZM4.82878 10.625H5.83333C6.17851 10.625 6.45833 10.3452 6.45833 10C6.45833 9.65482 6.17851 9.375 5.83333 9.375H4.82878C5.11304 6.99811 6.99811 5.11304 9.375 4.82878V5.83333C9.375 6.17851 9.65482 6.45833 10 6.45833C10.3452 6.45833 10.625 6.17851 10.625 5.83333V4.82878C13.0019 5.11304 14.887 6.99811 15.1712 9.375H14.1667C13.8215 9.375 13.5417 9.65482 13.5417 10C13.5417 10.3452 13.8215 10.625 14.1667 10.625H15.1712C14.887 13.0019 13.0019 14.887 10.625 15.1712V14.1667C10.625 13.8215 10.3452 13.5417 10 13.5417C9.65482 13.5417 9.375 13.8215 9.375 14.1667V15.1712C6.99811 14.887 5.11304 13.0019 4.82878 10.625Z",fill:"#6B7280"})})}function kE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function CE(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function NE(n){var t=n.children,e=n.className,r=h(n,["children","className"]);return k.jsx("button",d({type:"button",className:j(["ink-flow__controls-button",e])},r,{children:t}))}var ME=function(n){return n.userSelectionActive?"none":"all"};function OE(n){var t=n.position,e=void 0===t?"top-left":t,r=n.children,o=n.className,i=n.style,u=h(n,["position","children","className","style"]),a=Sb(ME),c="".concat(e).split("-");return k.jsx("div",d({className:j(m(["ink-flow__panel",o],y(c),!1)),style:d(d({},i),{pointerEvents:a})},u,{children:r}))}var jE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function IE(n){var t=n.style,e=n.showZoom,r=void 0===e||e,o=n.showFitView,i=void 0===o||o,u=n.showInteractive,a=void 0===u||u,c=n.fitViewOptions,l=n.onZoomIn,s=n.onZoomOut,f=n.onFitView,d=n.onInteractiveChange,h=n.className,v=n.children,p=n.position,g=void 0===p?"bottom-left":p,y=n.orientation,m=void 0===y?"vertical":y,w=n["aria-label"],b=void 0===w?"Ink Flow controls":w,_=kb(),x=Sb(jE,u_),E=x.isInteractive,S=x.minZoomReached,C=x.maxZoomReached,N=R_(),M=N.zoomIn,O=N.zoomOut,I=N.fitView,P="horizontal"===m?"horizontal":"vertical";return k.jsxs(OE,{className:j(["ink-flow__controls",P,h]),position:g,style:t,"data-testid":"rf__controls","aria-label":b,children:[i&&k.jsx(NE,{className:"ink-flow__controls-fitview",onClick:function(){I(c),null==f||f()},"aria-label":"fit view",children:k.jsx(SE,{})}),r&&k.jsxs("div",{className:"ink-flow__controls-zoom",children:[k.jsx(NE,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:C,children:k.jsx(xE,{})}),k.jsx(NE,{onClick:function(){O(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:S,children:k.jsx(EE,{})})]}),a&&k.jsx(NE,{className:"ink-flow__controls-interactive",onClick:function(){_.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==d||d(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?k.jsx(CE,{}):k.jsx(kE,{})}),v]})}IE.displayName="Controls";var PE,AE,zE=c(IE);function LE(n){var t=n.dimensions,e=n.lineWidth,r=n.variant,o=n.className;return k.jsx("path",{strokeWidth:e,d:"M".concat(t[0]/2," 0 V").concat(t[1]," M0 ").concat(t[1]/2," H").concat(t[0]),className:j(["react-flow__background-pattern",r,o])})}function TE(n){var t=n.radius,e=n.className;return k.jsx("circle",{cx:t,cy:t,r:t,className:j(["react-flow__background-pattern","dots",e])})}!function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"}(PE||(PE={}));var BE=((AE={})[PE.Dots]=1,AE[PE.Lines]=1,AE[PE.Cross]=6,AE),DE=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function RE(n){var t=n.id,e=n.variant,r=void 0===e?PE.Dots:e,o=n.gap,i=void 0===o?20:o,a=n.size,c=n.lineWidth,l=void 0===c?1:c,s=n.offset,f=void 0===s?2:s,h=n.color,v=n.bgColor,p=n.style,g=n.className,y=n.patternClassName,m=u(null),w=Sb(DE,u_),b=w.transform,_=w.patternId,x=a||BE[r],E=r===PE.Dots,S=r===PE.Cross,C=Array.isArray(i)?i:[i,i],N=[C[0]*b[2]||1,C[1]*b[2]||1],M=x*b[2],O=S?[M,M]:N,I=E?[M/f,M/f]:[O[0]/f,O[1]/f],P="".concat(_).concat(t||"");return k.jsxs("svg",{className:j(["ink-flow__background",g]),style:d(d(d({},p),a_),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[k.jsx("pattern",{id:P,x:b[0]%N[0],y:b[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(I[0],",-").concat(I[1],")"),children:E?k.jsx(TE,{radius:M/f,className:y}):k.jsx(LE,{dimensions:O,lineWidth:l,variant:r,className:y})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(P,")")})]})}RE.displayName="Background";var VE=c(RE),HE=function(n){var t;return null===(t=n.domNode)||void 0===t?void 0:t.querySelector(".ink-flow__edgelabel-renderer")};function YE(n){var t=n.children,e=Sb(HE);return e?f(t,e):null}export{VE as Background,PE as BackgroundVariant,yx as BaseEdge,rp as ConnectionLineType,np as ConnectionMode,NE as ControlButton,zE as Controls,YE as EdgeLabelRenderer,tx as Handle,vE as InkFlowProvider,op as MarkerType,tp as PanOnScrollMode,ip as Position,ep as SelectionMode,Sx as SmoothStepEdge,Nx as StepEdge,vp as addEdge,_p as dagreLayout,_E as default,ap as getBezierEdgeCenter,sp as getBezierPath,Tv as getConnectedEdges,fp as getEdgeCenter,Av as getIncomers,Lv as getNodesBounds,Pv as getOutgoers,bp as getSmoothStepPath,gp as getStraightPath,$v as getViewportForBounds,pp as updateEdge,I_ as useEdgesState,R_ as useInkFlow,P_ as useNodesState,Sb as useStore,kb as useStoreApi};
|
|
25
25
|
//# sourceMappingURL=index.esm.js.map
|