@aloudata/ink-flow 1.0.25 → 1.0.26

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.
Files changed (63) hide show
  1. package/dist/components/ConnectionLine/index.d.ts +4 -4
  2. package/dist/components/ConnectionLine/index.d.ts.map +1 -1
  3. package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +7 -9
  4. package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
  5. package/dist/components/EdgeWrapper/index.d.ts +1 -1
  6. package/dist/components/EdgeWrapper/index.d.ts.map +1 -1
  7. package/dist/components/Handle/index.d.ts.map +1 -1
  8. package/dist/components/NodeWrapper/index.d.ts.map +1 -1
  9. package/dist/components/StoreUpdater/index.d.ts +1 -1
  10. package/dist/components/StoreUpdater/index.d.ts.map +1 -1
  11. package/dist/container/EdgeRenderer/index.d.ts +2 -2
  12. package/dist/container/EdgeRenderer/index.d.ts.map +1 -1
  13. package/dist/container/FlowRenderer/index.d.ts +1 -1
  14. package/dist/container/FlowRenderer/index.d.ts.map +1 -1
  15. package/dist/container/GraphView/index.d.ts +2 -2
  16. package/dist/container/GraphView/index.d.ts.map +1 -1
  17. package/dist/container/InkFlow/index.d.ts.map +1 -1
  18. package/dist/container/Pane/index.d.ts +3 -2
  19. package/dist/container/Pane/index.d.ts.map +1 -1
  20. package/dist/hooks/useConnection.d.ts +29 -0
  21. package/dist/hooks/useConnection.d.ts.map +1 -0
  22. package/dist/hooks/useGlobalKeyHandler.d.ts.map +1 -1
  23. package/dist/hooks/useInkFlow.d.ts.map +1 -1
  24. package/dist/hooks/useViewportHelper.d.ts.map +1 -1
  25. package/dist/index.cjs.js +3 -3
  26. package/dist/index.cjs.js.map +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.esm.js +4 -4
  30. package/dist/index.esm.js.map +1 -1
  31. package/dist/plugins/NodeResizer/NodeResizeControl.d.ts +11 -0
  32. package/dist/plugins/NodeResizer/NodeResizeControl.d.ts.map +1 -0
  33. package/dist/plugins/NodeResizer/NodeResizer.d.ts +27 -0
  34. package/dist/plugins/NodeResizer/NodeResizer.d.ts.map +1 -0
  35. package/dist/plugins/NodeResizer/index.d.ts +4 -0
  36. package/dist/plugins/NodeResizer/index.d.ts.map +1 -0
  37. package/dist/plugins/NodeResizer/types.d.ts +65 -0
  38. package/dist/plugins/NodeResizer/types.d.ts.map +1 -0
  39. package/dist/plugins/index.d.ts +1 -0
  40. package/dist/plugins/index.d.ts.map +1 -1
  41. package/dist/store/index.d.ts.map +1 -1
  42. package/dist/store/initialState.d.ts.map +1 -1
  43. package/dist/style.css +7 -5
  44. package/dist/types/edges.d.ts +17 -14
  45. package/dist/types/edges.d.ts.map +1 -1
  46. package/dist/types/general.d.ts +1 -1
  47. package/dist/types/general.d.ts.map +1 -1
  48. package/dist/types/nodes.d.ts +1 -1
  49. package/dist/types/nodes.d.ts.map +1 -1
  50. package/dist/types/props.d.ts +71 -3
  51. package/dist/types/props.d.ts.map +1 -1
  52. package/dist/types/store.d.ts +7 -8
  53. package/dist/types/store.d.ts.map +1 -1
  54. package/dist/utils/dom.d.ts +1 -2
  55. package/dist/utils/dom.d.ts.map +1 -1
  56. package/dist/utils/general.d.ts +4 -1
  57. package/dist/utils/general.d.ts.map +1 -1
  58. package/dist/utils/graph.d.ts +2 -2
  59. package/dist/utils/graph.d.ts.map +1 -1
  60. package/dist/utils/layout.d.ts.map +1 -1
  61. package/dist/utils/store.d.ts +1 -14
  62. package/dist/utils/store.d.ts.map +1 -1
  63. package/package.json +2 -2
package/dist/index.esm.js CHANGED
@@ -1,10 +1,10 @@
1
- import n,{createContext as t,useContext as e,useMemo as r,forwardRef as o,useState as i,useRef as u,useEffect as a,memo as c,useLayoutEffect as l,useCallback as s}from"react";import{createPortal as f}from"react-dom";var d=function(){return d=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},d.apply(this,arguments)};function h(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}function v(n,t,e,r){return new(e||(e=Promise))((function(o,i){function u(n){try{c(r.next(n))}catch(n){i(n)}}function a(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var t;n.done?o(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,a)}c((r=r.apply(n,t||[])).next())}))}function p(n,t){var e,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(n,i)}catch(n){a=[6,n],r=0}finally{e=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function g(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 y(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 m(n,t,e){if(e||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 w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _,x={exports:{}},E={};x.exports=function(){if(_)return E;_=1;var t=n,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function a(n,t,r){var a,c={},l=null,s=null;for(a in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(s=t.ref),t)o.call(t,a)&&!u.hasOwnProperty(a)&&(c[a]=t[a]);if(n&&n.defaultProps)for(a in t=n.defaultProps)void 0===c[a]&&(c[a]=t[a]);return{$$typeof:e,type:n,key:l,ref:s,props:c,_owner:i.current}}return E.Fragment=r,E.jsx=a,E.jsxs=a,E}();var S,k=x.exports,C={exports:{}};
1
+ import n,{createContext as e,useContext as t,useMemo as r,forwardRef as o,useState as i,useRef as u,useEffect as a,useLayoutEffect as c,useCallback as l,memo as s}from"react";import{createPortal as f}from"react-dom";var d=function(){return d=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},d.apply(this,arguments)};function h(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function v(n,e,t,r){return new(t||(t=Promise))((function(o,i){function u(n){try{c(r.next(n))}catch(n){i(n)}}function a(n){try{c(r.throw(n))}catch(n){i(n)}}function c(n){var e;n.done?o(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(u,a)}c((r=r.apply(n,e||[])).next())}))}function p(n,e){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=a(0),u.throw=a(1),u.return=a(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;u&&(u=0,a[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(n,i)}catch(n){a=[6,n],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function g(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function m(n,e,t){if(t||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var b,_={exports:{}},E={};_.exports=function(){if(b)return E;b=1;var e=n,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function a(n,e,r){var a,c={},l=null,s=null;for(a in void 0!==r&&(l=""+r),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(s=e.ref),e)o.call(e,a)&&!u.hasOwnProperty(a)&&(c[a]=e[a]);if(n&&n.defaultProps)for(a in e=n.defaultProps)void 0===c[a]&&(c[a]=e[a]);return{$$typeof:t,type:n,key:l,ref:s,props:c,_owner:i.current}}return E.Fragment=r,E.jsx=a,E.jsxs=a,E}();var S,k=_.exports,C={exports:{}};
2
2
  /*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
6
  */
7
- S=C,function(){var n={}.hasOwnProperty;function t(){for(var n="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(n=r(n,e(o)))}return n}function e(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return t.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var o="";for(var i in e)n.call(e,i)&&e[i]&&(o=r(o,i));return o}function r(n,t){return t?n?n+" "+t:n+t:n}S.exports?(t.default=t,S.exports=t):window.classNames=t}();var N,M,O,j=b(C.exports),I={exports:{}},P={},A={exports:{}},z={};function L(){return M||(M=1,A.exports=function(){if(N)return z;N=1;var t=n,e="function"==typeof Object.is?Object.is:function(n,t){return n===t&&(0!==n||1/n==1/t)||n!=n&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,u=t.useDebugValue;function a(n){var t=n.getSnapshot;n=n.value;try{var r=t();return!e(n,r)}catch(n){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(n,t){return t()}:function(n,t){var e=t(),c=r({inst:{value:e,getSnapshot:t}}),l=c[0].inst,s=c[1];return i((function(){l.value=e,l.getSnapshot=t,a(l)&&s({inst:l})}),[n,e,t]),o((function(){return a(l)&&s({inst:l}),n((function(){a(l)&&s({inst:l})}))}),[n]),u(e),e};return z.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,z}()),A.exports}
7
+ S=C,function(){var n={}.hasOwnProperty;function e(){for(var n="",e=0;e<arguments.length;e++){var o=arguments[e];o&&(n=r(n,t(o)))}return n}function t(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return e.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var o="";for(var i in t)n.call(t,i)&&t[i]&&(o=r(o,i));return o}function r(n,e){return e?n?n+" "+e:n+e:n}S.exports?(e.default=e,S.exports=e):window.classNames=e}();var N,M,O,P=x(C.exports),j={exports:{}},I={},A={exports:{}},z={};function L(){return M||(M=1,A.exports=function(){if(N)return z;N=1;var e=n,t="function"==typeof Object.is?Object.is:function(n,e){return n===e&&(0!==n||1/n==1/e)||n!=n&&e!=e},r=e.useState,o=e.useEffect,i=e.useLayoutEffect,u=e.useDebugValue;function a(n){var e=n.getSnapshot;n=n.value;try{var r=e();return!t(n,r)}catch(n){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(n,e){return e()}:function(n,e){var t=e(),c=r({inst:{value:t,getSnapshot:e}}),l=c[0].inst,s=c[1];return i((function(){l.value=t,l.getSnapshot=e,a(l)&&s({inst:l})}),[n,t,e]),o((function(){return a(l)&&s({inst:l}),n((function(){a(l)&&s({inst:l})}))}),[n]),u(t),t};return z.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,z}()),A.exports}
8
8
  /**
9
9
  * @license React
10
10
  * use-sync-external-store-shim/with-selector.production.min.js
@@ -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_);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:{}};
16
+ */j.exports=function(){if(O)return I;O=1;var e=n,t=L(),r="function"==typeof Object.is?Object.is:function(n,e){return n===e&&(0!==n||1/n==1/e)||n!=n&&e!=e},o=t.useSyncExternalStore,i=e.useRef,u=e.useEffect,a=e.useMemo,c=e.useDebugValue;return I.useSyncExternalStoreWithSelector=function(n,e,t,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 e=d.value;if(s(e,n))return i=e}return i=n}if(e=i,r(o,n))return e;var t=l(n);return void 0!==s&&s(e,t)?e:(o=n,i=t)}var o,i,u=!1,a=void 0===t?null:t;return[function(){return n(e())},null===a?void 0:function(){return n(a())}]}),[e,t,l,s]);var h=o(n,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),c(h),h},I}();var R=x(j.exports);const T=n=>{let e;const t=new Set,r=(n,r)=>{const o="function"==typeof n?n(e):n;if(!Object.is(o,e)){const n=e;e=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},e,o),t.forEach((t=>t(e,n)))}},o=()=>e,i={setState:r,getState:o,getInitialState:()=>u,subscribe:n=>(t.add(n),()=>t.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."),t.clear()}},u=e=n(r,o,i);return i},{useDebugValue:D}=n,{useSyncExternalStoreWithSelector:B}=R,V=n=>n;function H(n,e=V,t){const r=B(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return D(r),r}const Y=(n,e)=>{const t=(n=>n?T(n):T)(n),r=(n,r=e)=>H(t,n,r);return Object.assign(r,t),r};var X=e(null),Z=X.Provider,W=function(){return W=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},W.apply(this,arguments)};function F(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]])}return t}function U(n){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function $(n,e){var t="function"==typeof Symbol&&n[Symbol.iterator];if(!t)return n;var r,o,i=t.call(n),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return u}function G(n,e,t){if(2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return n.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var q,K,Q,J,nn,en,tn,rn,on,un,an,cn,ln,sn,fn,dn,hn,vn,pn,gn,yn,mn,wn,xn,bn,_n,En,Sn,kn,Cn,Nn,Mn,On,Pn,jn,In,An,zn,Ln,Rn,Tn,Dn,Bn,Vn,Hn,Yn,Xn,Zn,Wn,Fn,Un,$n,Gn,qn,Kn,Qn,Jn,ne,ee,te,re,oe,ie,ue,ae,ce,le,se,fe,de,he,ve,pe,ge,ye,me,we,xe,be,_e,Ee,Se,ke,Ce,Ne,Me,Oe,Pe,je,Ie,Ae,ze,Le,Re,Te,De,Be,Ve,He,Ye,Xe,Ze,We,Fe,Ue,$e,Ge,qe,Ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Qe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Je(){return J?Q:(J=1,Q=function(n,e){return n===e||n!=n&&e!=e})}function nt(){if(en)return nn;en=1;var n=Je();return nn=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1},nn}function et(){if(dn)return fn;dn=1;var n=K?q:(K=1,q=function(){this.__data__=[],this.size=0}),e=function(){if(rn)return tn;rn=1;var n=nt(),e=Array.prototype.splice;return tn=function(t){var r=this.__data__,o=n(r,t);return!(o<0||(o==r.length-1?r.pop():e.call(r,o,1),--this.size,0))}}(),t=function(){if(un)return on;un=1;var n=nt();return on=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}}(),r=function(){if(cn)return an;cn=1;var n=nt();return an=function(e){return n(this.__data__,e)>-1}}(),o=function(){if(sn)return ln;sn=1;var n=nt();return ln=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,fn=i}function tt(){if(_n)return bn;_n=1;var n="object"==typeof Ke&&Ke&&Ke.Object===Object&&Ke;return bn=n}function rt(){if(Sn)return En;Sn=1;var n=tt(),e="object"==typeof self&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return En=t}function ot(){if(Cn)return kn;Cn=1;var n=rt().Symbol;return kn=n}function it(){if(In)return jn;In=1;var n=ot(),e=function(){if(Mn)return Nn;Mn=1;var n=ot(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;return Nn=function(n){var e=t.call(n,o),i=n[o];try{n[o]=void 0;var u=!0}catch(n){}var a=r.call(n);return u&&(e?n[o]=i:delete n[o]),a}}(),t=function(){if(Pn)return On;Pn=1;var n=Object.prototype.toString;return On=function(e){return n.call(e)}}(),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)?e(n):t(n)}}function ut(){return zn?An:(zn=1,An=function(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)})}function at(){if(Rn)return Ln;Rn=1;var n=it(),e=ut();return Ln=function(t){if(!e(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function ct(){if(Yn)return Hn;Yn=1;var n=Function.prototype.toString;return Hn=function(e){if(null!=e){try{return n.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function lt(){if($n)return Un;$n=1;var n=function(){if(Zn)return Xn;Zn=1;var n=at(),e=function(){if(Vn)return Bn;Vn=1;var n,e=function(){if(Dn)return Tn;Dn=1;var n=rt()["__core-js_shared__"];return Tn=n}(),t=(n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return Bn=function(n){return!!t&&t in n}}(),t=ut(),r=ct(),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 Xn=function(i){return!(!t(i)||e(i))&&(n(i)?l:o).test(r(i))}}(),e=Fn?Wn:(Fn=1,Wn=function(n,e){return null==n?void 0:n[e]});return Un=function(t,r){var o=e(t,r);return n(o)?o:void 0}}function st(){if(qn)return Gn;qn=1;var n=lt()(rt(),"Map");return Gn=n}function ft(){if(Qn)return Kn;Qn=1;var n=lt()(Object,"create");return Kn=n}function dt(){if(ge)return pe;ge=1;var n=ve?he:(ve=1,he=function(n){var e=typeof n;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n});return pe=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}}function ht(){if(Ce)return ke;Ce=1;var n=function(){if(de)return fe;de=1;var n=function(){if(se)return le;se=1;var n=function(){if(ne)return Jn;ne=1;var n=ft();return Jn=function(){this.__data__=n?n(null):{},this.size=0}}(),e=te?ee:(te=1,ee=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}),t=function(){if(oe)return re;oe=1;var n=ft(),e=Object.prototype.hasOwnProperty;return re=function(t){var r=this.__data__;if(n){var o=r[t];return"__lodash_hash_undefined__"===o?void 0:o}return e.call(r,t)?r[t]:void 0}}(),r=function(){if(ue)return ie;ue=1;var n=ft(),e=Object.prototype.hasOwnProperty;return ie=function(t){var r=this.__data__;return n?void 0!==r[t]:e.call(r,t)}}(),o=function(){if(ce)return ae;ce=1;var n=ft();return ae=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,le=i}(),e=et(),t=st();return fe=function(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}}(),e=function(){if(me)return ye;me=1;var n=dt();return ye=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}}(),t=function(){if(xe)return we;xe=1;var n=dt();return we=function(e){return n(this,e).get(e)}}(),r=function(){if(_e)return be;_e=1;var n=dt();return be=function(e){return n(this,e).has(e)}}(),o=function(){if(Se)return Ee;Se=1;var n=dt();return Ee=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}}();function i(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}return i.prototype.clear=n,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=r,i.prototype.set=o,ke=i}function vt(){if(Pe)return Oe;Pe=1;var n=et(),e=function(){if(vn)return hn;vn=1;var n=et();return hn=function(){this.__data__=new n,this.size=0}}(),t=gn?pn:(gn=1,pn=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}),r=mn?yn:(mn=1,yn=function(n){return this.__data__.get(n)}),o=xn?wn:(xn=1,wn=function(n){return this.__data__.has(n)}),i=function(){if(Me)return Ne;Me=1;var n=et(),e=st(),t=ht();return Ne=function(r,o){var i=this.__data__;if(i instanceof n){var u=i.__data__;if(!e||u.length<199)return u.push([r,o]),this.size=++i.size,this;i=this.__data__=new t(u)}return i.set(r,o),this.size=i.size,this}}();function u(e){var t=this.__data__=new n(e);this.size=t.size}return u.prototype.clear=e,u.prototype.delete=t,u.prototype.get=r,u.prototype.has=o,u.prototype.set=i,Oe=u}function pt(){return Ie||(Ie=1,je=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}),je}function gt(){if(ze)return Ae;ze=1;var n=lt(),e=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Ae=e}function yt(){if(Re)return Le;Re=1;var n=gt();return Le=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}}function mt(){if(De)return Te;De=1;var n=yt(),e=Je(),t=Object.prototype.hasOwnProperty;return Te=function(r,o,i){var u=r[o];t.call(r,o)&&e(u,i)&&(void 0!==i||o in r)||n(r,o,i)}}function wt(){if(Ve)return Be;Ve=1;var n=mt(),e=yt();return Be=function(t,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],t[l],l,o,t):void 0;void 0===s&&(s=t[l]),u?e(o,l,s):n(o,l,s)}return o}}function xt(){return Ze?Xe:(Ze=1,Xe=function(n){return null!=n&&"object"==typeof n})}function bt(){if($e)return Ue;$e=1;var n=function(){if(Fe)return We;Fe=1;var n=it(),e=xt();return We=function(t){return e(t)&&"[object Arguments]"==n(t)}}(),e=xt(),t=Object.prototype,r=t.hasOwnProperty,o=t.propertyIsEnumerable,i=n(function(){return arguments}())?n:function(n){return e(n)&&r.call(n,"callee")&&!o.call(n,"callee")};return Ue=i}function _t(){if(qe)return Ge;qe=1;var n=Array.isArray;return Ge=n}var Et,St,kt,Ct,Nt,Mt,Ot,Pt,jt,It,At,zt={exports:{}};function Lt(){return kt||(kt=1,function(n,e){var t=rt(),r=St?Et:(St=1,Et=function(){return!1}),o=e&&!e.nodeType&&e,i=o&&n&&!n.nodeType&&n,u=i&&i.exports===o?t.Buffer:void 0,a=(u?u.isBuffer:void 0)||r;n.exports=a}(zt,zt.exports)),zt.exports}function Rt(){if(Nt)return Ct;Nt=1;var n=/^(?:0|[1-9]\d*)$/;return Ct=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}}function Tt(){return Ot?Mt:(Ot=1,Mt=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991})}function Dt(){return At?It:(At=1,It=function(n){return function(e){return n(e)}})}var Bt,Vt,Ht,Yt,Xt,Zt,Wt,Ft,Ut,$t,Gt,qt,Kt,Qt,Jt,nr,er,tr,rr,or,ir,ur,ar,cr,lr,sr,fr,dr={exports:{}};function hr(){return Bt||(Bt=1,n=dr,e=dr.exports,t=tt(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r&&t.process,u=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(n){}}(),n.exports=u),dr.exports;var n,e,t,r,o,i,u}function vr(){if(Ht)return Vt;Ht=1;var n=function(){if(jt)return Pt;jt=1;var n=it(),e=Tt(),t=xt(),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,Pt=function(o){return t(o)&&e(o.length)&&!!r[n(o)]}}(),e=Dt(),t=hr(),r=t&&t.isTypedArray,o=r?e(r):n;return Vt=o}function pr(){if(Xt)return Yt;Xt=1;var n=Ye?He:(Ye=1,He=function(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}),e=bt(),t=_t(),r=Lt(),o=Rt(),i=vr(),u=Object.prototype.hasOwnProperty;return Yt=function(a,c){var l=t(a),s=!l&&e(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 gr(){if(Wt)return Zt;Wt=1;var n=Object.prototype;return Zt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}}function yr(){return Ut||(Ut=1,Ft=function(n,e){return function(t){return n(e(t))}}),Ft}function mr(){if(Kt)return qt;Kt=1;var n=gr(),e=function(){if(Gt)return $t;Gt=1;var n=yr()(Object.keys,Object);return $t=n}(),t=Object.prototype.hasOwnProperty;return qt=function(r){if(!n(r))return e(r);var o=[];for(var i in Object(r))t.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function wr(){if(Jt)return Qt;Jt=1;var n=at(),e=Tt();return Qt=function(t){return null!=t&&e(t.length)&&!n(t)}}function xr(){if(er)return nr;er=1;var n=pr(),e=mr(),t=wr();return nr=function(r){return t(r)?n(r):e(r)}}function br(){if(lr)return cr;lr=1;var n=pr(),e=function(){if(ar)return ur;ar=1;var n=ut(),e=gr(),t=ir?or:(ir=1,or=function(n){var e=[];if(null!=n)for(var t in Object(n))e.push(t);return e}),r=Object.prototype.hasOwnProperty;return ur=function(o){if(!n(o))return t(o);var i=e(o),u=[];for(var a in o)("constructor"!=a||!i&&r.call(o,a))&&u.push(a);return u}}(),t=wr();return cr=function(r){return t(r)?n(r,!0):e(r)}}var _r,Er,Sr,kr,Cr,Nr,Mr,Or,Pr,jr,Ir,Ar,zr,Lr,Rr,Tr,Dr,Br,Vr,Hr,Yr,Xr,Zr,Wr,Fr,Ur,$r,Gr,qr,Kr,Qr,Jr,no,eo,to,ro,oo,io,uo,ao,co,lo,so,fo,ho,vo,po,go,yo,mo,wo,xo,bo,_o,Eo,So,ko,Co,No,Mo,Oo,Po,jo,Io,Ao,zo,Lo,Ro,To,Do,Bo,Vo,Ho,Yo,Xo,Zo,Wo,Fo,Uo,$o,Go,qo,Ko,Qo,Jo,ni,ei,ti,ri,oi,ii,ui,ai,ci,li,si,fi,di,hi,vi,pi,gi,yi,mi,wi,xi,bi,_i,Ei,Si,ki,Ci,Ni,Mi,Oi,Pi,ji,Ii,Ai,zi,Li,Ri,Ti,Di,Bi,Vi,Hi,Yi,Xi,Zi,Wi,Fi,Ui,$i,Gi,qi,Ki,Qi,Ji,nu,eu,tu,ru,ou,iu,uu,au,cu,lu,su,fu,du,hu,vu,pu,gu,yu,mu,wu,xu,bu,_u,Eu,Su,ku,Cu,Nu,Mu,Ou,Pu,ju,Iu,Au,zu,Lu,Ru,Tu,Du,Bu,Vu,Hu,Yu,Xu,Zu,Wu,Fu,Uu,$u,Gu,qu,Ku,Qu,Ju,na,ea,ta,ra,oa,ia,ua,aa,ca,la,sa,fa,da,ha,va,pa,ga,ya,ma,wa,xa,ba,_a,Ea,Sa,ka,Ca,Na,Ma,Oa,Pa,ja,Ia,Aa,za,La,Ra,Ta,Da,Ba,Va,Ha,Ya,Xa,Za,Wa,Fa,Ua,$a,Ga,qa,Ka,Qa,Ja,nc,ec,tc,rc,oc,ic,uc,ac,cc,lc,sc,fc,dc,hc,vc,pc,gc,yc,mc,wc,xc,bc,_c,Ec,Sc,kc,Cc,Nc,Mc,Oc,Pc,jc,Ic,Ac={exports:{}};function zc(){return _r||(_r=1,function(n,e){var t=rt(),r=e&&!e.nodeType&&e,o=r&&n&&!n.nodeType&&n,i=o&&o.exports===r?t.Buffer:void 0,u=i?i.allocUnsafe:void 0;n.exports=function(n,e){if(e)return n.slice();var t=n.length,r=u?u(t):new n.constructor(t);return n.copy(r),r}}(Ac,Ac.exports)),Ac.exports}function Lc(){return Sr||(Sr=1,Er=function(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}),Er}function Rc(){return Cr||(Cr=1,kr=function(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var u=n[t];e(u,t,n)&&(i[o++]=u)}return i}),kr}function Tc(){return Mr?Nr:(Mr=1,Nr=function(){return[]})}function Dc(){if(Pr)return Or;Pr=1;var n=Rc(),e=Tc(),t=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Or=r?function(e){return null==e?[]:(e=Object(e),n(r(e),(function(n){return t.call(e,n)})))}:e}function Bc(){return zr||(zr=1,Ar=function(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}),Ar}function Vc(){if(Rr)return Lr;Rr=1;var n=yr()(Object.getPrototypeOf,Object);return Lr=n}function Hc(){if(Dr)return Tr;Dr=1;var n=Bc(),e=Vc(),t=Dc(),r=Tc(),o=Object.getOwnPropertySymbols;return Tr=o?function(r){for(var o=[];r;)n(o,t(r)),r=e(r);return o}:r}function Yc(){if(Yr)return Hr;Yr=1;var n=Bc(),e=_t();return Hr=function(t,r,o){var i=r(t);return e(t)?i:n(i,o(t))}}function Xc(){if(Zr)return Xr;Zr=1;var n=Yc(),e=Dc(),t=xr();return Xr=function(r){return n(r,t,e)}}function Zc(){if(Qr)return Kr;Qr=1;var n=lt()(rt(),"Set");return Kr=n}function Wc(){if(to)return eo;to=1;var n=function(){if($r)return Ur;$r=1;var n=lt()(rt(),"DataView");return Ur=n}(),e=st(),t=function(){if(qr)return Gr;qr=1;var n=lt()(rt(),"Promise");return Gr=n}(),r=Zc(),o=function(){if(no)return Jr;no=1;var n=lt()(rt(),"WeakMap");return Jr=n}(),i=it(),u=ct(),a="[object Map]",c="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",d=u(n),h=u(e),v=u(t),p=u(r),g=u(o),y=i;return(n&&y(new n(new ArrayBuffer(1)))!=f||e&&y(new e)!=a||t&&y(t.resolve())!=c||r&&y(new r)!=l||o&&y(new o)!=s)&&(y=function(n){var e=i(n),t="[object Object]"==e?n.constructor:void 0,r=t?u(t):"";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 e}),eo=y}function Fc(){if(uo)return io;uo=1;var n=rt().Uint8Array;return io=n}function Uc(){if(co)return ao;co=1;var n=Fc();return ao=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}}function $c(){if(yo)return go;yo=1;var n=Uc();return go=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}}function Gc(){if(bo)return xo;bo=1;var n=ut(),e=Object.create,t=function(){function t(){}return function(r){if(!n(r))return{};if(e)return e(r);t.prototype=r;var o=new t;return t.prototype=void 0,o}}();return xo=t}function qc(){if(Eo)return _o;Eo=1;var n=Gc(),e=Vc(),t=gr();return _o=function(r){return"function"!=typeof r.constructor||t(r)?{}:n(e(r))}}function Kc(){if(Ao)return Io;Ao=1;var n=vt(),e=pt(),t=mt(),r=function(){if(rr)return tr;rr=1;var n=wt(),e=xr();return tr=function(t,r){return t&&n(r,e(r),t)}}(),o=function(){if(fr)return sr;fr=1;var n=wt(),e=br();return sr=function(t,r){return t&&n(r,e(r),t)}}(),i=zc(),u=Lc(),a=function(){if(Ir)return jr;Ir=1;var n=wt(),e=Dc();return jr=function(t,r){return n(t,e(t),r)}}(),c=function(){if(Vr)return Br;Vr=1;var n=wt(),e=Hc();return Br=function(t,r){return n(t,e(t),r)}}(),l=Xc(),s=function(){if(Fr)return Wr;Fr=1;var n=Yc(),e=Hc(),t=br();return Wr=function(r){return n(r,t,e)}}(),f=Wc(),d=function(){if(oo)return ro;oo=1;var n=Object.prototype.hasOwnProperty;return ro=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r},ro}(),h=function(){if(wo)return mo;wo=1;var n=Uc(),e=function(){if(so)return lo;so=1;var n=Uc();return lo=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}}(),t=function(){if(ho)return fo;ho=1;var n=/\w*$/;return fo=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}(),r=function(){if(po)return vo;po=1;var n=ot(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;return vo=function(n){return t?Object(t.call(n)):{}}}(),o=$c();return mo=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 e(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 t(i);case"[object Symbol]":return r(i)}}}(),v=qc(),p=_t(),g=Lt(),y=function(){if(No)return Co;No=1;var n=function(){if(ko)return So;ko=1;var n=Wc(),e=xt();return So=function(t){return e(t)&&"[object Map]"==n(t)}}(),e=Dt(),t=hr(),r=t&&t.isMap,o=r?e(r):n;return Co=o}(),m=ut(),w=function(){if(jo)return Po;jo=1;var n=function(){if(Oo)return Mo;Oo=1;var n=Wc(),e=xt();return Mo=function(t){return e(t)&&"[object Set]"==n(t)}}(),e=Dt(),t=hr(),r=t&&t.isSet,o=r?e(r):n;return Po=o}(),x=xr(),b=br(),_="[object Arguments]",E="[object Function]",S="[object Object]",k={};return k[_]=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,P,j,I){var A,z=1&M,L=2&M,R=4&M;if(O&&(A=j?O(N,P,j,I):O(N)),void 0!==A)return A;if(!m(N))return N;var T=p(N);if(T){if(A=d(N),!z)return u(N,A)}else{var D=f(N),B=D==E||"[object GeneratorFunction]"==D;if(g(N))return i(N,z);if(D==S||D==_||B&&!j){if(A=L||B?{}:v(N),!z)return L?c(N,o(A,N)):a(N,r(A,N))}else{if(!k[D])return j?N:{};A=h(N,D,z)}}I||(I=new n);var V=I.get(N);if(V)return V;I.set(N,A),w(N)?N.forEach((function(n){A.add(C(n,M,O,n,N,I))})):y(N)&&N.forEach((function(n,e){A.set(e,C(n,M,O,e,N,I))}));var H=T?void 0:(R?L?s:l:L?b:x)(N);return e(H||N,(function(n,e){H&&(n=N[e=n]),t(A,e,C(n,M,O,e,N,I))})),A},Io}function Qc(){if(Lo)return zo;Lo=1;var n=Kc();return zo=function(e){return n(e,4)}}function Jc(){return To?Ro:(To=1,Ro=function(n){return function(){return n}})}function nl(){if(Ho)return Vo;Ho=1;var n=(Bo?Do:(Bo=1,Do=function(n){return function(e,t,r){for(var o=-1,i=Object(e),u=r(e),a=u.length;a--;){var c=u[n?a:++o];if(!1===t(i[c],c,i))break}return e}}))();return Vo=n}function el(){if(Xo)return Yo;Xo=1;var n=nl(),e=xr();return Yo=function(t,r){return t&&n(t,r,e)}}function tl(){if(Uo)return Fo;Uo=1;var n=el(),e=function(){if(Wo)return Zo;Wo=1;var n=wr();return Zo=function(e,t){return function(r,o){if(null==r)return r;if(!n(r))return e(r,o);for(var i=r.length,u=t?i:-1,a=Object(r);(t?u--:++u<i)&&!1!==o(a[u],u,a););return r}}}()(n);return Fo=e}function rl(){return Go?$o:(Go=1,$o=function(n){return n})}function ol(){if(Ko)return qo;Ko=1;var n=rl();return qo=function(e){return"function"==typeof e?e:n}}function il(){if(Jo)return Qo;Jo=1;var n=pt(),e=tl(),t=ol(),r=_t();return Qo=function(o,i){return(r(o)?n:e)(o,t(i))}}function ul(){return ei?ni:(ei=1,ni=il())}function al(){if(li)return ci;li=1;var n=ht(),e=ii?oi:(ii=1,oi=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=ai?ui:(ai=1,ui=function(n){return this.__data__.has(n)});function r(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,ci=r}function cl(){return hi?di:(hi=1,di=function(n,e){return n.has(e)})}function ll(){if(pi)return vi;pi=1;var n=al(),e=(fi||(fi=1,si=function(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}),si),t=cl();return vi=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(!e(o,(function(n,e){if(!t(g,e)&&(y===n||a(y,n,i,u,c)))return g.push(e)}))){p=!1;break}}else if(y!==m&&!a(y,m,i,u,c)){p=!1;break}}return c.delete(r),c.delete(o),p},vi}function sl(){return wi||(wi=1,mi=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}),mi}function fl(){if(ki)return Si;ki=1;var n=vt(),e=ll(),t=function(){if(bi)return xi;bi=1;var n=ot(),e=Fc(),t=Je(),r=ll(),o=yi?gi:(yi=1,gi=function(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}),i=sl(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return xi=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 e(n),new e(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+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(Ei)return _i;Ei=1;var n=Xc(),e=Object.prototype.hasOwnProperty;return _i=function(t,r,o,i,u,a){var c=1&o,l=n(t),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:e.call(r,d)))return!1}var h=a.get(t),v=a.get(r);if(h&&v)return h==r&&v==t;var p=!0;a.set(t,r),a.set(r,t);for(var g=c;++f<s;){var y=t[d=l[f]],m=r[d];if(i)var w=c?i(m,y,d,r,t,a):i(y,m,d,t,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 x=t.constructor,b=r.constructor;x==b||!("constructor"in t)||!("constructor"in r)||"function"==typeof x&&x instanceof x&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(t),a.delete(r),p}}(),o=Wc(),i=_t(),u=Lt(),a=vr(),c="[object Arguments]",l="[object Array]",s="[object Object]",f=Object.prototype.hasOwnProperty;return Si=function(d,h,v,p,g,y){var m=i(d),w=i(h),x=m?l:o(d),b=w?l:o(h),_=(x=x==c?s:x)==s,E=(b=b==c?s:b)==s,S=x==b;if(S&&u(d)){if(!u(h))return!1;m=!0,_=!1}if(S&&!_)return y||(y=new n),m||a(d)?e(d,h,v,p,g,y):t(d,h,x,v,p,g,y);if(!(1&v)){var k=_&&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 dl(){if(Ni)return Ci;Ni=1;var n=fl(),e=xt();return Ci=function t(r,o,i,u,a){return r===o||(null==r||null==o||!e(r)&&!e(o)?r!=r&&o!=o:n(r,o,i,u,t,a))},Ci}function hl(){if(ji)return Pi;ji=1;var n=ut();return Pi=function(e){return e==e&&!n(e)}}function vl(){return Li?zi:(Li=1,zi=function(n,e){return function(t){return null!=t&&t[n]===e&&(void 0!==e||n in Object(t))}})}function pl(){if(Bi)return Di;Bi=1;var n=it(),e=xt();return Di=function(t){return"symbol"==typeof t||e(t)&&"[object Symbol]"==n(t)}}function gl(){if(Hi)return Vi;Hi=1;var n=_t(),e=pl(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return Vi=function(o,i){if(n(o))return!1;var u=typeof o;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=o&&!e(o))||r.test(o)||!t.test(o)||null!=i&&o in Object(i)}}function yl(){return Gi||(Gi=1,$i=function(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}),$i}function ml(){if(Ji)return Qi;Ji=1;var n=function(){if(Ki)return qi;Ki=1;var n=ot(),e=yl(),t=_t(),r=pl(),o=n?n.prototype:void 0,i=o?o.toString:void 0;return qi=function n(o){if("string"==typeof o)return o;if(t(o))return e(o,n)+"";if(r(o))return i?i.call(o):"";var u=o+"";return"0"==u&&1/o==-1/0?"-0":u},qi}();return Qi=function(e){return null==e?"":n(e)}}function wl(){if(eu)return nu;eu=1;var n=_t(),e=gl(),t=function(){if(Ui)return Fi;Ui=1;var n=function(){if(Wi)return Zi;Wi=1;var n=function(){if(Xi)return Yi;Xi=1;var n=ht();function e(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var n=arguments,e=r?r.apply(this,n):n[0],i=o.cache;if(i.has(e))return i.get(e);var u=t.apply(this,n);return o.cache=i.set(e,u)||i,u};return o.cache=new(e.Cache||n),o}return e.Cache=n,Yi=e}();return Zi=function(e){var t=n(e,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}}(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n((function(n){var r=[];return 46===n.charCodeAt(0)&&r.push(""),n.replace(e,(function(n,e,o,i){r.push(o?i.replace(t,"$1"):e||n)})),r}));return Fi=r}(),r=ml();return nu=function(o,i){return n(o)?o:e(o,i)?[o]:t(r(o))}}function xl(){if(ru)return tu;ru=1;var n=pl();return tu=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}}function bl(){if(iu)return ou;iu=1;var n=wl(),e=xl();return ou=function(t,r){for(var o=0,i=(r=n(r,t)).length;null!=t&&o<i;)t=t[e(r[o++])];return o&&o==i?t:void 0}}function _l(){if(fu)return su;fu=1;var n=wl(),e=bt(),t=_t(),r=Rt(),o=Tt(),i=xl();return su=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)&&(t(u)||e(u))}}function El(){if(hu)return du;hu=1;var n=lu?cu:(lu=1,cu=function(n,e){return null!=n&&e in Object(n)}),e=_l();return du=function(t,r){return null!=t&&e(t,r,n)}}function Sl(){return yu?gu:(yu=1,gu=function(n){return function(e){return null==e?void 0:e[n]}})}function kl(){if(Eu)return _u;Eu=1;var n=function(){if(Ti)return Ri;Ti=1;var n=function(){if(Oi)return Mi;Oi=1;var n=vt(),e=dl();return Mi=function(t,r,o,i){var u=o.length,a=u,c=!i;if(null==t)return!a;for(t=Object(t);u--;){var l=o[u];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++u<a;){var s=(l=o[u])[0],f=t[s],d=l[1];if(c&&l[2]){if(void 0===f&&!(s in t))return!1}else{var h=new n;if(i)var v=i(f,d,s,t,r,h);if(!(void 0===v?e(d,f,3,i,h):v))return!1}}return!0}}(),e=function(){if(Ai)return Ii;Ai=1;var n=hl(),e=xr();return Ii=function(t){for(var r=e(t),o=r.length;o--;){var i=r[o],u=t[i];r[o]=[i,u,n(u)]}return r}}(),t=vl();return Ri=function(r){var o=e(r);return 1==o.length&&o[0][2]?t(o[0][0],o[0][1]):function(e){return e===r||n(e,r,o)}}}(),e=function(){if(pu)return vu;pu=1;var n=dl(),e=function(){if(au)return uu;au=1;var n=bl();return uu=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}}(),t=El(),r=gl(),o=hl(),i=vl(),u=xl();return vu=function(a,c){return r(a)&&o(c)?i(u(a),c):function(r){var o=e(r,a);return void 0===o&&o===c?t(r,a):n(c,o,3)}}}(),t=rl(),r=_t(),o=function(){if(bu)return xu;bu=1;var n=Sl(),e=function(){if(wu)return mu;wu=1;var n=bl();return mu=function(e){return function(t){return n(t,e)}}}(),t=gl(),r=xl();return xu=function(o){return t(o)?n(r(o)):e(o)}}();return _u=function(i){return"function"==typeof i?i:null==i?t:"object"==typeof i?r(i)?e(i[0],i[1]):n(i):o(i)}}function Cl(){if(ku)return Su;ku=1;var n=Rc(),e=function(){if(ri)return ti;ri=1;var n=tl();return ti=function(e,t){var r=[];return n(e,(function(n,e,o){t(n,e,o)&&r.push(n)})),r}}(),t=kl(),r=_t();return Su=function(o,i){return(r(o)?n:e)(o,t(i,3))}}function Nl(){if(Ou)return Mu;Ou=1;var n=function(){if(Nu)return Cu;Nu=1;var n=Object.prototype.hasOwnProperty;return Cu=function(e,t){return null!=e&&n.call(e,t)}}(),e=_l();return Mu=function(t,r){return null!=t&&e(t,r,n)}}function Ml(){if(ju)return Pu;ju=1;var n=mr(),e=Wc(),t=bt(),r=_t(),o=wr(),i=Lt(),u=gr(),a=vr(),c=Object.prototype.hasOwnProperty;return Pu=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||a(l)||t(l)))return!l.length;var s=e(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 Ol(){return Au?Iu:(Au=1,Iu=function(n){return void 0===n})}function Pl(){if(Lu)return zu;Lu=1;var n=tl(),e=wr();return zu=function(t,r){var o=-1,i=e(t)?Array(t.length):[];return n(t,(function(n,e,t){i[++o]=r(n,e,t)})),i}}function jl(){if(Tu)return Ru;Tu=1;var n=yl(),e=kl(),t=Pl(),r=_t();return Ru=function(o,i){return(r(o)?n:t)(o,e(i,3))}}function Il(){if(Xu)return Yu;Xu=1;var n=(Bu||(Bu=1,Du=function(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}),Du),e=tl(),t=kl(),r=Hu?Vu:(Hu=1,Vu=function(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}),o=_t();return Yu=function(i,u,a){var c=o(i)?n:r,l=arguments.length<3;return c(i,t(u,4),a,l,e)},Yu}function Al(){if(ea)return na;ea=1;var n=mr(),e=Wc(),t=wr(),r=function(){if(Wu)return Zu;Wu=1;var n=it(),e=_t(),t=xt();return Zu=function(r){return"string"==typeof r||!e(r)&&t(r)&&"[object String]"==n(r)}}(),o=function(){if(Ju)return Qu;Ju=1;var n=function(){if(Uu)return Fu;Uu=1;var n=Sl()("length");return Fu=n}(),e=function(){if(Gu)return $u;Gu=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return $u=function(e){return n.test(e)}}(),t=function(){if(Ku)return qu;Ku=1;var n="\\ud800-\\udfff",e="["+n+"]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+n+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+t+"|"+r+")?",c="[\\ufe0e\\ufe0f]?",l=c+a+"(?:\\u200d(?:"+[o,i,u].join("|")+")"+c+a+")*",s="(?:"+[o+t+"?",t,i,u,e].join("|")+")",f=RegExp(r+"(?="+r+")|"+s+l,"g");return qu=function(n){for(var e=f.lastIndex=0;f.test(n);)++e;return e}}();return Qu=function(r){return e(r)?t(r):n(r)}}();return na=function(i){if(null==i)return 0;if(t(i))return r(i)?o(i):i.length;var u=e(i);return"[object Map]"==u||"[object Set]"==u?i.size:n(i).length}}function zl(){if(ra)return ta;ra=1;var n=pt(),e=Gc(),t=el(),r=kl(),o=Vc(),i=_t(),u=Lt(),a=at(),c=ut(),l=vr();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)?e(o(s)):{}}return(v?n:t)(s,(function(n,e,t){return f(d,n,e,t)})),d}}function Ll(){if(aa)return ua;aa=1;var n=Bc(),e=function(){if(ia)return oa;ia=1;var n=ot(),e=bt(),t=_t(),r=n?n.isConcatSpreadable:void 0;return oa=function(n){return t(n)||e(n)||!!(r&&n&&n[r])}}();return ua=function t(r,o,i,u,a){var c=-1,l=r.length;for(i||(i=e),a||(a=[]);++c<l;){var s=r[c];o>0&&i(s)?o>1?t(s,o-1,i,u,a):n(a,s):u||(a[a.length]=s)}return a},ua}function Rl(){if(fa)return sa;fa=1;var n=la?ca:(la=1,ca=function(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}),e=Math.max;return sa=function(t,r,o){return r=e(void 0===r?t.length-1:r,0),function(){for(var i=arguments,u=-1,a=e(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(t,this,l)}},sa}function Tl(){if(ya)return ga;ya=1;var n=function(){if(ha)return da;ha=1;var n=Jc(),e=gt(),t=rl();return da=e?function(t,r){return e(t,"toString",{configurable:!0,enumerable:!1,value:n(r),writable:!0})}:t}(),e=function(){if(pa)return va;pa=1;var n=Date.now;return va=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},va}(),t=e(n);return ga=t}function Dl(){if(wa)return ma;wa=1;var n=rl(),e=Rl(),t=Tl();return ma=function(r,o){return t(e(r,o,n),r+"")},ma}function Bl(){return ba||(ba=1,xa=function(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}),xa}function Vl(){if(Ta)return Ra;Ta=1;var n=al(),e=function(){if(Oa)return Ma;Oa=1;var n=function(){if(Na)return Ca;Na=1;var n=Bl(),e=Ea?_a:(Ea=1,_a=function(n){return n!=n}),t=(ka||(ka=1,Sa=function(n,e,t){for(var r=t-1,o=n.length;++r<o;)if(n[r]===e)return r;return-1}),Sa);return Ca=function(r,o,i){return o==o?t(r,o,i):n(r,e,i)},Ca}();return Ma=function(e,t){return!(null==e||!e.length)&&n(e,t,0)>-1},Ma}(),t=(ja||(ja=1,Pa=function(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}),Pa),r=cl(),o=function(){if(La)return za;La=1;var n=Zc(),e=Aa?Ia:(Aa=1,Ia=function(){}),t=sl(),r=n&&1/t(new n([,-0]))[1]==1/0?function(e){return new n(e)}:e;return za=r}(),i=sl();return Ra=function(u,a,c){var l=-1,s=e,f=u.length,d=!0,h=[],v=h;if(c)d=!1,s=t;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},Ra}function Hl(){if(Ba)return Da;Ba=1;var n=wr(),e=xt();return Da=function(t){return e(t)&&n(t)}}function Yl(){if(Ha)return Va;Ha=1;var n=Ll(),e=Dl(),t=Vl(),r=Hl(),o=e((function(e){return t(n(e,1,r,!0))}));return Va=o}function Xl(){if(Wa)return Za;Wa=1;var n=function(){if(Xa)return Ya;Xa=1;var n=yl();return Ya=function(e,t){return n(t,(function(n){return e[n]}))}}(),e=xr();return Za=function(t){return null==t?[]:n(t,e(t))}}function Zl(){if(Ua)return Fa;var n;Ua=1;try{n={clone:Qc(),constant:Jc(),each:ul(),filter:Cl(),has:Nl(),isArray:_t(),isEmpty:Ml(),isFunction:at(),isUndefined:Ol(),keys:xr(),map:jl(),reduce:Il(),size:Al(),transform:zl(),union:Yl(),values:Xl()}}catch(n){}return n||(n=window._),Fa=n}function Wl(){if(Ga)return $a;Ga=1;var n=Zl();$a=t;var e="\0";function t(t){this._isDirected=!n.has(t,"directed")||t.directed,this._isMultigraph=!!n.has(t,"multigraph")&&t.multigraph,this._isCompound=!!n.has(t,"compound")&&t.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[e]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(n,e){n[e]?n[e]++:n[e]=1}function o(n,e){--n[e]||delete n[e]}function i(e,t,r,o){var i=""+t,u=""+r;if(!e&&i>u){var a=i;i=u,u=a}return i+""+u+""+(n.isUndefined(o)?"\0":o)}function u(n,e){return i(n,e.v,e.w,e.name)}return t.prototype._nodeCount=0,t.prototype._edgeCount=0,t.prototype.isDirected=function(){return this._isDirected},t.prototype.isMultigraph=function(){return this._isMultigraph},t.prototype.isCompound=function(){return this._isCompound},t.prototype.setGraph=function(n){return this._label=n,this},t.prototype.graph=function(){return this._label},t.prototype.setDefaultNodeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultNodeLabelFn=e,this},t.prototype.nodeCount=function(){return this._nodeCount},t.prototype.nodes=function(){return n.keys(this._nodes)},t.prototype.sources=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._in[t])}))},t.prototype.sinks=function(){var e=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(e._out[t])}))},t.prototype.setNodes=function(e,t){var r=arguments,o=this;return n.each(e,(function(n){r.length>1?o.setNode(n,t):o.setNode(n)})),this},t.prototype.setNode=function(t,r){return n.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=e,this._children[t]={},this._children[e][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},t.prototype.node=function(n){return this._nodes[n]},t.prototype.hasNode=function(e){return n.has(this._nodes,e)},t.prototype.removeNode=function(e){var t=this;if(n.has(this._nodes,e)){var r=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],n.each(this.children(e),(function(n){t.setParent(n)})),delete this._children[e]),n.each(n.keys(this._in[e]),r),delete this._in[e],delete this._preds[e],n.each(n.keys(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},t.prototype.setParent=function(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(r))r=e;else{for(var o=r+="";!n.isUndefined(o);o=this.parent(o))if(o===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this},t.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},t.prototype.parent=function(n){if(this._isCompound){var t=this._parent[n];if(t!==e)return t}},t.prototype.children=function(t){if(n.isUndefined(t)&&(t=e),this._isCompound){var r=this._children[t];if(r)return n.keys(r)}else{if(t===e)return this.nodes();if(this.hasNode(t))return[]}},t.prototype.predecessors=function(e){var t=this._preds[e];if(t)return n.keys(t)},t.prototype.successors=function(e){var t=this._sucs[e];if(t)return n.keys(t)},t.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return n.union(t,this.successors(e))},t.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},t.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;n.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),n.each(this._edgeObjs,(function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,r.edge(n))}));var o={};function i(n){var e=r.parent(n);return void 0===e||t.hasNode(e)?(o[n]=e,e):e in o?o[e]:i(e)}return this._isCompound&&n.each(t.nodes(),(function(n){t.setParent(n,i(n))})),t},t.prototype.setDefaultEdgeLabel=function(e){return n.isFunction(e)||(e=n.constant(e)),this._defaultEdgeLabelFn=e,this},t.prototype.edgeCount=function(){return this._edgeCount},t.prototype.edges=function(){return n.values(this._edgeObjs)},t.prototype.setPath=function(e,t){var r=this,o=arguments;return n.reduce(e,(function(n,e){return o.length>1?r.setEdge(n,e,t):r.setEdge(n,e),e})),this},t.prototype.setEdge=function(){var e,t,o,u,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(e=c.v,t=c.w,o=c.name,2===arguments.length&&(u=arguments[1],a=!0)):(e=c,t=arguments[1],o=arguments[3],arguments.length>2&&(u=arguments[2],a=!0)),e=""+e,t=""+t,n.isUndefined(o)||(o=""+o);var l=i(this._isDirected,e,t,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(e),this.setNode(t),this._edgeLabels[l]=a?u:this._defaultEdgeLabelFn(e,t,o);var s=function(n,e,t,r){var o=""+e,i=""+t;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,e,t,o);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[l]=s,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=s,this._out[e][l]=s,this._edgeCount++,this},t.prototype.edge=function(n,e,t){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,e,t);return this._edgeLabels[r]},t.prototype.hasEdge=function(e,t,r){var o=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,e,t,r);return n.has(this._edgeLabels,o)},t.prototype.removeEdge=function(n,e,t){var r=1===arguments.length?u(this._isDirected,arguments[0]):i(this._isDirected,n,e,t),a=this._edgeObjs[r];return a&&(n=a.v,e=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[e],n),o(this._sucs[n],e),delete this._in[e][r],delete this._out[n][r],this._edgeCount--),this},t.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.v===t})):o}},t.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var o=n.values(r);return t?n.filter(o,(function(n){return n.w===t})):o}},t.prototype.nodeEdges=function(n,e){var t=this.inEdges(n,e);if(t)return t.concat(this.outEdges(n,e))},$a}function Fl(){if(ec)return nc;ec=1;var n=Zl(),e=Wl();function t(e){return n.map(e.nodes(),(function(t){var r=e.node(t),o=e.parent(t),i={v:t};return n.isUndefined(r)||(i.value=r),n.isUndefined(o)||(i.parent=o),i}))}function r(e){return n.map(e.edges(),(function(t){var r=e.edge(t),o={v:t.v,w:t.w};return n.isUndefined(t.name)||(o.name=t.name),n.isUndefined(r)||(o.value=r),o}))}return nc={write:function(e){var o={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:t(e),edges:r(e)};return n.isUndefined(e.graph())||(o.value=n.clone(e.graph())),o},read:function(t){var r=new e(t.options).setGraph(t.value);return n.each(t.nodes,(function(n){r.setNode(n.v,n.value),n.parent&&r.setParent(n.v,n.parent)})),n.each(t.edges,(function(n){r.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),r}}}function Ul(){if(rc)return tc;rc=1;var n=Zl();return tc=function(e){var t,r={},o=[];function i(o){n.has(r,o)||(r[o]=!0,t.push(o),n.each(e.successors(o),i),n.each(e.predecessors(o),i))}return n.each(e.nodes(),(function(n){t=[],i(n),t.length&&o.push(t)})),o},tc}function $l(){if(ic)return oc;ic=1;var n=Zl();function e(){this._arr=[],this._keyIndices={}}return oc=e,e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},e.prototype.has=function(e){return n.has(this._keyIndices,e)},e.prototype.priority=function(n){var e=this._keyIndices[n];if(void 0!==e)return this._arr[e].priority},e.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(e,t){var r=this._keyIndices;if(e=String(e),!n.has(r,e)){var o=this._arr,i=o.length;return r[e]=i,o.push({key:e,priority:t}),this._decrease(i),!0}return!1},e.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},e.prototype.decrease=function(n,e){var t=this._keyIndices[n];if(e>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+e);this._arr[t].priority=e,this._decrease(t)},e.prototype._heapify=function(n){var e=this._arr,t=2*n,r=t+1,o=n;t<e.length&&(o=e[t].priority<e[o].priority?t:o,r<e.length&&(o=e[r].priority<e[o].priority?r:o),o!==n&&(this._swap(n,o),this._heapify(o)))},e.prototype._decrease=function(n){for(var e,t=this._arr,r=t[n].priority;0!==n&&!(t[e=n>>1].priority<r);)this._swap(n,e),n=e},e.prototype._swap=function(n,e){var t=this._arr,r=this._keyIndices,o=t[n],i=t[e];t[n]=i,t[e]=o,r[i.key]=n,r[o.key]=e},oc}function Gl(){if(ac)return uc;ac=1;var n=Zl(),e=$l();uc=function(n,r,o,i){return function(n,t,r,o){var i,u,a={},c=new e,l=function(n){var e=n.v!==i?n.v:n.w,t=a[e],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<t.distance&&(t.distance=l,t.predecessor=i,c.decrease(e,l))};for(n.nodes().forEach((function(n){var e=n===t?0:Number.POSITIVE_INFINITY;a[n]={distance:e},c.add(n,e)}));c.size()>0&&(i=c.removeMin(),(u=a[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(l);return a}(n,String(r),o||t,i||function(e){return n.outEdges(e)})};var t=n.constant(1);return uc}function ql(){if(lc)return cc;lc=1;var n=Gl(),e=Zl();return cc=function(t,r,o){return e.transform(t.nodes(),(function(e,i){e[i]=n(t,i,r,o)}),{})}}function Kl(){if(fc)return sc;fc=1;var n=Zl();return sc=function(e){var t=0,r=[],o={},i=[];function u(a){var c=o[a]={onStack:!0,lowlink:t,index:t++};if(r.push(a),e.successors(a).forEach((function(e){n.has(o,e)?o[e].onStack&&(c.lowlink=Math.min(c.lowlink,o[e].index)):(u(e),c.lowlink=Math.min(c.lowlink,o[e].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 e.nodes().forEach((function(e){n.has(o,e)||u(e)})),i},sc}function Ql(){if(hc)return dc;hc=1;var n=Zl(),e=Kl();return dc=function(t){return n.filter(e(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function Jl(){if(pc)return vc;pc=1;var n=Zl();vc=function(n,t,r){return function(n,e,t){var r={},o=n.nodes();return o.forEach((function(n){r[n]={},r[n][n]={distance:0},o.forEach((function(e){n!==e&&(r[n][e]={distance:Number.POSITIVE_INFINITY})})),t(n).forEach((function(t){var o=t.v===n?t.w:t.v,i=e(t);r[n][o]={distance:i,predecessor:n}}))})),o.forEach((function(n){var e=r[n];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[n],o=e[t],u=i[t],a=r.distance+o.distance;a<u.distance&&(u.distance=a,u.predecessor=o.predecessor)}))}))})),r}(n,t||e,r||function(e){return n.outEdges(e)})};var e=n.constant(1);return vc}function ns(){if(yc)return gc;yc=1;var n=Zl();function e(e){var r={},o={},i=[];if(n.each(e.sinks(),(function u(a){if(n.has(o,a))throw new t;n.has(r,a)||(o[a]=!0,r[a]=!0,n.each(e.predecessors(a),u),delete o[a],i.push(a))})),n.size(r)!==e.nodeCount())throw new t;return i}function t(){}return gc=e,e.CycleException=t,t.prototype=new Error,gc}function es(){if(wc)return mc;wc=1;var n=ns();return mc=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}function ts(){if(bc)return xc;bc=1;var n=Zl();function e(t,r,o,i,u,a){n.has(i,r)||(i[r]=!0,o||a.push(r),n.each(u(r),(function(n){e(t,n,o,i,u,a)})),o&&a.push(r))}return xc=function(t,r,o){n.isArray(r)||(r=[r]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),u=[],a={};return n.each(r,(function(n){if(!t.hasNode(n))throw new Error("Graph does not have node: "+n);e(t,n,"post"===o,a,i,u)})),u},xc}function rs(){if(Ec)return _c;Ec=1;var n=ts();return _c=function(e,t){return n(e,t,"post")}}function os(){if(kc)return Sc;kc=1;var n=ts();return Sc=function(e,t){return n(e,t,"pre")}}function is(){if(Nc)return Cc;Nc=1;var n=Zl(),e=Wl(),t=$l();return Cc=function(r,o){var i,u=new e,a={},c=new t;function l(n){var e=n.v===i?n.w:n.v,t=c.priority(e);if(void 0!==t){var r=o(n);r<t&&(a[e]=i,c.decrease(e,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},Cc}try{Ic=function(){if(jc)return Pc;jc=1;var n=Ja?Qa:(Ja=1,Qa={Graph:Wl(),version:Ka?qa:(Ka=1,qa="2.1.8")});return Pc={Graph:n.Graph,json:Fl(),alg:Oc?Mc:(Oc=1,Mc={components:Ul(),dijkstra:Gl(),dijkstraAll:ql(),findCycles:Ql(),floydWarshall:Jl(),isAcyclic:es(),postorder:rs(),preorder:os(),prim:is(),tarjan:Kl(),topsort:ns()}),version:n.version}}()}catch(W){}Ic||(Ic=window.graphlib);var us,as,cs,ls,ss,fs,ds,hs,vs,ps,gs,ys,ms,ws,xs,bs,_s,Es,Ss,ks,Cs,Ns,Ms,Os,Ps,js,Is,As,zs,Ls,Rs,Ts,Ds,Bs,Vs,Hs,Ys,Xs,Zs,Ws,Fs,Us,$s,Gs,qs,Ks,Qs,Js,nf,ef,tf,rf,of,uf,af,cf,lf,sf,ff,df,hf,vf,pf,gf,yf,mf,wf,xf,bf,_f,Ef,Sf,kf,Cf,Nf,Mf,Of,Pf,jf,If,Af,zf,Lf,Rf,Tf,Df,Bf,Vf,Hf,Yf,Xf,Zf,Wf,Ff=Ic;function Uf(){if(ls)return cs;ls=1;var n=Je(),e=wr(),t=Rt(),r=ut();return cs=function(o,i,u){if(!r(u))return!1;var a=typeof i;return!!("number"==a?e(u)&&t(i,u.length):"string"==a&&i in u)&&n(u[i],o)}}function $f(){if(bs)return xs;bs=1;var n=function(){if(ws)return ms;ws=1;var n=function(){if(ys)return gs;ys=1;var n=function(){if(ps)return vs;ps=1;var n=/\s/;return vs=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}}(),e=/^\s+/;return gs=function(t){return t?t.slice(0,n(t)+1).replace(e,""):t}}(),e=ut(),t=pl(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt;return ms=function(a){if("number"==typeof a)return a;if(t(a))return NaN;if(e(a)){var c="function"==typeof a.valueOf?a.valueOf():a;a=e(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}}(),e=1/0;return xs=function(t){return t?(t=n(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}}function Gf(){if(Os)return Ms;Os=1;var n=Ll();return Ms=function(e){return null!=e&&e.length?n(e,1):[]},Ms}function qf(){if(Ts)return Rs;Ts=1;var n=pl();return Rs=function(e,t,r){for(var o=-1,i=e.length;++o<i;){var u=e[o],a=t(u);if(null!=a&&(void 0===c?a==a&&!n(a):r(a,c)))var c=a,l=u}return l},Rs}function Kf(){if(Xs)return Ys;Xs=1;var n=yt(),e=Je();return Ys=function(t,r,o){(void 0!==o&&!e(t[r],o)||void 0===o&&!(r in t))&&n(t,r,o)}}function Qf(){return Us?Fs:(Us=1,Fs=function(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]})}function Jf(){return uf?of:(uf=1,of=function(n,e){return n<e})}function nd(){if(Rf)return Lf;Rf=1;var n=yl(),e=bl(),t=kl(),r=Pl(),o=(Pf||(Pf=1,Of=function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}),Of),i=Dt(),u=function(){if(zf)return Af;zf=1;var n=function(){if(If)return jf;If=1;var n=pl();return jf=function(e,t){if(e!==t){var r=void 0!==e,o=null===e,i=e==e,u=n(e),a=void 0!==t,c=null===t,l=t==t,s=n(t);if(!c&&!s&&!u&&e>t||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&e<t||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}}();return Af=function(e,t,r){for(var o=-1,i=e.criteria,u=t.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 e.index-t.index}}(),a=rl(),c=_t();return Lf=function(l,s,f){s=s.length?n(s,(function(n){return c(n)?function(t){return e(t,1===n.length?n[0]:n)}:n})):[a];var d=-1;s=n(s,i(t));var h=r(l,(function(e,t,r){return{criteria:n(s,(function(n){return n(e)})),index:++d,value:e}}));return o(h,(function(n,e){return u(n,e,f)}))}}try{Wf={cloneDeep:function(){if(as)return us;as=1;var n=Kc();return us=function(e){return n(e,5)}}(),constant:Jc(),defaults:function(){if(fs)return ss;fs=1;var n=Dl(),e=Je(),t=Uf(),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&&t(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||e(p,o[v])&&!i.call(n,v))&&(n[v]=s[v])}return n}));return ss=u}(),each:ul(),filter:Cl(),find:function(){if(Ns)return Cs;Ns=1;var n=function(){if(hs)return ds;hs=1;var n=kl(),e=wr(),t=xr();return ds=function(r){return function(o,i,u){var a=Object(o);if(!e(o)){var c=n(i,3);o=t(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(ks)return Ss;ks=1;var n=Bl(),e=kl(),t=function(){if(Es)return _s;Es=1;var n=$f();return _s=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}}(),r=Math.max;return Ss=function(o,i,u){var a=null==o?0:o.length;if(!a)return-1;var c=null==u?0:t(u);return c<0&&(c=r(a+c,0)),n(o,e(i,3),c)},Ss}());return Cs=n}(),flatten:Gf(),forEach:il(),forIn:function(){if(js)return Ps;js=1;var n=nl(),e=ol(),t=br();return Ps=function(r,o){return null==r?r:n(r,e(o),t)}}(),has:Nl(),isUndefined:Ol(),last:(As||(As=1,Is=function(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}),Is),map:jl(),mapValues:function(){if(Ls)return zs;Ls=1;var n=yt(),e=el(),t=kl();return zs=function(r,o){var i={};return o=t(o,3),e(r,(function(e,t,r){n(i,t,o(e,t,r))})),i}}(),max:function(){if(Hs)return Vs;Hs=1;var n=qf(),e=Bs?Ds:(Bs=1,Ds=function(n,e){return n>e}),t=rl();return Vs=function(r){return r&&r.length?n(r,t,e):void 0}}(),merge:function(){if(rf)return tf;rf=1;var n=function(){if(Js)return Qs;Js=1;var n=vt(),e=Kf(),t=nl(),r=function(){if(Ks)return qs;Ks=1;var n=Kf(),e=zc(),t=$c(),r=Lc(),o=qc(),i=bt(),u=_t(),a=Hl(),c=Lt(),l=at(),s=ut(),f=function(){if(Ws)return Zs;Ws=1;var n=it(),e=Vc(),t=xt(),r=Function.prototype,o=Object.prototype,i=r.toString,u=o.hasOwnProperty,a=i.call(Object);return Zs=function(r){if(!t(r)||"[object Object]"!=n(r))return!1;var o=e(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=vr(),h=Qf(),v=function(){if(Gs)return $s;Gs=1;var n=wt(),e=br();return $s=function(t){return n(t,e(t))}}();return qs=function(p,g,y,m,w,x,b){var _=h(p,y),E=h(g,y),S=b.get(E);if(S)n(p,y,S);else{var k=x?x(_,E,y+"",p,g,b):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(_)?k=_:a(_)?k=r(_):M?(C=!1,k=e(E,!0)):O?(C=!1,k=t(E,!0)):k=[]:f(E)||i(E)?(k=_,i(_)?k=v(_):s(_)&&!l(_)||(k=o(E))):C=!1}C&&(b.set(E,k),w(k,E,m,x,b),b.delete(E)),n(p,y,k)}}}(),o=ut(),i=br(),u=Qf();return Qs=function a(c,l,s,f,d){c!==l&&t(l,(function(t,i){if(d||(d=new n),o(t))r(c,l,i,s,a,f,d);else{var h=f?f(u(c,i),t,i+"",c,l,d):void 0;void 0===h&&(h=t),e(c,i,h)}}),i)},Qs}(),e=function(){if(ef)return nf;ef=1;var n=Dl(),e=Uf();return nf=function(t){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=t.length>3&&"function"==typeof u?(i--,u):void 0,a&&e(r[0],r[1],a)&&(u=i<3?void 0:u,i=1),n=Object(n);++o<i;){var c=r[o];c&&t(n,c,o,u)}return n}))}}()((function(e,t,r){n(e,t,r)}));return tf=e}(),min:function(){if(cf)return af;cf=1;var n=qf(),e=Jf(),t=rl();return af=function(r){return r&&r.length?n(r,t,e):void 0}}(),minBy:function(){if(sf)return lf;sf=1;var n=qf(),e=kl(),t=Jf();return lf=function(r,o){return r&&r.length?n(r,e(o,2),t):void 0},lf}(),now:function(){if(df)return ff;df=1;var n=rt();return ff=function(){return n.Date.now()}}(),pick:function(){if(_f)return bf;_f=1;var n=function(){if(mf)return yf;mf=1;var n=function(){if(gf)return pf;gf=1;var n=bl(),e=function(){if(vf)return hf;vf=1;var n=mt(),e=wl(),t=Rt(),r=ut(),o=xl();return hf=function(i,u,a,c){if(!r(i))return i;for(var l=-1,s=(u=e(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:t(u[l+1])?[]:{})}n(d,h,v),d=d[h]}return i}}(),t=wl();return pf=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)&&e(c,t(l,r),s)}return c}}(),e=El();return yf=function(t,r){return n(t,r,(function(n,r){return e(t,r)}))}}(),e=function(){if(xf)return wf;xf=1;var n=Gf(),e=Rl(),t=Tl();return wf=function(r){return t(e(r,void 0,n),r+"")}}()((function(e,t){return null==e?{}:n(e,t)}));return bf=e}(),range:function(){if(Mf)return Nf;Mf=1;var n=function(){if(Cf)return kf;Cf=1;var n=function(){if(Sf)return Ef;Sf=1;var n=Math.ceil,e=Math.max;return Ef=function(t,r,o,i){for(var u=-1,a=e(n((r-t)/(o||1)),0),c=Array(a);a--;)c[i?a:++u]=t,t+=o;return c},Ef}(),e=Uf(),t=$f();return kf=function(r){return function(o,i,u){return u&&"number"!=typeof u&&e(o,i,u)&&(i=u=void 0),o=t(o),void 0===i?(i=o,o=0):i=t(i),u=void 0===u?o<i?1:-1:t(u),n(o,i,u,r)}},kf}()();return Nf=n}(),reduce:Il(),sortBy:function(){if(Df)return Tf;Df=1;var n=Ll(),e=nd(),t=Dl(),r=Uf(),o=t((function(t,o){if(null==t)return[];var i=o.length;return i>1&&r(t,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),e(t,n(o,1),[])}));return Tf=o}(),uniqueId:function(){if(Vf)return Bf;Vf=1;var n=ml(),e=0;return Bf=function(t){var r=++e;return n(t)+r}}(),values:Xl(),zipObject:function(){if(Zf)return Xf;Zf=1;var n=mt(),e=Yf?Hf:(Yf=1,Hf=function(n,e,t){for(var r=-1,o=n.length,i=e.length,u={};++r<o;){var a=r<i?e[r]:void 0;t(u,n[r],a)}return u});return Xf=function(t,r){return e(t||[],r||[],n)}}()}}catch(W){}Wf||(Wf=window._);var ed=Wf,td=rd;function rd(){var n={};n._next=n._prev=n,this._sentinel=n}function od(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function id(n,e){if("_next"!==n&&"_prev"!==n)return e}rd.prototype.dequeue=function(){var n=this._sentinel,e=n._prev;if(e!==n)return od(e),e},rd.prototype.enqueue=function(n){var e=this._sentinel;n._prev&&n._next&&od(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e},rd.prototype.toString=function(){for(var n=[],e=this._sentinel,t=e._prev;t!==e;)n.push(JSON.stringify(t,id)),t=t._prev;return"["+n.join(", ")+"]"};var ud=ed,ad=Ff.Graph,cd=td,ld=ud.constant(1);function sd(n,e,t,r,o){var i=o?[]:void 0;return ud.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,fd(e,t,a)})),ud.forEach(n.outEdges(r.v),(function(r){var o=n.edge(r),i=r.w,u=n.node(i);u.in-=o,fd(e,t,u)})),n.removeNode(r.v),i}function fd(n,e,t){t.out?t.in?n[t.out-t.in+e].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var dd=ed,hd=function(n,e){if(n.nodeCount()<=1)return[];var t=function(n,e){var t=new ad,r=0,o=0;ud.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),ud.forEach(n.edges(),(function(n){var i=t.edge(n.v,n.w)||0,u=e(n),a=i+u;t.setEdge(n.v,n.w,a),o=Math.max(o,t.node(n.v).out+=u),r=Math.max(r,t.node(n.w).in+=u)}));var i=ud.range(o+r+3).map((function(){return new cd})),u=r+1;return ud.forEach(t.nodes(),(function(n){fd(i,u,t.node(n))})),{graph:t,buckets:i,zeroIdx:u}}(n,e||ld),r=function(n,e,t){for(var r,o=[],i=e[e.length-1],u=e[0];n.nodeCount();){for(;r=u.dequeue();)sd(n,e,t,r);for(;r=i.dequeue();)sd(n,e,t,r);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(r=e[a].dequeue()){o=o.concat(sd(n,e,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return ud.flatten(ud.map(r,(function(e){return n.outEdges(e.v,e.w)})),!0)},vd={run:function(n){var e="greedy"===n.graph().acyclicer?hd(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],t={},r={};return dd.forEach(n.nodes(),(function o(i){dd.has(r,i)||(r[i]=!0,t[i]=!0,dd.forEach(n.outEdges(i),(function(n){dd.has(t,n.w)?e.push(n):o(n.w)})),delete t[i])})),e}(n);dd.forEach(e,(function(e){var t=n.edge(e);n.removeEdge(e),t.forwardName=e.name,t.reversed=!0,n.setEdge(e.w,e.v,t,dd.uniqueId("rev"))}))},undo:function(n){dd.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.reversed){n.removeEdge(e);var r=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(e.w,e.v,t,r)}}))}},pd=ed,gd=Ff.Graph,yd={addDummyNode:md,simplify:function(n){var e=(new gd).setGraph(n.graph());return pd.forEach(n.nodes(),(function(t){e.setNode(t,n.node(t))})),pd.forEach(n.edges(),(function(t){var r=e.edge(t.v,t.w)||{weight:0,minlen:1},o=n.edge(t);e.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),e},asNonCompoundGraph:function(n){var e=new gd({multigraph:n.isMultigraph()}).setGraph(n.graph());return pd.forEach(n.nodes(),(function(t){n.children(t).length||e.setNode(t,n.node(t))})),pd.forEach(n.edges(),(function(t){e.setEdge(t,n.edge(t))})),e},successorWeights:function(n){var e=pd.map(n.nodes(),(function(e){var t={};return pd.forEach(n.outEdges(e),(function(e){t[e.w]=(t[e.w]||0)+n.edge(e).weight})),t}));return pd.zipObject(n.nodes(),e)},predecessorWeights:function(n){var e=pd.map(n.nodes(),(function(e){var t={};return pd.forEach(n.inEdges(e),(function(e){t[e.v]=(t[e.v]||0)+n.edge(e).weight})),t}));return pd.zipObject(n.nodes(),e)},intersectRect:function(n,e){var t,r,o=n.x,i=n.y,u=e.x-o,a=e.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),t=l*u/a,r=l):(u<0&&(c=-c),t=c,r=c*a/u),{x:o+t,y:i+r}},buildLayerMatrix:function(n){var e=pd.map(pd.range(wd(n)+1),(function(){return[]}));return pd.forEach(n.nodes(),(function(t){var r=n.node(t),o=r.rank;pd.isUndefined(o)||(e[o][r.order]=t)})),e},normalizeRanks:function(n){var e=pd.min(pd.map(n.nodes(),(function(e){return n.node(e).rank})));pd.forEach(n.nodes(),(function(t){var r=n.node(t);pd.has(r,"rank")&&(r.rank-=e)}))},removeEmptyRanks:function(n){var e=pd.min(pd.map(n.nodes(),(function(e){return n.node(e).rank}))),t=[];pd.forEach(n.nodes(),(function(r){var o=n.node(r).rank-e;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=n.graph().nodeRankFactor;pd.forEach(t,(function(e,t){pd.isUndefined(e)&&t%o!=0?--r:r&&pd.forEach(e,(function(e){n.node(e).rank+=r}))}))},addBorderNode:function(n,e,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),md(n,"border",o,e)},maxRank:wd,partition:function(n,e){var t={lhs:[],rhs:[]};return pd.forEach(n,(function(n){e(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,e){var t=pd.now();try{return e()}finally{console.log(n+" time: "+(pd.now()-t)+"ms")}},notime:function(n,e){return e()}};function md(n,e,t,r){var o;do{o=pd.uniqueId(r)}while(n.hasNode(o));return t.dummy=e,n.setNode(o,t),o}function wd(n){return pd.max(pd.map(n.nodes(),(function(e){var t=n.node(e).rank;if(!pd.isUndefined(t))return t})))}var xd=ed,bd=yd,_d={run:function(n){n.graph().dummyChains=[],xd.forEach(n.edges(),(function(e){!function(n,e){var t,r,o,i=e.v,u=n.node(i).rank,a=e.w,c=n.node(a).rank,l=e.name,s=n.edge(e),f=s.labelRank;if(c!==u+1){for(n.removeEdge(e),o=0,++u;u<c;++o,++u)s.points=[],r={width:0,height:0,edgeLabel:s,edgeObj:e,rank:u},t=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,t,{weight:s.weight},l),0===o&&n.graph().dummyChains.push(t),i=t;n.setEdge(i,a,{weight:s.weight},l)}}(n,e)}))},undo:function(n){xd.forEach(n.graph().dummyChains,(function(e){var t,r=n.node(e),o=r.edgeLabel;for(n.setEdge(r.edgeObj,o);r.dummy;)t=n.successors(e)[0],n.removeNode(e),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),e=t,r=n.node(e)}))}},Ed=ed,Sd=function(n){var e={};Ed.forEach(n.sources(),(function t(r){var o=n.node(r);if(Ed.has(e,r))return o.rank;e[r]=!0;var i=Ed.min(Ed.map(n.outEdges(r),(function(e){return t(e.w)-n.edge(e).minlen})));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i}))},kd=function(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen},Cd=ed,Nd=Ff.Graph,Md=kd,Od=function(n){var e,t,r=new Nd({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(r.setNode(o,{});Pd(r,n)<i;)e=jd(r,n),t=r.hasNode(e.v)?Md(n,e):-Md(n,e),Id(r,n,t);return r};function Pd(n,e){return Cd.forEach(n.nodes(),(function t(r){Cd.forEach(e.nodeEdges(r),(function(o){var i=o.v,u=r===i?o.w:i;n.hasNode(u)||Md(e,o)||(n.setNode(u,{}),n.setEdge(r,u,{}),t(u))}))})),n.nodeCount()}function jd(n,e){return Cd.minBy(e.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return Md(e,t)}))}function Id(n,e,t){Cd.forEach(n.nodes(),(function(n){e.node(n).rank+=t}))}var Ad=ed,zd=Od,Ld=kd,Rd=Sd,Td=Ff.alg.preorder,Dd=Ff.alg.postorder,Bd=yd.simplify,Vd=Hd;function Hd(n){n=Bd(n),Rd(n);var e,t=zd(n);for(Zd(t),Yd(t,n);e=Fd(t);)$d(t,n,e,Ud(t,n,e))}function Yd(n,e){var t=Dd(n,n.nodes());t=t.slice(0,t.length-1),Ad.forEach(t,(function(t){!function(n,e,t){var r=n.node(t).parent;n.edge(t,r).cutvalue=Xd(n,e,t)}(n,e,t)}))}function Xd(n,e,t){var r=n.node(t).parent,o=!0,i=e.edge(t,r),u=0;return i||(o=!1,i=e.edge(r,t)),u=i.weight,Ad.forEach(e.nodeEdges(t),(function(i){var a,c,l=i.v===t,s=l?i.w:i.v;if(s!==r){var f=l===o,d=e.edge(i).weight;if(u+=f?d:-d,a=t,c=s,n.hasEdge(a,c)){var h=n.edge(t,s).cutvalue;u+=f?-h:h}}})),u}function Zd(n,e){arguments.length<2&&(e=n.nodes()[0]),Wd(n,{},1,e)}function Wd(n,e,t,r,o){var i=t,u=n.node(r);return e[r]=!0,Ad.forEach(n.neighbors(r),(function(o){Ad.has(e,o)||(t=Wd(n,e,t,o,r))})),u.low=i,u.lim=t++,o?u.parent=o:delete u.parent,t}function Fd(n){return Ad.find(n.edges(),(function(e){return n.edge(e).cutvalue<0}))}function Ud(n,e,t){var r=t.v,o=t.w;e.hasEdge(r,o)||(r=t.w,o=t.v);var i=n.node(r),u=n.node(o),a=i,c=!1;i.lim>u.lim&&(a=u,c=!0);var l=Ad.filter(e.edges(),(function(e){return c===Gd(n,n.node(e.v),a)&&c!==Gd(n,n.node(e.w),a)}));return Ad.minBy(l,(function(n){return Ld(e,n)}))}function $d(n,e,t,r){var o=t.v,i=t.w;n.removeEdge(o,i),n.setEdge(r.v,r.w,{}),Zd(n),Yd(n,e),function(n,e){var t=Ad.find(n.nodes(),(function(n){return!e.node(n).parent})),r=Td(n,t);r=r.slice(1),Ad.forEach(r,(function(t){var r=n.node(t).parent,o=e.edge(t,r),i=!1;o||(o=e.edge(r,t),i=!0),e.node(t).rank=e.node(r).rank+(i?o.minlen:-o.minlen)}))}(n,e)}function Gd(n,e,t){return t.low<=e.lim&&e.lim<=t.lim}Hd.initLowLimValues=Zd,Hd.initCutValues=Yd,Hd.calcCutValue=Xd,Hd.leaveEdge=Fd,Hd.enterEdge=Ud,Hd.exchangeEdges=$d;var qd=Sd,Kd=Od,Qd=Vd,Jd=qd;var nh=ed,eh=ed,th=yd,rh={run:function(n){var e=th.addDummyNode(n,"root",{},"_root"),t=function(n){var e={};function t(r,o){var i=n.children(r);i&&i.length&&eh.forEach(i,(function(n){t(n,o+1)})),e[r]=o}return eh.forEach(n.children(),(function(n){t(n,1)})),e}(n),r=eh.max(eh.values(t))-1,o=2*r+1;n.graph().nestingRoot=e,eh.forEach(n.edges(),(function(e){n.edge(e).minlen*=o}));var i=function(n){return eh.reduce(n.edges(),(function(e,t){return e+n.edge(t).weight}),0)}(n)+1;eh.forEach(n.children(),(function(u){oh(n,e,o,i,r,t,u)})),n.graph().nodeRankFactor=o},cleanup:function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,eh.forEach(n.edges(),(function(e){n.edge(e).nestingEdge&&n.removeEdge(e)}))}};function oh(n,e,t,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,eh.forEach(a,(function(a){oh(n,e,t,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(e,c,{weight:0,minlen:o+i[u]})}else u!==e&&n.setEdge(e,u,{weight:0,minlen:t})}var ih=ed,uh=yd;function ah(n,e,t,r,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],c=uh.addDummyNode(n,"border",u,t);o[e][i]=c,n.setParent(c,r),a&&n.setEdge(a,c,{weight:1})}var ch=ed,lh={adjust:function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||sh(n)},undo:function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){ch.forEach(n.nodes(),(function(e){dh(n.node(e))})),ch.forEach(n.edges(),(function(e){var t=n.edge(e);ch.forEach(t.points,dh),ch.has(t,"y")&&dh(t)}))}(n),"lr"!==e&&"rl"!==e||(function(n){ch.forEach(n.nodes(),(function(e){hh(n.node(e))})),ch.forEach(n.edges(),(function(e){var t=n.edge(e);ch.forEach(t.points,hh),ch.has(t,"x")&&hh(t)}))}(n),sh(n))}};function sh(n){ch.forEach(n.nodes(),(function(e){fh(n.node(e))})),ch.forEach(n.edges(),(function(e){fh(n.edge(e))}))}function fh(n){var e=n.width;n.width=n.height,n.height=e}function dh(n){n.y=-n.y}function hh(n){var e=n.x;n.x=n.y,n.y=e}var vh=ed,ph=ed;function gh(n,e,t){for(var r=ph.zipObject(t,ph.map(t,(function(n,e){return e}))),o=ph.flatten(ph.map(e,(function(e){return ph.sortBy(ph.map(n.outEdges(e),(function(e){return{pos:r[e.w],weight:n.edge(e).weight}})),"pos")})),!0),i=1;i<t.length;)i<<=1;var u=2*i-1;i-=1;var a=ph.map(new Array(u),(function(){return 0})),c=0;return ph.forEach(o.forEach((function(n){var e=n.pos+i;a[e]+=n.weight;for(var t=0;e>0;)e%2&&(t+=a[e+1]),a[e=e-1>>1]+=n.weight;c+=n.weight*t}))),c}var yh=ed,mh=ed,wh=ed,xh=yd;function bh(n,e,t){for(var r;e.length&&(r=wh.last(e)).i<=t;)e.pop(),n.push(r.vs),t++;return t}var _h=ed,Eh=ed,Sh=Ff.Graph,kh=ed,Ch=ed,Nh=function(n){var e={},t=vh.filter(n.nodes(),(function(e){return!n.children(e).length})),r=vh.max(vh.map(t,(function(e){return n.node(e).rank}))),o=vh.map(vh.range(r+1),(function(){return[]}));var i=vh.sortBy(t,(function(e){return n.node(e).rank}));return vh.forEach(i,(function t(r){if(!vh.has(e,r)){e[r]=!0;var i=n.node(r);o[i.rank].push(r),vh.forEach(n.successors(r),t)}})),o},Mh=function(n,e){for(var t=0,r=1;r<e.length;++r)t+=gh(n,e[r-1],e[r]);return t},Oh=function n(e,t,r,o){var i=e.children(t),u=e.node(t),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,e){return yh.map(e,(function(e){var t=n.inEdges(e);if(t.length){var r=yh.reduce(t,(function(e,t){var r=n.edge(t),o=n.node(t.v);return{sum:e.sum+r.weight*o.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))}(e,i);_h.forEach(s,(function(t){if(e.children(t.v).length){var i=n(e,t.v,r,o);l[t.v]=i,_h.has(i,"barycenter")&&(u=t,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,e){var t={};return mh.forEach(n,(function(n,e){var r=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};mh.isUndefined(n.barycenter)||(r.barycenter=n.barycenter,r.weight=n.weight)})),mh.forEach(e.edges(),(function(n){var e=t[n.v],r=t[n.w];mh.isUndefined(e)||mh.isUndefined(r)||(r.indegree++,e.out.push(t[n.w]))})),function(n){var e=[];function t(n){return function(e){e.merged||(mh.isUndefined(e.barycenter)||mh.isUndefined(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var t=0,r=0;n.weight&&(t+=n.barycenter*n.weight,r+=n.weight),e.weight&&(t+=e.barycenter*e.weight,r+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=t/r,n.weight=r,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function r(e){return function(t){t.in.push(e),0==--t.indegree&&n.push(t)}}for(;n.length;){var o=n.pop();e.push(o),mh.forEach(o.in.reverse(),t(o)),mh.forEach(o.out,r(o))}return mh.map(mh.filter(e,(function(n){return!n.merged})),(function(n){return mh.pick(n,["vs","i","barycenter","weight"])}))}(mh.filter(t,(function(n){return!n.indegree})))}(s,r);!function(n,e){_h.forEach(n,(function(n){n.vs=_h.flatten(n.vs.map((function(n){return e[n]?e[n].vs:n})),!0)}))}(f,l);var d=function(n,e){var t,r=xh.partition(n,(function(n){return wh.has(n,"barycenter")})),o=r.lhs,i=wh.sortBy(r.rhs,(function(n){return-n.i})),u=[],a=0,c=0,l=0;o.sort((t=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:t?e.i-n.i:n.i-e.i})),l=bh(u,i,l),wh.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:wh.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),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.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},Ph=function(n,e,t){var r=function(n){for(var e;n.hasNode(e=Eh.uniqueId("_root")););return e}(n),o=new Sh({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(e){return n.node(e)}));return Eh.forEach(n.nodes(),(function(i){var u=n.node(i),a=n.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||r),Eh.forEach(n[t](i),(function(e){var t=e.v===i?e.w:e.v,r=o.edge(t,i),u=Eh.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:n.edge(e).weight+u})})),Eh.has(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))})),o},jh=Ff.Graph,Ih=yd;function Ah(n,e,t){return Ch.map(e,(function(e){return Ph(n,e,t)}))}function zh(n,e){var t=new jh;Ch.forEach(n,(function(n){var r=n.graph().root,o=Oh(n,r,t,e);Ch.forEach(o.vs,(function(e,t){n.node(e).order=t})),function(n,e,t){var r,o={};kh.forEach(t,(function(t){for(var i,u,a=n.parent(t);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=r,r=a),u&&u!==a)return void e.setEdge(u,a);a=i}}))}(n,t,o.vs)}))}function Lh(n,e){Ch.forEach(e,(function(e){Ch.forEach(e,(function(e,t){n.node(e).order=t}))}))}var Rh=ed,Th=Ff.Graph,Dh=yd;function Bh(n,e,t){if(e>t){var r=e;e=t,t=r}var o=n[e];o||(n[e]=o={}),o[t]=!0}function Vh(n,e,t){if(e>t){var r=e;e=t,t=r}return Rh.has(n[e],t)}var Hh=ed,Yh=yd,Xh=function(n){var e,t=Dh.buildLayerMatrix(n),r=Rh.merge(function(n,e){var t={};return Rh.reduce(e,(function(e,r){var o=0,i=0,u=e.length,a=Rh.last(r);return Rh.forEach(r,(function(e,c){var l=function(n,e){if(n.node(e).dummy)return Rh.find(n.predecessors(e),(function(e){return n.node(e).dummy}))}(n,e),s=l?n.node(l).order:u;(l||e===a)&&(Rh.forEach(r.slice(i,c+1),(function(e){Rh.forEach(n.predecessors(e),(function(r){var i=n.node(r),u=i.order;!(u<o||s<u)||i.dummy&&n.node(e).dummy||Bh(t,r,e)}))})),i=c+1,o=s)})),r})),t}(n,t),function(n,e){var t={};function r(e,r,o,i,u){var a;Rh.forEach(Rh.range(r,o),(function(r){a=e[r],n.node(a).dummy&&Rh.forEach(n.predecessors(a),(function(e){var r=n.node(e);r.dummy&&(r.order<i||r.order>u)&&Bh(t,e,a)}))}))}return Rh.reduce(e,(function(e,t){var o,i=-1,u=0;return Rh.forEach(t,(function(a,c){if("border"===n.node(a).dummy){var l=n.predecessors(a);l.length&&(o=n.node(l[0]).order,r(t,u,c,i,o),u=c,i=o)}r(t,u,t.length,o,e.length)})),t})),t}(n,t)),o={};Rh.forEach(["u","d"],(function(i){e="u"===i?t:Rh.values(t).reverse(),Rh.forEach(["l","r"],(function(t){"r"===t&&(e=Rh.map(e,(function(n){return Rh.values(n).reverse()})));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,t,r){var o={},i={},u={};return Rh.forEach(e,(function(n){Rh.forEach(n,(function(n,e){o[n]=n,i[n]=n,u[n]=e}))})),Rh.forEach(e,(function(n){var e=-1;Rh.forEach(n,(function(n){var a=r(n);if(a.length){a=Rh.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&&e<u[f]&&!Vh(t,n,f)&&(i[f]=n,i[n]=o[n]=o[f],e=u[f])}}}))})),{root:o,align:i}}(0,e,r,u),c=function(n,e,t,r,o){var i={},u=function(n,e,t,r){var o=new Th,i=n.graph(),u=function(n,e,t){return function(r,o,i){var u,a=r.node(o),c=r.node(i),l=0;if(l+=a.width/2,Rh.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(l+=t?u:-u),u=0,l+=(a.dummy?e:n)/2,l+=(c.dummy?e:n)/2,l+=c.width/2,Rh.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":u=c.width/2;break;case"r":u=-c.width/2}return u&&(l+=t?u:-u),u=0,l}}(i.nodesep,i.edgesep,r);return Rh.forEach(e,(function(e){var r;Rh.forEach(e,(function(e){var i=t[e];if(o.setNode(i),r){var a=t[r],c=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,e,r),c||0))}r=e}))})),o}(n,e,t,o),a=o?"borderLeft":"borderRight";function c(n,e){for(var t=u.nodes(),r=t.pop(),o={};r;)o[r]?n(r):(o[r]=!0,t.push(r),t=t.concat(e(r))),r=t.pop()}return c((function(n){i[n]=u.inEdges(n).reduce((function(n,e){return Math.max(n,i[e.v]+u.edge(e))}),0)}),u.predecessors.bind(u)),c((function(e){var t=u.outEdges(e).reduce((function(n,e){return Math.min(n,i[e.w]-u.edge(e))}),Number.POSITIVE_INFINITY),r=n.node(e);t!==Number.POSITIVE_INFINITY&&r.borderType!==a&&(i[e]=Math.max(i[e],t))}),u.successors.bind(u)),Rh.forEach(r,(function(n){i[n]=i[t[n]]})),i}(n,e,a.root,a.align,"r"===t);"r"===t&&(c=Rh.mapValues(c,(function(n){return-n}))),o[i+t]=c}))}));var i=function(n,e){return Rh.minBy(Rh.values(e),(function(e){var t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return Rh.forIn(e,(function(e,o){var i=function(n,e){return n.node(e).width}(n,o)/2;t=Math.max(e+i,t),r=Math.min(e-i,r)})),t-r}))}(n,o);return function(n,e){var t=Rh.values(e),r=Rh.min(t),o=Rh.max(t);Rh.forEach(["u","d"],(function(t){Rh.forEach(["l","r"],(function(i){var u,a=t+i,c=n[a];if(c!==e){var l=Rh.values(c);(u="l"===i?r-Rh.min(l):o-Rh.max(l))&&(n[a]=Rh.mapValues(c,(function(n){return n+u})))}}))}))}(o,i),function(n,e){return Rh.mapValues(n.ul,(function(t,r){if(e)return n[e.toLowerCase()][r];var o=Rh.sortBy(Rh.map(n,r));return(o[1]+o[2])/2}))}(o,n.graph().align)},Zh=ed,Wh=vd,Fh=_d,Uh=function(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Qd(n)}(n);break;case"tight-tree":!function(n){qd(n),Kd(n)}(n);break;case"longest-path":Jd(n)}},$h=yd.normalizeRanks,Gh=function(n){var e=function(n){var e={},t=0;return nh.forEach(n.children(),(function r(o){var i=t;nh.forEach(n.children(o),r),e[o]={low:i,lim:t++}})),e}(n);nh.forEach(n.graph().dummyChains,(function(t){for(var r=n.node(t),o=r.edgeObj,i=function(n,e,t,r){var o,i,u=[],a=[],c=Math.min(e[t].low,e[r].low),l=Math.max(e[t].lim,e[r].lim);o=t;do{o=n.parent(o),u.push(o)}while(o&&(e[o].low>c||l>e[o].lim));for(i=o,o=r;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,c=0,l=u[c],s=!0;t!==o.w;){if(r=n.node(t),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(t,l),t=n.successors(t)[0]}}))},qh=yd.removeEmptyRanks,Kh=rh,Qh=function(n){ih.forEach(n.children(),(function e(t){var r=n.children(t),o=n.node(t);if(r.length&&ih.forEach(r,e),ih.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)ah(n,"borderLeft","_bl",t,o,i),ah(n,"borderRight","_br",t,o,i)}}))},Jh=lh,nv=function(n){var e=Ih.maxRank(n),t=Ah(n,Ch.range(1,e+1),"inEdges"),r=Ah(n,Ch.range(e-1,-1,-1),"outEdges"),o=Nh(n);Lh(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,c=0;c<4;++a,++c){zh(a%2?t:r,a%4>=2),o=Ih.buildLayerMatrix(n);var l=Mh(n,o);l<u&&(c=0,i=Ch.cloneDeep(o),u=l)}Lh(n,i)},ev=function(n){(function(n){var e=Yh.buildLayerMatrix(n),t=n.graph().ranksep,r=0;Hh.forEach(e,(function(e){var o=Hh.max(Hh.map(e,(function(e){return n.node(e).height})));Hh.forEach(e,(function(e){n.node(e).y=r+o/2})),r+=o+t}))})(n=Yh.asNonCompoundGraph(n)),Hh.forEach(Xh(n),(function(e,t){n.node(t).x=e}))},tv=yd,rv=Ff.Graph,ov=["nodesep","edgesep","ranksep","marginx","marginy"],iv={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},uv=["acyclicer","ranker","rankdir","align"],av=["width","height"],cv={width:0,height:0},lv=["minlen","weight","width","height","labeloffset"],sv={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fv=["labelpos"];function dv(n,e){return Zh.mapValues(Zh.pick(n,e),Number)}function hv(n){var e={};return Zh.forEach(n,(function(n,t){e[t.toLowerCase()]=n})),e}var vv=ed,pv=yd,gv=Ff.Graph,yv={debugOrdering:function(n){var e=pv.buildLayerMatrix(n),t=new gv({compound:!0,multigraph:!0}).setGraph({});return vv.forEach(n.nodes(),(function(e){t.setNode(e,{label:e}),t.setParent(e,"layer"+n.node(e).rank)})),vv.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),vv.forEach(e,(function(n,e){var r="layer"+e;t.setNode(r,{rank:"same"}),vv.reduce(n,(function(n,e){return t.setEdge(n,e,{style:"invis"}),e}))})),t}},mv=Qe({graphlib:Ff,layout:function(n,e){var t=e&&e.debugTiming?tv.time:tv.notime;t("layout",(function(){var e=t(" buildLayoutGraph",(function(){return function(n){var e=new rv({multigraph:!0,compound:!0}),t=hv(n.graph());return e.setGraph(Zh.merge({},iv,dv(t,ov),Zh.pick(t,uv))),Zh.forEach(n.nodes(),(function(t){var r=hv(n.node(t));e.setNode(t,Zh.defaults(dv(r,av),cv)),e.setParent(t,n.parent(t))})),Zh.forEach(n.edges(),(function(t){var r=hv(n.edge(t));e.setEdge(t,Zh.merge({},sv,dv(r,lv),Zh.pick(r,fv)))})),e}(n)}));t(" runLayout",(function(){!function(n,e){e(" makeSpaceForEdgeLabels",(function(){!function(n){var e=n.graph();e.ranksep/=2,Zh.forEach(n.edges(),(function(t){var r=n.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(n)})),e(" removeSelfEdges",(function(){!function(n){Zh.forEach(n.edges(),(function(e){if(e.v===e.w){var t=n.node(e.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}}))}(n)})),e(" acyclic",(function(){Wh.run(n)})),e(" nestingGraph.run",(function(){Kh.run(n)})),e(" rank",(function(){Uh(tv.asNonCompoundGraph(n))})),e(" injectEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);if(t.width&&t.height){var r=n.node(e.v),o={rank:(n.node(e.w).rank-r.rank)/2+r.rank,e:e};tv.addDummyNode(n,"edge-proxy",o,"_ep")}}))}(n)})),e(" removeEmptyRanks",(function(){qh(n)})),e(" nestingGraph.cleanup",(function(){Kh.cleanup(n)})),e(" normalizeRanks",(function(){$h(n)})),e(" assignRankMinMax",(function(){!function(n){var e=0;Zh.forEach(n.nodes(),(function(t){var r=n.node(t);r.borderTop&&(r.minRank=n.node(r.borderTop).rank,r.maxRank=n.node(r.borderBottom).rank,e=Zh.max(e,r.maxRank))})),n.graph().maxRank=e}(n)})),e(" removeEdgeLabelProxies",(function(){!function(n){Zh.forEach(n.nodes(),(function(e){var t=n.node(e);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(e))}))}(n)})),e(" normalize.run",(function(){Fh.run(n)})),e(" parentDummyChains",(function(){Gh(n)})),e(" addBorderSegments",(function(){Qh(n)})),e(" order",(function(){nv(n)})),e(" insertSelfEdges",(function(){!function(n){var e=tv.buildLayerMatrix(n);Zh.forEach(e,(function(e){var t=0;Zh.forEach(e,(function(e,r){var o=n.node(e);o.order=r+t,Zh.forEach(o.selfEdges,(function(e){tv.addDummyNode(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++t,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(n)})),e(" adjustCoordinateSystem",(function(){Jh.adjust(n)})),e(" position",(function(){ev(n)})),e(" positionSelfEdges",(function(){!function(n){Zh.forEach(n.nodes(),(function(e){var t=n.node(e);if("selfedge"===t.dummy){var r=n.node(t.e.v),o=r.x+r.width/2,i=r.y,u=t.x-o,a=r.height/2;n.setEdge(t.e,t.label),n.removeNode(e),t.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}],t.label.x=t.x,t.label.y=t.y}}))}(n)})),e(" removeBorderNodes",(function(){!function(n){Zh.forEach(n.nodes(),(function(e){if(n.children(e).length){var t=n.node(e),r=n.node(t.borderTop),o=n.node(t.borderBottom),i=n.node(Zh.last(t.borderLeft)),u=n.node(Zh.last(t.borderRight));t.width=Math.abs(u.x-i.x),t.height=Math.abs(o.y-r.y),t.x=i.x+t.width/2,t.y=r.y+t.height/2}})),Zh.forEach(n.nodes(),(function(e){"border"===n.node(e).dummy&&n.removeNode(e)}))}(n)})),e(" normalize.undo",(function(){Fh.undo(n)})),e(" fixupEdgeLabelCoords",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);if(Zh.has(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}}))}(n)})),e(" undoCoordinateSystem",(function(){Jh.undo(n)})),e(" translateGraph",(function(){!function(n){var e=Number.POSITIVE_INFINITY,t=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;e=Math.min(e,i-a/2),t=Math.max(t,i+a/2),r=Math.min(r,u-c/2),o=Math.max(o,u+c/2)}Zh.forEach(n.nodes(),(function(e){c(n.node(e))})),Zh.forEach(n.edges(),(function(e){var t=n.edge(e);Zh.has(t,"x")&&c(t)})),e-=u,r-=a,Zh.forEach(n.nodes(),(function(t){var o=n.node(t);o.x-=e,o.y-=r})),Zh.forEach(n.edges(),(function(t){var o=n.edge(t);Zh.forEach(o.points,(function(n){n.x-=e,n.y-=r})),Zh.has(o,"x")&&(o.x-=e),Zh.has(o,"y")&&(o.y-=r)})),i.width=t-e+u,i.height=o-r+a}(n)})),e(" assignNodeIntersects",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t,r,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=u,r=i),o.points.unshift(tv.intersectRect(i,t)),o.points.push(tv.intersectRect(u,r))}))}(n)})),e(" reversePoints",(function(){!function(n){Zh.forEach(n.edges(),(function(e){var t=n.edge(e);t.reversed&&t.points.reverse()}))}(n)})),e(" acyclic.undo",(function(){Wh.undo(n)}))}(e,t)})),t(" updateInputGraph",(function(){!function(n,e){Zh.forEach(n.nodes(),(function(t){var r=n.node(t),o=e.node(t);r&&(r.x=o.x,r.y=o.y,e.children(t).length&&(r.width=o.width,r.height=o.height))})),Zh.forEach(n.edges(),(function(t){var r=n.edge(t),o=e.edge(t);r.points=o.points,Zh.has(o,"x")&&(r.x=o.x,r.y=o.y)})),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(n,e)}))}))},debug:yv,util:{time:yd.time,notime:yd.notime},version:"0.8.5"}),wv={error001:function(){return"[Ink Flow]: Seems like you have not used zustand provider as an ancestor."},error002:function(){return"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them."},error003:function(n){return'Node type "'.concat(n,'" not found. Using fallback type "default".')},error004:function(){return"The Ink Flow parent container needs a width and a height to render the graph."},error005:function(){return"Only child nodes can use a parent extent."},error006:function(){return"Can't create edge. An edge needs a source and a target."},error007:function(n){return"The old edge with id=".concat(n," does not exist.")},error009:function(n){return'Marker type "'.concat(n,"\" doesn't exist.")},error008:function(n,e){var t=e.id,r=e.sourceHandle,o=e.targetHandle;return"Couldn't create edge for ".concat(n,' handle id: "').concat(r?o:r,'", edge id: ').concat(t,".")},error010:function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},error011:function(n){return'Edge type "'.concat(n,'" not found. Using fallback type "default".')},error012: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.')},error013:function(n){return void 0===n&&(n="react"),"It seems that you haven't loaded the styles. Please import '@aloudata/".concat(n,"/dist/style.css' or base.css to make sure everything is working properly.")}},xv=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bv=["Enter"," ","Escape"],_v=.5,Ev=2,Sv=[0,0],kv=function(n){return"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n)},Cv=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.source===n.id&&r.add(e.target)})),e.filter((function(n){return r.has(n.id)}))},Nv=function(n,e,t){if(!n.id)return[];var r=new Set;return t.forEach((function(e){e.target===n.id&&r.add(e.source)})),e.filter((function(n){return r.has(n.id)}))},Mv=function(n,e){var t;void 0===e&&(e=[0,0]);var r=Gv(n),o=r.width,i=r.height,u=null!==(t=n.origin)&&void 0!==t?t:e,a=o*u[0],c=i*u[1];return{x:n.position.x-a,y:n.position.y-c}},Ov=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=Vv(t,e.nodeOrigin);return Rv(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Dv(t)},Pv=function(n,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))};function jv(n){var e,t,r,o=n.nodeId,i=n.nextPosition,u=n.nodeLookup,a=n.nodeOrigin,c=void 0===a?[0,0]:a,l=n.nodeExtent,s=n.onError,f=u.get(o),d=f.parentId?u.get(f.parentId):void 0,h=d?d.internals.positionAbsolute:{x:0,y:0},v=h.x,p=h.y,g=null!==(e=f.origin)&&void 0!==e?e:c,y=l;if("parent"!==f.extent||f.expandParent)d&&$v(f.extent)&&(y=[[f.extent[0][0]+v,f.extent[0][1]+p],[f.extent[1][0]+v,f.extent[1][1]+p]]);else if(d){var m=d.measured.width,w=d.measured.height;m&&w&&(y=[[v,p],[v+m,p+w]])}else null==s||s("005",wv.error005());var x=$v(y)?Av(i,y,f.measured):i;return void 0!==f.measured.width&&void 0!==f.measured.height||null==s||s("015",wv.error015()),{position:{x:x.x-v+(null!==(t=f.measured.width)&&void 0!==t?t:0)*g[0],y:x.y-p+(null!==(r=f.measured.height)&&void 0!==r?r:0)*g[1]},positionAbsolute:x}}var Iv=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Av=function(n,e,t){var r,o;return void 0===n&&(n={x:0,y:0}),{x:Iv(n.x,e[0][0],e[1][0]-(null!==(r=null==t?void 0:t.width)&&void 0!==r?r:0)),y:Iv(n.y,e[0][1],e[1][1]-(null!==(o=null==t?void 0:t.height)&&void 0!==o?o:0))}},zv=function(n,e,t){return n<e?Iv(Math.abs(n-e),1,50)/50:n>t?-Iv(Math.abs(n-t),1,50)/50:0},Lv=function(n,e,t,r){return void 0===t&&(t=15),void 0===r&&(r=40),[zv(n.x,r,e.width-r)*t,zv(n.y,r,e.height-r)*t]},Rv=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},Tv=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},Dv=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},Bv=function(n,e){var t,r,o,i,u,a,c,l;void 0===e&&(e=[0,0]);var s=kv(n)?n.internals.positionAbsolute:Mv(n,e);return{x:s.x,y:s.y,width:null!==(i=null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:n.initialWidth)&&void 0!==i?i:0,height:null!==(l=null!==(c=null!==(a=null===(u=n.measured)||void 0===u?void 0:u.height)&&void 0!==a?a:n.height)&&void 0!==c?c:n.initialHeight)&&void 0!==l?l:0}},Vv=function(n,e){var t,r,o,i,u,a,c,l;void 0===e&&(e=[0,0]);var s=kv(n)?n.internals.positionAbsolute:Mv(n,e),f=s.x,d=s.y;return{x:f,y:d,x2:f+(null!==(i=null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:n.width)&&void 0!==o?o:n.initialWidth)&&void 0!==i?i:0),y2:d+(null!==(l=null!==(c=null!==(a=null===(u=n.measured)||void 0===u?void 0:u.height)&&void 0!==a?a:n.height)&&void 0!==c?c:n.initialHeight)&&void 0!==l?l:0)}},Hv=function(n,e){return Dv(Rv(Tv(n),Tv(e)))},Yv=function(n,e){var t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),r=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*r)},Xv=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},Zv=function(n,e,t,r){var o=n.x,i=n.y,u=$(e,3),a=u[0],c=u[1],l=u[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return t?Xv(s,r):s},Wv=function(n,e){var t=n.x,r=n.y,o=$(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}},Fv=function(n,e,t,r,o,i){var u=e/(n.width*(1+i)),a=t/(n.height*(1+i)),c=Math.min(u,a),l=Iv(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}},Uv=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 $v(n){return void 0!==n&&"parent"!==n}function Gv(n){var e,t,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t: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}}function qv(n,e,t){var r=Gv(t),o=r.width,i=r.height,u=t.internals.positionAbsolute,a=u.x,c=u.y;return Av(n,[[a,c],[a+o,c+i]],e)}var Kv={x:0,y:0};function Qv(n){return null===n?null:n?"valid":"invalid"}function Jv(n,e){var t=e.snapGrid,r=void 0===t?[0,0]:t,o=e.snapToGrid,i=void 0!==o&&o,u=e.transform,a=op(n),c=a.x,l=a.y,s=Zv({x:c,y:l},u),f=i?Xv(s,r):s,d=f.x,h=f.y;return W({xSnapped:d,ySnapped:h},s)}var np,ep,tp,rp=function(n){return{width:n.offsetWidth,height:n.offsetHeight}},op=function(n,e){var t,r,o,i,u=function(n){return"clientX"in n}(n),a=u?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}},ip=function(n,e,t,r,o){var i=e.querySelectorAll(".".concat(n));return i&&i.length?Array.from(i).map((function(e){var i=e.getBoundingClientRect();return W({id:e.getAttribute("data-handleid"),type:n,nodeId:o,position:e.getAttribute("data-handlepos"),x:(i.left-t.left)/r,y:(i.top-t.top)/r},rp(e))})):null};!function(n){n.Strict="strict",n.Loose="loose"}(np||(np={})),function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"}(ep||(ep={})),function(n){n.Partial="partial",n.Full="full"}(tp||(tp={}));var up,ap,cp,lp,sp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};!function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"}(up||(up={})),function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"}(ap||(ap={})),function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"}(lp||(lp={}));var fp=((cp={})[lp.Left]=lp.Right,cp[lp.Right]=lp.Left,cp[lp.Top]=lp.Bottom,cp[lp.Bottom]=lp.Top,cp);function dp(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-e),Math.abs(c-t)]}function hp(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function vp(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case lp.Left:return[t-hp(t-o,u),r];case lp.Right:return[t+hp(o-t,u),r];case lp.Top:return[t,r-hp(r-i,u)];case lp.Bottom:return[t,r+hp(i-r,u)]}}function pp(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.curvature,s=void 0===l?.25:l,f=$(vp({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=$(vp({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],y=$(dp({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),m=y[0],w=y[1],x=y[2],b=y[3];return["M".concat(e,",").concat(t," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),m,w,x,b]}function gp(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,u=r<e?r+i:r-i,a=Math.abs(o-t)/2;return[u,o<t?o+a:o-a,i,a]}var yp,mp=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")},wp=function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(t=function(n){return"id"in n&&"source"in n&&"target"in n}(n)?W({},n):W(W({},n),{id:mp(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):(wv.error006(),e);var t},xp=function(n,e,t,r){void 0===r&&(r={shouldReplaceId:!0});var o=n.id,i=F(n,["id"]);if(!e.source||!e.target)return wv.error006(),t;if(!t.find((function(e){return e.id===n.id})))return wv.error007(o),t;var u=W(W({},i),{id:r.shouldReplaceId?mp(e):o,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle});return t.filter((function(n){return n.id!==o})).concat(u)};function bp(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=$(gp({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),u,a,c,l]}var _p=((yp={})[lp.Left]={x:-1,y:0},yp[lp.Right]={x:1,y:0},yp[lp.Top]={x:0,y:-1},yp[lp.Bottom]={x:0,y:1},yp),Ep=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function Sp(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?lp.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?lp.Top:l,f=n.center,d=n.offset,h=_p[a],v=_p[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 e=n.source,t=n.sourcePosition,r=void 0===t?lp.Bottom:t,o=n.target;return r===lp.Left||r===lp.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.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],x=[],b={x:0,y:0},_={x:0,y:0},E=$(gp({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!==(e=f.x)&&void 0!==e?e:S,o=null!==(t=f.y)&&void 0!==t?t:k;var M=[{x:r,y:p.y},{x:r,y:g.y}],O=[{x:p.x,y:o},{x:g.x,y:o}];x=h[m]===w?"x"===m?M:O:"x"===m?O:M}else{var P=[{x:p.x,y:g.y}],j=[{x:g.x,y:p.y}];if(x="x"===m?h.x===w?j:P:h.y===w?P:j,a===s){var I=Math.abs(i[m]-c[m]);if(I<=d){var A=Math.min(d-1,d-I);h[m]===w?b[m]=(p[m]>i[m]?-1:1)*A:_[m]=(g[m]>c[m]?-1:1)*A}}if(a!==s){var z="x"===m?"y":"x",L=h[m]===v[z],R=p[z]>g[z],T=p[z]<g[z];(1===h[m]&&(!L&&R||L&&T)||1!==h[m]&&(!L&&T||L&&R))&&(x="x"===m?P:j)}var D={x:p.x+b.x,y:p.y+b.y},B={x:g.x+_.x,y:g.y+_.y};Math.max(Math.abs(D.x-x[0].x),Math.abs(B.x-x[0].x))>=Math.max(Math.abs(D.y-x[0].y),Math.abs(B.y-x[0].y))?(r=(D.x+B.x)/2,o=x[0].y):(r=x[0].x,o=(D.y+B.y)/2)}return[G(G([i,{x:p.x+b.x,y:p.y+b.y}],$(x),!1),[{x:g.x+_.x,y:g.y+_.y},c],!1),r,o,C,N]}function kp(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=$(Sp({source:{x:e,y:t},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,e,t){return n+(t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(Ep(n,e)/2,Ep(e,t)/2,r),i=e.x,u=e.y;if(n.x===i&&i===t.x||n.y===u&&u===t.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<t.x?-1:1,c=n.y<t.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<t.x?1:-1,s=n.y<t.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[t-1],e,p[t+1],s):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y))}),""),g,y,m,w]}function Cp(n,e,t,r){var o,i;void 0===t&&(t=lp.Left);var u=(null!==(o=null==e?void 0:e.x)&&void 0!==o?o:0)+n.internals.positionAbsolute.x,a=(null!==(i=null==e?void 0:e.y)&&void 0!==i?i:0)+n.internals.positionAbsolute.y,c=null!=e?e:Gv(n);return{x:u+c.width/2,y:a+c.height/2}}var Np={nodeOrigin:[0,0],nodeExtent:xv,elevateNodesOnSelect:!0,defaults:{}},Mp=W(W({},Np),{checkEquality:!0});function Op(n,e,t,r){var o,i,u,a,c=Ip(Mp,r),l=new Map(e),s=(null==c?void 0:c.elevateNodesOnSelect)?1e3:0;e.clear(),t.clear();try{for(var f=U(n),d=f.next();!d.done;d=f.next()){var h=d.value,v=l.get(h.id);if(c.checkEquality&&h===(null==v?void 0:v.internals.userNode))e.set(h.id,v);else{var p=Mv(h,c.nodeOrigin),g=$v(h.extent)?h.extent:c.nodeExtent,y=Av(p,g,Gv(h));v=W(W(W({},c.defaults),h),{measured:{width:null===(u=h.measured)||void 0===u?void 0:u.width,height:null===(a=h.measured)||void 0===a?void 0:a.height},internals:{positionAbsolute:y,handleBounds:h.measured?null==v?void 0:v.internals.handleBounds:void 0,z:Ap(h,s),userNode:h}}),e.set(h.id,v)}h.parentId&&jp(v,e,t,r)}}catch(n){o={error:n}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}function Pp(n,e,t,r){var o,i,u,a;void 0===r&&(r=[0,0]);var c=[],l=new Map;try{for(var s=U(n),f=s.next();!f.done;f=s.next()){var d=f.value,h=e.get(d.parentId);if(h){var v=null!==(a=null===(u=l.get(d.parentId))||void 0===u?void 0:u.expandedRect)&&void 0!==a?a:Bv(h),p=Hv(v,d.rect);l.set(d.parentId,{expandedRect:p,parent:h})}}}catch(n){o={error:n}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return l.size>0&&l.forEach((function(e,o){var i,u,a=e.expandedRect,l=e.parent,s=l.internals.positionAbsolute,f=Gv(l),d=null!==(i=l.origin)&&void 0!==i?i:r,h=a.x<s.x?Math.round(Math.abs(s.x-a.x)):0,v=a.y<s.y?Math.round(Math.abs(s.y-a.y)):0,p=Math.max(f.width,Math.round(a.width)),g=Math.max(f.height,Math.round(a.height)),y=(p-f.width)*d[0],m=(g-f.height)*d[1];(h>0||v>0||y||m)&&(c.push({id:o,type:"position",position:{x:l.position.x-h+y,y:l.position.y-v+m}}),null===(u=t.get(o))||void 0===u||u.forEach((function(e){n.some((function(n){return n.id===e.id}))||c.push({id:e.id,type:"position",position:{x:e.position.x+h,y:e.position.y+v}})}))),(f.width<a.width||f.height<a.height||h||v)&&c.push({id:o,type:"dimensions",setAttributes:!0,dimensions:{width:p+(h?d[0]*h-y:0),height:g+(v?d[1]*v-m:0)}})})),c}function jp(n,e,t,r){var o=Ip(Np,r),i=o.elevateNodesOnSelect,u=o.nodeOrigin,a=o.nodeExtent,c=n.parentId,l=e.get(c);if(l){!function(n,e){if(n.parentId){var t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}}(n,t);var s=function(n,e,t,r,o){var i,u=e.internals.positionAbsolute,a=u.x,c=u.y,l=Gv(n),s=Mv(n,t),f=$v(n.extent)?Av(s,n.extent,l):s,d=Av({x:a+f.x,y:c+f.y},r,l);"parent"===n.extent&&(d=qv(d,l,e));var h=Ap(n,o),v=null!==(i=e.internals.z)&&void 0!==i?i:0;return{x:d.x,y:d.y,z:v>h?v:h}}(n,l,u,a,i?1e3:0),f=s.x,d=s.y,h=s.z,v=n.internals.positionAbsolute,p=f!==v.x||d!==v.y;(p||h!==n.internals.z)&&e.set(n.id,W(W({},n),{internals:W(W({},n.internals),{positionAbsolute:p?{x:f,y:d}:v,z:h})}))}else console.warn("Parent node ".concat(c," not found. Please make sure that parent nodes are in front of their child nodes in the nodes array."))}function Ip(n,e){var t=W({},n);for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function Ap(n,e){return(function(n){return!isNaN(n)&&isFinite(n)}(n.zIndex)?n.zIndex:0)+(n.selected?e:0)}function zp(n,e,t){var r=(null==t?void 0:t.rankdir)||"TB",o=new mv.graphlib.Graph;o.setDefaultEdgeLabel((function(){return{}})),o.setGraph(W({rankdir:r},t));var i=n.map((function(n){return W({},n)}));i.forEach((function(n){var e,t;if(!n.id)throw new Error('Node "id" does not exist');var r=(null===(e=n.data)||void 0===e?void 0:e.width)||200,i=(null===(t=n.data)||void 0===t?void 0:t.height)||56;o.setNode(n.id,{width:r,height:i})})),e.forEach((function(n){o.setEdge(n.source,n.target)})),mv.layout(o),i.forEach((function(n){var e=o.node(n.id),t="bottom",i="top";switch(r){case"TB":default:t="bottom",i="top";break;case"BT":t="top",i="bottom";break;case"LR":t="right",i="left";break;case"RL":t="left",i="right"}n.targetPosition=i,n.sourcePosition=t,n.position={x:e.x-e.width/2,y:e.y-e.height/2}}));var u=function(n){var e=n.centerNodeId,t=n.containerHeight,r=void 0===t?0:t,o=n.containerWidth,i=void 0===o?0:o,u=n.centerByBBox,a=n.nodes,c=n.nodeOrigin,l=void 0===c?Sv:c;if(!e&&!u||!r||!i)return Kv;if(null==e?void 0:e.trim()){var s=null==a?void 0:a.find((function(n){return n.id===(null==e?void 0:e.trim())}));if(s){var f=function(n,e){if(!n)return Kv;var t=Gv(n),r=t.width,o=t.height,i=r*e[0],u=o*e[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,e){if(!(null==n?void 0:n.length))return Kv;var t=Ov(n,{nodeOrigin:e}),r=t.x,o=t.y;return{x:r+t.width/2,y:o+t.height/2}}(a,l),{x:i/2-f.x,y:r/2-f.y}):Kv}({centerByBBox:null==t?void 0:t.centerByBBox,centerNodeId:null==t?void 0:t.centerNodeId,nodes:i,containerWidth:null==t?void 0:t.width,containerHeight:null==t?void 0:t.height,nodeOrigin:null==t?void 0:t.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==t?void 0:t.width)&&(null==t?void 0:t.height)&&t.fitViewOptions&&(f=function(n,e){var t=e||{},r=t.minZoom,o=void 0===r?_v:r,i=t.maxZoom,u=void 0===i?Ev:i,a=t.padding,c=void 0===a?.1:a,l=t.nodeOrigin,s=void 0===l?Sv:l,f=t.width,d=t.height,h=Ov(n||[],{nodeOrigin:s}),v=h.width>=f||h.height>=d;return{transform:Fv(h,f,d,o,u,c),overflowBoundary:v}}(i,W({width:t.width,height:t.height,nodeOrigin:t.nodeOrigin},t.fitViewOptions))),{nodes:i,edges:e,transform:f.transform,overflowBoundary:f.overflowBoundary}}var Lp={assign:Object.assign,getHeight:function(n,e,t,r){return void 0===r&&(r="height"),"center"===t?(n[r]+e[r])/2:n.height}},Rp=Lp,Tp={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 e=n.label||" ";return n.width||18*e.split("").length}};function Dp(n,e){var t=this;if(t.vgap=t.hgap=0,n instanceof Dp)return n;t.data=n;var r=e.getHGap(n),o=e.getVGap(n);return t.preH=e.getPreH(n),t.preV=e.getPreV(n),t.width=e.getWidth(n),t.height=e.getHeight(n),t.width+=t.preH,t.height+=t.preV,t.id=e.getId(n),t.x=t.y=0,t.depth=0,t.children||(t.children=[]),t.addGap(r,o),t}Rp.assign(Dp.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(n,e){var t=this;t.hgap+=n,t.vgap+=e,t.width+=2*n,t.height+=2*e},eachNode:function(n){for(var e,t=[this];e=t.shift();)n(e),t=e.children.concat(t)},DFTraverse:function(n){this.eachNode(n)},BFTraverse:function(n){for(var e,t=[this];e=t.shift();)n(e),t=t.concat(e.children)},getBoundingBox:function(){var n={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){n.left=Math.min(n.left,e.x),n.top=Math.min(n.top,e.y),n.width=Math.max(n.width,e.x+e.width),n.height=Math.max(n.height,e.y+e.height)})),n},translate:function(n,e){void 0===n&&(n=0),void 0===e&&(e=0),this.eachNode((function(t){t.x+=n,t.y+=e,t.x+=t.preH,t.y+=t.preV}))},right2left:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.x=n.x-2*(n.x-e.left)-n.width})),n.translate(e.width,0)},bottom2top:function(){var n=this,e=n.getBoundingBox();n.eachNode((function(n){n.y=n.y-2*(n.y-e.top)-n.height})),n.translate(0,e.height)}});var Bp=function(n,e,t){void 0===e&&(e={});var r,o=new Dp(n,e=Rp.assign({},Tp,e)),i=[o];if(!t&&!n.collapsed)for(;r=i.shift();)if(!r.data.collapsed){var u=e.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 Dp(u[c],e);r.children[c]=l,i.push(l),l.parent=r,l.depth=r.depth+1}}return o},Vp=Bp,Hp=function(){function n(n,e){void 0===e&&(e={}),this.options=e,this.rootNode=Vp(n,e)}return n.prototype.execute=function(){throw new Error("please override this method")},n}(),Yp=Hp;function Xp(n,e,t,r){void 0===r&&(r=[]);var o=this;o.w=n||0,o.h=e||0,o.y=t||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 Zp(n,e,t){t?n.y+=e:n.x+=e,n.children.forEach((function(n){Zp(n,e,t)}))}function Wp(n,e){var t=e?n.y:n.x;return n.children.forEach((function(n){t=Math.min(Wp(n,e),t)})),t}function Fp(n,e){Zp(n,-Wp(n,e),e)}function Up(n,e,t){t?e.y=n.x:e.x=n.x,n.c.forEach((function(n,r){Up(n,e.children[r],t)}))}function $p(n,e,t){void 0===t&&(t=0),e?(n.x=t,t+=n.width):(n.y=t,t+=n.height),n.children.forEach((function(n){$p(n,e,t)}))}Xp.fromNode=function(n,e){if(!n)return null;var t=[];return n.children.forEach((function(n){t.push(Xp.fromNode(n,e))})),e?new Xp(n.height,n.width,n.x,t):new Xp(n.width,n.height,n.y,t)};var Gp=Bp,qp=function(n,e){for(var t=Gp(n.data,e,!0),r=Gp(n.data,e,!0),o=n.children.length,i=Math.round(o/2),u=e.getSide||function(n,e){return e<i?"right":"left"},a=0;a<o;a++){var c=n.children[a];"right"===u(c,a)?r.children.push(c):t.children.push(c)}return t.eachNode((function(n){n.isRoot()||(n.side="left")})),r.eachNode((function(n){n.isRoot()||(n.side="right")})),{left:t,right:r}},Kp=qp,Qp=["LR","RL","TB","BT","H","V"],Jp=["LR","RL","H"],ng=Qp[0],eg=function(n,e,t){var r=e.direction||ng;if(e.isHorizontal=function(n){return Jp.indexOf(n)>-1}(r),r&&-1===Qp.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===Qp[0])t(n,e);else if(r===Qp[1])t(n,e),n.right2left();else if(r===Qp[2])t(n,e);else if(r===Qp[3])t(n,e),n.bottom2top();else if(r===Qp[4]||r===Qp[5]){var o=Kp(n,e),i=o.left,u=o.right;t(i,e),t(u,e),e.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();e.isHorizontal?a.top<0&&n.translate(0,-a.top):a.left<0&&n.translate(-a.left,0)}var c=e.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,e){if(e.radial){var t=e.isHorizontal?["x","y"]:["y","x"],r=t[0],o=t[1],i={x:1/0,y:1/0},u={x:-1/0,y:-1/0},a=0;n.DFTraverse((function(n){a++;var e=n.x,t=n.y;i.x=Math.min(i.x,e),i.y=Math.min(i.y,t),u.x=Math.max(u.x,e),u.y=Math.max(u.y,t)}));var c=u[o]-i[o];if(0===c)return;var l=2*Math.PI/a;n.DFTraverse((function(e){var t=(e[o]-i[o])/c*(2*Math.PI-l)+l,u=e[r]-n[r];e.x=Math.cos(t)*u,e.y=Math.sin(t)*u}))}}(n,e),n};function tg(n,e){return tg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},tg(n,e)}var rg=function(n,e){void 0===e&&(e={});var t=e.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,e,t){for(var r=n.c[e-1],o=r.mod,l=n.c[e],s=l.mod;null!==r&&null!==l;){c(r)>t.low&&(t=t.nxt);var f=o+r.prelim+r.w-(s+l.prelim);f>0&&(s+=f,i(n,e,t.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,e,t,r){var o=n.c[0].el;o.tl=t;var i=r-t.mod-n.c[0].msel;o.mod+=i,o.prelim-=i,n.c[0].el=n.c[e].el,n.c[0].msel=n.c[e].msel}(n,e,l,s):r&&!l&&function(n,e,t,r){var o=n.c[e].er;o.tr=t;var i=r-t.mod-n.c[e].mser;o.mod+=i,o.prelim-=i,n.c[e].er=n.c[e-1].er,n.c[e].mser=n.c[e-1].mser}(n,e,r,o)}function i(n,e,t,r){n.c[e].mod+=r,n.c[e].msel+=r,n.c[e].mser+=r,function(n,e,t,r){if(t!==e-1){var o=e-t;n.c[t+1].shift+=r/o,n.c[e].shift-=r/o,n.c[e].change-=r-r/o}}(n,e,t,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,e,t){for(;null!==t&&n>=t.low;)t=t.nxt;return{low:n,index:e,nxt:t}}$p(n,t);var s=Xp.fromNode(n,t);return function n(e){if(0!==e.cs){n(e.c[0]);for(var t=l(c(e.c[0].el),0,null),i=1;i<e.cs;++i){n(e.c[i]);var u=c(e.c[i].er);o(e,i,t),t=l(u,i,t)}!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}(e),r(e)}else r(e)}(s),function n(e,t){t+=e.mod,e.x=e.prelim+t,function(n){for(var e=0,t=0,r=0;r<n.cs;r++)t+=(e+=n.c[r].shift)+n.c[r].change,n.c[r].mod+=t}(e);for(var r=0;r<e.cs;r++)n(e.c[r],t)}(s,0),Up(s,n,t),Fp(n,t),n},og=eg,ig=Lp,ug=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,tg(t,r),e.prototype.execute=function(){return og(this.rootNode,this.options,rg)},e}(Yp),ag={},cg=Lp;function lg(n,e){void 0===e&&(e=[]);var t=this;t.x=t.y=0,t.leftChild=t.rightChild=null,t.height=0,t.children=e}var sg={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function fg(n,e,t){t?(e.x=n.x,e.y=n.y):(e.x=n.y,e.y=n.x),n.children.forEach((function(n,r){fg(n,e.children[r],t)}))}function dg(n,e){return dg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},dg(n,e)}var hg=function(n,e){void 0===e&&(e={}),e=cg.assign({},sg,e);var t,r=0,o=function n(e){if(!e)return null;e.width=0,e.depth&&e.depth>r&&(r=e.depth);var t=e.children,o=t.length,i=new lg(e.height,[]);return t.forEach((function(e,t){var r=n(e);i.children.push(r),0===t&&(i.leftChild=r),t===o-1&&(i.rightChild=r)})),i.originNode=e,i.isLeaf=e.isLeaf(),i}(n);return function n(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=r;else{var t=e.children.map((function(e){return n(e)})),o=Math.min.apply(null,t);e.drawingDepth=o-1}return e.drawingDepth}(o),function n(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,t&&(r.y=t.y+t.height+e.nodeSep,r.originNode.parent!==t.originNode.parent&&(r.y+=e.subTreeSep)),t=r):(r.children.forEach((function(e){n(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(o),fg(o,n,e.isHorizontal),n},vg=eg,pg=Lp,gg=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,dg(t,r),e.prototype.execute=function(){var n=this;return n.rootNode.width=0,vg(n.rootNode,n.options,hg)},e}(Yp),yg={},mg=Lp;function wg(n,e){return wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},wg(n,e)}var xg=Yp,bg=function(n,e,t,r){var o=null;n.eachNode((function(n){!function(n,e,t,r,o){var i=("function"==typeof t?t(n):t)*n.depth;if(!r)try{if(n.id===n.parent.children[0].id)return n.x+=i,void(n.y=e?e.y:0)}catch(n){}if(n.x+=i,e){if(n.y=e.y+mg.getHeight(e,n,o),e.parent&&n.parent.id!==e.parent.id){var u=e.parent,a=u.y+mg.getHeight(u,n,o);n.y=a>n.y?a:n.y}}else n.y=0}(n,o,e,t,r),o=n}))},_g=qp,Eg=Lp,Sg=["LR","RL","H"],kg=Sg[0],Cg=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,wg(t,r),e.prototype.execute=function(){var n=this.options,e=this.rootNode;n.isHorizontal=!0;var t=n.indent,r=void 0===t?20:t,o=n.dropCap,i=void 0===o||o,u=n.direction,a=void 0===u?kg:u,c=n.align;if(a&&-1===Sg.indexOf(a))throw new TypeError("Invalid direction: "+a);if(a===Sg[0])bg(e,r,i,c);else if(a===Sg[1])bg(e,r,i,c),e.right2left();else if(a===Sg[2]){var l=_g(e,n),s=l.left,f=l.right;bg(s,r,i,c),s.right2left(),bg(f,r,i,c);var d=s.getBoundingBox();f.translate(d.width,0),e.x=f.x-e.width/2}return e},e}(xg),Ng={},Mg=Lp;function Og(n,e){var t=0;return n.children.length?n.children.forEach((function(n){t+=Og(n,e)})):t=n.height,n._subTreeSep=e.getSubTreeSep(n.data),n.totalHeight=Math.max(n.height,t)+2*n._subTreeSep,n.totalHeight}function Pg(n){var e=n.children,t=e.length;if(t){e.forEach((function(n){Pg(n)}));var r=e[0],o=e[t-1],i=o.y-r.y+o.height,u=0;if(e.forEach((function(n){u+=n.totalHeight})),i>n.height)n.y=r.y+i/2-n.height/2;else if(1!==e.length||n.height>u){var a=n.y+(n.height-i)/2-r.y;e.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 jg={getSubTreeSep:function(){return 0}};function Ig(n,e){return Ig=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},Ig(n,e)}var Ag=function(n,e){void 0===e&&(e={}),e=Mg.assign({},jg,e),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,Og(n,e),n.startY=0,n.y=n.totalHeight/2-n.height/2,n.eachNode((function(n){var e=n.children,t=e.length;if(t){var r=e[0];if(r.startY=n.startY+n._subTreeSep,1===t)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<t;o++){var i=e[o];i.startY=e[o-1].startY+e[o-1].totalHeight,i.y=i.startY+i.totalHeight/2-i.height/2}}}})),Pg(n)},zg=eg,Lg=Lp,Rg=function(n){function e(){return n.apply(this,arguments)||this}var t,r;return r=n,(t=e).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ig(t,r),e.prototype.execute=function(){return zg(this.rootNode,this.options,Ag)},e}(Yp),Tg={};Qe({compactBox:function(n,e){return e=ig.assign({},ag,e),new ug(n,e).execute()},dendrogram:function(n,e){return e=pg.assign({},yg,e),new gg(n,e).execute()},indented:function(n,e){return e=Eg.assign({},Ng,e),new Cg(n,e).execute()},mindmap:function(n,e){return e=Lg.assign({},Tg,e),new Rg(n,e).execute()}});var Dg={value:()=>{}};function Bg(){for(var n,e=0,t=arguments.length,r={};e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Vg(r)}function Vg(n){this._=n}function Hg(n,e){for(var t,r=0,o=n.length;r<o;++r)if((t=n[r]).name===e)return t.value}function Yg(n,e,t){for(var r=0,o=n.length;r<o;++r)if(n[r].name===e){n[r]=Dg,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}Vg.prototype=Bg.prototype={constructor:Vg,on:function(n,e){var t,r,o=this._,i=(r=o,(n+"").trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");if(t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),n&&!r.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:e}}))),u=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<a;)if(t=(n=i[u]).type)o[t]=Yg(o[t],n.name,e);else if(null==e)for(t in o)o[t]=Yg(o[t],n.name,null);return this}for(;++u<a;)if((t=(n=i[u]).type)&&(t=Hg(o[t],n.name)))return t},copy:function(){var n={},e=this._;for(var t in e)n[t]=e[t].slice();return new Vg(n)},call:function(n,e){if((t=arguments.length-2)>0)for(var t,r,o=new Array(t),i=0;i<t;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(i=0,t=(r=this._[n]).length;i<t;++i)r[i].value.apply(e,o)},apply:function(n,e,t){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(e,t)}};var Xg="http://www.w3.org/1999/xhtml",Zg={svg:"http://www.w3.org/2000/svg",xhtml:Xg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wg(n){var e=n+="",t=e.indexOf(":");return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Zg.hasOwnProperty(e)?{space:Zg[e],local:n}:n}function Fg(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===Xg&&e.documentElement.namespaceURI===Xg?e.createElement(n):e.createElementNS(t,n)}}function Ug(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function $g(n){var e=Wg(n);return(e.local?Ug:Fg)(e)}function Gg(){}function qg(n){return null==n?Gg:function(){return this.querySelector(n)}}function Kg(){return[]}function Qg(n){return null==n?Kg:function(){return this.querySelectorAll(n)}}function Jg(n){return function(){return this.matches(n)}}function ny(n){return function(e){return e.matches(n)}}var ey=Array.prototype.find;function ty(){return this.firstElementChild}var ry=Array.prototype.filter;function oy(){return Array.from(this.children)}function iy(n){return new Array(n.length)}function uy(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}function ay(n,e,t,r,o,i){for(var u,a=0,c=e.length,l=i.length;a<l;++a)(u=e[a])?(u.__data__=i[a],r[a]=u):t[a]=new uy(n,i[a]);for(;a<c;++a)(u=e[a])&&(o[a]=u)}function cy(n,e,t,r,o,i,u){var a,c,l,s=new Map,f=e.length,d=i.length,h=new Array(f);for(a=0;a<f;++a)(c=e[a])&&(h[a]=l=u.call(c,c.__data__,a,e)+"",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)):t[a]=new uy(n,i[a]);for(a=0;a<f;++a)(c=e[a])&&s.get(h[a])===c&&(o[a]=c)}function ly(n){return n.__data__}function sy(n){return"object"==typeof n&&"length"in n?n:Array.from(n)}function fy(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function dy(n){return function(){this.removeAttribute(n)}}function hy(n){return function(){this.removeAttributeNS(n.space,n.local)}}function vy(n,e){return function(){this.setAttribute(n,e)}}function py(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function gy(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}function yy(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}function my(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function wy(n){return function(){this.style.removeProperty(n)}}function xy(n,e,t){return function(){this.style.setProperty(n,e,t)}}function by(n,e,t){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,t)}}function _y(n,e){return n.style.getPropertyValue(e)||my(n).getComputedStyle(n,null).getPropertyValue(e)}function Ey(n){return function(){delete this[n]}}function Sy(n,e){return function(){this[n]=e}}function ky(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}function Cy(n){return n.trim().split(/^|\s+/)}function Ny(n){return n.classList||new My(n)}function My(n){this._node=n,this._names=Cy(n.getAttribute("class")||"")}function Oy(n,e){for(var t=Ny(n),r=-1,o=e.length;++r<o;)t.add(e[r])}function Py(n,e){for(var t=Ny(n),r=-1,o=e.length;++r<o;)t.remove(e[r])}function jy(n){return function(){Oy(this,n)}}function Iy(n){return function(){Py(this,n)}}function Ay(n,e){return function(){(e.apply(this,arguments)?Oy:Py)(this,n)}}function zy(){this.textContent=""}function Ly(n){return function(){this.textContent=n}}function Ry(n){return function(){var e=n.apply(this,arguments);this.textContent=null==e?"":e}}function Ty(){this.innerHTML=""}function Dy(n){return function(){this.innerHTML=n}}function By(n){return function(){var e=n.apply(this,arguments);this.innerHTML=null==e?"":e}}function Vy(){this.nextSibling&&this.parentNode.appendChild(this)}function Hy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yy(){return null}function Xy(){var n=this.parentNode;n&&n.removeChild(this)}function Zy(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Wy(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Fy(n){return function(){var e=this.__on;if(e){for(var t,r=0,o=-1,i=e.length;r<i;++r)t=e[r],n.type&&t.type!==n.type||t.name!==n.name?e[++o]=t:this.removeEventListener(t.type,t.listener,t.options);++o?e.length=o:delete this.__on}}}function Uy(n,e,t){return function(){var r,o=this.__on,i=function(n){return function(e){n.call(this,e,this.__data__)}}(e);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=t),void(r.value=e);this.addEventListener(n.type,i,t),r={type:n.type,name:n.name,value:e,listener:i,options:t},o?o.push(r):this.__on=[r]}}function $y(n,e,t){var r=my(n),o=r.CustomEvent;"function"==typeof o?o=new o(e,t):(o=r.document.createEvent("Event"),t?(o.initEvent(e,t.bubbles,t.cancelable),o.detail=t.detail):o.initEvent(e,!1,!1)),n.dispatchEvent(o)}function Gy(n,e){return function(){return $y(this,n,e)}}function qy(n,e){return function(){return $y(this,n,e.apply(this,arguments))}}uy.prototype={constructor:uy,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}},My.prototype={add:function(n){this._names.indexOf(n)<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};var Ky=[null];function Qy(n,e){this._groups=n,this._parents=e}function Jy(){return new Qy([[document.documentElement]],Ky)}function nm(n){return"string"==typeof n?new Qy([[document.querySelector(n)]],[document.documentElement]):new Qy([[n]],Ky)}function em(n,e){if(n=function(n){let e;for(;e=n.sourceEvent;)n=e;return n}(n),void 0===e&&(e=n.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var r=t.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[n.clientX-o.left-e.clientLeft,n.clientY-o.top-e.clientTop]}}return[n.pageX,n.pageY]}Qy.prototype=Jy.prototype={constructor:Qy,select:function(n){"function"!=typeof n&&(n=qg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u,a=e[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 Qy(r,this._parents)},selectAll:function(n){n="function"==typeof n?function(n){return function(){return null==(e=n.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}(n):Qg(n);for(var e=this._groups,t=e.length,r=[],o=[],i=0;i<t;++i)for(var u,a=e[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 Qy(r,o)},selectChild:function(n){return this.select(null==n?ty:function(n){return function(){return ey.call(this.children,n)}}("function"==typeof n?n:ny(n)))},selectChildren:function(n){return this.selectAll(null==n?oy:function(n){return function(){return ry.call(this.children,n)}}("function"==typeof n?n:ny(n)))},filter:function(n){"function"!=typeof n&&(n=Jg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u=e[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 Qy(r,this._parents)},data:function(n,e){if(!arguments.length)return Array.from(this,ly);var t,r=e?cy:ay,o=this._parents,i=this._groups;"function"!=typeof n&&(t=n,n=function(){return t});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=sy(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,e);for(var m,w,x=0,b=0;x<p;++x)if(m=g[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<p;);m._next=w||null}}return(a=new Qy(a,o))._enter=c,a._exit=l,a},enter:function(){return new Qy(this._enter||this._groups.map(iy),this._parents)},exit:function(){return new Qy(this._exit||this._groups.map(iy),this._parents)},join:function(n,e,t){var r=this.enter(),o=this,i=this.exit();return"function"==typeof n?(r=n(r))&&(r=r.selection()):r=r.append(n+""),null!=e&&(o=e(o))&&(o=o.selection()),null==t?i.remove():t(i),r&&o?r.merge(o).order():o},merge:function(n){for(var e=n.selection?n.selection():n,t=this._groups,r=e._groups,o=t.length,i=r.length,u=Math.min(o,i),a=new Array(o),c=0;c<u;++c)for(var l,s=t[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]=t[c];return new Qy(a,this._parents)},selection:function(){return this},order:function(){for(var n=this._groups,e=-1,t=n.length;++e<t;)for(var r,o=n[e],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 e(e,t){return e&&t?n(e.__data__,t.__data__):!e-!t}n||(n=fy);for(var t=this._groups,r=t.length,o=new Array(r),i=0;i<r;++i){for(var u,a=t[i],c=a.length,l=o[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(l[s]=u);l.sort(e)}return new Qy(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,e=0,t=n.length;e<t;++e)for(var r=n[e],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 e of this)++n;return n},empty:function(){return!this.node()},each:function(n){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var o,i=e[t],u=0,a=i.length;u<a;++u)(o=i[u])&&n.call(o,o.__data__,u,i);return this},attr:function(n,e){var t=Wg(n);if(arguments.length<2){var r=this.node();return t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}return this.each((null==e?t.local?hy:dy:"function"==typeof e?t.local?yy:gy:t.local?py:vy)(t,e))},style:function(n,e,t){return arguments.length>1?this.each((null==e?wy:"function"==typeof e?by:xy)(n,e,null==t?"":t)):_y(this.node(),n)},property:function(n,e){return arguments.length>1?this.each((null==e?Ey:"function"==typeof e?ky:Sy)(n,e)):this.node()[n]},classed:function(n,e){var t=Cy(n+"");if(arguments.length<2){for(var r=Ny(this.node()),o=-1,i=t.length;++o<i;)if(!r.contains(t[o]))return!1;return!0}return this.each(("function"==typeof e?Ay:e?jy:Iy)(t,e))},text:function(n){return arguments.length?this.each(null==n?zy:("function"==typeof n?Ry:Ly)(n)):this.node().textContent},html:function(n){return arguments.length?this.each(null==n?Ty:("function"==typeof n?By:Dy)(n)):this.node().innerHTML},raise:function(){return this.each(Vy)},lower:function(){return this.each(Hy)},append:function(n){var e="function"==typeof n?n:$g(n);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(n,e){var t="function"==typeof n?n:$g(n),r=null==e?Yy:"function"==typeof e?e:qg(e);return this.select((function(){return this.insertBefore(t.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Xy)},clone:function(n){return this.select(n?Wy:Zy)},datum:function(n){return arguments.length?this.property("__data__",n):this.node().__data__},on:function(n,e,t){var r,o,i=function(n){return n.trim().split(/^|\s+/).map((function(n){var e="",t=n.indexOf(".");return t>=0&&(e=n.slice(t+1),n=n.slice(0,t)),{type:n,name:e}}))}(n+""),u=i.length;if(!(arguments.length<2)){for(a=e?Uy:Fy,r=0;r<u;++r)this.each(a(i[r],e,t));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,e){return this.each(("function"==typeof e?qy:Gy)(n,e))},[Symbol.iterator]:function*(){for(var n=this._groups,e=0,t=n.length;e<t;++e)for(var r,o=n[e],i=0,u=o.length;i<u;++i)(r=o[i])&&(yield r)}};const tm={passive:!1},rm={capture:!0,passive:!1};function om(n){n.stopImmediatePropagation()}function im(n){n.preventDefault(),n.stopImmediatePropagation()}function um(n){var e=n.document.documentElement,t=nm(n).on("dragstart.drag",im,rm);"onselectstart"in e?t.on("selectstart.drag",im,rm):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function am(n,e){var t=n.document.documentElement,r=nm(n).on("dragstart.drag",null);e&&(r.on("click.drag",im,rm),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in t?r.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}var cm=n=>()=>n;function lm(n,{sourceEvent:e,subject:t,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:e,enumerable:!0,configurable:!0},subject:{value:t,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 sm(n){return!n.ctrlKey&&!n.button}function fm(){return this.parentNode}function dm(n,e){return null==e?{x:n.x,y:n.y}:e}function hm(){return navigator.maxTouchPoints||"ontouchstart"in this}function vm(){var n,e,t,r,o=sm,i=fm,u=dm,a=hm,c={},l=Bg("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,tm).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&&(nm(u.view).on("mousemove.drag",v,rm).on("mouseup.drag",p,rm),um(u.view),om(u),t=!1,n=u.clientX,e=u.clientY,c("start",u))}}function v(r){if(im(r),!t){var o=r.clientX-n,i=r.clientY-e;t=o*o+i*i>f}c.mouse("drag",r)}function p(n){nm(n.view).on("mousemove.drag mouseup.drag",null),am(n.view,t),im(n),c.mouse("end",n)}function g(n,e){if(o.call(this,n,e)){var t,r,u=n.changedTouches,a=i.call(this,n,e),c=u.length;for(t=0;t<c;++t)(r=w(this,a,n,e,u[t].identifier,u[t]))&&(om(n),r("start",n,u[t]))}}function y(n){var e,t,r=n.changedTouches,o=r.length;for(e=0;e<o;++e)(t=c[r[e].identifier])&&(im(n),t("drag",n,r[e]))}function m(n){var e,t,o=n.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),e=0;e<i;++e)(t=c[o[e].identifier])&&(om(n),t("end",n,o[e]))}function w(n,e,t,r,o,i){var a,f,h,v=l.copy(),p=em(i||t,e);if(null!=(h=u.call(n,new lm("beforestart",{sourceEvent:t,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 t(i,u,l){var g,y=p;switch(i){case"start":c[o]=t,g=s++;break;case"end":delete c[o],--s;case"drag":p=em(l||u,e),g=s}v.call(i,n,new lm(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:cm(!!n),d):o},d.container=function(n){return arguments.length?(i="function"==typeof n?n:cm(n),d):i},d.subject=function(n){return arguments.length?(u="function"==typeof n?n:cm(n),d):u},d.touchable=function(n){return arguments.length?(a="function"==typeof n?n:cm(!!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}function pm(n,e){if(!n.parentId)return!1;var t=e.get(n.parentId);return!!t&&(!!t.selected||pm(t,e))}function gm(n,e,t){var r=n;do{if(null==r?void 0:r.matches(e))return!0;if(r===t)return!1;r=r.parentElement}while(r);return!1}function ym(n){var e,t,r,o,i=n.nodeId,u=n.dragItems,a=n.nodeLookup,c=[];try{for(var l=U(u),s=l.next();!s.done;s=l.next()){var f=$(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(W(W({},v),{position:h.position}))}}catch(n){e={error:n}}finally{try{s&&!s.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}if(!i)return[c[0],c];var p=a.get(i).internals.userNode;return[W(W({},p),{position:(null===(o=u.get(i))||void 0===o?void 0:o.position)||p.position}),c]}function mm(n){var e=n.onNodeMouseDown,t=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,e){var r,i,a=n.x,l=n.y,s=t(),f=s.nodeLookup,d=s.nodeExtent,h=s.snapGrid,v=s.snapToGrid,p=s.nodeOrigin,g=s.onNodeDrag,y=s.onSelectionDrag,w=s.onError,x=s.updateNodePositions;u={x:a,y:l};var b=!1,_={x:0,y:0,x2:0,y2:0};if(c.size>1&&d){var E=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==e.filter||e.filter(n)){var r=Vv(n,e.nodeOrigin);t=Rv(t,r)}})),Dv(t)}(c,{nodeOrigin:p});_=Tv(E)}try{for(var S=U(c),k=S.next();!k.done;k=S.next()){var C=$(k.value,2),N=C[0],M=C[1],O={x:a-M.distance.x,y:l-M.distance.y};v&&(O=Xv(O,h));var P=[[d[0][0],d[0][1]],[d[1][0],d[1][1]]];if(c.size>1&&d&&!M.extent){var j=M.internals.positionAbsolute,I=j.x-_.x+d[0][0],A=j.x+M.measured.width-_.x2+d[1][0];P=[[I,j.y-_.y+d[0][1]],[A,j.y+M.measured.height-_.y2+d[1][1]]]}var z=jv({nodeId:N,nextPosition:O,nodeLookup:f,nodeExtent:P,nodeOrigin:p,onError:w}),L=z.position,R=z.positionAbsolute;b=b||M.position.x!==L.x||M.position.y!==L.y,M.position=L,M.internals.positionAbsolute=R}}catch(n){r={error:n}}finally{try{k&&!k.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(b&&(x(c,!0),e&&(o||g||!m&&y))){var T=$(ym({nodeId:m,dragItems:c,nodeLookup:f}),2),D=T[0],B=T[1];null==o||o(e,c,D,B),null==g||g(e,D,B),m||null==y||y(e,B)}}function x(){var n,e;if(f){var r=$(Lv(s,f),2),o=r[0],i=r[1];if(0!==o||0!==i){var c=t(),l=c.transform,d=c.panBy;u.x=(null!==(n=u.x)&&void 0!==n?n:0)-o/l[2],u.y=(null!==(e=u.y)&&void 0!==e?e:0)-i/l[2],d({x:o,y:i})&&w(u,null)}a=requestAnimationFrame(x)}}function b(n){var o,i=t(),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,x=i.unselectNodesAndEdges;d=!0,p&&y||l||!m||(null===(o=a.get(m))||void 0===o?void 0:o.selected)||x(),y&&p&&m&&(null==e||e(m));var b=Jv(n.sourceEvent,{transform:f,snapGrid:h,snapToGrid:v});if(u=b,c=function(n,e,t,r){var o,i,u,a,c=new Map;try{for(var l=U(n),s=l.next();!s.done;s=l.next()){var f=$(s.value,2),d=f[0],h=f[1];if((h.selected||h.id===r)&&(!h.parentId||!pm(h,n))&&(h.draggable||e&&void 0===h.draggable)){var v=n.get(d);v&&c.set(d,{id:d,position:v.position||{x:0,y:0},distance:{x:t.x-v.internals.positionAbsolute.x,y:t.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,b,m),c.size>0&&(r||g||!m&&w)){var _=$(ym({nodeId:m,dragItems:c,nodeLookup:a}),2),E=_[0],S=_[1];null==r||r(n.sourceEvent,c,E,S),null==g||g(n.sourceEvent,E,S),m||null==w||w(n.sourceEvent,S)}}h=nm(g);var _=vm().on("start",(function(n){var e=t(),r=e.domNode,o=e.nodeDragThreshold,i=e.transform,a=e.snapGrid,c=e.snapToGrid;0===o&&b(n);var l=Jv(n.sourceEvent,{transform:i,snapGrid:a,snapToGrid:c});u=l,f=(null==r?void 0:r.getBoundingClientRect())||null,s=op(n.sourceEvent,f)})).on("drag",(function(n){var e,r,o=t(),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,x()),!d){var y=g.xSnapped-(null!==(e=u.x)&&void 0!==e?e:0),m=g.ySnapped-(null!==(r=u.y)&&void 0!==r?r:0);Math.sqrt(y*y+m*m)>p&&b(n)}(u.x!==g.xSnapped||u.y!==g.ySnapped)&&c&&d&&(s=op(n.sourceEvent,f),w(g,n.sourceEvent))})).on("end",(function(n){if(d&&(l=!1,d=!1,cancelAnimationFrame(a),c.size>0)){var e=t(),r=e.nodeLookup,o=e.updateNodePositions,u=e.onNodeDragStop,s=e.onSelectionDragStop;if(o(c,!1),i||u||!m&&s){var f=$(ym({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 e=n.target;return!n.button&&(!v||!gm(e,".".concat(v),g))&&(!p||gm(e,p,g))}));h.call(_)},destroy:function(){null==h||h.on(".drag",null)}}}function wm(n,e,t,r){var o,i,u,a,c,l,s,f,d,h=[],v=1/0,p=function(n,e,t){var r,o,i=[],u={x:n.x-t,y:n.y-t,width:2*t,height:2*t};try{for(var a=U(e.values()),c=a.next();!c.done;c=a.next()){var l=c.value;Yv(u,Bv(l))>0&&i.push(l)}}catch(n){r={error:n}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i}(n,t,e+250);try{for(var g=U(p),y=g.next();!y.done;y=g.next()){var m=y.value,w=G(G([],$(null!==(l=null===(c=m.internals.handleBounds)||void 0===c?void 0:c.source)&&void 0!==l?l:[]),!1),$(null!==(f=null===(s=m.internals.handleBounds)||void 0===s?void 0:s.target)&&void 0!==f?f:[]),!1);try{for(var x=(u=void 0,U(w)),b=x.next();!b.done;b=x.next()){var _=b.value;if(r.nodeId!==_.nodeId||r.type!==_.type||r.id!==_.id){var E=Cp(m,_,_.position),S=E.x,k=E.y,C=Math.sqrt(Math.pow(S-n.x,2)+Math.pow(k-n.y,2));C>e||(C<v?(h=[W(W({},_),{x:S,y:k})],v=C):C===v&&h.push(W(W({},_),{x:S,y:k})))}}}catch(n){u={error:n}}finally{try{b&&!b.done&&(a=x.return)&&a.call(x)}finally{if(u)throw u.error}}}}catch(n){o={error:n}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}if(!h.length)return null;if(h.length>1){var N="source"===r.type?"target":"source";return null!==(d=h.find((function(n){return n.type===N})))&&void 0!==d?d:h[0]}return h[0]}function xm(n,e,t,r,o,i){var u,a,c,l,s,f;void 0===i&&(i=!1);var d=r.get(n);if(!d)return null;var h="strict"===o?null===(u=d.internals.handleBounds)||void 0===u?void 0:u[e]:G(G([],$(null!==(c=null===(a=d.internals.handleBounds)||void 0===a?void 0:a.source)&&void 0!==c?c:[]),!1),$(null!==(s=null===(l=d.internals.handleBounds)||void 0===l?void 0:l.target)&&void 0!==s?s:[]),!1),v=null!==(f=t?null==h?void 0:h.find((function(n){return n.id===t})):null==h?void 0:h[0])&&void 0!==f?f:null;return v&&i?W(W({},v),Cp(d,v,v.position)):v}function bm(n,e){return n||((null==e?void 0:e.classList.contains("target"))?"target":(null==e?void 0:e.classList.contains("source"))?"source":null)}lm.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};var _m=function(){return!0};function Em(n,e){var t=e.handle,r=e.connectionMode,o=e.fromNodeId,i=e.fromHandleId,u=e.fromType,a=e.doc,c=e.lib,l=e.flowId,s=e.isValidConnection,f=void 0===s?_m:s,d=e.nodeLookup,h=".".concat(c,'-flow__handle[data-id="').concat(l,"-").concat(null==t?void 0:t.nodeId,"-").concat(null==t?void 0:t.id,"-").concat(null==t?void 0:t.type,'"]'),v="target"===u,p=t?a.querySelector(h):null,g=op(n),y=g.x,m=g.y,w=a.elementFromPoint(y,m),x=(null==w?void 0:w.classList.contains("".concat(c,"-flow__handle")))?w:p,b={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){var _=bm(void 0,x),E=x.getAttribute("data-nodeid"),S=x.getAttribute("data-handleid"),k=x.classList.contains("connectable"),C=x.classList.contains("connectableend");if(!E||!_)return b;var N={source:v?E:o,sourceHandle:v?S:i,target:v?o:E,targetHandle:v?i:S};b.connection=N;var M=k&&C&&(r===np.Strict?v&&"source"===_||!v&&"target"===_:E!==o||S!==i);b.isValid=M&&f(N),b.toHandle=xm(E,_,S,d,r,!1)}return b}var Sm={onPointerDown:function(n,e){var t,r=e.connectionMode,o=e.connectionRadius,i=e.handleId,u=e.nodeId,a=e.edgeUpdaterType,c=e.isTarget,l=e.domNode,s=e.nodeLookup,f=e.lib,d=e.autoPanOnConnect,h=e.flowId,v=e.panBy,p=e.cancelConnection,g=e.onConnectStart,y=e.onConnect,m=e.onConnectEnd,w=e.isValidConnection,x=void 0===w?_m:w,b=e.onReconnectEnd,_=e.updateConnection,E=e.getTransform,S=e.getFromHandle,k=e.autoPanSpeed,C=function(n){var e;return(null===(e=null==n?void 0:n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),N=0,M=op(n),O=M.x,P=M.y,j=null==C?void 0:C.elementFromPoint(O,P),I=bm(a,j),A=null==l?void 0:l.getBoundingClientRect();if(A&&I){var z=xm(u,I,i,s,r);if(z){var L=op(n,A),R=!1,T=null,D=!1,B=null,V=W(W({},z),{nodeId:u,type:I,position:z.position}),H=s.get(u),Y={inProgress:!0,isValid:null,from:Cp(H,V,lp.Left),fromHandle:V,fromPosition:V.position,fromNode:H,to:L,toHandle:null,toPosition:fp[V.position],toNode:null};_(Y);var X=Y;null==g||g(n,{nodeId:u,handleId:i,handleType:I}),C.addEventListener("mousemove",U),C.addEventListener("mouseup",G),C.addEventListener("touchmove",U),C.addEventListener("touchend",G)}}function Z(){if(d&&A){var n=$(Lv(L,A,k),2),e=n[0],t=n[1];v({x:e,y:t}),N=requestAnimationFrame(Z)}}function U(n){if(S()&&V){var e=E();L=op(n,A),t=wm(Zv(L,e,!1,[1,1]),o,s,V),R||(Z(),R=!0);var a=Em(n,{handle:t,connectionMode:r,fromNodeId:u,fromHandleId:i,fromType:c?"target":"source",isValidConnection:x,doc:C,lib:f,flowId:h,nodeLookup:s});B=a.handleDomNode,T=a.connection,D=function(n,e){var t=null;return e?t=!0:n&&!e&&(t=!1),t}(!!t,a.isValid);var l=W(W({},X),{isValid:D,to:t&&D?Wv({x:t.x,y:t.y},e):L,toHandle:a.toHandle,toPosition:D&&a.toHandle?a.toHandle.position:fp[V.position],toNode:a.toHandle?s.get(a.toHandle.nodeId):null});D&&t&&X.toHandle&&l.toHandle&&X.toHandle.type===l.toHandle.type&&X.toHandle.nodeId===l.toHandle.nodeId&&X.toHandle.id===l.toHandle.id&&X.to.x===l.to.x&&X.to.y===l.to.y||(_(l),X=l)}else G(n)}function G(n){(t||B)&&T&&D&&(null==y||y(T)),X.inProgress;var e=F(X,["inProgress"]),r=W(W({},e),{toPosition:X.toHandle?X.toPosition:null});null==m||m(n,r),a&&(null==b||b(n,r)),p(),cancelAnimationFrame(N),R=!1,D=!1,T=null,B=null,C.removeEventListener("mousemove",U),C.removeEventListener("mouseup",G),C.removeEventListener("touchmove",U),C.removeEventListener("touchend",G)}},isValid:Em};function km(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function Cm(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Nm(){}var Mm=.7,Om=1/Mm,Pm="\\s*([+-]?\\d+)\\s*",jm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Im="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Am=/^#([0-9a-f]{3,8})$/,zm=new RegExp(`^rgb\\(${Pm},${Pm},${Pm}\\)$`),Lm=new RegExp(`^rgb\\(${Im},${Im},${Im}\\)$`),Rm=new RegExp(`^rgba\\(${Pm},${Pm},${Pm},${jm}\\)$`),Tm=new RegExp(`^rgba\\(${Im},${Im},${Im},${jm}\\)$`),Dm=new RegExp(`^hsl\\(${jm},${Im},${Im}\\)$`),Bm=new RegExp(`^hsla\\(${jm},${Im},${Im},${jm}\\)$`),Vm={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 Hm(){return this.rgb().formatHex()}function Ym(){return this.rgb().formatRgb()}function Xm(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=Am.exec(n))?(t=e[1].length,e=parseInt(e[1],16),6===t?Zm(e):3===t?new Um(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===t?Wm(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===t?Wm(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=zm.exec(n))?new Um(e[1],e[2],e[3],1):(e=Lm.exec(n))?new Um(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Rm.exec(n))?Wm(e[1],e[2],e[3],e[4]):(e=Tm.exec(n))?Wm(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Dm.exec(n))?Jm(e[1],e[2]/100,e[3]/100,1):(e=Bm.exec(n))?Jm(e[1],e[2]/100,e[3]/100,e[4]):Vm.hasOwnProperty(n)?Zm(Vm[n]):"transparent"===n?new Um(NaN,NaN,NaN,0):null}function Zm(n){return new Um(n>>16&255,n>>8&255,255&n,1)}function Wm(n,e,t,r){return r<=0&&(n=e=t=NaN),new Um(n,e,t,r)}function Fm(n,e,t,r){return 1===arguments.length?((o=n)instanceof Nm||(o=Xm(o)),o?new Um((o=o.rgb()).r,o.g,o.b,o.opacity):new Um):new Um(n,e,t,null==r?1:r);var o}function Um(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}function $m(){return`#${Qm(this.r)}${Qm(this.g)}${Qm(this.b)}`}function Gm(){const n=qm(this.opacity);return`${1===n?"rgb(":"rgba("}${Km(this.r)}, ${Km(this.g)}, ${Km(this.b)}${1===n?")":`, ${n})`}`}function qm(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Km(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Qm(n){return((n=Km(n))<16?"0":"")+n.toString(16)}function Jm(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new ew(n,e,t,r)}function nw(n){if(n instanceof ew)return new ew(n.h,n.s,n.l,n.opacity);if(n instanceof Nm||(n=Xm(n)),!n)return new ew;if(n instanceof ew)return n;var e=(n=n.rgb()).r/255,t=n.g/255,r=n.b/255,o=Math.min(e,t,r),i=Math.max(e,t,r),u=NaN,a=i-o,c=(i+o)/2;return a?(u=e===i?(t-r)/a+6*(t<r):t===i?(r-e)/a+2:(e-t)/a+4,a/=c<.5?i+o:2-i-o,u*=60):a=c>0&&c<1?0:u,new ew(u,a,c,n.opacity)}function ew(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}function tw(n){return(n=(n||0)%360)<0?n+360:n}function rw(n){return Math.max(0,Math.min(1,n||0))}function ow(n,e,t){return 255*(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)}km(Nm,Xm,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Hm,formatHex:Hm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return nw(this).formatHsl()},formatRgb:Ym,toString:Ym}),km(Um,Fm,Cm(Nm,{brighter(n){return n=null==n?Om:Math.pow(Om,n),new Um(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=null==n?Mm:Math.pow(Mm,n),new Um(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Um(Km(this.r),Km(this.g),Km(this.b),qm(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:$m,formatHex:$m,formatHex8:function(){return`#${Qm(this.r)}${Qm(this.g)}${Qm(this.b)}${Qm(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gm,toString:Gm})),km(ew,(function(n,e,t,r){return 1===arguments.length?nw(n):new ew(n,e,t,null==r?1:r)}),Cm(Nm,{brighter(n){return n=null==n?Om:Math.pow(Om,n),new ew(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=null==n?Mm:Math.pow(Mm,n),new ew(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+360*(this.h<0),e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,o=2*t-r;return new Um(ow(n>=240?n-240:n+120,o,r),ow(n,o,r),ow(n<120?n+240:n-120,o,r),this.opacity)},clamp(){return new ew(tw(this.h),rw(this.s),rw(this.l),qm(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=qm(this.opacity);return`${1===n?"hsl(":"hsla("}${tw(this.h)}, ${100*rw(this.s)}%, ${100*rw(this.l)}%${1===n?")":`, ${n})`}`}}));var iw=n=>()=>n;function uw(n,e){var t=e-n;return t?function(n,e){return function(t){return n+t*e}}(n,t):iw(isNaN(n)?e:n)}var aw=function n(e){var t=function(n){return 1==(n=+n)?uw:function(e,t){return t-e?function(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}(e,t,n):iw(isNaN(e)?t:e)}}(e);function r(n,e){var r=t((n=Fm(n)).r,(e=Fm(e)).r),o=t(n.g,e.g),i=t(n.b,e.b),u=uw(n.opacity,e.opacity);return function(e){return n.r=r(e),n.g=o(e),n.b=i(e),n.opacity=u(e),n+""}}return r.gamma=n,r}(1);function cw(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}var lw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sw=new RegExp(lw.source,"g");function fw(n,e){var t,r,o,i=lw.lastIndex=sw.lastIndex=0,u=-1,a=[],c=[];for(n+="",e+="";(t=lw.exec(n))&&(r=sw.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),a[u]?a[u]+=o:a[++u]=o),(t=t[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:cw(t,r)})),i=sw.lastIndex;return i<e.length&&(o=e.slice(i),a[u]?a[u]+=o:a[++u]=o),a.length<2?c[0]?function(n){return function(e){return n(e)+""}}(c[0].x):function(n){return function(){return n}}(e):(e=c.length,function(n){for(var t,r=0;r<e;++r)a[(t=c[r]).i]=t.x(n);return a.join("")})}var dw,hw=180/Math.PI,vw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pw(n,e,t,r,o,i){var u,a,c;return(u=Math.sqrt(n*n+e*e))&&(n/=u,e/=u),(c=n*t+e*r)&&(t-=n*c,r-=e*c),(a=Math.sqrt(t*t+r*r))&&(t/=a,r/=a,c/=a),n*r<e*t&&(n=-n,e=-e,c=-c,u=-u),{translateX:o,translateY:i,rotate:Math.atan2(e,n)*hw,skewX:Math.atan(c)*hw,scaleX:u,scaleY:a}}function gw(n,e,t,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,e,null,t);a.push({i:c-4,x:cw(n,o)},{i:c-2,x:cw(r,i)})}else(o||i)&&u.push("translate("+o+e+i+t)}(i.translateX,i.translateY,u.translateX,u.translateY,a,c),function(n,e,t,i){n!==e?(n-e>180?e+=360:e-n>180&&(n+=360),i.push({i:t.push(o(t)+"rotate(",null,r)-2,x:cw(n,e)})):e&&t.push(o(t)+"rotate("+e+r)}(i.rotate,u.rotate,a,c),function(n,e,t,i){n!==e?i.push({i:t.push(o(t)+"skewX(",null,r)-2,x:cw(n,e)}):e&&t.push(o(t)+"skewX("+e+r)}(i.skewX,u.skewX,a,c),function(n,e,t,r,i,u){if(n!==t||e!==r){var a=i.push(o(i)+"scale(",null,",",null,")");u.push({i:a-4,x:cw(n,t)},{i:a-2,x:cw(e,r)})}else 1===t&&1===r||i.push(o(i)+"scale("+t+","+r+")")}(i.scaleX,i.scaleY,u.scaleX,u.scaleY,a,c),i=u=null,function(n){for(var e,t=-1,r=c.length;++t<r;)a[(e=c[t]).i]=e.x(n);return a.join("")}}}var yw=gw((function(n){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?vw:pw(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),mw=gw((function(n){return null==n?vw:(dw||(dw=document.createElementNS("http://www.w3.org/2000/svg","g")),dw.setAttribute("transform",n),(n=dw.transform.baseVal.consolidate())?pw((n=n.matrix).a,n.b,n.c,n.d,n.e,n.f):vw)}),", ",")",")");function ww(n){return((n=Math.exp(n))+1/n)/2}var xw,bw,_w=function n(e,t,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)/e,i=function(n){return[a+n*h,c+n*v,l*Math.exp(e*n*u)]};else{var g=Math.sqrt(p),y=(d*d-l*l+r*p)/(2*l*t*g),m=(d*d-l*l-r*p)/(2*d*t*g),w=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(m*m+1)-m);u=(x-w)/e,i=function(n){var r,o=n*u,i=ww(w),s=l/(t*g)*(i*(r=e*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/ww(e*o+w)]}}return i.duration=1e3*u*e/Math.SQRT2,i}return o.rho=function(e){var t=Math.max(.001,+e),r=t*t;return n(t,r,r*r)},o}(Math.SQRT2,2,4),Ew=0,Sw=0,kw=0,Cw=0,Nw=0,Mw=0,Ow="object"==typeof performance&&performance.now?performance:Date,Pw="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function jw(){return Nw||(Pw(Iw),Nw=Ow.now()+Mw)}function Iw(){Nw=0}function Aw(){this._call=this._time=this._next=null}function zw(n,e,t){var r=new Aw;return r.restart(n,e,t),r}function Lw(){Nw=(Cw=Ow.now())+Mw,Ew=Sw=0;try{!function(){jw(),++Ew;for(var n,e=xw;e;)(n=Nw-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Ew}()}finally{Ew=0,function(){for(var n,e,t=xw,r=1/0;t;)t._call?(r>t._time&&(r=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:xw=e);bw=n,Tw(r)}(),Nw=0}}function Rw(){var n=Ow.now(),e=n-Cw;e>1e3&&(Mw-=e,Cw=n)}function Tw(n){Ew||(Sw&&(Sw=clearTimeout(Sw)),n-Nw>24?(n<1/0&&(Sw=setTimeout(Lw,n-Ow.now()-Mw)),kw&&(kw=clearInterval(kw))):(kw||(Cw=Ow.now(),kw=setInterval(Rw,1e3)),Ew=1,Pw(Lw)))}function Dw(n,e,t){var r=new Aw;return e=null==e?0:+e,r.restart((t=>{r.stop(),n(t+e)}),e,t),r}Aw.prototype=zw.prototype={constructor:Aw,restart:function(n,e,t){if("function"!=typeof n)throw new TypeError("callback is not a function");t=(null==t?jw():+t)+(null==e?0:+e),this._next||bw===this||(bw?bw._next=this:xw=this,bw=this),this._call=n,this._time=t,Tw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tw())}};var Bw=Bg("start","end","cancel","interrupt"),Vw=[];function Hw(n,e,t,r,o,i){var u=n.__transition;if(u){if(t in u)return}else n.__transition={};!function(n,e,t){var r,o=n.__transition;function i(c){var l,s,f,d;if(1!==t.state)return a();for(l in o)if((d=o[l]).name===t.name){if(3===d.state)return Dw(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<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",n,n.__data__,d.index,d.group),delete o[l])}if(Dw((function(){3===t.state&&(t.state=4,t.timer.restart(u,t.delay,t.time),u(c))})),t.state=2,t.on.call("start",n,n.__data__,t.index,t.group),2===t.state){for(t.state=3,r=new Array(f=t.tween.length),l=0,s=-1;l<f;++l)(d=t.tween[l].value.call(n,n.__data__,t.index,t.group))&&(r[++s]=d);r.length=s+1}}function u(e){for(var o=e<t.duration?t.ease.call(null,e/t.duration):(t.timer.restart(a),t.state=5,1),i=-1,u=r.length;++i<u;)r[i].call(n,o);5===t.state&&(t.on.call("end",n,n.__data__,t.index,t.group),a())}function a(){for(var r in t.state=6,t.timer.stop(),delete o[e],o)return;delete n.__transition}o[e]=t,t.timer=zw((function(n){t.state=1,t.timer.restart(i,t.delay,t.time),t.delay<=n&&i(n-t.delay)}),0,t.time)}(n,t,{name:e,index:r,group:o,on:Bw,tween:Vw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Yw(n,e){var t=Zw(n,e);if(t.state>0)throw new Error("too late; already scheduled");return t}function Xw(n,e){var t=Zw(n,e);if(t.state>3)throw new Error("too late; already running");return t}function Zw(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function Ww(n,e){var t,r,o,i=n.__transition,u=!0;if(i){for(o in e=null==e?null:e+"",i)(t=i[o]).name===e?(r=t.state>2&&t.state<5,t.state=6,t.timer.stop(),t.on.call(r?"interrupt":"cancel",n,n.__data__,t.index,t.group),delete i[o]):u=!1;u&&delete n.__transition}}function Fw(n,e){var t,r;return function(){var o=Xw(this,n),i=o.tween;if(i!==t)for(var u=0,a=(r=t=i).length;u<a;++u)if(r[u].name===e){(r=r.slice()).splice(u,1);break}o.tween=r}}function Uw(n,e,t){var r,o;if("function"!=typeof t)throw new Error;return function(){var i=Xw(this,n),u=i.tween;if(u!==r){o=(r=u).slice();for(var a={name:e,value:t},c=0,l=o.length;c<l;++c)if(o[c].name===e){o[c]=a;break}c===l&&o.push(a)}i.tween=o}}function $w(n,e,t){var r=n._id;return n.each((function(){var n=Xw(this,r);(n.value||(n.value={}))[e]=t.apply(this,arguments)})),function(n){return Zw(n,r).value[e]}}function Gw(n,e){var t;return("number"==typeof e?cw:e instanceof Xm?aw:(t=Xm(e))?(e=t,aw):fw)(n,e)}function qw(n){return function(){this.removeAttribute(n)}}function Kw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Qw(n,e,t){var r,o,i=t+"";return function(){var u=this.getAttribute(n);return u===i?null:u===r?o:o=e(r=u,t)}}function Jw(n,e,t){var r,o,i=t+"";return function(){var u=this.getAttributeNS(n.space,n.local);return u===i?null:u===r?o:o=e(r=u,t)}}function nx(n,e,t){var r,o,i;return function(){var u,a,c=t(this);if(null!=c)return(u=this.getAttribute(n))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=e(r=u,c));this.removeAttribute(n)}}function ex(n,e,t){var r,o,i;return function(){var u,a,c=t(this);if(null!=c)return(u=this.getAttributeNS(n.space,n.local))===(a=c+"")?null:u===r&&a===o?i:(o=a,i=e(r=u,c));this.removeAttributeNS(n.space,n.local)}}function tx(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttributeNS(n.space,n.local,e.call(this,t))}}(n,o)),t}return o._value=e,o}function rx(n,e){var t,r;function o(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&function(n,e){return function(t){this.setAttribute(n,e.call(this,t))}}(n,o)),t}return o._value=e,o}function ox(n,e){return function(){Yw(this,n).delay=+e.apply(this,arguments)}}function ix(n,e){return e=+e,function(){Yw(this,n).delay=e}}function ux(n,e){return function(){Xw(this,n).duration=+e.apply(this,arguments)}}function ax(n,e){return e=+e,function(){Xw(this,n).duration=e}}var cx=Jy.prototype.constructor;function lx(n){return function(){this.style.removeProperty(n)}}var sx=0;function fx(n,e,t,r){this._groups=n,this._parents=e,this._name=t,this._id=r}function dx(){return++sx}var hx=Jy.prototype;fx.prototype={constructor:fx,select:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=qg(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,Hw(f[d],e,t,d,f,Zw(a,t)));return new fx(i,this._parents,e,t)},selectAll:function(n){var e=this._name,t=this._id;"function"!=typeof n&&(n=Qg(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=Zw(c,t),p=0,g=h.length;p<g;++p)(d=h[p])&&Hw(d,e,t,p,h,v);i.push(h),u.push(c)}return new fx(i,u,e,t)},selectChild:hx.selectChild,selectChildren:hx.selectChildren,filter:function(n){"function"!=typeof n&&(n=Jg(n));for(var e=this._groups,t=e.length,r=new Array(t),o=0;o<t;++o)for(var i,u=e[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 fx(r,this._parents,this._name,this._id)},merge:function(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,t=n._groups,r=e.length,o=t.length,i=Math.min(r,o),u=new Array(r),a=0;a<i;++a)for(var c,l=e[a],s=t[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]=e[a];return new fx(u,this._parents,this._name,this._id)},selection:function(){return new cx(this._groups,this._parents)},transition:function(){for(var n=this._name,e=this._id,t=dx(),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=Zw(u,e);Hw(u,n,t,l,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new fx(r,this._parents,n,t)},call:hx.call,nodes:hx.nodes,node:hx.node,size:hx.size,empty:hx.empty,each:hx.each,on:function(n,e){var t=this._id;return arguments.length<2?Zw(this.node(),t).on.on(n):this.each(function(n,e,t){var r,o,i=function(n){return(n+"").trim().split(/^|\s+/).every((function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||"start"===n}))}(e)?Yw:Xw;return function(){var u=i(this,n),a=u.on;a!==r&&(o=(r=a).copy()).on(e,t),u.on=o}}(t,n,e))},attr:function(n,e){var t=Wg(n),r="transform"===t?mw:Gw;return this.attrTween(n,"function"==typeof e?(t.local?ex:nx)(t,r,$w(this,"attr."+n,e)):null==e?(t.local?Kw:qw)(t):(t.local?Jw:Qw)(t,r,e))},attrTween:function(n,e){var t="attr."+n;if(arguments.length<2)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;var r=Wg(n);return this.tween(t,(r.local?tx:rx)(r,e))},style:function(n,e,t){var r="transform"==(n+="")?yw:Gw;return null==e?this.styleTween(n,function(n,e){var t,r,o;return function(){var i=_y(this,n),u=(this.style.removeProperty(n),_y(this,n));return i===u?null:i===t&&u===r?o:o=e(t=i,r=u)}}(n,r)).on("end.style."+n,lx(n)):"function"==typeof e?this.styleTween(n,function(n,e,t){var r,o,i;return function(){var u=_y(this,n),a=t(this),c=a+"";return null==a&&(this.style.removeProperty(n),c=a=_y(this,n)),u===c?null:u===r&&c===o?i:(o=c,i=e(r=u,a))}}(n,r,$w(this,"style."+n,e))).each(function(n,e){var t,r,o,i,u="style."+e,a="end."+u;return function(){var c=Xw(this,n),l=c.on,s=null==c.value[u]?i||(i=lx(e)):void 0;l===t&&o===s||(r=(t=l).copy()).on(a,o=s),c.on=r}}(this._id,n)):this.styleTween(n,function(n,e,t){var r,o,i=t+"";return function(){var u=_y(this,n);return u===i?null:u===r?o:o=e(r=u,t)}}(n,r,e),t).on("end.style."+n,null)},styleTween:function(n,e,t){var r="style."+(n+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(n,e,t){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&function(n,e,t){return function(r){this.style.setProperty(n,e.call(this,r),t)}}(n,i,t)),r}return i._value=e,i}(n,e,null==t?"":t))},text:function(n){return this.tween("text","function"==typeof n?function(n){return function(){var e=n(this);this.textContent=null==e?"":e}}($w(this,"text",n)):function(n){return function(){this.textContent=n}}(null==n?"":n+""))},textTween:function(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;return this.tween(e,function(n){var e,t;function r(){var r=n.apply(this,arguments);return r!==t&&(e=(t=r)&&function(n){return function(e){this.textContent=n.call(this,e)}}(r)),e}return r._value=n,r}(n))},remove:function(){return this.on("end.remove",function(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}(this._id))},tween:function(n,e){var t=this._id;if(n+="",arguments.length<2){for(var r,o=Zw(this.node(),t).tween,i=0,u=o.length;i<u;++i)if((r=o[i]).name===n)return r.value;return null}return this.each((null==e?Fw:Uw)(t,n,e))},delay:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?ox:ix)(e,n)):Zw(this.node(),e).delay},duration:function(n){var e=this._id;return arguments.length?this.each(("function"==typeof n?ux:ax)(e,n)):Zw(this.node(),e).duration},ease:function(n){var e=this._id;return arguments.length?this.each(function(n,e){if("function"!=typeof e)throw new Error;return function(){Xw(this,n).ease=e}}(e,n)):Zw(this.node(),e).ease},easeVarying:function(n){if("function"!=typeof n)throw new Error;return this.each(function(n,e){return function(){var t=e.apply(this,arguments);if("function"!=typeof t)throw new Error;Xw(this,n).ease=t}}(this._id,n))},end:function(){var n,e,t=this,r=t._id,o=t.size();return new Promise((function(i,u){var a={value:u},c={value:function(){0==--o&&i()}};t.each((function(){var t=Xw(this,r),o=t.on;o!==n&&((e=(n=o).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),t.on=e})),0===o&&i()}))},[Symbol.iterator]:hx[Symbol.iterator]};var vx={time:null,delay:0,duration:250,ease:function(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}};function px(n,e){for(var t;!(t=n.__transition)||!(t=t[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return t}Jy.prototype.interrupt=function(n){return this.each((function(){Ww(this,n)}))},Jy.prototype.transition=function(n){var e,t;n instanceof fx?(e=n._id,n=n._name):(e=dx(),(t=vx).time=jw(),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])&&Hw(u,n,e,l,a,t||px(u,e));return new fx(r,this._parents,n,e)};var gx=n=>()=>n;function yx(n,{sourceEvent:e,target:t,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function mx(n,e,t){this.k=n,this.x=e,this.y=t}mx.prototype={constructor:mx,scale:function(n){return 1===n?this:new mx(this.k*n,this.x,this.y)},translate:function(n,e){return 0===n&0===e?this:new mx(this.k,this.x+this.k*n,this.y+this.k*e)},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 wx=new mx(1,0,0);function xx(n){for(;!n.__zoom;)if(!(n=n.parentNode))return wx;return n.__zoom}function bx(n){n.stopImmediatePropagation()}function _x(n){n.preventDefault(),n.stopImmediatePropagation()}function Ex(n){return!(n.ctrlKey&&"wheel"!==n.type||n.button)}function Sx(){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 kx(){return this.__zoom||wx}function Cx(n){return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Nx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mx(n,e,t){var r=n.invertX(e[0][0])-t[0][0],o=n.invertX(e[1][0])-t[1][0],i=n.invertY(e[0][1])-t[0][1],u=n.invertY(e[1][1])-t[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))}xx.prototype=mx.prototype;var Ox,Px=function(n){return{x:n.x,y:n.y,zoom:n.k}},jx=function(n){var e=n.x,t=n.y,r=n.zoom;return wx.translate(e,t).scale(r)},Ix=function(n,e){return n.target.closest(".".concat(e))},Ax=function(n,e){return 2===e&&Array.isArray(n)&&n.includes(2)},zx=function(n,e,t){void 0===e&&(e=0),void 0===t&&(t=function(){});var r="number"==typeof e&&e>0;return r||t(),r?n.transition().duration(e).on("end",t):n},Lx=function(n){var e=n.ctrlKey&&Uv()?10:1;return-n.deltaY*(1===n.deltaMode?.05:n.deltaMode?1:.002)*e};function Rx(n){var e=n.domNode,t=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=e.getBoundingClientRect(),h=function(){var n,e,t,r=Ex,o=Sx,i=Mx,u=Cx,a=Nx,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=_w,d=Bg("start","zoom","end"),h=0,v=10;function p(n){n.property("__zoom",kx).on("wheel.zoom",_,{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,e){return(e=Math.max(c[0],Math.min(c[1],e)))===n.k?n:new mx(e,n.x,n.y)}function y(n,e,t){var r=e[0]-t[0]*n.k,o=e[1]-t[1]*n.k;return r===n.x&&o===n.y?n:new mx(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,e,t,r){n.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var n=this,i=arguments,u=x(n,i).event(r),a=o.apply(n,i),c=null==t?m(a):"function"==typeof t?t.apply(n,i):t,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),s=n.__zoom,d="function"==typeof e?e.apply(n,i):e,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 e=h(n),t=l/e[2];n=new mx(t,c[0]-e[0]*t,c[1]-e[1]*t)}u.zoom(null,n)}}))}function x(n,e,t){return!t&&n.__zooming||new b(n,e)}function b(n,e){this.that=n,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(n,e),this.taps=0}function _(n,...e){if(r.apply(this,arguments)){var t=x(this,e).event(n),o=this.__zoom,a=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,u.apply(this,arguments)))),s=em(n);if(t.wheel)t.mouse[0][0]===s[0]&&t.mouse[0][1]===s[1]||(t.mouse[1]=o.invert(t.mouse[0]=s)),clearTimeout(t.wheel);else{if(o.k===a)return;t.mouse=[s,o.invert(s)],Ww(this),t.start()}_x(n),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),150),t.zoom("mouse",i(y(g(o,a),t.mouse[0],t.mouse[1]),t.extent,l))}}function E(n,...e){if(!t&&r.apply(this,arguments)){var o=n.currentTarget,u=x(this,e,!0).event(n),a=nm(n.view).on("mousemove.zoom",(function(n){if(_x(n),!u.moved){var e=n.clientX-s,t=n.clientY-f;u.moved=e*e+t*t>h}u.event(n).zoom("mouse",i(y(u.that.__zoom,u.mouse[0]=em(n,o),u.mouse[1]),u.extent,l))}),!0).on("mouseup.zoom",(function(n){a.on("mousemove.zoom mouseup.zoom",null),am(n.view,u.moved),_x(n),u.event(n).end()}),!0),c=em(n,o),s=n.clientX,f=n.clientY;um(n.view),bx(n),u.mouse=[c,this.__zoom.invert(c)],Ww(this),u.start()}}function S(n,...e){if(r.apply(this,arguments)){var t=this.__zoom,u=em(n.changedTouches?n.changedTouches[0]:n,this),a=t.invert(u),c=t.k*(n.shiftKey?.5:2),f=i(y(g(t,c),u,a),o.apply(this,e),l);_x(n),s>0?nm(this).transition().duration(s).call(w,f,u,n):nm(this).call(p.transform,f,u,n)}}function k(t,...o){if(r.apply(this,arguments)){var i,u,a,c,l=t.touches,s=l.length,f=x(this,o,t.changedTouches.length===s).event(t);for(bx(t),u=0;u<s;++u)c=[c=em(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&&(e=c[0],n=setTimeout((function(){n=null}),500)),Ww(this),f.start())}}function C(n,...e){if(this.__zooming){var t,r,o,u,a=x(this,e).event(n),c=n.changedTouches,s=c.length;for(_x(n),t=0;t<s;++t)o=em(r=c[t],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=x(this,r).event(n),a=n.changedTouches,c=a.length;for(bx(n),t&&clearTimeout(t),t=setTimeout((function(){t=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=em(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<v)){var l=nm(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return p.transform=function(n,e,t,r){var o=n.selection?n.selection():n;o.property("__zoom",kx),n!==o?w(n,e,t,r):o.interrupt().each((function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(n,e,t,r){p.scaleTo(n,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),t,r)},p.scaleTo=function(n,e,t,r){p.transform(n,(function(){var n=o.apply(this,arguments),r=this.__zoom,u=null==t?m(n):"function"==typeof t?t.apply(this,arguments):t,a=r.invert(u),c="function"==typeof e?e.apply(this,arguments):e;return i(y(g(r,c),u,a),n,l)}),t,r)},p.translateBy=function(n,e,t,r){p.transform(n,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof t?t.apply(this,arguments):t),o.apply(this,arguments),l)}),null,r)},p.translateTo=function(n,e,t,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(wx.translate(a[0],a[1]).scale(u.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof t?-t.apply(this,arguments):-t),n,l)}),r,u)},b.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,e){return this.mouse&&"mouse"!==n&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==n&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==n&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(n){var e=nm(this.that).datum();d.call(n,this.that,new yx(n,{sourceEvent:this.sourceEvent,target:p,type:n,transform:this.that.__zoom,dispatch:d}),e)}},p.wheelDelta=function(n){return arguments.length?(u="function"==typeof n?n:gx(+n),p):u},p.filter=function(n){return arguments.length?(r="function"==typeof n?n:gx(!!n),p):r},p.touchable=function(n){return arguments.length?(a="function"==typeof n?n:gx(!!n),p):a},p.extent=function(n){return arguments.length?(o="function"==typeof n?n:gx([[+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([t,r]).translateExtent(o),v=nm(e).call(h);w({x:i.x,y:i.y,zoom:Iv(i.zoom,t,r)},[[0,0],[d.width,d.height]],o);var p=v.on("wheel.zoom"),g=v.on("dblclick.zoom");function y(n,e){v&&(null==h||h.transform(zx(v,null==e?void 0:e.duration),n))}function m(){h.on("zoom",null)}function w(n,e,t){var r=jx(n),o=null==h?void 0:h.constrain()(r,e,t);return o&&y(o),o}return h.wheelDelta(Lx),{update:function(n){var e=n.noWheelClassName,t=n.noPanClassName,r=n.onPaneContextMenu,o=n.userSelectionActive,i=n.panOnScroll,d=n.panOnDrag,y=n.panOnScrollMode,w=n.panOnScrollSpeed,x=n.preventScrolling,b=n.zoomOnPinch,_=n.zoomOnScroll,E=n.zoomOnDoubleClick,S=n.zoomActivationKeyPressed,k=n.lib;o&&!f.isZoomingOrPanning&&m();var C=!i||S||o?function(n){var e=n.noWheelClassName,t=n.preventScrolling,r=n.d3ZoomHandler;return function(n,o){if(!t&&"wheel"===n.type&&!n.ctrlKey||Ix(n,e))return null;n.preventDefault(),r.call(this,n,o)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:p}):function(n){var e=n.zoomPanValues,t=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(Ix(n,t))return!1;n.preventDefault(),n.stopImmediatePropagation();var f=r.property("__zoom").k||1;if(n.ctrlKey&&a){var d=em(n),h=Lx(n),v=f*Math.pow(2,h);o.scaleTo(r,v,d,n)}else{var p=1===n.deltaMode?20:1,g=i===ep.Vertical?0:n.deltaX*p,y=i===ep.Horizontal?0:n.deltaY*p;!Uv()&&n.shiftKey&&i!==ep.Vertical&&(g=n.deltaY*p,y=0),o.translateBy(r,-g/f*u,-y/f*u,{internal:!0});var m=Px(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,null==c||c(n,m)),e.isPanScrolling&&(null==l||l(n,m),e.panScrollTimeout=setTimeout((function(){null==s||s(n,m),e.isPanScrolling=!1}),150))}}}({zoomPanValues:f,noWheelClassName:e,d3Selection:v,d3Zoom:h,panOnScrollMode:y,panOnScrollSpeed:w,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c});if(v.on("wheel.zoom",C,{passive:!1}),!o){var N=function(n){var e=n.zoomPanValues,t=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=Px(n.transform);e.mouseButton=(null===(i=n.sourceEvent)||void 0===i?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,"mousedown"===(null===(u=n.sourceEvent)||void 0===u?void 0:u.type)&&t(!0),r&&(null==r||r(n.sourceEvent,a))}}}({zoomPanValues:f,onDraggingChange:s,onPanZoomStart:a});h.on("start",N);var M=function(n){var e=n.zoomPanValues,t=n.panOnDrag,r=n.onPaneContextMenu,o=n.onTransformChange,i=n.onPanZoom;return function(n){var u,a,c;e.usedRightMouseButton=!(!r||!Ax(t,null!==(u=e.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,Px(n.transform)))}}({zoomPanValues:f,panOnDrag:d,onPaneContextMenu:!!r,onPanZoom:u,onTransformChange:l});h.on("zoom",M);var O=function(n){var e=n.zoomPanValues,t=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)&&(e.isZoomingOrPanning=!1,u&&Ax(t,null!==(c=e.mouseButton)&&void 0!==c?c:0)&&!e.usedRightMouseButton&&n.sourceEvent&&u(n.sourceEvent),e.usedRightMouseButton=!1,o(!1),i&&(l=e.prevViewport,s=n.transform,l.x!==s.x||l.y!==s.y||l.zoom!==s.k))){var f=Px(n.transform);e.prevViewport=f,clearTimeout(e.timerId),e.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 P=function(n){var e=n.zoomActivationKeyPressed,t=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=e||t,d=r&&n.ctrlKey;if(1===n.button&&"mousedown"===n.type&&(Ix(n,"".concat(s,"-flow__node"))||Ix(n,"".concat(s,"-flow__edge"))))return!0;if(!(o||f||i||u||r))return!1;if(a)return!1;if(Ix(n,c)&&"wheel"===n.type)return!1;if(Ix(n,l)&&("wheel"!==n.type||i&&"wheel"===n.type&&!e))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:_,panOnScroll:i,zoomOnDoubleClick:E,zoomOnPinch:b,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:k});h.filter(P),E?v.on("dblclick.zoom",g):v.on("dblclick.zoom",null)},destroy:m,setViewport:function(n,e){var t=jx(n);return y(t,e),t},setViewportConstrained:w,getViewport:function(){var n=v?xx(v.node()):{x:0,y:0,k:1};return{x:n.x,y:n.y,zoom:n.k}},scaleTo:function(n,e){return v?new Promise((function(t){null==h||h.scaleTo(zx(v,null==e?void 0:e.duration,(function(){return t(!0)})),n)})):Promise.resolve(!1)},scaleBy:function(n,e){return v?new Promise((function(t){null==h||h.scaleBy(zx(v,null==e?void 0:e.duration,(function(){return t(!0)})),n)})):Promise.resolve(!1)},setScaleExtent:function(n){null==h||h.scaleExtent(n)},setTranslateExtent:function(n){null==h||h.translateExtent(n)},syncViewport:function(n){if(v){var e=jx(n),t=v.property("__zoom");t.k===n.zoom&&t.x===n.x&&t.y===n.y||null==h||h.transform(v,e,null,{sync:!0})}}}}!function(n){n.Line="line",n.Handle="handle"}(Ox||(Ox={}));var Tx=["top-left","top-right","bottom-left","bottom-right"],Dx=["top","right","bottom","left"];function Bx(n,e){return Math.max(0,e-n)}function Vx(n,e){return Math.max(0,n-e)}function Hx(n,e,t){return Math.max(0,e-n,n-t)}function Yx(n,e){return n?!e:e}var Xx={width:0,height:0,x:0,y:0},Zx=W(W({},Xx),{pointerX:0,pointerY:0,aspectRatio:1});function Wx(n,e,t){var r,o,i=e.position.x+n.position.x,u=e.position.y+n.position.y,a=null!==(r=n.measured.width)&&void 0!==r?r:0,c=null!==(o=n.measured.height)&&void 0!==o?o:0,l=t[0]*a,s=t[1]*c;return[[i-l,u-s],[i+a-l,u+c-s]]}var Fx=wv.error001();function Ux(n,e){var r=t(X);if(null===r)throw new Error(Fx);return H(r,n,e)}function $x(){var n=t(X);if(null===n)throw new Error(Fx);return r((function(){return{getState:n.getState,setState:n.setState,subscribe:n.subscribe}}),[n])}var Gx=function(n,e){void 0===e&&(e=[0,0]);var t=Jx(n),r=t.width,o=t.height,i=("internals"in n?n.internals.positionAbsolute:n.position)||{x:0,y:0},u=n.origin||e,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 qx(n,e,t){var r,o;n.clear(),e.clear();try{for(var i=g(t),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};e.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}}}var Kx=function(n,e,t){return void 0===e&&(e=0),void 0===t&&(t=1),Math.min(Math.max(n,e),t)},Qx=function(n,e){return void 0===n&&(n={x:0,y:0}),{x:Kx(n.x,e[0][0],e[1][0]),y:Kx(n.y,e[0][1],e[1][1])}};function Jx(n){var e,t,r,o,i,u,a,c;return{width:null!==(o=null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t: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 nb=function(n){return!isNaN(n)&&isFinite(n)},eb=function(n,e){return void 0===e&&(e=[1,1]),{x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}},tb=function(n,e,t,r){var o=n.x,i=n.y,u=y(e,3),a=u[0],c=u[1],l=u[2];void 0===t&&(t=!1),void 0===r&&(r=[1,1]);var s={x:(o-a)/l,y:(i-c)/l};return t?eb(s,r):s},rb=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=Gx(n,e).positionAbsolute;return{x:c.x,y:c.y,width:null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.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}},ob=function(n,e){return{x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}},ib=function(n){var e=n.x,t=n.y;return{x:e,y:t,x2:e+n.width,y2:t+n.height}},ub=function(n){var e=n.x,t=n.y;return{x:e,y:t,width:n.x2-e,height:n.y2-t}},ab=function(n,e){var t,r,o,i,u,a;void 0===e&&(e=[0,0]);var c=Gx(n,e).positionAbsolute,l=c.x,s=c.y;return{x:l,y:s,x2:l+(null!==(o=null!==(r=null===(t=n.measured)||void 0===t?void 0:t.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)}},cb=function(n,e){return ub(ob(ib(n),ib(e)))};function lb(n){return o(n)}var sb=function(n,e){var t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),r=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*r)},fb=function(n,e,t,r,o,i){var u=e/(n.width*(1+i)),a=t/(n.height*(1+i)),c=Math.min(u,a),l=Kx(c,r,o);return{x:e/2-(n.x+n.width/2)*l,y:t/2-(n.y+n.height/2)*l,zoom:l}};function db(n){return void 0!==n&&"parent"!==n}var hb=function(n){return vb(n)},vb=function(n){return"id"in n&&"position"in n&&!("source"in n)&&!("target"in n)};function pb(n,e,t,r,o){var i,u;void 0===r&&(r=[0,0]),void 0===o&&(o={width:0,height:0});for(var a=e,c=d({},n);a;){var l=t.get(e);if(a=null==l?void 0:l.parentId,l){var s=l.origin||r;c.x+=l.internals.positionAbsolute.x-(null!==(i=o.width)&&void 0!==i?i:0)*s[0],c.y+=l.internals.positionAbsolute.y-(null!==(u=o.height)&&void 0!==u?u:0)*s[1]}}return c}var gb=function(n){return nb(n.width)&&nb(n.height)&&nb(n.x)&&nb(n.y)},yb=["INPUT","SELECT","TEXTAREA"];function mb(n){var e,t,r=(null===(t=null===(e=n.composedPath)||void 0===e?void 0:e.call(n))||void 0===t?void 0:t[0])||n.target;return yb.includes(null==r?void 0:r.nodeName)||(null==r?void 0:r.hasAttribute("contenteditable"))||!!(null==r?void 0:r.closest(".nokey"))}var wb=function(n){return"clientX"in n},xb=function(n,e){var t,r,o,i,u=wb(n),a=u?n.clientX:null===(t=n.touches)||void 0===t?void 0:t[0].clientX,c=u?n.clientY:null===(r=n.touches)||void 0===r?void 0:r[0].clientY;return{x:a-(null!==(o=null==e?void 0:e.left)&&void 0!==o?o:0),y:c-(null!==(i=null==e?void 0:e.top)&&void 0!==i?i:0)}},bb="undefined"!=typeof document?document:null;function _b(n,e){void 0===n&&(n=null),void 0===e&&(e={target:bb,actInsideInputWithModifier:!0});var t=y(i(!1),2),o=t[0],c=t[1],l=u(!1),s=u(new Set([])),f=y(r((function(){if(null!==n){var e=(Array.isArray(n)?n:[n]).filter((function(n){return"string"==typeof n})).map((function(n){return n.split("+")})),t=e.reduce((function(n,e){return n.concat.apply(n,m([],y(e),!1))}),[]);return[e,t]}return[[],[]]}),[n]),2),d=f[0],h=f[1];return a((function(){var t=(null==e?void 0:e.target)||bb;if(null!==n){var r=function(n){if(l.current=n.ctrlKey||n.metaKey||n.shiftKey,(!l.current||l.current&&!e.actInsideInputWithModifier)&&mb(n))return!1;var t=Sb(n.code,h);s.current.add(n[t]),Eb(d,s.current,!1)&&(n.preventDefault(),c(!0))},o=function(n){if((!l.current||l.current&&!e.actInsideInputWithModifier)&&mb(n))return!1;var t=Sb(n.code,h);Eb(d,s.current,!0)?(c(!1),s.current.clear()):s.current.delete(n[t]),"Meta"===n.key&&s.current.clear(),l.current=!1},i=function(){s.current.clear(),c(!1)};return null==t||t.addEventListener("keydown",r),null==t||t.addEventListener("keyup",o),window.addEventListener("blur",i),window.addEventListener("contextmenu",i),function(){null==t||t.removeEventListener("keydown",r),null==t||t.removeEventListener("keyup",o),window.removeEventListener("blur",i),window.removeEventListener("contextmenu",i)}}}),[n,c]),o}function Eb(n,e,t){return n.filter((function(n){return t||n.length===e.size})).some((function(n){return n.every((function(n){return e.has(n)}))}))}function Sb(n,e){return e.includes(n)?"code":"key"}function kb(n,e){if(Object.is(n,e))return!0;if("object"!=typeof n||null===n||"object"!=typeof e||null===e)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[t,r]of n)if(!Object.is(r,e.get(t)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(n[r],e[r]))return!1;return!0}var Cb={position:"absolute",width:"100%",height:"100%",top:0,left:0};var Nb=function(n){return{userSelectionActive:n.userSelectionActive,lib:n.lib}};function Mb(n){var e=n.onPaneContextMenu,t=n.zoomOnScroll,r=void 0===t||t,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?ep.Free:d,v=n.zoomOnDoubleClick,p=void 0===v||v,g=n.panOnDrag,y=void 0===g||g,m=n.defaultViewport,w=n.translateExtent,x=n.zoomActivationKeyCode,b=n.preventScrolling,_=void 0===b||b,E=n.children,S=n.noWheelClassName,C=n.noPanClassName,N=n.onViewportChange,M=n.isControlledViewport,O=$x(),P=u(null),j=Ux(Nb,kb),I=j.userSelectionActive,A=j.lib,z=_b(x),L=u();return function(n){var e=$x();a((function(){var t=function(){var t,r;if(!n.current)return!1;var o,i={width:(o=n.current).offsetWidth,height:o.offsetHeight};0!==i.height&&0!==i.width||null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"004",wv.error004()),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);var r=new ResizeObserver((function(){return t()}));return r.observe(n.current),function(){window.removeEventListener("resize",t),r&&n.current&&r.unobserve(n.current)}}}),[])}(P),a((function(){if(P.current){var n=O.getState();L.current=Rx({domNode:P.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,e){var t=O.getState(),r=t.onViewportChangeStart,o=t.onMoveStart;null==o||o(n,e),null==r||r(e)},onPanZoom:function(n,e){var t=O.getState(),r=t.onViewportChange,o=t.onMove;null==o||o(n,e),null==r||r(e)},onPanZoomEnd:function(n,e){var t=O.getState(),r=t.onViewportChangeEnd,o=t.onMoveEnd;null==o||o(n,e),null==r||r(e)}});var e=L.current.getViewport(),t=e.x,r=e.y,o=e.zoom;return O.setState({panZoom:L.current,transform:[t,r,o],domNode:P.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:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:l,panOnScrollSpeed:f,panOnScrollMode:h,zoomOnDoubleClick:p,panOnDrag:y,zoomActivationKeyPressed:z,preventScrolling:_,noPanClassName:C,userSelectionActive:I,noWheelClassName:S,lib:A})}),[e,r,i,l,f,h,p,y,z,_,C,I,S,A]),k.jsx("div",{className:"ink-flow__renderer",ref:P,style:Cb,children:E})}var Ob="undefined"!=typeof window?c:a;function Pb(n){var e=y(i(!1),2),t=e[0],r=e[1],o=y(i((function(){return function(n){var e=[];return{get:function(){return e},reset:function(){e=[]},push:function(t){e.push(t),n()}}}((function(){return r(!0)}))})),1),u=o[0];return Ob((function(){if(t){var e=u.get();e.length&&(n(e),u.reset()),r(!1)}else u.reset()}),[t]),u}function jb(n,e){switch(n.type){case"select":e.selected=n.selected;break;case"position":void 0!==n.position&&(e.position=n.position),void 0!==n.dragging&&(e.dragging=n.dragging);break;case"dimensions":void 0!==n.dimensions&&(e.measured={width:n.dimensions.width,height:n.dimensions.height},n.setAttributes&&(e.width=n.dimensions.width,e.height=n.dimensions.height)),"boolean"==typeof n.resizing&&(e.resizing=n.resizing)}}function Ib(n,e){var t,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"!==(_=f.value).type)if("remove"===_.type||"replace"===_.type)l.set(_.id,[_]);else{var h=l.get(_.id);h?h.push(_):l.set(_.id,[_])}else c.push(_.item)}}catch(n){t={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}try{for(var v=g(e),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 x=(u=void 0,g(m)),b=x.next();!b.done;b=x.next()){var _;jb(_=b.value,w)}}catch(n){u={error:n}}finally{try{b&&!b.done&&(a=x.return)&&a.call(x)}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 Ab(n,e){return{id:n,type:"select",selected:e}}function zb(n,e,t){var r,o;void 0===e&&(e=new Set),void 0===t&&(t=!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=e.has(l);void 0===s.selected&&!f||s.selected===f||(t&&(s.selected=f),i.push(Ab(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 Lb(n){var e,t,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){e={error:n}}finally{try{h&&!h.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var w=g(l),x=w.next();!x.done;x=w.next()){var b=y(x.value,1)[0];void 0===f.get(b)&&s.push({id:b,type:"remove"})}}catch(n){r={error:n}}finally{try{x&&!x.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}return s}var Rb=e(null);function Tb(n){var e=n.children,t=$x(),o=l((function(n){var e,r,o=t.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){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}a&&a({changes:Lb({items:l,lookup:c}),userNodes:l})}),[]),i=Pb(o),u=l((function(n){var e,r,o=t.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){e={error:n}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}a&&a({changes:Lb({items:l,lookup:c}),userEdges:l})}),[]),a=Pb(u),c=r((function(){return{nodeQueue:i,edgeQueue:a}}),[]);return k.jsx(Rb.Provider,{value:c,children:e})}var Db=function(n,e){void 0===e&&(e=[0,0]);var t=Jx(n),r=t.width,o=t.height,i="internals"in n?n.internals.positionAbsolute:n.position,u=n.origin||e,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}}},Bb=function(n,e,t,r,o){var i,u,a,c,l,s,f,h,v=y(void 0===t?[0,0,1]:t,3),p=v[0],m=v[1],w=v[2];void 0===r&&(r=!1),void 0===o&&(o=!1);var x=d(d({},tb(e,[p,m,w])),{width:e.width/w,height:e.height/w}),b=[];try{for(var _=g(n.values()),E=_.next();!E.done;E=_.next()){var S=E.value,k=S.measured,C=S.selectable,N=void 0===C||C,M=S.hidden;if(!(o&&!N||void 0!==M&&M)){var O=null!==(l=null!==(c=null!==(a=k.width)&&void 0!==a?a:S.width)&&void 0!==c?c:S.initialWidth)&&void 0!==l?l:null,P=null!==(h=null!==(f=null!==(s=k.height)&&void 0!==s?s:S.height)&&void 0!==f?f:S.initialHeight)&&void 0!==h?h:null,j=sb(x,rb(S)),I=(null!=O?O:0)*(null!=P?P:0),A=r&&j>0;(!S.internals.handleBounds||A||j>=I||S.dragging)&&b.push(S)}}}catch(n){i={error:n}}finally{try{E&&!E.done&&(u=_.return)&&u.call(_)}finally{if(i)throw i.error}}return b};function Vb(n,e){return v(this,arguments,void 0,(function(n,e){var t,r,o,i,u,a=n.nodes,c=n.width,l=n.height,s=n.panZoom,f=n.minZoom,d=n.maxZoom;return p(this,(function(n){switch(n.label){case 0:return 0===a.size?[2,Promise.resolve(!1)]:(t=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.size)return{x:0,y:0,width:0,height:0};var t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return n.forEach((function(n){if(null==e.filter||e.filter(n)){var r=ab(n,e.nodeOrigin);t=ob(t,r)}})),ub(t)}(a),r=fb(t,c,l,null!==(o=null==e?void 0:e.minZoom)&&void 0!==o?o:f,null!==(i=null==e?void 0:e.maxZoom)&&void 0!==i?i:d,null!==(u=null==e?void 0:e.padding)&&void 0!==u?u:.1),[4,s.setViewport(r,{duration:null==e?void 0:e.duration})]);case 1:return n.sent(),[2,Promise.resolve(!0)]}}))}))}function Hb(n){var e=n.nodeId,t=n.nextPosition,r=n.nodeLookup,o=n.nodeOrigin,i=void 0===o?[0,0]:o,u=n.nodeExtent,a=n.onError,c=r.get(e),l=c.parentId?r.get(c.parentId):void 0,s=l?Db(l,l.origin||i).positionAbsolute:{x:0,y:0},f=s.x,d=s.y,h=function(n,e){var t,r,o,i;return e&&"parent"!==e?[e[0],[e[1][0]-(null!==(r=null===(t=n.measured)||void 0===t?void 0:t.width)&&void 0!==r?r:0),e[1][1]-(null!==(i=null===(o=n.measured)||void 0===o?void 0:o.height)&&void 0!==i?i:0)]]:e}(c,c.extent||u);if("parent"!==c.extent||c.expandParent)l&&db(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],x=d+p*m[1];h=[[w,x],[w+g-v,x+y-p]]}}else null==a||a("005",wv.error005());var b=db(h)?Qx(t,h):t;return{position:{x:b.x-f,y:b.y-d},positionAbsolute:b}}function Yb(n){return v(this,arguments,void 0,(function(n){var e,t,r,o,i,u,a,c,l,s,f,d,h,v,y,m,w,x,b,_=n.nodesToRemove,E=void 0===_?[]:_,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:e=new Set(E.map((function(n){return n.id}))),t=[],r=function(n){if(!1===n.deletable)return"continue";var r=e.has(n.id),o=!r&&n.parentId&&t.find((function(e){return e.id===n.parentId}));(r||o)&&t.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,e){var t=new Set;return n.forEach((function(n){t.add(n.id)})),e.filter((function(n){return t.has(n.source)||t.has(n.target)}))}(t,c),s=l,f=function(n){a.has(n.id)&&!s.find((function(e){return e.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){x={error:n}}finally{try{h&&!h.done&&(b=d.return)&&b.call(d)}finally{if(x)throw x.error}}return M?[4,M({nodes:t,edges:s})]:[2,{edges:s,nodes:t}];case 1:return"boolean"==typeof(y=n.sent())?[2,y?{edges:s,nodes:t}:{edges:[],nodes:[]}]:[2,y]}}))}))}var Xb=function(){var n=$x();return r((function(){return{zoomIn:function(e){var t=n.getState().panZoom;return t?t.scaleBy(1.2,{duration:null==e?void 0:e.duration}):Promise.resolve(!1)},zoomOut:function(e){var t=n.getState().panZoom;return t?t.scaleBy(1/1.2,{duration:null==e?void 0:e.duration}):Promise.resolve(!1)},zoomTo:function(e,t){var r=n.getState().panZoom;return r?r.scaleTo(e,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},getZoom:function(){return n.getState().transform[2]},setViewport:function(e,t){return v(void 0,void 0,void 0,(function(){var r,o,i,u,a,c,l,s,f;return p(this,(function(d){switch(d.label){case 0:return r=n.getState(),o=y(r.transform,3),i=o[0],u=o[1],a=o[2],(c=r.panZoom)?[4,c.setViewport({x:null!==(l=e.x)&&void 0!==l?l:i,y:null!==(s=e.y)&&void 0!==s?s:u,zoom:null!==(f=e.zoom)&&void 0!==f?f:a},{duration:null==t?void 0:t.duration})]:[2,Promise.resolve(!1)];case 1:return d.sent(),[2,Promise.resolve(!0)]}}))}))},getViewport:function(){var e=y(n.getState().transform,3);return{x:e[0],y:e[1],zoom:e[2]}},fitView:function(e){var t=n.getState(),r=t.nodeLookup,o=t.minZoom,i=t.maxZoom,u=t.panZoom,a=t.domNode;if(!u||!a)return Promise.resolve(!1);var c=function(n,e){var t=new Map,r=(null==e?void 0:e.nodes)?new Set(e.nodes.map((function(n){return n.id}))):null;return n.forEach((function(n){!n.measured.width||!n.measured.height||!(null==e?void 0:e.includeHiddenNodes)&&n.hidden||r&&!r.has(n.id)||t.set(n.id,n)})),t}(r,e),l=rp(a);return Vb({nodes:c,width:l.width,height:l.height,minZoom:o,maxZoom:i,panZoom:u},e)},setCenter:function(e,t,r){return v(void 0,void 0,void 0,(function(){var o,i,u,a,c,l,s,f;return p(this,(function(d){switch(d.label){case 0:return o=n.getState(),i=o.width,u=o.height,a=o.maxZoom,c=o.panZoom,l=void 0!==(null==r?void 0:r.zoom)?r.zoom:a,s=i/2-e*l,f=u/2-t*l,c?[4,c.setViewport({x:s,y:f,zoom:l},{duration:null==r?void 0:r.duration})]:[2,Promise.resolve(!1)];case 1:return d.sent(),[2,Promise.resolve(!0)]}}))}))},fitBounds:function(e,t){return v(void 0,void 0,void 0,(function(){var r,o,i,u,a,c,l,s;return p(this,(function(f){switch(f.label){case 0:return r=n.getState(),o=r.width,i=r.height,u=r.minZoom,a=r.maxZoom,c=r.panZoom,l=fb(e,o,i,u,a,null!==(s=null==t?void 0:t.padding)&&void 0!==s?s:.1),c?[4,c.setViewport(l,{duration:null==t?void 0:t.duration})]:[2,Promise.resolve(!1)];case 1:return f.sent(),[2,Promise.resolve(!0)]}}))}))},screenToFlowPosition:function(e,t){var r,o;void 0===t&&(t={});var i=n.getState(),u=i.transform,a=i.snapGrid,c=i.snapToGrid,l=i.domNode;if(!l)return e;var s=l.getBoundingClientRect(),f=s.x,d=s.y,h={x:e.x-f,y:e.y-d},v=null!==(r=t.snapGrid)&&void 0!==r?r:a,p=null!==(o=t.snapToGrid)&&void 0!==o?o:c;return tb(h,u,p,v)},flowToScreenPosition:function(e){var t=n.getState(),r=t.transform,o=t.domNode;if(!o)return e;var i=o.getBoundingClientRect(),u=i.x,a=i.y,c=function(n,e){var t=n.x,r=n.y,o=y(e,3),i=o[0],u=o[1],a=o[2];return{x:t*a+i,y:r*a+u}}(e,r);return{x:c.x+u,y:c.y+a}}}}),[])},Zb=function(n){return!!n.panZoom};function Wb(){var n=this,e=Xb(),o=$x(),i=function(){var n=t(Rb);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}(),u=Ux(Zb);a((function(){window.inkFlowStoreState=o.getState()}),[o]);var c=r((function(){var e=function(n){return o.getState().nodeLookup.get(n)},t=function(n){i.nodeQueue.push(n)},r=function(n){var e,t,r,i,u=o.getState(),a=u.nodeLookup,c=u.nodeOrigin,l=hb(n)?n:a.get(n.id),s=l.parentId?pb(l.position,l.parentId,a,c):l.position,f={id:l.id,position:s,width:null!==(t=null===(e=l.measured)||void 0===e?void 0:e.width)&&void 0!==t?t: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 rb(f)},u=function(n,e,r){void 0===r&&(r={replace:!1}),t((function(t){return t.map((function(t){if(t.id===n){var o="function"==typeof e?e(t):e;return r.replace&&hb(o)?o:d(d({},t),o)}return t}))}))};return{getNodes:function(){return o.getState().nodes.map((function(n){return d({},n)}))},getNode:function(n){var t;return null===(t=e(n))||void 0===t?void 0:t.internals.userNode},getInternalNode:e,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:t,setEdges:function(n){i.edgeQueue.push(n)},addNodes:function(n){var e=Array.isArray(n)?n:[n];i.nodeQueue.push((function(n){return m(m([],y(n),!1),y(e),!1)}))},addEdges:function(n){var e=Array.isArray(n)?n:[n];i.edgeQueue.push((function(n){return m(m([],y(n),!1),y(e),!1)}))},toObject:function(){var n=o.getState(),e=n.nodes,t=void 0===e?[]:e,r=n.edges,i=void 0===r?[]:r,u=y(n.transform,3),a=u[0],c=u[1],l=u[2];return{nodes:t.map((function(n){return d({},n)})),edges:i.map((function(n){return d({},n)})),viewport:{x:a,y:c,zoom:l}}},deleteElements:function(e){return v(n,[e],void 0,(function(n){var e,t,r,i,u,a,c,l,s,f,d,h,v=n.nodes,g=void 0===v?[]:v,y=n.edges,m=void 0===y?[]:y;return p(this,(function(n){switch(n.label){case 0:return e=o.getState(),t=e.nodes,r=e.edges,i=e.onNodesDelete,u=e.onEdgesDelete,a=e.onDelete,c=e.onBeforeDelete,[4,Yb({nodesToRemove:g,edgesToRemove:m,nodes:t,edges:r,onBeforeDelete:c})];case 1:return l=n.sent(),s=l.nodes,f=l.edges,d=f.length>0,h=s.length>0,d&&(null==u||u(f)),h&&(null==i||i(s)),(h||d)&&(null==a||a({nodes:s,edges:f})),[2,{deletedNodes:s,deletedEdges:f}]}}))}))},getIntersectingNodes:function(n,e,t){void 0===e&&(e=!0);var i=gb(n),u=i?n:r(n),a=void 0!==t;return u?(t||o.getState().nodes).filter((function(t){var r=o.getState().nodeLookup.get(t.id);if(r&&!i&&(t.id===n.id||!r.internals.positionAbsolute))return!1;var c=rb(a?t:r),l=sb(c,u);return e&&l>0||l>=u.width*u.height})):[]},isNodeIntersecting:function(n,e,t){void 0===t&&(t=!0);var o=gb(n)?n:r(n);if(!o)return!1;var i=sb(o,e);return t&&i>0||i>=o.width*o.height},updateNode:u,updateNodeData:function(n,e,t){void 0===t&&(t={replace:!1}),u(n,(function(n){var r="function"==typeof e?e(n):e;return t.replace?d(d({},n),{data:r}):d(d({},n),{data:d(d({},n.data),r)})}),t)},setLayoutAnchorId:function(n){o.getState().setLayoutAnchorId(n)}}}),[]);return r((function(){return d(d(d({},c),e),{viewportInitialized:u})}),[u])}var Fb=function(n){return n.selected},Ub={actInsideInputWithModifier:!1};var $b=function(n){return{userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect}};function Gb(){var n=Ux($b,kb),e=n.userSelectionActive,t=n.userSelectionRect;return e&&t?k.jsx("div",{className:"ink-flow__selection ink-flow__container",style:{width:t.width,height:t.height,transform:"translate(".concat(t.x,"px, ").concat(t.y,"px)")}}):null}var qb=function(n,e){return function(t){t.target===e.current&&(null==n||n(t))}},Kb=function(n){return{userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,dragging:n.paneDragging}};function Qb(n){var e=n.isSelecting,t=n.selectionKeyPressed,r=n.selectionMode,o=void 0===r?tp.Full:r,i=n.selectionOnDrag,a=n.panOnDrag,c=n.onSelectionStart,l=n.onSelectionEnd,s=n.onPaneClick,f=n.onPaneContextMenu,d=n.onPaneScroll,h=n.onPaneMouseEnter,v=n.onPaneMouseMove,p=n.onPaneMouseLeave,m=n.children,w=u(null),x=$x(),b=u(0),_=u(0),E=u(),S=u(new Map),C=Ux(Kb,kb),N=C.userSelectionActive,M=C.elementsSelectable,O=C.dragging,j=M&&(e||N),I=u(!1),A=u(!1),z=function(n){I.current?I.current=!1:(null==s||s(n),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1}))},L=d?function(n){return d(n)}:void 0,R=!0===a||Array.isArray(a)&&a.includes(0);return k.jsxs("div",{className:P(["ink-flow__pane",{draggable:R,dragging:O,selection:e}]),onClick:j?void 0:qb(z,w),onContextMenu:qb((function(n){Array.isArray(a)&&(null==a?void 0:a.includes(2))?n.preventDefault():null==f||f(n)}),w),onWheel:qb(L,w),onPointerEnter:j?void 0:h,onPointerDown:j?function(n){var t,r,o,i,u,a,l=x.getState(),s=l.resetSelectedElements,f=l.domNode,d=l.edgeLookup;if(E.current=null==f?void 0:f.getBoundingClientRect(),M&&e&&0===n.button&&n.target===w.current&&E.current){null===(i=null===(o=n.target)||void 0===o?void 0:o.setPointerCapture)||void 0===i||i.call(o,n.pointerId),A.current=!0,I.current=!1,S.current=new Map;try{for(var h=g(d),v=h.next();!v.done;v=h.next()){var p=y(v.value,2),m=p[0],b=p[1];S.current.set(b.source,(null===(u=S.current.get(b.source))||void 0===u?void 0:u.add(m))||new Set([m])),S.current.set(b.target,(null===(a=S.current.get(b.target))||void 0===a?void 0:a.add(m))||new Set([m]))}}catch(n){t={error:n}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}var _=xb(n.nativeEvent,E.current),k=_.x,C=_.y;s(),x.setState({userSelectionRect:{width:0,height:0,startX:k,startY:C,x:k,y:C}}),null==c||c(n)}}:v,onPointerMove:j?function(n){var e,t,r,i,u=x.getState(),a=u.userSelectionRect,c=u.edgeLookup,l=u.transform,s=u.nodeLookup,f=u.triggerNodeChanges,d=u.triggerEdgeChanges;if(E.current&&a){I.current=!0;var h=xb(n.nativeEvent,E.current),v=h.x,p=h.y,y=a.startX,m=a.startY,w={startX:y,startY:m,x:v<y?v:y,y:p<m?p:m,width:Math.abs(v-y),height:Math.abs(p-m)},k=Bb(s,w,l,o===tp.Partial,!0),C=new Set,N=new Set;try{for(var M=g(k),O=M.next();!O.done;O=M.next()){var P=O.value;N.add(P.id);var j=S.current.get(P.id);if(j)try{for(var A=(r=void 0,g(j)),z=A.next();!z.done;z=A.next()){var L=z.value;C.add(L)}}catch(n){r={error:n}}finally{try{z&&!z.done&&(i=A.return)&&i.call(A)}finally{if(r)throw r.error}}}}catch(n){e={error:n}}finally{try{O&&!O.done&&(t=M.return)&&t.call(M)}finally{if(e)throw e.error}}if(b.current!==N.size)b.current=N.size,f(zb(s,N,!0));if(_.current!==C.size)_.current=C.size,d(zb(c,C));x.setState({userSelectionRect:w,userSelectionActive:!0,nodesSelectionActive:!1})}}:v,onPointerUp:j?function(n){var e,r;if(0===n.button&&A.current){null===(r=null===(e=n.target)||void 0===e?void 0:e.releasePointerCapture)||void 0===r||r.call(e,n.pointerId);var o=x.getState().userSelectionRect;!N&&o&&n.target===w.current&&(null==z||z(n)),b.current>0&&x.setState({nodesSelectionActive:!0}),x.setState({userSelectionActive:!1,userSelectionRect:null}),b.current=0,_.current=0,null==l||l(n),(t||i)&&(I.current=!1),A.current=!1}}:void 0,onPointerLeave:p,ref:w,style:Cb,children:[m,k.jsx(Gb,{})]})}var Jb=function(n){return{nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive}};function n_(n){var e=n.children,t=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,x=n.zoomOnPinch,b=n.panOnScroll,_=n.panOnScrollSpeed,E=n.panOnScrollMode,S=n.zoomOnDoubleClick,C=n.panOnDrag,N=n.defaultViewport,M=n.translateExtent,O=n.minZoom,P=n.maxZoom,j=n.preventScrolling;n.onSelectionContextMenu;var I=n.noWheelClassName,A=n.noPanClassName;n.disableKeyboardA11y;var z=n.onViewportChange,L=n.isControlledViewport,R=n.paneClickDistance,T=n.nodeClickDistance,D=Ux(Jb);D.nodesSelectionActive;var B=D.userSelectionActive,V=_b(s),H=_b(g),Y=H||C,X=H||b,Z=V||B||f&&!0!==Y;return function(n){var e=n.deleteKeyCode,t=n.multiSelectionKeyCode,r=$x(),o=Wb().deleteElements,i=_b(e,Ub),u=_b(t);a((function(){if(i){var n=r.getState(),e=n.edgeLookup,t=n.nodeLookup;o({nodes:Array.from(t.values()).filter(Fb),edges:Array.from(e.values()).filter(Fb)}),r.setState({nodesSelectionActive:!1})}}),[i]),a((function(){r.setState({multiSelectionActive:u})}),[u])}({deleteKeyCode:l,multiSelectionKeyCode:p}),k.jsx(Mb,{onPaneContextMenu:u,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:X,panOnScrollSpeed:_,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!V&&Y,defaultViewport:N,translateExtent:M,minZoom:O,maxZoom:P,zoomActivationKeyCode:y,preventScrolling:j,noWheelClassName:I,noPanClassName:A,onViewportChange:z,isControlledViewport:L,paneClickDistance:R,nodeClickDistance:T,children:k.jsx(Qb,{onSelectionStart:h,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:Y,isSelecting:!!Z,selectionMode:d,selectionKeyPressed:V,children:e})})}n_.displayName="FlowRenderer";var e_=s(n_);function t_(n){var e=y(i(n),2);return[e[0],e[1]]}function r_(n){var e=y(i(n),2);return[e[0],e[1]]}var o_=function(n){return n.updateNodeInternals};function i_(n){var e=Ux(l(function(n){return function(e){return n?Bb(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map((function(n){return n.id})):Array.from(e.nodeLookup.keys())}}(n),[n]),kb);return e}var u_=e(null),a_=u_.Provider;u_.Consumer;var c_=function(){return t(u_)};function l_(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=n.sourceControlX,u=n.sourceControlY,a=.125*e+.375*i+.375*n.targetControlX+.125*r,c=.125*t+.375*u+.375*n.targetControlY+.125*o;return[a,c,Math.abs(a-e),Math.abs(c-t)]}function s_(n,e){return n>=0?.5*n:25*e*Math.sqrt(-n)}function f_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2,u=n.c;switch(e){case lp.Left:return[t-s_(t-o,u),r];case lp.Right:return[t+s_(o-t,u),r];case lp.Top:return[t,r-s_(r-i,u)];case lp.Bottom:return[t,r+s_(i-r,u)]}}function d_(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=Math.abs(r-e)/2,u=r<e?r+i:r-i,a=Math.abs(o-t)/2;return[u,o<t?o+a:o-a,i,a]}function h_(n){var e=n.sourceNode,t=n.targetNode,r=n.width,o=n.height,i=n.transform,u=ob(ab(e),ab(t));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);var a={x:-i[0]/i[2],y:-i[1]/i[2],width:r/i[2],height:o/i[2]};return sb(a,ub(u))>0}var v_,p_=function(n){var e=n.source,t=n.sourceHandle,r=n.target,o=n.targetHandle;return"xy-edge__".concat(e).concat(t||"","-").concat(r).concat(o||"")};var g_=((v_={})[lp.Left]={x:-1,y:0},v_[lp.Right]={x:1,y:0},v_[lp.Top]={x:0,y:-1},v_[lp.Bottom]={x:0,y:1},v_),y_=function(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))};function m_(n){var e,t,r,o,i=n.source,u=n.sourcePosition,a=void 0===u?lp.Bottom:u,c=n.target,l=n.targetPosition,s=void 0===l?lp.Top:l,f=n.center,d=n.offset,h=g_[a],v=g_[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 e=n.source,t=n.sourcePosition,r=void 0===t?lp.Bottom:t,o=n.target;return r===lp.Left||r===lp.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}({source:p,sourcePosition:a,target:g}),x=0!==w.x?"x":"y",b=w[x],_=[],E={x:0,y:0},S={x:0,y:0},k=y(d_({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[x]*v[x]==-1){r=null!==(e=f.x)&&void 0!==e?e:C,o=null!==(t=f.y)&&void 0!==t?t:N;var P=[{x:r,y:p.y},{x:r,y:g.y}],j=[{x:p.x,y:o},{x:g.x,y:o}];_=h[x]===b?"x"===x?P:j:"x"===x?j:P}else{var I=[{x:p.x,y:g.y}],A=[{x:g.x,y:p.y}];if(_="x"===x?h.x===b?A:I:h.y===b?I:A,a===s){var z=Math.abs(i[x]-c[x]);if(z<=d){var L=Math.min(d-1,d-z);h[x]===b?E[x]=(p[x]>i[x]?-1:1)*L:S[x]=(g[x]>c[x]?-1:1)*L}}if(a!==s){var R="x"===x?"y":"x",T=h[x]===v[R],D=p[R]>g[R],B=p[R]<g[R];(1===h[x]&&(!T&&D||T&&B)||1!==h[x]&&(!T&&B||T&&D))&&(_="x"===x?I: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-_[0].x),Math.abs(H.x-_[0].x))>=Math.max(Math.abs(V.y-_[0].y),Math.abs(H.y-_[0].y))?(r=(V.x+H.x)/2,o=_[0].y):(r=_[0].x,o=(V.y+H.y)/2)}return[m(m([i,{x:p.x+E.x,y:p.y+E.y}],y(_),!1),[{x:g.x+S.x,y:g.y+S.y},c],!1),r,o,M,O]}function w_(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.borderRadius,s=void 0===l?5:l,f=n.centerX,d=n.centerY,h=n.offset,v=y(m_({source:{x:e,y:t},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],x=v[4],b=p.reduce((function(n,e,t){var r="";return r=t>0&&t<p.length-1?function(n,e,t,r){var o=Math.min(y_(n,e)/2,y_(e,t)/2,r),i=e.x,u=e.y;if(n.x===i&&i===t.x||n.y===u&&u===t.y)return"L".concat(i," ").concat(u);if(n.y===u){var a=n.x<t.x?-1:1,c=n.y<t.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<t.x?1:-1,s=n.y<t.y?-1:1;return"L ".concat(i,",").concat(u+o*s,"Q ").concat(i,",").concat(u," ").concat(i+o*l,",").concat(u)}(p[t-1],e,p[t+1],s):"".concat(0===t?"M":"L").concat(e.x," ").concat(e.y),n+=r}),"");return[b,g,m,w,x]}var x_=function(n){return{connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}};var b_=s(lb((function(n,e){var t,r,o=n.type,i=void 0===o?"source":o,u=n.position,a=void 0===u?lp.Top:u,c=n.isValidConnection,l=n.isConnectable,s=void 0===l||l,f=n.isConnectableStart,v=void 0===f||f,p=n.isConnectableEnd,g=void 0===p||p,y=n.id,m=n.onConnect,w=n.children,x=n.className,b=n.onMouseDown,_=n.onTouchStart,E=h(n,["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"]),S=y||null,C="target"===i,N=$x(),M=c_(),O=Ux(x_,kb),j=O.connectOnClick,I=O.noPanClassName,A=O.rfId,z=Ux(function(n,e,t){return function(r){var o=r.connectionClickStartHandle,i=r.connectionMode,u=r.connection,a=u.fromHandle,c=u.toHandle,l=u.isValid,s=(null==c?void 0:c.nodeId)===n&&(null==c?void 0:c.id)===e&&(null==c?void 0:c.type)===t;return{connectingFrom:(null==a?void 0:a.nodeId)===n&&(null==a?void 0:a.id)===e&&(null==a?void 0:a.type)===t,connectingTo:s,clickConnecting:(null==o?void 0:o.nodeId)===n&&(null==o?void 0:o.id)===e&&(null==o?void 0:o.type)===t,isPossibleEndHandle:i===np.Strict?(null==a?void 0:a.type)!==t:n!==(null==a?void 0:a.nodeId)||e!==(null==a?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:s&&l}}}(M,S,i),kb),L=z.connectingFrom,R=z.connectingTo,T=z.clickConnecting,D=z.isPossibleEndHandle,B=z.connectionInProcess,V=z.clickConnectionInProcess,H=z.valid;M||null===(r=(t=N.getState()).onError)||void 0===r||r.call(t,"010",wv.error010());var Y=function(n){var e=N.getState(),t=e.defaultEdgeOptions,r=e.onConnect,o=e.hasDefaultEdges,i=d(d({},t),n);if(o){var u=N.getState(),a=u.edges;(0,u.setEdges)(function(n,e){return n.source&&n.target?function(n,e){return e.some((function(e){return!(e.source!==n.source||e.target!==n.target||e.sourceHandle!==n.sourceHandle&&(e.sourceHandle||n.sourceHandle)||e.targetHandle!==n.targetHandle&&(e.targetHandle||n.targetHandle))}))}(t="id"in(r=n)&&"source"in r&&"target"in r?d({},n):d(d({},n),{id:p_(n)}),e)?e:(null===t.sourceHandle&&delete t.sourceHandle,null===t.targetHandle&&delete t.targetHandle,e.concat(t)):(wv.error006(),e);var t,r}(i,a))}null==r||r(i),null==m||m(i)},X=function(n){if(M){var e=wb(n.nativeEvent);if(v&&(e&&0===n.button||!e)){var t=N.getState();Sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:C,handleId:S,nodeId:M,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:Y,isValidConnection:c||t.isValidConnection,getTransform:function(){return N.getState().transform},getFromHandle:function(){return N.getState().connection.fromHandle},autoPanSpeed:t.autoPanSpeed})}e?null==b||b(n):null==_||_(n)}};return k.jsx("div",d({"data-handleid":S,"data-nodeid":M,"data-handlepos":a,"data-id":"".concat(A,"-").concat(M,"-").concat(S,"-").concat(i),className:P(["ink-flow__handle","ink-flow__handle-".concat(a),"nodrag",I,x,{source:!C,target:C,connectable:s,connectablestart:v,connectableend:g,clickconnecting:T,connectingfrom:L,connectingto:R,valid:H,connectionindicator:s&&(!B||D)&&(B||V?g:v)}]),onMouseDown:X,onTouchStart:X,onClick:j?function(n){var e=N.getState(),t=e.onClickConnectStart,r=e.onClickConnectEnd,o=e.connectionClickStartHandle,u=e.connectionMode,a=e.isValidConnection,l=e.lib,s=e.rfId,f=e.nodeLookup,d=e.connection;if(M&&(o||v)){if(!o)return null==t||t(n.nativeEvent,{nodeId:M,handleId:S,handleType:i}),void N.setState({connectionClickStartHandle:{nodeId:M,type:i,id:S}});var h=function(n){var e;return(null===(e=n.getRootNode)||void 0===e?void 0:e.call(n))||(null===window||void 0===window?void 0:window.document)}(n.target),p=c||a,g=Sm.isValid(n.nativeEvent,{handle:{nodeId:M,id:S,type:i},connectionMode:u,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:p,flowId:s,doc:h,lib:l,nodeLookup:f}),y=g.connection;g.isValid&&y&&Y(y);var m=structuredClone(d);delete m.inProgress,m.toPosition=m.toHandle?m.toHandle.position:null,null==r||r(n,m),N.setState({connectionClickStartHandle:null})}}:void 0,ref:e},E,{children:w}))})));var __={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},E_={input:function(n){var e=n.data,t=n.isConnectable,r=n.sourcePosition,o=void 0===r?lp.Bottom:r;return k.jsxs(k.Fragment,{children:[null==e?void 0:e.label,k.jsx(b_,{type:"source",position:o,isConnectable:t})]})},default:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?lp.Top:r,i=n.sourcePosition,u=void 0===i?lp.Bottom:i;return k.jsxs(k.Fragment,{children:[k.jsx(b_,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label,k.jsx(b_,{type:"source",position:u,isConnectable:t})]})},output:function(n){var e=n.data,t=n.isConnectable,r=n.targetPosition,o=void 0===r?lp.Top:r;return k.jsxs(k.Fragment,{children:[k.jsx(b_,{type:"target",position:o,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};function S_(n){var e=n.id,t=n.store,r=n.unselect,o=void 0!==r&&r,i=n.nodeRef,u=t.getState(),a=u.addSelectedNodes,c=u.unselectNodesAndEdges,l=u.multiSelectionActive,s=u.nodeLookup,f=u.onError,d=s.get(e);d?(t.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([e])):null==f||f("012",wv.error012(e))}function k_(n){var e,t,r=n.id,o=n.onClick,c=n.onMouseEnter,s=n.onMouseMove,f=n.onMouseLeave,h=n.onContextMenu,v=n.onDoubleClick,p=n.nodesDraggable,m=n.elementsSelectable,w=n.nodesConnectable,x=n.nodesFocusable,b=n.resizeObserver,_=n.noDragClassName,E=n.noPanClassName,S=n.disableKeyboardA11y,C=n.rfId,N=n.nodeTypes,M=n.nodeExtent,O=n.nodeOrigin,j=n.onError,I=Ux((function(n){var e=n.nodeLookup.get(r),t=n.parentLookup.has(r);return{node:e,internals:e.internals,isParent:t}}),kb),A=I.node,z=I.internals,L=I.isParent,R=A.type||"default",T=(null==N?void 0:N[R])||E_[R];void 0===T&&(null==j||j("003",wv.error003(R)),R="default",T=E_.default);var D=!!(A.draggable||p&&void 0===A.draggable),B=!!(A.selectable||m&&void 0===A.selectable),V=!!(A.connectable||w&&void 0===A.connectable),H=!!(A.focusable||x&&void 0===A.focusable),Y=$x(),X=function(n){var e,t,r,o,i,u;return void 0!==(null!==(r=null!==(t=null===(e=n.measured)||void 0===e?void 0:e.width)&&void 0!==t?t: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)}(A),Z=function(n){var e=n.node,t=n.nodeType,r=n.hasDimensions,o=n.resizeObserver,i=$x(),c=u(null),l=u(null),s=u(e.sourcePosition),f=u(e.targetPosition),d=u(t),h=r&&!!e.internals.handleBounds&&!e.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!==t,r=s.current!==e.sourcePosition,o=f.current!==e.targetPosition;(n||r||o)&&(d.current=t,s.current=e.sourcePosition,f.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}}),[e.id,t,e.sourcePosition,e.targetPosition]),c}({node:A,nodeType:R,hasDimensions:X,resizeObserver:b}),W=function(n){var e=n.nodeRef,t=n.disabled,r=void 0!==t&&t,o=n.noDragClassName,c=n.handleSelector,l=n.nodeId,s=n.isSelectable,f=$x(),d=y(i(!1),2),h=d[0],v=d[1],p=u();return a((function(){p.current=mm({getStoreItems:function(){return f.getState()},onNodeMouseDown:function(n){S_({id:n,store:f,nodeRef:e})},onDragStart:function(){v(!0)},onDragStop:function(){v(!1)}})}),[]),a((function(){var n,t;if(r)null===(n=p.current)||void 0===n||n.destroy();else if(e.current)return null===(t=p.current)||void 0===t||t.update({noDragClassName:o,handleSelector:c,domNode:e.current,isSelectable:s,nodeId:l}),function(){var n;null===(n=p.current)||void 0===n||n.destroy()}}),[o,c,r,s,e,l]),h}({nodeRef:Z,disabled:A.hidden||!D,noDragClassName:_,handleSelector:A.dragHandle,nodeId:r,isSelectable:B}),F=function(){var n=$x(),e=l((function(e){var t,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(e){return e.selected&&(e.draggable||n&&void 0===e.draggable)}}(c),p=u?a[0]:5,m=u?a[1]:5,w=e.direction.x*p*e.factor,x=e.direction.y*m*e.factor;try{for(var b=g(f),_=b.next();!_.done;_=b.next()){var E=y(_.value,2)[1];if(v(E)){var S={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+x};u&&(S=eb(S,a));var k=Hb({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){t={error:n}}finally{try{_&&!_.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}s(h)}),[]);return e}();if(A.hidden)return null;var U=Jx(A),$=function(n){var e,t,r,o,i,u,a,c,l,s;return void 0===n.internals.handleBounds?{width:null!==(t=null!==(e=n.width)&&void 0!==e?e:n.initialWidth)&&void 0!==t?t: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}}(A),G=(M?Qx(z.positionAbsolute,M):z.positionAbsolute)||{x:0,y:0},q=function(n){var e=n.x,t=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:e,y:t}:{x:e-r*u[0],y:t-o*u[1]}}(d(d(d({},G),U),{origin:A.origin||O})),K=B||D||o||c||s||f,Q=c?function(n){return c(n,d({},z.userNode))}:void 0,J=s?function(n){return s(n,d({},z.userNode))}:void 0,nn=f?function(n){return f(n,d({},z.userNode))}:void 0,en=h?function(n){return h(n,d({},z.userNode))}:void 0,tn=v?function(n){return v(n,d({},z.userNode))}:void 0;return k.jsx("div",{className:P(["ink-flow__node","ink-flow__node-".concat(R),(e={},e[E]=D,e),A.className,{selected:A.selected,selectable:B,parent:L,draggable:D,dragging:W}]),ref:Z,style:d(d({zIndex:z.z,transform:"translate(".concat(q.x,"px,").concat(q.y,"px)"),pointerEvents:K?"all":"none",visibility:X?"visible":"hidden"},A.style),$),"data-id":r,"data-testid":"rf__node-".concat(r),onMouseEnter:Q,onMouseMove:J,onMouseLeave:nn,onContextMenu:en,onClick:function(n){var e=Y.getState(),t=e.selectNodesOnDrag,i=e.nodeDragThreshold;B&&(!t||!D||i>0)&&S_({id:r,store:Y,nodeRef:Z}),o&&o(n,d({},z.userNode))},onDoubleClick:tn,onKeyDown:H?function(n){if(!mb(n.nativeEvent)&&!S)if(bv.includes(n.key)&&B){var e="Escape"===n.key;S_({id:r,store:Y,unselect:e,nodeRef:Z})}else D&&A.selected&&Object.prototype.hasOwnProperty.call(__,n.key)&&(Y.setState({ariaLiveMessage:"Moved selected node ".concat(n.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~G.x,", y: ").concat(~~G.y)}),F({direction:__[n.key],factor:n.shiftKey?4:1}))}:void 0,tabIndex:H?0:void 0,role:H?"button":void 0,"aria-describedby":S?void 0:"".concat("ink-flow__node-desc","-").concat(C),"aria-label":A.ariaLabel,children:k.jsx(a_,{value:r,children:k.jsx(T,d({id:r,data:A.data,type:R,positionAbsoluteX:G.x,positionAbsoluteY:G.y,selected:A.selected,isConnectable:V,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:W,draggable:D,dragHandle:A.dragHandle,zIndex:z.z,selectable:B,deletable:null===(t=A.deletable)||void 0===t||t},U))})})}var C_=function(n){return{nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError}};function N_(n){var e=Ux(C_,kb),t=e.nodesDraggable,r=e.nodesConnectable,o=e.nodesFocusable,u=e.elementsSelectable,c=e.onError,l=i_(!1),s=function(){var n=Ux(o_),e=y(i((function(){return"undefined"==typeof ResizeObserver?null:new ResizeObserver((function(e){var t=new Map;e.forEach((function(n){var e=n.target.getAttribute("data-id");t.set(e,{id:e,nodeElement:n.target})})),n(t)}))})),1),t=e[0];return a((function(){return function(){null==t||t.disconnect()}}),[t]),t}();return k.jsx("div",{className:"ink-flow__nodes",style:Cb,children:l.map((function(e){return k.jsx(k_,{id:e,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:t,nodesConnectable:r,nodesFocusable:o,elementsSelectable:u,onError:c},e)}))})}N_.displayName="NodeRenderer";var M_,O_=s(N_),P_=((M_={})[ap.Arrow]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})},M_[ap.ArrowClosed]=function(n){var e=n.color,t=void 0===e?"none":e,r=n.strokeWidth,o=void 0===r?1:r;return k.jsx("polyline",{style:{stroke:t,fill:t,strokeWidth:o},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},M_);function j_(n,e){if(!n)return"";if("string"==typeof n)return n;var t=e?"".concat(e,"__"):"";return"".concat(t).concat(Object.keys(n).sort().map((function(e){return"".concat(e,"=").concat(n[e])})).join("&"))}var I_=function(n){var e=n.id,t=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 e=$x(),t=r((function(){var t,r;return Object.prototype.hasOwnProperty.call(P_,n)?P_[n]:(null===(r=(t=e.getState()).onError)||void 0===r||r.call(t,"009",wv.error009(n)),null)}),[n]);return t}(t);return v?k.jsx("marker",{className:"ink-flow__arrowhead",id:e,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},A_=function(n){var e=n.defaultColor,t=n.rfId,o=Ux((function(n){return n.edges})),i=Ux((function(n){return n.defaultEdgeOptions})),u=r((function(){var n=function(n,e){var t=e.id,r=e.defaultColor,o=e.defaultMarkerStart,i=e.defaultMarkerEnd,u=new Set;return n.reduce((function(n,e){return[e.markerStart||o,e.markerEnd||i].forEach((function(e){if(e&&"object"==typeof e){var o=j_(e,t);u.has(o)||(n.push(d({id:o,color:e.color||r},e)),u.add(o))}})),n}),[]).sort((function(n,e){return n.id.localeCompare(e.id)}))}(o,{id:t,defaultColor:e,defaultMarkerStart:null==i?void 0:i.markerStart,defaultMarkerEnd:null==i?void 0:i.markerEnd});return n}),[o,i,t,e]);return u.length?k.jsx("svg",{className:"ink-flow__marker",children:k.jsx("defs",{children:u.map((function(n){return k.jsx(I_,{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};A_.displayName="MarkerDefinitions";var z_=s(A_);function L_(n){var e=n.x,t=n.y,r=n.label,o=n.labelStyle,u=void 0===o?{}:o,a=n.labelShowBg,c=void 0===a||a,s=n.labelBgStyle,f=void 0===s?{}:s,v=n.labelBgPadding,p=void 0===v?[2,4]:v,g=n.labelBgBorderRadius,m=void 0===g?2:g,w=n.children,x=n.className,b=h(n,["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"]),_=y(i({x:1,y:0,width:0,height:0}),2),E=_[0],S=_[1],C=P(["ink-flow__edge-textwrapper",x]),N=l((function(n){if(null!==n){var e=n.getBBox();S({x:e.x,y:e.y,width:e.width,height:e.height})}}),[]);return void 0!==r&&r?k.jsxs("g",d({transform:"translate(".concat(e-E.width/2," ").concat(t-E.height/2,")"),className:C,visibility:E.width?"visible":"hidden"},b,{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}L_.displayName="EdgeText";var R_=s(L_);function T_(n){var e=n.id,t=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:e,style:f,d:t,fill:"none",className:P(["ink-flow__edge-path",v]),markerEnd:d,markerStart:h}),g&&k.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"ink-flow__edge-interaction"}),i&&nb(r)&&nb(o)?k.jsx(R_,{x:r,y:o,label:i,labelStyle:u,labelShowBg:a,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function D_(n){var e=n.pos,t=n.x1,r=n.y1,o=n.x2,i=n.y2;return e===lp.Left||e===lp.Right?[.5*(t+o),r]:[t,.5*(r+i)]}function B_(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=y(D_({pos:o,x1:e,y1:t,x2:i,y2:u}),2),s=l[0],f=l[1],d=y(D_({pos:c,x1:i,y1:u,x2:e,y2:t}),2),h=d[0],v=d[1],p=y(l_({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:s,sourceControlY:f,targetControlX:h,targetControlY:v}),4),g=p[0],m=p[1],w=p[2],x=p[3];return["M".concat(e,",").concat(t," C").concat(s,",").concat(f," ").concat(h,",").concat(v," ").concat(i,",").concat(u),g,m,w,x]}function V_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.sourcePosition,c=void 0===a?lp.Bottom:a,l=e.targetPosition,s=void 0===l?lp.Top:l,f=e.label,d=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,g=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,x=e.markerStart,b=e.interactionWidth,_=y(B_({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s}),3),E=_[0],S=_[1],C=_[2],N=n.isInternal?void 0:t;return k.jsx(T_,{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:x,interactionWidth:b})}))}var H_=V_({isInternal:!1}),Y_=V_({isInternal:!0});function X_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,f=e.labelBgPadding,d=e.labelBgBorderRadius,h=e.style,v=e.sourcePosition,p=void 0===v?lp.Bottom:v,g=e.targetPosition,m=void 0===g?lp.Top:g,w=e.markerEnd,x=e.markerStart,b=e.pathOptions,_=e.interactionWidth,E=y(w_({sourceX:r,sourceY:o,sourcePosition:p,targetX:i,targetY:u,targetPosition:m,borderRadius:null==b?void 0:b.borderRadius,offset:null==b?void 0:b.offset}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:t;return k.jsx(T_,{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:x,interactionWidth:_})}))}H_.displayName="SimpleBezierEdge",Y_.displayName="SimpleBezierEdgeInternal";var Z_=X_({isInternal:!1}),W_=X_({isInternal:!0});function F_(n){return s((function(e){var t,o=e.id,i=h(e,["id"]),u=n.isInternal?void 0:o;return k.jsx(Z_,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===(t=i.pathOptions)||void 0===t?void 0:t.offset])}))}))}Z_.displayName="SmoothStepEdge",W_.displayName="SmoothStepEdgeInternal";var U_=F_({isInternal:!1}),$_=F_({isInternal:!0});function G_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.label,c=e.labelStyle,l=e.labelShowBg,s=e.labelBgStyle,f=e.labelBgPadding,d=e.labelBgBorderRadius,h=e.style,v=e.markerEnd,p=e.markerStart,g=e.interactionWidth,m=y(function(n){var e=n.sourceX,t=n.sourceY,r=n.targetX,o=n.targetY,i=y(d_({sourceX:e,sourceY:t,targetX:r,targetY:o}),4),u=i[0],a=i[1],c=i[2],l=i[3];return["M ".concat(e,",").concat(t,"L ").concat(r,",").concat(o),u,a,c,l]}({sourceX:r,sourceY:o,targetX:i,targetY:u}),3),w=m[0],x=m[1],b=m[2],_=n.isInternal?void 0:t;return k.jsx(T_,{id:_,path:w,labelX:x,labelY:b,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:s,labelBgPadding:f,labelBgBorderRadius:d,style:h,markerEnd:v,markerStart:p,interactionWidth:g})}))}U_.displayName="StepEdge",$_.displayName="StepEdgeInternal";var q_=G_({isInternal:!1}),K_=G_({isInternal:!0});function Q_(n){return s((function(e){var t=e.id,r=e.sourceX,o=e.sourceY,i=e.targetX,u=e.targetY,a=e.sourcePosition,c=void 0===a?lp.Bottom:a,l=e.targetPosition,s=void 0===l?lp.Top:l,f=e.label,d=e.labelStyle,h=e.labelShowBg,v=e.labelBgStyle,p=e.labelBgPadding,g=e.labelBgBorderRadius,m=e.style,w=e.markerEnd,x=e.markerStart,b=e.pathOptions,_=e.interactionWidth,E=y(function(n){var e=n.sourceX,t=n.sourceY,r=n.sourcePosition,o=void 0===r?lp.Bottom:r,i=n.targetX,u=n.targetY,a=n.targetPosition,c=void 0===a?lp.Top:a,l=n.curvature,s=void 0===l?.25:l,f=y(f_({pos:o,x1:e,y1:t,x2:i,y2:u,c:s}),2),d=f[0],h=f[1],v=y(f_({pos:c,x1:i,y1:u,x2:e,y2:t,c:s}),2),p=v[0],g=v[1],m=y(l_({sourceX:e,sourceY:t,targetX:i,targetY:u,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:g}),4),w=m[0],x=m[1],b=m[2],_=m[3];return["M".concat(e,",").concat(t," C").concat(d,",").concat(h," ").concat(p,",").concat(g," ").concat(i,",").concat(u),w,x,b,_]}({sourceX:r,sourceY:o,sourcePosition:c,targetX:i,targetY:u,targetPosition:s,curvature:null==b?void 0:b.curvature}),3),S=E[0],C=E[1],N=E[2],M=n.isInternal?void 0:t;return k.jsx(T_,{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:x,interactionWidth:_})}))}q_.displayName="StraightEdge",K_.displayName="StraightEdgeInternal";var J_=Q_({isInternal:!1}),nE=Q_({isInternal:!0});J_.displayName="BezierEdge",nE.displayName="BezierEdgeInternal";var eE={default:nE,straight:K_,step:$_,smoothstep:W_,simplebezier:Y_},tE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},rE=function(n,e,t){return t===lp.Left?n-e:t===lp.Right?n+e:n},oE=function(n,e,t){return t===lp.Top?n-e:t===lp.Bottom?n+e:n},iE="ink-flow__edgeupdater";function uE(n){var e=n.position,t=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:P([iE,"".concat(iE,"-").concat(l)]),cx:rE(t,i,e),cy:oE(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function aE(n){var e=n.isReconnectable,t=n.reconnectRadius,r=n.edge,o=n.sourceX,i=n.sourceY,u=n.targetX,a=n.targetY,c=n.sourcePosition,l=n.targetPosition,s=n.onReconnect,f=n.onReconnectStart,d=n.onReconnectEnd,h=n.setReconnecting,v=n.setUpdateHover,p=$x(),g=function(n,e){if(0===n.button){var t=p.getState(),o=t.autoPanOnConnect,i=t.domNode,u=t.isValidConnection,a=t.connectionMode,c=t.connectionRadius,l=t.lib,v=t.onConnectStart,g=t.onConnectEnd,y=t.cancelConnection,m=t.nodeLookup,w=t.rfId,x=t.panBy,b=t.updateConnection,_="target"===e.type;h(!0),null==f||f(n,r,e.type);Sm.onPointerDown(n.nativeEvent,{autoPanOnConnect:o,connectionMode:a,connectionRadius:c,domNode:i,handleId:e.id,nodeId:e.nodeId,nodeLookup:m,isTarget:_,edgeUpdaterType:e.type,lib:l,flowId:w,cancelConnection:y,panBy:x,isValidConnection:u,onConnect:function(n){return null==s?void 0:s(r,n)},onConnectStart:v,onConnectEnd:g,onReconnectEnd:function(n,t){h(!1),null==d||d(n,r,e.type,t)},updateConnection:b,getTransform:function(){return p.getState().transform},getFromHandle:function(){return p.getState().connection.fromHandle}})}},y=function(){return v(!0)},m=function(){return v(!1)};return k.jsxs(k.Fragment,{children:[(!0===e||"source"===e)&&k.jsx(uE,{position:c,centerX:o,centerY:i,radius:t,onMouseDown:function(n){var e;return g(n,{nodeId:r.target,id:null!==(e=r.targetHandle)&&void 0!==e?e:null,type:"target"})},onMouseEnter:y,onMouseOut:m,type:"source"}),(!0===e||"target"===e)&&k.jsx(uE,{position:l,centerX:u,centerY:a,radius:t,onMouseDown:function(n){var e;return g(n,{nodeId:r.source,id:null!==(e=r.sourceHandle)&&void 0!==e?e:null,type:"source"})},onMouseEnter:y,onMouseOut:m,type:"target"})]})}function cE(n){var e;return n&&!(!n.internals.handleBounds&&!(null===(e=n.handles)||void 0===e?void 0:e.length))&&!!(n.measured.width||n.width||n.initialWidth)}function lE(n){var e,t,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){e={error:n}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return{source:i,target:u}}function sE(n,e,t){var r,o;void 0===t&&(t=null);var i=(null!==(r=null==t?void 0:t.x)&&void 0!==r?r:0)+e.internals.positionAbsolute.x,u=(null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0)+e.internals.positionAbsolute.y,a=null!=t?t:Jx(e),c=a.width,l=a.height;switch(n){case lp.Top:return[i+c/2,u];case lp.Right:return[i+c,u+l/2];case lp.Bottom:return[i+c/2,u+l];case lp.Left:return[i,u+l/2]}}function fE(n,e){return n&&(e?n.find((function(n){return n.id===e})):n[0])||null}function dE(n){var e,t=n.id,o=n.edgesFocusable,a=n.edgesReconnectable,c=n.elementsSelectable,s=n.onClick,f=n.onDoubleClick,h=n.onContextMenu,v=n.onMouseEnter,p=n.onMouseMove,g=n.onMouseLeave,m=n.reconnectRadius,w=n.onReconnect,x=n.onReconnectStart,b=n.onReconnectEnd,_=n.rfId,E=n.edgeTypes,S=n.noPanClassName,C=n.onError,N=n.disableKeyboardA11y,M=Ux((function(n){return n.edgeLookup.get(t)})),O=Ux((function(n){return n.defaultEdgeOptions})),j=(M=O?d(d({},O),M):M).type||"default",I=(null==E?void 0:E[j])||eE[j];void 0===I&&(null==C||C("011",wv.error011(j)),j="default",I=eE.default);var A=!!(M.focusable||o&&void 0===M.focusable),z=void 0!==w&&(M.reconnectable||a&&void 0===M.reconnectable),L=!!(M.selectable||c&&void 0===M.selectable),R=u(null),T=y(i(!1),2),D=T[0],B=T[1],V=y(i(!1),2),H=V[0],Y=V[1],X=$x(),Z=Ux(l((function(n){var e=n.nodeLookup.get(M.source),r=n.nodeLookup.get(M.target);if(!e||!r)return d({zIndex:M.zIndex},tE);var o=function(n){var e,t,r,o,i,u=n.sourceNode,a=n.targetNode;if(!cE(u)||!cE(a))return null;var c=u.internals.handleBounds||lE(u.handles),l=a.internals.handleBounds||lE(a.handles),s=fE(null!==(e=null==c?void 0:c.source)&&void 0!==e?e:[],n.sourceHandle),f=fE(n.connectionMode===np.Strict?null!==(t=null==l?void 0:l.target)&&void 0!==t?t:[]:(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)||lp.Bottom,h=(null==f?void 0:f.position)||lp.Top;if(!s||!f)return null===(i=n.onError)||void 0===i||i.call(n,"008",wv.error008(s?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;var v=y(sE(d,u,s),2),p=v[0],g=v[1],m=y(sE(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:M.sourceHandle||null,targetHandle:M.targetHandle||null,connectionMode:n.connectionMode,onError:C}),i=function(n){var e=n.sourceNode,t=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||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return u+(c?l:0)}({selected:M.selected,zIndex:M.zIndex,sourceNode:e,targetNode:r,elevateOnSelect:n.elevateEdgesOnSelect});return d({zIndex:i},o||tE)}),[M.source,M.target,M.sourceHandle,M.targetHandle,M.selected,M.zIndex]),kb),W=Z.zIndex,F=Z.sourceX,U=Z.sourceY,$=Z.targetX,G=Z.targetY,q=Z.sourcePosition,K=Z.targetPosition,Q=r((function(){return M.markerStart?"url('#".concat(j_(M.markerStart,_),"')"):void 0}),[M.markerStart,_]),J=r((function(){return M.markerEnd?"url('#".concat(j_(M.markerEnd,_),"')"):void 0}),[M.markerEnd,_]);if(M.hidden||null===F||null===U||null===$||null===G)return null;var nn=f?function(n){f(n,d({},M))}:void 0,en=h?function(n){h(n,d({},M))}:void 0,tn=v?function(n){v(n,d({},M))}:void 0,rn=p?function(n){p(n,d({},M))}:void 0,on=g?function(n){g(n,d({},M))}:void 0;return k.jsx("svg",{style:{zIndex:W},children:k.jsxs("g",{className:P(["ink-flow__edge","ink-flow__edge-".concat(j),M.className,S,{selected:M.selected,animated:M.animated,inactive:!L&&!s,updating:D,selectable:L}]),onClick:function(n){var e,r=X.getState(),o=r.addSelectedEdges,i=r.unselectNodesAndEdges,u=r.multiSelectionActive;L&&(X.setState({nodesSelectionActive:!1}),M.selected&&u?(i({nodes:[],edges:[M]}),null===(e=R.current)||void 0===e||e.blur()):o([t])),s&&s(n,M)},onDoubleClick:nn,onContextMenu:en,onMouseEnter:tn,onMouseMove:rn,onMouseLeave:on,onKeyDown:A?function(n){var e;if(!N&&bv.includes(n.key)&&L){var r=X.getState(),o=r.unselectNodesAndEdges,i=r.addSelectedEdges;"Escape"===n.key?(null===(e=R.current)||void 0===e||e.blur(),o({edges:[M]})):i([t])}}:void 0,tabIndex:A?0:void 0,role:A?"button":"img","data-id":t,"data-testid":"rf__edge-".concat(t),"aria-label":null===M.ariaLabel?void 0:M.ariaLabel||"Edge from ".concat(M.source," to ").concat(M.target),"aria-describedby":A?"".concat("ink-flow__edge-desc","-").concat(_):void 0,ref:R,children:[!H&&k.jsx(I,{id:t,source:M.source,target:M.target,type:M.type,selected:M.selected,animated:M.animated,selectable:L,deletable:null===(e=M.deletable)||void 0===e||e,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,sourceX:F,sourceY:U,targetX:$,targetY:G,sourcePosition:q,targetPosition:K,data:M.data,style:M.style,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerStart:Q,markerEnd:J,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth}),z&&k.jsx(aE,{edge:M,isReconnectable:z,reconnectRadius:m,onReconnect:w,onReconnectStart:x,onReconnectEnd:b,sourceX:F,sourceY:U,targetX:$,targetY:G,sourcePosition:q,targetPosition:K,setUpdateHover:B,setReconnecting:Y})]})})}var hE=function(n){return{edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError}};function vE(n){var e=n.defaultMarkerColor,t=n.onlyRenderVisibleElements,r=n.rfId,o=n.edgeTypes,i=n.noPanClassName,u=n.onReconnect,a=n.onEdgeContextMenu,c=n.onEdgeMouseEnter,s=n.onEdgeMouseMove,f=n.onEdgeMouseLeave,d=n.onEdgeClick,h=n.reconnectRadius,v=n.onEdgeDoubleClick,p=n.onReconnectStart,y=n.onReconnectEnd,m=n.disableKeyboardA11y,w=Ux(hE,kb),x=w.edgesFocusable,b=w.edgesReconnectable,_=w.elementsSelectable,E=w.onError,S=function(n){var e=Ux(l((function(e){var t,r;if(!n)return e.edges.map((function(n){return n.id}));var o=[];if(e.width&&e.height)try{for(var i=g(e.edges),u=i.next();!u.done;u=i.next()){var a=u.value,c=e.nodeLookup.get(a.source),l=e.nodeLookup.get(a.target);c&&l&&h_({sourceNode:c,targetNode:l,width:e.width,height:e.height,transform:e.transform})&&o.push(a.id)}}catch(n){t={error:n}}finally{try{u&&!u.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}),[n]),kb);return e}(t);return k.jsxs("div",{className:"ink-flow__edges",children:[k.jsx(z_,{defaultColor:e,rfId:r}),S.map((function(n){return k.jsx(dE,{id:n,edgesFocusable:x,edgesReconnectable:b,elementsSelectable:_,noPanClassName:i,onReconnect:u,onContextMenu:a,onMouseEnter:c,onMouseMove:s,onMouseLeave:f,onClick:d,reconnectRadius:h,onDoubleClick:v,onReconnectStart:p,onReconnectEnd:y,rfId:r,onError:E,edgeTypes:o,disableKeyboardA11y:m},n)}))]})}vE.displayName="EdgeRenderer";var pE=s(vE),gE=function(n){return"translate(".concat(n.transform[0],"px,").concat(n.transform[1],"px) scale(").concat(n.transform[2],")")};function yE(n){var e=n.children,t=Ux(gE);return k.jsx("div",{className:"ink-flow__viewport xyflow__viewport ink-flow__container",style:{transform:t},children:e})}function mE(n){return n.connection.inProgress?d(d({},n.connection),{to:Zv(n.connection.to,n.transform)}):d({},n.connection)}function wE(n){return Ux(mE,kb)}var xE=function(n){var e=n.style,t=n.type,r=void 0===t?up.Bezier:t,o=n.CustomComponent,i=n.isValid,u=wE(),a=u.inProgress,c=u.from,l=u.fromNode,s=u.fromHandle,f=u.fromPosition,h=u.to,v=u.toNode,p=u.toHandle,g=u.toPosition;if(a){if(o)return k.jsx(o,{connectionLineType:r,connectionLineStyle:e,fromNode:l,fromHandle:s,fromX:c.x,fromY:c.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:g,connectionStatus:Qv(i),toNode:v,toHandle:p});var m="",w={sourceX:c.x,sourceY:c.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:g};switch(r){case up.Bezier:m=y(pp(w),1)[0];break;case up.SimpleBezier:m=y(B_(w),1)[0];break;case up.Step:m=y(kp(d(d({},w),{borderRadius:0})),1)[0];break;case up.SmoothStep:m=y(kp(w),1)[0];break;default:m=y(bp(w),1)[0]}return k.jsx("path",{d:m,fill:"none",className:"ink-flow__connection-path",style:e})}};xE.displayName="ConnectionLine";var bE=function(n){return{nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height}};function _E(n){var e=n.containerStyle,t=n.style,r=n.type,o=n.component,i=Ux(bE,kb),u=i.nodesConnectable,a=i.width,c=i.height,l=i.isValid,s=i.inProgress;return!!(a&&u&&s)?k.jsx("svg",{style:e,width:a,height:c,className:"ink-flow__connectionline ink-flow__container",children:k.jsx("g",{className:P(["ink-flow__connection",Qv(l)]),children:k.jsx(xE,{style:t,type:r,CustomComponent:o,isValid:l})})}):null}function EE(n){var e=n.onNodeClick,t=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,x=n.disableKeyboardA11y,b=n.translateExtent,_=n.defaultViewport,E=n.nodeTypes,S=n.edgeTypes,C=n.elementsSelectable,N=n.defaultMarkerColor,M=n.connectionLineType,O=n.connectionLineStyle,P=n.connectionLineComponent,j=n.connectionLineContainerStyle,I=n.onPaneClick,A=n.onPaneContextMenu,z=n.onPaneMouseEnter,L=n.onPaneMouseMove,R=n.onPaneMouseLeave,T=n.onPaneScroll,D=n.panOnDrag,B=n.selectionOnDrag,V=n.selectionMode,H=n.onlyRenderVisibleElements,Y=n.paneClickDistance,X=n.nodeClickDistance,Z=n.onReconnect,W=n.onReconnectStart,F=n.onReconnectEnd,U=n.reconnectRadius,$=n.deleteKeyCode,G=n.selectionKeyCode,q=n.multiSelectionKeyCode,K=n.noWheelClassName;return k.jsx(e_,{minZoom:v,maxZoom:p,noPanClassName:g,noDragClassName:y,isControlledViewport:!!w,disableKeyboardA11y:x,translateExtent:b,defaultViewport:_,elementsSelectable:C,onPaneClick:I,onPaneContextMenu:A,onPaneMouseEnter:z,onPaneMouseMove:L,onPaneMouseLeave:R,onPaneScroll:T,panOnDrag:D,selectionOnDrag:B,selectionMode:V,paneClickDistance:Y,nodeClickDistance:X,deleteKeyCode:$,selectionKeyCode:G,multiSelectionKeyCode:q,noWheelClassName:K,children:k.jsxs(yE,{children:[k.jsx(pE,{edgeTypes:S,onEdgeClick:a,onEdgeDoubleClick:c,onReconnect:Z,onReconnectStart:W,onReconnectEnd:F,onlyRenderVisibleElements:H,onEdgeContextMenu:d,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:f,reconnectRadius:U,defaultMarkerColor:N,noPanClassName:g,disableKeyboardA11y:x,rfId:h}),k.jsx(_E,{style:O,type:M,component:P,containerStyle:j}),k.jsx("div",{className:"ink-flow__edgelabel-renderer"}),k.jsx(O_,{rfId:h,nodeTypes:E,nodeOrigin:m,noDragClassName:y,noPanClassName:g,disableKeyboardA11y:!1,onNodeClick:e,onNodeDoubleClick:t,onNodeMouseEnter:r,onNodeMouseMove:o,onNodeMouseLeave:i,onNodeContextMenu:u}),k.jsx("div",{className:"ink-flow__viewport-portal"})]})})}EE.displayName="GraphView";var SE=s(EE),kE={x:0,y:0,zoom:1},CE={type:"dagre",options:{rankdir:"TB",ranksep:100,nodesep:50}},NE=function(n){var e,t,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,h=null!==(e=null!=a?a:i)&&void 0!==e?e:[],v=null!==(t=null!=u?u:o)&&void 0!==t?t:[];qx(s,f,h),Op(v,c,l,{nodeOrigin:[0,0],elevateNodesOnSelect:!1});return{rfId:"1",width:0,height:0,transform:[0,0,1],nodes:v,nodeLookup:c,parentLookup:l,edges:h,edgeLookup:f,connectionLookup:s,hasDefaultNodes:void 0!==u,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:xv,nodeExtent:xv,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:d({},sp),connectionClickStartHandle:null,connectOnClick:!0,connectionMode:np.Strict,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:void 0,isValidConnection:void 0,onSelectionChangeHandlers:[],autoLayout:!1,layoutConfig:CE,layoutTypes:{},layoutComplete:!1,centerConfig:{},centered:!1,lib:"ink",debug:!1}},ME={dagre:zp};function OE(n){var e=n.nodes,t=n.nodeOrigin,r=n.height,o=n.width,i=n.zoom,u=void 0===i?1:i,a=n.panZoom,c=function(n,e){if(void 0===e&&(e={nodeOrigin:[0,0]}),0===n.length)return{x:0,y:0,width:0,height:0};var t=n.reduce((function(n,t){var r=ab(t,e.nodeOrigin);return ob(n,r)}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ub(t)}(e,{nodeOrigin:t}),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})}var PE={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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});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};
24
+ */!function(n,e){(function(){var t,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]",x="[object Date]",b="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",k="[object Number]",C="[object Object]",N="[object Promise]",M="[object RegExp]",O="[object Set]",P="[object String]",j="[object Symbol]",I="[object WeakMap]",A="[object ArrayBuffer]",z="[object DataView]",L="[object Float32Array]",R="[object Float64Array]",T="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",V="[object Uint8Array]",H="[object Uint8ClampedArray]",Y="[object Uint16Array]",X="[object Uint32Array]",Z=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,G=RegExp(U.source),q=RegExp($.source),K=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,en=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\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,xn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_n=/($^)/,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",Pn="\\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",jn="['’]",In="["+Sn+"]",An="["+Pn+"]",zn="["+kn+"]",Ln="\\d+",Rn="["+Cn+"]",Tn="["+Nn+"]",Dn="[^"+Sn+Pn+Ln+Cn+Nn+Mn+"]",Bn="\\ud83c[\\udffb-\\udfff]",Vn="[^"+Sn+"]",Hn="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",Xn="["+Mn+"]",Zn="\\u200d",Wn="(?:"+Tn+"|"+Dn+")",Fn="(?:"+Xn+"|"+Dn+")",Un="(?:['’](?:d|ll|m|re|s|t|ve))?",$n="(?:['’](?:D|LL|M|RE|S|T|VE))?",Gn="(?:"+zn+"|"+Bn+")"+"?",qn="["+On+"]?",Kn=qn+Gn+("(?:"+Zn+"(?:"+[Vn,Hn,Yn].join("|")+")"+qn+Gn+")*"),Qn="(?:"+[Rn,Hn,Yn].join("|")+")"+Kn,Jn="(?:"+[Vn+zn+"?",zn,Hn,Yn,In].join("|")+")",ne=RegExp(jn,"g"),ee=RegExp(zn,"g"),te=RegExp(Bn+"(?="+Bn+")|"+Jn+Kn,"g"),re=RegExp([Xn+"?"+Tn+"+"+Un+"(?="+[An,Xn,"$"].join("|")+")",Fn+"+"+$n+"(?="+[An,Xn+Wn,"$"].join("|")+")",Xn+"?"+Wn+"+"+Un,Xn+"+"+$n,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ln,Qn].join("|"),"g"),oe=RegExp("["+Zn+Sn+kn+On+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ue=["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"],ae=-1,ce={};ce[L]=ce[R]=ce[T]=ce[D]=ce[B]=ce[V]=ce[H]=ce[Y]=ce[X]=!0,ce[g]=ce[y]=ce[A]=ce[m]=ce[z]=ce[x]=ce[b]=ce[_]=ce[S]=ce[k]=ce[C]=ce[M]=ce[O]=ce[P]=ce[I]=!1;var le={};le[g]=le[y]=le[A]=le[z]=le[m]=le[x]=le[L]=le[R]=le[T]=le[D]=le[B]=le[S]=le[k]=le[C]=le[M]=le[O]=le[P]=le[j]=le[V]=le[H]=le[Y]=le[X]=!0,le[b]=le[_]=le[I]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,de=parseInt,he="object"==typeof w&&w&&w.Object===Object&&w,ve="object"==typeof self&&self&&self.Object===Object&&self,pe=he||ve||Function("return this")(),ge=e&&!e.nodeType&&e,ye=ge&&n&&!n.nodeType&&n,me=ye&&ye.exports===ge,we=me&&he.process,xe=function(){try{var n=ye&&ye.require&&ye.require("util").types;return n||we&&we.binding&&we.binding("util")}catch(n){}}(),be=xe&&xe.isArrayBuffer,_e=xe&&xe.isDate,Ee=xe&&xe.isMap,Se=xe&&xe.isRegExp,ke=xe&&xe.isSet,Ce=xe&&xe.isTypedArray;function Ne(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Me(n,e,t,r){for(var o=-1,i=null==n?0:n.length;++o<i;){var u=n[o];e(r,u,t(u),n)}return r}function Oe(n,e){for(var t=-1,r=null==n?0:n.length;++t<r&&!1!==e(n[t],t,n););return n}function Pe(n,e){for(var t=null==n?0:n.length;t--&&!1!==e(n[t],t,n););return n}function je(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(!e(n[t],t,n))return!1;return!0}function Ie(n,e){for(var t=-1,r=null==n?0:n.length,o=0,i=[];++t<r;){var u=n[t];e(u,t,n)&&(i[o++]=u)}return i}function Ae(n,e){return!!(null==n?0:n.length)&&Xe(n,e,0)>-1}function ze(n,e,t){for(var r=-1,o=null==n?0:n.length;++r<o;)if(t(e,n[r]))return!0;return!1}function Le(n,e){for(var t=-1,r=null==n?0:n.length,o=Array(r);++t<r;)o[t]=e(n[t],t,n);return o}function Re(n,e){for(var t=-1,r=e.length,o=n.length;++t<r;)n[o+t]=e[t];return n}function Te(n,e,t,r){var o=-1,i=null==n?0:n.length;for(r&&i&&(t=n[++o]);++o<i;)t=e(t,n[o],o,n);return t}function De(n,e,t,r){var o=null==n?0:n.length;for(r&&o&&(t=n[--o]);o--;)t=e(t,n[o],o,n);return t}function Be(n,e){for(var t=-1,r=null==n?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}var Ve=Ue("length");function He(n,e,t){var r;return t(n,(function(n,t,o){if(e(n,t,o))return r=t,!1})),r}function Ye(n,e,t,r){for(var o=n.length,i=t+(r?1:-1);r?i--:++i<o;)if(e(n[i],i,n))return i;return-1}function Xe(n,e,t){return e==e?function(n,e,t){var r=t-1,o=n.length;for(;++r<o;)if(n[r]===e)return r;return-1}(n,e,t):Ye(n,We,t)}function Ze(n,e,t,r){for(var o=t-1,i=n.length;++o<i;)if(r(n[o],e))return o;return-1}function We(n){return n!=n}function Fe(n,e){var t=null==n?0:n.length;return t?qe(n,e)/t:h}function Ue(n){return function(e){return null==e?t:e[n]}}function $e(n){return function(e){return null==n?t:n[e]}}function Ge(n,e,t,r,o){return o(n,(function(n,o,i){t=r?(r=!1,n):e(t,n,o,i)})),t}function qe(n,e){for(var r,o=-1,i=n.length;++o<i;){var u=e(n[o]);u!==t&&(r=r===t?u:r+u)}return r}function Ke(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}function Qe(n){return n?n.slice(0,pt(n)+1).replace(un,""):n}function Je(n){return function(e){return n(e)}}function nt(n,e){return Le(e,(function(e){return n[e]}))}function et(n,e){return n.has(e)}function tt(n,e){for(var t=-1,r=n.length;++t<r&&Xe(e,n[t],0)>-1;);return t}function rt(n,e){for(var t=n.length;t--&&Xe(e,n[t],0)>-1;);return t}var ot=$e({"À":"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"}),it=$e({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ut(n){return"\\"+se[n]}function at(n){return oe.test(n)}function ct(n){var e=-1,t=Array(n.size);return n.forEach((function(n,r){t[++e]=[r,n]})),t}function lt(n,e){return function(t){return n(e(t))}}function st(n,e){for(var t=-1,r=n.length,o=0,u=[];++t<r;){var a=n[t];a!==e&&a!==i||(n[t]=i,u[o++]=t)}return u}function ft(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=n})),t}function dt(n){var e=-1,t=Array(n.size);return n.forEach((function(n){t[++e]=[n,n]})),t}function ht(n){return at(n)?function(n){var e=te.lastIndex=0;for(;te.test(n);)++e;return e}(n):Ve(n)}function vt(n){return at(n)?function(n){return n.match(te)||[]}(n):function(n){return n.split("")}(n)}function pt(n){for(var e=n.length;e--&&an.test(n.charAt(e)););return e}var gt=$e({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var yt=function n(e){var w,an=(e=null==e?pe:yt.defaults(pe.Object(),e,yt.pick(pe,ue))).Array,Sn=e.Date,kn=e.Error,Cn=e.Function,Nn=e.Math,Mn=e.Object,On=e.RegExp,Pn=e.String,jn=e.TypeError,In=an.prototype,An=Cn.prototype,zn=Mn.prototype,Ln=e["__core-js_shared__"],Rn=An.toString,Tn=zn.hasOwnProperty,Dn=0,Bn=(w=/[^.]+$/.exec(Ln&&Ln.keys&&Ln.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",Vn=zn.toString,Hn=Rn.call(Mn),Yn=pe._,Xn=On("^"+Rn.call(Tn).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zn=me?e.Buffer:t,Wn=e.Symbol,Fn=e.Uint8Array,Un=Zn?Zn.allocUnsafe:t,$n=lt(Mn.getPrototypeOf,Mn),Gn=Mn.create,qn=zn.propertyIsEnumerable,Kn=In.splice,Qn=Wn?Wn.isConcatSpreadable:t,Jn=Wn?Wn.iterator:t,te=Wn?Wn.toStringTag:t,oe=function(){try{var n=hi(Mn,"defineProperty");return n({},"",{}),n}catch(n){}}(),se=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=Sn&&Sn.now!==pe.Date.now&&Sn.now,ve=e.setTimeout!==pe.setTimeout&&e.setTimeout,ge=Nn.ceil,ye=Nn.floor,we=Mn.getOwnPropertySymbols,xe=Zn?Zn.isBuffer:t,Ve=e.isFinite,$e=In.join,mt=lt(Mn.keys,Mn),wt=Nn.max,xt=Nn.min,bt=Sn.now,_t=e.parseInt,Et=Nn.random,St=In.reverse,kt=hi(e,"DataView"),Ct=hi(e,"Map"),Nt=hi(e,"Promise"),Mt=hi(e,"Set"),Ot=hi(e,"WeakMap"),Pt=hi(Mn,"create"),jt=Ot&&new Ot,It={},At=Bi(kt),zt=Bi(Ct),Lt=Bi(Nt),Rt=Bi(Mt),Tt=Bi(Ot),Dt=Wn?Wn.prototype:t,Bt=Dt?Dt.valueOf:t,Vt=Dt?Dt.toString:t;function Ht(n){if(ta(n)&&!Wu(n)&&!(n instanceof Wt)){if(n instanceof Zt)return n;if(Tn.call(n,"__wrapped__"))return Vi(n)}return new Zt(n)}var Yt=function(){function n(){}return function(e){if(!ea(e))return{};if(Gn)return Gn(e);n.prototype=e;var r=new n;return n.prototype=t,r}}();function Xt(){}function Zt(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=t}function Wt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function Ft(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Ut(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function $t(n){var e=-1,t=null==n?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}function Gt(n){var e=-1,t=null==n?0:n.length;for(this.__data__=new $t;++e<t;)this.add(n[e])}function qt(n){var e=this.__data__=new Ut(n);this.size=e.size}function Kt(n,e){var t=Wu(n),r=!t&&Zu(n),o=!t&&!r&&Gu(n),i=!t&&!r&&!o&&sa(n),u=t||r||o||i,a=u?Ke(n.length,Pn):[],c=a.length;for(var l in n)!e&&!Tn.call(n,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||xi(l,c))||a.push(l);return a}function Qt(n){var e=n.length;return e?n[Gr(0,e-1)]:t}function Jt(n,e){return Ri(jo(n),cr(e,0,n.length))}function nr(n){return Ri(jo(n))}function er(n,e,r){(r!==t&&!Hu(n[e],r)||r===t&&!(e in n))&&ur(n,e,r)}function tr(n,e,r){var o=n[e];Tn.call(n,e)&&Hu(o,r)&&(r!==t||e in n)||ur(n,e,r)}function rr(n,e){for(var t=n.length;t--;)if(Hu(n[t][0],e))return t;return-1}function or(n,e,t,r){return hr(n,(function(n,o,i){e(r,n,t(n),i)})),r}function ir(n,e){return n&&Io(e,Ia(e),n)}function ur(n,e,t){"__proto__"==e&&oe?oe(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function ar(n,e){for(var r=-1,o=e.length,i=an(o),u=null==n;++r<o;)i[r]=u?t:Na(n,e[r]);return i}function cr(n,e,r){return n==n&&(r!==t&&(n=n<=r?n:r),e!==t&&(n=n>=e?n:e)),n}function lr(n,e,r,o,i,u){var a,c=1&e,l=2&e,s=4&e;if(r&&(a=i?r(n,o,i,u):r(n)),a!==t)return a;if(!ea(n))return n;var f=Wu(n);if(f){if(a=function(n){var e=n.length,t=new n.constructor(e);e&&"string"==typeof n[0]&&Tn.call(n,"index")&&(t.index=n.index,t.input=n.input);return t}(n),!c)return jo(n,a)}else{var d=gi(n),h=d==_||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,e){return Io(n,pi(n),e)}(n,function(n,e){return n&&Io(e,Aa(e),n)}(a,n)):function(n,e){return Io(n,vi(n),e)}(n,ir(a,n))}else{if(!le[d])return i?n:{};a=function(n,e,t){var r=n.constructor;switch(e){case A:return Co(n);case m:case x:return new r(+n);case z:return function(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}(n,t);case L:case R:case T:case D:case B:case V:case H:case Y:case X:return No(n,t);case S:return new r;case k:case P:return new r(n);case M:return function(n){var e=new n.constructor(n.source,pn.exec(n));return e.lastIndex=n.lastIndex,e}(n);case O:return new r;case j:return o=n,Bt?Mn(Bt.call(o)):{}}var o}(n,d,c)}}u||(u=new qt);var v=u.get(n);if(v)return v;u.set(n,a),aa(n)?n.forEach((function(t){a.add(lr(t,e,r,t,n,u))})):ra(n)&&n.forEach((function(t,o){a.set(o,lr(t,e,r,o,n,u))}));var p=f?t:(s?l?ui:ii:l?Aa:Ia)(n);return Oe(p||n,(function(t,o){p&&(t=n[o=t]),tr(a,o,lr(t,e,r,o,n,u))})),a}function sr(n,e,r){var o=r.length;if(null==n)return!o;for(n=Mn(n);o--;){var i=r[o],u=e[i],a=n[i];if(a===t&&!(i in n)||!u(a))return!1}return!0}function fr(n,e,o){if("function"!=typeof n)throw new jn(r);return Ii((function(){n.apply(t,o)}),e)}function dr(n,e,t,r){var o=-1,i=Ae,u=!0,a=n.length,c=[],l=e.length;if(!a)return c;t&&(e=Le(e,Je(t))),r?(i=ze,u=!1):e.length>=200&&(i=et,u=!1,e=new Gt(e));n:for(;++o<a;){var s=n[o],f=null==t?s:t(s);if(s=r||0!==s?s:0,u&&f==f){for(var d=l;d--;)if(e[d]===f)continue n;c.push(s)}else i(e,f,r)||c.push(s)}return c}Ht.templateSettings={escape:K,evaluate:Q,interpolate:J,variable:"",imports:{_:Ht}},Ht.prototype=Xt.prototype,Ht.prototype.constructor=Ht,Zt.prototype=Yt(Xt.prototype),Zt.prototype.constructor=Zt,Wt.prototype=Yt(Xt.prototype),Wt.prototype.constructor=Wt,Ft.prototype.clear=function(){this.__data__=Pt?Pt(null):{},this.size=0},Ft.prototype.delete=function(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e},Ft.prototype.get=function(n){var e=this.__data__;if(Pt){var r=e[n];return r===o?t:r}return Tn.call(e,n)?e[n]:t},Ft.prototype.has=function(n){var e=this.__data__;return Pt?e[n]!==t:Tn.call(e,n)},Ft.prototype.set=function(n,e){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Pt&&e===t?o:e,this},Ut.prototype.clear=function(){this.__data__=[],this.size=0},Ut.prototype.delete=function(n){var e=this.__data__,t=rr(e,n);return!(t<0)&&(t==e.length-1?e.pop():Kn.call(e,t,1),--this.size,!0)},Ut.prototype.get=function(n){var e=this.__data__,r=rr(e,n);return r<0?t:e[r][1]},Ut.prototype.has=function(n){return rr(this.__data__,n)>-1},Ut.prototype.set=function(n,e){var t=this.__data__,r=rr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this},$t.prototype.clear=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ct||Ut),string:new Ft}},$t.prototype.delete=function(n){var e=fi(this,n).delete(n);return this.size-=e?1:0,e},$t.prototype.get=function(n){return fi(this,n).get(n)},$t.prototype.has=function(n){return fi(this,n).has(n)},$t.prototype.set=function(n,e){var t=fi(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this},Gt.prototype.add=Gt.prototype.push=function(n){return this.__data__.set(n,o),this},Gt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.clear=function(){this.__data__=new Ut,this.size=0},qt.prototype.delete=function(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t},qt.prototype.get=function(n){return this.__data__.get(n)},qt.prototype.has=function(n){return this.__data__.has(n)},qt.prototype.set=function(n,e){var t=this.__data__;if(t instanceof Ut){var r=t.__data__;if(!Ct||r.length<199)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $t(r)}return t.set(n,e),this.size=t.size,this};var hr=Lo(br),vr=Lo(_r,!0);function pr(n,e){var t=!0;return hr(n,(function(n,r,o){return t=!!e(n,r,o)})),t}function gr(n,e,r){for(var o=-1,i=n.length;++o<i;){var u=n[o],a=e(u);if(null!=a&&(c===t?a==a&&!la(a):r(a,c)))var c=a,l=u}return l}function yr(n,e){var t=[];return hr(n,(function(n,r,o){e(n,r,o)&&t.push(n)})),t}function mr(n,e,t,r,o){var i=-1,u=n.length;for(t||(t=wi),o||(o=[]);++i<u;){var a=n[i];e>0&&t(a)?e>1?mr(a,e-1,t,r,o):Re(o,a):r||(o[o.length]=a)}return o}var wr=Ro(),xr=Ro(!0);function br(n,e){return n&&wr(n,e,Ia)}function _r(n,e){return n&&xr(n,e,Ia)}function Er(n,e){return Ie(e,(function(e){return Qu(n[e])}))}function Sr(n,e){for(var r=0,o=(e=bo(e,n)).length;null!=n&&r<o;)n=n[Di(e[r++])];return r&&r==o?n:t}function kr(n,e,t){var r=e(n);return Wu(n)?r:Re(r,t(n))}function Cr(n){return null==n?n===t?"[object Undefined]":"[object Null]":te&&te in Mn(n)?function(n){var e=Tn.call(n,te),r=n[te];try{n[te]=t;var o=!0}catch(n){}var i=Vn.call(n);o&&(e?n[te]=r:delete n[te]);return i}(n):function(n){return Vn.call(n)}(n)}function Nr(n,e){return n>e}function Mr(n,e){return null!=n&&Tn.call(n,e)}function Or(n,e){return null!=n&&e in Mn(n)}function Pr(n,e,r){for(var o=r?ze:Ae,i=n[0].length,u=n.length,a=u,c=an(u),l=1/0,s=[];a--;){var f=n[a];a&&e&&(f=Le(f,Je(e))),l=xt(f.length,l),c[a]=!r&&(e||i>=120&&f.length>=120)?new Gt(a&&f):t}f=n[0];var d=-1,h=c[0];n:for(;++d<i&&s.length<l;){var v=f[d],p=e?e(v):v;if(v=r||0!==v?v:0,!(h?et(h,p):o(s,p,r))){for(a=u;--a;){var g=c[a];if(!(g?et(g,p):o(n[a],p,r)))continue n}h&&h.push(p),s.push(v)}}return s}function jr(n,e,r){var o=null==(n=Oi(n,e=bo(e,n)))?n:n[Di(Ki(e))];return null==o?t:Ne(o,n,r)}function Ir(n){return ta(n)&&Cr(n)==g}function Ar(n,e,r,o,i){return n===e||(null==n||null==e||!ta(n)&&!ta(e)?n!=n&&e!=e:function(n,e,r,o,i,u){var a=Wu(n),c=Wu(e),l=a?y:gi(n),s=c?y:gi(e),f=(l=l==g?C:l)==C,d=(s=s==g?C:s)==C,h=l==s;if(h&&Gu(n)){if(!Gu(e))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new qt),a||sa(n)?ri(n,e,r,o,i,u):function(n,e,t,r,o,i,u){switch(t){case z:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case A:return!(n.byteLength!=e.byteLength||!i(new Fn(n),new Fn(e)));case m:case x:case k:return Hu(+n,+e);case b:return n.name==e.name&&n.message==e.message;case M:case P:return n==e+"";case S:var a=ct;case O:var c=1&r;if(a||(a=ft),n.size!=e.size&&!c)return!1;var l=u.get(n);if(l)return l==e;r|=2,u.set(n,e);var s=ri(a(n),a(e),r,o,i,u);return u.delete(n),s;case j:if(Bt)return Bt.call(n)==Bt.call(e)}return!1}(n,e,l,r,o,i,u);if(!(1&r)){var v=f&&Tn.call(n,"__wrapped__"),p=d&&Tn.call(e,"__wrapped__");if(v||p){var w=v?n.value():n,_=p?e.value():e;return u||(u=new qt),i(w,_,r,o,u)}}if(!h)return!1;return u||(u=new qt),function(n,e,r,o,i,u){var a=1&r,c=ii(n),l=c.length,s=ii(e),f=s.length;if(l!=f&&!a)return!1;var d=l;for(;d--;){var h=c[d];if(!(a?h in e:Tn.call(e,h)))return!1}var v=u.get(n),p=u.get(e);if(v&&p)return v==e&&p==n;var g=!0;u.set(n,e),u.set(e,n);var y=a;for(;++d<l;){var m=n[h=c[d]],w=e[h];if(o)var x=a?o(w,m,h,e,n,u):o(m,w,h,n,e,u);if(!(x===t?m===w||i(m,w,r,o,u):x)){g=!1;break}y||(y="constructor"==h)}if(g&&!y){var b=n.constructor,_=e.constructor;b==_||!("constructor"in n)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(g=!1)}return u.delete(n),u.delete(e),g}(n,e,r,o,i,u)}(n,e,r,o,Ar,i))}function zr(n,e,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===t&&!(l in n))return!1}else{var d=new qt;if(o)var h=o(s,f,l,n,e,d);if(!(h===t?Ar(f,s,3,o,d):h))return!1}}return!0}function Lr(n){return!(!ea(n)||(e=n,Bn&&Bn in e))&&(Qu(n)?Xn:mn).test(Bi(n));var e}function Rr(n){return"function"==typeof n?n:null==n?oc:"object"==typeof n?Wu(n)?Yr(n[0],n[1]):Hr(n):hc(n)}function Tr(n){if(!ki(n))return mt(n);var e=[];for(var t in Mn(n))Tn.call(n,t)&&"constructor"!=t&&e.push(t);return e}function Dr(n){if(!ea(n))return function(n){var e=[];if(null!=n)for(var t in Mn(n))e.push(t);return e}(n);var e=ki(n),t=[];for(var r in n)("constructor"!=r||!e&&Tn.call(n,r))&&t.push(r);return t}function Br(n,e){return n<e}function Vr(n,e){var t=-1,r=Uu(n)?an(n.length):[];return hr(n,(function(n,o,i){r[++t]=e(n,o,i)})),r}function Hr(n){var e=di(n);return 1==e.length&&e[0][2]?Ni(e[0][0],e[0][1]):function(t){return t===n||zr(t,n,e)}}function Yr(n,e){return _i(n)&&Ci(e)?Ni(Di(n),e):function(r){var o=Na(r,n);return o===t&&o===e?Ma(r,n):Ar(e,o,3)}}function Xr(n,e,r,o,i){n!==e&&wr(e,(function(u,a){if(i||(i=new qt),ea(u))!function(n,e,r,o,i,u,a){var c=Pi(n,r),l=Pi(e,r),s=a.get(l);if(s)return void er(n,r,s);var f=u?u(c,l,r+"",n,e,a):t,d=f===t;if(d){var h=Wu(l),v=!h&&Gu(l),p=!h&&!v&&sa(l);f=l,h||v||p?Wu(c)?f=c:$u(c)?f=jo(c):v?(d=!1,f=ko(l,!0)):p?(d=!1,f=No(l,!0)):f=[]:ia(l)||Zu(l)?(f=c,Zu(c)?f=ma(c):ea(c)&&!Qu(c)||(f=mi(l))):d=!1}d&&(a.set(l,f),i(f,l,o,u,a),a.delete(l));er(n,r,f)}(n,e,a,r,Xr,o,i);else{var c=o?o(Pi(n,a),u,a+"",n,e,i):t;c===t&&(c=u),er(n,a,c)}}),Aa)}function Zr(n,e){var r=n.length;if(r)return xi(e+=e<0?r:0,r)?n[e]:t}function Wr(n,e,t){e=e.length?Le(e,(function(n){return Wu(n)?function(e){return Sr(e,1===n.length?n[0]:n)}:n})):[oc];var r=-1;e=Le(e,Je(si()));var o=Vr(n,(function(n,t,o){var i=Le(e,(function(e){return e(n)}));return{criteria:i,index:++r,value:n}}));return function(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}(o,(function(n,e){return function(n,e,t){var r=-1,o=n.criteria,i=e.criteria,u=o.length,a=t.length;for(;++r<u;){var c=Mo(o[r],i[r]);if(c)return r>=a?c:c*("desc"==t[r]?-1:1)}return n.index-e.index}(n,e,t)}))}function Fr(n,e,t){for(var r=-1,o=e.length,i={};++r<o;){var u=e[r],a=Sr(n,u);t(a,u)&&no(i,bo(u,n),a)}return i}function Ur(n,e,t,r){var o=r?Ze:Xe,i=-1,u=e.length,a=n;for(n===e&&(e=jo(e)),t&&(a=Le(n,Je(t)));++i<u;)for(var c=0,l=e[i],s=t?t(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,e){for(var t=n?e.length:0,r=t-1;t--;){var o=e[t];if(t==r||o!==i){var i=o;xi(o)?Kn.call(n,o,1):ho(n,o)}}return n}function Gr(n,e){return n+ye(Et()*(e-n+1))}function qr(n,e){var t="";if(!n||e<1||e>d)return t;do{e%2&&(t+=n),(e=ye(e/2))&&(n+=n)}while(e);return t}function Kr(n,e){return Ai(Mi(n,e,oc),n+"")}function Qr(n){return Qt(Ha(n))}function Jr(n,e){var t=Ha(n);return Ri(t,cr(e,0,t.length))}function no(n,e,r,o){if(!ea(n))return n;for(var i=-1,u=(e=bo(e,n)).length,a=u-1,c=n;null!=c&&++i<u;){var l=Di(e[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):t)===t&&(s=ea(f)?f:xi(e[i+1])?[]:{})}tr(c,l,s),c=c[l]}return n}var eo=jt?function(n,e){return jt.set(n,e),n}:oc,to=oe?function(n,e){return oe(n,"toString",{configurable:!0,enumerable:!1,value:ec(e),writable:!0})}:oc;function ro(n){return Ri(Ha(n))}function oo(n,e,t){var r=-1,o=n.length;e<0&&(e=-e>o?0:o+e),(t=t>o?o:t)<0&&(t+=o),o=e>t?0:t-e>>>0,e>>>=0;for(var i=an(o);++r<o;)i[r]=n[r+e];return i}function io(n,e){var t;return hr(n,(function(n,r,o){return!(t=e(n,r,o))})),!!t}function uo(n,e,t){var r=0,o=null==n?r:n.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=n[i];null!==u&&!la(u)&&(t?u<=e:u<e)?r=i+1:o=i}return o}return ao(n,e,oc,t)}function ao(n,e,r,o){var i=0,u=null==n?0:n.length;if(0===u)return 0;for(var a=(e=r(e))!=e,c=null===e,l=la(e),s=e===t;i<u;){var f=ye((i+u)/2),d=r(n[f]),h=d!==t,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<=e:d<e);y?i=f+1:u=f}return xt(u,4294967294)}function co(n,e){for(var t=-1,r=n.length,o=0,i=[];++t<r;){var u=n[t],a=e?e(u):u;if(!t||!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(Wu(n))return Le(n,so)+"";if(la(n))return Vt?Vt.call(n):"";var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function fo(n,e,t){var r=-1,o=Ae,i=n.length,u=!0,a=[],c=a;if(t)u=!1,o=ze;else if(i>=200){var l=e?null:Ko(n);if(l)return ft(l);u=!1,o=et,c=new Gt}else c=e?[]:a;n:for(;++r<i;){var s=n[r],f=e?e(s):s;if(s=t||0!==s?s:0,u&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue n;e&&c.push(f),a.push(s)}else o(c,f,t)||(c!==a&&c.push(f),a.push(s))}return a}function ho(n,e){return null==(n=Oi(n,e=bo(e,n)))||delete n[Di(Ki(e))]}function vo(n,e,t,r){return no(n,e,t(Sr(n,e)),r)}function po(n,e,t,r){for(var o=n.length,i=r?o:-1;(r?i--:++i<o)&&e(n[i],i,n););return t?oo(n,r?0:i,r?i+1:o):oo(n,r?i+1:0,r?o:i)}function go(n,e){var t=n;return t instanceof Wt&&(t=t.value()),Te(e,(function(n,e){return e.func.apply(e.thisArg,Re([n],e.args))}),t)}function yo(n,e,t){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],e,t));return fo(mr(i,1),e,t)}function mo(n,e,r){for(var o=-1,i=n.length,u=e.length,a={};++o<i;){var c=o<u?e[o]:t;r(a,n[o],c)}return a}function wo(n){return $u(n)?n:[]}function xo(n){return"function"==typeof n?n:oc}function bo(n,e){return Wu(n)?n:_i(n,e)?[n]:Ti(wa(n))}var _o=Kr;function Eo(n,e,r){var o=n.length;return r=r===t?o:r,!e&&r>=o?n:oo(n,e,r)}var So=se||function(n){return pe.clearTimeout(n)};function ko(n,e){if(e)return n.slice();var t=n.length,r=Un?Un(t):new n.constructor(t);return n.copy(r),r}function Co(n){var e=new n.constructor(n.byteLength);return new Fn(e).set(new Fn(n)),e}function No(n,e){var t=e?Co(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function Mo(n,e){if(n!==e){var r=n!==t,o=null===n,i=n==n,u=la(n),a=e!==t,c=null===e,l=e==e,s=la(e);if(!c&&!s&&!u&&n>e||u&&a&&l&&!c&&!s||o&&a&&l||!r&&l||!i)return 1;if(!o&&!u&&!s&&n<e||s&&r&&i&&!o&&!u||c&&r&&i||!a&&i||!l)return-1}return 0}function Oo(n,e,t,r){for(var o=-1,i=n.length,u=t.length,a=-1,c=e.length,l=wt(i-u,0),s=an(c+l),f=!r;++a<c;)s[a]=e[a];for(;++o<u;)(f||o<i)&&(s[t[o]]=n[o]);for(;l--;)s[a++]=n[o++];return s}function Po(n,e,t,r){for(var o=-1,i=n.length,u=-1,a=t.length,c=-1,l=e.length,s=wt(i-a,0),f=an(s+l),d=!r;++o<s;)f[o]=n[o];for(var h=o;++c<l;)f[h+c]=e[c];for(;++u<a;)(d||o<i)&&(f[h+t[u]]=n[o++]);return f}function jo(n,e){var t=-1,r=n.length;for(e||(e=an(r));++t<r;)e[t]=n[t];return e}function Io(n,e,r,o){var i=!r;r||(r={});for(var u=-1,a=e.length;++u<a;){var c=e[u],l=o?o(r[c],n[c],c,r,n):t;l===t&&(l=n[c]),i?ur(r,c,l):tr(r,c,l)}return r}function Ao(n,e){return function(t,r){var o=Wu(t)?Me:or,i=e?e():{};return o(t,n,si(r,2),i)}}function zo(n){return Kr((function(e,r){var o=-1,i=r.length,u=i>1?r[i-1]:t,a=i>2?r[2]:t;for(u=n.length>3&&"function"==typeof u?(i--,u):t,a&&bi(r[0],r[1],a)&&(u=i<3?t:u,i=1),e=Mn(e);++o<i;){var c=r[o];c&&n(e,c,o,u)}return e}))}function Lo(n,e){return function(t,r){if(null==t)return t;if(!Uu(t))return n(t,r);for(var o=t.length,i=e?o:-1,u=Mn(t);(e?i--:++i<o)&&!1!==r(u[i],i,u););return t}}function Ro(n){return function(e,t,r){for(var o=-1,i=Mn(e),u=r(e),a=u.length;a--;){var c=u[n?a:++o];if(!1===t(i[c],c,i))break}return e}}function To(n){return function(e){var r=at(e=wa(e))?vt(e):t,o=r?r[0]:e.charAt(0),i=r?Eo(r,1).join(""):e.slice(1);return o[n]()+i}}function Do(n){return function(e){return Te(Qa(Za(e).replace(ne,"")),n,"")}}function Bo(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Yt(n.prototype),r=n.apply(t,e);return ea(r)?r:t}}function Vo(n){return function(e,r,o){var i=Mn(e);if(!Uu(e)){var u=si(r,3);e=Ia(e),r=function(n){return u(i[n],n,i)}}var a=n(e,r,o);return a>-1?i[u?e[a]:a]:t}}function Ho(n){return oi((function(e){var o=e.length,i=o,u=Zt.prototype.thru;for(n&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new jn(r);if(u&&!c&&"wrapper"==ci(a))var c=new Zt([],!0)}for(i=c?i:o;++i<o;){var l=ci(a=e[i]),s="wrapper"==l?ai(a):t;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,t=n[0];if(c&&1==n.length&&Wu(t))return c.plant(t).value();for(var r=0,i=o?e[r].apply(this,n):t;++r<o;)i=e[r].call(this,i);return i}}))}function Yo(n,e,r,o,i,u,a,c,s,f){var d=e&l,h=1&e,v=2&e,p=24&e,g=512&e,y=v?t:Bo(n);return function l(){for(var m=arguments.length,w=an(m),x=m;x--;)w[x]=arguments[x];if(p)var b=li(l),_=function(n,e){for(var t=n.length,r=0;t--;)n[t]===e&&++r;return r}(w,b);if(o&&(w=Oo(w,o,i,p)),u&&(w=Po(w,u,a,p)),m-=_,p&&m<f){var E=st(w,b);return Go(n,e,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,e){var r=n.length,o=xt(e.length,r),i=jo(n);for(;o--;){var u=e[o];n[o]=xi(u,r)?i[u]:t}return n}(w,c):g&&m>1&&w.reverse(),d&&s<m&&(w.length=s),this&&this!==pe&&this instanceof l&&(k=y||Bo(k)),k.apply(S,w)}}function Xo(n,e){return function(t,r){return function(n,e,t,r){return br(n,(function(n,o,i){e(r,t(n),o,i)})),r}(t,n,e(r),{})}}function Zo(n,e){return function(r,o){var i;if(r===t&&o===t)return e;if(r!==t&&(i=r),o!==t){if(i===t)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 Wo(n){return oi((function(e){return e=Le(e,Je(si())),Kr((function(t){var r=this;return n(e,(function(n){return Ne(n,r,t)}))}))}))}function Fo(n,e){var r=(e=e===t?" ":so(e)).length;if(r<2)return r?qr(e,n):e;var o=qr(e,ge(n/ht(e)));return at(e)?Eo(vt(o),0,n).join(""):o.slice(0,n)}function Uo(n){return function(e,r,o){return o&&"number"!=typeof o&&bi(e,r,o)&&(r=o=t),e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t,r){for(var o=-1,i=wt(ge((e-n)/(t||1)),0),u=an(i);i--;)u[r?i:++o]=n,n+=t;return u}(e,r,o=o===t?e<r?1:-1:va(o),n)}}function $o(n){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=ya(e),t=ya(t)),n(e,t)}}function Go(n,e,r,o,i,u,l,s,f,d){var h=8&e;e|=h?a:c,4&(e&=~(h?c:a))||(e&=-4);var v=[n,e,i,h?u:t,h?l:t,h?t:u,h?t:l,s,f,d],p=r.apply(t,v);return Ei(n)&&ji(p,v),p.placeholder=o,zi(p,n,e)}function qo(n){var e=Nn[n];return function(n,t){if(n=ya(n),(t=null==t?0:xt(pa(t),292))&&Ve(n)){var r=(wa(n)+"e").split("e");return+((r=(wa(e(r[0]+"e"+(+r[1]+t)))+"e").split("e"))[0]+"e"+(+r[1]-t))}return e(n)}}var Ko=Mt&&1/ft(new Mt([,-0]))[1]==f?function(n){return new Mt(n)}:lc;function Qo(n){return function(e){var t=gi(e);return t==S?ct(e):t==O?dt(e):function(n,e){return Le(e,(function(e){return[e,n[e]]}))}(e,n(e))}}function Jo(n,e,o,f,d,h,v,p){var g=2&e;if(!g&&"function"!=typeof n)throw new jn(r);var y=f?f.length:0;if(y||(e&=-97,f=d=t),v=v===t?v:wt(pa(v),0),p=p===t?p:pa(p),y-=d?d.length:0,e&c){var m=f,w=d;f=d=t}var x=g?t:ai(n),b=[n,e,o,f,d,m,w,h,v,p];if(x&&function(n,e){var t=n[1],r=e[1],o=t|r,u=o<131,a=r==l&&8==t||r==l&&t==s&&n[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==t;if(!u&&!a)return n;1&r&&(n[2]=e[2],o|=1&t?0:4);var c=e[3];if(c){var f=n[3];n[3]=f?Oo(f,c,e[4]):c,n[4]=f?st(n[3],i):e[4]}(c=e[5])&&(f=n[5],n[5]=f?Po(f,c,e[6]):c,n[6]=f?st(n[5],i):e[6]);(c=e[7])&&(n[7]=c);r&l&&(n[8]=null==n[8]?e[8]:xt(n[8],e[8]));null==n[9]&&(n[9]=e[9]);n[0]=e[0],n[1]=o}(b,x),n=b[0],e=b[1],o=b[2],f=b[3],d=b[4],!(p=b[9]=b[9]===t?g?0:n.length:wt(b[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)_=8==e||e==u?function(n,e,r){var o=Bo(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?[]:st(a,l);return(u-=s.length)<r?Go(n,e,Yo,i.placeholder,t,a,s,t,t,r-u):Ne(this&&this!==pe&&this instanceof i?o:n,this,a)}}(n,e,p):e!=a&&33!=e||d.length?Yo.apply(t,b):function(n,e,t,r){var o=1&e,i=Bo(n);return function e(){for(var u=-1,a=arguments.length,c=-1,l=r.length,s=an(l+a),f=this&&this!==pe&&this instanceof e?i:n;++c<l;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Ne(f,o?t:this,s)}}(n,e,o,f);else var _=function(n,e,t){var r=1&e,o=Bo(n);return function e(){return(this&&this!==pe&&this instanceof e?o:n).apply(r?t:this,arguments)}}(n,e,o);return zi((x?eo:ji)(_,b),n,e)}function ni(n,e,r,o){return n===t||Hu(n,zn[r])&&!Tn.call(o,r)?e:n}function ei(n,e,r,o,i,u){return ea(n)&&ea(e)&&(u.set(e,n),Xr(n,e,t,ei,u),u.delete(e)),n}function ti(n){return ia(n)?t:n}function ri(n,e,r,o,i,u){var a=1&r,c=n.length,l=e.length;if(c!=l&&!(a&&l>c))return!1;var s=u.get(n),f=u.get(e);if(s&&f)return s==e&&f==n;var d=-1,h=!0,v=2&r?new Gt:t;for(u.set(n,e),u.set(e,n);++d<c;){var p=n[d],g=e[d];if(o)var y=a?o(g,p,d,e,n,u):o(p,g,d,n,e,u);if(y!==t){if(y)continue;h=!1;break}if(v){if(!Be(e,(function(n,e){if(!et(v,e)&&(p===n||i(p,n,r,o,u)))return v.push(e)}))){h=!1;break}}else if(p!==g&&!i(p,g,r,o,u)){h=!1;break}}return u.delete(n),u.delete(e),h}function oi(n){return Ai(Mi(n,t,Fi),n+"")}function ii(n){return kr(n,Ia,vi)}function ui(n){return kr(n,Aa,pi)}var ai=jt?function(n){return jt.get(n)}:lc;function ci(n){for(var e=n.name+"",t=It[e],r=Tn.call(It,e)?t.length:0;r--;){var o=t[r],i=o.func;if(null==i||i==n)return o.name}return e}function li(n){return(Tn.call(Ht,"placeholder")?Ht:n).placeholder}function si(){var n=Ht.iteratee||ic;return n=n===ic?Rr:n,arguments.length?n(arguments[0],arguments[1]):n}function fi(n,e){var t,r,o=n.__data__;return("string"==(r=typeof(t=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t)?o["string"==typeof e?"string":"hash"]:o.map}function di(n){for(var e=Ia(n),t=e.length;t--;){var r=e[t],o=n[r];e[t]=[r,o,Ci(o)]}return e}function hi(n,e){var r=function(n,e){return null==n?t:n[e]}(n,e);return Lr(r)?r:t}var vi=we?function(n){return null==n?[]:(n=Mn(n),Ie(we(n),(function(e){return qn.call(n,e)})))}:gc,pi=we?function(n){for(var e=[];n;)Re(e,vi(n)),n=$n(n);return e}:gc,gi=Cr;function yi(n,e,t){for(var r=-1,o=(e=bo(e,n)).length,i=!1;++r<o;){var u=Di(e[r]);if(!(i=null!=n&&t(n,u)))break;n=n[u]}return i||++r!=o?i:!!(o=null==n?0:n.length)&&na(o)&&xi(u,o)&&(Wu(n)||Zu(n))}function mi(n){return"function"!=typeof n.constructor||ki(n)?{}:Yt($n(n))}function wi(n){return Wu(n)||Zu(n)||!!(Qn&&n&&n[Qn])}function xi(n,e){var t=typeof n;return!!(e=null==e?d:e)&&("number"==t||"symbol"!=t&&xn.test(n))&&n>-1&&n%1==0&&n<e}function bi(n,e,t){if(!ea(t))return!1;var r=typeof e;return!!("number"==r?Uu(t)&&xi(e,t.length):"string"==r&&e in t)&&Hu(t[e],n)}function _i(n,e){if(Wu(n))return!1;var t=typeof n;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=n&&!la(n))||(en.test(n)||!nn.test(n)||null!=e&&n in Mn(e))}function Ei(n){var e=ci(n),t=Ht[e];if("function"!=typeof t||!(e in Wt.prototype))return!1;if(n===t)return!0;var r=ai(t);return!!r&&n===r[0]}(kt&&gi(new kt(new ArrayBuffer(1)))!=z||Ct&&gi(new Ct)!=S||Nt&&gi(Nt.resolve())!=N||Mt&&gi(new Mt)!=O||Ot&&gi(new Ot)!=I)&&(gi=function(n){var e=Cr(n),r=e==C?n.constructor:t,o=r?Bi(r):"";if(o)switch(o){case At:return z;case zt:return S;case Lt:return N;case Rt:return O;case Tt:return I}return e});var Si=Ln?Qu:yc;function ki(n){var e=n&&n.constructor;return n===("function"==typeof e&&e.prototype||zn)}function Ci(n){return n==n&&!ea(n)}function Ni(n,e){return function(r){return null!=r&&(r[n]===e&&(e!==t||n in Mn(r)))}}function Mi(n,e,r){return e=wt(e===t?n.length-1:e,0),function(){for(var t=arguments,o=-1,i=wt(t.length-e,0),u=an(i);++o<i;)u[o]=t[e+o];o=-1;for(var a=an(e+1);++o<e;)a[o]=t[o];return a[e]=r(u),Ne(n,this,a)}}function Oi(n,e){return e.length<2?n:Sr(n,oo(e,0,-1))}function Pi(n,e){if(("constructor"!==e||"function"!=typeof n[e])&&"__proto__"!=e)return n[e]}var ji=Li(eo),Ii=ve||function(n,e){return pe.setTimeout(n,e)},Ai=Li(to);function zi(n,e,t){var r=e+"";return Ai(n,function(n,e){var t=e.length;if(!t)return n;var r=t-1;return e[r]=(t>1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(cn,"{\n/* [wrapped with "+e+"] */\n")}(r,function(n,e){return Oe(p,(function(t){var r="_."+t[0];e&t[1]&&!Ae(n,r)&&n.push(r)})),n.sort()}(function(n){var e=n.match(ln);return e?e[1].split(sn):[]}(r),t)))}function Li(n){var e=0,r=0;return function(){var o=bt(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return n.apply(t,arguments)}}function Ri(n,e){var r=-1,o=n.length,i=o-1;for(e=e===t?o:e;++r<e;){var u=Gr(r,i),a=n[u];n[u]=n[r],n[r]=a}return n.length=e,n}var Ti=function(n){var e=Lu(n,(function(n){return 500===t.size&&t.clear(),n})),t=e.cache;return e}((function(n){var e=[];return 46===n.charCodeAt(0)&&e.push(""),n.replace(tn,(function(n,t,r,o){e.push(r?o.replace(hn,"$1"):t||n)})),e}));function Di(n){if("string"==typeof n||la(n))return n;var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}function Bi(n){if(null!=n){try{return Rn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Vi(n){if(n instanceof Wt)return n.clone();var e=new Zt(n.__wrapped__,n.__chain__);return e.__actions__=jo(n.__actions__),e.__index__=n.__index__,e.__values__=n.__values__,e}var Hi=Kr((function(n,e){return $u(n)?dr(n,mr(e,1,$u,!0)):[]})),Yi=Kr((function(n,e){var r=Ki(e);return $u(r)&&(r=t),$u(n)?dr(n,mr(e,1,$u,!0),si(r,2)):[]})),Xi=Kr((function(n,e){var r=Ki(e);return $u(r)&&(r=t),$u(n)?dr(n,mr(e,1,$u,!0),t,r):[]}));function Zi(n,e,t){var r=null==n?0:n.length;if(!r)return-1;var o=null==t?0:pa(t);return o<0&&(o=wt(r+o,0)),Ye(n,si(e,3),o)}function Wi(n,e,r){var o=null==n?0:n.length;if(!o)return-1;var i=o-1;return r!==t&&(i=pa(r),i=r<0?wt(o+i,0):xt(i,o-1)),Ye(n,si(e,3),i,!0)}function Fi(n){return(null==n?0:n.length)?mr(n,1):[]}function Ui(n){return n&&n.length?n[0]:t}var $i=Kr((function(n){var e=Le(n,wo);return e.length&&e[0]===n[0]?Pr(e):[]})),Gi=Kr((function(n){var e=Ki(n),r=Le(n,wo);return e===Ki(r)?e=t:r.pop(),r.length&&r[0]===n[0]?Pr(r,si(e,2)):[]})),qi=Kr((function(n){var e=Ki(n),r=Le(n,wo);return(e="function"==typeof e?e:t)&&r.pop(),r.length&&r[0]===n[0]?Pr(r,t,e):[]}));function Ki(n){var e=null==n?0:n.length;return e?n[e-1]:t}var Qi=Kr(Ji);function Ji(n,e){return n&&n.length&&e&&e.length?Ur(n,e):n}var nu=oi((function(n,e){var t=null==n?0:n.length,r=ar(n,e);return $r(n,Le(e,(function(n){return xi(n,t)?+n:n})).sort(Mo)),r}));function eu(n){return null==n?n:St.call(n)}var tu=Kr((function(n){return fo(mr(n,1,$u,!0))})),ru=Kr((function(n){var e=Ki(n);return $u(e)&&(e=t),fo(mr(n,1,$u,!0),si(e,2))})),ou=Kr((function(n){var e=Ki(n);return e="function"==typeof e?e:t,fo(mr(n,1,$u,!0),t,e)}));function iu(n){if(!n||!n.length)return[];var e=0;return n=Ie(n,(function(n){if($u(n))return e=wt(n.length,e),!0})),Ke(e,(function(e){return Le(n,Ue(e))}))}function uu(n,e){if(!n||!n.length)return[];var r=iu(n);return null==e?r:Le(r,(function(n){return Ne(e,t,n)}))}var au=Kr((function(n,e){return $u(n)?dr(n,e):[]})),cu=Kr((function(n){return yo(Ie(n,$u))})),lu=Kr((function(n){var e=Ki(n);return $u(e)&&(e=t),yo(Ie(n,$u),si(e,2))})),su=Kr((function(n){var e=Ki(n);return e="function"==typeof e?e:t,yo(Ie(n,$u),t,e)})),fu=Kr(iu);var du=Kr((function(n){var e=n.length,r=e>1?n[e-1]:t;return r="function"==typeof r?(n.pop(),r):t,uu(n,r)}));function hu(n){var e=Ht(n);return e.__chain__=!0,e}function vu(n,e){return e(n)}var pu=oi((function(n){var e=n.length,r=e?n[0]:0,o=this.__wrapped__,i=function(e){return ar(e,n)};return!(e>1||this.__actions__.length)&&o instanceof Wt&&xi(r)?((o=o.slice(r,+r+(e?1:0))).__actions__.push({func:vu,args:[i],thisArg:t}),new Zt(o,this.__chain__).thru((function(n){return e&&!n.length&&n.push(t),n}))):this.thru(i)}));var gu=Ao((function(n,e,t){Tn.call(n,t)?++n[t]:ur(n,t,1)}));var yu=Vo(Zi),mu=Vo(Wi);function wu(n,e){return(Wu(n)?Oe:hr)(n,si(e,3))}function xu(n,e){return(Wu(n)?Pe:vr)(n,si(e,3))}var bu=Ao((function(n,e,t){Tn.call(n,t)?n[t].push(e):ur(n,t,[e])}));var _u=Kr((function(n,e,t){var r=-1,o="function"==typeof e,i=Uu(n)?an(n.length):[];return hr(n,(function(n){i[++r]=o?Ne(e,n,t):jr(n,e,t)})),i})),Eu=Ao((function(n,e,t){ur(n,t,e)}));function Su(n,e){return(Wu(n)?Le:Vr)(n,si(e,3))}var ku=Ao((function(n,e,t){n[t?0:1].push(e)}),(function(){return[[],[]]}));var Cu=Kr((function(n,e){if(null==n)return[];var t=e.length;return t>1&&bi(n,e[0],e[1])?e=[]:t>2&&bi(e[0],e[1],e[2])&&(e=[e[0]]),Wr(n,mr(e,1),[])})),Nu=he||function(){return pe.Date.now()};function Mu(n,e,r){return e=r?t:e,e=n&&null==e?n.length:e,Jo(n,l,t,t,t,t,e)}function Ou(n,e){var o;if("function"!=typeof e)throw new jn(r);return n=pa(n),function(){return--n>0&&(o=e.apply(this,arguments)),n<=1&&(e=t),o}}var Pu=Kr((function(n,e,t){var r=1;if(t.length){var o=st(t,li(Pu));r|=a}return Jo(n,r,e,t,o)})),ju=Kr((function(n,e,t){var r=3;if(t.length){var o=st(t,li(ju));r|=a}return Jo(e,r,n,t,o)}));function Iu(n,e,o){var i,u,a,c,l,s,f=0,d=!1,h=!1,v=!0;if("function"!=typeof n)throw new jn(r);function p(e){var r=i,o=u;return i=u=t,f=e,c=n.apply(o,r)}function g(n){var r=n-s;return s===t||r>=e||r<0||h&&n-f>=a}function y(){var n=Nu();if(g(n))return m(n);l=Ii(y,function(n){var t=e-(n-s);return h?xt(t,a-(n-f)):t}(n))}function m(n){return l=t,v&&i?p(n):(i=u=t,c)}function w(){var n=Nu(),r=g(n);if(i=arguments,u=this,s=n,r){if(l===t)return function(n){return f=n,l=Ii(y,e),d?p(n):c}(s);if(h)return So(l),l=Ii(y,e),p(s)}return l===t&&(l=Ii(y,e)),c}return e=ya(e)||0,ea(o)&&(d=!!o.leading,a=(h="maxWait"in o)?wt(ya(o.maxWait)||0,e):a,v="trailing"in o?!!o.trailing:v),w.cancel=function(){l!==t&&So(l),f=0,i=s=u=l=t},w.flush=function(){return l===t?c:m(Nu())},w}var Au=Kr((function(n,e){return fr(n,1,e)})),zu=Kr((function(n,e,t){return fr(n,ya(e)||0,t)}));function Lu(n,e){if("function"!=typeof n||null!=e&&"function"!=typeof e)throw new jn(r);var t=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=t.cache;if(i.has(o))return i.get(o);var u=n.apply(this,r);return t.cache=i.set(o,u)||i,u};return t.cache=new(Lu.Cache||$t),t}function Ru(n){if("function"!=typeof n)throw new jn(r);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}Lu.Cache=$t;var Tu=_o((function(n,e){var t=(e=1==e.length&&Wu(e[0])?Le(e[0],Je(si())):Le(mr(e,1),Je(si()))).length;return Kr((function(r){for(var o=-1,i=xt(r.length,t);++o<i;)r[o]=e[o].call(this,r[o]);return Ne(n,this,r)}))})),Du=Kr((function(n,e){var r=st(e,li(Du));return Jo(n,a,t,e,r)})),Bu=Kr((function(n,e){var r=st(e,li(Bu));return Jo(n,c,t,e,r)})),Vu=oi((function(n,e){return Jo(n,s,t,t,t,e)}));function Hu(n,e){return n===e||n!=n&&e!=e}var Yu=$o(Nr),Xu=$o((function(n,e){return n>=e})),Zu=Ir(function(){return arguments}())?Ir:function(n){return ta(n)&&Tn.call(n,"callee")&&!qn.call(n,"callee")},Wu=an.isArray,Fu=be?Je(be):function(n){return ta(n)&&Cr(n)==A};function Uu(n){return null!=n&&na(n.length)&&!Qu(n)}function $u(n){return ta(n)&&Uu(n)}var Gu=xe||yc,qu=_e?Je(_e):function(n){return ta(n)&&Cr(n)==x};function Ku(n){if(!ta(n))return!1;var e=Cr(n);return e==b||"[object DOMException]"==e||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qu(n){if(!ea(n))return!1;var e=Cr(n);return e==_||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}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 ea(n){var e=typeof n;return null!=n&&("object"==e||"function"==e)}function ta(n){return null!=n&&"object"==typeof n}var ra=Ee?Je(Ee):function(n){return ta(n)&&gi(n)==S};function oa(n){return"number"==typeof n||ta(n)&&Cr(n)==k}function ia(n){if(!ta(n)||Cr(n)!=C)return!1;var e=$n(n);if(null===e)return!0;var t=Tn.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&Rn.call(t)==Hn}var ua=Se?Je(Se):function(n){return ta(n)&&Cr(n)==M};var aa=ke?Je(ke):function(n){return ta(n)&&gi(n)==O};function ca(n){return"string"==typeof n||!Wu(n)&&ta(n)&&Cr(n)==P}function la(n){return"symbol"==typeof n||ta(n)&&Cr(n)==j}var sa=Ce?Je(Ce):function(n){return ta(n)&&na(n.length)&&!!ce[Cr(n)]};var fa=$o(Br),da=$o((function(n,e){return n<=e}));function ha(n){if(!n)return[];if(Uu(n))return ca(n)?vt(n):jo(n);if(Jn&&n[Jn])return function(n){for(var e,t=[];!(e=n.next()).done;)t.push(e.value);return t}(n[Jn]());var e=gi(n);return(e==S?ct:e==O?ft: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 e=va(n),t=e%1;return e==e?t?e-t:e: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(ea(n)){var e="function"==typeof n.valueOf?n.valueOf():n;n=ea(e)?e+"":e}if("string"!=typeof n)return 0===n?n:+n;n=Qe(n);var t=yn.test(n);return t||wn.test(n)?de(n.slice(2),t?2:8):gn.test(n)?h:+n}function ma(n){return Io(n,Aa(n))}function wa(n){return null==n?"":so(n)}var xa=zo((function(n,e){if(ki(e)||Uu(e))Io(e,Ia(e),n);else for(var t in e)Tn.call(e,t)&&tr(n,t,e[t])})),ba=zo((function(n,e){Io(e,Aa(e),n)})),_a=zo((function(n,e,t,r){Io(e,Aa(e),n,r)})),Ea=zo((function(n,e,t,r){Io(e,Ia(e),n,r)})),Sa=oi(ar);var ka=Kr((function(n,e){n=Mn(n);var r=-1,o=e.length,i=o>2?e[2]:t;for(i&&bi(e[0],e[1],i)&&(o=1);++r<o;)for(var u=e[r],a=Aa(u),c=-1,l=a.length;++c<l;){var s=a[c],f=n[s];(f===t||Hu(f,zn[s])&&!Tn.call(n,s))&&(n[s]=u[s])}return n})),Ca=Kr((function(n){return n.push(t,ei),Ne(La,t,n)}));function Na(n,e,r){var o=null==n?t:Sr(n,e);return o===t?r:o}function Ma(n,e){return null!=n&&yi(n,e,Or)}var Oa=Xo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),n[e]=t}),ec(oc)),Pa=Xo((function(n,e,t){null!=e&&"function"!=typeof e.toString&&(e=Vn.call(e)),Tn.call(n,e)?n[e].push(t):n[e]=[t]}),si),ja=Kr(jr);function Ia(n){return Uu(n)?Kt(n):Tr(n)}function Aa(n){return Uu(n)?Kt(n,!0):Dr(n)}var za=zo((function(n,e,t){Xr(n,e,t)})),La=zo((function(n,e,t,r){Xr(n,e,t,r)})),Ra=oi((function(n,e){var t={};if(null==n)return t;var r=!1;e=Le(e,(function(e){return e=bo(e,n),r||(r=e.length>1),e})),Io(n,ui(n),t),r&&(t=lr(t,7,ti));for(var o=e.length;o--;)ho(t,e[o]);return t}));var Ta=oi((function(n,e){return null==n?{}:function(n,e){return Fr(n,e,(function(e,t){return Ma(n,t)}))}(n,e)}));function Da(n,e){if(null==n)return{};var t=Le(ui(n),(function(n){return[n]}));return e=si(e),Fr(n,t,(function(n,t){return e(n,t[0])}))}var Ba=Qo(Ia),Va=Qo(Aa);function Ha(n){return null==n?[]:nt(n,Ia(n))}var Ya=Do((function(n,e,t){return e=e.toLowerCase(),n+(t?Xa(e):e)}));function Xa(n){return Ka(wa(n).toLowerCase())}function Za(n){return(n=wa(n))&&n.replace(bn,ot).replace(ee,"")}var Wa=Do((function(n,e,t){return n+(t?"-":"")+e.toLowerCase()})),Fa=Do((function(n,e,t){return n+(t?" ":"")+e.toLowerCase()})),Ua=To("toLowerCase");var $a=Do((function(n,e,t){return n+(t?"_":"")+e.toLowerCase()}));var Ga=Do((function(n,e,t){return n+(t?" ":"")+Ka(e)}));var qa=Do((function(n,e,t){return n+(t?" ":"")+e.toUpperCase()})),Ka=To("toUpperCase");function Qa(n,e,r){return n=wa(n),(e=r?t:e)===t?function(n){return ie.test(n)}(n)?function(n){return n.match(re)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(e)||[]}var Ja=Kr((function(n,e){try{return Ne(n,t,e)}catch(n){return Ku(n)?n:new kn(n)}})),nc=oi((function(n,e){return Oe(e,(function(e){e=Di(e),ur(n,e,Pu(n[e],n))})),n}));function ec(n){return function(){return n}}var tc=Ho(),rc=Ho(!0);function oc(n){return n}function ic(n){return Rr("function"==typeof n?n:lr(n,1))}var uc=Kr((function(n,e){return function(t){return jr(t,n,e)}})),ac=Kr((function(n,e){return function(t){return jr(n,t,e)}}));function cc(n,e,t){var r=Ia(e),o=Er(e,r);null!=t||ea(e)&&(o.length||!r.length)||(t=e,e=n,n=this,o=Er(e,Ia(e)));var i=!(ea(t)&&"chain"in t&&!t.chain),u=Qu(n);return Oe(o,(function(t){var r=e[t];n[t]=r,u&&(n.prototype[t]=function(){var e=this.__chain__;if(i||e){var t=n(this.__wrapped__);return(t.__actions__=jo(this.__actions__)).push({func:r,args:arguments,thisArg:n}),t.__chain__=e,t}return r.apply(n,Re([this.value()],arguments))})})),n}function lc(){}var sc=Wo(Le),fc=Wo(je),dc=Wo(Be);function hc(n){return _i(n)?Ue(Di(n)):function(n){return function(e){return Sr(e,n)}}(n)}var vc=Uo(),pc=Uo(!0);function gc(){return[]}function yc(){return!1}var mc=Zo((function(n,e){return n+e}),0),wc=qo("ceil"),xc=Zo((function(n,e){return n/e}),1),bc=qo("floor");var _c,Ec=Zo((function(n,e){return n*e}),1),Sc=qo("round"),kc=Zo((function(n,e){return n-e}),0);return Ht.after=function(n,e){if("function"!=typeof e)throw new jn(r);return n=pa(n),function(){if(--n<1)return e.apply(this,arguments)}},Ht.ary=Mu,Ht.assign=xa,Ht.assignIn=ba,Ht.assignInWith=_a,Ht.assignWith=Ea,Ht.at=Sa,Ht.before=Ou,Ht.bind=Pu,Ht.bindAll=nc,Ht.bindKey=ju,Ht.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Wu(n)?n:[n]},Ht.chain=hu,Ht.chunk=function(n,e,r){e=(r?bi(n,e,r):e===t)?1:wt(pa(e),0);var o=null==n?0:n.length;if(!o||e<1)return[];for(var i=0,u=0,a=an(ge(o/e));i<o;)a[u++]=oo(n,i,i+=e);return a},Ht.compact=function(n){for(var e=-1,t=null==n?0:n.length,r=0,o=[];++e<t;){var i=n[e];i&&(o[r++]=i)}return o},Ht.concat=function(){var n=arguments.length;if(!n)return[];for(var e=an(n-1),t=arguments[0],r=n;r--;)e[r-1]=arguments[r];return Re(Wu(t)?jo(t):[t],mr(e,1))},Ht.cond=function(n){var e=null==n?0:n.length,t=si();return n=e?Le(n,(function(n){if("function"!=typeof n[1])throw new jn(r);return[t(n[0]),n[1]]})):[],Kr((function(t){for(var r=-1;++r<e;){var o=n[r];if(Ne(o[0],this,t))return Ne(o[1],this,t)}}))},Ht.conforms=function(n){return function(n){var e=Ia(n);return function(t){return sr(t,n,e)}}(lr(n,1))},Ht.constant=ec,Ht.countBy=gu,Ht.create=function(n,e){var t=Yt(n);return null==e?t:ir(t,e)},Ht.curry=function n(e,r,o){var i=Jo(e,8,t,t,t,t,t,r=o?t:r);return i.placeholder=n.placeholder,i},Ht.curryRight=function n(e,r,o){var i=Jo(e,u,t,t,t,t,t,r=o?t:r);return i.placeholder=n.placeholder,i},Ht.debounce=Iu,Ht.defaults=ka,Ht.defaultsDeep=Ca,Ht.defer=Au,Ht.delay=zu,Ht.difference=Hi,Ht.differenceBy=Yi,Ht.differenceWith=Xi,Ht.drop=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,(e=r||e===t?1:pa(e))<0?0:e,o):[]},Ht.dropRight=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,0,(e=o-(e=r||e===t?1:pa(e)))<0?0:e):[]},Ht.dropRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0,!0):[]},Ht.dropWhile=function(n,e){return n&&n.length?po(n,si(e,3),!0):[]},Ht.fill=function(n,e,r,o){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&bi(n,e,r)&&(r=0,o=i),function(n,e,r,o){var i=n.length;for((r=pa(r))<0&&(r=-r>i?0:i+r),(o=o===t||o>i?i:pa(o))<0&&(o+=i),o=r>o?0:ga(o);r<o;)n[r++]=e;return n}(n,e,r,o)):[]},Ht.filter=function(n,e){return(Wu(n)?Ie:yr)(n,si(e,3))},Ht.flatMap=function(n,e){return mr(Su(n,e),1)},Ht.flatMapDeep=function(n,e){return mr(Su(n,e),f)},Ht.flatMapDepth=function(n,e,r){return r=r===t?1:pa(r),mr(Su(n,e),r)},Ht.flatten=Fi,Ht.flattenDeep=function(n){return(null==n?0:n.length)?mr(n,f):[]},Ht.flattenDepth=function(n,e){return(null==n?0:n.length)?mr(n,e=e===t?1:pa(e)):[]},Ht.flip=function(n){return Jo(n,512)},Ht.flow=tc,Ht.flowRight=rc,Ht.fromPairs=function(n){for(var e=-1,t=null==n?0:n.length,r={};++e<t;){var o=n[e];r[o[0]]=o[1]}return r},Ht.functions=function(n){return null==n?[]:Er(n,Ia(n))},Ht.functionsIn=function(n){return null==n?[]:Er(n,Aa(n))},Ht.groupBy=bu,Ht.initial=function(n){return(null==n?0:n.length)?oo(n,0,-1):[]},Ht.intersection=$i,Ht.intersectionBy=Gi,Ht.intersectionWith=qi,Ht.invert=Oa,Ht.invertBy=Pa,Ht.invokeMap=_u,Ht.iteratee=ic,Ht.keyBy=Eu,Ht.keys=Ia,Ht.keysIn=Aa,Ht.map=Su,Ht.mapKeys=function(n,e){var t={};return e=si(e,3),br(n,(function(n,r,o){ur(t,e(n,r,o),n)})),t},Ht.mapValues=function(n,e){var t={};return e=si(e,3),br(n,(function(n,r,o){ur(t,r,e(n,r,o))})),t},Ht.matches=function(n){return Hr(lr(n,1))},Ht.matchesProperty=function(n,e){return Yr(n,lr(e,1))},Ht.memoize=Lu,Ht.merge=za,Ht.mergeWith=La,Ht.method=uc,Ht.methodOf=ac,Ht.mixin=cc,Ht.negate=Ru,Ht.nthArg=function(n){return n=pa(n),Kr((function(e){return Zr(e,n)}))},Ht.omit=Ra,Ht.omitBy=function(n,e){return Da(n,Ru(si(e)))},Ht.once=function(n){return Ou(2,n)},Ht.orderBy=function(n,e,r,o){return null==n?[]:(Wu(e)||(e=null==e?[]:[e]),Wu(r=o?t:r)||(r=null==r?[]:[r]),Wr(n,e,r))},Ht.over=sc,Ht.overArgs=Tu,Ht.overEvery=fc,Ht.overSome=dc,Ht.partial=Du,Ht.partialRight=Bu,Ht.partition=ku,Ht.pick=Ta,Ht.pickBy=Da,Ht.property=hc,Ht.propertyOf=function(n){return function(e){return null==n?t:Sr(n,e)}},Ht.pull=Qi,Ht.pullAll=Ji,Ht.pullAllBy=function(n,e,t){return n&&n.length&&e&&e.length?Ur(n,e,si(t,2)):n},Ht.pullAllWith=function(n,e,r){return n&&n.length&&e&&e.length?Ur(n,e,t,r):n},Ht.pullAt=nu,Ht.range=vc,Ht.rangeRight=pc,Ht.rearg=Vu,Ht.reject=function(n,e){return(Wu(n)?Ie:yr)(n,Ru(si(e,3)))},Ht.remove=function(n,e){var t=[];if(!n||!n.length)return t;var r=-1,o=[],i=n.length;for(e=si(e,3);++r<i;){var u=n[r];e(u,r,n)&&(t.push(u),o.push(r))}return $r(n,o),t},Ht.rest=function(n,e){if("function"!=typeof n)throw new jn(r);return Kr(n,e=e===t?e:pa(e))},Ht.reverse=eu,Ht.sampleSize=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),(Wu(n)?Jt:Jr)(n,e)},Ht.set=function(n,e,t){return null==n?n:no(n,e,t)},Ht.setWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:no(n,e,r,o)},Ht.shuffle=function(n){return(Wu(n)?nr:ro)(n)},Ht.slice=function(n,e,r){var o=null==n?0:n.length;return o?(r&&"number"!=typeof r&&bi(n,e,r)?(e=0,r=o):(e=null==e?0:pa(e),r=r===t?o:pa(r)),oo(n,e,r)):[]},Ht.sortBy=Cu,Ht.sortedUniq=function(n){return n&&n.length?co(n):[]},Ht.sortedUniqBy=function(n,e){return n&&n.length?co(n,si(e,2)):[]},Ht.split=function(n,e,r){return r&&"number"!=typeof r&&bi(n,e,r)&&(e=r=t),(r=r===t?v:r>>>0)?(n=wa(n))&&("string"==typeof e||null!=e&&!ua(e))&&!(e=so(e))&&at(n)?Eo(vt(n),0,r):n.split(e,r):[]},Ht.spread=function(n,e){if("function"!=typeof n)throw new jn(r);return e=null==e?0:wt(pa(e),0),Kr((function(t){var r=t[e],o=Eo(t,0,e);return r&&Re(o,r),Ne(n,this,o)}))},Ht.tail=function(n){var e=null==n?0:n.length;return e?oo(n,1,e):[]},Ht.take=function(n,e,r){return n&&n.length?oo(n,0,(e=r||e===t?1:pa(e))<0?0:e):[]},Ht.takeRight=function(n,e,r){var o=null==n?0:n.length;return o?oo(n,(e=o-(e=r||e===t?1:pa(e)))<0?0:e,o):[]},Ht.takeRightWhile=function(n,e){return n&&n.length?po(n,si(e,3),!1,!0):[]},Ht.takeWhile=function(n,e){return n&&n.length?po(n,si(e,3)):[]},Ht.tap=function(n,e){return e(n),n},Ht.throttle=function(n,e,t){var o=!0,i=!0;if("function"!=typeof n)throw new jn(r);return ea(t)&&(o="leading"in t?!!t.leading:o,i="trailing"in t?!!t.trailing:i),Iu(n,e,{leading:o,maxWait:e,trailing:i})},Ht.thru=vu,Ht.toArray=ha,Ht.toPairs=Ba,Ht.toPairsIn=Va,Ht.toPath=function(n){return Wu(n)?Le(n,Di):la(n)?[n]:jo(Ti(wa(n)))},Ht.toPlainObject=ma,Ht.transform=function(n,e,t){var r=Wu(n),o=r||Gu(n)||sa(n);if(e=si(e,4),null==t){var i=n&&n.constructor;t=o?r?new i:[]:ea(n)&&Qu(i)?Yt($n(n)):{}}return(o?Oe:br)(n,(function(n,r,o){return e(t,n,r,o)})),t},Ht.unary=function(n){return Mu(n,1)},Ht.union=tu,Ht.unionBy=ru,Ht.unionWith=ou,Ht.uniq=function(n){return n&&n.length?fo(n):[]},Ht.uniqBy=function(n,e){return n&&n.length?fo(n,si(e,2)):[]},Ht.uniqWith=function(n,e){return e="function"==typeof e?e:t,n&&n.length?fo(n,t,e):[]},Ht.unset=function(n,e){return null==n||ho(n,e)},Ht.unzip=iu,Ht.unzipWith=uu,Ht.update=function(n,e,t){return null==n?n:vo(n,e,xo(t))},Ht.updateWith=function(n,e,r,o){return o="function"==typeof o?o:t,null==n?n:vo(n,e,xo(r),o)},Ht.values=Ha,Ht.valuesIn=function(n){return null==n?[]:nt(n,Aa(n))},Ht.without=au,Ht.words=Qa,Ht.wrap=function(n,e){return Du(xo(e),n)},Ht.xor=cu,Ht.xorBy=lu,Ht.xorWith=su,Ht.zip=fu,Ht.zipObject=function(n,e){return mo(n||[],e||[],tr)},Ht.zipObjectDeep=function(n,e){return mo(n||[],e||[],no)},Ht.zipWith=du,Ht.entries=Ba,Ht.entriesIn=Va,Ht.extend=ba,Ht.extendWith=_a,cc(Ht,Ht),Ht.add=mc,Ht.attempt=Ja,Ht.camelCase=Ya,Ht.capitalize=Xa,Ht.ceil=wc,Ht.clamp=function(n,e,r){return r===t&&(r=e,e=t),r!==t&&(r=(r=ya(r))==r?r:0),e!==t&&(e=(e=ya(e))==e?e:0),cr(ya(n),e,r)},Ht.clone=function(n){return lr(n,4)},Ht.cloneDeep=function(n){return lr(n,5)},Ht.cloneDeepWith=function(n,e){return lr(n,5,e="function"==typeof e?e:t)},Ht.cloneWith=function(n,e){return lr(n,4,e="function"==typeof e?e:t)},Ht.conformsTo=function(n,e){return null==e||sr(n,e,Ia(e))},Ht.deburr=Za,Ht.defaultTo=function(n,e){return null==n||n!=n?e:n},Ht.divide=xc,Ht.endsWith=function(n,e,r){n=wa(n),e=so(e);var o=n.length,i=r=r===t?o:cr(pa(r),0,o);return(r-=e.length)>=0&&n.slice(r,i)==e},Ht.eq=Hu,Ht.escape=function(n){return(n=wa(n))&&q.test(n)?n.replace($,it):n},Ht.escapeRegExp=function(n){return(n=wa(n))&&on.test(n)?n.replace(rn,"\\$&"):n},Ht.every=function(n,e,r){var o=Wu(n)?je:pr;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.find=yu,Ht.findIndex=Zi,Ht.findKey=function(n,e){return He(n,si(e,3),br)},Ht.findLast=mu,Ht.findLastIndex=Wi,Ht.findLastKey=function(n,e){return He(n,si(e,3),_r)},Ht.floor=bc,Ht.forEach=wu,Ht.forEachRight=xu,Ht.forIn=function(n,e){return null==n?n:wr(n,si(e,3),Aa)},Ht.forInRight=function(n,e){return null==n?n:xr(n,si(e,3),Aa)},Ht.forOwn=function(n,e){return n&&br(n,si(e,3))},Ht.forOwnRight=function(n,e){return n&&_r(n,si(e,3))},Ht.get=Na,Ht.gt=Yu,Ht.gte=Xu,Ht.has=function(n,e){return null!=n&&yi(n,e,Mr)},Ht.hasIn=Ma,Ht.head=Ui,Ht.identity=oc,Ht.includes=function(n,e,t,r){n=Uu(n)?n:Ha(n),t=t&&!r?pa(t):0;var o=n.length;return t<0&&(t=wt(o+t,0)),ca(n)?t<=o&&n.indexOf(e,t)>-1:!!o&&Xe(n,e,t)>-1},Ht.indexOf=function(n,e,t){var r=null==n?0:n.length;if(!r)return-1;var o=null==t?0:pa(t);return o<0&&(o=wt(r+o,0)),Xe(n,e,o)},Ht.inRange=function(n,e,r){return e=va(e),r===t?(r=e,e=0):r=va(r),function(n,e,t){return n>=xt(e,t)&&n<wt(e,t)}(n=ya(n),e,r)},Ht.invoke=ja,Ht.isArguments=Zu,Ht.isArray=Wu,Ht.isArrayBuffer=Fu,Ht.isArrayLike=Uu,Ht.isArrayLikeObject=$u,Ht.isBoolean=function(n){return!0===n||!1===n||ta(n)&&Cr(n)==m},Ht.isBuffer=Gu,Ht.isDate=qu,Ht.isElement=function(n){return ta(n)&&1===n.nodeType&&!ia(n)},Ht.isEmpty=function(n){if(null==n)return!0;if(Uu(n)&&(Wu(n)||"string"==typeof n||"function"==typeof n.splice||Gu(n)||sa(n)||Zu(n)))return!n.length;var e=gi(n);if(e==S||e==O)return!n.size;if(ki(n))return!Tr(n).length;for(var t in n)if(Tn.call(n,t))return!1;return!0},Ht.isEqual=function(n,e){return Ar(n,e)},Ht.isEqualWith=function(n,e,r){var o=(r="function"==typeof r?r:t)?r(n,e):t;return o===t?Ar(n,e,t,r):!!o},Ht.isError=Ku,Ht.isFinite=function(n){return"number"==typeof n&&Ve(n)},Ht.isFunction=Qu,Ht.isInteger=Ju,Ht.isLength=na,Ht.isMap=ra,Ht.isMatch=function(n,e){return n===e||zr(n,e,di(e))},Ht.isMatchWith=function(n,e,r){return r="function"==typeof r?r:t,zr(n,e,di(e),r)},Ht.isNaN=function(n){return oa(n)&&n!=+n},Ht.isNative=function(n){if(Si(n))throw new kn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Lr(n)},Ht.isNil=function(n){return null==n},Ht.isNull=function(n){return null===n},Ht.isNumber=oa,Ht.isObject=ea,Ht.isObjectLike=ta,Ht.isPlainObject=ia,Ht.isRegExp=ua,Ht.isSafeInteger=function(n){return Ju(n)&&n>=-9007199254740991&&n<=d},Ht.isSet=aa,Ht.isString=ca,Ht.isSymbol=la,Ht.isTypedArray=sa,Ht.isUndefined=function(n){return n===t},Ht.isWeakMap=function(n){return ta(n)&&gi(n)==I},Ht.isWeakSet=function(n){return ta(n)&&"[object WeakSet]"==Cr(n)},Ht.join=function(n,e){return null==n?"":$e.call(n,e)},Ht.kebabCase=Wa,Ht.last=Ki,Ht.lastIndexOf=function(n,e,r){var o=null==n?0:n.length;if(!o)return-1;var i=o;return r!==t&&(i=(i=pa(r))<0?wt(o+i,0):xt(i,o-1)),e==e?function(n,e,t){for(var r=t+1;r--;)if(n[r]===e)return r;return r}(n,e,i):Ye(n,We,i,!0)},Ht.lowerCase=Fa,Ht.lowerFirst=Ua,Ht.lt=fa,Ht.lte=da,Ht.max=function(n){return n&&n.length?gr(n,oc,Nr):t},Ht.maxBy=function(n,e){return n&&n.length?gr(n,si(e,2),Nr):t},Ht.mean=function(n){return Fe(n,oc)},Ht.meanBy=function(n,e){return Fe(n,si(e,2))},Ht.min=function(n){return n&&n.length?gr(n,oc,Br):t},Ht.minBy=function(n,e){return n&&n.length?gr(n,si(e,2),Br):t},Ht.stubArray=gc,Ht.stubFalse=yc,Ht.stubObject=function(){return{}},Ht.stubString=function(){return""},Ht.stubTrue=function(){return!0},Ht.multiply=Ec,Ht.nth=function(n,e){return n&&n.length?Zr(n,pa(e)):t},Ht.noConflict=function(){return pe._===this&&(pe._=Yn),this},Ht.noop=lc,Ht.now=Nu,Ht.pad=function(n,e,t){n=wa(n);var r=(e=pa(e))?ht(n):0;if(!e||r>=e)return n;var o=(e-r)/2;return Fo(ye(o),t)+n+Fo(ge(o),t)},Ht.padEnd=function(n,e,t){n=wa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?n+Fo(e-r,t):n},Ht.padStart=function(n,e,t){n=wa(n);var r=(e=pa(e))?ht(n):0;return e&&r<e?Fo(e-r,t)+n:n},Ht.parseInt=function(n,e,t){return t||null==e?e=0:e&&(e=+e),_t(wa(n).replace(un,""),e||0)},Ht.random=function(n,e,r){if(r&&"boolean"!=typeof r&&bi(n,e,r)&&(e=r=t),r===t&&("boolean"==typeof e?(r=e,e=t):"boolean"==typeof n&&(r=n,n=t)),n===t&&e===t?(n=0,e=1):(n=va(n),e===t?(e=n,n=0):e=va(e)),n>e){var o=n;n=e,e=o}if(r||n%1||e%1){var i=Et();return xt(n+i*(e-n+fe("1e-"+((i+"").length-1))),e)}return Gr(n,e)},Ht.reduce=function(n,e,t){var r=Wu(n)?Te:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,hr)},Ht.reduceRight=function(n,e,t){var r=Wu(n)?De:Ge,o=arguments.length<3;return r(n,si(e,4),t,o,vr)},Ht.repeat=function(n,e,r){return e=(r?bi(n,e,r):e===t)?1:pa(e),qr(wa(n),e)},Ht.replace=function(){var n=arguments,e=wa(n[0]);return n.length<3?e:e.replace(n[1],n[2])},Ht.result=function(n,e,r){var o=-1,i=(e=bo(e,n)).length;for(i||(i=1,n=t);++o<i;){var u=null==n?t:n[Di(e[o])];u===t&&(o=i,u=r),n=Qu(u)?u.call(n):u}return n},Ht.round=Sc,Ht.runInContext=n,Ht.sample=function(n){return(Wu(n)?Qt:Qr)(n)},Ht.size=function(n){if(null==n)return 0;if(Uu(n))return ca(n)?ht(n):n.length;var e=gi(n);return e==S||e==O?n.size:Tr(n).length},Ht.snakeCase=$a,Ht.some=function(n,e,r){var o=Wu(n)?Be:io;return r&&bi(n,e,r)&&(e=t),o(n,si(e,3))},Ht.sortedIndex=function(n,e){return uo(n,e)},Ht.sortedIndexBy=function(n,e,t){return ao(n,e,si(t,2))},Ht.sortedIndexOf=function(n,e){var t=null==n?0:n.length;if(t){var r=uo(n,e);if(r<t&&Hu(n[r],e))return r}return-1},Ht.sortedLastIndex=function(n,e){return uo(n,e,!0)},Ht.sortedLastIndexBy=function(n,e,t){return ao(n,e,si(t,2),!0)},Ht.sortedLastIndexOf=function(n,e){if(null==n?0:n.length){var t=uo(n,e,!0)-1;if(Hu(n[t],e))return t}return-1},Ht.startCase=Ga,Ht.startsWith=function(n,e,t){return n=wa(n),t=null==t?0:cr(pa(t),0,n.length),e=so(e),n.slice(t,t+e.length)==e},Ht.subtract=kc,Ht.sum=function(n){return n&&n.length?qe(n,oc):0},Ht.sumBy=function(n,e){return n&&n.length?qe(n,si(e,2)):0},Ht.template=function(n,e,r){var o=Ht.templateSettings;r&&bi(n,e,r)&&(e=t),n=wa(n),e=_a({},e,o,ni);var i,u,a=_a({},e.imports,o.imports,ni),c=Ia(a),l=nt(a,c),s=0,f=e.interpolate||_n,d="__p += '",h=On((e.escape||_n).source+"|"+f.source+"|"+(f===J?vn:_n).source+"|"+(e.evaluate||_n).source+"|$","g"),v="//# sourceURL="+(Tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ae+"]")+"\n";n.replace(h,(function(e,t,r,o,a,c){return r||(r=o),d+=n.slice(s,c).replace(En,ut),t&&(i=!0,d+="' +\n__e("+t+") +\n'"),a&&(u=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+e.length,e})),d+="';\n";var p=Tn.call(e,"variable")&&e.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(Z,""):d).replace(W,"$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(t,l)}));if(g.source=d,Ku(g))throw g;return g},Ht.times=function(n,e){if((n=pa(n))<1||n>d)return[];var t=v,r=xt(n,v);e=si(e),n-=v;for(var o=Ke(r,e);++t<n;)e(t);return o},Ht.toFinite=va,Ht.toInteger=pa,Ht.toLength=ga,Ht.toLower=function(n){return wa(n).toLowerCase()},Ht.toNumber=ya,Ht.toSafeInteger=function(n){return n?cr(pa(n),-9007199254740991,d):0===n?n:0},Ht.toString=wa,Ht.toUpper=function(n){return wa(n).toUpperCase()},Ht.trim=function(n,e,r){if((n=wa(n))&&(r||e===t))return Qe(n);if(!n||!(e=so(e)))return n;var o=vt(n),i=vt(e);return Eo(o,tt(o,i),rt(o,i)+1).join("")},Ht.trimEnd=function(n,e,r){if((n=wa(n))&&(r||e===t))return n.slice(0,pt(n)+1);if(!n||!(e=so(e)))return n;var o=vt(n);return Eo(o,0,rt(o,vt(e))+1).join("")},Ht.trimStart=function(n,e,r){if((n=wa(n))&&(r||e===t))return n.replace(un,"");if(!n||!(e=so(e)))return n;var o=vt(n);return Eo(o,tt(o,vt(e))).join("")},Ht.truncate=function(n,e){var r=30,o="...";if(ea(e)){var i="separator"in e?e.separator:i;r="length"in e?pa(e.length):r,o="omission"in e?so(e.omission):o}var u=(n=wa(n)).length;if(at(n)){var a=vt(n);u=a.length}if(r>=u)return n;var c=r-ht(o);if(c<1)return o;var l=a?Eo(a,0,c).join(""):n.slice(0,c);if(i===t)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===t?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},Ht.unescape=function(n){return(n=wa(n))&&G.test(n)?n.replace(U,gt):n},Ht.uniqueId=function(n){var e=++Dn;return wa(n)+e},Ht.upperCase=qa,Ht.upperFirst=Ka,Ht.each=wu,Ht.eachRight=xu,Ht.first=Ui,cc(Ht,(_c={},br(Ht,(function(n,e){Tn.call(Ht.prototype,e)||(_c[e]=n)})),_c),{chain:!1}),Ht.VERSION="4.17.21",Oe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Ht[n].placeholder=Ht})),Oe(["drop","take"],(function(n,e){Wt.prototype[n]=function(r){r=r===t?1:wt(pa(r),0);var o=this.__filtered__&&!e?new Wt(this):this.clone();return o.__filtered__?o.__takeCount__=xt(r,o.__takeCount__):o.__views__.push({size:xt(r,v),type:n+(o.__dir__<0?"Right":"")}),o},Wt.prototype[n+"Right"]=function(e){return this.reverse()[n](e).reverse()}})),Oe(["filter","map","takeWhile"],(function(n,e){var t=e+1,r=1==t||3==t;Wt.prototype[n]=function(n){var e=this.clone();return e.__iteratees__.push({iteratee:si(n,3),type:t}),e.__filtered__=e.__filtered__||r,e}})),Oe(["head","last"],(function(n,e){var t="take"+(e?"Right":"");Wt.prototype[n]=function(){return this[t](1).value()[0]}})),Oe(["initial","tail"],(function(n,e){var t="drop"+(e?"":"Right");Wt.prototype[n]=function(){return this.__filtered__?new Wt(this):this[t](1)}})),Wt.prototype.compact=function(){return this.filter(oc)},Wt.prototype.find=function(n){return this.filter(n).head()},Wt.prototype.findLast=function(n){return this.reverse().find(n)},Wt.prototype.invokeMap=Kr((function(n,e){return"function"==typeof n?new Wt(this):this.map((function(t){return jr(t,n,e)}))})),Wt.prototype.reject=function(n){return this.filter(Ru(si(n)))},Wt.prototype.slice=function(n,e){n=pa(n);var r=this;return r.__filtered__&&(n>0||e<0)?new Wt(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==t&&(r=(e=pa(e))<0?r.dropRight(-e):r.take(e-n)),r)},Wt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Wt.prototype.toArray=function(){return this.take(v)},br(Wt.prototype,(function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=Ht[o?"take"+("last"==e?"Right":""):e],u=o||/^find/.test(e);i&&(Ht.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,c=e instanceof Wt,l=a[0],s=c||Wu(e),f=function(n){var e=i.apply(Ht,Re([n],a));return o&&d?e[0]:e};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){e=p?e:new Wt(this);var g=n.apply(e,a);return g.__actions__.push({func:vu,args:[f],thisArg:t}),new Zt(g,d)}return v&&p?n.apply(this,a):(g=this.thru(f),v?o?g.value()[0]:g.value():g)})})),Oe(["pop","push","shift","sort","splice","unshift"],(function(n){var e=In[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);Ht.prototype[n]=function(){var n=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Wu(o)?o:[],n)}return this[t]((function(t){return e.apply(Wu(t)?t:[],n)}))}})),br(Wt.prototype,(function(n,e){var t=Ht[e];if(t){var r=t.name+"";Tn.call(It,r)||(It[r]=[]),It[r].push({name:e,func:t})}})),It[Yo(t,2).name]=[{name:"wrapper",func:t}],Wt.prototype.clone=function(){var n=new Wt(this.__wrapped__);return n.__actions__=jo(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=jo(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=jo(this.__views__),n},Wt.prototype.reverse=function(){if(this.__filtered__){var n=new Wt(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Wt.prototype.value=function(){var n=this.__wrapped__.value(),e=this.__dir__,t=Wu(n),r=e<0,o=t?n.length:0,i=function(n,e,t){var r=-1,o=t.length;for(;++r<o;){var i=t[r],u=i.size;switch(i.type){case"drop":n+=u;break;case"dropRight":e-=u;break;case"take":e=xt(e,n+u);break;case"takeRight":n=wt(n,e-u)}}return{start:n,end:e}}(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=xt(c,this.__takeCount__);if(!t||!r&&o==c&&h==c)return go(n,this.__actions__);var v=[];n:for(;c--&&d<h;){for(var p=-1,g=n[l+=e];++p<f;){var y=s[p],m=y.iteratee,w=y.type,x=m(g);if(2==w)g=x;else if(!x){if(1==w)continue n;break n}}v[d++]=g}return v},Ht.prototype.at=pu,Ht.prototype.chain=function(){return hu(this)},Ht.prototype.commit=function(){return new Zt(this.value(),this.__chain__)},Ht.prototype.next=function(){this.__values__===t&&(this.__values__=ha(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?t:this.__values__[this.__index__++]}},Ht.prototype.plant=function(n){for(var e,r=this;r instanceof Xt;){var o=Vi(r);o.__index__=0,o.__values__=t,e?i.__wrapped__=o:e=o;var i=o;r=r.__wrapped__}return i.__wrapped__=n,e},Ht.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Wt){var e=n;return this.__actions__.length&&(e=new Wt(this)),(e=e.reverse()).__actions__.push({func:vu,args:[eu],thisArg:t}),new Zt(e,this.__chain__)}return this.thru(eu)},Ht.prototype.toJSON=Ht.prototype.valueOf=Ht.prototype.value=function(){return go(this.__wrapped__,this.__actions__)},Ht.prototype.first=Ht.prototype.head,Jn&&(Ht.prototype[Jn]=function(){return this}),Ht}();ye?((ye.exports=yt)._=yt,ge._=yt):pe._=yt}).call(w)}(PE,PE.exports);var jE=x(PE.exports);function IE(n){var e=n.layoutTypes,t=n.layoutConfig,r=void 0===t?CE:t,o=n.edges,i=n.nodeOrigin,u=n.nodes,a=n.container,c=e[null==r?void 0:r.type]||ME[null==r?void 0:r.type];return function(n){return n.every((function(n){var e,t;return(null===(e=n.measured)||void 0===e?void 0:e.width)&&(null===(t=n.measured)||void 0===t?void 0:t.height)}))}(u)&&c?function(n){var e=n.layoutConfig,t=void 0===e?CE:e,r=n.edges,o=n.nodeOrigin,i=n.nodes,u=n.container,a=n.layoutFn,c=jE.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==t?void 0:t.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 AE(n){var e=n.centerConfig,t=n.width,r=n.height,o=n.transform,i=n.panZoom,u=n.nodeOrigin,a=n.nodes;if(e&&i){var c=a.find((function(n){return n.id===e.centerNodeId}));return c?(function(n){var e=n.node,t=n.height,r=n.width,o=n.zoom,i=void 0===o?1:o,u=n.panZoom,a=n.nodeOrigin,c=Jx(e),l=Gx(e,a).positionAbsolute,s={x:r/2-(l.x+c.width/2)*i,y:t/2-(l.y+c.height/2)*i};u.setViewport({x:s.x,y:s.y,zoom:i})}({node:c,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0):(e.centerByBBox&&OE({nodes:a,width:t,height:r,panZoom:i,nodeOrigin:u,zoom:o[2]}),!0)}}var zE=function(n){var e,t,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return e=function(n,e){return d(d({},NE({nodes:r,edges:o,width:a,height:c,fitView:l,defaultNodes:i,defaultEdges:u})),{setNodes:function(e){n({nodes:e})},setEdges:function(e){n({edges:e})},setDefaultNodesAndEdges:function(t,r){t&&((0,e().onNodesChange)({changes:[],userNodes:t}),n({hasDefaultNodes:!0})),r&&((0,e().onEdgesChange)({userEdges:r}),n({hasDefaultEdges:!0}))},updateNodeInternals:function(t){var r=e(),o=r.triggerNodeChanges,i=r.nodeLookup,u=r.parentLookup,a=r.domNode,c=r.nodeOrigin,l=r.debug,s=r.nodeExtent,f=function(n,e,t,r,o,i){var u,a,c=null==r?void 0:r.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};var s=[],f=window.getComputedStyle(c),d=new window.DOMMatrixReadOnly(f.transform).m22,h=[];try{for(var v=U(n.values()),p=v.next();!p.done;p=v.next()){var g=p.value,y=e.get(g.id);if(y)if(y.hidden)e.set(y.id,W(W({},y),{internals:W(W({},y.internals),{handleBounds:void 0})})),l=!0;else{var m=rp(g.nodeElement),w=y.measured.width!==m.width||y.measured.height!==m.height;if(m.width&&m.height&&(w||!y.internals.handleBounds||g.force)){var x=g.nodeElement.getBoundingClientRect(),b=$v(y.extent)?y.extent:i,_=y.internals.positionAbsolute;y.parentId&&"parent"===y.extent?_=qv(_,m,e.get(y.parentId)):b&&(_=Av(_,b,m));var E=W(W({},y),{measured:m,internals:W(W({},y.internals),{positionAbsolute:_,handleBounds:{source:ip("source",g.nodeElement,x,d,y.id),target:ip("target",g.nodeElement,x,d,y.id)}})});e.set(y.id,E),y.parentId&&jp(E,e,t,{nodeOrigin:o}),l=!0,w&&(s.push({id:y.id,type:"dimensions",dimensions:m}),y.expandParent&&y.parentId&&h.push({id:y.id,parentId:y.parentId,rect:Bv(E,o)}))}}}}catch(n){u={error:n}}finally{try{p&&!p.done&&(a=v.return)&&a.call(v)}finally{if(u)throw u.error}}if(h.length>0){var S=Pp(h,e,t,o);s.push.apply(s,G([],$(S),!1))}return{changes:s,updatedInternals:l}}(t,i,u,a,c,s),d=f.changes;if(f.updatedInternals){var h=jE.cloneDeep(i);n({nodeLookup:h}),function(n,e,t){var r,o,i=Ip(Np,t);try{for(var u=U(n.values()),a=u.next();!a.done;a=u.next()){var c=a.value;if(c.parentId)jp(c,n,e,i);else{var l=Mv(c,i.nodeOrigin),s=$v(c.extent)?c.extent:i.nodeExtent,f=Av(l,s,Gv(c));c.internals.positionAbsolute=f}}}catch(n){r={error:n}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}}(i,u,{nodeOrigin:c,nodeExtent:s}),(null==d?void 0:d.length)>0&&(l&&console.log("Ink Flow: trigger node changes",d),null==o||o(d))}},updateNodePositions:function(n,t){var r,o;void 0===t&&(t=!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:t};(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=e(),p=function(n,e,t,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=e.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:rb(v,null!==(c=v.origin)&&void 0!==c?c:r),y=cb(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(e,r){var o=e.expandedRect,i=e.parent,u=Gx(i,i.origin).position,a=Jx(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=t.get(r);null==f||f.forEach((function(e){n.some((function(n){return n.id===e.id}))||l.push({id:e.id,type:"position",position:{x:e.position.x+c,y:e.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}(i,v.nodeLookup,v.parentLookup);u.push.apply(u,m([],y(p),!1))}e().triggerNodeChanges(u)},triggerNodeChanges:function(n){var t=e(),r=t.onNodesChange,o=t.debug;(null==n?void 0:n.length)&&(o&&console.log("Ink Flow: trigger node changes",n),r({changes:n}))},triggerEdgeChanges:function(n){var t=e(),r=t.onEdgesChange,o=t.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 t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,a=t.triggerEdgeChanges;r?u(n.map((function(n){return Ab(n,!0)}))):(u(zb(i,new Set(m([],y(n),!1)),!0)),a(zb(o)))},addSelectedEdges:function(n){var t=e(),r=t.multiSelectionActive,o=t.edgeLookup,i=t.nodeLookup,u=t.triggerNodeChanges,a=t.triggerEdgeChanges;r?a(n.map((function(n){return Ab(n,!0)}))):(a(zb(o,new Set(m([],y(n),!1)))),u(zb(i,new Set,!0)))},unselectNodesAndEdges:function(n){var t=void 0===n?{}:n,r=t.nodes,o=t.edges,i=e(),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,Ab(n.id,!1)})),d=s.map((function(n){return Ab(n.id,!1)}));c(f),l(d)},setMinZoom:function(t){var r=e(),o=r.panZoom,i=r.maxZoom;null==o||o.setScaleExtent([t,i]),n({minZoom:t})},setMaxZoom:function(t){var r=e(),o=r.panZoom,i=r.minZoom;null==o||o.setScaleExtent([i,t]),n({maxZoom:t})},setTranslateExtent:function(t){var r;null===(r=e().panZoom)||void 0===r||r.setTranslateExtent(t),n({translateExtent:t})},resetSelectedElements:function(){var n=e(),t=n.edges,r=n.nodes,o=n.triggerNodeChanges,i=n.triggerEdgeChanges,u=r.reduce((function(n,e){return e.selected?m(m([],y(n),!1),[Ab(e.id,!1)],!1):n}),[]),a=t.reduce((function(n,e){return e.selected?m(m([],y(n),!1),[Ab(e.id,!1)],!1):n}),[]);o(u),i(a)},setNodeExtent:function(t){var r,o,i=e().nodeLookup;try{for(var u=g(i),a=u.next();!a.done;a=u.next()){var c=y(a.value,2)[1],l=Qx(c.position,t);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:t})},panBy:function(n){var t=e(),r=t.transform,o=t.width,i=t.height;return function(n){var e=n.delta,t=n.panZoom,r=n.transform,o=n.translateExtent,i=n.width,u=n.height;if(!t||!e.x&&!e.y)return!1;var a=t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.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:t.panZoom,transform:r,translateExtent:t.translateExtent,width:o,height:i})},cancelConnection:function(){n({connection:d({},sp)})},updateConnection:function(e){n({connection:e})},reset:function(){return n(d({},NE()))},updateLayout:function(t){var r,o=t.config,i=t.nodes,u=t.force,a=e(),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,x=a.minZoom,b=a.maxZoom,_=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 P=IE({container:{width:c,height:l},edges:s,nodes:O,nodeOrigin:v,layoutTypes:f,layoutConfig:o||d||CE});if(P.layoutComplete&&(Op(P.nodes,p,g,{nodeOrigin:v,elevateNodesOnSelect:y,checkEquality:!0}),n({nodes:m,layoutComplete:P.layoutComplete}),h&&function(n){return n.every((function(n){return!!n.position}))}(Array.from(p.values())))){var j=O.find((function(n){return n.id===M})),I=P.nodes.find((function(n){return n.id===M}));if(j&&I)return function(n){var e=n.position,t=n.targetPosition,r=n.panZoom,o=n.transform,i=o[2],u=(t.x-e.x)*i,a=(t.y-e.y)*i;r.setViewport({x:o[0]+u,y:o[1]+a,zoom:i})}({targetPosition:Gx(j,v).position,panZoom:h,position:Gx(I,v).position,transform:E}),void n({layoutAnchorId:void 0});if(u||!(k||N||C))if(d.offsetConfig){var A=function(n){var e=n.offsetConfig,t=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==e?void 0:e.nodeId)}));if(!a||!c)return!1;var l=Db(c,i).positionAbsolute,s=Jx(c),f=t/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-e.offset-s.height};break;case"LR":h={x:e.offset-l.x,y:d-l.y-s.height/2};break;case"RL":h={x:t-l.x-e.offset-s.width,y:d-l.y-s.height/2};break;default:h={x:f-l.x-s.width/2,y:e.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 Vb({nodeOrigin:v,width:c,height:l,panZoom:h,fitViewOnInit:w,minZoom:x,maxZoom:b,fitViewOnInitOptions:_,nodes:p}),void n({fitViewDone:!0});S&&(AE({width:c,height:l,nodeOrigin:v,transform:E,panZoom:h,centerConfig:S,nodes:Array.from(p.values())}),n({centered:!0}))}}}},onNodesChange:function(n){var t=n.changes,r=n.userNodes;if(t||r){var o=e(),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==t?void 0:t.length),p=function(n){return n.some((function(n){return["dimensions","remove","add","replace"].includes(n.type)}))}(t||[]),g=[];g=v?(r||[]).map((function(n){var e=u.get(n.id),t=d(d({},e),n);return f&&(t.position=(null==e?void 0:e.position)||{x:0,y:0}),t})):function(n,e){return Ib(n,e)}(t,Array.from(u.values())),!v&&p&&f||Op(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 t=n.changes,r=void 0===t?[]:t,o=n.userEdges,i=e(),u=i.connectionLookup,a=i.edgeLookup,c=i.setEdges,l=i.edges,s=[];if((null==r?void 0:r.length)<=0)s=o.map((function(n){var e=a.get(n.id)||{};return d(d({},e),n)})),c(o);else{s=function(n,e){return Ib(n,e)}(r,Array.from(a.values()));var f=s.map((function(n){return n.id}));c(l.filter((function(n){return f.includes(n.id)})))}qx(u,a,s)},updateLayoutConfig:function(t){var r=e(),o=r.layoutComplete,i=r.updateLayout,u=r.layoutConfig;jE.isEqual(t,u)||(n({layoutConfig:t}),o&&i({config:t,force:!0}))},setLayoutAnchorId:function(e){n({layoutAnchorId:e})}})},t=Object.is,e?Y(e,t):Y};function LE(n){var e=n.initialNodes,t=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 zE({nodes:e,edges:t,defaultNodes:r,defaultEdges:o,width:u,height:a,fitView:c})})),1)[0];return k.jsx(Z,{value:s,children:k.jsx(Tb,{children:l})})}function RE(n){var e=n.children,r=n.nodes,o=n.edges,i=n.defaultNodes,u=n.defaultEdges,a=n.width,c=n.height,l=n.fitView;return t(X)?k.jsx(k.Fragment,{children:e}):k.jsx(LE,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:u,initialWidth:a,initialHeight:c,fitView:l,children:e})}var TE=m(m([],y(["layoutConfig","edges","nodes","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","minZoom","maxZoom","nodeExtent","elementsSelectable","connectionMode","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","nodeOrigin","isValidConnection","autoLayout","centerConfig","layoutTypes","autoPanSpeed"]),!1),["rfId"],!1),DE=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}},BE={translateExtent:xv,nodeOrigin:[0,0],minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function VE(n){var e=Ux(DE,kb),t=e.setMinZoom,r=e.setMaxZoom,o=e.setTranslateExtent,i=e.setNodeExtent,c=e.reset,l=e.setDefaultNodesAndEdges,s=e.onNodesChange,f=e.onEdgesChange,h=e.updateLayoutConfig,v=$x();a((function(){return l(n.defaultNodes,n.defaultEdges),function(){p.current=BE,c()}}),[]);var p=u(BE);return a((function(){var e,u,a,c;try{for(var l=g(TE),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)t(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 x=w||{},b=d(d({},x),{options:d(d({},x.options||{}),{rankdir:(null===(c=x.options)||void 0===c?void 0:c.rankdir)||"TB"})});h(b)}else v.setState(((a={})[m]=w,a))}}catch(n){e={error:n}}finally{try{y&&!y.done&&(u=l.return)&&u.call(l)}finally{if(e)throw e.error}}p.current=n}),TE.map((function(e){return n[e]}))),null}var HE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var YE=lb((function(n,e){var t=n.nodes,r=n.edges,o=n.translateExtent,i=void 0===o?xv:o,u=n.defaultViewport,a=void 0===u?kE: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=void 0===y?"nodrag":y,w=n.noPanClassName,x=void 0===w?"nopan":w,b=n.disableKeyboardA11y,_=n.nodeTypes,E=n.edgeTypes;n.connectionMode;var S=n.connectionLineType,C=void 0===S?up.Bezier:S,N=n.connectionLineStyle,M=n.connectionLineComponent,O=n.connectionLineContainerStyle,j=n.onNodeClick,I=n.onNodeDoubleClick,A=n.onNodeMouseEnter,z=n.onNodeMouseMove,L=n.onNodeMouseLeave,R=n.onNodeContextMenu,T=n.onEdgeClick,D=n.onEdgeMouseEnter,B=n.onEdgeMouseMove,V=n.onEdgeMouseLeave,H=n.onEdgeContextMenu,Y=n.onEdgeDoubleClick,X=n.fitView,Z=n.fitViewOptions,W=n.nodeExtent,F=n.nodesDraggable,U=n.children,$=n.id,G=n.width,q=n.height,K=n.panOnDrag,Q=void 0===K||K,J=n.onPaneClick,nn=n.onPaneContextMenu,en=n.onPaneMouseEnter,tn=n.onPaneMouseMove,rn=n.onPaneMouseLeave,on=n.onPaneScroll,un=n.elementsSelectable,an=void 0===un||un,cn=n.autoPanSpeed,ln=n.autoLayout,sn=void 0===ln||ln,fn=n.layoutConfig,dn=void 0===fn?CE:fn,hn=n.centerConfig,vn=void 0===hn?{}:hn,pn=n.layoutTypes,gn=void 0===pn?{}:pn,yn=n.selectionOnDrag,mn=void 0!==yn&&yn,wn=n.selectionMode,xn=void 0===wn?tp.Full:wn,bn=n.deleteKeyCode,_n=void 0===bn?"Backspace":bn,En=n.selectionKeyCode,Sn=n.multiSelectionKeyCode,kn=n.onlyRenderVisibleElements,Cn=n.paneClickDistance,Nn=n.nodeClickDistance,Mn=n.noWheelClassName,On=n.onConnect,Pn=n.onConnectStart,jn=n.onConnectEnd,In=n.onNodesDelete,An=n.onEdgesDelete,zn=n.onDelete,Ln=n.isValidConnection,Rn=n.onNodeDragStop,Tn=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","panOnDrag","onPaneClick","onPaneContextMenu","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","elementsSelectable","autoPanSpeed","autoLayout","layoutConfig","centerConfig","layoutTypes","selectionOnDrag","selectionMode","deleteKeyCode","selectionKeyCode","multiSelectionKeyCode","onlyRenderVisibleElements","paneClickDistance","nodeClickDistance","noWheelClassName","onConnect","onConnectStart","onConnectEnd","onNodesDelete","onEdgesDelete","onDelete","isValidConnection","onNodeDragStop"]),Dn=$||"1";return k.jsx("div",d({},Tn,{ref:e,style:d({},HE),className:P(["ink-flow"]),"data-testid":"rf__wrapper",id:$,children:k.jsxs(RE,{nodes:t,edges:r,width:G,height:q,fitView:X,children:[k.jsx(SE,{deleteKeyCode:_n,selectionKeyCode:En,multiSelectionKeyCode:Sn,onlyRenderVisibleElements:kn,paneClickDistance:Cn,nodeClickDistance:Nn,onNodeClick:j,onNodeMouseEnter:A,onNodeMouseMove:z,onNodeMouseLeave:L,onNodeContextMenu:R,onNodeDoubleClick:I,onEdgeClick:T,onEdgeMouseEnter:D,onEdgeMouseMove:B,onEdgeMouseLeave:V,onEdgeContextMenu:H,onEdgeDoubleClick:Y,rfId:Dn,nodeTypes:_,edgeTypes:E,minZoom:l,maxZoom:f,nodeOrigin:g,noDragClassName:m,noPanClassName:x,disableKeyboardA11y:b,translateExtent:i,defaultMarkerColor:p,connectionLineType:C,connectionLineStyle:N,connectionLineComponent:M,connectionLineContainerStyle:O,defaultViewport:a,panOnDrag:Q,onPaneClick:J,onPaneContextMenu:nn,onPaneMouseEnter:en,onPaneMouseMove:tn,onPaneMouseLeave:rn,onPaneScroll:on,selectionOnDrag:mn,selectionMode:xn,noWheelClassName:Mn}),k.jsx(VE,{nodes:t,edges:r,rfId:Dn,fitView:X,fitViewOptions:Z,nodeExtent:W,nodesDraggable:F,elementsSelectable:an,minZoom:l,maxZoom:f,nodeOrigin:g,autoLayout:sn,layoutConfig:dn,layoutTypes:gn,centerConfig:vn,autoPanSpeed:cn,onConnect:On,onConnectStart:Pn,onConnectEnd:jn,onDelete:zn,onEdgesDelete:An,onNodesDelete:In,isValidConnection:Ln,onNodeDragStop:Rn}),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 ZE(){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 WE(){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 FE(){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 UE(){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 $E(n){var e=n.children,t=n.className,r=h(n,["children","className"]);return k.jsx("button",d({type:"button",className:P(["ink-flow__controls-button",t])},r,{children:e}))}var GE=function(n){return n.userSelectionActive?"none":"all"};function qE(n){var e=n.position,t=void 0===e?"top-left":e,r=n.children,o=n.className,i=n.style,u=h(n,["position","children","className","style"]),a=Ux(GE),c="".concat(t).split("-");return k.jsx("div",d({className:P(m(["ink-flow__panel",o],y(c),!1)),style:d(d({},i),{pointerEvents:a})},u,{children:r}))}var KE=function(n){return{isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom}};function QE(n){var e=n.style,t=n.showZoom,r=void 0===t||t,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"],x=void 0===w?"Ink Flow controls":w,b=$x(),_=Ux(KE,kb),E=_.isInteractive,S=_.minZoomReached,C=_.maxZoomReached,N=Wb(),M=N.zoomIn,O=N.zoomOut,j=N.fitView,I="horizontal"===m?"horizontal":"vertical";return k.jsxs(qE,{className:P(["ink-flow__controls",I,h]),position:g,style:e,"data-testid":"rf__controls","aria-label":x,children:[i&&k.jsx($E,{className:"ink-flow__controls-fitview",onClick:function(){j(c),null==f||f()},"aria-label":"fit view",children:k.jsx(WE,{})}),r&&k.jsxs("div",{className:"ink-flow__controls-zoom",children:[k.jsx($E,{onClick:function(){M(),null==l||l()},className:"ink-flow__controls-zoomin","aria-label":"zoom in",disabled:C,children:k.jsx(XE,{})}),k.jsx($E,{onClick:function(){O(),null==s||s()},className:"ink-flow__controls-zoomout","aria-label":"zoom out",disabled:S,children:k.jsx(ZE,{})})]}),a&&k.jsx($E,{className:"ink-flow__controls-interactive",onClick:function(){b.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),null==d||d(!E)},title:"toggle interactivity","aria-label":"toggle interactivity",children:E?k.jsx(UE,{}):k.jsx(FE,{})}),v]})}QE.displayName="Controls";var JE,nS,eS=s(QE);function tS(n){var e=n.dimensions,t=n.lineWidth,r=n.variant,o=n.className;return k.jsx("path",{strokeWidth:t,d:"M".concat(e[0]/2," 0 V").concat(e[1]," M0 ").concat(e[1]/2," H").concat(e[0]),className:P(["ink-flow__background-pattern",r,o])})}function rS(n){var e=n.radius,t=n.className;return k.jsx("circle",{cx:e,cy:e,r:e,className:P(["ink-flow__background-pattern","dots",t])})}!function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"}(JE||(JE={}));var oS=((nS={})[JE.Dots]=1,nS[JE.Lines]=1,nS[JE.Cross]=6,nS),iS=function(n){return{transform:n.transform,patternId:"pattern-".concat(n.rfId)}};function uS(n){var e=n.id,t=n.variant,r=void 0===t?JE.Dots:t,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=Ux(iS,kb),x=w.transform,b=w.patternId,_=a||oS[r],E=r===JE.Dots,S=r===JE.Cross,C=Array.isArray(i)?i:[i,i],N=[C[0]*x[2]||1,C[1]*x[2]||1],M=_*x[2],O=S?[M,M]:N,j=E?[M/f,M/f]:[O[0]/f,O[1]/f],I="".concat(b).concat(e||"");return k.jsxs("svg",{className:P(["ink-flow__background",g]),style:d(d(d({},p),Cb),{"--xy-background-color-props":v,"--xy-background-pattern-color-props":h}),ref:m,"data-testid":"rf__background",children:[k.jsx("pattern",{id:I,x:x[0]%N[0],y:x[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:"translate(-".concat(j[0],",-").concat(j[1],")"),children:E?k.jsx(rS,{radius:M/f,className:y}):k.jsx(tS,{dimensions:O,lineWidth:l,variant:r,className:y})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(I,")")})]})}uS.displayName="Background";var aS=s(uS);var cS=s((function(n){var e,t=n.nodeId,r=n.position,o=n.variant,i=void 0===o?Ox.Handle:o,c=n.className,l=n.style,s=void 0===l?{}:l,f=n.children,h=n.color,v=n.minWidth,p=void 0===v?10:v,w=n.minHeight,x=void 0===w?10:w,b=n.maxWidth,_=void 0===b?Number.MAX_VALUE:b,E=n.maxHeight,S=void 0===E?Number.MAX_VALUE:E,C=n.keepAspectRatio,N=void 0!==C&&C,M=n.shouldResize,O=n.onResizeStart,j=n.onResize,I=n.onResizeEnd,A=c_(),z="string"==typeof t?t:A,L=$x(),R=u(null),T=i===Ox.Line?"right":"bottom-right",D=null!=r?r:T,B=u(null);a((function(){if(R.current&&z)return B.current||(B.current=function(n){var e=n.domNode,t=n.nodeId,r=n.getStoreItems,o=n.onChange,i=n.onEnd,u=nm(e);return{update:function(n){var e=n.controlPosition,a=n.boundaries,c=n.keepAspectRatio,l=n.onResizeStart,s=n.onResize,f=n.onResizeEnd,d=n.shouldResize,h=W({},Xx),v=W({},Zx),p=function(n){return{isHorizontal:n.includes("right")||n.includes("left"),isVertical:n.includes("bottom")||n.includes("top"),affectsX:n.includes("left"),affectsY:n.includes("top")}}(e),g=void 0,y=[],m=void 0,w=void 0,x=void 0,b=vm().on("start",(function(n){var e,o,i,u,a,c,s,f,d,p=r(),b=p.nodeLookup,_=p.transform,E=p.snapGrid,S=p.snapToGrid,k=p.nodeOrigin;if(g=b.get(t)){var C=Jv(n.sourceEvent,{transform:_,snapGrid:E,snapToGrid:S}),N=C.xSnapped,M=C.ySnapped;h={width:null!==(u=null===(i=g.measured)||void 0===i?void 0:i.width)&&void 0!==u?u:0,height:null!==(c=null===(a=g.measured)||void 0===a?void 0:a.height)&&void 0!==c?c:0,x:null!==(s=g.position.x)&&void 0!==s?s:0,y:null!==(f=g.position.y)&&void 0!==f?f:0},v=W(W({},h),{pointerX:N,pointerY:M,aspectRatio:h.width/h.height}),m=void 0,("parent"===g.extent||g.expandParent)&&(m=b.get(g.parentId))&&"parent"===g.extent&&(w=function(n){return[[0,0],[n.measured.width,n.measured.height]]}(m)),y=[],x=void 0;try{for(var O=U(b),P=O.next();!P.done;P=O.next()){var j=$(P.value,2),I=j[0],A=j[1];if(A.parentId===t&&(y.push({id:I,position:W({},A.position),extent:A.extent}),"parent"===A.extent||A.expandParent)){var z=Wx(A,g,null!==(d=A.origin)&&void 0!==d?d:k);x=x?[[Math.min(z[0][0],x[0][0]),Math.min(z[0][1],x[0][1])],[Math.max(z[1][0],x[1][0]),Math.max(z[1][1],x[1][1])]]:z}}}catch(n){e={error:n}}finally{try{P&&!P.done&&(o=O.return)&&o.call(O)}finally{if(e)throw e.error}}null==l||l(n,W({},h))}})).on("drag",(function(n){var e,t,i,u=r(),l=u.transform,f=u.snapGrid,b=u.snapToGrid,_=u.nodeOrigin,E=Jv(n.sourceEvent,{transform:l,snapGrid:f,snapToGrid:b}),S=[];if(g){var k=h.x,C=h.y,N=h.width,M=h.height,O={},P=null!==(i=g.origin)&&void 0!==i?i:_,j=function(n,e,t,r,o,i,u,a){var c=e.affectsX,l=e.affectsY,s=e.isHorizontal,f=e.isVertical,d=s&&f,h=t.xSnapped,v=t.ySnapped,p=r.minWidth,g=r.maxWidth,y=r.minHeight,m=r.maxHeight,w=n.x,x=n.y,b=n.width,_=n.height,E=n.aspectRatio,S=Math.floor(s?h-n.pointerX:0),k=Math.floor(f?v-n.pointerY:0),C=b+(c?-S:S),N=_+(l?-k:k),M=-i[0]*b,O=-i[1]*_,P=Hx(C,p,g),j=Hx(N,y,m);if(u){var I=0,A=0;c&&S<0?I=Bx(w+S+M,u[0][0]):!c&&S>0&&(I=Vx(w+C+M,u[1][0])),l&&k<0?A=Bx(x+k+O,u[0][1]):!l&&k>0&&(A=Vx(x+N+O,u[1][1])),P=Math.max(P,I),j=Math.max(j,A)}if(a&&(I=0,A=0,c&&S>0?I=Vx(w+S,a[0][0]):!c&&S<0&&(I=Bx(w+C,a[1][0])),l&&k>0?A=Vx(x+k,a[0][1]):!l&&k<0&&(A=Bx(x+N,a[1][1])),P=Math.max(P,I),j=Math.max(j,A)),o){if(s){var z=Hx(C/E,y,m)*E;if(P=Math.max(P,z),u){var L=0;L=!c&&!l||c&&!l&&d?Vx(x+O+C/E,u[1][1])*E:Bx(x+O+(c?S:-S)/E,u[0][1])*E,P=Math.max(P,L)}a&&(L=0,L=!c&&!l||c&&!l&&d?Bx(x+C/E,a[1][1])*E:Vx(x+(c?S:-S)/E,a[0][1])*E,P=Math.max(P,L))}if(f){var R=Hx(N*E,p,g)/E;j=Math.max(j,R),u&&(L=0,L=!c&&!l||l&&!c&&d?Vx(w+N*E+M,u[1][0])/E:Bx(w+(l?k:-k)*E+M,u[0][0])/E,j=Math.max(j,L)),a&&(L=0,L=!c&&!l||l&&!c&&d?Bx(w+N*E,a[1][0])/E:Vx(w+(l?k:-k)*E,a[0][0])/E,j=Math.max(j,L))}}k+=k<0?j:-j,S+=S<0?P:-P,o&&(d?C>N*E?k=(Yx(c,l)?-S:S)/E:S=(Yx(c,l)?-k:k)*E:s?(k=S/E,l=c):(S=k*E,c=l));var T=c?w+S:w,D=l?x+k:x;return{width:b+(c?-S:S),height:_+(l?-k:k),x:i[0]*S*(c?-1:1)+T,y:i[1]*k*(l?-1:1)+D}}(v,p,E,a,c,P,w,x),I=j.width,A=j.height,z=j.x,L=j.y,R=I!==N,T=A!==M,D=z!==k&&R,B=L!==C&&T;if(D||B||R||T){if((D||B||1===P[0]||1==P[1])&&(O.x=D?z:h.x,O.y=B?L:h.y,h.x=O.x,h.y=O.y,m&&g.expandParent&&(O.x&&O.x<0&&(h.x=0,v.x=v.x-O.x),O.y&&O.y<0&&(h.y=0,v.y=v.y-O.y)),y.length>0)){var V=z-k,H=L-C;try{for(var Y=U(y),X=Y.next();!X.done;X=Y.next()){var Z=X.value;Z.position={x:Z.position.x-V+P[0]*(I-N),y:Z.position.y-H+P[1]*(A-M)},S.push(Z)}}catch(n){e={error:n}}finally{try{X&&!X.done&&(t=Y.return)&&t.call(Y)}finally{if(e)throw e.error}}}(R||T)&&(O.width=R?I:h.width,O.height=T?A:h.height,h.width=O.width,h.height=O.height);var F=function(n){var e=n.affectsY,t=n.width-n.prevWidth,r=n.height-n.prevHeight,o=[t>0?1:t<0?-1:0,r>0?1:r<0?-1:0];return t&&n.affectsX&&(o[0]=-1*o[0]),r&&e&&(o[1]=-1*o[1]),o}({width:h.width,prevWidth:N,height:h.height,prevHeight:M,affectsX:p.affectsX,affectsY:p.affectsY}),$=W(W({},h),{direction:F});!1!==(null==d?void 0:d(n,$))&&(null==s||s(n,$),o(O,S))}}})).on("end",(function(n){null==f||f(n,W({},h)),null==i||i()}));u.call(b)},destroy:function(){u.on(".drag",null)}}}({domNode:R.current,nodeId:z,getStoreItems:function(){var n=L.getState();return{nodeLookup:n.nodeLookup,transform:n.transform,snapGrid:n.snapGrid,snapToGrid:n.snapToGrid,nodeOrigin:n.nodeOrigin,paneDomNode:n.domNode}},onChange:function(n,e){var t,r,o,i,u,a,c,l,s,f=L.getState(),h=f.triggerNodeChanges,v=f.nodeLookup,p=f.parentLookup,w=f.nodeOrigin,x=[],b={x:n.x,y:n.y},_=v.get(z);if(_&&_.expandParent&&_.parentId){var E=null!==(o=_.origin)&&void 0!==o?o:w,S=null!==(u=null!==(i=n.width)&&void 0!==i?i:_.measured.width)&&void 0!==u?u:0,k=null!==(c=null!==(a=n.height)&&void 0!==a?a:_.measured.height)&&void 0!==c?c:0,C=Pp([{id:_.id,parentId:_.parentId,rect:d({width:S,height:k},pb({x:null!==(l=n.x)&&void 0!==l?l:_.position.x,y:null!==(s=n.y)&&void 0!==s?s:_.position.y},_.parentId,v,E,{width:S,height:k}))}],v,p,w);x.push.apply(x,m([],y(C),!1)),b.x=n.x?Math.max(E[0]*S,n.x):void 0,b.y=n.y?Math.max(E[1]*k,n.y):void 0}if(void 0!==b.x&&void 0!==b.y){var N={id:z,type:"position",position:d({},b)};x.push(N)}if(void 0!==n.width&&void 0!==n.height){var M={id:z,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:n.width,height:n.height}};x.push(M)}try{for(var O=g(e),P=O.next();!P.done;P=O.next()){var j=P.value;N=d(d({},j),{type:"position"});x.push(N)}}catch(n){t={error:n}}finally{try{P&&!P.done&&(r=O.return)&&r.call(O)}finally{if(t)throw t.error}}h(x)},onEnd:function(){var n={id:z,type:"dimensions",resizing:!1};L.getState().triggerNodeChanges([n])}})),B.current.update({controlPosition:D,boundaries:{minWidth:p,minHeight:x,maxWidth:_,maxHeight:S},keepAspectRatio:N,onResizeStart:O,onResize:j,onResizeEnd:I,shouldResize:M}),function(){var n;null===(n=B.current)||void 0===n||n.destroy()}}),[D,p,x,_,S,N,O,j,I,M]);var V=D.split("-"),H=i===Ox.Line?"borderColor":"backgroundColor",Y=h?d(d({},s),((e={})[H]=h,e)):s;return k.jsx("div",{className:P(m(m(["ink-flow__resize-control","nodrag"],y(V),!1),[i,c],!1)),ref:R,style:Y,children:f})}));function lS(n){var e=n.nodeId,t=n.isVisible,r=void 0===t||t,o=n.handleClassName,i=n.handleStyle,u=n.lineClassName,a=n.lineStyle,c=n.color,l=n.minWidth,s=void 0===l?10:l,f=n.minHeight,d=void 0===f?10:f,h=n.maxWidth,v=void 0===h?Number.MAX_VALUE:h,p=n.maxHeight,g=void 0===p?Number.MAX_VALUE:p,y=n.keepAspectRatio,m=void 0!==y&&y,w=n.shouldResize,x=n.onResizeStart,b=n.onResize,_=n.onResizeEnd;return r?k.jsxs(k.Fragment,{children:[Dx.map((function(n){return k.jsx(cS,{className:u,style:a,nodeId:e,position:n,variant:Ox.Line,color:c,minWidth:s,minHeight:d,maxWidth:v,maxHeight:g,onResizeStart:x,keepAspectRatio:m,shouldResize:w,onResize:b,onResizeEnd:_},n)})),Tx.map((function(n){return k.jsx(cS,{className:o,style:i,nodeId:e,position:n,color:c,minWidth:s,minHeight:d,maxWidth:v,maxHeight:g,onResizeStart:x,keepAspectRatio:m,shouldResize:w,onResize:b,onResizeEnd:_},n)}))]}):null}var sS=function(n){var e;return null===(e=n.domNode)||void 0===e?void 0:e.querySelector(".ink-flow__edgelabel-renderer")};function fS(n){var e=n.children,t=Ux(sS);return t?f(e,t):null}export{aS as Background,JE as BackgroundVariant,T_ as BaseEdge,up as ConnectionLineType,np as ConnectionMode,$E as ControlButton,eS as Controls,fS as EdgeLabelRenderer,b_ as Handle,LE as InkFlowProvider,ap as MarkerType,cS as NodeResizeControl,lS as NodeResizer,ep as PanOnScrollMode,lp as Position,tp as SelectionMode,Z_ as SmoothStepEdge,U_ as StepEdge,wp as addEdge,zp as dagreLayout,YE as default,dp as getBezierEdgeCenter,pp as getBezierPath,Pv as getConnectedEdges,gp as getEdgeCenter,Nv as getIncomers,Ov as getNodesBounds,Cv as getOutgoers,kp as getSmoothStepPath,bp as getStraightPath,Fv as getViewportForBounds,xp as updateEdge,t_ as useEdgesState,Wb as useInkFlow,r_ as useNodesState,Ux as useStore,$x as useStoreApi};
25
25
  //# sourceMappingURL=index.esm.js.map