unleash-server 5.3.0 → 5.3.2

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 (41) hide show
  1. package/dist/lib/features/playground/feature-evaluator/client.d.ts +1 -1
  2. package/dist/lib/features/playground/feature-evaluator/client.js +14 -15
  3. package/dist/lib/features/playground/feature-evaluator/client.js.map +1 -1
  4. package/dist/lib/features/playground/feature-evaluator/feature-evaluator.d.ts +1 -1
  5. package/dist/lib/features/playground/feature-evaluator/feature-evaluator.js +2 -2
  6. package/dist/lib/features/playground/feature-evaluator/feature-evaluator.js.map +1 -1
  7. package/dist/lib/features/playground/playground-service.js +1 -1
  8. package/dist/lib/features/playground/playground-service.js.map +1 -1
  9. package/dist/lib/services/client-metrics/metrics-service-v2.d.ts +2 -0
  10. package/dist/lib/services/client-metrics/metrics-service-v2.js +27 -17
  11. package/dist/lib/services/client-metrics/metrics-service-v2.js.map +1 -1
  12. package/dist/lib/services/client-metrics/metrics-service-v2.test.d.ts +1 -0
  13. package/dist/lib/services/client-metrics/metrics-service-v2.test.js +96 -0
  14. package/dist/lib/services/client-metrics/metrics-service-v2.test.js.map +1 -0
  15. package/dist/lib/types/experimental.d.ts +1 -1
  16. package/dist/lib/types/experimental.js +1 -0
  17. package/dist/lib/types/experimental.js.map +1 -1
  18. package/frontend/build/index.html +1 -1
  19. package/frontend/build/static/{AdvancedPlayground-4c9d02ea.js → AdvancedPlayground-48dddbf4.js} +1 -1
  20. package/frontend/build/static/{CreateProject-16b35d57.js → CreateProject-c1b0f704.js} +1 -1
  21. package/frontend/build/static/{Error-50364f10.js → Error-e6f7c2ee.js} +1 -1
  22. package/frontend/build/static/FeatureArchiveDialog-9ad60db1.js +10 -0
  23. package/frontend/build/static/{FeatureMetricsChart-839cdf1e.js → FeatureMetricsChart-81da0ce4.js} +1 -1
  24. package/frontend/build/static/{FeatureViewLazyExport-47bb7f13.js → FeatureViewLazyExport-58a3e977.js} +2 -2
  25. package/frontend/build/static/{LazyAdminExport-8ef0ca21.js → LazyAdminExport-c98b11d7.js} +2 -2
  26. package/frontend/build/static/{LazyProjectExport-49541c75.js → LazyProjectExport-14db2e37.js} +1 -1
  27. package/frontend/build/static/{NetworkOverview-711050f3.js → NetworkOverview-cd06e59f.js} +2 -2
  28. package/frontend/build/static/{NetworkTraffic-e587c2c7.js → NetworkTraffic-ba933617.js} +1 -1
  29. package/frontend/build/static/{RoleCell-9a62b4ed.js → RoleCell-c534790e.js} +1 -1
  30. package/frontend/build/static/{StrategyItemContainer-4098c8ef.js → StrategyItemContainer-88c18285.js} +1 -1
  31. package/frontend/build/static/{chartjs-adapter-date-fns.esm-d57aaddd.js → chartjs-adapter-date-fns.esm-799be047.js} +1 -1
  32. package/frontend/build/static/{flowchart-elk-definition-170a3958-4dece62b.js → flowchart-elk-definition-170a3958-543f0844.js} +1 -1
  33. package/frontend/build/static/{index-9c528324.js → index-1c4c68c3.js} +2 -2
  34. package/frontend/build/static/{index-9bb67f88.js → index-88f1c682.js} +1 -1
  35. package/frontend/build/static/{index-1c8194e0.js → index-aa638b65.js} +1 -1
  36. package/frontend/build/static/{is_dark-ba77f0b9.js → is_dark-735e3a95.js} +1 -1
  37. package/frontend/build/static/{mindmap-definition-44684416-a4071c9f.js → mindmap-definition-44684416-ac92f950.js} +1 -1
  38. package/frontend/build/static/{timeline-definition-8e5a9bc6-c996bf40.js → timeline-definition-8e5a9bc6-6c09f608.js} +1 -1
  39. package/frontend/build/static/{unknownify-db48ebae.js → unknownify-0b176a78.js} +1 -1
  40. package/package.json +1 -1
  41. package/frontend/build/static/FeatureArchiveDialog-fda1aa0c.js +0 -10
@@ -1,4 +1,4 @@
1
- import{w as bp,g as sn,l as qr,s as nn,a as Ep,t as wp,u as xp}from"./NetworkOverview-711050f3.js";import{g1 as Ca,g2 as Vu}from"./index-9c528324.js";import{i as Tp}from"./is_dark-ba77f0b9.js";import"./unknownify-db48ebae.js";var _u={exports:{}};(function(de,fe){(function(Q,he){de.exports=he()})(Ca,function(){function Q(t){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(t)}function he(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function A(t,e,r){return e&&Y(t.prototype,e),r&&Y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){return L(t)||G(t,e)||U(t,e)||K()}function L(t){if(Array.isArray(t))return t}function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,i=!1,s,o;try{for(r=r.call(t);!(n=(s=r.next()).done)&&(a.push(s.value),!(e&&a.length===e));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw o}}return a}}function U(t,e){if(t){if(typeof t=="string")return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(t,e)}}function P(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function K(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{w as bp,g as sn,l as qr,s as nn,a as Ep,t as wp,u as xp}from"./NetworkOverview-cd06e59f.js";import{g1 as Ca,g2 as Vu}from"./index-1c4c68c3.js";import{i as Tp}from"./is_dark-735e3a95.js";import"./unknownify-0b176a78.js";var _u={exports:{}};(function(de,fe){(function(Q,he){de.exports=he()})(Ca,function(){function Q(t){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(t)}function he(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function A(t,e,r){return e&&Y(t.prototype,e),r&&Y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w(t,e){return L(t)||G(t,e)||U(t,e)||K()}function L(t){if(Array.isArray(t))return t}function G(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a=[],n=!0,i=!1,s,o;try{for(r=r.call(t);!(n=(s=r.next()).done)&&(a.push(s.value),!(e&&a.length===e));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&r.return!=null&&r.return()}finally{if(i)throw o}}return a}}function U(t,e){if(t){if(typeof t=="string")return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(t,e)}}function P(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=t[r];return a}function K(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var D=typeof window>"u"?null:window,V=D?D.navigator:null;D&&D.document;var _=Q(""),J=Q({}),ne=Q(function(){}),oe=typeof HTMLElement>"u"?"undefined":Q(HTMLElement),j=function(e){return e&&e.instanceString&&H(e.instanceString)?e.instanceString():null},ee=function(e){return e!=null&&Q(e)==_},H=function(e){return e!=null&&Q(e)===ne},te=function(e){return!ge(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},S=function(e){return e!=null&&Q(e)===J&&!te(e)&&e.constructor===Object},$=function(e){return e!=null&&Q(e)===J},k=function(e){return e!=null&&Q(e)===Q(1)&&!isNaN(e)},q=function(e){return k(e)&&Math.floor(e)===e},ce=function(e){if(oe!=="undefined")return e!=null&&e instanceof HTMLElement},ge=function(e){return Ae(e)||Ne(e)},Ae=function(e){return j(e)==="collection"&&e._private.single},Ne=function(e){return j(e)==="collection"&&!e._private.single},_e=function(e){return j(e)==="core"},tt=function(e){return j(e)==="stylesheet"},ct=function(e){return j(e)==="event"},Pe=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},$e=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Xe=function(e){return S(e)&&k(e.x1)&&k(e.x2)&&k(e.y1)&&k(e.y2)},rt=function(e){return $(e)&&H(e.then)},lt=function(){return V&&V.userAgent.match(/msie|trident|edge/i)},nt=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var a=function n(){var i=this,s=arguments,o,l=r.apply(i,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(i,s)),o};return a.cache={},a},je=nt(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),pt=nt(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Et=nt(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),kt=function(e){return Pe(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},vt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",vr="rgb[a]?\\(("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)\\s*,\\s*("+vt+"[%]?)(?:\\s*,\\s*("+vt+"))?\\)",qt="rgb[a]?\\((?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)\\s*,\\s*(?:"+vt+"[%]?)(?:\\s*,\\s*(?:"+vt+"))?\\)",un="hsl[a]?\\(("+vt+")\\s*,\\s*("+vt+"[%])\\s*,\\s*("+vt+"[%])(?:\\s*,\\s*("+vt+"))?\\)",Kr="hsl[a]?\\((?:"+vt+")\\s*,\\s*(?:"+vt+"[%])\\s*,\\s*(?:"+vt+"[%])(?:\\s*,\\s*(?:"+vt+"))?\\)",Da="\\#[0-9a-fA-F]{3}",jt="\\#[0-9a-fA-F]{6}",Ji=function(e,r){return e<r?-1:e>r?1:0},Ju=function(e,r){return-1*Ji(e,r)},Ue=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var a=e[r];if(a!=null)for(var n=Object.keys(a),i=0;i<n.length;i++){var s=n[i];t[s]=a[s]}}return t},ju=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,a,n,i,s=16;return r?(a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[a,n,i]}},el=function(e){var r,a,n,i,s,o,l,u;function f(v,p,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?v+(p-v)*6*y:y<1/2?p:y<2/3?v+(p-v)*(2/3-y)*6:v}var h=new RegExp("^"+un+"$").exec(e);if(h){if(a=parseInt(h[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(h[2]),n<0||n>100||(n=n/100,i=parseFloat(h[3]),i<0||i>100)||(i=i/100,s=h[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var c=i<.5?i*(1+n):i+n-i*n,d=2*i-c;o=Math.round(255*f(d,c,a+1/3)),l=Math.round(255*f(d,c,a)),u=Math.round(255*f(d,c,a-1/3))}r=[o,l,u,s]}return r},tl=function(e){var r,a=new RegExp("^"+vr+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},rl=function(e){return nl[e.toLowerCase()]},al=function(e){return(te(e)?e:null)||rl(e)||ju(e)||tl(e)||el(e)},nl={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ji=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(S(s))throw Error("Tried to set map with object key");i<a.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},es=function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i<n;i++){var s=a[i];if(S(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r};function il(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Rr=il,Sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ca<"u"?Ca:typeof self<"u"?self:{};function sl(t,e){return e={exports:{}},t(e,e.exports),e.exports}var ol=typeof Sa=="object"&&Sa&&Sa.Object===Object&&Sa,ul=ol,ll=typeof self=="object"&&self&&self.Object===Object&&self,fl=ul||ll||Function("return this")(),ln=fl,hl=function(){return ln.Date.now()},ti=hl,cl=/\s/;function vl(t){for(var e=t.length;e--&&cl.test(t.charAt(e)););return e}var dl=vl,gl=/^\s+/;function pl(t){return t&&t.slice(0,dl(t)+1).replace(gl,"")}var yl=pl,ml=ln.Symbol,Zr=ml,ts=Object.prototype,bl=ts.hasOwnProperty,El=ts.toString,La=Zr?Zr.toStringTag:void 0;function wl(t){var e=bl.call(t,La),r=t[La];try{t[La]=void 0;var a=!0}catch{}var n=El.call(t);return a&&(e?t[La]=r:delete t[La]),n}var xl=wl,Tl=Object.prototype,Cl=Tl.toString;function Dl(t){return Cl.call(t)}var Sl=Dl,Ll="[object Null]",Al="[object Undefined]",rs=Zr?Zr.toStringTag:void 0;function Ol(t){return t==null?t===void 0?Al:Ll:rs&&rs in Object(t)?xl(t):Sl(t)}var as=Ol;function Nl(t){return t!=null&&typeof t=="object"}var Ml=Nl,Il="[object Symbol]";function Rl(t){return typeof t=="symbol"||Ml(t)&&as(t)==Il}var Aa=Rl,ns=0/0,kl=/^[-+]0x[0-9a-f]+$/i,Pl=/^0b[01]+$/i,Bl=/^0o[0-7]+$/i,Fl=parseInt;function zl(t){if(typeof t=="number")return t;if(Aa(t))return ns;if(Rr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Rr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=yl(t);var r=Pl.test(t);return r||Bl.test(t)?Fl(t.slice(2),r?2:8):kl.test(t)?ns:+t}var is=zl,Gl="Expected a function",$l=Math.max,Vl=Math.min;function _l(t,e,r){var a,n,i,s,o,l,u=0,f=!1,h=!1,c=!0;if(typeof t!="function")throw new TypeError(Gl);e=is(e)||0,Rr(r)&&(f=!!r.leading,h="maxWait"in r,i=h?$l(is(r.maxWait)||0,e):i,c="trailing"in r?!!r.trailing:c);function d(O){var x=a,R=n;return a=n=void 0,u=O,s=t.apply(R,x),s}function v(O){return u=O,o=setTimeout(g,e),f?d(O):s}function p(O){var x=O-l,R=O-u,C=e-x;return h?Vl(C,i-R):C}function y(O){var x=O-l,R=O-u;return l===void 0||x>=e||x<0||h&&R>=i}function g(){var O=ti();if(y(O))return m(O);o=setTimeout(g,p(O))}function m(O){return o=void 0,c&&a?d(O):(a=n=void 0,s)}function b(){o!==void 0&&clearTimeout(o),u=0,a=l=n=o=void 0}function E(){return o===void 0?s:m(ti())}function M(){var O=ti(),x=y(O);if(a=arguments,n=this,l=O,x){if(o===void 0)return v(l);if(h)return clearTimeout(o),o=setTimeout(g,e),d(l)}return o===void 0&&(o=setTimeout(g,e)),s}return M.cancel=b,M.flush=E,M}var fn=_l,ri=D?D.performance:null,ss=ri&&ri.now?function(){return ri.now()}:function(){return Date.now()},Ul=function(){if(D){if(D.requestAnimationFrame)return function(t){D.requestAnimationFrame(t)};if(D.mozRequestAnimationFrame)return function(t){D.mozRequestAnimationFrame(t)};if(D.webkitRequestAnimationFrame)return function(t){D.webkitRequestAnimationFrame(t)};if(D.msRequestAnimationFrame)return function(t){D.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ss())},1e3/60)}}(),hn=function(e){return Ul(e)},dr=ss,Qr=9261,os=65599,Oa=5381,us=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qr,a=r,n;n=e.next(),!n.done;)a=a*os+n.value|0;return a},Na=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qr;return r*os+e|0},Ma=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oa;return(r<<5)+r+e|0},Yl=function(e,r){return e*2097152+r},Er=function(e){return e[0]*2097152+e[1]},cn=function(e,r){return[Na(e[0],r[0]),Ma(e[1],r[1])]},Hl=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e[n++]:a.done=!0,a}};return us(s,r)},kr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){return n<i?a.value=e.charCodeAt(n++):a.done=!0,a}};return us(s,r)},ls=function(){return Xl(arguments)},Xl=function(e){for(var r,a=0;a<e.length;a++){var n=e[a];a===0?r=kr(n):r=kr(n,r)}return r},fs=!0,ql=console.warn!=null,Wl=console.trace!=null,ai=Number.MAX_SAFE_INTEGER||9007199254740991,hs=function(){return!0},vn=function(){return!1},cs=function(){return 0},ni=function(){},xt=function(e){throw new Error(e)},vs=function(e){if(e!==void 0)fs=!!e;else return fs},ft=function(e){vs()&&(ql?console.warn(e):(console.log(e),Wl&&console.trace()))},Kl=function(e){return Ue({},e)},or=function(e){return e==null?e:te(e)?e.slice():S(e)?Kl(e):e},Zl=function(e){return e.slice()},ds=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},Ql={},gs=function(){return Ql},Lt=function(e){var r=Object.keys(e);return function(a){for(var n={},i=0;i<r.length;i++){var s=r[i],o=a==null?void 0:a[s];n[s]=o===void 0?e[s]:o}return n}},wr=function(e,r,a){for(var n=e.length-1;n>=0&&!(e[n]===r&&(e.splice(n,1),a));n--);},ii=function(e){e.splice(0,e.length)},Jl=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},er=function(e,r,a){return a&&(r=Et(a,r)),e[r]},xr=function(e,r,a,n){a&&(r=Et(a,r)),e[r]=n},jl=function(){function t(){he(this,t),this._obj={}}return A(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),ur=typeof Map<"u"?Map:jl,ef="undefined",tf=function(){function t(e){if(he(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return A(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;a[r]!==1&&(a[r]=1,this.size++)}},{key:"delete",value:function(r){var a=this._obj;a[r]===1&&(a[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}]),t}(),Jr=(typeof Set>"u"?"undefined":Q(Set))!==ef?Set:tf,dn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!_e(e)){xt("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){xt("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new Jr,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];te(r.classes)?u=r.classes:ee(r.classes)&&(u=r.classes.split(/\s+/));for(var f=0,h=u.length;f<h;f++){var c=u[f];!c||c===""||i.classes.add(c)}this.createEmitter();var d=r.style||r.css;d&&(ft("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(d)),(a===void 0||a)&&this.restore()},ps=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;S(a)&&!ge(a)&&(s=a,a=s.roots||s.root,n=s.visit,i=s.directed),i=arguments.length===2&&!H(n)?n:i,n=H(n)?n:function(){};for(var o=this._private.cy,l=a=ee(a)?this.filter(a):a,u=[],f=[],h={},c={},d={},v=0,p,y=this.byGroup(),g=y.nodes,m=y.edges,b=0;b<l.length;b++){var E=l[b],M=E.id();E.isNode()&&(u.unshift(E),e.bfs&&(d[M]=!0,f.push(E)),c[M]=0)}for(var O=function(){var X=e.bfs?u.shift():u.pop(),B=X.id();if(e.dfs){if(d[B])return"continue";d[B]=!0,f.push(X)}var re=c[B],W=h[B],Z=W!=null?W.source():null,ie=W!=null?W.target():null,ue=W==null?void 0:X.same(Z)?ie[0]:Z[0],pe=void 0;if(pe=n(X,W,ue,v++,re),pe===!0)return p=X,"break";if(pe===!1)return"break";for(var se=X.connectedEdges().filter(function(ye){return(!i||ye.source().same(X))&&m.has(ye)}),ve=0;ve<se.length;ve++){var we=se[ve],Te=we.connectedNodes().filter(function(ye){return!ye.same(X)&&g.has(ye)}),Ee=Te.id();Te.length!==0&&!d[Ee]&&(Te=Te[0],u.push(Te),e.bfs&&(d[Ee]=!0,f.push(Te)),h[Ee]=we,c[Ee]=c[B]+1)}};u.length!==0;){var x=O();if(x!=="continue"&&x==="break")break}for(var R=o.collection(),C=0;C<f.length;C++){var F=f[C],z=h[F.id()];z!=null&&R.push(z),R.push(F)}return{path:o.collection(R),found:o.collection(p)}}},Ia={breadthFirstSearch:ps({bfs:!0}),depthFirstSearch:ps({dfs:!0})};Ia.bfs=Ia.breadthFirstSearch,Ia.dfs=Ia.depthFirstSearch;var rf=sl(function(t,e){(function(){var r,a,n,i,s,o,l,u,f,h,c,d,v,p,y;n=Math.floor,h=Math.min,a=function(g,m){return g<m?-1:g>m?1:0},f=function(g,m,b,E,M){var O;if(b==null&&(b=0),M==null&&(M=a),b<0)throw new Error("lo must be non-negative");for(E==null&&(E=g.length);b<E;)O=n((b+E)/2),M(m,g[O])<0?E=O:b=O+1;return[].splice.apply(g,[b,b-b].concat(m)),m},o=function(g,m,b){return b==null&&(b=a),g.push(m),p(g,0,g.length-1,b)},s=function(g,m){var b,E;return m==null&&(m=a),b=g.pop(),g.length?(E=g[0],g[0]=b,y(g,0,m)):E=b,E},u=function(g,m,b){var E;return b==null&&(b=a),E=g[0],g[0]=m,y(g,0,b),E},l=function(g,m,b){var E;return b==null&&(b=a),g.length&&b(g[0],m)<0&&(E=[g[0],m],m=E[0],g[0]=E[1],y(g,0,b)),m},i=function(g,m){var b,E,M,O,x,R;for(m==null&&(m=a),O=(function(){R=[];for(var C=0,F=n(g.length/2);0<=F?C<F:C>F;0<=F?C++:C--)R.push(C);return R}).apply(this).reverse(),x=[],E=0,M=O.length;E<M;E++)b=O[E],x.push(y(g,b,m));return x},v=function(g,m,b){var E;if(b==null&&(b=a),E=g.indexOf(m),E!==-1)return p(g,0,E,b),y(g,E,b)},c=function(g,m,b){var E,M,O,x,R;if(b==null&&(b=a),M=g.slice(0,m),!M.length)return M;for(i(M,b),R=g.slice(m),O=0,x=R.length;O<x;O++)E=R[O],l(M,E,b);return M.sort(b).reverse()},d=function(g,m,b){var E,M,O,x,R,C,F,z,I;if(b==null&&(b=a),m*10<=g.length){if(O=g.slice(0,m).sort(b),!O.length)return O;for(M=O[O.length-1],F=g.slice(m),x=0,C=F.length;x<C;x++)E=F[x],b(E,M)<0&&(f(O,E,0,null,b),O.pop(),M=O[O.length-1]);return O}for(i(g,b),I=[],R=0,z=h(m,g.length);0<=z?R<z:R>z;0<=z?++R:--R)I.push(s(g,b));return I},p=function(g,m,b,E){var M,O,x;for(E==null&&(E=a),M=g[b];b>m;){if(x=b-1>>1,O=g[x],E(M,O)<0){g[b]=O,b=x;continue}break}return g[b]=M},y=function(g,m,b){var E,M,O,x,R;for(b==null&&(b=a),M=g.length,R=m,O=g[m],E=2*m+1;E<M;)x=E+1,x<M&&!(b(g[E],g[x])<0)&&(E=x),g[m]=g[E],m=E,E=2*m+1;return g[m]=O,p(g,R,m,b)},r=function(){g.push=o,g.pop=s,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=v,g.nlargest=c,g.nsmallest=d;function g(m){this.cmp=m??a,this.nodes=[]}return g.prototype.push=function(m){return o(this.nodes,m,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},g.prototype.replace=function(m){return u(this.nodes,m,this.cmp)},g.prototype.pushpop=function(m){return l(this.nodes,m,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(m){return v(this.nodes,m,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return this.nodes.length===0},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var m;return m=new g,m.nodes=this.nodes.slice(0),m},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),function(g,m){return t.exports=m()}(this,function(){return r})}).call(Sa)}),Ra=rf,af=Lt({root:null,weight:function(e){return 1},directed:!1}),nf={dijkstra:function(e){if(!S(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=af(e),n=a.root,i=a.weight,s=a.directed,o=this,l=i,u=ee(n)?this.filter(n)[0]:n[0],f={},h={},c={},d=this.byGroup(),v=d.nodes,p=d.edges;p.unmergeBy(function(re){return re.isLoop()});for(var y=function(W){return f[W.id()]},g=function(W,Z){f[W.id()]=Z,m.updateItem(W)},m=new Ra(function(re,W){return y(re)-y(W)}),b=0;b<v.length;b++){var E=v[b];f[E.id()]=E.same(u)?0:1/0,m.push(E)}for(var M=function(W,Z){for(var ie=(s?W.edgesTo(Z):W.edgesWith(Z)).intersect(p),ue=1/0,pe,se=0;se<ie.length;se++){var ve=ie[se],we=l(ve);(we<ue||!pe)&&(ue=we,pe=ve)}return{edge:pe,dist:ue}};m.size()>0;){var O=m.pop(),x=y(O),R=O.id();if(c[R]=x,x!==1/0)for(var C=O.neighborhood().intersect(v),F=0;F<C.length;F++){var z=C[F],I=z.id(),X=M(O,z),B=x+X.dist;B<y(z)&&(g(z,B),h[I]={node:O,edge:X.edge})}}return{distanceTo:function(W){var Z=ee(W)?v.filter(W)[0]:W[0];return c[Z.id()]},pathTo:function(W){var Z=ee(W)?v.filter(W)[0]:W[0],ie=[],ue=Z,pe=ue.id();if(Z.length>0)for(ie.unshift(Z);h[pe];){var se=h[pe];ie.unshift(se.edge),ie.unshift(se.node),ue=se.node,pe=ue.id()}return o.spawn(ie)}}}},sf={kruskal:function(e){e=e||function(b){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,s=new Array(i),o=a,l=function(E){for(var M=0;M<s.length;M++){var O=s[M];if(O.has(E))return M}},u=0;u<i;u++)s[u]=this.spawn(a[u]);for(var f=n.sort(function(b,E){return e(b)-e(E)}),h=0;h<f.length;h++){var c=f[h],d=c.source()[0],v=c.target()[0],p=l(d),y=l(v),g=s[p],m=s[y];p!==y&&(o.merge(c),g.merge(m),s.splice(y,1))}return o}},of=Lt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),uf={aStar:function(e){var r=this.cy(),a=of(e),n=a.root,i=a.goal,s=a.heuristic,o=a.directed,l=a.weight;n=r.collection(n)[0],i=r.collection(i)[0];var u=n.id(),f=i.id(),h={},c={},d={},v=new Ra(function(pe,se){return c[pe.id()]-c[se.id()]}),p=new Jr,y={},g={},m=function(se,ve){v.push(se),p.add(ve)},b,E,M=function(){b=v.pop(),E=b.id(),p.delete(E)},O=function(se){return p.has(se)};m(n,u),h[u]=0,c[u]=s(n);for(var x=0;v.size()>0;){if(M(),x++,E===f){for(var R=[],C=i,F=f,z=g[F];R.unshift(C),z!=null&&R.unshift(z),C=y[F],C!=null;)F=C.id(),z=g[F];return{found:!0,distance:h[E],path:this.spawn(R),steps:x}}d[E]=!0;for(var I=b._private.edges,X=0;X<I.length;X++){var B=I[X];if(this.hasElementWithId(B.id())&&!(o&&B.data("source")!==E)){var re=B.source(),W=B.target(),Z=re.id()!==E?re:W,ie=Z.id();if(this.hasElementWithId(ie)&&!d[ie]){var ue=h[E]+l(B);if(!O(ie)){h[ie]=ue,c[ie]=ue+s(Z),m(Z,ie),y[ie]=b,g[ie]=B;continue}ue<h[ie]&&(h[ie]=ue,c[ie]=ue+s(Z),y[ie]=b,g[ie]=B)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},lf=Lt({weight:function(e){return 1},directed:!1}),ff={floydWarshall:function(e){for(var r=this.cy(),a=lf(e),n=a.weight,i=a.directed,s=n,o=this.byGroup(),l=o.nodes,u=o.edges,f=l.length,h=f*f,c=function(we){return l.indexOf(we)},d=function(we){return l[we]},v=new Array(h),p=0;p<h;p++){var y=p%f,g=(p-y)/f;g===y?v[p]=0:v[p]=1/0}for(var m=new Array(h),b=new Array(h),E=0;E<u.length;E++){var M=u[E],O=M.source()[0],x=M.target()[0];if(O!==x){var R=c(O),C=c(x),F=R*f+C,z=s(M);if(v[F]>z&&(v[F]=z,m[F]=C,b[F]=M),!i){var I=C*f+R;!i&&v[I]>z&&(v[I]=z,m[I]=R,b[I]=M)}}}for(var X=0;X<f;X++)for(var B=0;B<f;B++)for(var re=B*f+X,W=0;W<f;W++){var Z=B*f+W,ie=X*f+W;v[re]+v[ie]<v[Z]&&(v[Z]=v[re]+v[ie],m[Z]=m[re])}var ue=function(we){return(ee(we)?r.filter(we):we)[0]},pe=function(we){return c(ue(we))},se={distance:function(we,Te){var Ee=pe(we),ye=pe(Te);return v[Ee*f+ye]},path:function(we,Te){var Ee=pe(we),ye=pe(Te),ae=d(Ee);if(Ee===ye)return ae.collection();if(m[Ee*f+ye]==null)return r.collection();var xe=r.collection(),Ce=Ee,Oe;for(xe.merge(ae);Ee!==ye;)Ce=Ee,Ee=m[Ee*f+ye],Oe=b[Ce*f+Ee],xe.merge(Oe),xe.merge(d(Ee));return xe}};return se}},hf=Lt({weight:function(e){return 1},directed:!1,root:null}),cf={bellmanFord:function(e){var r=this,a=hf(e),n=a.weight,i=a.directed,s=a.root,o=n,l=this,u=this.cy(),f=this.byGroup(),h=f.edges,c=f.nodes,d=c.length,v=new ur,p=!1,y=[];s=u.collection(s)[0],h.unmergeBy(function(Fe){return Fe.isLoop()});for(var g=h.length,m=function(ke){var Ge=v.get(ke.id());return Ge||(Ge={},v.set(ke.id(),Ge)),Ge},b=function(ke){return(ee(ke)?u.$(ke):ke)[0]},E=function(ke){return m(b(ke)).dist},M=function(ke){for(var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,et=b(ke),We=[],Ye=et;;){if(Ye==null)return r.spawn();var Se=m(Ye),N=Se.edge,le=Se.pred;if(We.unshift(Ye[0]),Ye.same(Ge)&&We.length>0)break;N!=null&&We.unshift(N),Ye=le}return l.spawn(We)},O=0;O<d;O++){var x=c[O],R=m(x);x.same(s)?R.dist=0:R.dist=1/0,R.pred=null,R.edge=null}for(var C=!1,F=function(ke,Ge,et,We,Ye,Se){var N=We.dist+Se;N<Ye.dist&&!et.same(We.edge)&&(Ye.dist=N,Ye.pred=ke,Ye.edge=et,C=!0)},z=1;z<d;z++){C=!1;for(var I=0;I<g;I++){var X=h[I],B=X.source(),re=X.target(),W=o(X),Z=m(B),ie=m(re);F(B,re,X,Z,ie,W),i||F(re,B,X,ie,Z,W)}if(!C)break}if(C)for(var ue=[],pe=0;pe<g;pe++){var se=h[pe],ve=se.source(),we=se.target(),Te=o(se),Ee=m(ve).dist,ye=m(we).dist;if(Ee+Te<ye||!i&&ye+Te<Ee)if(p||(ft("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles!==!1){var ae=[];Ee+Te<ye&&ae.push(ve),!i&&ye+Te<Ee&&ae.push(we);for(var xe=ae.length,Ce=0;Ce<xe;Ce++){var Oe=ae[Ce],Ie=[Oe];Ie.push(m(Oe).edge);for(var He=m(Oe).pred;Ie.indexOf(He)===-1;)Ie.push(He),Ie.push(m(He).edge),He=m(He).pred;Ie=Ie.slice(Ie.indexOf(He));for(var qe=Ie[0].id(),Re=0,Me=2;Me<Ie.length;Me+=2)Ie[Me].id()<qe&&(qe=Ie[Me].id(),Re=Me);Ie=Ie.slice(Re).concat(Ie.slice(0,Re)),Ie.push(Ie[0]);var Ve=Ie.map(function(Fe){return Fe.id()}).join(",");ue.indexOf(Ve)===-1&&(y.push(l.spawn(Ie)),ue.push(Ve))}}else break}return{distanceTo:E,pathTo:M,hasNegativeWeightCycle:p,negativeWeightCycles:y}}},vf=Math.sqrt(2),df=function(e,r,a){a.length===0&&xt("Karger-Stein must be run on a connected (sub)graph");for(var n=a[e],i=n[1],s=n[2],o=r[i],l=r[s],u=a,f=u.length-1;f>=0;f--){var h=u[f],c=h[1],d=h[2];(r[c]===o&&r[d]===l||r[c]===l&&r[d]===o)&&u.splice(f,1)}for(var v=0;v<u.length;v++){var p=u[v];p[1]===l?(u[v]=p.slice(),u[v][1]=o):p[2]===l&&(u[v]=p.slice(),u[v][2]=o)}for(var y=0;y<r.length;y++)r[y]===l&&(r[y]=o);return u},si=function(e,r,a,n){for(;a>n;){var i=Math.floor(Math.random()*r.length);r=df(i,e,r),a--}return r},gf={kargerStein:function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(ie){return ie.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/vf);if(i<2){xt("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],f=0;f<s;f++){var h=n[f];u.push([f,a.indexOf(h.source()),a.indexOf(h.target())])}for(var c=1/0,d=[],v=new Array(i),p=new Array(i),y=new Array(i),g=function(ue,pe){for(var se=0;se<i;se++)pe[se]=ue[se]},m=0;m<=o;m++){for(var b=0;b<i;b++)p[b]=b;var E=si(p,u.slice(),i,l),M=E.slice();g(p,y);var O=si(p,E,l,2),x=si(y,M,l,2);O.length<=x.length&&O.length<c?(c=O.length,d=O,g(p,v)):x.length<=O.length&&x.length<c&&(c=x.length,d=x,g(y,v))}for(var R=this.spawn(d.map(function(ie){return n[ie[0]]})),C=this.spawn(),F=this.spawn(),z=v[0],I=0;I<v.length;I++){var X=v[I],B=a[I];X===z?C.merge(B):F.merge(B)}var re=function(ue){var pe=e.spawn();return ue.forEach(function(se){pe.merge(se),se.connectedEdges().forEach(function(ve){e.contains(ve)&&!R.contains(ve)&&pe.merge(ve)})}),pe},W=[re(C),re(F)],Z={cut:R,components:W,partition1:C,partition2:F};return Z}},pf=function(e){return{x:e.x,y:e.y}},gn=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},ys=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},jr=function(e){return{x:e[0],y:e[1]}},yf=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.min(s,n))}return n},mf=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i<a;i++){var s=e[i];isFinite(s)&&(n=Math.max(s,n))}return n},bf=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=r;s<a;s++){var o=e[s];isFinite(o)&&(n+=o,i++)}return n/i},Ef=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a<e.length&&e.splice(a,e.length-a),r>0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(c,d){return c-d});var f=e.length,h=Math.floor(f/2);return f%2!==0?e[h+1+o]:(e[h-1+o]+e[h+o])/2},wf=function(e){return Math.PI*e/180},pn=function(e,r){return Math.atan2(r,e)-Math.PI/2},oi=Math.log2||function(t){return Math.log(t)/Math.log(2)},ms=function(e){return e>0?1:e<0?-1:0},Pr=function(e,r){return Math.sqrt(Br(e,r))},Br=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},xf=function(e){for(var r=e.length,a=0,n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},St=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ea=function(e,r,a,n){return{x:St(e.x,r.x,a.x,n),y:St(e.y,r.y,a.y,n)}},Tf=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},s=Pr(e,r),o={x:i.x/s,y:i.y/s};return a=a??0,n=n??a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},ka=function(e,r,a){return Math.max(e,Math.min(a,r))},Ut=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Cf=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Df=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Sf=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},Lf=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},yn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ui=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=w(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},bs=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},li=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},ta=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},Af=function(e,r){return ta(e,r.x,r.y)},Es=function(e,r){return ta(e,r.x1,r.y1)&&ta(e,r.x2,r.y2)},ws=function(e,r,a,n,i,s,o){var l=Fa(i,s),u=i/2,f=s/2,h;{var c=a-u+l-o,d=n-f-o,v=a+u-l+o,p=d;if(h=Tr(e,r,a,n,c,d,v,p,!1),h.length>0)return h}{var y=a+u+o,g=n-f+l-o,m=y,b=n+f-l+o;if(h=Tr(e,r,a,n,y,g,m,b,!1),h.length>0)return h}{var E=a-u+l-o,M=n+f+o,O=a+u-l+o,x=M;if(h=Tr(e,r,a,n,E,M,O,x,!1),h.length>0)return h}{var R=a-u-o,C=n-f+l-o,F=R,z=n+f-l+o;if(h=Tr(e,r,a,n,R,C,F,z,!1),h.length>0)return h}var I;{var X=a-u+l,B=n-f+l;if(I=Pa(e,r,a,n,X,B,l+o),I.length>0&&I[0]<=X&&I[1]<=B)return[I[0],I[1]]}{var re=a+u-l,W=n-f+l;if(I=Pa(e,r,a,n,re,W,l+o),I.length>0&&I[0]>=re&&I[1]<=W)return[I[0],I[1]]}{var Z=a+u-l,ie=n+f-l;if(I=Pa(e,r,a,n,Z,ie,l+o),I.length>0&&I[0]>=Z&&I[1]>=ie)return[I[0],I[1]]}{var ue=a-u+l,pe=n+f-l;if(I=Pa(e,r,a,n,ue,pe,l+o),I.length>0&&I[0]<=ue&&I[1]>=pe)return[I[0],I[1]]}return[]},Of=function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),f=Math.max(a,i),h=Math.min(n,s),c=Math.max(n,s);return u-l<=e&&e<=f+l&&h-l<=r&&r<=c+l},Nf=function(e,r,a,n,i,s,o,l,u){var f={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},Mf=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},If=function(e,r,a,n,i){var s=1e-5;e===0&&(e=s),r/=e,a/=e,n/=e;var o,l,u,f,h,c,d,v;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,d=r/3,o>0){h=u+Math.sqrt(o),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),c=u-Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+h+c,d+=(h+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+h)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,o===0){v=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-d+2*v,i[4]=i[2]=-(v+d);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),v=2*Math.sqrt(l),i[0]=-d+v*Math.cos(f/3),i[2]=-d+v*Math.cos((f+2*Math.PI)/3),i[4]=-d+v*Math.cos((f+4*Math.PI)/3)},Rf=function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,f=1*9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,h=1*3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,c=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,d=[];If(u,f,h,c,d);for(var v=1e-7,p=[],y=0;y<6;y+=2)Math.abs(d[y+1])<v&&d[y]>=0&&d[y]<=1&&p.push(d[y]);p.push(1),p.push(0);for(var g=-1,m,b,E,M=0;M<p.length;M++)m=Math.pow(1-p[M],2)*a+2*(1-p[M])*p[M]*i+p[M]*p[M]*o,b=Math.pow(1-p[M],2)*n+2*(1-p[M])*p[M]*s+p[M]*p[M]*l,E=Math.pow(m-e,2)+Math.pow(b-r,2),g>=0?E<g&&(g=E):g=E;return g},kf=function(e,r,a,n,i,s){var o=[e-a,r-n],l=[i-a,s-n],u=l[0]*l[0]+l[1]*l[1],f=o[0]*o[0]+o[1]*o[1],h=o[0]*l[0]+o[1]*l[1],c=h*h/u;return h<0?f:c>u?(e-i)*(e-i)+(r-s)*(r-s):f-c},Yt=function(e,r,a){for(var n,i,s,o,l,u=0,f=0;f<a.length/2;f++)if(n=a[f*2],i=a[f*2+1],f+1<a.length/2?(s=a[(f+1)*2],o=a[(f+1)*2+1]):(s=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1]),!(n==e&&s==e))if(n>=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>r&&u++;else continue;return u%2!==0},gr=function(e,r,a,n,i,s,o,l,u){var f=new Array(a.length),h;l[0]!=null?(h=Math.atan(l[1]/l[0]),l[0]<0?h=h+Math.PI/2:h=-h-Math.PI/2):h=l;for(var c=Math.cos(-h),d=Math.sin(-h),v=0;v<f.length/2;v++)f[v*2]=s/2*(a[v*2]*c-a[v*2+1]*d),f[v*2+1]=o/2*(a[v*2+1]*c+a[v*2]*d),f[v*2]+=n,f[v*2+1]+=i;var p;if(u>0){var y=Ts(f,-u);p=xs(y)}else p=f;return Yt(e,r,p)},Pf=function(e,r,a,n,i,s,o){for(var l=new Array(a.length),u=s/2,f=o/2,h=ci(s,o),c=h*h,d=0;d<a.length/4;d++){var v=void 0,p=void 0;d===0?v=a.length-2:v=d*4-2,p=d*4+2;var y=n+u*a[d*4],g=i+f*a[d*4+1],m=-a[v]*a[p]-a[v+1]*a[p+1],b=h/Math.tan(Math.acos(m)/2),E=y-b*a[v],M=g-b*a[v+1],O=y+b*a[p],x=g+b*a[p+1];l[d*4]=E,l[d*4+1]=M,l[d*4+2]=O,l[d*4+3]=x;var R=a[v+1],C=-a[v],F=R*a[p]+C*a[p+1];F<0&&(R*=-1,C*=-1);var z=E+R*h,I=M+C*h,X=Math.pow(z-e,2)+Math.pow(I-r,2);if(X<=c)return!0}return Yt(e,r,l)},xs=function(e){for(var r=new Array(e.length/2),a,n,i,s,o,l,u,f,h=0;h<e.length/4;h++){a=e[h*4],n=e[h*4+1],i=e[h*4+2],s=e[h*4+3],h<e.length/4-1?(o=e[(h+1)*4],l=e[(h+1)*4+1],u=e[(h+1)*4+2],f=e[(h+1)*4+3]):(o=e[0],l=e[1],u=e[2],f=e[3]);var c=Tr(a,n,i,s,o,l,u,f,!0);r[h*2]=c[0],r[h*2+1]=c[1]}return r},Ts=function(e,r){for(var a=new Array(e.length*2),n,i,s,o,l=0;l<e.length/2;l++){n=e[l*2],i=e[l*2+1],l<e.length/2-1?(s=e[(l+1)*2],o=e[(l+1)*2+1]):(s=e[0],o=e[1]);var u=o-i,f=-(s-n),h=Math.sqrt(u*u+f*f),c=u/h,d=f/h;a[l*4]=n+c*r,a[l*4+1]=i+d*r,a[l*4+2]=s+c*r,a[l*4+3]=o+d*r}return a},Bf=function(e,r,a,n,i,s){var o=a-e,l=n-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),f=u-1;if(f<0)return[];var h=f/u;return[(a-e)*h+e,(n-r)*h+r]},Fr=function(e,r,a,n,i,s,o){return e-=i,r-=s,e/=a/2+o,r/=n/2+o,e*e+r*r<=1},Pa=function(e,r,a,n,i,s,o){var l=[a-e,n-r],u=[e-i,r-s],f=l[0]*l[0]+l[1]*l[1],h=2*(u[0]*l[0]+u[1]*l[1]),c=u[0]*u[0]+u[1]*u[1]-o*o,d=h*h-4*f*c;if(d<0)return[];var v=(-h+Math.sqrt(d))/(2*f),p=(-h-Math.sqrt(d))/(2*f),y=Math.min(v,p),g=Math.max(v,p),m=[];if(y>=0&&y<=1&&m.push(y),g>=0&&g<=1&&m.push(g),m.length===0)return[];var b=m[0]*l[0]+e,E=m[0]*l[1]+r;if(m.length>1){if(m[0]==m[1])return[b,E];var M=m[1]*l[0]+e,O=m[1]*l[1]+r;return[b,E,M,O]}else return[b,E]},fi=function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},Tr=function(e,r,a,n,i,s,o,l,u){var f=e-i,h=a-e,c=o-i,d=r-s,v=n-r,p=l-s,y=c*d-p*f,g=h*d-v*f,m=p*h-c*v;if(m!==0){var b=y/m,E=g/m,M=.001,O=0-M,x=1+M;return O<=b&&b<=x&&O<=E&&E<=x?[e+b*h,r+b*v]:u?[e+b*h,r+b*v]:[]}else return y===0||g===0?fi(e,a,o)===o?[o,l]:fi(e,a,i)===i?[i,s]:fi(i,o,a)===a?[a,n]:[]:[]},Ba=function(e,r,a,n,i,s,o,l){var u=[],f,h=new Array(a.length),c=!0;s==null&&(c=!1);var d;if(c){for(var v=0;v<h.length/2;v++)h[v*2]=a[v*2]*s+n,h[v*2+1]=a[v*2+1]*o+i;if(l>0){var p=Ts(h,-l);d=xs(p)}else d=h}else d=a;for(var y,g,m,b,E=0;E<d.length/2;E++)y=d[E*2],g=d[E*2+1],E<d.length/2-1?(m=d[(E+1)*2],b=d[(E+1)*2+1]):(m=d[0],b=d[1]),f=Tr(e,r,n,i,y,g,m,b),f.length!==0&&u.push(f[0],f[1]);return u},Ff=function(e,r,a,n,i,s,o,l){for(var u=[],f,h=new Array(a.length),c=s/2,d=o/2,v=ci(s,o),p=0;p<a.length/4;p++){var y=void 0,g=void 0;p===0?y=a.length-2:y=p*4-2,g=p*4+2;var m=n+c*a[p*4],b=i+d*a[p*4+1],E=-a[y]*a[g]-a[y+1]*a[g+1],M=v/Math.tan(Math.acos(E)/2),O=m-M*a[y],x=b-M*a[y+1],R=m+M*a[g],C=b+M*a[g+1];p===0?(h[a.length-2]=O,h[a.length-1]=x):(h[p*4-2]=O,h[p*4-1]=x),h[p*4]=R,h[p*4+1]=C;var F=a[y+1],z=-a[y],I=F*a[g]+z*a[g+1];I<0&&(F*=-1,z*=-1);var X=O+F*v,B=x+z*v;f=Pa(e,r,n,i,X,B,v),f.length!==0&&u.push(f[0],f[1])}for(var re=0;re<h.length/4;re++)f=Tr(e,r,n,i,h[re*4],h[re*4+1],h[re*4+2],h[re*4+3],!1),f.length!==0&&u.push(f[0],f[1]);if(u.length>2){for(var W=[u[0],u[1]],Z=Math.pow(W[0]-e,2)+Math.pow(W[1]-r,2),ie=1;ie<u.length/2;ie++){var ue=Math.pow(u[ie*2]-e,2)+Math.pow(u[ie*2+1]-r,2);ue<=Z&&(W[0]=u[ie*2],W[1]=u[ie*2+1],Z=ue)}return W}return u},mn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;return s<0&&(s=1e-5),[r[0]+s*n[0],r[1]+s*n[1]]},$t=function(e,r){var a=hi(e,r);return a=Cs(a),a},Cs=function(e){for(var r,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<n;u++)r=e[2*u],a=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);for(var f=2/(o-i),h=2/(l-s),c=0;c<n;c++)r=e[2*c]=e[2*c]*f,a=e[2*c+1]=e[2*c+1]*h,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);if(s<-1)for(var d=0;d<n;d++)a=e[2*d+1]=e[2*d+1]+(-1-s);return e},hi=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Fa=function(e,r){return Math.min(e/4,r/4,8)},ci=function(e,r){return Math.min(e/10,r/10,8)},Ds=function(){return 8},zf=function(e,r,a){return[e-2*r+a,2*(r-e),e]},vi=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Gf=Lt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),$f={pageRank:function(e){for(var r=Gf(e),a=r.dampingFactor,n=r.precision,i=r.iterations,s=r.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,f=l.edges,h=u.length,c=h*h,d=f.length,v=new Array(c),p=new Array(h),y=(1-a)/h,g=0;g<h;g++){for(var m=0;m<h;m++){var b=g*h+m;v[b]=0}p[g]=0}for(var E=0;E<d;E++){var M=f[E],O=M.data("source"),x=M.data("target");if(O!==x){var R=u.indexOfId(O),C=u.indexOfId(x),F=s(M),z=C*h+R;v[z]+=F,p[R]+=F}}for(var I=1/h+y,X=0;X<h;X++)if(p[X]===0)for(var B=0;B<h;B++){var re=B*h+X;v[re]=I}else for(var W=0;W<h;W++){var Z=W*h+X;v[Z]=v[Z]/p[X]+y}for(var ie=new Array(h),ue=new Array(h),pe,se=0;se<h;se++)ie[se]=1;for(var ve=0;ve<i;ve++){for(var we=0;we<h;we++)ue[we]=0;for(var Te=0;Te<h;Te++)for(var Ee=0;Ee<h;Ee++){var ye=Te*h+Ee;ue[Te]+=v[ye]*ie[Ee]}xf(ue),pe=ie,ie=ue,ue=pe;for(var ae=0,xe=0;xe<h;xe++){var Ce=pe[xe]-ie[xe];ae+=Ce*Ce}if(ae<n)break}var Oe={rank:function(He){return He=o.collection(He)[0],ie[u.indexOf(He)]}};return Oe}},Ss=Lt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ra={degreeCentralityNormalized:function(e){e=Ss(e);var r=this.cy(),a=this.nodes(),n=a.length;if(e.directed){for(var f={},h={},c=0,d=0,v=0;v<n;v++){var p=a[v],y=p.id();e.root=p;var g=this.degreeCentrality(e);c<g.indegree&&(c=g.indegree),d<g.outdegree&&(d=g.outdegree),f[y]=g.indegree,h[y]=g.outdegree}return{indegree:function(b){return c==0?0:(ee(b)&&(b=r.filter(b)),f[b.id()]/c)},outdegree:function(b){return d===0?0:(ee(b)&&(b=r.filter(b)),h[b.id()]/d)}}}else{for(var i={},s=0,o=0;o<n;o++){var l=a[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(b){return s===0?0:(ee(b)&&(b=r.filter(b)),i[b.id()]/s)}}}},degreeCentrality:function(e){e=Ss(e);var r=this.cy(),a=this,n=e,i=n.root,s=n.weight,o=n.directed,l=n.alpha;if(i=r.collection(i)[0],o){for(var d=i.connectedEdges(),v=d.filter(function(O){return O.target().same(i)&&a.has(O)}),p=d.filter(function(O){return O.source().same(i)&&a.has(O)}),y=v.length,g=p.length,m=0,b=0,E=0;E<v.length;E++)m+=s(v[E]);for(var M=0;M<p.length;M++)b+=s(p[M]);return{indegree:Math.pow(y,1-l)*Math.pow(m,l),outdegree:Math.pow(g,1-l)*Math.pow(b,l)}}else{for(var u=i.connectedEdges().intersection(a),f=u.length,h=0,c=0;c<u.length;c++)h+=s(u[c]);return{degree:Math.pow(f,1-l)*Math.pow(h,l)}}}};ra.dc=ra.degreeCentrality,ra.dcn=ra.degreeCentralityNormalised=ra.degreeCentralityNormalized;var Ls=Lt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),aa={closenessCentralityNormalized:function(e){for(var r=Ls(e),a=r.harmonic,n=r.weight,i=r.directed,s=this.cy(),o={},l=0,u=this.nodes(),f=this.floydWarshall({weight:n,directed:i}),h=0;h<u.length;h++){for(var c=0,d=u[h],v=0;v<u.length;v++)if(h!==v){var p=f.distance(d,u[v]);a?c+=1/p:c+=p}a||(c=1/c),l<c&&(l=c),o[d.id()]=c}return{closeness:function(g){return l==0?0:(ee(g)?g=s.filter(g)[0].id():g=g.id(),o[g]/l)}}},closenessCentrality:function(e){var r=Ls(e),a=r.root,n=r.weight,i=r.directed,s=r.harmonic;a=this.filter(a)[0];for(var o=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes(),f=0;f<u.length;f++){var h=u[f];if(!h.same(a)){var c=o.distanceTo(h);s?l+=1/c:l+=c}}return s?l:1/l}};aa.cc=aa.closenessCentrality,aa.ccn=aa.closenessCentralityNormalised=aa.closenessCentralityNormalized;var Vf=Lt({weight:null,directed:!1}),di={betweennessCentrality:function(e){for(var r=Vf(e),a=r.directed,n=r.weight,i=n!=null,s=this.cy(),o=this.nodes(),l={},u={},f=0,h={set:function(b,E){u[b]=E,E>f&&(f=E)},get:function(b){return u[b]}},c=0;c<o.length;c++){var d=o[c],v=d.id();a?l[v]=d.outgoers().nodes():l[v]=d.openNeighborhood().nodes(),h.set(v,0)}for(var p=function(b){for(var E=o[b].id(),M=[],O={},x={},R={},C=new Ra(function(Ee,ye){return R[Ee]-R[ye]}),F=0;F<o.length;F++){var z=o[F].id();O[z]=[],x[z]=0,R[z]=1/0}for(x[E]=1,R[E]=0,C.push(E);!C.empty();){var I=C.pop();if(M.push(I),i)for(var X=0;X<l[I].length;X++){var B=l[I][X],re=s.getElementById(I),W=void 0;re.edgesTo(B).length>0?W=re.edgesTo(B)[0]:W=B.edgesTo(re)[0];var Z=n(W);B=B.id(),R[B]>R[I]+Z&&(R[B]=R[I]+Z,C.nodes.indexOf(B)<0?C.push(B):C.updateItem(B),x[B]=0,O[B]=[]),R[B]==R[I]+Z&&(x[B]=x[B]+x[I],O[B].push(I))}else for(var ie=0;ie<l[I].length;ie++){var ue=l[I][ie].id();R[ue]==1/0&&(C.push(ue),R[ue]=R[I]+1),R[ue]==R[I]+1&&(x[ue]=x[ue]+x[I],O[ue].push(I))}}for(var pe={},se=0;se<o.length;se++)pe[o[se].id()]=0;for(;M.length>0;){for(var ve=M.pop(),we=0;we<O[ve].length;we++){var Te=O[ve][we];pe[Te]=pe[Te]+x[Te]/x[ve]*(1+pe[ve])}ve!=o[b].id()&&h.set(ve,h.get(ve)+pe[ve])}},y=0;y<o.length;y++)p(y);var g={betweenness:function(b){var E=s.collection(b).id();return h.get(E)},betweennessNormalized:function(b){if(f==0)return 0;var E=s.collection(b).id();return h.get(E)/f}};return g.betweennessNormalised=g.betweennessNormalized,g}};di.bc=di.betweennessCentrality;var _f=Lt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Uf=function(e){return _f(e)},Yf=function(e,r){for(var a=0,n=0;n<r.length;n++)a+=r[n](e);return a},Hf=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},As=function(e,r){for(var a,n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var s=0;s<r;s++)e[s*r+n]=e[s*r+n]/a}},Xf=function(e,r,a){for(var n=new Array(a*a),i=0;i<a;i++){for(var s=0;s<a;s++)n[i*a+s]=0;for(var o=0;o<a;o++)for(var l=0;l<a;l++)n[i*a+l]+=e[i*a+o]*r[o*a+l]}return n},qf=function(e,r,a){for(var n=e.slice(0),i=1;i<a;i++)e=Xf(e,n,r);return e},Wf=function(e,r,a){for(var n=new Array(r*r),i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return As(n,r),n},Kf=function(e,r,a,n){for(var i=0;i<a;i++){var s=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(s!==o)return!1}return!0},Zf=function(e,r,a,n){for(var i=[],s=0;s<r;s++){for(var o=[],l=0;l<r;l++)Math.round(e[s*r+l]*1e3)/1e3>0&&o.push(a[l]);o.length!==0&&i.push(n.collection(o))}return i},Qf=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},Jf=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)r!=a&&Qf(e[r],e[a])&&e.splice(a,1);return e},Os=function(e){for(var r=this.nodes(),a=this.edges(),n=this.cy(),i=Uf(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var l=r.length,u=l*l,f=new Array(u),h,c=0;c<u;c++)f[c]=0;for(var d=0;d<a.length;d++){var v=a[d],p=s[v.source().id()],y=s[v.target().id()],g=Yf(v,i.attributes);f[p*l+y]+=g,f[y*l+p]+=g}Hf(f,l,i.multFactor),As(f,l);for(var m=!0,b=0;m&&b<i.maxIterations;)m=!1,h=qf(f,l,i.expandFactor),f=Wf(h,l,i.inflateFactor),Kf(f,h,u,4)||(m=!0),b++;var E=Zf(f,l,r,n);return E=Jf(E),E},jf={markovClustering:Os,mcl:Os},eh=function(e){return e},Ns=function(e,r){return Math.abs(r-e)},Ms=function(e,r,a){return e+Ns(r,a)},Is=function(e,r,a){return e+Math.pow(a-r,2)},th=function(e){return Math.sqrt(e)},rh=function(e,r,a){return Math.max(e,Ns(r,a))},za=function(e,r,a,n,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:eh,o=n,l,u,f=0;f<e;f++)l=r(f),u=a(f),o=i(o,l,u);return s(o)},na={euclidean:function(e,r,a){return e>=2?za(e,r,a,0,Is,th):za(e,r,a,0,Ms)},squaredEuclidean:function(e,r,a){return za(e,r,a,0,Is)},manhattan:function(e,r,a){return za(e,r,a,0,Ms)},max:function(e,r,a){return za(e,r,a,-1/0,rh)}};na["squared-euclidean"]=na.squaredEuclidean,na.squaredeuclidean=na.squaredEuclidean;function bn(t,e,r,a,n,i){var s;return H(t)?s=t:s=na[t]||na.euclidean,e===0&&H(t)?s(n,i):s(e,r,a,n,i)}var ah=Lt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),gi=function(e){return ah(e)},En=function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(h){return a[h]}:function(h){return n[h](a)},l=function(c){return n[c](r)},u=a,f=r;return bn(e,n.length,o,l,u,f)},pi=function(e,r,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(r),l=null,u=0;u<n;u++)i[u]=e.min(a[u]).value,s[u]=e.max(a[u]).value;for(var f=0;f<r;f++){l=[];for(var h=0;h<n;h++)l[h]=Math.random()*(s[h]-i[h])+i[h];o[f]=l}return o},Rs=function(e,r,a,n,i){for(var s=1/0,o=0,l=0;l<r.length;l++){var u=En(a,e,r[l],n,i);u<s&&(s=u,o=l)}return o},ks=function(e,r,a){for(var n=[],i=null,s=0;s<r.length;s++)i=r[s],a[i.id()]===e&&n.push(i);return n},nh=function(e,r,a){return Math.abs(r-e)<=a},ih=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var s=Math.abs(e[n][i]-r[n][i]);if(s>a)return!1}return!0},sh=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},Ps=function(e,r){var a=new Array(r);if(e.length<50)for(var n=0;n<r;n++){for(var i=e[Math.floor(Math.random()*e.length)];sh(i,a,n);)i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var s=0;s<r;s++)a[s]=e[Math.floor(Math.random()*e.length)];return a},Bs=function(e,r,a){for(var n=0,i=0;i<r.length;i++)n+=En("manhattan",r[i],e,a,"kMedoids");return n},oh=function(e){var r=this.cy(),a=this.nodes(),n=null,i=gi(e),s=new Array(i.k),o={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=pi(a,i.k,i.attributes)):Q(i.testCentroids)==="object"?l=i.testCentroids:l=pi(a,i.k,i.attributes):l=pi(a,i.k,i.attributes);for(var u=!0,f=0;u&&f<i.maxIterations;){for(var h=0;h<a.length;h++)n=a[h],o[n.id()]=Rs(n,l,i.distance,i.attributes,"kMeans");u=!1;for(var c=0;c<i.k;c++){var d=ks(c,a,o);if(d.length!==0){for(var v=i.attributes.length,p=l[c],y=new Array(v),g=new Array(v),m=0;m<v;m++){g[m]=0;for(var b=0;b<d.length;b++)n=d[b],g[m]+=i.attributes[m](n);y[m]=g[m]/d.length,nh(y[m],p[m],i.sensitivityThreshold)||(u=!0)}l[c]=y,s[c]=r.collection(d)}}f++}return s},uh=function(e){var r=this.cy(),a=this.nodes(),n=null,i=gi(e),s=new Array(i.k),o,l={},u,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(Q(i.testCentroids)==="object"?o=i.testCentroids:o=Ps(a,i.k)):o=Ps(a,i.k);for(var h=!0,c=0;h&&c<i.maxIterations;){for(var d=0;d<a.length;d++)n=a[d],l[n.id()]=Rs(n,o,i.distance,i.attributes,"kMedoids");h=!1;for(var v=0;v<o.length;v++){var p=ks(v,a,l);if(p.length!==0){f[v]=Bs(o[v],p,i.attributes);for(var y=0;y<p.length;y++)u=Bs(p[y],p,i.attributes),u<f[v]&&(f[v]=u,o[v]=p[y],h=!0);s[v]=r.collection(p)}}c++}return s},lh=function(e,r,a,n,i){for(var s,o,l=0;l<r.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],i.m);for(var f=0;f<e.length;f++)for(var h=0;h<i.attributes.length;h++){s=0,o=0;for(var c=0;c<r.length;c++)s+=n[c][f]*i.attributes[h](r[c]),o+=n[c][f];e[f][h]=s/o}},fh=function(e,r,a,n,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,l,u,f=2/(i.m-1),h=0;h<a.length;h++)for(var c=0;c<n.length;c++){o=0;for(var d=0;d<a.length;d++)l=En(i.distance,n[c],a[h],i.attributes,"cmeans"),u=En(i.distance,n[c],a[d],i.attributes,"cmeans"),o+=Math.pow(l/u,f);e[c][h]=1/o}},hh=function(e,r,a,n){for(var i=new Array(a.k),s=0;s<i.length;s++)i[s]=[];for(var o,l,u=0;u<r.length;u++){o=-1/0,l=-1;for(var f=0;f<r[0].length;f++)r[u][f]>o&&(o=r[u][f],l=f);i[l].push(e[u])}for(var h=0;h<i.length;h++)i[h]=n.collection(i[h]);return i},Fs=function(e){var r=this.cy(),a=this.nodes(),n=gi(e),i,s,o,l,u;l=new Array(a.length);for(var f=0;f<a.length;f++)l[f]=new Array(n.k);o=new Array(a.length);for(var h=0;h<a.length;h++)o[h]=new Array(n.k);for(var c=0;c<a.length;c++){for(var d=0,v=0;v<n.k;v++)o[c][v]=Math.random(),d+=o[c][v];for(var p=0;p<n.k;p++)o[c][p]=o[c][p]/d}s=new Array(n.k);for(var y=0;y<n.k;y++)s[y]=new Array(n.attributes.length);u=new Array(a.length);for(var g=0;g<a.length;g++)u[g]=new Array(n.k);for(var m=!0,b=0;m&&b<n.maxIterations;)m=!1,lh(s,a,o,u,n),fh(o,l,s,a,n),ih(o,l,n.sensitivityThreshold)||(m=!0),b++;return i=hh(a,o,n,r),{clusters:i,degreeOfMembership:o}},ch={kMeans:oh,kMedoids:uh,fuzzyCMeans:Fs,fcm:Fs},vh=Lt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),dh={single:"min",complete:"max"},gh=function(e){var r=vh(e),a=dh[r.linkage];return a!=null&&(r.linkage=a),r},zs=function(e,r,a,n,i){for(var s=0,o=1/0,l,u=i.attributes,f=function(C,F){return bn(i.distance,u.length,function(z){return u[z](C)},function(z){return u[z](F)},C,F)},h=0;h<e.length;h++){var c=e[h].key,d=a[c][n[c]];d<o&&(s=c,o=d)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var v=r[s],p=r[n[s]],y;i.mode==="dendrogram"?y={left:v,right:p,key:v.key}:y={value:v.value.concat(p.value),key:v.key},e[v.index]=y,e.splice(p.index,1),r[v.key]=y;for(var g=0;g<e.length;g++){var m=e[g];v.key===m.key?l=1/0:i.linkage==="min"?(l=a[v.key][m.key],a[v.key][m.key]>a[p.key][m.key]&&(l=a[p.key][m.key])):i.linkage==="max"?(l=a[v.key][m.key],a[v.key][m.key]<a[p.key][m.key]&&(l=a[p.key][m.key])):i.linkage==="mean"?l=(a[v.key][m.key]*v.size+a[p.key][m.key]*p.size)/(v.size+p.size):i.mode==="dendrogram"?l=f(m.value,v.value):l=f(m.value[0],v.value[0]),a[v.key][m.key]=a[m.key][v.key]=l}for(var b=0;b<e.length;b++){var E=e[b].key;if(n[E]===v.key||n[E]===p.key){for(var M=E,O=0;O<e.length;O++){var x=e[O].key;a[E][x]<a[E][M]&&(M=x)}n[E]=M}e[b].index=b}return v.key=p.key=v.index=p.index=null,!0},wn=function t(e,r,a){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},ph=function t(e,r){if(!e)return"";if(e.left&&e.right){var a=t(e.left,r),n=t(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},yh=function t(e,r,a){if(!e)return[];var n=[],i=[],s=[];return r===0?(e.left&&wn(e.left,n),e.right&&wn(e.right,i),s=n.concat(i),[a.collection(s)]):r===1?e.value?[a.collection(e.value)]:(e.left&&wn(e.left,n),e.right&&wn(e.right,i),[a.collection(n),a.collection(i)]):e.value?[a.collection(e.value)]:(e.left&&(n=t(e.left,r-1,a)),e.right&&(i=t(e.right,r-1,a)),n.concat(i))},Gs=function(e){for(var r=this.cy(),a=this.nodes(),n=gh(e),i=n.attributes,s=function(b,E){return bn(n.distance,i.length,function(M){return i[M](b)},function(M){return i[M](E)},b,E)},o=[],l=[],u=[],f=[],h=0;h<a.length;h++){var c={value:n.mode==="dendrogram"?a[h]:[a[h]],key:h,index:h};o[h]=c,f[h]=c,l[h]=[],u[h]=0}for(var d=0;d<o.length;d++)for(var v=0;v<=d;v++){var p=void 0;n.mode==="dendrogram"?p=d===v?1/0:s(o[d].value,o[v].value):p=d===v?1/0:s(o[d].value[0],o[v].value[0]),l[d][v]=p,l[v][d]=p,p<l[d][u[d]]&&(u[d]=v)}for(var y=zs(o,f,l,u,n);y;)y=zs(o,f,l,u,n);var g;return n.mode==="dendrogram"?(g=yh(o[0],n.dendrogramDepth,r),n.addDendrogram&&ph(o[0],r)):(g=new Array(o.length),o.forEach(function(m,b){m.key=m.index=null,g[b]=r.collection(m.value)})),g},mh={hierarchicalClustering:Gs,hca:Gs},bh=Lt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Eh=function(e){var r=e.damping,a=e.preference;.5<=r&&r<1||xt("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];return n.some(function(i){return i===a})||k(a)||xt("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a)),bh(e)},wh=function(e,r,a,n){var i=function(o,l){return n[l](o)};return-bn(e,n.length,function(s){return i(r,s)},function(s){return i(a,s)},r,a)},xh=function(e,r){var a=null;return r==="median"?a=Ef(e):r==="mean"?a=bf(e):r==="min"?a=yf(e):r==="max"?a=mf(e):a=r,a},Th=function(e,r,a){for(var n=[],i=0;i<e;i++)r[i*e+i]+a[i*e+i]>0&&n.push(i);return n},$s=function(e,r,a){for(var n=[],i=0;i<e;i++){for(var s=-1,o=-1/0,l=0;l<a.length;l++){var u=a[l];r[i*e+u]>o&&(s=u,o=r[i*e+u])}s>0&&n.push(s)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},Ch=function(e,r,a){for(var n=$s(e,r,a),i=0;i<a.length;i++){for(var s=[],o=0;o<n.length;o++)n[o]===a[i]&&s.push(o);for(var l=-1,u=-1/0,f=0;f<s.length;f++){for(var h=0,c=0;c<s.length;c++)h+=r[s[c]*e+s[f]];h>u&&(l=f,u=h)}a[i]=s[l]}return n=$s(e,r,a),n},Vs=function(e){for(var r=this.cy(),a=this.nodes(),n=Eh(e),i={},s=0;s<a.length;s++)i[a[s].id()]=s;var o,l,u,f,h,c;o=a.length,l=o*o,u=new Array(l);for(var d=0;d<l;d++)u[d]=-1/0;for(var v=0;v<o;v++)for(var p=0;p<o;p++)v!==p&&(u[v*o+p]=wh(n.distance,a[v],a[p],n.attributes));f=xh(u,n.preference);for(var y=0;y<o;y++)u[y*o+y]=f;h=new Array(l);for(var g=0;g<l;g++)h[g]=0;c=new Array(l);for(var m=0;m<l;m++)c[m]=0;for(var b=new Array(o),E=new Array(o),M=new Array(o),O=0;O<o;O++)b[O]=0,E[O]=0,M[O]=0;for(var x=new Array(o*n.minIterations),R=0;R<x.length;R++)x[R]=0;var C;for(C=0;C<n.maxIterations;C++){for(var F=0;F<o;F++){for(var z=-1/0,I=-1/0,X=-1,B=0,re=0;re<o;re++)b[re]=h[F*o+re],B=c[F*o+re]+u[F*o+re],B>=z?(I=z,z=B,X=re):B>I&&(I=B);for(var W=0;W<o;W++)h[F*o+W]=(1-n.damping)*(u[F*o+W]-z)+n.damping*b[W];h[F*o+X]=(1-n.damping)*(u[F*o+X]-I)+n.damping*b[X]}for(var Z=0;Z<o;Z++){for(var ie=0,ue=0;ue<o;ue++)b[ue]=c[ue*o+Z],E[ue]=Math.max(0,h[ue*o+Z]),ie+=E[ue];ie-=E[Z],E[Z]=h[Z*o+Z],ie+=E[Z];for(var pe=0;pe<o;pe++)c[pe*o+Z]=(1-n.damping)*Math.min(0,ie-E[pe])+n.damping*b[pe];c[Z*o+Z]=(1-n.damping)*(ie-E[Z])+n.damping*b[Z]}for(var se=0,ve=0;ve<o;ve++){var we=c[ve*o+ve]+h[ve*o+ve]>0?1:0;x[C%n.minIterations*o+ve]=we,se+=we}if(se>0&&(C>=n.minIterations-1||C==n.maxIterations-1)){for(var Te=0,Ee=0;Ee<o;Ee++){M[Ee]=0;for(var ye=0;ye<n.minIterations;ye++)M[Ee]+=x[ye*o+Ee];(M[Ee]===0||M[Ee]===n.minIterations)&&Te++}if(Te===o)break}}for(var ae=Th(o,h,c),xe=Ch(o,u,ae),Ce={},Oe=0;Oe<ae.length;Oe++)Ce[ae[Oe]]=[];for(var Ie=0;Ie<a.length;Ie++){var He=i[a[Ie].id()],qe=xe[He];qe!=null&&Ce[qe].push(a[Ie])}for(var Re=new Array(ae.length),Me=0;Me<ae.length;Me++)Re[Me]=r.collection(Ce[ae[Me]]);return Re},Dh={affinityPropagation:Vs,ap:Vs},Sh=Lt({root:void 0,directed:!1}),Lh={hierholzer:function(e){if(!S(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Sh(e),n=a.root,i=a.directed,s=this,o=!1,l,u,f;n&&(f=ee(n)?this.filter(n)[0].id():n[0].id());var h={},c={};i?s.forEach(function(m){var b=m.id();if(m.isNode()){var E=m.indegree(!0),M=m.outdegree(!0),O=E-M,x=M-E;O==1?l?o=!0:l=b:x==1?u?o=!0:u=b:(x>1||O>1)&&(o=!0),h[b]=[],m.outgoers().forEach(function(R){R.isEdge()&&h[b].push(R.id())})}else c[b]=[void 0,m.target().id()]}):s.forEach(function(m){var b=m.id();if(m.isNode()){var E=m.degree(!0);E%2&&(l?u?o=!0:u=b:l=b),h[b]=[],m.connectedEdges().forEach(function(M){return h[b].push(M.id())})}else c[b]=[m.source().id(),m.target().id()]});var d={found:!1,trail:void 0};if(o)return d;if(u&&l)if(i){if(f&&u!=f)return d;f=u}else{if(f&&u!=f&&l!=f)return d;f||(f=u)}else f||(f=s[0].id());var v=function(b){for(var E=b,M=[b],O,x,R;h[E].length;)O=h[E].shift(),x=c[O][0],R=c[O][1],E!=R?(h[R]=h[R].filter(function(C){return C!=O}),E=R):!i&&E!=x&&(h[x]=h[x].filter(function(C){return C!=O}),E=x),M.unshift(O),M.unshift(E);return M},p=[],y=[];for(y=v(f);y.length!=1;)h[y[0]].length==0?(p.unshift(s.getElementById(y.shift())),p.unshift(s.getElementById(y.shift()))):y=v(y.shift()).concat(y);p.unshift(s.getElementById(y.shift()));for(var g in h)if(h[g].length)return d;return d.found=!0,d.trail=this.spawn(p,!0),d}},xn=function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=function(c,d){for(var v=s.length-1,p=[],y=e.spawn();s[v].x!=c||s[v].y!=d;)p.push(s.pop().edge),v--;p.push(s.pop().edge),p.forEach(function(g){var m=g.connectedNodes().intersection(e);y.merge(g),m.forEach(function(b){var E=b.id(),M=b.connectedEdges().intersection(e);y.merge(b),r[E].cutVertex?y.merge(M.filter(function(O){return O.isLoop()})):y.merge(M)})}),i.push(y)},u=function h(c,d,v){c===v&&(n+=1),r[d]={id:a,low:a++,cutVertex:!1};var p=e.getElementById(d).connectedEdges().intersection(e);if(p.size()===0)i.push(e.spawn(e.getElementById(d)));else{var y,g,m,b;p.forEach(function(E){y=E.source().id(),g=E.target().id(),m=y===d?g:y,m!==v&&(b=E.id(),o[b]||(o[b]=!0,s.push({x:d,y:m,edge:E})),m in r?r[d].low=Math.min(r[d].low,r[m].id):(h(c,m,d),r[d].low=Math.min(r[d].low,r[m].low),r[d].id<=r[m].low&&(r[d].cutVertex=!0,l(d,m))))})}};e.forEach(function(h){if(h.isNode()){var c=h.id();c in r||(n=0,u(c,c),r[c].cutVertex=n>1)}});var f=Object.keys(r).filter(function(h){return r[h].cutVertex}).map(function(h){return e.getElementById(h)});return{cut:e.spawn(f),components:i}},Ah={hopcroftTarjanBiconnected:xn,htbc:xn,htb:xn,hopcroftTarjanBiconnectedComponents:xn},Tn=function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=function l(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(p){var y=p.target().id();y!==u&&(y in r||l(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var h=e.spawn();;){var c=i.pop();if(h.merge(e.getElementById(c)),r[c].low=r[u].index,r[c].explored=!0,c===u)break}var d=h.edgesWith(h),v=h.merge(d);n.push(v),s=s.difference(v)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:n}},Oh={tarjanStronglyConnected:Tn,tsc:Tn,tscc:Tn,tarjanStronglyConnectedComponents:Tn},_s={};[Ia,nf,sf,uf,ff,cf,gf,$f,ra,aa,di,jf,ch,mh,Dh,Lh,Ah,Oh].forEach(function(t){Ue(_s,t)});/*!
3
3
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
4
4
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
@@ -1,4 +1,4 @@
1
- import{o as kt,q as vt,r as wt,g as rt,l as I,s as q,a as St,t as Et,u as Tt,v as et}from"./NetworkOverview-711050f3.js";import{i as It}from"./is_dark-ba77f0b9.js";import"./index-9c528324.js";import"./unknownify-db48ebae.js";var X=function(){var n=function(k,r,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=r);return a},t=[1,2],e=[1,5],s=[6,9,11,17,18,20,22,23,26,27,28],i=[1,15],o=[1,16],l=[1,17],p=[1,18],g=[1,19],d=[1,23],f=[1,24],v=[1,27],_=[4,6,9,11,17,18,20,22,23,26,27,28],b={trace:function(){},yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,period_statement:24,event_statement:25,period:26,event:27,open_directive:28,type_directive:29,arg_directive:30,close_directive:31,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",26:"period",27:"event",28:"open_directive",29:"type_directive",30:"arg_directive",31:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[24,1],[25,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(r,a,h,u,y,c,M){var x=c.length-1;switch(y){case 1:return c[x-1];case 3:this.$=[];break;case 4:c[x-1].push(c[x]),this.$=c[x-1];break;case 5:case 6:this.$=c[x];break;case 7:case 8:this.$=[];break;case 11:u.getCommonDb().setDiagramTitle(c[x].substr(6)),this.$=c[x].substr(6);break;case 12:this.$=c[x].trim(),u.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=c[x].trim(),u.getCommonDb().setAccDescription(this.$);break;case 15:u.addSection(c[x].substr(8)),this.$=c[x].substr(8);break;case 19:u.addTask(c[x],0,""),this.$=c[x];break;case 20:u.addEvent(c[x].substr(2)),this.$=c[x];break;case 21:u.parseDirective("%%{","open_directive");break;case 22:u.parseDirective(c[x],"type_directive");break;case 23:c[x]=c[x].trim().replace(/'/g,'"'),u.parseDirective(c[x],"arg_directive");break;case 24:u.parseDirective("}%%","close_directive","timeline");break}},table:[{3:1,4:t,7:3,12:4,28:e},{1:[3]},n(s,[2,3],{5:6}),{3:7,4:t,7:3,12:4,28:e},{13:8,29:[1,9]},{29:[2,21]},{6:[1,10],7:22,8:11,9:[1,12],10:13,11:[1,14],12:4,17:i,18:o,20:l,22:p,23:g,24:20,25:21,26:d,27:f,28:e},{1:[2,2]},{14:25,15:[1,26],31:v},n([15,31],[2,22]),n(s,[2,8],{1:[2,1]}),n(s,[2,4]),{7:22,10:28,12:4,17:i,18:o,20:l,22:p,23:g,24:20,25:21,26:d,27:f,28:e},n(s,[2,6]),n(s,[2,7]),n(s,[2,11]),{19:[1,29]},{21:[1,30]},n(s,[2,14]),n(s,[2,15]),n(s,[2,16]),n(s,[2,17]),n(s,[2,18]),n(s,[2,19]),n(s,[2,20]),{11:[1,31]},{16:32,30:[1,33]},{11:[2,24]},n(s,[2,5]),n(s,[2,12]),n(s,[2,13]),n(_,[2,9]),{14:34,31:v},{31:[2,23]},{11:[1,35]},n(_,[2,10])],defaultActions:{5:[2,21],7:[2,2],27:[2,24],33:[2,23]},parseError:function(r,a){if(a.recoverable)this.trace(r);else{var h=new Error(r);throw h.hash=a,h}},parse:function(r){var a=this,h=[0],u=[],y=[null],c=[],M=this.table,x="",N=0,S=0,L=2,V=1,H=c.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(C.yy[O]=this.yy[O]);m.setInput(r,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var J=m.yylloc;c.push(J);var _t=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function bt(){var P;return P=u.pop()||m.lex()||V,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=a.symbols_[P]||P),P}for(var T,z,$,K,W={},j,A,tt,G;;){if(z=h[h.length-1],this.defaultActions[z]?$=this.defaultActions[z]:((T===null||typeof T>"u")&&(T=bt()),$=M[z]&&M[z][T]),typeof $>"u"||!$.length||!$[0]){var Q="";G=[];for(j in M[z])this.terminals_[j]&&j>L&&G.push("'"+this.terminals_[j]+"'");m.showPosition?Q="Parse error on line "+(N+1)+`:
1
+ import{o as kt,q as vt,r as wt,g as rt,l as I,s as q,a as St,t as Et,u as Tt,v as et}from"./NetworkOverview-cd06e59f.js";import{i as It}from"./is_dark-735e3a95.js";import"./index-1c4c68c3.js";import"./unknownify-0b176a78.js";var X=function(){var n=function(k,r,a,h){for(a=a||{},h=k.length;h--;a[k[h]]=r);return a},t=[1,2],e=[1,5],s=[6,9,11,17,18,20,22,23,26,27,28],i=[1,15],o=[1,16],l=[1,17],p=[1,18],g=[1,19],d=[1,23],f=[1,24],v=[1,27],_=[4,6,9,11,17,18,20,22,23,26,27,28],b={trace:function(){},yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,acc_title:18,acc_title_value:19,acc_descr:20,acc_descr_value:21,acc_descr_multiline_value:22,section:23,period_statement:24,event_statement:25,period:26,event:27,open_directive:28,type_directive:29,arg_directive:30,close_directive:31,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",26:"period",27:"event",28:"open_directive",29:"type_directive",30:"arg_directive",31:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[24,1],[25,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(r,a,h,u,y,c,M){var x=c.length-1;switch(y){case 1:return c[x-1];case 3:this.$=[];break;case 4:c[x-1].push(c[x]),this.$=c[x-1];break;case 5:case 6:this.$=c[x];break;case 7:case 8:this.$=[];break;case 11:u.getCommonDb().setDiagramTitle(c[x].substr(6)),this.$=c[x].substr(6);break;case 12:this.$=c[x].trim(),u.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=c[x].trim(),u.getCommonDb().setAccDescription(this.$);break;case 15:u.addSection(c[x].substr(8)),this.$=c[x].substr(8);break;case 19:u.addTask(c[x],0,""),this.$=c[x];break;case 20:u.addEvent(c[x].substr(2)),this.$=c[x];break;case 21:u.parseDirective("%%{","open_directive");break;case 22:u.parseDirective(c[x],"type_directive");break;case 23:c[x]=c[x].trim().replace(/'/g,'"'),u.parseDirective(c[x],"arg_directive");break;case 24:u.parseDirective("}%%","close_directive","timeline");break}},table:[{3:1,4:t,7:3,12:4,28:e},{1:[3]},n(s,[2,3],{5:6}),{3:7,4:t,7:3,12:4,28:e},{13:8,29:[1,9]},{29:[2,21]},{6:[1,10],7:22,8:11,9:[1,12],10:13,11:[1,14],12:4,17:i,18:o,20:l,22:p,23:g,24:20,25:21,26:d,27:f,28:e},{1:[2,2]},{14:25,15:[1,26],31:v},n([15,31],[2,22]),n(s,[2,8],{1:[2,1]}),n(s,[2,4]),{7:22,10:28,12:4,17:i,18:o,20:l,22:p,23:g,24:20,25:21,26:d,27:f,28:e},n(s,[2,6]),n(s,[2,7]),n(s,[2,11]),{19:[1,29]},{21:[1,30]},n(s,[2,14]),n(s,[2,15]),n(s,[2,16]),n(s,[2,17]),n(s,[2,18]),n(s,[2,19]),n(s,[2,20]),{11:[1,31]},{16:32,30:[1,33]},{11:[2,24]},n(s,[2,5]),n(s,[2,12]),n(s,[2,13]),n(_,[2,9]),{14:34,31:v},{31:[2,23]},{11:[1,35]},n(_,[2,10])],defaultActions:{5:[2,21],7:[2,2],27:[2,24],33:[2,23]},parseError:function(r,a){if(a.recoverable)this.trace(r);else{var h=new Error(r);throw h.hash=a,h}},parse:function(r){var a=this,h=[0],u=[],y=[null],c=[],M=this.table,x="",N=0,S=0,L=2,V=1,H=c.slice.call(arguments,1),m=Object.create(this.lexer),C={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(C.yy[O]=this.yy[O]);m.setInput(r,C.yy),C.yy.lexer=m,C.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var J=m.yylloc;c.push(J);var _t=m.options&&m.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function bt(){var P;return P=u.pop()||m.lex()||V,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=a.symbols_[P]||P),P}for(var T,z,$,K,W={},j,A,tt,G;;){if(z=h[h.length-1],this.defaultActions[z]?$=this.defaultActions[z]:((T===null||typeof T>"u")&&(T=bt()),$=M[z]&&M[z][T]),typeof $>"u"||!$.length||!$[0]){var Q="";G=[];for(j in M[z])this.terminals_[j]&&j>L&&G.push("'"+this.terminals_[j]+"'");m.showPosition?Q="Parse error on line "+(N+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+G.join(", ")+", got '"+(this.terminals_[T]||T)+"'":Q="Parse error on line "+(N+1)+": Unexpected "+(T==V?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[T]||T,line:m.yylineno,loc:J,expected:G})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+T);switch($[0]){case 1:h.push(T),y.push(m.yytext),c.push(m.yylloc),h.push($[1]),T=null,S=m.yyleng,x=m.yytext,N=m.yylineno,J=m.yylloc;break;case 2:if(A=this.productions_[$[1]][1],W.$=y[y.length-A],W._$={first_line:c[c.length-(A||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(A||1)].first_column,last_column:c[c.length-1].last_column},_t&&(W._$.range=[c[c.length-(A||1)].range[0],c[c.length-1].range[1]]),K=this.performAction.apply(W,[x,S,N,C.yy,$[1],y,c].concat(H)),typeof K<"u")return K;A&&(h=h.slice(0,-1*A*2),y=y.slice(0,-1*A),c=c.slice(0,-1*A)),h.push(this.productions_[$[1]][0]),y.push(W.$),c.push(W._$),tt=M[h[h.length-2]][h[h.length-1]],h.push(tt);break;case 3:return!0}}return!0}},w=function(){var k={EOF:1,parseError:function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},setInput:function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var a=r.length,h=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===u.length?this.yylloc.first_column:0)+u[u.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{aM as r,aN as a,r as o,aO as c}from"./index-9c528324.js";const u=(e={})=>{const{data:t,error:n,mutate:s}=r(a("api/admin/metrics/rps"),i,e);return o.useMemo(()=>({metrics:t,loading:!n&&!t,refetch:()=>s(),error:n}),[t,n,s])},i=e=>fetch(e).then(c("Instance Metrics")).then(t=>t.json()),f=e=>!e||e==="undefined"?"unknown":e;export{f as a,u};
1
+ import{aM as r,aN as a,r as o,aO as c}from"./index-1c4c68c3.js";const u=(e={})=>{const{data:t,error:n,mutate:s}=r(a("api/admin/metrics/rps"),i,e);return o.useMemo(()=>({metrics:t,loading:!n&&!t,refetch:()=>s(),error:n}),[t,n,s])},i=e=>fetch(e).then(c("Instance Metrics")).then(t=>t.json()),f=e=>!e||e==="undefined"?"unknown":e;export{f as a,u};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unleash-server",
3
3
  "description": "Unleash is an enterprise ready feature toggles service. It provides different strategies for handling feature toggles.",
4
- "version": "5.3.0",
4
+ "version": "5.3.2",
5
5
  "keywords": [
6
6
  "unleash",
7
7
  "feature toggle",
@@ -1,10 +0,0 @@
1
- import{c as ie,j as r,b as ce,aD as W,aV as X,d as C,b6 as Y,C as U,E as we,T as $,c3 as Ae,s as V,fy as xe,bc as Re,fz as Z,au as J,X as ee,fA as ke,fB as Fe,fC as De,fD as Pe,bs as G,fE as Oe,i as $e,fF as Be,fG as N,cd as le,r as w,aw as ue,f as z,fH as de,ag as ge,fI as he,ax as fe,aW as pe,bm as qe,fJ as Le,h as B,dg as _e,aX as Ue,aU as me,aE as Q,aZ as ye,fK as Ve,fL as je,fM as Ie,fN as ze,fO as We,fP as Ye,a_ as be,b7 as He,fQ as Me,y as K,aI as ne,B as Ge,ae as Je,bN as te,fR as Ke,ef as Ne,fS as Qe,fT as Xe,fU as Ze,b9 as et,ba as tt,bb as at,A as Se,l as ve,bQ as st,m as nt,o as rt,L as ot,fV as it,n as ct,u as lt,bL as ut,aP as dt,aN as gt,aO as ht}from"./index-9c528324.js";const ft=ie(r("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud"),zt=ie(r("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z"}),"WatchLater"),Wt=({enabled:e,className:s})=>{const t=ce(),i=e?"Environment enabled":"Environment disabled",a={backgroundColor:e?t.palette.primary.light:t.palette.neutral.border,borderRadius:"50%",width:"28px",height:"28px",minWidth:"28px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:t.spacing(1)},n={fill:t.palette.common.white,width:"16px",height:"16px"};return r("div",{style:a,className:s,children:r(ft,{style:n,titleAccess:i})})},pt=({isOpen:e,onConfirm:s,onClose:t,showBanner:i,environment:a,messageComponent:n})=>{const o=W("projectId"),{data:u}=X(o),{changeRequestInReviewOrApproved:f,alert:g}=Ae(u),l=f(a||"");return C(Y,{open:e,primaryButtonText:l?"Add to existing change request":"Add suggestion to draft",secondaryButtonText:"Cancel",onClick:s,onClose:t,title:"Request changes",fullWidth:!0,children:[r(U,{condition:l,show:g}),r(U,{condition:!!i,show:C(we,{severity:"info",sx:{mb:2},children:["Change requests feature is enabled for ",a,". Your changes need to be approved before they will be live. All the changes you do now will be added into a draft that you can submit for review."]})}),r($,{variant:"body2",color:"text.secondary",children:"Your suggestion:"}),n]})},mt=(e,s)=>{const t={};return s.parameters.forEach(i=>{t[i.name]=yt(e,i)}),{name:s.name,constraints:[],parameters:t}},yt=(e,s)=>s.name==="rollout"||s.name==="percentage"||s.type==="percentage"?"50":s.name==="stickiness"?"":s.name==="groupId"?e:s.type==="boolean"?"false":"",bt=V("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),re=V("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),St=V("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),vt=({projectId:e,environmentId:s,permission:t,onSubmit:i,onCancel:a,loading:n,strategy:o,setStrategy:u,segments:f,setSegments:g,errors:l})=>{const S=xe(o.constraints),c=Re(t,e,s),{strategyDefinition:d}=Z(o==null?void 0:o.name),m=J(),{uiConfig:h,error:v,loading:x}=ee();if(v)throw v;if(x||!d)return null;const D=p=>d.parameters.find(E=>E.name===p),A=(p,E)=>{const F=D(p);if(p!=="groupId"){const T=Be(F,E);return T?(l.setFormError(p,T),!1):(l.removeFormError(p),!0)}return!0},y=()=>d.parameters.map(p=>p.name).map(p=>{var E;return A(p,(E=o.parameters)==null?void 0:E[p])}).every(Boolean),q=()=>{m(`/projects/${e}/settings/default-strategy`)};return C(bt,{onSubmit:async p=>{if(p.preventDefault(),y())i();else return},children:[r(ke,{title:o.title||"",setTitle:p=>{u(E=>({...E,title:p}))}}),r(U,{condition:!!h.flags.SE,show:r(Fe,{segments:f,setSegments:g,projectId:e})}),r(De,{projectId:e,environmentId:s,strategy:o,setStrategy:u}),r(re,{}),r(Pe,{strategy:o,strategyDefinition:d,setStrategy:u,validateParameter:A,errors:l,hasAccess:c}),r(re,{}),C(St,{children:[r(G,{permission:t,projectId:e,environmentId:s,variant:"contained",color:"primary",type:"submit",disabled:n||!S||l.hasFormErrors(),"data-testid":Oe,children:"Save strategy"}),r($e,{type:"button",color:"primary",onClick:a||q,disabled:n,children:"Cancel"})]})]})},Te={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:"default",groupId:""}},Yt=()=>{var F;const e=W("projectId"),s=N("environmentId"),{project:t,refetch:i}=le(e),a=(F=t.environments.find(T=>T.environment===s))==null?void 0:F.defaultStrategy,[n,o]=w.useState(a||Te),[u,f]=w.useState([]),{updateDefaultStrategy:g,loading:l}=ue(),{strategyDefinition:S}=Z(n==null?void 0:n.name),{setToastData:c,setToastApiError:d}=z(),m=de(),{uiConfig:h}=ee(),{unleashUrl:v}=h,x=J(),{trackEvent:D}=ge(),{segments:A,refetchSegments:y}=he();w.useEffect(()=>{if(A&&(a!=null&&a.segments)){const T=[];for(const P of a==null?void 0:a.segments)T.push(...A.filter(j=>j.id===P));f(T)}},[JSON.stringify(A),JSON.stringify(a==null?void 0:a.segments)]);const q=h!=null&&h.flags.SE?u:[],k=Tt(n,q),p=async T=>{await g(e,s,T),D("default_strategy",{props:{action:"edit",hasTitle:!!T.title}}),await y(),c({title:"Default Strategy updated",type:"success",confetti:!0})},E=async()=>{const T=`/projects/${e}/settings/default-strategy`;try{await p(k),await i(),x(T)}catch(P){d(B(P))}};return!S||!n?null:r(fe,{modal:!0,title:pe((n==null?void 0:n.name)??""),description:Et,documentationLink:wt,documentationLinkLabel:At,formatApiCode:()=>Ct(e,s,k,S,v),children:r(vt,{projectId:e,strategy:n,setStrategy:o,segments:u,setSegments:f,environmentId:s,onSubmit:E,loading:l,permission:qe,errors:m,isChangeRequest:!1})})},Tt=(e,s)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},segments:s.map(t=>t.id),disabled:e.disabled??!1}),Ct=(e,s,t,i,a)=>{if(!a)return"";const n={...t,parameters:Le(t.parameters??{},i)},o=`${a}/api/admin/projects/${e}/environments/${s}/default-strategy}`,u=JSON.stringify(n,void 0,2);return`curl --location --request PUT '${o}' \\
2
- --header 'Authorization: INSERT_API_KEY' \\
3
- --header 'Content-Type: application/json' \\
4
- --data-raw '${u}'`},Et=`
5
- An activation strategy will only run when a feature toggle is enabled and provides a way to control who will get access to the feature.
6
- If any of a feature toggle's activation strategies returns true, the user will get access.
7
- `,wt="https://docs.getunleash.io/reference/activation-strategies",At="Default strategy documentation",Ht=()=>{var se;const e=W("projectId"),s=W("featureId"),t=N("environmentId"),i=N("strategyName"),a=JSON.parse(_e().get("defaultStrategy")||"false"),{project:n}=le(e),o=(se=n.environments.find(R=>R.environment===t))==null?void 0:se.defaultStrategy,{segments:u}=he(),f=(u||[]).filter(R=>{var _;return(_=o==null?void 0:o.segments)==null?void 0:_.includes(R.id)}),[g,l]=w.useState({}),[S,c]=w.useState(a?f:[]),{strategyDefinition:d}=Z(i),m=de(),{addStrategyToFeature:h,loading:v}=Ue(),{addChange:x}=me(),{setToastData:D,setToastApiError:A}=z(),{uiConfig:y}=ee(),{unleashUrl:q}=y,k=J(),{feature:p,refetchFeature:E}=Q(e,s),F=w.useRef(p),{isChangeRequestConfigured:T}=ye(e),{refetch:P}=X(e),{trackEvent:j}=ge(),{data:I,staleDataNotification:b,forceRefreshCache:O}=Ve({unleashGetter:Q,params:[e,s],dataKey:"feature",refetchFunctionKey:"refetchFeature",options:{}},p,{afterSubmitAction:E},Me);w.useEffect(()=>{F.current.name===""&&p.name&&(O(p),F.current=p)},[p.name]),w.useEffect(()=>{var R;if(a){const _=o||Te;((R=_.parameters)==null?void 0:R.groupId)===""&&s?l({..._,parameters:{..._.parameters,groupId:s}}):l(_)}else d&&l(mt(s,d))},[s,JSON.stringify(d),a]);const H=async R=>{await h(e,s,t,R),D({title:"Strategy created",type:"success",confetti:!0})},M=async R=>{await x(e,t,{action:"addStrategy",feature:s,payload:R}),D({title:"Strategy added to draft",type:"success",confetti:!0}),P()},L=je(g,S),Ee=async()=>{j("strategyTitle",{props:{hasTitle:!!g.title,on:"create"}});try{T(t)?await M(L):await H(L),E(),k(He(e,s))}catch(R){A(B(R))}};return!I||!I.project?null:C(fe,{modal:!0,title:pe(i),description:Ie,documentationLink:ze,documentationLinkLabel:We,formatApiCode:()=>Rt(e,s,t,L,q),children:[r(Ye,{projectId:e,feature:I,strategy:g,setStrategy:l,segments:S,setSegments:c,environmentId:t,onSubmit:Ee,loading:v,permission:be,errors:m,isChangeRequest:T(t)}),b]})},xt=(e,s,t,i,a=!1)=>{const n=new URLSearchParams({environmentId:t,strategyName:i,defaultStrategy:String(a)});return`/projects/${e}/features/${s}/strategies/create?${n}`},Rt=(e,s,t,i,a)=>{if(!a)return"";const n=`${a}/api/admin/projects/${e}/features/${s}/environments/${t}/strategies`,o=JSON.stringify(i,void 0,2);return`curl --location --request POST '${n}' \\
8
- --header 'Authorization: INSERT_API_KEY' \\
9
- --header 'Content-Type: application/json' \\
10
- --data-raw '${o}'`},oe=V("p")(({theme:e})=>({marginBottom:e.spacing(.5),fontSize:e.fontSizes.bodySize})),Mt=({open:e,environmentName:s,featureId:t,projectId:i,onClose:a})=>{const n=J(),o=xt(i,t,s,"default");return C(Y,{open:e,maxWidth:"sm",onClose:()=>a(),title:"You need to add a strategy to your toggle",primaryButtonText:"Take me directly to add strategy",permissionButton:r(G,{type:"button",permission:be,projectId:i,environmentId:s,onClick:()=>{a(),n(o)},children:"Take me directly to add strategy"}),secondaryButtonText:"Cancel",children:[r(oe,{children:"Before you can enable the toggle in the environment, you need to add an activation strategy."}),r(oe,{children:"You can add the activation strategy by selecting the toggle, open the environment accordion and add the activation strategy."})]})},kt="You can not enable the environment before it has strategies",Ft=e=>{const{setToastData:s,setToastApiError:t}=z(),{addChange:i}=me(),{refetch:a}=X(e),[n,o]=w.useState({isOpen:!1}),u=w.useCallback((l,S,c,d)=>{o({featureName:l,environment:S,enabled:c,shouldActivateDisabledStrategies:d,isOpen:!0})},[]),f=w.useCallback(()=>{o(l=>({...l,isOpen:!1}))},[]),g=w.useCallback(async()=>{try{await i(e,n.environment,{feature:n.featureName,action:"updateEnabled",payload:{enabled:!!n.enabled,shouldActivateDisabledStrategies:!!n.shouldActivateDisabledStrategies}}),a(),o(l=>({...l,isOpen:!1})),s({type:"success",title:"Changes added to the draft!"})}catch(l){t(B(l)),o(S=>({...S,isOpen:!1}))}},[i]);return{onChangeRequestToggle:u,onChangeRequestToggleClose:f,onChangeRequestToggleConfirm:g,changeRequestDialogDetails:n}},Dt=({isOpen:e,onAddDefaultStrategy:s,onActivateDisabledStrategies:t,onClose:i,environment:a,disabledStrategiesCount:n=0})=>{const o=W("projectId");return C(Y,{open:e,secondaryButtonText:"Cancel",permissionButton:C(K,{children:[r(G,{type:"button",permission:ne,projectId:o,environmentId:a,onClick:s,children:"Add default strategy"}),r(G,{type:"button",variant:"text",permission:ne,projectId:o,environmentId:a,onClick:t,children:"Enable all strategies"})]}),onClose:i,title:"Enable feature toggle",fullWidth:!0,children:[C($,{variant:"body1",color:"text.primary",sx:{mb:u=>u.spacing(2)},children:["The feature toggle has ",n," disabled",n===1?" strategy":" strategies","."]}),r($,{variant:"body1",color:"text.primary",children:"You can choose to enable all the disabled strategies or you can add the default strategy to enable this feature toggle."})]})},Pt=({enabled:e,featureName:s,environment:t})=>C($,{"data-testid":"update-enabled-message",children:[r("strong",{children:e?"Enable":"Disable"})," feature toggle"," ",r("strong",{children:s})," in ",r("strong",{children:t})]}),Ot=V(Ge)(()=>({mx:"auto",...Je})),Gt=({projectId:e,featureId:s,environmentName:t,value:i,onToggle:a,onError:n})=>{var I;const{toggleFeatureEnvironmentOn:o,toggleFeatureEnvironmentOff:u}=te(),{setToastData:f,setToastApiError:g}=z(),{isChangeRequestConfigured:l}=ye(e),{onChangeRequestToggle:S,onChangeRequestToggleClose:c,onChangeRequestToggleConfirm:d,changeRequestDialogDetails:m}=Ft(e),[h,v,x]=Ke(i),[D,A]=w.useState(!1),{feature:y}=Q(e,s),q=((I=y==null?void 0:y.environments.find(b=>b.name===t))==null?void 0:I.strategies.filter(b=>b.disabled).length)??0,k=async(b=!1)=>{try{v(!h),await o(e,y.name,t,b),f({type:"success",title:`Available in ${t}`,text:`${y.name} is now available in ${t} based on its defined strategies.`}),a==null||a(e,y.name,t,!h)}catch(O){O instanceof Error&&O.message===kt?n==null||n():g(B(O)),x()}},p=async()=>{try{v(!h),await u(e,y.name,t),f({type:"success",title:`Unavailable in ${t}`,text:`${y.name} is unavailable in ${t} and its strategies will no longer have any effect.`}),a==null||a(e,y.name,t,!h)}catch(b){g(B(b)),x()}},E=async b=>{if(l(t)){b.preventDefault(),P()?A(!0):S(y.name,t,!h,!1);return}if(h){await p();return}P()?A(!0):await k()},F=async()=>{l(t)?S(y.name,t,!h,!0):await k(!0),A(!1)},T=async()=>{l(t)?S(y.name,t,!h,!1):await k(),A(!1)},P=()=>{var O,H,M;const b=(O=y==null?void 0:y.environments)==null?void 0:O.find(L=>L.name===t);return(b==null?void 0:b.strategies)&&((H=b==null?void 0:b.strategies)==null?void 0:H.length)>0&&((M=b==null?void 0:b.strategies)==null?void 0:M.every(L=>L.disabled))},j=`${y.name}-${t}`;return C(K,{children:[r(Ot,{"data-testid":`TOGGLE-${j}`,children:r(Ne,{tooltip:h?`Disable feature in ${t}`:`Enable feature in ${t}`,checked:h,environmentId:t,projectId:e,permission:Qe,inputProps:{"aria-label":t},onClick:E})},j),r(Dt,{isOpen:D,onClose:()=>A(!1),environment:t,disabledStrategiesCount:q,onActivateDisabledStrategies:F,onAddDefaultStrategy:T}),r(pt,{isOpen:m.isOpen,onClose:c,environment:m==null?void 0:m.environment,onConfirm:d,messageComponent:r(Pt,{enabled:m==null?void 0:m.enabled,featureName:m==null?void 0:m.featureName,environment:m.environment})})]})},$t=V(Xe)(({theme:e})=>({color:e.palette.warning.main,fontSize:e.fontSizes.bodySize})),Jt=()=>r(Ze,{arrow:!0,title:C(K,{children:["This environment has no variants enabled. If you check this feature's variants in this environment, you will get the"," ",r("a",{href:"https://docs.getunleash.io/reference/feature-toggle-variants#the-disabled-variant",target:"_blank",rel:"noreferrer",children:"disabled variant"}),"."]}),children:r($t,{})});var ae={},Bt=tt;Object.defineProperty(ae,"__esModule",{value:!0});var Ce=ae.default=void 0,qt=Bt(et()),Lt=at,_t=(0,qt.default)((0,Lt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");Ce=ae.default=_t;const Ut=it(),Kt=({options:e,selectedOptions:s,indeterminateOptions:t,tagType:i,existingTags:a,disabled:n=!1,onChange:o})=>{const u=r(ct,{fontSize:"small"});return r(Se,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:c=>c.spacing(2),width:500},disableCloseOnSelect:!0,placeholder:"Select Values",options:e,value:s,renderTags:(c,d)=>c.map((m,h)=>a.some(x=>x.value===m.title&&x.type===i.name)&&t===void 0?null:r(ot,{...d({index:h}),label:m.title})),isOptionEqualToValue:(c,d)=>d.inputValue&&d.inputValue!==""?c.title===d.inputValue:c.title===d.title,getOptionLabel:c=>c.inputValue?c.inputValue:c.title,renderOption:(c,d,{selected:m})=>{const h=(t==null?void 0:t.some(v=>v.title===d.title))??!1;return C("li",{...c,children:[r(U,{condition:!!d.inputValue,show:r(st,{sx:{mr:v=>v.spacing(.5)}}),elseShow:r(nt,{icon:u,checkedIcon:r(rt,{fontSize:"small"}),indeterminateIcon:r(Ce,{fontSize:"small"}),sx:{mr:v=>v.spacing(.5)},checked:m&&!h,indeterminate:h})}),d.title]})},filterOptions:(c,d)=>{const m=Ut(c,d),{inputValue:h}=d,v=c.some(x=>h===x.title);return h!==""&&!v&&m.push({inputValue:h,title:`Create new value "${h}"`}),m},ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:o,renderInput:c=>r(ve,{...c,label:"Select values",placeholder:"Select values"}),disabled:n})},Vt=V("li")({flexDirection:"column"}),Nt=({options:e,value:s,disabled:t=!1,onChange:i})=>{const a=ce();return r(Se,{disablePortal:!0,disabled:t,id:"tag-type-select",sx:{marginTop:n=>n.spacing(2),width:500},options:e,disableClearable:!0,value:s,getOptionLabel:n=>n.name,renderOption:(n,o)=>C(Vt,{...n,style:{alignItems:"flex-start",gap:a.spacing(.5)},children:[r($,{variant:"body1",children:o.name}),r($,{variant:"caption",children:o.description})]}),renderInput:n=>r(ve,{...n,label:"Tag type",value:s}),onChange:i,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},Qt=()=>{const{makeRequest:e,createRequest:s,errors:t,loading:i}=lt({propagateErrors:!0});return{createTag:async o=>{const f=s("api/admin/tags",{method:"POST",body:JSON.stringify(o)});try{return await e(f.caller,f.id)}catch(g){throw g}},bulkUpdateTags:async(o,u)=>{const f=`api/admin/projects/${u}/tags`,g=s(f,{method:"PUT",body:JSON.stringify(o)});try{return await e(g.caller,g.id)}catch(l){throw l}},errors:t,loading:i}},Xt=(e,s={})=>{const t=async()=>{const g=gt(`api/admin/tags/${e}`);return(await fetch(g,{method:"GET"}).then(ht("Tags"))).json()},i=`api/admin/tags/${e}`,{data:a,error:n}=ut(!!e,{tags:[]},i,t,s),[o,u]=w.useState(!n&&!a),f=()=>{dt(i)};return w.useEffect(()=>{u(!n&&!a)},[a,n]),{tags:(a==null?void 0:a.tags)||[],error:n,loading:o,refetch:f}},Zt=({isStale:e,isOpen:s,projectId:t,featureId:i,onClose:a})=>{const{setToastData:n,setToastApiError:o}=z(),{patchFeatureToggle:u}=te(),f=r($,{children:"Setting a toggle to stale marks it for cleanup"}),g=r($,{children:"Setting a toggle to active marks it as in active use"}),l=e?"active":"stale",S=async c=>{c.stopPropagation();try{await u(t,i,[{op:"replace",path:"/stale",value:!e}]),a()}catch(d){o(B(d))}n(e?{type:"success",title:"And we're back!",text:"The toggle is no longer marked as stale."}:{type:"success",title:"A job well done.",text:"The toggle has been marked as stale."})};return r(Y,{open:s,secondaryButtonText:"Cancel",primaryButtonText:`Flip to ${l}`,title:`Set feature state to ${l}`,onClick:S,onClose:a,children:r(U,{condition:e,show:g,elseShow:f})})},ea=({isOpen:e,onClose:s,onConfirm:t,projectId:i,featureIds:a})=>{const{archiveFeatureToggle:n}=te(),{archiveFeatures:o}=ue(),{setToastData:u,setToastApiError:f}=z(),g=(a==null?void 0:a.length)>1;return r(Y,{onClick:g?async()=>{try{await o(i,a),u({text:"Selected feature toggles have been archived",type:"success",title:"Feature toggles archived"}),t(),s()}catch(c){f(B(c)),s()}}:async()=>{try{await n(i,a[0]),u({text:"Your feature toggle has been archived",type:"success",title:"Feature archived"}),t(),s()}catch(c){f(B(c)),s()}},open:e,onClose:s,primaryButtonText:g?"Archive toggles":"Archive toggle",secondaryButtonText:"Cancel",title:g?"Archive feature toggles":"Archive feature toggle",children:r(U,{condition:g,show:C(K,{children:[C("p",{children:["Are you sure you want to archive"," ",r("strong",{children:a==null?void 0:a.length})," feature toggles?"]}),r(U,{condition:(a==null?void 0:a.length)<=5,show:r("ul",{children:a==null?void 0:a.map(c=>r("li",{children:c},c))})})]}),elseShow:r("p",{children:"Are you sure you want to archive these feature toggles?"})})})};export{pt as C,Wt as E,Gt as F,Nt as T,Pt as U,Jt as V,zt as W,Mt as a,Xt as b,Kt as c,Ht as d,ea as e,xt as f,Zt as g,Ft as h,Yt as i,Qt as u};